Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jdt.core.tests.compiler/src/org/eclipse')
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/Activator.java6
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AbstractSyntaxTreeTest.java174
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationCompletionParserTest.java2
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationDietRecoveryTest.java50
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest.java290
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest18.java1338
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest2.java16
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionRecoveryTest.java68
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java994
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DietRecoveryTest.java700
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/FieldAccessCompletionTest.java2
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsCompletionParserTest.java70
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsSelectionTest.java50
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java2
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/LambdaExpressionSyntaxTest.java602
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ModuleDeclarationSyntaxTest.java114
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/NameReferenceCompletionTest.java2
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest.java134
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest1_7.java1044
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ReferenceExpressionSyntaxTest.java852
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ReferenceTypeCompletionTest.java2
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest10.java32
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest12.java512
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest13.java880
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest18.java214
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionTest.java30
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceElementParserTest.java118
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest.java58
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest_1_5.java50
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TypeAnnotationSyntaxTest.java1898
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractBatchCompilerTest.java2
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractComparableTest.java36
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractNullAnnotationTest.java8
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java32
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest9.java6
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java2144
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java2360
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest_9.java46
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ArrayTest.java134
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssertionTest.java232
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest.java930
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest_1_5.java224
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest_1_7.java20
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AutoBoxingTest.java1052
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java2098
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest2.java178
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BinaryLiteralTest.java50
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BootstrapMethodAttributeTest.java22
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java1060
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_5.java166
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_8.java84
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClasspathJmodTests.java106
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java10
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java128
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_4.java202
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java274
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_6.java28
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_7.java94
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConcurrentBatchCompilerTest.java128
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConditionalExpressionTest.java138
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConstantTest.java300
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DebugAttributeTest.java176
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DefaultJavaRuntimeEnvironment.java4
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated15Test.java38
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated18Test.java12
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java614
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java66
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnclosingMethodAttributeTest.java2
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java1368
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExpressionContextTests.java370
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExternalizeStringLiterals15Test.java58
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FieldAccessTest.java114
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java2102
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest8.java370
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ForStatementTest.java2740
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ForeachStatementTest.java482
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeSignatureTest.java14
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java12140
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java5512
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_7.java2024
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java11524
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_9.java620
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GrammarCoverageTests308.java1680
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InMemoryNameEnvironment9.java6
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InitializationTests.java180
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerClass15Test.java608
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java1066
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest_1_5.java162
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InterfaceMethodsTest.java1782
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InterfaceMethodsTest_9.java222
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP181NestTest.java96
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286ReservedWordTest.java16
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286Test.java944
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP323VarLambdaParamsTest.java86
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR308SpecSnippetTests.java2850
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR335ClassFileTest.java4720
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java1366
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest.java88
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForClass.java154
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForConstructor.java2
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForField.java14
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForInterface.java2
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForMethod.java30
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForRecord.java2
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java972
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java940
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java346
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Jsr14Test.java48
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java3144
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaRegressionTest.java1002
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaShapeTests.java2734
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LineNumberAttributeTest.java70
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LocalVariableTest.java80
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java710
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodHandleTest.java432
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodParametersAttributeTest.java1120
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java5438
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleAttributeTests.java4
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java1950
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MultiReleaseJarTests.java76
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java6924
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeTypeAnnotationTest.java3644
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NonFatalErrorTest.java170
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationBatchCompilerTest.java108
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java5662
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTests9.java202
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullChecksTests.java20
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java6086
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTestAsserts.java670
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java13160
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/OverloadResolutionTest8.java650
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PatternMatching14Test.java1164
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PolymorphicSignatureTest.java44
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProblemConstructorTest.java92
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java4696
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProgrammingProblemsTest.java1382
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RecordsRestrictedClassTest.java732
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RepeatableAnnotationTest.java624
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java3344
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ScannerTest.java168
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SerialVersionUIDTests.java60
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SerializableLambdaTest.java1224
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java10122
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StaticImportTest.java710
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SuperTypeTest.java210
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionTest.java2658
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionsYieldTest.java2488
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java2170
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java10
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TextBlockTest.java986
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatement17Test.java1050
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatement9Test.java152
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatementTest.java434
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryWithResourcesStatementTest.java2060
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TypeAnnotationTest.java7230
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UnderscoresInLiteralsTest.java220
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode10Test.java4
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode11Test.java18
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode12_1Test.java18
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode18Test.java78
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode9Test.java4
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UnnamedModuleTest.java2
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java610
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/XLargeTest.java17212
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/XLargeTest2.java416
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/dom/StandAloneASTParserTest.java174
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/DebugEvaluationTest.java12
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/EvaluationSetup.java4
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/JDIStackFrame.java6
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SimpleTest.java6
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/TestCase.java4
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/LocalVMLauncher.java2
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/StandardVMLauncher.java2
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java8
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/TestVerifier.java470
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java10
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/ZipEntryStorageException.java2
177 files changed, 99238 insertions, 99238 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/Activator.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/Activator.java
index 19fd680b9..45729f46e 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/Activator.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/Activator.java
@@ -21,7 +21,7 @@ import org.osgi.framework.ServiceReference;
/**
* Make the PackageAdmin service accessible to tests.
- *
+ *
* @deprecated uses deprecated class PackageAdmin.
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -33,7 +33,7 @@ public class Activator extends Plugin {
public void start(BundleContext context) throws Exception {
-
+
ServiceReference ref= context.getServiceReference(org.osgi.service.packageadmin.PackageAdmin.class.getName());
if (ref!=null)
packageAdmin = (org.osgi.service.packageadmin.PackageAdmin)context.getService(ref);
@@ -48,5 +48,5 @@ public class Activator extends Plugin {
public static org.osgi.service.packageadmin.PackageAdmin getPackageAdmin() {
return packageAdmin;
}
-
+
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AbstractSyntaxTreeTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AbstractSyntaxTreeTest.java
index 1ea8201f8..c70decd56 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AbstractSyntaxTreeTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AbstractSyntaxTreeTest.java
@@ -62,7 +62,7 @@ public class AbstractSyntaxTreeTest extends AbstractCompilerTest implements IDoc
CHECK_DOCUMENT_ELEMENT_PARSER | CHECK_COMMENT_RECORDER_PARSER |
//{ObjectTeams: with our grammar testing the IndexingParser is even less useful (creates false positives), just disable it:
/* orig:
- CHECK_SOURCE_ELEMENT_PARSER | CHECK_INDEXING_PARSER);
+ CHECK_SOURCE_ELEMENT_PARSER | CHECK_INDEXING_PARSER);
:giro */
CHECK_SOURCE_ELEMENT_PARSER /*| CHECK_INDEXING_PARSER */);
// SH}
@@ -85,11 +85,11 @@ public class AbstractSyntaxTreeTest extends AbstractCompilerTest implements IDoc
}
public void checkParse(int parserToCheck, char[] source, String expectedSyntaxErrorDiagnosis,
String testName, String expectedUnitToString, ASTVisitor visitor, CompilerOptions options) throws IOException {
-
+
ICompilationUnit sourceUnit = null;
CompilationResult compilationResult = null;
CompilationUnitDeclaration unit = null;
-
+
if (this.referenceCompiler != null && (parserToCheck & CHECK_JAVAC_PARSER) != 0) {
String javaFilePath = this.referenceCompilerTestsScratchArea + "\\Xyz.java";
File f = new File(javaFilePath);
@@ -130,7 +130,7 @@ public class AbstractSyntaxTreeTest extends AbstractCompilerTest implements IDoc
}
parser1 = null;
}
-
+
if ((parserToCheck & CHECK_COMPLETION_PARSER) != 0) {
CompletionParser parser2 = new CompletionParser(
new ProblemReporter(
@@ -278,65 +278,65 @@ public class AbstractSyntaxTreeTest extends AbstractCompilerTest implements IDoc
public void acceptImport(int declarationStart, int declarationEnd, int[] javaDocPositions,
char[] name, int nameStartPosition, boolean onDemand, int modifiers) {
-
-
+
+
}
public void acceptInitializer(int declarationStart, int declarationEnd, int[] javaDocPositions,
int modifiers, int modifiersStart, int bodyStart, int bodyEnd) {
-
-
+
+
}
public void acceptLineSeparatorPositions(int[] positions) {
-
-
+
+
}
public void acceptPackage(int declarationStart, int declarationEnd, int[] javaDocPositions,
char[] name, int nameStartPosition) {
-
-
+
+
}
public void acceptProblem(CategorizedProblem problem) {
-
-
+
+
}
public void enterClass(int declarationStart, int[] javaDocPositions, int modifiers,
int modifiersStart, int classStart, char[] name, int nameStart, int nameEnd,
char[] superclass, int superclassStart, int superclassEnd, char[][] superinterfaces, int[] superinterfaceStarts,
int[] superinterfaceEnds, int bodyStart) {
-
-
+
+
}
public void enterCompilationUnit() {
-
-
+
+
}
public void enterConstructor(int declarationStart, int[] javaDocPositions, int modifiers,
int modifiersStart, char[] name, int nameStart, int nameEnd, char[][] parameterTypes,
int[] parameterTypeStarts, int[] parameterTypeEnds, char[][] parameterNames, int[] parameterNameStarts, int[] parameterNameEnds,
int parametersEnd, char[][] exceptionTypes, int[] exceptionTypeStarts, int[] exceptionTypeEnds, int bodyStart) {
-
-
+
+
}
public void enterField(int declarationStart, int[] javaDocPositions, int modifiers,
int modifiersStart, char[] type, int typeStart, int typeEnd, int typeDimensionCount,
char[] name, int nameStart, int nameEnd, int extendedTypeDimensionCount, int extendedTypeDimensionEnd) {
-
-
+
+
}
public void enterInterface(int declarationStart, int[] javaDocPositions, int modifiers,
int modifiersStart, int interfaceStart, char[] name, int nameStart, int nameEnd,
char[][] superinterfaces, int[] superinterfaceStarts, int[] superinterfaceEnds, int bodyStart) {
-
-
+
+
}
public void enterMethod(int declarationStart, int[] javaDocPositions, int modifiers,
@@ -345,175 +345,175 @@ public class AbstractSyntaxTreeTest extends AbstractCompilerTest implements IDoc
int[] parameterTypeEnds, char[][] parameterNames, int[] parameterNameStarts, int[] parameterNameEnds, int parametersEnd,
int extendedReturnTypeDimensionCount, int extendedReturnTypeDimensionEnd, char[][] exceptionTypes, int[] exceptionTypeStarts, int[] exceptionTypeEnds,
int bodyStart) {
-
-
+
+
}
public void exitClass(int bodyEnd, int declarationEnd) {
-
-
+
+
}
public void exitCompilationUnit(int declarationEnd) {
-
-
+
+
}
public void exitConstructor(int bodyEnd, int declarationEnd) {
-
-
+
+
}
public void exitField(int bodyEnd, int declarationEnd) {
-
-
+
+
}
public void exitInterface(int bodyEnd, int declarationEnd) {
-
-
+
+
}
public void exitMethod(int bodyEnd, int declarationEnd) {
-
-
+
+
}
public void acceptAnnotationTypeReference(char[][] annotation, int sourceStart,
int sourceEnd) {
-
-
+
+
}
public void acceptAnnotationTypeReference(char[] annotation, int sourcePosition) {
-
-
+
+
}
public void acceptConstructorReference(char[] typeName, int argCount,
int sourcePosition) {
-
-
+
+
}
public void acceptFieldReference(char[] fieldName, int sourcePosition) {
-
-
+
+
}
public void acceptImport(int declarationStart, int declarationEnd, int nameStart,
int nameEnd, char[][] tokens, boolean onDemand, int modifiers) {
-
-
+
+
}
public void acceptMethodReference(char[] methodName, int argCount, int sourcePosition) {
-
-
+
+
}
public void acceptPackage(ImportReference importReference) {
-
-
+
+
}
public void acceptTypeReference(char[][] typeName, int sourceStart, int sourceEnd) {
-
-
+
+
}
public void acceptTypeReference(char[] typeName, int sourcePosition) {
-
-
+
+
}
public void acceptUnknownReference(char[][] name, int sourceStart, int sourceEnd) {
-
-
+
+
}
public void acceptUnknownReference(char[] name, int sourcePosition) {
-
-
+
+
}
public void enterConstructor(MethodInfo methodInfo) {
-
-
+
+
}
public void enterField(FieldInfo fieldInfo) {
-
-
+
+
}
public void enterInitializer(int declarationStart, int modifiers) {
-
-
+
+
}
public void enterMethod(MethodInfo methodInfo) {
-
-
+
+
}
public void enterType(TypeInfo typeInfo) {
-
-
+
+
}
public void exitConstructor(int declarationEnd) {
-
-
+
+
}
public void exitField(int initializationStart, int declarationEnd, int declarationSourceEnd) {
-
-
+
+
}
public void exitInitializer(int declarationEnd) {
-
-
+
+
}
public void exitMethod(int declarationEnd, Expression defaultValue) {
-
-
+
+
}
public void exitType(int declarationEnd) {
-
-
+
+
}
//{ObjectTeams: new methods
public void acceptBaseReference(char[][] typeName, int sourceStart, int sourceEnd) {
-
+
}
public void enterCalloutMapping(CalloutInfo info) {
-
+
}
public void enterCalloutToFieldMapping(CalloutToFieldInfo info) {
-
+
}
public void enterCallinMapping(CallinInfo info) {
-
+
}
public void exitCalloutMapping(int sourceEnd, int declarationSourceEnd) {
-
+
}
public void exitCalloutToFieldMapping(int sourceEnd, int declarationSourceEnd) {
-
+
}
public void exitCallinMapping(int sourceEnd, int declarationSourceEnd) {
-
+
}
// SH}
} \ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationCompletionParserTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationCompletionParserTest.java
index 8ace4d8e8..2c6421b29 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationCompletionParserTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationCompletionParserTest.java
@@ -3322,7 +3322,7 @@ public void test0087(){
String expectedReplacedSource = "foo";
String expectedUnitDisplayString =
"public class X {\n" +
- " @Annot(zzz = {<CompleteOnName:foo>})\n" +
+ " @Annot(zzz = {<CompleteOnName:foo>})\n" +
" public X() {\n" +
" }\n" +
" void bar() {\n" +
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationDietRecoveryTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationDietRecoveryTest.java
index cf908782d..d00432e99 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationDietRecoveryTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationDietRecoveryTest.java
@@ -1924,39 +1924,39 @@ public void test0041() {
"}\n";
String expectedDietUnitToString =
- "package snippet;\n" +
- "public class Bug366003 {\n" +
- " public Bug366003() {\n" +
- " }\n" +
- " void foo(Object o1) {\n" +
- " }\n" +
- " @Blah User(@Bla String str) {\n" +
- " }\n" +
+ "package snippet;\n" +
+ "public class Bug366003 {\n" +
+ " public Bug366003() {\n" +
+ " }\n" +
+ " void foo(Object o1) {\n" +
+ " }\n" +
+ " @Blah User(@Bla String str) {\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyUnitToString =
- "package snippet;\n" +
- "public class Bug366003 {\n" +
- " public Bug366003() {\n" +
- " super();\n" +
- " }\n" +
- " void foo(Object o1) {\n" +
- " }\n" +
- " @Blah User(@Bla String str) {\n" +
- " }\n" +
+ "package snippet;\n" +
+ "public class Bug366003 {\n" +
+ " public Bug366003() {\n" +
+ " super();\n" +
+ " }\n" +
+ " void foo(Object o1) {\n" +
+ " }\n" +
+ " @Blah User(@Bla String str) {\n" +
+ " }\n" +
"}\n";
String expectedFullUnitToString = expectedDietUnitToString;
String expectedCompletionDietUnitToString =
- "package snippet;\n" +
- "public class Bug366003 {\n" +
- " public Bug366003() {\n" +
- " }\n" +
- " void foo(Object o1) {\n" +
- " }\n" +
- " User(@Bla String str) {\n" +
- " }\n" +
+ "package snippet;\n" +
+ "public class Bug366003 {\n" +
+ " public Bug366003() {\n" +
+ " }\n" +
+ " void foo(Object o1) {\n" +
+ " }\n" +
+ " User(@Bla String str) {\n" +
+ " }\n" +
"}\n";
String testName = "<annotation recovery>";
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest.java
index 03eb21f59..4e68502dd 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -8658,28 +8658,28 @@ public void testBug310423(){
String testName = "";
String completeBehind = "In";
String expectedCompletionNodeToString = "<CompleteOnInterface:In>";
- String expectedParentNodeToString =
- "public class Test implements <CompleteOnInterface:In> {\n" +
- " public Test() {\n" +
- " }\n" +
+ String expectedParentNodeToString =
+ "public class Test implements <CompleteOnInterface:In> {\n" +
+ " public Test() {\n" +
+ " }\n" +
"}";
String completionIdentifier = "In";
String expectedReplacedSource = "In";
int cursorLocation = str.lastIndexOf("In") + completeBehind.length() - 1;
String expectedUnitDisplayString =
- "import java.lang.annotation.Annotation;\n" +
- "interface In {\n" +
- "}\n" +
- "interface Inn {\n" +
- " interface Inn2 {\n" +
- " }\n" +
- " @interface InAnnot {\n" +
- " }\n" +
- "}\n" +
- "@interface InnAnnot {\n" +
- "}\n" +
- "public class Test implements <CompleteOnInterface:In> {\n" +
- " public Test() {\n" +
+ "import java.lang.annotation.Annotation;\n" +
+ "interface In {\n" +
+ "}\n" +
+ "interface Inn {\n" +
+ " interface Inn2 {\n" +
+ " }\n" +
+ " @interface InAnnot {\n" +
+ " }\n" +
+ "}\n" +
+ "@interface InnAnnot {\n" +
+ "}\n" +
+ "public class Test implements <CompleteOnInterface:In> {\n" +
+ " public Test() {\n" +
" }\n" +
"}\n";
@@ -8723,32 +8723,32 @@ public void testBug338789(){
String completionIdentifier = "IZZ";
String expectedReplacedSource = "IZZ";
String expectedUnitDisplayString =
- "public class Test {\n" +
- " public Test() {\n" +
- " }\n" +
- " public void throwing() throws IZZBException, IZZException {\n" +
- " }\n" +
- " public void foo() {\n" +
- " try\n" +
- " {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (IZZException | <CompleteOnException:IZZ> )\n" +
- " {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "class IZZAException extends Exception {\n" +
- " IZZAException() {\n" +
- " }\n" +
- "}\n" +
- "class IZZBException extends Exception {\n" +
- " IZZBException() {\n" +
- " }\n" +
- "}\n" +
- "class IZZException extends Exception {\n" +
- " IZZException() {\n" +
- " }\n" +
+ "public class Test {\n" +
+ " public Test() {\n" +
+ " }\n" +
+ " public void throwing() throws IZZBException, IZZException {\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " try\n" +
+ " {\n" +
+ " throwing();\n" +
+ " }\n" +
+ " catch (IZZException | <CompleteOnException:IZZ> )\n" +
+ " {\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "class IZZAException extends Exception {\n" +
+ " IZZAException() {\n" +
+ " }\n" +
+ "}\n" +
+ "class IZZBException extends Exception {\n" +
+ " IZZBException() {\n" +
+ " }\n" +
+ "}\n" +
+ "class IZZException extends Exception {\n" +
+ " IZZException() {\n" +
+ " }\n" +
"}\n";
int cursorLocation = str.indexOf("IZZException | IZZ") + completeBehind.length() - 1;
@@ -8786,20 +8786,20 @@ public void testBug338789b(){
String completionIdentifier = "I";
String expectedReplacedSource = "java.lang.I";
String expectedUnitDisplayString =
- "public class Test {\n" +
- " public Test() {\n" +
- " }\n" +
- " public void throwing() throws java.lang.IllegalArgumentException, java.lang.IndexOutOfBoundsException {\n" +
- " }\n" +
- " public void foo() {\n" +
- " try\n" +
- " {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (java.lang.IllegalArgumentException | <CompleteOnException:java.lang.I> )\n" +
- " {\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " public Test() {\n" +
+ " }\n" +
+ " public void throwing() throws java.lang.IllegalArgumentException, java.lang.IndexOutOfBoundsException {\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " try\n" +
+ " {\n" +
+ " throwing();\n" +
+ " }\n" +
+ " catch (java.lang.IllegalArgumentException | <CompleteOnException:java.lang.I> )\n" +
+ " {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
int cursorLocation = str.indexOf("java.lang.IllegalArgumentException | java.lang.I") + completeBehind.length() - 1;
@@ -8837,24 +8837,24 @@ public void testBug343637(){
String expectedCompletionNodeToString = "<CompleteOnException:java.lang.I>";
String completionIdentifier = "I";
String expectedReplacedSource = "java.lang.I";
- String expectedUnitDisplayString =
- "public class Test {\n" +
- " public Test() {\n" +
- " }\n" +
- " public void throwing() throws java.lang.IllegalArgumentException, java.lang.IndexOutOfBoundsException, java.lang.IOException {\n" +
- " }\n" +
- " public void foo() {\n" +
- " try\n" +
- " {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (java.lang.IOException e)\n" +
- " {\n" +
- " }\n" +
- " catch (java.lang.IllegalArgumentException | <CompleteOnException:java.lang.I> )\n" +
- " {\n" +
- " }\n" +
- " }\n" +
+ String expectedUnitDisplayString =
+ "public class Test {\n" +
+ " public Test() {\n" +
+ " }\n" +
+ " public void throwing() throws java.lang.IllegalArgumentException, java.lang.IndexOutOfBoundsException, java.lang.IOException {\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " try\n" +
+ " {\n" +
+ " throwing();\n" +
+ " }\n" +
+ " catch (java.lang.IOException e)\n" +
+ " {\n" +
+ " }\n" +
+ " catch (java.lang.IllegalArgumentException | <CompleteOnException:java.lang.I> )\n" +
+ " {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
int cursorLocation = str.indexOf("java.lang.IllegalArgumentException | java.lang.I") + completeBehind.length() - 1;
@@ -8884,13 +8884,13 @@ public void testBug346454(){
String expectedCompletionNodeToString = "<CompleteOnAllocationExpression:new Test<>()>";
String completionIdentifier = "";
String expectedReplacedSource = "";
- String expectedUnitDisplayString =
- "public class Test<T> {\n" +
- " public Test() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " Test<String> t = <CompleteOnAllocationExpression:new Test<>()>;\n" +
- " }\n" +
+ String expectedUnitDisplayString =
+ "public class Test<T> {\n" +
+ " public Test() {\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " Test<String> t = <CompleteOnAllocationExpression:new Test<>()>;\n" +
+ " }\n" +
"}\n";
int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
@@ -8920,17 +8920,17 @@ public void testBug346454b(){
String expectedCompletionNodeToString = "<CompleteOnQualifiedAllocationExpression:new Test<>().new T2<>()>";
String completionIdentifier = "";
String expectedReplacedSource = "";
- String expectedUnitDisplayString =
- "public class Test<T> {\n" +
- " public class T2<Z> {\n" +
- " public T2() {\n" +
- " }\n" +
- " }\n" +
- " public Test() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " Test<String>.T2<String> t = <CompleteOnQualifiedAllocationExpression:new Test<>().new T2<>()>;\n" +
- " }\n" +
+ String expectedUnitDisplayString =
+ "public class Test<T> {\n" +
+ " public class T2<Z> {\n" +
+ " public T2() {\n" +
+ " }\n" +
+ " }\n" +
+ " public Test() {\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " Test<String>.T2<String> t = <CompleteOnQualifiedAllocationExpression:new Test<>().new T2<>()>;\n" +
+ " }\n" +
"}\n";
int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
@@ -8967,27 +8967,27 @@ public void testBug346415(){
String expectedCompletionNodeToString = "<CompleteOnException:>";
String completionIdentifier = "";
String expectedReplacedSource = "";
- String expectedUnitDisplayString =
- "public class Test {\n" +
- " public Test() {\n" +
- " }\n" +
- " public void throwing() throws java.lang.IllegalArgumentException, java.lang.IndexOutOfBoundsException, java.lang.IOException {\n" +
- " }\n" +
- " public void foo() {\n" +
- " try\n" +
- " {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (java.lang.IOException e)\n" +
- " {\n" +
- " }\n" +
- " catch (java.lang.IllegalArgumentException e)\n" +
- " {\n" +
- " }\n" +
- " catch (<CompleteOnException:> )\n" +
- " {\n" +
- " }\n" +
- " }\n" +
+ String expectedUnitDisplayString =
+ "public class Test {\n" +
+ " public Test() {\n" +
+ " }\n" +
+ " public void throwing() throws java.lang.IllegalArgumentException, java.lang.IndexOutOfBoundsException, java.lang.IOException {\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " try\n" +
+ " {\n" +
+ " throwing();\n" +
+ " }\n" +
+ " catch (java.lang.IOException e)\n" +
+ " {\n" +
+ " }\n" +
+ " catch (java.lang.IllegalArgumentException e)\n" +
+ " {\n" +
+ " }\n" +
+ " catch (<CompleteOnException:> )\n" +
+ " {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
@@ -9026,26 +9026,26 @@ public void testBug292087a(){
String testName = "";
String completeBehind = "/*Complete here*/";
String expectedCompletionNodeToString = "<CompleteOnName:>";
- String expectedParentNodeToString =
+ String expectedParentNodeToString =
"public MyClass[] member = {<CompleteOnName:>};";
String completionIdentifier = "";
String expectedReplacedSource = "";
int cursorLocation = str.lastIndexOf("/*Complete here*/") + completeBehind.length() - 1;
String expectedUnitDisplayString =
- "package test;\n" +
- "class MyClass {\n" +
- " MyClass() {\n" +
- " }\n" +
- "}\n" +
- "public class Try extends Thread {\n" +
- " public static MyClass MyClassField;\n" +
- " public MyClass[] member = {<CompleteOnName:>};\n" +
- " public Try() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public static MyClass MyClassMethod() {\n" +
- " }\n" +
+ "package test;\n" +
+ "class MyClass {\n" +
+ " MyClass() {\n" +
+ " }\n" +
+ "}\n" +
+ "public class Try extends Thread {\n" +
+ " public static MyClass MyClassField;\n" +
+ " public MyClass[] member = {<CompleteOnName:>};\n" +
+ " public Try() {\n" +
+ " }\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " public static MyClass MyClassMethod() {\n" +
+ " }\n" +
"}\n";
checkDietParse(
@@ -9084,26 +9084,26 @@ public void testBug292087b(){
String testName = "";
String completeBehind = "/*Complete here*/";
String expectedCompletionNodeToString = "<CompleteOnName:>";
- String expectedParentNodeToString =
+ String expectedParentNodeToString =
"public MyClass[] member = {<CompleteOnName:>};";
String completionIdentifier = "";
String expectedReplacedSource = "";
int cursorLocation = str.lastIndexOf("/*Complete here*/") + completeBehind.length() - 1;
String expectedUnitDisplayString =
- "package test;\n" +
- "class MyClass {\n" +
- " MyClass() {\n" +
- " }\n" +
- "}\n" +
- "public class Try extends Thread {\n" +
- " public static MyClass MyClassField;\n" +
- " public MyClass[] member = {<CompleteOnName:>};\n" +
- " public Try() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public static MyClass MyClassMethod() {\n" +
- " }\n" +
+ "package test;\n" +
+ "class MyClass {\n" +
+ " MyClass() {\n" +
+ " }\n" +
+ "}\n" +
+ "public class Try extends Thread {\n" +
+ " public static MyClass MyClassField;\n" +
+ " public MyClass[] member = {<CompleteOnName:>};\n" +
+ " public Try() {\n" +
+ " }\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " public static MyClass MyClassMethod() {\n" +
+ " }\n" +
"}\n";
checkDietParse(
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest18.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest18.java
index 05db7fdb6..52431729b 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest18.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest18.java
@@ -58,25 +58,25 @@ public void test0001() {
String completionIdentifier = "";
String expectedReplacedSource = "first.";
String expectedUnitDisplayString =
- "interface I {\n" +
- " J foo(String x, String y);\n" +
- "}\n" +
- "interface J {\n" +
- " K foo(String x, String y);\n" +
- "}\n" +
- "interface K {\n" +
- " int foo(String x, int y);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " static void goo(J i) {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " goo((<no type> first, <no type> second) -> {\n" +
- " return (<no type> xyz, <no type> pqr) -> <CompleteOnName:first.>;\n" +
- "});\n" +
- " }\n" +
+ "interface I {\n" +
+ " J foo(String x, String y);\n" +
+ "}\n" +
+ "interface J {\n" +
+ " K foo(String x, String y);\n" +
+ "}\n" +
+ "interface K {\n" +
+ " int foo(String x, int y);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " static void goo(J i) {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " goo((<no type> first, <no type> second) -> {\n" +
+ " return (<no type> xyz, <no type> pqr) -> <CompleteOnName:first.>;\n" +
+ "});\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -106,13 +106,13 @@ public void test0002() {
String completionIdentifier = "fi";
String expectedReplacedSource = "fi";
String expectedUnitDisplayString =
- "interface Foo {\n" +
- " void run1(int s1, int s2);\n" +
- "}\n" +
- "interface X extends Foo {\n" +
- " static Foo f = (<no type> first, <no type> second) -> System.out.print(<CompleteOnName:fi>);\n" +
- " <clinit>() {\n" +
- " }\n" +
+ "interface Foo {\n" +
+ " void run1(int s1, int s2);\n" +
+ "}\n" +
+ "interface X extends Foo {\n" +
+ " static Foo f = (<no type> first, <no type> second) -> System.out.print(<CompleteOnName:fi>);\n" +
+ " <clinit>() {\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -144,13 +144,13 @@ public void test0003() {
String completionIdentifier = "fi";
String expectedReplacedSource = "fi";
String expectedUnitDisplayString =
- "interface Foo {\n" +
- " void run1(int s1, int s2);\n" +
- "}\n" +
- "interface X extends Foo {\n" +
- " public static void main(String[] args) {\n" +
- " Foo f = (<no type> first, <no type> second) -> System.out.print(<CompleteOnName:fi>);\n" +
- " }\n" +
+ "interface Foo {\n" +
+ " void run1(int s1, int s2);\n" +
+ "}\n" +
+ "interface X extends Foo {\n" +
+ " public static void main(String[] args) {\n" +
+ " Foo f = (<no type> first, <no type> second) -> System.out.print(<CompleteOnName:fi>);\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -180,15 +180,15 @@ public void test0004() {
String completionIdentifier = "x";
String expectedReplacedSource = "x";
String expectedUnitDisplayString =
- "interface Foo {\n" +
- " int run1(int s1, int s2);\n" +
- "}\n" +
- "interface X extends Foo {\n" +
- " static Foo f = (<no type> x5, <no type> x6) -> {\n" +
- " <CompleteOnName:x>;\n" +
- " };\n" +
- " <clinit>() {\n" +
- " }\n" +
+ "interface Foo {\n" +
+ " int run1(int s1, int s2);\n" +
+ "}\n" +
+ "interface X extends Foo {\n" +
+ " static Foo f = (<no type> x5, <no type> x6) -> {\n" +
+ " <CompleteOnName:x>;\n" +
+ " };\n" +
+ " <clinit>() {\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -224,20 +224,20 @@ public void test0005() {
String completionIdentifier = "arg";
String expectedReplacedSource = "arg";
String expectedUnitDisplayString =
- "interface I {\n" +
- " int foo(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void go() {\n" +
- " I i = (<no type> argument) -> {\n" +
- " if (true)\n" +
- " {\n" +
- " return <CompleteOnName:arg>;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
+ "interface I {\n" +
+ " int foo(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " void go() {\n" +
+ " I i = (<no type> argument) -> {\n" +
+ " if (true)\n" +
+ " {\n" +
+ " return <CompleteOnName:arg>;\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -271,17 +271,17 @@ public void test0006() {
String completionIdentifier = "arg";
String expectedReplacedSource = "arg";
String expectedUnitDisplayString =
- "interface I {\n" +
- " int foo(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void go() {\n" +
- " I i = (<no type> argument) -> {\n" +
- " <CompleteOnName:arg>;\n" +
- " };\n" +
- " }\n" +
+ "interface I {\n" +
+ " int foo(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " void go() {\n" +
+ " I i = (<no type> argument) -> {\n" +
+ " <CompleteOnName:arg>;\n" +
+ " };\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -317,21 +317,21 @@ public void test0007() {
String completionIdentifier = "";
String expectedReplacedSource = "X.";
String expectedUnitDisplayString =
- "public interface Foo {\n" +
- " int run(int s1, int s2);\n" +
- "}\n" +
- "interface X {\n" +
+ "public interface Foo {\n" +
+ " int run(int s1, int s2);\n" +
+ "}\n" +
+ "interface X {\n" +
" static Foo f;\n" +
- " static int x1;\n" +
- " <clinit>() {\n" +
- " }\n" +
- "}\n" +
- "class C {\n" +
- " C() {\n" +
- " }\n" +
- " void method1() {\n" +
- " int p = <CompleteOnName:X.>;\n" +
- " }\n" +
+ " static int x1;\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ "}\n" +
+ "class C {\n" +
+ " C() {\n" +
+ " }\n" +
+ " void method1() {\n" +
+ " int p = <CompleteOnName:X.>;\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -400,7 +400,7 @@ public void test0010() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=417935, [1.8][code select] ICU#codeSelect doesn't work on reference to lambda parameter
public void test417935() {
- String string =
+ String string =
"import java.util.ArrayList;\n" +
"import java.util.Arrays;\n" +
"import java.util.Collections;\n" +
@@ -421,18 +421,18 @@ public void test417935() {
String completionIdentifier = "compa";
String expectedReplacedSource = "o1.compa";
String expectedUnitDisplayString =
- "import java.util.ArrayList;\n" +
- "import java.util.Arrays;\n" +
- "import java.util.Collections;\n" +
- "import java.util.Comparator;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int compareTo(X x) {\n" +
- " }\n" +
- " void foo() {\n" +
- " Collections.sort(new ArrayList<X>(Arrays.asList(new X(), new X(), new X())), (X o1, X o2) -> <CompleteOnName:o1.compa>);\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.Arrays;\n" +
+ "import java.util.Collections;\n" +
+ "import java.util.Comparator;\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " int compareTo(X x) {\n" +
+ " }\n" +
+ " void foo() {\n" +
+ " Collections.sort(new ArrayList<X>(Arrays.asList(new X(), new X(), new X())), (X o1, X o2) -> <CompleteOnName:o1.compa>);\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -445,9 +445,9 @@ public void test417935() {
expectedReplacedSource,
"diet ast");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=405126, [1.8][code assist] Lambda parameters incorrectly recovered as fields.
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=405126, [1.8][code assist] Lambda parameters incorrectly recovered as fields.
public void test405126() {
- String string =
+ String string =
"public interface Foo { \n" +
" int run(int s1, int s2); \n" +
"}\n" +
@@ -469,21 +469,21 @@ public void test405126() {
String completionIdentifier = "";
String expectedReplacedSource = "X.";
String expectedUnitDisplayString =
- "public interface Foo {\n" +
- " int run(int s1, int s2);\n" +
- "}\n" +
- "interface X {\n" +
- " static Foo f;\n" +
- " static int x1;\n" +
- " <clinit>() {\n" +
- " }\n" +
- "}\n" +
- "class C {\n" +
- " C() {\n" +
- " }\n" +
- " void method1() {\n" +
- " int p = <CompleteOnName:X.>;\n" +
- " }\n" +
+ "public interface Foo {\n" +
+ " int run(int s1, int s2);\n" +
+ "}\n" +
+ "interface X {\n" +
+ " static Foo f;\n" +
+ " static int x1;\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ "}\n" +
+ "class C {\n" +
+ " C() {\n" +
+ " }\n" +
+ " void method1() {\n" +
+ " int p = <CompleteOnName:X.>;\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -498,7 +498,7 @@ public void test405126() {
}
// Verify that locals inside a lambda block don't get promoted to the parent block.
public void testLocalsPromotion() {
- String string =
+ String string =
"interface I {\n" +
" void foo(int x);\n" +
"}\n" +
@@ -522,22 +522,22 @@ public void testLocalsPromotion() {
String completionIdentifier = "lam";
String expectedReplacedSource = "lam";
String expectedUnitDisplayString =
- "interface I {\n" +
- " void foo(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " static void goo(I i) {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " int outerLocal;\n" +
- " goo((<no type> x) -> {\n" +
- " int lambdaLocal;\n" +
- " System.out.println(\"Statement inside lambda\");\n" +
- " <CompleteOnName:lam>;\n" +
- "});\n" +
- " }\n" +
+ "interface I {\n" +
+ " void foo(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " static void goo(I i) {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " int outerLocal;\n" +
+ " goo((<no type> x) -> {\n" +
+ " int lambdaLocal;\n" +
+ " System.out.println(\"Statement inside lambda\");\n" +
+ " <CompleteOnName:lam>;\n" +
+ "});\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -553,7 +553,7 @@ public void testLocalsPromotion() {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=422107, [1.8][code assist] Invoking code assist just before and after a variable initialized using lambda gives different result
public void testCompletionLocation() {
- String string =
+ String string =
"interface I {\n" +
" void doit();\n" +
"}\n" +
@@ -572,16 +572,16 @@ public void testCompletionLocation() {
String completionIdentifier = "";
String expectedReplacedSource = "";
String expectedUnitDisplayString =
- "interface I {\n" +
- " void doit();\n" +
- "}\n" +
- "interface J {\n" +
- "}\n" +
- "public class X {\n" +
- " Object o;\n" +
- " <CompleteOnType:>;\n" +
- " public X() {\n" +
- " }\n" +
+ "interface I {\n" +
+ " void doit();\n" +
+ "}\n" +
+ "interface J {\n" +
+ "}\n" +
+ "public class X {\n" +
+ " Object o;\n" +
+ " <CompleteOnType:>;\n" +
+ " public X() {\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -595,7 +595,7 @@ public void testCompletionLocation() {
"diet ast");
}
public void testElidedCompletion() {
- String string =
+ String string =
"class Collections {\n" +
" public static void sort(ArrayList list, Comparator c) {\n" +
" }\n" +
@@ -620,27 +620,27 @@ public void testElidedCompletion() {
String completionIdentifier = "compa";
String expectedReplacedSource = "o1.compa";
String expectedUnitDisplayString =
- "class Collections {\n" +
- " Collections() {\n" +
- " }\n" +
- " public static void sort(ArrayList list, Comparator c) {\n" +
- " }\n" +
- "}\n" +
- "interface Comparator {\n" +
- " int compareTo(X t, X s);\n" +
- "}\n" +
- "class ArrayList {\n" +
- " ArrayList() {\n" +
- " }\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int compareTo(X x) {\n" +
- " }\n" +
- " void foo() {\n" +
- " Collections.sort(new ArrayList(), (X o1, X o2) -> <CompleteOnName:o1.compa>);\n" +
- " }\n" +
+ "class Collections {\n" +
+ " Collections() {\n" +
+ " }\n" +
+ " public static void sort(ArrayList list, Comparator c) {\n" +
+ " }\n" +
+ "}\n" +
+ "interface Comparator {\n" +
+ " int compareTo(X t, X s);\n" +
+ "}\n" +
+ "class ArrayList {\n" +
+ " ArrayList() {\n" +
+ " }\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " int compareTo(X x) {\n" +
+ " }\n" +
+ " void foo() {\n" +
+ " Collections.sort(new ArrayList(), (X o1, X o2) -> <CompleteOnName:o1.compa>);\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -654,7 +654,7 @@ public void testElidedCompletion() {
"diet ast");
}
public void testElidedCompletion2() {
- String string =
+ String string =
"class Collections {\n" +
" public static void sort(ArrayList list, Comparator c) {\n" +
" }\n" +
@@ -679,27 +679,27 @@ public void testElidedCompletion2() {
String completionIdentifier = "compa";
String expectedReplacedSource = "o1.compa";
String expectedUnitDisplayString =
- "class Collections {\n" +
- " Collections() {\n" +
- " }\n" +
- " public static void sort(ArrayList list, Comparator c) {\n" +
- " }\n" +
- "}\n" +
- "interface Comparator {\n" +
- " int compareTo(X t, X s);\n" +
- "}\n" +
- "class ArrayList {\n" +
- " ArrayList() {\n" +
- " }\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int compareTo(X x) {\n" +
- " }\n" +
- " void foo() {\n" +
- " Collections.sort(new ArrayList(), (<no type> o1, <no type> o2) -> <CompleteOnName:o1.compa>);\n" +
- " }\n" +
+ "class Collections {\n" +
+ " Collections() {\n" +
+ " }\n" +
+ " public static void sort(ArrayList list, Comparator c) {\n" +
+ " }\n" +
+ "}\n" +
+ "interface Comparator {\n" +
+ " int compareTo(X t, X s);\n" +
+ "}\n" +
+ "class ArrayList {\n" +
+ " ArrayList() {\n" +
+ " }\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " int compareTo(X x) {\n" +
+ " }\n" +
+ " void foo() {\n" +
+ " Collections.sort(new ArrayList(), (<no type> o1, <no type> o2) -> <CompleteOnName:o1.compa>);\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -713,7 +713,7 @@ public void testElidedCompletion2() {
"diet ast");
}
public void testUnspecifiedReference() { // verify that completion works on unspecified reference and finds types and names.
- String string =
+ String string =
"interface I {\n" +
" void doit(X x);\n" +
"}\n" +
@@ -737,23 +737,23 @@ public void testUnspecifiedReference() { // verify that completion works on uns
String completionIdentifier = "Str";
String expectedReplacedSource = "Str";
String expectedUnitDisplayString =
- "interface I {\n" +
- " void doit(X x);\n" +
- "}\n" +
- "class String {\n" +
- " String() {\n" +
- " }\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " static void goo(I i) {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " goo((<no type> StringParameter) -> {\n" +
- " <CompleteOnName:Str>;\n" +
- "});\n" +
- " }\n" +
+ "interface I {\n" +
+ " void doit(X x);\n" +
+ "}\n" +
+ "class String {\n" +
+ " String() {\n" +
+ " }\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " static void goo(I i) {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " goo((<no type> StringParameter) -> {\n" +
+ " <CompleteOnName:Str>;\n" +
+ "});\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -767,7 +767,7 @@ public void testUnspecifiedReference() { // verify that completion works on uns
"diet ast");
}
public void testBrokenMethodCall() { // verify that completion works when the call containing the lambda is broken - i.e missing a semicolon.
- String string =
+ String string =
"interface I {\n" +
" void doit(X x);\n" +
"}\n" +
@@ -789,19 +789,19 @@ public void testBrokenMethodCall() { // verify that completion works when the c
String completionIdentifier = "Str";
String expectedReplacedSource = "Str";
String expectedUnitDisplayString =
- "interface I {\n" +
- " void doit(X x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " static void goo(I i) {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " goo((<no type> StringParameter) -> {\n" +
- " <CompleteOnName:Str>;\n" +
- "});\n" +
- " }\n" +
+ "interface I {\n" +
+ " void doit(X x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " static void goo(I i) {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " goo((<no type> StringParameter) -> {\n" +
+ " <CompleteOnName:Str>;\n" +
+ "});\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -816,7 +816,7 @@ public void testBrokenMethodCall() { // verify that completion works when the c
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=424080, [1.8][completion] Workbench hanging on code completion with lambda expression containing anonymous class
public void test424080() {
-String string =
+String string =
"interface FI {\n" +
" public static int val = 5;\n" +
" default int run (String x) { return 1;};\n" +
@@ -834,18 +834,18 @@ String string =
String completionIdentifier = "val";
String expectedReplacedSource = "val";
String expectedUnitDisplayString =
- "interface FI {\n" +
- " public static int val;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " default int run(String x) {\n" +
- " }\n" +
- " public int run(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " FI fi;\n" +
- " public X() {\n" +
- " }\n" +
+ "interface FI {\n" +
+ " public static int val;\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " default int run(String x) {\n" +
+ " }\n" +
+ " public int run(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " FI fi;\n" +
+ " public X() {\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -860,7 +860,7 @@ String string =
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425084, [1.8][completion] Eclipse freeze while autocompleting try block in lambda.
public void test425084() {
- String string =
+ String string =
"interface I {\n" +
" void foo();\n" +
"}\n" +
@@ -878,15 +878,15 @@ public void test425084() {
String completionIdentifier = "try";
String expectedReplacedSource = "try";
String expectedUnitDisplayString =
- "interface I {\n" +
- " void foo();\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " I goo() {\n" +
- " <CompleteOnName:try>;\n" +
- " }\n" +
+ "interface I {\n" +
+ " void foo();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " I goo() {\n" +
+ " <CompleteOnName:try>;\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -901,7 +901,7 @@ public void test425084() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425084, [1.8][completion] Eclipse freeze while autocompleting try block in lambda.
public void test425084b() {
- String string =
+ String string =
"interface I {\n" +
" void foo();\n" +
"}\n" +
@@ -921,17 +921,17 @@ public void test425084b() {
String completionIdentifier = "try";
String expectedReplacedSource = "try";
String expectedUnitDisplayString =
- "interface I {\n" +
- " void foo();\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " I goo() {\n" +
- " return () -> {\n" +
- " <CompleteOnName:try>;\n" +
- "};\n" +
- " }\n" +
+ "interface I {\n" +
+ " void foo();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " I goo() {\n" +
+ " return () -> {\n" +
+ " <CompleteOnName:try>;\n" +
+ "};\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -946,7 +946,7 @@ public void test425084b() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427255, [1.8][code assist] Hang due to infinite loop in Parser.automatonWillShift
public void test427255() {
- String string =
+ String string =
"public class X {\n" +
" public final String targetApplication;\n" +
" public final String arguments;\n" +
@@ -962,15 +962,15 @@ public void test427255() {
String completionIdentifier = "X";
String expectedReplacedSource = "X";
String expectedUnitDisplayString =
- "public class X {\n" +
- " public final String targetApplication;\n" +
- " public final String arguments;\n" +
- " public final String appUserModelID;\n" +
- " <CompleteOnType:X>;\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
+ "public class X {\n" +
+ " public final String targetApplication;\n" +
+ " public final String arguments;\n" +
+ " public final String appUserModelID;\n" +
+ " <CompleteOnType:X>;\n" +
+ " {\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -985,7 +985,7 @@ public void test427255() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427322, [1.8][code assist] Eclipse hangs upon completion just past lambda
public void test427322() {
- String string =
+ String string =
"public class X {\n" +
" interface I {\n" +
" int foo();\n" +
@@ -1003,17 +1003,17 @@ public void test427322() {
String completionIdentifier = "";
String expectedReplacedSource = "";
String expectedUnitDisplayString =
- "public class X {\n" +
- " interface I {\n" +
- " int foo();\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i;\n" +
- " I i;\n" +
- " <CompleteOnName:>;\n" +
- " }\n" +
+ "public class X {\n" +
+ " interface I {\n" +
+ " int foo();\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i;\n" +
+ " I i;\n" +
+ " <CompleteOnName:>;\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -1028,7 +1028,7 @@ public void test427322() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427322, [1.8][code assist] Eclipse hangs upon completion just past lambda
public void test427322a() {
- String string =
+ String string =
"public class X {\n" +
" interface I {\n" +
" int foo();\n" +
@@ -1046,17 +1046,17 @@ public void test427322a() {
String completionIdentifier = "";
String expectedReplacedSource = "";
String expectedUnitDisplayString =
- "public class X {\n" +
- " interface I {\n" +
- " int foo();\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i;\n" +
- " I i;\n" +
- " <CompleteOnName:>;\n" +
- " }\n" +
+ "public class X {\n" +
+ " interface I {\n" +
+ " int foo();\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i;\n" +
+ " I i;\n" +
+ " <CompleteOnName:>;\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -1071,7 +1071,7 @@ public void test427322a() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427463, [1.8][content assist] No completions available in throw statement within lambda body
public void test427463() {
- String string =
+ String string =
"interface FI1 {\n" +
" int foo(int x) throws Exception;\n" +
"}\n" +
@@ -1092,17 +1092,17 @@ public void test427463() {
String completionIdentifier = "Ex";
String expectedReplacedSource = "Ex";
String expectedUnitDisplayString =
- "interface FI1 {\n" +
- " int foo(int x) throws Exception;\n" +
- "}\n" +
- "class Test {\n" +
- " FI1 fi1 = (int x) -> {\n" +
- " <CompleteOnException:Ex>;\n" +
- " };\n" +
- " Test() {\n" +
- " }\n" +
- " private void test() throws Exception {\n" +
- " }\n" +
+ "interface FI1 {\n" +
+ " int foo(int x) throws Exception;\n" +
+ "}\n" +
+ "class Test {\n" +
+ " FI1 fi1 = (int x) -> {\n" +
+ " <CompleteOnException:Ex>;\n" +
+ " };\n" +
+ " Test() {\n" +
+ " }\n" +
+ " private void test() throws Exception {\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -1117,7 +1117,7 @@ public void test427463() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427117, [1.8][code assist] code assist after lambda as a parameter does not work
public void test427117() {
- String string =
+ String string =
"import java.util.ArrayList;\n" +
"import java.util.List;\n" +
"public class X {\n" +
@@ -1139,17 +1139,17 @@ public void test427117() {
String completionIdentifier = "";
String expectedReplacedSource = "list.";
String expectedUnitDisplayString =
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public static void bar() {\n" +
- " List<Integer> list;\n" +
- " <CompleteOnName:list.>;\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
+ " public static void bar() {\n" +
+ " List<Integer> list;\n" +
+ " <CompleteOnName:list.>;\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -1164,7 +1164,7 @@ public void test427117() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427532, [1.8][code assist] Completion engine does not like intersection casts
public void test427532() {
- String string =
+ String string =
"import java.io.Serializable;\n" +
"interface I {\n" +
" void foo();\n" +
@@ -1184,17 +1184,17 @@ public void test427532() {
String completionIdentifier = "syso";
String expectedReplacedSource = "syso";
String expectedUnitDisplayString =
- "import java.io.Serializable;\n" +
- "interface I {\n" +
- " void foo();\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i;\n" +
- " <CompleteOnName:syso>;\n" +
- " }\n" +
+ "import java.io.Serializable;\n" +
+ "interface I {\n" +
+ " void foo();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i;\n" +
+ " <CompleteOnName:syso>;\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -1209,7 +1209,7 @@ public void test427532() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428735, [1.8][assist] Missing completion proposals inside lambda body expression - other than first token
public void test428735() {
- String string =
+ String string =
"import java.util.List;\n" +
"class Person {\n" +
" String getLastName() { return null; }\n" +
@@ -1228,19 +1228,19 @@ public void test428735() {
String completionIdentifier = "";
String expectedReplacedSource = "p.";
String expectedUnitDisplayString =
- "import java.util.List;\n" +
- "class Person {\n" +
- " Person() {\n" +
- " }\n" +
- " String getLastName() {\n" +
- " }\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void test1(List<Person> people) {\n" +
- " people.stream().forEach((<no type> p) -> System.out.println(<CompleteOnName:p.>));\n" +
- " }\n" +
+ "import java.util.List;\n" +
+ "class Person {\n" +
+ " Person() {\n" +
+ " }\n" +
+ " String getLastName() {\n" +
+ " }\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " void test1(List<Person> people) {\n" +
+ " people.stream().forEach((<no type> p) -> System.out.println(<CompleteOnName:p.>));\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -1255,7 +1255,7 @@ public void test428735() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428735, [1.8][assist] Missing completion proposals inside lambda body expression - other than first token
public void test428735a() {
- String string =
+ String string =
"import java.util.List;\n" +
"class Person {\n" +
" String getLastName() { return null; }\n" +
@@ -1277,21 +1277,21 @@ public void test428735a() {
String completionIdentifier = "";
String expectedReplacedSource = "x.";
String expectedUnitDisplayString =
- "import java.util.List;\n" +
- "class Person {\n" +
- " Person() {\n" +
- " }\n" +
- " String getLastName() {\n" +
- " }\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void test1(List<Person> people) {\n" +
- " }\n" +
- " void test2(List<Person> people) {\n" +
- " people.sort((<no type> x, <no type> y) -> <CompleteOnName:x.>);\n" +
- " }\n" +
+ "import java.util.List;\n" +
+ "class Person {\n" +
+ " Person() {\n" +
+ " }\n" +
+ " String getLastName() {\n" +
+ " }\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " void test1(List<Person> people) {\n" +
+ " }\n" +
+ " void test2(List<Person> people) {\n" +
+ " people.sort((<no type> x, <no type> y) -> <CompleteOnName:x.>);\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -1306,7 +1306,7 @@ public void test428735a() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428735, [1.8][assist] Missing completion proposals inside lambda body expression - other than first token
public void test428735b() {
- String string =
+ String string =
"import java.util.List;\n" +
"class Person {\n" +
" String getLastName() { return null; }\n" +
@@ -1316,7 +1316,7 @@ public void test428735b() {
" people.stream().forEach(p -> System.out.println(p.)); // NOK\n" +
" }\n" +
" void test2(List<Person> people) {\n" +
- " people.sort((x,y) -> x.getLastName().compareTo(y.));\n" +
+ " people.sort((x,y) -> x.getLastName().compareTo(y.));\n" +
" }\n" +
"}\n";
@@ -1328,21 +1328,21 @@ public void test428735b() {
String completionIdentifier = "";
String expectedReplacedSource = "y.";
String expectedUnitDisplayString =
- "import java.util.List;\n" +
- "class Person {\n" +
- " Person() {\n" +
- " }\n" +
- " String getLastName() {\n" +
- " }\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void test1(List<Person> people) {\n" +
- " }\n" +
- " void test2(List<Person> people) {\n" +
- " people.sort((<no type> x, <no type> y) -> x.getLastName().compareTo(<CompleteOnName:y.>));\n" +
- " }\n" +
+ "import java.util.List;\n" +
+ "class Person {\n" +
+ " Person() {\n" +
+ " }\n" +
+ " String getLastName() {\n" +
+ " }\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " void test1(List<Person> people) {\n" +
+ " }\n" +
+ " void test2(List<Person> people) {\n" +
+ " people.sort((<no type> x, <no type> y) -> x.getLastName().compareTo(<CompleteOnName:y.>));\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -1357,7 +1357,7 @@ public void test428735b() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428735, [1.8][assist] Missing completion proposals inside lambda body expression - other than first token
public void test428735c() {
- String string =
+ String string =
"import java.util.List;\n" +
"class Person {\n" +
" String getLastName() { return null; }\n" +
@@ -1367,7 +1367,7 @@ public void test428735c() {
" people.stream().forEach(p -> System.out.println(p.)); // NOK\n" +
" }\n" +
" void test2(List<Person> people) {\n" +
- " people.sort((x,y) -> x.getLastName() + y.);\n" +
+ " people.sort((x,y) -> x.getLastName() + y.);\n" +
" }\n" +
"}\n";
@@ -1379,21 +1379,21 @@ public void test428735c() {
String completionIdentifier = "";
String expectedReplacedSource = "y.";
String expectedUnitDisplayString =
- "import java.util.List;\n" +
- "class Person {\n" +
- " Person() {\n" +
- " }\n" +
- " String getLastName() {\n" +
- " }\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void test1(List<Person> people) {\n" +
- " }\n" +
- " void test2(List<Person> people) {\n" +
- " people.sort((<no type> x, <no type> y) -> (x.getLastName() + <CompleteOnName:y.>));\n" +
- " }\n" +
+ "import java.util.List;\n" +
+ "class Person {\n" +
+ " Person() {\n" +
+ " }\n" +
+ " String getLastName() {\n" +
+ " }\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " void test1(List<Person> people) {\n" +
+ " }\n" +
+ " void test2(List<Person> people) {\n" +
+ " people.sort((<no type> x, <no type> y) -> (x.getLastName() + <CompleteOnName:y.>));\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -1408,7 +1408,7 @@ public void test428735c() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428735, [1.8][assist] Missing completion proposals inside lambda body expression - other than first token
public void test428735d() {
- String string =
+ String string =
"import java.util.List;\n" +
"class Person {\n" +
" String getLastName() { return null; }\n" +
@@ -1418,7 +1418,7 @@ public void test428735d() {
" people.stream().forEach(p -> System.out.println(p.)); // NOK\n" +
" }\n" +
" void test2(List<Person> people) {\n" +
- " people.sort((x,y) -> \"\" + x.); \n" +
+ " people.sort((x,y) -> \"\" + x.); \n" +
" }\n" +
"}\n";
@@ -1430,21 +1430,21 @@ public void test428735d() {
String completionIdentifier = "";
String expectedReplacedSource = "x.";
String expectedUnitDisplayString =
- "import java.util.List;\n" +
- "class Person {\n" +
- " Person() {\n" +
- " }\n" +
- " String getLastName() {\n" +
- " }\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void test1(List<Person> people) {\n" +
- " }\n" +
- " void test2(List<Person> people) {\n" +
- " people.sort((<no type> x, <no type> y) -> (\"\" + <CompleteOnName:x.>));\n" +
- " }\n" +
+ "import java.util.List;\n" +
+ "class Person {\n" +
+ " Person() {\n" +
+ " }\n" +
+ " String getLastName() {\n" +
+ " }\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " void test1(List<Person> people) {\n" +
+ " }\n" +
+ " void test2(List<Person> people) {\n" +
+ " people.sort((<no type> x, <no type> y) -> (\"\" + <CompleteOnName:x.>));\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -1459,7 +1459,7 @@ public void test428735d() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428735, [1.8][assist] Missing completion proposals inside lambda body expression - other than first token
public void test428735e() { // field
- String string =
+ String string =
"class Person {\n" +
" String getLastName() { return null; }\n" +
"}\n" +
@@ -1478,19 +1478,19 @@ public void test428735e() { // field
String completionIdentifier = "get";
String expectedReplacedSource = "y.get";
String expectedUnitDisplayString =
- "class Person {\n" +
- " Person() {\n" +
- " }\n" +
- " String getLastName() {\n" +
- " }\n" +
- "}\n" +
- "interface I {\n" +
- " int foo(Person p, Person q);\n" +
- "}\n" +
- "public class X {\n" +
- " I i = (<no type> x, <no type> y) -> (10 + x.getLastName().compareTo(<CompleteOnName:y.get>));\n" +
- " public X() {\n" +
- " }\n" +
+ "class Person {\n" +
+ " Person() {\n" +
+ " }\n" +
+ " String getLastName() {\n" +
+ " }\n" +
+ "}\n" +
+ "interface I {\n" +
+ " int foo(Person p, Person q);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " I i = (<no type> x, <no type> y) -> (10 + x.getLastName().compareTo(<CompleteOnName:y.get>));\n" +
+ " public X() {\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -1505,7 +1505,7 @@ public void test428735e() { // field
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428735, [1.8][assist] Missing completion proposals inside lambda body expression - other than first token
public void test428735f() { // local
- String string =
+ String string =
"class Person {\n" +
" String getLastName() { return null; }\n" +
"}\n" +
@@ -1526,21 +1526,21 @@ public void test428735f() { // local
String completionIdentifier = "get";
String expectedReplacedSource = "y.get";
String expectedUnitDisplayString =
- "class Person {\n" +
- " Person() {\n" +
- " }\n" +
- " String getLastName() {\n" +
- " }\n" +
- "}\n" +
- "interface I {\n" +
- " int foo(Person p, Person q);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " I i = (<no type> x, <no type> y) -> (10 + x.getLastName().compareTo(<CompleteOnName:y.get>));\n" +
- " }\n" +
+ "class Person {\n" +
+ " Person() {\n" +
+ " }\n" +
+ " String getLastName() {\n" +
+ " }\n" +
+ "}\n" +
+ "interface I {\n" +
+ " int foo(Person p, Person q);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " void foo() {\n" +
+ " I i = (<no type> x, <no type> y) -> (10 + x.getLastName().compareTo(<CompleteOnName:y.get>));\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -1555,7 +1555,7 @@ public void test428735f() { // local
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428735, [1.8][assist] Missing completion proposals inside lambda body expression - other than first token
public void test428735g() { // initializer block
- String string =
+ String string =
"import java.util.List;\n" +
"class Person {\n" +
" String getLastName() { return null; }\n" +
@@ -1566,7 +1566,7 @@ public void test428735g() { // initializer block
"public class X {\n" +
" List<Person> people;\n" +
" {\n" +
- " people.sort((x,y) -> \"\" + x.); \n" +
+ " people.sort((x,y) -> \"\" + x.); \n" +
" }\n" +
"}\n";
@@ -1578,23 +1578,23 @@ public void test428735g() { // initializer block
String completionIdentifier = "";
String expectedReplacedSource = "x.";
String expectedUnitDisplayString =
- "import java.util.List;\n" +
- "class Person {\n" +
- " Person() {\n" +
- " }\n" +
- " String getLastName() {\n" +
- " }\n" +
- "}\n" +
- "interface I {\n" +
- " int foo(Person p, Person q);\n" +
- "}\n" +
- "public class X {\n" +
- " List<Person> people;\n" +
- " {\n" +
- " people.sort((<no type> x, <no type> y) -> (\"\" + <CompleteOnName:x.>));\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
+ "import java.util.List;\n" +
+ "class Person {\n" +
+ " Person() {\n" +
+ " }\n" +
+ " String getLastName() {\n" +
+ " }\n" +
+ "}\n" +
+ "interface I {\n" +
+ " int foo(Person p, Person q);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " List<Person> people;\n" +
+ " {\n" +
+ " people.sort((<no type> x, <no type> y) -> (\"\" + <CompleteOnName:x.>));\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -1609,7 +1609,7 @@ public void test428735g() { // initializer block
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=402081, [1.8][code complete] No proposals while completing at method/constructor references
public void test402081() { // initializer block
- String string =
+ String string =
"interface I {\n" +
" String foo(String x);\n" +
"}\n" +
@@ -1632,18 +1632,18 @@ public void test402081() { // initializer block
String completionIdentifier = "long";
String expectedReplacedSource = "x::long";
String expectedUnitDisplayString =
- "interface I {\n" +
- " String foo(String x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public String longMethodName(String x) {\n" +
- " }\n" +
- " void foo() {\n" +
- " X x;\n" +
- " I i = <CompletionOnReferenceExpressionName:x::long>;\n" +
- " }\n" +
+ "interface I {\n" +
+ " String foo(String x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public String longMethodName(String x) {\n" +
+ " }\n" +
+ " void foo() {\n" +
+ " X x;\n" +
+ " I i = <CompletionOnReferenceExpressionName:x::long>;\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -1658,7 +1658,7 @@ public void test402081() { // initializer block
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430656, [1.8][content assist] Content assist does not work for method reference argument
public void test430656() {
- String string =
+ String string =
"import java.util.ArrayList;\n" +
"import java.util.Collections;\n" +
"import java.util.Comparator;\n" +
@@ -1683,23 +1683,23 @@ public void test430656() {
String completionIdentifier = "get";
String expectedReplacedSource = "Person::get";
String expectedUnitDisplayString =
- "import java.util.ArrayList;\n" +
- "import java.util.Collections;\n" +
- "import java.util.Comparator;\n" +
- "import java.util.List;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void bar() {\n" +
- " List<Person> people;\n" +
- " Comparator.comparing(<CompletionOnReferenceExpressionName:Person::get>);\n" +
- " }\n" +
- "}\n" +
- "class Person {\n" +
- " Person() {\n" +
- " }\n" +
- " String getLastName() {\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.Collections;\n" +
+ "import java.util.Comparator;\n" +
+ "import java.util.List;\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public void bar() {\n" +
+ " List<Person> people;\n" +
+ " Comparator.comparing(<CompletionOnReferenceExpressionName:Person::get>);\n" +
+ " }\n" +
+ "}\n" +
+ "class Person {\n" +
+ " Person() {\n" +
+ " }\n" +
+ " String getLastName() {\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -1712,9 +1712,9 @@ public void test430656() {
expectedReplacedSource,
"diet ast");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=438952, [1.8][content assist] StackOverflowError at org.eclipse.jdt.internal.compiler.ast.SingleTypeReference.traverse(SingleTypeReference.java:108)
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=438952, [1.8][content assist] StackOverflowError at org.eclipse.jdt.internal.compiler.ast.SingleTypeReference.traverse(SingleTypeReference.java:108)
public void test438952() {
- String string =
+ String string =
"import java.util.function.Supplier;\n" +
"class SO {\n" +
" {\n" +
@@ -1736,18 +1736,18 @@ public void test438952() {
String completionIdentifier = "";
String expectedReplacedSource = "";
String expectedUnitDisplayString =
- "import java.util.function.Supplier;\n" +
- "class SO {\n" +
- " {\n" +
- " int Supplier;\n" +
- " m6 = () -> new SO() {\n" +
- " void test() {\n" +
- " <CompleteOnName:>;\n" +
- " }\n" +
- "};\n" +
- " }\n" +
- " SO() {\n" +
- " }\n" +
+ "import java.util.function.Supplier;\n" +
+ "class SO {\n" +
+ " {\n" +
+ " int Supplier;\n" +
+ " m6 = () -> new SO() {\n" +
+ " void test() {\n" +
+ " <CompleteOnName:>;\n" +
+ " }\n" +
+ "};\n" +
+ " }\n" +
+ " SO() {\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -1760,9 +1760,9 @@ public void test438952() {
expectedReplacedSource,
"diet ast");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=435219, [1.8][content assist] No proposals for some closure cases
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=435219, [1.8][content assist] No proposals for some closure cases
public void test435219() {
- String string =
+ String string =
"import java.util.Arrays;\n" +
"import java.util.List;\n" +
"public class X {\n" +
@@ -1782,15 +1782,15 @@ public void test435219() {
String completionIdentifier = "dou";
String expectedReplacedSource = "cost.dou";
String expectedUnitDisplayString =
- "import java.util.Arrays;\n" +
- "import java.util.List;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " List<Integer> costBeforeTax;\n" +
- " double bill = costBeforeTax.stream().map((<no type> cost) -> (cost + (0.19 * cost))).reduce((<no type> sum, <no type> cost) -> (sum.doubleValue() + <CompleteOnName:cost.dou>));\n" +
- " }\n" +
+ "import java.util.Arrays;\n" +
+ "import java.util.List;\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " List<Integer> costBeforeTax;\n" +
+ " double bill = costBeforeTax.stream().map((<no type> cost) -> (cost + (0.19 * cost))).reduce((<no type> sum, <no type> cost) -> (sum.doubleValue() + <CompleteOnName:cost.dou>));\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -1805,7 +1805,7 @@ public void test435219() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=435682, [1.8] content assist not working inside lambda expression
public void test435682() {
- String string =
+ String string =
"import java.util.Arrays;\n" +
"import java.util.List;\n" +
"public class X {\n" +
@@ -1823,15 +1823,15 @@ public void test435682() {
String completionIdentifier = "";
String expectedReplacedSource = "so.";
String expectedUnitDisplayString =
- "import java.util.Arrays;\n" +
- "import java.util.List;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " List<String> words;\n" +
- " List<String> list1 = words.stream().map((<no type> so) -> <CompleteOnName:so.>).collect(Collectors.toList());\n" +
- " }\n" +
+ "import java.util.Arrays;\n" +
+ "import java.util.List;\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " List<String> words;\n" +
+ " List<String> list1 = words.stream().map((<no type> so) -> <CompleteOnName:so.>).collect(Collectors.toList());\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -1846,7 +1846,7 @@ public void test435682() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430667, [1.8][content assist] no proposals around lambda as a field
public void test430667() {
- String string =
+ String string =
"interface D_FI {\n" +
" void print(String value, int n);\n" +
"}\n" +
@@ -1868,14 +1868,14 @@ public void test430667() {
String completionIdentifier = "D_F";
String expectedReplacedSource = "D_F";
String expectedUnitDisplayString =
- "interface D_FI {\n" +
- " void print(String value, int n);\n" +
- "}\n" +
- "class D_DemoRefactorings {\n" +
- " D_FI fi1;\n" +
- " <CompleteOnType:D_F>;\n" +
- " D_DemoRefactorings() {\n" +
- " }\n" +
+ "interface D_FI {\n" +
+ " void print(String value, int n);\n" +
+ "}\n" +
+ "class D_DemoRefactorings {\n" +
+ " D_FI fi1;\n" +
+ " <CompleteOnType:D_F>;\n" +
+ " D_DemoRefactorings() {\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -1890,7 +1890,7 @@ public void test430667() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430667, [1.8][content assist] no proposals around lambda as a field
public void test430667a() {
- String string =
+ String string =
"class D_DemoRefactorings {\n" +
" \n" +
" D_FI fi1= (String value, int n) -> {\n" +
@@ -1903,7 +1903,7 @@ public void test430667a() {
"interface D_FI {\n" +
" void print(String value, int n);\n" +
"}\n";
-
+
String completeBehind = "/*HERE*/D_F";
int cursorLocation = string.lastIndexOf(completeBehind) + completeBehind.length() - 1;
@@ -1913,14 +1913,14 @@ public void test430667a() {
String completionIdentifier = "D_F";
String expectedReplacedSource = "D_F";
String expectedUnitDisplayString =
- "class D_DemoRefactorings {\n" +
- " D_FI fi1;\n" +
- " <CompleteOnType:D_F>;\n" +
- " D_DemoRefactorings() {\n" +
- " }\n" +
- "}\n" +
- "interface D_FI {\n" +
- " void print(String value, int n);\n" +
+ "class D_DemoRefactorings {\n" +
+ " D_FI fi1;\n" +
+ " <CompleteOnType:D_F>;\n" +
+ " D_DemoRefactorings() {\n" +
+ " }\n" +
+ "}\n" +
+ "interface D_FI {\n" +
+ " void print(String value, int n);\n" +
"}\n";
checkMethodParse(
@@ -1935,7 +1935,7 @@ public void test430667a() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430667, [1.8][content assist] no proposals around lambda as a field
public void test430667b() {
- String string =
+ String string =
"public class D_DemoRefactorings {\n" +
" D_F\n" +
" D_FI fi1= (String value, int n) -> {\n" +
@@ -1947,7 +1947,7 @@ public void test430667b() {
"interface D_FI {\n" +
" void print(String value, int n);\n" +
"}\n";
-
+
String completeBehind = "D_F";
int cursorLocation = string.indexOf(completeBehind) + completeBehind.length() - 1;
@@ -1956,14 +1956,14 @@ public void test430667b() {
String completionIdentifier = "D_F";
String expectedReplacedSource = "D_F";
String expectedUnitDisplayString =
- "public class D_DemoRefactorings {\n" +
- " <CompleteOnType:D_F>;\n" +
- " D_FI fi1;\n" +
- " public D_DemoRefactorings() {\n" +
- " }\n" +
- "}\n" +
- "interface D_FI {\n" +
- " void print(String value, int n);\n" +
+ "public class D_DemoRefactorings {\n" +
+ " <CompleteOnType:D_F>;\n" +
+ " D_FI fi1;\n" +
+ " public D_DemoRefactorings() {\n" +
+ " }\n" +
+ "}\n" +
+ "interface D_FI {\n" +
+ " void print(String value, int n);\n" +
"}\n";
checkMethodParse(
@@ -1978,7 +1978,7 @@ public void test430667b() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430667, [1.8][content assist] no proposals around lambda as a field
public void test430667c() {
- String string =
+ String string =
"public interface Foo {\n" +
" int run(int s1, int s2);\n" +
"}\n" +
@@ -1987,7 +1987,7 @@ public void test430667c() {
" static int another = 3;\n" +
" static int two () { return 2; }\n" +
"}";
-
+
String completeBehind = "(int x5, int x2) -> anot";
int cursorLocation = string.indexOf(completeBehind) + completeBehind.length() - 1;
@@ -1996,16 +1996,16 @@ public void test430667c() {
String completionIdentifier = "anot";
String expectedReplacedSource = "anot";
String expectedUnitDisplayString =
- "public interface Foo {\n" +
- " int run(int s1, int s2);\n" +
- "}\n" +
- "interface B {\n" +
- " static Foo f = (int x5, int x2) -> <CompleteOnName:anot>;\n" +
- " static int another;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " static int two() {\n" +
- " }\n" +
+ "public interface Foo {\n" +
+ " int run(int s1, int s2);\n" +
+ "}\n" +
+ "interface B {\n" +
+ " static Foo f = (int x5, int x2) -> <CompleteOnName:anot>;\n" +
+ " static int another;\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " static int two() {\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -2020,14 +2020,14 @@ public void test430667c() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430667, [1.8][content assist] no proposals around lambda as a field
public void test430667d() {
- String string =
+ String string =
"import java.util.Arrays;\n" +
"import java.util.List;\n" +
"public class X {\n" +
" List<Integer> list = Arrays.asList(1, 2, 3);\n" +
" Object o = list.stream().map((x) -> x * x.hashCode()).forEach(System.out::pri);\n" +
"}\n";
-
+
String completeBehind = "pri";
int cursorLocation = string.indexOf(completeBehind) + completeBehind.length() - 1;
@@ -2036,13 +2036,13 @@ public void test430667d() {
String completionIdentifier = "pri";
String expectedReplacedSource = "System.out::pri";
String expectedUnitDisplayString =
- "import java.util.Arrays;\n" +
- "import java.util.List;\n" +
- "public class X {\n" +
- " List<Integer> list;\n" +
- " Object o = list.stream().map((<no type> x) -> (x * x.hashCode())).forEach(<CompletionOnReferenceExpressionName:System.out::pri>);\n" +
- " public X() {\n" +
- " }\n" +
+ "import java.util.Arrays;\n" +
+ "import java.util.List;\n" +
+ "public class X {\n" +
+ " List<Integer> list;\n" +
+ " Object o = list.stream().map((<no type> x) -> (x * x.hashCode())).forEach(<CompletionOnReferenceExpressionName:System.out::pri>);\n" +
+ " public X() {\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -2055,9 +2055,9 @@ public void test430667d() {
expectedReplacedSource,
"diet ast");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=446765,
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=446765,
public void test446765() {
- String string =
+ String string =
"class Stepper<T> {\n" +
" public interface Step<T> {\n" +
" void run();\n" +
@@ -2092,59 +2092,59 @@ public void test446765() {
" }.run(); \n" +
" } \n" +
"}\n";
-
+
String completeBehind = "response.";
int cursorLocation = string.indexOf(completeBehind) + completeBehind.length() - 1;
String expectedCompletionNodeToString = "<CompleteOnName:response.>";
- String expectedParentNodeToString = "if (<CompleteOnName:response.>)\n" +
+ String expectedParentNodeToString = "if (<CompleteOnName:response.>)\n" +
" ;";
String completionIdentifier = "";
String expectedReplacedSource = "response.";
String expectedUnitDisplayString =
- "class Stepper<T> {\n" +
- " public interface Step<T> {\n" +
- " void run();\n" +
- " }\n" +
- " public Stepper(Handler<AsyncResult<T>> handler) {\n" +
- " }\n" +
- " public final @SafeVarargs void run(Step<T>... steps) {\n" +
- " }\n" +
- "}\n" +
- "interface AsyncResult<T> {\n" +
- "}\n" +
- "interface Handler<E> {\n" +
- " void handle(E event);\n" +
- "}\n" +
- "class Z {\n" +
- " Z() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n" +
- "interface I {\n" +
- " void foo(Z z);\n" +
- "}\n" +
- "class Y {\n" +
- " Y() {\n" +
- " }\n" +
- " void request(I i) {\n" +
- " }\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void test() {\n" +
- " new Stepper<Void>((<no type> r) -> {\n" +
- "}) {\n" +
- " private void step1() {\n" +
- " Y y;\n" +
- " y.request((<no type> response) -> {\n" +
- " <CompleteOnName:response.>;\n" +
- "});\n" +
- " }\n" +
- "}.run();\n" +
- " }\n" +
+ "class Stepper<T> {\n" +
+ " public interface Step<T> {\n" +
+ " void run();\n" +
+ " }\n" +
+ " public Stepper(Handler<AsyncResult<T>> handler) {\n" +
+ " }\n" +
+ " public final @SafeVarargs void run(Step<T>... steps) {\n" +
+ " }\n" +
+ "}\n" +
+ "interface AsyncResult<T> {\n" +
+ "}\n" +
+ "interface Handler<E> {\n" +
+ " void handle(E event);\n" +
+ "}\n" +
+ "class Z {\n" +
+ " Z() {\n" +
+ " }\n" +
+ " void foo() {\n" +
+ " }\n" +
+ "}\n" +
+ "interface I {\n" +
+ " void foo(Z z);\n" +
+ "}\n" +
+ "class Y {\n" +
+ " Y() {\n" +
+ " }\n" +
+ " void request(I i) {\n" +
+ " }\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " void test() {\n" +
+ " new Stepper<Void>((<no type> r) -> {\n" +
+ "}) {\n" +
+ " private void step1() {\n" +
+ " Y y;\n" +
+ " y.request((<no type> response) -> {\n" +
+ " <CompleteOnName:response.>;\n" +
+ "});\n" +
+ " }\n" +
+ "}.run();\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -2159,7 +2159,7 @@ public void test446765() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428735, [1.8][assist] Missing completion proposals inside lambda body expression - other than first token
public void test428735h() {
- String string =
+ String string =
"import java.util.List;\n" +
"class Person {\n" +
" String getLastName() { return null; }\n" +
@@ -2171,7 +2171,7 @@ public void test428735h() {
" else return \"\";\n" +
" }\n" +
"}\n";
-
+
String completeBehind = "x.get";
int cursorLocation = string.indexOf(completeBehind) + completeBehind.length() - 1;
@@ -2180,24 +2180,24 @@ public void test428735h() {
String completionIdentifier = "get";
String expectedReplacedSource = "x.get";
String expectedUnitDisplayString =
- "import java.util.List;\n" +
- "class Person {\n" +
- " Person() {\n" +
- " }\n" +
- " String getLastName() {\n" +
- " }\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void test2(List<Person> people) {\n" +
- " people.sort((<no type> x, <no type> y) -> {\n" +
- " if (true)\n" +
- " return (\"\" + <CompleteOnName:x.get>);\n" +
- " ;\n" +
- " return \"\";\n" +
- "});\n" +
- " }\n" +
+ "import java.util.List;\n" +
+ "class Person {\n" +
+ " Person() {\n" +
+ " }\n" +
+ " String getLastName() {\n" +
+ " }\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " void test2(List<Person> people) {\n" +
+ " people.sort((<no type> x, <no type> y) -> {\n" +
+ " if (true)\n" +
+ " return (\"\" + <CompleteOnName:x.get>);\n" +
+ " ;\n" +
+ " return \"\";\n" +
+ "});\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -2212,7 +2212,7 @@ public void test428735h() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=422468, [1.8][assist] Code assist issues with type elided lambda parameters
public void test422468() { // computing visible elements in lambda scope.
- String string =
+ String string =
"interface I {\n" +
" void foo(X x);\n" +
"}\n" +
@@ -2245,31 +2245,31 @@ public void test422468() { // computing visible elements in lambda scope.
String completionIdentifier = "";
String expectedReplacedSource = "xyz.";
String expectedUnitDisplayString =
- "interface I {\n" +
- " void foo(X x);\n" +
- "}\n" +
- "public class X {\n" +
- " static X xField;\n" +
- " public X() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " static X goo(String s) {\n" +
- " }\n" +
- " static void goo(I i) {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X xLocal;\n" +
- " {\n" +
- " {\n" +
- " goo((<no type> xyz) -> {\n" +
- " X xLambdaLocal;\n" +
+ "interface I {\n" +
+ " void foo(X x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " static X xField;\n" +
+ " public X() {\n" +
+ " }\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " static X goo(String s) {\n" +
+ " }\n" +
+ " static void goo(I i) {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X xLocal;\n" +
+ " {\n" +
+ " {\n" +
+ " goo((<no type> xyz) -> {\n" +
+ " X xLambdaLocal;\n" +
" System.out.println(<CompleteOnName:xyz.>);\n" +
- " ;\n" +
- "});\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ " ;\n" +
+ "});\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -2284,7 +2284,7 @@ public void test422468() { // computing visible elements in lambda scope.
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=473008
public void test473008() {
- String string =
+ String string =
"interface FooFunctional {\n" +
" void function();\n" +
"}\n" +
@@ -2302,16 +2302,16 @@ public void test473008() {
String completionIdentifier = "";
String expectedReplacedSource = "";
String expectedUnitDisplayString =
- "interface FooFunctional {\n" +
- " void function();\n" +
- "}\n" +
- "public class Foo {\n" +
- " public Foo() {\n" +
- " }\n" +
- " public void bar() {\n" +
- " private FooFunctional lambda;\n" +
- " <CompleteOnAllocationExpression:new StringBuffer()>;\n" +
- " }\n" +
+ "interface FooFunctional {\n" +
+ " void function();\n" +
+ "}\n" +
+ "public class Foo {\n" +
+ " public Foo() {\n" +
+ " }\n" +
+ " public void bar() {\n" +
+ " private FooFunctional lambda;\n" +
+ " <CompleteOnAllocationExpression:new StringBuffer()>;\n" +
+ " }\n" +
"}\n";
checkMethodParse(
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest2.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest2.java
index 0318fb79e..f36ef7575 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest2.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest2.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -4159,7 +4159,7 @@ public void test0067_Method(){
String expectedUnitDisplayString =
"package p;\n" +
"public class X {\n" +
- " Object o = new X[]{<CompleteOnName:zzz>};\n" +
+ " Object o = new X[]{<CompleteOnName:zzz>};\n" +
" public X() {\n" +
" }\n" +
"}\n";
@@ -9302,12 +9302,12 @@ public void test0139(){
String completeBehind = "Z.";
int cursorLocation = str.indexOf("Z.") + completeBehind.length() - 1;
String expectedCompletionNodeToString = "<CompleteOnClass:Z.>";
- String expectedParentNodeToString =
- "public class X extends <CompleteOnClass:Z.> {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
+ String expectedParentNodeToString =
+ "public class X extends <CompleteOnClass:Z.> {\n" +
+ " {\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
"}";
String completionIdentifier = "";
String expectedReplacedSource = "Z.";
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionRecoveryTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionRecoveryTest.java
index e4efa645e..f24fb392c 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionRecoveryTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionRecoveryTest.java
@@ -1035,46 +1035,46 @@ public void test25() {
public void test26() {
this.runTestCheckMethodParse(
// compilationUnit:
- "import org.eclipse.swt.*;\n" +
- "import org.eclipse.swt.events.*;\n" +
- "import org.eclipse.swt.widgets.*;\n" +
- "\n" +
- "public class Try {\n" +
- "\n" +
- " void main(Shell shell) {\n" +
- "\n" +
- " final Label label= new Label(shell, SWT.WRAP);\n" +
- " label.addPaintListener(new PaintListener() {\n" +
- " public void paintControl(PaintEvent e) {\n" +
- " e.gc.setLineCap(SWT.CAP_); // content assist after CAP_\n" +
- " }\n" +
- " });\n" +
- "\n" +
- " shell.addControlListener(new ControlAdapter() { });\n" +
- "\n" +
- " while (!shell.isDisposed()) { }\n" +
- " }\n" +
- "}\n" +
+ "import org.eclipse.swt.*;\n" +
+ "import org.eclipse.swt.events.*;\n" +
+ "import org.eclipse.swt.widgets.*;\n" +
+ "\n" +
+ "public class Try {\n" +
+ "\n" +
+ " void main(Shell shell) {\n" +
+ "\n" +
+ " final Label label= new Label(shell, SWT.WRAP);\n" +
+ " label.addPaintListener(new PaintListener() {\n" +
+ " public void paintControl(PaintEvent e) {\n" +
+ " e.gc.setLineCap(SWT.CAP_); // content assist after CAP_\n" +
+ " }\n" +
+ " });\n" +
+ "\n" +
+ " shell.addControlListener(new ControlAdapter() { });\n" +
+ "\n" +
+ " while (!shell.isDisposed()) { }\n" +
+ " }\n" +
+ "}\n" +
"\n",
// completeBehind:
"SWT.CAP_",
// expectedCompletionNodeToString:
"<CompleteOnName:SWT.CAP_>",
// expectedUnitDisplayString:
- "import org.eclipse.swt.*;\n" +
- "import org.eclipse.swt.events.*;\n" +
- "import org.eclipse.swt.widgets.*;\n" +
- "public class Try {\n" +
- " public Try() {\n" +
- " }\n" +
- " void main(Shell shell) {\n" +
- " final Label label;\n" +
- " new PaintListener() {\n" +
- " public void paintControl(PaintEvent e) {\n" +
- " e.gc.setLineCap(<CompleteOnName:SWT.CAP_>);\n" +
- " }\n" +
- " };\n" +
- " }\n" +
+ "import org.eclipse.swt.*;\n" +
+ "import org.eclipse.swt.events.*;\n" +
+ "import org.eclipse.swt.widgets.*;\n" +
+ "public class Try {\n" +
+ " public Try() {\n" +
+ " }\n" +
+ " void main(Shell shell) {\n" +
+ " final Label label;\n" +
+ " new PaintListener() {\n" +
+ " public void paintControl(PaintEvent e) {\n" +
+ " e.gc.setLineCap(<CompleteOnName:SWT.CAP_>);\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
"}\n",
// expectedCompletionIdentifier:
"CAP_",
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java
index 44c0c96ad..3265d2e89 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java
@@ -1107,11 +1107,11 @@ public void test0023() {
expected13ProblemLog;
String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import static for;\n" +
- " ^^^\n" +
- "Syntax error on token \"for\", invalid Name\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " import static for;\n" +
+ " ^^^\n" +
+ "Syntax error on token \"for\", invalid Name\n" +
"----------\n";
runComplianceParserTest(
@@ -1256,21 +1256,21 @@ public void test0027() {
};
String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " for(Object o : switch){\n" +
- " ^\n" +
- "Syntax error on token \":\", delete this token\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " for(Object o : switch){\n" +
- " ^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " for(Object o : switch){\n" +
+ " ^\n" +
+ "Syntax error on token \":\", delete this token\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " for(Object o : switch){\n" +
+ " ^\n" +
"Syntax error, insert \": Expression )\" to complete EnhancedForStatementHeader\n" + // FIXME: bogus suggestion, this rule is compliance 1.5
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " for(Object o : switch){\n" +
- " ^\n" +
- "Syntax error, insert \"Statement\" to complete BlockStatements\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " for(Object o : switch){\n" +
+ " ^\n" +
+ "Syntax error, insert \"Statement\" to complete BlockStatements\n" +
"----------\n";
String expected14ProblemLog =
expected13ProblemLog;
@@ -1524,16 +1524,16 @@ public void _test0032() {
};
String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X <T1 extends String, T2 extends Y {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error on token(s), misplaced construct(s)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " public class X <T1 extends String, T2 extends Y {\n" +
- " ^\n" +
- "Y cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X <T1 extends String, T2 extends Y {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error on token(s), misplaced construct(s)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 1)\n" +
+ " public class X <T1 extends String, T2 extends Y {\n" +
+ " ^\n" +
+ "Y cannot be resolved to a type\n" +
"----------\n";
String expected14ProblemLog =
expected13ProblemLog;
@@ -1639,10 +1639,10 @@ public void test0034() {
"Syntax error, insert \"}\" to complete ClassBody\n" +
:giro */
" ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
+ "Syntax error on tokens, delete these tokens\n" +
"----------\n" +
"2. ERROR in X.java (at line 1)\n" +
- " public class X <T1 extnds String, T2> extends Y {\n" +
+ " public class X <T1 extnds String, T2> extends Y {\n" +
" ^^\n" +
"T1 cannot be resolved to a type\n" +
// SH}
@@ -1654,22 +1654,22 @@ public void test0034() {
"----------\n" +
"1. ERROR in X.java (at line 1)\n" +
//{ObjectTeams
- " public class X <T1 extnds String, T2> extends Y {\n" +
- " ^^\n" +
- "T1 cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
-// orig:
+ " public class X <T1 extnds String, T2> extends Y {\n" +
+ " ^^\n" +
+ "T1 cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 1)\n" +
+// orig:
" public class X <T1 extnds String, T2> extends Y {\n" +
" ^^^^^^\n" +
"Syntax error on token \"extnds\", extends expected\n" +
-/*
+/*
"----------\n" +
"2. ERROR in X.java (at line 1)\n" +
" public class X <T1 extnds String, T2> extends Y {\n" +
" ^^^^^^\n" +
"extnds cannot be resolved to a type\n" +
- :giro */
+ :giro */
// SH}
"----------\n";
@@ -1994,24 +1994,24 @@ public void _test0042() {
};
String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " void ___eval() {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " new Runnable() {\n" +
- " int ___run() throws Throwable {\n" +
- " return blah;\n" +
- " }\n" +
- " private String blarg;\n" +
- " public void run() {\n" +
- " }\n" +
- " };\n" +
- "}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " void ___eval() {\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Syntax error on tokens, delete these tokens\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " new Runnable() {\n" +
+ " int ___run() throws Throwable {\n" +
+ " return blah;\n" +
+ " }\n" +
+ " private String blarg;\n" +
+ " public void run() {\n" +
+ " }\n" +
+ " };\n" +
+ "}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error on tokens, delete these tokens\n" +
"----------\n";
@SuppressWarnings("unused")
String expected14ProblemLog =
@@ -2019,65 +2019,65 @@ public void _test0042() {
@SuppressWarnings("unused")
String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " void ___eval() {\n" +
- " ^^^^\n" +
- "Syntax error on token \"void\", @ expected\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " void ___eval() {\n" +
- " ^\n" +
- "Syntax error on token \")\", delete this token\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " };\n" +
- "}\n" +
- " ^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 23)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 23)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete MemberValue\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 23)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \")\" to complete Modifiers\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 23)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"enum Identifier\" to complete EnumHeader\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 23)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"EnumBody\" to complete CompilationUnit\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " void ___eval() {\n" +
+ " ^^^^\n" +
+ "Syntax error on token \"void\", @ expected\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 1)\n" +
+ " void ___eval() {\n" +
+ " ^\n" +
+ "Syntax error on token \")\", delete this token\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 9)\n" +
+ " };\n" +
+ "}\n" +
+ " ^^^^\n" +
+ "Syntax error on tokens, delete these tokens\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 23)\n" +
+ " }\n" +
+ " ^\n" +
+ "Syntax error, insert \"}\" to complete ClassBody\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 23)\n" +
+ " }\n" +
+ " ^\n" +
+ "Syntax error, insert \"}\" to complete MemberValue\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 23)\n" +
+ " }\n" +
+ " ^\n" +
+ "Syntax error, insert \")\" to complete Modifiers\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 23)\n" +
+ " }\n" +
+ " ^\n" +
+ "Syntax error, insert \"enum Identifier\" to complete EnumHeader\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 23)\n" +
+ " }\n" +
+ " ^\n" +
+ "Syntax error, insert \"EnumBody\" to complete CompilationUnit\n" +
"----------\n";
String expected_Java14_ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " void ___eval() {\n" +
- " ^^^^\n" +
- "Syntax error on token \"void\", record expected\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " void ___eval() {\n" +
- " ^\n" +
- "Syntax error on token \")\", { expected after this token\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 23)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete RecordBody\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " void ___eval() {\n" +
+ " ^^^^\n" +
+ "Syntax error on token \"void\", record expected\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 1)\n" +
+ " void ___eval() {\n" +
+ " ^\n" +
+ "Syntax error on token \")\", { expected after this token\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 23)\n" +
+ " }\n" +
+ " ^\n" +
+ "Syntax error, insert \"}\" to complete RecordBody\n" +
"----------\n";
runComplianceParserTest(
testFiles,
@@ -2146,26 +2146,26 @@ public void test0044() {
};
String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public <T> X(T t){\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " <String>super(\"SUCCESS\");\n" +
- " ^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " <String>super(\"SUCCESS\");\n" +
- " ^^^^^^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public <T> X(T t){\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " }\n" +
+ " ^\n" +
+ "Syntax error on token \"}\", delete this token\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 9)\n" +
+ " <String>super(\"SUCCESS\");\n" +
+ " ^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 9)\n" +
+ " <String>super(\"SUCCESS\");\n" +
+ " ^^^^^^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
"----------\n";
String expected14ProblemLog =
expected13ProblemLog;
@@ -2418,17 +2418,17 @@ public void test0050() {
" ^^^^\n" +
"List cannot be resolved to a type\n" +
"----------\n";
- String expected17ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void foo(List<String>... args) {}\n" +
- " ^^^^\n" +
- "List cannot be resolved to a type\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 2)\n" +
- " void foo(List<String>... args) {}\n" +
- " ^^^^\n" +
- "Type safety: Potential heap pollution via varargs parameter args\n" +
+ String expected17ProblemLog =
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " void foo(List<String>... args) {}\n" +
+ " ^^^^\n" +
+ "List cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 2)\n" +
+ " void foo(List<String>... args) {}\n" +
+ " ^^^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter args\n" +
"----------\n";
runComplianceParserTest(
@@ -2520,10 +2520,10 @@ public void test0052() {
String expected15ProblemLog =
"----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " void foo2() {\n" +
- " ^^^^\n" +
- "Syntax error on token \"void\", record expected\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " void foo2() {\n" +
+ " ^^^^\n" +
+ "Syntax error on token \"void\", record expected\n" +
"----------\n";
runComplianceParserTest(
@@ -2580,11 +2580,11 @@ public void test0054() {
};
String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " try (int i = 0) {};\n" +
- " ^^^^^^^^^\n" +
- "Resource specification not allowed here for source level below 1.7\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " try (int i = 0) {};\n" +
+ " ^^^^^^^^^\n" +
+ "Resource specification not allowed here for source level below 1.7\n" +
"----------\n";
String expected14ProblemLog =
expected13ProblemLog;
@@ -2592,12 +2592,12 @@ public void test0054() {
String expected15ProblemLog =
expected14ProblemLog;
- String expected17ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " try (int i = 0) {};\n" +
- " ^^^\n" +
- "The resource type int does not implement java.lang.AutoCloseable\n" +
+ String expected17ProblemLog =
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " try (int i = 0) {};\n" +
+ " ^^^\n" +
+ "The resource type int does not implement java.lang.AutoCloseable\n" +
"----------\n";
runComplianceParserTest(
testFiles,
@@ -2617,23 +2617,23 @@ public void test0055() {
"import java.io.*;\n" +
"public class X {\n" +
" public static void main(String[] args) {\n" +
- " try {\n" +
- " System.out.println();\n" +
- " Reader r = new FileReader(args[0]);\n" +
- " r.read();\n" +
- " } catch(IOException | RuntimeException e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
+ " try {\n" +
+ " System.out.println();\n" +
+ " Reader r = new FileReader(args[0]);\n" +
+ " r.read();\n" +
+ " } catch(IOException | RuntimeException e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
" }\n" +
"}\n"
};
String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " } catch(IOException | RuntimeException e) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Multi-catch parameters are not allowed for source level below 1.7\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " } catch(IOException | RuntimeException e) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Multi-catch parameters are not allowed for source level below 1.7\n" +
"----------\n";
String expected14ProblemLog =
expected13ProblemLog;
@@ -2648,22 +2648,22 @@ public void test0055() {
expected15ProblemLog
);
}
-// rethrow should not be precisely computed in 1.6-
+// rethrow should not be precisely computed in 1.6-
public void test0056() {
String[] testFiles = new String[] {
"X.java",
"public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
" throw new DaughterOfFoo();\n"+
- " } catch(Foo e) {\n" +
+ " } catch(Foo e) {\n" +
" try {\n" +
" throw e;\n" +
" } catch (SonOfFoo e1) {\n" +
" e1.printStackTrace();\n" +
" } catch (Foo e1) {}\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"+
"class Foo extends Exception {}\n"+
"class SonOfFoo extends Foo {}\n"+
@@ -2671,21 +2671,21 @@ public void test0056() {
};
String expected13ProblemLog =
- "----------\n" +
- "1. WARNING in X.java (at line 14)\n" +
- " class Foo extends Exception {}\n" +
- " ^^^\n" +
- "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 15)\n" +
- " class SonOfFoo extends Foo {}\n" +
- " ^^^^^^^^\n" +
- "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 16)\n" +
- " class DaughterOfFoo extends Foo {}\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 14)\n" +
+ " class Foo extends Exception {}\n" +
+ " ^^^\n" +
+ "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 15)\n" +
+ " class SonOfFoo extends Foo {}\n" +
+ " ^^^^^^^^\n" +
+ "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 16)\n" +
+ " class DaughterOfFoo extends Foo {}\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
"----------\n";
String expected14ProblemLog =
expected13ProblemLog;
@@ -2693,27 +2693,27 @@ public void test0056() {
String expected15ProblemLog =
expected14ProblemLog;
- String expected17ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " } catch (SonOfFoo e1) {\n" +
- " ^^^^^^^^\n" +
- "Unreachable catch block for SonOfFoo. This exception is never thrown from the try statement body\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 14)\n" +
- " class Foo extends Exception {}\n" +
- " ^^^\n" +
- "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 15)\n" +
- " class SonOfFoo extends Foo {}\n" +
- " ^^^^^^^^\n" +
- "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 16)\n" +
- " class DaughterOfFoo extends Foo {}\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ String expected17ProblemLog =
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " } catch (SonOfFoo e1) {\n" +
+ " ^^^^^^^^\n" +
+ "Unreachable catch block for SonOfFoo. This exception is never thrown from the try statement body\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 14)\n" +
+ " class Foo extends Exception {}\n" +
+ " ^^^\n" +
+ "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 15)\n" +
+ " class SonOfFoo extends Foo {}\n" +
+ " ^^^^^^^^\n" +
+ "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 16)\n" +
+ " class DaughterOfFoo extends Foo {}\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
"----------\n";
runComplianceParserTest(
testFiles,
@@ -2736,11 +2736,11 @@ public void test0057() {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public default void foo() { System.out.println(); }\n" +
- " ^^^^^\n" +
- "Default methods are allowed only at source level 1.8 or above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public default void foo() { System.out.println(); }\n" +
+ " ^^^^^\n" +
+ "Default methods are allowed only at source level 1.8 or above\n" +
"----------\n";
runComplianceParserTest(
@@ -2768,11 +2768,11 @@ public void test0058() {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " I i = System::exit;\n" +
- " ^^^^^^^^^^^^\n" +
- "Method references are allowed only at source level 1.8 or above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " I i = System::exit;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Method references are allowed only at source level 1.8 or above\n" +
"----------\n";
runComplianceParserTest(
@@ -2804,16 +2804,16 @@ public void test0059() {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " I i = super::goo;\n" +
- " ^^^^^^^^^^\n" +
- "Method references are allowed only at source level 1.8 or above\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " I i = super::goo;\n" +
- " ^^^^^^^^^^\n" +
- "The method goo(int) from the type Y should be accessed in a static way \n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " I i = super::goo;\n" +
+ " ^^^^^^^^^^\n" +
+ "Method references are allowed only at source level 1.8 or above\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " I i = super::goo;\n" +
+ " ^^^^^^^^^^\n" +
+ "The method goo(int) from the type Y should be accessed in a static way \n" +
"----------\n";
runComplianceParserTest(
@@ -2845,11 +2845,11 @@ public void test0060() {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " I i = new Y()::goo;\n" +
- " ^^^^^^^^^^^^\n" +
- "Method references are allowed only at source level 1.8 or above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " I i = new Y()::goo;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Method references are allowed only at source level 1.8 or above\n" +
"----------\n";
runComplianceParserTest(
@@ -2883,11 +2883,11 @@ public void test0061() {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " I i = Y::new;\n" +
- " ^^^^^^\n" +
- "Constructor references are allowed only at source level 1.8 or above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " I i = Y::new;\n" +
+ " ^^^^^^\n" +
+ "Constructor references are allowed only at source level 1.8 or above\n" +
"----------\n";
runComplianceParserTest(
@@ -2915,11 +2915,11 @@ public void test0062() {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " I i = p -> 10 + 20 + 30;\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " I i = p -> 10 + 20 + 30;\n" +
" ^^^^^^^^^^^^^^^^^\n" +
- "Lambda expressions are allowed only at source level 1.8 or above\n" +
+ "Lambda expressions are allowed only at source level 1.8 or above\n" +
"----------\n";
runComplianceParserTest(
@@ -2951,21 +2951,21 @@ public void test0063() {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " I i = X<String>::foo;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Method references are allowed only at source level 1.8 or above\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " I i = X<String>::foo;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method foo(int) from the type X<String> should be accessed in a static way \n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " I i2 = (p) -> 10;\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " I i = X<String>::foo;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Method references are allowed only at source level 1.8 or above\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " I i = X<String>::foo;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The method foo(int) from the type X<String> should be accessed in a static way \n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " I i2 = (p) -> 10;\n" +
" ^^^^^^^^^\n" +
- "Lambda expressions are allowed only at source level 1.8 or above\n" +
+ "Lambda expressions are allowed only at source level 1.8 or above\n" +
"----------\n";
runComplianceParserTest(
@@ -3038,26 +3038,26 @@ public void testBug391201() {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " @Marker int foo(@Marker int p) {\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are available only when source level is at least 1.8\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " @Marker int foo(@Marker int p) {\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are available only when source level is at least 1.8\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " @Marker int i = 0;\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are available only when source level is at least 1.8\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " @Marker\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are available only when source level is at least 1.8\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " @Marker int foo(@Marker int p) {\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are available only when source level is at least 1.8\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " @Marker int foo(@Marker int p) {\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are available only when source level is at least 1.8\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " @Marker int i = 0;\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are available only when source level is at least 1.8\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " @Marker\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are available only when source level is at least 1.8\n" +
"----------\n";
runComplianceParserTest(
@@ -3088,31 +3088,31 @@ public void testBug399773() {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " default void doitalso () {}\n" +
- " ^^^^^^^^^^^\n" +
- "Default methods are allowed only at source level 1.8 or above\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " default void doitalso () {}\n" +
- " ^^^^^^^^^^^\n" +
- "Default methods are allowed only at source level 1.8 or above\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " Object p = (I & J) () -> {};\n" +
- " ^^^^^\n" +
- "Additional bounds are not allowed in cast operator at source levels below 1.8\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " Object p = (I & J) () -> {};\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " default void doitalso () {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "Default methods are allowed only at source level 1.8 or above\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " default void doitalso () {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "Default methods are allowed only at source level 1.8 or above\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 10)\n" +
+ " Object p = (I & J) () -> {};\n" +
+ " ^^^^^\n" +
+ "Additional bounds are not allowed in cast operator at source levels below 1.8\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 10)\n" +
+ " Object p = (I & J) () -> {};\n" +
" ^^^^^\n" +
- "Lambda expressions are allowed only at source level 1.8 or above\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 10)\n" +
- " Object p = (I & J) () -> {};\n" +
+ "Lambda expressions are allowed only at source level 1.8 or above\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 10)\n" +
+ " Object p = (I & J) () -> {};\n" +
" ^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
+ "The target type of this expression must be a functional interface\n" +
"----------\n";
runComplianceParserTest(
@@ -3138,11 +3138,11 @@ public void testBug399778() {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " List<String> l = null == null ? Arrays.asList() : Arrays.asList(\"Hello\",\"world\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from List<capture#1-of ? extends Object> to List<String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " List<String> l = null == null ? Arrays.asList() : Arrays.asList(\"Hello\",\"world\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from List<capture#1-of ? extends Object> to List<String>\n" +
"----------\n";
runComplianceParserTest(
@@ -3169,11 +3169,11 @@ public void testBug399778a() {
};
String expectedProblemLog =
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " List<String> l = (List<String>) (null == null ? Arrays.asList() : Arrays.asList(\"Hello\",\"world\"));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from List<capture#1-of ? extends Object> to List<String>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " List<String> l = (List<String>) (null == null ? Arrays.asList() : Arrays.asList(\"Hello\",\"world\"));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from List<capture#1-of ? extends Object> to List<String>\n" +
"----------\n";
runComplianceParserTest(
@@ -3201,26 +3201,26 @@ public void testBug399780() {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in I.java (at line 2)\n" +
- " public static void foo1() { System.out.println(); }\n" +
- " ^^^^^^\n" +
- "Static methods are allowed in interfaces only at source level 1.8 or above\n" +
- "----------\n" +
- "2. ERROR in I.java (at line 2)\n" +
- " public static void foo1() { System.out.println(); }\n" +
- " ^^^^^^\n" +
- "Illegal modifier for the interface method foo1; only public & abstract are permitted\n" +
- "----------\n" +
- "3. ERROR in I.java (at line 3)\n" +
- " public static void foo2();\n" +
- " ^^^^^^\n" +
- "Illegal modifier for the interface method foo2; only public & abstract are permitted\n" +
- "----------\n" +
- "4. ERROR in I.java (at line 4)\n" +
- " public abstract static void foo3();\n" +
- " ^^^^^^\n" +
- "Illegal modifier for the interface method foo3; only public & abstract are permitted\n" +
+ "----------\n" +
+ "1. ERROR in I.java (at line 2)\n" +
+ " public static void foo1() { System.out.println(); }\n" +
+ " ^^^^^^\n" +
+ "Static methods are allowed in interfaces only at source level 1.8 or above\n" +
+ "----------\n" +
+ "2. ERROR in I.java (at line 2)\n" +
+ " public static void foo1() { System.out.println(); }\n" +
+ " ^^^^^^\n" +
+ "Illegal modifier for the interface method foo1; only public & abstract are permitted\n" +
+ "----------\n" +
+ "3. ERROR in I.java (at line 3)\n" +
+ " public static void foo2();\n" +
+ " ^^^^^^\n" +
+ "Illegal modifier for the interface method foo2; only public & abstract are permitted\n" +
+ "----------\n" +
+ "4. ERROR in I.java (at line 4)\n" +
+ " public abstract static void foo3();\n" +
+ " ^^^^^^\n" +
+ "Illegal modifier for the interface method foo3; only public & abstract are permitted\n" +
"----------\n";
runComplianceParserTest(
@@ -3254,58 +3254,58 @@ public void testBug399781() {
};
String usLevel = this.complianceLevel < ClassFileConstants.JDK9 ? "WARNING" : "ERROR";
String expectedProblemLog =
- "----------\n" +
- "1. " + usLevel +" in X.java (at line 2)\n" +
- " int _;\n" +
- " ^\n" +
- "\'_\' should not be used as an identifier, since it is a reserved keyword from source level 1.8 on\n" +
- "----------\n" +
- "2. " + usLevel +" in X.java (at line 4)\n" +
- " int _ = 3;\n" +
- " ^\n" +
- "\'_\' should not be used as an identifier, since it is a reserved keyword from source level 1.8 on\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 4)\n" +
- " int _ = 3;\n" +
- " ^\n" +
- "The local variable _ is hiding a field from type X\n" +
- "----------\n" +
- "4. " + usLevel +" in X.java (at line 8)\n" +
- " void goo(int _) {}\n" +
- " ^\n" +
- "\'_\' should not be used as an identifier, since it is a reserved keyword from source level 1.8 on\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 8)\n" +
- " void goo(int _) {}\n" +
- " ^\n" +
- "The parameter _ is hiding a field from type X\n" +
- "----------\n" +
- "6. " + usLevel +" in X.java (at line 11)\n" +
- " } catch (Exception _) {\n" +
- " ^\n" +
- "\'_\' should not be used as an identifier, since it is a reserved keyword from source level 1.8 on\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 11)\n" +
- " } catch (Exception _) {\n" +
- " ^\n" +
- "The parameter _ is hiding a field from type X\n" +
+ "----------\n" +
+ "1. " + usLevel +" in X.java (at line 2)\n" +
+ " int _;\n" +
+ " ^\n" +
+ "\'_\' should not be used as an identifier, since it is a reserved keyword from source level 1.8 on\n" +
+ "----------\n" +
+ "2. " + usLevel +" in X.java (at line 4)\n" +
+ " int _ = 3;\n" +
+ " ^\n" +
+ "\'_\' should not be used as an identifier, since it is a reserved keyword from source level 1.8 on\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 4)\n" +
+ " int _ = 3;\n" +
+ " ^\n" +
+ "The local variable _ is hiding a field from type X\n" +
+ "----------\n" +
+ "4. " + usLevel +" in X.java (at line 8)\n" +
+ " void goo(int _) {}\n" +
+ " ^\n" +
+ "\'_\' should not be used as an identifier, since it is a reserved keyword from source level 1.8 on\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 8)\n" +
+ " void goo(int _) {}\n" +
+ " ^\n" +
+ "The parameter _ is hiding a field from type X\n" +
+ "----------\n" +
+ "6. " + usLevel +" in X.java (at line 11)\n" +
+ " } catch (Exception _) {\n" +
+ " ^\n" +
+ "\'_\' should not be used as an identifier, since it is a reserved keyword from source level 1.8 on\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 11)\n" +
+ " } catch (Exception _) {\n" +
+ " ^\n" +
+ "The parameter _ is hiding a field from type X\n" +
"----------\n";
String expected13ProblemLog =
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " int _ = 3;\n" +
- " ^\n" +
- "The local variable _ is hiding a field from type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " void goo(int _) {}\n" +
- " ^\n" +
- "The parameter _ is hiding a field from type X\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 11)\n" +
- " } catch (Exception _) {\n" +
- " ^\n" +
- "The parameter _ is hiding a field from type X\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " int _ = 3;\n" +
+ " ^\n" +
+ "The local variable _ is hiding a field from type X\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " void goo(int _) {}\n" +
+ " ^\n" +
+ "The parameter _ is hiding a field from type X\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 11)\n" +
+ " } catch (Exception _) {\n" +
+ " ^\n" +
+ "The parameter _ is hiding a field from type X\n" +
"----------\n";
runComplianceParserTest(
@@ -3320,10 +3320,10 @@ public void testBug399781() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406846: [1.8] compiler NPE for method reference/lambda code compiled with < 1.8 compliance
public void test406846() {
-
+
if (this.complianceLevel >= ClassFileConstants.JDK1_8) // tested in LET.
return;
-
+
String[] testFiles = new String[] {
"X.java",
"import java.util.*;\n" +
@@ -3348,58 +3348,58 @@ public void test406846() {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " eachWithIndex(list,X::printItem);\n" +
- " ^^^^^^^^^^^^\n" +
- "Method references are allowed only at source level 1.8 or above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " eachWithIndex(list,X::printItem);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Method references are allowed only at source level 1.8 or above\n" +
"----------\n";
String expected1314ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " public static <E> void printItem(E value, int index) {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " String output = String.format(\"%d -> %s\", index, value);\n" +
- " ^^^^^^\n" +
- "The method format(String, Object[]) in the type String is not applicable for the arguments (String, int, E)\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " List<String> list = Arrays.asList(\"A\",\"B\",\"C\");\n" +
- " ^^^^^^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " List<String> list = Arrays.asList(\"A\",\"B\",\"C\");\n" +
- " ^^^^^^\n" +
- "The method asList(T[]) in the type Arrays is not applicable for the arguments (String, String, String)\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 9)\n" +
- " eachWithIndex(list,X::printItem);\n" +
- " ^^^^^^^^^^^^\n" +
- "Method references are allowed only at source level 1.8 or above\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 11)\n" +
- " interface ItemWithIndexVisitor<E> {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 14)\n" +
- " public static <E> void eachWithIndex(List<E> list, ItemWithIndexVisitor<E> visitor) {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 14)\n" +
- " public static <E> void eachWithIndex(List<E> list, ItemWithIndexVisitor<E> visitor) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 14)\n" +
- " public static <E> void eachWithIndex(List<E> list, ItemWithIndexVisitor<E> visitor) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " public static <E> void printItem(E value, int index) {\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " String output = String.format(\"%d -> %s\", index, value);\n" +
+ " ^^^^^^\n" +
+ "The method format(String, Object[]) in the type String is not applicable for the arguments (String, int, E)\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " List<String> list = Arrays.asList(\"A\",\"B\",\"C\");\n" +
+ " ^^^^^^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " List<String> list = Arrays.asList(\"A\",\"B\",\"C\");\n" +
+ " ^^^^^^\n" +
+ "The method asList(T[]) in the type Arrays is not applicable for the arguments (String, String, String)\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 9)\n" +
+ " eachWithIndex(list,X::printItem);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Method references are allowed only at source level 1.8 or above\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 11)\n" +
+ " interface ItemWithIndexVisitor<E> {\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 14)\n" +
+ " public static <E> void eachWithIndex(List<E> list, ItemWithIndexVisitor<E> visitor) {\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 14)\n" +
+ " public static <E> void eachWithIndex(List<E> list, ItemWithIndexVisitor<E> visitor) {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 14)\n" +
+ " public static <E> void eachWithIndex(List<E> list, ItemWithIndexVisitor<E> visitor) {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
"----------\n";
runComplianceParserTest(
@@ -3415,7 +3415,7 @@ public void test406846() {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401850: [1.8][compiler] Compiler fails to type poly allocation expressions in method invocation contexts
// FAIL: sub-optimal overload picked
public void test401850() {
-
+
if (this.complianceLevel < ClassFileConstants.JDK1_7)
return;
this.runConformTest(
@@ -3467,17 +3467,17 @@ public void test429110() {
" return arg;\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " List<@NonNull String> foo(List<@NonNull String> arg) {\n" +
- " ^^^^^^^^\n" +
- "Syntax error, type annotations are available only when source level is at least 1.8\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " List<@NonNull String> foo(List<@NonNull String> arg) {\n" +
- " ^^^^^^^^\n" +
- "Syntax error, type annotations are available only when source level is at least 1.8\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " List<@NonNull String> foo(List<@NonNull String> arg) {\n" +
+ " ^^^^^^^^\n" +
+ "Syntax error, type annotations are available only when source level is at least 1.8\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " List<@NonNull String> foo(List<@NonNull String> arg) {\n" +
+ " ^^^^^^^^\n" +
+ "Syntax error, type annotations are available only when source level is at least 1.8\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=421477: [1.8][compiler] strange error message for default method in class
@@ -3550,16 +3550,16 @@ public void testBug440285() {
" Function<Integer, int[]> m1 = int[]::<Y, Z>new;\n" +
" Function<Integer, int[]> m2 = int[]::<Y>new;\n" +
"}",},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " Function<Integer, int[]> m1 = int[]::<Y, Z>new;\n" +
- " ^^^^\n" +
- "Type arguments are not allowed here\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " Function<Integer, int[]> m2 = int[]::<Y>new;\n" +
- " ^\n" +
- "Type arguments are not allowed here\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " Function<Integer, int[]> m1 = int[]::<Y, Z>new;\n" +
+ " ^^^^\n" +
+ "Type arguments are not allowed here\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " Function<Integer, int[]> m2 = int[]::<Y>new;\n" +
+ " ^\n" +
+ "Type arguments are not allowed here\n" +
"----------\n");
}
public void testBug531714_001() {
@@ -3583,30 +3583,30 @@ public void testBug531714_001() {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " int tw = switch (i) {\n" +
- " case 0 -> i * 0;\n" +
- " case 1 -> 2;\n" +
- " default -> 3;\n" +
- " };\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Switch Expressions are supported from Java 14 onwards only\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " case 0 -> i * 0;\n" +
- " ^^^^^^\n" +
- "Arrow in case statement supported from Java 14 onwards only\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " case 1 -> 2;\n" +
- " ^^^^^^\n" +
- "Arrow in case statement supported from Java 14 onwards only\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " default -> 3;\n" +
- " ^^^^^^^\n" +
- "Arrow in case statement supported from Java 14 onwards only\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " int tw = switch (i) {\n" +
+ " case 0 -> i * 0;\n" +
+ " case 1 -> 2;\n" +
+ " default -> 3;\n" +
+ " };\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Switch Expressions are supported from Java 14 onwards only\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " case 0 -> i * 0;\n" +
+ " ^^^^^^\n" +
+ "Arrow in case statement supported from Java 14 onwards only\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " case 1 -> 2;\n" +
+ " ^^^^^^\n" +
+ "Arrow in case statement supported from Java 14 onwards only\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " default -> 3;\n" +
+ " ^^^^^^^\n" +
+ "Arrow in case statement supported from Java 14 onwards only\n" +
"----------\n";
runComplianceParserTest(
@@ -3639,21 +3639,21 @@ public void testBug531714_002() {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case 0 -> i * 0;\n" +
- " ^^^^^^\n" +
- "Arrow in case statement supported from Java 14 onwards only\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " case 1 -> 2;\n" +
- " ^^^^^^\n" +
- "Arrow in case statement supported from Java 14 onwards only\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " default -> 3;\n" +
- " ^^^^^^^\n" +
- "Arrow in case statement supported from Java 14 onwards only\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case 0 -> i * 0;\n" +
+ " ^^^^^^\n" +
+ "Arrow in case statement supported from Java 14 onwards only\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " case 1 -> 2;\n" +
+ " ^^^^^^\n" +
+ "Arrow in case statement supported from Java 14 onwards only\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " default -> 3;\n" +
+ " ^^^^^^^\n" +
+ "Arrow in case statement supported from Java 14 onwards only\n" +
"----------\n";
runComplianceParserTest(
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DietRecoveryTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DietRecoveryTest.java
index 7fda33cb8..212e32411 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DietRecoveryTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DietRecoveryTest.java
@@ -685,7 +685,7 @@ public void test05() {
" }\n" +
" void foo() {\n" +
" System.out.println();\n" +
- " void baz;\n" +
+ " void baz;\n" +
" }\n" +
" void bar() {\n" +
" }\n" +
@@ -1987,9 +1987,9 @@ public void test25() {
" \n" +
" void bar(){ \n" +
" void truc(){ \n" +
-//{ObjectTeams: Unfortunately our parser needs one more '}' which I think is somewhat acceptable
- "} \n" +
-// SH}
+//{ObjectTeams: Unfortunately our parser needs one more '}' which I think is somewhat acceptable
+ "} \n" +
+// SH}
"} \n";
String expectedDietUnitToString =
@@ -4663,23 +4663,23 @@ public void test75() {
String expectedCompletionDietUnitToString =
"package ZKentTest;\n" +
- "import java.awt.color.*;\n" +
- "public class A {\n" +
- " int[] ii;\n" +
- " public A() {\n" +
- " }\n" +
- " A foo(int i) {\n" +
- " }\n" +
- "}\n" +
- "class Local {\n" +
- " Local() {\n" +
- " }\n" +
- " int hello() {\n" +
- " }\n" +
- " int world() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
+ "import java.awt.color.*;\n" +
+ "public class A {\n" +
+ " int[] ii;\n" +
+ " public A() {\n" +
+ " }\n" +
+ " A foo(int i) {\n" +
+ " }\n" +
+ "}\n" +
+ "class Local {\n" +
+ " Local() {\n" +
+ " }\n" +
+ " int hello() {\n" +
+ " }\n" +
+ " int world() {\n" +
+ " }\n" +
+ " void foo() {\n" +
+ " }\n" +
"}\n";
String testName = "<bunch of syntax errors>";
@@ -6011,14 +6011,14 @@ public void test99() {
" removes the;\n" +
" thread restriction;\n" +
" will need = (re - create);\n" +
-//{ObjectTeams our compiler recovers less than the orig
+//{ObjectTeams our compiler recovers less than the orig
/* orig:
" request as;\n" +
" does not;\n" +
" the removal;\n" +
" thread = $missing$;\n" +
:giro */
-// SH}
+// SH}
" }\n" +
" public IJavaThread[] getThreadFilters() {\n" +
" return the;\n" +
@@ -7631,12 +7631,12 @@ public void _test124() {
"}\n";
} else {
expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "public class Test {\n" +
- " public Test() {\n" +
- " super();\n" +
- " }\n" +
- " void aMethod() {\n" +
- " }\n" +
+ "public class Test {\n" +
+ " public Test() {\n" +
+ " super();\n" +
+ " }\n" +
+ " void aMethod() {\n" +
+ " }\n" +
"}\n";
}
@@ -7669,7 +7669,7 @@ public void test125() {
String s =
"public class Test {\n" +
"}\n";
-
+
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 1000; i++) {
buf.append("class AClass #\n");
@@ -7700,14 +7700,14 @@ public void test125() {
buf.append(indent).append(" }\n");
buf.append(indent).append("}\n");
}
-
+
expectedDietUnitToString += buf.toString();
-
+
// expectedDietPlusBodyUnitToString
String expectedDietPlusBodyUnitToString =
"public class Test {\n" +
" public Test() {\n" +
- " super();\n" +
+ " super();\n" +
" }\n" +
"}\n";
buf = new StringBuffer();
@@ -7764,52 +7764,52 @@ public void test126() {
"}\n";
String expectedDietUnitToString =
- "package p;\n" +
- "public class ContextTest {\n" +
- " private Context context = new Context();\n" +
- " public ContextTest() {\n" +
- " }\n" +
- " public void test() {\n" +
- " }\n" +
+ "package p;\n" +
+ "public class ContextTest {\n" +
+ " private Context context = new Context();\n" +
+ " public ContextTest() {\n" +
+ " }\n" +
+ " public void test() {\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyUnitToString =
- "package p;\n" +
- "public class ContextTest {\n" +
- " private Context context = new Context();\n" +
- " public ContextTest() {\n" +
- " super();\n" +
- " }\n" +
- " public void test() {\n" +
- " }\n" +
+ "package p;\n" +
+ "public class ContextTest {\n" +
+ " private Context context = new Context();\n" +
+ " public ContextTest() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void test() {\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "package p;\n" +
- "public class ContextTest {\n" +
- " private Context context = new Context();\n" +
- " public ContextTest() {\n" +
- " super();\n" +
- " }\n" +
- " public void test() {\n" +
- " context.new Callback() {\n" +
- " public void doit(int value) {\n" +
- " }\n" +
- " };\n" +
- " }\n" +
+ "package p;\n" +
+ "public class ContextTest {\n" +
+ " private Context context = new Context();\n" +
+ " public ContextTest() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void test() {\n" +
+ " context.new Callback() {\n" +
+ " public void doit(int value) {\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
"}\n";
String expectedFullUnitToString =
expectedDietUnitToString;
String expectedCompletionDietUnitToString =
- "package p;\n" +
- "public class ContextTest {\n" +
- " private Context context;\n" +
- " public ContextTest() {\n" +
- " }\n" +
- " public void test() {\n" +
- " }\n" +
+ "package p;\n" +
+ "public class ContextTest {\n" +
+ " private Context context;\n" +
+ " public ContextTest() {\n" +
+ " }\n" +
+ " public void test() {\n" +
+ " }\n" +
"}\n";
String testName = "test";
@@ -7824,114 +7824,114 @@ public void test126() {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=201762
public void test127() {
String s =
- "import org.eclipse.swt.*;\n" +
- "import org.eclipse.swt.events.*;\n" +
- "import org.eclipse.swt.widgets.*;\n" +
- "\n" +
- "public class Try {\n" +
- "\n" +
- " void main(Shell shell) {\n" +
- "\n" +
- " final Label label= new Label(shell, SWT.WRAP);\n" +
- " label.addPaintListener(new PaintListener() {\n" +
- " public void paintControl(PaintEvent e) {\n" +
- " e.gc.setLineCap(SWT.CAP_); // content assist after CAP_\n" +
- " }\n" +
- " });\n" +
- "\n" +
- " shell.addControlListener(new ControlAdapter() { });\n" +
- "\n" +
- " while (!shell.isDisposed()) { }\n" +
- " }\n" +
- "}\n" +
+ "import org.eclipse.swt.*;\n" +
+ "import org.eclipse.swt.events.*;\n" +
+ "import org.eclipse.swt.widgets.*;\n" +
+ "\n" +
+ "public class Try {\n" +
+ "\n" +
+ " void main(Shell shell) {\n" +
+ "\n" +
+ " final Label label= new Label(shell, SWT.WRAP);\n" +
+ " label.addPaintListener(new PaintListener() {\n" +
+ " public void paintControl(PaintEvent e) {\n" +
+ " e.gc.setLineCap(SWT.CAP_); // content assist after CAP_\n" +
+ " }\n" +
+ " });\n" +
+ "\n" +
+ " shell.addControlListener(new ControlAdapter() { });\n" +
+ "\n" +
+ " while (!shell.isDisposed()) { }\n" +
+ " }\n" +
+ "}\n" +
"\n";
String expectedDietUnitToString =
- "import org.eclipse.swt.*;\n" +
- "import org.eclipse.swt.events.*;\n" +
- "import org.eclipse.swt.widgets.*;\n" +
- "public class Try {\n" +
- " public Try() {\n" +
- " }\n" +
- " void main(Shell shell) {\n" +
- " }\n" +
+ "import org.eclipse.swt.*;\n" +
+ "import org.eclipse.swt.events.*;\n" +
+ "import org.eclipse.swt.widgets.*;\n" +
+ "public class Try {\n" +
+ " public Try() {\n" +
+ " }\n" +
+ " void main(Shell shell) {\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyUnitToString =
- "import org.eclipse.swt.*;\n" +
- "import org.eclipse.swt.events.*;\n" +
- "import org.eclipse.swt.widgets.*;\n" +
- "public class Try {\n" +
- " public Try() {\n" +
- " super();\n" +
- " }\n" +
- " void main(Shell shell) {\n" +
- " final Label label = new Label(shell, SWT.WRAP);\n" +
- " label.addPaintListener(new PaintListener() {\n" +
- " public void paintControl(PaintEvent e) {\n" +
- " e.gc.setLineCap(SWT.CAP_);\n" +
- " }\n" +
- "});\n" +
- " shell.addControlListener(new ControlAdapter() {\n" +
- "});\n" +
- " while ((! shell.isDisposed())) {\n" +
- " }\n" +
- " }\n" +
+ "import org.eclipse.swt.*;\n" +
+ "import org.eclipse.swt.events.*;\n" +
+ "import org.eclipse.swt.widgets.*;\n" +
+ "public class Try {\n" +
+ " public Try() {\n" +
+ " super();\n" +
+ " }\n" +
+ " void main(Shell shell) {\n" +
+ " final Label label = new Label(shell, SWT.WRAP);\n" +
+ " label.addPaintListener(new PaintListener() {\n" +
+ " public void paintControl(PaintEvent e) {\n" +
+ " e.gc.setLineCap(SWT.CAP_);\n" +
+ " }\n" +
+ "});\n" +
+ " shell.addControlListener(new ControlAdapter() {\n" +
+ "});\n" +
+ " while ((! shell.isDisposed())) {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "import org.eclipse.swt.*;\n" +
- "import org.eclipse.swt.events.*;\n" +
- "import org.eclipse.swt.widgets.*;\n" +
- "public class Try {\n" +
- " public Try() {\n" +
- " super();\n" +
- " }\n" +
- " void main(Shell shell) {\n" +
- " final Label label = new Label(shell, SWT.WRAP);\n" +
- " label.addPaintListener(new PaintListener() {\n" +
- " public void paintControl(PaintEvent e) {\n" +
- " e.gc.setLineCap(SWT.CAP_);\n" +
- " }\n" +
- "});\n" +
- " shell.addControlListener(new ControlAdapter() {\n" +
- "});\n" +
- " while ((! shell.isDisposed())) {\n" +
- " }\n" +
- " }\n" +
+ "import org.eclipse.swt.*;\n" +
+ "import org.eclipse.swt.events.*;\n" +
+ "import org.eclipse.swt.widgets.*;\n" +
+ "public class Try {\n" +
+ " public Try() {\n" +
+ " super();\n" +
+ " }\n" +
+ " void main(Shell shell) {\n" +
+ " final Label label = new Label(shell, SWT.WRAP);\n" +
+ " label.addPaintListener(new PaintListener() {\n" +
+ " public void paintControl(PaintEvent e) {\n" +
+ " e.gc.setLineCap(SWT.CAP_);\n" +
+ " }\n" +
+ "});\n" +
+ " shell.addControlListener(new ControlAdapter() {\n" +
+ "});\n" +
+ " while ((! shell.isDisposed())) {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedFullUnitToString =
- "import org.eclipse.swt.*;\n" +
- "import org.eclipse.swt.events.*;\n" +
- "import org.eclipse.swt.widgets.*;\n" +
- "public class Try {\n" +
- " public Try() {\n" +
- " super();\n" +
- " }\n" +
- " void main(Shell shell) {\n" +
- " final Label label = new Label(shell, SWT.WRAP);\n" +
- " label.addPaintListener(new PaintListener() {\n" +
- " public void paintControl(PaintEvent e) {\n" +
- " e.gc.setLineCap(SWT.CAP_);\n" +
- " }\n" +
- "});\n" +
- " shell.addControlListener(new ControlAdapter() {\n" +
- "});\n" +
- " while ((! shell.isDisposed())) {\n" +
- " }\n" +
- " }\n" +
+ "import org.eclipse.swt.*;\n" +
+ "import org.eclipse.swt.events.*;\n" +
+ "import org.eclipse.swt.widgets.*;\n" +
+ "public class Try {\n" +
+ " public Try() {\n" +
+ " super();\n" +
+ " }\n" +
+ " void main(Shell shell) {\n" +
+ " final Label label = new Label(shell, SWT.WRAP);\n" +
+ " label.addPaintListener(new PaintListener() {\n" +
+ " public void paintControl(PaintEvent e) {\n" +
+ " e.gc.setLineCap(SWT.CAP_);\n" +
+ " }\n" +
+ "});\n" +
+ " shell.addControlListener(new ControlAdapter() {\n" +
+ "});\n" +
+ " while ((! shell.isDisposed())) {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedCompletionDietUnitToString =
- "import org.eclipse.swt.*;\n" +
- "import org.eclipse.swt.events.*;\n" +
- "import org.eclipse.swt.widgets.*;\n" +
- "public class Try {\n" +
- " public Try() {\n" +
- " }\n" +
- " void main(Shell shell) {\n" +
- " }\n" +
+ "import org.eclipse.swt.*;\n" +
+ "import org.eclipse.swt.events.*;\n" +
+ "import org.eclipse.swt.widgets.*;\n" +
+ "public class Try {\n" +
+ " public Try() {\n" +
+ " }\n" +
+ " void main(Shell shell) {\n" +
+ " }\n" +
"}\n";
String testName = "test";
@@ -7946,93 +7946,93 @@ public void test127() {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=201762
public void test128() {
String s =
- "import org.eclipse.swt.*;\n" +
- "import org.eclipse.swt.events.*;\n" +
- "import org.eclipse.swt.widgets.*;\n" +
- "\n" +
- "public class Try {\n" +
- "\n" +
- " void main(Shell shell) {\n" +
- "\n" +
- " final Label label= new Label(shell, SWT.WRAP);\n" +
- " label.addPaintListener(new PaintListener() {\n" +
- " public void paintControl(PaintEvent e) {\n" +
- " e.gc.setLineCap(SWT.CAP_#); // content assist after CAP_\n" +
- " }\n" +
- " });\n" +
- "\n" +
- " shell.addControlListener(new ControlAdapter() { });\n" +
- "\n" +
- " while (!shell.isDisposed()) { }\n" +
- " }\n" +
- "}\n" +
+ "import org.eclipse.swt.*;\n" +
+ "import org.eclipse.swt.events.*;\n" +
+ "import org.eclipse.swt.widgets.*;\n" +
+ "\n" +
+ "public class Try {\n" +
+ "\n" +
+ " void main(Shell shell) {\n" +
+ "\n" +
+ " final Label label= new Label(shell, SWT.WRAP);\n" +
+ " label.addPaintListener(new PaintListener() {\n" +
+ " public void paintControl(PaintEvent e) {\n" +
+ " e.gc.setLineCap(SWT.CAP_#); // content assist after CAP_\n" +
+ " }\n" +
+ " });\n" +
+ "\n" +
+ " shell.addControlListener(new ControlAdapter() { });\n" +
+ "\n" +
+ " while (!shell.isDisposed()) { }\n" +
+ " }\n" +
+ "}\n" +
"\n";
String expectedDietUnitToString =
- "import org.eclipse.swt.*;\n" +
- "import org.eclipse.swt.events.*;\n" +
- "import org.eclipse.swt.widgets.*;\n" +
- "public class Try {\n" +
- " public Try() {\n" +
- " }\n" +
- " void main(Shell shell) {\n" +
- " }\n" +
+ "import org.eclipse.swt.*;\n" +
+ "import org.eclipse.swt.events.*;\n" +
+ "import org.eclipse.swt.widgets.*;\n" +
+ "public class Try {\n" +
+ " public Try() {\n" +
+ " }\n" +
+ " void main(Shell shell) {\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyUnitToString =
- "import org.eclipse.swt.*;\n" +
- "import org.eclipse.swt.events.*;\n" +
- "import org.eclipse.swt.widgets.*;\n" +
- "public class Try {\n" +
- " public Try() {\n" +
- " super();\n" +
- " }\n" +
- " void main(Shell shell) {\n" +
- " }\n" +
+ "import org.eclipse.swt.*;\n" +
+ "import org.eclipse.swt.events.*;\n" +
+ "import org.eclipse.swt.widgets.*;\n" +
+ "public class Try {\n" +
+ " public Try() {\n" +
+ " super();\n" +
+ " }\n" +
+ " void main(Shell shell) {\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "import org.eclipse.swt.*;\n" +
- "import org.eclipse.swt.events.*;\n" +
- "import org.eclipse.swt.widgets.*;\n" +
- "public class Try {\n" +
- " public Try() {\n" +
- " super();\n" +
- " }\n" +
- " void main(Shell shell) {\n" +
- " final Label label = new Label(shell, SWT.WRAP);\n" +
- " label.addPaintListener(new PaintListener() {\n" +
- " public void paintControl(PaintEvent e) {\n" +
- " e.gc.setLineCap(SWT.CAP_);\n" +
- " }\n" +
- "});\n" +
- " shell.addControlListener(new ControlAdapter() {\n" +
- "});\n" +
- " while ((! shell.isDisposed())) {\n" +
- " }\n" +
- " }\n" +
+ "import org.eclipse.swt.*;\n" +
+ "import org.eclipse.swt.events.*;\n" +
+ "import org.eclipse.swt.widgets.*;\n" +
+ "public class Try {\n" +
+ " public Try() {\n" +
+ " super();\n" +
+ " }\n" +
+ " void main(Shell shell) {\n" +
+ " final Label label = new Label(shell, SWT.WRAP);\n" +
+ " label.addPaintListener(new PaintListener() {\n" +
+ " public void paintControl(PaintEvent e) {\n" +
+ " e.gc.setLineCap(SWT.CAP_);\n" +
+ " }\n" +
+ "});\n" +
+ " shell.addControlListener(new ControlAdapter() {\n" +
+ "});\n" +
+ " while ((! shell.isDisposed())) {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedFullUnitToString =
- "import org.eclipse.swt.*;\n" +
- "import org.eclipse.swt.events.*;\n" +
- "import org.eclipse.swt.widgets.*;\n" +
- "public class Try {\n" +
- " public Try() {\n" +
- " }\n" +
- " void main(Shell shell) {\n" +
- " }\n" +
+ "import org.eclipse.swt.*;\n" +
+ "import org.eclipse.swt.events.*;\n" +
+ "import org.eclipse.swt.widgets.*;\n" +
+ "public class Try {\n" +
+ " public Try() {\n" +
+ " }\n" +
+ " void main(Shell shell) {\n" +
+ " }\n" +
"}\n";
String expectedCompletionDietUnitToString =
- "import org.eclipse.swt.*;\n" +
- "import org.eclipse.swt.events.*;\n" +
- "import org.eclipse.swt.widgets.*;\n" +
- "public class Try {\n" +
- " public Try() {\n" +
- " }\n" +
- " void main(Shell shell) {\n" +
- " }\n" +
+ "import org.eclipse.swt.*;\n" +
+ "import org.eclipse.swt.events.*;\n" +
+ "import org.eclipse.swt.widgets.*;\n" +
+ "public class Try {\n" +
+ " public Try() {\n" +
+ " }\n" +
+ " void main(Shell shell) {\n" +
+ " }\n" +
"}\n";
String testName = "test";
@@ -8047,68 +8047,68 @@ public void test128() {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=405778 - [1.8][dom ast] method body recovery broken (empty body)
public void test405778() {
String s =
- "import java.util.Collection;\n" +
- "public class E {\n" +
- " public void __test1() {\n" +
- " Object o = new Object();\n" +
- " if (o.hashCode() != 0) {\n" +
- " o.\n" +
- " \n" +
- " }\n" +
- " }\n" +
- "}" +
+ "import java.util.Collection;\n" +
+ "public class E {\n" +
+ " public void __test1() {\n" +
+ " Object o = new Object();\n" +
+ " if (o.hashCode() != 0) {\n" +
+ " o.\n" +
+ " \n" +
+ " }\n" +
+ " }\n" +
+ "}" +
"\n";
String expectedDietUnitToString =
- "import java.util.Collection;\n" +
- "public class E {\n" +
- " public E() {\n" +
- " }\n" +
- " public void __test1() {\n" +
- " }\n" +
+ "import java.util.Collection;\n" +
+ "public class E {\n" +
+ " public E() {\n" +
+ " }\n" +
+ " public void __test1() {\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyUnitToString =
- "import java.util.Collection;\n" +
- "public class E {\n" +
- " public E() {\n" +
- " super();\n" +
- " }\n" +
- " public void __test1() {\n" +
- " }\n" +
+ "import java.util.Collection;\n" +
+ "public class E {\n" +
+ " public E() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void __test1() {\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "import java.util.Collection;\n" +
- "public class E {\n" +
- " public E() {\n" +
- " super();\n" +
- " }\n" +
+ "import java.util.Collection;\n" +
+ "public class E {\n" +
+ " public E() {\n" +
+ " super();\n" +
+ " }\n" +
" public void __test1() {\n" +
" Object o = new Object();\n" +
- " if ((o.hashCode() != 0))\n" +
- " {\n" +
- " o = $missing$;\n" +
- " }\n" +
- " }\n" +
+ " if ((o.hashCode() != 0))\n" +
+ " {\n" +
+ " o = $missing$;\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedFullUnitToString =
- "import java.util.Collection;\n" +
- "public class E {\n" +
- " public E() {\n" +
- " }\n" +
- " public void __test1() {\n" +
- " }\n" +
+ "import java.util.Collection;\n" +
+ "public class E {\n" +
+ " public E() {\n" +
+ " }\n" +
+ " public void __test1() {\n" +
+ " }\n" +
"}\n";
String expectedCompletionDietUnitToString =
- "import java.util.Collection;\n" +
- "public class E {\n" +
- " public E() {\n" +
- " }\n" +
- " public void __test1() {\n" +
- " }\n" +
+ "import java.util.Collection;\n" +
+ "public class E {\n" +
+ " public E() {\n" +
+ " }\n" +
+ " public void __test1() {\n" +
+ " }\n" +
"}\n";
String testName = "test";
@@ -8124,7 +8124,7 @@ public void test405778() {
public void test405778a() {
String s =
"import java.util.Collection;\n" +
- "public class E {\n" +
+ "public class E {\n" +
" void m(String[] names) {\n"
+ "/*[*/\n"
+ "for (String string : names) {\n"
@@ -8132,63 +8132,63 @@ public void test405778a() {
+ "}\n"
+ "/*]*/\n"
+ "}\n"
- + "}\n" +
+ + "}\n" +
"\n";
String expectedDietUnitToString =
- "import java.util.Collection;\n" +
- "public class E {\n" +
- " public E() {\n" +
- " }\n" +
- " void m(String[] names) {\n" +
- " }\n" +
+ "import java.util.Collection;\n" +
+ "public class E {\n" +
+ " public E() {\n" +
+ " }\n" +
+ " void m(String[] names) {\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyUnitToString =
- "import java.util.Collection;\n" +
- "public class E {\n" +
- " public E() {\n" +
- " super();\n" +
- " }\n" +
- " void m(String[] names) {\n" +
- " }\n" +
+ "import java.util.Collection;\n" +
+ "public class E {\n" +
+ " public E() {\n" +
+ " super();\n" +
+ " }\n" +
+ " void m(String[] names) {\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "import java.util.Collection;\n" +
- "public class E {\n" +
- " public E() {\n" +
- " super();\n" +
- " }\n" +
+ "import java.util.Collection;\n" +
+ "public class E {\n" +
+ " public E() {\n" +
+ " super();\n" +
+ " }\n" +
" void m(String[] names) {\n" +
- " for (String string : names) \n" +
- " {\n" +
+ " for (String string : names) \n" +
+ " {\n" +
//{ObjectTeams: guessing differently:
/* orig:
" System.out.println(string.class);\n" +
:giro */
" System.out.println(string.this);\n" +
// SH}
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedFullUnitToString =
- "import java.util.Collection;\n" +
- "public class E {\n" +
- " public E() {\n" +
- " }\n" +
- " void m(String[] names) {\n" +
- " }\n" +
+ "import java.util.Collection;\n" +
+ "public class E {\n" +
+ " public E() {\n" +
+ " }\n" +
+ " void m(String[] names) {\n" +
+ " }\n" +
"}\n";
String expectedCompletionDietUnitToString =
- "import java.util.Collection;\n" +
- "public class E {\n" +
- " public E() {\n" +
- " }\n" +
- " void m(String[] names) {\n" +
- " }\n" +
+ "import java.util.Collection;\n" +
+ "public class E {\n" +
+ " public E() {\n" +
+ " }\n" +
+ " void m(String[] names) {\n" +
+ " }\n" +
"}\n";
String testName = "test";
@@ -8203,66 +8203,66 @@ public void test405778a() {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=456861 - [recovery] NPE in RecoveryScanner since Mars M4
public void test456861() {
String s =
- "import java.awt.Point;\n" +
- "public class Test {\n" +
- " public void foo(Point p, int[] a) {\n" +
- " String s1 = \"\";\n" +
- " s.;\n" +
- " }\n" +
+ "import java.awt.Point;\n" +
+ "public class Test {\n" +
+ " public void foo(Point p, int[] a) {\n" +
+ " String s1 = \"\";\n" +
+ " s.;\n" +
+ " }\n" +
" }";
String expectedDietUnitToString =
- "import java.awt.Point;\n" +
- "public class Test {\n" +
- " public Test() {\n" +
- " }\n" +
- " public void foo(Point p, int[] a) {\n" +
- " }\n" +
+ "import java.awt.Point;\n" +
+ "public class Test {\n" +
+ " public Test() {\n" +
+ " }\n" +
+ " public void foo(Point p, int[] a) {\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyUnitToString =
- "import java.awt.Point;\n" +
- "public class Test {\n" +
- " public Test() {\n" +
+ "import java.awt.Point;\n" +
+ "public class Test {\n" +
+ " public Test() {\n" +
" super();\n" +
- " }\n" +
- " public void foo(Point p, int[] a) {\n" +
- " }\n" +
+ " }\n" +
+ " public void foo(Point p, int[] a) {\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "import java.awt.Point;\n" +
- "public class Test {\n" +
- " public Test() {\n" +
+ "import java.awt.Point;\n" +
+ "public class Test {\n" +
+ " public Test() {\n" +
" super();\n" +
- " }\n" +
- " public void foo(Point p, int[] a) {\n" +
+ " }\n" +
+ " public void foo(Point p, int[] a) {\n" +
" String s1 = \"\";\n" +
//{ObjectTeams: different grammar => different recovery:
/* orig:
- " s = $missing$;\n" +
+ " s = $missing$;\n" +
:giro */
" s --;\n" +
// SH}
- " }\n" +
+ " }\n" +
"}\n";
String expectedFullUnitToString =
- "import java.awt.Point;\n" +
- "public class Test {\n" +
- " public Test() {\n" +
- " }\n" +
- " public void foo(Point p, int[] a) {\n" +
- " }\n" +
+ "import java.awt.Point;\n" +
+ "public class Test {\n" +
+ " public Test() {\n" +
+ " }\n" +
+ " public void foo(Point p, int[] a) {\n" +
+ " }\n" +
"}\n";
String expectedCompletionDietUnitToString =
- "import java.awt.Point;\n" +
- "public class Test {\n" +
- " public Test() {\n" +
- " }\n" +
- " public void foo(Point p, int[] a) {\n" +
- " }\n" +
+ "import java.awt.Point;\n" +
+ "public class Test {\n" +
+ " public Test() {\n" +
+ " }\n" +
+ " public void foo(Point p, int[] a) {\n" +
+ " }\n" +
"}\n";
String testName = "test";
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/FieldAccessCompletionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/FieldAccessCompletionTest.java
index f9f29cc13..1a1648ff1 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/FieldAccessCompletionTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/FieldAccessCompletionTest.java
@@ -1121,7 +1121,7 @@ public void testForStatementExpression() {
" }\n" +
" void foo() {\n" +
" int i;\n" +
- " for (; <CompleteOnMemberAccess:fred().x>; ) \n" +
+ " for (; <CompleteOnMemberAccess:fred().x>; ) \n" +
" ;\n" +
" }\n" +
"}\n",
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsCompletionParserTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsCompletionParserTest.java
index 6c6cf281c..fee3bdaeb 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsCompletionParserTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsCompletionParserTest.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -432,10 +432,10 @@ public void test0014(){
String completeBehind = "Y<Z>.";
int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
String expectedCompletionNodeToString = "<CompleteOnClass:Y<Z>.>";
- String expectedParentNodeToString =
- "public class X extends <CompleteOnClass:Y<Z>.> {\n" +
- " public X() {\n" +
- " }\n" +
+ String expectedParentNodeToString =
+ "public class X extends <CompleteOnClass:Y<Z>.> {\n" +
+ " public X() {\n" +
+ " }\n" +
"}";
String completionIdentifier = "";
String expectedReplacedSource = "Y<Z>.";
@@ -465,10 +465,10 @@ public void test0015(){
String completeBehind = "Y<Z>.";
int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
String expectedCompletionNodeToString = "<CompleteOnInterface:Y<Z>.>";
- String expectedParentNodeToString =
- "public class X implements I1, <CompleteOnInterface:Y<Z>.> {\n" +
- " public X() {\n" +
- " }\n" +
+ String expectedParentNodeToString =
+ "public class X implements I1, <CompleteOnInterface:Y<Z>.> {\n" +
+ " public X() {\n" +
+ " }\n" +
"}";
String completionIdentifier = "";
String expectedReplacedSource = "Y<Z>.";
@@ -11095,11 +11095,11 @@ public void test0219_Diet() {
String completionIdentifier = "";
String expectedReplacedSource = "\"\"";
String expectedUnitDisplayString =
- "public class X {\n" +
- " @Annot(value = <CompletionOnString:\"\">)\n" +
- " int field;\n" +
- " public X() {\n" +
- " }\n" +
+ "public class X {\n" +
+ " @Annot(value = <CompletionOnString:\"\">)\n" +
+ " int field;\n" +
+ " public X() {\n" +
+ " }\n" +
"}\n";
checkDietParse(
@@ -11128,11 +11128,11 @@ public void test0220_Diet() {
String completionIdentifier = "";
String expectedReplacedSource = "\"\"";
String expectedUnitDisplayString =
- "public class X {\n" +
- " @Annot(value = <CompletionOnString:\"\">)\n" +
- " int field;\n" +
- " public X() {\n" +
- " }\n" +
+ "public class X {\n" +
+ " @Annot(value = <CompletionOnString:\"\">)\n" +
+ " int field;\n" +
+ " public X() {\n" +
+ " }\n" +
"}\n";
checkDietParse(
@@ -11196,16 +11196,16 @@ public void testBug351426b(){
String completionIdentifier = "";
String expectedReplacedSource = "";
String expectedUnitDisplayString =
- "public class X<T> {\n" +
- " static class X1<E> {\n" +
- " X1() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " X1<String> x = new X.X1<<CompleteOnType:>>();\n" +
- " }\n" +
+ "public class X<T> {\n" +
+ " static class X1<E> {\n" +
+ " X1() {\n" +
+ " }\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " void foo() {\n" +
+ " X1<String> x = new X.X1<<CompleteOnType:>>();\n" +
+ " }\n" +
"}\n";
checkMethodParse(
@@ -11234,12 +11234,12 @@ public void testBug351426c(){
String completionIdentifier = "";
String expectedReplacedSource = "";
String expectedUnitDisplayString =
- "public class X<T> {\n" +
- " public X() {\n" +
- " }\n" +
- " public X<String> foo() {\n" +
- " return new X<<CompleteOnType:>>();\n" +
- " }\n" +
+ "public class X<T> {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public X<String> foo() {\n" +
+ " return new X<<CompleteOnType:>>();\n" +
+ " }\n" +
"}\n";
checkMethodParse(
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsSelectionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsSelectionTest.java
index f44654702..a5b71ce3f 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsSelectionTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsSelectionTest.java
@@ -913,13 +913,13 @@ public void test0023() {
String completionIdentifier = "emptyList";
String expectedUnitDisplayString =
- "package test;\n" +
- "public class Test {\n" +
- " public Test() {\n" +
- " }\n" +
- " public List<String> foo() {\n" +
- " return <SelectOnMessageSend:Collections.emptyList()>;\n" +
- " }\n" +
+ "package test;\n" +
+ "public class Test {\n" +
+ " public Test() {\n" +
+ " }\n" +
+ " public List<String> foo() {\n" +
+ " return <SelectOnMessageSend:Collections.emptyList()>;\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "Collections.emptyList()";
String testName = "<select method>";
@@ -941,14 +941,14 @@ public void test0023() {
public void test0024() {
String str =
- "import java.util.List;\n" +
- "public class X {\n" +
- " <T> T bar(T t) { return t; }\n" +
- " void foo(boolean b, Runnable r) {\n" +
- " Zork z = null;\n" +
- " String s = (String) bar(z); // 5\n" +
- " }\n" +
- "}\n" +
+ "import java.util.List;\n" +
+ "public class X {\n" +
+ " <T> T bar(T t) { return t; }\n" +
+ " void foo(boolean b, Runnable r) {\n" +
+ " Zork z = null;\n" +
+ " String s = (String) bar(z); // 5\n" +
+ " }\n" +
+ "}\n" +
"\n";
String selection = "bar";
@@ -957,16 +957,16 @@ public void test0024() {
String completionIdentifier = "bar";
String expectedUnitDisplayString =
- "import java.util.List;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " <T>T bar(T t) {\n" +
- " }\n" +
- " void foo(boolean b, Runnable r) {\n" +
- " Zork z;\n" +
- " String s = (String) <SelectOnMessageSend:bar(z)>;\n" +
- " }\n" +
+ "import java.util.List;\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " <T>T bar(T t) {\n" +
+ " }\n" +
+ " void foo(boolean b, Runnable r) {\n" +
+ " Zork z;\n" +
+ " String s = (String) <SelectOnMessageSend:bar(z)>;\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "bar(z)";
String testName = "<select method>";
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java
index 4de24598a..f28fb42c1 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java
@@ -608,7 +608,7 @@ public void test025() {
} else if (this.complianceLevel >= ClassFileConstants.JDK12) {
additionalTags = new char[][] {
TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
- TAG_CODE, TAG_LITERAL,
+ TAG_CODE, TAG_LITERAL,
TAG_INDEX, TAG_SUMMARY, TAG_SYSTEM_PROPERTY
};
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/LambdaExpressionSyntaxTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/LambdaExpressionSyntaxTest.java
index 802340017..38dabe743 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/LambdaExpressionSyntaxTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/LambdaExpressionSyntaxTest.java
@@ -56,7 +56,7 @@ public class LambdaExpressionSyntaxTest extends AbstractSyntaxTreeTest {
}
// type elided, unparenthesized parameter + expression body lambda in casting context.
public void test0001() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" int square(int x);\n" +
"}\n" +
@@ -66,23 +66,23 @@ public class LambdaExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " int square(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(((I) (<no type> x) -> (x * x)).square(10));\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " int square(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(((I) (<no type> x) -> (x * x)).square(10));\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0001", expectedUnitToString);
}
// type elided, unparenthesized parameter + expression body lambda as initializer.
public void test0002() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" int square(int x);\n" +
"}\n" +
@@ -93,24 +93,24 @@ public class LambdaExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " int square(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = (<no type> x) -> (x * x);\n" +
- " System.out.println(i.square(10));\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " int square(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = (<no type> x) -> (x * x);\n" +
+ " System.out.println(i.square(10));\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0002", expectedUnitToString);
}
// type elided, unparenthesized parameter + expression body lambda as initializer, full lambda is parenthesized.
public void test0003() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" int square(int x);\n" +
"}\n" +
@@ -121,24 +121,24 @@ public class LambdaExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " int square(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = (((((<no type> x) -> (x * x)))));\n" +
- " System.out.println(i.square(10));\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " int square(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = (((((<no type> x) -> (x * x)))));\n" +
+ " System.out.println(i.square(10));\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0003", expectedUnitToString);
}
// type elided, unparenthesized parameter + expression body lambda as RHS of assignment, full lambda is parenthesized.
public void test0004() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" int square(int x);\n" +
"}\n" +
@@ -150,25 +150,25 @@ public class LambdaExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " int square(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i;\n" +
- " i = ((<no type> x) -> (x * x));\n" +
- " System.out.println(i.square(10));\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " int square(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i;\n" +
+ " i = ((<no type> x) -> (x * x));\n" +
+ " System.out.println(i.square(10));\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0004", expectedUnitToString);
}
// type elided, unparenthesized parameter + expression body lambda in return statement, full lambda is parenthesized.
public void test0005() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" int square(int x);\n" +
"}\n" +
@@ -182,27 +182,27 @@ public class LambdaExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " int square(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " static I getI() {\n" +
- " return ((<no type> x) -> (x * x));\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = getI();\n" +
- " System.out.println(i.square(10));\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " int square(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " static I getI() {\n" +
+ " return ((<no type> x) -> (x * x));\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = getI();\n" +
+ " System.out.println(i.square(10));\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0005", expectedUnitToString);
}
// type elided, unparenthesized parameter + expression body lambda in conditional expression.
public void test0006() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" int square(int x);\n" +
"}\n" +
@@ -213,24 +213,24 @@ public class LambdaExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " int square(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = ((args == null) ? (<no type> x) -> (x * x) : (<no type> x) -> ((x * x) * x));\n" +
- " System.out.println(i.square(10));\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " int square(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = ((args == null) ? (<no type> x) -> (x * x) : (<no type> x) -> ((x * x) * x));\n" +
+ " System.out.println(i.square(10));\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0006", expectedUnitToString);
}
// type elided, unparenthesized parameter + expression body lambda in message send.
public void test0007() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" int square(int x);\n" +
"}\n" +
@@ -244,27 +244,27 @@ public class LambdaExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " int square(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " static void foo(I i1, I i2) {\n" +
- " System.out.println(i1.square(10));\n" +
- " System.out.println(i2.square(10));\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " foo((<no type> x) -> (x * x), (<no type> x) -> ((x * x) * x));\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " int square(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " static void foo(I i1, I i2) {\n" +
+ " System.out.println(i1.square(10));\n" +
+ " System.out.println(i2.square(10));\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " foo((<no type> x) -> (x * x), (<no type> x) -> ((x * x) * x));\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0007", expectedUnitToString);
}
// type elided, unparenthesized parameter + expression body lambda in constructor call.
public void test0008() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" int square(int x);\n" +
"}\n" +
@@ -278,25 +278,25 @@ public class LambdaExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " int square(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " X(I i1, I i2) {\n" +
- " super();\n" +
- " System.out.println(i1.square(10));\n" +
- " System.out.println(i2.square(10));\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new X((<no type> x) -> (x * x), (<no type> x) -> ((x * x) * x));\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " int square(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " X(I i1, I i2) {\n" +
+ " super();\n" +
+ " System.out.println(i1.square(10));\n" +
+ " System.out.println(i2.square(10));\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new X((<no type> x) -> (x * x), (<no type> x) -> ((x * x) * x));\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0008", expectedUnitToString);
}
// type elided, unparenthesized parameter + expression body lambda in lambda.
public void test0009() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" I square(int x);\n" +
"}\n" +
@@ -306,23 +306,23 @@ public class LambdaExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " I square(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(((I) (<no type> a) -> (<no type> b) -> (<no type> c) -> (<no type> d) -> (<no type> e) -> (<no type> f) -> (<no type> g) -> null).square(10));\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " I square(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(((I) (<no type> a) -> (<no type> b) -> (<no type> c) -> (<no type> d) -> (<no type> e) -> (<no type> f) -> (<no type> g) -> null).square(10));\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0009", expectedUnitToString);
}
// type elided, unparenthesized parameter + expression body lambda in an initializer block
public void test00010() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" int square(int x);\n" +
"}\n" +
@@ -336,29 +336,29 @@ public class LambdaExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " int square(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " static I i = (<no type> x) -> (x * x);\n" +
- " {\n" +
- " i = (<no type> x) -> ((x * x) * x);\n" +
- " }\n" +
- " static {\n" +
- " i = (<no type> x) -> ((x * x) * x);\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " int square(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " static I i = (<no type> x) -> (x * x);\n" +
+ " {\n" +
+ " i = (<no type> x) -> ((x * x) * x);\n" +
+ " }\n" +
+ " static {\n" +
+ " i = (<no type> x) -> ((x * x) * x);\n" +
+ " }\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test00010", expectedUnitToString);
}
// type elided, parenthesized parameter + expression body lambda in casting context.
public void test0011() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" int square(int x);\n" +
"}\n" +
@@ -368,23 +368,23 @@ public class LambdaExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " int square(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(((I) (<no type> x) -> (x * x)).square(10));\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " int square(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(((I) (<no type> x) -> (x * x)).square(10));\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0011", expectedUnitToString);
}
// Normal & minimal parameter list + expression body lambda in assignment context.
public void test0012() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" int square(int x);\n" +
"}\n" +
@@ -395,24 +395,24 @@ public class LambdaExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " int square(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = (int x) -> (x * x);\n" +
- " System.out.println(i.square(10));\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " int square(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = (int x) -> (x * x);\n" +
+ " System.out.println(i.square(10));\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0012", expectedUnitToString);
}
// Normal parameter list, with modifiers & annotations + expression body lambda in invocation context.
public void test0013() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" int square(int x);\n" +
"}\n" +
@@ -427,29 +427,29 @@ public class LambdaExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " int square(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " @interface Positive {\n" +
- " }\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " static void foo(I i1, I i2) {\n" +
- " System.out.println(i1.square(10));\n" +
- " System.out.println(i2.square(10));\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " foo((final int x) -> (x * x), (final @Positive int x) -> ((x * x) * x));\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " int square(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " @interface Positive {\n" +
+ " }\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " static void foo(I i1, I i2) {\n" +
+ " System.out.println(i1.square(10));\n" +
+ " System.out.println(i2.square(10));\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " foo((final int x) -> (x * x), (final @Positive int x) -> ((x * x) * x));\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0013", expectedUnitToString);
}
// Vararg parameter list, with modifiers & annotations + expression body lambda in message send context.
public void test0014() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" int square(int ... x);\n" +
"}\n" +
@@ -464,29 +464,29 @@ public class LambdaExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " int square(int... x);\n" +
- "}\n" +
- "public class X {\n" +
- " @interface Positive {\n" +
- " }\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " static void foo(I i1, I i2) {\n" +
- " System.out.println(i1.square(10));\n" +
- " System.out.println(i2.square(10));\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " foo((final int... x) -> 10, (final @Positive int[] x) -> 20);\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " int square(int... x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " @interface Positive {\n" +
+ " }\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " static void foo(I i1, I i2) {\n" +
+ " System.out.println(i1.square(10));\n" +
+ " System.out.println(i2.square(10));\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " foo((final int... x) -> 10, (final @Positive int[] x) -> 20);\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0014", expectedUnitToString);
}
// multi parameter type elided list + expression body lambda in return statement.
public void test0015() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" int product(int x, int y);\n" +
"}\n" +
@@ -500,27 +500,27 @@ public class LambdaExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
"};\n";
- String expectedUnitToString =
- "interface I {\n" +
- " int product(int x, int y);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " static I getI() {\n" +
- " return ((<no type> x, <no type> y) -> (x * y));\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = getI();\n" +
- " System.out.println(i.product(5, 6));\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " int product(int x, int y);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " static I getI() {\n" +
+ " return ((<no type> x, <no type> y) -> (x * y));\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = getI();\n" +
+ " System.out.println(i.product(5, 6));\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0015", expectedUnitToString);
}
// multi parameter type specified list + block body lambda in return statement.
public void test0016() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" int product(int x, int y);\n" +
"}\n" +
@@ -534,29 +534,29 @@ public class LambdaExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " int product(int x, int y);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " static I getI() {\n" +
- " return (int x, int y) -> {\n" +
- " return (x * y);\n" +
- "};\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = getI();\n" +
- " System.out.println(i.product(5, 6));\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " int product(int x, int y);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " static I getI() {\n" +
+ " return (int x, int y) -> {\n" +
+ " return (x * y);\n" +
+ "};\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = getI();\n" +
+ " System.out.println(i.product(5, 6));\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0016", expectedUnitToString);
}
- // noarg + block body lambda
+ // noarg + block body lambda
public void test0017() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" String noarg();\n" +
"}\n" +
@@ -566,25 +566,25 @@ public class LambdaExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " String noarg();\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(((I) () -> {\n" +
- " return \"noarg\";\n" +
- "}).noarg());\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " String noarg();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(((I) () -> {\n" +
+ " return \"noarg\";\n" +
+ "}).noarg());\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0017", expectedUnitToString);
}
// Assorted tests.
public void test0018() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" void foo();\n" +
"}\n" +
@@ -607,44 +607,44 @@ public class LambdaExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
" };\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " void foo();\n" +
- "}\n" +
- "interface J {\n" +
- " int foo();\n" +
- "}\n" +
- "public class X {\n" +
- " I i1 = () -> {\n" +
- " };\n" +
- " J j1 = () -> 0;\n" +
- " J j2 = () -> {\n" +
- " return 0;\n" +
- " };\n" +
- " I i2 = () -> {\n" +
- " System.gc();\n" +
- " };\n" +
- " J j3 = () -> {\n" +
- " if (true)\n" +
- " return 0;\n" +
- " else\n" +
- " {\n" +
- " int r = 12;\n" +
- " for (int i = 1;; (i < 8); i ++) \n" +
- " r += i;\n" +
- " return r;\n" +
- " }\n" +
- " };\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " void foo();\n" +
+ "}\n" +
+ "interface J {\n" +
+ " int foo();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " I i1 = () -> {\n" +
+ " };\n" +
+ " J j1 = () -> 0;\n" +
+ " J j2 = () -> {\n" +
+ " return 0;\n" +
+ " };\n" +
+ " I i2 = () -> {\n" +
+ " System.gc();\n" +
+ " };\n" +
+ " J j3 = () -> {\n" +
+ " if (true)\n" +
+ " return 0;\n" +
+ " else\n" +
+ " {\n" +
+ " int r = 12;\n" +
+ " for (int i = 1;; (i < 8); i ++) \n" +
+ " r += i;\n" +
+ " return r;\n" +
+ " }\n" +
+ " };\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0018", expectedUnitToString);
}
// like test0001() but body expression is an assignment
public void test0019() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" int square(int x);\n" +
"}\n" +
@@ -654,28 +654,28 @@ public class LambdaExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" System.out.println(((I) x -> y = x * x ).square(10));\n" +
" }\n" +
"}\n";
-
- String expectedUnitToString =
- "interface I {\n" +
- " int square(int x);\n" +
- "}\n" +
- "public class X {\n" +
+
+ String expectedUnitToString =
+ "interface I {\n" +
+ " int square(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
" int y;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(((I) (<no type> x) -> y = (x * x)).square(10));\n" +
- " }\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(((I) (<no type> x) -> y = (x * x)).square(10));\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0019", expectedUnitToString);
}
-
+
// Coverage: exercise this condition in Parser.consumeExpression():
// if (this.valueLambdaNestDepth >= 0 && this.stateStackLengthStack[this.valueLambdaNestDepth] == this.stateStackTop - 1)
// make sure we see a (true && false) combination
public void testNestedLambda01() throws IOException {
- String source =
+ String source =
"public class C {\n" +
" I foo() {\n" +
" return (i1, i2) -> (String x1, String x2) -> { \n" +
@@ -687,7 +687,7 @@ public class LambdaExpressionSyntaxTest extends AbstractSyntaxTreeTest {
"interface I {\n" +
" String doit(String s1, String s2);\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"public class C {\n" +
" public C() {\n" +
" super();\n" +
@@ -706,14 +706,14 @@ public class LambdaExpressionSyntaxTest extends AbstractSyntaxTreeTest {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=385132
public void test385132() throws IOException {
String source = "->";
- String expectedErrorString =
+ String expectedErrorString =
"----------\n" +
"1. ERROR in test385132 (at line 1)\n" +
" ->\n" +
" ^^\n" +
"Syntax error on token \"->\", delete this token\n" +
"----------\n";
-
+
checkParse(CHECK_PARSER , source.toCharArray(), expectedErrorString, "test385132", null);
}
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ModuleDeclarationSyntaxTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ModuleDeclarationSyntaxTest.java
index dd40942cf..791cca4b1 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ModuleDeclarationSyntaxTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ModuleDeclarationSyntaxTest.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -45,10 +45,10 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
super(testName, null, null);
}
public void test0001() throws IOException {
- String source =
+ String source =
"module com.greetings {\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"module com.greetings {\n" +
"}\n";
CompilerOptions options = new CompilerOptions(getCompilerOptions());
@@ -58,11 +58,11 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), null, "module-info", expectedUnitToString, null, options);
}
public void test0002() throws IOException {
- String source =
+ String source =
"module com.greetings {\n" +
"requires org.astro;" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"module com.greetings {\n" +
" requires org.astro;\n" +
"}\n";
@@ -73,11 +73,11 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), null, "module-info", expectedUnitToString, null, options);
}
public void test0003() throws IOException {
- String source =
+ String source =
"module org.astro {\n" +
" exports org.astro;\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"module org.astro {\n" +
" exports org.astro;\n" +
"}\n";
@@ -88,11 +88,11 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), null, "module-info", expectedUnitToString, null, options);
}
public void test0004() throws IOException {
- String source =
+ String source =
"module org.astro {\n" +
" exports org.astro to com.greetings, com.example1, com.example2;\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"module org.astro {\n" +
" exports org.astro to com.greetings, com.example1, com.example2;\n" +
"}\n";
@@ -103,13 +103,13 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), null, "module-info", expectedUnitToString, null, options);
}
public void test0005() throws IOException {
- String source =
+ String source =
"module com.socket {\n" +
" exports com.socket;\n" +
" exports com.socket.spi;\n" +
" uses com.socket.spi.NetworkSocketProvider;\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"module com.socket {\n" +
" exports com.socket;\n" +
" exports com.socket.spi;\n" +
@@ -122,13 +122,13 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), null, "module-info", expectedUnitToString, null, options);
}
public void test0006() throws IOException {
- String source =
+ String source =
"module org.fastsocket {\n" +
" requires com.socket;\n" +
" provides com.socket.spi.NetworkSocketProvider\n" +
" with org.fastsocket.FastNetworkSocketProvider;\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"module org.fastsocket {\n" +
" requires com.socket;\n" +
" provides com.socket.spi.NetworkSocketProvider with org.fastsocket.FastNetworkSocketProvider;\n" +
@@ -140,12 +140,12 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), null, "module-info", expectedUnitToString, null, options);
}
public void test0007() throws IOException {
- String source =
+ String source =
"module org.fastsocket {\n" +
" requires com.socket;\n" +
" provides com.socket.spi.NetworkSocketProvider;\n" +
"}\n";
- String expectedErrorString =
+ String expectedErrorString =
"----------\n" +
"1. ERROR in module-info (at line 3)\n" +
" provides com.socket.spi.NetworkSocketProvider;\n" +
@@ -159,11 +159,11 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), expectedErrorString, "module-info", null, null, options);
}
public void test0008() throws IOException {
- String source =
+ String source =
"module @Marker com.greetings {\n" +
" requires org.astro;" +
"}\n";
- String errorMsg =
+ String errorMsg =
"----------\n" +
"1. ERROR in module-info (at line 1)\n" +
" module @Marker com.greetings {\n" +
@@ -182,11 +182,11 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), errorMsg, "module-info", null, null, options);
}
public void test0009() throws IOException {
- String source =
+ String source =
"module com.greetings {\n" +
" requires @Marker org.astro;\n" +
"}\n";
- String errorMsg =
+ String errorMsg =
"----------\n" +
"1. ERROR in module-info (at line 1)\n" +
" module com.greetings {\n requires @Marker org.astro;\n" +
@@ -210,11 +210,11 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), errorMsg, "module-info", null, null, options);
}
public void test0010() throws IOException {
- String source =
+ String source =
"module com.greetings {\n" +
" requires private org.astro;\n" +
"}\n";
- String errorMsg =
+ String errorMsg =
"----------\n" +
"1. ERROR in module-info (at line 2)\n" +
" requires private org.astro;\n"+
@@ -228,11 +228,11 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), errorMsg, "module-info", null, null, options);
}
public void test0011() throws IOException {
- String source =
+ String source =
"module com.greetings {\n" +
" exports @Marker com.greetings;\n" +
"}\n";
- String errorMsg =
+ String errorMsg =
"----------\n" +
"1. ERROR in module-info (at line 1)\n" +
" module com.greetings {\n exports @Marker com.greetings;\n" +
@@ -256,11 +256,11 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), errorMsg, "module-info", null, null, options);
}
public void test0012() throws IOException {
- String source =
+ String source =
"module com.greetings {\n" +
" exports com.greetings to @Marker org.astro;\n" +
"}\n";
- String errorMsg =
+ String errorMsg =
"----------\n" +
"1. ERROR in module-info (at line 2)\n" +
" exports com.greetings to @Marker org.astro;\n"+
@@ -274,11 +274,11 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), errorMsg, "module-info", null, null, options);
}
public void test0013() throws IOException {
- String source =
+ String source =
"module com.greetings {\n" +
" uses @Marker org.astro.World;\n" +
"}\n";
- String errorMsg =
+ String errorMsg =
"----------\n" +
"1. ERROR in module-info (at line 2)\n" +
" uses @Marker org.astro.World;\n" +
@@ -292,11 +292,11 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), errorMsg, "module-info", null, null, options);
}
public void test0014() throws IOException {
- String source =
+ String source =
"module com.greetings {\n" +
" provides @Marker org.astro.World with @Marker com.greetings.Main;\n" +
"}\n";
- String errorMsg =
+ String errorMsg =
"----------\n" +
"1. ERROR in module-info (at line 2)\n" +
" provides @Marker org.astro.World with @Marker com.greetings.Main;\n" +
@@ -315,11 +315,11 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), errorMsg, "module-info", null, null, options);
}
public void test0015() throws IOException {
- String source =
+ String source =
"module com.greetings {\n" +
"requires transitive org.astro;" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"module com.greetings {\n" +
" requires transitive org.astro;\n" +
"}\n";
@@ -330,11 +330,11 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), null, "module-info", expectedUnitToString, null, options);
}
public void test0016() throws IOException {
- String source =
+ String source =
"module com.greetings {\n" +
"requires static org.astro;" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"module com.greetings {\n" +
" requires static org.astro;\n" +
"}\n";
@@ -345,11 +345,11 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), null, "module-info", expectedUnitToString, null, options);
}
public void test0017() throws IOException {
- String source =
+ String source =
"module com.greetings {\n" +
"requires transitive static org.astro;" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"module com.greetings {\n" +
" requires transitive static org.astro;\n" +
"}\n";
@@ -360,14 +360,14 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), null, "module-info", expectedUnitToString, null, options);
}
public void test0018() throws IOException {
- String source =
+ String source =
"import com.socket.spi.NetworkSocketProvider;\n" +
"module org.fastsocket {\n" +
" requires com.socket;\n" +
" provides NetworkSocketProvider\n" +
" with org.fastsocket.FastNetworkSocketProvider;\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"import com.socket.spi.NetworkSocketProvider;\n" +
"module org.fastsocket {\n" +
" requires com.socket;\n" +
@@ -380,14 +380,14 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), null, "module-info", expectedUnitToString, null, options);
}
public void test0019() throws IOException {
- String source =
+ String source =
"import com.socket.spi.*;\n" +
"module org.fastsocket {\n" +
" requires com.socket;\n" +
" provides NetworkSocketProvider\n" +
" with org.fastsocket.FastNetworkSocketProvider;\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"import com.socket.spi.*;\n" +
"module org.fastsocket {\n" +
" requires com.socket;\n" +
@@ -400,11 +400,11 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), null, "module-info", expectedUnitToString, null, options);
}
public void test0020() throws IOException {
- String source =
+ String source =
"open module com.greetings {\n" +
"requires transitive static org.astro;" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"open module com.greetings {\n" +
" requires transitive static org.astro;\n" +
"}\n";
@@ -415,13 +415,13 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), null, "module-info", expectedUnitToString, null, options);
}
public void test0021() throws IOException {
- String source =
+ String source =
"module org.fastsocket {\n" +
" requires com.socket;\n" +
" provides com.socket.spi.NetworkSocketProvider\n" +
" with org.fastsocket.FastNetworkSocketProvider, org.fastSocket.SlowNetworkSocketProvider;\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"module org.fastsocket {\n" +
" requires com.socket;\n" +
" provides com.socket.spi.NetworkSocketProvider with org.fastsocket.FastNetworkSocketProvider, org.fastSocket.SlowNetworkSocketProvider;\n" +
@@ -433,11 +433,11 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), null, "module-info", expectedUnitToString, null, options);
}
public void test0022() throws IOException {
- String source =
+ String source =
"module org.astro {\n" +
" opens org.astro;\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"module org.astro {\n" +
" opens org.astro;\n" +
"}\n";
@@ -448,11 +448,11 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), null, "module-info", expectedUnitToString, null, options);
}
public void test0023() throws IOException {
- String source =
+ String source =
"module org.astro {\n" +
" opens org.astro to com.greetings, com.example1, com.example2;\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"module org.astro {\n" +
" opens org.astro to com.greetings, com.example1, com.example2;\n" +
"}\n";
@@ -463,13 +463,13 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), null, "module-info", expectedUnitToString, null, options);
}
public void test0024() throws IOException {
- String source =
+ String source =
"module org.astro {\n" +
" exports org.astro to com.greetings, com.example1, com.example2;\n" +
" opens org.astro to com.greetings, com.example1, com.example2;\n" +
" opens org.astro.galaxy to com.greetings, com.example1, com.example2;\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"module org.astro {\n" +
" exports org.astro to com.greetings, com.example1, com.example2;\n" +
" opens org.astro to com.greetings, com.example1, com.example2;\n" +
@@ -482,14 +482,14 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), null, "module-info", expectedUnitToString, null, options);
}
public void test0025() throws IOException {
- String source =
+ String source =
"@Foo\n" +
"module org.astro {\n" +
" exports org.astro to com.greetings, com.example1, com.example2;\n" +
" opens org.astro to com.greetings, com.example1, com.example2;\n" +
" opens org.astro.galaxy to com.greetings, com.example1, com.example2;\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"@Foo\n" +
"module org.astro {\n" +
" exports org.astro to com.greetings, com.example1, com.example2;\n" +
@@ -503,14 +503,14 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
checkParse(CHECK_PARSER, source.toCharArray(), null, "module-info", expectedUnitToString, null, options);
}
public void test0026() throws IOException {
- String source =
+ String source =
"@Foo\n" +
"open module org.astro {\n" +
" exports org.astro to com.greetings, com.example1, com.example2;\n" +
" opens org.astro to com.greetings, com.example1, com.example2;\n" +
" opens org.astro.galaxy to com.greetings, com.example1, com.example2;\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"@Foo\n" +
"open module org.astro {\n" +
" exports org.astro to com.greetings, com.example1, com.example2;\n" +
@@ -525,14 +525,14 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
}
public void test0027() throws IOException {
- String source =
+ String source =
"@Foo @Bar(x = 2) @Baz(\"true\")\n" +
"open module org.astro {\n" +
" exports org.astro to com.greetings, com.example1, com.example2;\n" +
" opens org.astro to com.greetings, com.example1, com.example2;\n" +
" opens org.astro.galaxy to com.greetings, com.example1, com.example2;\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"@Foo @Bar(x = 2) @Baz(\"true\")\n" +
"open module org.astro {\n" +
" exports org.astro to com.greetings, com.example1, com.example2;\n" +
@@ -547,11 +547,11 @@ public class ModuleDeclarationSyntaxTest extends AbstractSyntaxTreeTest {
}
public void testBug518626() throws IOException {
- String source =
+ String source =
"module module.test {\n" +
" provides X with Y;\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"module module.test {\n" +
" provides X with Y;\n" +
"}\n";
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/NameReferenceCompletionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/NameReferenceCompletionTest.java
index 4f8cf5e86..0a688f6b3 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/NameReferenceCompletionTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/NameReferenceCompletionTest.java
@@ -166,7 +166,7 @@ public void test1FVRQQA_2() {
" void foo() {\n" +
" Enumeration e;\n" +
" for (; <CompleteOnName:e.has>; ) \n" +
- " ;\n" +
+ " ;\n" +
" }\n" +
"}\n",
// expectedCompletionIdentifier:
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest.java
index 5869d5054..11f2ae6bd 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest.java
@@ -76,21 +76,21 @@ public void test003() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " throws new X\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"throws\", throw expected\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " throws new X\n" +
- " ^\n" +
- "Syntax error, insert \"( )\" to complete Expression\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " throws new X\n" +
- " ^\n" +
- "Syntax error, insert \";\" to complete BlockStatements\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " throws new X\n" +
+ " ^^^^^^\n" +
+ "Syntax error on token \"throws\", throw expected\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " throws new X\n" +
+ " ^\n" +
+ "Syntax error, insert \"( )\" to complete Expression\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " throws new X\n" +
+ " ^\n" +
+ "Syntax error, insert \";\" to complete BlockStatements\n" +
"----------\n");
}
public void test004() {
@@ -139,21 +139,21 @@ public void test006() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " throws new X\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"throws\", throw expected\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " throws new X\n" +
- " ^\n" +
- "Syntax error, insert \"( )\" to complete Expression\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " throws new X\n" +
- " ^\n" +
- "Syntax error, insert \";\" to complete BlockStatements\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " throws new X\n" +
+ " ^^^^^^\n" +
+ "Syntax error on token \"throws\", throw expected\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " throws new X\n" +
+ " ^\n" +
+ "Syntax error, insert \"( )\" to complete Expression\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " throws new X\n" +
+ " ^\n" +
+ "Syntax error, insert \";\" to complete BlockStatements\n" +
"----------\n");
}
public void test007() {
@@ -755,23 +755,23 @@ public void test027() {
*/
public void _test028() {
String error = (this.complianceLevel == ClassFileConstants.JDK14) ?
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " Srtring bar = \"\"\"\n" +
- " }\n" +
- " ^^^^\n" +
- "Text block is not properly closed with the delimiter\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " Srtring bar = \"\"\"\n" +
+ " }\n" +
+ " ^^^^\n" +
+ "Text block is not properly closed with the delimiter\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " Srtring bar = \"\"\"\n" +
- " ^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " Srtring bar = \"\"\"\n" +
- " ^\n" +
- "String literal is not properly closed by a double-quote\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " Srtring bar = \"\"\"\n" +
+ " ^^\n" +
+ "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " Srtring bar = \"\"\"\n" +
+ " ^\n" +
+ "String literal is not properly closed by a double-quote\n" +
"----------\n";
Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
@@ -794,34 +794,34 @@ public void testBug485477() {
runNegativeTest(
new String[] {
"T.java",
- "public class T {{\n" +
+ "public class T {{\n" +
" Object o = T.super; // error: '.' expected\n" + // instance initializer
- " System.out.println(o.toString());\n" +
- "}}\n" +
- "class U {\n" +
+ " System.out.println(o.toString());\n" +
+ "}}\n" +
+ "class U {\n" +
" Object o1;\n" +
" Object o2 = T.super;\n" + // field initializer
- " U() {\n" +
+ " U() {\n" +
" o1 = U.super;\n" + // constructor
" System.out.println(o1.toString());\n" +
- " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in T.java (at line 2)\n" +
- " Object o = T.super; // error: \'.\' expected\n" +
- " ^^^^^\n" +
- "Syntax error, insert \". Identifier\" to complete Expression\n" +
- "----------\n" +
- "2. ERROR in T.java (at line 7)\n" +
- " Object o2 = T.super;\n" +
- " ^^^^^\n" +
- "Syntax error, insert \". Identifier\" to complete Expression\n" +
- "----------\n" +
- "3. ERROR in T.java (at line 9)\n" +
- " o1 = U.super;\n" +
- " ^^^^^\n" +
- "Syntax error, insert \". Identifier\" to complete Expression\n" +
+ "----------\n" +
+ "1. ERROR in T.java (at line 2)\n" +
+ " Object o = T.super; // error: \'.\' expected\n" +
+ " ^^^^^\n" +
+ "Syntax error, insert \". Identifier\" to complete Expression\n" +
+ "----------\n" +
+ "2. ERROR in T.java (at line 7)\n" +
+ " Object o2 = T.super;\n" +
+ " ^^^^^\n" +
+ "Syntax error, insert \". Identifier\" to complete Expression\n" +
+ "----------\n" +
+ "3. ERROR in T.java (at line 9)\n" +
+ " o1 = U.super;\n" +
+ " ^^^^^\n" +
+ "Syntax error, insert \". Identifier\" to complete Expression\n" +
"----------\n");
}
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest1_7.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest1_7.java
index 12a6a1dc7..9efe7e1e1 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest1_7.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest1_7.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -191,10 +191,10 @@ public void checkParse(
new DefaultProblemFactory(Locale.getDefault())),
true);
parser.setStatementsRecovery(false);
-
+
ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null);
CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
-
+
CompilationUnitDeclaration computedUnit = parser.parse(sourceUnit, compilationResult);
String computedUnitToString = computedUnit.toString();
if (!expectedFullUnitToString.equals(computedUnitToString)){
@@ -204,7 +204,7 @@ public void checkParse(
"Invalid unit full structure" + testName,
expectedFullUnitToString,
computedUnitToString);
-
+
}
}
/* using regular parser in FULL mode and statementRecoveryEnabled */
@@ -256,77 +256,77 @@ public void test0001() {
"}";
String expectedDietUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " }\n" +
"}\n";
String expectedDietWithStatementRecoveryUnitToString =
expectedDietUnitToString;
String expectedDietPlusBodyUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try (Reader reader = new FileReader(\"fileName\"))\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
- " }\n" +
- " catch (FileNotFoundException | IOException | Exception e)\n" +
- " {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " finally\n" +
- " {\n" +
- " System.out.println(\"Finishing try-with-resources\");\n" +
- " }\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try (Reader reader = new FileReader(\"fileName\"))\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
+ " }\n" +
+ " catch (FileNotFoundException | IOException | Exception e)\n" +
+ " {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " finally\n" +
+ " {\n" +
+ " System.out.println(\"Finishing try-with-resources\");\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try (Reader reader = new FileReader(\"fileName\"))\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
- " }\n" +
- " catch (FileNotFoundException | IOException | Exception e)\n" +
- " {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " finally\n" +
- " {\n" +
- " System.out.println(\"Finishing try-with-resources\");\n" +
- " }\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try (Reader reader = new FileReader(\"fileName\"))\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
+ " }\n" +
+ " catch (FileNotFoundException | IOException | Exception e)\n" +
+ " {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " finally\n" +
+ " {\n" +
+ " System.out.println(\"Finishing try-with-resources\");\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedFullUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try (Reader reader = new FileReader(\"fileName\"))\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
- " }\n" +
- " catch (FileNotFoundException | IOException | Exception e)\n" +
- " {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " finally\n" +
- " {\n" +
- " System.out.println(\"Finishing try-with-resources\");\n" +
- " }\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try (Reader reader = new FileReader(\"fileName\"))\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
+ " }\n" +
+ " catch (FileNotFoundException | IOException | Exception e)\n" +
+ " {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " finally\n" +
+ " {\n" +
+ " System.out.println(\"Finishing try-with-resources\");\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedFullWithStatementRecoveryUnitToString =
@@ -359,77 +359,77 @@ public void test0002() {
"}";
String expectedDietUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " }\n" +
"}\n";
String expectedDietWithStatementRecoveryUnitToString =
expectedDietUnitToString;
String expectedDietPlusBodyUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try (Reader reader = new FileReader(\"fileName\"))\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
- " }\n" +
- " catch (FileNotFoundException e)\n" +
- " {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " finally\n" +
- " {\n" +
- " System.out.println(\"Finishing try-with-resources\");\n" +
- " }\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try (Reader reader = new FileReader(\"fileName\"))\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
+ " }\n" +
+ " catch (FileNotFoundException e)\n" +
+ " {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " finally\n" +
+ " {\n" +
+ " System.out.println(\"Finishing try-with-resources\");\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try (Reader reader = new FileReader(\"fileName\"))\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
- " }\n" +
- " catch (FileNotFoundException e)\n" +
- " {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " finally\n" +
- " {\n" +
- " System.out.println(\"Finishing try-with-resources\");\n" +
- " }\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try (Reader reader = new FileReader(\"fileName\"))\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
+ " }\n" +
+ " catch (FileNotFoundException e)\n" +
+ " {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " finally\n" +
+ " {\n" +
+ " System.out.println(\"Finishing try-with-resources\");\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedFullUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try (Reader reader = new FileReader(\"fileName\"))\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
- " }\n" +
- " catch (FileNotFoundException e)\n" +
- " {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " finally\n" +
- " {\n" +
- " System.out.println(\"Finishing try-with-resources\");\n" +
- " }\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try (Reader reader = new FileReader(\"fileName\"))\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
+ " }\n" +
+ " catch (FileNotFoundException e)\n" +
+ " {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " finally\n" +
+ " {\n" +
+ " System.out.println(\"Finishing try-with-resources\");\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedFullWithStatementRecoveryUnitToString =
@@ -458,53 +458,53 @@ public void test0003() {
"}";
String expectedDietUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " }\n" +
"}\n";
String expectedDietWithStatementRecoveryUnitToString =
expectedDietUnitToString;
String expectedDietPlusBodyUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try (Reader reader = new FileReader(\"fileName\"))\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try (Reader reader = new FileReader(\"fileName\"))\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
" }\n" +
- " }\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try (Reader reader = new FileReader(\"fileName\"))\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
- " }\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try (Reader reader = new FileReader(\"fileName\"))\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedFullUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try (Reader reader = new FileReader(\"fileName\"))\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
- " }\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try (Reader reader = new FileReader(\"fileName\"))\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedFullWithStatementRecoveryUnitToString =
@@ -535,65 +535,65 @@ public void test0004() {
"}";
String expectedDietUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " }\n" +
"}\n";
String expectedDietWithStatementRecoveryUnitToString =
expectedDietUnitToString;
String expectedDietPlusBodyUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try (Reader reader = new FileReader(\"fileName\"))\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
- " }\n" +
- " finally\n" +
- " {\n" +
- " System.out.println(\"Finishing try-with-resources\");\n" +
- " }\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try (Reader reader = new FileReader(\"fileName\"))\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
+ " }\n" +
+ " finally\n" +
+ " {\n" +
+ " System.out.println(\"Finishing try-with-resources\");\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try (Reader reader = new FileReader(\"fileName\"))\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
- " }\n" +
- " finally\n" +
- " {\n" +
- " System.out.println(\"Finishing try-with-resources\");\n" +
- " }\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try (Reader reader = new FileReader(\"fileName\"))\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
+ " }\n" +
+ " finally\n" +
+ " {\n" +
+ " System.out.println(\"Finishing try-with-resources\");\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedFullUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try (Reader reader = new FileReader(\"fileName\"))\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
- " }\n" +
- " finally\n" +
- " {\n" +
- " System.out.println(\"Finishing try-with-resources\");\n" +
- " }\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try (Reader reader = new FileReader(\"fileName\"))\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
+ " }\n" +
+ " finally\n" +
+ " {\n" +
+ " System.out.println(\"Finishing try-with-resources\");\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedFullWithStatementRecoveryUnitToString =
@@ -624,65 +624,65 @@ public void test0005() {
"}";
String expectedDietUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " }\n" +
"}\n";
String expectedDietWithStatementRecoveryUnitToString =
expectedDietUnitToString;
String expectedDietPlusBodyUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try (Reader reader = new FileReader(\"fileName\"))\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
- " }\n" +
- " catch (FileNotFoundException e)\n" +
- " {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try (Reader reader = new FileReader(\"fileName\"))\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
+ " }\n" +
+ " catch (FileNotFoundException e)\n" +
+ " {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try (Reader reader = new FileReader(\"fileName\"))\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
- " }\n" +
- " catch (FileNotFoundException e)\n" +
- " {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try (Reader reader = new FileReader(\"fileName\"))\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
+ " }\n" +
+ " catch (FileNotFoundException e)\n" +
+ " {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedFullUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try (Reader reader = new FileReader(\"fileName\"))\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
- " }\n" +
- " catch (FileNotFoundException e)\n" +
- " {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try (Reader reader = new FileReader(\"fileName\"))\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
+ " }\n" +
+ " catch (FileNotFoundException e)\n" +
+ " {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedFullWithStatementRecoveryUnitToString =
@@ -715,77 +715,77 @@ public void test0006() {
"}";
String expectedDietUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " }\n" +
"}\n";
String expectedDietWithStatementRecoveryUnitToString =
expectedDietUnitToString;
String expectedDietPlusBodyUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
- " }\n" +
- " catch (FileNotFoundException | IOException | Exception e)\n" +
- " {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " finally\n" +
- " {\n" +
- " System.out.println(\"Finishing try-with-resources\");\n" +
- " }\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
+ " }\n" +
+ " catch (FileNotFoundException | IOException | Exception e)\n" +
+ " {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " finally\n" +
+ " {\n" +
+ " System.out.println(\"Finishing try-with-resources\");\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
- " }\n" +
- " catch (FileNotFoundException | IOException | Exception e)\n" +
- " {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " finally\n" +
- " {\n" +
- " System.out.println(\"Finishing try-with-resources\");\n" +
- " }\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
+ " }\n" +
+ " catch (FileNotFoundException | IOException | Exception e)\n" +
+ " {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " finally\n" +
+ " {\n" +
+ " System.out.println(\"Finishing try-with-resources\");\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedFullUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
- " }\n" +
- " catch (FileNotFoundException | IOException | Exception e)\n" +
- " {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " finally\n" +
- " {\n" +
- " System.out.println(\"Finishing try-with-resources\");\n" +
- " }\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
+ " }\n" +
+ " catch (FileNotFoundException | IOException | Exception e)\n" +
+ " {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " finally\n" +
+ " {\n" +
+ " System.out.println(\"Finishing try-with-resources\");\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedFullWithStatementRecoveryUnitToString =
@@ -813,47 +813,47 @@ public void test0007() {
"}";
String expectedDietUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " }\n" +
"}\n";
String expectedDietWithStatementRecoveryUnitToString =
expectedDietUnitToString;
String expectedDietPlusBodyUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " List<String> l = new ArrayList<>();\n" +
- " System.out.println(l);\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " List<String> l = new ArrayList<>();\n" +
+ " System.out.println(l);\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " List<String> l = new ArrayList<>();\n" +
- " System.out.println(l);\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " List<String> l = new ArrayList<>();\n" +
+ " System.out.println(l);\n" +
+ " }\n" +
"}\n";
String expectedFullUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " List<String> l = new ArrayList<>();\n" +
- " System.out.println(l);\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " List<String> l = new ArrayList<>();\n" +
+ " System.out.println(l);\n" +
+ " }\n" +
"}\n";
String expectedFullWithStatementRecoveryUnitToString =
@@ -881,47 +881,47 @@ public void test0008() {
"}";
String expectedDietUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " }\n" +
"}\n";
String expectedDietWithStatementRecoveryUnitToString =
expectedDietUnitToString;
String expectedDietPlusBodyUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " List<> l = new ArrayList<>();\n" +
- " System.out.println(l);\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " List<> l = new ArrayList<>();\n" +
+ " System.out.println(l);\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " List<> l = new ArrayList<>();\n" +
- " System.out.println(l);\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " List<> l = new ArrayList<>();\n" +
+ " System.out.println(l);\n" +
+ " }\n" +
"}\n";
String expectedFullUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " List<> l = new ArrayList<>();\n" +
- " System.out.println(l);\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " List<> l = new ArrayList<>();\n" +
+ " System.out.println(l);\n" +
+ " }\n" +
"}\n";
String expectedFullWithStatementRecoveryUnitToString =
@@ -949,47 +949,47 @@ public void test0009() {
"}";
String expectedDietUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " }\n" +
"}\n";
String expectedDietWithStatementRecoveryUnitToString =
expectedDietUnitToString;
String expectedDietPlusBodyUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " List<String> l = new java.util.ArrayList<>();\n" +
- " System.out.println(l);\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " List<String> l = new java.util.ArrayList<>();\n" +
+ " System.out.println(l);\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " List<String> l = new java.util.ArrayList<>();\n" +
- " System.out.println(l);\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " List<String> l = new java.util.ArrayList<>();\n" +
+ " System.out.println(l);\n" +
+ " }\n" +
"}\n";
String expectedFullUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " List<String> l = new java.util.ArrayList<>();\n" +
- " System.out.println(l);\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " List<String> l = new java.util.ArrayList<>();\n" +
+ " System.out.println(l);\n" +
+ " }\n" +
"}\n";
String expectedFullWithStatementRecoveryUnitToString =
@@ -1017,47 +1017,47 @@ public void test0010() {
"}";
String expectedDietUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " }\n" +
"}\n";
String expectedDietWithStatementRecoveryUnitToString =
expectedDietUnitToString;
String expectedDietPlusBodyUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " B<String>.C<Integer> o = new B<>.C<>();\n" +
- " System.out.println(l);\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " B<String>.C<Integer> o = new B<>.C<>();\n" +
+ " System.out.println(l);\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " B<String>.C<Integer> o = new B<>.C<>();\n" +
- " System.out.println(l);\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " B<String>.C<Integer> o = new B<>.C<>();\n" +
+ " System.out.println(l);\n" +
+ " }\n" +
"}\n";
String expectedFullUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " B<String>.C<Integer> o = new B<>.C<>();\n" +
- " System.out.println(l);\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " B<String>.C<Integer> o = new B<>.C<>();\n" +
+ " System.out.println(l);\n" +
+ " }\n" +
"}\n";
String expectedFullWithStatementRecoveryUnitToString =
@@ -1088,65 +1088,65 @@ public void test0011() {
"}";
String expectedDietUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " }\n" +
"}\n";
String expectedDietWithStatementRecoveryUnitToString =
expectedDietUnitToString;
String expectedDietPlusBodyUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try (Reader reader = new FileReader(\"fileName\"))\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
- " }\n" +
- " catch (FileNotFoundException e)\n" +
- " {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try (Reader reader = new FileReader(\"fileName\"))\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
+ " }\n" +
+ " catch (FileNotFoundException e)\n" +
+ " {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try (Reader reader = new FileReader(\"fileName\"))\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
- " }\n" +
- " catch (FileNotFoundException e)\n" +
- " {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try (Reader reader = new FileReader(\"fileName\"))\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
+ " }\n" +
+ " catch (FileNotFoundException e)\n" +
+ " {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedFullUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try (Reader reader = new FileReader(\"fileName\"))\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
- " }\n" +
- " catch (FileNotFoundException e)\n" +
- " {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try (Reader reader = new FileReader(\"fileName\"))\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
+ " }\n" +
+ " catch (FileNotFoundException e)\n" +
+ " {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedFullWithStatementRecoveryUnitToString =
@@ -1178,68 +1178,68 @@ public void test0012() {
"}";
String expectedDietUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " }\n" +
"}\n";
String expectedDietWithStatementRecoveryUnitToString =
expectedDietUnitToString;
String expectedDietPlusBodyUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try (Reader reader = new FileReader(\"fileName\");\n" +
- " Reader reader2 = new FileReader(\"fileName\"))\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
- " }\n" +
- " catch (FileNotFoundException e)\n" +
- " {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try (Reader reader = new FileReader(\"fileName\");\n" +
+ " Reader reader2 = new FileReader(\"fileName\"))\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
+ " }\n" +
+ " catch (FileNotFoundException e)\n" +
+ " {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try (Reader reader = new FileReader(\"fileName\");\n" +
- " Reader reader2 = new FileReader(\"fileName\"))\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
- " }\n" +
- " catch (FileNotFoundException e)\n" +
- " {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try (Reader reader = new FileReader(\"fileName\");\n" +
+ " Reader reader2 = new FileReader(\"fileName\"))\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
+ " }\n" +
+ " catch (FileNotFoundException e)\n" +
+ " {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedFullUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(String fileName) {\n" +
- " try (Reader reader = new FileReader(\"fileName\");\n" +
- " Reader reader2 = new FileReader(\"fileName\"))\n" +
- " {\n" +
- " System.out.println(reader.read());\n" +
- " }\n" +
- " catch (FileNotFoundException e)\n" +
- " {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(String fileName) {\n" +
+ " try (Reader reader = new FileReader(\"fileName\");\n" +
+ " Reader reader2 = new FileReader(\"fileName\"))\n" +
+ " {\n" +
+ " System.out.println(reader.read());\n" +
+ " }\n" +
+ " catch (FileNotFoundException e)\n" +
+ " {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedFullWithStatementRecoveryUnitToString =
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ReferenceExpressionSyntaxTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ReferenceExpressionSyntaxTest.java
index c4f14db2f..36e736cc1 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ReferenceExpressionSyntaxTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ReferenceExpressionSyntaxTest.java
@@ -54,9 +54,9 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
jsr335TestScratchArea = null;
}
}
- // Reference expression - super:: form, without type arguments.
+ // Reference expression - super:: form, without type arguments.
public void test0001() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" void foo(int x);\n" +
"}\n" +
@@ -74,35 +74,35 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" System.out.println(x);\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " void foo(int x);\n" +
- "}\n" +
- "public class X extends Y {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new X().doit();\n" +
- " }\n" +
- " void doit() {\n" +
- " I i = super::foo;\n" +
- " i.foo(10);\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(int x) {\n" +
- " System.out.println(x);\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " void foo(int x);\n" +
+ "}\n" +
+ "public class X extends Y {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().doit();\n" +
+ " }\n" +
+ " void doit() {\n" +
+ " I i = super::foo;\n" +
+ " i.foo(10);\n" +
+ " }\n" +
+ "}\n" +
+ "class Y {\n" +
+ " Y() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(int x) {\n" +
+ " System.out.println(x);\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0001", expectedUnitToString);
}
- // Reference expression - super:: form, with type arguments.
+ // Reference expression - super:: form, with type arguments.
public void test0002() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" void foo(int x);\n" +
"}\n" +
@@ -120,35 +120,35 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" System.out.println(x);\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " void foo(int x);\n" +
- "}\n" +
- "public class X extends Y {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new X().doit();\n" +
- " }\n" +
- " void doit() {\n" +
- " I i = super::<String>foo;\n" +
- " i.foo(10);\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(int x) {\n" +
- " System.out.println(x);\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " void foo(int x);\n" +
+ "}\n" +
+ "public class X extends Y {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().doit();\n" +
+ " }\n" +
+ " void doit() {\n" +
+ " I i = super::<String>foo;\n" +
+ " i.foo(10);\n" +
+ " }\n" +
+ "}\n" +
+ "class Y {\n" +
+ " Y() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(int x) {\n" +
+ " System.out.println(x);\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0002", expectedUnitToString);
}
// Reference expression - SimpleName:: form, without type arguments.
public void test0003() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" void foo(int x);\n" +
"}\n" +
@@ -163,32 +163,32 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" System.out.println(x);\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " void foo(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = Y::foo;\n" +
- " i.foo(10);\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " public static void foo(int x) {\n" +
- " System.out.println(x);\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " void foo(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = Y::foo;\n" +
+ " i.foo(10);\n" +
+ " }\n" +
+ "}\n" +
+ "class Y {\n" +
+ " Y() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void foo(int x) {\n" +
+ " System.out.println(x);\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0003", expectedUnitToString);
}
// Reference expression - SimpleName:: form, with type arguments.
public void test0004() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" void foo(int x);\n" +
"}\n" +
@@ -203,32 +203,32 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" System.out.println(x);\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " void foo(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = Y::<String>foo;\n" +
- " i.foo(10);\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " public static void foo(int x) {\n" +
- " System.out.println(x);\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " void foo(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = Y::<String>foo;\n" +
+ " i.foo(10);\n" +
+ " }\n" +
+ "}\n" +
+ "class Y {\n" +
+ " Y() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void foo(int x) {\n" +
+ " System.out.println(x);\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0004", expectedUnitToString);
}
// Reference expression - QualifiedName:: form, without type arguments.
public void test0005() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" void foo(int x);\n" +
"}\n" +
@@ -245,37 +245,37 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " void foo(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = Y.Z::foo;\n" +
- " i.foo(10);\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " static class Z {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " public static void foo(int x) {\n" +
- " System.out.println(x);\n" +
- " }\n" +
- " }\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " void foo(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = Y.Z::foo;\n" +
+ " i.foo(10);\n" +
+ " }\n" +
+ "}\n" +
+ "class Y {\n" +
+ " static class Z {\n" +
+ " Z() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void foo(int x) {\n" +
+ " System.out.println(x);\n" +
+ " }\n" +
+ " }\n" +
+ " Y() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0005", expectedUnitToString);
}
// Reference expression - QualifiedName:: form, with type arguments.
public void test0006() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" void foo(int x);\n" +
"}\n" +
@@ -292,37 +292,37 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " void foo(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = Y.Z::<String>foo;\n" +
- " i.foo(10);\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " static class Z {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " public static void foo(int x) {\n" +
- " System.out.println(x);\n" +
- " }\n" +
- " }\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " void foo(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = Y.Z::<String>foo;\n" +
+ " i.foo(10);\n" +
+ " }\n" +
+ "}\n" +
+ "class Y {\n" +
+ " static class Z {\n" +
+ " Z() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void foo(int x) {\n" +
+ " System.out.println(x);\n" +
+ " }\n" +
+ " }\n" +
+ " Y() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0006", expectedUnitToString);
}
// Reference expression - Primary:: form, without type arguments.
public void test0007() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" void foo(int x);\n" +
"}\n" +
@@ -337,32 +337,32 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" System.out.println(x);\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " void foo(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = new Y()::foo;\n" +
- " i.foo(10);\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " void foo(int x) {\n" +
- " System.out.println(x);\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " void foo(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = new Y()::foo;\n" +
+ " i.foo(10);\n" +
+ " }\n" +
+ "}\n" +
+ "class Y {\n" +
+ " Y() {\n" +
+ " super();\n" +
+ " }\n" +
+ " void foo(int x) {\n" +
+ " System.out.println(x);\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0007", expectedUnitToString);
}
// Reference expression - primary:: form, with type arguments.
public void test0008() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" void foo(int x);\n" +
"}\n" +
@@ -377,32 +377,32 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" System.out.println(x);\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " void foo(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = new Y()::<String>foo;\n" +
- " i.foo(10);\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " void foo(int x) {\n" +
- " System.out.println(x);\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " void foo(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = new Y()::<String>foo;\n" +
+ " i.foo(10);\n" +
+ " }\n" +
+ "}\n" +
+ "class Y {\n" +
+ " Y() {\n" +
+ " super();\n" +
+ " }\n" +
+ " void foo(int x) {\n" +
+ " System.out.println(x);\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0008", expectedUnitToString);
}
// Reference expression - X<T>:: form, without type arguments.
public void test0009() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" void foo(Y<String> y, int x);\n" +
"}\n" +
@@ -417,32 +417,32 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" System.out.println(x);\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " void foo(Y<String> y, int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = Y<String>::foo;\n" +
- " i.foo(new Y<String>(), 10);\n" +
- " }\n" +
- "}\n" +
- "class Y<T> {\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " void foo(int x) {\n" +
- " System.out.println(x);\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " void foo(Y<String> y, int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = Y<String>::foo;\n" +
+ " i.foo(new Y<String>(), 10);\n" +
+ " }\n" +
+ "}\n" +
+ "class Y<T> {\n" +
+ " Y() {\n" +
+ " super();\n" +
+ " }\n" +
+ " void foo(int x) {\n" +
+ " System.out.println(x);\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0009", expectedUnitToString);
}
// Reference expression - X<T>:: form, with type arguments.
public void test0010() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" void foo(Y<String> y, int x);\n" +
"}\n" +
@@ -457,32 +457,32 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" System.out.println(x);\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " void foo(Y<String> y, int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = Y<String>::<String>foo;\n" +
- " i.foo(new Y<String>(), 10);\n" +
- " }\n" +
- "}\n" +
- "class Y<T> {\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " void foo(int x) {\n" +
- " System.out.println(x);\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " void foo(Y<String> y, int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = Y<String>::<String>foo;\n" +
+ " i.foo(new Y<String>(), 10);\n" +
+ " }\n" +
+ "}\n" +
+ "class Y<T> {\n" +
+ " Y() {\n" +
+ " super();\n" +
+ " }\n" +
+ " void foo(int x) {\n" +
+ " System.out.println(x);\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0010", expectedUnitToString);
}
// Reference expression - X<T>.Name:: form, without type arguments.
public void test0011() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" void foo(Y<String>.Z z, int x);\n" +
"}\n" +
@@ -499,37 +499,37 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " void foo(Y<String>.Z z, int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = Y<String>.Z::foo;\n" +
- " i.foo(new Y<String>().new Z(), 10);\n" +
- " }\n" +
- "}\n" +
- "class Y<T> {\n" +
- " class Z {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " void foo(int x) {\n" +
- " System.out.println(x);\n" +
- " }\n" +
- " }\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " void foo(Y<String>.Z z, int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = Y<String>.Z::foo;\n" +
+ " i.foo(new Y<String>().new Z(), 10);\n" +
+ " }\n" +
+ "}\n" +
+ "class Y<T> {\n" +
+ " class Z {\n" +
+ " Z() {\n" +
+ " super();\n" +
+ " }\n" +
+ " void foo(int x) {\n" +
+ " System.out.println(x);\n" +
+ " }\n" +
+ " }\n" +
+ " Y() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0011", expectedUnitToString);
}
// Reference expression - X<T>.Name:: form, with type arguments.
public void test0012() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" void foo(Y<String>.Z z, int x);\n" +
"}\n" +
@@ -546,37 +546,37 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " void foo(Y<String>.Z z, int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = Y<String>.Z::<String>foo;\n" +
- " i.foo(new Y<String>().new Z(), 10);\n" +
- " }\n" +
- "}\n" +
- "class Y<T> {\n" +
- " class Z {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " void foo(int x) {\n" +
- " System.out.println(x);\n" +
- " }\n" +
- " }\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " void foo(Y<String>.Z z, int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = Y<String>.Z::<String>foo;\n" +
+ " i.foo(new Y<String>().new Z(), 10);\n" +
+ " }\n" +
+ "}\n" +
+ "class Y<T> {\n" +
+ " class Z {\n" +
+ " Z() {\n" +
+ " super();\n" +
+ " }\n" +
+ " void foo(int x) {\n" +
+ " System.out.println(x);\n" +
+ " }\n" +
+ " }\n" +
+ " Y() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0012", expectedUnitToString);
}
// Reference expression - X<T>.Y<K>:: form, without type arguments.
public void test0013() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" void foo(Y<String>.Z<Integer> z, int x);\n" +
"}\n" +
@@ -593,37 +593,37 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " void foo(Y<String>.Z<Integer> z, int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = Y<String>.Z<Integer>::foo;\n" +
- " i.foo(new Y<String>().new Z<Integer>(), 10);\n" +
- " }\n" +
- "}\n" +
- "class Y<T> {\n" +
- " class Z<K> {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " void foo(int x) {\n" +
- " System.out.println(x);\n" +
- " }\n" +
- " }\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " void foo(Y<String>.Z<Integer> z, int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = Y<String>.Z<Integer>::foo;\n" +
+ " i.foo(new Y<String>().new Z<Integer>(), 10);\n" +
+ " }\n" +
+ "}\n" +
+ "class Y<T> {\n" +
+ " class Z<K> {\n" +
+ " Z() {\n" +
+ " super();\n" +
+ " }\n" +
+ " void foo(int x) {\n" +
+ " System.out.println(x);\n" +
+ " }\n" +
+ " }\n" +
+ " Y() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0013", expectedUnitToString);
}
// Reference expression - X<T>.Y<K>:: form, with type arguments.
public void test0014() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" void foo(Y<String>.Z<Integer> z, int x);\n" +
"}\n" +
@@ -640,37 +640,37 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " void foo(Y<String>.Z<Integer> z, int x);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = Y<String>.Z<Integer>::<String>foo;\n" +
- " i.foo(new Y<String>().new Z<Integer>(), 10);\n" +
- " }\n" +
- "}\n" +
- "class Y<T> {\n" +
- " class Z<K> {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " void foo(int x) {\n" +
- " System.out.println(x);\n" +
- " }\n" +
- " }\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " void foo(Y<String>.Z<Integer> z, int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = Y<String>.Z<Integer>::<String>foo;\n" +
+ " i.foo(new Y<String>().new Z<Integer>(), 10);\n" +
+ " }\n" +
+ "}\n" +
+ "class Y<T> {\n" +
+ " class Z<K> {\n" +
+ " Z() {\n" +
+ " super();\n" +
+ " }\n" +
+ " void foo(int x) {\n" +
+ " System.out.println(x);\n" +
+ " }\n" +
+ " }\n" +
+ " Y() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0014", expectedUnitToString);
}
// Constructor reference expression - X<T>.Y<K>::new form, with type arguments.
public void test0015() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" void foo(Y<String> y);\n" +
"}\n" +
@@ -687,35 +687,35 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" }\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " void foo(Y<String> y);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = Y<String>.Z<Integer>::<String>new;\n" +
- " i.foo(new Y<String>());\n" +
- " }\n" +
- "}\n" +
- "class Y<T> {\n" +
- " class Z<K> {\n" +
- " Z() {\n" +
- " super();\n" +
- " System.out.println(\"Y<T>.Z<K>::new\");\n" +
- " }\n" +
- " }\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " void foo(Y<String> y);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = Y<String>.Z<Integer>::<String>new;\n" +
+ " i.foo(new Y<String>());\n" +
+ " }\n" +
+ "}\n" +
+ "class Y<T> {\n" +
+ " class Z<K> {\n" +
+ " Z() {\n" +
+ " super();\n" +
+ " System.out.println(\"Y<T>.Z<K>::new\");\n" +
+ " }\n" +
+ " }\n" +
+ " Y() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0015", expectedUnitToString);
}
// Reference expression - PrimitiveType[]:: form, with type arguments.
public void test0016() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" Object copy(int [] ia);\n" +
"}\n" +
@@ -725,24 +725,24 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" i.copy(new int[10]); \n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " Object copy(int[] ia);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = int[]::<String>clone;\n" +
- " i.copy(new int[10]);\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " Object copy(int[] ia);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = int[]::<String>clone;\n" +
+ " i.copy(new int[10]);\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0016", expectedUnitToString);
- }
+ }
// Reference expression - Name[]:: form, with type arguments.
public void test0017() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" Object copy(X [] ia);\n" +
"}\n" +
@@ -752,24 +752,24 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" i.copy(new X[10]); \n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " Object copy(X[] ia);\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = X[]::<String>clone;\n" +
- " i.copy(new X[10]);\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " Object copy(X[] ia);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = X[]::<String>clone;\n" +
+ " i.copy(new X[10]);\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0017", expectedUnitToString);
- }
+ }
// Reference expression - X<T>.Y<K>[]:: form, with type arguments.
public void test0018() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" Object copy(X<String>.Y<Integer> [] p);\n" +
"}\n" +
@@ -782,31 +782,31 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" i.copy(xs); \n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " Object copy(X<String>.Y<Integer>[] p);\n" +
- "}\n" +
- "public class X<T> {\n" +
- " class Y<K> {\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = X<String>.Y<Integer>[]::<String>clone;\n" +
- " X<String>.Y<Integer>[] xs = null;\n" +
- " i.copy(xs);\n" +
- " }\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " Object copy(X<String>.Y<Integer>[] p);\n" +
+ "}\n" +
+ "public class X<T> {\n" +
+ " class Y<K> {\n" +
+ " Y() {\n" +
+ " super();\n" +
+ " }\n" +
+ " }\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = X<String>.Y<Integer>[]::<String>clone;\n" +
+ " X<String>.Y<Integer>[] xs = null;\n" +
+ " i.copy(xs);\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0018", expectedUnitToString);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384320, syntax error while mixing 308 and 335.
public void test0019() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" void foo(X<String> s, int x);\n" +
"}\n" +
@@ -818,27 +818,27 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
"@interface Foo {\n" +
" String [] value();\n" +
"}\n";
- String expectedUnitToString =
- "interface I {\n" +
- " void foo(X<String> s, int x);\n" +
- "}\n" +
- "public class X<T> {\n" +
- " I i = X<@Foo({\"hello\"}) String>::foo;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo(int x) {\n" +
- " }\n" +
- "}\n" +
- "@interface Foo {\n" +
- " String[] value();\n" +
+ String expectedUnitToString =
+ "interface I {\n" +
+ " void foo(X<String> s, int x);\n" +
+ "}\n" +
+ "public class X<T> {\n" +
+ " I i = X<@Foo({\"hello\"}) String>::foo;\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " void foo(int x) {\n" +
+ " }\n" +
+ "}\n" +
+ "@interface Foo {\n" +
+ " String[] value();\n" +
"}\n";
checkParse(CHECK_PARSER | CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0019", expectedUnitToString);
}
// Reference expression - Name::new forms, with/without type arguments.
public void test0020() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" Y foo(int x);\n" +
"}\n" +
@@ -870,7 +870,7 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" System.out.println(x);\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"interface I {\n" +
" Y foo(int x);\n" +
"}\n" +
@@ -911,19 +911,19 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=385132
public void test385132() throws IOException {
String source = "::";
- String expectedErrorString =
+ String expectedErrorString =
"----------\n" +
"1. ERROR in test385132 (at line 1)\n" +
" ::\n" +
" ^^\n" +
"Syntax error on token \"::\", delete this token\n" +
"----------\n";
-
+
checkParse(CHECK_PARSER , source.toCharArray(), expectedErrorString, "test385132", null);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=385374, Support for 308 style type annotations on 335 constructs.
public void test385374() throws IOException {
- String source =
+ String source =
"interface I {\n" +
" void foo();\n" +
"}\n" +
@@ -950,8 +950,8 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
" // Qualified generic type array form with dimension annotations and type parameter annotations.\n" +
" I x9 = @TypeAnnotation X<@TypeParameterAnnotation String>.Y<@TypeParameterAnnotation String> @ArrayAnnotation[]@ArrayAnnotation[]::<@TypeParameterAnnotation String>clone; \n" +
"}\n";
-
- String expectedUnitToString =
+
+ String expectedUnitToString =
"interface I {\n" +
" void foo();\n" +
"}\n" +
@@ -975,7 +975,7 @@ public class ReferenceExpressionSyntaxTest extends AbstractSyntaxTreeTest {
}
/* https://bugs.eclipse.org/bugs/show_bug.cgi?id=385374, Support for 308 style type annotations on 335 constructs - make sure illegal modifiers are rejected
This test has been rendered meaningless as the grammar has been so throughly changed - Type annotations are not accepted via modifiers in the first place.
- Disabling this test as we don't want fragile and unstable tests that are at the whimsy of the diagnose parser's complex algorithms.
+ Disabling this test as we don't want fragile and unstable tests that are at the whimsy of the diagnose parser's complex algorithms.
*/
public void test385374a() throws IOException {
// Nop.
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ReferenceTypeCompletionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ReferenceTypeCompletionTest.java
index 5c5634ad7..3ca664b2b 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ReferenceTypeCompletionTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ReferenceTypeCompletionTest.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest10.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest10.java
index 588ffadea..5ed1fbe24 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest10.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest10.java
@@ -10,7 +10,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Jesper Steen Møller <jesper@selskabet.org> - contributions for:
+ * Jesper Steen Møller <jesper@selskabet.org> - contributions for:
* Bug 531046: [10] ICodeAssist#codeSelect support for 'var'
*******************************************************************************/
package org.eclipse.jdt.core.tests.compiler.parser;
@@ -34,22 +34,22 @@ public class SelectionParserTest10 extends AbstractSelectionTest {
}
public void test001() throws JavaModelException {
- String string = "public class X {\n"
+ String string = "public class X {\n"
+ " public static void main(String[] args) {\n"
+ " var s_s = args[0];\n"
+ " }\n"
- + "}\n";
+ + "}\n";
String selection = "s_s";
String expectedSelection = "<SelectionOnLocalName:var s_s = args[0]>;";
String completionIdentifier = "s_s";
- String expectedUnitDisplayString = "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " <SelectionOnLocalName:var s_s = args[0]>;\n" +
- " }\n" +
+ String expectedUnitDisplayString = "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " <SelectionOnLocalName:var s_s = args[0]>;\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "s_s";
String testName = "X.java";
@@ -62,22 +62,22 @@ public class SelectionParserTest10 extends AbstractSelectionTest {
}
public void test002() throws JavaModelException {
- String string = "public class X {\n"
+ String string = "public class X {\n"
+ " public static void main(String[] args) {\n"
+ " var s_s = args[0];\n"
+ " }\n"
- + "}\n";
+ + "}\n";
String selection = "var";
String expectedSelection = "<SelectOnType:var>";
String completionIdentifier = "var";
- String expectedUnitDisplayString = "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
+ String expectedUnitDisplayString = "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
" <SelectOnType:var> s_s = args[0];\n" +
- " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "var";
String testName = "X.java";
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest12.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest12.java
index 7912c9e4b..34b1c4a6e 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest12.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest12.java
@@ -50,21 +50,21 @@ public void test001() throws JavaModelException {
String selectionIdentifier = "ONE";
String expectedUnitDisplayString =
- "public class X {\n" +
- " static final String ONE;\n" +
- " static final String TWO;\n" +
- " static final String THREE;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(String num) {\n" +
- " {\n" +
- " switch (num) {\n" +
- " case <SelectOnName:ONE> :\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " static final String ONE;\n" +
+ " static final String TWO;\n" +
+ " static final String THREE;\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(String num) {\n" +
+ " {\n" +
+ " switch (num) {\n" +
+ " case <SelectOnName:ONE> :\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "ONE";
String testName = "X.java";
@@ -96,25 +96,25 @@ public void test002() throws JavaModelException {
String selectionIdentifier = "ONE";
String expectedUnitDisplayString =
- "public class X {\n" +
- " enum Num {\n" +
- " ONE(),\n" +
- " TWO(),\n" +
- " THREE(),\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Num() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(Num num) {\n" +
- " {\n" +
- " switch (num) {\n" +
- " case <SelectOnName:ONE> :\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " enum Num {\n" +
+ " ONE(),\n" +
+ " TWO(),\n" +
+ " THREE(),\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " Num() {\n" +
+ " }\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(Num num) {\n" +
+ " {\n" +
+ " switch (num) {\n" +
+ " case <SelectOnName:ONE> :\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "ONE";
String testName = "X.java";
@@ -146,21 +146,21 @@ public void test003() throws JavaModelException {
String selectionIdentifier = "TWO";
String expectedUnitDisplayString =
- "public class X {\n" +
- " static final String ONE;\n" +
- " static final String TWO;\n" +
- " static final String THREE;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(String num) {\n" +
- " {\n" +
- " switch (num) {\n" +
- " case <SelectOnName:TWO> :\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " static final String ONE;\n" +
+ " static final String TWO;\n" +
+ " static final String THREE;\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(String num) {\n" +
+ " {\n" +
+ " switch (num) {\n" +
+ " case <SelectOnName:TWO> :\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "TWO";
String testName = "X.java";
@@ -192,25 +192,25 @@ public void test004() throws JavaModelException {
String selectionIdentifier = "TWO";
String expectedUnitDisplayString =
- "public class X {\n" +
- " enum Num {\n" +
- " ONE(),\n" +
- " TWO(),\n" +
- " THREE(),\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Num() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(Num num) {\n" +
- " {\n" +
- " switch (num) {\n" +
- " case <SelectOnName:TWO> :\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " enum Num {\n" +
+ " ONE(),\n" +
+ " TWO(),\n" +
+ " THREE(),\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " Num() {\n" +
+ " }\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(Num num) {\n" +
+ " {\n" +
+ " switch (num) {\n" +
+ " case <SelectOnName:TWO> :\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "TWO";
String testName = "X.java";
@@ -243,21 +243,21 @@ public void test005() throws JavaModelException {
String expectedSelection = selectKey + selection + ">";
String selectionIdentifier = "ONE";
String expectedUnitDisplayString =
- "public class X {\n" +
- " static final String ONE;\n" +
- " static final String TWO;\n" +
- " static final String THREE;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(String num) {\n" +
- " {\n" +
- " switch (num) {\n" +
- " case <SelectOnName:ONE> :\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " static final String ONE;\n" +
+ " static final String TWO;\n" +
+ " static final String THREE;\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(String num) {\n" +
+ " {\n" +
+ " switch (num) {\n" +
+ " case <SelectOnName:ONE> :\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "ONE";
String testName = "X.java";
@@ -289,25 +289,25 @@ public void test006() throws JavaModelException {
String selectionIdentifier = "ONE";
String expectedUnitDisplayString =
- "public class X {\n" +
- " enum Num {\n" +
- " ONE(),\n" +
- " TWO(),\n" +
- " THREE(),\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Num() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(Num num) {\n" +
- " {\n" +
- " switch (num) {\n" +
- " case <SelectOnName:ONE> :\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " enum Num {\n" +
+ " ONE(),\n" +
+ " TWO(),\n" +
+ " THREE(),\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " Num() {\n" +
+ " }\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(Num num) {\n" +
+ " {\n" +
+ " switch (num) {\n" +
+ " case <SelectOnName:ONE> :\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "ONE";
String testName = "X.java";
@@ -339,21 +339,21 @@ public void test007() throws JavaModelException {
String selectionIdentifier = "TWO";
String expectedUnitDisplayString =
- "public class X {\n" +
- " static final String ONE;\n" +
- " static final String TWO;\n" +
- " static final String THREE;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(String num) {\n" +
- " {\n" +
- " switch (num) {\n" +
- " case <SelectOnName:TWO> :\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " static final String ONE;\n" +
+ " static final String TWO;\n" +
+ " static final String THREE;\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(String num) {\n" +
+ " {\n" +
+ " switch (num) {\n" +
+ " case <SelectOnName:TWO> :\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "TWO";
String testName = "X.java";
@@ -385,25 +385,25 @@ public void test008() throws JavaModelException {
String selectionIdentifier = "TWO";
String expectedUnitDisplayString =
- "public class X {\n" +
- " enum Num {\n" +
- " ONE(),\n" +
- " TWO(),\n" +
- " THREE(),\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Num() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(Num num) {\n" +
- " {\n" +
- " switch (num) {\n" +
- " case <SelectOnName:TWO> :\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " enum Num {\n" +
+ " ONE(),\n" +
+ " TWO(),\n" +
+ " THREE(),\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " Num() {\n" +
+ " }\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(Num num) {\n" +
+ " {\n" +
+ " switch (num) {\n" +
+ " case <SelectOnName:TWO> :\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "TWO";
String testName = "X.java";
@@ -436,23 +436,23 @@ public void test009() throws JavaModelException {
String selectionIdentifier = "num_";
String expectedUnitDisplayString =
- "public class X {\n" +
- " enum Num {\n" +
- " ONE(),\n" +
- " TWO(),\n" +
- " THREE(),\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Num() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(Num num_) {\n" +
- " {\n" +
- " <SelectOnName:num_>;\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " enum Num {\n" +
+ " ONE(),\n" +
+ " TWO(),\n" +
+ " THREE(),\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " Num() {\n" +
+ " }\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(Num num_) {\n" +
+ " {\n" +
+ " <SelectOnName:num_>;\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "num_";
String testName = "X.java";
@@ -487,28 +487,28 @@ public void test010() throws JavaModelException {
String selectionIdentifier = "i_j";
String expectedUnitDisplayString =
- "public class X {\n" +
- " enum Num {\n" +
- " ONE(),\n" +
- " TWO(),\n" +
- " THREE(),\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Num() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(Num num_) {\n" +
- " switch (num_) {\n" +
- " case THREE ->\n" +
- " {\n" +
- " int i_j;\n" +
- " System.out.println(<SelectOnName:i_j>);\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " enum Num {\n" +
+ " ONE(),\n" +
+ " TWO(),\n" +
+ " THREE(),\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " Num() {\n" +
+ " }\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(Num num_) {\n" +
+ " switch (num_) {\n" +
+ " case THREE ->\n" +
+ " {\n" +
+ " int i_j;\n" +
+ " System.out.println(<SelectOnName:i_j>);\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "i_j";
String testName = "X.java";
@@ -540,21 +540,21 @@ public void test011() throws JavaModelException {
String selectionIdentifier = "num_";
String expectedUnitDisplayString =
- "public class X {\n" +
- " enum Num {\n" +
- " ONE(),\n" +
- " TWO(),\n" +
- " THREE(),\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Num() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(Num num_) {\n" +
- " <SelectOnName:num_>;\n" +
- " }\n" +
+ "public class X {\n" +
+ " enum Num {\n" +
+ " ONE(),\n" +
+ " TWO(),\n" +
+ " THREE(),\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " Num() {\n" +
+ " }\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(Num num_) {\n" +
+ " <SelectOnName:num_>;\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "num_";
String testName = "X.java";
@@ -585,12 +585,12 @@ public void test012() throws JavaModelException {
String selectionIdentifier = "num_";
String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(int num_) {\n" +
- " <SelectOnName:num_>;\n" +
- " }\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(int num_) {\n" +
+ " <SelectOnName:num_>;\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "num_";
String testName = "X.java";
@@ -609,7 +609,7 @@ public void test013() throws JavaModelException {
" public static void foo(int num_) {\n" +
" int i = switch (num_) {\n" +
" case 1, 2, 3 -> (num_ + 1);\n" +
- " default -> 0;\n" +
+ " default -> 0;\n" +
" }" +
" }\n" +
"}";
@@ -620,15 +620,15 @@ public void test013() throws JavaModelException {
String selectionIdentifier = "num_";
String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(int num_) {\n" +
- " int i;\n" +
- " {\n" +
- " <SelectOnName:num_>;\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(int num_) {\n" +
+ " int i;\n" +
+ " {\n" +
+ " <SelectOnName:num_>;\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "num_";
String testName = "X.java";
@@ -647,7 +647,7 @@ public void test014() throws JavaModelException {
" public static void foo(int num_) {\n" +
" int i = switch (num_) {\n" +
" case 1, 2, 3 -> 0;\n" +
- " default -> (num_ + 1);\n" +
+ " default -> (num_ + 1);\n" +
" }" +
" }\n" +
"}";
@@ -658,15 +658,15 @@ public void test014() throws JavaModelException {
String selectionIdentifier = "num_";
String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(int num_) {\n" +
- " int i;\n" +
- " {\n" +
- " <SelectOnName:num_>;\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(int num_) {\n" +
+ " int i;\n" +
+ " {\n" +
+ " <SelectOnName:num_>;\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "num_";
String testName = "X.java";
@@ -685,7 +685,7 @@ public void test015() throws JavaModelException {
" public static void foo(int num_) {\n" +
" int i = switch (num_) {\n" +
" case 1, 2, 3 -> 0;\n" +
- " default -> (num_ + 1);\n" +
+ " default -> (num_ + 1);\n" +
" }" +
" }\n" +
"}";
@@ -696,15 +696,15 @@ public void test015() throws JavaModelException {
String selectionIdentifier = "num_";
String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(int num_) {\n" +
- " int i;\n" +
- " {\n" +
- " <SelectOnName:num_>;\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(int num_) {\n" +
+ " int i;\n" +
+ " {\n" +
+ " <SelectOnName:num_>;\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "num_";
String testName = "X.java";
@@ -719,13 +719,13 @@ public void test015() throws JavaModelException {
* Multi constant case statement with '->', selection is a referenced name of type int in switch expression
*/
public void test016() throws JavaModelException {
- String string = "public class X {\n" +
- " public void bar(int s) {\n" +
- " int i_j = switch (s) {\n" +
+ String string = "public class X {\n" +
+ " public void bar(int s) {\n" +
+ " int i_j = switch (s) {\n" +
" case 1, 2, 3 -> (s+1);\n" +
- " default -> i_j;\n" +
- " };\n" +
- " }\n" +
+ " default -> i_j;\n" +
+ " };\n" +
+ " }\n" +
"}\n";
String selection = "i_j";
@@ -734,15 +734,15 @@ public void test016() throws JavaModelException {
String selectionIdentifier = "i_j";
String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void bar(int s) {\n" +
- " int i_j;\n" +
- " {\n" +
- " <SelectOnName:i_j>;\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public void bar(int s) {\n" +
+ " int i_j;\n" +
+ " {\n" +
+ " <SelectOnName:i_j>;\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "i_j";
String testName = "X.java";
@@ -754,13 +754,13 @@ public void test016() throws JavaModelException {
selectionIdentifier, expectedReplacedSource, testName);
}
public void test017() throws JavaModelException {
- String string = "public class X {\n" +
- " public void bar(int s) {\n" +
- " int i_j = switch (s) {\n" +
+ String string = "public class X {\n" +
+ " public void bar(int s) {\n" +
+ " int i_j = switch (s) {\n" +
" case 1, 2, 3 -> (s+1);\n" +
- " default -> (1+i_j);\n" +
- " };\n" +
- " }\n" +
+ " default -> (1+i_j);\n" +
+ " };\n" +
+ " }\n" +
"}\n";
String selection = "i_j";
@@ -769,15 +769,15 @@ public void test017() throws JavaModelException {
String selectionIdentifier = "i_j";
String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void bar(int s) {\n" +
- " int i_j;\n" +
- " {\n" +
- " <SelectOnName:i_j>;\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public void bar(int s) {\n" +
+ " int i_j;\n" +
+ " {\n" +
+ " <SelectOnName:i_j>;\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "i_j";
String testName = "X.java";
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest13.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest13.java
index 854d12db8..f6678dd98 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest13.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest13.java
@@ -50,21 +50,21 @@ public void test001() throws JavaModelException {
String selectionIdentifier = "ONE";
String expectedUnitDisplayString =
- "public class X {\n" +
- " static final String ONE;\n" +
- " static final String TWO;\n" +
- " static final String THREE;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(String num) {\n" +
- " {\n" +
- " switch (num) {\n" +
- " case <SelectOnName:ONE> :\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " static final String ONE;\n" +
+ " static final String TWO;\n" +
+ " static final String THREE;\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(String num) {\n" +
+ " {\n" +
+ " switch (num) {\n" +
+ " case <SelectOnName:ONE> :\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "ONE";
String testName = "X.java";
@@ -96,25 +96,25 @@ public void test002() throws JavaModelException {
String selectionIdentifier = "ONE";
String expectedUnitDisplayString =
- "public class X {\n" +
- " enum Num {\n" +
- " ONE(),\n" +
- " TWO(),\n" +
- " THREE(),\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Num() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(Num num) {\n" +
- " {\n" +
- " switch (num) {\n" +
- " case <SelectOnName:ONE> :\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " enum Num {\n" +
+ " ONE(),\n" +
+ " TWO(),\n" +
+ " THREE(),\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " Num() {\n" +
+ " }\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(Num num) {\n" +
+ " {\n" +
+ " switch (num) {\n" +
+ " case <SelectOnName:ONE> :\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "ONE";
String testName = "X.java";
@@ -146,21 +146,21 @@ public void test003() throws JavaModelException {
String selectionIdentifier = "TWO";
String expectedUnitDisplayString =
- "public class X {\n" +
- " static final String ONE;\n" +
- " static final String TWO;\n" +
- " static final String THREE;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(String num) {\n" +
- " {\n" +
- " switch (num) {\n" +
- " case <SelectOnName:TWO> :\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " static final String ONE;\n" +
+ " static final String TWO;\n" +
+ " static final String THREE;\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(String num) {\n" +
+ " {\n" +
+ " switch (num) {\n" +
+ " case <SelectOnName:TWO> :\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "TWO";
String testName = "X.java";
@@ -192,25 +192,25 @@ public void test004() throws JavaModelException {
String selectionIdentifier = "TWO";
String expectedUnitDisplayString =
- "public class X {\n" +
- " enum Num {\n" +
- " ONE(),\n" +
- " TWO(),\n" +
- " THREE(),\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Num() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(Num num) {\n" +
- " {\n" +
- " switch (num) {\n" +
- " case <SelectOnName:TWO> :\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " enum Num {\n" +
+ " ONE(),\n" +
+ " TWO(),\n" +
+ " THREE(),\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " Num() {\n" +
+ " }\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(Num num) {\n" +
+ " {\n" +
+ " switch (num) {\n" +
+ " case <SelectOnName:TWO> :\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "TWO";
String testName = "X.java";
@@ -243,21 +243,21 @@ public void test005() throws JavaModelException {
String expectedSelection = selectKey + selection + ">";
String selectionIdentifier = "ONE";
String expectedUnitDisplayString =
- "public class X {\n" +
- " static final String ONE;\n" +
- " static final String TWO;\n" +
- " static final String THREE;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(String num) {\n" +
- " {\n" +
- " switch (num) {\n" +
- " case <SelectOnName:ONE> :\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " static final String ONE;\n" +
+ " static final String TWO;\n" +
+ " static final String THREE;\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(String num) {\n" +
+ " {\n" +
+ " switch (num) {\n" +
+ " case <SelectOnName:ONE> :\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "ONE";
String testName = "X.java";
@@ -289,25 +289,25 @@ public void test006() throws JavaModelException {
String selectionIdentifier = "ONE";
String expectedUnitDisplayString =
- "public class X {\n" +
- " enum Num {\n" +
- " ONE(),\n" +
- " TWO(),\n" +
- " THREE(),\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Num() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(Num num) {\n" +
- " {\n" +
- " switch (num) {\n" +
- " case <SelectOnName:ONE> :\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " enum Num {\n" +
+ " ONE(),\n" +
+ " TWO(),\n" +
+ " THREE(),\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " Num() {\n" +
+ " }\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(Num num) {\n" +
+ " {\n" +
+ " switch (num) {\n" +
+ " case <SelectOnName:ONE> :\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "ONE";
String testName = "X.java";
@@ -339,21 +339,21 @@ public void test007() throws JavaModelException {
String selectionIdentifier = "TWO";
String expectedUnitDisplayString =
- "public class X {\n" +
- " static final String ONE;\n" +
- " static final String TWO;\n" +
- " static final String THREE;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(String num) {\n" +
- " {\n" +
- " switch (num) {\n" +
- " case <SelectOnName:TWO> :\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " static final String ONE;\n" +
+ " static final String TWO;\n" +
+ " static final String THREE;\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(String num) {\n" +
+ " {\n" +
+ " switch (num) {\n" +
+ " case <SelectOnName:TWO> :\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "TWO";
String testName = "X.java";
@@ -385,25 +385,25 @@ public void test008() throws JavaModelException {
String selectionIdentifier = "TWO";
String expectedUnitDisplayString =
- "public class X {\n" +
- " enum Num {\n" +
- " ONE(),\n" +
- " TWO(),\n" +
- " THREE(),\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Num() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(Num num) {\n" +
- " {\n" +
- " switch (num) {\n" +
- " case <SelectOnName:TWO> :\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " enum Num {\n" +
+ " ONE(),\n" +
+ " TWO(),\n" +
+ " THREE(),\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " Num() {\n" +
+ " }\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(Num num) {\n" +
+ " {\n" +
+ " switch (num) {\n" +
+ " case <SelectOnName:TWO> :\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "TWO";
String testName = "X.java";
@@ -436,23 +436,23 @@ public void test009() throws JavaModelException {
String selectionIdentifier = "num_";
String expectedUnitDisplayString =
- "public class X {\n" +
- " enum Num {\n" +
- " ONE(),\n" +
- " TWO(),\n" +
- " THREE(),\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Num() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(Num num_) {\n" +
- " {\n" +
- " <SelectOnName:num_>;\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " enum Num {\n" +
+ " ONE(),\n" +
+ " TWO(),\n" +
+ " THREE(),\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " Num() {\n" +
+ " }\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(Num num_) {\n" +
+ " {\n" +
+ " <SelectOnName:num_>;\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "num_";
String testName = "X.java";
@@ -487,26 +487,26 @@ public void test010() throws JavaModelException {
String selectionIdentifier = "i_j";
String expectedUnitDisplayString =
- "public class X {\n" +
- " enum Num {\n" +
- " ONE(),\n" +
- " TWO(),\n" +
- " THREE(),\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Num() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(Num num_) {\n" +
- " {\n" +
- " {\n" +
- " int i_j;\n" +
- " <SelectOnName:i_j>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " enum Num {\n" +
+ " ONE(),\n" +
+ " TWO(),\n" +
+ " THREE(),\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " Num() {\n" +
+ " }\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(Num num_) {\n" +
+ " {\n" +
+ " {\n" +
+ " int i_j;\n" +
+ " <SelectOnName:i_j>;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "i_j";
String testName = "X.java";
@@ -538,21 +538,21 @@ public void test011() throws JavaModelException {
String selectionIdentifier = "num_";
String expectedUnitDisplayString =
- "public class X {\n" +
- " enum Num {\n" +
- " ONE(),\n" +
- " TWO(),\n" +
- " THREE(),\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Num() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(Num num_) {\n" +
- " <SelectOnName:num_>;\n" +
- " }\n" +
+ "public class X {\n" +
+ " enum Num {\n" +
+ " ONE(),\n" +
+ " TWO(),\n" +
+ " THREE(),\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " Num() {\n" +
+ " }\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(Num num_) {\n" +
+ " <SelectOnName:num_>;\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "num_";
String testName = "X.java";
@@ -583,12 +583,12 @@ public void test012() throws JavaModelException {
String selectionIdentifier = "num_";
String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(int num_) {\n" +
- " <SelectOnName:num_>;\n" +
- " }\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(int num_) {\n" +
+ " <SelectOnName:num_>;\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "num_";
String testName = "X.java";
@@ -607,7 +607,7 @@ public void test013() throws JavaModelException {
" public static void foo(int num_) {\n" +
" int i = switch (num_) {\n" +
" case 1, 2, 3 -> (num_ + 1);\n" +
- " default -> 0;\n" +
+ " default -> 0;\n" +
" }" +
" }\n" +
"}";
@@ -618,15 +618,15 @@ public void test013() throws JavaModelException {
String selectionIdentifier = "num_";
String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(int num_) {\n" +
- " int i;\n" +
- " {\n" +
- " <SelectOnName:num_>;\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(int num_) {\n" +
+ " int i;\n" +
+ " {\n" +
+ " <SelectOnName:num_>;\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "num_";
String testName = "X.java";
@@ -645,7 +645,7 @@ public void test014() throws JavaModelException {
" public static void foo(int num_) {\n" +
" int i = switch (num_) {\n" +
" case 1, 2, 3 -> 0;\n" +
- " default -> (num_ + 1);\n" +
+ " default -> (num_ + 1);\n" +
" }" +
" }\n" +
"}";
@@ -656,15 +656,15 @@ public void test014() throws JavaModelException {
String selectionIdentifier = "num_";
String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(int num_) {\n" +
- " int i;\n" +
- " {\n" +
- " <SelectOnName:num_>;\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(int num_) {\n" +
+ " int i;\n" +
+ " {\n" +
+ " <SelectOnName:num_>;\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "num_";
String testName = "X.java";
@@ -683,7 +683,7 @@ public void test015() throws JavaModelException {
" public static void foo(int num_) {\n" +
" int i = switch (num_) {\n" +
" case 1, 2, 3 -> 0;\n" +
- " default -> (num_ + 1);\n" +
+ " default -> (num_ + 1);\n" +
" }" +
" }\n" +
"}";
@@ -694,15 +694,15 @@ public void test015() throws JavaModelException {
String selectionIdentifier = "num_";
String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public static void foo(int num_) {\n" +
- " int i;\n" +
- " {\n" +
- " <SelectOnName:num_>;\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static void foo(int num_) {\n" +
+ " int i;\n" +
+ " {\n" +
+ " <SelectOnName:num_>;\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "num_";
String testName = "X.java";
@@ -717,13 +717,13 @@ public void test015() throws JavaModelException {
* Multi constant case statement with '->', selection is a referenced name of type int in switch expression
*/
public void test016() throws JavaModelException {
- String string = "public class X {\n" +
- " public void bar(int s) {\n" +
- " int i_j = switch (s) {\n" +
+ String string = "public class X {\n" +
+ " public void bar(int s) {\n" +
+ " int i_j = switch (s) {\n" +
" case 1, 2, 3 -> (s+1);\n" +
- " default -> i_j;\n" +
- " };\n" +
- " }\n" +
+ " default -> i_j;\n" +
+ " };\n" +
+ " }\n" +
"}\n";
String selection = "i_j";
@@ -732,15 +732,15 @@ public void test016() throws JavaModelException {
String selectionIdentifier = "i_j";
String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void bar(int s) {\n" +
- " int i_j;\n" +
- " {\n" +
- " <SelectOnName:i_j>;\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public void bar(int s) {\n" +
+ " int i_j;\n" +
+ " {\n" +
+ " <SelectOnName:i_j>;\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "i_j";
String testName = "X.java";
@@ -752,13 +752,13 @@ public void test016() throws JavaModelException {
selectionIdentifier, expectedReplacedSource, testName);
}
public void test017() throws JavaModelException {
- String string = "public class X {\n" +
- " public void bar(int s) {\n" +
- " int i_j = switch (s) {\n" +
+ String string = "public class X {\n" +
+ " public void bar(int s) {\n" +
+ " int i_j = switch (s) {\n" +
" case 1, 2, 3 -> (s+1);\n" +
- " default -> (1+i_j);\n" +
- " };\n" +
- " }\n" +
+ " default -> (1+i_j);\n" +
+ " };\n" +
+ " }\n" +
"}\n";
String selection = "i_j";
@@ -767,15 +767,15 @@ public void test017() throws JavaModelException {
String selectionIdentifier = "i_j";
String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void bar(int s) {\n" +
- " int i_j;\n" +
- " {\n" +
- " <SelectOnName:i_j>;\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public void bar(int s) {\n" +
+ " int i_j;\n" +
+ " {\n" +
+ " <SelectOnName:i_j>;\n" +
+ " }\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "i_j";
String testName = "X.java";
@@ -787,20 +787,20 @@ public void test017() throws JavaModelException {
selectionIdentifier, expectedReplacedSource, testName);
}
public void test018() throws JavaModelException {
- String string = "import org.eclipse.jdt.annotation.*;\n" +
- "import java.util.function.*;\n" +
- "interface IN0 {} \n" +
- "interface IN1 extends IN0 {} \n" +
- "interface IN2 extends IN0 {}\n" +
- "public class X {\n" +
- " IN1 n_1() { return new IN1() {}; } \n" +
- " IN2 n_2() { return null; } \n" +
- " <M> void m( Supplier< M> m2) { } \n" +
- " void testSw(int i) { \n" +
- " m(switch(i) { \n" +
- " case 1 -> this::n_1; \n" +
- " default -> this::n_2; }); \n" +
- " }\n" +
+ String string = "import org.eclipse.jdt.annotation.*;\n" +
+ "import java.util.function.*;\n" +
+ "interface IN0 {} \n" +
+ "interface IN1 extends IN0 {} \n" +
+ "interface IN2 extends IN0 {}\n" +
+ "public class X {\n" +
+ " IN1 n_1() { return new IN1() {}; } \n" +
+ " IN2 n_2() { return null; } \n" +
+ " <M> void m( Supplier< M> m2) { } \n" +
+ " void testSw(int i) { \n" +
+ " m(switch(i) { \n" +
+ " case 1 -> this::n_1; \n" +
+ " default -> this::n_2; }); \n" +
+ " }\n" +
"}";
String selection = "n_1";
@@ -809,31 +809,31 @@ public void test018() throws JavaModelException {
String selectionIdentifier = "n_1";
String expectedUnitDisplayString =
- "import org.eclipse.jdt.annotation.*;\n" +
- "import java.util.function.*;\n" +
- "interface IN0 {\n" +
- "}\n" +
- "interface IN1 extends IN0 {\n" +
- "}\n" +
- "interface IN2 extends IN0 {\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " IN1 n_1() {\n" +
- " }\n" +
- " IN2 n_2() {\n" +
- " }\n" +
- " <M>void m(Supplier<M> m2) {\n" +
- " }\n" +
- " void testSw(int i) {\n" +
- " m(switch (i) {\n" +
- "case 1 ->\n" +
- " <SelectionOnReferenceExpressionName:this::n_1>;\n" +
- "default ->\n" +
- " this::n_2;\n" +
- "});\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "import java.util.function.*;\n" +
+ "interface IN0 {\n" +
+ "}\n" +
+ "interface IN1 extends IN0 {\n" +
+ "}\n" +
+ "interface IN2 extends IN0 {\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " IN1 n_1() {\n" +
+ " }\n" +
+ " IN2 n_2() {\n" +
+ " }\n" +
+ " <M>void m(Supplier<M> m2) {\n" +
+ " }\n" +
+ " void testSw(int i) {\n" +
+ " m(switch (i) {\n" +
+ "case 1 ->\n" +
+ " <SelectionOnReferenceExpressionName:this::n_1>;\n" +
+ "default ->\n" +
+ " this::n_2;\n" +
+ "});\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "this::n_1";
String testName = "X.java";
@@ -845,20 +845,20 @@ public void test018() throws JavaModelException {
selectionIdentifier, expectedReplacedSource, testName);
}
public void test019() throws JavaModelException {
- String string = "import org.eclipse.jdt.annotation.*;\n" +
- "import java.util.function.*;\n" +
- "interface IN0 {} \n" +
- "interface IN1 extends IN0 {} \n" +
- "interface IN2 extends IN0 {}\n" +
- "public class X {\n" +
- " IN1 n_1() { return new IN1() {}; } \n" +
- " IN2 n_2() { return null; } \n" +
- " <M> void m( Supplier< M> m2) { } \n" +
- " void testSw(int i) { \n" +
- " m(switch(i) { \n" +
- " case 2 -> () -> n_1(); \n" +
- " default -> this::n_2; }); \n" +
- " }\n" +
+ String string = "import org.eclipse.jdt.annotation.*;\n" +
+ "import java.util.function.*;\n" +
+ "interface IN0 {} \n" +
+ "interface IN1 extends IN0 {} \n" +
+ "interface IN2 extends IN0 {}\n" +
+ "public class X {\n" +
+ " IN1 n_1() { return new IN1() {}; } \n" +
+ " IN2 n_2() { return null; } \n" +
+ " <M> void m( Supplier< M> m2) { } \n" +
+ " void testSw(int i) { \n" +
+ " m(switch(i) { \n" +
+ " case 2 -> () -> n_1(); \n" +
+ " default -> this::n_2; }); \n" +
+ " }\n" +
"}";
String selection = "n_1";
@@ -867,31 +867,31 @@ public void test019() throws JavaModelException {
String selectionIdentifier = "n_1";
String expectedUnitDisplayString =
- "import org.eclipse.jdt.annotation.*;\n" +
- "import java.util.function.*;\n" +
- "interface IN0 {\n" +
- "}\n" +
- "interface IN1 extends IN0 {\n" +
- "}\n" +
- "interface IN2 extends IN0 {\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " IN1 n_1() {\n" +
- " }\n" +
- " IN2 n_2() {\n" +
- " }\n" +
- " <M>void m(Supplier<M> m2) {\n" +
- " }\n" +
- " void testSw(int i) {\n" +
- " m(switch (i) {\n" +
- "case 2 ->\n" +
- " () -> <SelectOnMessageSend:n_1()>;\n" +
- "default ->\n" +
- " this::n_2;\n" +
- "});\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "import java.util.function.*;\n" +
+ "interface IN0 {\n" +
+ "}\n" +
+ "interface IN1 extends IN0 {\n" +
+ "}\n" +
+ "interface IN2 extends IN0 {\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " IN1 n_1() {\n" +
+ " }\n" +
+ " IN2 n_2() {\n" +
+ " }\n" +
+ " <M>void m(Supplier<M> m2) {\n" +
+ " }\n" +
+ " void testSw(int i) {\n" +
+ " m(switch (i) {\n" +
+ "case 2 ->\n" +
+ " () -> <SelectOnMessageSend:n_1()>;\n" +
+ "default ->\n" +
+ " this::n_2;\n" +
+ "});\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "n_1()";
String testName = "X.java";
@@ -903,19 +903,19 @@ public void test019() throws JavaModelException {
selectionIdentifier, expectedReplacedSource, testName);
}
public void test020() throws JavaModelException {
- String string = "import org.eclipse.jdt.annotation.*;\n" +
- "import java.util.function.*;\n" +
- "interface IN0 {} \n" +
- "interface IN1 extends IN0 {} \n" +
- "interface IN2 extends IN0 {}\n" +
- "public class X {\n" +
- " IN1 n_1() { return new IN1() {}; } \n" +
- " IN2 n_2() { return null; } \n" +
- " <M> void m( Supplier< M> m2) { } \n" +
- " void testSw(int i) { \n" +
- " m(switch(i) { \n" +
- " default -> this::n_2; }); \n" +
- " }\n" +
+ String string = "import org.eclipse.jdt.annotation.*;\n" +
+ "import java.util.function.*;\n" +
+ "interface IN0 {} \n" +
+ "interface IN1 extends IN0 {} \n" +
+ "interface IN2 extends IN0 {}\n" +
+ "public class X {\n" +
+ " IN1 n_1() { return new IN1() {}; } \n" +
+ " IN2 n_2() { return null; } \n" +
+ " <M> void m( Supplier< M> m2) { } \n" +
+ " void testSw(int i) { \n" +
+ " m(switch(i) { \n" +
+ " default -> this::n_2; }); \n" +
+ " }\n" +
"}";
String selection = "n_2";
@@ -924,29 +924,29 @@ public void test020() throws JavaModelException {
String selectionIdentifier = "n_2";
String expectedUnitDisplayString =
- "import org.eclipse.jdt.annotation.*;\n" +
- "import java.util.function.*;\n" +
- "interface IN0 {\n" +
- "}\n" +
- "interface IN1 extends IN0 {\n" +
- "}\n" +
- "interface IN2 extends IN0 {\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " IN1 n_1() {\n" +
- " }\n" +
- " IN2 n_2() {\n" +
- " }\n" +
- " <M>void m(Supplier<M> m2) {\n" +
- " }\n" +
- " void testSw(int i) {\n" +
- " m(switch (i) {\n" +
- "default ->\n" +
- " <SelectionOnReferenceExpressionName:this::n_2>;\n" +
- "});\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "import java.util.function.*;\n" +
+ "interface IN0 {\n" +
+ "}\n" +
+ "interface IN1 extends IN0 {\n" +
+ "}\n" +
+ "interface IN2 extends IN0 {\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " IN1 n_1() {\n" +
+ " }\n" +
+ " IN2 n_2() {\n" +
+ " }\n" +
+ " <M>void m(Supplier<M> m2) {\n" +
+ " }\n" +
+ " void testSw(int i) {\n" +
+ " m(switch (i) {\n" +
+ "default ->\n" +
+ " <SelectionOnReferenceExpressionName:this::n_2>;\n" +
+ "});\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "this::n_2";
String testName = "X.java";
@@ -958,19 +958,19 @@ public void test020() throws JavaModelException {
selectionIdentifier, expectedReplacedSource, testName);
}
public void test021() throws JavaModelException {
- String string = "import org.eclipse.jdt.annotation.*;\n" +
- "import java.util.function.*;\n" +
- "interface IN0 {} \n" +
- "interface IN1 extends IN0 {} \n" +
- "interface IN2 extends IN0 {}\n" +
- "public class X {\n" +
- " IN1 n_1(int ijk) { return new IN1() {}; } \n" +
- " IN2 n_2() { return null; } \n" +
- " <M> void m( Supplier< M> m2) { } \n" +
- " void testSw(int ijk) { \n" +
- " m(switch(ijk) { \n" +
- " default -> () -> n_1(ijk); }); \n" +
- " }\n" +
+ String string = "import org.eclipse.jdt.annotation.*;\n" +
+ "import java.util.function.*;\n" +
+ "interface IN0 {} \n" +
+ "interface IN1 extends IN0 {} \n" +
+ "interface IN2 extends IN0 {}\n" +
+ "public class X {\n" +
+ " IN1 n_1(int ijk) { return new IN1() {}; } \n" +
+ " IN2 n_2() { return null; } \n" +
+ " <M> void m( Supplier< M> m2) { } \n" +
+ " void testSw(int ijk) { \n" +
+ " m(switch(ijk) { \n" +
+ " default -> () -> n_1(ijk); }); \n" +
+ " }\n" +
"}";
String selection = "n_1";
@@ -979,29 +979,29 @@ public void test021() throws JavaModelException {
String selectionIdentifier = "n_1";
String expectedUnitDisplayString =
- "import org.eclipse.jdt.annotation.*;\n" +
- "import java.util.function.*;\n" +
- "interface IN0 {\n" +
- "}\n" +
- "interface IN1 extends IN0 {\n" +
- "}\n" +
- "interface IN2 extends IN0 {\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " IN1 n_1(int ijk) {\n" +
- " }\n" +
- " IN2 n_2() {\n" +
- " }\n" +
- " <M>void m(Supplier<M> m2) {\n" +
- " }\n" +
- " void testSw(int ijk) {\n" +
- " m(switch (ijk) {\n" +
- "default ->\n" +
- " () -> <SelectOnMessageSend:n_1(ijk)>;\n" +
- "});\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "import java.util.function.*;\n" +
+ "interface IN0 {\n" +
+ "}\n" +
+ "interface IN1 extends IN0 {\n" +
+ "}\n" +
+ "interface IN2 extends IN0 {\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " IN1 n_1(int ijk) {\n" +
+ " }\n" +
+ " IN2 n_2() {\n" +
+ " }\n" +
+ " <M>void m(Supplier<M> m2) {\n" +
+ " }\n" +
+ " void testSw(int ijk) {\n" +
+ " m(switch (ijk) {\n" +
+ "default ->\n" +
+ " () -> <SelectOnMessageSend:n_1(ijk)>;\n" +
+ "});\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "n_1(ijk)";
String testName = "X.java";
@@ -1013,19 +1013,19 @@ public void test021() throws JavaModelException {
selectionIdentifier, expectedReplacedSource, testName);
}
public void test022() throws JavaModelException {
- String string = "import org.eclipse.jdt.annotation.*;\n" +
- "import java.util.function.*;\n" +
- "interface IN0 {} \n" +
- "interface IN1 extends IN0 {} \n" +
- "interface IN2 extends IN0 {}\n" +
- "public class X {\n" +
- " IN1 n_1(int ijk) { return new IN1() {}; } \n" +
- " IN2 n_2() { return null; } \n" +
- " <M> void m( Supplier< M> m2) { } \n" +
- " void testSw(int ijk) { \n" +
- " m(switch(ijk) { \n" +
- " default -> () -> n_1(ijk); }); \n" +
- " }\n" +
+ String string = "import org.eclipse.jdt.annotation.*;\n" +
+ "import java.util.function.*;\n" +
+ "interface IN0 {} \n" +
+ "interface IN1 extends IN0 {} \n" +
+ "interface IN2 extends IN0 {}\n" +
+ "public class X {\n" +
+ " IN1 n_1(int ijk) { return new IN1() {}; } \n" +
+ " IN2 n_2() { return null; } \n" +
+ " <M> void m( Supplier< M> m2) { } \n" +
+ " void testSw(int ijk) { \n" +
+ " m(switch(ijk) { \n" +
+ " default -> () -> n_1(ijk); }); \n" +
+ " }\n" +
"}";
String selection = "ijk";
@@ -1034,29 +1034,29 @@ public void test022() throws JavaModelException {
String selectionIdentifier = "ijk";
String expectedUnitDisplayString =
- "import org.eclipse.jdt.annotation.*;\n" +
- "import java.util.function.*;\n" +
- "interface IN0 {\n" +
- "}\n" +
- "interface IN1 extends IN0 {\n" +
- "}\n" +
- "interface IN2 extends IN0 {\n" +
- "}\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " IN1 n_1(int ijk) {\n" +
- " }\n" +
- " IN2 n_2() {\n" +
- " }\n" +
- " <M>void m(Supplier<M> m2) {\n" +
- " }\n" +
- " void testSw(int ijk) {\n" +
- " m(switch (ijk) {\n" +
- "default ->\n" +
- " () -> n_1(<SelectOnName:ijk>);\n" +
- "});\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "import java.util.function.*;\n" +
+ "interface IN0 {\n" +
+ "}\n" +
+ "interface IN1 extends IN0 {\n" +
+ "}\n" +
+ "interface IN2 extends IN0 {\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " }\n" +
+ " IN1 n_1(int ijk) {\n" +
+ " }\n" +
+ " IN2 n_2() {\n" +
+ " }\n" +
+ " <M>void m(Supplier<M> m2) {\n" +
+ " }\n" +
+ " void testSw(int ijk) {\n" +
+ " m(switch (ijk) {\n" +
+ "default ->\n" +
+ " () -> n_1(<SelectOnName:ijk>);\n" +
+ "});\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "ijk";
String testName = "X.java";
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest18.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest18.java
index 72fadde93..d5eaba2ac 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest18.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest18.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -32,7 +32,7 @@ public SelectionParserTest18(String testName) {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=424110, [1.8][hovering] Hover, F3 does not work for method reference in method invocation
public void test424110() throws JavaModelException {
- String string =
+ String string =
"public class X {\n" +
" static F f = X::m; // [1] Works\n" +
" int i = fun(X::m); // [2] Does not work\n" +
@@ -53,20 +53,20 @@ public void test424110() throws JavaModelException {
String completionIdentifier = "m";
String expectedUnitDisplayString =
- "public class X {\n" +
- " static F f = <SelectionOnReferenceExpressionName:X::m>;\n" +
- " int i;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " public static int m(int x) {\n" +
- " }\n" +
- " private int fun(F f) {\n" +
- " }\n" +
- "}\n" +
- "interface F {\n" +
- " int foo(int x);\n" +
+ "public class X {\n" +
+ " static F f = <SelectionOnReferenceExpressionName:X::m>;\n" +
+ " int i;\n" +
+ " <clinit>() {\n" +
+ " }\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static int m(int x) {\n" +
+ " }\n" +
+ " private int fun(F f) {\n" +
+ " }\n" +
+ "}\n" +
+ "interface F {\n" +
+ " int foo(int x);\n" +
"}\n";
String expectedReplacedSource = "X::m";
String testName = "<select>";
@@ -86,7 +86,7 @@ public void test424110() throws JavaModelException {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=424110, [1.8][hovering] Hover, F3 does not work for method reference in method invocation
public void test424110a() throws JavaModelException {
- String string =
+ String string =
"public class X {\n" +
" int i = fun(X::m); // [2] Does not work\n" +
" public static int m(int x) {\n" +
@@ -106,17 +106,17 @@ public void test424110a() throws JavaModelException {
String completionIdentifier = "m";
String expectedUnitDisplayString =
- "public class X {\n" +
- " int i = fun(<SelectionOnReferenceExpressionName:X::m>);\n" +
- " public X() {\n" +
- " }\n" +
- " public static int m(int x) {\n" +
- " }\n" +
- " private int fun(F f) {\n" +
- " }\n" +
- "}\n" +
- "interface F {\n" +
- " int foo(int x);\n" +
+ "public class X {\n" +
+ " int i = fun(<SelectionOnReferenceExpressionName:X::m>);\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public static int m(int x) {\n" +
+ " }\n" +
+ " private int fun(F f) {\n" +
+ " }\n" +
+ "}\n" +
+ "interface F {\n" +
+ " int foo(int x);\n" +
"}\n";
String expectedReplacedSource = "X::m";
String testName = "<select>";
@@ -136,7 +136,7 @@ public void test424110a() throws JavaModelException {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430572, [1.8] CCE on hovering over 'super' in lambda expression
public void test430572() throws JavaModelException {
- String string =
+ String string =
"@FunctionalInterface\n" +
"interface FI {\n" +
" default int getID() {\n" +
@@ -154,15 +154,15 @@ public void test430572() throws JavaModelException {
String completionIdentifier = "super";
String expectedUnitDisplayString =
- "@FunctionalInterface interface FI {\n" +
- " default int getID() {\n" +
- " }\n" +
- " void print();\n" +
- "}\n" +
- "class T {\n" +
- " FI f2 = () -> System.out.println(<SelectOnSuper:super>.toString());\n" +
- " T() {\n" +
- " }\n" +
+ "@FunctionalInterface interface FI {\n" +
+ " default int getID() {\n" +
+ " }\n" +
+ " void print();\n" +
+ "}\n" +
+ "class T {\n" +
+ " FI f2 = () -> System.out.println(<SelectOnSuper:super>.toString());\n" +
+ " T() {\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "super";
String testName = "<select>";
@@ -182,7 +182,7 @@ public void test430572() throws JavaModelException {
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=476693
public void test476693() throws JavaModelException {
- String string =
+ String string =
"import static java.util.stream.Collectors.toList;\n" +
"import java.util.List;\n" +
"import java.util.Spliterator;\n" +
@@ -254,7 +254,7 @@ public void test476693() throws JavaModelException {
testName);
}
public void test495912() {
- String string =
+ String string =
"package xy;\n" +
"public class Test {\n" +
" {\n" +
@@ -276,27 +276,27 @@ public void test495912() {
String completionIdentifier = "byteValue";
String expectedUnitDisplayString =
- "package xy;\n" +
- "public class Test {\n" +
- " {\n" +
- " {\n" +
- " Runnable r = () -> {\n" +
- " Integer i;\n" +
- " byte b = <SelectOnMessageSend:i.byteValue()>;\n" +
- " if (true)\n" +
- " {\n" +
- " if (false)\n" +
- " {\n" +
- " }\n" +
- " }\n" +
- " String s;\n" +
+ "package xy;\n" +
+ "public class Test {\n" +
+ " {\n" +
+ " {\n" +
+ " Runnable r = () -> {\n" +
+ " Integer i;\n" +
+ " byte b = <SelectOnMessageSend:i.byteValue()>;\n" +
+ " if (true)\n" +
+ " {\n" +
+ " if (false)\n" +
+ " {\n" +
+ " }\n" +
+ " }\n" +
+ " String s;\n" +
" };\n" +
- " }\n" +
- " }\n" +
- " public Test() {\n" +
- " }\n" +
- " public void foo(Runnable r) {\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
+ " public Test() {\n" +
+ " }\n" +
+ " public void foo(Runnable r) {\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "i.byteValue()";
String testName = "<select>";
@@ -315,7 +315,7 @@ public void test495912() {
testName);
}
public void test495912a() {
- String string =
+ String string =
"package xy;\n" +
"public class Test {\n" +
" {\n" +
@@ -338,29 +338,29 @@ public void test495912a() {
String completionIdentifier = "byteValue";
String expectedUnitDisplayString =
- "package xy;\n" +
- "public class Test {\n" +
- " {\n" +
+ "package xy;\n" +
+ "public class Test {\n" +
+ " {\n" +
" {\n" +
- " Runnable r = () -> {\n" +
- " Integer i;\n" +
- " byte b = <SelectOnMessageSend:i.byteValue()>;\n" +
+ " Runnable r = () -> {\n" +
+ " Integer i;\n" +
+ " byte b = <SelectOnMessageSend:i.byteValue()>;\n" +
" if (true)\n" +
" {\n" +
" if (false)\n" +
" {\n" +
" }\n" +
" }\n" +
- " for (int i1;; (i1 < 42); i1 ++) \n" +
- " {\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " }\n" +
- " public Test() {\n" +
- " }\n" +
- " public void foo(Runnable r) {\n" +
- " }\n" +
+ " for (int i1;; (i1 < 42); i1 ++) \n" +
+ " {\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
+ " }\n" +
+ " public Test() {\n" +
+ " }\n" +
+ " public void foo(Runnable r) {\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "i.byteValue()";
String testName = "<select>";
@@ -379,7 +379,7 @@ public void test495912a() {
testName);
}
public void test495912b() {
- String string =
+ String string =
"package xy;\n" +
"import org.eclipse.e4.ui.internal.workbench.PartServiceImpl;\n" +
"import org.eclipse.e4.ui.model.application.ui.basic.MPart;\n" +
@@ -413,36 +413,36 @@ public void test495912b() {
String selectionIdentifier = "getTransientData";
String expectedUnitDisplayString =
- "package xy;\n" +
- "import org.eclipse.e4.ui.internal.workbench.PartServiceImpl;\n" +
- "import org.eclipse.e4.ui.model.application.ui.basic.MPart;\n" +
- "import org.eclipse.swt.widgets.Table;\n" +
- "import org.eclipse.ui.IWorkbenchWindow;\n" +
- "public abstract class CycleViewHandler extends CycleBaseHandler {\n" +
- " public CycleViewHandler() {\n" +
- " }\n" +
- " protected @Override void addItems(Table table, WorkbenchPage page) {\n" +
+ "package xy;\n" +
+ "import org.eclipse.e4.ui.internal.workbench.PartServiceImpl;\n" +
+ "import org.eclipse.e4.ui.model.application.ui.basic.MPart;\n" +
+ "import org.eclipse.swt.widgets.Table;\n" +
+ "import org.eclipse.ui.IWorkbenchWindow;\n" +
+ "public abstract class CycleViewHandler extends CycleBaseHandler {\n" +
+ " public CycleViewHandler() {\n" +
+ " }\n" +
+ " protected @Override void addItems(Table table, WorkbenchPage page) {\n" +
" List<MPart> parts;\n" + // this is the missing part without the fix in RecoveredMethod#add(Block....)
- " parts.stream().sorted((<no type> firstPart, <no type> secondPart) -> {\n" +
- " Long firstPartActivationTime = (Long) <SelectOnMessageSend:firstPart.getTransientData()>.getOrDefault(PartServiceImpl.PART_ACTIVATION_TIME, Long.MIN_VALUE);\n" +
- " Long secondPartActivationTime;\n" +
- " return 0;\n" +
- "}).forEach((<no type> part) -> {\n" +
- " if (true)\n" +
- " {\n" +
- " if (true)\n" +
- " {\n" +
- " }\n" +
- " }\n" +
- " else\n" +
- " {\n" +
- " IWorkbenchWindow iwbw;\n" +
- " if (true)\n" +
- " {\n" +
- " }\n" +
- " }\n" +
- "});\n" +
- " }\n" +
+ " parts.stream().sorted((<no type> firstPart, <no type> secondPart) -> {\n" +
+ " Long firstPartActivationTime = (Long) <SelectOnMessageSend:firstPart.getTransientData()>.getOrDefault(PartServiceImpl.PART_ACTIVATION_TIME, Long.MIN_VALUE);\n" +
+ " Long secondPartActivationTime;\n" +
+ " return 0;\n" +
+ "}).forEach((<no type> part) -> {\n" +
+ " if (true)\n" +
+ " {\n" +
+ " if (true)\n" +
+ " {\n" +
+ " }\n" +
+ " }\n" +
+ " else\n" +
+ " {\n" +
+ " IWorkbenchWindow iwbw;\n" +
+ " if (true)\n" +
+ " {\n" +
+ " }\n" +
+ " }\n" +
+ "});\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "firstPart.getTransientData()";
String testName = "<select>";
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionTest.java
index 39d934b0c..7869e3d62 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionTest.java
@@ -2481,21 +2481,21 @@ public void _test56() {
String completionIdentifier = "zoo";
String expectedUnitDisplayString =
- "class X {\n" +
- " void foo() {\n" +
- " new X(null) {\n" +
- " void goo() {\n" +
- " new X(<SelectOnMessageSend:zoo()>) {\n" +
- " void voo() {\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " Object zoo() {\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " X(Object k) {\n" +
- " }\n" +
+ "class X {\n" +
+ " void foo() {\n" +
+ " new X(null) {\n" +
+ " void goo() {\n" +
+ " new X(<SelectOnMessageSend:zoo()>) {\n" +
+ " void voo() {\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
+ " Object zoo() {\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
+ " X(Object k) {\n" +
+ " }\n" +
"}\n";
String expectedReplacedSource = "zoo()";
String testName = "<select>";
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceElementParserTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceElementParserTest.java
index 479115892..d15208ff8 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceElementParserTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceElementParserTest.java
@@ -5309,68 +5309,68 @@ public void test81() {
options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5);
options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
-
+
String s =
- "import java.util.Collection;\n" +
- "\n" +
- "public class X {\n" +
- " public abstract class AbstractData {}\n" +
- " \n" +
- " public interface IScalarData<T extends AbstractData> {}\n" +
- "\n" +
- " private static interface ValueObjectPropertyIterator {\n" +
- " public <T extends AbstractData> void iterateOnValueObjectProperty(IScalarData<T> scalarObject, T valueObject, Class<?> valueObjectType, final String name, final Class<?> scalarType) throws Exception;\n" +
- " }\n" +
- "\n" +
- " private static <T extends AbstractData> void iterateOnValueObjectProperties(IScalarData<T> scalarObject, T valueObject, ValueObjectPropertyIterator valueObjectPropertyIterator) {}\n" +
- " \n" +
- " public static <T extends AbstractData> void loadScalarFromValueObject(IScalarData<T> scalarObject, T valueObject) {\n" +
- " iterateOnValueObjectProperties(scalarObject, valueObject, new ValueObjectPropertyIterator() {\n" +
- " public <T extends AbstractData> void iterateOnValueObjectProperty(IScalarData<T> scalarObject, T valueObject, Class<?> valueObjectType, String name, Class<?> scalarType) throws Exception {\n" +
- " if (true) {\n" +
- " if (true) {\n" +
- " if (true) {\n" +
- " final Collection<IScalarData<AbstractData>> lazyCollection = createLazyCollection(\n" +
- " name, scalarType, null, null,\n" +
- " new CollectionProviderForTargetCollection<IScalarData<AbstractData>>() {\n" +
- " @Override\n" +
- " public Collection<IScalarData<AbstractData>> provideCollection(\n" +
- " final Collection<IScalarData<AbstractData> targetCollection, final Class<IScalarData<AbstractData>> scalarCollectionType) {\n" +
- " return null;\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " abstract class CollectionProviderForTargetCollection<S> {\n" +
- " abstract public Collection<S> provideCollection(Collection<S> targetCollection, Class<S> scalarCollectionType);\n" +
- " }\n" +
- "\n" +
- " private <S> Collection<S> createLazyCollection(String name,\n" +
- " Class<?> scalarType, final Collection<AbstractData> valueObjectCollection,\n" +
- " final Class<S> scalarCollectionType, CollectionProviderForTargetCollection<S> collectionProvider) {\n" +
- " return null;\n" +
- " }\n" +
- " });\n" +
- " }\n" +
+ "import java.util.Collection;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public abstract class AbstractData {}\n" +
+ " \n" +
+ " public interface IScalarData<T extends AbstractData> {}\n" +
+ "\n" +
+ " private static interface ValueObjectPropertyIterator {\n" +
+ " public <T extends AbstractData> void iterateOnValueObjectProperty(IScalarData<T> scalarObject, T valueObject, Class<?> valueObjectType, final String name, final Class<?> scalarType) throws Exception;\n" +
+ " }\n" +
+ "\n" +
+ " private static <T extends AbstractData> void iterateOnValueObjectProperties(IScalarData<T> scalarObject, T valueObject, ValueObjectPropertyIterator valueObjectPropertyIterator) {}\n" +
+ " \n" +
+ " public static <T extends AbstractData> void loadScalarFromValueObject(IScalarData<T> scalarObject, T valueObject) {\n" +
+ " iterateOnValueObjectProperties(scalarObject, valueObject, new ValueObjectPropertyIterator() {\n" +
+ " public <T extends AbstractData> void iterateOnValueObjectProperty(IScalarData<T> scalarObject, T valueObject, Class<?> valueObjectType, String name, Class<?> scalarType) throws Exception {\n" +
+ " if (true) {\n" +
+ " if (true) {\n" +
+ " if (true) {\n" +
+ " final Collection<IScalarData<AbstractData>> lazyCollection = createLazyCollection(\n" +
+ " name, scalarType, null, null,\n" +
+ " new CollectionProviderForTargetCollection<IScalarData<AbstractData>>() {\n" +
+ " @Override\n" +
+ " public Collection<IScalarData<AbstractData>> provideCollection(\n" +
+ " final Collection<IScalarData<AbstractData> targetCollection, final Class<IScalarData<AbstractData>> scalarCollectionType) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " abstract class CollectionProviderForTargetCollection<S> {\n" +
+ " abstract public Collection<S> provideCollection(Collection<S> targetCollection, Class<S> scalarCollectionType);\n" +
+ " }\n" +
+ "\n" +
+ " private <S> Collection<S> createLazyCollection(String name,\n" +
+ " Class<?> scalarType, final Collection<AbstractData> valueObjectCollection,\n" +
+ " final Class<S> scalarCollectionType, CollectionProviderForTargetCollection<S> collectionProvider) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
"}";
String expectedUnitToString =
- "import java.util.Collection;\n" +
- "public class X {\n" +
- " public abstract class AbstractData {\n" +
- " java.lang.Object(0)\n" +
- " }\n" +
- " public interface IScalarData {\n" +
- " }\n" +
- " private static interface ValueObjectPropertyIterator {\n" +
- " public void iterateOnValueObjectProperty(IScalarData<T> scalarObject, T valueObject, Class<?> valueObjectType, String name, Class<?> scalarType, ) throws Exception, {}\n" +
- " }\n" +
- " java.lang.Object(0)\n" +
- " private static void iterateOnValueObjectProperties(IScalarData<T> scalarObject, T valueObject, ValueObjectPropertyIterator valueObjectPropertyIterator, ) {}\n" +
- " public static void loadScalarFromValueObject(IScalarData<T> scalarObject, T valueObject, ) {}\n" +
+ "import java.util.Collection;\n" +
+ "public class X {\n" +
+ " public abstract class AbstractData {\n" +
+ " java.lang.Object(0)\n" +
+ " }\n" +
+ " public interface IScalarData {\n" +
+ " }\n" +
+ " private static interface ValueObjectPropertyIterator {\n" +
+ " public void iterateOnValueObjectProperty(IScalarData<T> scalarObject, T valueObject, Class<?> valueObjectType, String name, Class<?> scalarType, ) throws Exception, {}\n" +
+ " }\n" +
+ " java.lang.Object(0)\n" +
+ " private static void iterateOnValueObjectProperties(IScalarData<T> scalarObject, T valueObject, ValueObjectPropertyIterator valueObjectPropertyIterator, ) {}\n" +
+ " public static void loadScalarFromValueObject(IScalarData<T> scalarObject, T valueObject, ) {}\n" +
"}";
String testName = "test81: full parse";
@@ -5384,7 +5384,7 @@ public void test81() {
public void acceptBaseReference(char[][] typeName, int sourceStart,
int sourceEnd) {
// TODO Auto-generated method stub
-
+
}
public void enterCallinMapping(CallinInfo callinInfo) {}
public void enterCalloutMapping(CalloutInfo calloutInfo) {}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest.java
index de1c44590..8690004d7 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest.java
@@ -3881,48 +3881,48 @@ public void test0047() {
public void testBug430336() {
String s =
- "package test1;\n" +
- "import java.util.Collection;\n" +
- "public class E {\n" +
- " void foo(Collection collection) {\n" +
- " collection\n" +
- " }\n" +
+ "package test1;\n" +
+ "import java.util.Collection;\n" +
+ "public class E {\n" +
+ " void foo(Collection collection) {\n" +
+ " collection\n" +
+ " }\n" +
"}\n";
String expectedDietUnitToString =
- "package test1;\n" +
- "import java.util.Collection;\n" +
- "public class E {\n" +
- " public E() {\n" +
- " }\n" +
- " void foo(Collection collection) {\n" +
- " }\n" +
+ "package test1;\n" +
+ "import java.util.Collection;\n" +
+ "public class E {\n" +
+ " public E() {\n" +
+ " }\n" +
+ " void foo(Collection collection) {\n" +
+ " }\n" +
"}\n";
String expectedDietWithStatementRecoveryUnitToString =
expectedDietUnitToString;
String expectedDietPlusBodyUnitToString =
- "package test1;\n" +
- "import java.util.Collection;\n" +
- "public class E {\n" +
- " public E() {\n" +
- " super();\n" +
- " }\n" +
- " void foo(Collection collection) {\n" +
- " }\n" +
+ "package test1;\n" +
+ "import java.util.Collection;\n" +
+ "public class E {\n" +
+ " public E() {\n" +
+ " super();\n" +
+ " }\n" +
+ " void foo(Collection collection) {\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package test1;\n" +
- "import java.util.Collection;\n" +
- "public class E {\n" +
- " public E() {\n" +
- " super();\n" +
- " }\n" +
+ "package test1;\n" +
+ "import java.util.Collection;\n" +
+ "public class E {\n" +
+ " public E() {\n" +
+ " super();\n" +
+ " }\n" +
" void foo(Collection collection) {\n" +
- " collection = $missing$;\n" +
- " }\n" +
+ " collection = $missing$;\n" +
+ " }\n" +
"}\n";
String expectedFullUnitToString =
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest_1_5.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest_1_5.java
index c245ba5e4..729c8269e 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest_1_5.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest_1_5.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -737,43 +737,43 @@ public void test0007() {
// incorrectly used modifier
public void test0008() {
String s =
- "public class Try {\n" +
- "\n" +
- " void m() {\n" +
- "\n" +
- " synchronized new Object();\n" +
- "\n" +
+ "public class Try {\n" +
+ "\n" +
+ " void m() {\n" +
+ "\n" +
+ " synchronized new Object();\n" +
+ "\n" +
" }\n" +
- "}\n" +
+ "}\n" +
"\n";
String expectedDietUnitToString =
- "public class Try {\n" +
- " public Try() {\n" +
- " }\n" +
- " void m() {\n" +
- " }\n" +
+ "public class Try {\n" +
+ " public Try() {\n" +
+ " }\n" +
+ " void m() {\n" +
+ " }\n" +
"}\n";
String expectedDietWithStatementRecoveryUnitToString =
expectedDietUnitToString;
String expectedDietPlusBodyUnitToString =
- "public class Try {\n" +
- " public Try() {\n" +
- " super();\n" +
- " }\n" +
- " void m() {\n" +
- " }\n" +
+ "public class Try {\n" +
+ " public Try() {\n" +
+ " super();\n" +
+ " }\n" +
+ " void m() {\n" +
+ " }\n" +
"}\n";
String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "public class Try {\n" +
- " public Try() {\n" +
- " super();\n" +
- " }\n" +
- " void m() {\n" +
- " }\n" +
+ "public class Try {\n" +
+ " public Try() {\n" +
+ " super();\n" +
+ " }\n" +
+ " void m() {\n" +
+ " }\n" +
"}\n";
String expectedFullUnitToString =
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TypeAnnotationSyntaxTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TypeAnnotationSyntaxTest.java
index 26e13171c..fb7494dcc 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TypeAnnotationSyntaxTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TypeAnnotationSyntaxTest.java
@@ -46,7 +46,7 @@ public class TypeAnnotationSyntaxTest extends AbstractSyntaxTreeTest {
private static String jsr308TestScratchArea = "c:\\Jsr308TestScratchArea";
private static String referenceCompiler = "C:\\jdk-7-ea-bin-b75-windows-i586-30_oct_2009\\jdk7\\bin\\javac.exe";
-
+
static {
// TESTS_NAMES = new String [] { "test0137" };
}
@@ -59,7 +59,7 @@ public class TypeAnnotationSyntaxTest extends AbstractSyntaxTreeTest {
public static Test suite() {
return buildMinimalComplianceTestSuite(testClass(), F_1_8);
}
-
+
static final class LocationPrinterVisitor extends ASTVisitor {
TypeReference enclosingReference;
Map locations;
@@ -126,7 +126,7 @@ public class TypeAnnotationSyntaxTest extends AbstractSyntaxTreeTest {
this.locations.put(key, null);
return;
}
-
+
StringBuffer buffer = new StringBuffer("[");
for (int i = 0, max = tab.length; i < max; i += 2) {
if (i > 0) {
@@ -246,31 +246,31 @@ public void test0001() throws IOException {
"@Marker class D extends @Marker @SingleMember(0) @Normal(Value = 0) String {}\n" +
"@Marker class E extends String {}\n;";
- String expectedUnitToString =
- "@Marker class A extends String {\n" +
- " A() {\n" +
- " super();\n" +
- " }\n" +
- "}\n" +
- "@Marker class B extends @Marker String {\n" +
- " B() {\n" +
- " super();\n" +
- " }\n" +
- "}\n" +
- "@Marker class C extends @Marker @SingleMember(0) String {\n" +
- " C() {\n" +
- " super();\n" +
- " }\n" +
- "}\n" +
- "@Marker class D extends @Marker @SingleMember(0) @Normal(Value = 0) String {\n" +
- " D() {\n" +
- " super();\n" +
- " }\n" +
- "}\n" +
- "@Marker class E extends String {\n" +
- " E() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "@Marker class A extends String {\n" +
+ " A() {\n" +
+ " super();\n" +
+ " }\n" +
+ "}\n" +
+ "@Marker class B extends @Marker String {\n" +
+ " B() {\n" +
+ " super();\n" +
+ " }\n" +
+ "}\n" +
+ "@Marker class C extends @Marker @SingleMember(0) String {\n" +
+ " C() {\n" +
+ " super();\n" +
+ " }\n" +
+ "}\n" +
+ "@Marker class D extends @Marker @SingleMember(0) @Normal(Value = 0) String {\n" +
+ " D() {\n" +
+ " super();\n" +
+ " }\n" +
+ "}\n" +
+ "@Marker class E extends String {\n" +
+ " E() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER , source.toCharArray(), null, "test0001", expectedUnitToString);
}
@@ -280,32 +280,32 @@ public void test0002() throws IOException {
"class C extends @Marker @SingleMember(0) String {}\n" +
"class D extends @Marker @SingleMember(0) @Normal(Value = 0) String {}\n" +
"class E extends String {}\n;";
-
- String expectedUnitToString =
- "class A extends String {\n" +
- " A() {\n" +
- " super();\n" +
- " }\n" +
- "}\n" +
- "class B extends @Marker String {\n" +
- " B() {\n" +
- " super();\n" +
- " }\n" +
- "}\n" +
- "class C extends @Marker @SingleMember(0) String {\n" +
- " C() {\n" +
- " super();\n" +
- " }\n" +
- "}\n" +
- "class D extends @Marker @SingleMember(0) @Normal(Value = 0) String {\n" +
- " D() {\n" +
- " super();\n" +
- " }\n" +
- "}\n" +
- "class E extends String {\n" +
- " E() {\n" +
- " super();\n" +
- " }\n" +
+
+ String expectedUnitToString =
+ "class A extends String {\n" +
+ " A() {\n" +
+ " super();\n" +
+ " }\n" +
+ "}\n" +
+ "class B extends @Marker String {\n" +
+ " B() {\n" +
+ " super();\n" +
+ " }\n" +
+ "}\n" +
+ "class C extends @Marker @SingleMember(0) String {\n" +
+ " C() {\n" +
+ " super();\n" +
+ " }\n" +
+ "}\n" +
+ "class D extends @Marker @SingleMember(0) @Normal(Value = 0) String {\n" +
+ " D() {\n" +
+ " super();\n" +
+ " }\n" +
+ "}\n" +
+ "class E extends String {\n" +
+ " E() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0002", expectedUnitToString);
}
@@ -314,11 +314,11 @@ public void test0003() throws IOException {
" @Marker Serializable," +
" Cloneable {\n" +
"}\n";
- String expectedUnitToString =
- "@Marker class A implements Comparable, @Marker Serializable, Cloneable {\n" +
- " A() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "@Marker class A implements Comparable, @Marker Serializable, Cloneable {\n" +
+ " A() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0003", expectedUnitToString);
}
@@ -327,11 +327,11 @@ public void test0004() throws IOException {
" @Marker @SingleMember(0) Serializable," +
" Cloneable {\n" +
"}\n";
- String expectedUnitToString =
- "@Marker class A implements Comparable, @Marker @SingleMember(0) Serializable, Cloneable {\n" +
- " A() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "@Marker class A implements Comparable, @Marker @SingleMember(0) Serializable, Cloneable {\n" +
+ " A() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0004", expectedUnitToString);
}
@@ -340,11 +340,11 @@ public void test0005() throws IOException {
" @Marker @SingleMember(0) @Normal(Value=0) Serializable," +
" Cloneable {\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"@Marker class A implements Comparable, @Marker @SingleMember(0) @Normal(Value = 0) Serializable, Cloneable {\n" +
- " A() {\n" +
- " super();\n" +
- " }\n" +
+ " A() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0005", expectedUnitToString);
}
@@ -353,11 +353,11 @@ public void test0006() throws IOException {
" @Marker @SingleMember(0) @Normal(Value=0) Serializable," +
" @Marker Cloneable {\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"@Marker class A implements @Marker Comparable, @Marker @SingleMember(0) @Normal(Value = 0) Serializable, @Marker Cloneable {\n" +
- " A() {\n" +
- " super();\n" +
- " }\n" +
+ " A() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0006", expectedUnitToString);
}
@@ -366,11 +366,11 @@ public void test007() throws IOException {
" @Marker @SingleMember(10) @Normal(Value=0) Serializable," +
" Cloneable {\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"@Marker class A extends Object implements Comparable, @Marker @SingleMember(10) @Normal(Value = 0) Serializable, Cloneable {\n" +
- " A() {\n" +
- " super();\n" +
- " }\n" +
+ " A() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0007", expectedUnitToString);
}
@@ -379,11 +379,11 @@ public void test0008() throws IOException {
" @Marker @SingleMember(0) @Normal(Value=0) Serializable," +
" Cloneable {\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"@Marker class A extends @Marker Object implements Comparable, @Marker @SingleMember(0) @Normal(Value = 0) Serializable, Cloneable {\n" +
- " A() {\n" +
- " super();\n" +
- " }\n" +
+ " A() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0008", expectedUnitToString);
}
@@ -392,11 +392,11 @@ public void test0009() throws IOException {
" @Marker @SingleMember(0) @Normal(Value=0) Serializable," +
" Cloneable {\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"@Marker class A extends @Marker @SingleMember(0) Object implements Comparable, @Marker @SingleMember(0) @Normal(Value = 0) Serializable, Cloneable {\n" +
- " A() {\n" +
- " super();\n" +
- " }\n" +
+ " A() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0009", expectedUnitToString);
}
@@ -405,11 +405,11 @@ public void test0010() throws IOException {
" @Marker @SingleMember(0) @Normal(Value=0) Serializable," +
" Cloneable {\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"@Marker class A extends @Marker @SingleMember(0) @Normal(Value = 0) Object implements Comparable, @Marker @SingleMember(0) @Normal(Value = 0) Serializable, Cloneable {\n" +
- " A() {\n" +
- " super();\n" +
- " }\n" +
+ " A() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0010", expectedUnitToString);
}
@@ -419,14 +419,14 @@ public void test0011() throws IOException {
" @Marker String[] @Marker[][] s[] @SingleMember(0)[][] @Normal(Value = 0)[][];\n" +
" float[] p[];\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " int[][] f;\n" +
- " @Marker String[] @Marker [][][] @SingleMember(0) [][] @Normal(Value = 0) [][] s;\n" +
- " float[][] p;\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " int[][] f;\n" +
+ " @Marker String[] @Marker [][][] @SingleMember(0) [][] @Normal(Value = 0) [][] s;\n" +
+ " float[][] p;\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0011", expectedUnitToString);
}
@@ -440,18 +440,18 @@ public void test0012() throws IOException {
" s = new @Readonly String @NonNull[5] @Nullable[];\n" +
"}\n" +
"}\n";
- String expectedUnitToString =
- "public class A implements @Readonly Comparable, @NonNull Serializable, Cloneable {\n" +
- " int[][] f;\n" +
- " @English String[] @NonNull [][] @Nullable [][] s;\n" +
- " float[][] p;\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " @Readonly String @Nullable [] @NonNull [] s;\n" +
- " s = new @Readonly String @NonNull [5] @Nullable [];\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A implements @Readonly Comparable, @NonNull Serializable, Cloneable {\n" +
+ " int[][] f;\n" +
+ " @English String[] @NonNull [][] @Nullable [][] s;\n" +
+ " float[][] p;\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " @Readonly String @Nullable [] @NonNull [] s;\n" +
+ " s = new @Readonly String @NonNull [5] @Nullable [];\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0012", expectedUnitToString);
}
@@ -465,18 +465,18 @@ public void test0013() throws IOException {
" s = new @Readonly String @NonNull[] @Nullable[] { {\"Hello\"}, {\"World\"}} [0][0];\n" +
"}\n" +
"}\n";
- String expectedUnitToString =
- "public class A implements @Readonly Comparable, @NonNull Serializable, Cloneable {\n" +
- " int[][] f;\n" +
- " @English String[] @NonNull [][] @Nullable [][] s;\n" +
- " float[][] p;\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " @Readonly String s;\n" +
- " s = new @Readonly String @NonNull [] @Nullable []{{\"Hello\"}, {\"World\"}}[0][0];\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A implements @Readonly Comparable, @NonNull Serializable, Cloneable {\n" +
+ " int[][] f;\n" +
+ " @English String[] @NonNull [][] @Nullable [][] s;\n" +
+ " float[][] p;\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " @Readonly String s;\n" +
+ " s = new @Readonly String @NonNull [] @Nullable []{{\"Hello\"}, {\"World\"}}[0][0];\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0013", expectedUnitToString);
}
@@ -490,18 +490,18 @@ public void test0014() throws IOException {
" s = new @Readonly String @NonNull[5] @Nullable[];\n" +
"}\n" +
"}\n";
- String expectedUnitToString =
- "public class A implements @Readonly Comparable, @NonNull Serializable, Cloneable {\n" +
- " int[][] f;\n" +
- " @English String[] @NonNull [][] @Nullable [][] s;\n" +
- " float[][] p;\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A implements @Readonly Comparable, @NonNull Serializable, Cloneable {\n" +
+ " int[][] f;\n" +
+ " @English String[] @NonNull [][] @Nullable [][] s;\n" +
+ " float[][] p;\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
" public static int[] @Marker [][] @Marker @SingleMember(0) @Normal(Value = 0) [][] main(String[] args) {\n" +
- " @Readonly String @Nullable [] @NonNull [] s;\n" +
- " s = new @Readonly String @NonNull [5] @Nullable [];\n" +
- " }\n" +
+ " @Readonly String @Nullable [] @NonNull [] s;\n" +
+ " s = new @Readonly String @NonNull [5] @Nullable [];\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0014", expectedUnitToString);
@@ -517,18 +517,18 @@ public void test0015() throws IOException {
"}\n" +
"@Marker public A () {}\n" +
"}\n";
- String expectedUnitToString =
- "public class A implements @Readonly Comparable, @NonNull Serializable, Cloneable {\n" +
- " int[][] f;\n" +
- " @English String[] @NonNull [][] @Nullable [][] s;\n" +
- " float[][] p;\n" +
- " public static int[] @Marker [][] @Marker @SingleMember(0) @Normal(Value = 0) [][] main(String[] args) {\n" +
- " @Readonly String @Nullable [] @NonNull [] s;\n" +
- " s = new @Readonly String @NonNull [5] @Nullable [];\n" +
- " }\n" +
- " public @Marker A() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A implements @Readonly Comparable, @NonNull Serializable, Cloneable {\n" +
+ " int[][] f;\n" +
+ " @English String[] @NonNull [][] @Nullable [][] s;\n" +
+ " float[][] p;\n" +
+ " public static int[] @Marker [][] @Marker @SingleMember(0) @Normal(Value = 0) [][] main(String[] args) {\n" +
+ " @Readonly String @Nullable [] @NonNull [] s;\n" +
+ " s = new @Readonly String @NonNull [5] @Nullable [];\n" +
+ " }\n" +
+ " public @Marker A() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0015", expectedUnitToString);
}
@@ -538,13 +538,13 @@ public void test0016() throws IOException {
"@Marker public int[] @Marker[][] main(int[] @SingleMember(10)[][] args[] @Normal(Value = 10)[][])[] @Marker[][] {\n" +
"}\n" +
"}";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public @Marker int[] @Marker [][][] @Marker [][] main(int[] @SingleMember(10) [][][] @Normal(Value = 10) [][] args) {\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public @Marker int[] @Marker [][][] @Marker [][] main(int[] @SingleMember(10) [][][] @Normal(Value = 10) [][] args) {\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0016", expectedUnitToString);
}
@@ -553,13 +553,13 @@ public void test0017() throws IOException {
"@Marker public int[] @Marker[][] main(String[] @SingleMember(10)[][] args[] @Normal(Value = 10)[][])[] @Marker[][] {\n" +
"}\n" +
"}";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public @Marker int[] @Marker [][][] @Marker [][] main(String[] @SingleMember(10) [][][] @Normal(Value = 10) [][] args) {\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public @Marker int[] @Marker [][][] @Marker [][] main(String[] @SingleMember(10) [][][] @Normal(Value = 10) [][] args) {\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0017", expectedUnitToString);
}
@@ -568,13 +568,13 @@ public void test0018() throws IOException {
"@Marker public int[] @Marker[][] main(HashMap<String, Object>[] @SingleMember(10)[][] args[] @Normal(Value = 10)[][])[] @Marker[][] {\n" +
"}\n" +
"}";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public @Marker int[] @Marker [][][] @Marker [][] main(HashMap<String, Object>[] @Normal(Value = 10) [][][] @SingleMember(10) [][] args) {\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public @Marker int[] @Marker [][][] @Marker [][] main(HashMap<String, Object>[] @Normal(Value = 10) [][][] @SingleMember(10) [][] args) {\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0018", expectedUnitToString);
}
@@ -583,13 +583,13 @@ public void test0019() throws IOException {
"@Marker public int[] @Marker [][] main(HashMap<String, Object>.Iterator[] @SingleMember(10) [][] args[] @Normal(Value = 10) [][])[] @Marker [][] {\n" +
"}\n" +
"}";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public @Marker int[] @Marker [][][] @Marker [][] main(HashMap<String, Object>.Iterator[] @Normal(Value = 10) [][][] @SingleMember(10) [][] args) {\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public @Marker int[] @Marker [][][] @Marker [][] main(HashMap<String, Object>.Iterator[] @Normal(Value = 10) [][][] @SingleMember(10) [][] args) {\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0019", expectedUnitToString);
}
@@ -599,13 +599,13 @@ public void test0020() throws IOException {
"@Marker public int[] @Marker[][] main(int[] @SingleMember(10)[][] @Marker ... args )[] @Marker[][] {\n" +
"}\n" +
"}";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public @Marker int[] @Marker [][][] @Marker [][] main(int[] @SingleMember(10) [][] @Marker ... args) {\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public @Marker int[] @Marker [][][] @Marker [][] main(int[] @SingleMember(10) [][] @Marker ... args) {\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0020", expectedUnitToString);
}
@@ -614,13 +614,13 @@ public void test0021() throws IOException {
"@Marker public int[] @Marker[][] main(String[] @SingleMember(10)[][] @Marker ... args )[] @Marker[][] {\n" +
"}\n" +
"}";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public @Marker int[] @Marker [][][] @Marker [][] main(String[] @SingleMember(10) [][] @Marker ... args) {\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public @Marker int[] @Marker [][][] @Marker [][] main(String[] @SingleMember(10) [][] @Marker ... args) {\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0021", expectedUnitToString);
}
@@ -629,13 +629,13 @@ public void test0022() throws IOException {
"@Marker public int[] @Marker[][] main(HashMap<Integer,String>[] @SingleMember(10)[][] @Marker ... args )[] @Marker[][] {\n" +
"}\n" +
"}";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public @Marker int[] @Marker [][][] @Marker [][] main(HashMap<Integer, String>[] @SingleMember(10) [][] @Marker ... args) {\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public @Marker int[] @Marker [][][] @Marker [][] main(HashMap<Integer, String>[] @SingleMember(10) [][] @Marker ... args) {\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0022", expectedUnitToString);
}
@@ -644,13 +644,13 @@ public void test0023() throws IOException {
"@Marker public int[] @Marker[][] main(HashMap<Integer,String>.Iterator[] @SingleMember(10)[][] @Marker ... args )[] @Marker[][] {\n" +
"}\n" +
"}";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public @Marker int[] @Marker [][][] @Marker [][] main(HashMap<Integer, String>.Iterator[] @SingleMember(10) [][] @Marker ... args) {\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public @Marker int[] @Marker [][][] @Marker [][] main(HashMap<Integer, String>.Iterator[] @SingleMember(10) [][] @Marker ... args) {\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0023", expectedUnitToString);
}
@@ -663,16 +663,16 @@ public void test0024() throws IOException {
" float[] p[];\n" +
"}\n" +
"}\n";
- String expectedUnitToString =
- "public class A implements @Readonly Comparable, @NonNull Serializable, Cloneable {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " int[][] f;\n" +
- " @English String[] @NonNull [][] @Nullable [][] s;\n" +
- " float[][] p;\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A implements @Readonly Comparable, @NonNull Serializable, Cloneable {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " int[][] f;\n" +
+ " @English String[] @NonNull [][] @Nullable [][] s;\n" +
+ " float[][] p;\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0024", expectedUnitToString);
}
@@ -682,13 +682,13 @@ public void test0025() throws IOException {
"public <Integer, @Positive Integer, @Negative Integer, Integer> void foo() {\n" +
"}\n" +
"}\n";
- String expectedUnitToString =
- "class A {\n" +
- " A() {\n" +
- " super();\n" +
+ String expectedUnitToString =
+ "class A {\n" +
+ " A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public <Integer, @Positive Integer, @Negative Integer, Integer>void foo() {\n" +
" }\n" +
- " public <Integer, @Positive Integer, @Negative Integer, Integer>void foo() {\n" +
- " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0025", expectedUnitToString);
}
@@ -803,14 +803,14 @@ public void test0034() throws IOException {
" @Marker int k;\n" +
" float[] p[];\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " int[][] f;\n" +
- " @Marker int k;\n" +
- " float[][] p;\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " int[][] f;\n" +
+ " @Marker int k;\n" +
+ " float[][] p;\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0034", expectedUnitToString);
}
@@ -821,14 +821,14 @@ public void test0035() throws IOException {
" @Marker String k;\n" +
" float[] p[];\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " int[][] f;\n" +
- " @Marker String k;\n" +
- " float[][] p;\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " int[][] f;\n" +
+ " @Marker String k;\n" +
+ " float[][] p;\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0035", expectedUnitToString);
}
@@ -839,14 +839,14 @@ public void test0036() throws IOException {
" @Marker HashMap<@Positive Integer, @Negative Integer> k;\n" +
" float[] p[];\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " int[][] f;\n" +
- " @Marker HashMap<@Positive Integer, @Negative Integer> k;\n" +
- " float[][] p;\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " int[][] f;\n" +
+ " @Marker HashMap<@Positive Integer, @Negative Integer> k;\n" +
+ " float[][] p;\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0036", expectedUnitToString);
}
@@ -857,14 +857,14 @@ public void test0037() throws IOException {
" @Marker HashMap<@Positive Integer, @Negative Integer>.Iterator k;\n" +
" float[] p[];\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " int[][] f;\n" +
- " @Marker HashMap<@Positive Integer, @Negative Integer>.Iterator k;\n" +
- " float[][] p;\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " int[][] f;\n" +
+ " @Marker HashMap<@Positive Integer, @Negative Integer>.Iterator k;\n" +
+ " float[][] p;\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0037", expectedUnitToString);
}
@@ -875,14 +875,14 @@ public void test0038() throws IOException {
" @Marker int[] @NonEmpty[][] k;\n" +
" float[] p[];\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " int[][] f;\n" +
- " @Marker int[] @NonEmpty [][] k;\n" +
- " float[][] p;\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " int[][] f;\n" +
+ " @Marker int[] @NonEmpty [][] k;\n" +
+ " float[][] p;\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0038", expectedUnitToString);
}
@@ -893,14 +893,14 @@ public void test0039() throws IOException {
" @Marker String[] @NonEmpty[][]k;\n" +
" float[] p[];\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " int[][] f;\n" +
- " @Marker String[] @NonEmpty [][] k;\n" +
- " float[][] p;\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " int[][] f;\n" +
+ " @Marker String[] @NonEmpty [][] k;\n" +
+ " float[][] p;\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0039", expectedUnitToString);
}
@@ -911,14 +911,14 @@ public void test0040() throws IOException {
" @Marker HashMap<@Positive Integer, @Negative Integer>[] @NonEmpty[][] k;\n" +
" float[] p[];\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " int[][] f;\n" +
- " @Marker HashMap<@Positive Integer, @Negative Integer>[] @NonEmpty [][] k;\n" +
- " float[][] p;\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " int[][] f;\n" +
+ " @Marker HashMap<@Positive Integer, @Negative Integer>[] @NonEmpty [][] k;\n" +
+ " float[][] p;\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0040", expectedUnitToString);
}
@@ -929,14 +929,14 @@ public void test0041() throws IOException {
" @Marker HashMap<@Positive Integer, @Negative Integer>.Iterator[] @NonEmpty[][] k;\n" +
" float[] p[];\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " int[][] f;\n" +
- " @Marker HashMap<@Positive Integer, @Negative Integer>.Iterator[] @NonEmpty [][] k;\n" +
- " float[][] p;\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " int[][] f;\n" +
+ " @Marker HashMap<@Positive Integer, @Negative Integer>.Iterator[] @NonEmpty [][] k;\n" +
+ " float[][] p;\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0041", expectedUnitToString);
}
@@ -946,17 +946,17 @@ public void test0042() throws IOException {
" public @Marker int foo() { return 0; }\n" +
" public int bar() { return 0; }\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public @Marker int foo() {\n" +
- " return 0;\n" +
- " }\n" +
- " public int bar() {\n" +
- " return 0;\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public @Marker int foo() {\n" +
+ " return 0;\n" +
+ " }\n" +
+ " public int bar() {\n" +
+ " return 0;\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0042", expectedUnitToString);
}
@@ -966,17 +966,17 @@ public void test0043() throws IOException {
" public @Marker String foo() { return null; }\n" +
" public String bar() { return null; }\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public @Marker String foo() {\n" +
- " return null;\n" +
- " }\n" +
- " public String bar() {\n" +
- " return null;\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public @Marker String foo() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public String bar() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0043", expectedUnitToString);
}
@@ -986,17 +986,17 @@ public void test0044() throws IOException {
" public @Marker HashMap<@Positive Integer, @Negative Integer> foo() { return null; }\n" +
" public HashMap<@Positive Integer, @Negative Integer> bar() { return null; }\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public @Marker HashMap<@Positive Integer, @Negative Integer> foo() {\n" +
- " return null;\n" +
- " }\n" +
- " public HashMap<@Positive Integer, @Negative Integer> bar() {\n" +
- " return null;\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public @Marker HashMap<@Positive Integer, @Negative Integer> foo() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public HashMap<@Positive Integer, @Negative Integer> bar() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0044", expectedUnitToString);
}
@@ -1006,17 +1006,17 @@ public void test0045() throws IOException {
" public @Marker HashMap<@Positive Integer, @Negative Integer>.Iterator foo() { return null; }\n" +
" public HashMap<@Positive Integer, @Negative Integer>.Iterator bar() { return null; }\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public @Marker HashMap<@Positive Integer, @Negative Integer>.Iterator foo() {\n" +
- " return null;\n" +
- " }\n" +
- " public HashMap<@Positive Integer, @Negative Integer>.Iterator bar() {\n" +
- " return null;\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public @Marker HashMap<@Positive Integer, @Negative Integer>.Iterator foo() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public HashMap<@Positive Integer, @Negative Integer>.Iterator bar() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0045", expectedUnitToString);
}
@@ -1026,17 +1026,17 @@ public void test0046() throws IOException {
" public @Marker int[] foo() @NonEmpty[][] { return 0; }\n" +
" public int[] @NonEmpty[][] bar() { return 0; }\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public @Marker int[] @NonEmpty [][] foo() {\n" +
- " return 0;\n" +
- " }\n" +
- " public int[] @NonEmpty [][] bar() {\n" +
- " return 0;\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public @Marker int[] @NonEmpty [][] foo() {\n" +
+ " return 0;\n" +
+ " }\n" +
+ " public int[] @NonEmpty [][] bar() {\n" +
+ " return 0;\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0046", expectedUnitToString);
}
@@ -1046,17 +1046,17 @@ public void test0047() throws IOException {
" public @Marker String[] foo() @NonEmpty[][] { return null; }\n" +
" public String[] @NonEmpty[][] bar() { return null; }\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public @Marker String[] @NonEmpty [][] foo() {\n" +
- " return null;\n" +
- " }\n" +
- " public String[] @NonEmpty [][] bar() {\n" +
- " return null;\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public @Marker String[] @NonEmpty [][] foo() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public String[] @NonEmpty [][] bar() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0047", expectedUnitToString);
}
@@ -1066,17 +1066,17 @@ public void test0048() throws IOException {
" public @Marker HashMap<@Positive Integer, @Negative Integer>[] foo() @NonEmpty[][] { return null; }\n" +
" public HashMap<@Positive Integer, @Negative Integer> [] @NonEmpty[][] bar() { return null; }\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public @Marker HashMap<@Positive Integer, @Negative Integer> @NonEmpty [][][] foo() {\n" +
- " return null;\n" +
- " }\n" +
- " public HashMap<@Positive Integer, @Negative Integer>[] @NonEmpty [][] bar() {\n" +
- " return null;\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public @Marker HashMap<@Positive Integer, @Negative Integer> @NonEmpty [][][] foo() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public HashMap<@Positive Integer, @Negative Integer>[] @NonEmpty [][] bar() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0048", expectedUnitToString);
}
@@ -1086,17 +1086,17 @@ public void test0049() throws IOException {
" public @Marker HashMap<@Positive Integer, @Negative Integer>.Iterator[] foo() @NonEmpty[][] { return null; }\n" +
" public HashMap<@Positive Integer, @Negative Integer>.Iterator[] @NonEmpty[][] bar() { return null; }\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public @Marker HashMap<@Positive Integer, @Negative Integer>.Iterator @NonEmpty [][][] foo() {\n" +
- " return null;\n" +
- " }\n" +
- " public HashMap<@Positive Integer, @Negative Integer>.Iterator[] @NonEmpty [][] bar() {\n" +
- " return null;\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public @Marker HashMap<@Positive Integer, @Negative Integer>.Iterator @NonEmpty [][][] foo() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public HashMap<@Positive Integer, @Negative Integer>.Iterator[] @NonEmpty [][] bar() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0049", expectedUnitToString);
}
@@ -1105,18 +1105,18 @@ public void test0050() throws IOException {
String source = "public class A {\n" +
" public void foo() {\n" +
" @Marker int p;\n" +
- " int q;\n" +
+ " int q;\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo() {\n" +
- " @Marker int p;\n" +
- " int q;\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " @Marker int p;\n" +
+ " int q;\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0050", expectedUnitToString);
}
@@ -1125,18 +1125,18 @@ public void test0051() throws IOException {
String source = "public class A {\n" +
" public void foo() {\n" +
" @Marker String p;\n" +
- " String q;\n" +
+ " String q;\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo() {\n" +
- " @Marker String p;\n" +
- " String q;\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " @Marker String p;\n" +
+ " String q;\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0051", expectedUnitToString);
}
@@ -1145,18 +1145,18 @@ public void test0052() throws IOException {
String source = "public class A {\n" +
" public void foo() {\n" +
" @Marker HashMap<@Positive Integer, @Negative Integer> p;\n" +
- " HashMap<@Positive Integer, @Negative Integer> q;\n" +
+ " HashMap<@Positive Integer, @Negative Integer> q;\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo() {\n" +
- " @Marker HashMap<@Positive Integer, @Negative Integer> p;\n" +
- " HashMap<@Positive Integer, @Negative Integer> q;\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " @Marker HashMap<@Positive Integer, @Negative Integer> p;\n" +
+ " HashMap<@Positive Integer, @Negative Integer> q;\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0052", expectedUnitToString);
}
@@ -1165,18 +1165,18 @@ public void test0053() throws IOException {
String source = "public class A {\n" +
" public void foo() {\n" +
" @Marker HashMap<@Positive Integer, @Negative Integer>.Iterator p;\n" +
- " HashMap<@Positive Integer, @Negative Integer>.Iterator q;\n" +
+ " HashMap<@Positive Integer, @Negative Integer>.Iterator q;\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo() {\n" +
- " @Marker HashMap<@Positive Integer, @Negative Integer>.Iterator p;\n" +
- " HashMap<@Positive Integer, @Negative Integer>.Iterator q;\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " @Marker HashMap<@Positive Integer, @Negative Integer>.Iterator p;\n" +
+ " HashMap<@Positive Integer, @Negative Integer>.Iterator q;\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0053", expectedUnitToString);
}
@@ -1185,18 +1185,18 @@ public void test0054() throws IOException {
String source = "public class A {\n" +
" public void foo() {\n" +
" @Marker int[] @NonNull[] p @NonEmpty[][];\n" +
- " int[] @NonNull[] q @NonEmpty[][];\n" +
+ " int[] @NonNull[] q @NonEmpty[][];\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo() {\n" +
- " @Marker int[] @NonNull [] @NonEmpty [][] p;\n" +
- " int[] @NonNull [] @NonEmpty [][] q;\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " @Marker int[] @NonNull [] @NonEmpty [][] p;\n" +
+ " int[] @NonNull [] @NonEmpty [][] q;\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0054", expectedUnitToString);
}
@@ -1205,18 +1205,18 @@ public void test0055() throws IOException {
String source = "public class A {\n" +
" public void foo() {\n" +
" @Marker String[] @NonNull[] p @NonEmpty[][];\n" +
- " String[] @NonNull[] q @NonEmpty[][];\n" +
+ " String[] @NonNull[] q @NonEmpty[][];\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo() {\n" +
- " @Marker String[] @NonNull [] @NonEmpty [][] p;\n" +
- " String[] @NonNull [] @NonEmpty [][] q;\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " @Marker String[] @NonNull [] @NonEmpty [][] p;\n" +
+ " String[] @NonNull [] @NonEmpty [][] q;\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0055", expectedUnitToString);
}
@@ -1225,18 +1225,18 @@ public void test0056() throws IOException {
String source = "public class A {\n" +
" public void foo() {\n" +
" @Marker HashMap<@Positive Integer, @Negative Integer>[] @NonNull[] p @NonEmpty[][];\n" +
- " HashMap<@Positive Integer, @Negative Integer>[] @NonNull[] q @NonEmpty[][];\n" +
+ " HashMap<@Positive Integer, @Negative Integer>[] @NonNull[] q @NonEmpty[][];\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo() {\n" +
- " @Marker HashMap<@Positive Integer, @Negative Integer> @NonEmpty [][][] @NonNull [] p;\n" +
- " HashMap<@Positive Integer, @Negative Integer> @NonEmpty [][][] @NonNull [] q;\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " @Marker HashMap<@Positive Integer, @Negative Integer> @NonEmpty [][][] @NonNull [] p;\n" +
+ " HashMap<@Positive Integer, @Negative Integer> @NonEmpty [][][] @NonNull [] q;\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0056", expectedUnitToString);
}
@@ -1245,18 +1245,18 @@ public void test0057() throws IOException {
String source = "public class A {\n" +
" public void foo() {\n" +
" @Marker HashMap<@Positive Integer, @Negative Integer>.Iterator[] @NonNull[] p @NonEmpty[][];\n" +
- " HashMap<@Positive Integer, @Negative Integer>.Iterator[] @NonNull[] @NonEmpty[][] q;\n" +
+ " HashMap<@Positive Integer, @Negative Integer>.Iterator[] @NonNull[] @NonEmpty[][] q;\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo() {\n" +
- " @Marker HashMap<@Positive Integer, @Negative Integer>.Iterator @NonEmpty [][][] @NonNull [] p;\n" +
- " HashMap<@Positive Integer, @Negative Integer>.Iterator[] @NonNull [] @NonEmpty [][] q;\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " @Marker HashMap<@Positive Integer, @Negative Integer>.Iterator @NonEmpty [][][] @NonNull [] p;\n" +
+ " HashMap<@Positive Integer, @Negative Integer>.Iterator[] @NonNull [] @NonEmpty [][] q;\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0057", expectedUnitToString);
}
@@ -1269,20 +1269,20 @@ public void test0058() throws IOException {
" for (String @NonNull[] sii @Marker[] : s) {}\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo() {\n" +
- " String @NonNull [] @Marker [] @Readonly [] s;\n" +
- " for (@Readonly String @NonNull [] @Marker [] si : s) \n" +
- " {\n" +
- " }\n" +
- " for (String @NonNull [] @Marker [] sii : s) \n" +
- " {\n" +
- " }\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " String @NonNull [] @Marker [] @Readonly [] s;\n" +
+ " for (@Readonly String @NonNull [] @Marker [] si : s) \n" +
+ " {\n" +
+ " }\n" +
+ " for (String @NonNull [] @Marker [] sii : s) \n" +
+ " {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0058", expectedUnitToString);
}
@@ -1295,20 +1295,20 @@ public void test0059() throws IOException {
" for (int @NonNull[] sii @Marker[] : s) {}\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo() {\n" +
- " int @NonNull [] @Marker [] @Readonly [] s;\n" +
- " for (@Readonly int @NonNull [] @Marker [] si : s) \n" +
- " {\n" +
- " }\n" +
- " for (int @NonNull [] @Marker [] sii : s) \n" +
- " {\n" +
- " }\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class A {\n" +
+ " public A() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " int @NonNull [] @Marker [] @Readonly [] s;\n" +
+ " for (@Readonly int @NonNull [] @Marker [] si : s) \n" +
+ " {\n" +
+ " }\n" +
+ " for (int @NonNull [] @Marker [] sii : s) \n" +
+ " {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0059", expectedUnitToString);
}
@@ -1344,15 +1344,15 @@ public void test0060() throws IOException {
"(@Readonly int) 10;\n" +
"}\n" +
"}\n";
- String expectedUnitToString =
- "public class Clazz {\n" +
- " public Clazz() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " int x;\n" +
- " x = (Integer) (@Readonly Object) (@Readonly HashMap<@Positive Integer, @Negative Integer>.Iterator[] @Normal(Value = 0) [][]) (@Readonly HashMap<@Positive Integer, @Negative Integer>.Iterator[] @SingleMember(0) [][]) (@Readonly HashMap<@Positive Integer, @Negative Integer>.Iterator[] @Marker [][]) (@Readonly Object) (@Readonly HashMap<@Positive Integer, @Negative Integer>[] @Normal(Value = 0) [][]) (@Readonly HashMap<@Positive Integer, @Negative Integer>[] @SingleMember(0) [][]) (@Readonly HashMap<@Positive Integer, @Negative Integer>[] @Marker [][]) (@Readonly Object) (@Readonly String[] @Normal(Value = 0) [][]) (@Readonly String[] @SingleMember(0) [][]) (@Readonly String[] @Marker [][]) (@Readonly Object) (@Readonly int[] @Normal(Value = 0) [][]) (@Readonly int[] @SingleMember(0) [][]) (@Readonly int[] @Marker [][]) (@Readonly Object) (@Readonly HashMap<@Positive Integer, @Negative Integer>.Iterator) (@Readonly Object) (@Readonly HashMap<@Positive Integer, @Negative Integer>) (@Readonly Object) (@ReadOnly String) (@Readonly Object) (@Readonly int) 10;\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class Clazz {\n" +
+ " public Clazz() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " int x;\n" +
+ " x = (Integer) (@Readonly Object) (@Readonly HashMap<@Positive Integer, @Negative Integer>.Iterator[] @Normal(Value = 0) [][]) (@Readonly HashMap<@Positive Integer, @Negative Integer>.Iterator[] @SingleMember(0) [][]) (@Readonly HashMap<@Positive Integer, @Negative Integer>.Iterator[] @Marker [][]) (@Readonly Object) (@Readonly HashMap<@Positive Integer, @Negative Integer>[] @Normal(Value = 0) [][]) (@Readonly HashMap<@Positive Integer, @Negative Integer>[] @SingleMember(0) [][]) (@Readonly HashMap<@Positive Integer, @Negative Integer>[] @Marker [][]) (@Readonly Object) (@Readonly String[] @Normal(Value = 0) [][]) (@Readonly String[] @SingleMember(0) [][]) (@Readonly String[] @Marker [][]) (@Readonly Object) (@Readonly int[] @Normal(Value = 0) [][]) (@Readonly int[] @SingleMember(0) [][]) (@Readonly int[] @Marker [][]) (@Readonly Object) (@Readonly HashMap<@Positive Integer, @Negative Integer>.Iterator) (@Readonly Object) (@Readonly HashMap<@Positive Integer, @Negative Integer>) (@Readonly Object) (@ReadOnly String) (@Readonly Object) (@Readonly int) 10;\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0060", expectedUnitToString);
}
@@ -1388,19 +1388,19 @@ public void test0061() throws IOException {
"(@Readonly int) 10;\n" +
"}\n" +
"}\n";
- String expectedUnitToString =
- "public class Clazz {\n" +
- " public Clazz() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " int x;\n" +
- " x = (Integer) (Object) (@Readonly HashMap<Integer, @Negative Integer>.Iterator[] @Normal(Value = 0) [][]) (HashMap<@Positive Integer, Integer>.Iterator[] @SingleMember(0) [][]) (@Readonly HashMap<Integer, @Negative Integer>.Iterator[] @Marker [][]) (Object) (@Readonly HashMap<@Positive Integer, Integer>[] @Normal(Value = 0) [][]) (HashMap<Integer, @Negative Integer>[] @SingleMember(0) [][]) (@Readonly HashMap<@Positive Integer, Integer>[] @Marker [][]) (Object) (@Readonly String[] @Normal(Value = 0) [][]) (String[] @SingleMember(0) [][]) (@Readonly String[] @Marker [][]) (Object) (@Readonly int[] @Normal(Value = 0) [][]) (int[] @SingleMember(0) [][]) (@Readonly int[] @Marker [][]) (Object) (@Readonly HashMap<Integer, @Negative Integer>.Iterator) (Object) (@Readonly HashMap<@Positive Integer, Integer>) (Object) (@ReadOnly String) (Object) (@Readonly int) 10;\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class Clazz {\n" +
+ " public Clazz() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " int x;\n" +
+ " x = (Integer) (Object) (@Readonly HashMap<Integer, @Negative Integer>.Iterator[] @Normal(Value = 0) [][]) (HashMap<@Positive Integer, Integer>.Iterator[] @SingleMember(0) [][]) (@Readonly HashMap<Integer, @Negative Integer>.Iterator[] @Marker [][]) (Object) (@Readonly HashMap<@Positive Integer, Integer>[] @Normal(Value = 0) [][]) (HashMap<Integer, @Negative Integer>[] @SingleMember(0) [][]) (@Readonly HashMap<@Positive Integer, Integer>[] @Marker [][]) (Object) (@Readonly String[] @Normal(Value = 0) [][]) (String[] @SingleMember(0) [][]) (@Readonly String[] @Marker [][]) (Object) (@Readonly int[] @Normal(Value = 0) [][]) (int[] @SingleMember(0) [][]) (@Readonly int[] @Marker [][]) (Object) (@Readonly HashMap<Integer, @Negative Integer>.Iterator) (Object) (@Readonly HashMap<@Positive Integer, Integer>) (Object) (@ReadOnly String) (Object) (@Readonly int) 10;\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0061", expectedUnitToString);
}
-// instanceof checks
+// instanceof checks
public void test0062() throws IOException {
String source = "public class Clazz {\n" +
"public static void main(Object o) {\n" +
@@ -1408,58 +1408,58 @@ public void test0062() throws IOException {
"} else if (o instanceof @Readonly int[] @NonEmpty[][] ) {\n" +
"} else if (o instanceof @Readonly String[] @NonEmpty[][] ) {\n" +
"} else if (o instanceof @Readonly HashMap<?,?>[] @NonEmpty[][] ) {\n" +
- "} else if (o instanceof @Readonly HashMap<@Positive Integer, @Negative Integer>.Iterator[] @NonEmpty[][] ) {\n" +
+ "} else if (o instanceof @Readonly HashMap<@Positive Integer, @Negative Integer>.Iterator[] @NonEmpty[][] ) {\n" +
"} else if (o instanceof @Readonly HashMap<?,?>) {\n" +
"} else if (o instanceof @Readonly HashMap<@Positive Integer, @Negative Integer>.Iterator) {\n" +
"}\n" +
"}\n" +
"}";
- String expectedUnitToString =
- "public class Clazz {\n" +
- " public Clazz() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(Object o) {\n" +
- " if ((o instanceof @Readonly String))\n" +
- " {\n" +
- " }\n" +
- " else\n" +
- " if ((o instanceof @Readonly int[] @NonEmpty [][]))\n" +
- " {\n" +
- " }\n" +
- " else\n" +
- " if ((o instanceof @Readonly String[] @NonEmpty [][]))\n" +
- " {\n" +
- " }\n" +
- " else\n" +
- " if ((o instanceof @Readonly HashMap<?, ?>[] @NonEmpty [][]))\n" +
- " {\n" +
- " }\n" +
- " else\n" +
- " if ((o instanceof @Readonly HashMap<@Positive Integer, @Negative Integer>.Iterator[] @NonEmpty [][]))\n" +
- " {\n" +
- " }\n" +
- " else\n" +
- " if ((o instanceof @Readonly HashMap<?, ?>))\n" +
- " {\n" +
- " }\n" +
- " else\n" +
- " if ((o instanceof @Readonly HashMap<@Positive Integer, @Negative Integer>.Iterator))\n" +
- " {\n" +
- " }\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class Clazz {\n" +
+ " public Clazz() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(Object o) {\n" +
+ " if ((o instanceof @Readonly String))\n" +
+ " {\n" +
+ " }\n" +
+ " else\n" +
+ " if ((o instanceof @Readonly int[] @NonEmpty [][]))\n" +
+ " {\n" +
+ " }\n" +
+ " else\n" +
+ " if ((o instanceof @Readonly String[] @NonEmpty [][]))\n" +
+ " {\n" +
+ " }\n" +
+ " else\n" +
+ " if ((o instanceof @Readonly HashMap<?, ?>[] @NonEmpty [][]))\n" +
+ " {\n" +
+ " }\n" +
+ " else\n" +
+ " if ((o instanceof @Readonly HashMap<@Positive Integer, @Negative Integer>.Iterator[] @NonEmpty [][]))\n" +
+ " {\n" +
+ " }\n" +
+ " else\n" +
+ " if ((o instanceof @Readonly HashMap<?, ?>))\n" +
+ " {\n" +
+ " }\n" +
+ " else\n" +
+ " if ((o instanceof @Readonly HashMap<@Positive Integer, @Negative Integer>.Iterator))\n" +
+ " {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0062", expectedUnitToString);
}
-// assorted unclassified
+// assorted unclassified
public void test0063() throws IOException {
String source = "import java.util.HashMap;\n" +
- "import java.util.Map; \n" +
+ "import java.util.Map; \n" +
"\n" +
"public class Clazz <@A M extends @B String, @C N extends @D Comparable> extends\n" +
" @E Object implements @F Comparable <@G Object> {\n" +
" \n" +
- " Clazz(char[] ...args) { \n" +
+ " Clazz(char[] ...args) { \n" +
" }\n" +
" \n" +
" int @I[] f @J[], g, h[], i@K[];\n" +
@@ -1501,68 +1501,68 @@ public void test0063() throws IOException {
" return null;\n" +
" }\n" +
"}\n";
-
-
- String expectedUnitToString = "import java.util.HashMap;\n" +
- "import java.util.Map;\n" +
- "public class Clazz<@A M extends @B String, @C N extends @D Comparable> extends @E Object implements @F Comparable<@G Object> {\n" +
- " int @I [] @J [] f;\n" +
- " int @I [] g;\n" +
- " int @I [][] h;\n" +
- " int @I [] @K [] i;\n" +
- " int @L [][] @M [] f2;\n" +
- " Clazz(char[]... args) {\n" +
- " super();\n" +
- " }\n" +
- " Clazz(int @N [] @O ... a) {\n" +
- " super();\n" +
- " }\n" +
- " int @R [] @S [] aa() {\n" +
- " }\n" +
- " int @T [] @U [] @V [] @W [] @X [] @Y [] a() {\n" +
- " return null;\n" +
- " }\n" +
- " public void main(String @A [] @B ... args) throws @D Exception {\n" +
- " HashMap<@E String, @F String> b1;\n" +
+
+
+ String expectedUnitToString = "import java.util.HashMap;\n" +
+ "import java.util.Map;\n" +
+ "public class Clazz<@A M extends @B String, @C N extends @D Comparable> extends @E Object implements @F Comparable<@G Object> {\n" +
+ " int @I [] @J [] f;\n" +
+ " int @I [] g;\n" +
+ " int @I [][] h;\n" +
+ " int @I [] @K [] i;\n" +
+ " int @L [][] @M [] f2;\n" +
+ " Clazz(char[]... args) {\n" +
+ " super();\n" +
+ " }\n" +
+ " Clazz(int @N [] @O ... a) {\n" +
+ " super();\n" +
+ " }\n" +
+ " int @R [] @S [] aa() {\n" +
+ " }\n" +
+ " int @T [] @U [] @V [] @W [] @X [] @Y [] a() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public void main(String @A [] @B ... args) throws @D Exception {\n" +
+ " HashMap<@E String, @F String> b1;\n" +
" int b;\n" +
- " b = (@G int) 10;\n" +
+ " b = (@G int) 10;\n" +
" char @H [] @I [] ch;\n" +
- " ch = (@K char @L [] @M []) (@N char @O [] @P []) null;\n" +
+ " ch = (@K char @L [] @M []) (@N char @O [] @P []) null;\n" +
" int[] i;\n" +
- " i = new @Q int @R [10];\n" +
+ " i = new @Q int @R [10];\n" +
" Integer w;\n" +
- " w = new X<@S String, @T Integer>().get(new @U Integer(12));\n" +
- " throw new @V Exception(\"test\");\n" +
+ " w = new X<@S String, @T Integer>().get(new @U Integer(12));\n" +
+ " throw new @V Exception(\"test\");\n" +
" boolean c;\n" +
- " c = (null instanceof @W String);\n" +
- " }\n" +
- " public <@X X, @Y Y>void foo(X x, Y @Z ... y) {\n" +
- " }\n" +
- " void foo(Map<? super @A Object, ? extends @B String> m) {\n" +
- " }\n" +
- " public int compareTo(Object arg0) {\n" +
- " return 0;\n" +
- " }\n" +
- "}\n" +
- "class X<@C K, @D T extends @E Object & @F Comparable<? super @G T>> {\n" +
- " X() {\n" +
- " super();\n" +
- " }\n" +
- " public Integer get(Integer integer) {\n" +
- " return null;\n" +
- " }\n" +
+ " c = (null instanceof @W String);\n" +
+ " }\n" +
+ " public <@X X, @Y Y>void foo(X x, Y @Z ... y) {\n" +
+ " }\n" +
+ " void foo(Map<? super @A Object, ? extends @B String> m) {\n" +
+ " }\n" +
+ " public int compareTo(Object arg0) {\n" +
+ " return 0;\n" +
+ " }\n" +
+ "}\n" +
+ "class X<@C K, @D T extends @E Object & @F Comparable<? super @G T>> {\n" +
+ " X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public Integer get(Integer integer) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n";
// indexing parser avoids creating lots of nodes, so parse tree comes out incorrectly.
// this is not bug, but intended behavior - see IndexingParser.newSingleNameReference(char[], long)
checkParse(CHECK_ALL & ~CHECK_INDEXING_PARSER & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0063", expectedUnitToString);
}
-//assorted unclassified
+//assorted unclassified
public void test0064() throws IOException {
String source = "class X<T extends @E Object & @F Comparable<? super T>> {}\n";
- String expectedUnitToString = "class X<T extends @E Object & @F Comparable<? super T>> {\n" +
- " X() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString = "class X<T extends @E Object & @F Comparable<? super T>> {\n" +
+ " X() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
// indexing parser avoids creating lots of nodes, so parse tree comes out incorrectly.
// this is not bug, but intended behavior - see IndexingParser.newSingleNameReference(char[], long)
@@ -1570,50 +1570,50 @@ public void test0064() throws IOException {
}
//type class literal expression
public void test0066() throws IOException {
- String source = "public class X {\n" +
- " <T extends Y<@A String @C[][]@B[]> & Cloneable> void foo(T t) {}\n" +
+ String source = "public class X {\n" +
+ " <T extends Y<@A String @C[][]@B[]> & Cloneable> void foo(T t) {}\n" +
"}";
- String expectedUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " <T extends Y<@A String @C [][] @B []> & Cloneable>void foo(T t) {\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " <T extends Y<@A String @C [][] @B []> & Cloneable>void foo(T t) {\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0066", expectedUnitToString);
}
//check locations
public void test0067() throws IOException {
- String source =
- "public class X {\n" +
- " @H String @E[] @F[] @G[] field;\n" +
- " @A Map<@B String, @C List<@D Object>> field2;\n" +
- " @A Map<@B String, @H String @E[] @F[] @G[]> field3;\n" +
+ String source =
+ "public class X {\n" +
+ " @H String @E[] @F[] @G[] field;\n" +
+ " @A Map<@B String, @C List<@D Object>> field2;\n" +
+ " @A Map<@B String, @H String @E[] @F[] @G[]> field3;\n" +
"}";
- String expectedUnitToString =
- "public class X {\n" +
- " @H String @E [] @F [] @G [] field;\n" +
- " @A Map<@B String, @C List<@D Object>> field2;\n" +
- " @A Map<@B String, @H String @E [] @F [] @G []> field3;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X {\n" +
+ " @H String @E [] @F [] @G [] field;\n" +
+ " @A Map<@B String, @C List<@D Object>> field2;\n" +
+ " @A Map<@B String, @H String @E [] @F [] @G []> field3;\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0067", expectedUnitToString);
}
//check locations
public void test0068() throws IOException {
- String source =
- "public class X {\n" +
- " @H String @E[] @F[] @G[] field;\n" +
+ String source =
+ "public class X {\n" +
+ " @H String @E[] @F[] @G[] field;\n" +
"}";
- String expectedUnitToString =
- "public class X {\n" +
- " @H String @E [] @F [] @G [] field;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X {\n" +
+ " @H String @E [] @F [] @G [] field;\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
LocationPrinterVisitor visitor = new LocationPrinterVisitor();
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0068", expectedUnitToString, visitor);
@@ -1626,16 +1626,16 @@ public void test0068() throws IOException {
}
//check locations
public void test0069() throws IOException {
- String source =
- "public class X {\n" +
- " @A Map<@B String, @H String> field3;\n" +
+ String source =
+ "public class X {\n" +
+ " @A Map<@B String, @H String> field3;\n" +
"}";
- String expectedUnitToString =
- "public class X {\n" +
- " @A Map<@B String, @H String> field3;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X {\n" +
+ " @A Map<@B String, @H String> field3;\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
LocationPrinterVisitor visitor = new LocationPrinterVisitor();
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0069", expectedUnitToString, visitor);
@@ -1647,16 +1647,16 @@ public void test0069() throws IOException {
}
//check locations
public void test0070() throws IOException {
- String source =
- "public class X {\n" +
- " @A Map<@B String, @H String @E[] @F[] @G[]> field3;\n" +
+ String source =
+ "public class X {\n" +
+ " @A Map<@B String, @H String @E[] @F[] @G[]> field3;\n" +
"}";
- String expectedUnitToString =
- "public class X {\n" +
- " @A Map<@B String, @H String @E [] @F [] @G []> field3;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X {\n" +
+ " @A Map<@B String, @H String @E [] @F [] @G []> field3;\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
LocationPrinterVisitor visitor = new LocationPrinterVisitor();
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0070", expectedUnitToString, visitor);
@@ -1671,16 +1671,16 @@ public void test0070() throws IOException {
}
//check locations
public void test0071() throws IOException {
- String source =
- "public class X {\n" +
- " @A Map<@B String, @C List<@H String @E[][] @G[]>> field;\n" +
+ String source =
+ "public class X {\n" +
+ " @A Map<@B String, @C List<@H String @E[][] @G[]>> field;\n" +
"}";
- String expectedUnitToString =
- "public class X {\n" +
- " @A Map<@B String, @C List<@H String @E [][] @G []>> field;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X {\n" +
+ " @A Map<@B String, @C List<@H String @E [][] @G []>> field;\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
LocationPrinterVisitor visitor = new LocationPrinterVisitor();
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0071", expectedUnitToString, visitor);
@@ -1695,16 +1695,16 @@ public void test0071() throws IOException {
}
//check locations
public void test0072() throws IOException {
- String source =
- "public class X {\n" +
- " @A Map<@B String, @C List<@H String @E[][] @G[]>>[] @I[] @J[] field;\n" +
+ String source =
+ "public class X {\n" +
+ " @A Map<@B String, @C List<@H String @E[][] @G[]>>[] @I[] @J[] field;\n" +
"}";
- String expectedUnitToString =
- "public class X {\n" +
- " @A Map<@B String, @C List<@H String @E [][] @G []>>[] @I [] @J [] field;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X {\n" +
+ " @A Map<@B String, @C List<@H String @E [][] @G []>>[] @I [] @J [] field;\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
LocationPrinterVisitor visitor = new LocationPrinterVisitor();
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0072", expectedUnitToString, visitor);
@@ -1721,16 +1721,16 @@ public void test0072() throws IOException {
}
//check locations
public void test0073() throws IOException {
- String source =
- "public class X {\n" +
- " @A Map<@B String, @C List<@H String @E[][] @G[]>> @I[][] @J[] field;\n" +
+ String source =
+ "public class X {\n" +
+ " @A Map<@B String, @C List<@H String @E[][] @G[]>> @I[][] @J[] field;\n" +
"}";
- String expectedUnitToString =
- "public class X {\n" +
- " @A Map<@B String, @C List<@H String @E [][] @G []>> @I [][] @J [] field;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X {\n" +
+ " @A Map<@B String, @C List<@H String @E [][] @G []>> @I [][] @J [] field;\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
LocationPrinterVisitor visitor = new LocationPrinterVisitor();
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0073", expectedUnitToString, visitor);
@@ -1747,16 +1747,16 @@ public void test0073() throws IOException {
}
//check locations
public void test0074() throws IOException {
- String source =
- "public class X {\n" +
- " @A Map<@C List<@H String @E[][] @G[]>, String @B[] @D[]> @I[] @F[] @J[] field;\n" +
+ String source =
+ "public class X {\n" +
+ " @A Map<@C List<@H String @E[][] @G[]>, String @B[] @D[]> @I[] @F[] @J[] field;\n" +
"}";
- String expectedUnitToString =
- "public class X {\n" +
- " @A Map<@C List<@H String @E [][] @G []>, String @B [] @D []> @I [] @F [] @J [] field;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X {\n" +
+ " @A Map<@C List<@H String @E [][] @G []>, String @B [] @D []> @I [] @F [] @J [] field;\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
LocationPrinterVisitor visitor = new LocationPrinterVisitor();
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0074", expectedUnitToString, visitor);
@@ -1775,16 +1775,16 @@ public void test0074() throws IOException {
}
//check locations
public void test0075() throws IOException {
- String source =
- "public class X {\n" +
- " @A Map<@C List<@H String @E[][] @G[]>, @B List<String [] @D[]>> [] @I[] @F[] @J[] field;\n" +
+ String source =
+ "public class X {\n" +
+ " @A Map<@C List<@H String @E[][] @G[]>, @B List<String [] @D[]>> [] @I[] @F[] @J[] field;\n" +
"}";
- String expectedUnitToString =
- "public class X {\n" +
- " @A Map<@C List<@H String @E [][] @G []>, @B List<String[] @D []>>[] @I [] @F [] @J [] field;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X {\n" +
+ " @A Map<@C List<@H String @E [][] @G []>, @B List<String[] @D []>>[] @I [] @F [] @J [] field;\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
LocationPrinterVisitor visitor = new LocationPrinterVisitor();
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0075", expectedUnitToString, visitor);
@@ -1803,16 +1803,16 @@ public void test0075() throws IOException {
}
//check locations
public void test0076() throws IOException {
- String source =
- "public class X {\n" +
- " @A Map<@B String, @C List<@D Object>> field;\n" +
+ String source =
+ "public class X {\n" +
+ " @A Map<@B String, @C List<@D Object>> field;\n" +
"}";
- String expectedUnitToString =
- "public class X {\n" +
- " @A Map<@B String, @C List<@D Object>> field;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X {\n" +
+ " @A Map<@B String, @C List<@D Object>> field;\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
LocationPrinterVisitor visitor = new LocationPrinterVisitor();
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0076", expectedUnitToString, visitor);
@@ -1825,16 +1825,16 @@ public void test0076() throws IOException {
}
//check locations
public void test0077() throws IOException {
- String source =
- "public class X {\n" +
- " @H String @E[] @F[] @G[] field;\n" +
+ String source =
+ "public class X {\n" +
+ " @H String @E[] @F[] @G[] field;\n" +
"}";
- String expectedUnitToString =
- "public class X {\n" +
- " @H String @E [] @F [] @G [] field;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X {\n" +
+ " @H String @E [] @F [] @G [] field;\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
LocationPrinterVisitor visitor = new LocationPrinterVisitor();
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0077", expectedUnitToString, visitor);
@@ -1847,16 +1847,16 @@ public void test0077() throws IOException {
}
//check locations
public void test0078() throws IOException {
- String source =
- "public class X {\n" +
- " @A Map<@B Comparable<@C Object @D[] @E[] @F[]>, @G List<@H Document>> field;\n" +
+ String source =
+ "public class X {\n" +
+ " @A Map<@B Comparable<@C Object @D[] @E[] @F[]>, @G List<@H Document>> field;\n" +
"}";
- String expectedUnitToString =
- "public class X {\n" +
- " @A Map<@B Comparable<@C Object @D [] @E [] @F []>, @G List<@H Document>> field;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X {\n" +
+ " @A Map<@B Comparable<@C Object @D [] @E [] @F []>, @G List<@H Document>> field;\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
LocationPrinterVisitor visitor = new LocationPrinterVisitor();
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0078", expectedUnitToString, visitor);
@@ -1873,16 +1873,16 @@ public void test0078() throws IOException {
}
//check locations
public void test0079() throws IOException {
- String source =
- "public class X {\n" +
- " @A java.util.Map<@B Comparable<@C Object @D[] @E[] @F[]>, @G List<@H Document>> field;\n" +
+ String source =
+ "public class X {\n" +
+ " @A java.util.Map<@B Comparable<@C Object @D[] @E[] @F[]>, @G List<@H Document>> field;\n" +
"}";
- String expectedUnitToString =
- "public class X {\n" +
- " @A java.util.Map<@B Comparable<@C Object @D [] @E [] @F []>, @G List<@H Document>> field;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X {\n" +
+ " @A java.util.Map<@B Comparable<@C Object @D [] @E [] @F []>, @G List<@H Document>> field;\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
LocationPrinterVisitor visitor = new LocationPrinterVisitor();
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0079", expectedUnitToString, visitor);
@@ -1899,16 +1899,16 @@ public void test0079() throws IOException {
}
//check locations
public void test0080() throws IOException {
- String source =
- "public class X {\n" +
- " @B Map<? extends Z, ? extends @A Z> field;\n" +
+ String source =
+ "public class X {\n" +
+ " @B Map<? extends Z, ? extends @A Z> field;\n" +
"}";
- String expectedUnitToString =
- "public class X {\n" +
- " @B Map<? extends Z, ? extends @A Z> field;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X {\n" +
+ " @B Map<? extends Z, ? extends @A Z> field;\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
LocationPrinterVisitor visitor = new LocationPrinterVisitor();
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0080", expectedUnitToString, visitor);
@@ -1919,16 +1919,16 @@ public void test0080() throws IOException {
}
//check locations
public void test0081() throws IOException {
- String source =
- "public class X {\n" +
- " @H java.lang.String @E[] @F[] @G[] field;\n" +
+ String source =
+ "public class X {\n" +
+ " @H java.lang.String @E[] @F[] @G[] field;\n" +
"}";
- String expectedUnitToString =
- "public class X {\n" +
- " @H java.lang.String @E [] @F [] @G [] field;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X {\n" +
+ " @H java.lang.String @E [] @F [] @G [] field;\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
LocationPrinterVisitor visitor = new LocationPrinterVisitor();
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0081", expectedUnitToString, visitor);
@@ -1941,16 +1941,16 @@ public void test0081() throws IOException {
}
//check locations
public void test0082() throws IOException {
- String source =
- "public class X {\n" +
- " @A Map<@B java.lang.String, @H java.lang.String @E[] @F[] @G[]> field3;\n" +
+ String source =
+ "public class X {\n" +
+ " @A Map<@B java.lang.String, @H java.lang.String @E[] @F[] @G[]> field3;\n" +
"}";
- String expectedUnitToString =
- "public class X {\n" +
- " @A Map<@B java.lang.String, @H java.lang.String @E [] @F [] @G []> field3;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X {\n" +
+ " @A Map<@B java.lang.String, @H java.lang.String @E [] @F [] @G []> field3;\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
LocationPrinterVisitor visitor = new LocationPrinterVisitor();
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0082", expectedUnitToString, visitor);
@@ -3415,10 +3415,10 @@ public void test0125() throws IOException {
String source =
"public class X extends @A(\"Hello, World!\") Y<@B @C('(') String[] @D[]> {}";
String expectedUnitToString =
- "public class X extends @A(\"Hello, World!\") Y<@B @C(\'(\') String[] @D []> {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
+ "public class X extends @A(\"Hello, World!\") Y<@B @C(\'(\') String[] @D []> {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER, source.toCharArray(), null, "test0125", expectedUnitToString );
}
@@ -3429,11 +3429,11 @@ public void test0126() throws IOException {
" @A(\"Hello, World!\") @B @C('(') String@E[] @D[] f;\n" +
"}";
String expectedUnitToString =
- "public class X {\n" +
- " @A(\"Hello, World!\") @B @C(\'(\') String @E [] @D [] f;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
+ "public class X {\n" +
+ " @A(\"Hello, World!\") @B @C(\'(\') String @E [] @D [] f;\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER, source.toCharArray(), null, "test0126", expectedUnitToString );
}
@@ -3444,52 +3444,52 @@ public void test0127() throws IOException {
" @A(\"Hello, World!\") Y<@B @C('(') String[] @D[]> f;\n" +
"}";
String expectedUnitToString =
- "public class X {\n" +
- " @A(\"Hello, World!\") Y<@B @C(\'(\') String[] @D []> f;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
+ "public class X {\n" +
+ " @A(\"Hello, World!\") Y<@B @C(\'(\') String[] @D []> f;\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER, source.toCharArray(), null, "test0127", expectedUnitToString );
}
//type class literal expression
public void test0128() throws IOException {
- String source =
- "public class X {\n" +
- " public boolean foo(String s) {\n" +
- " return (s instanceof @C('_') Object[]);\n" +
- " }\n" +
- " public Object foo1(String s) {\n" +
- " return new @B(3) @A(\"new Object\") Object[] {};\n" +
- " }\n" +
- " public Class foo2(String s) {\n" +
- " return null;\n" +
- " }\n" +
- " public Class foo3(String s) {\n" +
- " return null;\n" +
- " }\n" +
+ String source =
+ "public class X {\n" +
+ " public boolean foo(String s) {\n" +
+ " return (s instanceof @C('_') Object[]);\n" +
+ " }\n" +
+ " public Object foo1(String s) {\n" +
+ " return new @B(3) @A(\"new Object\") Object[] {};\n" +
+ " }\n" +
+ " public Class foo2(String s) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public Class foo3(String s) {\n" +
+ " return null;\n" +
+ " }\n" +
"}";
- String expectedUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public boolean foo(String s) {\n" +
- " return (s instanceof @C(\'_\') Object[]);\n" +
- " }\n" +
- " public Object foo1(String s) {\n" +
- " return new @B(3) @A(\"new Object\") Object[]{};\n" +
- " }\n" +
- " public Class foo2(String s) {\n" +
- " return null;\n" +
- " }\n" +
- " public Class foo3(String s) {\n" +
- " return null;\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public boolean foo(String s) {\n" +
+ " return (s instanceof @C(\'_\') Object[]);\n" +
+ " }\n" +
+ " public Object foo1(String s) {\n" +
+ " return new @B(3) @A(\"new Object\") Object[]{};\n" +
+ " }\n" +
+ " public Class foo2(String s) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public Class foo3(String s) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0128", expectedUnitToString );
}
-//instanceof checks
+//instanceof checks
public void test0129() throws IOException {
String source = "public class Clazz {\n" +
"public static void main(Object o) {\n" +
@@ -3497,92 +3497,92 @@ public void test0129() throws IOException {
"}\n" +
"}\n" +
"}";
- String expectedUnitToString =
- "public class Clazz {\n" +
- " public Clazz() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(Object o) {\n" +
- " if ((o instanceof @Readonly String))\n" +
- " {\n" +
- " }\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class Clazz {\n" +
+ " public Clazz() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(Object o) {\n" +
+ " if ((o instanceof @Readonly String))\n" +
+ " {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0129", expectedUnitToString);
}
-//instanceof checks
+//instanceof checks
public void test0130() throws IOException {
String source = "public class Clazz {\n" +
"public static void foo() {\n" +
" if (o instanceof @Readonly String[]) {}" +
"}\n" +
"}";
- String expectedUnitToString =
- "public class Clazz {\n" +
- " public Clazz() {\n" +
- " super();\n" +
- " }\n" +
- " public static void foo() {\n" +
- " if ((o instanceof @Readonly String[]))\n" +
- " {\n" +
- " }\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class Clazz {\n" +
+ " public Clazz() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void foo() {\n" +
+ " if ((o instanceof @Readonly String[]))\n" +
+ " {\n" +
+ " }\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_ALL & ~CHECK_JAVAC_PARSER, source.toCharArray(), null, "test0130", expectedUnitToString);
}
//cast
public void test0131() throws IOException {
String source =
- "public class X {\n" +
- " public void foo(Object o) {\n" +
+ "public class X {\n" +
+ " public void foo(Object o) {\n" +
" if (o instanceof String[][]) {\n" +
" String[][] tab = (@C('_') @B(3) String[] @A[]) o;\n" +
" System.out.println(tab.length);\n" +
- " }\n" +
+ " }\n" +
" System.out.println(o);\n" +
- " }\n" +
+ " }\n" +
"}";
- String expectedUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(Object o) {\n" +
- " if ((o instanceof String[][]))\n" +
- " {\n" +
- " String[][] tab = (@C(\'_\') @B(3) String[] @A []) o;\n" +
- " System.out.println(tab.length);\n" +
- " }\n" +
- " System.out.println(o);\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(Object o) {\n" +
+ " if ((o instanceof String[][]))\n" +
+ " {\n" +
+ " String[][] tab = (@C(\'_\') @B(3) String[] @A []) o;\n" +
+ " System.out.println(tab.length);\n" +
+ " }\n" +
+ " System.out.println(o);\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER, source.toCharArray(), null, "test0130", expectedUnitToString);
}
//cast
public void test0132() throws IOException {
String source =
- "public class X {\n" +
- " public void foo(Object o) {\n" +
+ "public class X {\n" +
+ " public void foo(Object o) {\n" +
" if (o instanceof String[][]) {\n" +
" String[][] tab = (@C('_') @B(3) String@D[] @A[]) o;\n" +
" System.out.println(tab.length);\n" +
- " }\n" +
+ " }\n" +
" System.out.println(o);\n" +
- " }\n" +
+ " }\n" +
"}";
- String expectedUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(Object o) {\n" +
- " if ((o instanceof String[][]))\n" +
- " {\n" +
- " String[][] tab = (@C(\'_\') @B(3) String @D [] @A []) o;\n" +
- " System.out.println(tab.length);\n" +
- " }\n" +
- " System.out.println(o);\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo(Object o) {\n" +
+ " if ((o instanceof String[][]))\n" +
+ " {\n" +
+ " String[][] tab = (@C(\'_\') @B(3) String @D [] @A []) o;\n" +
+ " System.out.println(tab.length);\n" +
+ " }\n" +
+ " System.out.println(o);\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER, source.toCharArray(), null, "test0130", expectedUnitToString);
}
@@ -3597,17 +3597,17 @@ public void test0133() throws IOException {
" System.out.println(X.<@D() @A(value = \"hello\") String, @B X>foo(\"SUCCESS\", null));\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " static <T, U>T foo(T t, U u) {\n" +
- " return t;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(X.<@D() @A(value = \"hello\") String, @B X>foo(\"SUCCESS\", null));\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " static <T, U>T foo(T t, U u) {\n" +
+ " return t;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(X.<@D() @A(value = \"hello\") String, @B X>foo(\"SUCCESS\", null));\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER, source.toCharArray(), null, "test0130", expectedUnitToString);
}
@@ -3624,18 +3624,18 @@ public void test0134() throws IOException {
" System.out.println(x.<@D() @A(value = \"hello\") String, @B X>foo(\"SUCCESS\", null));\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " <T, U>T foo(T t, U u) {\n" +
- " return t;\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " <T, U>T foo(T t, U u) {\n" +
+ " return t;\n" +
+ " }\n" +
" public static void main(String[] args) {\n" +
" X x = new X();\n" +
- " System.out.println(x.<@D() @A(value = \"hello\") String, @B X>foo(\"SUCCESS\", null));\n" +
- " }\n" +
+ " System.out.println(x.<@D() @A(value = \"hello\") String, @B X>foo(\"SUCCESS\", null));\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER, source.toCharArray(), null, "test0130", expectedUnitToString);
}
@@ -3650,15 +3650,15 @@ public void test0135() throws IOException {
" System.out.println(x);\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "public class X {\n" +
- " <T, U>X(T t, U u) {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X x = new <@D() @A(value = \"hello\") String, @B X>X();\n" +
- " System.out.println(x);\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X {\n" +
+ " <T, U>X(T t, U u) {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X x = new <@D() @A(value = \"hello\") String, @B X>X();\n" +
+ " System.out.println(x);\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER, source.toCharArray(), null, "test0130", expectedUnitToString);
}
@@ -3678,33 +3678,33 @@ public void test0136() throws IOException {
" new X<String>().new Y<Integer>().new Z();\n" +
" }\n" +
"}\n";
- String expectedUnitToString =
- "public class X<T> {\n" +
- " public class Y<K> {\n" +
- " public class Z {\n" +
- " Z(@D() @A(value = \"hello\") X<T>.Y<K> X.Y.this) {\n" +
- " super();\n" +
- " }\n" +
- " }\n" +
- " public Y() {\n" +
- " super();\n" +
- " }\n" +
- " void foo(@Marker X<T> this) {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new X<String>().new Y<Integer>().new Z();\n" +
- " }\n" +
+ String expectedUnitToString =
+ "public class X<T> {\n" +
+ " public class Y<K> {\n" +
+ " public class Z {\n" +
+ " Z(@D() @A(value = \"hello\") X<T>.Y<K> X.Y.this) {\n" +
+ " super();\n" +
+ " }\n" +
+ " }\n" +
+ " public Y() {\n" +
+ " super();\n" +
+ " }\n" +
+ " void foo(@Marker X<T> this) {\n" +
+ " }\n" +
+ " }\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new X<String>().new Y<Integer>().new Z();\n" +
+ " }\n" +
"}\n";
checkParse(CHECK_PARSER, source.toCharArray(), null, "test0130", expectedUnitToString);
}
// Support type annotations for wildcard
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=388085
public void test0137() throws IOException {
- String source =
+ String source =
"class X {\n" +
" public void main(Four<@Marker ? super String, @Marker ? extends Object> param) {\n" +
" One<@Marker ? extends Two<@Marker ? extends Three<@Marker ? extends Four<@Marker ? super String,@Marker ? extends Object>>>> one = null;\n" +
@@ -3718,44 +3718,44 @@ public void test0137() throws IOException {
"class Three<T> {}\n" +
"class Four<U, V> {}\n" +
"@interface Marker {}";
- String expectedUnitToString =
- "class X {\n" +
- " X() {\n" +
- " super();\n" +
- " }\n" +
- " public void main(Four<@Marker ? super String, @Marker ? extends Object> param) {\n" +
- " One<@Marker ? extends Two<@Marker ? extends Three<@Marker ? extends Four<@Marker ? super String, @Marker ? extends Object>>>> one = null;\n" +
- " Two<@Marker ? extends Three<@Marker ? extends Four<@Marker ? super String, @Marker ? extends Object>>> two = null;\n" +
- " Three<@Marker ? extends Four<@Marker ? super String, @Marker ? extends Object>> three = null;\n" +
- " Four<@Marker ? super String, @Marker ? extends Object> four = param;\n" +
- " }\n" +
- "}\n" +
- "class One<R> {\n" +
- " One() {\n" +
- " super();\n" +
- " }\n" +
- "}\n" +
- "class Two<S> {\n" +
- " Two() {\n" +
- " super();\n" +
- " }\n" +
- "}\n" +
- "class Three<T> {\n" +
- " Three() {\n" +
- " super();\n" +
- " }\n" +
- "}\n" +
- "class Four<U, V> {\n" +
- " Four() {\n" +
- " super();\n" +
- " }\n" +
- "}\n" +
- "@interface Marker {\n" +
+ String expectedUnitToString =
+ "class X {\n" +
+ " X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void main(Four<@Marker ? super String, @Marker ? extends Object> param) {\n" +
+ " One<@Marker ? extends Two<@Marker ? extends Three<@Marker ? extends Four<@Marker ? super String, @Marker ? extends Object>>>> one = null;\n" +
+ " Two<@Marker ? extends Three<@Marker ? extends Four<@Marker ? super String, @Marker ? extends Object>>> two = null;\n" +
+ " Three<@Marker ? extends Four<@Marker ? super String, @Marker ? extends Object>> three = null;\n" +
+ " Four<@Marker ? super String, @Marker ? extends Object> four = param;\n" +
+ " }\n" +
+ "}\n" +
+ "class One<R> {\n" +
+ " One() {\n" +
+ " super();\n" +
+ " }\n" +
+ "}\n" +
+ "class Two<S> {\n" +
+ " Two() {\n" +
+ " super();\n" +
+ " }\n" +
+ "}\n" +
+ "class Three<T> {\n" +
+ " Three() {\n" +
+ " super();\n" +
+ " }\n" +
+ "}\n" +
+ "class Four<U, V> {\n" +
+ " Four() {\n" +
+ " super();\n" +
+ " }\n" +
+ "}\n" +
+ "@interface Marker {\n" +
"}\n";
checkParse(CHECK_PARSER, source.toCharArray(), null, "test0137", expectedUnitToString);
}
public void test0138() throws IOException {
- String source =
+ String source =
"import java.lang.annotation.Target;\n" +
"import static java.lang.annotation.ElementType.*;\n" +
"public class X {\n" +
@@ -3767,41 +3767,41 @@ public void test0138() throws IOException {
" return 2;\n" +
" }\n" +
" public static int bar2(int k) {\n" +
- " return k;\n" +
+ " return k;\n" +
" }\n" +
"}\n" +
"@Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
"@interface Marker {}\n" +
"@Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
"@interface Marker2 {}\n";
- String expectedUnitToString =
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo() {\n" +
- " int @Marker [][][] i = new @Marker2 int @Marker @Marker2 [2] @Marker @Marker2 [bar()] @Marker @Marker2 [];\n" +
- " int @Marker [][][] j = new @Marker2 int @Marker @Marker2 [2] @Marker @Marker2 [X.bar2(2)] @Marker @Marker2 [];\n" +
- " }\n" +
- " public int bar() {\n" +
- " return 2;\n" +
- " }\n" +
- " public static int bar2(int k) {\n" +
- " return k;\n" +
- " }\n" +
- "}\n" +
- "@Target(java.lang.annotation.ElementType.TYPE_USE) @interface Marker {\n" +
- "}\n" +
- "@Target(java.lang.annotation.ElementType.TYPE_USE) @interface Marker2 {\n" +
+ String expectedUnitToString =
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "public class X {\n" +
+ " public X() {\n" +
+ " super();\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " int @Marker [][][] i = new @Marker2 int @Marker @Marker2 [2] @Marker @Marker2 [bar()] @Marker @Marker2 [];\n" +
+ " int @Marker [][][] j = new @Marker2 int @Marker @Marker2 [2] @Marker @Marker2 [X.bar2(2)] @Marker @Marker2 [];\n" +
+ " }\n" +
+ " public int bar() {\n" +
+ " return 2;\n" +
+ " }\n" +
+ " public static int bar2(int k) {\n" +
+ " return k;\n" +
+ " }\n" +
+ "}\n" +
+ "@Target(java.lang.annotation.ElementType.TYPE_USE) @interface Marker {\n" +
+ "}\n" +
+ "@Target(java.lang.annotation.ElementType.TYPE_USE) @interface Marker2 {\n" +
"}\n";
checkParse(CHECK_PARSER, source.toCharArray(), null, "test0137", expectedUnitToString);
}
// Support for annotations on ellipsis in lambda expression
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=432574
public void test0139() throws IOException {
- String source =
+ String source =
"import java.lang.annotation.ElementType;\n" +
"import java.lang.annotation.Target;\n" +
"public class X {\n" +
@@ -3813,7 +3813,7 @@ public void test0139() throws IOException {
"@Target(ElementType.TYPE_USE)\n" +
"@interface T1 {\n" +
"}\n";
- String expectedUnitToString =
+ String expectedUnitToString =
"import java.lang.annotation.ElementType;\n" +
"import java.lang.annotation.Target;\n" +
"public class X {\n" +
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractBatchCompilerTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractBatchCompilerTest.java
index 369f09013..d69c85911 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractBatchCompilerTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractBatchCompilerTest.java
@@ -149,7 +149,7 @@ public abstract class AbstractBatchCompilerTest extends AbstractRegressionTest {
super.setUp();
CASCADED_JARS_CREATED = false; // initialization needed for each subclass individually
}
-
+
protected void createCascadedJars() {
if (!CASCADED_JARS_CREATED) {
File libDir = new File(LIB_DIR);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractComparableTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractComparableTest.java
index 83d844a35..6d7ad9257 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractComparableTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractComparableTest.java
@@ -29,28 +29,28 @@ import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
public class AbstractComparableTest extends AbstractRegressionTest {
protected static final String GOOGLE_INJECT_NAME = "com/google/inject/Inject.java";
- protected static final String GOOGLE_INJECT_CONTENT =
- "package com.google.inject;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.RUNTIME;\n" +
+ protected static final String GOOGLE_INJECT_CONTENT =
+ "package com.google.inject;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.RUNTIME;\n" +
"import java.lang.annotation.Target;\n" +
- "@Target({ METHOD, CONSTRUCTOR, FIELD })\n" +
- "@Retention(RUNTIME)\n" +
- "public @interface Inject {\n" +
- "\n" +
- " boolean optional() default false;\n" +
+ "@Target({ METHOD, CONSTRUCTOR, FIELD })\n" +
+ "@Retention(RUNTIME)\n" +
+ "public @interface Inject {\n" +
+ "\n" +
+ " boolean optional() default false;\n" +
"}";
protected static final String JAVAX_INJECT_NAME = "javax/inject/Inject.java";
- protected static final String JAVAX_INJECT_CONTENT =
- "package javax.inject;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.RUNTIME;\n" +
+ protected static final String JAVAX_INJECT_CONTENT =
+ "package javax.inject;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.RUNTIME;\n" +
"import java.lang.annotation.Target;\n" +
- "@Target({ METHOD, CONSTRUCTOR, FIELD })\n" +
- "@Retention(RUNTIME)\n" +
+ "@Target({ METHOD, CONSTRUCTOR, FIELD })\n" +
+ "@Retention(RUNTIME)\n" +
"public @interface Inject {}\n";
protected static final String SPRINGFRAMEWORK_AUTOWIRED_NAME = "org/springframework/beans/factory/annotation/Autowired.java";
@@ -108,7 +108,7 @@ public class AbstractComparableTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.WARNING);
return options;
}
-
+
protected String intersection(String... types) {
// From JDK 12, Comparable gets two new super interfaces, namely Constable and ConstantDesc.
// The idea is to append Comparable with &Constable&ConstantDesc automatically.
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractNullAnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractNullAnnotationTest.java
index 1611ce3cc..180186dfe 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractNullAnnotationTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractNullAnnotationTest.java
@@ -98,10 +98,10 @@ public abstract class AbstractNullAnnotationTest extends AbstractComparableTest
this.LIBS[len] = bundleFile.getPath();
}
}
-
+
// Conditionally augment problem detection settings
static boolean setNullRelatedOptions = true;
-
+
protected Map getCompilerOptions() {
Map defaultOptions = super.getCompilerOptions();
if (setNullRelatedOptions) {
@@ -117,7 +117,7 @@ public abstract class AbstractNullAnnotationTest extends AbstractComparableTest
defaultOptions.put(CompilerOptions.OPTION_PessimisticNullAnalysisForFreeTypeVariables, JavaCore.ERROR);
defaultOptions.put(CompilerOptions.OPTION_ReportNonNullTypeVariableFromLegacyInvocation, JavaCore.WARNING);
-
+
// leave other new options at these defaults:
// defaultOptions.put(CompilerOptions.OPTION_ReportNullContractViolation, JavaCore.ERROR);
// defaultOptions.put(CompilerOptions.OPTION_ReportPotentialNullContractViolation, JavaCore.ERROR);
@@ -159,7 +159,7 @@ public abstract class AbstractNullAnnotationTest extends AbstractComparableTest
false);
}
/** Test with JDT null annotations, expecting a null-error from ecj, none from javac. */
- void runNegativeTestWithLibs(boolean shouldFlushOutputDirectory, String[] testFiles, Map customOptions,
+ void runNegativeTestWithLibs(boolean shouldFlushOutputDirectory, String[] testFiles, Map customOptions,
String expectedErrorLog, boolean skipJavaC) {
runNegativeTest(
shouldFlushOutputDirectory,
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
index 21cd9432b..fbc4931f9 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
@@ -617,7 +617,7 @@ protected static class JavacTestOptions {
if (additionalOptions != null)
result = result + " " + additionalOptions;
options.setCompilerOptions(result);
-
+
}
else
throw new IllegalArgumentException("preview not supported at release "+release);
@@ -824,7 +824,7 @@ protected static class JavacTestOptions {
new EclipseJustification(MismatchType.JavacErrorsEclipseNone) : null,
EclipseBug151275 = RUN_JAVAC ? // https://bugs.eclipse.org/bugs/show_bug.cgi?id=151275
new EclipseJustification(MismatchType.JavacErrorsEclipseNone) {
- Excuse excuseFor(JavacCompiler compiler) {
+ Excuse excuseFor(JavacCompiler compiler) {
return compiler.compliance < ClassFileConstants.JDK1_7 ? this : null;
}
} : null,
@@ -866,7 +866,7 @@ protected static class JavacTestOptions {
public static final EclipseJustification
EclipseJustification0001 = RUN_JAVAC ?
new EclipseJustification(MismatchType.EclipseErrorsJavacNone) {
- Excuse excuseFor(JavacCompiler compiler) {
+ Excuse excuseFor(JavacCompiler compiler) {
return compiler.compliance < ClassFileConstants.JDK1_7 ? this : null;
}
} : null;
@@ -1275,7 +1275,7 @@ protected static class JavacTestOptions {
int end = index + Messages.classformat_classformatexception.length();
fail("ClassFormatException swallowed in Disassembler:\n..." + result.substring(start, end));
}
-
+
FileInputStream stream = null;
try {
stream = new FileInputStream(classFile);
@@ -1994,14 +1994,14 @@ protected static class JavacTestOptions {
ICompilerRequestor clientRequestor,
boolean skipJavac) {
runConformTest(
- testFiles,
- expectedSuccessOutputString,
- classLib,
- shouldFlushOutputDirectory,
- vmArguments,
- customOptions,
- clientRequestor,
- skipJavac,
+ testFiles,
+ expectedSuccessOutputString,
+ classLib,
+ shouldFlushOutputDirectory,
+ vmArguments,
+ customOptions,
+ clientRequestor,
+ skipJavac,
(skipJavac ?
JavacTestOptions.SKIP :
JavacTestOptions.DEFAULT));
@@ -2509,7 +2509,7 @@ private void deleteSourceFiles(File directory) {
}
private boolean errorStringMatch(String expectedErrorStringStart, String actualError) {
/*
- * From TestVerifier.checkBuffers():
+ * From TestVerifier.checkBuffers():
* This is an opportunistic heuristic for error strings comparison:
* - null means skip test;
* - empty means exactly empty;
@@ -2821,8 +2821,8 @@ protected void runNegativeTest(boolean skipJavac, JavacTestOptions javacTestOpti
boolean shouldFlushOutputDirectory,
Map customOptions,
String expectedErrorString) {
- runNegativeTest(testFiles, expectedCompilerLog, classLibraries,
- shouldFlushOutputDirectory, customOptions, expectedErrorString,
+ runNegativeTest(testFiles, expectedCompilerLog, classLibraries,
+ shouldFlushOutputDirectory, customOptions, expectedErrorString,
JavacTestOptions.DEFAULT);
}
protected void runNegativeTest(
@@ -4003,5 +4003,5 @@ protected void runNegativeTest(
options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
return options;
- }
+ }
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest9.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest9.java
index 57db3e4ac..2e5b3270f 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest9.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest9.java
@@ -58,7 +58,7 @@ public class AbstractRegressionTest9 extends AbstractRegressionTest {
}
return new InMemoryNameEnvironment9(testFiles, this.moduleMap, classLibs);
}
-
+
@Override
protected CompilationUnit[] getCompilationUnits(String[] testFiles) {
Map<String,char[]> moduleFiles= new HashMap<>(); // filename -> modulename
@@ -104,7 +104,7 @@ public class AbstractRegressionTest9 extends AbstractRegressionTest {
private IModule extractModuleDesc(String fileName, String fileContent, ICompilationUnit cu) {
if (fileName.toLowerCase().endsWith(IModule.MODULE_INFO_JAVA)) {
Parser parser = createParser();
-
+
CompilationResult compilationResult = new CompilationResult(cu, 0, 1, 10);
CompilationUnitDeclaration unit = parser.parse(cu, compilationResult);
if (unit.isModuleInfo() && unit.moduleDeclaration != null) {
@@ -126,7 +126,7 @@ public class AbstractRegressionTest9 extends AbstractRegressionTest {
/** Use in tests to associate the CU in given files to the module of the given name. */
public void associateToModule(String moduleName, String... fileNames) {
- for (String fileName : fileNames)
+ for (String fileName : fileNames)
this.file2module.put(fileName, moduleName);
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java
index 92a1c26bc..aee35e029 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java
@@ -122,11 +122,11 @@ public class AmbiguousMethodTest extends AbstractComparableTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " static interface I3<E3, E4> extends I1<E3>, I2<E4> {}\n" +
- " ^^\n" +
- "Name clash: The method method(E2) of type X.I2<E2> has the same erasure as method(E1) of type X.I1<E1> but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " static interface I3<E3, E4> extends I1<E3>, I2<E4> {}\n" +
+ " ^^\n" +
+ "Name clash: The method method(E2) of type X.I2<E2> has the same erasure as method(E1) of type X.I1<E1> but does not override it\n" +
"----------\n");
}
}
@@ -278,32 +278,32 @@ public class AmbiguousMethodTest extends AbstractComparableTest {
public void test005() {
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " <S extends A> void foo() { }\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " <N extends B> N foo() { return null; }\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " new X().foo();\n" +
- " ^^^\n" +
- "The method foo() is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " <S extends A> void foo() { }\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " <N extends B> N foo() { return null; }\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " new X().foo();\n" +
+ " ^^^\n" +
+ "The method foo() is ambiguous for the type X\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " <S extends A> void foo() { }\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " <N extends B> N foo() { return null; }\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " <S extends A> void foo() { }\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " <N extends B> N foo() { return null; }\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -332,47 +332,47 @@ X.java:3: name clash: <N>foo() and <S>foo() have the same erasure
public void test006() {
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " new Y<Object>().foo(\"X\");\n" +
- " ^^^\n" +
- "The method foo(Object) is ambiguous for the type Y<Object>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " new Y<Object>().foo2(\"X\");\n" +
- " ^^^^\n" +
- "The method foo2(Object) is ambiguous for the type Y<Object>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 10)\n" +
- " void foo(T2 t) {}\n" +
- " ^^^^^^^^^\n" +
- "Name clash: The method foo(T2) of type Y<T2> has the same erasure as foo(U1) of type X<T> but does not override it\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 11)\n" +
- " <U3> void foo2(T2 t) {}\n" +
- " ^^^^^^^^^^\n" +
- "Name clash: The method foo2(T2) of type Y<T2> has the same erasure as foo2(U2) of type X<T> but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " new Y<Object>().foo(\"X\");\n" +
+ " ^^^\n" +
+ "The method foo(Object) is ambiguous for the type Y<Object>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " new Y<Object>().foo2(\"X\");\n" +
+ " ^^^^\n" +
+ "The method foo2(Object) is ambiguous for the type Y<Object>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 10)\n" +
+ " void foo(T2 t) {}\n" +
+ " ^^^^^^^^^\n" +
+ "Name clash: The method foo(T2) of type Y<T2> has the same erasure as foo(U1) of type X<T> but does not override it\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 11)\n" +
+ " <U3> void foo2(T2 t) {}\n" +
+ " ^^^^^^^^^^\n" +
+ "Name clash: The method foo2(T2) of type Y<T2> has the same erasure as foo2(U2) of type X<T> but does not override it\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " new Y<Object>().foo(\"X\");\n" +
- " ^^^\n" +
- "The method foo(Object) is ambiguous for the type Y<Object>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " new Y<Object>().foo2(\"X\");\n" +
- " ^^^^\n" +
- "The method foo2(Object) is ambiguous for the type Y<Object>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " void foo(T2 t) {}\n" +
- " ^^^^^^^^^\n" +
- "Name clash: The method foo(T2) of type Y<T2> has the same erasure as foo(U1) of type X<T> but does not override it\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 11)\n" +
- " <U3> void foo2(T2 t) {}\n" +
- " ^^^^^^^^^^\n" +
- "Name clash: The method foo2(T2) of type Y<T2> has the same erasure as foo2(U2) of type X<T> but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " new Y<Object>().foo(\"X\");\n" +
+ " ^^^\n" +
+ "The method foo(Object) is ambiguous for the type Y<Object>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " new Y<Object>().foo2(\"X\");\n" +
+ " ^^^^\n" +
+ "The method foo2(Object) is ambiguous for the type Y<Object>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 10)\n" +
+ " void foo(T2 t) {}\n" +
+ " ^^^^^^^^^\n" +
+ "Name clash: The method foo(T2) of type Y<T2> has the same erasure as foo(U1) of type X<T> but does not override it\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 11)\n" +
+ " <U3> void foo2(T2 t) {}\n" +
+ " ^^^^^^^^^^\n" +
+ "Name clash: The method foo2(T2) of type Y<T2> has the same erasure as foo2(U2) of type X<T> but does not override it\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -505,7 +505,7 @@ sure, yet neither overrides the other
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=123943 - case 2
// see also Bug 399567 - [1.8] Different error message from the reference compiler
public void test009() {
- String[] testFiles =
+ String[] testFiles =
new String[] {
"T.java",
"import java.util.*;\n" +
@@ -524,21 +524,21 @@ sure, yet neither overrides the other
else
this.runNegativeTest(
testFiles,
- "----------\n" +
- "1. WARNING in T.java (at line 5)\n" +
- " os.add(\"hello\");\n" +
- " ^^\n" +
- "Null pointer access: The variable os can only be null at this location\n" +
- "----------\n" +
- "2. WARNING in T.java (at line 7)\n" +
- " os2.add(1);\n" +
- " ^^^\n" +
- "Null pointer access: The variable os2 can only be null at this location\n" +
- "----------\n" +
- "3. ERROR in T.java (at line 10)\n" +
- " interface OrderedSet<E> extends List<E>, Set<E> { boolean add(E o); }\n" +
- " ^^^^^^^^^^\n" +
- "Duplicate default methods named spliterator with the parameters () and () are inherited from the types Set<E> and List<E>\n" +
+ "----------\n" +
+ "1. WARNING in T.java (at line 5)\n" +
+ " os.add(\"hello\");\n" +
+ " ^^\n" +
+ "Null pointer access: The variable os can only be null at this location\n" +
+ "----------\n" +
+ "2. WARNING in T.java (at line 7)\n" +
+ " os2.add(1);\n" +
+ " ^^^\n" +
+ "Null pointer access: The variable os2 can only be null at this location\n" +
+ "----------\n" +
+ "3. ERROR in T.java (at line 10)\n" +
+ " interface OrderedSet<E> extends List<E>, Set<E> { boolean add(E o); }\n" +
+ " ^^^^^^^^^^\n" +
+ "Duplicate default methods named spliterator with the parameters () and () are inherited from the types Set<E> and List<E>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=123943 variant to make it pass on JRE8
@@ -581,11 +581,11 @@ public void test010a() {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " createParser(new A());\n" +
- " ^^^^^^^^^^^^\n" +
- "The method createParser(A) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " createParser(new A());\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The method createParser(A) is ambiguous for the type X\n" +
"----------\n"
);
// javac 7 randomly picks which ever method is second
@@ -662,26 +662,26 @@ public void test010c() {
public void test011a() {
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in Combined.java (at line 2)\n" +
- " <T extends Comparable<T>> void pickOne(T value) throws ExOne {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in Combined.java (at line 2)\n" +
+ " <T extends Comparable<T>> void pickOne(T value) throws ExOne {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method pickOne(T) is the same as another method in type Combined<A,B>\n" +
- "----------\n" +
- "2. WARNING in Combined.java (at line 3)\n" +
- " <T> T pickOne(Comparable<T> value) throws ExTwo { return null;}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. WARNING in Combined.java (at line 3)\n" +
+ " <T> T pickOne(Comparable<T> value) throws ExTwo { return null;}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method pickOne(Comparable<T>) is the same as another method in type Combined<A,B>\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in Combined.java (at line 2)\n" +
- " <T extends Comparable<T>> void pickOne(T value) throws ExOne {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in Combined.java (at line 2)\n" +
+ " <T extends Comparable<T>> void pickOne(T value) throws ExOne {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method pickOne(T) is the same as another method in type Combined<A,B>\n" +
- "----------\n" +
- "2. ERROR in Combined.java (at line 3)\n" +
- " <T> T pickOne(Comparable<T> value) throws ExTwo { return null;}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in Combined.java (at line 3)\n" +
+ " <T> T pickOne(Comparable<T> value) throws ExTwo { return null;}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method pickOne(Comparable<T>) is the same as another method in type Combined<A,B>\n" +
"----------\n";
this.runNegativeTest(
@@ -714,47 +714,47 @@ X.java:3: name clash: <T#1>pickOne(Comparable<T#1>) and <T#2>pickOne(T#2) have t
public void test011b() {
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in Test1.java (at line 2)\n" +
- " <T extends Comparable<T>> void pickOne(T value) throws ExOne {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in Test1.java (at line 2)\n" +
+ " <T extends Comparable<T>> void pickOne(T value) throws ExOne {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method pickOne(T) is the same as another method in type Test1<AA,BB>\n" +
- "----------\n" +
- "2. WARNING in Test1.java (at line 3)\n" +
- " <T> T pickOne(Comparable<T> value) throws ExTwo { return null;}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. WARNING in Test1.java (at line 3)\n" +
+ " <T> T pickOne(Comparable<T> value) throws ExTwo { return null;}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method pickOne(Comparable<T>) is the same as another method in type Test1<AA,BB>\n" +
- "----------\n" +
- "3. WARNING in Test1.java (at line 4)\n" +
- " void pickOne2(Test1<Integer,Integer> c) throws ExOne { c.pickOne((Comparable) \"test\"); }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation pickOne(Comparable) of the generic method pickOne(T) of type Test1<Integer,Integer>\n" +
- "----------\n" +
- "4. WARNING in Test1.java (at line 4)\n" +
- " void pickOne2(Test1<Integer,Integer> c) throws ExOne { c.pickOne((Comparable) \"test\"); }\n" +
- " ^^^^^^^^^^\n" +
- "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in Test1.java (at line 4)\n" +
+ " void pickOne2(Test1<Integer,Integer> c) throws ExOne { c.pickOne((Comparable) \"test\"); }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation pickOne(Comparable) of the generic method pickOne(T) of type Test1<Integer,Integer>\n" +
+ "----------\n" +
+ "4. WARNING in Test1.java (at line 4)\n" +
+ " void pickOne2(Test1<Integer,Integer> c) throws ExOne { c.pickOne((Comparable) \"test\"); }\n" +
+ " ^^^^^^^^^^\n" +
+ "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in Test1.java (at line 2)\n" +
- " <T extends Comparable<T>> void pickOne(T value) throws ExOne {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in Test1.java (at line 2)\n" +
+ " <T extends Comparable<T>> void pickOne(T value) throws ExOne {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method pickOne(T) is the same as another method in type Test1<AA,BB>\n" +
- "----------\n" +
- "2. ERROR in Test1.java (at line 3)\n" +
- " <T> T pickOne(Comparable<T> value) throws ExTwo { return null;}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in Test1.java (at line 3)\n" +
+ " <T> T pickOne(Comparable<T> value) throws ExTwo { return null;}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method pickOne(Comparable<T>) is the same as another method in type Test1<AA,BB>\n" +
- "----------\n" +
- "3. WARNING in Test1.java (at line 4)\n" +
- " void pickOne2(Test1<Integer,Integer> c) throws ExOne { c.pickOne((Comparable) \"test\"); }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation pickOne(Comparable) of the generic method pickOne(T) of type Test1<Integer,Integer>\n" +
- "----------\n" +
- "4. WARNING in Test1.java (at line 4)\n" +
- " void pickOne2(Test1<Integer,Integer> c) throws ExOne { c.pickOne((Comparable) \"test\"); }\n" +
- " ^^^^^^^^^^\n" +
- "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in Test1.java (at line 4)\n" +
+ " void pickOne2(Test1<Integer,Integer> c) throws ExOne { c.pickOne((Comparable) \"test\"); }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation pickOne(Comparable) of the generic method pickOne(T) of type Test1<Integer,Integer>\n" +
+ "----------\n" +
+ "4. WARNING in Test1.java (at line 4)\n" +
+ " void pickOne2(Test1<Integer,Integer> c) throws ExOne { c.pickOne((Comparable) \"test\"); }\n" +
+ " ^^^^^^^^^^\n" +
+ "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -1206,53 +1206,53 @@ X.java:4: warning: [unchecked] unchecked method invocation: method pickOne in cl
" new X().a5(hraw);\n" +
" ^^\n" +
"The method a5(H) is ambiguous for the type X\n" +
- "----------\n" +
- "12. ERROR in Y.java (at line 15)\n" +
- " new X().a6(h);\n" +
- " ^^\n" +
- "The method a6(H<C>) is ambiguous for the type X\n" +
- "----------\n" +
- "13. ERROR in Y.java (at line 16)\n" +
- " new X().a6(hraw);\n" +
- " ^^\n" +
- "The method a6(H) is ambiguous for the type X\n" +
+ "----------\n" +
+ "12. ERROR in Y.java (at line 15)\n" +
+ " new X().a6(h);\n" +
+ " ^^\n" +
+ "The method a6(H<C>) is ambiguous for the type X\n" +
+ "----------\n" +
+ "13. ERROR in Y.java (at line 16)\n" +
+ " new X().a6(hraw);\n" +
+ " ^^\n" +
+ "The method a6(H) is ambiguous for the type X\n" +
"----------\n"
: // in 1.8 fewer of the calls are ambiguous
- "----------\n" +
- "1. WARNING in Y.java (at line 4)\n" +
- " H hraw = null;\n" +
- " ^\n" +
- "H is a raw type. References to generic type H<T3> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 5)\n" +
- " new X().a(h);\n" +
- " ^\n" +
- "The method a(G) is ambiguous for the type X\n" +
- "----------\n" +
- "3. ERROR in Y.java (at line 6)\n" +
- " new X().a(hraw);\n" +
- " ^\n" +
- "The method a(G) is ambiguous for the type X\n" +
- "----------\n" +
- "4. ERROR in Y.java (at line 7)\n" +
- " new X().a2(h);\n" +
- " ^^\n" +
- "The method a2(G) is ambiguous for the type X\n" +
- "----------\n" +
- "5. ERROR in Y.java (at line 8)\n" +
- " new X().a2(hraw);\n" +
- " ^^\n" +
- "The method a2(G) is ambiguous for the type X\n" +
- "----------\n" +
- "6. ERROR in Y.java (at line 13)\n" +
- " new X().a5(h);\n" +
- " ^^\n" +
- "The method a5(H<C>) is ambiguous for the type X\n" +
- "----------\n" +
- "7. ERROR in Y.java (at line 14)\n" +
- " new X().a5(hraw);\n" +
- " ^^\n" +
- "The method a5(H) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. WARNING in Y.java (at line 4)\n" +
+ " H hraw = null;\n" +
+ " ^\n" +
+ "H is a raw type. References to generic type H<T3> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in Y.java (at line 5)\n" +
+ " new X().a(h);\n" +
+ " ^\n" +
+ "The method a(G) is ambiguous for the type X\n" +
+ "----------\n" +
+ "3. ERROR in Y.java (at line 6)\n" +
+ " new X().a(hraw);\n" +
+ " ^\n" +
+ "The method a(G) is ambiguous for the type X\n" +
+ "----------\n" +
+ "4. ERROR in Y.java (at line 7)\n" +
+ " new X().a2(h);\n" +
+ " ^^\n" +
+ "The method a2(G) is ambiguous for the type X\n" +
+ "----------\n" +
+ "5. ERROR in Y.java (at line 8)\n" +
+ " new X().a2(hraw);\n" +
+ " ^^\n" +
+ "The method a2(G) is ambiguous for the type X\n" +
+ "----------\n" +
+ "6. ERROR in Y.java (at line 13)\n" +
+ " new X().a5(h);\n" +
+ " ^^\n" +
+ "The method a5(H<C>) is ambiguous for the type X\n" +
+ "----------\n" +
+ "7. ERROR in Y.java (at line 14)\n" +
+ " new X().a5(hraw);\n" +
+ " ^^\n" +
+ "The method a5(H) is ambiguous for the type X\n" +
"----------\n"),
null,
false
@@ -1365,255 +1365,255 @@ X.java:4: warning: [unchecked] unchecked method invocation: method pickOne in cl
"class G<T2> extends F<T2> implements J<T2> {}\n" +
"class H<T3> extends G<T3> {}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " void a(G x) {}\n" +
- " ^\n" +
- "G is a raw type. References to generic type G<T2> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " void b(G x) {}\n" +
- " ^\n" +
- "G is a raw type. References to generic type G<T2> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 9)\n" +
- " void b(F x) {}\n" +
- " ^\n" +
- "F is a raw type. References to generic type F<T1> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 11)\n" +
- " void c(G x) {}\n" +
- " ^\n" +
- "G is a raw type. References to generic type G<T2> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 14)\n" +
- " void d(G x) {}\n" +
- " ^\n" +
- "G is a raw type. References to generic type G<T2> should be parameterized\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 17)\n" +
- " void e(G x) {}\n" +
- " ^\n" +
- "G is a raw type. References to generic type G<T2> should be parameterized\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 20)\n" +
- " void f(G x) {}\n" +
- " ^\n" +
- "G is a raw type. References to generic type G<T2> should be parameterized\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 21)\n" +
- " <S extends F> void f(S x) {}\n" +
- " ^\n" +
- "F is a raw type. References to generic type F<T1> should be parameterized\n" +
- "----------\n" +
- "9. WARNING in X.java (at line 23)\n" +
- " void g(G x) {}\n" +
- " ^\n" +
- "G is a raw type. References to generic type G<T2> should be parameterized\n" +
- "----------\n" +
- "10. WARNING in X.java (at line 24)\n" +
- " <S extends F & J<S>> void g(S x) {}\n" +
- " ^\n" +
- "F is a raw type. References to generic type F<T1> should be parameterized\n" +
- "----------\n" +
- "11. WARNING in X.java (at line 26)\n" +
- " <T extends G> void a2(T x) {}\n" +
- " ^\n" +
- "G is a raw type. References to generic type G<T2> should be parameterized\n" +
- "----------\n" +
- "12. WARNING in X.java (at line 29)\n" +
- " <T extends G> void b2(T x) {}\n" +
- " ^\n" +
- "G is a raw type. References to generic type G<T2> should be parameterized\n" +
- "----------\n" +
- "13. WARNING in X.java (at line 30)\n" +
- " void b2(F x) {}\n" +
- " ^\n" +
- "F is a raw type. References to generic type F<T1> should be parameterized\n" +
- "----------\n" +
- "14. WARNING in X.java (at line 32)\n" +
- " <T extends G> void c2(T x) {}\n" +
- " ^\n" +
- "G is a raw type. References to generic type G<T2> should be parameterized\n" +
- "----------\n" +
- "15. WARNING in X.java (at line 35)\n" +
- " <T extends G> void d2(T x) {}\n" +
- " ^\n" +
- "G is a raw type. References to generic type G<T2> should be parameterized\n" +
- "----------\n" +
- "16. WARNING in X.java (at line 38)\n" +
- " <T extends G> void e2(T x) {}\n" +
- " ^\n" +
- "G is a raw type. References to generic type G<T2> should be parameterized\n" +
- "----------\n" +
- "17. WARNING in X.java (at line 41)\n" +
- " <T extends G> void f2(T x) {}\n" +
- " ^\n" +
- "G is a raw type. References to generic type G<T2> should be parameterized\n" +
- "----------\n" +
- "18. WARNING in X.java (at line 42)\n" +
- " <S extends F & J> void f2(S x) {}\n" +
- " ^\n" +
- "F is a raw type. References to generic type F<T1> should be parameterized\n" +
- "----------\n" +
- "19. WARNING in X.java (at line 42)\n" +
- " <S extends F & J> void f2(S x) {}\n" +
- " ^\n" +
- "J is a raw type. References to generic type J<T> should be parameterized\n" +
- "----------\n" +
- "20. WARNING in X.java (at line 44)\n" +
- " <T extends G> void g2(T x) {}\n" +
- " ^\n" +
- "G is a raw type. References to generic type G<T2> should be parameterized\n" +
- "----------\n" +
- "21. WARNING in X.java (at line 45)\n" +
- " <S extends F & J<S>> void g2(S x) {}\n" +
- " ^\n" +
- "F is a raw type. References to generic type F<T1> should be parameterized\n" +
- "----------\n" +
- "22. WARNING in X.java (at line 50)\n" +
- " H hraw = null;\n" +
- " ^\n" +
- "H is a raw type. References to generic type H<T3> should be parameterized\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " void a(G x) {}\n" +
+ " ^\n" +
+ "G is a raw type. References to generic type G<T2> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " void b(G x) {}\n" +
+ " ^\n" +
+ "G is a raw type. References to generic type G<T2> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 9)\n" +
+ " void b(F x) {}\n" +
+ " ^\n" +
+ "F is a raw type. References to generic type F<T1> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 11)\n" +
+ " void c(G x) {}\n" +
+ " ^\n" +
+ "G is a raw type. References to generic type G<T2> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 14)\n" +
+ " void d(G x) {}\n" +
+ " ^\n" +
+ "G is a raw type. References to generic type G<T2> should be parameterized\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 17)\n" +
+ " void e(G x) {}\n" +
+ " ^\n" +
+ "G is a raw type. References to generic type G<T2> should be parameterized\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 20)\n" +
+ " void f(G x) {}\n" +
+ " ^\n" +
+ "G is a raw type. References to generic type G<T2> should be parameterized\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 21)\n" +
+ " <S extends F> void f(S x) {}\n" +
+ " ^\n" +
+ "F is a raw type. References to generic type F<T1> should be parameterized\n" +
+ "----------\n" +
+ "9. WARNING in X.java (at line 23)\n" +
+ " void g(G x) {}\n" +
+ " ^\n" +
+ "G is a raw type. References to generic type G<T2> should be parameterized\n" +
+ "----------\n" +
+ "10. WARNING in X.java (at line 24)\n" +
+ " <S extends F & J<S>> void g(S x) {}\n" +
+ " ^\n" +
+ "F is a raw type. References to generic type F<T1> should be parameterized\n" +
+ "----------\n" +
+ "11. WARNING in X.java (at line 26)\n" +
+ " <T extends G> void a2(T x) {}\n" +
+ " ^\n" +
+ "G is a raw type. References to generic type G<T2> should be parameterized\n" +
+ "----------\n" +
+ "12. WARNING in X.java (at line 29)\n" +
+ " <T extends G> void b2(T x) {}\n" +
+ " ^\n" +
+ "G is a raw type. References to generic type G<T2> should be parameterized\n" +
+ "----------\n" +
+ "13. WARNING in X.java (at line 30)\n" +
+ " void b2(F x) {}\n" +
+ " ^\n" +
+ "F is a raw type. References to generic type F<T1> should be parameterized\n" +
+ "----------\n" +
+ "14. WARNING in X.java (at line 32)\n" +
+ " <T extends G> void c2(T x) {}\n" +
+ " ^\n" +
+ "G is a raw type. References to generic type G<T2> should be parameterized\n" +
+ "----------\n" +
+ "15. WARNING in X.java (at line 35)\n" +
+ " <T extends G> void d2(T x) {}\n" +
+ " ^\n" +
+ "G is a raw type. References to generic type G<T2> should be parameterized\n" +
+ "----------\n" +
+ "16. WARNING in X.java (at line 38)\n" +
+ " <T extends G> void e2(T x) {}\n" +
+ " ^\n" +
+ "G is a raw type. References to generic type G<T2> should be parameterized\n" +
+ "----------\n" +
+ "17. WARNING in X.java (at line 41)\n" +
+ " <T extends G> void f2(T x) {}\n" +
+ " ^\n" +
+ "G is a raw type. References to generic type G<T2> should be parameterized\n" +
+ "----------\n" +
+ "18. WARNING in X.java (at line 42)\n" +
+ " <S extends F & J> void f2(S x) {}\n" +
+ " ^\n" +
+ "F is a raw type. References to generic type F<T1> should be parameterized\n" +
+ "----------\n" +
+ "19. WARNING in X.java (at line 42)\n" +
+ " <S extends F & J> void f2(S x) {}\n" +
+ " ^\n" +
+ "J is a raw type. References to generic type J<T> should be parameterized\n" +
+ "----------\n" +
+ "20. WARNING in X.java (at line 44)\n" +
+ " <T extends G> void g2(T x) {}\n" +
+ " ^\n" +
+ "G is a raw type. References to generic type G<T2> should be parameterized\n" +
+ "----------\n" +
+ "21. WARNING in X.java (at line 45)\n" +
+ " <S extends F & J<S>> void g2(S x) {}\n" +
+ " ^\n" +
+ "F is a raw type. References to generic type F<T1> should be parameterized\n" +
+ "----------\n" +
+ "22. WARNING in X.java (at line 50)\n" +
+ " H hraw = null;\n" +
+ " ^\n" +
+ "H is a raw type. References to generic type H<T3> should be parameterized\n" +
+ "----------\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "23. ERROR in X.java (at line 52)\n" +
- " x.a(h);\n" +
- " ^\n" +
- "The method a(G) is ambiguous for the type X\n" +
- "----------\n" +
- "24. ERROR in X.java (at line 53)\n" +
- " x.a(hraw);\n" +
- " ^\n" +
- "The method a(G) is ambiguous for the type X\n" +
- "----------\n" +
- "25. ERROR in X.java (at line 58)\n" +
- " x.c(h);\n" +
- " ^\n" +
- "The method c(G) is ambiguous for the type X\n" +
- "----------\n" +
- "26. ERROR in X.java (at line 59)\n" +
- " x.c(hraw);\n" +
- " ^\n" +
- "The method c(G) is ambiguous for the type X\n" +
- "----------\n" +
- "27. ERROR in X.java (at line 61)\n" +
- " x.d(h);\n" +
- " ^\n" +
- "The method d(G) is ambiguous for the type X\n" +
- "----------\n" +
- "28. ERROR in X.java (at line 62)\n" +
- " x.d(hraw);\n" +
- " ^\n" +
- "The method d(G) is ambiguous for the type X\n" +
- "----------\n" +
- "29. ERROR in X.java (at line 64)\n" +
- " x.e(h);\n" +
- " ^\n" +
- "The method e(G) is ambiguous for the type X\n" +
- "----------\n" +
- "30. ERROR in X.java (at line 65)\n" +
- " x.e(hraw);\n" +
- " ^\n" +
- "The method e(G) is ambiguous for the type X\n" +
- "----------\n" +
- "31. ERROR in X.java (at line 71)\n" +
- " x.g(hraw);\n" +
- " ^\n" +
- "The method g(G) is ambiguous for the type X\n" +
- "----------\n" +
- "32. ERROR in X.java (at line 73)\n" +
- " x.a2(h);\n" +
- " ^^\n" +
- "The method a2(H<C>) is ambiguous for the type X\n" +
- "----------\n" +
- "33. ERROR in X.java (at line 74)\n" +
- " x.a2(hraw);\n" +
- " ^^\n" +
- "The method a2(H) is ambiguous for the type X\n" +
- "----------\n" +
- "34. ERROR in X.java (at line 79)\n" +
- " x.c2(h);\n" +
- " ^^\n" +
- "The method c2(H<C>) is ambiguous for the type X\n" +
- "----------\n" +
- "35. ERROR in X.java (at line 80)\n" +
- " x.c2(hraw);\n" +
- " ^^\n" +
- "The method c2(H) is ambiguous for the type X\n" +
- "----------\n" +
- "36. ERROR in X.java (at line 82)\n" +
- " x.d2(h);\n" +
- " ^^\n" +
- "The method d2(H<C>) is ambiguous for the type X\n" +
- "----------\n" +
- "37. ERROR in X.java (at line 83)\n" +
- " x.d2(hraw);\n" +
- " ^^\n" +
- "The method d2(H) is ambiguous for the type X\n" +
- "----------\n" +
- "38. ERROR in X.java (at line 85)\n" +
- " x.e2(h);\n" +
- " ^^\n" +
- "The method e2(H<C>) is ambiguous for the type X\n" +
- "----------\n" +
- "39. ERROR in X.java (at line 86)\n" +
- " x.e2(hraw);\n" +
- " ^^\n" +
- "The method e2(H) is ambiguous for the type X\n" +
- "----------\n" +
- "40. ERROR in X.java (at line 92)\n" +
- " x.g2(hraw);\n" +
- " ^^\n" +
- "The method g2(H) is ambiguous for the type X\n" +
- "----------\n" +
+ "23. ERROR in X.java (at line 52)\n" +
+ " x.a(h);\n" +
+ " ^\n" +
+ "The method a(G) is ambiguous for the type X\n" +
+ "----------\n" +
+ "24. ERROR in X.java (at line 53)\n" +
+ " x.a(hraw);\n" +
+ " ^\n" +
+ "The method a(G) is ambiguous for the type X\n" +
+ "----------\n" +
+ "25. ERROR in X.java (at line 58)\n" +
+ " x.c(h);\n" +
+ " ^\n" +
+ "The method c(G) is ambiguous for the type X\n" +
+ "----------\n" +
+ "26. ERROR in X.java (at line 59)\n" +
+ " x.c(hraw);\n" +
+ " ^\n" +
+ "The method c(G) is ambiguous for the type X\n" +
+ "----------\n" +
+ "27. ERROR in X.java (at line 61)\n" +
+ " x.d(h);\n" +
+ " ^\n" +
+ "The method d(G) is ambiguous for the type X\n" +
+ "----------\n" +
+ "28. ERROR in X.java (at line 62)\n" +
+ " x.d(hraw);\n" +
+ " ^\n" +
+ "The method d(G) is ambiguous for the type X\n" +
+ "----------\n" +
+ "29. ERROR in X.java (at line 64)\n" +
+ " x.e(h);\n" +
+ " ^\n" +
+ "The method e(G) is ambiguous for the type X\n" +
+ "----------\n" +
+ "30. ERROR in X.java (at line 65)\n" +
+ " x.e(hraw);\n" +
+ " ^\n" +
+ "The method e(G) is ambiguous for the type X\n" +
+ "----------\n" +
+ "31. ERROR in X.java (at line 71)\n" +
+ " x.g(hraw);\n" +
+ " ^\n" +
+ "The method g(G) is ambiguous for the type X\n" +
+ "----------\n" +
+ "32. ERROR in X.java (at line 73)\n" +
+ " x.a2(h);\n" +
+ " ^^\n" +
+ "The method a2(H<C>) is ambiguous for the type X\n" +
+ "----------\n" +
+ "33. ERROR in X.java (at line 74)\n" +
+ " x.a2(hraw);\n" +
+ " ^^\n" +
+ "The method a2(H) is ambiguous for the type X\n" +
+ "----------\n" +
+ "34. ERROR in X.java (at line 79)\n" +
+ " x.c2(h);\n" +
+ " ^^\n" +
+ "The method c2(H<C>) is ambiguous for the type X\n" +
+ "----------\n" +
+ "35. ERROR in X.java (at line 80)\n" +
+ " x.c2(hraw);\n" +
+ " ^^\n" +
+ "The method c2(H) is ambiguous for the type X\n" +
+ "----------\n" +
+ "36. ERROR in X.java (at line 82)\n" +
+ " x.d2(h);\n" +
+ " ^^\n" +
+ "The method d2(H<C>) is ambiguous for the type X\n" +
+ "----------\n" +
+ "37. ERROR in X.java (at line 83)\n" +
+ " x.d2(hraw);\n" +
+ " ^^\n" +
+ "The method d2(H) is ambiguous for the type X\n" +
+ "----------\n" +
+ "38. ERROR in X.java (at line 85)\n" +
+ " x.e2(h);\n" +
+ " ^^\n" +
+ "The method e2(H<C>) is ambiguous for the type X\n" +
+ "----------\n" +
+ "39. ERROR in X.java (at line 86)\n" +
+ " x.e2(hraw);\n" +
+ " ^^\n" +
+ "The method e2(H) is ambiguous for the type X\n" +
+ "----------\n" +
+ "40. ERROR in X.java (at line 92)\n" +
+ " x.g2(hraw);\n" +
+ " ^^\n" +
+ "The method g2(H) is ambiguous for the type X\n" +
+ "----------\n" +
"41. WARNING in X.java (at line 98)\n"
: // fewer ambiguities in 1.8
- "23. ERROR in X.java (at line 61)\n" +
- " x.d(h);\n" +
- " ^\n" +
- "The method d(G) is ambiguous for the type X\n" +
- "----------\n" +
- "24. ERROR in X.java (at line 62)\n" +
- " x.d(hraw);\n" +
- " ^\n" +
- "The method d(G) is ambiguous for the type X\n" +
- "----------\n" +
- "25. ERROR in X.java (at line 64)\n" +
- " x.e(h);\n" +
- " ^\n" +
- "The method e(G) is ambiguous for the type X\n" +
- "----------\n" +
- "26. ERROR in X.java (at line 65)\n" +
- " x.e(hraw);\n" +
- " ^\n" +
- "The method e(G) is ambiguous for the type X\n" +
- "----------\n" +
- "27. ERROR in X.java (at line 82)\n" +
- " x.d2(h);\n" +
- " ^^\n" +
- "The method d2(H<C>) is ambiguous for the type X\n" +
- "----------\n" +
- "28. ERROR in X.java (at line 83)\n" +
- " x.d2(hraw);\n" +
- " ^^\n" +
- "The method d2(H) is ambiguous for the type X\n" +
- "----------\n" +
- "29. ERROR in X.java (at line 85)\n" +
- " x.e2(h);\n" +
- " ^^\n" +
- "The method e2(H<C>) is ambiguous for the type X\n" +
- "----------\n" +
- "30. ERROR in X.java (at line 86)\n" +
- " x.e2(hraw);\n" +
- " ^^\n" +
- "The method e2(H) is ambiguous for the type X\n" +
- "----------\n" +
+ "23. ERROR in X.java (at line 61)\n" +
+ " x.d(h);\n" +
+ " ^\n" +
+ "The method d(G) is ambiguous for the type X\n" +
+ "----------\n" +
+ "24. ERROR in X.java (at line 62)\n" +
+ " x.d(hraw);\n" +
+ " ^\n" +
+ "The method d(G) is ambiguous for the type X\n" +
+ "----------\n" +
+ "25. ERROR in X.java (at line 64)\n" +
+ " x.e(h);\n" +
+ " ^\n" +
+ "The method e(G) is ambiguous for the type X\n" +
+ "----------\n" +
+ "26. ERROR in X.java (at line 65)\n" +
+ " x.e(hraw);\n" +
+ " ^\n" +
+ "The method e(G) is ambiguous for the type X\n" +
+ "----------\n" +
+ "27. ERROR in X.java (at line 82)\n" +
+ " x.d2(h);\n" +
+ " ^^\n" +
+ "The method d2(H<C>) is ambiguous for the type X\n" +
+ "----------\n" +
+ "28. ERROR in X.java (at line 83)\n" +
+ " x.d2(hraw);\n" +
+ " ^^\n" +
+ "The method d2(H) is ambiguous for the type X\n" +
+ "----------\n" +
+ "29. ERROR in X.java (at line 85)\n" +
+ " x.e2(h);\n" +
+ " ^^\n" +
+ "The method e2(H<C>) is ambiguous for the type X\n" +
+ "----------\n" +
+ "30. ERROR in X.java (at line 86)\n" +
+ " x.e2(hraw);\n" +
+ " ^^\n" +
+ "The method e2(H) is ambiguous for the type X\n" +
+ "----------\n" +
"31. WARNING in X.java (at line 98)\n"
) +
- " class C extends B implements I {}\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<T> should be parameterized\n" +
+ " class C extends B implements I {}\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<T> should be parameterized\n" +
"----------\n"
);
}
@@ -1816,77 +1816,77 @@ X.java:4: warning: [unchecked] unchecked method invocation: method pickOne in cl
public void test021() {
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in Y.java (at line 3)\n" +
- " public class Y<V extends String> extends X<V> {\n" +
- " ^^^^^^\n" +
- "The type parameter V should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n" +
- "2. WARNING in Y.java (at line 4)\n" +
- " public static <W extends String> Y<W> make(Class<W> clazz) {\n" +
- " ^^^^^^\n" +
- "The type parameter W should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n" +
- "3. WARNING in Y.java (at line 4)\n" +
- " public static <W extends String> Y<W> make(Class<W> clazz) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in Y.java (at line 3)\n" +
+ " public class Y<V extends String> extends X<V> {\n" +
+ " ^^^^^^\n" +
+ "The type parameter V should not be bounded by the final type String. Final types cannot be further extended\n" +
+ "----------\n" +
+ "2. WARNING in Y.java (at line 4)\n" +
+ " public static <W extends String> Y<W> make(Class<W> clazz) {\n" +
+ " ^^^^^^\n" +
+ "The type parameter W should not be bounded by the final type String. Final types cannot be further extended\n" +
+ "----------\n" +
+ "3. WARNING in Y.java (at line 4)\n" +
+ " public static <W extends String> Y<W> make(Class<W> clazz) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method make(Class<W>) is the same as another method in type Y<V>\n" +
- "----------\n" +
- "4. WARNING in Y.java (at line 8)\n" +
- " public static <U extends Object> X<U> make(Class<U> clazz) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "4. WARNING in Y.java (at line 8)\n" +
+ " public static <U extends Object> X<U> make(Class<U> clazz) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method make(Class<U>) is the same as another method in type Y<V>\n" +
- "----------\n" +
- "5. WARNING in Y.java (at line 13)\n" +
- " Y.make(getClazz());\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation make(Class) of the generic method make(Class<W>) of type Y\n" +
- "----------\n" +
- "6. WARNING in Y.java (at line 13)\n" +
- " Y.make(getClazz());\n" +
- " ^^^^^^^^^^\n" +
- "Type safety: The expression of type Class needs unchecked conversion to conform to Class<String>\n" +
- "----------\n" +
- "7. WARNING in Y.java (at line 15)\n" +
- " public static Class getClazz() {\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in Y.java (at line 13)\n" +
+ " Y.make(getClazz());\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation make(Class) of the generic method make(Class<W>) of type Y\n" +
+ "----------\n" +
+ "6. WARNING in Y.java (at line 13)\n" +
+ " Y.make(getClazz());\n" +
+ " ^^^^^^^^^^\n" +
+ "Type safety: The expression of type Class needs unchecked conversion to conform to Class<String>\n" +
+ "----------\n" +
+ "7. WARNING in Y.java (at line 15)\n" +
+ " public static Class getClazz() {\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
"----------\n":
- "----------\n" +
- "1. WARNING in Y.java (at line 3)\n" +
- " public class Y<V extends String> extends X<V> {\n" +
- " ^^^^^^\n" +
- "The type parameter V should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n" +
- "2. WARNING in Y.java (at line 4)\n" +
- " public static <W extends String> Y<W> make(Class<W> clazz) {\n" +
- " ^^^^^^\n" +
- "The type parameter W should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n" +
- "3. ERROR in Y.java (at line 4)\n" +
- " public static <W extends String> Y<W> make(Class<W> clazz) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in Y.java (at line 3)\n" +
+ " public class Y<V extends String> extends X<V> {\n" +
+ " ^^^^^^\n" +
+ "The type parameter V should not be bounded by the final type String. Final types cannot be further extended\n" +
+ "----------\n" +
+ "2. WARNING in Y.java (at line 4)\n" +
+ " public static <W extends String> Y<W> make(Class<W> clazz) {\n" +
+ " ^^^^^^\n" +
+ "The type parameter W should not be bounded by the final type String. Final types cannot be further extended\n" +
+ "----------\n" +
+ "3. ERROR in Y.java (at line 4)\n" +
+ " public static <W extends String> Y<W> make(Class<W> clazz) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method make(Class<W>) is the same as another method in type Y<V>\n" +
- "----------\n" +
- "4. ERROR in Y.java (at line 8)\n" +
- " public static <U extends Object> X<U> make(Class<U> clazz) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "4. ERROR in Y.java (at line 8)\n" +
+ " public static <U extends Object> X<U> make(Class<U> clazz) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method make(Class<U>) is the same as another method in type Y<V>\n" +
- "----------\n" +
- "5. WARNING in Y.java (at line 13)\n" +
- " Y.make(getClazz());\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation make(Class) of the generic method make(Class<W>) of type Y\n" +
- "----------\n" +
- "6. WARNING in Y.java (at line 13)\n" +
- " Y.make(getClazz());\n" +
- " ^^^^^^^^^^\n" +
- "Type safety: The expression of type Class needs unchecked conversion to conform to Class<String>\n" +
- "----------\n" +
- "7. WARNING in Y.java (at line 15)\n" +
- " public static Class getClazz() {\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in Y.java (at line 13)\n" +
+ " Y.make(getClazz());\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation make(Class) of the generic method make(Class<W>) of type Y\n" +
+ "----------\n" +
+ "6. WARNING in Y.java (at line 13)\n" +
+ " Y.make(getClazz());\n" +
+ " ^^^^^^^^^^\n" +
+ "Type safety: The expression of type Class needs unchecked conversion to conform to Class<String>\n" +
+ "----------\n" +
+ "7. WARNING in Y.java (at line 15)\n" +
+ " public static Class getClazz() {\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -1943,107 +1943,107 @@ X.java:13: warning: [unchecked] unchecked method invocation: method make in clas
public void test022() {
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " class Y<V extends String> extends X<V> {\n" +
- " ^^^^^^\n" +
- "The type parameter V should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " public <W extends String> Y<W> make(Class<W> clazz) {\n" +
- " ^^^^^^\n" +
- "The type parameter W should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 4)\n" +
- " public <W extends String> Y<W> make(Class<W> clazz) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " class Y<V extends String> extends X<V> {\n" +
+ " ^^^^^^\n" +
+ "The type parameter V should not be bounded by the final type String. Final types cannot be further extended\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " public <W extends String> Y<W> make(Class<W> clazz) {\n" +
+ " ^^^^^^\n" +
+ "The type parameter W should not be bounded by the final type String. Final types cannot be further extended\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 4)\n" +
+ " public <W extends String> Y<W> make(Class<W> clazz) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method make(Class<W>) is the same as another method in type Y<V>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 7)\n" +
- " public <U extends Object> X<U> make(Class<U> clazz) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 7)\n" +
+ " public <U extends Object> X<U> make(Class<U> clazz) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method make(Class<U>) is the same as another method in type Y<V>\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 12)\n" +
- " Y y = new Y();\n" +
- " ^\n" +
- "Y is a raw type. References to generic type Y<V> should be parameterized\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 12)\n" +
- " Y y = new Y();\n" +
- " ^\n" +
- "Y is a raw type. References to generic type Y<V> should be parameterized\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 13)\n" +
- " y.make(String.class);\n" +
- " ^^^^\n" +
- "The method make(Class) is ambiguous for the type Y\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 14)\n" +
- " y.make(getClazz());\n" +
- " ^^^^\n" +
- "The method make(Class) is ambiguous for the type Y\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 15)\n" +
- " y.make(getClazz().newInstance().getClass());\n" +
- " ^^^^\n" +
- "The method make(Class) is ambiguous for the type Y\n" +
- "----------\n" +
- "10. WARNING in X.java (at line 17)\n" +
- " public static Class getClazz() {\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 12)\n" +
+ " Y y = new Y();\n" +
+ " ^\n" +
+ "Y is a raw type. References to generic type Y<V> should be parameterized\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 12)\n" +
+ " Y y = new Y();\n" +
+ " ^\n" +
+ "Y is a raw type. References to generic type Y<V> should be parameterized\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 13)\n" +
+ " y.make(String.class);\n" +
+ " ^^^^\n" +
+ "The method make(Class) is ambiguous for the type Y\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 14)\n" +
+ " y.make(getClazz());\n" +
+ " ^^^^\n" +
+ "The method make(Class) is ambiguous for the type Y\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 15)\n" +
+ " y.make(getClazz().newInstance().getClass());\n" +
+ " ^^^^\n" +
+ "The method make(Class) is ambiguous for the type Y\n" +
+ "----------\n" +
+ "10. WARNING in X.java (at line 17)\n" +
+ " public static Class getClazz() {\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
"----------\n":
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " class Y<V extends String> extends X<V> {\n" +
- " ^^^^^^\n" +
- "The type parameter V should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " public <W extends String> Y<W> make(Class<W> clazz) {\n" +
- " ^^^^^^\n" +
- "The type parameter W should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " public <W extends String> Y<W> make(Class<W> clazz) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " class Y<V extends String> extends X<V> {\n" +
+ " ^^^^^^\n" +
+ "The type parameter V should not be bounded by the final type String. Final types cannot be further extended\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " public <W extends String> Y<W> make(Class<W> clazz) {\n" +
+ " ^^^^^^\n" +
+ "The type parameter W should not be bounded by the final type String. Final types cannot be further extended\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " public <W extends String> Y<W> make(Class<W> clazz) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method make(Class<W>) is the same as another method in type Y<V>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " public <U extends Object> X<U> make(Class<U> clazz) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " public <U extends Object> X<U> make(Class<U> clazz) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method make(Class<U>) is the same as another method in type Y<V>\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 12)\n" +
- " Y y = new Y();\n" +
- " ^\n" +
- "Y is a raw type. References to generic type Y<V> should be parameterized\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 12)\n" +
- " Y y = new Y();\n" +
- " ^\n" +
- "Y is a raw type. References to generic type Y<V> should be parameterized\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 13)\n" +
- " y.make(String.class);\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method make(Class) belongs to the raw type Y. References to generic type Y<V> should be parameterized\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 14)\n" +
- " y.make(getClazz());\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method make(Class) belongs to the raw type Y. References to generic type Y<V> should be parameterized\n" +
- "----------\n" +
- "9. WARNING in X.java (at line 15)\n" +
- " y.make(getClazz().newInstance().getClass());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method make(Class) belongs to the raw type Y. References to generic type Y<V> should be parameterized\n" +
- "----------\n" +
- "10. WARNING in X.java (at line 17)\n" +
- " public static Class getClazz() {\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 12)\n" +
+ " Y y = new Y();\n" +
+ " ^\n" +
+ "Y is a raw type. References to generic type Y<V> should be parameterized\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 12)\n" +
+ " Y y = new Y();\n" +
+ " ^\n" +
+ "Y is a raw type. References to generic type Y<V> should be parameterized\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 13)\n" +
+ " y.make(String.class);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method make(Class) belongs to the raw type Y. References to generic type Y<V> should be parameterized\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 14)\n" +
+ " y.make(getClazz());\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method make(Class) belongs to the raw type Y. References to generic type Y<V> should be parameterized\n" +
+ "----------\n" +
+ "9. WARNING in X.java (at line 15)\n" +
+ " y.make(getClazz().newInstance().getClass());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method make(Class) belongs to the raw type Y. References to generic type Y<V> should be parameterized\n" +
+ "----------\n" +
+ "10. WARNING in X.java (at line 17)\n" +
+ " public static Class getClazz() {\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -2729,36 +2729,36 @@ public void test051() {
"}\n"
},
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " bar(new Z());\n" +
- " ^^^\n" +
- "The method bar(X.Z) is ambiguous for the type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 13)\n" +
- " private static final class Z implements I {\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<T> should be parameterized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " bar(new Z());\n" +
+ " ^^^\n" +
+ "The method bar(X.Z) is ambiguous for the type X\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 13)\n" +
+ " private static final class Z implements I {\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<T> should be parameterized\n" +
"----------\n"
: this.complianceLevel < ClassFileConstants.JDK11 ?
// in 1.8 bar(Z) is recognized as being more specific than bar(I<#RAW>)
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " bar(new Z());\n" +
- " ^^^^^^^\n" +
- "Access to enclosing constructor X.Z() is emulated by a synthetic accessor method\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 13)\n" +
- " private static final class Z implements I {\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<T> should be parameterized\n" +
- "----------\n"
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " bar(new Z());\n" +
+ " ^^^^^^^\n" +
+ "Access to enclosing constructor X.Z() is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 13)\n" +
+ " private static final class Z implements I {\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<T> should be parameterized\n" +
+ "----------\n"
:
- "----------\n" +
- "1. WARNING in X.java (at line 13)\n" +
- " private static final class Z implements I {\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 13)\n" +
+ " private static final class Z implements I {\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<T> should be parameterized\n" +
"----------\n"));
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=166355
@@ -2811,35 +2811,35 @@ public void test053() {
"}\n"
},
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " bar(new Z(){});\n" +
- " ^^^\n" +
- "The method bar(X.Z) is ambiguous for the type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 13)\n" +
- " private static class Z implements I {\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<T> should be parameterized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " bar(new Z(){});\n" +
+ " ^^^\n" +
+ "The method bar(X.Z) is ambiguous for the type X\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 13)\n" +
+ " private static class Z implements I {\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<T> should be parameterized\n" +
"----------\n"
: this.complianceLevel < ClassFileConstants.JDK11 ?
// in 1.8 bar(Z) is recognized as being more specific than bar(I<#RAW>)
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " bar(new Z(){});\n" +
- " ^^^\n" +
- "Access to enclosing constructor X.Z() is emulated by a synthetic accessor method\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 13)\n" +
- " private static class Z implements I {\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " bar(new Z(){});\n" +
+ " ^^^\n" +
+ "Access to enclosing constructor X.Z() is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 13)\n" +
+ " private static class Z implements I {\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<T> should be parameterized\n" +
"----------\n" :
- "----------\n" +
- "1. WARNING in X.java (at line 13)\n" +
- " private static class Z implements I {\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 13)\n" +
+ " private static class Z implements I {\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<T> should be parameterized\n" +
"----------\n"));
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=166355
@@ -3508,7 +3508,7 @@ public void test073() {
public void test074() {
this.runNegativeTest(
false /* skipJavac */,
- this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ this.complianceLevel < ClassFileConstants.JDK1_8 ?
null : JavacTestOptions.EclipseHasABug.EclipseBug427719,
new String[] {
"Y.java",
@@ -3566,88 +3566,88 @@ public void test074() {
"public class Y {}\n"
},
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. WARNING in Y.java (at line 3)\n" +
- " void a(I x) {}\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in Y.java (at line 9)\n" +
- " class C extends B implements I {\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<T> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in Y.java (at line 19)\n" +
- " b(new C());\n" +
- " ^\n" +
- "The method b(C) is ambiguous for the type D\n" +
- "----------\n" +
- "4. ERROR in Y.java (at line 20)\n" +
- " b(new D());\n" +
- " ^\n" +
- "The method b(C) is ambiguous for the type D\n" +
- "----------\n" +
- "5. ERROR in Y.java (at line 21)\n" +
- " b(new C[0]);\n" +
- " ^\n" +
- "The method b(C[]) is ambiguous for the type D\n" +
- "----------\n" +
- "6. ERROR in Y.java (at line 22)\n" +
- " b(new D[0]);\n" +
- " ^\n" +
- "The method b(C[]) is ambiguous for the type D\n" +
- "----------\n" +
- "7. ERROR in Y.java (at line 23)\n" +
- " c(new C());\n" +
- " ^\n" +
- "The method c(C) is ambiguous for the type D\n" +
- "----------\n" +
- "8. ERROR in Y.java (at line 24)\n" +
- " c(new D());\n" +
- " ^\n" +
- "The method c(C) is ambiguous for the type D\n" +
- "----------\n" +
- "9. WARNING in Y.java (at line 28)\n" +
- " void a(I x) {}\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<T> should be parameterized\n" +
- "----------\n" +
- "10. WARNING in Y.java (at line 33)\n" +
- " class B2 extends A2 {}\n" +
- " ^^\n" +
- "A2 is a raw type. References to generic type A2<T> should be parameterized\n" +
- "----------\n" +
- "11. WARNING in Y.java (at line 34)\n" +
- " class C2 extends B2 implements I {\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in Y.java (at line 3)\n" +
+ " void a(I x) {}\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in Y.java (at line 9)\n" +
+ " class C extends B implements I {\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<T> should be parameterized\n" +
+ "----------\n" +
+ "3. ERROR in Y.java (at line 19)\n" +
+ " b(new C());\n" +
+ " ^\n" +
+ "The method b(C) is ambiguous for the type D\n" +
+ "----------\n" +
+ "4. ERROR in Y.java (at line 20)\n" +
+ " b(new D());\n" +
+ " ^\n" +
+ "The method b(C) is ambiguous for the type D\n" +
+ "----------\n" +
+ "5. ERROR in Y.java (at line 21)\n" +
+ " b(new C[0]);\n" +
+ " ^\n" +
+ "The method b(C[]) is ambiguous for the type D\n" +
+ "----------\n" +
+ "6. ERROR in Y.java (at line 22)\n" +
+ " b(new D[0]);\n" +
+ " ^\n" +
+ "The method b(C[]) is ambiguous for the type D\n" +
+ "----------\n" +
+ "7. ERROR in Y.java (at line 23)\n" +
+ " c(new C());\n" +
+ " ^\n" +
+ "The method c(C) is ambiguous for the type D\n" +
+ "----------\n" +
+ "8. ERROR in Y.java (at line 24)\n" +
+ " c(new D());\n" +
+ " ^\n" +
+ "The method c(C) is ambiguous for the type D\n" +
+ "----------\n" +
+ "9. WARNING in Y.java (at line 28)\n" +
+ " void a(I x) {}\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<T> should be parameterized\n" +
+ "----------\n" +
+ "10. WARNING in Y.java (at line 33)\n" +
+ " class B2 extends A2 {}\n" +
+ " ^^\n" +
+ "A2 is a raw type. References to generic type A2<T> should be parameterized\n" +
+ "----------\n" +
+ "11. WARNING in Y.java (at line 34)\n" +
+ " class C2 extends B2 implements I {\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<T> should be parameterized\n" +
"----------\n"
: // no ambiguities in 1.8
- "----------\n" +
- "1. WARNING in Y.java (at line 3)\n" +
- " void a(I x) {}\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in Y.java (at line 9)\n" +
- " class C extends B implements I {\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in Y.java (at line 28)\n" +
- " void a(I x) {}\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<T> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in Y.java (at line 33)\n" +
- " class B2 extends A2 {}\n" +
- " ^^\n" +
- "A2 is a raw type. References to generic type A2<T> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in Y.java (at line 34)\n" +
- " class C2 extends B2 implements I {\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in Y.java (at line 3)\n" +
+ " void a(I x) {}\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in Y.java (at line 9)\n" +
+ " class C extends B implements I {\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in Y.java (at line 28)\n" +
+ " void a(I x) {}\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<T> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in Y.java (at line 33)\n" +
+ " class B2 extends A2 {}\n" +
+ " ^^\n" +
+ "A2 is a raw type. References to generic type A2<T> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in Y.java (at line 34)\n" +
+ " class C2 extends B2 implements I {\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<T> should be parameterized\n" +
"----------\n")
);
}
@@ -3667,16 +3667,16 @@ public void test075() {
" int test(Double val) { return x(val); }\n" +
"}"
},
- "----------\n" +
- "1. WARNING in C.java (at line 1)\n" +
- " abstract class A<T extends Comparable> {\n" +
- " ^^^^^^^^^^\n" +
- "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in C.java (at line 4)\n" +
- " class B<T extends Comparable> extends A<T> {\n" +
- " ^^^^^^^^^^\n" +
- "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in C.java (at line 1)\n" +
+ " abstract class A<T extends Comparable> {\n" +
+ " ^^^^^^^^^^\n" +
+ "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in C.java (at line 4)\n" +
+ " class B<T extends Comparable> extends A<T> {\n" +
+ " ^^^^^^^^^^\n" +
+ "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
"----------\n"
);
}
@@ -3685,207 +3685,207 @@ public void test075() {
// See that this test case exhibits the bug 345947
public void test076() {
String output = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " <U> J<String> b();\n" +
- " ^^^\n" +
- "Name clash: The method b() of type J<E> has the same erasure as b() of type I<E> but does not override it\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 15)\n" +
- " J<Integer> b = ints.a();\n" +
- " ^^^^^^^^\n" +
- "Type mismatch: cannot convert from J<String> to J<Integer>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 16)\n" +
- " J<Object> c = ints.a();\n" +
- " ^^^^^^^^\n" +
- "Type mismatch: cannot convert from J<String> to J<Object>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 17)\n" +
- " J d = ints.a();\n" +
- " ^\n" +
- "J is a raw type. References to generic type J<E> should be parameterized\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 19)\n" +
- " I<Integer> f = ints.a();\n" +
- " ^^^^^^^^\n" +
- "Type mismatch: cannot convert from J<String> to I<Integer>\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 20)\n" +
- " I<Object> g = ints.a();\n" +
- " ^^^^^^^^\n" +
- "Type mismatch: cannot convert from J<String> to I<Object>\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 21)\n" +
- " I h = ints.a();\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<E> should be parameterized\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 24)\n" +
- " ints.b();\n" +
- " ^\n" +
- "The method b() is ambiguous for the type J<Integer>\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 25)\n" +
- " J<String> a = ints.b();\n" +
- " ^\n" +
- "The method b() is ambiguous for the type J<Integer>\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 26)\n" +
- " J<Integer> b = ints.b();\n" +
- " ^\n" +
- "The method b() is ambiguous for the type J<Integer>\n" +
- "----------\n" +
- "11. ERROR in X.java (at line 27)\n" +
- " J<Object> c = ints.b();\n" +
- " ^\n" +
- "The method b() is ambiguous for the type J<Integer>\n" +
- "----------\n" +
- "12. WARNING in X.java (at line 28)\n" +
- " J d = ints.b();\n" +
- " ^\n" +
- "J is a raw type. References to generic type J<E> should be parameterized\n" +
- "----------\n" +
- "13. ERROR in X.java (at line 28)\n" +
- " J d = ints.b();\n" +
- " ^\n" +
- "The method b() is ambiguous for the type J<Integer>\n" +
- "----------\n" +
- "14. ERROR in X.java (at line 29)\n" +
- " I<String> e = ints.b();\n" +
- " ^\n" +
- "The method b() is ambiguous for the type J<Integer>\n" +
- "----------\n" +
- "15. ERROR in X.java (at line 30)\n" +
- " I<Integer> f = ints.b();\n" +
- " ^\n" +
- "The method b() is ambiguous for the type J<Integer>\n" +
- "----------\n" +
- "16. ERROR in X.java (at line 31)\n" +
- " I<Object> g = ints.b();\n" +
- " ^\n" +
- "The method b() is ambiguous for the type J<Integer>\n" +
- "----------\n" +
- "17. WARNING in X.java (at line 32)\n" +
- " I h = ints.b();\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<E> should be parameterized\n" +
- "----------\n" +
- "18. ERROR in X.java (at line 32)\n" +
- " I h = ints.b();\n" +
- " ^\n" +
- "The method b() is ambiguous for the type J<Integer>\n" +
- "----------\n" +
- "19. WARNING in X.java (at line 39)\n" +
- " J d = ints.c();\n" +
- " ^\n" +
- "J is a raw type. References to generic type J<E> should be parameterized\n" +
- "----------\n" +
- "20. WARNING in X.java (at line 43)\n" +
- " I h = ints.c();\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<E> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " <U> J<String> b();\n" +
+ " ^^^\n" +
+ "Name clash: The method b() of type J<E> has the same erasure as b() of type I<E> but does not override it\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 15)\n" +
+ " J<Integer> b = ints.a();\n" +
+ " ^^^^^^^^\n" +
+ "Type mismatch: cannot convert from J<String> to J<Integer>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 16)\n" +
+ " J<Object> c = ints.a();\n" +
+ " ^^^^^^^^\n" +
+ "Type mismatch: cannot convert from J<String> to J<Object>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 17)\n" +
+ " J d = ints.a();\n" +
+ " ^\n" +
+ "J is a raw type. References to generic type J<E> should be parameterized\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 19)\n" +
+ " I<Integer> f = ints.a();\n" +
+ " ^^^^^^^^\n" +
+ "Type mismatch: cannot convert from J<String> to I<Integer>\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 20)\n" +
+ " I<Object> g = ints.a();\n" +
+ " ^^^^^^^^\n" +
+ "Type mismatch: cannot convert from J<String> to I<Object>\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 21)\n" +
+ " I h = ints.a();\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<E> should be parameterized\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 24)\n" +
+ " ints.b();\n" +
+ " ^\n" +
+ "The method b() is ambiguous for the type J<Integer>\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 25)\n" +
+ " J<String> a = ints.b();\n" +
+ " ^\n" +
+ "The method b() is ambiguous for the type J<Integer>\n" +
+ "----------\n" +
+ "10. ERROR in X.java (at line 26)\n" +
+ " J<Integer> b = ints.b();\n" +
+ " ^\n" +
+ "The method b() is ambiguous for the type J<Integer>\n" +
+ "----------\n" +
+ "11. ERROR in X.java (at line 27)\n" +
+ " J<Object> c = ints.b();\n" +
+ " ^\n" +
+ "The method b() is ambiguous for the type J<Integer>\n" +
+ "----------\n" +
+ "12. WARNING in X.java (at line 28)\n" +
+ " J d = ints.b();\n" +
+ " ^\n" +
+ "J is a raw type. References to generic type J<E> should be parameterized\n" +
+ "----------\n" +
+ "13. ERROR in X.java (at line 28)\n" +
+ " J d = ints.b();\n" +
+ " ^\n" +
+ "The method b() is ambiguous for the type J<Integer>\n" +
+ "----------\n" +
+ "14. ERROR in X.java (at line 29)\n" +
+ " I<String> e = ints.b();\n" +
+ " ^\n" +
+ "The method b() is ambiguous for the type J<Integer>\n" +
+ "----------\n" +
+ "15. ERROR in X.java (at line 30)\n" +
+ " I<Integer> f = ints.b();\n" +
+ " ^\n" +
+ "The method b() is ambiguous for the type J<Integer>\n" +
+ "----------\n" +
+ "16. ERROR in X.java (at line 31)\n" +
+ " I<Object> g = ints.b();\n" +
+ " ^\n" +
+ "The method b() is ambiguous for the type J<Integer>\n" +
+ "----------\n" +
+ "17. WARNING in X.java (at line 32)\n" +
+ " I h = ints.b();\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<E> should be parameterized\n" +
+ "----------\n" +
+ "18. ERROR in X.java (at line 32)\n" +
+ " I h = ints.b();\n" +
+ " ^\n" +
+ "The method b() is ambiguous for the type J<Integer>\n" +
+ "----------\n" +
+ "19. WARNING in X.java (at line 39)\n" +
+ " J d = ints.c();\n" +
+ " ^\n" +
+ "J is a raw type. References to generic type J<E> should be parameterized\n" +
+ "----------\n" +
+ "20. WARNING in X.java (at line 43)\n" +
+ " I h = ints.c();\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<E> should be parameterized\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " <U> J<String> b();\n" +
- " ^^^\n" +
- "Name clash: The method b() of type J<E> has the same erasure as b() of type I<E> but does not override it\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 15)\n" +
- " J<Integer> b = ints.a();\n" +
- " ^^^^^^^^\n" +
- "Type mismatch: cannot convert from J<String> to J<Integer>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 16)\n" +
- " J<Object> c = ints.a();\n" +
- " ^^^^^^^^\n" +
- "Type mismatch: cannot convert from J<String> to J<Object>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 17)\n" +
- " J d = ints.a();\n" +
- " ^\n" +
- "J is a raw type. References to generic type J<E> should be parameterized\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 19)\n" +
- " I<Integer> f = ints.a();\n" +
- " ^^^^^^^^\n" +
- "Type mismatch: cannot convert from J<String> to I<Integer>\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 20)\n" +
- " I<Object> g = ints.a();\n" +
- " ^^^^^^^^\n" +
- "Type mismatch: cannot convert from J<String> to I<Object>\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 21)\n" +
- " I h = ints.a();\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<E> should be parameterized\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 24)\n" +
- " ints.b();\n" +
- " ^\n" +
- "The method b() is ambiguous for the type J<Integer>\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 25)\n" +
- " J<String> a = ints.b();\n" +
- " ^\n" +
- "The method b() is ambiguous for the type J<Integer>\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 26)\n" +
- " J<Integer> b = ints.b();\n" +
- " ^\n" +
- "The method b() is ambiguous for the type J<Integer>\n" +
- "----------\n" +
- "11. ERROR in X.java (at line 27)\n" +
- " J<Object> c = ints.b();\n" +
- " ^\n" +
- "The method b() is ambiguous for the type J<Integer>\n" +
- "----------\n" +
- "12. WARNING in X.java (at line 28)\n" +
- " J d = ints.b();\n" +
- " ^\n" +
- "J is a raw type. References to generic type J<E> should be parameterized\n" +
- "----------\n" +
- "13. ERROR in X.java (at line 28)\n" +
- " J d = ints.b();\n" +
- " ^\n" +
- "The method b() is ambiguous for the type J<Integer>\n" +
- "----------\n" +
- "14. ERROR in X.java (at line 29)\n" +
- " I<String> e = ints.b();\n" +
- " ^\n" +
- "The method b() is ambiguous for the type J<Integer>\n" +
- "----------\n" +
- "15. ERROR in X.java (at line 30)\n" +
- " I<Integer> f = ints.b();\n" +
- " ^\n" +
- "The method b() is ambiguous for the type J<Integer>\n" +
- "----------\n" +
- "16. ERROR in X.java (at line 31)\n" +
- " I<Object> g = ints.b();\n" +
- " ^\n" +
- "The method b() is ambiguous for the type J<Integer>\n" +
- "----------\n" +
- "17. WARNING in X.java (at line 32)\n" +
- " I h = ints.b();\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<E> should be parameterized\n" +
- "----------\n" +
- "18. ERROR in X.java (at line 32)\n" +
- " I h = ints.b();\n" +
- " ^\n" +
- "The method b() is ambiguous for the type J<Integer>\n" +
- "----------\n" +
- "19. WARNING in X.java (at line 39)\n" +
- " J d = ints.c();\n" +
- " ^\n" +
- "J is a raw type. References to generic type J<E> should be parameterized\n" +
- "----------\n" +
- "20. WARNING in X.java (at line 43)\n" +
- " I h = ints.c();\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<E> should be parameterized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " <U> J<String> b();\n" +
+ " ^^^\n" +
+ "Name clash: The method b() of type J<E> has the same erasure as b() of type I<E> but does not override it\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 15)\n" +
+ " J<Integer> b = ints.a();\n" +
+ " ^^^^^^^^\n" +
+ "Type mismatch: cannot convert from J<String> to J<Integer>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 16)\n" +
+ " J<Object> c = ints.a();\n" +
+ " ^^^^^^^^\n" +
+ "Type mismatch: cannot convert from J<String> to J<Object>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 17)\n" +
+ " J d = ints.a();\n" +
+ " ^\n" +
+ "J is a raw type. References to generic type J<E> should be parameterized\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 19)\n" +
+ " I<Integer> f = ints.a();\n" +
+ " ^^^^^^^^\n" +
+ "Type mismatch: cannot convert from J<String> to I<Integer>\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 20)\n" +
+ " I<Object> g = ints.a();\n" +
+ " ^^^^^^^^\n" +
+ "Type mismatch: cannot convert from J<String> to I<Object>\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 21)\n" +
+ " I h = ints.a();\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<E> should be parameterized\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 24)\n" +
+ " ints.b();\n" +
+ " ^\n" +
+ "The method b() is ambiguous for the type J<Integer>\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 25)\n" +
+ " J<String> a = ints.b();\n" +
+ " ^\n" +
+ "The method b() is ambiguous for the type J<Integer>\n" +
+ "----------\n" +
+ "10. ERROR in X.java (at line 26)\n" +
+ " J<Integer> b = ints.b();\n" +
+ " ^\n" +
+ "The method b() is ambiguous for the type J<Integer>\n" +
+ "----------\n" +
+ "11. ERROR in X.java (at line 27)\n" +
+ " J<Object> c = ints.b();\n" +
+ " ^\n" +
+ "The method b() is ambiguous for the type J<Integer>\n" +
+ "----------\n" +
+ "12. WARNING in X.java (at line 28)\n" +
+ " J d = ints.b();\n" +
+ " ^\n" +
+ "J is a raw type. References to generic type J<E> should be parameterized\n" +
+ "----------\n" +
+ "13. ERROR in X.java (at line 28)\n" +
+ " J d = ints.b();\n" +
+ " ^\n" +
+ "The method b() is ambiguous for the type J<Integer>\n" +
+ "----------\n" +
+ "14. ERROR in X.java (at line 29)\n" +
+ " I<String> e = ints.b();\n" +
+ " ^\n" +
+ "The method b() is ambiguous for the type J<Integer>\n" +
+ "----------\n" +
+ "15. ERROR in X.java (at line 30)\n" +
+ " I<Integer> f = ints.b();\n" +
+ " ^\n" +
+ "The method b() is ambiguous for the type J<Integer>\n" +
+ "----------\n" +
+ "16. ERROR in X.java (at line 31)\n" +
+ " I<Object> g = ints.b();\n" +
+ " ^\n" +
+ "The method b() is ambiguous for the type J<Integer>\n" +
+ "----------\n" +
+ "17. WARNING in X.java (at line 32)\n" +
+ " I h = ints.b();\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<E> should be parameterized\n" +
+ "----------\n" +
+ "18. ERROR in X.java (at line 32)\n" +
+ " I h = ints.b();\n" +
+ " ^\n" +
+ "The method b() is ambiguous for the type J<Integer>\n" +
+ "----------\n" +
+ "19. WARNING in X.java (at line 39)\n" +
+ " J d = ints.c();\n" +
+ " ^\n" +
+ "J is a raw type. References to generic type J<E> should be parameterized\n" +
+ "----------\n" +
+ "20. WARNING in X.java (at line 43)\n" +
+ " I h = ints.c();\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<E> should be parameterized\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -3981,21 +3981,21 @@ public void test078() {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " x.b(null);\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " x.b(null);\n" +
+ " ^\n" +
+ "The method b(Number) is ambiguous for the type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 13)\n" +
+ " x.<Integer>b(null);\n" +
+ " ^\n" +
+ "The method b(Integer) is ambiguous for the type X\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 14)\n" +
+ " x.c(null);\n" +
" ^\n" +
- "The method b(Number) is ambiguous for the type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " x.<Integer>b(null);\n" +
- " ^\n" +
- "The method b(Integer) is ambiguous for the type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 14)\n" +
- " x.c(null);\n" +
- " ^\n" +
- "The method c(String) is ambiguous for the type X\n" +
+ "The method c(String) is ambiguous for the type X\n" +
"----------\n"
);
}
@@ -4022,16 +4022,16 @@ public void test079() {
" void y(Two t) { t.y(); }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " <T extends A> I<T> x() throws IllegalAccessError;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method x() of type Two has the same erasure as x() of type One but does not override it\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " I<B> y() throws IllegalAccessError;\n" +
- " ^\n" +
- "Type safety: The return type I<B> for y() from the type Two needs unchecked conversion to conform to I<A> from the type One\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " <T extends A> I<T> x() throws IllegalAccessError;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method x() of type Two has the same erasure as x() of type One but does not override it\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " I<B> y() throws IllegalAccessError;\n" +
+ " ^\n" +
+ "Type safety: The return type I<B> for y() from the type Two needs unchecked conversion to conform to I<A> from the type One\n" +
"----------\n"
);
}
@@ -4396,7 +4396,7 @@ public void test087() {
"1. ERROR in X.java (at line 6)\n" +
" static { with(null); }\n" +
" ^^^^\n" +
- "The method with(List<? extends Object>) is ambiguous for the type X\n" +
+ "The method with(List<? extends Object>) is ambiguous for the type X\n" +
"----------\n"
);
} else {
@@ -4415,16 +4415,16 @@ public void test088a() {
" double foo() { return 0.0; }\n" +
"} \n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " int foo () { return 0; } \n" +
- " ^^^^^^\n" +
- "Duplicate method foo() in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " double foo() { return 0.0; }\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " int foo () { return 0; } \n" +
+ " ^^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " double foo() { return 0.0; }\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
"----------\n"
);
}
@@ -4438,16 +4438,16 @@ public void test088b() {
" double foo();\n" +
"} \n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " int foo (); \n" +
- " ^^^^^^\n" +
- "Duplicate method foo() in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " double foo();\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " int foo (); \n" +
+ " ^^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " double foo();\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
"----------\n"
);
}
@@ -4462,16 +4462,16 @@ public void test089() {
" double m2(List<Integer> b) {return 0.0;}\n" +
"} \n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " int m2(List<Integer> a) {return 0;} \n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate method m2(List<Integer>) in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " double m2(List<Integer> b) {return 0.0;}\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate method m2(List<Integer>) in type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " int m2(List<Integer> a) {return 0;} \n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate method m2(List<Integer>) in type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " double m2(List<Integer> b) {return 0.0;}\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate method m2(List<Integer>) in type X\n" +
"----------\n"
);
}
@@ -4479,24 +4479,24 @@ public void testBug426521() {
runNegativeTest(
new String[] {
"Test.java",
- "import java.util.List;\n" +
- "\n" +
- "class Test {\n" +
- " <U> void m(List<U> l, U v) { }\n" +
- "\n" +
- " <V> void m(List<V> l1, List<V> l2) { }\n" +
- "\n" +
- " void test(List<Object> l) {\n" +
- " m(l, l); //JDK 6/7 give ambiguity here - EJC compiles ok\n" +
- " }\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "class Test {\n" +
+ " <U> void m(List<U> l, U v) { }\n" +
+ "\n" +
+ " <V> void m(List<V> l1, List<V> l2) { }\n" +
+ "\n" +
+ " void test(List<Object> l) {\n" +
+ " m(l, l); //JDK 6/7 give ambiguity here - EJC compiles ok\n" +
+ " }\n" +
"}\n"
},
this.complianceLevel < ClassFileConstants.JDK1_8 ? "" :
- "----------\n" +
- "1. ERROR in Test.java (at line 9)\n" +
- " m(l, l); //JDK 6/7 give ambiguity here - EJC compiles ok\n" +
- " ^\n" +
- "The method m(List<Object>, Object) is ambiguous for the type Test\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 9)\n" +
+ " m(l, l); //JDK 6/7 give ambiguity here - EJC compiles ok\n" +
+ " ^\n" +
+ "The method m(List<Object>, Object) is ambiguous for the type Test\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428845
@@ -4504,32 +4504,32 @@ public void testBug428845() {
runNegativeTest(
new String[] {
"AmbiguousTest.java",
- "import java.io.File;\n" +
- "public class AmbiguousTest {\n" +
- " static interface IInterface {\n" +
- " public void method(File file);\n" +
- " }\n" +
- " static abstract class AbstractClass implements IInterface {\n" +
- " public void method(File file) {\n" +
- " System.err.println(\"file\");\n" +
- " }\n" +
- " public void method(String string) {\n" +
- " System.err.println(\"string\");\n" +
- " }\n" +
- " }\n" +
- " private static AbstractClass newAbstractClass() {\n" +
- " return new AbstractClass() {};\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " newAbstractClass().method(null);\n" +
- " }\n" +
+ "import java.io.File;\n" +
+ "public class AmbiguousTest {\n" +
+ " static interface IInterface {\n" +
+ " public void method(File file);\n" +
+ " }\n" +
+ " static abstract class AbstractClass implements IInterface {\n" +
+ " public void method(File file) {\n" +
+ " System.err.println(\"file\");\n" +
+ " }\n" +
+ " public void method(String string) {\n" +
+ " System.err.println(\"string\");\n" +
+ " }\n" +
+ " }\n" +
+ " private static AbstractClass newAbstractClass() {\n" +
+ " return new AbstractClass() {};\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " newAbstractClass().method(null);\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in AmbiguousTest.java (at line 18)\n" +
- " newAbstractClass().method(null);\n" +
- " ^^^^^^\n" +
- "The method method(File) is ambiguous for the type AmbiguousTest.AbstractClass\n" +
+ "----------\n" +
+ "1. ERROR in AmbiguousTest.java (at line 18)\n" +
+ " newAbstractClass().method(null);\n" +
+ " ^^^^^^\n" +
+ "The method method(File) is ambiguous for the type AmbiguousTest.AbstractClass\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=458563 - invalid ambiguous method error on Java 8 that isn't seen on Java 7 (or with javac)
@@ -4537,18 +4537,18 @@ public void testBug458563() {
runConformTest(
new String[] {
"X.java",
- "interface IStoredNode<T> extends INodeHandle<DocumentImpl>, NodeHandle { }\n" +
- "interface NodeHandle extends INodeHandle<DocumentImpl> { }\n" +
- "class DocumentImpl implements INodeHandle<DocumentImpl> {\n" +
- " public Object getNodeId() {return null;}\n" +
- "}\n" +
- "interface INodeHandle<D> {\n" +
- " public Object getNodeId();\n" +
- "}\n" +
- "public class X {\n" +
- " public void foo(IStoredNode bar) {\n" +
- " bar.getNodeId();\n" +
- " }\n" +
+ "interface IStoredNode<T> extends INodeHandle<DocumentImpl>, NodeHandle { }\n" +
+ "interface NodeHandle extends INodeHandle<DocumentImpl> { }\n" +
+ "class DocumentImpl implements INodeHandle<DocumentImpl> {\n" +
+ " public Object getNodeId() {return null;}\n" +
+ "}\n" +
+ "interface INodeHandle<D> {\n" +
+ " public Object getNodeId();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public void foo(IStoredNode bar) {\n" +
+ " bar.getNodeId();\n" +
+ " }\n" +
"}"
});
}
@@ -4557,18 +4557,18 @@ public void testBug458563a() {
runConformTest(
new String[] {
"X.java",
- "interface IStoredNode<T> extends INodeHandle<DocumentImpl>, NodeHandle { }\n" +
- "interface NodeHandle extends INodeHandle<DocumentImpl> { }\n" +
- "class DocumentImpl implements INodeHandle<DocumentImpl> {\n" +
- " public Object getNodeId() {return null;}\n" +
- "}\n" +
- "interface INodeHandle<D> {\n" +
- " public Object getNodeId();\n" +
- "}\n" +
- "public class X {\n" +
- " public void foo(IStoredNode<?> bar) {\n" +
- " bar.getNodeId();\n" +
- " }\n" +
+ "interface IStoredNode<T> extends INodeHandle<DocumentImpl>, NodeHandle { }\n" +
+ "interface NodeHandle extends INodeHandle<DocumentImpl> { }\n" +
+ "class DocumentImpl implements INodeHandle<DocumentImpl> {\n" +
+ " public Object getNodeId() {return null;}\n" +
+ "}\n" +
+ "interface INodeHandle<D> {\n" +
+ " public Object getNodeId();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public void foo(IStoredNode<?> bar) {\n" +
+ " bar.getNodeId();\n" +
+ " }\n" +
"}"
});
}
@@ -4577,28 +4577,28 @@ public void testBug466730() {
runConformTest(
new String[] {
"bug/Base.java",
- "package bug;\n" +
- "public class Base {\n" +
- " public static Object works() {\n" +
- " throw new IllegalStateException();\n" +
- " }\n" +
- " public static <T> T fails() {\n" +
- " throw new IllegalStateException();\n" +
- " }\n" +
+ "package bug;\n" +
+ "public class Base {\n" +
+ " public static Object works() {\n" +
+ " throw new IllegalStateException();\n" +
+ " }\n" +
+ " public static <T> T fails() {\n" +
+ " throw new IllegalStateException();\n" +
+ " }\n" +
"}\n",
"bug/Derived.java",
- "package bug;\n" +
+ "package bug;\n" +
"public class Derived extends Base {}\n",
"bug/StaticImportBug.java",
- "package bug;\n" +
- "import static bug.Base.*;\n" +
- "import static bug.Derived.*;\n" +
- "public class StaticImportBug {\n" +
- " void m() {\n" +
- " java.util.Objects.requireNonNull(works());\n" +
- " java.util.Objects.requireNonNull(fails());\n" +
- " }\n" +
- "}\n"
+ "package bug;\n" +
+ "import static bug.Base.*;\n" +
+ "import static bug.Derived.*;\n" +
+ "public class StaticImportBug {\n" +
+ " void m() {\n" +
+ " java.util.Objects.requireNonNull(works());\n" +
+ " java.util.Objects.requireNonNull(fails());\n" +
+ " }\n" +
+ "}\n"
});
}
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java
index 6aa1b0ade..d808322a7 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java
@@ -14,7 +14,7 @@
* bug 295551 - Add option to automatically promote all warnings to error
* bug 185682 - Increment/decrement operators mark local variables as read
* bug 366003 - CCE in ASTNode.resolveAnnotations(ASTNode.java:639)
- * bug 384663 - Package Based Annotation Compilation Error in JDT 3.8/4.2 (works in 3.7.2)
+ * bug 384663 - Package Based Annotation Compilation Error in JDT 3.8/4.2 (works in 3.7.2)
* bug 386356 - Type mismatch error with annotations and generics
* bug 331649 - [compiler][null] consider null annotations for fields
* bug 376590 - Private fields with @Inject are ignored by unused field validation
@@ -367,12 +367,12 @@ public class AnnotationTest extends AbstractComparableTest {
"1. ERROR in X.java (at line 1)\n" +
" @Foo @Foo\n" +
" ^^^^\n" +
- this.repeatableIntroText + "@Foo"+ this.repeatableTrailerText +
+ this.repeatableIntroText + "@Foo"+ this.repeatableTrailerText +
"----------\n" +
"2. ERROR in X.java (at line 1)\n" +
" @Foo @Foo\n" +
" ^^^^\n" +
- this.repeatableIntroText + "@Foo"+ this.repeatableTrailerText +
+ this.repeatableIntroText + "@Foo"+ this.repeatableTrailerText +
"----------\n");
}
@@ -1083,16 +1083,16 @@ public class AnnotationTest extends AbstractComparableTest {
" synchronized String id() default \"zero\";\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " strictfp double val() default 0.1;\n" +
- " ^^^^^\n" +
- "Illegal modifier for the annotation attribute X.val; only public & abstract are permitted\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " synchronized String id() default \"zero\";\n" +
- " ^^^^\n" +
- "Illegal modifier for the annotation attribute X.id; only public & abstract are permitted\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " strictfp double val() default 0.1;\n" +
+ " ^^^^^\n" +
+ "Illegal modifier for the annotation attribute X.val; only public & abstract are permitted\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " synchronized String id() default \"zero\";\n" +
+ " ^^^^\n" +
+ "Illegal modifier for the annotation attribute X.id; only public & abstract are permitted\n" +
"----------\n");
}
@@ -3386,51 +3386,51 @@ public class AnnotationTest extends AbstractComparableTest {
CompilerOptions.DISABLED);
String expectedOutput =
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " interface Iface extends Ann {\n" +
- " ^^^\n" +
- "The annotation type Ann should not be used as a superinterface for Iface\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 11)\n" +
- " abstract class Klass implements Ann {\n" +
- " ^^^\n" +
- "The annotation type Ann should not be used as a superinterface for Klass\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 14)\n" +
- " class SubKlass extends Klass {\n" +
- " ^^^^^^^^\n" +
- "The type SubKlass must implement the inherited abstract method Ann.foo()\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 20)\n" +
- " class AnnImpl implements Ann {\n" +
- " ^^^\n" +
- "The annotation type Ann should not be used as a superinterface for AnnImpl\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 21)\n" +
- " public boolean equals(Object obj) { return false; }\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The method equals(Object) of type AnnImpl should be tagged with @Override since it actually overrides a superclass method\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 22)\n" +
- " public int hashCode() { return 0; }\n" +
- " ^^^^^^^^^^\n" +
- "The method hashCode() of type AnnImpl should be tagged with @Override since it actually overrides a superclass method\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 23)\n" +
- " public String toString() { return null; }\n" +
- " ^^^^^^^^^^\n" +
- "The method toString() of type AnnImpl should be tagged with @Override since it actually overrides a superclass method\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 30)\n" +
- " Class c = SubKlass.class;\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n" +
- "9. WARNING in X.java (at line 41)\n" +
- " Class[] i = c.getInterfaces();\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " interface Iface extends Ann {\n" +
+ " ^^^\n" +
+ "The annotation type Ann should not be used as a superinterface for Iface\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 11)\n" +
+ " abstract class Klass implements Ann {\n" +
+ " ^^^\n" +
+ "The annotation type Ann should not be used as a superinterface for Klass\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 14)\n" +
+ " class SubKlass extends Klass {\n" +
+ " ^^^^^^^^\n" +
+ "The type SubKlass must implement the inherited abstract method Ann.foo()\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 20)\n" +
+ " class AnnImpl implements Ann {\n" +
+ " ^^^\n" +
+ "The annotation type Ann should not be used as a superinterface for AnnImpl\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 21)\n" +
+ " public boolean equals(Object obj) { return false; }\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "The method equals(Object) of type AnnImpl should be tagged with @Override since it actually overrides a superclass method\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 22)\n" +
+ " public int hashCode() { return 0; }\n" +
+ " ^^^^^^^^^^\n" +
+ "The method hashCode() of type AnnImpl should be tagged with @Override since it actually overrides a superclass method\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 23)\n" +
+ " public String toString() { return null; }\n" +
+ " ^^^^^^^^^^\n" +
+ "The method toString() of type AnnImpl should be tagged with @Override since it actually overrides a superclass method\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 30)\n" +
+ " Class c = SubKlass.class;\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "9. WARNING in X.java (at line 41)\n" +
+ " Class[] i = c.getInterfaces();\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
"----------\n";
this.runNegativeTest(
@@ -4263,16 +4263,16 @@ public class AnnotationTest extends AbstractComparableTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " import java.util.List;\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"import\", package expected\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " import java.util.List;\n" +
+ " ^^^^^^\n" +
+ "Syntax error on token \"import\", package expected\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// check @SuppressWarning support
@@ -4613,21 +4613,21 @@ public void test142c() {
},
null,
raiseDeprecationReduceInvalidJavadocSeverity,
- "----------\n" +
- "1. WARNING in X.java (at line 1)\n" +
- " @SuppressWarnings(\"deprecation\")\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary @SuppressWarnings(\"deprecation\")\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " public class X extends p.OldStuff {\n" +
- " ^^^^^^^^\n" +
- "The type OldStuff is deprecated\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " super.foo();\n" +
- " ^^^^^\n" +
- "The method foo() from the type OldStuff is deprecated\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 1)\n" +
+ " @SuppressWarnings(\"deprecation\")\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary @SuppressWarnings(\"deprecation\")\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " public class X extends p.OldStuff {\n" +
+ " ^^^^^^^^\n" +
+ "The type OldStuff is deprecated\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " super.foo();\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type OldStuff is deprecated\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -5059,11 +5059,11 @@ public void test143() {
"class BX extends AX {}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " } catch(AX e) {\n" +
- " ^^\n" +
- "Unreachable catch block for AX. Only more specific exceptions are thrown and they are handled by previous catch block(s).\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " } catch(AX e) {\n" +
+ " ^^\n" +
+ "Unreachable catch block for AX. Only more specific exceptions are thrown and they are handled by previous catch block(s).\n" +
"----------\n";
runner.runWarningTest();
}
@@ -8187,16 +8187,16 @@ public void test245() {
"} \n",
},
null, options,
- "----------\n" +
- "1. INFO in X.java (at line 3)\n" +
- " @SuppressWarnings({\"unchecked\",\"unused\"})\n" +
- " ^^^^^^^^^^^\n" +
- "At least one of the problems in category \'unchecked\' is not analysed due to a compiler option being ignored\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " @SuppressWarnings({\"unchecked\",\"unused\"})\n" +
- " ^^^^^^^^\n" +
- "Unnecessary @SuppressWarnings(\"unused\")\n" +
+ "----------\n" +
+ "1. INFO in X.java (at line 3)\n" +
+ " @SuppressWarnings({\"unchecked\",\"unused\"})\n" +
+ " ^^^^^^^^^^^\n" +
+ "At least one of the problems in category \'unchecked\' is not analysed due to a compiler option being ignored\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " @SuppressWarnings({\"unchecked\",\"unused\"})\n" +
+ " ^^^^^^^^\n" +
+ "Unnecessary @SuppressWarnings(\"unused\")\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -8222,11 +8222,11 @@ public void test245_ignored() {
"} \n",
},
null, options,
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " @SuppressWarnings({\"unchecked\",\"unused\"})\n" +
- " ^^^^^^^^\n" +
- "Unnecessary @SuppressWarnings(\"unused\")\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " @SuppressWarnings({\"unchecked\",\"unused\"})\n" +
+ " ^^^^^^^^\n" +
+ "Unnecessary @SuppressWarnings(\"unused\")\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -8252,16 +8252,16 @@ public void test245_error() {
"} \n",
},
null, options,
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " @SuppressWarnings({\"unchecked\",\"unused\"})\n" +
- " ^^^^^^^^^^^\n" +
- "At least one of the problems in category \'unchecked\' is not analysed due to a compiler option being ignored\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " @SuppressWarnings({\"unchecked\",\"unused\"})\n" +
- " ^^^^^^^^\n" +
- "Unnecessary @SuppressWarnings(\"unused\")\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " @SuppressWarnings({\"unchecked\",\"unused\"})\n" +
+ " ^^^^^^^^^^^\n" +
+ "At least one of the problems in category \'unchecked\' is not analysed due to a compiler option being ignored\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " @SuppressWarnings({\"unchecked\",\"unused\"})\n" +
+ " ^^^^^^^^\n" +
+ "Unnecessary @SuppressWarnings(\"unused\")\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -8721,31 +8721,31 @@ public void test259() {
this.runConformTest(
new String[] {
"Jpf.java",
- "public class Jpf {\n" +
- " @interface Action {\n" +
- " Forward[] forwards();\n" +
- " }\n" +
- " @interface Forward {\n" +
- " String name();\n" +
- " String path();\n" +
- " ActionOutput[] actionOutputs();\n" +
- " }\n" +
- " @interface ActionOutput {\n" +
- " String name();\n" +
- " Class type();\n" +
- " }\n" +
- " @Jpf.Action( \n" +
- " forwards = { \n" +
- " @Jpf.Forward(\n" +
- " name = \"success\", \n" +
- " path = \"results.jsp\", \n" +
- " actionOutputs = { \n" +
- " @Jpf.ActionOutput(\n" +
- " name = \"mybeanmethodResult\", \n" +
- " type = java.lang.String[].class) }) })\n" +
- " public Forward mybeanmethod() {\n" +
- " return null;\n" +
- " }\n" +
+ "public class Jpf {\n" +
+ " @interface Action {\n" +
+ " Forward[] forwards();\n" +
+ " }\n" +
+ " @interface Forward {\n" +
+ " String name();\n" +
+ " String path();\n" +
+ " ActionOutput[] actionOutputs();\n" +
+ " }\n" +
+ " @interface ActionOutput {\n" +
+ " String name();\n" +
+ " Class type();\n" +
+ " }\n" +
+ " @Jpf.Action( \n" +
+ " forwards = { \n" +
+ " @Jpf.Forward(\n" +
+ " name = \"success\", \n" +
+ " path = \"results.jsp\", \n" +
+ " actionOutputs = { \n" +
+ " @Jpf.ActionOutput(\n" +
+ " name = \"mybeanmethodResult\", \n" +
+ " type = java.lang.String[].class) }) })\n" +
+ " public Forward mybeanmethod() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
},
"");
@@ -8755,13 +8755,13 @@ public void test260() {
this.runConformTest(
new String[] {
"X.java",
- "@X.StringAnnotation(X.CONSTANT_EXPRESSION)\n" +
- "public class X {\n" +
- " public @interface StringAnnotation {\n" +
- " String value();\n" +
- " }\n" +
- " public final static String CONSTANT = \"Constant\";\n" +
- " public final static String CONSTANT_EXPRESSION = CONSTANT + \"Expression\";\n" +
+ "@X.StringAnnotation(X.CONSTANT_EXPRESSION)\n" +
+ "public class X {\n" +
+ " public @interface StringAnnotation {\n" +
+ " String value();\n" +
+ " }\n" +
+ " public final static String CONSTANT = \"Constant\";\n" +
+ " public final static String CONSTANT_EXPRESSION = CONSTANT + \"Expression\";\n" +
"}\n"
},
"");
@@ -8773,21 +8773,21 @@ public void test261() {
this.runConformTest(
new String[] {
"X.java",//=====================
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " new Other().foo();\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " new Other().foo();\n" +
+ " }\n" +
"}\n",
"Annot.java",//=====================
- "public @interface Annot {\n" +
- " Class value();\n" +
+ "public @interface Annot {\n" +
+ " Class value();\n" +
"}\n",
"Other.java",//=====================
- "public class Other {\n" +
- " @Annot(value = Other[].class)\n" +
- " void foo() {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
+ "public class Other {\n" +
+ " @Annot(value = Other[].class)\n" +
+ " void foo() {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " }\n" +
"}\n"
},
"SUCCESS",
@@ -8799,10 +8799,10 @@ public void test261() {
this.runConformTest(
new String[] {
"X.java",//=====================
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " new Other().foo();\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " new Other().foo();\n" +
+ " }\n" +
"}\n",
},
"SUCCESS",
@@ -8810,7 +8810,7 @@ public void test261() {
false,
null,
options,
- null);
+ null);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239273 - variation
public void test262() {
@@ -8819,21 +8819,21 @@ public void test262() {
this.runConformTest(
new String[] {
"X.java",//=====================
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " new Other().foo();\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " new Other().foo();\n" +
+ " }\n" +
"}\n",
"Annot.java",//=====================
- "public @interface Annot {\n" +
- " String[] values();\n" +
+ "public @interface Annot {\n" +
+ " String[] values();\n" +
"}\n",
"Other.java",//=====================
- "public class Other {\n" +
- " @Annot(values = {\"foo\",\"bar\"})\n" +
- " void foo() {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
+ "public class Other {\n" +
+ " @Annot(values = {\"foo\",\"bar\"})\n" +
+ " void foo() {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " }\n" +
"}\n"
},
"SUCCESS",
@@ -8845,10 +8845,10 @@ public void test262() {
this.runConformTest(
new String[] {
"X.java",//=====================
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " new Other().foo();\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " new Other().foo();\n" +
+ " }\n" +
"}\n",
},
"SUCCESS",
@@ -8856,7 +8856,7 @@ public void test262() {
false,
null,
options,
- null);
+ null);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239273 - variation
public void test263() {
@@ -8865,21 +8865,21 @@ public void test263() {
this.runConformTest(
new String[] {
"X.java",//=====================
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " new Other().foo();\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " new Other().foo();\n" +
+ " }\n" +
"}\n",
"Annot.java",//=====================
- "public @interface Annot {\n" +
- " String[] values();\n" +
+ "public @interface Annot {\n" +
+ " String[] values();\n" +
"}\n",
"Other.java",//=====================
- "public class Other {\n" +
- " @Annot(values = {\"foo\",\"bar\"})\n" +
- " void foo() {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
+ "public class Other {\n" +
+ " @Annot(values = {\"foo\",\"bar\"})\n" +
+ " void foo() {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " }\n" +
"}\n"
},
"SUCCESS",
@@ -8891,10 +8891,10 @@ public void test263() {
this.runConformTest(
new String[] {
"X.java",//=====================
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " new Other().foo();\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " new Other().foo();\n" +
+ " }\n" +
"}\n",
},
"SUCCESS",
@@ -8902,26 +8902,26 @@ public void test263() {
false,
null,
options,
- null);
+ null);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=256035
public void test264() {
this.runConformTest(
new String[] {
"X.java",
- "@interface Anno {\n" +
- " String value();\n" +
- "}\n" +
- "\n" +
- "@Anno(X.B)\n" +
- "public class X {\n" +
- " public static final String A = \"a\";\n" +
- " public static final String B = A + \"b\";\n" +
+ "@interface Anno {\n" +
+ " String value();\n" +
+ "}\n" +
+ "\n" +
+ "@Anno(X.B)\n" +
+ "public class X {\n" +
+ " public static final String A = \"a\";\n" +
+ " public static final String B = A + \"b\";\n" +
"}\n"
},
"");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=258906
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=258906
public void test265() {
INameEnvironment nameEnvironment = new FileSystem(Util.getJavaClassLibs(), new String[] {}, null);
@@ -8972,20 +8972,20 @@ public void test266() {
this.runNegativeTest(
new String[] {
"p/package-info.java",
- "@Deprecated\n" +
- "@Deprecated\n" +
+ "@Deprecated\n" +
+ "@Deprecated\n" +
"package p;"
},
- "----------\n" +
- "1. ERROR in p\\package-info.java (at line 1)\n" +
- " @Deprecated\n" +
- " ^^^^^^^^^^^\n" +
- this.repeatableIntroText + "@Deprecated"+ this.repeatableTrailerText +
- "----------\n" +
- "2. ERROR in p\\package-info.java (at line 2)\n" +
- " @Deprecated\n" +
- " ^^^^^^^^^^^\n" +
- this.repeatableIntroText + "@Deprecated"+ this.repeatableTrailerText +
+ "----------\n" +
+ "1. ERROR in p\\package-info.java (at line 1)\n" +
+ " @Deprecated\n" +
+ " ^^^^^^^^^^^\n" +
+ this.repeatableIntroText + "@Deprecated"+ this.repeatableTrailerText +
+ "----------\n" +
+ "2. ERROR in p\\package-info.java (at line 2)\n" +
+ " @Deprecated\n" +
+ " ^^^^^^^^^^^\n" +
+ this.repeatableIntroText + "@Deprecated"+ this.repeatableTrailerText +
"----------\n"
);
}
@@ -9002,13 +9002,13 @@ public void test267() {
true,
new String[] {
"com/SomeTest.java",
- "package com;\n" +
- "import static com.SomeTest.UNCHECKED;\n" +
- "@SuppressWarnings(UNCHECKED)\n" +
- "public class SomeTest {\n" +
- " public static final String UNCHECKED = \"unchecked\";\n" +
+ "package com;\n" +
+ "import static com.SomeTest.UNCHECKED;\n" +
+ "@SuppressWarnings(UNCHECKED)\n" +
+ "public class SomeTest {\n" +
+ " public static final String UNCHECKED = \"unchecked\";\n" +
"}\n"
- },
+ },
null, customOptions,
"----------\n" +
"1. ERROR in com\\SomeTest.java (at line 3)\n" +
@@ -9023,31 +9023,31 @@ public void test268() {
this.runNegativeTest(
new String[] {
"X.java", // =================
- "public class X {\n" +
- " protected enum E {\n" +
- " E1, E2\n" +
- " }\n" +
- " protected @interface Anno1 { E value(); }\n" +
- " protected @interface Anno2 { E value(); }\n" +
- " protected @interface Anno3 { E value(); }\n" +
- " @Anno1(true ? E.E1 : E.E2)\n" +
- " @Anno2(bar())\n" +
- " @Anno3(((E.E1)))\n" +
- " public void foo() {\n" +
- " }\n" +
- " public E bar() { return E.E1; }\n" +
+ "public class X {\n" +
+ " protected enum E {\n" +
+ " E1, E2\n" +
+ " }\n" +
+ " protected @interface Anno1 { E value(); }\n" +
+ " protected @interface Anno2 { E value(); }\n" +
+ " protected @interface Anno3 { E value(); }\n" +
+ " @Anno1(true ? E.E1 : E.E2)\n" +
+ " @Anno2(bar())\n" +
+ " @Anno3(((E.E1)))\n" +
+ " public void foo() {\n" +
+ " }\n" +
+ " public E bar() { return E.E1; }\n" +
"}\n", // =================
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " @Anno1(true ? E.E1 : E.E2)\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The value for annotation attribute X.Anno1.value must be an enum constant expression\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " @Anno2(bar())\n" +
- " ^^^^^\n" +
- "The value for annotation attribute X.Anno2.value must be an enum constant expression\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " @Anno1(true ? E.E1 : E.E2)\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "The value for annotation attribute X.Anno1.value must be an enum constant expression\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " @Anno2(bar())\n" +
+ " ^^^^^\n" +
+ "The value for annotation attribute X.Anno2.value must be an enum constant expression\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=274917
@@ -9065,11 +9065,11 @@ public void test269() {
},
null,
customOptions,
- "----------\n" +
- "1. WARNING in X.java (at line 1)\n" +
- " @interface X {}\n" +
- " ^^\n" +
- "Empty block should be documented\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 1)\n" +
+ " @interface X {}\n" +
+ " ^^\n" +
+ "Empty block should be documented\n" +
"----------\n",
null, null,
JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
@@ -9079,12 +9079,12 @@ public void test269() {
public void test270() {
this.runNegativeTest(
new String[] {
- "Test.java",
- "public class Test<T> {\n" +
- " @interface Anno {\n" +
- " Anno value();\n" +
- " }\n" +
- "}\n",
+ "Test.java",
+ "public class Test<T> {\n" +
+ " @interface Anno {\n" +
+ " Anno value();\n" +
+ " }\n" +
+ "}\n",
},
"----------\n" +
"1. ERROR in Test.java (at line 3)\n" +
@@ -9098,17 +9098,17 @@ public void test271() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "@interface A {}\n" +
- "public class X {\n" +
- " @SuppressWarnings(\"unused\")\n" +
- " private void foo(@A Object o) {}\n" +
+ "@interface A {}\n" +
+ "public class X {\n" +
+ " @SuppressWarnings(\"unused\")\n" +
+ " private void foo(@A Object o) {}\n" +
"}"
},
"");
String expectedOutput =
- " // Method descriptor #15 (Ljava/lang/Object;)V\n" +
- " // Stack: 0, Locals: 2\n" +
+ " // Method descriptor #15 (Ljava/lang/Object;)V\n" +
+ " // Stack: 0, Locals: 2\n" +
" private void foo(@A java.lang.Object o);\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator +"X.class", "X", expectedOutput, ClassFileBytesDisassembler.DETAILED);
@@ -9125,10 +9125,10 @@ public void test272() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "@interface A {}\n" +
- "public class X {\n" +
- " @SuppressWarnings(\"unused\")\n" +
- " private void foo(@A Object o) {}\n" +
+ "@interface A {}\n" +
+ "public class X {\n" +
+ " @SuppressWarnings(\"unused\")\n" +
+ " private void foo(@A Object o) {}\n" +
"}"
},
"",
@@ -9140,8 +9140,8 @@ public void test272() throws Exception {
true);
String expectedOutput =
- " // Method descriptor #15 (Ljava/lang/Object;)V\n" +
- " // Stack: 0, Locals: 2\n" +
+ " // Method descriptor #15 (Ljava/lang/Object;)V\n" +
+ " // Stack: 0, Locals: 2\n" +
" private void foo(@A java.lang.Object o);\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator +"X.class", "X", expectedOutput, ClassFileBytesDisassembler.DETAILED);
@@ -9151,17 +9151,17 @@ public void test273() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "@interface A {}\n" +
- "public class X {\n" +
- " @SuppressWarnings(\"unused\")\n" +
- " private X(@A Object o) {}\n" +
+ "@interface A {}\n" +
+ "public class X {\n" +
+ " @SuppressWarnings(\"unused\")\n" +
+ " private X(@A Object o) {}\n" +
"}"
},
"");
String expectedOutput =
- " // Method descriptor #6 (Ljava/lang/Object;)V\n" +
- " // Stack: 1, Locals: 2\n" +
+ " // Method descriptor #6 (Ljava/lang/Object;)V\n" +
+ " // Stack: 1, Locals: 2\n" +
" private X(@A java.lang.Object o);\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator +"X.class", "X", expectedOutput, ClassFileBytesDisassembler.DETAILED);
@@ -9174,7 +9174,7 @@ public void test274a() {
"T.java",
"public interface T {\n" +
" void m();\n" +
- "}\n" +
+ "}\n" +
"abstract class A implements T {\n" +
"}\n" +
"class B extends A {\n" +
@@ -9200,7 +9200,7 @@ public void test274a() {
true,
testString,
null, customOptions,
- expectedOutput,
+ expectedOutput,
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
} else {
this.runConformTest(
@@ -9208,7 +9208,7 @@ public void test274a() {
null,
customOptions,
null,
- null, null,
+ null, null,
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
}
@@ -9352,25 +9352,25 @@ public void test275() {
true,
new String[] {
"X.java",
- "public class X {\n" +
- " public static final boolean DEBUG = false;\n" +
- "// @SuppressWarnings(\"unused\")\n" +
- " public void foo() {\n" +
+ "public class X {\n" +
+ " public static final boolean DEBUG = false;\n" +
+ "// @SuppressWarnings(\"unused\")\n" +
+ " public void foo() {\n" +
" if (DEBUG)\n" +
" System.out.println(\"true\");\n" +
" else\n" +
" System.out.println(\"false\");\n" +
" \n" +
- " }\n" +
+ " }\n" +
"}\n"
},
null,
customOptions,
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " System.out.println(\"true\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " System.out.println(\"true\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
"",
"",
@@ -9385,16 +9385,16 @@ public void test276() {
true,
new String[] {
"X.java",
- "public class X {\n" +
- " public static final boolean DEBUG = false;\n" +
- " @SuppressWarnings(\"unused\")\n" +
- " public void foo() {\n" +
+ "public class X {\n" +
+ " public static final boolean DEBUG = false;\n" +
+ " @SuppressWarnings(\"unused\")\n" +
+ " public void foo() {\n" +
" if (DEBUG)\n" +
" System.out.println(\"true\");\n" +
" else\n" +
" System.out.println(\"false\");\n" +
" \n" +
- " }\n" +
+ " }\n" +
"}\n"
},
null,
@@ -9413,16 +9413,16 @@ public void test277() {
true,
new String[] {
"X.java",
- "public class X {\n" +
- " public static final boolean DEBUG = false;\n" +
- " @SuppressWarnings(\"unused\")\n" +
- " public void foo() {\n" +
+ "public class X {\n" +
+ " public static final boolean DEBUG = false;\n" +
+ " @SuppressWarnings(\"unused\")\n" +
+ " public void foo() {\n" +
" if (0 < 1)\n" +
" System.out.println(\"true\");\n" +
" else\n" +
" System.out.println(\"false\");\n" +
" \n" +
- " }\n" +
+ " }\n" +
"}\n"
},
null,
@@ -9475,10 +9475,10 @@ public void test279() {
"}"
};
String expectedOutput =
- "----------\n" +
- "1. ERROR in A.java (at line 6)\n" +
- " public Zork test;\n" +
- " ^^^^\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 6)\n" +
+ " public Zork test;\n" +
+ " ^^^^\n" +
"Zork cannot be resolved to a type\n" +
"----------\n";
this.runNegativeTest(
@@ -9519,17 +9519,17 @@ public void test281() {
" private int i;\n" +
"}\n"
};
- String expectedErrorString =
- "----------\n" +
- "1. ERROR in A.java (at line 3)\n" +
- " private int i;\n" +
- " ^\n" +
- "The value of the field A.i is not used\n" +
+ String expectedErrorString =
+ "----------\n" +
+ "1. ERROR in A.java (at line 3)\n" +
+ " private int i;\n" +
+ " ^\n" +
+ "The value of the field A.i is not used\n" +
"----------\n";
runNegativeTest(
true,
testFiles,
- null,
+ null,
customOptions,
expectedErrorString,
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
@@ -9544,7 +9544,7 @@ public void test282() {
"import java.util.Map;\n" +
"public class A {\n" +
" @SuppressWarnings({\"rawtypes\", \"unused\"})\n" + //suppress a warning and an error
- " private Map i;\n" +
+ " private Map i;\n" +
"}\n"
};
runConformTest(
@@ -9568,17 +9568,17 @@ public void test283() {
" private void i;\n" + // cannot suppress mandatory error
"}\n"
};
- String expectedErrorString =
- "----------\n" +
- "1. ERROR in A.java (at line 3)\n" +
- " private void i;\n" +
- " ^\n" +
- "void is an invalid type for the variable i\n" +
+ String expectedErrorString =
+ "----------\n" +
+ "1. ERROR in A.java (at line 3)\n" +
+ " private void i;\n" +
+ " ^\n" +
+ "void is an invalid type for the variable i\n" +
"----------\n";
runNegativeTest(
true,
testFiles,
- null,
+ null,
customOptions,
expectedErrorString,
JavacTestOptions.SKIP);
@@ -9591,27 +9591,27 @@ public void test284() {
customOptions.put(CompilerOptions.OPTION_SuppressOptionalErrors, CompilerOptions.ENABLED);
String testFiles [] = new String[] {
"X.java",
- "public class X {\n" +
- " void m() {\n" +
- " @SuppressWarnings(\"cast\")\n" +
- " int i= (int) 0;\n" +
- " @SuppressWarnings(\"cast\")\n" +
- " byte b= (byte) i;\n" +
- " System.out.println(b);\n" +
- " }\n" +
+ "public class X {\n" +
+ " void m() {\n" +
+ " @SuppressWarnings(\"cast\")\n" +
+ " int i= (int) 0;\n" +
+ " @SuppressWarnings(\"cast\")\n" +
+ " byte b= (byte) i;\n" +
+ " System.out.println(b);\n" +
+ " }\n" +
"}"
};
- String expectedErrorString =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " @SuppressWarnings(\"cast\")\n" +
- " ^^^^^^\n" +
- "Unnecessary @SuppressWarnings(\"cast\")\n" +
+ String expectedErrorString =
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " @SuppressWarnings(\"cast\")\n" +
+ " ^^^^^^\n" +
+ "Unnecessary @SuppressWarnings(\"cast\")\n" +
"----------\n";
runNegativeTest(
true,
testFiles,
- null,
+ null,
customOptions,
expectedErrorString,
JavacTestOptions.SKIP);
@@ -9624,27 +9624,27 @@ public void test285() {
customOptions.put(CompilerOptions.OPTION_SuppressOptionalErrors, CompilerOptions.ENABLED);
String testFiles [] = new String[] {
"X.java",
- "public class X {\n" +
- " void m() {\n" +
- " @SuppressWarnings(\"cast\")\n" +
- " int i= (int) 0;\n" +
- " @SuppressWarnings(\"cast\")\n" +
- " byte b= (byte) i;\n" +
- " System.out.println(b);\n" +
- " }\n" +
+ "public class X {\n" +
+ " void m() {\n" +
+ " @SuppressWarnings(\"cast\")\n" +
+ " int i= (int) 0;\n" +
+ " @SuppressWarnings(\"cast\")\n" +
+ " byte b= (byte) i;\n" +
+ " System.out.println(b);\n" +
+ " }\n" +
"}"
};
- String expectedErrorString =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " @SuppressWarnings(\"cast\")\n" +
- " ^^^^^^\n" +
- "Unnecessary @SuppressWarnings(\"cast\")\n" +
+ String expectedErrorString =
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " @SuppressWarnings(\"cast\")\n" +
+ " ^^^^^^\n" +
+ "Unnecessary @SuppressWarnings(\"cast\")\n" +
"----------\n";
runNegativeTest(
true,
testFiles,
- null,
+ null,
customOptions,
expectedErrorString,
JavacTestOptions.SKIP);
@@ -9695,19 +9695,19 @@ public void test287() {
this.runConformTest(
new String[] {
"X.java",
- "import java.util.ArrayList;\n" +
- "\n" +
- "public class X {\n" +
- " @SuppressWarnings(\"rawtypes\")\n" +
- " void foo(ArrayList arg) {\n" +
- " for (\n" +
+ "import java.util.ArrayList;\n" +
+ "\n" +
+ "public class X {\n" +
+ " @SuppressWarnings(\"rawtypes\")\n" +
+ " void foo(ArrayList arg) {\n" +
+ " for (\n" +
" @SuppressWarnings(\"unchecked\")\n" +
- " boolean a= arg.add(1), b= arg.add(1);\n" +
- " Boolean.FALSE;\n" +
- " ) {\n" +
- " System.out.println(a && b);\n" +
- " }\n" +
- " }\n" +
+ " boolean a= arg.add(1), b= arg.add(1);\n" +
+ " Boolean.FALSE;\n" +
+ " ) {\n" +
+ " System.out.println(a && b);\n" +
+ " }\n" +
+ " }\n" +
"}",
},
"",
@@ -9725,13 +9725,13 @@ public void test288() {
this.runConformTest(
new String[] {
"X.java",
- "import java.util.ArrayList;\n" +
- "\n" +
- "public class X {\n" +
- " @SuppressWarnings(\"rawtypes\")\n" +
- " ArrayList arg;\n" +
- " @SuppressWarnings(\"unchecked\")\n" +
- " boolean a= arg.add(1), b= arg.add(1);\n" +
+ "import java.util.ArrayList;\n" +
+ "\n" +
+ "public class X {\n" +
+ " @SuppressWarnings(\"rawtypes\")\n" +
+ " ArrayList arg;\n" +
+ " @SuppressWarnings(\"unchecked\")\n" +
+ " boolean a= arg.add(1), b= arg.add(1);\n" +
"}",
},
"",
@@ -9750,20 +9750,20 @@ public void test289() {
this.runConformTest(
new String[] {
"X.java",
- "import java.util.ArrayList;\n" +
- "\n" +
- "public class X {\n" +
- " void foo(ArrayList arg) {\n" +
- " for (\n" +
- " @Deprecated\n" +
- " @Other\n" +
+ "import java.util.ArrayList;\n" +
+ "\n" +
+ "public class X {\n" +
+ " void foo(ArrayList arg) {\n" +
+ " for (\n" +
+ " @Deprecated\n" +
+ " @Other\n" +
" @SuppressWarnings(\"unchecked\")\n" +
- " boolean a= arg.add(1), b= arg.add(1);\n" +
- " Boolean.FALSE;\n" +
- " ) {\n" +
- " System.out.println(a && b);\n" +
- " }\n" +
- " }\n" +
+ " boolean a= arg.add(1), b= arg.add(1);\n" +
+ " Boolean.FALSE;\n" +
+ " ) {\n" +
+ " System.out.println(a && b);\n" +
+ " }\n" +
+ " }\n" +
"}",
"Other.java",
"@interface Other {}"
@@ -9785,15 +9785,15 @@ public void test290() {
this.runConformTest(
new String[] {
"X.java",
- "import java.util.ArrayList;\n" +
- "class X {\n" +
- " @SuppressWarnings(\"rawtypes\")\n" +
- " void foo(ArrayList arg) {\n" +
- " @SuppressWarnings(\"unchecked\")\n" +
- " boolean aa = arg.add(1), bb = arg.add(1);\n" +
- " if (bb)\n" +
- " System.out.println(\"hi\");\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "class X {\n" +
+ " @SuppressWarnings(\"rawtypes\")\n" +
+ " void foo(ArrayList arg) {\n" +
+ " @SuppressWarnings(\"unchecked\")\n" +
+ " boolean aa = arg.add(1), bb = arg.add(1);\n" +
+ " if (bb)\n" +
+ " System.out.println(\"hi\");\n" +
+ " }\n" +
"}"
},
"",
@@ -9813,15 +9813,15 @@ public void test291() {
this.runConformTest(
new String[] {
"X.java",
- "import java.util.ArrayList;\n" +
- "class X {\n" +
- " @SuppressWarnings(\"rawtypes\")\n" +
- " void foo(ArrayList arg) {\n" +
- " @SuppressWarnings(\"unchecked\")\n" +
- " boolean aa = arg.add(1), bb = arg.add(1);\n" +
- " if (aa)\n" +
- " System.out.println(\"hi\");\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "class X {\n" +
+ " @SuppressWarnings(\"rawtypes\")\n" +
+ " void foo(ArrayList arg) {\n" +
+ " @SuppressWarnings(\"unchecked\")\n" +
+ " boolean aa = arg.add(1), bb = arg.add(1);\n" +
+ " if (aa)\n" +
+ " System.out.println(\"hi\");\n" +
+ " }\n" +
"}"
},
"",
@@ -9841,13 +9841,13 @@ public void test292() {
this.runConformTest(
new String[] {
"X.java",
- "import java.util.ArrayList;\n" +
- "class X {\n" +
- " @SuppressWarnings(\"rawtypes\")\n" +
- " void foo(ArrayList arg) {\n" +
- " @SuppressWarnings(\"unchecked\")\n" +
- " boolean aa = arg.add(1), bb = arg.add(1);\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "class X {\n" +
+ " @SuppressWarnings(\"rawtypes\")\n" +
+ " void foo(ArrayList arg) {\n" +
+ " @SuppressWarnings(\"unchecked\")\n" +
+ " boolean aa = arg.add(1), bb = arg.add(1);\n" +
+ " }\n" +
"}"
},
"",
@@ -9870,13 +9870,13 @@ public void test293() {
"@interface A{\n" +
" String name();\n" +
" String query();\n" +
- "}\n"
+ "}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " @A(name = X.QUERY_NAME, query = X.QUERY)\n" +
- " ^^^^^\n" +
- "The field X.QUERY is not visible\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " @A(name = X.QUERY_NAME, query = X.QUERY)\n" +
+ " ^^^^^\n" +
+ "The field X.QUERY is not visible\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=179566
@@ -9967,158 +9967,158 @@ public void test297() {
runner.customOptions.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
runner.customOptions.put(CompilerOptions.OPTION_ReportComparingIdentical, CompilerOptions.ERROR);
runner.customOptions.put(CompilerOptions.OPTION_ReportUncheckedTypeOperation, CompilerOptions.ERROR);
-
- runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in A.java (at line 15)\n" +
- " return i == i;\n" +
- " ^^^^^^\n" +
- "Comparing identical expressions\n" +
+
+ runner.expectedCompilerLog =
+ "----------\n" +
+ "1. ERROR in A.java (at line 15)\n" +
+ " return i == i;\n" +
+ " ^^^^^^\n" +
+ "Comparing identical expressions\n" +
"----------\n";
if (this.complianceLevel >= ClassFileConstants.JDK1_7) {
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in A.java (at line 10)\n" +
- " public final Object build(Class<? super Object>... objects) {\n" +
- " ^^^^^^^\n" +
- "Type safety: Potential heap pollution via varargs parameter objects\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 15)\n" +
- " return i == i;\n" +
- " ^^^^^^\n" +
- "Comparing identical expressions\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 10)\n" +
+ " public final Object build(Class<? super Object>... objects) {\n" +
+ " ^^^^^^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter objects\n" +
+ "----------\n" +
+ "2. ERROR in A.java (at line 15)\n" +
+ " return i == i;\n" +
+ " ^^^^^^\n" +
+ "Comparing identical expressions\n" +
"----------\n";
}
runner.testFiles = new String[] {
"A.java",
- "public class A {\n" +
- " public void one() {\n" +
- " @SuppressWarnings(\"unused\")\n" +
- " Object object = new Object();\n" +
- " }\n" +
- " public void two() {\n" +
- " @SuppressWarnings({ \"unchecked\", \"unused\" })\n" +
- " Object object = build();\n" +
- " }\n" +
- " public final Object build(Class<? super Object>... objects) {\n" +
- " return null;\n" +
- " }\n" +
+ "public class A {\n" +
+ " public void one() {\n" +
+ " @SuppressWarnings(\"unused\")\n" +
+ " Object object = new Object();\n" +
+ " }\n" +
+ " public void two() {\n" +
+ " @SuppressWarnings({ \"unchecked\", \"unused\" })\n" +
+ " Object object = build();\n" +
+ " }\n" +
+ " public final Object build(Class<? super Object>... objects) {\n" +
+ " return null;\n" +
+ " }\n" +
" public boolean bar() {\n" +
" int i = 0;\n" +
- " return i == i;\n" +
- " }\n" +
+ " return i == i;\n" +
+ " }\n" +
"}"
};
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
runner.runNegativeTest();
}
-// Bug 366003 - CCE in ASTNode.resolveAnnotations(ASTNode.java:639)
-// many syntax errors fixed, does not trigger CCE
+// Bug 366003 - CCE in ASTNode.resolveAnnotations(ASTNode.java:639)
+// many syntax errors fixed, does not trigger CCE
public void testBug366003() {
runNegativeTest(
new String[] {
"snippet/Bug366003.java",
"package snippet;\n" +
- "public class Bug366003 {\n" +
- " public void foo(@NonNull Object o1) {\n" +
+ "public class Bug366003 {\n" +
+ " public void foo(@NonNull Object o1) {\n" +
" System.out.println(o1.toString()); // OK: o1 cannot be null\n" +
- " } \n" +
+ " } \n" +
" @NonNull Object bar(@Nullable String s1) {\n" +
" foo(null); // cannot pass null argument\n" +
" @NonNull String s= null; // cannot assign null value\n" +
- " @NonNull String t= s1; // cannot assign potentially null value\n" +
+ " @NonNull String t= s1; // cannot assign potentially null value\n" +
" return null; // cannot return null value\n" +
- " }\n" +
- "}\n" +
- "org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
+ " }\n" +
+ "}\n" +
+ "org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
""
},
- "----------\n" +
- "1. ERROR in snippet\\Bug366003.java (at line 3)\n" +
- " public void foo(@NonNull Object o1) {\n" +
- " ^^^^^^^\n" +
- "NonNull cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in snippet\\Bug366003.java (at line 6)\n" +
- " @NonNull Object bar(@Nullable String s1) {\n" +
- " ^^^^^^^\n" +
- "NonNull cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in snippet\\Bug366003.java (at line 6)\n" +
- " @NonNull Object bar(@Nullable String s1) {\n" +
- " ^^^^^^^^\n" +
- "Nullable cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in snippet\\Bug366003.java (at line 8)\n" +
- " @NonNull String s= null; // cannot assign null value\n" +
- " ^^^^^^^\n" +
- "NonNull cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in snippet\\Bug366003.java (at line 9)\n" +
- " @NonNull String t= s1; // cannot assign potentially null value\n" +
- " ^^^^^^^\n" +
- "NonNull cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in snippet\\Bug366003.java (at line 12)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
- "----------\n" +
- "7. ERROR in snippet\\Bug366003.java (at line 13)\n" +
- " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
- " ^^^^\n" +
- "Syntax error, insert \"Identifier (\" to complete MethodHeaderName\n" +
- "----------\n" +
- "8. ERROR in snippet\\Bug366003.java (at line 13)\n" +
- " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
+ "----------\n" +
+ "1. ERROR in snippet\\Bug366003.java (at line 3)\n" +
+ " public void foo(@NonNull Object o1) {\n" +
+ " ^^^^^^^\n" +
+ "NonNull cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in snippet\\Bug366003.java (at line 6)\n" +
+ " @NonNull Object bar(@Nullable String s1) {\n" +
+ " ^^^^^^^\n" +
+ "NonNull cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in snippet\\Bug366003.java (at line 6)\n" +
+ " @NonNull Object bar(@Nullable String s1) {\n" +
+ " ^^^^^^^^\n" +
+ "Nullable cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in snippet\\Bug366003.java (at line 8)\n" +
+ " @NonNull String s= null; // cannot assign null value\n" +
+ " ^^^^^^^\n" +
+ "NonNull cannot be resolved to a type\n" +
+ "----------\n" +
+ "5. ERROR in snippet\\Bug366003.java (at line 9)\n" +
+ " @NonNull String t= s1; // cannot assign potentially null value\n" +
+ " ^^^^^^^\n" +
+ "NonNull cannot be resolved to a type\n" +
+ "----------\n" +
+ "6. ERROR in snippet\\Bug366003.java (at line 12)\n" +
+ " }\n" +
+ " ^\n" +
+ "Syntax error on token \"}\", delete this token\n" +
+ "----------\n" +
+ "7. ERROR in snippet\\Bug366003.java (at line 13)\n" +
+ " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
+ " ^^^^\n" +
+ "Syntax error, insert \"Identifier (\" to complete MethodHeaderName\n" +
+ "----------\n" +
+ "8. ERROR in snippet\\Bug366003.java (at line 13)\n" +
+ " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
" ^^^^\n" +
//{ObjectTeams: starting from here the OT/J grammar produces different errors:
// different:
"Syntax error, insert \")\" to complete MethodSpecLong\n" +
- "----------\n" +
- "9. ERROR in snippet\\Bug366003.java (at line 13)\n" +
- " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
- " ^^^^\n" +
- "Syntax error, insert \"<-\" to complete CallinBindingLeft\n" +
+ "----------\n" +
+ "9. ERROR in snippet\\Bug366003.java (at line 13)\n" +
+ " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
+ " ^^^^\n" +
+ "Syntax error, insert \"<-\" to complete CallinBindingLeft\n" +
//
- "----------\n" +
- "10. ERROR in snippet\\Bug366003.java (at line 13)\n" +
- " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
- " ^^^^\n" +
+ "----------\n" +
+ "10. ERROR in snippet\\Bug366003.java (at line 13)\n" +
+ " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
+ " ^^^^\n" +
// new
- "Syntax error, insert \"MethodSpecsLong EmptyParameterMappings\" to complete InvalidCallinBinding\n" +
+ "Syntax error, insert \"MethodSpecsLong EmptyParameterMappings\" to complete InvalidCallinBinding\n" +
"----------\n" +
// number changes beyond this point
- "11. ERROR in snippet\\Bug366003.java (at line 13)\n" +
- " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
- " ^^^^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n" +
- "12. ERROR in snippet\\Bug366003.java (at line 13)\n" +
- " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Return type for the method is missing\n" +
- "----------\n" +
- "13. ERROR in snippet\\Bug366003.java (at line 13)\n" +
- " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
- " ^^^^^^^\n" +
- "NonNull cannot be resolved to a type\n" +
- "----------\n" +
- "14. ERROR in snippet\\Bug366003.java (at line 13)\n" +
- " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
- " ^^^^^^^^\n" +
- "Nullable cannot be resolved to a type\n" +
- "----------\n" +
- "15. ERROR in snippet\\Bug366003.java (at line 13)\n" +
+ "11. ERROR in snippet\\Bug366003.java (at line 13)\n" +
+ " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
+ " ^^^^\n" +
+ "Syntax error, insert \"}\" to complete ClassBody\n" +
+ "----------\n" +
+ "12. ERROR in snippet\\Bug366003.java (at line 13)\n" +
+ " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Return type for the method is missing\n" +
+ "----------\n" +
+ "13. ERROR in snippet\\Bug366003.java (at line 13)\n" +
+ " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
+ " ^^^^^^^\n" +
+ "NonNull cannot be resolved to a type\n" +
+ "----------\n" +
+ "14. ERROR in snippet\\Bug366003.java (at line 13)\n" +
+ " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
+ " ^^^^^^^^\n" +
+ "Nullable cannot be resolved to a type\n" +
+ "----------\n" +
+ "15. ERROR in snippet\\Bug366003.java (at line 13)\n" +
// SH}
- " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
- " ^\n" +
- "Syntax error, insert \";\" to complete ConstructorDeclaration\n" +
+ " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
+ " ^\n" +
+ "Syntax error, insert \";\" to complete ConstructorDeclaration\n" +
"----------\n");
}
-// Bug 366003 - CCE in ASTNode.resolveAnnotations(ASTNode.java:639)
-// code is garbage, triggers CCE
+// Bug 366003 - CCE in ASTNode.resolveAnnotations(ASTNode.java:639)
+// code is garbage, triggers CCE
public void testBug366003b() {
runNegativeTest(
new String[] {
@@ -10136,142 +10136,142 @@ public void testBug366003b() {
"org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
""
},
- "----------\n" +
- "1. ERROR in snippet\\Bug366003.java (at line 3)\n" +
- " public void foo(@Blah Object o1) { \n" +
- " ^^^^\n" +
- "Blah cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in snippet\\Bug366003.java (at line 4)\n" +
- " System.out.println(o1.toString()); // OK: o1 cannot be null } \n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete MethodBody\n" +
- "----------\n" +
- "3. ERROR in snippet\\Bug366003.java (at line 5)\n" +
- " @Blah Object bar(@BlahBlah String s1) { foo(null); // cannot pass\n" +
- " ^^^^\n" +
- "Blah cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in snippet\\Bug366003.java (at line 5)\n" +
- " @Blah Object bar(@BlahBlah String s1) { foo(null); // cannot pass\n" +
- " ^^^^^^^^\n" +
- "BlahBlah cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in snippet\\Bug366003.java (at line 6)\n" +
- " null argument @Blah String s= null; // cannot assign null value \n" +
- " ^^^^\n" +
- "Syntax error on token \"null\", @ expected\n" +
- "----------\n" +
- "6. ERROR in snippet\\Bug366003.java (at line 11)\n" +
- " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
- " ^^^^\n" +
- "Syntax error, insert \"Identifier (\" to complete MethodHeaderName\n" +
- "----------\n" +
- "7. ERROR in snippet\\Bug366003.java (at line 11)\n" +
- " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
- " ^^^^\n" +
+ "----------\n" +
+ "1. ERROR in snippet\\Bug366003.java (at line 3)\n" +
+ " public void foo(@Blah Object o1) { \n" +
+ " ^^^^\n" +
+ "Blah cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in snippet\\Bug366003.java (at line 4)\n" +
+ " System.out.println(o1.toString()); // OK: o1 cannot be null } \n" +
+ " ^\n" +
+ "Syntax error, insert \"}\" to complete MethodBody\n" +
+ "----------\n" +
+ "3. ERROR in snippet\\Bug366003.java (at line 5)\n" +
+ " @Blah Object bar(@BlahBlah String s1) { foo(null); // cannot pass\n" +
+ " ^^^^\n" +
+ "Blah cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in snippet\\Bug366003.java (at line 5)\n" +
+ " @Blah Object bar(@BlahBlah String s1) { foo(null); // cannot pass\n" +
+ " ^^^^^^^^\n" +
+ "BlahBlah cannot be resolved to a type\n" +
+ "----------\n" +
+ "5. ERROR in snippet\\Bug366003.java (at line 6)\n" +
+ " null argument @Blah String s= null; // cannot assign null value \n" +
+ " ^^^^\n" +
+ "Syntax error on token \"null\", @ expected\n" +
+ "----------\n" +
+ "6. ERROR in snippet\\Bug366003.java (at line 11)\n" +
+ " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
+ " ^^^^\n" +
+ "Syntax error, insert \"Identifier (\" to complete MethodHeaderName\n" +
+ "----------\n" +
+ "7. ERROR in snippet\\Bug366003.java (at line 11)\n" +
+ " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
+ " ^^^^\n" +
//{ObjectTeams: starting from here the OT/J grammar produces different errors:
// different:
"Syntax error, insert \")\" to complete MethodSpecLong\n" +
- "----------\n" +
- "8. ERROR in snippet\\Bug366003.java (at line 11)\n" +
- " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
- " ^^^^\n" +
- "Syntax error, insert \"<-\" to complete CallinBindingLeft\n" +
+ "----------\n" +
+ "8. ERROR in snippet\\Bug366003.java (at line 11)\n" +
+ " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
+ " ^^^^\n" +
+ "Syntax error, insert \"<-\" to complete CallinBindingLeft\n" +
//
- "----------\n" +
+ "----------\n" +
// new
- "9. ERROR in snippet\\Bug366003.java (at line 11)\n" +
- " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
- " ^^^^\n" +
- "Syntax error, insert \"MethodSpecsLong EmptyParameterMappings\" to complete InvalidCallinBinding\n" +
+ "9. ERROR in snippet\\Bug366003.java (at line 11)\n" +
+ " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
+ " ^^^^\n" +
+ "Syntax error, insert \"MethodSpecsLong EmptyParameterMappings\" to complete InvalidCallinBinding\n" +
// number changes beyond this point
- "----------\n" +
- "10. ERROR in snippet\\Bug366003.java (at line 11)\n" +
- " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
- " ^^^^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n" +
- "11. ERROR in snippet\\Bug366003.java (at line 11)\n" +
- " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Return type for the method is missing\n" +
- "----------\n" +
- "12. ERROR in snippet\\Bug366003.java (at line 11)\n" +
- " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
- " ^^^^^^^\n" +
- "NonNull cannot be resolved to a type\n" +
- "----------\n" +
- "13. ERROR in snippet\\Bug366003.java (at line 11)\n" +
- " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
- " ^^^^^^^^\n" +
- "Nullable cannot be resolved to a type\n" +
- "----------\n" +
+ "----------\n" +
+ "10. ERROR in snippet\\Bug366003.java (at line 11)\n" +
+ " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
+ " ^^^^\n" +
+ "Syntax error, insert \"}\" to complete ClassBody\n" +
+ "----------\n" +
+ "11. ERROR in snippet\\Bug366003.java (at line 11)\n" +
+ " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Return type for the method is missing\n" +
+ "----------\n" +
+ "12. ERROR in snippet\\Bug366003.java (at line 11)\n" +
+ " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
+ " ^^^^^^^\n" +
+ "NonNull cannot be resolved to a type\n" +
+ "----------\n" +
+ "13. ERROR in snippet\\Bug366003.java (at line 11)\n" +
+ " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
+ " ^^^^^^^^\n" +
+ "Nullable cannot be resolved to a type\n" +
+ "----------\n" +
"14. ERROR in snippet\\Bug366003.java (at line 11)\n" +
// SH}
- " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
- " ^\n" +
- "Syntax error, insert \";\" to complete ConstructorDeclaration\n" +
+ " org.eclipse.User.User(@NonNull String name, int uid, @Nullable String email)\n" +
+ " ^\n" +
+ "Syntax error, insert \";\" to complete ConstructorDeclaration\n" +
"----------\n");
}
-// Bug 366003 - CCE in ASTNode.resolveAnnotations(ASTNode.java:639)
-// minimal syntax error to trigger CCE
+// Bug 366003 - CCE in ASTNode.resolveAnnotations(ASTNode.java:639)
+// minimal syntax error to trigger CCE
public void testBug366003c() {
runNegativeTest(
new String[] {
"snippet/Bug366003.java",
"package snippet;\n" +
"public class Bug366003 {\n" +
- " void foo(Object o1) {\n" +
- " }\n" +
+ " void foo(Object o1) {\n" +
+ " }\n" +
"org.User(@Bla String a)"
},
- "----------\n" +
- "1. ERROR in snippet\\Bug366003.java (at line 5)\n" +
- " org.User(@Bla String a)\n" +
- " ^^^\n" +
- "Syntax error, insert \"Identifier (\" to complete MethodHeaderName\n" +
- "----------\n" +
- "2. ERROR in snippet\\Bug366003.java (at line 5)\n" +
- " org.User(@Bla String a)\n" +
+ "----------\n" +
+ "1. ERROR in snippet\\Bug366003.java (at line 5)\n" +
+ " org.User(@Bla String a)\n" +
+ " ^^^\n" +
+ "Syntax error, insert \"Identifier (\" to complete MethodHeaderName\n" +
+ "----------\n" +
+ "2. ERROR in snippet\\Bug366003.java (at line 5)\n" +
+ " org.User(@Bla String a)\n" +
" ^^^\n" +
//{ObjectTeams: starting from here the OT/J grammar produces different errors:
// different:
"Syntax error, insert \")\" to complete MethodSpecLong\n" +
- "----------\n" +
- "3. ERROR in snippet\\Bug366003.java (at line 5)\n" +
- " org.User(@Bla String a)\n" +
- " ^^^\n" +
- "Syntax error, insert \"<-\" to complete CallinBindingLeft\n" +
+ "----------\n" +
+ "3. ERROR in snippet\\Bug366003.java (at line 5)\n" +
+ " org.User(@Bla String a)\n" +
+ " ^^^\n" +
+ "Syntax error, insert \"<-\" to complete CallinBindingLeft\n" +
//
"----------\n" +
// new
- "4. ERROR in snippet\\Bug366003.java (at line 5)\n" +
- " org.User(@Bla String a)\n" +
- " ^^^\n" +
+ "4. ERROR in snippet\\Bug366003.java (at line 5)\n" +
+ " org.User(@Bla String a)\n" +
+ " ^^^\n" +
"Syntax error, insert \"MethodSpecsLong EmptyParameterMappings\" to complete InvalidCallinBinding\n" +
// number changes beyond this point
- "----------\n" +
- "5. ERROR in snippet\\Bug366003.java (at line 5)\n" +
- " org.User(@Bla String a)\n" +
- " ^^^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n" +
- "6. ERROR in snippet\\Bug366003.java (at line 5)\n" +
- " org.User(@Bla String a)\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Return type for the method is missing\n" +
- "----------\n" +
- "7. ERROR in snippet\\Bug366003.java (at line 5)\n" +
- " org.User(@Bla String a)\n" +
- " ^^^\n" +
- "Bla cannot be resolved to a type\n" +
+ "----------\n" +
+ "5. ERROR in snippet\\Bug366003.java (at line 5)\n" +
+ " org.User(@Bla String a)\n" +
+ " ^^^\n" +
+ "Syntax error, insert \"}\" to complete ClassBody\n" +
+ "----------\n" +
+ "6. ERROR in snippet\\Bug366003.java (at line 5)\n" +
+ " org.User(@Bla String a)\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Return type for the method is missing\n" +
+ "----------\n" +
+ "7. ERROR in snippet\\Bug366003.java (at line 5)\n" +
+ " org.User(@Bla String a)\n" +
+ " ^^^\n" +
+ "Bla cannot be resolved to a type\n" +
"----------\n" +
// SH}
- "8. ERROR in snippet\\Bug366003.java (at line 5)\n" +
- " org.User(@Bla String a)\n" +
- " ^\n" +
- "Syntax error, insert \";\" to complete ConstructorDeclaration\n" +
+ "8. ERROR in snippet\\Bug366003.java (at line 5)\n" +
+ " org.User(@Bla String a)\n" +
+ " ^\n" +
+ "Syntax error, insert \";\" to complete ConstructorDeclaration\n" +
"----------\n");
}
// unfinished attempt to trigger the same CCE via catch formal parameters
@@ -10290,26 +10290,26 @@ public void testBug366003d() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in snippet\\Bug366003.java (at line 7)\n" +
- " e } catch (@Blah Exception eSecond) {\n" +
- " ^\n" +
- "Syntax error, insert \"VariableDeclarators\" to complete LocalVariableDeclaration\n" +
- "----------\n" +
- "2. ERROR in snippet\\Bug366003.java (at line 7)\n" +
- " e } catch (@Blah Exception eSecond) {\n" +
- " ^\n" +
- "Syntax error, insert \";\" to complete BlockStatements\n" +
- "----------\n" +
- "3. ERROR in snippet\\Bug366003.java (at line 8)\n" +
- " e }\n" +
- " ^\n" +
- "Syntax error, insert \"VariableDeclarators\" to complete LocalVariableDeclaration\n" +
- "----------\n" +
- "4. ERROR in snippet\\Bug366003.java (at line 8)\n" +
- " e }\n" +
- " ^\n" +
- "Syntax error, insert \";\" to complete BlockStatements\n" +
+ "----------\n" +
+ "1. ERROR in snippet\\Bug366003.java (at line 7)\n" +
+ " e } catch (@Blah Exception eSecond) {\n" +
+ " ^\n" +
+ "Syntax error, insert \"VariableDeclarators\" to complete LocalVariableDeclaration\n" +
+ "----------\n" +
+ "2. ERROR in snippet\\Bug366003.java (at line 7)\n" +
+ " e } catch (@Blah Exception eSecond) {\n" +
+ " ^\n" +
+ "Syntax error, insert \";\" to complete BlockStatements\n" +
+ "----------\n" +
+ "3. ERROR in snippet\\Bug366003.java (at line 8)\n" +
+ " e }\n" +
+ " ^\n" +
+ "Syntax error, insert \"VariableDeclarators\" to complete LocalVariableDeclaration\n" +
+ "----------\n" +
+ "4. ERROR in snippet\\Bug366003.java (at line 8)\n" +
+ " e }\n" +
+ " ^\n" +
+ "Syntax error, insert \";\" to complete BlockStatements\n" +
"----------\n");
}
public void testBug366003e() {
@@ -10322,25 +10322,25 @@ public void testBug366003e() {
" @Blah org.User(@Bla String str){}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in snippet\\Bug366003.java (at line 4)\n" +
- " @Blah org.User(@Bla String str){}\n" +
- " ^^^^\n" +
- "Blah cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in snippet\\Bug366003.java (at line 4)\n" +
- " @Blah org.User(@Bla String str){}\n" +
- " ^^^^\n" +
- "Syntax error on token \"User\", Identifier expected after this token\n" +
- "----------\n" +
- "3. ERROR in snippet\\Bug366003.java (at line 4)\n" +
- " @Blah org.User(@Bla String str){}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Return type for the method is missing\n" +
- "----------\n" +
- "4. ERROR in snippet\\Bug366003.java (at line 4)\n" +
- " @Blah org.User(@Bla String str){}\n" +
- " ^^^\n" +
+ "----------\n" +
+ "1. ERROR in snippet\\Bug366003.java (at line 4)\n" +
+ " @Blah org.User(@Bla String str){}\n" +
+ " ^^^^\n" +
+ "Blah cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in snippet\\Bug366003.java (at line 4)\n" +
+ " @Blah org.User(@Bla String str){}\n" +
+ " ^^^^\n" +
+ "Syntax error on token \"User\", Identifier expected after this token\n" +
+ "----------\n" +
+ "3. ERROR in snippet\\Bug366003.java (at line 4)\n" +
+ " @Blah org.User(@Bla String str){}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Return type for the method is missing\n" +
+ "----------\n" +
+ "4. ERROR in snippet\\Bug366003.java (at line 4)\n" +
+ " @Blah org.User(@Bla String str){}\n" +
+ " ^^^\n" +
"Bla cannot be resolved to a type\n" +
"----------\n");
}
@@ -10373,22 +10373,22 @@ public void testBug365437a() {
"package p1;\n" +
"public @interface PostConstruct{}"
};
- String expectedErrorString =
- "----------\n" +
- "1. WARNING in p\\A.java (at line 8)\n" +
- " @SuppressWarnings(\"null\")\n" +
- " ^^^^^^\n" +
- "Unnecessary @SuppressWarnings(\"null\")\n" +
- "----------\n" +
- "2. ERROR in p\\A.java (at line 13)\n" +
- " @Deprecated private void foo3(){}}\n" +
- " ^^^^^^\n" +
- "The method foo3() from the type A is never used locally\n" +
+ String expectedErrorString =
+ "----------\n" +
+ "1. WARNING in p\\A.java (at line 8)\n" +
+ " @SuppressWarnings(\"null\")\n" +
+ " ^^^^^^\n" +
+ "Unnecessary @SuppressWarnings(\"null\")\n" +
+ "----------\n" +
+ "2. ERROR in p\\A.java (at line 13)\n" +
+ " @Deprecated private void foo3(){}}\n" +
+ " ^^^^^^\n" +
+ "The method foo3() from the type A is never used locally\n" +
"----------\n";
runNegativeTest(
true,
testFiles,
- null,
+ null,
customOptions,
expectedErrorString,
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
@@ -10428,12 +10428,12 @@ public void testBug365437b() {
"public @interface NonNull {\n" +
"}"
};
- String expectedErrorString =
- "----------\n" +
- "1. ERROR in A.java (at line 16)\n" +
- " private Object foo3a(){ return new Object();}\n" +
- " ^^^^^^^\n" +
- "The method foo3a() from the type A is never used locally\n" +
+ String expectedErrorString =
+ "----------\n" +
+ "1. ERROR in A.java (at line 16)\n" +
+ " private Object foo3a(){ return new Object();}\n" +
+ " ^^^^^^^\n" +
+ "The method foo3a() from the type A is never used locally\n" +
"----------\n";
INameEnvironment save = this.javaClassLib;
try {
@@ -10483,22 +10483,22 @@ public void testBug365437c() {
"package p1;\n" +
"public @interface PostConstruct{}"
};
- String expectedErrorString =
- "----------\n" +
- "1. WARNING in p\\A.java (at line 8)\n" +
- " @SuppressWarnings(\"null\")\n" +
- " ^^^^^^\n" +
- "Unnecessary @SuppressWarnings(\"null\")\n" +
- "----------\n" +
- "2. ERROR in p\\A.java (at line 13)\n" +
- " @SafeVarargs private final void foo3(Object... o){}}\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The method foo3(Object...) from the type A is never used locally\n" +
+ String expectedErrorString =
+ "----------\n" +
+ "1. WARNING in p\\A.java (at line 8)\n" +
+ " @SuppressWarnings(\"null\")\n" +
+ " ^^^^^^\n" +
+ "Unnecessary @SuppressWarnings(\"null\")\n" +
+ "----------\n" +
+ "2. ERROR in p\\A.java (at line 13)\n" +
+ " @SafeVarargs private final void foo3(Object... o){}}\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The method foo3(Object...) from the type A is never used locally\n" +
"----------\n";
runNegativeTest(
true,
testFiles,
- null,
+ null,
customOptions,
expectedErrorString,
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
@@ -10560,26 +10560,26 @@ public void testBug365437d() {
"}"
},
null, customOptions,
- "----------\n" +
- "1. ERROR in Example.java (at line 10)\n" +
- " private E1() {}\n" +
- " ^^^^\n" +
- "The constructor E1() is never used locally\n" +
- "----------\n" +
- "2. WARNING in Example.java (at line 14)\n" +
- " @SuppressWarnings(\"null\")\n" +
- " ^^^^^^\n" +
- "Unnecessary @SuppressWarnings(\"null\")\n" +
- "----------\n" +
- "3. ERROR in Example.java (at line 15)\n" +
- " private E2() {}\n" +
- " ^^^^\n" +
- "The constructor E2() is never used locally\n" +
- "----------\n" +
- "4. ERROR in Example.java (at line 20)\n" +
- " private E3() {}\n" +
- " ^^^^\n" +
- "The constructor E3() is never used locally\n" +
+ "----------\n" +
+ "1. ERROR in Example.java (at line 10)\n" +
+ " private E1() {}\n" +
+ " ^^^^\n" +
+ "The constructor E1() is never used locally\n" +
+ "----------\n" +
+ "2. WARNING in Example.java (at line 14)\n" +
+ " @SuppressWarnings(\"null\")\n" +
+ " ^^^^^^\n" +
+ "Unnecessary @SuppressWarnings(\"null\")\n" +
+ "----------\n" +
+ "3. ERROR in Example.java (at line 15)\n" +
+ " private E2() {}\n" +
+ " ^^^^\n" +
+ "The constructor E2() is never used locally\n" +
+ "----------\n" +
+ "4. ERROR in Example.java (at line 20)\n" +
+ " private E3() {}\n" +
+ " ^^^^\n" +
+ "The constructor E3() is never used locally\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -10633,26 +10633,26 @@ public void testBug365437e() {
"}"
},
null, customOptions,
- "----------\n" +
- "1. ERROR in Example.java (at line 7)\n" +
- " private int E1;\n" +
- " ^^\n" +
- "The value of the field E1.E1 is not used\n" +
- "----------\n" +
- "2. WARNING in Example.java (at line 10)\n" +
- " @SuppressWarnings(\"null\")\n" +
- " ^^^^^^\n" +
- "Unnecessary @SuppressWarnings(\"null\")\n" +
- "----------\n" +
- "3. ERROR in Example.java (at line 11)\n" +
- " private int E2;\n" +
- " ^^\n" +
- "The value of the field E2.E2 is not used\n" +
- "----------\n" +
- "4. ERROR in Example.java (at line 15)\n" +
- " private Object E3 = new Object();\n" +
- " ^^\n" +
- "The value of the field E3.E3 is not used\n" +
+ "----------\n" +
+ "1. ERROR in Example.java (at line 7)\n" +
+ " private int E1;\n" +
+ " ^^\n" +
+ "The value of the field E1.E1 is not used\n" +
+ "----------\n" +
+ "2. WARNING in Example.java (at line 10)\n" +
+ " @SuppressWarnings(\"null\")\n" +
+ " ^^^^^^\n" +
+ "Unnecessary @SuppressWarnings(\"null\")\n" +
+ "----------\n" +
+ "3. ERROR in Example.java (at line 11)\n" +
+ " private int E2;\n" +
+ " ^^\n" +
+ "The value of the field E2.E2 is not used\n" +
+ "----------\n" +
+ "4. ERROR in Example.java (at line 15)\n" +
+ " private Object E3 = new Object();\n" +
+ " ^^\n" +
+ "The value of the field E3.E3 is not used\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -10706,26 +10706,26 @@ public void testBug365437f() {
"}"
},
null, customOptions,
- "----------\n" +
- "1. ERROR in Example.java (at line 7)\n" +
- " private class E11{}\n" +
- " ^^^\n" +
- "The type E1.E11 is never used locally\n" +
- "----------\n" +
- "2. WARNING in Example.java (at line 10)\n" +
- " @SuppressWarnings(\"null\")\n" +
- " ^^^^^^\n" +
- "Unnecessary @SuppressWarnings(\"null\")\n" +
- "----------\n" +
- "3. ERROR in Example.java (at line 11)\n" +
- " private class E22{}\n" +
- " ^^^\n" +
- "The type E2.E22 is never used locally\n" +
- "----------\n" +
- "4. ERROR in Example.java (at line 15)\n" +
- " private class E33{}\n" +
- " ^^^\n" +
- "The type E3.E33 is never used locally\n" +
+ "----------\n" +
+ "1. ERROR in Example.java (at line 7)\n" +
+ " private class E11{}\n" +
+ " ^^^\n" +
+ "The type E1.E11 is never used locally\n" +
+ "----------\n" +
+ "2. WARNING in Example.java (at line 10)\n" +
+ " @SuppressWarnings(\"null\")\n" +
+ " ^^^^^^\n" +
+ "Unnecessary @SuppressWarnings(\"null\")\n" +
+ "----------\n" +
+ "3. ERROR in Example.java (at line 11)\n" +
+ " private class E22{}\n" +
+ " ^^^\n" +
+ "The type E2.E22 is never used locally\n" +
+ "----------\n" +
+ "4. ERROR in Example.java (at line 15)\n" +
+ " private class E33{}\n" +
+ " ^^^\n" +
+ "The type E3.E33 is never used locally\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -10751,13 +10751,13 @@ public void testBug376590a() {
"}\n"
},
null, customOptions,
- "----------\n" +
- "1. ERROR in Example.java (at line 3)\n" +
- " private @Inject Object o;\n" +
- " ^\n" +
- "The value of the field Example.o is not used\n" +
+ "----------\n" +
+ "1. ERROR in Example.java (at line 3)\n" +
+ " private @Inject Object o;\n" +
+ " ^\n" +
+ "The value of the field Example.o is not used\n" +
"----------\n",
- JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
+ JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
// https://bugs.eclipse.org/376590 - Private fields with @Inject are ignored by unused field validation
// using javax.inject.Inject - slight variation
@@ -10779,18 +10779,18 @@ public void testBug376590b() {
"}\n"
},
null, customOptions,
- "----------\n" +
- "1. ERROR in Example.java (at line 2)\n" +
- " private @javax.inject.Inject Object o;\n" +
- " ^\n" +
- "The value of the field Example.o is not used\n" +
- "----------\n" +
- "2. ERROR in Example.java (at line 3)\n" +
- " private Example() {} // also warn here: no @Inject\n" +
- " ^^^^^^^^^\n" +
- "The constructor Example() is never used locally\n" +
+ "----------\n" +
+ "1. ERROR in Example.java (at line 2)\n" +
+ " private @javax.inject.Inject Object o;\n" +
+ " ^\n" +
+ "The value of the field Example.o is not used\n" +
+ "----------\n" +
+ "2. ERROR in Example.java (at line 3)\n" +
+ " private Example() {} // also warn here: no @Inject\n" +
+ " ^^^^^^^^^\n" +
+ "The constructor Example() is never used locally\n" +
"----------\n",
- JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
+ JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
// https://bugs.eclipse.org/376590 - Private fields with @Inject are ignored by unused field validation
// using javax.inject.Inject, combined with standard as well as custom annotations
@@ -10828,18 +10828,18 @@ public void testBug376590c() {
"}"
},
null, customOptions,
- "----------\n" +
- "1. ERROR in Example.java (at line 3)\n" +
- " private @Inject @p.NonNull Object o; // do warn, annotations don't signal a read\n" +
- " ^\n" +
- "The value of the field Example.o is not used\n" +
- "----------\n" +
- "2. ERROR in Example.java (at line 4)\n" +
- " private @Deprecated @Inject String old; // do warn, annotations don't signal a read\n" +
- " ^^^\n" +
- "The value of the field Example.old is not used\n" +
+ "----------\n" +
+ "1. ERROR in Example.java (at line 3)\n" +
+ " private @Inject @p.NonNull Object o; // do warn, annotations don't signal a read\n" +
+ " ^\n" +
+ "The value of the field Example.o is not used\n" +
+ "----------\n" +
+ "2. ERROR in Example.java (at line 4)\n" +
+ " private @Deprecated @Inject String old; // do warn, annotations don't signal a read\n" +
+ " ^^^\n" +
+ "The value of the field Example.old is not used\n" +
"----------\n",
- JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
+ JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
public void testBug376429a() {
@@ -10852,31 +10852,31 @@ public void testBug376429a() {
" @Try u();\n"+
"}"
},
- "----------\n" +
- "1. ERROR in Try.java (at line 3)\n" +
- " @Try t();\n" +
- " ^^^^\n" +
- "The annotation @Try must define the attribute value\n" +
- "----------\n" +
- "2. ERROR in Try.java (at line 3)\n" +
- " @Try t();\n" +
- " ^^^\n" +
- "Return type for the method is missing\n" +
- "----------\n" +
- "3. ERROR in Try.java (at line 3)\n" +
- " @Try t();\n" +
- " ^^^\n" +
- "Return type for the method is missing\n" +
- "----------\n" +
- "4. ERROR in Try.java (at line 4)\n" +
- " @Try u();\n" +
- " ^^^^\n" +
- "The annotation @Try must define the attribute value\n" +
- "----------\n" +
- "5. ERROR in Try.java (at line 4)\n" +
- " @Try u();\n" +
- " ^^^\n" +
- "Return type for the method is missing\n" +
+ "----------\n" +
+ "1. ERROR in Try.java (at line 3)\n" +
+ " @Try t();\n" +
+ " ^^^^\n" +
+ "The annotation @Try must define the attribute value\n" +
+ "----------\n" +
+ "2. ERROR in Try.java (at line 3)\n" +
+ " @Try t();\n" +
+ " ^^^\n" +
+ "Return type for the method is missing\n" +
+ "----------\n" +
+ "3. ERROR in Try.java (at line 3)\n" +
+ " @Try t();\n" +
+ " ^^^\n" +
+ "Return type for the method is missing\n" +
+ "----------\n" +
+ "4. ERROR in Try.java (at line 4)\n" +
+ " @Try u();\n" +
+ " ^^^^\n" +
+ "The annotation @Try must define the attribute value\n" +
+ "----------\n" +
+ "5. ERROR in Try.java (at line 4)\n" +
+ " @Try u();\n" +
+ " ^^^\n" +
+ "Return type for the method is missing\n" +
"----------\n");
}
public void testBug376429b() {
@@ -10888,16 +10888,16 @@ public void testBug376429b() {
" byte[] value(); \n" +
"}"
},
- "----------\n" +
- "1. ERROR in Try.java (at line 2)\n" +
- " @Try t();\n" +
- " ^^^^\n" +
- "The annotation @Try must define the attribute value\n" +
- "----------\n" +
- "2. ERROR in Try.java (at line 2)\n" +
- " @Try t();\n" +
- " ^^^\n" +
- "Return type for the method is missing\n" +
+ "----------\n" +
+ "1. ERROR in Try.java (at line 2)\n" +
+ " @Try t();\n" +
+ " ^^^^\n" +
+ "The annotation @Try must define the attribute value\n" +
+ "----------\n" +
+ "2. ERROR in Try.java (at line 2)\n" +
+ " @Try t();\n" +
+ " ^^^\n" +
+ "Return type for the method is missing\n" +
"----------\n");
}
@@ -10918,17 +10918,17 @@ public void testBug371832() throws Exception {
" }\n"+
"}\n"
};
- String expectedErrorString =
- "----------\n" +
- "1. ERROR in A.java (at line 1)\n" +
- " import java.util.List;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The import java.util.List is never used\n" +
+ String expectedErrorString =
+ "----------\n" +
+ "1. ERROR in A.java (at line 1)\n" +
+ " import java.util.List;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The import java.util.List is never used\n" +
"----------\n";
runNegativeTest(
true,
testFiles,
- null,
+ null,
customOptions,
expectedErrorString,
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
@@ -10956,7 +10956,7 @@ public void testBug384663() {
"@Retention(RetentionPolicy.RUNTIME)\n" +
"@Target(ElementType.PACKAGE)\n" +
"public @interface AnnotationDefinition {\n" +
- " String value();\n" +
+ " String value();\n" +
"}",
};
runConformTest(testFiles);
@@ -10968,17 +10968,17 @@ public void _testBug386356_1() {
runConformTest(
new String[] {
"p/X.java",
- "package p;\n" +
- "import javax.xml.bind.annotation.adapters.XmlAdapter;\n" +
- "public abstract class X extends XmlAdapter<String,X> {\n" +
+ "package p;\n" +
+ "import javax.xml.bind.annotation.adapters.XmlAdapter;\n" +
+ "public abstract class X extends XmlAdapter<String,X> {\n" +
"}",
"p/package-info.java",
- "@XmlJavaTypeAdapters({ @XmlJavaTypeAdapter(value = X.class, type = X.class) })\n" +
- "package p;\n" +
- "import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; \n" +
+ "@XmlJavaTypeAdapters({ @XmlJavaTypeAdapter(value = X.class, type = X.class) })\n" +
+ "package p;\n" +
+ "import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; \n" +
"import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;"
-
+
});
}
@@ -11006,7 +11006,7 @@ public void testBug386356_2() {
"package com.ermahgerd;\n" +
"import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;\n" +
"import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;",
-
+
"com/ermahgerd/ErmahgerdXmlAdapter.java",
"package com.ermahgerd;\n" +
"\n" +
@@ -11045,9 +11045,9 @@ public void test398657() throws Exception {
new String[] {
"p/Annot.java",
"package p;\n" +
- "public @interface Annot {\n" +
- " static public enum E { A }\n" +
- " E getEnum();\n" +
+ "public @interface Annot {\n" +
+ " static public enum E { A }\n" +
+ " E getEnum();\n" +
"}",
"X.java",
"import static p.Annot.E.*;\n" +
@@ -11064,8 +11064,8 @@ public void test398657() throws Exception {
true);
String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #22 p/Annot$E, outer class info: #24 p/Annot\n" +
+ " Inner classes:\n" +
+ " [inner class info: #22 p/Annot$E, outer class info: #24 p/Annot\n" +
" inner name: #26 E, accessflags: 16409 public static final]\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator +"X.class", "X", expectedOutput, ClassFileBytesDisassembler.DETAILED);
@@ -11084,9 +11084,9 @@ public void test398657_2() throws Exception {
"p/Y.java",
"package p;\n" +
"public class Y {\n" +
- " static public @interface Annot {\n" +
+ " static public @interface Annot {\n" +
" int id();\n" +
- " }\n" +
+ " }\n" +
"}",
"X.java",
"import p.Y.Annot;\n" +
@@ -11102,8 +11102,8 @@ public void test398657_2() throws Exception {
true);
String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #21 p/Y$Annot, outer class info: #23 p/Y\n" +
+ " Inner classes:\n" +
+ " [inner class info: #21 p/Y$Annot, outer class info: #23 p/Y\n" +
" inner name: #25 Annot, accessflags: 9737 public abstract static]\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator +"X.class", "X", expectedOutput, ClassFileBytesDisassembler.DETAILED);
@@ -11120,16 +11120,16 @@ public void test384567() {
"@interface Foo {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in xy\\X.java (at line 1)\n" +
- " public final synchronized @Foo private package xy;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, modifiers are not allowed here\n" +
- "----------\n" +
- "2. ERROR in xy\\X.java (at line 1)\n" +
- " public final synchronized @Foo private package xy;\n" +
- " ^^^^\n" +
- "Package annotations must be in file package-info.java\n" +
+ "----------\n" +
+ "1. ERROR in xy\\X.java (at line 1)\n" +
+ " public final synchronized @Foo private package xy;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, modifiers are not allowed here\n" +
+ "----------\n" +
+ "2. ERROR in xy\\X.java (at line 1)\n" +
+ " public final synchronized @Foo private package xy;\n" +
+ " ^^^^\n" +
+ "Package annotations must be in file package-info.java\n" +
"----------\n");
}
//check invalid modifiers on package
@@ -11143,10 +11143,10 @@ public void test384567_2() {
"\n"
},
"----------\n" +
- "1. ERROR in xy\\X.java (at line 1)\n" +
- " public final synchronized private package xy;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, modifiers are not allowed here\n" +
+ "1. ERROR in xy\\X.java (at line 1)\n" +
+ " public final synchronized private package xy;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, modifiers are not allowed here\n" +
"----------\n");
}
// Bug 416107 - Incomplete error message for member interface and annotation
@@ -11201,27 +11201,27 @@ public void test427367() throws Exception {
this.runNegativeTest(
new String[] {
"X.java",
- "@interface Annot1 {\n" +
- " Thread.State value() default Thread.State.NEW;\n" +
- " int value2() default 1;\n" +
+ "@interface Annot1 {\n" +
+ " Thread.State value() default Thread.State.NEW;\n" +
+ " int value2() default 1;\n" +
"}\n" +
- "@interface Annot2 {\n" +
- " Thread.State value() default Thread.State.NEW;\n" +
+ "@interface Annot2 {\n" +
+ " Thread.State value() default Thread.State.NEW;\n" +
"}\n" +
"@Annot1(value = XXThread.State.BLOCKED, value2 = 42)\n" +
"@Annot2(value = XYThread.State.BLOCKED)\n" +
"public class X {}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " @Annot1(value = XXThread.State.BLOCKED, value2 = 42)\n" +
- " ^^^^^^^^\n" +
- "XXThread cannot be resolved to a variable\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " @Annot2(value = XYThread.State.BLOCKED)\n" +
- " ^^^^^^^^\n" +
- "XYThread cannot be resolved to a variable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " @Annot1(value = XXThread.State.BLOCKED, value2 = 42)\n" +
+ " ^^^^^^^^\n" +
+ "XXThread cannot be resolved to a variable\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " @Annot2(value = XYThread.State.BLOCKED)\n" +
+ " ^^^^^^^^\n" +
+ "XYThread cannot be resolved to a variable\n" +
"----------\n",
null,
true,
@@ -11230,22 +11230,22 @@ public void test427367() throws Exception {
false,
false);
- String expectedOutput = "@Annot1@Annot2\n" +
- "public class X {\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 3, Locals: 1\n" +
- " public X();\n" +
- " 0 new java.lang.Error [8]\n" +
- " 3 dup\n" +
- " 4 ldc <String \"Unresolved compilation problems: \\n\\tXXThread cannot be resolved to a variable\\n\\tXYThread cannot be resolved to a variable\\n\"> [10]\n" +
- " 6 invokespecial java.lang.Error(java.lang.String) [12]\n" +
- " 9 athrow\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 8]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 10] local: this index: 0 type: X\n" +
- "\n" +
+ String expectedOutput = "@Annot1@Annot2\n" +
+ "public class X {\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 3, Locals: 1\n" +
+ " public X();\n" +
+ " 0 new java.lang.Error [8]\n" +
+ " 3 dup\n" +
+ " 4 ldc <String \"Unresolved compilation problems: \\n\\tXXThread cannot be resolved to a variable\\n\\tXYThread cannot be resolved to a variable\\n\"> [10]\n" +
+ " 6 invokespecial java.lang.Error(java.lang.String) [12]\n" +
+ " 9 athrow\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 8]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 10] local: this index: 0 type: X\n" +
+ "\n" +
"}";
try {
checkDisassembledClassFile(OUTPUT_DIR + File.separator +"X.class", "X", expectedOutput, ClassFileBytesDisassembler.DETAILED);
@@ -11265,20 +11265,20 @@ public void test376977() throws Exception {
"@Outer(nest= {@Nested()})\n" +
"public class X {}",
"p/Outer.java",
- "package p;\n" +
- "public @interface Outer {\n" +
- " Nested[] nest();" +
+ "package p;\n" +
+ "public @interface Outer {\n" +
+ " Nested[] nest();" +
"}",
"p/Nested.java",
- "package p;\n" +
- "public @interface Nested {\n" +
+ "package p;\n" +
+ "public @interface Nested {\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " @Outer(nest= {@Nested()})\n" +
- " ^^^^^^\n" +
- "Nested cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " @Outer(nest= {@Nested()})\n" +
+ " ^^^^^^\n" +
+ "Nested cannot be resolved to a type\n" +
"----------\n",
null,
true,
@@ -11363,25 +11363,25 @@ public void test434556() throws Exception {
this.runNegativeTest(
new String[] {
"A.java",
- "import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface C {\n" +
- " int i();\n" +
- "}\n" +
- "public class A {\n" +
- " @C(b={},i=42)\n" +
- " public void xxx() {}\n" +
- " public static void main(String []argv) throws Exception {\n" +
- " System.out.println(A.class.getDeclaredMethod(\"xxx\").getAnnotations()[0]); \n" +
- " }\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface C {\n" +
+ " int i();\n" +
+ "}\n" +
+ "public class A {\n" +
+ " @C(b={},i=42)\n" +
+ " public void xxx() {}\n" +
+ " public static void main(String []argv) throws Exception {\n" +
+ " System.out.println(A.class.getDeclaredMethod(\"xxx\").getAnnotations()[0]); \n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in A.java (at line 8)\n" +
- " @C(b={},i=42)\n" +
- " ^\n" +
- "The attribute b is undefined for the annotation type C\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 8)\n" +
+ " @C(b={},i=42)\n" +
+ " ^\n" +
+ "The attribute b is undefined for the annotation type C\n" +
"----------\n",
null,
true,
@@ -11390,17 +11390,17 @@ public void test434556() throws Exception {
false,
false);
- String expectedOutput = "@C(i=(int) 42)\n" +
- " public void xxx();\n" +
- " 0 new java.lang.Error [20]\n" +
- " 3 dup\n" +
- " 4 ldc <String \"Unresolved compilation problem: \\n\\tThe attribute b is undefined for the annotation type C\\n\"> [22]\n" +
- " 6 invokespecial java.lang.Error(java.lang.String) [24]\n" +
- " 9 athrow\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 8]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 10] local: this index: 0 type: A\n" +
+ String expectedOutput = "@C(i=(int) 42)\n" +
+ " public void xxx();\n" +
+ " 0 new java.lang.Error [20]\n" +
+ " 3 dup\n" +
+ " 4 ldc <String \"Unresolved compilation problem: \\n\\tThe attribute b is undefined for the annotation type C\\n\"> [22]\n" +
+ " 6 invokespecial java.lang.Error(java.lang.String) [24]\n" +
+ " 9 athrow\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 8]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 10] local: this index: 0 type: A\n" +
" \n";
try {
checkDisassembledClassFile(OUTPUT_DIR + File.separator +"A.class", "A", expectedOutput, ClassFileBytesDisassembler.DETAILED);
@@ -11456,22 +11456,22 @@ public void test456960() throws Exception {
this.runNegativeTest(
new String[] {
"X.java",
- "@Bar(String)\n" +
+ "@Bar(String)\n" +
"public class X {\n" +
"}",
"Bar.java",
- "import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface Bar {\n" +
- " Class<?>[] value();\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface Bar {\n" +
+ " Class<?>[] value();\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " @Bar(String)\n" +
- " ^^^^^^\n" +
- "String cannot be resolved to a variable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " @Bar(String)\n" +
+ " ^^^^^^\n" +
+ "String cannot be resolved to a variable\n" +
"----------\n",
null,
true,
@@ -11481,20 +11481,20 @@ public void test456960() throws Exception {
false);
String expectedOutput =
- "public class X {\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 3, Locals: 1\n" +
- " public X();\n" +
- " 0 new java.lang.Error [8]\n" +
- " 3 dup\n" +
- " 4 ldc <String \"Unresolved compilation problem: \\n\\tString cannot be resolved to a variable\\n\"> [10]\n" +
- " 6 invokespecial java.lang.Error(java.lang.String) [12]\n" +
- " 9 athrow\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 10] local: this index: 0 type: X\n" +
+ "public class X {\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 3, Locals: 1\n" +
+ " public X();\n" +
+ " 0 new java.lang.Error [8]\n" +
+ " 3 dup\n" +
+ " 4 ldc <String \"Unresolved compilation problem: \\n\\tString cannot be resolved to a variable\\n\"> [10]\n" +
+ " 6 invokespecial java.lang.Error(java.lang.String) [12]\n" +
+ " 9 athrow\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 10] local: this index: 0 type: X\n" +
"}";
try {
checkDisassembledClassFile(OUTPUT_DIR + File.separator +"X.class", "X", expectedOutput, ClassFileBytesDisassembler.DETAILED);
@@ -11586,16 +11586,16 @@ public void testBug386692() {
"}\n"
},
null, customOptions,
- "----------\n" +
- "1. ERROR in Example.java (at line 2)\n" +
- " private @org.springframework.beans.factory.annotation.Autowired Object o;\n" +
- " ^\n" +
- "The value of the field Example.o is not used\n" +
- "----------\n" +
- "2. ERROR in Example.java (at line 3)\n" +
- " private Example() {}\n" +
- " ^^^^^^^^^\n" +
- "The constructor Example() is never used locally\n" +
+ "----------\n" +
+ "1. ERROR in Example.java (at line 2)\n" +
+ " private @org.springframework.beans.factory.annotation.Autowired Object o;\n" +
+ " ^\n" +
+ "The value of the field Example.o is not used\n" +
+ "----------\n" +
+ "2. ERROR in Example.java (at line 3)\n" +
+ " private Example() {}\n" +
+ " ^^^^^^^^^\n" +
+ "The constructor Example() is never used locally\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -11616,21 +11616,21 @@ public void testBug464977() throws Exception {
} else if (this.complianceLevel == ClassFileConstants.JDK1_6) {
version = "1.6 : 50.0";
}
- String expectedOutput = "// Compiled from DeprecatedClass.java (version " + version + ", super bit, deprecated)\n" +
- "@Deprecated\n" +
- "public class DeprecatedClass {\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " public DeprecatedClass();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial Object() [8]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 2]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: DeprecatedClass\n" +
- "\n" +
+ String expectedOutput = "// Compiled from DeprecatedClass.java (version " + version + ", super bit, deprecated)\n" +
+ "@Deprecated\n" +
+ "public class DeprecatedClass {\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " public DeprecatedClass();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial Object() [8]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 2]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: DeprecatedClass\n" +
+ "\n" +
"}";
try {
this.enableAPT = true;
@@ -11643,133 +11643,133 @@ public void testBug469584() {
runNegativeTest(
new String[] {
"CCETest.java",
- "import java.lang.annotation.*;\n" +
- "\n" +
- "@Retention({RetentionPolicy.CLASS, RetentionPolicy.RUNTIME})\n" +
- "public @interface CCETest {\n" +
- "\n" +
+ "import java.lang.annotation.*;\n" +
+ "\n" +
+ "@Retention({RetentionPolicy.CLASS, RetentionPolicy.RUNTIME})\n" +
+ "public @interface CCETest {\n" +
+ "\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in CCETest.java (at line 3)\n" +
- " @Retention({RetentionPolicy.CLASS, RetentionPolicy.RUNTIME})\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from RetentionPolicy[] to RetentionPolicy\n" +
+ "----------\n" +
+ "1. ERROR in CCETest.java (at line 3)\n" +
+ " @Retention({RetentionPolicy.CLASS, RetentionPolicy.RUNTIME})\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from RetentionPolicy[] to RetentionPolicy\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=472178
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=472178
public void test472178() throws Exception {
if (this.complianceLevel < ClassFileConstants.JDK1_8) {
return; // Enough to run in 3 levels rather!
}
String source =
- "import java.lang.annotation.ElementType;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
- "import java.lang.annotation.Target;\n" +
- "import java.util.ArrayList;\n" +
- "import java.util.Iterator;\n" +
- " \n" +
- "/**\n" +
- " * @author gglab\n" +
- " */\n" +
- "public class Test<X> extends ArrayList<X> {\n" +
- " public void iterateRemove()\n" +
- " {\n" +
- " for (Iterator<X> iter = this.iterator(); iter.hasNext();) {\n" +
- " Object key = iter.next();\n" +
- " @Flowannotation\n" +
- " Foo<@Flowannotation String> f = new Foo<String>();\n" +
- " @Flowannotation long l = (@Flowannotation long)f.getI(); // this line causes parse error\n" +
- " iter.remove();\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " @Flowannotation\n" +
- " class Foo<@Flowannotation T>\n" +
- " {\n" +
- " @Flowannotation\n" +
- " public int getI()\n" +
- " {\n" +
- " return 3;\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " @Target({ ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.METHOD, ElementType.LOCAL_VARIABLE, ElementType.TYPE, ElementType.FIELD,\n" +
- " ElementType.TYPE_PARAMETER, ElementType.TYPE_USE})\n" +
- " @Retention(RetentionPolicy.RUNTIME)\n" +
- " @interface Flowannotation {}\n" +
- " public static void main(String[] args) {}\n" +
+ "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.Iterator;\n" +
+ " \n" +
+ "/**\n" +
+ " * @author gglab\n" +
+ " */\n" +
+ "public class Test<X> extends ArrayList<X> {\n" +
+ " public void iterateRemove()\n" +
+ " {\n" +
+ " for (Iterator<X> iter = this.iterator(); iter.hasNext();) {\n" +
+ " Object key = iter.next();\n" +
+ " @Flowannotation\n" +
+ " Foo<@Flowannotation String> f = new Foo<String>();\n" +
+ " @Flowannotation long l = (@Flowannotation long)f.getI(); // this line causes parse error\n" +
+ " iter.remove();\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " @Flowannotation\n" +
+ " class Foo<@Flowannotation T>\n" +
+ " {\n" +
+ " @Flowannotation\n" +
+ " public int getI()\n" +
+ " {\n" +
+ " return 3;\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " @Target({ ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.METHOD, ElementType.LOCAL_VARIABLE, ElementType.TYPE, ElementType.FIELD,\n" +
+ " ElementType.TYPE_PARAMETER, ElementType.TYPE_USE})\n" +
+ " @Retention(RetentionPolicy.RUNTIME)\n" +
+ " @interface Flowannotation {}\n" +
+ " public static void main(String[] args) {}\n" +
"}";
String expectedOutput =
- " // Method descriptor #6 ()V\n" +
- " // Stack: 3, Locals: 6\n" +
- " public void iterateRemove();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokevirtual Test.iterator() : Iterator [17]\n" +
- " 4 astore_1 [iter]\n" +
- " 5 goto 37\n" +
- " 8 aload_1 [iter]\n" +
- " 9 invokeinterface Iterator.next() : Object [21] [nargs: 1]\n" +
- " 14 astore_2 [key]\n" +
- " 15 new Test$Foo [27]\n" +
- " 18 dup\n" +
- " 19 aload_0 [this]\n" +
- " 20 invokespecial Test$Foo(Test) [29]\n" +
- " 23 astore_3 [f]\n" +
- " 24 aload_3 [f]\n" +
- " 25 invokevirtual Test$Foo.getI() : int [32]\n" +
- " 28 i2l\n" +
- " 29 lstore 4 [l]\n" +
- " 31 aload_1 [iter]\n" +
- " 32 invokeinterface Iterator.remove() : void [36] [nargs: 1]\n" +
- " 37 aload_1 [iter]\n" +
- " 38 invokeinterface Iterator.hasNext() : boolean [39] [nargs: 1]\n" +
- " 43 ifne 8\n" +
- " 46 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 14]\n" +
- " [pc: 8, line: 15]\n" +
- " [pc: 15, line: 17]\n" +
- " [pc: 24, line: 18]\n" +
- " [pc: 31, line: 19]\n" +
- " [pc: 37, line: 14]\n" +
- " [pc: 46, line: 21]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 47] local: this index: 0 type: Test\n" +
- " [pc: 5, pc: 46] local: iter index: 1 type: Iterator\n" +
- " [pc: 15, pc: 37] local: key index: 2 type: Object\n" +
- " [pc: 24, pc: 37] local: f index: 3 type: Foo\n" +
- " [pc: 31, pc: 37] local: l index: 4 type: long\n" +
- " Local variable type table:\n" +
- " [pc: 0, pc: 47] local: this index: 0 type: Test<X>\n" +
- " [pc: 5, pc: 46] local: iter index: 1 type: Iterator<X>\n" +
- " [pc: 24, pc: 37] local: f index: 3 type: String>\n" +
- " Stack map table: number of frames 2\n" +
- " [pc: 8, append: {Iterator}]\n" +
- " [pc: 37, same]\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #55 @Flowannotation(\n" +
- " target type = 0x47 CAST\n" +
- " offset = 24\n" +
- " type argument index = 0\n" +
- " )\n" +
- " #55 @Flowannotation(\n" +
- " target type = 0x40 LOCAL_VARIABLE\n" +
- " local variable entries:\n" +
- " [pc: 24, pc: 37] index: 3\n" +
- " location = [INNER_TYPE]\n" +
- " )\n" +
- " #55 @Flowannotation(\n" +
- " target type = 0x40 LOCAL_VARIABLE\n" +
- " local variable entries:\n" +
- " [pc: 24, pc: 37] index: 3\n" +
- " location = [INNER_TYPE, TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " #55 @Flowannotation(\n" +
- " target type = 0x40 LOCAL_VARIABLE\n" +
- " local variable entries:\n" +
- " [pc: 31, pc: 37] index: 4\n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 3, Locals: 6\n" +
+ " public void iterateRemove();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokevirtual Test.iterator() : Iterator [17]\n" +
+ " 4 astore_1 [iter]\n" +
+ " 5 goto 37\n" +
+ " 8 aload_1 [iter]\n" +
+ " 9 invokeinterface Iterator.next() : Object [21] [nargs: 1]\n" +
+ " 14 astore_2 [key]\n" +
+ " 15 new Test$Foo [27]\n" +
+ " 18 dup\n" +
+ " 19 aload_0 [this]\n" +
+ " 20 invokespecial Test$Foo(Test) [29]\n" +
+ " 23 astore_3 [f]\n" +
+ " 24 aload_3 [f]\n" +
+ " 25 invokevirtual Test$Foo.getI() : int [32]\n" +
+ " 28 i2l\n" +
+ " 29 lstore 4 [l]\n" +
+ " 31 aload_1 [iter]\n" +
+ " 32 invokeinterface Iterator.remove() : void [36] [nargs: 1]\n" +
+ " 37 aload_1 [iter]\n" +
+ " 38 invokeinterface Iterator.hasNext() : boolean [39] [nargs: 1]\n" +
+ " 43 ifne 8\n" +
+ " 46 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 14]\n" +
+ " [pc: 8, line: 15]\n" +
+ " [pc: 15, line: 17]\n" +
+ " [pc: 24, line: 18]\n" +
+ " [pc: 31, line: 19]\n" +
+ " [pc: 37, line: 14]\n" +
+ " [pc: 46, line: 21]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 47] local: this index: 0 type: Test\n" +
+ " [pc: 5, pc: 46] local: iter index: 1 type: Iterator\n" +
+ " [pc: 15, pc: 37] local: key index: 2 type: Object\n" +
+ " [pc: 24, pc: 37] local: f index: 3 type: Foo\n" +
+ " [pc: 31, pc: 37] local: l index: 4 type: long\n" +
+ " Local variable type table:\n" +
+ " [pc: 0, pc: 47] local: this index: 0 type: Test<X>\n" +
+ " [pc: 5, pc: 46] local: iter index: 1 type: Iterator<X>\n" +
+ " [pc: 24, pc: 37] local: f index: 3 type: String>\n" +
+ " Stack map table: number of frames 2\n" +
+ " [pc: 8, append: {Iterator}]\n" +
+ " [pc: 37, same]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #55 @Flowannotation(\n" +
+ " target type = 0x47 CAST\n" +
+ " offset = 24\n" +
+ " type argument index = 0\n" +
+ " )\n" +
+ " #55 @Flowannotation(\n" +
+ " target type = 0x40 LOCAL_VARIABLE\n" +
+ " local variable entries:\n" +
+ " [pc: 24, pc: 37] index: 3\n" +
+ " location = [INNER_TYPE]\n" +
+ " )\n" +
+ " #55 @Flowannotation(\n" +
+ " target type = 0x40 LOCAL_VARIABLE\n" +
+ " local variable entries:\n" +
+ " [pc: 24, pc: 37] index: 3\n" +
+ " location = [INNER_TYPE, TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " #55 @Flowannotation(\n" +
+ " target type = 0x40 LOCAL_VARIABLE\n" +
+ " local variable entries:\n" +
+ " [pc: 31, pc: 37] index: 4\n" +
" )\n";
checkClassFile("Test", source, expectedOutput, ClassFileBytesDisassembler.DETAILED | ClassFileBytesDisassembler.COMPACT);
}
@@ -11780,25 +11780,25 @@ public void testBug470665() throws Exception {
}
boolean apt = this.enableAPT;
String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ?
- "----------\n" +
- "1. ERROR in A.java (at line 10)\n" +
- " };\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 10)\n" +
+ " };\n" +
+ " ^\n" +
+ "Syntax error on token \"}\", delete this token\n" +
+ "----------\n" +
"----------\n"
:
- "----------\n" +
- "1. ERROR in A.java (at line 10)\n" +
- " };\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in B.java (at line 12)\n" +
- " X x = new X();\n" +
- " ^^^^^^^\n" +
- "Access to enclosing constructor B.X() is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 10)\n" +
+ " };\n" +
+ " ^\n" +
+ "Syntax error on token \"}\", delete this token\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in B.java (at line 12)\n" +
+ " X x = new X();\n" +
+ " ^^^^^^^\n" +
+ "Access to enclosing constructor B.X() is emulated by a synthetic accessor method\n" +
"----------\n";
String[] sources = new String[] {
"A.java",
@@ -11856,11 +11856,11 @@ public void testBug506888a() throws Exception {
"} \n",
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. INFO in X.java (at line 3)\n" +
- " @SuppressWarnings({\"incomplete-switch\"})\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "At least one of the problems in category \'incomplete-switch\' is not analysed due to a compiler option being ignored\n" +
+ "----------\n" +
+ "1. INFO in X.java (at line 3)\n" +
+ " @SuppressWarnings({\"incomplete-switch\"})\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "At least one of the problems in category \'incomplete-switch\' is not analysed due to a compiler option being ignored\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings;
runner.runWarningTest();
@@ -11880,7 +11880,7 @@ public void testBug506888b() throws Exception {
" \n" +
" @SuppressWarnings({\"incomplete-switch\"})\n" +
" void foo(Color c) {\n" +
- " switch(c) {\n" +
+ " switch(c) {\n" +
" }\n" +
" }\n" +
" enum Color { BLUE, RED; } \n" +
@@ -11905,18 +11905,18 @@ public void testBug506888c() throws Exception {
" \n" +
" @SuppressWarnings({\"incomplete-switch\", \"unchecked\"})\n" +
" void foo(Color c) {\n" +
- " switch(c) {\n" +
+ " switch(c) {\n" +
" }\n" +
" }\n" +
" enum Color { BLUE, RED; } \n" +
"} \n",
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " @SuppressWarnings({\"incomplete-switch\", \"unchecked\"})\n" +
- " ^^^^^^^^^^^\n" +
- "Unnecessary @SuppressWarnings(\"unchecked\")\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " @SuppressWarnings({\"incomplete-switch\", \"unchecked\"})\n" +
+ " ^^^^^^^^^^^\n" +
+ "Unnecessary @SuppressWarnings(\"unchecked\")\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings;
runner.runWarningTest();
@@ -11938,7 +11938,7 @@ public void testBug506888d() throws Exception {
" }\n" +
"} \n",
},
- "",
+ "",
null, true, options);
}
public void testBug506888e() throws Exception {
@@ -11957,7 +11957,7 @@ public void testBug506888e() throws Exception {
" void foo() {}\n" +
"} \n",
},
- "",
+ "",
null, true, options);
}
public void testBug506888f() throws Exception {
@@ -11995,11 +11995,11 @@ public void testBug506888f() throws Exception {
"} \n",
},
false,
- "----------\n" +
- "1. INFO in X.java (at line 3)\n" +
- " @SuppressWarnings({\"unused\"})\n" +
- " ^^^^^^^^\n" +
- "At least one of the problems in category \'unused\' is not analysed due to a compiler option being ignored\n" +
+ "----------\n" +
+ "1. INFO in X.java (at line 3)\n" +
+ " @SuppressWarnings({\"unused\"})\n" +
+ " ^^^^^^^^\n" +
+ "At least one of the problems in category \'unused\' is not analysed due to a compiler option being ignored\n" +
"----------\n",
"" /*expectedOutputString */,
"" /* expectedErrorString */,
@@ -12105,7 +12105,7 @@ public void testBug537593_001() {
JavacTestOptions.DEFAULT);
assertNull(requestor.problemArguments);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=542520 - [JUnit 5] Warning The method xxx from the type X
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=542520 - [JUnit 5] Warning The method xxx from the type X
// is never used locally is shown when using MethodSource - common case
public void testBug542520a() throws Exception {
Runner runner = new Runner();
@@ -12124,14 +12124,14 @@ public void testBug542520a() throws Exception {
" @MethodSource(\"getIntegers\")\n" +
" void testIntegers(Integer integer) {}\n" +
" \n" +
- " private static List<Integer> getIntegers() {\n" +
- " return Arrays.asList(0, 5, 1);\n" +
+ " private static List<Integer> getIntegers() {\n" +
+ " return Arrays.asList(0, 5, 1);\n" +
" }\n" +
"}\n",
};
runner.runConformTest();
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=542520 - [JUnit 5] Warning The method xxx from the type X
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=542520 - [JUnit 5] Warning The method xxx from the type X
// is never used locally is shown when using MethodSource - variation with fully qualified annotation
public void testBug542520b() throws Exception {
Runner runner = new Runner();
@@ -12149,14 +12149,14 @@ public void testBug542520b() throws Exception {
" @org.junit.jupiter.params.provider.MethodSource(\"getIntegers\")\n" +
" void testIntegers(Integer integer) {}\n" +
" \n" +
- " private static List<Integer> getIntegers() {\n" +
- " return Arrays.asList(0, 5, 1);\n" +
+ " private static List<Integer> getIntegers() {\n" +
+ " return Arrays.asList(0, 5, 1);\n" +
" }\n" +
"}\n",
};
runner.runConformTest();
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=542520 - [JUnit 5] Warning The method xxx from the type X
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=542520 - [JUnit 5] Warning The method xxx from the type X
// is never used locally is shown when using MethodSource - marker annotation
public void testBug542520c() throws Exception {
Runner runner = new Runner();
@@ -12175,14 +12175,14 @@ public void testBug542520c() throws Exception {
" @MethodSource\n" +
" void testIntegers(Integer integer) {}\n" +
" \n" +
- " private static List<Integer> testIntegers() {\n" +
- " return Arrays.asList(0, 5, 1);\n" +
+ " private static List<Integer> testIntegers() {\n" +
+ " return Arrays.asList(0, 5, 1);\n" +
" }\n" +
"}\n",
};
runner.runConformTest();
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=542520 - [JUnit 5] Warning The method xxx from the type X
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=542520 - [JUnit 5] Warning The method xxx from the type X
// is never used locally is shown when using MethodSource - missing no-args method source
public void testBug542520d() throws Exception {
Map customOptions = getCompilerOptions();
@@ -12202,16 +12202,16 @@ public void testBug542520d() throws Exception {
" void testIntegers(Integer integer) {}\n" +
" \n" +
" private static List<Integer> getIntegers(int i) {\n" +
- " return Arrays.asList(0, 5, 1);\n" +
+ " return Arrays.asList(0, 5, 1);\n" +
" }\n" +
"}\n",
},
null, customOptions,
- "----------\n" +
- "1. ERROR in ExampleTest.java (at line 9)\n" +
- " private static List<Integer> getIntegers(int i) {\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The method getIntegers(int) from the type ExampleTest is never used locally\n" +
+ "----------\n" +
+ "1. ERROR in ExampleTest.java (at line 9)\n" +
+ " private static List<Integer> getIntegers(int i) {\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "The method getIntegers(int) from the type ExampleTest is never used locally\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -12294,8 +12294,8 @@ public void testBug546084c() throws Exception {
" @MethodSource({ \"getIntegers\" })\n" +
" void testIntegers(Integer integer) {}\n" +
" \n" +
- " private static List<Integer> getIntegers() {\n" +
- " return Arrays.asList(0, 5, 1);\n" +
+ " private static List<Integer> getIntegers() {\n" +
+ " return Arrays.asList(0, 5, 1);\n" +
" }\n" +
"}\n",
};
@@ -12305,38 +12305,38 @@ public void testBug490698_comment16() {
runConformTest(
new String[] {
"foo/bar/AnnotationError.java",
- "package foo.bar;\n" +
- "\n" +
- "import static java.lang.annotation.ElementType.FIELD;\n" +
- "import static java.lang.annotation.RetentionPolicy.RUNTIME;\n" +
- "\n" +
- "import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.Target;\n" +
- "import java.util.function.Predicate;\n" +
- "\n" +
- "public class AnnotationError<T> {\n" +
- "\n" +
- " public enum P {\n" +
- " AAA\n" +
- " }\n" +
- "\n" +
- " @Target(FIELD)\n" +
- " @Retention(RUNTIME)\n" +
- " public @interface A {\n" +
- " P value();\n" +
- " }\n" +
- "\n" +
- " @Target(FIELD)\n" +
- " @Retention(RUNTIME)\n" +
- " public @interface FF {\n" +
- " }\n" +
- "\n" +
- " public static class Bool extends AnnotationError<Boolean> {\n" +
- " }\n" +
- "\n" +
- " @A(P.AAA)\n" +
- " @FF\n" +
- " public static final AnnotationError.Bool FOO = new AnnotationError.Bool();\n" +
+ "package foo.bar;\n" +
+ "\n" +
+ "import static java.lang.annotation.ElementType.FIELD;\n" +
+ "import static java.lang.annotation.RetentionPolicy.RUNTIME;\n" +
+ "\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import java.util.function.Predicate;\n" +
+ "\n" +
+ "public class AnnotationError<T> {\n" +
+ "\n" +
+ " public enum P {\n" +
+ " AAA\n" +
+ " }\n" +
+ "\n" +
+ " @Target(FIELD)\n" +
+ " @Retention(RUNTIME)\n" +
+ " public @interface A {\n" +
+ " P value();\n" +
+ " }\n" +
+ "\n" +
+ " @Target(FIELD)\n" +
+ " @Retention(RUNTIME)\n" +
+ " public @interface FF {\n" +
+ " }\n" +
+ "\n" +
+ " public static class Bool extends AnnotationError<Boolean> {\n" +
+ " }\n" +
+ "\n" +
+ " @A(P.AAA)\n" +
+ " @FF\n" +
+ " public static final AnnotationError.Bool FOO = new AnnotationError.Bool();\n" +
"}\n"
});
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest_9.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest_9.java
index 56cf9d3d5..a5a00fceb 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest_9.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest_9.java
@@ -33,17 +33,17 @@ public class AnnotationTest_9 extends AbstractComparableTest {
new String[] {
"p/A.java",
"package p;\n" +
- "@java.lang.annotation.Target({\n" +
- " java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.METHOD})\n" +
- "@Deprecated\n" +
+ "@java.lang.annotation.Target({\n" +
+ " java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.METHOD})\n" +
+ "@Deprecated\n" +
"public @interface A {}\n",
},"");
runConformTest(
new String[] {
"X.java",
"import p.A;\n" +
- "class X {\n" +
- " @A void foo() {}\n" +
+ "class X {\n" +
+ " @A void foo() {}\n" +
"}\n",
},"", null, false, null);
}
@@ -55,12 +55,12 @@ public class AnnotationTest_9 extends AbstractComparableTest {
" String value(X this);\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " String value(X this);\n" +
- " ^^^^^^^^^^^^^\n" +
- "Annotation attributes cannot have parameters\n" +
- "----------\n",
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " String value(X this);\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Annotation attributes cannot have parameters\n" +
+ "----------\n",
null, true);
}
public void testBug521054b() throws Exception {
@@ -75,12 +75,12 @@ public class AnnotationTest_9 extends AbstractComparableTest {
" X[] value(Container this);\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " X[] value(Container this);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Annotation attributes cannot have parameters\n" +
- "----------\n",
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " X[] value(Container this);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Annotation attributes cannot have parameters\n" +
+ "----------\n",
null, true);
}
public void testBug521054c() throws Exception {
@@ -95,12 +95,12 @@ public class AnnotationTest_9 extends AbstractComparableTest {
" X[] value();\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " String value(X this, int i);\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Annotation attributes cannot have parameters\n" +
- "----------\n",
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " String value(X this, int i);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Annotation attributes cannot have parameters\n" +
+ "----------\n",
null, true);
}
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ArrayTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ArrayTest.java
index 383757b34..b3b528bdd 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ArrayTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ArrayTest.java
@@ -410,22 +410,22 @@ public void test014() throws Exception {
CompilerOptions options = new CompilerOptions(optionsMap);
if (options.complianceLevel > ClassFileConstants.JDK1_4) {
// check that #clone() return type is changed ONLY from -source 1.5 only (independant from compliance level)
- optionsMap.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4);
- }
+ optionsMap.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4);
+ }
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " void foo(long[] longs) throws Exception {\n" +
- " long[] other = longs.clone();\n" +
- " }\n" +
+ "public class X {\n" +
+ " void foo(long[] longs) throws Exception {\n" +
+ " long[] other = longs.clone();\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " long[] other = longs.clone();\n" +
- " ^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Object to long[]\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " long[] other = longs.clone();\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Object to long[]\n" +
"----------\n",
null,
true,
@@ -440,10 +440,10 @@ public void test015() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " void foo(long[] longs) throws Exception {\n" +
- " long[] other = longs.clone();\n" +
- " }\n" +
+ "public class X {\n" +
+ " void foo(long[] longs) throws Exception {\n" +
+ " long[] other = longs.clone();\n" +
+ " }\n" +
"}\n",
},
"");
@@ -454,10 +454,10 @@ public void test016() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " void foo(long[] longs) throws Exception {\n" +
- " Object other = longs.clone();\n" +
- " }\n" +
+ "public class X {\n" +
+ " void foo(long[] longs) throws Exception {\n" +
+ " Object other = longs.clone();\n" +
+ " }\n" +
"}\n",
},
"");
@@ -470,25 +470,25 @@ public void test016() throws Exception {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput = new CompilerOptions(getCompilerOptions()).sourceLevel <= ClassFileConstants.JDK1_4
- ? " // Method descriptor #15 ([J)V\n" +
- " // Stack: 1, Locals: 3\n" +
- " void foo(long[] longs) throws java.lang.Exception;\n" +
- " 0 aload_1 [longs]\n" +
- " 1 invokevirtual java.lang.Object.clone() : java.lang.Object [19]\n" +
- " 4 astore_2 [other]\n" +
- " 5 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
+ ? " // Method descriptor #15 ([J)V\n" +
+ " // Stack: 1, Locals: 3\n" +
+ " void foo(long[] longs) throws java.lang.Exception;\n" +
+ " 0 aload_1 [longs]\n" +
+ " 1 invokevirtual java.lang.Object.clone() : java.lang.Object [19]\n" +
+ " 4 astore_2 [other]\n" +
+ " 5 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
" [pc: 5, line: 4]\n"
- : " // Method descriptor #15 ([J)V\n" +
- " // Stack: 1, Locals: 3\n" +
- " void foo(long[] longs) throws java.lang.Exception;\n" +
- " 0 aload_1 [longs]\n" +
- " 1 invokevirtual long[].clone() : java.lang.Object [19]\n" +
- " 4 astore_2 [other]\n" +
- " 5 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
+ : " // Method descriptor #15 ([J)V\n" +
+ " // Stack: 1, Locals: 3\n" +
+ " void foo(long[] longs) throws java.lang.Exception;\n" +
+ " 0 aload_1 [longs]\n" +
+ " 1 invokevirtual long[].clone() : java.lang.Object [19]\n" +
+ " 4 astore_2 [other]\n" +
+ " 5 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
" [pc: 5, line: 4]\n";
int index = actualOutput.indexOf(expectedOutput);
@@ -497,7 +497,7 @@ public void test016() throws Exception {
}
if (index == -1) {
assertEquals("unexpected bytecode sequence", expectedOutput, actualOutput);
- }
+ }
return;
}
@@ -508,15 +508,15 @@ public void test017() throws Exception {
CompilerOptions options = new CompilerOptions(optionsMap);
if (options.complianceLevel > ClassFileConstants.JDK1_4) {
// check that #clone() return type is changed ONLY from -source 1.5 only (independant from compliance level)
- optionsMap.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4);
+ optionsMap.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4);
}
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " void foo(long[] longs) throws Exception {\n" +
- " Object other = longs.clone();\n" +
- " }\n" +
+ "public class X {\n" +
+ " void foo(long[] longs) throws Exception {\n" +
+ " Object other = longs.clone();\n" +
+ " }\n" +
"}\n",
},
"",
@@ -534,15 +534,15 @@ public void test017() throws Exception {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " // Method descriptor #15 ([J)V\n" +
- " // Stack: 1, Locals: 3\n" +
- " void foo(long[] longs) throws java.lang.Exception;\n" +
- " 0 aload_1 [longs]\n" +
- " 1 invokevirtual java.lang.Object.clone() : java.lang.Object [19]\n" +
- " 4 astore_2 [other]\n" +
- " 5 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
+ " // Method descriptor #15 ([J)V\n" +
+ " // Stack: 1, Locals: 3\n" +
+ " void foo(long[] longs) throws java.lang.Exception;\n" +
+ " 0 aload_1 [longs]\n" +
+ " 1 invokevirtual java.lang.Object.clone() : java.lang.Object [19]\n" +
+ " 4 astore_2 [other]\n" +
+ " 5 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
" [pc: 5, line: 4]\n";
int index = actualOutput.indexOf(expectedOutput);
@@ -551,7 +551,7 @@ public void test017() throws Exception {
}
if (index == -1) {
assertEquals("unexpected bytecode sequence", expectedOutput, actualOutput);
- }
+ }
}
// https://bugs.eclipse.org/331872 - [compiler] NPE in Scope.createArrayType when attempting qualified access from type parameter
@@ -561,24 +561,24 @@ public void test018() throws Exception {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X<p> {\n" +
- " void foo(p.O[] elems) {\n" +
+ "public class X<p> {\n" +
+ " void foo(p.O[] elems) {\n" +
" }\n" +
" void bar() {\n" +
" foo(new Object[0]);\n" +
- " }\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void foo(p.O[] elems) {\n" +
- " ^^^^^\n" +
- "Illegal qualified access from the type parameter p\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " foo(new Object[0]);\n" +
- " ^^^\n" +
- "The method foo(Object[]) is undefined for the type X<p>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " void foo(p.O[] elems) {\n" +
+ " ^^^^^\n" +
+ "Illegal qualified access from the type parameter p\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " foo(new Object[0]);\n" +
+ " ^^^\n" +
+ "The method foo(Object[]) is undefined for the type X<p>\n" +
"----------\n");
}
@@ -587,7 +587,7 @@ public void test019() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" public static void main(String[] args) {\n" +
" X [][][] x = new X[10][10][];\n" +
" System.out.println(\"SUCCESS\");\n" +
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssertionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssertionTest.java
index 5f4e0e3fb..d151a04b5 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssertionTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssertionTest.java
@@ -451,103 +451,103 @@ public class AssertionTest extends AbstractRegressionTest {
runNegativeTest(
new String[] { /* test files */
"X.java",
- "public class X {\n" +
- " protected void transform1(boolean srcPts) {\n" +
- " final float error1;\n" +
- " assert !(srcPts && (error1 = maxError()) > 0) : error1;\n" +
- " }\n" +
- " float foo1(boolean srcPts) {\n" +
- " final float error2;\n" +
- " if (!(srcPts && (error2 = maxError()) > 0)) {\n" +
- " } else {\n" +
- " return error2;\n" +
- " }\n" +
- " return 0;\n" +
- " }\n" +
- " float bar1(boolean srcPts) {\n" +
- " final float error3;\n" +
- " if ((srcPts && (error3 = maxError()) > 0)) {\n" +
- " return error3;\n" +
- " }\n" +
- " return 0;\n" +
- " } \n" +
- " protected void transform2(boolean srcPts) {\n" +
- " final float error4;\n" +
- " assert (srcPts && (error4 = maxError()) > 0) : error4;\n" +
- " }\n" +
- " float foo2(boolean srcPts) {\n" +
- " final float error5;\n" +
- " if (srcPts && (error5 = maxError()) > 0) {\n" +
- " } else {\n" +
- " return error5;\n" +
- " }\n" +
- " return 0;\n" +
- " }\n" +
- " float bar2(boolean srcPts) {\n" +
- " final float error6;\n" +
- " if (!(srcPts && (error6 = maxError()) > 0)) {\n" +
- " return error6;\n" +
- " }\n" +
- " return 0;\n" +
- " }\n" +
- " private float maxError() {\n" +
- " return 0;\n" +
- " }\n" +
- "\n" +
+ "public class X {\n" +
+ " protected void transform1(boolean srcPts) {\n" +
+ " final float error1;\n" +
+ " assert !(srcPts && (error1 = maxError()) > 0) : error1;\n" +
+ " }\n" +
+ " float foo1(boolean srcPts) {\n" +
+ " final float error2;\n" +
+ " if (!(srcPts && (error2 = maxError()) > 0)) {\n" +
+ " } else {\n" +
+ " return error2;\n" +
+ " }\n" +
+ " return 0;\n" +
+ " }\n" +
+ " float bar1(boolean srcPts) {\n" +
+ " final float error3;\n" +
+ " if ((srcPts && (error3 = maxError()) > 0)) {\n" +
+ " return error3;\n" +
+ " }\n" +
+ " return 0;\n" +
+ " } \n" +
+ " protected void transform2(boolean srcPts) {\n" +
+ " final float error4;\n" +
+ " assert (srcPts && (error4 = maxError()) > 0) : error4;\n" +
+ " }\n" +
+ " float foo2(boolean srcPts) {\n" +
+ " final float error5;\n" +
+ " if (srcPts && (error5 = maxError()) > 0) {\n" +
+ " } else {\n" +
+ " return error5;\n" +
+ " }\n" +
+ " return 0;\n" +
+ " }\n" +
+ " float bar2(boolean srcPts) {\n" +
+ " final float error6;\n" +
+ " if (!(srcPts && (error6 = maxError()) > 0)) {\n" +
+ " return error6;\n" +
+ " }\n" +
+ " return 0;\n" +
+ " }\n" +
+ " private float maxError() {\n" +
+ " return 0;\n" +
+ " }\n" +
+ "\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 23)\n" +
- " assert (srcPts && (error4 = maxError()) > 0) : error4;\n" +
- " ^^^^^^\n" +
- "The local variable error4 may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 29)\n" +
- " return error5;\n" +
- " ^^^^^^\n" +
- "The local variable error5 may not have been initialized\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 36)\n" +
- " return error6;\n" +
- " ^^^^^^\n" +
- "The local variable error6 may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 23)\n" +
+ " assert (srcPts && (error4 = maxError()) > 0) : error4;\n" +
+ " ^^^^^^\n" +
+ "The local variable error4 may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 29)\n" +
+ " return error5;\n" +
+ " ^^^^^^\n" +
+ "The local variable error5 may not have been initialized\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 36)\n" +
+ " return error6;\n" +
+ " ^^^^^^\n" +
+ "The local variable error6 may not have been initialized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=328361
public void test018() {
this.runNegativeTest(new String[] {
"X.java",
- "public class X {\n" +
- " static final int i;\n" +
- " static {\n" +
- " assert (i = 0) == 0;\n" +
- " System.out.println(i);\n" +
- " }\n" +
+ "public class X {\n" +
+ " static final int i;\n" +
+ " static {\n" +
+ " assert (i = 0) == 0;\n" +
+ " System.out.println(i);\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " static final int i;\n" +
- " ^\n" +
- "The blank final field i may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " System.out.println(i);\n" +
- " ^\n" +
- "The blank final field i may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " static final int i;\n" +
+ " ^\n" +
+ "The blank final field i may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " System.out.println(i);\n" +
+ " ^\n" +
+ "The blank final field i may not have been initialized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=328361
public void test019() {
this.runConformTest(new String[] {
"X.java",
- "public class X {\n" +
- " static final int i;\n" +
+ "public class X {\n" +
+ " static final int i;\n" +
" static {\n" +
- " i = 0;\n" +
- " assert i == 0;\n" +
- " System.out.println(i);\n" +
- " }\n" +
+ " i = 0;\n" +
+ " assert i == 0;\n" +
+ " System.out.println(i);\n" +
+ " }\n" +
"}"
},
"");
@@ -559,17 +559,17 @@ public class AssertionTest extends AbstractRegressionTest {
"X.java",
"public class X {\n" +
" void method1() {\n" +
- " int i;" +
- " assert (i = 0) == 0;\n" +
- " System.out.println(i);\n" +
- " }\n" +
- "}\n"
+ " int i;" +
+ " assert (i = 0) == 0;\n" +
+ " System.out.println(i);\n" +
+ " }\n" +
+ "}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " System.out.println(i);\n" +
- " ^\n" +
- "The local variable i may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " System.out.println(i);\n" +
+ " ^\n" +
+ "The local variable i may not have been initialized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=328361
@@ -582,17 +582,17 @@ public class AssertionTest extends AbstractRegressionTest {
" return 1;\n" +
" }\n" +
" void method1() {\n" +
- " int i;" +
- " assert (i = this.bar()) == 0;\n" +
- " System.out.println(i);\n" +
- " }\n" +
- "}\n"
+ " int i;" +
+ " assert (i = this.bar()) == 0;\n" +
+ " System.out.println(i);\n" +
+ " }\n" +
+ "}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " System.out.println(i);\n" +
- " ^\n" +
- "The local variable i may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " System.out.println(i);\n" +
+ " ^\n" +
+ "The local variable i may not have been initialized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=328361
@@ -605,28 +605,28 @@ public class AssertionTest extends AbstractRegressionTest {
" return 1;\n" +
" }\n" +
" void method1() {\n" +
- " int i;\n" +
- " assert i++ == 0;\n" +
- " System.out.println(i);\n" +
- " }\n" +
- "}\n"
+ " int i;\n" +
+ " assert i++ == 0;\n" +
+ " System.out.println(i);\n" +
+ " }\n" +
+ "}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " assert i++ == 0;\n" +
- " ^\n" +
- "The local variable i may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " System.out.println(i);\n" +
- " ^\n" +
- "The local variable i may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " assert i++ == 0;\n" +
+ " ^\n" +
+ "The local variable i may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " System.out.println(i);\n" +
+ " ^\n" +
+ "The local variable i may not have been initialized\n" +
"----------\n");
}
public void test023() {
if (this.complianceLevel < ClassFileConstants.JDK1_8)
return;
- this.runConformTest(new String[] {"X.java",
+ this.runConformTest(new String[] {"X.java",
"interface Foo {\n" +
" default Object test(Object a) {\n" +
" assert a != null; // triggers creation of bogus synthetic field\n" +
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest.java
index c13757041..7b7593ed2 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest.java
@@ -789,11 +789,11 @@ public void test034() {
" private String adsyasta;\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 356)\n" +
- " if (rs != null)\n" +
- " ^^\n" +
- "Redundant null check: The variable rs cannot be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 356)\n" +
+ " if (rs != null)\n" +
+ " ^^\n" +
+ "Redundant null check: The variable rs cannot be null at this location\n" +
"----------\n",
null/*classLibs*/,
true/*shouldFlush*/,
@@ -1027,11 +1027,11 @@ public void test041() {
null /* no class libraries */,
options /* custom options */,
// compiler results
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " b = false;\n" +
- " ^\n" +
- "The parameter b should not be assigned\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " b = false;\n" +
+ " ^\n" +
+ "The parameter b should not be assigned\n" +
"----------\n",
// javac options
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
@@ -1061,10 +1061,10 @@ public void test042() {
options /* custom options */,
// compiler results
"----------\n" + /* expected compiler log */
- "1. ERROR in X.java (at line 6)\n" +
- " b = false;\n" +
- " ^\n" +
- "The parameter b should not be assigned\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " b = false;\n" +
+ " ^\n" +
+ "The parameter b should not be assigned\n" +
"----------\n",
// javac options
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
@@ -1086,11 +1086,11 @@ public void test043() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " b = false;\n" +
- " ^\n" +
- "The final local variable b cannot be assigned. It must be blank and not using a compound assignment\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " b = false;\n" +
+ " ^\n" +
+ "The final local variable b cannot be assigned. It must be blank and not using a compound assignment\n" +
"----------\n",
null, true, options);
}
@@ -1407,10 +1407,10 @@ public void test055_definite_unassignment_try_catch() {
},
// compiler results
"----------\n" + /* expected compiler log */
- "1. ERROR in X.java (at line 11)\n" +
- " i = 1;\n" +
- " ^\n" +
- "The final local variable i may already have been assigned\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " i = 1;\n" +
+ " ^\n" +
+ "The final local variable i may already have been assigned\n" +
"----------\n",
// javac options
JavacTestOptions.EclipseJustification.EclipseBug235543 /* javac test options */);
@@ -1549,14 +1549,14 @@ public void test061() {
new String[] {
"X.java",
"public class X {\n" +
- " java.sql.Date d = new java.util.Date();\n" +
+ " java.sql.Date d = new java.util.Date();\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " java.sql.Date d = new java.util.Date();\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from java.util.Date to java.sql.Date\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " java.sql.Date d = new java.util.Date();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from java.util.Date to java.sql.Date\n" +
"----------\n");
}
@@ -1565,212 +1565,212 @@ public void test062() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " byte b;\n" +
- " short s;\n" +
- " char c;\n" +
- " boolean z;\n" +
- " int i;\n" +
- " long j;\n" +
- " float f;\n" +
- " double d;\n" +
- "void foo() {\n" +
- " boolean[] booleans = { b, s, c, z, i, j, f, d, };\n" +
- " byte[] bytes = { b, s, c, z, i, j, f, d, };\n" +
- " short[] shorts = { b, s, c, z, i, j, f, d, };\n" +
- " char[] chars = { b, s, c, z, i, j, f, d, };\n" +
- " int[] ints = { b, s, c, z, i, j, f, d, };\n" +
- " long[] longs = { b, s, c, z, i, j, f, d, };\n" +
- " float[] floats = { b, s, c, z, i, j, f, d, };\n" +
- " double[] doubles = { b, s, c, z, i, j, f, d, };\n" +
+ "public class X {\n" +
+ " byte b;\n" +
+ " short s;\n" +
+ " char c;\n" +
+ " boolean z;\n" +
+ " int i;\n" +
+ " long j;\n" +
+ " float f;\n" +
+ " double d;\n" +
+ "void foo() {\n" +
+ " boolean[] booleans = { b, s, c, z, i, j, f, d, };\n" +
+ " byte[] bytes = { b, s, c, z, i, j, f, d, };\n" +
+ " short[] shorts = { b, s, c, z, i, j, f, d, };\n" +
+ " char[] chars = { b, s, c, z, i, j, f, d, };\n" +
+ " int[] ints = { b, s, c, z, i, j, f, d, };\n" +
+ " long[] longs = { b, s, c, z, i, j, f, d, };\n" +
+ " float[] floats = { b, s, c, z, i, j, f, d, };\n" +
+ " double[] doubles = { b, s, c, z, i, j, f, d, };\n" +
"}\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " boolean[] booleans = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from byte to boolean\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " boolean[] booleans = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from short to boolean\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " boolean[] booleans = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from char to boolean\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 11)\n" +
- " boolean[] booleans = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from int to boolean\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 11)\n" +
- " boolean[] booleans = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from long to boolean\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 11)\n" +
- " boolean[] booleans = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from float to boolean\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 11)\n" +
- " boolean[] booleans = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from double to boolean\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 12)\n" +
- " byte[] bytes = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from short to byte\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 12)\n" +
- " byte[] bytes = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from char to byte\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 12)\n" +
- " byte[] bytes = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from boolean to byte\n" +
- "----------\n" +
- "11. ERROR in X.java (at line 12)\n" +
- " byte[] bytes = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from int to byte\n" +
- "----------\n" +
- "12. ERROR in X.java (at line 12)\n" +
- " byte[] bytes = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from long to byte\n" +
- "----------\n" +
- "13. ERROR in X.java (at line 12)\n" +
- " byte[] bytes = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from float to byte\n" +
- "----------\n" +
- "14. ERROR in X.java (at line 12)\n" +
- " byte[] bytes = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from double to byte\n" +
- "----------\n" +
- "15. ERROR in X.java (at line 13)\n" +
- " short[] shorts = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from char to short\n" +
- "----------\n" +
- "16. ERROR in X.java (at line 13)\n" +
- " short[] shorts = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from boolean to short\n" +
- "----------\n" +
- "17. ERROR in X.java (at line 13)\n" +
- " short[] shorts = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from int to short\n" +
- "----------\n" +
- "18. ERROR in X.java (at line 13)\n" +
- " short[] shorts = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from long to short\n" +
- "----------\n" +
- "19. ERROR in X.java (at line 13)\n" +
- " short[] shorts = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from float to short\n" +
- "----------\n" +
- "20. ERROR in X.java (at line 13)\n" +
- " short[] shorts = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from double to short\n" +
- "----------\n" +
- "21. ERROR in X.java (at line 14)\n" +
- " char[] chars = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from byte to char\n" +
- "----------\n" +
- "22. ERROR in X.java (at line 14)\n" +
- " char[] chars = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from short to char\n" +
- "----------\n" +
- "23. ERROR in X.java (at line 14)\n" +
- " char[] chars = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from boolean to char\n" +
- "----------\n" +
- "24. ERROR in X.java (at line 14)\n" +
- " char[] chars = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from int to char\n" +
- "----------\n" +
- "25. ERROR in X.java (at line 14)\n" +
- " char[] chars = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from long to char\n" +
- "----------\n" +
- "26. ERROR in X.java (at line 14)\n" +
- " char[] chars = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from float to char\n" +
- "----------\n" +
- "27. ERROR in X.java (at line 14)\n" +
- " char[] chars = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from double to char\n" +
- "----------\n" +
- "28. ERROR in X.java (at line 15)\n" +
- " int[] ints = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from boolean to int\n" +
- "----------\n" +
- "29. ERROR in X.java (at line 15)\n" +
- " int[] ints = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from long to int\n" +
- "----------\n" +
- "30. ERROR in X.java (at line 15)\n" +
- " int[] ints = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from float to int\n" +
- "----------\n" +
- "31. ERROR in X.java (at line 15)\n" +
- " int[] ints = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from double to int\n" +
- "----------\n" +
- "32. ERROR in X.java (at line 16)\n" +
- " long[] longs = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from boolean to long\n" +
- "----------\n" +
- "33. ERROR in X.java (at line 16)\n" +
- " long[] longs = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from float to long\n" +
- "----------\n" +
- "34. ERROR in X.java (at line 16)\n" +
- " long[] longs = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from double to long\n" +
- "----------\n" +
- "35. ERROR in X.java (at line 17)\n" +
- " float[] floats = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from boolean to float\n" +
- "----------\n" +
- "36. ERROR in X.java (at line 17)\n" +
- " float[] floats = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from double to float\n" +
- "----------\n" +
- "37. ERROR in X.java (at line 18)\n" +
- " double[] doubles = { b, s, c, z, i, j, f, d, };\n" +
- " ^\n" +
- "Type mismatch: cannot convert from boolean to double\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " boolean[] booleans = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from byte to boolean\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " boolean[] booleans = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from short to boolean\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " boolean[] booleans = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from char to boolean\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 11)\n" +
+ " boolean[] booleans = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from int to boolean\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 11)\n" +
+ " boolean[] booleans = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from long to boolean\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 11)\n" +
+ " boolean[] booleans = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from float to boolean\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 11)\n" +
+ " boolean[] booleans = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from double to boolean\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 12)\n" +
+ " byte[] bytes = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from short to byte\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 12)\n" +
+ " byte[] bytes = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from char to byte\n" +
+ "----------\n" +
+ "10. ERROR in X.java (at line 12)\n" +
+ " byte[] bytes = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from boolean to byte\n" +
+ "----------\n" +
+ "11. ERROR in X.java (at line 12)\n" +
+ " byte[] bytes = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from int to byte\n" +
+ "----------\n" +
+ "12. ERROR in X.java (at line 12)\n" +
+ " byte[] bytes = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from long to byte\n" +
+ "----------\n" +
+ "13. ERROR in X.java (at line 12)\n" +
+ " byte[] bytes = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from float to byte\n" +
+ "----------\n" +
+ "14. ERROR in X.java (at line 12)\n" +
+ " byte[] bytes = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from double to byte\n" +
+ "----------\n" +
+ "15. ERROR in X.java (at line 13)\n" +
+ " short[] shorts = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from char to short\n" +
+ "----------\n" +
+ "16. ERROR in X.java (at line 13)\n" +
+ " short[] shorts = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from boolean to short\n" +
+ "----------\n" +
+ "17. ERROR in X.java (at line 13)\n" +
+ " short[] shorts = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from int to short\n" +
+ "----------\n" +
+ "18. ERROR in X.java (at line 13)\n" +
+ " short[] shorts = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from long to short\n" +
+ "----------\n" +
+ "19. ERROR in X.java (at line 13)\n" +
+ " short[] shorts = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from float to short\n" +
+ "----------\n" +
+ "20. ERROR in X.java (at line 13)\n" +
+ " short[] shorts = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from double to short\n" +
+ "----------\n" +
+ "21. ERROR in X.java (at line 14)\n" +
+ " char[] chars = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from byte to char\n" +
+ "----------\n" +
+ "22. ERROR in X.java (at line 14)\n" +
+ " char[] chars = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from short to char\n" +
+ "----------\n" +
+ "23. ERROR in X.java (at line 14)\n" +
+ " char[] chars = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from boolean to char\n" +
+ "----------\n" +
+ "24. ERROR in X.java (at line 14)\n" +
+ " char[] chars = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from int to char\n" +
+ "----------\n" +
+ "25. ERROR in X.java (at line 14)\n" +
+ " char[] chars = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from long to char\n" +
+ "----------\n" +
+ "26. ERROR in X.java (at line 14)\n" +
+ " char[] chars = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from float to char\n" +
+ "----------\n" +
+ "27. ERROR in X.java (at line 14)\n" +
+ " char[] chars = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from double to char\n" +
+ "----------\n" +
+ "28. ERROR in X.java (at line 15)\n" +
+ " int[] ints = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from boolean to int\n" +
+ "----------\n" +
+ "29. ERROR in X.java (at line 15)\n" +
+ " int[] ints = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from long to int\n" +
+ "----------\n" +
+ "30. ERROR in X.java (at line 15)\n" +
+ " int[] ints = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from float to int\n" +
+ "----------\n" +
+ "31. ERROR in X.java (at line 15)\n" +
+ " int[] ints = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from double to int\n" +
+ "----------\n" +
+ "32. ERROR in X.java (at line 16)\n" +
+ " long[] longs = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from boolean to long\n" +
+ "----------\n" +
+ "33. ERROR in X.java (at line 16)\n" +
+ " long[] longs = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from float to long\n" +
+ "----------\n" +
+ "34. ERROR in X.java (at line 16)\n" +
+ " long[] longs = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from double to long\n" +
+ "----------\n" +
+ "35. ERROR in X.java (at line 17)\n" +
+ " float[] floats = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from boolean to float\n" +
+ "----------\n" +
+ "36. ERROR in X.java (at line 17)\n" +
+ " float[] floats = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from double to float\n" +
+ "----------\n" +
+ "37. ERROR in X.java (at line 18)\n" +
+ " double[] doubles = { b, s, c, z, i, j, f, d, };\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from boolean to double\n" +
"----------\n");
}
//challenge narrowing conversion
@@ -1778,97 +1778,97 @@ public void test063() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " byte b;\n" +
- " short s;\n" +
- " char c;\n" +
- " boolean z;\n" +
- " int i;\n" +
- " long j;\n" +
- " float f;\n" +
- " double d;\n" +
- "void foo() {\n" +
- " boolean[] booleans = { (boolean)b, (boolean)s, (boolean)c, (boolean)z, (boolean)i, (boolean)j, (boolean)f, (boolean)d, };\n" +
- " byte[] bytes = { (byte)b, (byte)s, (byte)c, (byte)z, (byte)i, (byte)j, (byte)f, (byte)d, };\n" +
- " short[] shorts = { (short)b, (short)s, (short)c, (short)z, (short)i, (short)j, (short)f, (short)d, };\n" +
- " char[] chars = { (char)b, (char)s, (char)c, (char)z, (char)i, (char)j, (char)f, (char)d, };\n" +
- " int[] ints = { (int)b, (int)s, (int)c, (int)z, (int)i, (int)j, (int)f, (int)d, };\n" +
- " long[] longs = { (long)b, (long)s, (long)c, (long)z, (long)i, (long)j, (long)f, (long)d, };\n" +
- " float[] floats = { (float)b, (float)s, (float)c, (float)z, (float)i, (float)j, (float)f, (float)d, };\n" +
- " double[] doubles = { (double)b, (double)s, (double)c, (double)z, (double)i, (double)j, (double)f, (double)d, };\n" +
- "}\n" +
+ "public class X {\n" +
+ " byte b;\n" +
+ " short s;\n" +
+ " char c;\n" +
+ " boolean z;\n" +
+ " int i;\n" +
+ " long j;\n" +
+ " float f;\n" +
+ " double d;\n" +
+ "void foo() {\n" +
+ " boolean[] booleans = { (boolean)b, (boolean)s, (boolean)c, (boolean)z, (boolean)i, (boolean)j, (boolean)f, (boolean)d, };\n" +
+ " byte[] bytes = { (byte)b, (byte)s, (byte)c, (byte)z, (byte)i, (byte)j, (byte)f, (byte)d, };\n" +
+ " short[] shorts = { (short)b, (short)s, (short)c, (short)z, (short)i, (short)j, (short)f, (short)d, };\n" +
+ " char[] chars = { (char)b, (char)s, (char)c, (char)z, (char)i, (char)j, (char)f, (char)d, };\n" +
+ " int[] ints = { (int)b, (int)s, (int)c, (int)z, (int)i, (int)j, (int)f, (int)d, };\n" +
+ " long[] longs = { (long)b, (long)s, (long)c, (long)z, (long)i, (long)j, (long)f, (long)d, };\n" +
+ " float[] floats = { (float)b, (float)s, (float)c, (float)z, (float)i, (float)j, (float)f, (float)d, };\n" +
+ " double[] doubles = { (double)b, (double)s, (double)c, (double)z, (double)i, (double)j, (double)f, (double)d, };\n" +
+ "}\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " boolean[] booleans = { (boolean)b, (boolean)s, (boolean)c, (boolean)z, (boolean)i, (boolean)j, (boolean)f, (boolean)d, };\n" +
- " ^^^^^^^^^^\n" +
- "Cannot cast from byte to boolean\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " boolean[] booleans = { (boolean)b, (boolean)s, (boolean)c, (boolean)z, (boolean)i, (boolean)j, (boolean)f, (boolean)d, };\n" +
- " ^^^^^^^^^^\n" +
- "Cannot cast from short to boolean\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " boolean[] booleans = { (boolean)b, (boolean)s, (boolean)c, (boolean)z, (boolean)i, (boolean)j, (boolean)f, (boolean)d, };\n" +
- " ^^^^^^^^^^\n" +
- "Cannot cast from char to boolean\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 11)\n" +
- " boolean[] booleans = { (boolean)b, (boolean)s, (boolean)c, (boolean)z, (boolean)i, (boolean)j, (boolean)f, (boolean)d, };\n" +
- " ^^^^^^^^^^\n" +
- "Cannot cast from int to boolean\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 11)\n" +
- " boolean[] booleans = { (boolean)b, (boolean)s, (boolean)c, (boolean)z, (boolean)i, (boolean)j, (boolean)f, (boolean)d, };\n" +
- " ^^^^^^^^^^\n" +
- "Cannot cast from long to boolean\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 11)\n" +
- " boolean[] booleans = { (boolean)b, (boolean)s, (boolean)c, (boolean)z, (boolean)i, (boolean)j, (boolean)f, (boolean)d, };\n" +
- " ^^^^^^^^^^\n" +
- "Cannot cast from float to boolean\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 11)\n" +
- " boolean[] booleans = { (boolean)b, (boolean)s, (boolean)c, (boolean)z, (boolean)i, (boolean)j, (boolean)f, (boolean)d, };\n" +
- " ^^^^^^^^^^\n" +
- "Cannot cast from double to boolean\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 12)\n" +
- " byte[] bytes = { (byte)b, (byte)s, (byte)c, (byte)z, (byte)i, (byte)j, (byte)f, (byte)d, };\n" +
- " ^^^^^^^\n" +
- "Cannot cast from boolean to byte\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 13)\n" +
- " short[] shorts = { (short)b, (short)s, (short)c, (short)z, (short)i, (short)j, (short)f, (short)d, };\n" +
- " ^^^^^^^^\n" +
- "Cannot cast from boolean to short\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 14)\n" +
- " char[] chars = { (char)b, (char)s, (char)c, (char)z, (char)i, (char)j, (char)f, (char)d, };\n" +
- " ^^^^^^^\n" +
- "Cannot cast from boolean to char\n" +
- "----------\n" +
- "11. ERROR in X.java (at line 15)\n" +
- " int[] ints = { (int)b, (int)s, (int)c, (int)z, (int)i, (int)j, (int)f, (int)d, };\n" +
- " ^^^^^^\n" +
- "Cannot cast from boolean to int\n" +
- "----------\n" +
- "12. ERROR in X.java (at line 16)\n" +
- " long[] longs = { (long)b, (long)s, (long)c, (long)z, (long)i, (long)j, (long)f, (long)d, };\n" +
- " ^^^^^^^\n" +
- "Cannot cast from boolean to long\n" +
- "----------\n" +
- "13. ERROR in X.java (at line 17)\n" +
- " float[] floats = { (float)b, (float)s, (float)c, (float)z, (float)i, (float)j, (float)f, (float)d, };\n" +
- " ^^^^^^^^\n" +
- "Cannot cast from boolean to float\n" +
- "----------\n" +
- "14. ERROR in X.java (at line 18)\n" +
- " double[] doubles = { (double)b, (double)s, (double)c, (double)z, (double)i, (double)j, (double)f, (double)d, };\n" +
- " ^^^^^^^^^\n" +
- "Cannot cast from boolean to double\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " boolean[] booleans = { (boolean)b, (boolean)s, (boolean)c, (boolean)z, (boolean)i, (boolean)j, (boolean)f, (boolean)d, };\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot cast from byte to boolean\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " boolean[] booleans = { (boolean)b, (boolean)s, (boolean)c, (boolean)z, (boolean)i, (boolean)j, (boolean)f, (boolean)d, };\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot cast from short to boolean\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " boolean[] booleans = { (boolean)b, (boolean)s, (boolean)c, (boolean)z, (boolean)i, (boolean)j, (boolean)f, (boolean)d, };\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot cast from char to boolean\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 11)\n" +
+ " boolean[] booleans = { (boolean)b, (boolean)s, (boolean)c, (boolean)z, (boolean)i, (boolean)j, (boolean)f, (boolean)d, };\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot cast from int to boolean\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 11)\n" +
+ " boolean[] booleans = { (boolean)b, (boolean)s, (boolean)c, (boolean)z, (boolean)i, (boolean)j, (boolean)f, (boolean)d, };\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot cast from long to boolean\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 11)\n" +
+ " boolean[] booleans = { (boolean)b, (boolean)s, (boolean)c, (boolean)z, (boolean)i, (boolean)j, (boolean)f, (boolean)d, };\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot cast from float to boolean\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 11)\n" +
+ " boolean[] booleans = { (boolean)b, (boolean)s, (boolean)c, (boolean)z, (boolean)i, (boolean)j, (boolean)f, (boolean)d, };\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot cast from double to boolean\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 12)\n" +
+ " byte[] bytes = { (byte)b, (byte)s, (byte)c, (byte)z, (byte)i, (byte)j, (byte)f, (byte)d, };\n" +
+ " ^^^^^^^\n" +
+ "Cannot cast from boolean to byte\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 13)\n" +
+ " short[] shorts = { (short)b, (short)s, (short)c, (short)z, (short)i, (short)j, (short)f, (short)d, };\n" +
+ " ^^^^^^^^\n" +
+ "Cannot cast from boolean to short\n" +
+ "----------\n" +
+ "10. ERROR in X.java (at line 14)\n" +
+ " char[] chars = { (char)b, (char)s, (char)c, (char)z, (char)i, (char)j, (char)f, (char)d, };\n" +
+ " ^^^^^^^\n" +
+ "Cannot cast from boolean to char\n" +
+ "----------\n" +
+ "11. ERROR in X.java (at line 15)\n" +
+ " int[] ints = { (int)b, (int)s, (int)c, (int)z, (int)i, (int)j, (int)f, (int)d, };\n" +
+ " ^^^^^^\n" +
+ "Cannot cast from boolean to int\n" +
+ "----------\n" +
+ "12. ERROR in X.java (at line 16)\n" +
+ " long[] longs = { (long)b, (long)s, (long)c, (long)z, (long)i, (long)j, (long)f, (long)d, };\n" +
+ " ^^^^^^^\n" +
+ "Cannot cast from boolean to long\n" +
+ "----------\n" +
+ "13. ERROR in X.java (at line 17)\n" +
+ " float[] floats = { (float)b, (float)s, (float)c, (float)z, (float)i, (float)j, (float)f, (float)d, };\n" +
+ " ^^^^^^^^\n" +
+ "Cannot cast from boolean to float\n" +
+ "----------\n" +
+ "14. ERROR in X.java (at line 18)\n" +
+ " double[] doubles = { (double)b, (double)s, (double)c, (double)z, (double)i, (double)j, (double)f, (double)d, };\n" +
+ " ^^^^^^^^^\n" +
+ "Cannot cast from boolean to double\n" +
"----------\n");
}
public void test064() {
@@ -1907,11 +1907,11 @@ public void test065() {
" boolean foo() { return true; }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " return foo && (foo = foo);\n" +
- " ^^^^^^^^^^^\n" +
- "The assignment to variable foo has no effect\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " return foo && (foo = foo);\n" +
+ " ^^^^^^^^^^^\n" +
+ "The assignment to variable foo has no effect\n" +
"----------\n",
null,
true,
@@ -1927,22 +1927,22 @@ public void test066() {
"X.java",
"public class X {\n" +
" public boolean test() {\n" +
- " int i = 1;\n" +
- " if (i != (i = 2)) {\n" +
- " System.out.println(\"The first warning is unjust.\");\n" +
- " }\n" +
- " if ((i = 3) != i) {\n" +
- " System.out.println(\"The second warning is just.\");\n" +
- " }\n" +
- " return false;\n" +
+ " int i = 1;\n" +
+ " if (i != (i = 2)) {\n" +
+ " System.out.println(\"The first warning is unjust.\");\n" +
+ " }\n" +
+ " if ((i = 3) != i) {\n" +
+ " System.out.println(\"The second warning is just.\");\n" +
+ " }\n" +
+ " return false;\n" +
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " if ((i = 3) != i) {\n" +
- " ^^^^^^^^^^^^\n" +
- "Comparing identical expressions\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " if ((i = 3) != i) {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Comparing identical expressions\n" +
"----------\n",
null,
true,
@@ -1958,22 +1958,22 @@ public void test067() {
"X.java",
"public class X {\n" +
" public boolean test() {\n" +
- " String s = \"Hello World\";\n" +
- " if (s != (s = \"\")) {\n" +
- " System.out.println(\"The first warning is unjust.\");\n" +
- " }\n" +
- " if ((s = \"\") != s) {\n" +
- " System.out.println(\"The second warning is just.\");\n" +
- " }\n" +
- " return false;\n" +
+ " String s = \"Hello World\";\n" +
+ " if (s != (s = \"\")) {\n" +
+ " System.out.println(\"The first warning is unjust.\");\n" +
+ " }\n" +
+ " if ((s = \"\") != s) {\n" +
+ " System.out.println(\"The second warning is just.\");\n" +
+ " }\n" +
+ " return false;\n" +
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " if ((s = \"\") != s) {\n" +
- " ^^^^^^^^^^^^^\n" +
- "Comparing identical expressions\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " if ((s = \"\") != s) {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Comparing identical expressions\n" +
"----------\n",
null,
true,
@@ -1998,86 +1998,86 @@ public void test068() {
" }\n" +
"}\n"
},
- this.complianceLevel < ClassFileConstants.JDK1_5 ?
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Integer f = \'a\'; // Field declaration.\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from char to Integer\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " Integer i = \'a\'; // local declaration with initialization.\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from char to Integer\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " i = \'a\'; // assignment\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from char to Integer\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " Integer [] ia = new Integer [] { \'a\' }; // array initializer.\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from char to Integer\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " return \'a\'; // return statement.\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from char to Integer\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 8)\n" +
- " switch (i) {\n" +
- " ^\n" +
- "Cannot switch on a value of type Integer. Only convertible int values or enum variables are permitted\n" +
- "----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Integer f = \'a\'; // Field declaration.\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from char to Integer\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " Integer i = \'a\'; // local declaration with initialization.\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from char to Integer\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " i = \'a\'; // assignment\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from char to Integer\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " Integer [] ia = new Integer [] { \'a\' }; // array initializer.\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from char to Integer\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " return \'a\'; // return statement.\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from char to Integer\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 9)\n" +
- " case \'a\' : // case statement\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from char to Integer\n" +
+ this.complianceLevel < ClassFileConstants.JDK1_5 ?
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " Integer f = \'a\'; // Field declaration.\n" +
+ " ^^^\n" +
+ "Type mismatch: cannot convert from char to Integer\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " Integer i = \'a\'; // local declaration with initialization.\n" +
+ " ^^^\n" +
+ "Type mismatch: cannot convert from char to Integer\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " i = \'a\'; // assignment\n" +
+ " ^^^\n" +
+ "Type mismatch: cannot convert from char to Integer\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " Integer [] ia = new Integer [] { \'a\' }; // array initializer.\n" +
+ " ^^^\n" +
+ "Type mismatch: cannot convert from char to Integer\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 7)\n" +
+ " return \'a\'; // return statement.\n" +
+ " ^^^\n" +
+ "Type mismatch: cannot convert from char to Integer\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 8)\n" +
+ " switch (i) {\n" +
+ " ^\n" +
+ "Cannot switch on a value of type Integer. Only convertible int values or enum variables are permitted\n" +
+ "----------\n" :
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " Integer f = \'a\'; // Field declaration.\n" +
+ " ^^^\n" +
+ "Type mismatch: cannot convert from char to Integer\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " Integer i = \'a\'; // local declaration with initialization.\n" +
+ " ^^^\n" +
+ "Type mismatch: cannot convert from char to Integer\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " i = \'a\'; // assignment\n" +
+ " ^^^\n" +
+ "Type mismatch: cannot convert from char to Integer\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " Integer [] ia = new Integer [] { \'a\' }; // array initializer.\n" +
+ " ^^^\n" +
+ "Type mismatch: cannot convert from char to Integer\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 7)\n" +
+ " return \'a\'; // return statement.\n" +
+ " ^^^\n" +
+ "Type mismatch: cannot convert from char to Integer\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 9)\n" +
+ " case \'a\' : // case statement\n" +
+ " ^^^\n" +
+ "Type mismatch: cannot convert from char to Integer\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=480989
public void testbug480989() {
- String src =
- "public abstract class Unassigned {\n" +
- " public Unassigned() {}\n" +
- " static class SubClass extends Unassigned {\n" +
- " private final String test;\n" +
- " public SubClass(String atest) { // rename\n" +
- " System.out.println(this.test);\n" +
- " this.test = atest;\n" +
- " System.out.println(this.test);\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new SubClass(\"Hello World!\");\n" +
- " }\n" +
+ String src =
+ "public abstract class Unassigned {\n" +
+ " public Unassigned() {}\n" +
+ " static class SubClass extends Unassigned {\n" +
+ " private final String test;\n" +
+ " public SubClass(String atest) { // rename\n" +
+ " System.out.println(this.test);\n" +
+ " this.test = atest;\n" +
+ " System.out.println(this.test);\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new SubClass(\"Hello World!\");\n" +
+ " }\n" +
"}\n";
if (this.complianceLevel >= ClassFileConstants.JDK1_7) {
this.runNegativeTest(
@@ -2085,17 +2085,17 @@ public void testbug480989() {
"Unassigned.java",
src
},
- "----------\n" +
- "1. ERROR in Unassigned.java (at line 6)\n" +
- " System.out.println(this.test);\n" +
- " ^^^^\n" +
- "The blank final field test may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in Unassigned.java (at line 6)\n" +
+ " System.out.println(this.test);\n" +
+ " ^^^^\n" +
+ "The blank final field test may not have been initialized\n" +
"----------\n");
} else {
this.runConformTest(
new String[] {
"Unassigned.java",
- src
+ src
},
"null\n" +
"Hello World!");
@@ -2106,26 +2106,26 @@ public void testBug486908_A(){
if (this.complianceLevel >= ClassFileConstants.JDK1_7) {
this.runConformTest(new String[] {
"Random.java",
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "public class Random {\n" +
- " private final List<Object> values;\n" +
- " public Random() {\n" +
- " values = new ArrayList<>();\n" +
- " }\n" +
- " public Random(Object arg) {\n" +
- " if(arg instanceof Random) {\n" +
- " values = ((Random)(arg)).values; //Compile error here.\n" +
- " } else {\n" +
- " throw new IllegalArgumentException(\"arg is not instance of Random\");\n" +
- " }\n" +
- " }\n" +
- " public static void foo() {\n" +
- " return;\n" +
- " }\n" +
- " public static void main(String[] args){\n" +
- " foo();\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "public class Random {\n" +
+ " private final List<Object> values;\n" +
+ " public Random() {\n" +
+ " values = new ArrayList<>();\n" +
+ " }\n" +
+ " public Random(Object arg) {\n" +
+ " if(arg instanceof Random) {\n" +
+ " values = ((Random)(arg)).values; //Compile error here.\n" +
+ " } else {\n" +
+ " throw new IllegalArgumentException(\"arg is not instance of Random\");\n" +
+ " }\n" +
+ " }\n" +
+ " public static void foo() {\n" +
+ " return;\n" +
+ " }\n" +
+ " public static void main(String[] args){\n" +
+ " foo();\n" +
+ " }\n" +
"}\n"
});
}
@@ -2133,17 +2133,17 @@ public void testBug486908_A(){
public void testBug486908_B() {
this.runConformTest(new String[] {
"Sample.java",
- "public class Sample {\n" +
- " public final String value;\n" +
- " public Sample() {\n" +
- " this.value = new Sample().value;\n" +
- " }\n" +
- " public static void foo() {\n" +
- " return;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " foo();\n" +
- " }\n" +
+ "public class Sample {\n" +
+ " public final String value;\n" +
+ " public Sample() {\n" +
+ " this.value = new Sample().value;\n" +
+ " }\n" +
+ " public static void foo() {\n" +
+ " return;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " foo();\n" +
+ " }\n" +
"}\n"
});
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest_1_5.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest_1_5.java
index 730cba576..b25362089 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest_1_5.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest_1_5.java
@@ -48,19 +48,19 @@ public void test1() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Integer value = 4711;\n" +
- " double test = 47d;\n" +
- " value += test;\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Integer value = 4711;\n" +
+ " double test = 47d;\n" +
+ " value += test;\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " value += test;\n" +
- " ^^^^^^^^^^^^^\n" +
- "The operator += is undefined for the argument type(s) Integer, double\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " value += test;\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The operator += is undefined for the argument type(s) Integer, double\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=277450
@@ -68,19 +68,19 @@ public void test2() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Integer value = 4711;\n" +
- " float test = 47f;\n" +
- " value += test;\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Integer value = 4711;\n" +
+ " float test = 47f;\n" +
+ " value += test;\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " value += test;\n" +
- " ^^^^^^^^^^^^^\n" +
- "The operator += is undefined for the argument type(s) Integer, float\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " value += test;\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The operator += is undefined for the argument type(s) Integer, float\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=277450
@@ -88,13 +88,13 @@ public void test3() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Integer value = 4711;\n" +
- " byte test = 47;\n" +
- " value += test;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Integer value = 4711;\n" +
+ " byte test = 47;\n" +
+ " value += test;\n" +
" System.out.println(value);\n" +
- " }\n" +
+ " }\n" +
"}",
},
"4758");
@@ -104,13 +104,13 @@ public void test4() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Integer value = 4711;\n" +
- " char test = 'a';\n" +
- " value += test;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Integer value = 4711;\n" +
+ " char test = 'a';\n" +
+ " value += test;\n" +
" System.out.println(value);\n" +
- " }\n" +
+ " }\n" +
"}",
},
"4808");
@@ -120,20 +120,20 @@ public void test5() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Integer value = 4711;\n" +
- " long test = 100L;\n" +
- " value += test;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Integer value = 4711;\n" +
+ " long test = 100L;\n" +
+ " value += test;\n" +
" System.out.println(value);\n" +
- " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " value += test;\n" +
- " ^^^^^^^^^^^^^\n" +
- "The operator += is undefined for the argument type(s) Integer, long\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " value += test;\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The operator += is undefined for the argument type(s) Integer, long\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=277450
@@ -141,20 +141,20 @@ public void test6() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Integer value = 4711;\n" +
- " boolean test = true;\n" +
- " value += test;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Integer value = 4711;\n" +
+ " boolean test = true;\n" +
+ " value += test;\n" +
" System.out.println(value);\n" +
- " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " value += test;\n" +
- " ^^^^^^^^^^^^^\n" +
- "The operator += is undefined for the argument type(s) int, boolean\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " value += test;\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The operator += is undefined for the argument type(s) int, boolean\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=277450
@@ -162,13 +162,13 @@ public void test7() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Integer value = 4711;\n" +
- " short test = 32767;\n" +
- " value += test;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Integer value = 4711;\n" +
+ " short test = 32767;\n" +
+ " value += test;\n" +
" System.out.println(value);\n" +
- " }\n" +
+ " }\n" +
"}",
},
"37478");
@@ -178,12 +178,12 @@ public void test8() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " int x = -8;\n" +
- " x += 7.8f;\n" +
- " System.out.println(x == 0 ? \"SUCCESS\" : \"FAILED\");\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " int x = -8;\n" +
+ " x += 7.8f;\n" +
+ " System.out.println(x == 0 ? \"SUCCESS\" : \"FAILED\");\n" +
+ " }\n" +
"}",
},
"SUCCESS");
@@ -231,22 +231,22 @@ public void test11() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String args[]) { \n" +
- " Long _long = new Long(44);\n" +
- " byte b = (byte) 1;\n" +
- " char c = (char) 2;\n" +
- " short s = (short) 32767;\n" +
- " int i = 10;\n" +
- " long l = 80L;\n" +
- " _long >>>= b;\n" +
- " _long <<= c;\n" +
- " _long >>= s;\n" +
- " _long >>>= i;\n" +
- " _long = 77l;\n" +
- " _long <<= l;\n" +
- " System.out.println(_long);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String args[]) { \n" +
+ " Long _long = new Long(44);\n" +
+ " byte b = (byte) 1;\n" +
+ " char c = (char) 2;\n" +
+ " short s = (short) 32767;\n" +
+ " int i = 10;\n" +
+ " long l = 80L;\n" +
+ " _long >>>= b;\n" +
+ " _long <<= c;\n" +
+ " _long >>= s;\n" +
+ " _long >>>= i;\n" +
+ " _long = 77l;\n" +
+ " _long <<= l;\n" +
+ " System.out.println(_long);\n" +
+ " }\n" +
"}",
},
"5046272"
@@ -273,19 +273,19 @@ public void test13() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Integer value = 4711;\n" +
- " long test = 47L;\n" +
- " value &= test;\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Integer value = 4711;\n" +
+ " long test = 47L;\n" +
+ " value &= test;\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " value &= test;\n" +
- " ^^^^^^^^^^^^^\n" +
- "The operator &= is undefined for the argument type(s) Integer, long\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " value &= test;\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The operator &= is undefined for the argument type(s) Integer, long\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=277450
@@ -293,19 +293,19 @@ public void test14() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Integer value = 4711;\n" +
- " long test = 47L;\n" +
- " value |= test;\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Integer value = 4711;\n" +
+ " long test = 47L;\n" +
+ " value |= test;\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " value |= test;\n" +
- " ^^^^^^^^^^^^^\n" +
- "The operator |= is undefined for the argument type(s) Integer, long\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " value |= test;\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The operator |= is undefined for the argument type(s) Integer, long\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=277450
@@ -313,12 +313,12 @@ public void test15() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Byte value = (byte) 1;\n" +
- " value++;\n" +
- " System.out.println(value);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Byte value = (byte) 1;\n" +
+ " value++;\n" +
+ " System.out.println(value);\n" +
+ " }\n" +
"}",
},
"2");
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest_1_7.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest_1_7.java
index a7f099c4a..c55271441 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest_1_7.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest_1_7.java
@@ -51,16 +51,16 @@ public void test001() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Object o = new X();\n" +
- " String s = \"ESS\";\n" +
- " o += s;\n" +
- " System.out.println(o);\n" +
- " }\n" +
- " public String toString() {\n" +
- " return \"SUCC\";\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object o = new X();\n" +
+ " String s = \"ESS\";\n" +
+ " o += s;\n" +
+ " System.out.println(o);\n" +
+ " }\n" +
+ " public String toString() {\n" +
+ " return \"SUCC\";\n" +
+ " }\n" +
"}",
},
"SUCCESS");
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AutoBoxingTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AutoBoxingTest.java
index b1f37b7d8..b7f1167b0 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AutoBoxingTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AutoBoxingTest.java
@@ -2934,21 +2934,21 @@ public class AutoBoxingTest extends AbstractComparableTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " new X().foo(1);\n" +
- " ^^^\n" +
- "The method foo(Object[]) is ambiguous for the type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " new X().foo(new Integer(1));\n" +
- " ^^^\n" +
- "The method foo(Object[]) is ambiguous for the type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " new X().foo(1, new Integer(1));\n" +
- " ^^^\n" +
- "The method foo(Object[]) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " new X().foo(1);\n" +
+ " ^^^\n" +
+ "The method foo(Object[]) is ambiguous for the type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " new X().foo(new Integer(1));\n" +
+ " ^^^\n" +
+ "The method foo(Object[]) is ambiguous for the type X\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " new X().foo(1, new Integer(1));\n" +
+ " ^^^\n" +
+ "The method foo(Object[]) is ambiguous for the type X\n" +
"----------\n");
this.runNegativeTest(
new String[] {
@@ -3785,18 +3785,18 @@ public void test124() {
" } \n" +
"}", // =================
},
- this.complianceLevel >= ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " boolean x = false ? \"\" : false;\n" +
- " ^^\n" +
- "Type mismatch: cannot convert from String to boolean\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " System.out.print(\"[4:\"+ x + \",\" + x.getClass().getCanonicalName() + \"]\");\n" +
- " ^^^^^^^^^^^^\n" +
- "Cannot invoke getClass() on the primitive type boolean\n" +
- "----------\n" :
+ this.complianceLevel >= ClassFileConstants.JDK1_8 ?
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " boolean x = false ? \"\" : false;\n" +
+ " ^^\n" +
+ "Type mismatch: cannot convert from String to boolean\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " System.out.print(\"[4:\"+ x + \",\" + x.getClass().getCanonicalName() + \"]\");\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Cannot invoke getClass() on the primitive type boolean\n" +
+ "----------\n" :
"----------\n" +
"1. ERROR in X.java (at line 3)\n" +
" boolean x = false ? \"\" : false;\n" +
@@ -4614,29 +4614,29 @@ public void test154() {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T> {\n" +
- " T counter;\n" +
- " public static void main(String[] args) {\n" +
- " bar(new X<Integer>());\n" +
- " new Y().foo();\n" +
- " new Y().baz();\n" +
- " }\n" +
- " static void bar(X<Integer> x) {\n" +
- " x.counter = 0;\n" +
- " System.out.print(Integer.toString(x.counter++));\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Y extends X<Integer> {\n" +
- " Y() {\n" +
- " this.counter = 0;\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.print(Integer.toString(counter++));\n" +
- " }\n" +
- " void baz() {\n" +
- " System.out.println(Integer.toString(this.counter++));\n" +
- " }\n" +
+ "public class X<T> {\n" +
+ " T counter;\n" +
+ " public static void main(String[] args) {\n" +
+ " bar(new X<Integer>());\n" +
+ " new Y().foo();\n" +
+ " new Y().baz();\n" +
+ " }\n" +
+ " static void bar(X<Integer> x) {\n" +
+ " x.counter = 0;\n" +
+ " System.out.print(Integer.toString(x.counter++));\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class Y extends X<Integer> {\n" +
+ " Y() {\n" +
+ " this.counter = 0;\n" +
+ " }\n" +
+ " void foo() {\n" +
+ " System.out.print(Integer.toString(counter++));\n" +
+ " }\n" +
+ " void baz() {\n" +
+ " System.out.println(Integer.toString(this.counter++));\n" +
+ " }\n" +
"}\n",
},
"000");
@@ -4646,29 +4646,29 @@ public void test155() {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T> {\n" +
- " T[] counter;\n" +
- " public static void main(String[] args) {\n" +
- " bar(new X<Integer>());\n" +
- " new Y().foo();\n" +
- " new Y().baz();\n" +
- " }\n" +
- " static void bar(X<Integer> x) {\n" +
- " x.counter = new Integer[]{ 0 };\n" +
- " System.out.print(Integer.toString(x.counter[0]++));\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Y extends X<Integer> {\n" +
- " Y() {\n" +
- " this.counter = new Integer[]{ 0 };\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.print(Integer.toString(counter[0]++));\n" +
- " }\n" +
- " void baz() {\n" +
- " System.out.println(Integer.toString(this.counter[0]++));\n" +
- " }\n" +
+ "public class X<T> {\n" +
+ " T[] counter;\n" +
+ " public static void main(String[] args) {\n" +
+ " bar(new X<Integer>());\n" +
+ " new Y().foo();\n" +
+ " new Y().baz();\n" +
+ " }\n" +
+ " static void bar(X<Integer> x) {\n" +
+ " x.counter = new Integer[]{ 0 };\n" +
+ " System.out.print(Integer.toString(x.counter[0]++));\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class Y extends X<Integer> {\n" +
+ " Y() {\n" +
+ " this.counter = new Integer[]{ 0 };\n" +
+ " }\n" +
+ " void foo() {\n" +
+ " System.out.print(Integer.toString(counter[0]++));\n" +
+ " }\n" +
+ " void baz() {\n" +
+ " System.out.println(Integer.toString(this.counter[0]++));\n" +
+ " }\n" +
"}\n",
},
"000");
@@ -4678,16 +4678,16 @@ public void test156() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " static void print(Character c) {\n" +
- " System.out.print((char) c);\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " char c = \'H\';\n" +
- " print(c++);\n" +
- " print(c++);\n" +
- " System.out.println(\"done\");\n" +
- " }\n" +
+ "public class X {\n" +
+ " static void print(Character c) {\n" +
+ " System.out.print((char) c);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " char c = \'H\';\n" +
+ " print(c++);\n" +
+ " print(c++);\n" +
+ " System.out.println(\"done\");\n" +
+ " }\n" +
"}\n",
},
"HIdone");
@@ -4697,17 +4697,17 @@ public void test157() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " char c = \'H\';\n" +
- " static void print(Character c) {\n" +
- " System.out.print((char) c);\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X x = new X();\n" +
- " print(x.c++);\n" +
- " print(x.c++);\n" +
- " System.out.println(\"done\");\n" +
- " }\n" +
+ "public class X {\n" +
+ " char c = \'H\';\n" +
+ " static void print(Character c) {\n" +
+ " System.out.print((char) c);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X x = new X();\n" +
+ " print(x.c++);\n" +
+ " print(x.c++);\n" +
+ " System.out.println(\"done\");\n" +
+ " }\n" +
"}\n",
},
"HIdone");
@@ -4717,19 +4717,19 @@ public void test158() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " static X singleton = new X();\n" +
- " static X singleton() { return singleton; }\n" +
- " char c = \'H\';\n" +
- " \n" +
- " static void print(Character c) {\n" +
- " System.out.print((char) c);\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " print(singleton().c++);\n" +
- " print(singleton().c++);\n" +
- " System.out.println(\"done\");\n" +
- " }\n" +
+ "public class X {\n" +
+ " static X singleton = new X();\n" +
+ " static X singleton() { return singleton; }\n" +
+ " char c = \'H\';\n" +
+ " \n" +
+ " static void print(Character c) {\n" +
+ " System.out.print((char) c);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " print(singleton().c++);\n" +
+ " print(singleton().c++);\n" +
+ " System.out.println(\"done\");\n" +
+ " }\n" +
"}\n",
},
"HIdone");
@@ -4739,37 +4739,37 @@ public void test159() {
this.runNegativeTest(
new String[] {
"X.java",
- "import java.util.ArrayList;\n" +
- "public class X {\n" +
- " ArrayList params;\n" +
- " public int getSqlParamCount() {\n" +
- " return params == null ? null:params.size();\n" +
- " }\n" +
- " public int getSqlParamCount2() {\n" +
- " return null;\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "public class X {\n" +
+ " ArrayList params;\n" +
+ " public int getSqlParamCount() {\n" +
+ " return params == null ? null:params.size();\n" +
+ " }\n" +
+ " public int getSqlParamCount2() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " ArrayList params;\n" +
- " ^^^^^^^^^\n" +
- "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " return params == null ? null:params.size();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The expression of type Integer is unboxed into int\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 5)\n" +
- " return params == null ? null:params.size();\n" +
- " ^^^^^^^^^^^^^\n" +
- "The expression of type int is boxed into Integer\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " return null;\n" +
- " ^^^^\n" +
- "Type mismatch: cannot convert from null to int\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " ArrayList params;\n" +
+ " ^^^^^^^^^\n" +
+ "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " return params == null ? null:params.size();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The expression of type Integer is unboxed into int\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 5)\n" +
+ " return params == null ? null:params.size();\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The expression of type int is boxed into Integer\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " return null;\n" +
+ " ^^^^\n" +
+ "Type mismatch: cannot convert from null to int\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=232565 - variation
@@ -4777,29 +4777,29 @@ public void test160() {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T> {\n" +
- " T counter;\n" +
- " public static void main(String[] args) {\n" +
- " bar(new X<Integer>());\n" +
- " new Y().foo();\n" +
- " new Y().baz();\n" +
- " }\n" +
- " static void bar(X<Integer> x) {\n" +
- " x.counter = 0;\n" +
- " System.out.print(Integer.toString(++x.counter));\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Y extends X<Integer> {\n" +
- " Y() {\n" +
- " this.counter = 0;\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.print(Integer.toString(++counter));\n" +
- " }\n" +
- " void baz() {\n" +
- " System.out.println(Integer.toString(++this.counter));\n" +
- " }\n" +
+ "public class X<T> {\n" +
+ " T counter;\n" +
+ " public static void main(String[] args) {\n" +
+ " bar(new X<Integer>());\n" +
+ " new Y().foo();\n" +
+ " new Y().baz();\n" +
+ " }\n" +
+ " static void bar(X<Integer> x) {\n" +
+ " x.counter = 0;\n" +
+ " System.out.print(Integer.toString(++x.counter));\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class Y extends X<Integer> {\n" +
+ " Y() {\n" +
+ " this.counter = 0;\n" +
+ " }\n" +
+ " void foo() {\n" +
+ " System.out.print(Integer.toString(++counter));\n" +
+ " }\n" +
+ " void baz() {\n" +
+ " System.out.println(Integer.toString(++this.counter));\n" +
+ " }\n" +
"}\n",
},
"111");
@@ -4809,29 +4809,29 @@ public void test161() {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T> {\n" +
- " T[] counter;\n" +
- " public static void main(String[] args) {\n" +
- " bar(new X<Integer>());\n" +
- " new Y().foo();\n" +
- " new Y().baz();\n" +
- " }\n" +
- " static void bar(X<Integer> x) {\n" +
- " x.counter = new Integer[]{ 0 };\n" +
- " System.out.print(Integer.toString(++x.counter[0]));\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Y extends X<Integer> {\n" +
- " Y() {\n" +
- " this.counter = new Integer[]{ 0 };\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.print(Integer.toString(++counter[0]));\n" +
- " }\n" +
- " void baz() {\n" +
- " System.out.println(Integer.toString(++this.counter[0]));\n" +
- " }\n" +
+ "public class X<T> {\n" +
+ " T[] counter;\n" +
+ " public static void main(String[] args) {\n" +
+ " bar(new X<Integer>());\n" +
+ " new Y().foo();\n" +
+ " new Y().baz();\n" +
+ " }\n" +
+ " static void bar(X<Integer> x) {\n" +
+ " x.counter = new Integer[]{ 0 };\n" +
+ " System.out.print(Integer.toString(++x.counter[0]));\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class Y extends X<Integer> {\n" +
+ " Y() {\n" +
+ " this.counter = new Integer[]{ 0 };\n" +
+ " }\n" +
+ " void foo() {\n" +
+ " System.out.print(Integer.toString(++counter[0]));\n" +
+ " }\n" +
+ " void baz() {\n" +
+ " System.out.println(Integer.toString(++this.counter[0]));\n" +
+ " }\n" +
"}\n",
},
"111");
@@ -4841,16 +4841,16 @@ public void test162() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " static void print(Character c) {\n" +
- " System.out.print((char) c);\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " char c = \'H\';\n" +
- " print(++c);\n" +
- " print(++c);\n" +
- " System.out.println(\"done\");\n" +
- " }\n" +
+ "public class X {\n" +
+ " static void print(Character c) {\n" +
+ " System.out.print((char) c);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " char c = \'H\';\n" +
+ " print(++c);\n" +
+ " print(++c);\n" +
+ " System.out.println(\"done\");\n" +
+ " }\n" +
"}\n",
},
"IJdone");
@@ -4860,17 +4860,17 @@ public void test163() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " char c = \'H\';\n" +
- " static void print(Character c) {\n" +
- " System.out.print((char) c);\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X x = new X();\n" +
- " print(++x.c);\n" +
- " print(++x.c);\n" +
- " System.out.println(\"done\");\n" +
- " }\n" +
+ "public class X {\n" +
+ " char c = \'H\';\n" +
+ " static void print(Character c) {\n" +
+ " System.out.print((char) c);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X x = new X();\n" +
+ " print(++x.c);\n" +
+ " print(++x.c);\n" +
+ " System.out.println(\"done\");\n" +
+ " }\n" +
"}\n",
},
"IJdone");
@@ -4880,19 +4880,19 @@ public void test164() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " static X singleton = new X();\n" +
- " static X singleton() { return singleton; }\n" +
- " char c = \'H\';\n" +
- " \n" +
- " static void print(Character c) {\n" +
- " System.out.print((char) c);\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " print(++singleton().c);\n" +
- " print(++singleton().c);\n" +
- " System.out.println(\"done\");\n" +
- " }\n" +
+ "public class X {\n" +
+ " static X singleton = new X();\n" +
+ " static X singleton() { return singleton; }\n" +
+ " char c = \'H\';\n" +
+ " \n" +
+ " static void print(Character c) {\n" +
+ " System.out.print((char) c);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " print(++singleton().c);\n" +
+ " print(++singleton().c);\n" +
+ " System.out.println(\"done\");\n" +
+ " }\n" +
"}\n",
},
"IJdone");
@@ -4902,96 +4902,96 @@ public void test165() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public void foo() {\n" +
- " Integer i1 = 10 ;\n" +
- " final short s = 100;\n" +
- " i1 = s;\n" +
- " switch (i1)\n" +
- " {\n" +
- " case s:\n" +
- " }\n" +
- " }\n" +
- " public void bar() {\n" +
- " Integer i2 = 10 ;\n" +
- " final byte b = 100;\n" +
- " i2 = b;\n" +
- " switch (i2)\n" +
- " {\n" +
- " case b:\n" +
- " }\n" +
- " } \n" +
- " public void baz() {\n" +
- " Integer i3 = 10 ;\n" +
- " final char c = 100;\n" +
- " i3 = c;\n" +
- " switch (i3)\n" +
- " {\n" +
- " case c:\n" +
- " }\n" +
- " } \n" +
+ "public class X {\n" +
+ " public void foo() {\n" +
+ " Integer i1 = 10 ;\n" +
+ " final short s = 100;\n" +
+ " i1 = s;\n" +
+ " switch (i1)\n" +
+ " {\n" +
+ " case s:\n" +
+ " }\n" +
+ " }\n" +
+ " public void bar() {\n" +
+ " Integer i2 = 10 ;\n" +
+ " final byte b = 100;\n" +
+ " i2 = b;\n" +
+ " switch (i2)\n" +
+ " {\n" +
+ " case b:\n" +
+ " }\n" +
+ " } \n" +
+ " public void baz() {\n" +
+ " Integer i3 = 10 ;\n" +
+ " final char c = 100;\n" +
+ " i3 = c;\n" +
+ " switch (i3)\n" +
+ " {\n" +
+ " case c:\n" +
+ " }\n" +
+ " } \n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " Integer i1 = 10 ;\n" +
- " ^^\n" +
- "The expression of type int is boxed into Integer\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " i1 = s;\n" +
- " ^\n" +
- "Type mismatch: cannot convert from short to Integer\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " switch (i1)\n" +
- " ^^\n" +
- "The expression of type Integer is unboxed into int\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " case s:\n" +
- " ^\n" +
- "Type mismatch: cannot convert from short to Integer\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 12)\n" +
- " Integer i2 = 10 ;\n" +
- " ^^\n" +
- "The expression of type int is boxed into Integer\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 14)\n" +
- " i2 = b;\n" +
- " ^\n" +
- "Type mismatch: cannot convert from byte to Integer\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 15)\n" +
- " switch (i2)\n" +
- " ^^\n" +
- "The expression of type Integer is unboxed into int\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 17)\n" +
- " case b:\n" +
- " ^\n" +
- "Type mismatch: cannot convert from byte to Integer\n" +
- "----------\n" +
- "9. WARNING in X.java (at line 21)\n" +
- " Integer i3 = 10 ;\n" +
- " ^^\n" +
- "The expression of type int is boxed into Integer\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 23)\n" +
- " i3 = c;\n" +
- " ^\n" +
- "Type mismatch: cannot convert from char to Integer\n" +
- "----------\n" +
- "11. WARNING in X.java (at line 24)\n" +
- " switch (i3)\n" +
- " ^^\n" +
- "The expression of type Integer is unboxed into int\n" +
- "----------\n" +
- "12. ERROR in X.java (at line 26)\n" +
- " case c:\n" +
- " ^\n" +
- "Type mismatch: cannot convert from char to Integer\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " Integer i1 = 10 ;\n" +
+ " ^^\n" +
+ "The expression of type int is boxed into Integer\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " i1 = s;\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from short to Integer\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " switch (i1)\n" +
+ " ^^\n" +
+ "The expression of type Integer is unboxed into int\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " case s:\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from short to Integer\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 12)\n" +
+ " Integer i2 = 10 ;\n" +
+ " ^^\n" +
+ "The expression of type int is boxed into Integer\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 14)\n" +
+ " i2 = b;\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from byte to Integer\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 15)\n" +
+ " switch (i2)\n" +
+ " ^^\n" +
+ "The expression of type Integer is unboxed into int\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 17)\n" +
+ " case b:\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from byte to Integer\n" +
+ "----------\n" +
+ "9. WARNING in X.java (at line 21)\n" +
+ " Integer i3 = 10 ;\n" +
+ " ^^\n" +
+ "The expression of type int is boxed into Integer\n" +
+ "----------\n" +
+ "10. ERROR in X.java (at line 23)\n" +
+ " i3 = c;\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from char to Integer\n" +
+ "----------\n" +
+ "11. WARNING in X.java (at line 24)\n" +
+ " switch (i3)\n" +
+ " ^^\n" +
+ "The expression of type Integer is unboxed into int\n" +
+ "----------\n" +
+ "12. ERROR in X.java (at line 26)\n" +
+ " case c:\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from char to Integer\n" +
"----------\n");
}
@@ -5000,147 +5000,147 @@ public void test166() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " void foo(short s, byte b, char c) {\n" +
- " Integer is = s;\n" +
- " Integer ib = b;\n" +
- " Integer ic = c; \n" +
- " }\n" +
- " void foo() {\n" +
- " final short s = 0;\n" +
- " final byte b = 0;\n" +
- " final char c = 0;\n" +
- " Integer is = s;\n" +
- " Integer ib = b;\n" +
- " Integer ic = c; \n" +
- " }\n" +
- " void foo2() {\n" +
- " Integer is = (short)0;\n" +
- " Integer ib = (byte)0;\n" +
- " Integer ic = (char)0; \n" +
- " }\n" +
- " void foo3() {\n" +
- " Short si = 0;\n" +
- " Byte bi = 0;\n" +
- " Character ci = 0;\n" +
- " }\n" +
- " void foo4() {\n" +
- " Short si = (byte) 0;\n" +
- " Byte bi = (short) 0;\n" +
- " Character ci = (short) 0;\n" +
- " }\n" +
+ "public class X {\n" +
+ " void foo(short s, byte b, char c) {\n" +
+ " Integer is = s;\n" +
+ " Integer ib = b;\n" +
+ " Integer ic = c; \n" +
+ " }\n" +
+ " void foo() {\n" +
+ " final short s = 0;\n" +
+ " final byte b = 0;\n" +
+ " final char c = 0;\n" +
+ " Integer is = s;\n" +
+ " Integer ib = b;\n" +
+ " Integer ic = c; \n" +
+ " }\n" +
+ " void foo2() {\n" +
+ " Integer is = (short)0;\n" +
+ " Integer ib = (byte)0;\n" +
+ " Integer ic = (char)0; \n" +
+ " }\n" +
+ " void foo3() {\n" +
+ " Short si = 0;\n" +
+ " Byte bi = 0;\n" +
+ " Character ci = 0;\n" +
+ " }\n" +
+ " void foo4() {\n" +
+ " Short si = (byte) 0;\n" +
+ " Byte bi = (short) 0;\n" +
+ " Character ci = (short) 0;\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Integer is = s;\n" +
- " ^\n" +
- "Type mismatch: cannot convert from short to Integer\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " Integer ib = b;\n" +
- " ^\n" +
- "Type mismatch: cannot convert from byte to Integer\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " Integer ic = c; \n" +
- " ^\n" +
- "Type mismatch: cannot convert from char to Integer\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 11)\n" +
- " Integer is = s;\n" +
- " ^\n" +
- "Type mismatch: cannot convert from short to Integer\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 12)\n" +
- " Integer ib = b;\n" +
- " ^\n" +
- "Type mismatch: cannot convert from byte to Integer\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 13)\n" +
- " Integer ic = c; \n" +
- " ^\n" +
- "Type mismatch: cannot convert from char to Integer\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 16)\n" +
- " Integer is = (short)0;\n" +
- " ^^^^^^^^\n" +
- "Type mismatch: cannot convert from short to Integer\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 17)\n" +
- " Integer ib = (byte)0;\n" +
- " ^^^^^^^\n" +
- "Type mismatch: cannot convert from byte to Integer\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 18)\n" +
- " Integer ic = (char)0; \n" +
- " ^^^^^^^\n" +
- "Type mismatch: cannot convert from char to Integer\n" +
- "----------\n" +
- "10. WARNING in X.java (at line 21)\n" +
- " Short si = 0;\n" +
- " ^\n" +
- "The expression of type int is boxed into Short\n" +
- "----------\n" +
- "11. WARNING in X.java (at line 22)\n" +
- " Byte bi = 0;\n" +
- " ^\n" +
- "The expression of type int is boxed into Byte\n" +
- "----------\n" +
- "12. WARNING in X.java (at line 23)\n" +
- " Character ci = 0;\n" +
- " ^\n" +
- "The expression of type int is boxed into Character\n" +
- "----------\n" +
- "13. WARNING in X.java (at line 26)\n" +
- " Short si = (byte) 0;\n" +
- " ^^^^^^^^\n" +
- "The expression of type byte is boxed into Short\n" +
- "----------\n" +
- "14. WARNING in X.java (at line 27)\n" +
- " Byte bi = (short) 0;\n" +
- " ^^^^^^^^^\n" +
- "The expression of type short is boxed into Byte\n" +
- "----------\n" +
- "15. WARNING in X.java (at line 28)\n" +
- " Character ci = (short) 0;\n" +
- " ^^^^^^^^^\n" +
- "The expression of type short is boxed into Character\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " Integer is = s;\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from short to Integer\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " Integer ib = b;\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from byte to Integer\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " Integer ic = c; \n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from char to Integer\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 11)\n" +
+ " Integer is = s;\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from short to Integer\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 12)\n" +
+ " Integer ib = b;\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from byte to Integer\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 13)\n" +
+ " Integer ic = c; \n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from char to Integer\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 16)\n" +
+ " Integer is = (short)0;\n" +
+ " ^^^^^^^^\n" +
+ "Type mismatch: cannot convert from short to Integer\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 17)\n" +
+ " Integer ib = (byte)0;\n" +
+ " ^^^^^^^\n" +
+ "Type mismatch: cannot convert from byte to Integer\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 18)\n" +
+ " Integer ic = (char)0; \n" +
+ " ^^^^^^^\n" +
+ "Type mismatch: cannot convert from char to Integer\n" +
+ "----------\n" +
+ "10. WARNING in X.java (at line 21)\n" +
+ " Short si = 0;\n" +
+ " ^\n" +
+ "The expression of type int is boxed into Short\n" +
+ "----------\n" +
+ "11. WARNING in X.java (at line 22)\n" +
+ " Byte bi = 0;\n" +
+ " ^\n" +
+ "The expression of type int is boxed into Byte\n" +
+ "----------\n" +
+ "12. WARNING in X.java (at line 23)\n" +
+ " Character ci = 0;\n" +
+ " ^\n" +
+ "The expression of type int is boxed into Character\n" +
+ "----------\n" +
+ "13. WARNING in X.java (at line 26)\n" +
+ " Short si = (byte) 0;\n" +
+ " ^^^^^^^^\n" +
+ "The expression of type byte is boxed into Short\n" +
+ "----------\n" +
+ "14. WARNING in X.java (at line 27)\n" +
+ " Byte bi = (short) 0;\n" +
+ " ^^^^^^^^^\n" +
+ "The expression of type short is boxed into Byte\n" +
+ "----------\n" +
+ "15. WARNING in X.java (at line 28)\n" +
+ " Character ci = (short) 0;\n" +
+ " ^^^^^^^^^\n" +
+ "The expression of type short is boxed into Character\n" +
"----------\n");
}
public void test167() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " String foo(Comparable<String> x) {\n" +
+ "public class X {\n" +
+ " String foo(Comparable<String> x) {\n" +
" System.out.println( \"one\" );" +
- " return null;\n" +
- " }\n" +
- " void foo(int x) {\n" +
- " System.out.println( \"two\" );\n" +
- " }\n" +
- " void bar() {\n" +
- " Integer i = 1;\n" +
- " String s = foo(i); \n" +
- " }\n" +
+ " return null;\n" +
+ " }\n" +
+ " void foo(int x) {\n" +
+ " System.out.println( \"two\" );\n" +
+ " }\n" +
+ " void bar() {\n" +
+ " Integer i = 1;\n" +
+ " String s = foo(i); \n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " Integer i = 1;\n" +
- " ^\n" +
- "The expression of type int is boxed into Integer\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " String s = foo(i); \n" +
- " ^^^^^^\n" +
- "Type mismatch: cannot convert from void to String\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 10)\n" +
- " String s = foo(i); \n" +
- " ^\n" +
- "The expression of type Integer is unboxed into int\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " Integer i = 1;\n" +
+ " ^\n" +
+ "The expression of type int is boxed into Integer\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " String s = foo(i); \n" +
+ " ^^^^^^\n" +
+ "Type mismatch: cannot convert from void to String\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 10)\n" +
+ " String s = foo(i); \n" +
+ " ^\n" +
+ "The expression of type Integer is unboxed into int\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=264843
@@ -5149,58 +5149,58 @@ public void test168() {
new String[] {
"X.java",
"@SuppressWarnings(\"deprecation\")\n" +
- "public class X {\n" +
- " <T extends Integer> T a() { return 35; }\n" +
- " <T extends Integer> T[] b() { return new int[]{35}; }\n" +
+ "public class X {\n" +
+ " <T extends Integer> T a() { return 35; }\n" +
+ " <T extends Integer> T[] b() { return new int[]{35}; }\n" +
" <T extends Integer> T c() { return new Integer(35); }\n" +
- " <T extends Integer> T[] d() { return new Integer[]{35}; }\n" +
+ " <T extends Integer> T[] d() { return new Integer[]{35}; }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " <T extends Integer> T a() { return 35; }\n" +
- " ^^^^^^^\n" +
- "The type parameter T should not be bounded by the final type Integer. Final types cannot be further extended\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " <T extends Integer> T a() { return 35; }\n" +
- " ^^\n" +
- "Type mismatch: cannot convert from int to T\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 4)\n" +
- " <T extends Integer> T[] b() { return new int[]{35}; }\n" +
- " ^^^^^^^\n" +
- "The type parameter T should not be bounded by the final type Integer. Final types cannot be further extended\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 4)\n" +
- " <T extends Integer> T[] b() { return new int[]{35}; }\n" +
- " ^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from int[] to T[]\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 5)\n" +
- " <T extends Integer> T c() { return new Integer(35); }\n" +
- " ^^^^^^^\n" +
- "The type parameter T should not be bounded by the final type Integer. Final types cannot be further extended\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 5)\n" +
- " <T extends Integer> T c() { return new Integer(35); }\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Integer to T\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 6)\n" +
- " <T extends Integer> T[] d() { return new Integer[]{35}; }\n" +
- " ^^^^^^^\n" +
- "The type parameter T should not be bounded by the final type Integer. Final types cannot be further extended\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 6)\n" +
- " <T extends Integer> T[] d() { return new Integer[]{35}; }\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Integer[] to T[]\n" +
- "----------\n" +
- "9. WARNING in X.java (at line 6)\n" +
- " <T extends Integer> T[] d() { return new Integer[]{35}; }\n" +
- " ^^\n" +
- "The expression of type int is boxed into Integer\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " <T extends Integer> T a() { return 35; }\n" +
+ " ^^^^^^^\n" +
+ "The type parameter T should not be bounded by the final type Integer. Final types cannot be further extended\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " <T extends Integer> T a() { return 35; }\n" +
+ " ^^\n" +
+ "Type mismatch: cannot convert from int to T\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 4)\n" +
+ " <T extends Integer> T[] b() { return new int[]{35}; }\n" +
+ " ^^^^^^^\n" +
+ "The type parameter T should not be bounded by the final type Integer. Final types cannot be further extended\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 4)\n" +
+ " <T extends Integer> T[] b() { return new int[]{35}; }\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from int[] to T[]\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 5)\n" +
+ " <T extends Integer> T c() { return new Integer(35); }\n" +
+ " ^^^^^^^\n" +
+ "The type parameter T should not be bounded by the final type Integer. Final types cannot be further extended\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 5)\n" +
+ " <T extends Integer> T c() { return new Integer(35); }\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Integer to T\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 6)\n" +
+ " <T extends Integer> T[] d() { return new Integer[]{35}; }\n" +
+ " ^^^^^^^\n" +
+ "The type parameter T should not be bounded by the final type Integer. Final types cannot be further extended\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 6)\n" +
+ " <T extends Integer> T[] d() { return new Integer[]{35}; }\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Integer[] to T[]\n" +
+ "----------\n" +
+ "9. WARNING in X.java (at line 6)\n" +
+ " <T extends Integer> T[] d() { return new Integer[]{35}; }\n" +
+ " ^^\n" +
+ "The expression of type int is boxed into Integer\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=264843
@@ -5208,9 +5208,9 @@ public void test169() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X<T extends Integer> {\n" +
- " T x = 12;\n" +
- " Byte y = 12;\n" +
+ "public class X<T extends Integer> {\n" +
+ " T x = 12;\n" +
+ " Byte y = 12;\n" +
" void x(T t) {\n" +
" t = 5;\n" +
" switch (t) {\n" +
@@ -5227,46 +5227,46 @@ public void test169() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 1)\n" +
- " public class X<T extends Integer> {\n" +
- " ^^^^^^^\n" +
- "The type parameter T should not be bounded by the final type Integer. Final types cannot be further extended\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " T x = 12;\n" +
- " ^^\n" +
- "Type mismatch: cannot convert from int to T\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 3)\n" +
- " Byte y = 12;\n" +
- " ^^\n" +
- "The expression of type int is boxed into Byte\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " t = 5;\n" +
- " ^\n" +
- "Type mismatch: cannot convert from int to T\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 6)\n" +
- " switch (t) {\n" +
- " ^\n" +
- "The expression of type T is unboxed into int\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 7)\n" +
- " case 1:\n" +
- " ^\n" +
- "Type mismatch: cannot convert from int to T\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 12)\n" +
- " t = 5;\n" +
- " ^\n" +
- "The expression of type int is boxed into Byte\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 13)\n" +
- " switch (t) {\n" +
- " ^\n" +
- "The expression of type Byte is unboxed into int\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 1)\n" +
+ " public class X<T extends Integer> {\n" +
+ " ^^^^^^^\n" +
+ "The type parameter T should not be bounded by the final type Integer. Final types cannot be further extended\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " T x = 12;\n" +
+ " ^^\n" +
+ "Type mismatch: cannot convert from int to T\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 3)\n" +
+ " Byte y = 12;\n" +
+ " ^^\n" +
+ "The expression of type int is boxed into Byte\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " t = 5;\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from int to T\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 6)\n" +
+ " switch (t) {\n" +
+ " ^\n" +
+ "The expression of type T is unboxed into int\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 7)\n" +
+ " case 1:\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from int to T\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 12)\n" +
+ " t = 5;\n" +
+ " ^\n" +
+ "The expression of type int is boxed into Byte\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 13)\n" +
+ " switch (t) {\n" +
+ " ^\n" +
+ "The expression of type Byte is unboxed into int\n" +
"----------\n");
}
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java
index 07359c9ab..2ea65d7e2 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java
@@ -27,7 +27,7 @@
* bug 388281 - [compiler][null] inheritance of null annotations as an option
* bug 381443 - [compiler][null] Allow parameter widening from @NonNull to unannotated
* bug 383368 - [compiler][null] syntactic null analysis for field references
- * Bug 392099 - [1.8][compiler][null] Apply null annotation on types for null analysis
+ * Bug 392099 - [1.8][compiler][null] Apply null annotation on types for null analysis
* Bug 440477 - [null] Infrastructure for feeding external annotations into compilation
* Bug 440687 - [compiler][batch][null] improve command line option for external annotations
* Bug 408815 - [batch][null] Add CLI option for COMPILER_PB_SYNTACTIC_NULL_ANALYSIS_FOR_FIELDS
@@ -286,12 +286,12 @@ public class BatchCompilerTest extends AbstractBatchCompilerTest {
*/
private static Normalizer textLogsNormalizer = new StringNormalizer(
new XMLClasspathsSectionNormalizer(new LinesRangeNormalizer(null,
-//{ObjectTeams: chop off one more line of version info:
-/*orig:
+//{ObjectTeams: chop off one more line of version info:
+/*orig:
0, 2)), OUTPUT_DIR, OUTPUT_DIR_PLACEHOLDER);
:giro*/
0, 3)), OUTPUT_DIR, OUTPUT_DIR_PLACEHOLDER);
-// SH}
+// SH}
/**
* Normalizer instance for XML log files.
@@ -513,22 +513,22 @@ public void test009(){
+ " -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal"
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 5)\n" +
- " Warn warn;\n" +
- " ^^^^\n" +
- "Discouraged access: The type \'Warn\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
- "----------\n" +
- "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 6)\n" +
- " KO ko;\n" +
- " ^^\n" +
- "Access restriction: The type \'KO\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
- "----------\n" +
- "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 7)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 5)\n" +
+ " Warn warn;\n" +
+ " ^^^^\n" +
+ "Discouraged access: The type \'Warn\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
+ "----------\n" +
+ "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 6)\n" +
+ " KO ko;\n" +
+ " ^^\n" +
+ "Access restriction: The type \'KO\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
+ "----------\n" +
+ "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 7)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
+ "----------\n" +
"3 problems (1 error, 2 warnings)\n",
true);
}
@@ -629,11 +629,11 @@ public void test012(){
" created); this option can be overridden per source\n" +
" directory\n" +
" -d none generate no .class files\n" +
- " -encoding <enc> specify default encoding for all source files. Each\n" +
- " file/directory can override it when suffixed with\n" +
- " ''[''<enc>'']'' (e.g. X.java[utf8]).\n" +
- " If multiple default encodings are specified, the last\n" +
- " one will be used.\n" +
+ " -encoding <enc> specify default encoding for all source files. Each\n" +
+ " file/directory can override it when suffixed with\n" +
+ " ''[''<enc>'']'' (e.g. X.java[utf8]).\n" +
+ " If multiple default encodings are specified, the last\n" +
+ " one will be used.\n" +
" \n" +
" Module compilation options:\n" +
" These options are meaningful only in Java 9 environment or later.\n" +
@@ -642,7 +642,7 @@ public void test012(){
" -p --module-path <directories separated by " + File.pathSeparator + ">\n" +
" specify where to find application modules\n" +
" --processor-module-path <directories separated by " + File.pathSeparator + ">\n" +
- " specify module path where annotation processors\n" +
+ " specify module path where annotation processors\n" +
" can be found\n" +
" --system <jdk> Override location of system modules\n" +
" --add-exports <module>/<package>=<other-module>(,<other-module>)*\n" +
@@ -685,28 +685,28 @@ public void test012(){
" be ignored\n" +
" -?:warn -help:warn display advanced warning options\n" +
" \n" +
- " Error options:\n" +
- " -err:<warnings separated by ,> convert exactly the listed warnings\n" +
- " to be reported as errors\n" +
- " -err:+<warnings separated by ,> enable additional warnings to be\n" +
- " reported as errors\n" +
- " -err:-<warnings separated by ,> disable specific warnings to be\n" +
- " reported as errors\n" +
- " \n" +
- " Info options:\n" +
- " -info:<warnings separated by ,> convert exactly the listed warnings\n" +
- " to be reported as infos\n" +
- " -info:+<warnings separated by ,> enable additional warnings to be\n" +
- " reported as infos\n" +
- " -info:-<warnings separated by ,> disable specific warnings to be\n" +
- " reported as infos\n" +
- " \n" +
- " Setting warning, error or info options using properties file:\n" +
- " -properties <file> set warnings/errors/info option based on the properties\n" +
- " file contents. This option can be used with -nowarn,\n" +
- " -err:.., -info: or -warn:.. options, but the last one\n" +
- " on the command line sets the options to be used.\n" +
- " \n" +
+ " Error options:\n" +
+ " -err:<warnings separated by ,> convert exactly the listed warnings\n" +
+ " to be reported as errors\n" +
+ " -err:+<warnings separated by ,> enable additional warnings to be\n" +
+ " reported as errors\n" +
+ " -err:-<warnings separated by ,> disable specific warnings to be\n" +
+ " reported as errors\n" +
+ " \n" +
+ " Info options:\n" +
+ " -info:<warnings separated by ,> convert exactly the listed warnings\n" +
+ " to be reported as infos\n" +
+ " -info:+<warnings separated by ,> enable additional warnings to be\n" +
+ " reported as infos\n" +
+ " -info:-<warnings separated by ,> disable specific warnings to be\n" +
+ " reported as infos\n" +
+ " \n" +
+ " Setting warning, error or info options using properties file:\n" +
+ " -properties <file> set warnings/errors/info option based on the properties\n" +
+ " file contents. This option can be used with -nowarn,\n" +
+ " -err:.., -info: or -warn:.. options, but the last one\n" +
+ " on the command line sets the options to be used.\n" +
+ " \n" +
" Debug options:\n" +
" -g[:lines,vars,source] custom debug info\n" +
" -g:lines,source + both lines table and source debug info\n" +
@@ -740,10 +740,10 @@ public void test012(){
" default)\n" +
" -log <file> log to a file. If the file extension is ''.xml'', then\n" +
" the log will be a xml file.\n" +
- " -proceedOnError[:Fatal]\n" +
- " do not stop at first error, dumping class files with\n" +
- " problem methods\n" +
- " With \":Fatal\", all optional errors are treated as fatal\n" +
+ " -proceedOnError[:Fatal]\n" +
+ " do not stop at first error, dumping class files with\n" +
+ " problem methods\n" +
+ " With \":Fatal\", all optional errors are treated as fatal\n" +
" -failOnWarning fail compilation if there are warnings\n" +
" -verbose enable verbose output\n" +
" -referenceInfo compute reference info\n" +
@@ -759,12 +759,12 @@ public void test012(){
" -Xemacs used to enable emacs-style output in the console.\n" +
" It does not affect the xml log output\n" +
" -missingNullDefault report missing default nullness annotation\n" +
- " -annotationpath <directories and ZIP archives separated by " + File.pathSeparator + ">\n" +
- " specify locations where to find external annotations\n" +
- " to support annotation-based null analysis.\n" +
- " The special name CLASSPATH will cause lookup of\n" +
- " external annotations from the classpath and sourcepath.\n" +
- " \n" +
+ " -annotationpath <directories and ZIP archives separated by " + File.pathSeparator + ">\n" +
+ " specify locations where to find external annotations\n" +
+ " to support annotation-based null analysis.\n" +
+ " The special name CLASSPATH will cause lookup of\n" +
+ " external annotations from the classpath and sourcepath.\n" +
+ " \n" +
" -? -help print this help message\n" +
" -v -version print compiler version\n" +
" -showversion print compiler version and continue\n" +
@@ -807,29 +807,29 @@ public void test012b(){
"{0} {1}\n" +
"{2}\n" +
" \n" +
- " Warning options:\n" +
- " -deprecation + deprecation outside deprecated code\n" +
- " -nowarn -warn:none disable all warnings and infos\n" +
+ " Warning options:\n" +
+ " -deprecation + deprecation outside deprecated code\n" +
+ " -nowarn -warn:none disable all warnings and infos\n" +
" -nowarn:[<directories separated by " + File.pathSeparator+ ">]\n" +
" specify directories from which optional problems should\n" +
" be ignored\n" +
- " -warn:<warnings separated by ,> enable exactly the listed warnings\n" +
- " -warn:+<warnings separated by ,> enable additional warnings\n" +
- " -warn:-<warnings separated by ,> disable specific warnings\n" +
+ " -warn:<warnings separated by ,> enable exactly the listed warnings\n" +
+ " -warn:+<warnings separated by ,> enable additional warnings\n" +
+ " -warn:-<warnings separated by ,> disable specific warnings\n" +
//{ObjectTeams: new options (marked individually as //OT: )
//OT (2x):
" abstractrelevantrole + abstract relevant role (OTJLD 2.5(b))\n" +
" adaptDeprecated + adapting a deprecated type/method\n" +
- " all enable all warnings\n" +
- " allDeadCode dead code including trivial if(DEBUG) check\n" +
- " allDeprecation deprecation including inside deprecated code\n" +
- " allJavadoc invalid or missing javadoc\n" +
- " allOver-ann all missing @Override annotations\n" +
- " all-static-method all method can be declared as static warnings\n" +
+ " all enable all warnings\n" +
+ " allDeadCode dead code including trivial if(DEBUG) check\n" +
+ " allDeprecation deprecation including inside deprecated code\n" +
+ " allJavadoc invalid or missing javadoc\n" +
+ " allOver-ann all missing @Override annotations\n" +
+ " all-static-method all method can be declared as static warnings\n" +
//OT (2x):
- " ambiguousbinding + ambiguous role-base bindings (OTJLD 2.3.4(a))\n" +
+ " ambiguousbinding + ambiguous role-base bindings (OTJLD 2.3.4(a))\n" +
" ambiguouslowering + ambiguous lowering or upcast (OTJLD 2.2(f))\n" +
- " assertIdentifier + ''assert'' used as identifier\n" +
+ " assertIdentifier + ''assert'' used as identifier\n" +
//OT (4x):
" basecall + base call not issued exactly once on each path\n" +
" (OTJLD 4.3(b,c))\n" +
@@ -839,151 +839,151 @@ public void test012b(){
" (OTJLD 2.1.2(d))\n" +
" bindingtosystemclass + trying to bind a role to a system class\n" +
//:TO
- " boxing autoboxing conversion\n" +
- " charConcat + char[] in String concat\n" +
- " compareIdentical + comparing identical expressions\n" +
- " conditionAssign possible accidental boolean assignment\n" +
- " constructorName + method with constructor name\n" +
+ " boxing autoboxing conversion\n" +
+ " charConcat + char[] in String concat\n" +
+ " compareIdentical + comparing identical expressions\n" +
+ " conditionAssign possible accidental boolean assignment\n" +
+ " constructorName + method with constructor name\n" +
//OT:
" dangerouscallin + dangerous callin binding (hashCode or equals)\n" +
- " deadCode + dead code excluding trivial if (DEBUG) check\n" +
+ " deadCode + dead code excluding trivial if (DEBUG) check\n" +
//OT:
" decapsulation + overriding access restrictions of a base class\n" +
" (OTJLD 3.4)\n" +
- " dep-ann missing @Deprecated annotation\n" +
- " deprecation + deprecation outside deprecated code\n" +
- " discouraged + use of types matching a discouraged access rule\n" +
- " emptyBlock undocumented empty block\n" +
- " enumIdentifier ''enum'' used as identifier\n" +
- " enumSwitch incomplete enum switch\n" +
- " enumSwitchPedantic + report missing enum switch cases even\n" +
- " in the presence of a default case\n" +
+ " dep-ann missing @Deprecated annotation\n" +
+ " deprecation + deprecation outside deprecated code\n" +
+ " discouraged + use of types matching a discouraged access rule\n" +
+ " emptyBlock undocumented empty block\n" +
+ " enumIdentifier ''enum'' used as identifier\n" +
+ " enumSwitch incomplete enum switch\n" +
+ " enumSwitchPedantic + report missing enum switch cases even\n" +
+ " in the presence of a default case\n" +
//OT:
" exceptioninguard + guard predicate throwing checked exception\n" +
- " fallthrough possible fall-through case\n" +
- " fieldHiding field hiding another variable\n" +
- " finalBound type parameter with final bound\n" +
- " finally + finally block not completing normally\n" +
- " forbidden + use of types matching a forbidden access rule\n" +
+ " fallthrough possible fall-through case\n" +
+ " fieldHiding field hiding another variable\n" +
+ " finalBound type parameter with final bound\n" +
+ " finally + finally block not completing normally\n" +
+ " forbidden + use of types matching a forbidden access rule\n" +
//OT:
" fragilecallin + replace callin not providing expected result\n" +
- " (OTJLD 4.3(e))\n" +
- " hashCode missing hashCode() method when overriding equals()\n" +
+ " (OTJLD 4.3(e))\n" +
+ " hashCode missing hashCode() method when overriding equals()\n" +
//OT:
- " hiddenLiftingProblem + a lifting that is not directly visible in source\n" +
+ " hiddenLiftingProblem + a lifting that is not directly visible in source\n" +
" code could fail at runtime (OTJLD 2.3.5)\n" +
- " hiding macro for fieldHiding, localHiding, typeHiding and\n" +
- " maskedCatchBlock\n" +
- " includeAssertNull raise null warnings for variables\n" +
- " that got tainted in an assert expression\n" +
+ " hiding macro for fieldHiding, localHiding, typeHiding and\n" +
+ " maskedCatchBlock\n" +
+ " includeAssertNull raise null warnings for variables\n" +
+ " that got tainted in an assert expression\n" +
" indirectStatic indirect reference to static member\n" +
//OT:
" inferredcallout + a callout binding has to be inferred (OTJLD 3.1(j))\n" +
- " inheritNullAnnot inherit null annotations\n" +
- " intfAnnotation + annotation type used as super interface\n" +
- " intfNonInherited + interface non-inherited method compatibility\n" +
- " intfRedundant find redundant superinterfaces\n" +
- " invalidJavadoc all warnings for malformed javadoc tags\n" +
- " invalidJavadocTag validate javadoc tag arguments\n" +
- " invalidJavadocTagDep validate deprecated references in javadoc tag args\n" +
- " invalidJavadocTagNotVisible validate non-visible references in javadoc\n" +
- " tag args\n" +
- " invalidJavadocVisibility(<visibility>) specify visibility modifier\n" +
- " for malformed javadoc tag warnings\n" +
- " javadoc invalid javadoc\n" +
- " localHiding local variable hiding another variable\n" +
- " maskedCatchBlock + hidden catch block\n" +
- " missingJavadocTags missing Javadoc tags\n" +
- " missingJavadocTagsOverriding missing Javadoc tags in overriding methods\n" +
- " missingJavadocTagsMethod missing Javadoc tags for method type parameter\n" +
- " missingJavadocTagsVisibility(<visibility>) specify visibility modifier\n" +
- " for missing javadoc tags warnings\n" +
- " missingJavadocComments missing Javadoc comments\n" +
- " missingJavadocCommentsOverriding missing Javadoc tags in overriding\n" +
- " methods\n" +
- " missingJavadocCommentsVisibility(<visibility>) specify visibility\n" +
- " modifier for missing javadoc comments warnings\n" +
- " module + module related problems.\n" +
- " nls string literal lacking non-nls tag //$NON-NLS-<n>$\n" +
- " noEffectAssign + assignment without effect\n" +
- " null potential missing or redundant null check\n" +
- " nullAnnot(<annot. names separated by |>) annotation based null analysis,\n" +
- " nullable|nonnull|nonnullbydefault annotation types\n" +
- " optionally specified using fully qualified names.\n" +
- " Enabling this option enables all null-annotation\n" +
- " related sub-options. These can be individually\n" +
- " controlled using options listed below.\n" +
- " nullAnnotConflict conflict between null annotation specified\n" +
- " and nullness inferred. Is effective only with\n" +
- " nullAnnot option enabled.\n" +
- " nullAnnotRedundant redundant specification of null annotation. Is\n" +
- " effective only with nullAnnot option enabled.\n" +
- " nullDereference + missing null check\n" +
- " nullUncheckedConversion unchecked conversion from non-annotated type\n" +
- " to @NonNull type. Is effective only with\n" +
- " nullAnnot option enabled.\n" +
- " over-ann missing @Override annotation (superclass)\n" +
- " paramAssign assignment to a parameter\n" +
- " pkgDefaultMethod + attempt to override package-default method\n" +
- " raw + usage of raw type\n" +
- " removal + deprecation marked for removal\n" +
- " resource + (pot.) unsafe usage of resource of type Closeable\n" +
+ " inheritNullAnnot inherit null annotations\n" +
+ " intfAnnotation + annotation type used as super interface\n" +
+ " intfNonInherited + interface non-inherited method compatibility\n" +
+ " intfRedundant find redundant superinterfaces\n" +
+ " invalidJavadoc all warnings for malformed javadoc tags\n" +
+ " invalidJavadocTag validate javadoc tag arguments\n" +
+ " invalidJavadocTagDep validate deprecated references in javadoc tag args\n" +
+ " invalidJavadocTagNotVisible validate non-visible references in javadoc\n" +
+ " tag args\n" +
+ " invalidJavadocVisibility(<visibility>) specify visibility modifier\n" +
+ " for malformed javadoc tag warnings\n" +
+ " javadoc invalid javadoc\n" +
+ " localHiding local variable hiding another variable\n" +
+ " maskedCatchBlock + hidden catch block\n" +
+ " missingJavadocTags missing Javadoc tags\n" +
+ " missingJavadocTagsOverriding missing Javadoc tags in overriding methods\n" +
+ " missingJavadocTagsMethod missing Javadoc tags for method type parameter\n" +
+ " missingJavadocTagsVisibility(<visibility>) specify visibility modifier\n" +
+ " for missing javadoc tags warnings\n" +
+ " missingJavadocComments missing Javadoc comments\n" +
+ " missingJavadocCommentsOverriding missing Javadoc tags in overriding\n" +
+ " methods\n" +
+ " missingJavadocCommentsVisibility(<visibility>) specify visibility\n" +
+ " modifier for missing javadoc comments warnings\n" +
+ " module + module related problems.\n" +
+ " nls string literal lacking non-nls tag //$NON-NLS-<n>$\n" +
+ " noEffectAssign + assignment without effect\n" +
+ " null potential missing or redundant null check\n" +
+ " nullAnnot(<annot. names separated by |>) annotation based null analysis,\n" +
+ " nullable|nonnull|nonnullbydefault annotation types\n" +
+ " optionally specified using fully qualified names.\n" +
+ " Enabling this option enables all null-annotation\n" +
+ " related sub-options. These can be individually\n" +
+ " controlled using options listed below.\n" +
+ " nullAnnotConflict conflict between null annotation specified\n" +
+ " and nullness inferred. Is effective only with\n" +
+ " nullAnnot option enabled.\n" +
+ " nullAnnotRedundant redundant specification of null annotation. Is\n" +
+ " effective only with nullAnnot option enabled.\n" +
+ " nullDereference + missing null check\n" +
+ " nullUncheckedConversion unchecked conversion from non-annotated type\n" +
+ " to @NonNull type. Is effective only with\n" +
+ " nullAnnot option enabled.\n" +
+ " over-ann missing @Override annotation (superclass)\n" +
+ " paramAssign assignment to a parameter\n" +
+ " pkgDefaultMethod + attempt to override package-default method\n" +
+ " raw + usage of raw type\n" +
+ " removal + deprecation marked for removal\n" +
+ " resource + (pot.) unsafe usage of resource of type Closeable\n" +
//OT (2x):
" roleinstantiation + unsafe instantiation of a role\n" +
- " (OTJLD 2.4.1(c), 2.4.3)\n" +
+ " (OTJLD 2.4.1(c), 2.4.3)\n" +
" roletypesyntax + old style syntax for role types (dependent types)\n" +
" (OTJLD 1.2.2(b))\n" +
- " semicolon unnecessary semicolon, empty statement\n" +
- " serial + missing serialVersionUID\n" +
- " specialParamHiding constructor or setter parameter hiding a field\n" +
- " static-method method can be declared as static\n" +
- " static-access macro for indirectStatic and staticReceiver\n" +
- " staticReceiver + non-static reference to static member\n" +
- " super overriding a method without making a super invocation\n" +
- " suppress + enable @SuppressWarnings\n" +
- " When used with -err:, it can also silence optional\n" +
- " errors and warnings\n" +
+ " semicolon unnecessary semicolon, empty statement\n" +
+ " serial + missing serialVersionUID\n" +
+ " specialParamHiding constructor or setter parameter hiding a field\n" +
+ " static-method method can be declared as static\n" +
+ " static-access macro for indirectStatic and staticReceiver\n" +
+ " staticReceiver + non-static reference to static member\n" +
+ " super overriding a method without making a super invocation\n" +
+ " suppress + enable @SuppressWarnings\n" +
+ " When used with -err:, it can also silence optional\n" +
+ " errors and warnings\n" +
" switchDefault switch statement lacking a default case\n" +
- " syncOverride missing synchronized in synchr. method override\n" +
- " syntacticAnalysis perform syntax-based null analysis for fields\n" +
- " syntheticAccess synthetic access for innerclass\n" +
- " tasks(<tags separated by |>) tasks identified by tags inside comments\n" +
- " typeHiding + type parameter hiding another type\n" +
- " unavoidableGenericProblems + ignore unavoidable type safety problems\n" +
- " due to raw APIs\n" +
- " unchecked + unchecked type operation\n" +
+ " syncOverride missing synchronized in synchr. method override\n" +
+ " syntacticAnalysis perform syntax-based null analysis for fields\n" +
+ " syntheticAccess synthetic access for innerclass\n" +
+ " tasks(<tags separated by |>) tasks identified by tags inside comments\n" +
+ " typeHiding + type parameter hiding another type\n" +
+ " unavoidableGenericProblems + ignore unavoidable type safety problems\n" +
+ " due to raw APIs\n" +
+ " unchecked + unchecked type operation\n" +
" unlikelyCollectionMethodArgumentType\n" +
- " + unlikely argument type for collection method\n" +
- " declaring an Object parameter\n" +
- " unlikelyEqualsArgumentType unlikely argument type for method equals()\n" +
- " unnecessaryElse unnecessary else clause\n" +
- " unqualifiedField unqualified reference to field\n" +
- " unused macro for unusedAllocation, unusedArgument,\n" +
- " unusedImport, unusedLabel, unusedLocal,\n" +
- " unusedPrivate, unusedThrown, and unusedTypeArgs,\n" +
+ " + unlikely argument type for collection method\n" +
+ " declaring an Object parameter\n" +
+ " unlikelyEqualsArgumentType unlikely argument type for method equals()\n" +
+ " unnecessaryElse unnecessary else clause\n" +
+ " unqualifiedField unqualified reference to field\n" +
+ " unused macro for unusedAllocation, unusedArgument,\n" +
+ " unusedImport, unusedLabel, unusedLocal,\n" +
+ " unusedPrivate, unusedThrown, and unusedTypeArgs,\n" +
" unusedExceptionParam\n"+
- " unusedAllocation allocating an object that is not used\n" +
+ " unusedAllocation allocating an object that is not used\n" +
" unusedArgument unread method parameter\n" +
- " unusedExceptionParam unread exception parameter\n" +
- " unusedImport + unused import declaration\n" +
- " unusedLabel + unused label\n" +
- " unusedLocal + unread local variable\n" +
- " unusedParam unused parameter\n" +
- " unusedParamOverriding unused parameter for overriding method\n" +
- " unusedParamImplementing unused parameter for implementing method\n" +
- " unusedParamIncludeDoc unused parameter documented in comment tag\n" +
- " unusedPrivate + unused private member declaration\n" +
- " unusedThrown unused declared thrown exception\n" +
- " unusedThrownWhenOverriding unused declared thrown exception in \n" +
- " overriding method\n" +
- " unusedThrownIncludeDocComment unused declared thrown exception,\n" +
- " documented in a comment tag\n" +
- " unusedThrownExemptExceptionThrowable unused declared thrown exception,\n" +
- " exempt Exception and Throwable\n" +
- " unusedTypeArgs + unused type arguments for method and constructor\n" +
- " uselessTypeCheck unnecessary cast/instanceof operation\n" +
- " varargsCast + varargs argument need explicit cast\n" +
- " warningToken + unsupported or unnecessary @SuppressWarnings\n" +
+ " unusedExceptionParam unread exception parameter\n" +
+ " unusedImport + unused import declaration\n" +
+ " unusedLabel + unused label\n" +
+ " unusedLocal + unread local variable\n" +
+ " unusedParam unused parameter\n" +
+ " unusedParamOverriding unused parameter for overriding method\n" +
+ " unusedParamImplementing unused parameter for implementing method\n" +
+ " unusedParamIncludeDoc unused parameter documented in comment tag\n" +
+ " unusedPrivate + unused private member declaration\n" +
+ " unusedThrown unused declared thrown exception\n" +
+ " unusedThrownWhenOverriding unused declared thrown exception in \n" +
+ " overriding method\n" +
+ " unusedThrownIncludeDocComment unused declared thrown exception,\n" +
+ " documented in a comment tag\n" +
+ " unusedThrownExemptExceptionThrowable unused declared thrown exception,\n" +
+ " exempt Exception and Throwable\n" +
+ " unusedTypeArgs + unused type arguments for method and constructor\n" +
+ " uselessTypeCheck unnecessary cast/instanceof operation\n" +
+ " varargsCast + varargs argument need explicit cast\n" +
+ " warningToken + unsupported or unnecessary @SuppressWarnings\n" +
// SH}
"\n";
String expandedExpectedOutput =
@@ -1031,210 +1031,210 @@ public void test012b(){
true);
String logContents = Util.fileContent(logFileName);
String expectedLogContents =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<!DOCTYPE compiler PUBLIC \"-//Eclipse.org//DTD Eclipse JDT 3.2.006 Compiler//EN\" \"http://www.eclipse.org/jdt/core/compiler_32_006.dtd\">\n" +
- "<compiler copyright=\"{2}\" name=\"{1}\" version=\"{3}\">\n" +
- " <command_line>\n" +
- " <argument value=\"---OUTPUT_DIR_PLACEHOLDER---{0}X.java\"/>\n" +
- " <argument value=\"-1.5\"/>\n" +
- " <argument value=\"-proceedOnError\"/>\n" +
- " <argument value=\"-log\"/>\n" +
- " <argument value=\"---OUTPUT_DIR_PLACEHOLDER---{0}log.xml\"/>\n" +
- " <argument value=\"-d\"/>\n" +
- " <argument value=\"---OUTPUT_DIR_PLACEHOLDER---\"/>\n" +
- " </command_line>\n" +
- " <options>\n" +
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
+ "<!DOCTYPE compiler PUBLIC \"-//Eclipse.org//DTD Eclipse JDT 3.2.006 Compiler//EN\" \"http://www.eclipse.org/jdt/core/compiler_32_006.dtd\">\n" +
+ "<compiler copyright=\"{2}\" name=\"{1}\" version=\"{3}\">\n" +
+ " <command_line>\n" +
+ " <argument value=\"---OUTPUT_DIR_PLACEHOLDER---{0}X.java\"/>\n" +
+ " <argument value=\"-1.5\"/>\n" +
+ " <argument value=\"-proceedOnError\"/>\n" +
+ " <argument value=\"-log\"/>\n" +
+ " <argument value=\"---OUTPUT_DIR_PLACEHOLDER---{0}log.xml\"/>\n" +
+ " <argument value=\"-d\"/>\n" +
+ " <argument value=\"---OUTPUT_DIR_PLACEHOLDER---\"/>\n" +
+ " </command_line>\n" +
+ " <options>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.annotation.nonnull\" value=\"org.eclipse.jdt.annotation.NonNull\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.annotation.nonnull\" value=\"org.eclipse.jdt.annotation.NonNull\"/>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.annotation.nonnull.secondary\" value=\"\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.annotation.nonnullbydefault\" value=\"org.eclipse.jdt.annotation.NonNullByDefault\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.annotation.nonnullbydefault\" value=\"org.eclipse.jdt.annotation.NonNullByDefault\"/>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary\" value=\"\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.annotation.nullable\" value=\"org.eclipse.jdt.annotation.Nullable\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.annotation.nullable\" value=\"org.eclipse.jdt.annotation.Nullable\"/>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.annotation.nullable.secondary\" value=\"\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.annotation.nullanalysis\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode\" value=\"disabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.annotation.nullanalysis\" value=\"disabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode\" value=\"disabled\"/>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.codegen.lambda.genericSignature\" value=\"do not generate\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.codegen.methodParameters\" value=\"do not generate\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.codegen.methodParameters\" value=\"do not generate\"/>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.codegen.shareCommonFinallyBlocks\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.codegen.targetPlatform\" value=\"1.5\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.codegen.unusedLocal\" value=\"optimize out\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.compliance\" value=\"1.5\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.debug.lineNumber\" value=\"generate\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.debug.localVariable\" value=\"do not generate\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.debug.sourceFile\" value=\"generate\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.doc.comment.support\" value=\"disabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.codegen.targetPlatform\" value=\"1.5\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.codegen.unusedLocal\" value=\"optimize out\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.compliance\" value=\"1.5\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.debug.lineNumber\" value=\"generate\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.debug.localVariable\" value=\"do not generate\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.debug.sourceFile\" value=\"generate\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.doc.comment.support\" value=\"disabled\"/>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.emulateJavacBug8031744\" value=\"enabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.generateClassFiles\" value=\"enabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.generateClassFiles\" value=\"enabled\"/>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.maxProblemPerUnit\" value=\"100\"/>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.problem.APILeak\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated\" value=\"info\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.annotationSuperInterface\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.assertIdentifier\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.autoboxing\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.comparingIdentical\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.deadCode\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.deadCodeInTrivialIfStatement\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.deprecation\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.discouragedReference\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.emptyStatement\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated\" value=\"info\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.annotationSuperInterface\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.assertIdentifier\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.autoboxing\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.comparingIdentical\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.deadCode\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.deadCodeInTrivialIfStatement\" value=\"disabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.deprecation\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode\" value=\"disabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod\" value=\"disabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.discouragedReference\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.emptyStatement\" value=\"ignore\"/>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.enumIdentifier\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.fallthroughCase\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.fatalOptionalError\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.fieldHiding\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.finalParameterBound\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.forbiddenReference\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.indirectStaticAccess\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadoc\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTags\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility\" value=\"public\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.localVariableHiding\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.methodWithConstructorName\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.enumIdentifier\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.fallthroughCase\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.fatalOptionalError\" value=\"disabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.fieldHiding\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.finalParameterBound\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.forbiddenReference\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts\" value=\"disabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.indirectStaticAccess\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadoc\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTags\" value=\"disabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef\" value=\"disabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef\" value=\"disabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility\" value=\"public\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.localVariableHiding\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.methodWithConstructorName\" value=\"warning\"/>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.problem.missingDefaultCase\" value=\"ignore\"/>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation\" value=\"ignore\"/>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocComments\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility\" value=\"public\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription\" value=\"return_tag\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTags\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility\" value=\"public\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation\" value=\"enabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.missingSerialVersion\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.noEffectAssignment\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocComments\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding\" value=\"disabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility\" value=\"public\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription\" value=\"return_tag\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTags\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters\" value=\"disabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding\" value=\"disabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility\" value=\"public\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation\" value=\"enabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.missingSerialVersion\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.noEffectAssignment\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion\" value=\"warning\"/>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral\" value=\"ignore\"/>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped\" value=\"warning\"/>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict\" value=\"error\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.nullReference\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.nullSpecViolation\" value=\"error\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.overridingMethodWithoutSuperInvocation\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.parameterAssignment\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict\" value=\"error\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.nullReference\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.nullSpecViolation\" value=\"error\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.overridingMethodWithoutSuperInvocation\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.parameterAssignment\" value=\"ignore\"/>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.potentialNullReference\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.rawTypeReference\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.redundantNullCheck\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.redundantSuperinterface\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.specialParameterHidingField\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.staticAccessReceiver\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.suppressWarnings\" value=\"enabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed\" value=\"info\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.potentialNullReference\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.rawTypeReference\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.redundantNullCheck\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.redundantSuperinterface\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.specialParameterHidingField\" value=\"disabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.staticAccessReceiver\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors\" value=\"disabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.suppressWarnings\" value=\"enabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed\" value=\"info\"/>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.tasks\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.tasks\" value=\"warning\"/>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.problem.terminalDeprecation\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.typeParameterHiding\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems\" value=\"enabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unclosedCloseable\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unhandledWarningToken\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.typeParameterHiding\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems\" value=\"enabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unclosedCloseable\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unhandledWarningToken\" value=\"warning\"/>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.problem.uninternedIdentityComparison\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType\" value=\"info\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unnecessaryElse\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable\" value=\"enabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference\" value=\"enabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding\" value=\"disabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict\" value=\"disabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType\" value=\"info\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unnecessaryElse\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable\" value=\"enabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference\" value=\"enabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding\" value=\"disabled\"/>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedImport\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedLabel\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedLocal\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameter\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference\" value=\"enabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedPrivateMember\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedImport\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedLabel\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedLocal\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameter\" value=\"ignore\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference\" value=\"enabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract\" value=\"disabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete\" value=\"disabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedPrivateMember\" value=\"warning\"/>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.problem.unusedTypeArgumentsForMethodInvocation\" value=\"warning\"/>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.problem.unusedTypeParameter\" value=\"ignore\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedWarningToken\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.processAnnotations\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.release\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.source\" value=\"1.5\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedWarningToken\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.processAnnotations\" value=\"disabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.release\" value=\"disabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.source\" value=\"1.5\"/>\n" +
" <option key=\"org.eclipse.jdt.core.compiler.storeAnnotations\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.taskCaseSensitive\" value=\"enabled\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.taskPriorities\" value=\"\"/>\n" +
- " <option key=\"org.eclipse.jdt.core.compiler.taskTags\" value=\"\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.taskCaseSensitive\" value=\"enabled\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.taskPriorities\" value=\"\"/>\n" +
+ " <option key=\"org.eclipse.jdt.core.compiler.taskTags\" value=\"\"/>\n" +
//{ObjectTeams: new options
" <option key=\"org.eclipse.objectteams.otdt.compiler.option.pure_java\" value=\"disabled\"/>\n" +
- " <option key=\"org.eclipse.objectteams.otdt.compiler.option.scoped_keywords\" value=\"enabled\"/>\n" +
+ " <option key=\"org.eclipse.objectteams.otdt.compiler.option.scoped_keywords\" value=\"enabled\"/>\n" +
" <option key=\"org.eclipse.objectteams.otdt.compiler.option.weaving_scheme\" value=\"OTRE\"/>\n" +
- " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.abstract_potential_relevant_role\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.adapting_deprecated\" value=\"error\"/>\n" +
- " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.ambiguous_lowering\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.basecall\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.baseclass_cycle\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.binding_conventions\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.abstract_potential_relevant_role\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.adapting_deprecated\" value=\"error\"/>\n" +
+ " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.ambiguous_lowering\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.basecall\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.baseclass_cycle\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.binding_conventions\" value=\"warning\"/>\n" +
" <option key=\"org.eclipse.objectteams.otdt.compiler.problem.decapsulation\" value=\"warning\"/>\n" +
" <option key=\"org.eclipse.objectteams.otdt.compiler.problem.decapsulation_write\" value=\"warning\"/>\n" +
" <option key=\"org.eclipse.objectteams.otdt.compiler.problem.deprecated_path_syntax\" value=\"warning\"/>\n" +
" <option key=\"org.eclipse.objectteams.otdt.compiler.problem.effectless_fieldaccess\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.exception_in_guard\" value=\"error\"/>\n" +
- " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.fragile_callin\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.hidden_lifting_problem\" value=\"error\"/>\n" +
+ " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.exception_in_guard\" value=\"error\"/>\n" +
+ " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.fragile_callin\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.hidden_lifting_problem\" value=\"error\"/>\n" +
" <option key=\"org.eclipse.objectteams.otdt.compiler.problem.ignoring_role_return\" value=\"warning\"/>\n" +
" <option key=\"org.eclipse.objectteams.otdt.compiler.problem.inferred_callout\" value=\"error\"/>\n" +
- " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.otre_into_java8\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.otre_into_java8\" value=\"warning\"/>\n" +
" <option key=\"org.eclipse.objectteams.otdt.compiler.problem.override_final_role\" value=\"error\"/>\n" +
- " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.potential_ambiguous_playedby\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.potential_ambiguous_playedby\" value=\"warning\"/>\n" +
" <option key=\"org.eclipse.objectteams.otdt.compiler.problem.unsafe_role_instantiation\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.unused_parammap\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.weave_into_system_class\" value=\"warning\"/>\n" +
- " <option key=\"org.eclipse.objectteams.otdt.core.compiler.problem.decapsulation\" value=\"report binding\"/>\n" +
+ " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.unused_parammap\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.objectteams.otdt.compiler.problem.weave_into_system_class\" value=\"warning\"/>\n" +
+ " <option key=\"org.eclipse.objectteams.otdt.core.compiler.problem.decapsulation\" value=\"report binding\"/>\n" +
// SH}
- " </options>\n" +
- " <classpaths>NORMALIZED SECTION</classpaths>\n" +
- " <sources>\n" +
- " <source output=\"---OUTPUT_DIR_PLACEHOLDER---\" path=\"---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\">\n" +
- " <problems errors=\"1\" infos=\"0\" problems=\"1\" warnings=\"0\">\n" +
- " <problem categoryID=\"40\" charEnd=\"28\" charStart=\"25\" id=\"UndefinedType\" line=\"3\" problemID=\"16777218\" severity=\"ERROR\">\n" +
- " <message value=\"Zork cannot be resolved to a type\"/>\n" +
- " <source_context sourceEnd=\"3\" sourceStart=\"0\" value=\"Zork z;\"/>\n" +
- " <arguments>\n" +
- " <argument value=\"Zork\"/>\n" +
- " </arguments>\n" +
- " </problem>\n" +
- " </problems>\n" +
- " <classfile path=\"---OUTPUT_DIR_PLACEHOLDER---{0}X.class\"/>\n" +
- " </source>\n" +
- " </sources>\n" +
- " <stats>\n" +
- " <problem_summary errors=\"1\" infos=\"0\" problems=\"1\" tasks=\"0\" warnings=\"0\"/>\n" +
- " </stats>\n" +
+ " </options>\n" +
+ " <classpaths>NORMALIZED SECTION</classpaths>\n" +
+ " <sources>\n" +
+ " <source output=\"---OUTPUT_DIR_PLACEHOLDER---\" path=\"---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\">\n" +
+ " <problems errors=\"1\" infos=\"0\" problems=\"1\" warnings=\"0\">\n" +
+ " <problem categoryID=\"40\" charEnd=\"28\" charStart=\"25\" id=\"UndefinedType\" line=\"3\" problemID=\"16777218\" severity=\"ERROR\">\n" +
+ " <message value=\"Zork cannot be resolved to a type\"/>\n" +
+ " <source_context sourceEnd=\"3\" sourceStart=\"0\" value=\"Zork z;\"/>\n" +
+ " <arguments>\n" +
+ " <argument value=\"Zork\"/>\n" +
+ " </arguments>\n" +
+ " </problem>\n" +
+ " </problems>\n" +
+ " <classfile path=\"---OUTPUT_DIR_PLACEHOLDER---{0}X.class\"/>\n" +
+ " </source>\n" +
+ " </sources>\n" +
+ " <stats>\n" +
+ " <problem_summary errors=\"1\" infos=\"0\" problems=\"1\" tasks=\"0\" warnings=\"0\"/>\n" +
+ " </stats>\n" +
"</compiler>\n";
String normalizedExpectedLogContents =
MessageFormat.format(
@@ -1621,21 +1621,21 @@ public void test019(){
+ " -d \"" + OUTPUT_DIR + "\"",
"",
"----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 5)\n" +
- " Warn warn;\n" +
- " ^^^^\n" +
- "Discouraged access: The type \'Warn\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
- "----------\n" +
- "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 6)\n" +
- " KO ko;\n" +
- " ^^\n" +
- "Access restriction: The type \'KO\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
- "----------\n" +
- "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 7)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 5)\n" +
+ " Warn warn;\n" +
+ " ^^^^\n" +
+ "Discouraged access: The type \'Warn\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
+ "----------\n" +
+ "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 6)\n" +
+ " KO ko;\n" +
+ " ^^\n" +
+ "Access restriction: The type \'KO\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
+ "----------\n" +
+ "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 7)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
+ "----------\n" +
"3 problems (1 error, 2 warnings)\n",
true);
}
@@ -1922,22 +1922,22 @@ public void test027(){
// generated, once able to avoid console echoing
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 5)\n" +
- " Warn warn;\n" +
- " ^^^^\n" +
- "Discouraged access: The type \'Warn\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---/p1\')\n" +
- "----------\n" +
- "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 6)\n" +
- " KO ko;\n" +
- " ^^\n" +
- "Access restriction: The type \'KO\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
- "----------\n" +
- "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 7)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 5)\n" +
+ " Warn warn;\n" +
+ " ^^^^\n" +
+ "Discouraged access: The type \'Warn\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---/p1\')\n" +
+ "----------\n" +
+ "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 6)\n" +
+ " KO ko;\n" +
+ " ^^\n" +
+ "Access restriction: The type \'KO\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
+ "----------\n" +
+ "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 7)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
+ "----------\n" +
"3 problems (1 error, 2 warnings)\n",
true);
}
@@ -2509,12 +2509,12 @@ public void test036(){
+ " -proceedOnError -referenceInfo"
+ " -d \"" + OUTPUT_DIR + File.separator + "bin2/\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 2)\n" +
- " public class Y extends p.X {\n" +
- " ^^^\n" +
- "Discouraged access: The type \'X\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---/bin1\')\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 2)\n" +
+ " public class Y extends p.X {\n" +
+ " ^^^\n" +
+ "Discouraged access: The type \'X\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---/bin1\')\n" +
+ "----------\n" +
"1 problem (1 warning)\n",
false);
}
@@ -2587,32 +2587,32 @@ public void test039(){
+ " -proceedOnError -referenceInfo"
+ " -d \"" + OUTPUT_DIR + File.separator + "bin2/\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 3)\n" +
- " X x1;\n" +
- " ^\n" +
- "Discouraged access: The type \'X<T>\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---/bin1\')\n" +
- "----------\n" +
- "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 3)\n" +
- " X x1;\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 4)\n" +
- " X<String> x2 = new X<String>();\n" +
- " ^\n" +
- "Discouraged access: The type \'X<String>\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---/bin1\')\n" +
- "----------\n" +
- "4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 4)\n" +
- " X<String> x2 = new X<String>();\n" +
- " ^\n" +
- "Discouraged access: The type \'X<String>\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---/bin1\')\n" +
- "----------\n" +
- "5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 4)\n" +
- " X<String> x2 = new X<String>();\n" +
- " ^\n" +
- "Discouraged access: The constructor \'X<String>()\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---/bin1\')\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 3)\n" +
+ " X x1;\n" +
+ " ^\n" +
+ "Discouraged access: The type \'X<T>\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---/bin1\')\n" +
+ "----------\n" +
+ "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 3)\n" +
+ " X x1;\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 4)\n" +
+ " X<String> x2 = new X<String>();\n" +
+ " ^\n" +
+ "Discouraged access: The type \'X<String>\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---/bin1\')\n" +
+ "----------\n" +
+ "4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 4)\n" +
+ " X<String> x2 = new X<String>();\n" +
+ " ^\n" +
+ "Discouraged access: The type \'X<String>\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---/bin1\')\n" +
+ "----------\n" +
+ "5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 4)\n" +
+ " X<String> x2 = new X<String>();\n" +
+ " ^\n" +
+ "Discouraged access: The constructor \'X<String>()\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---/bin1\')\n" +
+ "----------\n" +
"5 problems (5 warnings)\n",
false);
}
@@ -2655,12 +2655,12 @@ public void test040(){
+ " -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal"
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/Y.java (at line 4)\n" +
- " p.Z z;\n" +
- " ^^^\n" +
- "Access restriction: The type \'Z\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/Y.java (at line 4)\n" +
+ " p.Z z;\n" +
+ " ^^^\n" +
+ "Access restriction: The type \'Z\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
+ "----------\n" +
"1 problem (1 warning)\n",
false);
}
@@ -2704,12 +2704,12 @@ public void test041(){
+ " -warn:-discouraged -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal"
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/Y.java (at line 4)\n" +
- " p.Z z;\n" +
- " ^^^\n" +
- "Access restriction: The type \'Z\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/Y.java (at line 4)\n" +
+ " p.Z z;\n" +
+ " ^^^\n" +
+ "Access restriction: The type \'Z\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
+ "----------\n" +
"1 problem (1 warning)\n",
false);
}
@@ -2753,12 +2753,12 @@ public void test042(){
+ " -warn:-forbidden -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal"
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/Y.java (at line 3)\n" +
- " p.X x;\n" +
- " ^^^\n" +
- "Discouraged access: The type \'X\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/Y.java (at line 3)\n" +
+ " p.X x;\n" +
+ " ^^^\n" +
+ "Discouraged access: The type \'X\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
+ "----------\n" +
"1 problem (1 warning)\n",
false);
}
@@ -2962,17 +2962,17 @@ public void test048(){
+ " -warn:+discouraged,forbidden,deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal"
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/Y.java (at line 2)\n" +
- " @SuppressWarnings(\"deprecation\")\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary @SuppressWarnings(\"deprecation\")\n" +
- "----------\n" +
- "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/Y.java (at line 4)\n" +
- " p.X x;\n" +
- " ^^^\n" +
- "Discouraged access: The type \'X\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/Y.java (at line 2)\n" +
+ " @SuppressWarnings(\"deprecation\")\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary @SuppressWarnings(\"deprecation\")\n" +
+ "----------\n" +
+ "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/Y.java (at line 4)\n" +
+ " p.X x;\n" +
+ " ^^^\n" +
+ "Discouraged access: The type \'X\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
+ "----------\n" +
"2 problems (2 warnings)\n",
false);
}
@@ -3729,12 +3729,12 @@ public void test073_per_source_output_directory(){
+ " -sourcepath \"" + OUTPUT_DIR + File.separator + source1 + "\"" +
"[-**/*][-d \"" + OUTPUT_DIR + File.separator + output1 + "\"]",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/Z.java (at line 2)\n" +
- " X f;\n" +
- " ^\n" +
- "Access restriction: The type \'X\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---/src1\')\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/Z.java (at line 2)\n" +
+ " X f;\n" +
+ " ^\n" +
+ "Access restriction: The type \'X\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---/src1\')\n" +
+ "----------\n" +
"1 problem (1 warning)\n",
true);
}
@@ -3918,12 +3918,12 @@ public void test079_per_source_output_directory(){
+ " -classpath \"" + OUTPUT_DIR + File.separator + source1 + "\"" +
"[-**/*][-d \"" + OUTPUT_DIR + File.separator + output1 + "\"]",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/Z.java (at line 2)\n" +
- " X f;\n" +
- " ^\n" +
- "Access restriction: The type \'X\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---/src1\')\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/Z.java (at line 2)\n" +
+ " X f;\n" +
+ " ^\n" +
+ "Access restriction: The type \'X\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---/src1\')\n" +
+ "----------\n" +
"1 problem (1 warning)\n",
true);
}
@@ -4112,12 +4112,12 @@ public void test085_per_source_output_directory(){
"\"" + OUTPUT_DIR + File.separator + source1 + "\"" +
"[-**/*][-d \"" + OUTPUT_DIR + File.separator + output1 + "\"]",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/Z.java (at line 2)\n" +
- " X f;\n" +
- " ^\n" +
- "Access restriction: The type \'X\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---/src1\')\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/Z.java (at line 2)\n" +
+ " X f;\n" +
+ " ^\n" +
+ "Access restriction: The type \'X\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---/src1\')\n" +
+ "----------\n" +
"1 problem (1 warning)\n",
true);
}
@@ -5401,37 +5401,37 @@ public void test148_access_restrictions(){
+ " -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal"
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
- " KO ko;\n" +
- " ^^\n" +
- "Access restriction: The type \'KO\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
- "----------\n" +
- "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 5)\n" +
- " ko = new KO();\n" +
- " ^^\n" +
- "Access restriction: The type \'KO\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
- "----------\n" +
- "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 5)\n" +
- " ko = new KO();\n" +
- " ^^\n" +
- "Access restriction: The constructor \'KO()\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
- "----------\n" +
- "4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 6)\n" +
- " ko.bar();\n" +
- " ^^^\n" +
- "Access restriction: The method \'KO.bar()\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
- "----------\n" +
- "5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 7)\n" +
- " if (ko.m) {}\n" +
- " ^\n" +
- "Access restriction: The field \'KO.m\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
- "----------\n" +
- "6. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 9)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
+ " KO ko;\n" +
+ " ^^\n" +
+ "Access restriction: The type \'KO\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
+ "----------\n" +
+ "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 5)\n" +
+ " ko = new KO();\n" +
+ " ^^\n" +
+ "Access restriction: The type \'KO\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
+ "----------\n" +
+ "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 5)\n" +
+ " ko = new KO();\n" +
+ " ^^\n" +
+ "Access restriction: The constructor \'KO()\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
+ "----------\n" +
+ "4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 6)\n" +
+ " ko.bar();\n" +
+ " ^^^\n" +
+ "Access restriction: The method \'KO.bar()\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
+ "----------\n" +
+ "5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 7)\n" +
+ " if (ko.m) {}\n" +
+ " ^\n" +
+ "Access restriction: The field \'KO.m\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
+ "----------\n" +
+ "6. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 9)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
+ "----------\n" +
"6 problems (1 error, 5 warnings)\n",
true);
}
@@ -6973,11 +6973,11 @@ public void test191_warn_options() {
" ^^^^\n" +
"The label next is never explicitly referenced\n" +
"----------\n" +
- "8. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 14)\n" +
- " <T> void bar() {\n" +
- " ^\n" +
- "Unused type parameter T\n" +
- "----------\n" +
+ "8. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 14)\n" +
+ " <T> void bar() {\n" +
+ " ^\n" +
+ "Unused type parameter T\n" +
+ "----------\n" +
"8 problems (8 warnings)\n",
true);
}
@@ -7283,11 +7283,11 @@ public void test199_warn_options() {
" ^^^^\n" +
"The label next is never explicitly referenced\n" +
"----------\n" +
- "7. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 14)\n" +
- " <T> void bar() {\n" +
- " ^\n" +
- "Unused type parameter T\n" +
- "----------\n" +
+ "7. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 14)\n" +
+ " <T> void bar() {\n" +
+ " ^\n" +
+ "Unused type parameter T\n" +
+ "----------\n" +
"7 problems (7 warnings)\n",
true);
}
@@ -7348,11 +7348,11 @@ public void test200_warn_options() {
" ^^^^\n" +
"The label next is never explicitly referenced\n" +
"----------\n" +
- "7. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 14)\n" +
- " <T> void bar() {\n" +
- " ^\n" +
- "Unused type parameter T\n" +
- "----------\n" +
+ "7. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 14)\n" +
+ " <T> void bar() {\n" +
+ " ^\n" +
+ "Unused type parameter T\n" +
+ "----------\n" +
"7 problems (7 warnings)\n",
true);
}
@@ -7413,11 +7413,11 @@ public void test201_warn_options() {
" ^^^^^^\n" +
"Unused type arguments for the non generic method bar() of type X; it should not be parameterized with arguments <String>\n" +
"----------\n" +
- "7. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 14)\n" +
- " <T> void bar() {\n" +
- " ^\n" +
- "Unused type parameter T\n" +
- "----------\n" +
+ "7. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 14)\n" +
+ " <T> void bar() {\n" +
+ " ^\n" +
+ "Unused type parameter T\n" +
+ "----------\n" +
"7 problems (7 warnings)\n",
true);
}
@@ -7478,11 +7478,11 @@ public void test202_warn_options() {
" ^^^^\n" +
"The label next is never explicitly referenced\n" +
"----------\n" +
- "7. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 14)\n" +
- " <T> void bar() {\n" +
- " ^\n" +
- "Unused type parameter T\n" +
- "----------\n" +
+ "7. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 14)\n" +
+ " <T> void bar() {\n" +
+ " ^\n" +
+ "Unused type parameter T\n" +
+ "----------\n" +
"7 problems (7 warnings)\n",
true);
}
@@ -7543,11 +7543,11 @@ public void test203_warn_options() {
" ^^^^\n" +
"The label next is never explicitly referenced\n" +
"----------\n" +
- "7. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 14)\n" +
- " <T> void bar() {\n" +
- " ^\n" +
- "Unused type parameter T\n" +
- "----------\n" +
+ "7. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 14)\n" +
+ " <T> void bar() {\n" +
+ " ^\n" +
+ "Unused type parameter T\n" +
+ "----------\n" +
"7 problems (7 warnings)\n",
true);
}
@@ -7608,11 +7608,11 @@ public void test204_warn_options() {
" ^^^^\n" +
"The label next is never explicitly referenced\n" +
"----------\n" +
- "7. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 14)\n" +
- " <T> void bar() {\n" +
- " ^\n" +
- "Unused type parameter T\n" +
- "----------\n" +
+ "7. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 14)\n" +
+ " <T> void bar() {\n" +
+ " ^\n" +
+ "Unused type parameter T\n" +
+ "----------\n" +
"7 problems (7 warnings)\n",
true);
}
@@ -7673,11 +7673,11 @@ public void test205_warn_options() {
" ^^^^\n" +
"The label next is never explicitly referenced\n" +
"----------\n" +
- "7. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 14)\n" +
- " <T> void bar() {\n" +
- " ^\n" +
- "Unused type parameter T\n" +
- "----------\n" +
+ "7. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 14)\n" +
+ " <T> void bar() {\n" +
+ " ^\n" +
+ "Unused type parameter T\n" +
+ "----------\n" +
"7 problems (7 warnings)\n",
true);
}
@@ -8372,12 +8372,12 @@ public void test230_warn_options() {
"\"" + OUTPUT_DIR + File.separator + "X.java\""
+ " -warn:unusedTypeArgs -proc:none -1.7 -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 7)\n" +
- " X<String> x = new X<String>();\n" +
- " ^\n" +
- "Redundant specification of type arguments <String>\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 7)\n" +
+ " X<String> x = new X<String>();\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <String>\n" +
+ "----------\n" +
"1 problem (1 warning)\n",
true);
}
@@ -8812,12 +8812,12 @@ public void test235_classpath() throws IOException, InterruptedException {
sourceFilePath /* commandLine */
+ " -proc:none " + commonOptions,
"" /* expectedOutOutputString */,
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/Y.java (at line 3)\n" +
- " System.out.println(X.CONST);\n" +
- " ^^^^^\n" +
- "CONST cannot be resolved or is not a field\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/Y.java (at line 3)\n" +
+ " System.out.println(X.CONST);\n" +
+ " ^^^^^\n" +
+ "CONST cannot be resolved or is not a field\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false /* shouldFlushOutputDirectory */,
null /* progress */);
@@ -9111,12 +9111,12 @@ public void test241_jar_ref_in_jar(){
+ " -proceedOnError -referenceInfo"
+ " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 5)\n" +
- " int j = R.R3;\n" +
- " ^^\n" +
- "R3 cannot be resolved or is not a field\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 5)\n" +
+ " int j = R.R3;\n" +
+ " ^^\n" +
+ "R3 cannot be resolved or is not a field\n" +
+ "----------\n" +
"1 problem (1 error)\n",
true);
}
@@ -9141,12 +9141,12 @@ public void test242_jar_ref_in_jar(){
+ " -proceedOnError -referenceInfo"
+ " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 5)\n" +
- " int j = R.R3;\n" +
- " ^^\n" +
- "R3 cannot be resolved or is not a field\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 5)\n" +
+ " int j = R.R3;\n" +
+ " ^^\n" +
+ "R3 cannot be resolved or is not a field\n" +
+ "----------\n" +
"1 problem (1 error)\n",
true);
}
@@ -9377,12 +9377,12 @@ public void test251_jar_ref_in_jar(){
+ " -proceedOnError -referenceInfo"
+ " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 4)\n" +
- " A a;\n" +
- " ^\n" +
- "Discouraged access: The type \'A\' is not API (restriction on classpath entry \'---LIB_DIR_PLACEHOLDER---/lib3.jar\')\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 4)\n" +
+ " A a;\n" +
+ " ^\n" +
+ "Discouraged access: The type \'A\' is not API (restriction on classpath entry \'---LIB_DIR_PLACEHOLDER---/lib3.jar\')\n" +
+ "----------\n" +
"1 problem (1 warning)\n",
true);
}
@@ -9538,12 +9538,12 @@ public void test256_jar_ref_in_jar(){
+ " -proceedOnError -referenceInfo"
+ " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 4)\n" +
- " A a;\n" +
- " ^\n" +
- "Discouraged access: The type \'A\' is not API (restriction on classpath entry \'---LIB_DIR_PLACEHOLDER---/lib3.jar\')\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 4)\n" +
+ " A a;\n" +
+ " ^\n" +
+ "Discouraged access: The type \'A\' is not API (restriction on classpath entry \'---LIB_DIR_PLACEHOLDER---/lib3.jar\')\n" +
+ "----------\n" +
"1 problem (1 warning)\n",
true);
}
@@ -10364,21 +10364,21 @@ public void test288_warn_options() {
this.runConformTest(
new String[] {
"X.java",
- "interface IX {}\n" +
- "class BaseX implements IX {}\n" +
- "public class X extends BaseX implements IX {\n" +
+ "interface IX {}\n" +
+ "class BaseX implements IX {}\n" +
+ "public class X extends BaseX implements IX {\n" +
"}\n",
},
"\"" + OUTPUT_DIR + File.separator + "X.java\""
+ " -sourcepath \"" + OUTPUT_DIR + "\""
+ " -warn:+intfRedundant -proc:none -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
- " public class X extends BaseX implements IX {\n" +
- " ^^\n" +
- "Redundant superinterface IX for the type X, already defined by BaseX\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
+ " public class X extends BaseX implements IX {\n" +
+ " ^^\n" +
+ "Redundant superinterface IX for the type X, already defined by BaseX\n" +
+ "----------\n" +
"1 problem (1 warning)\n",
true);
}
@@ -10387,21 +10387,21 @@ public void test289_warn_options() {
this.runConformTest(
new String[] {
"X.java",
- "interface IX {}\n" +
- "class BaseX implements IX {}\n" +
- "public class X extends BaseX implements IX {\n" +
+ "interface IX {}\n" +
+ "class BaseX implements IX {}\n" +
+ "public class X extends BaseX implements IX {\n" +
"}\n",
},
"\"" + OUTPUT_DIR + File.separator + "X.java\""
+ " -sourcepath \"" + OUTPUT_DIR + "\""
+ " -warn:+redundantSuperinterface -proc:none -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
- " public class X extends BaseX implements IX {\n" +
- " ^^\n" +
- "Redundant superinterface IX for the type X, already defined by BaseX\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
+ " public class X extends BaseX implements IX {\n" +
+ " ^^\n" +
+ "Redundant superinterface IX for the type X, already defined by BaseX\n" +
+ "----------\n" +
"1 problem (1 warning)\n",
true);
}
@@ -10410,9 +10410,9 @@ public void test290_warn_options() {
this.runConformTest(
new String[] {
"X.java",
- "interface IX {}\n" +
- "class BaseX implements IX {}\n" +
- "public class X extends BaseX implements IX {\n" +
+ "interface IX {}\n" +
+ "class BaseX implements IX {}\n" +
+ "public class X extends BaseX implements IX {\n" +
"}\n",
},
"\"" + OUTPUT_DIR + File.separator + "X.java\""
@@ -10422,7 +10422,7 @@ public void test290_warn_options() {
"",
true);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=251079
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=251079
public void test291_jar_ref_in_jar() throws Exception {
ManifestAnalyzer analyzer = new ManifestAnalyzer();
assertTrue(analyzeManifestContents(
@@ -10435,8 +10435,8 @@ public void test291_jar_ref_in_jar() throws Exception {
List calledFileNames = analyzer.getCalledFileNames();
String actual = calledFileNames == null ? "<null>" : Util.toString((String[]) calledFileNames.toArray(new String[calledFileNames.size()]), false/*don't add extra new lines*/);
assertStringEquals(
- "<null>",
- actual,
+ "<null>",
+ actual,
true/*show line serators*/);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=163194
@@ -10521,32 +10521,32 @@ public void test293_warn_options() {
+ " -sourcepath \"" + OUTPUT_DIR + "\""
+ " -warn:null,includeAssertNull -1.5 -proc:none -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 4)\n" +
- " if (a!=null) {\n" +
- " ^\n" +
- "Null comparison always yields false: The variable a can only be null at this location\n" +
- "----------\n" +
- "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 9)\n" +
- " a = null;\n" +
- " ^\n" +
- "Redundant assignment: The variable a can only be null at this location\n" +
- "----------\n" +
- "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 10)\n" +
- " if (a== null) {}\n" +
- " ^\n" +
- "Redundant null check: The variable a can only be null at this location\n" +
- "----------\n" +
- "4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 12)\n" +
- " if (b!=null) {\n" +
- " ^\n" +
- "Redundant null check: The variable b cannot be null at this location\n" +
- "----------\n" +
- "5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 18)\n" +
- " if (c.equals(a)) {\n" +
- " ^\n" +
- "Null pointer access: The variable c can only be null at this location\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 4)\n" +
+ " if (a!=null) {\n" +
+ " ^\n" +
+ "Null comparison always yields false: The variable a can only be null at this location\n" +
+ "----------\n" +
+ "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 9)\n" +
+ " a = null;\n" +
+ " ^\n" +
+ "Redundant assignment: The variable a can only be null at this location\n" +
+ "----------\n" +
+ "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 10)\n" +
+ " if (a== null) {}\n" +
+ " ^\n" +
+ "Redundant null check: The variable a can only be null at this location\n" +
+ "----------\n" +
+ "4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 12)\n" +
+ " if (b!=null) {\n" +
+ " ^\n" +
+ "Redundant null check: The variable b cannot be null at this location\n" +
+ "----------\n" +
+ "5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 18)\n" +
+ " if (c.equals(a)) {\n" +
+ " ^\n" +
+ "Null pointer access: The variable c can only be null at this location\n" +
+ "----------\n" +
"5 problems (5 warnings)\n",
true);
}
@@ -10560,50 +10560,50 @@ public void test294_warn_options() {
"X.java",
"public class X {\n" +
" public static int field1;\n" +
- " public static int field2;\n" +
- " public void bar(int i) {\n" +
+ " public static int field2;\n" +
+ " public void bar(int i) {\n" +
" System.out.println(foo());\n" +
" foo();" +
" System.out.println(X.field1);\n" +
" System.out.println(field2);\n" +
" field2 = 1;\n" +
- " }\n" +
- " private static String foo() {\n" +
- " return null;\n" +
+ " }\n" +
+ " private static String foo() {\n" +
+ " return null;\n" +
" }\n" +
" private void foo1() {\n" +
" System.out.println();\n" +
" }\n" +
" public final void foo2() {\n" +
" System.out.println();\n" +
- " }\n" +
+ " }\n" +
"}\n" +
"final class A {" +
" public void foo() {\n" +
" System.out.println();\n" +
- " }\n" +
+ " }\n" +
"}\n",
},
"\"" + OUTPUT_DIR + File.separator + "X.java\""
+ " -sourcepath \"" + OUTPUT_DIR + "\""
+ " -warn:static-method -proc:none -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 13)\n" +
- " private void foo1() {\n" +
- " ^^^^^^\n" +
- "The method foo1() from the type X can be declared as static\n" +
- "----------\n" +
- "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 16)\n" +
- " public final void foo2() {\n" +
- " ^^^^^^\n" +
- "The method foo2() from the type X can be declared as static\n" +
- "----------\n" +
- "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 20)\n" +
- " final class A { public void foo() {\n" +
- " ^^^^^\n" +
- "The method foo() from the type A can be declared as static\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 13)\n" +
+ " private void foo1() {\n" +
+ " ^^^^^^\n" +
+ "The method foo1() from the type X can be declared as static\n" +
+ "----------\n" +
+ "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 16)\n" +
+ " public final void foo2() {\n" +
+ " ^^^^^^\n" +
+ "The method foo2() from the type X can be declared as static\n" +
+ "----------\n" +
+ "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 20)\n" +
+ " final class A { public void foo() {\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type A can be declared as static\n" +
+ "----------\n" +
"3 problems (3 warnings)\n",
true);
}
@@ -10617,55 +10617,55 @@ public void test295_warn_options() {
"X.java",
"public class X {\n" +
" public static int field1;\n" +
- " public static int field2;\n" +
- " public void bar(int i) {\n" +
+ " public static int field2;\n" +
+ " public void bar(int i) {\n" +
" System.out.println(foo());\n" +
" foo();" +
" System.out.println(X.field1);\n" +
" System.out.println(field2);\n" +
" field2 = 1;\n" +
- " }\n" +
- " private static String foo() {\n" +
- " return null;\n" +
+ " }\n" +
+ " private static String foo() {\n" +
+ " return null;\n" +
" }\n" +
" private void foo1() {\n" +
" System.out.println();\n" +
" }\n" +
" public final void foo2() {\n" +
" System.out.println();\n" +
- " }\n" +
+ " }\n" +
"}\n" +
"final class A {" +
" public void foo() {\n" +
" System.out.println();\n" +
- " }\n" +
+ " }\n" +
"}\n",
},
"\"" + OUTPUT_DIR + File.separator + "X.java\""
+ " -sourcepath \"" + OUTPUT_DIR + "\""
+ " -warn:all-static-method -proc:none -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 4)\n" +
- " public void bar(int i) {\n" +
- " ^^^^^^^^^^\n" +
- "The method bar(int) from the type X can potentially be declared as static\n" +
- "----------\n" +
- "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 13)\n" +
- " private void foo1() {\n" +
- " ^^^^^^\n" +
- "The method foo1() from the type X can be declared as static\n" +
- "----------\n" +
- "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 16)\n" +
- " public final void foo2() {\n" +
- " ^^^^^^\n" +
- "The method foo2() from the type X can be declared as static\n" +
- "----------\n" +
- "4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 20)\n" +
- " final class A { public void foo() {\n" +
- " ^^^^^\n" +
- "The method foo() from the type A can be declared as static\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 4)\n" +
+ " public void bar(int i) {\n" +
+ " ^^^^^^^^^^\n" +
+ "The method bar(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 13)\n" +
+ " private void foo1() {\n" +
+ " ^^^^^^\n" +
+ "The method foo1() from the type X can be declared as static\n" +
+ "----------\n" +
+ "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 16)\n" +
+ " public final void foo2() {\n" +
+ " ^^^^^^\n" +
+ "The method foo2() from the type X can be declared as static\n" +
+ "----------\n" +
+ "4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 20)\n" +
+ " final class A { public void foo() {\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type A can be declared as static\n" +
+ "----------\n" +
"4 problems (4 warnings)\n",
true);
}
@@ -10689,12 +10689,12 @@ public void test293(){
+ " -proceedOnError -referenceInfo -err:+discouraged"
+ " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 4)\n" +
- " A a;\n" +
- " ^\n" +
- "Discouraged access: The type \'A\' is not API (restriction on classpath entry \'---LIB_DIR_PLACEHOLDER---/lib3.jar\')\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 4)\n" +
+ " A a;\n" +
+ " ^\n" +
+ "Discouraged access: The type \'A\' is not API (restriction on classpath entry \'---LIB_DIR_PLACEHOLDER---/lib3.jar\')\n" +
+ "----------\n" +
"1 problem (1 error)\n",
true);
}
@@ -10783,17 +10783,17 @@ public void test299(){
+ " -1.5 -g -preserveAllLocals"
+ " -proceedOnError -err:+unused -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 2)\n" +
- " @SuppressWarnings(\"unused\")\n" +
- " ^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 2)\n" +
+ " @SuppressWarnings(\"unused\")\n" +
+ " ^^^^^^^^\n" +
"Unnecessary @SuppressWarnings(\"unused\")\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
- " private int i;\n" +
- " ^\n" +
- "The value of the field X.i is not used\n" +
- "----------\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
+ " private int i;\n" +
+ " ^\n" +
+ "The value of the field X.i is not used\n" +
+ "----------\n" +
"2 problems (1 error, 1 warning)\n",
true);
}
@@ -10828,12 +10828,12 @@ public void test301(){
+ " -1.5 -g -preserveAllLocals"
+ " -proceedOnError -warn:-suppress -err:+unused -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
- " private int i;\n" +
- " ^\n" +
- "The value of the field X.i is not used\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
+ " private int i;\n" +
+ " ^\n" +
+ "The value of the field X.i is not used\n" +
+ "----------\n" +
"1 problem (1 error)\n",
true);
}
@@ -10851,12 +10851,12 @@ public void test302(){
+ " -1.5 -g -preserveAllLocals"
+ " -proceedOnError -warn:-suppress -err:+suppress,unused -warn:-suppress -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
- " private int i;\n" +
- " ^\n" +
- "The value of the field X.i is not used\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
+ " private int i;\n" +
+ " ^\n" +
+ "The value of the field X.i is not used\n" +
+ "----------\n" +
"1 problem (1 error)\n",
true);
}
@@ -10874,17 +10874,17 @@ public void test303(){
+ " -1.5 -g -preserveAllLocals"
+ " -proceedOnError -warn:-suppress -err:+suppress,unused -warn:+suppress -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 2)\n" +
- " @SuppressWarnings(\"unused\")\n" +
- " ^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 2)\n" +
+ " @SuppressWarnings(\"unused\")\n" +
+ " ^^^^^^^^\n" +
"Unnecessary @SuppressWarnings(\"unused\")\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
- " private int i;\n" +
- " ^\n" +
- "The value of the field X.i is not used\n" +
- "----------\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
+ " private int i;\n" +
+ " ^\n" +
+ "The value of the field X.i is not used\n" +
+ "----------\n" +
"2 problems (1 error, 1 warning)\n",
true);
}
@@ -10902,12 +10902,12 @@ public void test304(){
+ " -1.5 -g -preserveAllLocals"
+ " -proceedOnError -err:+suppress,unused -warn:-suppress -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
- " private int i;\n" +
- " ^\n" +
- "The value of the field X.i is not used\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
+ " private int i;\n" +
+ " ^\n" +
+ "The value of the field X.i is not used\n" +
+ "----------\n" +
"1 problem (1 error)\n",
true);
}
@@ -10920,7 +10920,7 @@ public void test305(){
},
"\"" + OUTPUT_DIR + File.separator + "src/X.java\""
+ " -encoding UTF-8 -1.5 -g -encoding ISO-8859-1",
- "Found encoding ISO-8859-1. A different encoding was specified: UTF-8\n" +
+ "Found encoding ISO-8859-1. A different encoding was specified: UTF-8\n" +
"Multiple encoding specified: ISO-8859-1, UTF-8. The default encoding has been set to ISO-8859-1\n",
"",
true);
@@ -10934,8 +10934,8 @@ public void test306(){
},
"\"" + OUTPUT_DIR + File.separator + "src/X.java\""
+ " -encoding UTF-8 -1.5 -encoding Cp1252 -g -encoding ISO-8859-1",
- "Found encoding Cp1252. A different encoding was specified: UTF-8\n" +
- "Found encoding ISO-8859-1. Different encodings were specified: Cp1252, UTF-8\n" +
+ "Found encoding Cp1252. A different encoding was specified: UTF-8\n" +
+ "Found encoding ISO-8859-1. Different encodings were specified: Cp1252, UTF-8\n" +
"Multiple encoding specified: Cp1252, ISO-8859-1, UTF-8. The default encoding has been set to ISO-8859-1\n",
"",
true);
@@ -10998,7 +10998,7 @@ public void test0307a(){
String os= System.getProperty("os.name");
if (!os.startsWith("Windows")) // https://bugs.eclipse.org/bugs/show_bug.cgi?id=323558
return;
-
+
final String javaClassspath = System.getProperty("java.class.path");
final String javaUserDir = System.getProperty("user.dir");
try {
@@ -11029,18 +11029,18 @@ public void test0307a(){
"\"" + OUTPUT_DIR + File.separator + "X.java\""
+ " -1.5 -g -preserveAllLocals -proceedOnError -referenceInfo ",
"",// this is not the runtime output
- "no classpath defined, using default directory instead\n" +
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 1)\n" +
- " import p.Y.I;\n" +
- " ^^^\n" +
- "The import p.Y cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
- " I i;\n" +
- " ^\n" +
- "I cannot be resolved to a type\n" +
- "----------\n" +
+ "no classpath defined, using default directory instead\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 1)\n" +
+ " import p.Y.I;\n" +
+ " ^^^\n" +
+ "The import p.Y cannot be resolved\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
+ " I i;\n" +
+ " ^\n" +
+ "I cannot be resolved to a type\n" +
+ "----------\n" +
"2 problems (2 errors)\n",
false);
final String userDir = System.getProperty("user.dir");
@@ -11094,18 +11094,18 @@ public void test0307b(){
"\"" + OUTPUT_DIR + File.separator + "X.java\""
+ " -1.5 -g -preserveAllLocals -proceedOnError -referenceInfo ",
"",// this is not the runtime output
- "no classpath defined, using default directory instead\n" +
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 1)\n" +
- " import p.Y.I;\n" +
- " ^^^\n" +
- "The import p.Y cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
- " I i;\n" +
- " ^\n" +
- "I cannot be resolved to a type\n" +
- "----------\n" +
+ "no classpath defined, using default directory instead\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 1)\n" +
+ " import p.Y.I;\n" +
+ " ^^^\n" +
+ "The import p.Y cannot be resolved\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
+ " I i;\n" +
+ " ^\n" +
+ "I cannot be resolved to a type\n" +
+ "----------\n" +
"2 problems (2 errors)\n",
false);
final String userDir = System.getProperty("user.dir");
@@ -11159,18 +11159,18 @@ public void test0307c(){
"\"" + OUTPUT_DIR + File.separator + "X.java\""
+ " -1.5 -g -preserveAllLocals -proceedOnError -referenceInfo ",
"",// this is not the runtime output
- "no classpath defined, using default directory instead\n" +
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 1)\n" +
- " import p.Y.I;\n" +
- " ^^^^^\n" +
- "The import p.Y.I cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
- " I i;\n" +
- " ^\n" +
- "I cannot be resolved to a type\n" +
- "----------\n" +
+ "no classpath defined, using default directory instead\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 1)\n" +
+ " import p.Y.I;\n" +
+ " ^^^^^\n" +
+ "The import p.Y.I cannot be resolved\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
+ " I i;\n" +
+ " ^\n" +
+ "I cannot be resolved to a type\n" +
+ "----------\n" +
"2 problems (2 errors)\n",
false);
final String userDir = System.getProperty("user.dir");
@@ -11224,18 +11224,18 @@ public void test0307d(){
"\"" + OUTPUT_DIR + File.separator + "X.java\""
+ " -1.5 -g -preserveAllLocals -proceedOnError -referenceInfo ",
"",// this is not the runtime output
- "no classpath defined, using default directory instead\n" +
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 1)\n" +
- " import p.Y.I;\n" +
- " ^^^\n" +
- "The import p.Y cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
- " I i;\n" +
- " ^\n" +
- "I cannot be resolved to a type\n" +
- "----------\n" +
+ "no classpath defined, using default directory instead\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 1)\n" +
+ " import p.Y.I;\n" +
+ " ^^^\n" +
+ "The import p.Y cannot be resolved\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
+ " I i;\n" +
+ " ^\n" +
+ "I cannot be resolved to a type\n" +
+ "----------\n" +
"2 problems (2 errors)\n",
false);
final String userDir = System.getProperty("user.dir");
@@ -11289,18 +11289,18 @@ public void test0307e(){
"\"" + OUTPUT_DIR + File.separator + "X.java\""
+ " -1.5 -g -preserveAllLocals -proceedOnError -referenceInfo ",
"",// this is not the runtime output
- "no classpath defined, using default directory instead\n" +
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 1)\n" +
- " import p.Y.I;\n" +
- " ^^^\n" +
- "The import p.Y cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
- " I i;\n" +
- " ^\n" +
- "I cannot be resolved to a type\n" +
- "----------\n" +
+ "no classpath defined, using default directory instead\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 1)\n" +
+ " import p.Y.I;\n" +
+ " ^^^\n" +
+ "The import p.Y cannot be resolved\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
+ " I i;\n" +
+ " ^\n" +
+ "I cannot be resolved to a type\n" +
+ "----------\n" +
"2 problems (2 errors)\n",
false);
final String userDir = System.getProperty("user.dir");
@@ -11344,7 +11344,7 @@ public void testInferenceIn14Project(){
new String[] {
"src/X.java",
"public class X {\n" +
- " Bundle b = Bundle.adapt(BundleWiring.class);\n" +
+ " Bundle b = Bundle.adapt(BundleWiring.class);\n" +
"}\n" +
"class BundleWiring {}\n",
},
@@ -11355,12 +11355,12 @@ public void testInferenceIn14Project(){
+ " -proceedOnError -referenceInfo"
+ " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/X.java (at line 2)\n" +
- " Bundle b = Bundle.adapt(BundleWiring.class);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Object to Bundle\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/X.java (at line 2)\n" +
+ " Bundle b = Bundle.adapt(BundleWiring.class);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Object to Bundle\n" +
+ "----------\n" +
"1 problem (1 error)\n",
true);
} catch (IOException e) {
@@ -11395,7 +11395,7 @@ public void testInferenceIn15Project(){ // ensure 1.5 complains too
new String[] {
"src/X.java",
"public class X {\n" +
- " Bundle b = Bundle.adapt(BundleWiring.class);\n" +
+ " Bundle b = Bundle.adapt(BundleWiring.class);\n" +
"}\n" +
"class BundleWiring {}\n",
},
@@ -11406,12 +11406,12 @@ public void testInferenceIn15Project(){ // ensure 1.5 complains too
+ " -proceedOnError -referenceInfo"
+ " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/X.java (at line 2)\n" +
- " Bundle b = Bundle.adapt(BundleWiring.class);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from BundleWiring to Bundle\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/X.java (at line 2)\n" +
+ " Bundle b = Bundle.adapt(BundleWiring.class);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from BundleWiring to Bundle\n" +
+ "----------\n" +
"1 problem (1 error)\n",
true);
} catch (IOException e) {
@@ -11420,7 +11420,7 @@ public void testInferenceIn15Project(){ // ensure 1.5 complains too
new File(lib1Path).delete();
}
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=186565 Test interaction between 1.4 and 1.5 class files
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=186565 Test interaction between 1.4 and 1.5 class files
public void test186565(){
String outputDirName = OUTPUT_DIR + File.separator + "d",
metaInfDirName = outputDirName + File.separator + "META-INF",
@@ -11545,17 +11545,17 @@ public void testReportingUnavoidableGenericProblems() {
"\"" + OUTPUT_DIR + File.separator + "X.java\""
+ " -1.5 -warn:-unavoidableGenericProblems -proc:none -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 2)\n" +
- " public Object getAdapter(Class clazz); \n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 8)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 2)\n" +
+ " public Object getAdapter(Class clazz); \n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 8)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
+ "----------\n" +
"2 problems (1 error, 1 warning)\n",
true);
}
@@ -11577,22 +11577,22 @@ public void testReportingUnavoidableGenericProblems2() {
"\"" + OUTPUT_DIR + File.separator + "X.java\""
+ " -1.5 -warn:+unavoidableGenericProblems -proc:none -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 2)\n" +
- " public Object getAdapter(Class clazz); \n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 5)\n" +
- " public Object getAdapter(Class clazz) {\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 8)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 2)\n" +
+ " public Object getAdapter(Class clazz); \n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 5)\n" +
+ " public Object getAdapter(Class clazz) {\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 8)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
+ "----------\n" +
"3 problems (1 error, 2 warnings)\n",
true);
}
@@ -11636,12 +11636,12 @@ public void test0309_warn_options() {
"\"" + OUTPUT_DIR + File.separator + "X.java\""
+ " -warn:+resource -1.7 -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 4)\n" +
- " FileReader r = new FileReader(\"f1\");\n" +
- " ^\n" +
- "Potential resource leak: \'r\' may not be closed\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 4)\n" +
+ " FileReader r = new FileReader(\"f1\");\n" +
+ " ^\n" +
+ "Potential resource leak: \'r\' may not be closed\n" +
+ "----------\n" +
"1 problem (1 warning)\n",
true);
}
@@ -11660,8 +11660,8 @@ public void test310_warn_options() {
+ " -sourcepath \"" + OUTPUT_DIR + "\""
+ " -warn:syncOverride -1.5 -proc:none -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 2)\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 2)\n" +
" class Y extends X { @Override void foo() { } }\n" +
" ^^^^^\n" +
"The method Y.foo() is overriding a synchronized method without being synchronized\n" +
@@ -11677,7 +11677,7 @@ public void test310b_warn_options() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" void bar() { new X() { @Override void foo() {} }; }\n"+
" synchronized void foo() { }\n"+
"}"
@@ -11686,8 +11686,8 @@ public void test310b_warn_options() {
+ " -sourcepath \"" + OUTPUT_DIR + "\""
+ " -warn:syncOverride -1.5 -proc:none -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 2)\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 2)\n" +
" void bar() { new X() { @Override void foo() {} }; }\n"+
" ^^^^^\n" +
"The method new X(){}.foo() is overriding a synchronized method without being synchronized\n" +
@@ -11749,58 +11749,58 @@ public void test312_warn_options() {
+ " -1.5"
+ " -warn:+nullAnnot(p.Nullable|p.NonNull|p.NonNullByDefault) -warn:+null -proc:none -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 6)\n" +
- " public void test() { Object o = null; o.toString();}\n" +
- " ^\n" +
- "Null pointer access: The variable o can only be null at this location\n" +
- "----------\n" +
- "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 8)\n" +
- " if (o.toString() == \"\"){ return null;}\n" +
- " ^\n" +
- "Potential null pointer access: The variable o may be null at this location\n" +
- "----------\n" +
- "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 8)\n" +
- " if (o.toString() == \"\"){ return null;}\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 9)\n" +
- " if (o2 == null) {}\n" +
- " ^^\n" +
- "Null comparison always yields false: The variable o2 is specified as @NonNull\n" +
- "----------\n" +
- "5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 10)\n" +
- " goo(null).toString();\n" +
- " ^^^^^^^^^\n" +
- "Potential null pointer access: The method goo(Object) may return null\n" +
- "----------\n" +
- "6. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 10)\n" +
- " goo(null).toString();\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "7. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 13)\n" +
- " return null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "8. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 19)\n" +
- " if (o2 == null){}\n" +
- " ^^\n" +
- "Null comparison always yields false: The variable o2 is specified as @NonNull\n" +
- "----------\n" +
- "9. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 20)\n" +
- " if (o2 == null){\n" +
- " ^^\n" +
- "Null comparison always yields false: The variable o2 is specified as @NonNull\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 6)\n" +
+ " public void test() { Object o = null; o.toString();}\n" +
+ " ^\n" +
+ "Null pointer access: The variable o can only be null at this location\n" +
+ "----------\n" +
+ "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 8)\n" +
+ " if (o.toString() == \"\"){ return null;}\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable o may be null at this location\n" +
+ "----------\n" +
+ "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 8)\n" +
+ " if (o.toString() == \"\"){ return null;}\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 9)\n" +
+ " if (o2 == null) {}\n" +
+ " ^^\n" +
+ "Null comparison always yields false: The variable o2 is specified as @NonNull\n" +
+ "----------\n" +
+ "5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 10)\n" +
+ " goo(null).toString();\n" +
+ " ^^^^^^^^^\n" +
+ "Potential null pointer access: The method goo(Object) may return null\n" +
+ "----------\n" +
+ "6. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 10)\n" +
+ " goo(null).toString();\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "7. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 13)\n" +
+ " return null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "8. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 19)\n" +
+ " if (o2 == null){}\n" +
+ " ^^\n" +
+ "Null comparison always yields false: The variable o2 is specified as @NonNull\n" +
+ "----------\n" +
+ "9. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 20)\n" +
+ " if (o2 == null){\n" +
+ " ^^\n" +
+ "Null comparison always yields false: The variable o2 is specified as @NonNull\n" +
+ "----------\n" +
"9 problems (9 warnings)\n",
true);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=374605
-// -warn/-error option : enumSwitchPedantic
+// -warn/-error option : enumSwitchPedantic
public void test317_warn_options() {
this.runConformTest(
new String[] {
@@ -11913,7 +11913,7 @@ public void test317_nowarn_options() {
},
"\"" + OUTPUT_DIR + File.separator + "src/X.java\""
+ " -warn:javadoc -nowarn:[\"" +
- OUTPUT_DIR + File.separator + "src" +
+ OUTPUT_DIR + File.separator + "src" +
"\"] -proc:none -d \"" + OUTPUT_DIR + "\"",
"",
"",
@@ -12293,31 +12293,31 @@ public void testBug375409a() {
"public class X {\n" +
"/** \n" +
"* Description {@see String}, {@category cat}\n" +
- "* @param a\n" +
+ "* @param a\n" +
"*/\n" +
- "public void foo(int i) {}}\n"
+ "public void foo(int i) {}}\n"
},
"\"" + OUTPUT_DIR + File.separator + "p" + File.separator + "X.java\""
+ " -sourcepath \"" + OUTPUT_DIR + "\""
+ " -1.5"
+ " -warn:invalidJavadoc -proc:none -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 4)\n" +
- " * Description {@see String}, {@category cat}\n" +
- " ^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 4)\n" +
- " * Description {@see String}, {@category cat}\n" +
- " ^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 5)\n" +
- " * @param a\n" +
- " ^\n" +
- "Javadoc: Parameter a is not declared\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 4)\n" +
+ " * Description {@see String}, {@category cat}\n" +
+ " ^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 4)\n" +
+ " * Description {@see String}, {@category cat}\n" +
+ " ^^^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 5)\n" +
+ " * @param a\n" +
+ " ^\n" +
+ "Javadoc: Parameter a is not declared\n" +
+ "----------\n" +
"3 problems (3 warnings)\n",
true);
}
@@ -12330,21 +12330,21 @@ public void testBug375409b() {
"public class X {\n" +
"/** \n" +
"* Description {@see String}, {@category cat}\n" +
- "* @param a\n" +
+ "* @param a\n" +
"*/\n" +
- "public void foo(int i) {}}\n"
+ "public void foo(int i) {}}\n"
},
"\"" + OUTPUT_DIR + File.separator + "p" + File.separator + "X.java\""
+ " -sourcepath \"" + OUTPUT_DIR + "\""
+ " -1.5"
+ " -warn:missingJavadocTags,missingJavadocTagsVisibility(public) -proc:none -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 7)\n" +
- " public void foo(int i) {}}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter i\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 7)\n" +
+ " public void foo(int i) {}}\n" +
+ " ^\n" +
+ "Javadoc: Missing tag for parameter i\n" +
+ "----------\n" +
"1 problem (1 warning)\n",
true);
}
@@ -12357,21 +12357,21 @@ public void testBug375409c() {
"public class X {\n" +
"/** \n" +
"* Description {@see String}, {@category cat}\n" +
- "* @param a\n" +
+ "* @param a\n" +
"*/\n" +
- "public void foo(int i) {}}\n"
+ "public void foo(int i) {}}\n"
},
"\"" + OUTPUT_DIR + File.separator + "p" + File.separator + "X.java\""
+ " -sourcepath \"" + OUTPUT_DIR + "\""
+ " -1.5"
+ " -warn:missingJavadocComments -proc:none -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 2)\n" +
- " public class X {\n" +
- " ^\n" +
- "Javadoc: Missing comment for public declaration\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 2)\n" +
+ " public class X {\n" +
+ " ^\n" +
+ "Javadoc: Missing comment for public declaration\n" +
+ "----------\n" +
"1 problem (1 warning)\n",
true);
}
@@ -12384,26 +12384,26 @@ public void testBug375409d() {
"public class X {\n" +
"/** \n" +
"* Description {@see String}, {@category cat}\n" +
- "* @param a\n" +
+ "* @param a\n" +
"*/\n" +
"void foo(int i) {}\n" +
"/** \n" +
"* Description {@see String}, {@category cat}\n" +
- "* @param a\n" +
+ "* @param a\n" +
"*/\n" +
- "public void foo2(int i2) {}}\n"
+ "public void foo2(int i2) {}}\n"
},
"\"" + OUTPUT_DIR + File.separator + "p" + File.separator + "X.java\""
+ " -sourcepath \"" + OUTPUT_DIR + "\""
+ " -1.5"
+ " -warn:missingJavadocTags,missingJavadocTagsVisibility(public) -proc:none -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 12)\n" +
- " public void foo2(int i2) {}}\n" +
- " ^^\n" +
- "Javadoc: Missing tag for parameter i2\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 12)\n" +
+ " public void foo2(int i2) {}}\n" +
+ " ^^\n" +
+ "Javadoc: Missing tag for parameter i2\n" +
+ "----------\n" +
"1 problem (1 warning)\n",
true);
}
@@ -12447,7 +12447,7 @@ public void testBug375409e() {
+ " -warn:+nullAnnot(p.Nullable|p.NonNull|p.NonNullByDefault),+null,-nullAnnotConflict "
+ "-proc:none -d \"" + OUTPUT_DIR + "\"",
"",
- "",
+ "",
true);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=375409
@@ -12485,12 +12485,12 @@ public void testBug375409f() {
+ " -warn:+nullAnnot(p.Nullable|p.NonNull|p.NonNullByDefault),+null,-nullAnnotRedundant "
+ "-proc:none -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 6)\n" +
- " return null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 6)\n" +
+ " return null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
"1 problem (1 warning)\n",
true);
}
@@ -12532,7 +12532,7 @@ public void testBug375409g() {
+ " -warn:+nullAnnot(p.Nullable|p.NonNull|p.NonNullByDefault) -warn:+null -warn:-nullUncheckedConversion "
+ "-proc:none -d \"" + OUTPUT_DIR + "\"",
"",
- "",
+ "",
true);
}
@@ -12542,21 +12542,21 @@ public void testBug375409g() {
public void testBug375366a() throws IOException {
createOutputTestDirectory("regression/.settings");
Util.createFile(OUTPUT_DIR+"/.settings/org.eclipse.jdt.core.prefs",
- "eclipse.preferences.version=1\n" +
+ "eclipse.preferences.version=1\n" +
"org.eclipse.jdt.core.compiler.problem.unusedParameter=warning\n");
this.runConformTest(
new String[] {
"bugs/warning/ShowBug.java",
- "package bugs.warning;\n" +
- "\n" +
- "public class ShowBug {\n" +
- " /**\n" +
- " * \n" +
- " * @param unusedParam\n" +
- " */\n" +
- " public void foo(Object unusedParam) {\n" +
- " \n" +
- " }\n" +
+ "package bugs.warning;\n" +
+ "\n" +
+ "public class ShowBug {\n" +
+ " /**\n" +
+ " * \n" +
+ " * @param unusedParam\n" +
+ " */\n" +
+ " public void foo(Object unusedParam) {\n" +
+ " \n" +
+ " }\n" +
"}\n"
},
"\"" + OUTPUT_DIR + File.separator + "bugs" + File.separator + "warning" + File.separator + "ShowBug.java\""
@@ -12564,7 +12564,7 @@ public void testBug375366a() throws IOException {
+ " -properties " + OUTPUT_DIR + File.separator +".settings" + File.separator + "org.eclipse.jdt.core.prefs "
+ " -d \"" + OUTPUT_DIR + "\"",
"",
- "",
+ "",
false /*don't flush output dir*/);
}
@@ -12573,36 +12573,36 @@ public void testBug375366a() throws IOException {
public void testBug375366b() throws IOException {
createOutputTestDirectory("regression/.settings");
Util.createFile(OUTPUT_DIR+"/.settings/org.eclipse.jdt.core.prefs",
- "eclipse.preferences.version=1\n" +
+ "eclipse.preferences.version=1\n" +
"org.eclipse.jdt.core.compiler.problem.unusedParameter=warning\n" +
"org.eclipse.jdt.core.compiler.doc.comment.support=disabled\n");
this.runTest(
true, // compile OK, expecting only warning
new String[] {
"bugs/warning/ShowBug.java",
- "package bugs.warning;\n" +
- "\n" +
- "public class ShowBug {\n" +
- " /**\n" +
- " * \n" +
- " * @param unusedParam\n" +
- " */\n" +
- " public void foo(Object unusedParam) {\n" +
- " \n" +
- " }\n" +
+ "package bugs.warning;\n" +
+ "\n" +
+ "public class ShowBug {\n" +
+ " /**\n" +
+ " * \n" +
+ " * @param unusedParam\n" +
+ " */\n" +
+ " public void foo(Object unusedParam) {\n" +
+ " \n" +
+ " }\n" +
"}\n"
},
"\"" + OUTPUT_DIR + File.separator + "bugs" + File.separator + "warning" + File.separator + "ShowBug.java\""
+ " -1.5"
+ " -properties " + OUTPUT_DIR + File.separator +".settings" + File.separator + "org.eclipse.jdt.core.prefs "
+ " -d \"" + OUTPUT_DIR + "\"",
- "",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/bugs/warning/ShowBug.java (at line 8)\n" +
- " public void foo(Object unusedParam) {\n" +
- " ^^^^^^^^^^^\n" +
- "The value of the parameter unusedParam is not used\n" +
- "----------\n" +
+ "",
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/bugs/warning/ShowBug.java (at line 8)\n" +
+ " public void foo(Object unusedParam) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The value of the parameter unusedParam is not used\n" +
+ "----------\n" +
"1 problem (1 warning)\n",
false /*don't flush output dir*/,
null /* progress */);
@@ -12636,27 +12636,27 @@ public void test385780_warn_option() {
"\"" + OUTPUT_DIR + File.separator + "X.java\""
+ " -warn:unusedTypeParameter -proc:none -1.7 -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 1)\n" +
- " public class X<T> {\n" +
- " ^\n" +
- "Unused type parameter T\n" +
- "----------\n" +
- "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 2)\n" +
- " public <S> X() {\n" +
- " ^\n" +
- "Unused type parameter S\n" +
- "----------\n" +
- "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 7)\n" +
- " interface doNothingInterface<T> {\n" +
- " ^\n" +
- "Unused type parameter T\n" +
- "----------\n" +
- "4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 10)\n" +
- " public <T> void doNothingMethod() {}\n" +
- " ^\n" +
- "Unused type parameter T\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 1)\n" +
+ " public class X<T> {\n" +
+ " ^\n" +
+ "Unused type parameter T\n" +
+ "----------\n" +
+ "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 2)\n" +
+ " public <S> X() {\n" +
+ " ^\n" +
+ "Unused type parameter S\n" +
+ "----------\n" +
+ "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 7)\n" +
+ " interface doNothingInterface<T> {\n" +
+ " ^\n" +
+ "Unused type parameter T\n" +
+ "----------\n" +
+ "4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 10)\n" +
+ " public <T> void doNothingMethod() {}\n" +
+ " ^\n" +
+ "Unused type parameter T\n" +
+ "----------\n" +
"4 problems (4 warnings)\n",
true);
}
@@ -12877,7 +12877,7 @@ public void testBug419351() {
Util.createJar(
new String[] {
"java/lang/String.java",
- "package java.lang;\n" +
+ "package java.lang;\n" +
"public class String {\n" +
" public String(java.lang.Object obj) {}\n" +
"}\n"
@@ -13021,12 +13021,12 @@ public void test496137a(){
+ " -proceedOnError -referenceInfo -info:+discouraged"
+ " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
"",
- "----------\n" +
- "1. INFO in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 4)\n" +
- " A a;\n" +
- " ^\n" +
- "Discouraged access: The type \'A\' is not API (restriction on classpath entry \'---LIB_DIR_PLACEHOLDER---/lib3.jar\')\n" +
- "----------\n" +
+ "----------\n" +
+ "1. INFO in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 4)\n" +
+ " A a;\n" +
+ " ^\n" +
+ "Discouraged access: The type \'A\' is not API (restriction on classpath entry \'---LIB_DIR_PLACEHOLDER---/lib3.jar\')\n" +
+ "----------\n" +
"1 problem (1 info)\n",
true);
}
@@ -13088,36 +13088,36 @@ public void test496137d(){
public void test496137e() throws IOException {
createOutputTestDirectory("regression/.settings");
Util.createFile(OUTPUT_DIR+"/.settings/org.eclipse.jdt.core.prefs",
- "eclipse.preferences.version=1\n" +
+ "eclipse.preferences.version=1\n" +
"org.eclipse.jdt.core.compiler.problem.unusedParameter=info\n" +
"org.eclipse.jdt.core.compiler.doc.comment.support=disabled\n");
this.runTest(
true, // compile OK, expecting only warning
new String[] {
"bugs/warning/ShowBug.java",
- "package bugs.warning;\n" +
- "\n" +
- "public class ShowBug {\n" +
- " /**\n" +
- " * \n" +
- " * @param unusedParam\n" +
- " */\n" +
- " public void foo(Object unusedParam) {\n" +
- " \n" +
- " }\n" +
+ "package bugs.warning;\n" +
+ "\n" +
+ "public class ShowBug {\n" +
+ " /**\n" +
+ " * \n" +
+ " * @param unusedParam\n" +
+ " */\n" +
+ " public void foo(Object unusedParam) {\n" +
+ " \n" +
+ " }\n" +
"}\n"
},
"\"" + OUTPUT_DIR + File.separator + "bugs" + File.separator + "warning" + File.separator + "ShowBug.java\""
+ " -1.5"
+ " -properties " + OUTPUT_DIR + File.separator +".settings" + File.separator + "org.eclipse.jdt.core.prefs "
+ " -d \"" + OUTPUT_DIR + "\"",
- "",
- "----------\n" +
- "1. INFO in ---OUTPUT_DIR_PLACEHOLDER---/bugs/warning/ShowBug.java (at line 8)\n" +
- " public void foo(Object unusedParam) {\n" +
- " ^^^^^^^^^^^\n" +
- "The value of the parameter unusedParam is not used\n" +
- "----------\n" +
+ "",
+ "----------\n" +
+ "1. INFO in ---OUTPUT_DIR_PLACEHOLDER---/bugs/warning/ShowBug.java (at line 8)\n" +
+ " public void foo(Object unusedParam) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The value of the parameter unusedParam is not used\n" +
+ "----------\n" +
"1 problem (1 info)\n",
false /*don't flush output dir*/,
null /* progress */);
@@ -13168,12 +13168,12 @@ public void testReleaseOption() throws Exception {
public void testBug531579() throws Exception {
if (!isJRE9Plus) return;
- // these types replace inaccessible types from JRE/javax.xml.bind:
+ // these types replace inaccessible types from JRE/javax.xml.bind:
runConformTest(new String[] {
"src/javax/xml/bind/JAXBContext.java",
"package javax.xml.bind;\n" +
- "public abstract class JAXBContext {\n" +
- " public static JAXBContext newInstance( String contextPath )\n" +
+ "public abstract class JAXBContext {\n" +
+ " public static JAXBContext newInstance( String contextPath )\n" +
" throws JAXBException {\n" +
" return null;\n" +
" }\n" +
@@ -13191,21 +13191,21 @@ public void testBug531579() throws Exception {
"",
"",
true);
-
+
runConformTest(new String[] {
- "src/p1/ImportJAXBType.java",
- "package p1;\n" +
- "\n" +
- "import javax.xml.bind.JAXBContext;\n" +
- "\n" +
- "public class ImportJAXBType {\n" +
- "\n" +
- " public static void main(String[] args) throws Exception {\n" +
- " JAXBContext context = JAXBContext.newInstance(\"\");\n" +
- " }\n" +
- "\n" +
+ "src/p1/ImportJAXBType.java",
+ "package p1;\n" +
+ "\n" +
+ "import javax.xml.bind.JAXBContext;\n" +
+ "\n" +
+ "public class ImportJAXBType {\n" +
+ "\n" +
+ " public static void main(String[] args) throws Exception {\n" +
+ " JAXBContext context = JAXBContext.newInstance(\"\");\n" +
+ " }\n" +
+ "\n" +
"}\n"
- },
+ },
"\"" + OUTPUT_DIR + File.separator + "src/p1/ImportJAXBType.java\""
+ " -cp \"" + OUTPUT_DIR + File.separator + "bin\" "
+ " -sourcepath \"" + OUTPUT_DIR + File.separator + "src\""
@@ -13231,7 +13231,7 @@ public void testFailOnWarnings_NoWarning() {
"",
"",
true);
-
+
}
public void testFailOnWarnings_WithWarning() {
@@ -13240,21 +13240,21 @@ public void testFailOnWarnings_WithWarning() {
"X.java",
"/** */\n" +
"public class X {\n" +
- "private int a;\n" +
+ "private int a;\n" +
"}",
},
"\"" + OUTPUT_DIR + File.separator + "X.java\""
+ " -failOnWarning"
+ " -d \"" + OUTPUT_DIR + File.separator + "bin/\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
- " private int a;\n" +
- " ^\n" +
- "The value of the field X.a is not used\n" +
- "----------\n" +
- "1 problem (1 warning)\n" +
- "error: warnings found and -failOnWarning specified\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
+ " private int a;\n" +
+ " ^\n" +
+ "The value of the field X.a is not used\n" +
+ "----------\n" +
+ "1 problem (1 warning)\n" +
+ "error: warnings found and -failOnWarning specified\n" +
"",
true);
}
@@ -13272,12 +13272,12 @@ public void testUnusedObjectAllocation() {
+ " -err:+unused"
+ " -d \"" + OUTPUT_DIR + File.separator + "bin/\"",
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
- " new X();\n" +
- " ^^^^^^^\n" +
- "The allocated object is never used\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
+ " new X();\n" +
+ " ^^^^^^^\n" +
+ "The allocated object is never used\n" +
+ "----------\n" +
"1 problem (1 error)\n",
true);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest2.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest2.java
index 8d21da270..e5c872eb4 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest2.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest2.java
@@ -25,7 +25,7 @@ public class BatchCompilerTest2 extends AbstractBatchCompilerTest {
// TESTS_NUMBERS = new int[] { 306 };
// TESTS_RANGE = new int[] { 298, -1 };
}
-
+
/**
* This test suite only needs to be run on one compliance.
* As it includes some specific 1.5 tests, it must be used with a least a 1.5 VM
@@ -87,10 +87,10 @@ public void test002() throws Exception {
+ " -11 --enable-preview",
"",
"----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 11)\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 11)\n" +
" Zork z;\n" +
" ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n" +
"1 problem (1 error)\n",
true);
@@ -112,12 +112,12 @@ public void test003() {
"\"" + OUTPUT_DIR + File.separator + "X.java\""
+ " -11 --enable-preview",
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
- " I lam = (Integer x, var y) -> {System.out.println(\"SUCCESS \" + x);};\n" +
- " ^\n" +
- "\'var\' cannot be mixed with non-var parameters\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
+ " I lam = (Integer x, var y) -> {System.out.println(\"SUCCESS \" + x);};\n" +
+ " ^\n" +
+ "\'var\' cannot be mixed with non-var parameters\n" +
+ "----------\n" +
"1 problem (1 error)\n",
true);
}
@@ -200,24 +200,24 @@ public void testBug540123a() throws Exception {
this.runConformTest(
new String[] {
"SecurePrefs.java",
- "public class SecurePrefs {\n" +
- " public SecurePrefs node (String s) {\n" +
- " System.out.println(s);\n" +
- " return null;\n" +
- " }\n" +
+ "public class SecurePrefs {\n" +
+ " public SecurePrefs node (String s) {\n" +
+ " System.out.println(s);\n" +
+ " return null;\n" +
+ " }\n" +
"}",
"SecurePrefsRoot.java",
- "public class SecurePrefsRoot extends SecurePrefs {\n" +
- "\n" +
- " public void foo() {\n" +
- " SecurePrefs node = node(\"Hello\");\n" +
- " if (node != null)\n" +
- " System.out.println(node.toString());\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " new SecurePrefsRoot().foo();\n" +
- " }\n" +
+ "public class SecurePrefsRoot extends SecurePrefs {\n" +
+ "\n" +
+ " public void foo() {\n" +
+ " SecurePrefs node = node(\"Hello\");\n" +
+ " if (node != null)\n" +
+ " System.out.println(node.toString());\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " new SecurePrefsRoot().foo();\n" +
+ " }\n" +
"}"
},
"\"" + OUTPUT_DIR + File.separator + "SecurePrefsRoot.java\""
@@ -233,24 +233,24 @@ public void testBug540123b() throws Exception {
this.runConformTest(
new String[] {
"SecurePrefs.java",
- "public class SecurePrefs {\n" +
- " public SecurePrefs node (String s) {\n" +
- " System.out.println(s);\n" +
- " return null;\n" +
- " }\n" +
+ "public class SecurePrefs {\n" +
+ " public SecurePrefs node (String s) {\n" +
+ " System.out.println(s);\n" +
+ " return null;\n" +
+ " }\n" +
"}",
"SecurePrefsRoot.java",
- "public class SecurePrefsRoot extends SecurePrefs {\n" +
- "\n" +
- " public void foo() {\n" +
- " SecurePrefs node = node(\"Hello\");\n" +
- " if (node != null)\n" +
- " System.out.println(node.toString());\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " new SecurePrefsRoot().foo();\n" +
- " }\n" +
+ "public class SecurePrefsRoot extends SecurePrefs {\n" +
+ "\n" +
+ " public void foo() {\n" +
+ " SecurePrefs node = node(\"Hello\");\n" +
+ " if (node != null)\n" +
+ " System.out.println(node.toString());\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " new SecurePrefsRoot().foo();\n" +
+ " }\n" +
"}"
},
"\"" + OUTPUT_DIR + File.separator + "SecurePrefsRoot.java\""
@@ -266,24 +266,24 @@ public void testBug540123c() throws Exception {
this.runConformTest(
new String[] {
"SecurePrefs.java",
- "public class SecurePrefs {\n" +
- " public SecurePrefs node (String s) {\n" +
- " System.out.println(s);\n" +
- " return null;\n" +
- " }\n" +
+ "public class SecurePrefs {\n" +
+ " public SecurePrefs node (String s) {\n" +
+ " System.out.println(s);\n" +
+ " return null;\n" +
+ " }\n" +
"}",
"SecurePrefsRoot.java",
- "public class SecurePrefsRoot extends SecurePrefs {\n" +
- "\n" +
- " public void foo() {\n" +
- " SecurePrefs node = node(\"Hello\");\n" +
- " if (node != null)\n" +
- " System.out.println(node.toString());\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " new SecurePrefsRoot().foo();\n" +
- " }\n" +
+ "public class SecurePrefsRoot extends SecurePrefs {\n" +
+ "\n" +
+ " public void foo() {\n" +
+ " SecurePrefs node = node(\"Hello\");\n" +
+ " if (node != null)\n" +
+ " System.out.println(node.toString());\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " new SecurePrefsRoot().foo();\n" +
+ " }\n" +
"}"
},
"\"" + OUTPUT_DIR + File.separator + "SecurePrefsRoot.java\""
@@ -299,24 +299,24 @@ public void testBug540123d() throws Exception {
this.runConformTest(
new String[] {
"SecurePrefs.java",
- "public class SecurePrefs {\n" +
- " public SecurePrefs node (String s) {\n" +
- " System.out.println(s);\n" +
- " return null;\n" +
- " }\n" +
+ "public class SecurePrefs {\n" +
+ " public SecurePrefs node (String s) {\n" +
+ " System.out.println(s);\n" +
+ " return null;\n" +
+ " }\n" +
"}",
"SecurePrefsRoot.java",
- "public class SecurePrefsRoot extends SecurePrefs {\n" +
- "\n" +
- " public void foo() {\n" +
- " SecurePrefs node = node(\"Hello\");\n" +
- " if (node != null)\n" +
- " System.out.println(node.toString());\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " new SecurePrefsRoot().foo();\n" +
- " }\n" +
+ "public class SecurePrefsRoot extends SecurePrefs {\n" +
+ "\n" +
+ " public void foo() {\n" +
+ " SecurePrefs node = node(\"Hello\");\n" +
+ " if (node != null)\n" +
+ " System.out.println(node.toString());\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " new SecurePrefsRoot().foo();\n" +
+ " }\n" +
"}"
},
"\"" + OUTPUT_DIR + File.separator + "SecurePrefsRoot.java\""
@@ -332,24 +332,24 @@ public void testBug540123e() throws Exception {
this.runConformTest(
new String[] {
"SecurePrefs.java",
- "public class SecurePrefs {\n" +
- " public SecurePrefs node (String s) {\n" +
- " System.out.println(s);\n" +
- " return null;\n" +
- " }\n" +
+ "public class SecurePrefs {\n" +
+ " public SecurePrefs node (String s) {\n" +
+ " System.out.println(s);\n" +
+ " return null;\n" +
+ " }\n" +
"}",
"SecurePrefsRoot.java",
- "public class SecurePrefsRoot extends SecurePrefs {\n" +
- "\n" +
- " public void foo() {\n" +
- " SecurePrefs node = node(\"Hello\");\n" +
- " if (node != null)\n" +
- " System.out.println(node.toString());\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " new SecurePrefsRoot().foo();\n" +
- " }\n" +
+ "public class SecurePrefsRoot extends SecurePrefs {\n" +
+ "\n" +
+ " public void foo() {\n" +
+ " SecurePrefs node = node(\"Hello\");\n" +
+ " if (node != null)\n" +
+ " System.out.println(node.toString());\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " new SecurePrefsRoot().foo();\n" +
+ " }\n" +
"}"
},
"\"" + OUTPUT_DIR + File.separator + "SecurePrefsRoot.java\""
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BinaryLiteralTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BinaryLiteralTest.java
index b5ee00f69..954bfd9b6 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BinaryLiteralTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BinaryLiteralTest.java
@@ -54,11 +54,11 @@ public class BinaryLiteralTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(0b);\n" +
- " ^^\n" +
- "Invalid binary literal number (only \'0\' and \'1\' are expected)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(0b);\n" +
+ " ^^\n" +
+ "Invalid binary literal number (only \'0\' and \'1\' are expected)\n" +
"----------\n");
}
public void test003() {
@@ -71,11 +71,11 @@ public class BinaryLiteralTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(0b2);\n" +
- " ^^\n" +
- "Invalid binary literal number (only \'0\' and \'1\' are expected)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(0b2);\n" +
+ " ^^\n" +
+ "Invalid binary literal number (only \'0\' and \'1\' are expected)\n" +
"----------\n");
}
public void test004() {
@@ -92,11 +92,11 @@ public class BinaryLiteralTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(0b1110000);\n" +
- " ^^^^^^^^^\n" +
- "Binary literals can only be used with source level 1.7 or greater\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(0b1110000);\n" +
+ " ^^^^^^^^^\n" +
+ "Binary literals can only be used with source level 1.7 or greater\n" +
"----------\n",
null,
true,
@@ -116,11 +116,11 @@ public class BinaryLiteralTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(-0b1110000);\n" +
- " ^^^^^^^^^\n" +
- "Binary literals can only be used with source level 1.7 or greater\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(-0b1110000);\n" +
+ " ^^^^^^^^^\n" +
+ "Binary literals can only be used with source level 1.7 or greater\n" +
"----------\n",
null,
true,
@@ -140,11 +140,11 @@ public class BinaryLiteralTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(0b1113000);\n" +
- " ^^^^^\n" +
- "Binary literals can only be used with source level 1.7 or greater\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(0b1113000);\n" +
+ " ^^^^^\n" +
+ "Binary literals can only be used with source level 1.7 or greater\n" +
"----------\n",
null,
true,
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BootstrapMethodAttributeTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BootstrapMethodAttributeTest.java
index 07b44ee6a..c4bd218e5 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BootstrapMethodAttributeTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BootstrapMethodAttributeTest.java
@@ -54,17 +54,17 @@ public class BootstrapMethodAttributeTest extends AbstractRegressionTest {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- "// (version 1.2 : 46.0, no super bit)\n" +
- "public class test.G {\n" +
- " \n" +
- " // Method descriptor #2 ()V\n" +
- " // Stack: 0, Locals: 0\n" +
- " public static void call();\n" +
- " 0 invokedynamic 0 dyn() : void [18]\n" +
- " 5 return\n" +
- "\n" +
- "Bootstrap methods:\n" +
- " 0 : # 17 arguments: {#1}\n" +
+ "// (version 1.2 : 46.0, no super bit)\n" +
+ "public class test.G {\n" +
+ " \n" +
+ " // Method descriptor #2 ()V\n" +
+ " // Stack: 0, Locals: 0\n" +
+ " public static void call();\n" +
+ " 0 invokedynamic 0 dyn() : void [18]\n" +
+ " 5 return\n" +
+ "\n" +
+ "Bootstrap methods:\n" +
+ " 0 : # 17 arguments: {#1}\n" +
"}";
int index = actualOutput.indexOf(expectedOutput);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java
index 0eb6a2810..43400dd48 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java
@@ -10,7 +10,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Stephan Herrmann - Contributions for
+ * Stephan Herrmann - Contributions for
* Bug 428274 - [1.8] [compiler] Cannot cast from Number to double
*******************************************************************************/
package org.eclipse.jdt.core.tests.compiler.regression;
@@ -1721,13 +1721,13 @@ public void test045() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(castLongToInt(3));\n" +
- " }\n" +
- " private static int castLongToInt(long longVal) {\n" +
- " return (int)((long)longVal);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(castLongToInt(3));\n" +
+ " }\n" +
+ " private static int castLongToInt(long longVal) {\n" +
+ " return (int)((long)longVal);\n" +
+ " }\n" +
"}\n",
},
"3");
@@ -1738,19 +1738,19 @@ public void test046() {
true,
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " char a = 65;\n" +
- " String b = \"\" + a; // -> \"A\"\n" +
- " String c = \"\" + (int) a;\n" +
- " System.out.print(b);\n" +
- " System.out.print(c);\n" +
- " \n" +
- " String logText = \" second case \";\n" +
- " char firstChar = 65;\n" +
- " logText += (int) firstChar;\n" +
- " System.out.println(logText);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " char a = 65;\n" +
+ " String b = \"\" + a; // -> \"A\"\n" +
+ " String c = \"\" + (int) a;\n" +
+ " System.out.print(b);\n" +
+ " System.out.print(c);\n" +
+ " \n" +
+ " String logText = \" second case \";\n" +
+ " char firstChar = 65;\n" +
+ " logText += (int) firstChar;\n" +
+ " System.out.println(logText);\n" +
+ " }\n" +
"}",
},
"",
@@ -1817,11 +1817,11 @@ public void test048() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in A.java (at line 7)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 7)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n"
);
}
@@ -1848,11 +1848,11 @@ public void test049() {
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in A.java (at line 3)\n" +
- " Other<?>.Member m = (Other<?>.Member) om2;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from Other2<?>.Member2<capture#1-of ?> to Other<?>.Member\n" +
+ "----------\n" +
+ "1. WARNING in A.java (at line 3)\n" +
+ " Other<?>.Member m = (Other<?>.Member) om2;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unnecessary cast from Other2<?>.Member2<capture#1-of ?> to Other<?>.Member\n" +
"----------\n";
runner.javacTestOptions =
Excuse.EclipseHasSomeMoreWarnings; // javac is inconsistent: accepting both assignments, not issuing a warning though in simpler cases it does
@@ -1880,11 +1880,11 @@ public void test050() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in A.java (at line 7)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 7)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n"
);
}
@@ -1892,15 +1892,15 @@ public void test050() {
public void test051() {
CompilerOptions options = new CompilerOptions(getCompilerOptions());
String source =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Object x = foo();\n" +
- " boolean y = (boolean) x;\n" +
- " System.out.println(y);\n" +
- " }\n" +
- " public static Object foo() {\n" +
- " return Boolean.TRUE;\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " boolean y = (boolean) x;\n" +
+ " System.out.println(y);\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return Boolean.TRUE;\n" +
+ " }\n" +
"}";
if (options.sourceLevel < ClassFileConstants.JDK1_7) {
this.runNegativeTest(
@@ -1908,11 +1908,11 @@ public void test051() {
"X.java",
source
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " boolean y = (boolean) x;\n" +
- " ^^^^^^^^^^^\n" +
- "Cannot cast from Object to boolean\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " boolean y = (boolean) x;\n" +
+ " ^^^^^^^^^^^\n" +
+ "Cannot cast from Object to boolean\n" +
"----------\n"
);
} else {
@@ -1929,15 +1929,15 @@ public void test051() {
public void test052() {
CompilerOptions options = new CompilerOptions(getCompilerOptions());
String source =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Object x = foo();\n" +
- " byte y = (byte) x;\n" +
- " System.out.println(y);\n" +
- " }\n" +
- " public static Object foo() {\n" +
- " return Byte.valueOf((byte)1);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " byte y = (byte) x;\n" +
+ " System.out.println(y);\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return Byte.valueOf((byte)1);\n" +
+ " }\n" +
"}";
if (options.sourceLevel < ClassFileConstants.JDK1_7) {
this.runNegativeTest(
@@ -1945,11 +1945,11 @@ public void test052() {
"X.java",
source
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " byte y = (byte) x;\n" +
- " ^^^^^^^^\n" +
- "Cannot cast from Object to byte\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " byte y = (byte) x;\n" +
+ " ^^^^^^^^\n" +
+ "Cannot cast from Object to byte\n" +
"----------\n"
);
} else {
@@ -1966,15 +1966,15 @@ public void test052() {
public void test053() {
CompilerOptions options = new CompilerOptions(getCompilerOptions());
String source =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Object x = foo();\n" +
- " char y = (char) x;\n" +
- " System.out.println(y);\n" +
- " }\n" +
- " public static Object foo() {\n" +
- " return Character.valueOf('d');\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " char y = (char) x;\n" +
+ " System.out.println(y);\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return Character.valueOf('d');\n" +
+ " }\n" +
"}";
if (options.sourceLevel < ClassFileConstants.JDK1_7) {
this.runNegativeTest(
@@ -1982,11 +1982,11 @@ public void test053() {
"X.java",
source
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " char y = (char) x;\n" +
- " ^^^^^^^^\n" +
- "Cannot cast from Object to char\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " char y = (char) x;\n" +
+ " ^^^^^^^^\n" +
+ "Cannot cast from Object to char\n" +
"----------\n"
);
} else {
@@ -2004,15 +2004,15 @@ public void test053() {
public void test054() throws Exception {
CompilerOptions options = new CompilerOptions(getCompilerOptions());
String source =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Object x = foo();\n" +
- " int y = (int) x;\n" +
- " System.out.println(y);\n" +
- " }\n" +
- " public static Object foo() {\n" +
- " return Integer.valueOf(1);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " int y = (int) x;\n" +
+ " System.out.println(y);\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return Integer.valueOf(1);\n" +
+ " }\n" +
"}";
if (options.sourceLevel < ClassFileConstants.JDK1_7) {
this.runNegativeTest(
@@ -2020,11 +2020,11 @@ public void test054() throws Exception {
"X.java",
source
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " int y = (int) x;\n" +
- " ^^^^^^^\n" +
- "Cannot cast from Object to int\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " int y = (int) x;\n" +
+ " ^^^^^^^\n" +
+ "Cannot cast from Object to int\n" +
"----------\n"
);
} else {
@@ -2035,29 +2035,29 @@ public void test054() throws Exception {
},
"1"
);
- String expectedOutput =
- " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
- " // Stack: 2, Locals: 3\n" +
- " public static void main(java.lang.String[] args);\n" +
- " 0 invokestatic X.foo() : java.lang.Object [16]\n" +
- " 3 astore_1 [x]\n" +
- " 4 aload_1 [x]\n" +
- " 5 checkcast java.lang.Integer [20]\n" +
- " 8 invokevirtual java.lang.Integer.intValue() : int [22]\n" +
- " 11 istore_2 [y]\n" +
- " 12 getstatic java.lang.System.out : java.io.PrintStream [26]\n" +
- " 15 iload_2 [y]\n" +
- " 16 invokevirtual java.io.PrintStream.println(int) : void [32]\n" +
- " 19 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
- " [pc: 4, line: 4]\n" +
- " [pc: 12, line: 5]\n" +
- " [pc: 19, line: 6]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 20] local: args index: 0 type: java.lang.String[]\n" +
- " [pc: 4, pc: 20] local: x index: 1 type: java.lang.Object\n" +
- " [pc: 12, pc: 20] local: y index: 2 type: int\n" +
+ String expectedOutput =
+ " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
+ " // Stack: 2, Locals: 3\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 invokestatic X.foo() : java.lang.Object [16]\n" +
+ " 3 astore_1 [x]\n" +
+ " 4 aload_1 [x]\n" +
+ " 5 checkcast java.lang.Integer [20]\n" +
+ " 8 invokevirtual java.lang.Integer.intValue() : int [22]\n" +
+ " 11 istore_2 [y]\n" +
+ " 12 getstatic java.lang.System.out : java.io.PrintStream [26]\n" +
+ " 15 iload_2 [y]\n" +
+ " 16 invokevirtual java.io.PrintStream.println(int) : void [32]\n" +
+ " 19 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
+ " [pc: 4, line: 4]\n" +
+ " [pc: 12, line: 5]\n" +
+ " [pc: 19, line: 6]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 20] local: args index: 0 type: java.lang.String[]\n" +
+ " [pc: 4, pc: 20] local: x index: 1 type: java.lang.Object\n" +
+ " [pc: 12, pc: 20] local: y index: 2 type: int\n" +
" \n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
@@ -2076,15 +2076,15 @@ public void test054() throws Exception {
public void test055() {
CompilerOptions options = new CompilerOptions(getCompilerOptions());
String source =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Object x = foo();\n" +
- " long y = (long) x;\n" +
- " System.out.println(y);\n" +
- " }\n" +
- " public static Object foo() {\n" +
- " return Long.valueOf(Long.MAX_VALUE);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " long y = (long) x;\n" +
+ " System.out.println(y);\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return Long.valueOf(Long.MAX_VALUE);\n" +
+ " }\n" +
"}";
if (options.sourceLevel < ClassFileConstants.JDK1_7) {
this.runNegativeTest(
@@ -2092,11 +2092,11 @@ public void test055() {
"X.java",
source
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " long y = (long) x;\n" +
- " ^^^^^^^^\n" +
- "Cannot cast from Object to long\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " long y = (long) x;\n" +
+ " ^^^^^^^^\n" +
+ "Cannot cast from Object to long\n" +
"----------\n"
);
} else {
@@ -2113,15 +2113,15 @@ public void test055() {
public void test056() {
CompilerOptions options = new CompilerOptions(getCompilerOptions());
String source =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Object x = foo();\n" +
- " short y = (short) x;\n" +
- " System.out.println(y);\n" +
- " }\n" +
- " public static Object foo() {\n" +
- " return Short.valueOf((short) 1);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " short y = (short) x;\n" +
+ " System.out.println(y);\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return Short.valueOf((short) 1);\n" +
+ " }\n" +
"}";
if (options.sourceLevel < ClassFileConstants.JDK1_7) {
this.runNegativeTest(
@@ -2129,11 +2129,11 @@ public void test056() {
"X.java",
source
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " short y = (short) x;\n" +
- " ^^^^^^^^^\n" +
- "Cannot cast from Object to short\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " short y = (short) x;\n" +
+ " ^^^^^^^^^\n" +
+ "Cannot cast from Object to short\n" +
"----------\n"
);
} else {
@@ -2150,15 +2150,15 @@ public void test056() {
public void test057() {
CompilerOptions options = new CompilerOptions(getCompilerOptions());
String source =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Object x = foo();\n" +
- " double y = (double) x;\n" +
- " System.out.println(y);\n" +
- " }\n" +
- " public static Object foo() {\n" +
- " return Double.valueOf(1.0);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " double y = (double) x;\n" +
+ " System.out.println(y);\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return Double.valueOf(1.0);\n" +
+ " }\n" +
"}";
if (options.sourceLevel < ClassFileConstants.JDK1_7) {
this.runNegativeTest(
@@ -2166,11 +2166,11 @@ public void test057() {
"X.java",
source
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " double y = (double) x;\n" +
- " ^^^^^^^^^^\n" +
- "Cannot cast from Object to double\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " double y = (double) x;\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot cast from Object to double\n" +
"----------\n"
);
} else {
@@ -2187,15 +2187,15 @@ public void test057() {
public void test058() {
CompilerOptions options = new CompilerOptions(getCompilerOptions());
String source =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Object x = foo();\n" +
- " float y = (float) x;\n" +
- " System.out.println(y);\n" +
- " }\n" +
- " public static Object foo() {\n" +
- " return Float.valueOf(1.0f);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " float y = (float) x;\n" +
+ " System.out.println(y);\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return Float.valueOf(1.0f);\n" +
+ " }\n" +
"}";
if (options.sourceLevel < ClassFileConstants.JDK1_7) {
this.runNegativeTest(
@@ -2203,11 +2203,11 @@ public void test058() {
"X.java",
source
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " float y = (float) x;\n" +
- " ^^^^^^^^^\n" +
- "Cannot cast from Object to float\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " float y = (float) x;\n" +
+ " ^^^^^^^^^\n" +
+ "Cannot cast from Object to float\n" +
"----------\n"
);
} else {
@@ -2224,20 +2224,20 @@ public void test058() {
public void test059() {
CompilerOptions options = new CompilerOptions(getCompilerOptions());
String source =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
" Object x = foo();\n" +
- " try {\n" +
+ " try {\n" +
" int y = (int) x;\n" +
" } catch (ClassCastException e) {\n" +
" System.out.println(\"SUCCESS\");\n" +
" return;\n" +
- " }\n" +
- " System.out.println(\"FAIL\");\n" +
- " }\n" +
- " public static Object foo() {\n" +
- " return Float.valueOf(1.0f);\n" +
- " }\n" +
+ " }\n" +
+ " System.out.println(\"FAIL\");\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return Float.valueOf(1.0f);\n" +
+ " }\n" +
"}";
if (options.sourceLevel < ClassFileConstants.JDK1_7) {
this.runNegativeTest(
@@ -2245,11 +2245,11 @@ public void test059() {
"X.java",
source
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " int y = (int) x;\n" +
- " ^^^^^^^\n" +
- "Cannot cast from Object to int\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " int y = (int) x;\n" +
+ " ^^^^^^^\n" +
+ "Cannot cast from Object to int\n" +
"----------\n"
);
} else {
@@ -2266,20 +2266,20 @@ public void test059() {
public void test059b() {
CompilerOptions options = new CompilerOptions(getCompilerOptions());
String source =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Object x = foo();\n" +
- " try {\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " try {\n" +
" int y = (int) x;\n" +
" } catch (ClassCastException e) {\n" +
" System.out.println(\"SUCCESS\");\n" +
" return;\n" +
- " }\n" +
+ " }\n" +
" System.out.println(\"FAIL\");\n" +
- " }\n" +
- " public static Object foo() {\n" +
- " return Boolean.TRUE;\n" +
- " }\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return Boolean.TRUE;\n" +
+ " }\n" +
"}";
if (options.sourceLevel < ClassFileConstants.JDK1_7) {
this.runNegativeTest(
@@ -2287,11 +2287,11 @@ public void test059b() {
"X.java",
source
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " int y = (int) x;\n" +
- " ^^^^^^^\n" +
- "Cannot cast from Object to int\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " int y = (int) x;\n" +
+ " ^^^^^^^\n" +
+ "Cannot cast from Object to int\n" +
"----------\n"
);
} else {
@@ -2308,20 +2308,20 @@ public void test059b() {
public void test059c() {
CompilerOptions options = new CompilerOptions(getCompilerOptions());
String source =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Object x = foo();\n" +
- " try {\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " try {\n" +
" char y = (char) x;\n" +
" } catch (ClassCastException e) {\n" +
" System.out.println(\"SUCCESS\");\n" +
" return;\n" +
- " }\n" +
+ " }\n" +
" System.out.println(\"FAIL\");\n" +
- " }\n" +
- " public static Object foo() {\n" +
- " return Boolean.TRUE;\n" +
- " }\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return Boolean.TRUE;\n" +
+ " }\n" +
"}";
if (options.sourceLevel < ClassFileConstants.JDK1_7) {
this.runNegativeTest(
@@ -2329,11 +2329,11 @@ public void test059c() {
"X.java",
source
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " char y = (char) x;\n" +
- " ^^^^^^^^\n" +
- "Cannot cast from Object to char\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " char y = (char) x;\n" +
+ " ^^^^^^^^\n" +
+ "Cannot cast from Object to char\n" +
"----------\n"
);
} else {
@@ -2349,15 +2349,15 @@ public void test059c() {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=353085
public void test060() {
String source =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Object x = foo();\n" +
- " Boolean y = (Boolean) x;\n" +
- " System.out.println(y);\n" +
- " }\n" +
- " public static Object foo() {\n" +
- " return Boolean.TRUE;\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " Boolean y = (Boolean) x;\n" +
+ " System.out.println(y);\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return Boolean.TRUE;\n" +
+ " }\n" +
"}";
this.runConformTest(
new String[] {
@@ -2370,20 +2370,20 @@ public void test060() {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=353085
public void test061() {
String source =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Object x = foo();\n" +
- " try {\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " try {\n" +
" Float y = (Float) x;\n" +
" } catch (ClassCastException e) {\n" +
" System.out.println(\"SUCCESS\");\n" +
" return;\n" +
- " }\n" +
+ " }\n" +
" System.out.println(\"FAIL\");\n" +
- " }\n" +
- " public static Object foo() {\n" +
- " return Boolean.TRUE;\n" +
- " }\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return Boolean.TRUE;\n" +
+ " }\n" +
"}";
this.runConformTest(
new String[] {
@@ -2409,24 +2409,24 @@ public void test061b() throws Exception {
},
""
);
- String expectedOutput =
- "public class X {\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 1, Locals: 2\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [8]\n" +
- " 4 aconst_null\n" +
- " 5 checkcast java.lang.Object[] [10]\n" +
- " 8 astore_1 [x]\n" +
- " 9 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 2]\n" +
- " [pc: 4, line: 3]\n" +
- " [pc: 9, line: 4]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 10] local: this index: 0 type: X\n" +
+ String expectedOutput =
+ "public class X {\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 1, Locals: 2\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [8]\n" +
+ " 4 aconst_null\n" +
+ " 5 checkcast java.lang.Object[] [10]\n" +
+ " 8 astore_1 [x]\n" +
+ " 9 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 2]\n" +
+ " [pc: 4, line: 3]\n" +
+ " [pc: 9, line: 4]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 10] local: this index: 0 type: X\n" +
" [pc: 9, pc: 10] local: x index: 1 type: java.lang.Object[]\n" +
"}";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -2460,16 +2460,16 @@ public void test420283() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " Integer i = (Integer & Serializable) l.get(0);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from Integer to Integer & Serializable\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " Integer i = (Integer & Serializable) l.get(0);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Additional bounds are not allowed in cast operator at source levels below 1.8\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " Integer i = (Integer & Serializable) l.get(0);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unnecessary cast from Integer to Integer & Serializable\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " Integer i = (Integer & Serializable) l.get(0);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Additional bounds are not allowed in cast operator at source levels below 1.8\n" +
"----------\n");
return;
}
@@ -2492,16 +2492,16 @@ public void test420283() {
}
public void testBug428274() {
- String source =
- "public class Junk4 {\n" +
- " static void setValue(Number n) {\n" +
+ String source =
+ "public class Junk4 {\n" +
+ " static void setValue(Number n) {\n" +
" int rounded = (int) Math.round((double) n);\n" +
- " System.out.println(rounded);\n" +
+ " System.out.println(rounded);\n" +
" }\n" +
" public static void main(String[] args) {\n" +
" setValue(Double.valueOf(3.3));\n" +
" setValue(Double.valueOf(3.7));\n" +
- " }\n" +
+ " }\n" +
"}\n";
if (this.complianceLevel < ClassFileConstants.JDK1_7) {
runNegativeTest(
@@ -2509,11 +2509,11 @@ public void testBug428274() {
"Junk4.java",
source
},
- "----------\n" +
- "1. ERROR in Junk4.java (at line 3)\n" +
- " int rounded = (int) Math.round((double) n);\n" +
- " ^^^^^^^^^^\n" +
- "Cannot cast from Number to double\n" +
+ "----------\n" +
+ "1. ERROR in Junk4.java (at line 3)\n" +
+ " int rounded = (int) Math.round((double) n);\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot cast from Number to double\n" +
"----------\n");
} else {
runConformTest(
@@ -2530,25 +2530,25 @@ public void testBug428274b() {
Runner runner = new Runner();
runner.testFiles = new String[] {
"Junk4.java",
- "public class Junk4<T> {\n" +
- " void setValue(T n) {\n" +
+ "public class Junk4<T> {\n" +
+ " void setValue(T n) {\n" +
" int rounded = (int) Math.round((double) n);\n" +
- " System.out.println(rounded);\n" +
+ " System.out.println(rounded);\n" +
" }\n" +
" public static void main(String[] args) {\n" +
" Junk4<Number> j = new Junk4<Number>();\n" +
" j.setValue(Double.valueOf(3.3));\n" +
" j.setValue(Double.valueOf(3.7));\n" +
- " }\n" +
+ " }\n" +
"}\n"
};
if (this.complianceLevel < ClassFileConstants.JDK1_7) {
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in Junk4.java (at line 3)\n" +
- " int rounded = (int) Math.round((double) n);\n" +
- " ^^^^^^^^^^\n" +
- "Cannot cast from T to double\n" +
+ "----------\n" +
+ "1. ERROR in Junk4.java (at line 3)\n" +
+ " int rounded = (int) Math.round((double) n);\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot cast from T to double\n" +
"----------\n";
runner.runNegativeTest();
} else {
@@ -2560,26 +2560,26 @@ public void testBug428274b() {
}
// note: spec allows all reference types, but neither javac nor common sense accept arrays :)
public void testBug428274c() {
- String source =
- "public class Junk4 {\n" +
- " static void setValue(Object[] n) {\n" +
+ String source =
+ "public class Junk4 {\n" +
+ " static void setValue(Object[] n) {\n" +
" int rounded = (int) Math.round((double) n);\n" +
- " System.out.println(rounded);\n" +
+ " System.out.println(rounded);\n" +
" }\n" +
" public static void main(String[] args) {\n" +
" setValue(new Double[] { Double.valueOf(3.3) });\n" +
- " }\n" +
+ " }\n" +
"}\n";
runNegativeTest(
new String[] {
"Junk4.java",
source
},
- "----------\n" +
- "1. ERROR in Junk4.java (at line 3)\n" +
- " int rounded = (int) Math.round((double) n);\n" +
- " ^^^^^^^^^^\n" +
- "Cannot cast from Object[] to double\n" +
+ "----------\n" +
+ "1. ERROR in Junk4.java (at line 3)\n" +
+ " int rounded = (int) Math.round((double) n);\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot cast from Object[] to double\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428388, [1.8][compiler] Casting to primitives is over tolerant - probable regression since bug 428274
@@ -2593,30 +2593,30 @@ public void test428388() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " int x = (int) \"Hello\";\n" +
- " ^^^^^^^^^^^^^\n" +
- "Cannot cast from String to int\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " int x = (int) \"Hello\";\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Cannot cast from String to int\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428388, [1.8][compiler] Casting to primitives is over tolerant - probable regression since bug 428274
public void test428388a() throws Exception {
if (this.complianceLevel < ClassFileConstants.JDK1_7)
return;
-
+
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " static void setValue(Number n) {\n" +
+ "public class X {\n" +
+ " static void setValue(Number n) {\n" +
" int rounded = (int) Math.round((double) n);\n" +
- " System.out.println(rounded);\n" +
+ " System.out.println(rounded);\n" +
" }\n" +
" public static void main(String[] args) {\n" +
" setValue(Double.valueOf(3.3));\n" +
" setValue(Double.valueOf(3.7));\n" +
- " }\n" +
+ " }\n" +
"}\n",
},
"3\n4");
@@ -2630,26 +2630,26 @@ public void test428388a() throws Exception {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " // Method descriptor #15 (Ljava/lang/Number;)V\n" +
- " // Stack: 2, Locals: 2\n" +
- " static void setValue(java.lang.Number n);\n" +
- " 0 aload_0 [n]\n" +
- " 1 checkcast java.lang.Double [16]\n" +
- " 4 invokevirtual java.lang.Double.doubleValue() : double [18]\n" +
- " 7 invokestatic java.lang.Math.round(double) : long [22]\n" +
- " 10 l2i\n" +
- " 11 istore_1 [rounded]\n" +
- " 12 getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
- " 15 iload_1 [rounded]\n" +
- " 16 invokevirtual java.io.PrintStream.println(int) : void [34]\n" +
- " 19 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
- " [pc: 12, line: 4]\n" +
- " [pc: 19, line: 5]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 20] local: n index: 0 type: java.lang.Number\n" +
- " [pc: 12, pc: 20] local: rounded index: 1 type: int\n" +
+ " // Method descriptor #15 (Ljava/lang/Number;)V\n" +
+ " // Stack: 2, Locals: 2\n" +
+ " static void setValue(java.lang.Number n);\n" +
+ " 0 aload_0 [n]\n" +
+ " 1 checkcast java.lang.Double [16]\n" +
+ " 4 invokevirtual java.lang.Double.doubleValue() : double [18]\n" +
+ " 7 invokestatic java.lang.Math.round(double) : long [22]\n" +
+ " 10 l2i\n" +
+ " 11 istore_1 [rounded]\n" +
+ " 12 getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
+ " 15 iload_1 [rounded]\n" +
+ " 16 invokevirtual java.io.PrintStream.println(int) : void [34]\n" +
+ " 19 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
+ " [pc: 12, line: 4]\n" +
+ " [pc: 19, line: 5]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 20] local: n index: 0 type: java.lang.Number\n" +
+ " [pc: 12, pc: 20] local: rounded index: 1 type: int\n" +
" \n";
int index = actualOutput.indexOf(expectedOutput);
if (index == -1 || expectedOutput.length() == 0) {
@@ -2664,22 +2664,22 @@ public void test428388b() throws Exception {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " static void setValue(Number n) {\n" +
+ "public class X {\n" +
+ " static void setValue(Number n) {\n" +
" char rounded = (char) n;\n" +
- " System.out.println(rounded);\n" +
+ " System.out.println(rounded);\n" +
" }\n" +
" public static void main(String[] args) {\n" +
" setValue(Double.valueOf(3.3));\n" +
" setValue(Double.valueOf(3.7));\n" +
- " }\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " char rounded = (char) n;\n" +
- " ^^^^^^^^\n" +
- "Cannot cast from Number to char\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " char rounded = (char) n;\n" +
+ " ^^^^^^^^\n" +
+ "Cannot cast from Number to char\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428388, [1.8][compiler] Casting to primitives is over tolerant - probable regression since bug 428274
@@ -2689,9 +2689,9 @@ public void test428388c() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " static void setValue(Number n) {\n" +
- " try {\n" +
+ "public class X {\n" +
+ " static void setValue(Number n) {\n" +
+ " try {\n" +
" byte rounded = (byte) n;\n" +
" System.out.println(rounded);\n" +
" } catch (ClassCastException c) {\n" +
@@ -2701,7 +2701,7 @@ public void test428388c() throws Exception {
" public static void main(String[] args) {\n" +
" setValue(Double.valueOf(3.3));\n" +
" setValue(Double.valueOf(3.7));\n" +
- " }\n" +
+ " }\n" +
"}\n",
},
"CCE\nCCE");
@@ -2800,21 +2800,21 @@ public void test428388g() throws Exception {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " public class X implements Serializable {\n" +
- " ^\n" +
- "The serializable class X does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " static <S extends Boolean & Serializable>int test(S b) {\n" +
- " ^^^^^^^\n" +
- "The type parameter S should not be bounded by the final type Boolean. Final types cannot be further extended\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " return (int) b;\n" +
- " ^^^^^^^\n" +
- "Cannot cast from S to int\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " public class X implements Serializable {\n" +
+ " ^\n" +
+ "The serializable class X does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " static <S extends Boolean & Serializable>int test(S b) {\n" +
+ " ^^^^^^^\n" +
+ "The type parameter S should not be bounded by the final type Boolean. Final types cannot be further extended\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " return (int) b;\n" +
+ " ^^^^^^^\n" +
+ "Cannot cast from S to int\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428388, [1.8][compiler] Casting to primitives is over tolerant - probable regression since bug 428274
@@ -2835,16 +2835,16 @@ public void test428388h() throws Exception {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " public class X implements Serializable {\n" +
- " ^\n" +
- "The serializable class X does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " return (int) (Boolean & Serializable) b;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot cast from Boolean & Serializable to int\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " public class X implements Serializable {\n" +
+ " ^\n" +
+ "The serializable class X does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " return (int) (Boolean & Serializable) b;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot cast from Boolean & Serializable to int\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428388, [1.8][compiler] Casting to primitives is over tolerant - probable regression since bug 428274
@@ -2880,20 +2880,20 @@ public void test428388i() throws Exception {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " // Method descriptor #17 (Ljava/io/Serializable;)I\n" +
- " // Stack: 2, Locals: 2\n" +
- " static int test(java.io.Serializable v);\n" +
- " 0 aload_0 [v]\n" +
- " 1 checkcast java.lang.Integer [18]\n" +
- " 4 invokevirtual java.lang.Integer.intValue() : int [20]\n" +
- " 7 ireturn\n" +
- " 8 astore_1 [c]\n" +
- " 9 getstatic java.lang.System.out : java.io.PrintStream [24]\n" +
- " 12 ldc <String \"CCE\"> [30]\n" +
- " 14 invokevirtual java.io.PrintStream.println(java.lang.String) : void [32]\n" +
- " 17 iconst_m1\n" +
+ " // Method descriptor #17 (Ljava/io/Serializable;)I\n" +
+ " // Stack: 2, Locals: 2\n" +
+ " static int test(java.io.Serializable v);\n" +
+ " 0 aload_0 [v]\n" +
+ " 1 checkcast java.lang.Integer [18]\n" +
+ " 4 invokevirtual java.lang.Integer.intValue() : int [20]\n" +
+ " 7 ireturn\n" +
+ " 8 astore_1 [c]\n" +
+ " 9 getstatic java.lang.System.out : java.io.PrintStream [24]\n" +
+ " 12 ldc <String \"CCE\"> [30]\n" +
+ " 14 invokevirtual java.io.PrintStream.println(java.lang.String) : void [32]\n" +
+ " 17 iconst_m1\n" +
" 18 ireturn\n";
-
+
int index = actualOutput.indexOf(expectedOutput);
if (index == -1 || expectedOutput.length() == 0) {
System.out.println(Util.displayString(actualOutput, 2));
@@ -2922,7 +2922,7 @@ public void test428388j() throws Exception {
},
"10101010");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428522, [1.8] VerifyError when a non primitive type cast to primitive type
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428522, [1.8] VerifyError when a non primitive type cast to primitive type
public void test428522() throws Exception {
if (this.complianceLevel < ClassFileConstants.JDK1_7)
return;
@@ -2948,24 +2948,24 @@ public void test428522() throws Exception {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
- " // Stack: 2, Locals: 1\n" +
- " public static void main(java.lang.String[] args);\n" +
- " 0 ldc2_w <Long 100> [16]\n" +
- " 3 invokestatic java.lang.Long.valueOf(long) : java.lang.Long [18]\n" +
- " 6 checkcast java.lang.Long [19]\n" +
- " 9 invokevirtual java.lang.Long.longValue() : long [24]\n" +
- " 12 pop2\n" +
- " 13 getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
- " 16 ldc <String \"OK\"> [34]\n" +
- " 18 invokevirtual java.io.PrintStream.println(java.lang.String) : void [36]\n" +
- " 21 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
- " [pc: 13, line: 4]\n" +
- " [pc: 21, line: 5]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 22] local: args index: 0 type: java.lang.String[]\n" +
+ " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 ldc2_w <Long 100> [16]\n" +
+ " 3 invokestatic java.lang.Long.valueOf(long) : java.lang.Long [18]\n" +
+ " 6 checkcast java.lang.Long [19]\n" +
+ " 9 invokevirtual java.lang.Long.longValue() : long [24]\n" +
+ " 12 pop2\n" +
+ " 13 getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
+ " 16 ldc <String \"OK\"> [34]\n" +
+ " 18 invokevirtual java.io.PrintStream.println(java.lang.String) : void [36]\n" +
+ " 21 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
+ " [pc: 13, line: 4]\n" +
+ " [pc: 21, line: 5]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 22] local: args index: 0 type: java.lang.String[]\n" +
"}";
int index = actualOutput.indexOf(expectedOutput);
if (index == -1 || expectedOutput.length() == 0) {
@@ -2975,7 +2975,7 @@ public void test428522() throws Exception {
assertEquals("Wrong contents", expectedOutput, actualOutput);
}
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428522, [1.8] VerifyError when a non primitive type cast to primitive type
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428522, [1.8] VerifyError when a non primitive type cast to primitive type
public void test428522a() throws Exception {
if (this.complianceLevel < ClassFileConstants.JDK1_7)
return;
@@ -3001,25 +3001,25 @@ public void test428522a() throws Exception {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
- " // Stack: 2, Locals: 3\n" +
- " public static void main(java.lang.String[] args);\n" +
- " 0 ldc2_w <Long 100> [16]\n" +
- " 3 invokestatic java.lang.Long.valueOf(long) : java.lang.Long [18]\n" +
- " 6 checkcast java.lang.Long [19]\n" +
- " 9 invokevirtual java.lang.Long.longValue() : long [24]\n" +
- " 12 lstore_1 [l]\n" +
- " 13 getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
- " 16 ldc <String \"OK\"> [34]\n" +
- " 18 invokevirtual java.io.PrintStream.println(java.lang.String) : void [36]\n" +
- " 21 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
- " [pc: 13, line: 4]\n" +
- " [pc: 21, line: 5]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 22] local: args index: 0 type: java.lang.String[]\n" +
- " [pc: 13, pc: 22] local: l index: 1 type: long\n" +
+ " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
+ " // Stack: 2, Locals: 3\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 ldc2_w <Long 100> [16]\n" +
+ " 3 invokestatic java.lang.Long.valueOf(long) : java.lang.Long [18]\n" +
+ " 6 checkcast java.lang.Long [19]\n" +
+ " 9 invokevirtual java.lang.Long.longValue() : long [24]\n" +
+ " 12 lstore_1 [l]\n" +
+ " 13 getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
+ " 16 ldc <String \"OK\"> [34]\n" +
+ " 18 invokevirtual java.io.PrintStream.println(java.lang.String) : void [36]\n" +
+ " 21 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
+ " [pc: 13, line: 4]\n" +
+ " [pc: 21, line: 5]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 22] local: args index: 0 type: java.lang.String[]\n" +
+ " [pc: 13, pc: 22] local: l index: 1 type: long\n" +
"}";
int index = actualOutput.indexOf(expectedOutput);
if (index == -1 || expectedOutput.length() == 0) {
@@ -3029,7 +3029,7 @@ public void test428522a() throws Exception {
assertEquals("Wrong contents", expectedOutput, actualOutput);
}
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428522, [1.8] VerifyError when a non primitive type cast to primitive type
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428522, [1.8] VerifyError when a non primitive type cast to primitive type
public void test428522b() throws Exception {
if (this.complianceLevel < ClassFileConstants.JDK1_7)
return;
@@ -3051,7 +3051,7 @@ public void test428522b() throws Exception {
"CCE:OK", customOptions);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428522, [1.8] VerifyError when a non primitive type cast to primitive type
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428522, [1.8] VerifyError when a non primitive type cast to primitive type
public void test428522c() throws Exception {
if (this.complianceLevel < ClassFileConstants.JDK1_7)
return;
@@ -3077,24 +3077,24 @@ public void test428522c() throws Exception {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
- " // Stack: 2, Locals: 1\n" +
- " public static void main(java.lang.String[] args);\n" +
- " 0 bipush 100\n" +
- " 2 invokestatic java.lang.Integer.valueOf(int) : java.lang.Integer [16]\n" +
- " 5 checkcast java.lang.Integer [17]\n" +
- " 8 invokevirtual java.lang.Integer.intValue() : int [22]\n" +
- " 11 pop\n" +
- " 12 getstatic java.lang.System.out : java.io.PrintStream [26]\n" +
- " 15 ldc <String \"OK\"> [32]\n" +
- " 17 invokevirtual java.io.PrintStream.println(java.lang.String) : void [34]\n" +
- " 20 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
- " [pc: 12, line: 4]\n" +
- " [pc: 20, line: 5]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 21] local: args index: 0 type: java.lang.String[]\n" +
+ " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 bipush 100\n" +
+ " 2 invokestatic java.lang.Integer.valueOf(int) : java.lang.Integer [16]\n" +
+ " 5 checkcast java.lang.Integer [17]\n" +
+ " 8 invokevirtual java.lang.Integer.intValue() : int [22]\n" +
+ " 11 pop\n" +
+ " 12 getstatic java.lang.System.out : java.io.PrintStream [26]\n" +
+ " 15 ldc <String \"OK\"> [32]\n" +
+ " 17 invokevirtual java.io.PrintStream.println(java.lang.String) : void [34]\n" +
+ " 20 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
+ " [pc: 12, line: 4]\n" +
+ " [pc: 20, line: 5]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 21] local: args index: 0 type: java.lang.String[]\n" +
"}";
int index = actualOutput.indexOf(expectedOutput);
if (index == -1 || expectedOutput.length() == 0) {
@@ -3114,15 +3114,15 @@ public void test441731() {
this.runConformTest(
new String[] {
"X.java",
- "interface MUIElement {}\n" +
- "interface MUIElementContainer<T extends MUIElement> extends MUIElement{}\n" +
- "interface MWindowElement extends MUIElement {}\n" +
- "interface MWindow extends MUIElementContainer<MWindowElement> {}\n" +
- "public class X {\n" +
- " void test(MUIElementContainer<MUIElement> me) {\n" +
- " if(((MUIElement) me) instanceof MWindow) return;\n" +
- " MWindow mw = (MWindow)((MUIElement)me);\n" +
- " }\n" +
+ "interface MUIElement {}\n" +
+ "interface MUIElementContainer<T extends MUIElement> extends MUIElement{}\n" +
+ "interface MWindowElement extends MUIElement {}\n" +
+ "interface MWindow extends MUIElementContainer<MWindowElement> {}\n" +
+ "public class X {\n" +
+ " void test(MUIElementContainer<MUIElement> me) {\n" +
+ " if(((MUIElement) me) instanceof MWindow) return;\n" +
+ " MWindow mw = (MWindow)((MUIElement)me);\n" +
+ " }\n" +
"}\n"
},
customOptions);
@@ -3136,27 +3136,27 @@ public void test448112() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- "\n" +
- " static class Y {\n" +
- " public Object getAttribute(String name) {\n" +
- " return new Long(100L);\n" +
- " }\n" +
- " }\n" +
- " public static void foo2(Y y) {\n" +
- "\n" +
- " try {\n" +
- " long v1 = (Long) y.getAttribute(\"v1\");\n" +
- " long v2 = (Long) y.getAttribute(\"v2\");\n" +
- "\n" +
- " System.out.println(String.valueOf(v1));\n" +
- "\n" +
- " } catch (java.lang.Throwable t) {}\n" +
- " }\n" +
- " \n" +
- " public static void main(String args[]) {\n" +
- " foo2(new Y());\n" +
- " }\n" +
+ "public class X {\n" +
+ "\n" +
+ " static class Y {\n" +
+ " public Object getAttribute(String name) {\n" +
+ " return new Long(100L);\n" +
+ " }\n" +
+ " }\n" +
+ " public static void foo2(Y y) {\n" +
+ "\n" +
+ " try {\n" +
+ " long v1 = (Long) y.getAttribute(\"v1\");\n" +
+ " long v2 = (Long) y.getAttribute(\"v2\");\n" +
+ "\n" +
+ " System.out.println(String.valueOf(v1));\n" +
+ "\n" +
+ " } catch (java.lang.Throwable t) {}\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String args[]) {\n" +
+ " foo2(new Y());\n" +
+ " }\n" +
"}",
},
"100", customOptions);
@@ -3169,24 +3169,24 @@ public void test448112() throws Exception {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " public static void foo2(X.Y y);\n" +
- " 0 aload_0 [y]\n" +
- " 1 ldc <String \"v1\"> [16]\n" +
- " 3 invokevirtual X$Y.getAttribute(java.lang.String) : java.lang.Object [18]\n" +
- " 6 checkcast java.lang.Long [24]\n" +
- " 9 invokevirtual java.lang.Long.longValue() : long [26]\n" +
- " 12 lstore_1 [v1]\n" +
- " 13 aload_0 [y]\n" +
- " 14 ldc <String \"v2\"> [30]\n" +
- " 16 invokevirtual X$Y.getAttribute(java.lang.String) : java.lang.Object [18]\n" +
- " 19 checkcast java.lang.Long [24]\n" +
- " 22 pop\n" +
- " 23 getstatic java.lang.System.out : java.io.PrintStream [32]\n" +
- " 26 lload_1 [v1]\n" +
- " 27 invokestatic java.lang.String.valueOf(long) : java.lang.String [38]\n" +
- " 30 invokevirtual java.io.PrintStream.println(java.lang.String) : void [44]\n" +
- " 33 goto 37\n" +
- " 36 pop\n" +
+ " public static void foo2(X.Y y);\n" +
+ " 0 aload_0 [y]\n" +
+ " 1 ldc <String \"v1\"> [16]\n" +
+ " 3 invokevirtual X$Y.getAttribute(java.lang.String) : java.lang.Object [18]\n" +
+ " 6 checkcast java.lang.Long [24]\n" +
+ " 9 invokevirtual java.lang.Long.longValue() : long [26]\n" +
+ " 12 lstore_1 [v1]\n" +
+ " 13 aload_0 [y]\n" +
+ " 14 ldc <String \"v2\"> [30]\n" +
+ " 16 invokevirtual X$Y.getAttribute(java.lang.String) : java.lang.Object [18]\n" +
+ " 19 checkcast java.lang.Long [24]\n" +
+ " 22 pop\n" +
+ " 23 getstatic java.lang.System.out : java.io.PrintStream [32]\n" +
+ " 26 lload_1 [v1]\n" +
+ " 27 invokestatic java.lang.String.valueOf(long) : java.lang.String [38]\n" +
+ " 30 invokevirtual java.io.PrintStream.println(java.lang.String) : void [44]\n" +
+ " 33 goto 37\n" +
+ " 36 pop\n" +
" 37 return\n";
int index = actualOutput.indexOf(expectedOutput);
if (index == -1 || expectedOutput.length() == 0) {
@@ -3205,29 +3205,29 @@ public void test461706() {
this.runConformTest(
new String[] {
"Bug.java",
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "public class Bug {\n" +
- " private static class AndCondition implements ICondition {\n" +
- " public AndCondition(ICondition cond1, ICondition cond2) {\n" +
- " // todo\n" +
- " }\n" +
- " }\n" +
- " private static class SimpleCondition implements ICondition {\n" +
- " }\n" +
- " private static interface ICondition {\n" +
- " ICondition TRUE = new SimpleCondition();\n" +
- " default ICondition and(final ICondition cond) {\n" +
- " return new AndCondition(this, cond);\n" +
- " }\n" +
- " }\n" +
- " public static void main(final String[] args) {\n" +
- " final List<SimpleCondition> conditions = new ArrayList<>();\n" +
- " conditions.stream()\n" +
- " .map(x -> (ICondition)x)\n" +
- " .reduce((x, y) -> x.and(y))\n" +
- " .orElse(ICondition.TRUE);\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "public class Bug {\n" +
+ " private static class AndCondition implements ICondition {\n" +
+ " public AndCondition(ICondition cond1, ICondition cond2) {\n" +
+ " // todo\n" +
+ " }\n" +
+ " }\n" +
+ " private static class SimpleCondition implements ICondition {\n" +
+ " }\n" +
+ " private static interface ICondition {\n" +
+ " ICondition TRUE = new SimpleCondition();\n" +
+ " default ICondition and(final ICondition cond) {\n" +
+ " return new AndCondition(this, cond);\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(final String[] args) {\n" +
+ " final List<SimpleCondition> conditions = new ArrayList<>();\n" +
+ " conditions.stream()\n" +
+ " .map(x -> (ICondition)x)\n" +
+ " .reduce((x, y) -> x.and(y))\n" +
+ " .orElse(ICondition.TRUE);\n" +
+ " }\n" +
"}"
},
customOptions);
@@ -3242,29 +3242,29 @@ public void test461706a() {
runner.testFiles =
new String[] {
"Bug.java",
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "public class Bug {\n" +
- " private static class AndCondition implements ICondition {\n" +
- " public AndCondition(ICondition cond1, ICondition cond2) {\n" +
- " // todo\n" +
- " }\n" +
- " }\n" +
- " static class SimpleCondition implements ICondition {\n" +
- " }\n" +
- " private static interface ICondition {\n" +
- " ICondition TRUE = new SimpleCondition();\n" +
- " default ICondition and(final ICondition cond) {\n" +
- " return new AndCondition(this, cond);\n" +
- " }\n" +
- " }\n" +
- " public static void main(final String[] args) {\n" +
- " final List<ICondition> conditions = new ArrayList<>();\n" +
- " conditions.stream()\n" +
- " .map(x -> (ICondition)x)\n" +
- " .reduce((x, y) -> x.and(y))\n" +
- " .orElse(ICondition.TRUE);\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "public class Bug {\n" +
+ " private static class AndCondition implements ICondition {\n" +
+ " public AndCondition(ICondition cond1, ICondition cond2) {\n" +
+ " // todo\n" +
+ " }\n" +
+ " }\n" +
+ " static class SimpleCondition implements ICondition {\n" +
+ " }\n" +
+ " private static interface ICondition {\n" +
+ " ICondition TRUE = new SimpleCondition();\n" +
+ " default ICondition and(final ICondition cond) {\n" +
+ " return new AndCondition(this, cond);\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(final String[] args) {\n" +
+ " final List<ICondition> conditions = new ArrayList<>();\n" +
+ " conditions.stream()\n" +
+ " .map(x -> (ICondition)x)\n" +
+ " .reduce((x, y) -> x.and(y))\n" +
+ " .orElse(ICondition.TRUE);\n" +
+ " }\n" +
"}"
};
runner.expectedCompilerLog =
@@ -3355,10 +3355,10 @@ public void test548647() {
this.runConformTest(
new String[] {
"X.java",
- "interface MUIElement {}\n" +
- "interface MUIElementContainer<T extends MUIElement> extends MUIElement{}\n" +
- "interface MWindowElement extends MUIElement {}\n" +
- "interface MWindow extends MUIElementContainer<MWindowElement> {}\n" +
+ "interface MUIElement {}\n" +
+ "interface MUIElementContainer<T extends MUIElement> extends MUIElement{}\n" +
+ "interface MWindowElement extends MUIElement {}\n" +
+ "interface MWindow extends MUIElementContainer<MWindowElement> {}\n" +
"public class X {\n" +
" MUIElementContainer<MUIElement> field;\n" +
" MUIElementContainer<MUIElement> getField() {\n" +
@@ -3370,8 +3370,8 @@ public void test548647() {
" if(((Object) me) instanceof MWindow) return;\n" +
" if ((MUIElement)field instanceof MWindow) return;\n" +
" if ((MUIElement)getField() instanceof MWindow) return;\n" +
- " MWindow mw = (MWindow)((MUIElement)me);\n" +
- " }\n" +
+ " MWindow mw = (MWindow)((MUIElement)me);\n" +
+ " }\n" +
"}\n"
},
customOptions);
@@ -3388,13 +3388,13 @@ public void test548647a() {
"public class Bug {\n" +
" Integer k;\n" +
" private Number getK() { return k; }\n" +
- " public void fn(Number n) {\n" +
+ " public void fn(Number n) {\n" +
" Number j = n;\n" +
" if ((Number) n instanceof Long) return;\n" +
" if ((Number) k instanceof Integer) return;\n" +
" if ((Number) j instanceof Integer) return;\n" +
" if ((Number) getK() instanceof Integer) return;\n" +
- " }\n" +
+ " }\n" +
"}"
};
runner.expectedCompilerLog =
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_5.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_5.java
index 984d5ac29..092de4cac 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_5.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_5.java
@@ -514,106 +514,106 @@ public class ClassFileReaderTest_1_5 extends AbstractRegressionTest {
*/
public void test016() throws Exception {
String source =
- "public @interface MonAnnotation {\n" +
- " String test1() default \"\\0\";\n" +
- " char test2() default '\\0';\n" +
- "}\n" +
+ "public @interface MonAnnotation {\n" +
+ " String test1() default \"\\0\";\n" +
+ " char test2() default '\\0';\n" +
+ "}\n" +
"";
String expectedOutput =
" public abstract char test2() default \'\\u0000\';";
checkClassFile("", "MonAnnotation", source, expectedOutput, ClassFileBytesDisassembler.DETAILED | ClassFileBytesDisassembler.COMPACT);
}
-
+
public void testBug504031() throws Exception {
String source =
"package test;\n" +
- "@RunWith(JUnitPlatform.class)\n" +
- "@SelectPackages(\"test.dynamic.TODO\")\n" +
- "public class AllTests {\n" +
- " @Test\n" +
- " void test1() {\n" +
- " }\n" +
- "} \n" +
+ "@RunWith(JUnitPlatform.class)\n" +
+ "@SelectPackages(\"test.dynamic.TODO\")\n" +
+ "public class AllTests {\n" +
+ " @Test\n" +
+ " void test1() {\n" +
+ " }\n" +
+ "} \n" +
"\n" +
- "@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)\n" +
- "@interface RunWith {\n" +
- " Class<? extends Runner> value();\n" +
+ "@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)\n" +
+ "@interface RunWith {\n" +
+ " Class<? extends Runner> value();\n" +
"}\n" +
- "@interface SelectPackages {\n" +
+ "@interface SelectPackages {\n" +
"}\n" +
"class Runner {}\n" +
- "@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)\n" +
+ "@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)\n" +
"@interface Test {}\n";
String expectedOutput =
- "@RunWith(value=JUnitPlatform)\n" +
- "public class test.AllTests {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 test/AllTests\n" +
- " constant #2 utf8: \"test/AllTests\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"<init>\"\n" +
- " constant #6 utf8: \"()V\"\n" +
- " constant #7 utf8: \"Code\"\n" +
- " constant #8 class: #9 java/lang/Error\n" +
- " constant #9 utf8: \"java/lang/Error\"\n" +
- " constant #10 string: #11 \"Unresolved compilation problems: \\n\\tJUnitPlatform cannot be resolved to a type\\n\\tClass<JUnitPlatform> cannot be resolved to a type\\n\\tThe attribute value is undefined for the annotation type SelectPackages\\n\"\n" +
- " constant #11 utf8: \"Unresolved compilation problems: \\n\\tJUnitPlatform cannot be resolved to a type\\n\\tClass<JUnitPlatform> cannot be resolved to a type\\n\\tThe attribute value is undefined for the annotation type SelectPackages\\n\"\n" +
- " constant #12 method_ref: #8.#13 java/lang/Error.<init> (Ljava/lang/String;)V\n" +
- " constant #13 name_and_type: #5.#14 <init> (Ljava/lang/String;)V\n" +
- " constant #14 utf8: \"(Ljava/lang/String;)V\"\n" +
- " constant #15 utf8: \"LineNumberTable\"\n" +
- " constant #16 utf8: \"LocalVariableTable\"\n" +
- " constant #17 utf8: \"this\"\n" +
- " constant #18 utf8: \"Ltest/AllTests;\"\n" +
- " constant #19 utf8: \"test1\"\n" +
- " constant #20 utf8: \"RuntimeVisibleAnnotations\"\n" +
- " constant #21 utf8: \"Ltest/Test;\"\n" +
- " constant #22 string: #23 \"Unresolved compilation problem: \\n\"\n" +
- " constant #23 utf8: \"Unresolved compilation problem: \\n\"\n" +
- " constant #24 utf8: \"SourceFile\"\n" +
- " constant #25 utf8: \"AllTests.java\"\n" +
+ "@RunWith(value=JUnitPlatform)\n" +
+ "public class test.AllTests {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 test/AllTests\n" +
+ " constant #2 utf8: \"test/AllTests\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"<init>\"\n" +
+ " constant #6 utf8: \"()V\"\n" +
+ " constant #7 utf8: \"Code\"\n" +
+ " constant #8 class: #9 java/lang/Error\n" +
+ " constant #9 utf8: \"java/lang/Error\"\n" +
+ " constant #10 string: #11 \"Unresolved compilation problems: \\n\\tJUnitPlatform cannot be resolved to a type\\n\\tClass<JUnitPlatform> cannot be resolved to a type\\n\\tThe attribute value is undefined for the annotation type SelectPackages\\n\"\n" +
+ " constant #11 utf8: \"Unresolved compilation problems: \\n\\tJUnitPlatform cannot be resolved to a type\\n\\tClass<JUnitPlatform> cannot be resolved to a type\\n\\tThe attribute value is undefined for the annotation type SelectPackages\\n\"\n" +
+ " constant #12 method_ref: #8.#13 java/lang/Error.<init> (Ljava/lang/String;)V\n" +
+ " constant #13 name_and_type: #5.#14 <init> (Ljava/lang/String;)V\n" +
+ " constant #14 utf8: \"(Ljava/lang/String;)V\"\n" +
+ " constant #15 utf8: \"LineNumberTable\"\n" +
+ " constant #16 utf8: \"LocalVariableTable\"\n" +
+ " constant #17 utf8: \"this\"\n" +
+ " constant #18 utf8: \"Ltest/AllTests;\"\n" +
+ " constant #19 utf8: \"test1\"\n" +
+ " constant #20 utf8: \"RuntimeVisibleAnnotations\"\n" +
+ " constant #21 utf8: \"Ltest/Test;\"\n" +
+ " constant #22 string: #23 \"Unresolved compilation problem: \\n\"\n" +
+ " constant #23 utf8: \"Unresolved compilation problem: \\n\"\n" +
+ " constant #24 utf8: \"SourceFile\"\n" +
+ " constant #25 utf8: \"AllTests.java\"\n" +
" constant #26 utf8: \"RuntimeInvisibleAnnotations\"\n" + // unused but tolerated
" constant #27 utf8: \"Ltest/SelectPackages;\"\n" + // unused but tolerated
- " constant #28 utf8: \"value\"\n" +
- " constant #29 utf8: \"Ltest/RunWith;\"\n" +
- " constant #30 utf8: \"LJUnitPlatform;\"\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 3, Locals: 1\n" +
- " public AllTests();\n" +
- " 0 new Error [8]\n" +
- " 3 dup\n" +
- " 4 ldc <String \"Unresolved compilation problems: \\n\\tJUnitPlatform cannot be resolved to a type\\n\\tClass<JUnitPlatform> cannot be resolved to a type\\n\\tThe attribute value is undefined for the annotation type SelectPackages\\n\"> [10]\n" +
- " 6 invokespecial Error(String) [12]\n" +
- " 9 athrow\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 2]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 10] local: this index: 0 type: AllTests\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 3, Locals: 1\n" +
- " @Test\n" +
- " void test1();\n" +
- " 0 new Error [8]\n" +
- " 3 dup\n" +
- " 4 ldc <String \"Unresolved compilation problem: \\n\"> [22]\n" +
- " 6 invokespecial Error(String) [12]\n" +
- " 9 athrow\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 6]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 10] local: this index: 0 type: AllTests\n" +
- " RuntimeVisibleAnnotations: \n" +
- " #21 @Test(\n" +
- " )\n" +
- "\n" +
- " RuntimeVisibleAnnotations: \n" +
- " #29 @RunWith(\n" +
- " #28 value=JUnitPlatform (#30 class type)\n" +
- " )\n" +
+ " constant #28 utf8: \"value\"\n" +
+ " constant #29 utf8: \"Ltest/RunWith;\"\n" +
+ " constant #30 utf8: \"LJUnitPlatform;\"\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 3, Locals: 1\n" +
+ " public AllTests();\n" +
+ " 0 new Error [8]\n" +
+ " 3 dup\n" +
+ " 4 ldc <String \"Unresolved compilation problems: \\n\\tJUnitPlatform cannot be resolved to a type\\n\\tClass<JUnitPlatform> cannot be resolved to a type\\n\\tThe attribute value is undefined for the annotation type SelectPackages\\n\"> [10]\n" +
+ " 6 invokespecial Error(String) [12]\n" +
+ " 9 athrow\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 2]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 10] local: this index: 0 type: AllTests\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 3, Locals: 1\n" +
+ " @Test\n" +
+ " void test1();\n" +
+ " 0 new Error [8]\n" +
+ " 3 dup\n" +
+ " 4 ldc <String \"Unresolved compilation problem: \\n\"> [22]\n" +
+ " 6 invokespecial Error(String) [12]\n" +
+ " 9 athrow\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 6]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 10] local: this index: 0 type: AllTests\n" +
+ " RuntimeVisibleAnnotations: \n" +
+ " #21 @Test(\n" +
+ " )\n" +
+ "\n" +
+ " RuntimeVisibleAnnotations: \n" +
+ " #29 @RunWith(\n" +
+ " #28 value=JUnitPlatform (#30 class type)\n" +
+ " )\n" +
"}";
int mode = ClassFileBytesDisassembler.DETAILED | ClassFileBytesDisassembler.COMPACT | ClassFileBytesDisassembler.SYSTEM;
checkClassFile("test", "AllTests", "AllTests", source, expectedOutput, mode, true/*suppress expected errors*/);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_8.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_8.java
index f63069d47..7f3a61ea9 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_8.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_8.java
@@ -43,13 +43,13 @@ public class ClassFileReaderTest_1_8 extends AbstractRegressionTest {
public ClassFileReaderTest_1_8(String name) {
super(name);
}
-
+
// Needed to run tests individually from JUnit
protected void setUp() throws Exception {
super.setUp();
this.complianceLevel = ClassFileConstants.JDK1_8;
}
-
+
public void test001_classTypeParameter() throws Exception {
String source =
"import java.lang.annotation.*;\n" +
@@ -65,14 +65,14 @@ public class ClassFileReaderTest_1_8 extends AbstractRegressionTest {
"}";
org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader classFileReader = getInternalClassFile("", "X", "X", source);
-
+
IBinaryTypeAnnotation[] typeAnnotations = classFileReader.getTypeAnnotations();
assertEquals(2,typeAnnotations.length);
-
+
assertEquals("@LFoo; CLASS_TYPE_PARAMETER(type_parameter_index=0)", printTypeAnnotation(typeAnnotations[0]));
assertEquals("@LBar;(iii=(int)99) CLASS_TYPE_PARAMETER(type_parameter_index=1)", printTypeAnnotation(typeAnnotations[1]));
}
-
+
public void test001a_classTypeParameterDifferingRetentions() throws Exception {
String source =
"import java.lang.annotation.*;\n" +
@@ -88,19 +88,19 @@ public class ClassFileReaderTest_1_8 extends AbstractRegressionTest {
"}";
org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader classFileReader = getInternalClassFile("", "X", "X", source);
-
+
IBinaryTypeAnnotation[] typeAnnotations = classFileReader.getTypeAnnotations();
assertEquals(2,typeAnnotations.length);
-
+
assertEquals("@LBar;(iii=(int)99) CLASS_TYPE_PARAMETER(type_parameter_index=1)", printTypeAnnotation(typeAnnotations[0]));
assertEquals("@LFoo; CLASS_TYPE_PARAMETER(type_parameter_index=0)", printTypeAnnotation(typeAnnotations[1]));
}
-
+
public void test002_methodTypeParameter() throws Exception {
String source =
"import java.lang.annotation.*;\n" +
"public class X {\n" +
- " <@Foo T1, @Bar(3) T2> void foo(T1 t1,T2 t2) {}\n" +
+ " <@Foo T1, @Bar(3) T2> void foo(T1 t1,T2 t2) {}\n" +
"}\n" +
"@Retention(RetentionPolicy.CLASS)\n" +
"@Target(ElementType.TYPE_USE)\n" +
@@ -113,7 +113,7 @@ public class ClassFileReaderTest_1_8 extends AbstractRegressionTest {
"}";
org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader cfr = getInternalClassFile("", "X", "X", source);
-
+
IBinaryMethod method = getMethod(cfr,"foo");
assertNotNull(method);
IBinaryTypeAnnotation[] typeAnnotations = method.getTypeAnnotations();
@@ -122,7 +122,7 @@ public class ClassFileReaderTest_1_8 extends AbstractRegressionTest {
assertEquals("@LFoo; METHOD_TYPE_PARAMETER(type_parameter_index=0)",printTypeAnnotation(typeAnnotations[0]));
assertEquals("@LBar;(value=(int)3) METHOD_TYPE_PARAMETER(type_parameter_index=1)",printTypeAnnotation(typeAnnotations[1]));
}
-
+
public void test003_classExtends() throws Exception {
this.complianceLevel = ClassFileConstants.JDK1_8;
String source =
@@ -140,7 +140,7 @@ public class ClassFileReaderTest_1_8 extends AbstractRegressionTest {
"}";
org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader classFileReader = getInternalClassFile("", "X", "X", source);
-
+
IBinaryTypeAnnotation[] typeAnnotations = classFileReader.getTypeAnnotations();
assertEquals(3,typeAnnotations.length);
assertEquals("@LFoo; CLASS_EXTENDS(type_index=-1)", printTypeAnnotation(typeAnnotations[0]));
@@ -166,14 +166,14 @@ public class ClassFileReaderTest_1_8 extends AbstractRegressionTest {
"}";
org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader classFileReader = getInternalClassFile("", "X", "X", source);
-
+
IBinaryTypeAnnotation[] typeAnnotations = classFileReader.getTypeAnnotations();
assertEquals(3,typeAnnotations.length);
assertEquals("@LFoo; CLASS_EXTENDS(type_index=-1), location=[TYPE_ARGUMENT(0)]", printTypeAnnotation(typeAnnotations[0]));
assertEquals("@LBar; CLASS_EXTENDS(type_index=-1), location=[TYPE_ARGUMENT(1)]", printTypeAnnotation(typeAnnotations[1]));
assertEquals("@LFoo; CLASS_EXTENDS(type_index=0), location=[TYPE_ARGUMENT(0)]", printTypeAnnotation(typeAnnotations[2]));
}
-
+
public void test005_classTypeParameterBound() throws Exception {
String source =
"import java.lang.annotation.*;\n" +
@@ -190,7 +190,7 @@ public class ClassFileReaderTest_1_8 extends AbstractRegressionTest {
"}";
org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader classFileReader = getInternalClassFile("", "X", "X", source);
-
+
IBinaryTypeAnnotation[] typeAnnotations = classFileReader.getTypeAnnotations();
assertEquals(4,typeAnnotations.length);
assertEquals("@LFoo; CLASS_TYPE_PARAMETER_BOUND(type_parameter_index=1, bound_index=0), location=[TYPE_ARGUMENT(0), ARRAY, ARRAY, ARRAY]", printTypeAnnotation(typeAnnotations[0]));
@@ -198,7 +198,7 @@ public class ClassFileReaderTest_1_8 extends AbstractRegressionTest {
assertEquals("@LBar;(value=(int)2) CLASS_TYPE_PARAMETER_BOUND(type_parameter_index=1, bound_index=0), location=[TYPE_ARGUMENT(0), ARRAY, ARRAY]", printTypeAnnotation(typeAnnotations[2]));
assertEquals("@LBar;(value=(int)3) CLASS_TYPE_PARAMETER_BOUND(type_parameter_index=1, bound_index=1)", printTypeAnnotation(typeAnnotations[3]));
}
-
+
public void test006_methodTypeParameterBound() throws Exception {
String source =
"import java.lang.annotation.*;\n" +
@@ -229,7 +229,7 @@ public class ClassFileReaderTest_1_8 extends AbstractRegressionTest {
assertEquals("@LBar;(value=(int)2) METHOD_TYPE_PARAMETER_BOUND(type_parameter_index=0, bound_index=0), location=[TYPE_ARGUMENT(0), ARRAY, ARRAY]", printTypeAnnotation(typeAnnotations[2]));
assertEquals("@LBar;(value=(int)3) METHOD_TYPE_PARAMETER_BOUND(type_parameter_index=0, bound_index=1)", printTypeAnnotation(typeAnnotations[3]));
}
-
+
public void test007_field() throws Exception {
String source =
"import java.lang.annotation.*;\n" +
@@ -263,7 +263,7 @@ public class ClassFileReaderTest_1_8 extends AbstractRegressionTest {
assertEquals("@LBar;(value=(int)4) FIELD, location=[TYPE_ARGUMENT(1), ARRAY]", printTypeAnnotation(typeAnnotations[4]));
assertEquals("@LBar;(value=(int)5) FIELD, location=[TYPE_ARGUMENT(1), ARRAY, ARRAY]", printTypeAnnotation(typeAnnotations[5]));
}
-
+
public void test008_methodReturn() throws Exception {
String source =
"import java.lang.annotation.*;\n" +
@@ -271,10 +271,10 @@ public class ClassFileReaderTest_1_8 extends AbstractRegressionTest {
"public class X{\n" +
" @Bar(3) @Foo int foo() {\n" +
" return 1;\n" +
- " }\n" +
+ " }\n" +
" @Bar(3) int @Foo [] foo2() {\n" +
" return null;\n" +
- " }\n" +
+ " }\n" +
"}\n" +
"@Retention(RetentionPolicy.CLASS)\n" +
"@Target(ElementType.TYPE_USE)\n" +
@@ -295,7 +295,7 @@ public class ClassFileReaderTest_1_8 extends AbstractRegressionTest {
assertEquals(2,typeAnnotations.length);
assertEquals("@LBar;(value=(int)3) METHOD_RETURN",printTypeAnnotation(typeAnnotations[0]));
assertEquals("@LFoo; METHOD_RETURN", printTypeAnnotation(typeAnnotations[1]));
-
+
method = getMethod(cfr,"foo2");
assertNotNull(method);
typeAnnotations = method.getTypeAnnotations();
@@ -304,13 +304,13 @@ public class ClassFileReaderTest_1_8 extends AbstractRegressionTest {
assertEquals("@LBar;(value=(int)3) METHOD_RETURN, location=[ARRAY]",printTypeAnnotation(typeAnnotations[0]));
assertEquals("@LFoo; METHOD_RETURN", printTypeAnnotation(typeAnnotations[1]));
}
-
+
public void test009_methodReceiver() throws Exception {
String source =
"import java.lang.annotation.*;\n" +
"import java.util.Map;\n" +
"public class X{\n" +
- " void foo(@Bar(3) X this) {}\n" +
+ " void foo(@Bar(3) X this) {}\n" +
"}\n" +
"@Retention(RetentionPolicy.CLASS)\n" +
"@Target(ElementType.TYPE_USE)\n" +
@@ -331,13 +331,13 @@ public class ClassFileReaderTest_1_8 extends AbstractRegressionTest {
assertEquals(1,typeAnnotations.length);
assertEquals("@LBar;(value=(int)3) METHOD_RECEIVER", printTypeAnnotation(typeAnnotations[0]));
}
-
+
public void test010_methodFormalParameter() throws Exception {
String source =
"import java.lang.annotation.*;\n" +
"import java.util.Map;\n" +
"public class X{\n" +
- " void foo(@Bar(3) String s, @Foo int i) {}\n" +
+ " void foo(@Bar(3) String s, @Foo int i) {}\n" +
"}\n" +
"@Retention(RetentionPolicy.CLASS)\n" +
"@Target(ElementType.TYPE_USE)\n" +
@@ -359,13 +359,13 @@ public class ClassFileReaderTest_1_8 extends AbstractRegressionTest {
assertEquals("@LBar;(value=(int)3) METHOD_FORMAL_PARAMETER(method_formal_parameter_index=0)",printTypeAnnotation(typeAnnotations[0]));
assertEquals("@LFoo; METHOD_FORMAL_PARAMETER(method_formal_parameter_index=1)",printTypeAnnotation(typeAnnotations[1]));
}
-
+
public void test011_throws() throws Exception {
String source =
"import java.lang.annotation.*;\n" +
"import java.util.Map;\n" +
"public class X{\n" +
- " void foo() throws @Foo Exception, @Bar(1) Throwable {}\n" +
+ " void foo() throws @Foo Exception, @Bar(1) Throwable {}\n" +
"}\n" +
"@Retention(RetentionPolicy.CLASS)\n" +
"@Target(ElementType.TYPE_USE)\n" +
@@ -392,9 +392,9 @@ public class ClassFileReaderTest_1_8 extends AbstractRegressionTest {
"import java.lang.annotation.*;\n" +
"import java.util.Map;\n" +
"public @interface X{\n" +
- " @Bar(3) @Foo int foo();\n" +
- " @Bar(3) int @Foo [] foo2();\n" +
- " @Bar(7) @Foo String value() default \"aaa\";\n" +
+ " @Bar(3) @Foo int foo();\n" +
+ " @Bar(3) int @Foo [] foo2();\n" +
+ " @Bar(7) @Foo String value() default \"aaa\";\n" +
"}\n" +
"@Retention(RetentionPolicy.CLASS)\n" +
"@Target(ElementType.TYPE_USE)\n" +
@@ -415,7 +415,7 @@ public class ClassFileReaderTest_1_8 extends AbstractRegressionTest {
assertEquals(2,typeAnnotations.length);
assertEquals("@LBar;(value=(int)3) METHOD_RETURN",printTypeAnnotation(typeAnnotations[0]));
assertEquals("@LFoo; METHOD_RETURN", printTypeAnnotation(typeAnnotations[1]));
-
+
method = getMethod(cfr,"foo2");
assertNotNull(method);
typeAnnotations = method.getTypeAnnotations();
@@ -423,7 +423,7 @@ public class ClassFileReaderTest_1_8 extends AbstractRegressionTest {
assertEquals(2,typeAnnotations.length);
assertEquals("@LBar;(value=(int)3) METHOD_RETURN, location=[ARRAY]",printTypeAnnotation(typeAnnotations[0]));
assertEquals("@LFoo; METHOD_RETURN", printTypeAnnotation(typeAnnotations[1]));
-
+
method = getMethod(cfr,"value");
assertNotNull(method);
typeAnnotations = method.getTypeAnnotations();
@@ -454,12 +454,12 @@ public class ClassFileReaderTest_1_8 extends AbstractRegressionTest {
runConformTest(
new String[] {
"j/Usage.java",
- "package j;\n" +
- "\n" +
- "import k.A.B.C;\n" +
- "\n" +
- "public class Usage {\n" +
- " C c;\n" +
+ "package j;\n" +
+ "\n" +
+ "import k.A.B.C;\n" +
+ "\n" +
+ "public class Usage {\n" +
+ " C c;\n" +
"}"
},
"",
@@ -491,7 +491,7 @@ public class ClassFileReaderTest_1_8 extends AbstractRegressionTest {
sb.append(')');
}
sb.append(' ');
-
+
// target type
int targetType = typeAnnotation.getTargetType();
switch (targetType) {
@@ -535,10 +535,10 @@ public class ClassFileReaderTest_1_8 extends AbstractRegressionTest {
break;
default: throw new IllegalStateException("nyi "+targetType);
}
-
+
// location
int[] typepath = typeAnnotation.getTypePath();
-
+
if (typepath != IBinaryTypeAnnotation.NO_TYPE_PATH) {
sb.append(", location=["); //$NON-NLS-1$
for (int i = 0, max = typepath.length; i < max; i += 2) {
@@ -592,5 +592,5 @@ public class ClassFileReaderTest_1_8 extends AbstractRegressionTest {
}
return null;
}
-
+
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClasspathJmodTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClasspathJmodTests.java
index f283987a1..9a66768b2 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClasspathJmodTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClasspathJmodTests.java
@@ -36,7 +36,7 @@ public class ClasspathJmodTests extends ModuleCompilationTests {
super.setUp();
System.setProperty("modules.to.load", "java.base");
}
-
+
public void tearDown() throws Exception {
super.tearDown();
System.setProperty("modules.to.load", "");
@@ -59,12 +59,12 @@ public class ClasspathJmodTests extends ModuleCompilationTests {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
" public static java.sql.Connection getConnection() {\n" +
@@ -78,7 +78,7 @@ public class ClasspathJmodTests extends ModuleCompilationTests {
.append(getJavaSqlJMod())
.append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runConformModuleTest(files,
+ runConformModuleTest(files,
buffer,
"",
"",
@@ -91,12 +91,12 @@ public class ClasspathJmodTests extends ModuleCompilationTests {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
" public static java.sql.Connection getConnection() {\n" +
@@ -109,21 +109,21 @@ public class ClasspathJmodTests extends ModuleCompilationTests {
.append(" --module-path \"")
.append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 2)\n" +
- " requires java.sql;\n" +
- " ^^^^^^^^\n" +
- "java.sql cannot be resolved to a module\n" +
- "----------\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/X.java (at line 3)\n" +
- " public static java.sql.Connection getConnection() {\n" +
- " ^^^^^^^^\n" +
- "java.sql cannot be resolved to a type\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 2)\n" +
+ " requires java.sql;\n" +
+ " ^^^^^^^^\n" +
+ "java.sql cannot be resolved to a module\n" +
+ "----------\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/X.java (at line 3)\n" +
+ " public static java.sql.Connection getConnection() {\n" +
+ " ^^^^^^^^\n" +
+ "java.sql cannot be resolved to a type\n" +
+ "----------\n" +
"2 problems (2 errors)\n",
false,
"p.X");
@@ -134,12 +134,12 @@ public class ClasspathJmodTests extends ModuleCompilationTests {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
" public static java.sql.Connection getConnection() {\n" +
@@ -153,21 +153,21 @@ public class ClasspathJmodTests extends ModuleCompilationTests {
.append(getJavaSqlJMod())
.append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 2)\n" +
- " requires java.sql;\n" +
- " ^^^^^^^^\n" +
- "java.sql cannot be resolved to a module\n" +
- "----------\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/X.java (at line 3)\n" +
- " public static java.sql.Connection getConnection() {\n" +
- " ^^^^^^^^\n" +
- "java.sql cannot be resolved to a type\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 2)\n" +
+ " requires java.sql;\n" +
+ " ^^^^^^^^\n" +
+ "java.sql cannot be resolved to a module\n" +
+ "----------\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/X.java (at line 3)\n" +
+ " public static java.sql.Connection getConnection() {\n" +
+ " ^^^^^^^^\n" +
+ "java.sql cannot be resolved to a type\n" +
+ "----------\n" +
"2 problems (2 errors)\n",
false,
"p.X");
@@ -178,11 +178,11 @@ public class ClasspathJmodTests extends ModuleCompilationTests {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
" public static java.sql.Connection getConnection() {\n" +
@@ -196,15 +196,15 @@ public class ClasspathJmodTests extends ModuleCompilationTests {
.append(getJavaSqlJMod())
.append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/X.java (at line 3)\n" +
- " public static java.sql.Connection getConnection() {\n" +
- " ^^^^^^^^\n" +
- "java.sql cannot be resolved to a type\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/X.java (at line 3)\n" +
+ " public static java.sql.Connection getConnection() {\n" +
+ " ^^^^^^^^\n" +
+ "java.sql cannot be resolved to a type\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false,
"p.X");
@@ -215,14 +215,14 @@ public class ClasspathJmodTests extends ModuleCompilationTests {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p;\n" +
" requires mod.two;\n" +
" requires transitive java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"import q.Y;\n" +
"public class X {\n" +
@@ -231,12 +231,12 @@ public class ClasspathJmodTests extends ModuleCompilationTests {
" }\n" +
"}");
moduleLoc = directory + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.two { \n" +
" exports q;\n" +
" requires java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
"package q;\n" +
"public class Y {\n" +
" public static java.sql.Connection con = null;\n" +
@@ -252,7 +252,7 @@ public class ClasspathJmodTests extends ModuleCompilationTests {
.append(" --module-source-path " + "\"" + directory + "\"");
runConformModuleTest(files,
- buffer,
+ buffer,
"",
"",
false);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java
index af258935a..ec1c1d96e 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java
@@ -12,7 +12,7 @@
* IBM Corporation - initial API and implementation
* Benjamin Muskalla - Contribution for bug 239066
* Stephan Herrmann - Adjustments for Object Teams
- * Stephan Herrmann - Contributions for
+ * Stephan Herrmann - Contributions for
* bug 236385: [compiler] Warn for potential programming problem if an object is created but not used
* bug 349326 - [1.7] new warning for missing try-with-resources
* bug 186342 - [compiler][null] Using annotations for null checking
@@ -26,7 +26,7 @@
* bug 392862 - [1.8][compiler][null] Evaluate null annotations on array types
* bug 331649 - [compiler][null] consider null annotations for fields
* bug 382789 - [compiler][null] warn when syntactically-nonnull expression is compared against null
- * bug 402028 - [1.8][compiler] null analysis for reference expressions
+ * bug 402028 - [1.8][compiler] null analysis for reference expressions
* bug 401796 - [1.8][compiler] don't treat default methods as overriding an independent inherited abstract method
* bug 404649 - [1.8][compiler] detect illegal reference to indirect or redundant super
* bug 400761 - [compiler][null] null may be return as boolean without a diagnostic
@@ -619,7 +619,7 @@ public void _test011_problem_categories() {
expectedProblemAttributes.put("IncompatibleTypesInConditionalOperator", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
expectedProblemAttributes.put("IncompatibleTypesInEqualityOperator", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
expectedProblemAttributes.put("IncompatibleTypesInForeach", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
-
+
expectedProblemAttributes.put("IncorrectArityForParameterizedConstructor", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
expectedProblemAttributes.put("IncorrectArityForParameterizedMethod", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
expectedProblemAttributes.put("IncorrectArityForParameterizedType", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
@@ -1232,7 +1232,7 @@ public void _test011_problem_categories() {
expectedProblemAttributes.put("CovariantReturnRequiresTypeParameter", new ProblemAttributes(CategorizedProblem.CAT_MEMBER));
expectedProblemAttributes.put("CallinToConstructorMustUseAfter", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
-
+
// OT SYNTAX_RELATED:
expectedProblemAttributes.put("SYNTAX_RELATED", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
expectedProblemAttributes.put("OTKeywordInRegularClass", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
@@ -1254,7 +1254,7 @@ public void _test011_problem_categories() {
expectedProblemAttributes.put("MissingPredicateExpression", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
expectedProblemAttributes.put("ValueParamWrongPosition", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
expectedProblemAttributes.put("SyntaxErrorSingleTypeReferenceExpected", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
-
+
// LIMITATIONS:
expectedProblemAttributes.put("LIMITATIONS", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
expectedProblemAttributes.put("UnsupportedUseOfGenerics", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java
index 265be84b2..f34c533e9 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java
@@ -115,21 +115,21 @@ public void test011() {
" } \n" +
"} \n"
},
- "----------\n" +
- "1. ERROR in p1\\X.java (at line 5)\n" +
- " while (false) System.out.println(\"unreachable\"); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "2. ERROR in p1\\X.java (at line 9)\n" +
- " for (;false;) System.out.println(\"unreachable\"); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "3. WARNING in p1\\X.java (at line 11)\n" +
- " if (false)System.out.println(\"unreachable\"); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in p1\\X.java (at line 5)\n" +
+ " while (false) System.out.println(\"unreachable\"); \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "2. ERROR in p1\\X.java (at line 9)\n" +
+ " for (;false;) System.out.println(\"unreachable\"); \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "3. WARNING in p1\\X.java (at line 11)\n" +
+ " if (false)System.out.println(\"unreachable\"); \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n");
}
// binary compatibility
@@ -1036,22 +1036,22 @@ public void test032() {
" String bar = \"X2.bar\"; \n" +
"} \n",
},
- "----------\n" +
- "1. ERROR in p\\X.java (at line 4)\n" +
- " System.out.println(new q.X2().foo); \n" +
- " ^^^\n" +
- "The field X2.foo is not visible\n" +
- "----------\n" +
- "2. ERROR in p\\X.java (at line 5)\n" +
- " System.out.println(new q.X2().bar); \n" +
- " ^^^\n" +
- "The field X2.bar is not visible\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in q\\X2.java (at line 3)\n" +
- " protected String foo = \"X2.foo\"; \n" +
- " ^^^\n" +
- "The field X2.foo is hiding a field from type X1\n" +
+ "----------\n" +
+ "1. ERROR in p\\X.java (at line 4)\n" +
+ " System.out.println(new q.X2().foo); \n" +
+ " ^^^\n" +
+ "The field X2.foo is not visible\n" +
+ "----------\n" +
+ "2. ERROR in p\\X.java (at line 5)\n" +
+ " System.out.println(new q.X2().bar); \n" +
+ " ^^^\n" +
+ "The field X2.bar is not visible\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in q\\X2.java (at line 3)\n" +
+ " protected String foo = \"X2.foo\"; \n" +
+ " ^^^\n" +
+ "The field X2.foo is hiding a field from type X1\n" +
"----------\n");
}
/*
@@ -2593,24 +2593,24 @@ public void test079() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Hello.java (at line 1)\n" +
- " void ___eval() {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n" +
- "2. ERROR in Hello.java (at line 2)\n" +
- " new Runnable() {\n" +
- " int ___run() throws Throwable {\n" +
- " return blah;\n" +
- " }\n" +
- " private String blarg;\n" +
- " public void run() {\n" +
- " }\n" +
- " };\n" +
- "}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
+ "----------\n" +
+ "1. ERROR in Hello.java (at line 1)\n" +
+ " void ___eval() {\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Syntax error on tokens, delete these tokens\n" +
+ "----------\n" +
+ "2. ERROR in Hello.java (at line 2)\n" +
+ " new Runnable() {\n" +
+ " int ___run() throws Throwable {\n" +
+ " return blah;\n" +
+ " }\n" +
+ " private String blarg;\n" +
+ " public void run() {\n" +
+ " }\n" +
+ " };\n" +
+ "}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error on tokens, delete these tokens\n" +
"----------\n"
);
}
@@ -3484,21 +3484,21 @@ public void test107() {
" public void xyz() { System.out.println(1); }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " c.xyz();\n" +
- " ^^^^^^^\n" +
- "Unhandled exception type AException\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " class AException extends Exception { }\n" +
- " ^^^^^^^^^^\n" +
- "The serializable class AException does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 8)\n" +
- " class BException extends Exception { }\n" +
- " ^^^^^^^^^^\n" +
- "The serializable class BException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " c.xyz();\n" +
+ " ^^^^^^^\n" +
+ "Unhandled exception type AException\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " class AException extends Exception { }\n" +
+ " ^^^^^^^^^^\n" +
+ "The serializable class AException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 8)\n" +
+ " class BException extends Exception { }\n" +
+ " ^^^^^^^^^^\n" +
+ "The serializable class BException does not declare a static final serialVersionUID field of type long\n" +
"----------\n");
}
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_4.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_4.java
index 776e319c8..1f54df0fa 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_4.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_4.java
@@ -112,36 +112,36 @@ public void test011() {
" } \n" +
"} \n"
},
- "----------\n" +
- "1. ERROR in p1\\X.java (at line 4)\n" +
- " while (false); \n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "2. ERROR in p1\\X.java (at line 5)\n" +
- " while (false) System.out.println(\"unreachable\"); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "3. ERROR in p1\\X.java (at line 8)\n" +
- " for (;false;); \n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "4. ERROR in p1\\X.java (at line 9)\n" +
- " for (;false;) System.out.println(\"unreachable\"); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "5. WARNING in p1\\X.java (at line 10)\n" +
- " if (false); \n" +
- " ^\n" +
- "Dead code\n" +
- "----------\n" +
- "6. WARNING in p1\\X.java (at line 11)\n" +
- " if (false)System.out.println(\"unreachable\"); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in p1\\X.java (at line 4)\n" +
+ " while (false); \n" +
+ " ^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "2. ERROR in p1\\X.java (at line 5)\n" +
+ " while (false) System.out.println(\"unreachable\"); \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "3. ERROR in p1\\X.java (at line 8)\n" +
+ " for (;false;); \n" +
+ " ^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "4. ERROR in p1\\X.java (at line 9)\n" +
+ " for (;false;) System.out.println(\"unreachable\"); \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "5. WARNING in p1\\X.java (at line 10)\n" +
+ " if (false); \n" +
+ " ^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "6. WARNING in p1\\X.java (at line 11)\n" +
+ " if (false)System.out.println(\"unreachable\"); \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n"
);
}
@@ -792,16 +792,16 @@ public void test027() {
" } \n"+
"} \n"
},
- "----------\n" +
- "1. WARNING in p1\\X.java (at line 4)\n" +
- " for (;false;p()); \n" +
- " ^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. ERROR in p1\\X.java (at line 4)\n" +
- " for (;false;p()); \n" +
- " ^\n" +
- "Unreachable code\n" +
+ "----------\n" +
+ "1. WARNING in p1\\X.java (at line 4)\n" +
+ " for (;false;p()); \n" +
+ " ^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. ERROR in p1\\X.java (at line 4)\n" +
+ " for (;false;p()); \n" +
+ " ^\n" +
+ "Unreachable code\n" +
"----------\n");
}
/*
@@ -1020,22 +1020,22 @@ public void test032() {
" String bar = \"X2.bar\"; \n" +
"} \n",
},
- "----------\n" +
- "1. ERROR in p\\X.java (at line 4)\n" +
- " System.out.println(new q.X2().foo); \n" +
- " ^^^\n" +
- "The field X2.foo is not visible\n" +
- "----------\n" +
- "2. ERROR in p\\X.java (at line 5)\n" +
- " System.out.println(new q.X2().bar); \n" +
- " ^^^\n" +
- "The field X2.bar is not visible\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in q\\X2.java (at line 3)\n" +
- " protected String foo = \"X2.foo\"; \n" +
- " ^^^\n" +
- "The field X2.foo is hiding a field from type X1\n" +
+ "----------\n" +
+ "1. ERROR in p\\X.java (at line 4)\n" +
+ " System.out.println(new q.X2().foo); \n" +
+ " ^^^\n" +
+ "The field X2.foo is not visible\n" +
+ "----------\n" +
+ "2. ERROR in p\\X.java (at line 5)\n" +
+ " System.out.println(new q.X2().bar); \n" +
+ " ^^^\n" +
+ "The field X2.bar is not visible\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in q\\X2.java (at line 3)\n" +
+ " protected String foo = \"X2.foo\"; \n" +
+ " ^^^\n" +
+ "The field X2.foo is hiding a field from type X1\n" +
"----------\n");
}
@@ -1250,36 +1250,36 @@ public void test039() {
" } \n"+
"} \n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " for (;false;); \n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " for (;false;){} \n" +
- " ^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " while (false); \n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " while (false){} \n" +
- " ^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 9)\n" +
- " if (false) {} else {} \n" +
- " ^^\n" +
- "Dead code\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 10)\n" +
- " if (false) ; else ; \n" +
- " ^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " for (;false;); \n" +
+ " ^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " for (;false;){} \n" +
+ " ^^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " while (false); \n" +
+ " ^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " while (false){} \n" +
+ " ^^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 9)\n" +
+ " if (false) {} else {} \n" +
+ " ^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 10)\n" +
+ " if (false) ; else ; \n" +
+ " ^\n" +
+ "Dead code\n" +
"----------\n"
);
}
@@ -2620,21 +2620,21 @@ public void _test079() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Hello.java (at line 1)\n" +
- " void ___eval() {\n" +
- " ^^^^\n" +
- "Syntax error on token \"void\", record expected\n" +
- "----------\n" +
- "2. ERROR in Hello.java (at line 1)\n" +
- " void ___eval() {\n" +
- " ^\n" +
- "Syntax error on token \")\", { expected after this token\n" +
- "----------\n" +
- "3. ERROR in Hello.java (at line 23)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete RecordBody\n" +
+ "----------\n" +
+ "1. ERROR in Hello.java (at line 1)\n" +
+ " void ___eval() {\n" +
+ " ^^^^\n" +
+ "Syntax error on token \"void\", record expected\n" +
+ "----------\n" +
+ "2. ERROR in Hello.java (at line 1)\n" +
+ " void ___eval() {\n" +
+ " ^\n" +
+ "Syntax error on token \")\", { expected after this token\n" +
+ "----------\n" +
+ "3. ERROR in Hello.java (at line 23)\n" +
+ " }\n" +
+ " ^\n" +
+ "Syntax error, insert \"}\" to complete RecordBody\n" +
"----------\n"
);
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java
index a435e6e20..3b02c95bd 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java
@@ -118,36 +118,36 @@ public void test011() {
" } \n" +
"} \n"
},
- "----------\n" +
- "1. ERROR in p1\\X.java (at line 4)\n" +
- " while (false); \n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "2. ERROR in p1\\X.java (at line 5)\n" +
- " while (false) System.out.println(\"unreachable\"); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "3. ERROR in p1\\X.java (at line 8)\n" +
- " for (;false;); \n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "4. ERROR in p1\\X.java (at line 9)\n" +
- " for (;false;) System.out.println(\"unreachable\"); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "5. WARNING in p1\\X.java (at line 10)\n" +
- " if (false); \n" +
- " ^\n" +
- "Dead code\n" +
- "----------\n" +
- "6. WARNING in p1\\X.java (at line 11)\n" +
- " if (false)System.out.println(\"unreachable\"); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in p1\\X.java (at line 4)\n" +
+ " while (false); \n" +
+ " ^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "2. ERROR in p1\\X.java (at line 5)\n" +
+ " while (false) System.out.println(\"unreachable\"); \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "3. ERROR in p1\\X.java (at line 8)\n" +
+ " for (;false;); \n" +
+ " ^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "4. ERROR in p1\\X.java (at line 9)\n" +
+ " for (;false;) System.out.println(\"unreachable\"); \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "5. WARNING in p1\\X.java (at line 10)\n" +
+ " if (false); \n" +
+ " ^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "6. WARNING in p1\\X.java (at line 11)\n" +
+ " if (false)System.out.println(\"unreachable\"); \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n");
}
/// binary compatibility
@@ -802,16 +802,16 @@ public void test027() {
" } \n"+
"} \n"
},
- "----------\n" +
- "1. WARNING in p1\\X.java (at line 4)\n" +
- " for (;false;p()); \n" +
- " ^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. ERROR in p1\\X.java (at line 4)\n" +
- " for (;false;p()); \n" +
- " ^\n" +
- "Unreachable code\n" +
+ "----------\n" +
+ "1. WARNING in p1\\X.java (at line 4)\n" +
+ " for (;false;p()); \n" +
+ " ^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. ERROR in p1\\X.java (at line 4)\n" +
+ " for (;false;p()); \n" +
+ " ^\n" +
+ "Unreachable code\n" +
"----------\n"
);
}
@@ -1041,22 +1041,22 @@ public void test032() {
" String bar = \"X2.bar\"; \n" +
"} \n",
},
- "----------\n" +
- "1. ERROR in p\\X.java (at line 4)\n" +
- " System.out.println(new q.X2().foo); \n" +
- " ^^^\n" +
- "The field X2.foo is not visible\n" +
- "----------\n" +
- "2. ERROR in p\\X.java (at line 5)\n" +
- " System.out.println(new q.X2().bar); \n" +
- " ^^^\n" +
- "The field X2.bar is not visible\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in q\\X2.java (at line 3)\n" +
- " protected String foo = \"X2.foo\"; \n" +
- " ^^^\n" +
- "The field X2.foo is hiding a field from type X1\n" +
+ "----------\n" +
+ "1. ERROR in p\\X.java (at line 4)\n" +
+ " System.out.println(new q.X2().foo); \n" +
+ " ^^^\n" +
+ "The field X2.foo is not visible\n" +
+ "----------\n" +
+ "2. ERROR in p\\X.java (at line 5)\n" +
+ " System.out.println(new q.X2().bar); \n" +
+ " ^^^\n" +
+ "The field X2.bar is not visible\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in q\\X2.java (at line 3)\n" +
+ " protected String foo = \"X2.foo\"; \n" +
+ " ^^^\n" +
+ "The field X2.foo is hiding a field from type X1\n" +
"----------\n");
}
@@ -1286,36 +1286,36 @@ public void test039() {
" } \n"+
"} \n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " for (;false;); \n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " for (;false;){} \n" +
- " ^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " while (false); \n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " while (false){} \n" +
- " ^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 9)\n" +
- " if (false) {} else {} \n" +
- " ^^\n" +
- "Dead code\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 10)\n" +
- " if (false) ; else ; \n" +
- " ^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " for (;false;); \n" +
+ " ^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " for (;false;){} \n" +
+ " ^^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " while (false); \n" +
+ " ^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " while (false){} \n" +
+ " ^^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 9)\n" +
+ " if (false) {} else {} \n" +
+ " ^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 10)\n" +
+ " if (false) ; else ; \n" +
+ " ^\n" +
+ "Dead code\n" +
"----------\n");
}
// jls6.5.5.1 - simple type names favor member type over toplevel one.
@@ -2252,24 +2252,24 @@ public void test067() {
"----------\n";
if (this.complianceLevel == ClassFileConstants.JDK1_6) {
expectedError =
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " super(null); //1\n" +
- " ^^^^^^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " super(new M());//2\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " super(null); //1\n" +
+ " ^^^^^^^^^^^^\n" +
+ "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " super(new M());//2\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
"----------\n";
} else if (this.complianceLevel >= ClassFileConstants.JDK1_7) {
expectedError =
- "----------\n" +
- "1. ERROR in X.java (at line 14)\n" +
- " super(new M());//2\n" +
- " ^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 14)\n" +
+ " super(new M());//2\n" +
+ " ^^^^^^^\n" +
+ "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
"----------\n";
}
this.runNegativeTest(
@@ -2354,31 +2354,31 @@ public void test069() {
"----------\n";
if (this.complianceLevel == ClassFileConstants.JDK1_6) {
expectedError =
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " super(new MX4()); // ko\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " this(new MX4()); // ko\n" +
- " ^^^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " super(new MX4()); // ko\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " this(new MX4()); // ko\n" +
+ " ^^^^^^^^^\n" +
+ "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
"----------\n";
} else if (this.complianceLevel >= ClassFileConstants.JDK1_7) {
expectedError =
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " super(new MX4()); // ko\n" +
- " ^^^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " this(new MX4()); // ko\n" +
- " ^^^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " super(new MX4()); // ko\n" +
+ " ^^^^^^^^^\n" +
+ "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " this(new MX4()); // ko\n" +
+ " ^^^^^^^^^\n" +
+ "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
"----------\n";
-
+
}
this.runNegativeTest(
new String[] {
@@ -2748,21 +2748,21 @@ public void _test079() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Hello.java (at line 1)\n" +
- " void ___eval() {\n" +
- " ^^^^\n" +
- "Syntax error on token \"void\", record expected\n" +
- "----------\n" +
- "2. ERROR in Hello.java (at line 1)\n" +
- " void ___eval() {\n" +
- " ^\n" +
- "Syntax error on token \")\", { expected after this token\n" +
- "----------\n" +
- "3. ERROR in Hello.java (at line 23)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete RecordBody\n" +
+ "----------\n" +
+ "1. ERROR in Hello.java (at line 1)\n" +
+ " void ___eval() {\n" +
+ " ^^^^\n" +
+ "Syntax error on token \"void\", record expected\n" +
+ "----------\n" +
+ "2. ERROR in Hello.java (at line 1)\n" +
+ " void ___eval() {\n" +
+ " ^\n" +
+ "Syntax error on token \")\", { expected after this token\n" +
+ "----------\n" +
+ "3. ERROR in Hello.java (at line 23)\n" +
+ " }\n" +
+ " ^\n" +
+ "Syntax error, insert \"}\" to complete RecordBody\n" +
"----------\n"
);
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_6.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_6.java
index 3d83fced8..14ace54a0 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_6.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_6.java
@@ -47,20 +47,20 @@ public void test1() {
this.runConformTest(
new String[] {
"Test.java",
- "public class Test {\n" +
- " public interface MyInterface {\n" +
- " public void hello();\n" +
- " }\n" +
- " private static class MyClass implements MyInterface {\n" +
- " @Override\n" +
- " public void hello() {\n" +
- " System.out.println(\"Hello\");\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " MyClass m = new MyClass();\n" +
- " m.hello();\n" +
- " }\n" +
+ "public class Test {\n" +
+ " public interface MyInterface {\n" +
+ " public void hello();\n" +
+ " }\n" +
+ " private static class MyClass implements MyInterface {\n" +
+ " @Override\n" +
+ " public void hello() {\n" +
+ " System.out.println(\"Hello\");\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " MyClass m = new MyClass();\n" +
+ " m.hello();\n" +
+ " }\n" +
"}"
},
"Hello",
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_7.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_7.java
index 3dbb11f36..654f9bae4 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_7.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_7.java
@@ -48,8 +48,8 @@ public void test1() {
"import java.util.List;\n" +
"public class Z {\n" +
" @SafeVarargs\n" +
- " public static <T> List<T> asList(T... a) {\n" +
- " return null;\n" +
+ " public static <T> List<T> asList(T... a) {\n" +
+ " return null;\n" +
" }\n" +
"}"
},
@@ -91,18 +91,18 @@ public void testBug390889_a() {
this.runConformTest(
new String[] {
"MyComp.java",
- "import java.util.Comparator;\n" +
- "public class MyComp implements Comparator {\n" +
- " @Override\n" +
- " public int compare(Object o1, Object o2) {\n" +
- " return 0;\n" +
- " }\n" +
- "}\n" +
- "class MyStringComp implements Comparator<String> {\n" +
- " @Override\n" +
- " public int compare(String o1, String o2) {\n" +
- " return 0;\n" +
- " }\n" +
+ "import java.util.Comparator;\n" +
+ "public class MyComp implements Comparator {\n" +
+ " @Override\n" +
+ " public int compare(Object o1, Object o2) {\n" +
+ " return 0;\n" +
+ " }\n" +
+ "}\n" +
+ "class MyStringComp implements Comparator<String> {\n" +
+ " @Override\n" +
+ " public int compare(String o1, String o2) {\n" +
+ " return 0;\n" +
+ " }\n" +
"}\n"
},
"",
@@ -120,12 +120,12 @@ public void testBug390889_b() {
runConformTest(
new String[] {
"I1.java",
- "interface I0 {\n" +
- " void foo();\n" +
- "}\n" +
+ "interface I0 {\n" +
+ " void foo();\n" +
+ "}\n" +
"public interface I1 extends I0 {\n" +
- " @Override\n" +
- " default void foo() {}\n" +
+ " @Override\n" +
+ " default void foo() {}\n" +
"}\n"
});
@@ -136,7 +136,7 @@ public void testBug390889_b() {
this.runConformTest(
new String[] {
"C1.java",
- "public class C1 implements I1 {\n" +
+ "public class C1 implements I1 {\n" +
"}\n"
},
"",
@@ -154,8 +154,8 @@ public void testBug390889_c() {
runConformTest(
new String[] {
"I.java",
- "interface I {\n" +
- " default void foo() {}\n" +
+ "interface I {\n" +
+ " default void foo() {}\n" +
"}\n"
});
@@ -166,11 +166,11 @@ public void testBug390889_c() {
this.runConformTest(
new String[] {
"CI.java",
- "public class CI implements I {\n" +
- " void test(I i) {\n" +
- " this.foo();\n" +
- " i.foo();\n" +
- " }\n" +
+ "public class CI implements I {\n" +
+ " void test(I i) {\n" +
+ " this.foo();\n" +
+ " i.foo();\n" +
+ " }\n" +
"}\n"
},
"",
@@ -192,35 +192,35 @@ public void testBug490988() {
this.runNegativeTest(
new String[] {
"Thing.java",
- "import java.util.Comparator;\n" +
- "import java.util.Iterator;\n" +
- "public class Thing implements Iterator<Object> {\n" +
- " void breaking() {\n" +
- " Iterator.super.remove(); // not 1.7-compliant (must be an error)\n" +
- " Comparator.naturalOrder(); // not 1.7-compliant (bad error message)\n" +
- " }\n" +
- " @Override\n" +
- " public boolean hasNext() {\n" +
- " return false;\n" +
- " }\n" +
- " @Override\n" +
- " public Object next() {\n" +
- " return null;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new Thing().breaking();\n" +
- " }\n" +
+ "import java.util.Comparator;\n" +
+ "import java.util.Iterator;\n" +
+ "public class Thing implements Iterator<Object> {\n" +
+ " void breaking() {\n" +
+ " Iterator.super.remove(); // not 1.7-compliant (must be an error)\n" +
+ " Comparator.naturalOrder(); // not 1.7-compliant (bad error message)\n" +
+ " }\n" +
+ " @Override\n" +
+ " public boolean hasNext() {\n" +
+ " return false;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public Object next() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new Thing().breaking();\n" +
+ " }\n" +
"}"
},
"----------\n" +
"1. ERROR in Thing.java (at line 5)\n" +
" Iterator.super.remove(); // not 1.7-compliant (must be an error)\n" +
- " ^^^^^^^^^^^^^^\n" +
+ " ^^^^^^^^^^^^^^\n" +
"Super method references to interface default methods are allowed only at source level 1.8 or above\n" +
"----------\n" +
"2. ERROR in Thing.java (at line 6)\n" +
" Comparator.naturalOrder(); // not 1.7-compliant (bad error message)\n" +
- " ^^^^^^^^^^^^\n" +
+ " ^^^^^^^^^^^^\n" +
"References to interface static methods are allowed only at source level 1.8 or above\n" +
"----------\n",
null,
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConcurrentBatchCompilerTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConcurrentBatchCompilerTest.java
index 6cb58d015..621ac9f83 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConcurrentBatchCompilerTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConcurrentBatchCompilerTest.java
@@ -25,7 +25,7 @@ import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
@SuppressWarnings({ "unchecked", "rawtypes" })
public class ConcurrentBatchCompilerTest extends BatchCompilerTest {
-
+
public static Test suite() {
return buildUniqueComplianceTestSuite(testClass(), ClassFileConstants.JDK1_6);
}
@@ -40,7 +40,7 @@ public class ConcurrentBatchCompilerTest extends BatchCompilerTest {
Thread runner2;
static int COUNT = 100;
-
+
/* Invoke the compiler COUNT times to increase bug probabililty. */
protected boolean invokeCompiler(PrintWriter out, PrintWriter err, Object extraArguments, TestCompilationProgress compilationProgress) {
boolean success = true;
@@ -49,7 +49,7 @@ public class ConcurrentBatchCompilerTest extends BatchCompilerTest {
}
return success;
}
-
+
/* Disambiguate file names for concurrent tests in the same directory. */
protected String testName() {
Thread current = Thread.currentThread();
@@ -60,11 +60,11 @@ public class ConcurrentBatchCompilerTest extends BatchCompilerTest {
return baseName+"-Thread2";
return baseName;
}
-
+
public void testBug372319() throws Throwable {
try {
FakedTrackingVariable.TEST_372319 = true;
-
+
// expected error output for runner2 times COUNT:
final StringBuffer errorOutput = new StringBuffer();
for (int j=0; j<COUNT; j++)
@@ -75,72 +75,72 @@ public class ConcurrentBatchCompilerTest extends BatchCompilerTest {
"Potential resource leak: \'reader\' may not be closed\n" +
"----------\n" +
"1 problem (1 error)\n");
-
+
// collect exceptions indicating a failure:
final Throwable[] thrown = new Throwable[2];
-
+
this.runner1 = new Thread(new Runnable() {
public void run() {
try {
runConformTest(new String[] {
"org/eclipse/jdt/internal/launching/CompositeId.java",
- "/*******************************************************************************\n" +
- " * Copyright (c) 2000, 2014 IBM Corporation and others.\n" +
- " * All rights reserved. This program and the accompanying materials\n" +
- " * are made available under the terms of the Eclipse Public License v1.0\n" +
- " * which accompanies this distribution, and is available at\n" +
- " * http://www.eclipse.org/legal/epl-v10.html\n" +
- " * \n" +
- " * Contributors:\n" +
- " * IBM Corporation - initial API and implementation\n" +
- " *******************************************************************************/\n" +
- "package org.eclipse.jdt.internal.launching;\n" +
- "\n" +
- "import java.util.ArrayList;\n" +
- "\n" +
- "/**\n" +
- " * Utility class for id's made of multiple Strings\n" +
- " */\n" +
- "public class CompositeId {\n" +
- " private String[] fParts;\n" +
- " \n" +
- " public CompositeId(String[] parts) {\n" +
- " fParts= parts;\n" +
- " }\n" +
- " \n" +
- " public static CompositeId fromString(String idString) {\n" +
- " ArrayList<String> parts= new ArrayList<String>();\n" +
- " int commaIndex= idString.indexOf(',');\n" +
- " while (commaIndex > 0) {\n" +
- " int length= Integer.valueOf(idString.substring(0, commaIndex)).intValue();\n" +
- " String part= idString.substring(commaIndex+1, commaIndex+1+length);\n" +
- " parts.add(part);\n" +
- " idString= idString.substring(commaIndex+1+length);\n" +
- " commaIndex= idString.indexOf(',');\n" +
- " }\n" +
- " String[] result= parts.toArray(new String[parts.size()]);\n" +
- " return new CompositeId(result);\n" +
- " }\n" +
- " \n" +
- " @Override\n" +
- " public String toString() {\n" +
+ "/*******************************************************************************\n" +
+ " * Copyright (c) 2000, 2014 IBM Corporation and others.\n" +
+ " * All rights reserved. This program and the accompanying materials\n" +
+ " * are made available under the terms of the Eclipse Public License v1.0\n" +
+ " * which accompanies this distribution, and is available at\n" +
+ " * http://www.eclipse.org/legal/epl-v10.html\n" +
+ " * \n" +
+ " * Contributors:\n" +
+ " * IBM Corporation - initial API and implementation\n" +
+ " *******************************************************************************/\n" +
+ "package org.eclipse.jdt.internal.launching;\n" +
+ "\n" +
+ "import java.util.ArrayList;\n" +
+ "\n" +
+ "/**\n" +
+ " * Utility class for id's made of multiple Strings\n" +
+ " */\n" +
+ "public class CompositeId {\n" +
+ " private String[] fParts;\n" +
+ " \n" +
+ " public CompositeId(String[] parts) {\n" +
+ " fParts= parts;\n" +
+ " }\n" +
+ " \n" +
+ " public static CompositeId fromString(String idString) {\n" +
+ " ArrayList<String> parts= new ArrayList<String>();\n" +
+ " int commaIndex= idString.indexOf(',');\n" +
+ " while (commaIndex > 0) {\n" +
+ " int length= Integer.valueOf(idString.substring(0, commaIndex)).intValue();\n" +
+ " String part= idString.substring(commaIndex+1, commaIndex+1+length);\n" +
+ " parts.add(part);\n" +
+ " idString= idString.substring(commaIndex+1+length);\n" +
+ " commaIndex= idString.indexOf(',');\n" +
+ " }\n" +
+ " String[] result= parts.toArray(new String[parts.size()]);\n" +
+ " return new CompositeId(result);\n" +
+ " }\n" +
+ " \n" +
+ " @Override\n" +
+ " public String toString() {\n" +
" StringBuffer buf= new StringBuffer();\n" +
- " for (int i= 0; i < fParts.length; i++) {\n" +
- " buf.append(fParts[i].length());\n" +
- " buf.append(',');\n" +
- " buf.append(fParts[i]);\n" +
- " }\n" +
- " return buf.toString();\n" +
- " }\n" +
- " \n" +
- " public String get(int index) {\n" +
- " return fParts[index];\n" +
- " }\n" +
- " \n" +
- " public int getPartCount() {\n" +
- " return fParts.length;\n" +
- " }\n" +
- "}\n" +
+ " for (int i= 0; i < fParts.length; i++) {\n" +
+ " buf.append(fParts[i].length());\n" +
+ " buf.append(',');\n" +
+ " buf.append(fParts[i]);\n" +
+ " }\n" +
+ " return buf.toString();\n" +
+ " }\n" +
+ " \n" +
+ " public String get(int index) {\n" +
+ " return fParts[index];\n" +
+ " }\n" +
+ " \n" +
+ " public int getPartCount() {\n" +
+ " return fParts.length;\n" +
+ " }\n" +
+ "}\n" +
""
},
"\"" + OUTPUT_DIR + File.separator + "org/eclipse/jdt/internal/launching/CompositeId.java\""
@@ -195,7 +195,7 @@ public class ConcurrentBatchCompilerTest extends BatchCompilerTest {
}
}
});
-
+
this.runner2.start();
this.runner1.start();
this.runner1.join();
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConditionalExpressionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConditionalExpressionTest.java
index c9594263c..0cba2a22e 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConditionalExpressionTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConditionalExpressionTest.java
@@ -78,7 +78,7 @@ public class ConditionalExpressionTest extends AbstractRegressionTest {
""
);
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426078, Bug 426078 - [1.8] VerifyError when conditional expression passed as an argument
public void test003() {
if (this.complianceLevel < ClassFileConstants.JDK1_5)
@@ -101,7 +101,7 @@ public class ConditionalExpressionTest extends AbstractRegressionTest {
"true"
);
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=423685, - [1.8] poly conditional expression must not use lub
public void test004() {
if (this.complianceLevel < ClassFileConstants.JDK1_5)
@@ -123,11 +123,11 @@ public class ConditionalExpressionTest extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " G<? super B> l = (true)? gsa : gb;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from G<capture#2-of ? extends Object> to G<? super B>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " G<? super B> l = (true)? gsa : gb;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from G<capture#2-of ? extends Object> to G<? super B>\n" +
"----------\n"
);
} else {
@@ -151,7 +151,7 @@ public class ConditionalExpressionTest extends AbstractRegressionTest {
);
}
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425181, - Cast expression in ternary operation reported as incompatible
public void test005() {
if (this.complianceLevel < ClassFileConstants.JDK1_5)
@@ -169,26 +169,26 @@ public class ConditionalExpressionTest extends AbstractRegressionTest {
"interface I<T> {}\n" +
"interface J<T> extends I<T> {}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " I<? super J> i = true ? (I<I>) null : (I<J>) null; // Type mismatch reported\n" +
- " ^\n" +
- "J is a raw type. References to generic type J<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " I<? super J> i = true ? (I<I>) null : (I<J>) null; // Type mismatch reported\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from I<capture#1-of ? extends I> to I<? super J>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 3)\n" +
- " I<? super J> i = true ? (I<I>) null : (I<J>) null; // Type mismatch reported\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<T> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 3)\n" +
- " I<? super J> i = true ? (I<I>) null : (I<J>) null; // Type mismatch reported\n" +
- " ^\n" +
- "J is a raw type. References to generic type J<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " I<? super J> i = true ? (I<I>) null : (I<J>) null; // Type mismatch reported\n" +
+ " ^\n" +
+ "J is a raw type. References to generic type J<T> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " I<? super J> i = true ? (I<I>) null : (I<J>) null; // Type mismatch reported\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from I<capture#1-of ? extends I> to I<? super J>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 3)\n" +
+ " I<? super J> i = true ? (I<I>) null : (I<J>) null; // Type mismatch reported\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<T> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 3)\n" +
+ " I<? super J> i = true ? (I<I>) null : (I<J>) null; // Type mismatch reported\n" +
+ " ^\n" +
+ "J is a raw type. References to generic type J<T> should be parameterized\n" +
"----------\n"
);
} else {
@@ -251,16 +251,16 @@ public class ConditionalExpressionTest extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " foo(false ? (a,b)->a+b :new StringCatenation());\n" +
- " ^^^\n" +
- "The method foo(BinaryOperation<Integer>) in the type X is not applicable for the arguments ((false ? (<no type> a, <no type> b) -> (a + b) : new StringCatenation()))\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " foo(false ? (a,b)->a+b :new StringCatenation());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from StringCatenation to BinaryOperation<Integer>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " foo(false ? (a,b)->a+b :new StringCatenation());\n" +
+ " ^^^\n" +
+ "The method foo(BinaryOperation<Integer>) in the type X is not applicable for the arguments ((false ? (<no type> a, <no type> b) -> (a + b) : new StringCatenation()))\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " foo(false ? (a,b)->a+b :new StringCatenation());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from StringCatenation to BinaryOperation<Integer>\n" +
"----------\n"
);
}
@@ -286,21 +286,21 @@ public class ConditionalExpressionTest extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " foo(false ? new StringCatenation() : (a,b)->a+b);\n" +
- " ^^^\n" +
- "The method foo(BinaryOperation<Integer>) in the type X is not applicable for the arguments ((false ? new StringCatenation() : (<no type> a, <no type> b) -> (a + b)))\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " foo(false ? new StringCatenation() : (a,b)->a+b);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from StringCatenation to BinaryOperation<Integer>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " foo(false ? new StringCatenation() : (a,b)->a+b);\n" +
+ " ^^^\n" +
+ "The method foo(BinaryOperation<Integer>) in the type X is not applicable for the arguments ((false ? new StringCatenation() : (<no type> a, <no type> b) -> (a + b)))\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " foo(false ? new StringCatenation() : (a,b)->a+b);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from StringCatenation to BinaryOperation<Integer>\n" +
"----------\n"
);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427207, - [1.8][bytecode] Runtime type problem: Instruction type does not match stack map
- // Reference poly conditional in assignment context
+ // Reference poly conditional in assignment context
public void test009() {
if (this.complianceLevel < ClassFileConstants.JDK1_8)
return;
@@ -330,7 +330,7 @@ public class ConditionalExpressionTest extends AbstractRegressionTest {
"SomeInt instance");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427207, - [1.8][bytecode] Runtime type problem: Instruction type does not match stack map
- // Reference poly conditional in poly invocation context
+ // Reference poly conditional in poly invocation context
public void test010() {
if (this.complianceLevel < ClassFileConstants.JDK1_8)
return;
@@ -486,11 +486,11 @@ public class ConditionalExpressionTest extends AbstractRegressionTest {
"}\n",
},
this.complianceLevel < ClassFileConstants.JDK1_5 ? "" :
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " public X(Class clazz) {\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " public X(Class clazz) {\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427438, - NPE at org.eclipse.jdt.internal.compiler.ast.ConditionalExpression.generateCode
@@ -513,11 +513,11 @@ public class ConditionalExpressionTest extends AbstractRegressionTest {
"}\n",
},
this.complianceLevel < ClassFileConstants.JDK1_5 ? "" :
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " public X(Class clazz) {\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " public X(Class clazz) {\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427625, - NPE at org.eclipse.jdt.internal.compiler.ast.ConditionalExpression.generateCode
@@ -546,7 +546,7 @@ public class ConditionalExpressionTest extends AbstractRegressionTest {
},
"",
null, true, options);
- }
+ }
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=432487, NullPointerException during compilation using jdk1.8.0
public void testBug432487() {
this.runNegativeTest(
@@ -617,14 +617,14 @@ public class ConditionalExpressionTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"Main.java",
- "public class Main {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " if ((false) ? true: null);\n" +
- " } catch(NullPointerException npe) {\n" +
- " System.out.println(\"Success\");\n" +
- " }\n" +
- " }\n" +
+ "public class Main {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
+ " if ((false) ? true: null);\n" +
+ " } catch(NullPointerException npe) {\n" +
+ " System.out.println(\"Success\");\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
"Success");
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConstantTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConstantTest.java
index 28c2127cd..3788ca601 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConstantTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConstantTest.java
@@ -367,125 +367,125 @@ public void test009() throws Exception {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
- " // Stack: 3, Locals: 4\n" +
- " public static void main(java.lang.String[] args);\n" +
- " 0 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 3 ldc <String \"1\"> [22]\n" +
- " 5 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
- " 8 aconst_null\n" +
- " 9 aconst_null\n" +
- " 10 if_acmpne 21\n" +
- " 13 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 16 ldc <String \"2\"> [30]\n" +
- " 18 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
- " 21 new java.lang.StringBuffer [32]\n" +
- " 24 dup\n" +
- " 25 ldc <String \"[\"> [34]\n" +
- " 27 invokespecial java.lang.StringBuffer(java.lang.String) [36]\n" +
- " 30 aconst_null\n" +
- " 31 invokevirtual java.lang.StringBuffer.append(java.lang.Object) : java.lang.StringBuffer [38]\n" +
- " 34 ldc <String \"]\"> [42]\n" +
- " 36 invokevirtual java.lang.StringBuffer.append(java.lang.String) : java.lang.StringBuffer [44]\n" +
- " 39 invokevirtual java.lang.StringBuffer.toString() : java.lang.String [47]\n" +
- " 42 ldc <String \"[null]\"> [51]\n" +
- " 44 if_acmpne 51\n" +
- " 47 iconst_1\n" +
- " 48 goto 52\n" +
- " 51 iconst_0\n" +
- " 52 istore_1 [b]\n" +
- " 53 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 56 ldc <String \"3\"> [53]\n" +
- " 58 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
- " 61 aconst_null\n" +
- " 62 astore_2 [s]\n" +
- " 63 aload_2 [s]\n" +
- " 64 ifnonnull 75\n" +
- " 67 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 70 ldc <String \"4\"> [55]\n" +
- " 72 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
- " 75 ldc <String \"aaa\"> [57]\n" +
- " 77 astore_3 [s2]\n" +
- " 78 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 81 ldc <String \"5\"> [59]\n" +
- " 83 invokevirtual java.io.PrintStream.println(java.lang.String) : void [61]\n" +
- " 86 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
- " [pc: 8, line: 4]\n" +
- " [pc: 13, line: 5]\n" +
- " [pc: 21, line: 6]\n" +
- " [pc: 53, line: 7]\n" +
- " [pc: 61, line: 8]\n" +
- " [pc: 63, line: 9]\n" +
- " [pc: 75, line: 10]\n" +
- " [pc: 78, line: 11]\n" +
- " [pc: 86, line: 12]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 87] local: args index: 0 type: java.lang.String[]\n" +
- " [pc: 53, pc: 87] local: b index: 1 type: boolean\n" +
- " [pc: 63, pc: 87] local: s index: 2 type: java.lang.String\n" +
+ " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
+ " // Stack: 3, Locals: 4\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 3 ldc <String \"1\"> [22]\n" +
+ " 5 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
+ " 8 aconst_null\n" +
+ " 9 aconst_null\n" +
+ " 10 if_acmpne 21\n" +
+ " 13 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 16 ldc <String \"2\"> [30]\n" +
+ " 18 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
+ " 21 new java.lang.StringBuffer [32]\n" +
+ " 24 dup\n" +
+ " 25 ldc <String \"[\"> [34]\n" +
+ " 27 invokespecial java.lang.StringBuffer(java.lang.String) [36]\n" +
+ " 30 aconst_null\n" +
+ " 31 invokevirtual java.lang.StringBuffer.append(java.lang.Object) : java.lang.StringBuffer [38]\n" +
+ " 34 ldc <String \"]\"> [42]\n" +
+ " 36 invokevirtual java.lang.StringBuffer.append(java.lang.String) : java.lang.StringBuffer [44]\n" +
+ " 39 invokevirtual java.lang.StringBuffer.toString() : java.lang.String [47]\n" +
+ " 42 ldc <String \"[null]\"> [51]\n" +
+ " 44 if_acmpne 51\n" +
+ " 47 iconst_1\n" +
+ " 48 goto 52\n" +
+ " 51 iconst_0\n" +
+ " 52 istore_1 [b]\n" +
+ " 53 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 56 ldc <String \"3\"> [53]\n" +
+ " 58 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
+ " 61 aconst_null\n" +
+ " 62 astore_2 [s]\n" +
+ " 63 aload_2 [s]\n" +
+ " 64 ifnonnull 75\n" +
+ " 67 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 70 ldc <String \"4\"> [55]\n" +
+ " 72 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
+ " 75 ldc <String \"aaa\"> [57]\n" +
+ " 77 astore_3 [s2]\n" +
+ " 78 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 81 ldc <String \"5\"> [59]\n" +
+ " 83 invokevirtual java.io.PrintStream.println(java.lang.String) : void [61]\n" +
+ " 86 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
+ " [pc: 8, line: 4]\n" +
+ " [pc: 13, line: 5]\n" +
+ " [pc: 21, line: 6]\n" +
+ " [pc: 53, line: 7]\n" +
+ " [pc: 61, line: 8]\n" +
+ " [pc: 63, line: 9]\n" +
+ " [pc: 75, line: 10]\n" +
+ " [pc: 78, line: 11]\n" +
+ " [pc: 86, line: 12]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 87] local: args index: 0 type: java.lang.String[]\n" +
+ " [pc: 53, pc: 87] local: b index: 1 type: boolean\n" +
+ " [pc: 63, pc: 87] local: s index: 2 type: java.lang.String\n" +
" [pc: 78, pc: 87] local: s2 index: 3 type: java.lang.String\n";
String expectedOutput15 =
- " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
- " // Stack: 3, Locals: 4\n" +
- " public static void main(java.lang.String[] args);\n" +
- " 0 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 3 ldc <String \"1\"> [22]\n" +
- " 5 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
- " 8 aconst_null\n" +
- " 9 aconst_null\n" +
- " 10 if_acmpne 21\n" +
- " 13 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 16 ldc <String \"2\"> [30]\n" +
- " 18 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
- " 21 new java.lang.StringBuilder [32]\n" +
- " 24 dup\n" +
- " 25 ldc <String \"[\"> [34]\n" +
- " 27 invokespecial java.lang.StringBuilder(java.lang.String) [36]\n" +
- " 30 aconst_null\n" +
- " 31 invokevirtual java.lang.StringBuilder.append(java.lang.Object) : java.lang.StringBuilder [38]\n" +
- " 34 ldc <String \"]\"> [42]\n" +
- " 36 invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [44]\n" +
- " 39 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [47]\n" +
- " 42 ldc <String \"[null]\"> [51]\n" +
- " 44 if_acmpne 51\n" +
- " 47 iconst_1\n" +
- " 48 goto 52\n" +
- " 51 iconst_0\n" +
- " 52 istore_1 [b]\n" +
- " 53 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 56 ldc <String \"3\"> [53]\n" +
- " 58 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
- " 61 aconst_null\n" +
- " 62 astore_2 [s]\n" +
- " 63 aload_2 [s]\n" +
- " 64 ifnonnull 75\n" +
- " 67 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 70 ldc <String \"4\"> [55]\n" +
- " 72 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
- " 75 ldc <String \"aaa\"> [57]\n" +
- " 77 astore_3 [s2]\n" +
- " 78 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 81 ldc <String \"5\"> [59]\n" +
- " 83 invokevirtual java.io.PrintStream.println(java.lang.String) : void [61]\n" +
- " 86 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
- " [pc: 8, line: 4]\n" +
- " [pc: 13, line: 5]\n" +
- " [pc: 21, line: 6]\n" +
- " [pc: 53, line: 7]\n" +
- " [pc: 61, line: 8]\n" +
- " [pc: 63, line: 9]\n" +
- " [pc: 75, line: 10]\n" +
- " [pc: 78, line: 11]\n" +
- " [pc: 86, line: 12]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 87] local: args index: 0 type: java.lang.String[]\n" +
- " [pc: 53, pc: 87] local: b index: 1 type: boolean\n" +
- " [pc: 63, pc: 87] local: s index: 2 type: java.lang.String\n" +
+ " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
+ " // Stack: 3, Locals: 4\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 3 ldc <String \"1\"> [22]\n" +
+ " 5 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
+ " 8 aconst_null\n" +
+ " 9 aconst_null\n" +
+ " 10 if_acmpne 21\n" +
+ " 13 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 16 ldc <String \"2\"> [30]\n" +
+ " 18 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
+ " 21 new java.lang.StringBuilder [32]\n" +
+ " 24 dup\n" +
+ " 25 ldc <String \"[\"> [34]\n" +
+ " 27 invokespecial java.lang.StringBuilder(java.lang.String) [36]\n" +
+ " 30 aconst_null\n" +
+ " 31 invokevirtual java.lang.StringBuilder.append(java.lang.Object) : java.lang.StringBuilder [38]\n" +
+ " 34 ldc <String \"]\"> [42]\n" +
+ " 36 invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [44]\n" +
+ " 39 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [47]\n" +
+ " 42 ldc <String \"[null]\"> [51]\n" +
+ " 44 if_acmpne 51\n" +
+ " 47 iconst_1\n" +
+ " 48 goto 52\n" +
+ " 51 iconst_0\n" +
+ " 52 istore_1 [b]\n" +
+ " 53 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 56 ldc <String \"3\"> [53]\n" +
+ " 58 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
+ " 61 aconst_null\n" +
+ " 62 astore_2 [s]\n" +
+ " 63 aload_2 [s]\n" +
+ " 64 ifnonnull 75\n" +
+ " 67 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 70 ldc <String \"4\"> [55]\n" +
+ " 72 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
+ " 75 ldc <String \"aaa\"> [57]\n" +
+ " 77 astore_3 [s2]\n" +
+ " 78 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 81 ldc <String \"5\"> [59]\n" +
+ " 83 invokevirtual java.io.PrintStream.println(java.lang.String) : void [61]\n" +
+ " 86 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
+ " [pc: 8, line: 4]\n" +
+ " [pc: 13, line: 5]\n" +
+ " [pc: 21, line: 6]\n" +
+ " [pc: 53, line: 7]\n" +
+ " [pc: 61, line: 8]\n" +
+ " [pc: 63, line: 9]\n" +
+ " [pc: 75, line: 10]\n" +
+ " [pc: 78, line: 11]\n" +
+ " [pc: 86, line: 12]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 87] local: args index: 0 type: java.lang.String[]\n" +
+ " [pc: 53, pc: 87] local: b index: 1 type: boolean\n" +
+ " [pc: 63, pc: 87] local: s index: 2 type: java.lang.String\n" +
" [pc: 78, pc: 87] local: s2 index: 3 type: java.lang.String\n";
if (this.complianceLevel >= ClassFileConstants.JDK1_5) {
@@ -1171,7 +1171,7 @@ public void testAllConstants() {
verifyConstantEqualsAndHashcode(enumConstantSignature, enumConstantSignature2, enumConstantSignature3, byteConstant);
verifyConstantEqualsAndHashcode(enumConstantSignature, enumConstantSignature4, enumConstantSignature3, byteConstant);
assertNotNull(Constant.NotAConstant.toString());
-
+
verifyValues(byteConstant, charConstant, booleanConstant, doubleConstant, floatConstant, intConstant, longConstant, shortConstant, stringConstant);
// check equals between to null string constants
assertTrue(stringConstant4.equals(stringConstant5));
@@ -1408,7 +1408,7 @@ private void verifyConstantEqualsAndHashcode(
assertFalse(o.equals(null));
assertFalse(o.hashCode() == o2.hashCode());
assertNotNull(o.toString());
-
+
if (o instanceof Constant) {
assertTrue("Not the same values", ((Constant) o).hasSameValue((Constant) o3));
assertFalse("Have same values", ((Constant) o).hasSameValue((Constant) o2));
@@ -1449,27 +1449,27 @@ public void test021() {
" }\n" +
"}",
},
- "0\n" +
- "-9223372036854775808\n" +
- "-9223372036854775808\n" +
- "-9223372036854775808\n" +
- "-9223372036854775808\n" +
- "-9223372036854775808\n" +
- "-9223372036854775808\n" +
- "9223372036854775807\n" +
- "9223372036854775807\n" +
- "9223372036854775807\n" +
- "9223372036854775807\n" +
- "9223372036854775807\n" +
- "9223372036854775807\n" +
- "-1\n" +
- "-1\n" +
- "-1\n" +
- "-1\n" +
- "-1\n" +
- "-1\n" +
- "-1\n" +
- "8070450532247928831\n" +
+ "0\n" +
+ "-9223372036854775808\n" +
+ "-9223372036854775808\n" +
+ "-9223372036854775808\n" +
+ "-9223372036854775808\n" +
+ "-9223372036854775808\n" +
+ "-9223372036854775808\n" +
+ "9223372036854775807\n" +
+ "9223372036854775807\n" +
+ "9223372036854775807\n" +
+ "9223372036854775807\n" +
+ "9223372036854775807\n" +
+ "9223372036854775807\n" +
+ "-1\n" +
+ "-1\n" +
+ "-1\n" +
+ "-1\n" +
+ "-1\n" +
+ "-1\n" +
+ "-1\n" +
+ "8070450532247928831\n" +
"8070450532247928831\n" +
"0\n" +
"0");
@@ -1492,21 +1492,21 @@ public void test022() {
" System.out.println(0x0000000000000ffffffff); // OK\n" +
" System.out.println(037777777777); // OK\n" +
" System.out.println(-0x1); // OK\n" +
- " System.out.println(0xDADACAFE);\n" +
+ " System.out.println(0xDADACAFE);\n" +
" System.out.println(0x0000000000000); // OK\n" +
" }\n" +
"}",
},
- "0\n" +
- "-2147483648\n" +
- "-2147483648\n" +
- "-2147483648\n" +
- "2147483647\n" +
- "2147483647\n" +
- "2147483647\n" +
- "-1\n" +
- "-1\n" +
- "-1\n" +
+ "0\n" +
+ "-2147483648\n" +
+ "-2147483648\n" +
+ "-2147483648\n" +
+ "2147483647\n" +
+ "2147483647\n" +
+ "2147483647\n" +
+ "-1\n" +
+ "-1\n" +
+ "-1\n" +
"-1\n" +
"-623195394\n" +
"0");
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DebugAttributeTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DebugAttributeTest.java
index c969c2237..453ce1c6f 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DebugAttributeTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DebugAttributeTest.java
@@ -151,12 +151,12 @@ public void test003() throws Exception {
" List l2 = new ArrayList();\n" +
" l.add(new X());\n" +
" for (Iterator iterator = l.iterator(); iterator.hasNext() ;) {\n" +
- " l2.add(((X) iterator.next()).toString()\n" +
+ " l2.add(((X) iterator.next()).toString()\n" +
" .substring(3));\n" +
- " }\n" +
+ " }\n" +
" for (Iterator iterator = l2.iterator(); iterator.hasNext() ;) {\n" +
" System.out.println(iterator.next());\n" +
- " }\n" +
+ " }\n" +
" }" +
" public String toString() {\n" +
" return \"NO_SUCCESS\";\n" +
@@ -166,63 +166,63 @@ public void test003() throws Exception {
"SUCCESS");
String expectedOutput =
- " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
- " // Stack: 3, Locals: 4\n" +
- " public static void main(java.lang.String[] args);\n" +
- " 0 new java.util.ArrayList [16]\n" +
- " 3 dup\n" +
- " 4 invokespecial java.util.ArrayList() [18]\n" +
- " 7 astore_1 [l]\n" +
- " 8 new java.util.ArrayList [16]\n" +
- " 11 dup\n" +
- " 12 invokespecial java.util.ArrayList() [18]\n" +
- " 15 astore_2 [l2]\n" +
- " 16 aload_1 [l]\n" +
- " 17 new X [1]\n" +
- " 20 dup\n" +
- " 21 invokespecial X() [19]\n" +
- " 24 invokeinterface java.util.List.add(java.lang.Object) : boolean [20] [nargs: 2]\n" +
- " 29 pop\n" +
- " 30 aload_1 [l]\n" +
- " 31 invokeinterface java.util.List.iterator() : java.util.Iterator [26] [nargs: 1]\n" +
- " 36 astore_3 [iterator]\n" +
- " 37 goto 63\n" +
- " 40 aload_2 [l2]\n" +
- " 41 aload_3 [iterator]\n" +
- " 42 invokeinterface java.util.Iterator.next() : java.lang.Object [30] [nargs: 1]\n" +
- " 47 checkcast X [1]\n" +
- " 50 invokevirtual X.toString() : java.lang.String [36]\n" +
- " 53 iconst_3\n" +
- " 54 invokevirtual java.lang.String.substring(int) : java.lang.String [40]\n" +
- " 57 invokeinterface java.util.List.add(java.lang.Object) : boolean [20] [nargs: 2]\n" +
- " 62 pop\n" +
- " 63 aload_3 [iterator]\n" +
- " 64 invokeinterface java.util.Iterator.hasNext() : boolean [46] [nargs: 1]\n" +
- " 69 ifne 40\n" +
- " 72 aload_2 [l2]\n" +
- " 73 invokeinterface java.util.List.iterator() : java.util.Iterator [26] [nargs: 1]\n" +
- " 78 astore_3 [iterator]\n" +
- " 79 goto 94\n" +
- " 82 getstatic java.lang.System.out : java.io.PrintStream [50]\n" +
- " 85 aload_3 [iterator]\n" +
- " 86 invokeinterface java.util.Iterator.next() : java.lang.Object [30] [nargs: 1]\n" +
- " 91 invokevirtual java.io.PrintStream.println(java.lang.Object) : void [56]\n" +
- " 94 aload_3 [iterator]\n" +
- " 95 invokeinterface java.util.Iterator.hasNext() : boolean [46] [nargs: 1]\n" +
- " 100 ifne 82\n" +
- " 103 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 6]\n" +
- " [pc: 8, line: 7]\n" +
- " [pc: 16, line: 8]\n" +
- " [pc: 30, line: 9]\n" +
- " [pc: 40, line: 10]\n" +
- " [pc: 53, line: 11]\n" +
- " [pc: 57, line: 10]\n" +
- " [pc: 63, line: 9]\n" +
- " [pc: 72, line: 13]\n" +
- " [pc: 82, line: 14]\n" +
- " [pc: 94, line: 13]\n" +
+ " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
+ " // Stack: 3, Locals: 4\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 new java.util.ArrayList [16]\n" +
+ " 3 dup\n" +
+ " 4 invokespecial java.util.ArrayList() [18]\n" +
+ " 7 astore_1 [l]\n" +
+ " 8 new java.util.ArrayList [16]\n" +
+ " 11 dup\n" +
+ " 12 invokespecial java.util.ArrayList() [18]\n" +
+ " 15 astore_2 [l2]\n" +
+ " 16 aload_1 [l]\n" +
+ " 17 new X [1]\n" +
+ " 20 dup\n" +
+ " 21 invokespecial X() [19]\n" +
+ " 24 invokeinterface java.util.List.add(java.lang.Object) : boolean [20] [nargs: 2]\n" +
+ " 29 pop\n" +
+ " 30 aload_1 [l]\n" +
+ " 31 invokeinterface java.util.List.iterator() : java.util.Iterator [26] [nargs: 1]\n" +
+ " 36 astore_3 [iterator]\n" +
+ " 37 goto 63\n" +
+ " 40 aload_2 [l2]\n" +
+ " 41 aload_3 [iterator]\n" +
+ " 42 invokeinterface java.util.Iterator.next() : java.lang.Object [30] [nargs: 1]\n" +
+ " 47 checkcast X [1]\n" +
+ " 50 invokevirtual X.toString() : java.lang.String [36]\n" +
+ " 53 iconst_3\n" +
+ " 54 invokevirtual java.lang.String.substring(int) : java.lang.String [40]\n" +
+ " 57 invokeinterface java.util.List.add(java.lang.Object) : boolean [20] [nargs: 2]\n" +
+ " 62 pop\n" +
+ " 63 aload_3 [iterator]\n" +
+ " 64 invokeinterface java.util.Iterator.hasNext() : boolean [46] [nargs: 1]\n" +
+ " 69 ifne 40\n" +
+ " 72 aload_2 [l2]\n" +
+ " 73 invokeinterface java.util.List.iterator() : java.util.Iterator [26] [nargs: 1]\n" +
+ " 78 astore_3 [iterator]\n" +
+ " 79 goto 94\n" +
+ " 82 getstatic java.lang.System.out : java.io.PrintStream [50]\n" +
+ " 85 aload_3 [iterator]\n" +
+ " 86 invokeinterface java.util.Iterator.next() : java.lang.Object [30] [nargs: 1]\n" +
+ " 91 invokevirtual java.io.PrintStream.println(java.lang.Object) : void [56]\n" +
+ " 94 aload_3 [iterator]\n" +
+ " 95 invokeinterface java.util.Iterator.hasNext() : boolean [46] [nargs: 1]\n" +
+ " 100 ifne 82\n" +
+ " 103 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 6]\n" +
+ " [pc: 8, line: 7]\n" +
+ " [pc: 16, line: 8]\n" +
+ " [pc: 30, line: 9]\n" +
+ " [pc: 40, line: 10]\n" +
+ " [pc: 53, line: 11]\n" +
+ " [pc: 57, line: 10]\n" +
+ " [pc: 63, line: 9]\n" +
+ " [pc: 72, line: 13]\n" +
+ " [pc: 82, line: 14]\n" +
+ " [pc: 94, line: 13]\n" +
" [pc: 103, line: 16]\n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -242,39 +242,39 @@ public void test004() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X{\n" +
- " public class Inner {\n" +
- " public void foo() {\n" +
- " int i = 0;\n" +
- " final int NEW = 1;\n" +
- " if (i == NEW) {\n" +
- " System.out.println();\n" +
- " }\n" +
- " bar();\n" +
- " }\n" +
- " }\n" +
- " public void bar() {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new X().new Inner().foo();\n" +
- " }\n" +
+ "public class X{\n" +
+ " public class Inner {\n" +
+ " public void foo() {\n" +
+ " int i = 0;\n" +
+ " final int NEW = 1;\n" +
+ " if (i == NEW) {\n" +
+ " System.out.println();\n" +
+ " }\n" +
+ " bar();\n" +
+ " }\n" +
+ " }\n" +
+ " public void bar() {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().new Inner().foo();\n" +
+ " }\n" +
"}",
},
"SUCCESS");
String expectedOutput =
- " 22 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 4]\n" +
- " [pc: 2, line: 5]\n" +
- " [pc: 4, line: 6]\n" +
- " [pc: 9, line: 7]\n" +
- " [pc: 15, line: 9]\n" +
- " [pc: 22, line: 10]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 23] local: this index: 0 type: X.Inner\n" +
- " [pc: 2, pc: 23] local: i index: 1 type: int\n" +
+ " 22 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 4]\n" +
+ " [pc: 2, line: 5]\n" +
+ " [pc: 4, line: 6]\n" +
+ " [pc: 9, line: 7]\n" +
+ " [pc: 15, line: 9]\n" +
+ " [pc: 22, line: 10]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 23] local: this index: 0 type: X.Inner\n" +
+ " [pc: 2, pc: 23] local: i index: 1 type: int\n" +
" [pc: 4, pc: 23] local: NEW index: 2 type: int\n";
File f = new File(OUTPUT_DIR + File.separator + "X$Inner.class");
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DefaultJavaRuntimeEnvironment.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DefaultJavaRuntimeEnvironment.java
index aefaf3a46..c99c66ed7 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DefaultJavaRuntimeEnvironment.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DefaultJavaRuntimeEnvironment.java
@@ -48,7 +48,7 @@ public class DefaultJavaRuntimeEnvironment extends FileSystem {
}
outputFolder.reset();
}
-
+
public static void cleanUpDefaultJreClassLibs() {
if (defaultJreClassLibs != null && defaultJreClassLibs.length > 0) {
if (defaultJreClassLibs[0] instanceof DefaultJavaRuntimeEnvironment)
@@ -57,7 +57,7 @@ public class DefaultJavaRuntimeEnvironment extends FileSystem {
}
private static String[] javaLibsAndOutputDir;
-
+
static String[] getDefaultClassPaths() {
if (javaLibsAndOutputDir == null)
javaLibsAndOutputDir = Util.concatWithClassLibs(AbstractRegressionTest.OUTPUT_DIR, false);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated15Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated15Test.java
index 4abad628f..96ded3193 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated15Test.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated15Test.java
@@ -255,20 +255,20 @@ public void test005() {
},
null, customOptions,
"----------\n" +
- "1. ERROR in p2\\C.java (at line 3)\n" +
- " void bar(p1.X.Inner a) {\n" +
- " ^\n" +
- "The type X is deprecated\n" +
- "----------\n" +
- "2. ERROR in p2\\C.java (at line 3)\n" +
- " void bar(p1.X.Inner a) {\n" +
- " ^^^^^\n" +
- "The type X.Inner is deprecated\n" +
- "----------\n" +
- "3. ERROR in p2\\C.java (at line 4)\n" +
- " a.foo();\n" +
- " ^^^^^\n" +
- "The method foo() from the type X.Inner is deprecated\n" +
+ "1. ERROR in p2\\C.java (at line 3)\n" +
+ " void bar(p1.X.Inner a) {\n" +
+ " ^\n" +
+ "The type X is deprecated\n" +
+ "----------\n" +
+ "2. ERROR in p2\\C.java (at line 3)\n" +
+ " void bar(p1.X.Inner a) {\n" +
+ " ^^^^^\n" +
+ "The type X.Inner is deprecated\n" +
+ "----------\n" +
+ "3. ERROR in p2\\C.java (at line 4)\n" +
+ " a.foo();\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X.Inner is deprecated\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -294,11 +294,11 @@ public void test006() {
"}"
},
null, customOptions,
- "----------\n" +
- "1. ERROR in test1\\E02.java (at line 3)\n" +
- " public void foo(E01 arg) {\n" +
- " ^^^\n" +
- "The type E01 is deprecated\n" +
+ "----------\n" +
+ "1. ERROR in test1\\E02.java (at line 3)\n" +
+ " public void foo(E01 arg) {\n" +
+ " ^^^\n" +
+ "The type E01 is deprecated\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated18Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated18Test.java
index 7068824a6..9a048cc41 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated18Test.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated18Test.java
@@ -37,7 +37,7 @@ public void test412555() {
"X.java",
"public class X {\n" +
" public static void main(String[] args) {\n" +
- " Runnable r = () -> {\n" +
+ " Runnable r = () -> {\n" +
" Y.callMe();\n" +
" };\n" +
" }\n" +
@@ -48,11 +48,11 @@ public void test412555() {
" public static void callMe() {}\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " Y.callMe();\n" +
- " ^^^^^^^^\n" +
- "The method callMe() from the type Y is deprecated\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " Y.callMe();\n" +
+ " ^^^^^^^^\n" +
+ "The method callMe() from the type Y is deprecated\n" +
"----------\n",
null,
true,
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java
index 460219383..bbf51fde2 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java
@@ -221,20 +221,20 @@ public class Deprecated9Test extends AbstractRegressionTest9 {
},
null, customOptions,
"----------\n" +
- "1. ERROR in p2\\C.java (at line 3)\n" +
- " void bar(p1.X.Inner a) {\n" +
- " ^\n" +
- "The type X has been deprecated and marked for removal\n" +
- "----------\n" +
- "2. ERROR in p2\\C.java (at line 3)\n" +
- " void bar(p1.X.Inner a) {\n" +
- " ^^^^^\n" +
- "The type X.Inner has been deprecated and marked for removal\n" +
- "----------\n" +
- "3. ERROR in p2\\C.java (at line 4)\n" +
- " a.foo();\n" +
- " ^^^^^\n" +
- "The method foo() from the type X.Inner has been deprecated and marked for removal\n" +
+ "1. ERROR in p2\\C.java (at line 3)\n" +
+ " void bar(p1.X.Inner a) {\n" +
+ " ^\n" +
+ "The type X has been deprecated and marked for removal\n" +
+ "----------\n" +
+ "2. ERROR in p2\\C.java (at line 3)\n" +
+ " void bar(p1.X.Inner a) {\n" +
+ " ^^^^^\n" +
+ "The type X.Inner has been deprecated and marked for removal\n" +
+ "----------\n" +
+ "3. ERROR in p2\\C.java (at line 4)\n" +
+ " a.foo();\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X.Inner has been deprecated and marked for removal\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -275,7 +275,7 @@ public class Deprecated9Test extends AbstractRegressionTest9 {
"package p1;\n" +
"public class X {\n" +
" public static class Inner {\n" +
- " @java.lang.Deprecated(forRemoval=true)\n" +
+ " @java.lang.Deprecated(forRemoval=true)\n" +
" public void foo() {}\n" +
" }\n" +
"}\n",
@@ -293,10 +293,10 @@ public class Deprecated9Test extends AbstractRegressionTest9 {
};
runner.expectedCompilerLog =
"----------\n" +
- "1. WARNING in p2\\C.java (at line 5)\n" +
- " a.foo();\n" +
- " ^^^^^\n" +
- "The method foo() from the type X.Inner has been deprecated and marked for removal\n" +
+ "1. WARNING in p2\\C.java (at line 5)\n" +
+ " a.foo();\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X.Inner has been deprecated and marked for removal\n" +
"----------\n";
runner.runWarningTest();
}
@@ -322,11 +322,11 @@ public class Deprecated9Test extends AbstractRegressionTest9 {
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in test1\\E02.java (at line 3)\n" +
- " public void foo(E01 arg) {\n" +
- " ^^^\n" +
- "The type E01 is deprecated since version 4\n" +
+ "----------\n" +
+ "1. WARNING in test1\\E02.java (at line 3)\n" +
+ " public void foo(E01 arg) {\n" +
+ " ^^^\n" +
+ "The type E01 is deprecated since version 4\n" +
"----------\n";
runner.runWarningTest();
}
@@ -356,16 +356,16 @@ public class Deprecated9Test extends AbstractRegressionTest9 {
"}\n",
},
null, customOptions,
- "----------\n" +
- "1. WARNING in p2\\C.java (at line 4)\n" +
- " @Override public void foo() {}\n" +
- " ^^^^^\n" +
- "The method C.foo() overrides a deprecated method from X\n" +
- "----------\n" +
- "2. ERROR in p2\\C.java (at line 5)\n" +
- " @Override public void bar() {}\n" +
- " ^^^^^\n" +
- "The method C.bar() overrides a method from X that has been deprecated and marked for removal\n" +
+ "----------\n" +
+ "1. WARNING in p2\\C.java (at line 4)\n" +
+ " @Override public void foo() {}\n" +
+ " ^^^^^\n" +
+ "The method C.foo() overrides a deprecated method from X\n" +
+ "----------\n" +
+ "2. ERROR in p2\\C.java (at line 5)\n" +
+ " @Override public void bar() {}\n" +
+ " ^^^^^\n" +
+ "The method C.bar() overrides a method from X that has been deprecated and marked for removal\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -401,46 +401,46 @@ public class Deprecated9Test extends AbstractRegressionTest9 {
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in test1\\E02.java (at line 4)\n" +
- " System.out.println(new E01.Old());\n" +
- " ^^^^^^^^^\n" +
- "The constructor E01.Old() is deprecated since version 1.0\n" +
- "----------\n" +
- "2. WARNING in test1\\E02.java (at line 4)\n" +
- " System.out.println(new E01.Old());\n" +
- " ^^^\n" +
- "The type E01.Old is deprecated since version 1.0\n" +
- "----------\n" +
- "3. WARNING in test1\\E02.java (at line 5)\n" +
- " E01 e = new E01();\n" +
- " ^^^^^\n" +
- "The constructor E01() is deprecated since version 3.0.0\n" +
- "----------\n" +
- "4. WARNING in test1\\E02.java (at line 6)\n" +
- " e.old();\n" +
- " ^^^^^\n" +
- "The method old() from the type E01 is deprecated since version 4-SNAPSHOT\n" +
- "----------\n" +
- "5. WARNING in test1\\E02.java (at line 7)\n" +
- " System.out.println(E01.x);\n" +
- " ^\n" +
- "The field E01.x is deprecated since version 2\n" +
- "----------\n" +
- "6. WARNING in test1\\E02.java (at line 8)\n" +
- " System.out.println(E01.y);\n" +
- " ^\n" +
- "The field E01.y is deprecated since version 2\n" +
- "----------\n" +
- "7. WARNING in test1\\E02.java (at line 10)\n" +
- " class E03 extends E01 {\n" +
- " ^^^\n" +
- "The constructor E01() is deprecated since version 3.0.0\n" +
- "----------\n" +
- "8. WARNING in test1\\E02.java (at line 11)\n" +
- " protected void old() {}\n" +
- " ^^^^^\n" +
- "The method E02.E03.old() overrides a method from E01 that is deprecated since version 4-SNAPSHOT\n" +
+ "----------\n" +
+ "1. WARNING in test1\\E02.java (at line 4)\n" +
+ " System.out.println(new E01.Old());\n" +
+ " ^^^^^^^^^\n" +
+ "The constructor E01.Old() is deprecated since version 1.0\n" +
+ "----------\n" +
+ "2. WARNING in test1\\E02.java (at line 4)\n" +
+ " System.out.println(new E01.Old());\n" +
+ " ^^^\n" +
+ "The type E01.Old is deprecated since version 1.0\n" +
+ "----------\n" +
+ "3. WARNING in test1\\E02.java (at line 5)\n" +
+ " E01 e = new E01();\n" +
+ " ^^^^^\n" +
+ "The constructor E01() is deprecated since version 3.0.0\n" +
+ "----------\n" +
+ "4. WARNING in test1\\E02.java (at line 6)\n" +
+ " e.old();\n" +
+ " ^^^^^\n" +
+ "The method old() from the type E01 is deprecated since version 4-SNAPSHOT\n" +
+ "----------\n" +
+ "5. WARNING in test1\\E02.java (at line 7)\n" +
+ " System.out.println(E01.x);\n" +
+ " ^\n" +
+ "The field E01.x is deprecated since version 2\n" +
+ "----------\n" +
+ "6. WARNING in test1\\E02.java (at line 8)\n" +
+ " System.out.println(E01.y);\n" +
+ " ^\n" +
+ "The field E01.y is deprecated since version 2\n" +
+ "----------\n" +
+ "7. WARNING in test1\\E02.java (at line 10)\n" +
+ " class E03 extends E01 {\n" +
+ " ^^^\n" +
+ "The constructor E01() is deprecated since version 3.0.0\n" +
+ "----------\n" +
+ "8. WARNING in test1\\E02.java (at line 11)\n" +
+ " protected void old() {}\n" +
+ " ^^^^^\n" +
+ "The method E02.E03.old() overrides a method from E01 that is deprecated since version 4-SNAPSHOT\n" +
"----------\n";
runner.runWarningTest();
}
@@ -482,46 +482,46 @@ public class Deprecated9Test extends AbstractRegressionTest9 {
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in test1\\E02.java (at line 4)\n" +
- " System.out.println(new E01.Old());\n" +
- " ^^^^^^^^^\n" +
- "The constructor E01.Old() is deprecated since version 1.0\n" +
- "----------\n" +
- "2. WARNING in test1\\E02.java (at line 4)\n" +
- " System.out.println(new E01.Old());\n" +
- " ^^^\n" +
- "The type E01.Old is deprecated since version 1.0\n" +
- "----------\n" +
- "3. WARNING in test1\\E02.java (at line 5)\n" +
- " E01 e = new E01();\n" +
- " ^^^^^\n" +
- "The constructor E01() is deprecated since version 3.0.0\n" +
- "----------\n" +
- "4. WARNING in test1\\E02.java (at line 6)\n" +
- " e.old();\n" +
- " ^^^^^\n" +
- "The method old() from the type E01 is deprecated since version 4-SNAPSHOT\n" +
- "----------\n" +
- "5. WARNING in test1\\E02.java (at line 7)\n" +
- " System.out.println(E01.x);\n" +
- " ^\n" +
- "The field E01.x is deprecated since version 2\n" +
- "----------\n" +
- "6. WARNING in test1\\E02.java (at line 8)\n" +
- " System.out.println(E01.y);\n" +
- " ^\n" +
- "The field E01.y is deprecated since version 2\n" +
- "----------\n" +
- "7. WARNING in test1\\E02.java (at line 10)\n" +
- " class E03 extends E01 {\n" +
- " ^^^\n" +
- "The constructor E01() is deprecated since version 3.0.0\n" +
- "----------\n" +
- "8. WARNING in test1\\E02.java (at line 11)\n" +
- " protected void old() {}\n" +
- " ^^^^^\n" +
- "The method E02.E03.old() overrides a method from E01 that is deprecated since version 4-SNAPSHOT\n" +
+ "----------\n" +
+ "1. WARNING in test1\\E02.java (at line 4)\n" +
+ " System.out.println(new E01.Old());\n" +
+ " ^^^^^^^^^\n" +
+ "The constructor E01.Old() is deprecated since version 1.0\n" +
+ "----------\n" +
+ "2. WARNING in test1\\E02.java (at line 4)\n" +
+ " System.out.println(new E01.Old());\n" +
+ " ^^^\n" +
+ "The type E01.Old is deprecated since version 1.0\n" +
+ "----------\n" +
+ "3. WARNING in test1\\E02.java (at line 5)\n" +
+ " E01 e = new E01();\n" +
+ " ^^^^^\n" +
+ "The constructor E01() is deprecated since version 3.0.0\n" +
+ "----------\n" +
+ "4. WARNING in test1\\E02.java (at line 6)\n" +
+ " e.old();\n" +
+ " ^^^^^\n" +
+ "The method old() from the type E01 is deprecated since version 4-SNAPSHOT\n" +
+ "----------\n" +
+ "5. WARNING in test1\\E02.java (at line 7)\n" +
+ " System.out.println(E01.x);\n" +
+ " ^\n" +
+ "The field E01.x is deprecated since version 2\n" +
+ "----------\n" +
+ "6. WARNING in test1\\E02.java (at line 8)\n" +
+ " System.out.println(E01.y);\n" +
+ " ^\n" +
+ "The field E01.y is deprecated since version 2\n" +
+ "----------\n" +
+ "7. WARNING in test1\\E02.java (at line 10)\n" +
+ " class E03 extends E01 {\n" +
+ " ^^^\n" +
+ "The constructor E01() is deprecated since version 3.0.0\n" +
+ "----------\n" +
+ "8. WARNING in test1\\E02.java (at line 11)\n" +
+ " protected void old() {}\n" +
+ " ^^^^^\n" +
+ "The method E02.E03.old() overrides a method from E01 that is deprecated since version 4-SNAPSHOT\n" +
"----------\n";
runner.runWarningTest();
}
@@ -557,46 +557,46 @@ public class Deprecated9Test extends AbstractRegressionTest9 {
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in test1\\E02.java (at line 4)\n" +
- " System.out.println(new E01.Old());\n" +
- " ^^^^^^^^^\n" +
- "The constructor E01.Old() has been deprecated since version 1.0 and marked for removal\n" +
- "----------\n" +
- "2. ERROR in test1\\E02.java (at line 4)\n" +
- " System.out.println(new E01.Old());\n" +
- " ^^^\n" +
- "The type E01.Old has been deprecated since version 1.0 and marked for removal\n" +
- "----------\n" +
- "3. ERROR in test1\\E02.java (at line 5)\n" +
- " E01 e = new E01();\n" +
- " ^^^^^\n" +
- "The constructor E01() has been deprecated since version 3.0.0 and marked for removal\n" +
- "----------\n" +
- "4. ERROR in test1\\E02.java (at line 6)\n" +
- " e.old();\n" +
- " ^^^^^\n" +
- "The method old() from the type E01 has been deprecated since version 4-SNAPSHOT and marked for removal\n" +
- "----------\n" +
- "5. ERROR in test1\\E02.java (at line 7)\n" +
- " System.out.println(E01.x);\n" +
- " ^\n" +
- "The field E01.x has been deprecated since version 2 and marked for removal\n" +
- "----------\n" +
- "6. ERROR in test1\\E02.java (at line 8)\n" +
- " System.out.println(E01.y);\n" +
- " ^\n" +
- "The field E01.y has been deprecated since version 2 and marked for removal\n" +
- "----------\n" +
- "7. ERROR in test1\\E02.java (at line 10)\n" +
- " class E03 extends E01 {\n" +
- " ^^^\n" +
- "The constructor E01() has been deprecated since version 3.0.0 and marked for removal\n" +
- "----------\n" +
- "8. ERROR in test1\\E02.java (at line 11)\n" +
- " protected void old() {}\n" +
- " ^^^^^\n" +
- "The method E02.E03.old() overrides a method from E01 that has been deprecated since version 4-SNAPSHOT and marked for removal\n" +
+ "----------\n" +
+ "1. ERROR in test1\\E02.java (at line 4)\n" +
+ " System.out.println(new E01.Old());\n" +
+ " ^^^^^^^^^\n" +
+ "The constructor E01.Old() has been deprecated since version 1.0 and marked for removal\n" +
+ "----------\n" +
+ "2. ERROR in test1\\E02.java (at line 4)\n" +
+ " System.out.println(new E01.Old());\n" +
+ " ^^^\n" +
+ "The type E01.Old has been deprecated since version 1.0 and marked for removal\n" +
+ "----------\n" +
+ "3. ERROR in test1\\E02.java (at line 5)\n" +
+ " E01 e = new E01();\n" +
+ " ^^^^^\n" +
+ "The constructor E01() has been deprecated since version 3.0.0 and marked for removal\n" +
+ "----------\n" +
+ "4. ERROR in test1\\E02.java (at line 6)\n" +
+ " e.old();\n" +
+ " ^^^^^\n" +
+ "The method old() from the type E01 has been deprecated since version 4-SNAPSHOT and marked for removal\n" +
+ "----------\n" +
+ "5. ERROR in test1\\E02.java (at line 7)\n" +
+ " System.out.println(E01.x);\n" +
+ " ^\n" +
+ "The field E01.x has been deprecated since version 2 and marked for removal\n" +
+ "----------\n" +
+ "6. ERROR in test1\\E02.java (at line 8)\n" +
+ " System.out.println(E01.y);\n" +
+ " ^\n" +
+ "The field E01.y has been deprecated since version 2 and marked for removal\n" +
+ "----------\n" +
+ "7. ERROR in test1\\E02.java (at line 10)\n" +
+ " class E03 extends E01 {\n" +
+ " ^^^\n" +
+ "The constructor E01() has been deprecated since version 3.0.0 and marked for removal\n" +
+ "----------\n" +
+ "8. ERROR in test1\\E02.java (at line 11)\n" +
+ " protected void old() {}\n" +
+ " ^^^^^\n" +
+ "The method E02.E03.old() overrides a method from E01 that has been deprecated since version 4-SNAPSHOT and marked for removal\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -664,26 +664,26 @@ public class Deprecated9Test extends AbstractRegressionTest9 {
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in module-info.java (at line 2)\n" +
- " requires mod.dep;\n" +
- " ^^^^^^^\n" +
- "The module mod.dep is deprecated\n" +
- "----------\n" +
- "2. WARNING in module-info.java (at line 3)\n" +
- " requires mod.dep.since;\n" +
- " ^^^^^^^^^^^^^\n" +
- "The module mod.dep.since is deprecated since version 42\n" +
- "----------\n" +
- "3. ERROR in module-info.java (at line 4)\n" +
- " requires mod.dep.terminally;\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The module mod.dep.terminally has been deprecated and marked for removal\n" +
- "----------\n" +
- "4. ERROR in module-info.java (at line 5)\n" +
- " requires mod.dep.since.terminally;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The module mod.dep.since.terminally has been deprecated since version 42 and marked for removal\n" +
+ "----------\n" +
+ "1. WARNING in module-info.java (at line 2)\n" +
+ " requires mod.dep;\n" +
+ " ^^^^^^^\n" +
+ "The module mod.dep is deprecated\n" +
+ "----------\n" +
+ "2. WARNING in module-info.java (at line 3)\n" +
+ " requires mod.dep.since;\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The module mod.dep.since is deprecated since version 42\n" +
+ "----------\n" +
+ "3. ERROR in module-info.java (at line 4)\n" +
+ " requires mod.dep.terminally;\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "The module mod.dep.terminally has been deprecated and marked for removal\n" +
+ "----------\n" +
+ "4. ERROR in module-info.java (at line 5)\n" +
+ " requires mod.dep.since.terminally;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The module mod.dep.since.terminally has been deprecated since version 42 and marked for removal\n" +
"----------\n";
runner.runNegativeTest();
}
@@ -743,46 +743,46 @@ public class Deprecated9Test extends AbstractRegressionTest9 {
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. INFO in mod1\\module-info.java (at line 3)\n" +
- " provides p1.IServiceDep with p1impl.ServiceDep;\n" +
- " ^^^^^^^^^^^\n" +
- "The type IServiceDep is deprecated\n" +
- "----------\n" +
- "2. INFO in mod1\\module-info.java (at line 3)\n" +
- " provides p1.IServiceDep with p1impl.ServiceDep;\n" +
- " ^^^^^^^^^^\n" +
- "The type ServiceDep is deprecated\n" +
- "----------\n" +
- "3. INFO in mod1\\module-info.java (at line 4)\n" +
- " provides p1.IServiceDepSince with p1impl.ServiceDepSince;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type IServiceDepSince is deprecated since version 2\n" +
- "----------\n" +
- "4. INFO in mod1\\module-info.java (at line 4)\n" +
- " provides p1.IServiceDepSince with p1impl.ServiceDepSince;\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The type ServiceDepSince is deprecated since version 2\n" +
- "----------\n" +
- "5. WARNING in mod1\\module-info.java (at line 5)\n" +
- " provides p1.IServiceTermDep with p1impl.ServiceTermDep;\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The type IServiceTermDep has been deprecated and marked for removal\n" +
- "----------\n" +
- "6. WARNING in mod1\\module-info.java (at line 5)\n" +
- " provides p1.IServiceTermDep with p1impl.ServiceTermDep;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The type ServiceTermDep has been deprecated and marked for removal\n" +
- "----------\n" +
- "7. WARNING in mod1\\module-info.java (at line 6)\n" +
- " provides p1.IServiceTermDepSince with p1impl.ServiceTermDepSince;\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "The type IServiceTermDepSince has been deprecated since version 3 and marked for removal\n" +
- "----------\n" +
- "8. WARNING in mod1\\module-info.java (at line 6)\n" +
- " provides p1.IServiceTermDepSince with p1impl.ServiceTermDepSince;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The type ServiceTermDepSince has been deprecated since version 3 and marked for removal\n" +
+ "----------\n" +
+ "1. INFO in mod1\\module-info.java (at line 3)\n" +
+ " provides p1.IServiceDep with p1impl.ServiceDep;\n" +
+ " ^^^^^^^^^^^\n" +
+ "The type IServiceDep is deprecated\n" +
+ "----------\n" +
+ "2. INFO in mod1\\module-info.java (at line 3)\n" +
+ " provides p1.IServiceDep with p1impl.ServiceDep;\n" +
+ " ^^^^^^^^^^\n" +
+ "The type ServiceDep is deprecated\n" +
+ "----------\n" +
+ "3. INFO in mod1\\module-info.java (at line 4)\n" +
+ " provides p1.IServiceDepSince with p1impl.ServiceDepSince;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type IServiceDepSince is deprecated since version 2\n" +
+ "----------\n" +
+ "4. INFO in mod1\\module-info.java (at line 4)\n" +
+ " provides p1.IServiceDepSince with p1impl.ServiceDepSince;\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The type ServiceDepSince is deprecated since version 2\n" +
+ "----------\n" +
+ "5. WARNING in mod1\\module-info.java (at line 5)\n" +
+ " provides p1.IServiceTermDep with p1impl.ServiceTermDep;\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The type IServiceTermDep has been deprecated and marked for removal\n" +
+ "----------\n" +
+ "6. WARNING in mod1\\module-info.java (at line 5)\n" +
+ " provides p1.IServiceTermDep with p1impl.ServiceTermDep;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The type ServiceTermDep has been deprecated and marked for removal\n" +
+ "----------\n" +
+ "7. WARNING in mod1\\module-info.java (at line 6)\n" +
+ " provides p1.IServiceTermDepSince with p1impl.ServiceTermDepSince;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "The type IServiceTermDepSince has been deprecated since version 3 and marked for removal\n" +
+ "----------\n" +
+ "8. WARNING in mod1\\module-info.java (at line 6)\n" +
+ " provides p1.IServiceTermDepSince with p1impl.ServiceTermDepSince;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The type ServiceTermDepSince has been deprecated since version 3 and marked for removal\n" +
"----------\n";
runner.runWarningTest();
}
@@ -818,7 +818,7 @@ public class Deprecated9Test extends AbstractRegressionTest9 {
"}\n",
};
runner.runConformTest();
-
+
runner.shouldFlushOutputDirectory = false;
runner.testFiles =
new String[] {
@@ -832,26 +832,26 @@ public class Deprecated9Test extends AbstractRegressionTest9 {
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. INFO in module-info.java (at line 3)\n" +
- " uses p1.IServiceDep;\n" +
- " ^^^^^^^^^^^\n" +
- "The type IServiceDep is deprecated\n" +
- "----------\n" +
- "2. INFO in module-info.java (at line 4)\n" +
- " uses p1.IServiceDepSince;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type IServiceDepSince is deprecated since version 2\n" +
- "----------\n" +
- "3. WARNING in module-info.java (at line 5)\n" +
- " uses p1.IServiceTermDep;\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The type IServiceTermDep has been deprecated and marked for removal\n" +
- "----------\n" +
- "4. WARNING in module-info.java (at line 6)\n" +
- " uses p1.IServiceTermDepSince;\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "The type IServiceTermDepSince has been deprecated since version 3 and marked for removal\n" +
+ "----------\n" +
+ "1. INFO in module-info.java (at line 3)\n" +
+ " uses p1.IServiceDep;\n" +
+ " ^^^^^^^^^^^\n" +
+ "The type IServiceDep is deprecated\n" +
+ "----------\n" +
+ "2. INFO in module-info.java (at line 4)\n" +
+ " uses p1.IServiceDepSince;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type IServiceDepSince is deprecated since version 2\n" +
+ "----------\n" +
+ "3. WARNING in module-info.java (at line 5)\n" +
+ " uses p1.IServiceTermDep;\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The type IServiceTermDep has been deprecated and marked for removal\n" +
+ "----------\n" +
+ "4. WARNING in module-info.java (at line 6)\n" +
+ " uses p1.IServiceTermDepSince;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "The type IServiceTermDepSince has been deprecated since version 3 and marked for removal\n" +
"----------\n";
runner.runWarningTest();
}
@@ -869,20 +869,20 @@ public class Deprecated9Test extends AbstractRegressionTest9 {
};
if (isJRE11Plus) {
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in module-info.java (at line 2)\n" +
- " requires jdk.xml.bind;\n" +
- " ^^^^^^^^^^^^\n" +
- "jdk.xml.bind cannot be resolved to a module\n" +
+ "----------\n" +
+ "1. ERROR in module-info.java (at line 2)\n" +
+ " requires jdk.xml.bind;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "jdk.xml.bind cannot be resolved to a module\n" +
"----------\n";
runner.runNegativeTest();
} else {
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in module-info.java (at line 2)\n" +
- " requires jdk.xml.bind;\n" +
- " ^^^^^^^^^^^^\n" +
- "The module jdk.xml.bind has been deprecated since version 9 and marked for removal\n" +
+ "----------\n" +
+ "1. WARNING in module-info.java (at line 2)\n" +
+ " requires jdk.xml.bind;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The module jdk.xml.bind has been deprecated since version 9 and marked for removal\n" +
"----------\n";
runner.runWarningTest();
}
@@ -907,11 +907,11 @@ public class Deprecated9Test extends AbstractRegressionTest9 {
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in my.mod\\module-info.java (at line 2)\n" +
- " requires dont.use;\n" +
- " ^^^^^^^^\n" +
- "The module dont.use has been deprecated since version 9 and marked for removal\n" +
+ "----------\n" +
+ "1. WARNING in my.mod\\module-info.java (at line 2)\n" +
+ " requires dont.use;\n" +
+ " ^^^^^^^^\n" +
+ "The module dont.use has been deprecated since version 9 and marked for removal\n" +
"----------\n";
runner.runWarningTest();
}
@@ -919,45 +919,45 @@ public class Deprecated9Test extends AbstractRegressionTest9 {
runNegativeTest(
new String[] {
"p1/C1.java",
- "package p1;\n" +
- "\n" +
- "import pdep.Dep1;\n" +
- "\n" +
- "public class C1 {\n" +
- " Dep1 f;\n" +
+ "package p1;\n" +
+ "\n" +
+ "import pdep.Dep1;\n" +
+ "\n" +
+ "public class C1 {\n" +
+ " Dep1 f;\n" +
"}\n",
"pdep/Dep1.java",
- "package pdep;\n" +
- "\n" +
- "import pmissing.CMissing;\n" +
- "\n" +
- "@Deprecated(since=\"13\")\n" +
- "@CMissing\n" +
- "public class Dep1 {\n" +
- "\n" +
+ "package pdep;\n" +
+ "\n" +
+ "import pmissing.CMissing;\n" +
+ "\n" +
+ "@Deprecated(since=\"13\")\n" +
+ "@CMissing\n" +
+ "public class Dep1 {\n" +
+ "\n" +
"}\n"
- },
- "----------\n" +
- "1. WARNING in p1\\C1.java (at line 3)\n" +
- " import pdep.Dep1;\n" +
- " ^^^^^^^^^\n" +
- "The type Dep1 is deprecated since version 13\n" +
- "----------\n" +
- "2. WARNING in p1\\C1.java (at line 6)\n" +
- " Dep1 f;\n" +
- " ^^^^\n" +
- "The type Dep1 is deprecated since version 13\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in pdep\\Dep1.java (at line 3)\n" +
- " import pmissing.CMissing;\n" +
- " ^^^^^^^^\n" +
- "The import pmissing cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in pdep\\Dep1.java (at line 6)\n" +
- " @CMissing\n" +
- " ^^^^^^^^\n" +
- "CMissing cannot be resolved to a type\n" +
+ },
+ "----------\n" +
+ "1. WARNING in p1\\C1.java (at line 3)\n" +
+ " import pdep.Dep1;\n" +
+ " ^^^^^^^^^\n" +
+ "The type Dep1 is deprecated since version 13\n" +
+ "----------\n" +
+ "2. WARNING in p1\\C1.java (at line 6)\n" +
+ " Dep1 f;\n" +
+ " ^^^^\n" +
+ "The type Dep1 is deprecated since version 13\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in pdep\\Dep1.java (at line 3)\n" +
+ " import pmissing.CMissing;\n" +
+ " ^^^^^^^^\n" +
+ "The import pmissing cannot be resolved\n" +
+ "----------\n" +
+ "2. ERROR in pdep\\Dep1.java (at line 6)\n" +
+ " @CMissing\n" +
+ " ^^^^^^^^\n" +
+ "CMissing cannot be resolved to a type\n" +
"----------\n");
}
public void testBug542795() throws Exception {
@@ -983,27 +983,27 @@ public class Deprecated9Test extends AbstractRegressionTest9 {
"}\n",
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in Test.java (at line 1)\n" +
- " public class Test implements test.Screen.Component {}\n" +
- " ^^^^\n" +
- "The hierarchy of the type Test is inconsistent\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 1)\n" +
- " public class Test implements test.Screen.Component {}\n" +
- " ^^^^^^\n" +
- "The type Screen is deprecated\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 1)\n" +
- " public class Test implements test.Screen.Component {}\n" +
- " ^^^^^^^^^\n" +
- "The type Screen.Component is deprecated\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in test\\Screen.java (at line 7)\n" +
- " public interface Component extends test.ReaderWarningView.Component {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "test.ReaderWarningView.Component cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 1)\n" +
+ " public class Test implements test.Screen.Component {}\n" +
+ " ^^^^\n" +
+ "The hierarchy of the type Test is inconsistent\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 1)\n" +
+ " public class Test implements test.Screen.Component {}\n" +
+ " ^^^^^^\n" +
+ "The type Screen is deprecated\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 1)\n" +
+ " public class Test implements test.Screen.Component {}\n" +
+ " ^^^^^^^^^\n" +
+ "The type Screen.Component is deprecated\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in test\\Screen.java (at line 7)\n" +
+ " public interface Component extends test.ReaderWarningView.Component {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "test.ReaderWarningView.Component cannot be resolved to a type\n" +
"----------\n";
runner.runNegativeTest();
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java
index 638249b80..2cbc999be 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java
@@ -397,10 +397,10 @@ public void test008a() throws IOException {
runner.classLibraries = libs;
runner.expectedCompilerLog =
"----------\n" +
- "1. WARNING in Y.java (at line 3)\n" +
- " p008.X x;\n" +
- " ^\n" +
- "The type X is deprecated\n" +
+ "1. WARNING in Y.java (at line 3)\n" +
+ " p008.X x;\n" +
+ " ^\n" +
+ "The type X is deprecated\n" +
"----------\n";
if (this.complianceLevel < ClassFileConstants.JDK1_5) {
// simulate we were running on a JRE without java.lang.Deprecated
@@ -933,35 +933,35 @@ public void test020() {
customOptions /* custom options */,
// compiler results
"----------\n" + /* expected compiler log */
- "1. ERROR in a.b.c.d.e\\T.java (at line 5)\n" +
- " a.b.c.d.Deprecated.Inner.Inn g;\n" +
- " ^^^^^\n" +
- "The type Deprecated.Inner is deprecated\n" +
- "----------\n" +
- "2. ERROR in a.b.c.d.e\\T.java (at line 5)\n" +
- " a.b.c.d.Deprecated.Inner.Inn g;\n" +
- " ^^^\n" +
- "The type Deprecated.Inner.Inn is deprecated\n" +
- "----------\n" +
- "3. ERROR in a.b.c.d.e\\T.java (at line 6)\n" +
- " Deprecated.Inner i;\n" +
- " ^^^^^\n" +
- "The type Deprecated.Inner is deprecated\n" +
- "----------\n" +
- "4. ERROR in a.b.c.d.e\\T.java (at line 8)\n" +
- " f.foo().goo();\n" +
- " ^^^^^\n" +
- "The method foo() from the type Deprecated is deprecated\n" +
- "----------\n" +
- "5. ERROR in a.b.c.d.e\\T.java (at line 8)\n" +
- " f.foo().goo();\n" +
- " ^^^^^\n" +
- "The method goo() from the type Deprecated is deprecated\n" +
- "----------\n" +
- "6. ERROR in a.b.c.d.e\\T.java (at line 9)\n" +
- " a.b.c.d.Deprecated.bar();\n" +
- " ^^^^^\n" +
- "The method bar() from the type Deprecated is deprecated\n" +
+ "1. ERROR in a.b.c.d.e\\T.java (at line 5)\n" +
+ " a.b.c.d.Deprecated.Inner.Inn g;\n" +
+ " ^^^^^\n" +
+ "The type Deprecated.Inner is deprecated\n" +
+ "----------\n" +
+ "2. ERROR in a.b.c.d.e\\T.java (at line 5)\n" +
+ " a.b.c.d.Deprecated.Inner.Inn g;\n" +
+ " ^^^\n" +
+ "The type Deprecated.Inner.Inn is deprecated\n" +
+ "----------\n" +
+ "3. ERROR in a.b.c.d.e\\T.java (at line 6)\n" +
+ " Deprecated.Inner i;\n" +
+ " ^^^^^\n" +
+ "The type Deprecated.Inner is deprecated\n" +
+ "----------\n" +
+ "4. ERROR in a.b.c.d.e\\T.java (at line 8)\n" +
+ " f.foo().goo();\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type Deprecated is deprecated\n" +
+ "----------\n" +
+ "5. ERROR in a.b.c.d.e\\T.java (at line 8)\n" +
+ " f.foo().goo();\n" +
+ " ^^^^^\n" +
+ "The method goo() from the type Deprecated is deprecated\n" +
+ "----------\n" +
+ "6. ERROR in a.b.c.d.e\\T.java (at line 9)\n" +
+ " a.b.c.d.Deprecated.bar();\n" +
+ " ^^^^^\n" +
+ "The method bar() from the type Deprecated is deprecated\n" +
"----------\n",
// javac options
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnclosingMethodAttributeTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnclosingMethodAttributeTest.java
index 1f3ecd1aa..cbb6bce1c 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnclosingMethodAttributeTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnclosingMethodAttributeTest.java
@@ -262,7 +262,7 @@ public class EnclosingMethodAttributeTest extends AbstractComparableTest {
// orig:
ReferenceBinding binaryType = batchCompiler.lookupEnvironment.askForType(new char[][] {new char[0], "X$1".toCharArray()}, batchCompiler.lookupEnvironment.UnNamedModule);
assertNotNull("Should not be null", binaryType);
-// :giro
+// :giro
}
// SH}
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java
index 449557502..c1d1144e6 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java
@@ -219,20 +219,20 @@ public void test003() {
"}"
},
"----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " public BLEU, \n" +
- " ^^^^\n" +
- "Illegal modifier for the enum constant BLEU; no modifier is allowed\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " transient BLANC, \n" +
- " ^^^^^\n" +
- "Illegal modifier for the enum constant BLANC; no modifier is allowed\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " abstract RED {\n" +
- " ^^^\n" +
- "Illegal modifier for the enum constant RED; no modifier is allowed\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " public BLEU, \n" +
+ " ^^^^\n" +
+ "Illegal modifier for the enum constant BLEU; no modifier is allowed\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " transient BLANC, \n" +
+ " ^^^^^\n" +
+ "Illegal modifier for the enum constant BLANC; no modifier is allowed\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " abstract RED {\n" +
+ " ^^^\n" +
+ "Illegal modifier for the enum constant RED; no modifier is allowed\n" +
"----------\n");
}
// check using an enum constant
@@ -741,21 +741,21 @@ public void test022() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " case MX.BLEU : break;\n" +
- " ^^^^^^^\n" +
- "The qualified case label X.MX.BLEU must be replaced with the unqualified enum constant BLEU\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " case MX.BLANC : break;\n" +
- " ^^^^^^^^\n" +
- "The qualified case label X.MX.BLANC must be replaced with the unqualified enum constant BLANC\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " case MX.ROUGE : break;\n" +
- " ^^^^^^^^\n" +
- "The qualified case label X.MX.ROUGE must be replaced with the unqualified enum constant ROUGE\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " case MX.BLEU : break;\n" +
+ " ^^^^^^^\n" +
+ "The qualified case label X.MX.BLEU must be replaced with the unqualified enum constant BLEU\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " case MX.BLANC : break;\n" +
+ " ^^^^^^^^\n" +
+ "The qualified case label X.MX.BLANC must be replaced with the unqualified enum constant BLANC\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 9)\n" +
+ " case MX.ROUGE : break;\n" +
+ " ^^^^^^^^\n" +
+ "The qualified case label X.MX.ROUGE must be replaced with the unqualified enum constant ROUGE\n" +
"----------\n");
}
@@ -1865,7 +1865,7 @@ public void test062() {
"1. WARNING in X.java (at line 8)\n" +
" switch (x) {\n" +
" ^\n" +
- "The switch over the enum type X should have a default case\n" +
+ "The switch over the enum type X should have a default case\n" +
"----------\n" +
"2. WARNING in X.java (at line 8)\n" +
" switch (x) {\n" +
@@ -4755,7 +4755,7 @@ public void test135() {
" }\n" +
"}",
},
- "----------\n" +
+ "----------\n" +
"1. ERROR in X.java (at line 12)\n" +
" return b;\n" +
" ^\n" +
@@ -4951,15 +4951,15 @@ public void test138() {
" ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"The method eval(double, double) of type new X(){} should be tagged with @Override since it actually overrides a superclass method\n" +
"----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " MINUS {\n" +
- " ^^^^^\n" +
- "The enum constant MINUS cannot define abstract methods\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " abstract double eval(double x, double y);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The method eval cannot be abstract in the enum constant MINUS\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " MINUS {\n" +
+ " ^^^^^\n" +
+ "The enum constant MINUS cannot define abstract methods\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 9)\n" +
+ " abstract double eval(double x, double y);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The method eval cannot be abstract in the enum constant MINUS\n" +
"----------\n"
);
}
@@ -4988,20 +4988,20 @@ public void test139() {
" ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"The method eval(double, double) of type new X(){} should be tagged with @Override since it actually overrides a superclass method\n" +
"----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " MINUS {\n" +
- " ^^^^^\n" +
- "The enum constant MINUS cannot define abstract methods\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " MINUS {\n" +
- " ^^^^^\n" +
- "The enum constant MINUS must implement the abstract method eval(double, double)\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " abstract double eval2(double x, double y);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The method eval2 cannot be abstract in the enum constant MINUS\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " MINUS {\n" +
+ " ^^^^^\n" +
+ "The enum constant MINUS cannot define abstract methods\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " MINUS {\n" +
+ " ^^^^^\n" +
+ "The enum constant MINUS must implement the abstract method eval(double, double)\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " abstract double eval2(double x, double y);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The method eval2 cannot be abstract in the enum constant MINUS\n" +
"----------\n"
);
}
@@ -5079,15 +5079,15 @@ public void test143() {
"}",
},
"----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " A {\n" +
- " ^\n" +
- "The enum constant A cannot define abstract methods\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " public abstract String a();\n" +
- " ^^^\n" +
- "The method a cannot be abstract in the enum constant A\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " A {\n" +
+ " ^\n" +
+ "The enum constant A cannot define abstract methods\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " public abstract String a();\n" +
+ " ^^^\n" +
+ "The method a cannot be abstract in the enum constant A\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=186822
@@ -5771,39 +5771,39 @@ public void test162() {
this.runNegativeTest(
new String[] {
"Status.java", // =================
- "import java.util.HashMap;\n" +
- "import java.util.Map;\n" +
- "\n" +
- "public enum Status {\n" +
- " GOOD((byte) 0x00), BAD((byte) 0x02);\n" +
- "\n" +
- " private static Map<Byte, Status> mapping;\n" +
- "\n" +
- " private Status(final byte newValue) {\n" +
- "\n" +
- " if (Status.mapping == null) {\n" +
- " Status.mapping = new HashMap<Byte, Status>();\n" +
- " }\n" +
- "\n" +
- " Status.mapping.put(newValue, this);\n" +
- " }\n" +
+ "import java.util.HashMap;\n" +
+ "import java.util.Map;\n" +
+ "\n" +
+ "public enum Status {\n" +
+ " GOOD((byte) 0x00), BAD((byte) 0x02);\n" +
+ "\n" +
+ " private static Map<Byte, Status> mapping;\n" +
+ "\n" +
+ " private Status(final byte newValue) {\n" +
+ "\n" +
+ " if (Status.mapping == null) {\n" +
+ " Status.mapping = new HashMap<Byte, Status>();\n" +
+ " }\n" +
+ "\n" +
+ " Status.mapping.put(newValue, this);\n" +
+ " }\n" +
"}\n", // =================
},
- "----------\n" +
- "1. ERROR in Status.java (at line 11)\n" +
- " if (Status.mapping == null) {\n" +
- " ^^^^^^^\n" +
- "Cannot refer to the static enum field Status.mapping within an initializer\n" +
- "----------\n" +
- "2. ERROR in Status.java (at line 12)\n" +
- " Status.mapping = new HashMap<Byte, Status>();\n" +
- " ^^^^^^^\n" +
- "Cannot refer to the static enum field Status.mapping within an initializer\n" +
- "----------\n" +
- "3. ERROR in Status.java (at line 15)\n" +
- " Status.mapping.put(newValue, this);\n" +
- " ^^^^^^^\n" +
- "Cannot refer to the static enum field Status.mapping within an initializer\n" +
+ "----------\n" +
+ "1. ERROR in Status.java (at line 11)\n" +
+ " if (Status.mapping == null) {\n" +
+ " ^^^^^^^\n" +
+ "Cannot refer to the static enum field Status.mapping within an initializer\n" +
+ "----------\n" +
+ "2. ERROR in Status.java (at line 12)\n" +
+ " Status.mapping = new HashMap<Byte, Status>();\n" +
+ " ^^^^^^^\n" +
+ "Cannot refer to the static enum field Status.mapping within an initializer\n" +
+ "----------\n" +
+ "3. ERROR in Status.java (at line 15)\n" +
+ " Status.mapping.put(newValue, this);\n" +
+ " ^^^^^^^\n" +
+ "Cannot refer to the static enum field Status.mapping within an initializer\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239225 - variation
@@ -5811,22 +5811,22 @@ public void test163() {
this.runConformTest(
new String[] {
"Status.java", // =================
- "import java.util.HashMap;\n" +
- "import java.util.Map;\n" +
- "\n" +
- "enum Status {\n" +
- " GOOD((byte) 0x00), BAD((byte) 0x02);\n" +
- " private byte value;\n" +
- " private static Map<Byte, Status> mapping;\n" +
- " private Status(final byte newValue) {\n" +
- " this.value = newValue;\n" +
- " }\n" +
- " static {\n" +
- " Status.mapping = new HashMap<Byte, Status>();\n" +
- " for (Status s : values()) {\n" +
- " Status.mapping.put(s.value, s);\n" +
- " }\n" +
- " }\n" +
+ "import java.util.HashMap;\n" +
+ "import java.util.Map;\n" +
+ "\n" +
+ "enum Status {\n" +
+ " GOOD((byte) 0x00), BAD((byte) 0x02);\n" +
+ " private byte value;\n" +
+ " private static Map<Byte, Status> mapping;\n" +
+ " private Status(final byte newValue) {\n" +
+ " this.value = newValue;\n" +
+ " }\n" +
+ " static {\n" +
+ " Status.mapping = new HashMap<Byte, Status>();\n" +
+ " for (Status s : values()) {\n" +
+ " Status.mapping.put(s.value, s);\n" +
+ " }\n" +
+ " }\n" +
"}\n", // =================
},
"");
@@ -5854,95 +5854,95 @@ public void test165() throws Exception {
this.runNegativeTest(
new String[] {
"X.java", // =================
- "class Other {\n" +
- " int dupField;//1\n" +
- " int dupField;//2\n" +
- " int dupField;//3\n" +
- " int dupField;//4\n" +
- " void dupMethod(int i) {}//5\n" +
- " void dupMethod(int i) {}//6\n" +
- " void dupMethod(int i) {}//7\n" +
- " void dupMethod(int i) {}//8\n" +
- " void foo() {\n" +
- " int i = dupMethod(dupField);\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "public enum X {\n" +
- " ;\n" +
- " private X valueOf(String arg0) { return null; }//9\n" +
- " private X valueOf(String arg0) { return null; }//10\n" +
- " private X valueOf(String arg0) { return null; }//11\n" +
- " void foo() {\n" +
- " int i = valueOf(\"\");\n" +
- " }\n" +
+ "class Other {\n" +
+ " int dupField;//1\n" +
+ " int dupField;//2\n" +
+ " int dupField;//3\n" +
+ " int dupField;//4\n" +
+ " void dupMethod(int i) {}//5\n" +
+ " void dupMethod(int i) {}//6\n" +
+ " void dupMethod(int i) {}//7\n" +
+ " void dupMethod(int i) {}//8\n" +
+ " void foo() {\n" +
+ " int i = dupMethod(dupField);\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "public enum X {\n" +
+ " ;\n" +
+ " private X valueOf(String arg0) { return null; }//9\n" +
+ " private X valueOf(String arg0) { return null; }//10\n" +
+ " private X valueOf(String arg0) { return null; }//11\n" +
+ " void foo() {\n" +
+ " int i = valueOf(\"\");\n" +
+ " }\n" +
"}\n", // =================
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " int dupField;//1\n" +
- " ^^^^^^^^\n" +
- "Duplicate field Other.dupField\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " int dupField;//2\n" +
- " ^^^^^^^^\n" +
- "Duplicate field Other.dupField\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " int dupField;//3\n" +
- " ^^^^^^^^\n" +
- "Duplicate field Other.dupField\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " int dupField;//4\n" +
- " ^^^^^^^^\n" +
- "Duplicate field Other.dupField\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 6)\n" +
- " void dupMethod(int i) {}//5\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Duplicate method dupMethod(int) in type Other\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 7)\n" +
- " void dupMethod(int i) {}//6\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Duplicate method dupMethod(int) in type Other\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 8)\n" +
- " void dupMethod(int i) {}//7\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Duplicate method dupMethod(int) in type Other\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 9)\n" +
- " void dupMethod(int i) {}//8\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Duplicate method dupMethod(int) in type Other\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 11)\n" +
- " int i = dupMethod(dupField);\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from void to int\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 17)\n" +
- " private X valueOf(String arg0) { return null; }//9\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "The enum X already defines the method valueOf(String) implicitly\n" +
- "----------\n" +
- "11. ERROR in X.java (at line 18)\n" +
- " private X valueOf(String arg0) { return null; }//10\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "The enum X already defines the method valueOf(String) implicitly\n" +
- "----------\n" +
- "12. ERROR in X.java (at line 19)\n" +
- " private X valueOf(String arg0) { return null; }//11\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "The enum X already defines the method valueOf(String) implicitly\n" +
- "----------\n" +
- "13. ERROR in X.java (at line 21)\n" +
- " int i = valueOf(\"\");\n" +
- " ^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from X to int\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " int dupField;//1\n" +
+ " ^^^^^^^^\n" +
+ "Duplicate field Other.dupField\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " int dupField;//2\n" +
+ " ^^^^^^^^\n" +
+ "Duplicate field Other.dupField\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " int dupField;//3\n" +
+ " ^^^^^^^^\n" +
+ "Duplicate field Other.dupField\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " int dupField;//4\n" +
+ " ^^^^^^^^\n" +
+ "Duplicate field Other.dupField\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 6)\n" +
+ " void dupMethod(int i) {}//5\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Duplicate method dupMethod(int) in type Other\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 7)\n" +
+ " void dupMethod(int i) {}//6\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Duplicate method dupMethod(int) in type Other\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 8)\n" +
+ " void dupMethod(int i) {}//7\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Duplicate method dupMethod(int) in type Other\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 9)\n" +
+ " void dupMethod(int i) {}//8\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Duplicate method dupMethod(int) in type Other\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 11)\n" +
+ " int i = dupMethod(dupField);\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from void to int\n" +
+ "----------\n" +
+ "10. ERROR in X.java (at line 17)\n" +
+ " private X valueOf(String arg0) { return null; }//9\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "The enum X already defines the method valueOf(String) implicitly\n" +
+ "----------\n" +
+ "11. ERROR in X.java (at line 18)\n" +
+ " private X valueOf(String arg0) { return null; }//10\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "The enum X already defines the method valueOf(String) implicitly\n" +
+ "----------\n" +
+ "12. ERROR in X.java (at line 19)\n" +
+ " private X valueOf(String arg0) { return null; }//11\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "The enum X already defines the method valueOf(String) implicitly\n" +
+ "----------\n" +
+ "13. ERROR in X.java (at line 21)\n" +
+ " int i = valueOf(\"\");\n" +
+ " ^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from X to int\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=251814
@@ -5950,24 +5950,24 @@ public void test166() throws Exception {
this.runNegativeTest(
new String[] {
"X.java", // =================
- "public enum X {\n" +
- " ;\n" +
- " private int valueOf(String arg0) { return 0; }//11\n" +
- " void foo() {\n" +
- " int i = valueOf(\"\");\n" +
- " }\n" +
+ "public enum X {\n" +
+ " ;\n" +
+ " private int valueOf(String arg0) { return 0; }//11\n" +
+ " void foo() {\n" +
+ " int i = valueOf(\"\");\n" +
+ " }\n" +
"}\n", // =================
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " private int valueOf(String arg0) { return 0; }//11\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " private int valueOf(String arg0) { return 0; }//11\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
"The enum X already defines the method valueOf(String) implicitly\n" +
"----------\n" +
"2. ERROR in X.java (at line 5)\n" +
" int i = valueOf(\"\");\n" +
" ^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from X to int\n" +
+ "Type mismatch: cannot convert from X to int\n" +
"----------\n",
null,
true, // flush output
@@ -5977,33 +5977,33 @@ public void test166() throws Exception {
false);
// check for presence of #valueOf(...) in problem type
String expectedOutput =
- "public final enum X {\n" +
- " \n" +
- " // Method descriptor #6 (Ljava/lang/String;I)V\n" +
- " // Stack: 3, Locals: 3\n" +
- " private X(java.lang.String arg0, int arg1);\n" +
- " 0 new java.lang.Error [8]\n" +
- " 3 dup\n" +
- " 4 ldc <String \"Unresolved compilation problems: \\n\\tThe enum X already defines the method valueOf(String) implicitly\\n\\tType mismatch: cannot convert from X to int\\n\"> [10]\n" +
- " 6 invokespecial java.lang.Error(java.lang.String) [12]\n" +
- " 9 athrow\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 10] local: this index: 0 type: X\n" +
- " \n" +
- " // Method descriptor #20 ()V\n" +
- " // Stack: 3, Locals: 1\n" +
- " void foo();\n" +
- " 0 new java.lang.Error [8]\n" +
- " 3 dup\n" +
- " 4 ldc <String \"Unresolved compilation problem: \\n\\tType mismatch: cannot convert from X to int\\n\"> [21]\n" +
- " 6 invokespecial java.lang.Error(java.lang.String) [12]\n" +
- " 9 athrow\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 5]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 10] local: this index: 0 type: X\n" +
+ "public final enum X {\n" +
+ " \n" +
+ " // Method descriptor #6 (Ljava/lang/String;I)V\n" +
+ " // Stack: 3, Locals: 3\n" +
+ " private X(java.lang.String arg0, int arg1);\n" +
+ " 0 new java.lang.Error [8]\n" +
+ " 3 dup\n" +
+ " 4 ldc <String \"Unresolved compilation problems: \\n\\tThe enum X already defines the method valueOf(String) implicitly\\n\\tType mismatch: cannot convert from X to int\\n\"> [10]\n" +
+ " 6 invokespecial java.lang.Error(java.lang.String) [12]\n" +
+ " 9 athrow\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 10] local: this index: 0 type: X\n" +
+ " \n" +
+ " // Method descriptor #20 ()V\n" +
+ " // Stack: 3, Locals: 1\n" +
+ " void foo();\n" +
+ " 0 new java.lang.Error [8]\n" +
+ " 3 dup\n" +
+ " 4 ldc <String \"Unresolved compilation problem: \\n\\tType mismatch: cannot convert from X to int\\n\"> [21]\n" +
+ " 6 invokespecial java.lang.Error(java.lang.String) [12]\n" +
+ " 9 athrow\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 5]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 10] local: this index: 0 type: X\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
@@ -6013,21 +6013,21 @@ public void test167() throws Exception {
this.runNegativeTest(
new String[] {
"X.java", // =================
- "public enum X {\n" +
- " ;\n" +
- " static int valueOf(String arg0) { return 0; }//9\n" +
- " void foo() {\n" +
+ "public enum X {\n" +
+ " ;\n" +
+ " static int valueOf(String arg0) { return 0; }//9\n" +
+ " void foo() {\n" +
" int i = X.valueOf(\"\");\n" +
- " }\n" +
+ " }\n" +
"}\n",
"Other.java",// =================
- "public class Other {\n" +
- " void foo() {\n" +
- " int i = X.valueOf(\"\");\n" +
- " }\n" +
+ "public class Other {\n" +
+ " void foo() {\n" +
+ " int i = X.valueOf(\"\");\n" +
+ " }\n" +
"}\n", // =================
},
- "----------\n" +
+ "----------\n" +
"1. ERROR in X.java (at line 3)\n" +
" static int valueOf(String arg0) { return 0; }//9\n" +
" ^^^^^^^^^^^^^^^^^^^^\n" +
@@ -6054,10 +6054,10 @@ public void test167() throws Exception {
this.runNegativeTest(
new String[] {
"Other.java",// =================
- "public class Other {\n" +
- " void foo() {\n" +
- " int i = X.valueOf(\"\");\n" +
- " }\n" +
+ "public class Other {\n" +
+ " void foo() {\n" +
+ " int i = X.valueOf(\"\");\n" +
+ " }\n" +
"}\n", // =================
},
"----------\n" +
@@ -6078,63 +6078,63 @@ public void test168() {
this.runNegativeTest(
new String[] {
"X.java", // =================
- "enum BadEnum {\n" +
- " CRAZY(CRAZY), // <-- illegal forward reference reported by all compilers\n" +
- " IMPOSSIBLE(BadEnum.IMPOSSIBLE); // <-- illegal forward reference (javac 1.6 only)\n" +
- " private BadEnum(BadEnum self) {\n" +
- " }\n" +
- "}\n" +
- "public class X {\n" +
- " X x1 = new X(x1);//1 - WRONG\n" +
- " static X X2 = new X(X.X2);//2 - OK\n" +
- " X x3 = new X(this.x3);//3 - OK\n" +
- " X(X x) {}\n" +
- " X(int i) {}\n" +
- " static int VALUE() { return 13; }\n" +
- " int value() { return 14; }\n" +
- "}\n" +
- "class Y extends X {\n" +
- " X x1 = new X(x1);//6 - WRONG\n" +
- " static X X2 = new X(Y.X2);//7 - OK\n" +
- " X x3 = new X(this.x3);//8 - OK\n" +
- " Y(Y y) { super(y); }\n" +
+ "enum BadEnum {\n" +
+ " CRAZY(CRAZY), // <-- illegal forward reference reported by all compilers\n" +
+ " IMPOSSIBLE(BadEnum.IMPOSSIBLE); // <-- illegal forward reference (javac 1.6 only)\n" +
+ " private BadEnum(BadEnum self) {\n" +
+ " }\n" +
+ "}\n" +
+ "public class X {\n" +
+ " X x1 = new X(x1);//1 - WRONG\n" +
+ " static X X2 = new X(X.X2);//2 - OK\n" +
+ " X x3 = new X(this.x3);//3 - OK\n" +
+ " X(X x) {}\n" +
+ " X(int i) {}\n" +
+ " static int VALUE() { return 13; }\n" +
+ " int value() { return 14; }\n" +
+ "}\n" +
+ "class Y extends X {\n" +
+ " X x1 = new X(x1);//6 - WRONG\n" +
+ " static X X2 = new X(Y.X2);//7 - OK\n" +
+ " X x3 = new X(this.x3);//8 - OK\n" +
+ " Y(Y y) { super(y); }\n" +
"}\n", // =================
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " CRAZY(CRAZY), // <-- illegal forward reference reported by all compilers\n" +
- " ^^^^^\n" +
- "Cannot reference a field before it is defined\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " IMPOSSIBLE(BadEnum.IMPOSSIBLE); // <-- illegal forward reference (javac 1.6 only)\n" +
- " ^^^^^^^^^^\n" +
- "Cannot reference a field before it is defined\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " X x1 = new X(x1);//1 - WRONG\n" +
- " ^^\n" +
- "Cannot reference a field before it is defined\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 17)\n" +
- " X x1 = new X(x1);//6 - WRONG\n" +
- " ^^\n" +
- "The field Y.x1 is hiding a field from type X\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 17)\n" +
- " X x1 = new X(x1);//6 - WRONG\n" +
- " ^^\n" +
- "Cannot reference a field before it is defined\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 18)\n" +
- " static X X2 = new X(Y.X2);//7 - OK\n" +
- " ^^\n" +
- "The field Y.X2 is hiding a field from type X\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 19)\n" +
- " X x3 = new X(this.x3);//8 - OK\n" +
- " ^^\n" +
- "The field Y.x3 is hiding a field from type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " CRAZY(CRAZY), // <-- illegal forward reference reported by all compilers\n" +
+ " ^^^^^\n" +
+ "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " IMPOSSIBLE(BadEnum.IMPOSSIBLE); // <-- illegal forward reference (javac 1.6 only)\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " X x1 = new X(x1);//1 - WRONG\n" +
+ " ^^\n" +
+ "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 17)\n" +
+ " X x1 = new X(x1);//6 - WRONG\n" +
+ " ^^\n" +
+ "The field Y.x1 is hiding a field from type X\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 17)\n" +
+ " X x1 = new X(x1);//6 - WRONG\n" +
+ " ^^\n" +
+ "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 18)\n" +
+ " static X X2 = new X(Y.X2);//7 - OK\n" +
+ " ^^\n" +
+ "The field Y.X2 is hiding a field from type X\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 19)\n" +
+ " X x3 = new X(this.x3);//8 - OK\n" +
+ " ^^\n" +
+ "The field Y.x3 is hiding a field from type X\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=255452 - variation
@@ -6142,76 +6142,76 @@ public void test169() {
this.runNegativeTest(
new String[] {
"X.java", // =================
- "enum BadEnum {\n" +
- " NOWAY(BadEnum.NOWAY.CONST),\n" +
- " INVALID(INVALID.CONST),\n" +
- " WRONG(WRONG.VALUE()),\n" +
- " ILLEGAL(ILLEGAL.value());\n" +
- " final static int CONST = 12;\n" +
- " private BadEnum(int i) {\n" +
- " }\n" +
- " static int VALUE() { return 13; }\n" +
- " int value() { return 14; }\n" +
- "}\n" +
- "public class X {\n" +
- " final static int CONST = 12;\n" +
- " X x4 = new X(x4.CONST);//4 - WRONG\n" +
- " X x5 = new X(x5.value());//5 - WRONG\n" +
- " X(int i) {}\n" +
- " static int VALUE() { return 13; }\n" +
- " int value() { return 14; }\n" +
+ "enum BadEnum {\n" +
+ " NOWAY(BadEnum.NOWAY.CONST),\n" +
+ " INVALID(INVALID.CONST),\n" +
+ " WRONG(WRONG.VALUE()),\n" +
+ " ILLEGAL(ILLEGAL.value());\n" +
+ " final static int CONST = 12;\n" +
+ " private BadEnum(int i) {\n" +
+ " }\n" +
+ " static int VALUE() { return 13; }\n" +
+ " int value() { return 14; }\n" +
+ "}\n" +
+ "public class X {\n" +
+ " final static int CONST = 12;\n" +
+ " X x4 = new X(x4.CONST);//4 - WRONG\n" +
+ " X x5 = new X(x5.value());//5 - WRONG\n" +
+ " X(int i) {}\n" +
+ " static int VALUE() { return 13; }\n" +
+ " int value() { return 14; }\n" +
"}\n", // =================
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " NOWAY(BadEnum.NOWAY.CONST),\n" +
- " ^^^^^\n" +
- "Cannot reference a field before it is defined\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 2)\n" +
- " NOWAY(BadEnum.NOWAY.CONST),\n" +
- " ^^^^^\n" +
- "The static field BadEnum.CONST should be accessed in a static way\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " INVALID(INVALID.CONST),\n" +
- " ^^^^^^^\n" +
- "Cannot reference a field before it is defined\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 3)\n" +
- " INVALID(INVALID.CONST),\n" +
- " ^^^^^\n" +
- "The static field BadEnum.CONST should be accessed in a static way\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 4)\n" +
- " WRONG(WRONG.VALUE()),\n" +
- " ^^^^^\n" +
- "Cannot reference a field before it is defined\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 4)\n" +
- " WRONG(WRONG.VALUE()),\n" +
- " ^^^^^^^^^^^^^\n" +
- "The static method VALUE() from the type BadEnum should be accessed in a static way\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 5)\n" +
- " ILLEGAL(ILLEGAL.value());\n" +
- " ^^^^^^^\n" +
- "Cannot reference a field before it is defined\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 14)\n" +
- " X x4 = new X(x4.CONST);//4 - WRONG\n" +
- " ^^\n" +
- "Cannot reference a field before it is defined\n" +
- "----------\n" +
- "9. WARNING in X.java (at line 14)\n" +
- " X x4 = new X(x4.CONST);//4 - WRONG\n" +
- " ^^^^^\n" +
- "The static field X.CONST should be accessed in a static way\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 15)\n" +
- " X x5 = new X(x5.value());//5 - WRONG\n" +
- " ^^\n" +
- "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " NOWAY(BadEnum.NOWAY.CONST),\n" +
+ " ^^^^^\n" +
+ "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 2)\n" +
+ " NOWAY(BadEnum.NOWAY.CONST),\n" +
+ " ^^^^^\n" +
+ "The static field BadEnum.CONST should be accessed in a static way\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " INVALID(INVALID.CONST),\n" +
+ " ^^^^^^^\n" +
+ "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 3)\n" +
+ " INVALID(INVALID.CONST),\n" +
+ " ^^^^^\n" +
+ "The static field BadEnum.CONST should be accessed in a static way\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 4)\n" +
+ " WRONG(WRONG.VALUE()),\n" +
+ " ^^^^^\n" +
+ "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 4)\n" +
+ " WRONG(WRONG.VALUE()),\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The static method VALUE() from the type BadEnum should be accessed in a static way\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 5)\n" +
+ " ILLEGAL(ILLEGAL.value());\n" +
+ " ^^^^^^^\n" +
+ "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 14)\n" +
+ " X x4 = new X(x4.CONST);//4 - WRONG\n" +
+ " ^^\n" +
+ "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "9. WARNING in X.java (at line 14)\n" +
+ " X x4 = new X(x4.CONST);//4 - WRONG\n" +
+ " ^^^^^\n" +
+ "The static field X.CONST should be accessed in a static way\n" +
+ "----------\n" +
+ "10. ERROR in X.java (at line 15)\n" +
+ " X x5 = new X(x5.value());//5 - WRONG\n" +
+ " ^^\n" +
+ "Cannot reference a field before it is defined\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=263877
@@ -6219,46 +6219,46 @@ public void test170() {
this.runNegativeTest(
new String[] {
"X.java", // =================
- "enum Days {\n" +
- " Monday(\"Mon\", Days.OFFSET + 0), // should not complain\n" +
- " Tuesday(\"Tue\", Days.Wednesday.hashCode()), // should complain since enum constant\n" +
- " Wednesday(\"Wed\", OFFSET + 2); // should complain since unqualified\n" +
- " public static final int OFFSET = 0; // cannot move this above, else more errors\n" +
- " Days(String abbr, int index) {\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class X {\n" +
- " public static final int FOO = X.OFFSET + 0;\n" +
- " public static final int BAR = OFFSET + 1;\n" +
- " public static final int OFFSET = 0; // cannot move this above, else more errors\n" +
+ "enum Days {\n" +
+ " Monday(\"Mon\", Days.OFFSET + 0), // should not complain\n" +
+ " Tuesday(\"Tue\", Days.Wednesday.hashCode()), // should complain since enum constant\n" +
+ " Wednesday(\"Wed\", OFFSET + 2); // should complain since unqualified\n" +
+ " public static final int OFFSET = 0; // cannot move this above, else more errors\n" +
+ " Days(String abbr, int index) {\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class X {\n" +
+ " public static final int FOO = X.OFFSET + 0;\n" +
+ " public static final int BAR = OFFSET + 1;\n" +
+ " public static final int OFFSET = 0; // cannot move this above, else more errors\n" +
"}\n", // =================
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Tuesday(\"Tue\", Days.Wednesday.hashCode()), // should complain since enum constant\n" +
- " ^^^^^^^^^\n" +
- "Cannot reference a field before it is defined\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " Wednesday(\"Wed\", OFFSET + 2); // should complain since unqualified\n" +
- " ^^^^^^\n" +
- "Cannot reference a field before it is defined\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 12)\n" +
- " public static final int BAR = OFFSET + 1;\n" +
- " ^^^^^^\n" +
- "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " Tuesday(\"Tue\", Days.Wednesday.hashCode()), // should complain since enum constant\n" +
+ " ^^^^^^^^^\n" +
+ "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " Wednesday(\"Wed\", OFFSET + 2); // should complain since unqualified\n" +
+ " ^^^^^^\n" +
+ "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 12)\n" +
+ " public static final int BAR = OFFSET + 1;\n" +
+ " ^^^^^^\n" +
+ "Cannot reference a field before it is defined\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=267670. Make sure we don't emit any unused
-// warnings about enumerators. Since these could be used in indirect ways not obvious.
+// warnings about enumerators. Since these could be used in indirect ways not obvious.
public void test171() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.WARNING);
this.runConformTest(
- true,
+ true,
new String[] {
"X.java",
"public class X { \n" +
@@ -6276,7 +6276,7 @@ public void test171() {
},
null, customOptions,
"",
- "BLEUBLANCROUGE", null,
+ "BLEUBLANCROUGE", null,
JavacTestOptions.DEFAULT);
}
@@ -6288,11 +6288,11 @@ public void test172() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.WARNING);
this.runConformTest(
- true,
+ true,
new String[] {
"X.java",
"public class X { \n" +
- " private enum Greet {\n" +
+ " private enum Greet {\n" +
" HELLO, HOWDY, BONJOUR; \n" +
" }\n" +
" private enum Colors {\n" +
@@ -6302,7 +6302,7 @@ public void test172() {
" WARNING, ERROR, FATAL_ERROR, PANIC;\n" +
" }\n" +
" public static void main(String[] args) {\n" +
- " Greet g = Greet.valueOf(\"HELLO\");\n" +
+ " Greet g = Greet.valueOf(\"HELLO\");\n" +
" System.out.print(g);\n" +
" Colors c = Enum.valueOf(Colors.class, \"RED\");\n" +
" System.out.print(c);\n" +
@@ -6316,7 +6316,7 @@ public void test172() {
" ^^^^^^^^^\n" +
"The type X.Complaint is never used locally\n" +
"----------\n",
- "HELLORED", null,
+ "HELLORED", null,
JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=273990
@@ -6336,17 +6336,17 @@ public void test173() {
" private E2(final int i) {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in E.java (at line 2)\n" +
- " A(E.STATIK);\n" +
- " ^^^^^^\n" +
- "Cannot reference a field before it is defined\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in E2.java (at line 2)\n" +
- " A(E2.STATIK);\n" +
- " ^^^^^^\n" +
- "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "1. ERROR in E.java (at line 2)\n" +
+ " A(E.STATIK);\n" +
+ " ^^^^^^\n" +
+ "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in E2.java (at line 2)\n" +
+ " A(E2.STATIK);\n" +
+ " ^^^^^^\n" +
+ "Cannot reference a field before it is defined\n" +
"----------\n"
);
}
@@ -6412,18 +6412,18 @@ public void test176() {
this.runConformTest(
new String[] {
"X.java",
- "public enum X {\n" +
- " A(\"\"), B(\"SUCCESS\"), C(\"Hello\");\n" +
- " \n" +
- " String message;\n" +
- " \n" +
- " X(@Deprecated String s) {\n" +
- " this.message = s;\n" +
- " }\n" +
- " @Override\n" +
- " public String toString() {\n" +
- " return this.message;\n" +
- " }\n" +
+ "public enum X {\n" +
+ " A(\"\"), B(\"SUCCESS\"), C(\"Hello\");\n" +
+ " \n" +
+ " String message;\n" +
+ " \n" +
+ " X(@Deprecated String s) {\n" +
+ " this.message = s;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public String toString() {\n" +
+ " return this.message;\n" +
+ " }\n" +
"}"
},
""
@@ -6434,10 +6434,10 @@ public void test176() {
false,
new String[] {
"Y.java",
- "public class Y {\n" +
+ "public class Y {\n" +
" public static void main(String[] args) {\n" +
" System.out.println(X.B);\n" +
- " }\n" +
+ " }\n" +
"}"
},
null,
@@ -6455,22 +6455,22 @@ public void test177() {
this.runConformTest(
new String[] {
"X.java",
- "public enum X {\n" +
- " A(\"\", 0, \"A\"), B(\"SUCCESS\", 0, \"B\"), C(\"Hello\", 0, \"C\");\n" +
- " \n" +
- " private String message;\n" +
- " private int index;\n" +
- " private String name;\n" +
- " \n" +
- " X(@Deprecated String s, int i, @Deprecated String name) {\n" +
- " this.message = s;\n" +
- " this.index = i;\n" +
- " this.name = name;\n" +
- " }\n" +
- " @Override\n" +
- " public String toString() {\n" +
- " return this.message + this.name;\n" +
- " }\n" +
+ "public enum X {\n" +
+ " A(\"\", 0, \"A\"), B(\"SUCCESS\", 0, \"B\"), C(\"Hello\", 0, \"C\");\n" +
+ " \n" +
+ " private String message;\n" +
+ " private int index;\n" +
+ " private String name;\n" +
+ " \n" +
+ " X(@Deprecated String s, int i, @Deprecated String name) {\n" +
+ " this.message = s;\n" +
+ " this.index = i;\n" +
+ " this.name = name;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public String toString() {\n" +
+ " return this.message + this.name;\n" +
+ " }\n" +
"}"
},
""
@@ -6481,10 +6481,10 @@ public void test177() {
false,
new String[] {
"Y.java",
- "public class Y {\n" +
+ "public class Y {\n" +
" public static void main(String[] args) {\n" +
" System.out.println(X.B);\n" +
- " }\n" +
+ " }\n" +
"}"
},
null,
@@ -6503,22 +6503,22 @@ public void test178() {
new String[] {
"X.java",
"public class X {\n" +
- " public static enum Y {\n" +
- " A(\"\", 0, \"A\"), B(\"SUCCESS\", 0, \"B\"), C(\"Hello\", 0, \"C\");\n" +
- " \n" +
- " private String message;\n" +
- " private int index;\n" +
- " private String name;\n" +
- " Y(@Deprecated String s, int i, @Deprecated String name) {\n" +
- " this.message = s;\n" +
- " this.index = i;\n" +
- " this.name = name;\n" +
- " }\n" +
- " @Override\n" +
- " public String toString() {\n" +
- " return this.message + this.name;\n" +
- " }\n" +
- " }\n" +
+ " public static enum Y {\n" +
+ " A(\"\", 0, \"A\"), B(\"SUCCESS\", 0, \"B\"), C(\"Hello\", 0, \"C\");\n" +
+ " \n" +
+ " private String message;\n" +
+ " private int index;\n" +
+ " private String name;\n" +
+ " Y(@Deprecated String s, int i, @Deprecated String name) {\n" +
+ " this.message = s;\n" +
+ " this.index = i;\n" +
+ " this.name = name;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public String toString() {\n" +
+ " return this.message + this.name;\n" +
+ " }\n" +
+ " }\n" +
"}"
},
""
@@ -6529,10 +6529,10 @@ public void test178() {
false,
new String[] {
"Z.java",
- "public class Z {\n" +
+ "public class Z {\n" +
" public static void main(String[] args) {\n" +
" System.out.println(X.Y.B);\n" +
- " }\n" +
+ " }\n" +
"}"
},
null,
@@ -6551,22 +6551,22 @@ public void test179() {
new String[] {
"X.java",
"public class X {\n" +
- " public enum Y {\n" +
- " A(\"\", 0, \"A\"), B(\"SUCCESS\", 0, \"B\"), C(\"Hello\", 0, \"C\");\n" +
- " \n" +
- " private String message;\n" +
- " private int index;\n" +
- " private String name;\n" +
- " Y(@Deprecated String s, int i, @Deprecated String name) {\n" +
- " this.message = s;\n" +
- " this.index = i;\n" +
- " this.name = name;\n" +
- " }\n" +
- " @Override\n" +
- " public String toString() {\n" +
- " return this.message + this.name;\n" +
- " }\n" +
- " }\n" +
+ " public enum Y {\n" +
+ " A(\"\", 0, \"A\"), B(\"SUCCESS\", 0, \"B\"), C(\"Hello\", 0, \"C\");\n" +
+ " \n" +
+ " private String message;\n" +
+ " private int index;\n" +
+ " private String name;\n" +
+ " Y(@Deprecated String s, int i, @Deprecated String name) {\n" +
+ " this.message = s;\n" +
+ " this.index = i;\n" +
+ " this.name = name;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public String toString() {\n" +
+ " return this.message + this.name;\n" +
+ " }\n" +
+ " }\n" +
"}"
},
""
@@ -6577,10 +6577,10 @@ public void test179() {
false,
new String[] {
"Z.java",
- "public class Z {\n" +
+ "public class Z {\n" +
" public static void main(String[] args) {\n" +
" System.out.println(X.Y.B);\n" +
- " }\n" +
+ " }\n" +
"}"
},
null,
@@ -6595,28 +6595,28 @@ public void test180() {
this.runConformTest(
new String[] {
"p/package-info.java",
- "@p.Annot(state=p.MyEnum.BROKEN)\n" +
+ "@p.Annot(state=p.MyEnum.BROKEN)\n" +
"package p;",
"p/Annot.java",
- "package p;\n" +
- "@Annot(state=MyEnum.KO)\n" +
- "public @interface Annot {\n" +
- " MyEnum state() default MyEnum.KO;\n" +
+ "package p;\n" +
+ "@Annot(state=MyEnum.KO)\n" +
+ "public @interface Annot {\n" +
+ " MyEnum state() default MyEnum.KO;\n" +
"}",
"p/MyEnum.java",
- "package p;\n" +
- "@Annot(state=MyEnum.KO)\n" +
- "public enum MyEnum {\n" +
- " WORKS, OK, KO, BROKEN, ;\n" +
+ "package p;\n" +
+ "@Annot(state=MyEnum.KO)\n" +
+ "public enum MyEnum {\n" +
+ " WORKS, OK, KO, BROKEN, ;\n" +
"}",
"test180/package-info.java",
- "@p.Annot(state=p.MyEnum.OK)\n" +
+ "@p.Annot(state=p.MyEnum.OK)\n" +
"package test180;",
"test180/Test.java",
"package test180;\n" +
- "import p.MyEnum;\n" +
- "import p.Annot;\n" +
- "@Annot(state=MyEnum.OK)\n" +
+ "import p.MyEnum;\n" +
+ "import p.Annot;\n" +
+ "@Annot(state=MyEnum.OK)\n" +
"public class Test {}",
},
""
@@ -6628,10 +6628,10 @@ public void test180() {
new String[] {
"X.java",
"import test180.Test;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(Test.class);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(Test.class);\n" +
+ " }\n" +
"}"
},
null,
@@ -6643,35 +6643,35 @@ public void test180() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=289892
// in interaction with null annotations
-// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=365519#c4 item (6)
+// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=365519#c4 item (6)
public void test180a() {
Map options = getCompilerOptions();
options.put(JavaCore.COMPILER_ANNOTATION_NULL_ANALYSIS, JavaCore.ENABLED);
this.runConformTest(
new String[] {
"p/package-info.java",
- "@p.Annot(state=p.MyEnum.BROKEN)\n" +
+ "@p.Annot(state=p.MyEnum.BROKEN)\n" +
"package p;",
"p/Annot.java",
- "package p;\n" +
- "@Annot(state=MyEnum.KO)\n" +
- "public @interface Annot {\n" +
- " MyEnum state() default MyEnum.KO;\n" +
+ "package p;\n" +
+ "@Annot(state=MyEnum.KO)\n" +
+ "public @interface Annot {\n" +
+ " MyEnum state() default MyEnum.KO;\n" +
"}",
"p/MyEnum.java",
- "package p;\n" +
- "@Annot(state=MyEnum.KO)\n" +
- "public enum MyEnum {\n" +
- " WORKS, OK, KO, BROKEN, ;\n" +
+ "package p;\n" +
+ "@Annot(state=MyEnum.KO)\n" +
+ "public enum MyEnum {\n" +
+ " WORKS, OK, KO, BROKEN, ;\n" +
"}",
"test180/package-info.java",
- "@p.Annot(state=p.MyEnum.OK)\n" +
+ "@p.Annot(state=p.MyEnum.OK)\n" +
"package test180;",
"test180/Test.java",
"package test180;\n" +
- "import p.MyEnum;\n" +
- "import p.Annot;\n" +
- "@Annot(state=MyEnum.OK)\n" +
+ "import p.MyEnum;\n" +
+ "import p.Annot;\n" +
+ "@Annot(state=MyEnum.OK)\n" +
"public class Test {}",
},
"",
@@ -6688,10 +6688,10 @@ public void test180a() {
new String[] {
"X.java",
"import test180.Test;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(Test.class);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(Test.class);\n" +
+ " }\n" +
"}"
},
null,
@@ -6706,22 +6706,22 @@ public void test181() {
this.runConformTest(
new String[] {
"X.java",
- "public enum X {\n" +
- " A {\n" +
- " @Override\n" +
- " public Object foo(final String s) {\n" +
- " class Local {\n" +
- " public String toString() {\n" +
- " return s;\n" +
- " }\n" +
- " }\n" +
- " return new Local();\n" +
- " }\n" +
- " };\n" +
- " public abstract Object foo(String s);\n" +
- " public static void main(String... args) {\n" +
- " System.out.println(A.foo(\"SUCCESS\"));\n" +
- " }\n" +
+ "public enum X {\n" +
+ " A {\n" +
+ " @Override\n" +
+ " public Object foo(final String s) {\n" +
+ " class Local {\n" +
+ " public String toString() {\n" +
+ " return s;\n" +
+ " }\n" +
+ " }\n" +
+ " return new Local();\n" +
+ " }\n" +
+ " };\n" +
+ " public abstract Object foo(String s);\n" +
+ " public static void main(String... args) {\n" +
+ " System.out.println(A.foo(\"SUCCESS\"));\n" +
+ " }\n" +
"}"
},
"SUCCESS");
@@ -6734,30 +6734,30 @@ public void test182() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String argv[]) {\n" +
- " foo();\n" +
- " }\n" +
- " public static void foo() {\n" +
- " int n = 0;\n" +
- " for (E e : E.values()) {\n" +
- " if (e.val() == E.VALUES[n++] ) {\n" +
- " System.out.print(e.val());\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String argv[]) {\n" +
+ " foo();\n" +
+ " }\n" +
+ " public static void foo() {\n" +
+ " int n = 0;\n" +
+ " for (E e : E.values()) {\n" +
+ " if (e.val() == E.VALUES[n++] ) {\n" +
+ " System.out.print(e.val());\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}",
"E.java",
- "enum E {\n" +
- " a1(1), a2(2);\n" +
- " static int[] VALUES = { 1, 2 };\n" +
- " private int value;\n" +
- " E(int v) {\n" +
- " this.value = v;\n" +
- " }\n" +
- " public int val() {\n" +
- " return this.value;\n" +
- " }\n" +
+ "enum E {\n" +
+ " a1(1), a2(2);\n" +
+ " static int[] VALUES = { 1, 2 };\n" +
+ " private int value;\n" +
+ " E(int v) {\n" +
+ " this.value = v;\n" +
+ " }\n" +
+ " public int val() {\n" +
+ " return this.value;\n" +
+ " }\n" +
"}"
},
"12",
@@ -6775,29 +6775,29 @@ public void test183() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String argv[]) {\n" +
- " }\n" +
- " static {\n" +
- " int n = 0;\n" +
- " for (E e : E.values()) {\n" +
- " if (e.val() == E.VALUES[n++] ) {\n" +
- " System.out.print(e.val());\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String argv[]) {\n" +
+ " }\n" +
+ " static {\n" +
+ " int n = 0;\n" +
+ " for (E e : E.values()) {\n" +
+ " if (e.val() == E.VALUES[n++] ) {\n" +
+ " System.out.print(e.val());\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}",
"E.java",
- "enum E {\n" +
- " a1(1), a2(2);\n" +
- " static int[] VALUES = { 1, 2 };\n" +
- " private int value;\n" +
- " E(int v) {\n" +
- " this.value = v;\n" +
- " }\n" +
- " public int val() {\n" +
- " return this.value;\n" +
- " }\n" +
+ "enum E {\n" +
+ " a1(1), a2(2);\n" +
+ " static int[] VALUES = { 1, 2 };\n" +
+ " private int value;\n" +
+ " E(int v) {\n" +
+ " this.value = v;\n" +
+ " }\n" +
+ " public int val() {\n" +
+ " return this.value;\n" +
+ " }\n" +
"}"
},
"12",
@@ -6815,30 +6815,30 @@ public void test184() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" public static void main(String argv[]) {\n" +
" new X();\n" +
- " }\n" +
- " X() {\n" +
- " int n = 0;\n" +
- " for (E e : E.values()) {\n" +
- " if (e.val() == E.VALUES[n++] ) {\n" +
- " System.out.print(e.val());\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " X() {\n" +
+ " int n = 0;\n" +
+ " for (E e : E.values()) {\n" +
+ " if (e.val() == E.VALUES[n++] ) {\n" +
+ " System.out.print(e.val());\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}",
"E.java",
- "enum E {\n" +
- " a1(1), a2(2);\n" +
- " static int[] VALUES = { 1, 2 };\n" +
- " private int value;\n" +
- " E(int v) {\n" +
- " this.value = v;\n" +
- " }\n" +
- " public int val() {\n" +
- " return this.value;\n" +
- " }\n" +
+ "enum E {\n" +
+ " a1(1), a2(2);\n" +
+ " static int[] VALUES = { 1, 2 };\n" +
+ " private int value;\n" +
+ " E(int v) {\n" +
+ " this.value = v;\n" +
+ " }\n" +
+ " public int val() {\n" +
+ " return this.value;\n" +
+ " }\n" +
"}"
},
"12",
@@ -6853,22 +6853,22 @@ public void test185() {
this.runNegativeTest(
new String[] {
"X.java",
- "public enum X {\n" +
- " A, B;\n" +
- " private X() throws Exception {\n" +
- " }\n" +
+ "public enum X {\n" +
+ " A, B;\n" +
+ " private X() throws Exception {\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " A, B;\n" +
- " ^\n" +
- "Unhandled exception type Exception\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " A, B;\n" +
- " ^\n" +
- "Unhandled exception type Exception\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " A, B;\n" +
+ " ^\n" +
+ "Unhandled exception type Exception\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " A, B;\n" +
+ " ^\n" +
+ "Unhandled exception type Exception\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=374605
@@ -6878,8 +6878,8 @@ public void test186() {
this.runNegativeTest(
new String[] {
"Y.java",
- "enum X {\n" +
- " A, B;\n" +
+ "enum X {\n" +
+ " A, B;\n" +
"}\n" +
"public class Y {\n" +
" void test(X x) {\n" +
@@ -6890,11 +6890,11 @@ public void test186() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in Y.java (at line 6)\n" +
- " switch (x) {\n" +
- " ^\n" +
- "The enum constant B should have a corresponding case label in this enum switch on X. To suppress this problem, add a comment //$CASES-OMITTED$ on the line above the 'default:'\n" +
+ "----------\n" +
+ "1. WARNING in Y.java (at line 6)\n" +
+ " switch (x) {\n" +
+ " ^\n" +
+ "The enum constant B should have a corresponding case label in this enum switch on X. To suppress this problem, add a comment //$CASES-OMITTED$ on the line above the 'default:'\n" +
"----------\n",
null, // classlibs
true, // flush
@@ -6915,8 +6915,8 @@ public void test187() {
this.runConformTest(
new String[] {
"Y.java",
- "enum X {\n" +
- " A, B;\n" +
+ "enum X {\n" +
+ " A, B;\n" +
"}\n" +
"public class Y {\n" +
" void test(X x) {\n" +
@@ -6943,8 +6943,8 @@ public void test187a() {
this.runNegativeTest(
new String[] {
"Y.java",
- "enum X {\n" +
- " A, B;\n" +
+ "enum X {\n" +
+ " A, B;\n" +
"}\n" +
"public class Y {\n" +
" void test(X x) {\n" +
@@ -6955,11 +6955,11 @@ public void test187a() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in Y.java (at line 6)\n" +
- " switch (x) {\n" +
- " ^\n" +
- "The enum constant B needs a corresponding case label in this enum switch on X\n" +
+ "----------\n" +
+ "1. WARNING in Y.java (at line 6)\n" +
+ " switch (x) {\n" +
+ " ^\n" +
+ "The enum constant B needs a corresponding case label in this enum switch on X\n" +
"----------\n",
null, // classlibs
true, // flush
@@ -6980,8 +6980,8 @@ public void test187b() {
this.runConformTest(
new String[] {
"Y.java",
- "enum X {\n" +
- " A, B;\n" +
+ "enum X {\n" +
+ " A, B;\n" +
"}\n" +
"public class Y {\n" +
" @SuppressWarnings(\"incomplete-switch\")\n" +
@@ -7006,8 +7006,8 @@ public void test188() {
this.runNegativeTest(
new String[] {
"Y.java",
- "enum X {\n" +
- " A, B;\n" +
+ "enum X {\n" +
+ " A, B;\n" +
"}\n" +
"public class Y {\n" +
" void test(X x) {\n" +
@@ -7018,11 +7018,11 @@ public void test188() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in Y.java (at line 6)\n" +
- " switch (x) {\n" +
- " ^\n" +
- "The switch over the enum type X should have a default case\n" +
+ "----------\n" +
+ "1. WARNING in Y.java (at line 6)\n" +
+ " switch (x) {\n" +
+ " ^\n" +
+ "The switch over the enum type X should have a default case\n" +
"----------\n",
null, // classlibs
true, // flush
@@ -7042,8 +7042,8 @@ public void test189() {
this.runNegativeTest(
new String[] {
"Y.java",
- "enum X {\n" +
- " A, B;\n" +
+ "enum X {\n" +
+ " A, B;\n" +
"}\n" +
"public class Y {\n" +
" int test(X x) {\n" +
@@ -7054,11 +7054,11 @@ public void test189() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in Y.java (at line 5)\n" +
- " int test(X x) {\n" +
- " ^^^^^^^^^\n" +
- "This method must return a result of type int. Note that a problem regarding missing 'default:' on 'switch' has been suppressed, which is perhaps related to this problem\n" +
+ "----------\n" +
+ "1. ERROR in Y.java (at line 5)\n" +
+ " int test(X x) {\n" +
+ " ^^^^^^^^^\n" +
+ "This method must return a result of type int. Note that a problem regarding missing 'default:' on 'switch' has been suppressed, which is perhaps related to this problem\n" +
"----------\n",
null, // classlibs
true, // flush
@@ -7072,15 +7072,15 @@ public void test433060() {
this.runNegativeTest(
new String[] {
"X.java",
- "public enum X<T> {\n" +
- " OBJ;\n" +
+ "public enum X<T> {\n" +
+ " OBJ;\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public enum X<T> {\n" +
- " ^\n" +
- "Syntax error, enum declaration cannot have type parameters\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public enum X<T> {\n" +
+ " ^\n" +
+ "Syntax error, enum declaration cannot have type parameters\n" +
"----------\n",
null,
true,
@@ -7126,45 +7126,45 @@ public void test476281() {
return;
this.runConformTest(new String[] {
"LambdaEnumLocalClassBug.java",
- "public enum LambdaEnumLocalClassBug {\n" +
- " A(() -> {\n" +
- " class Foo {\n" +
- " }\n" +
- " new Foo();\n" +
+ "public enum LambdaEnumLocalClassBug {\n" +
+ " A(() -> {\n" +
+ " class Foo {\n" +
+ " }\n" +
+ " new Foo();\n" +
" System.out.println(\"Success\");\n" +
- " })\n" +
- ";\n" +
- " private final Runnable runnable;\n" +
- " private LambdaEnumLocalClassBug(Runnable runnable) {\n" +
- " this.runnable = runnable;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " A.runnable.run();\n" +
- " }\n" +
+ " })\n" +
+ ";\n" +
+ " private final Runnable runnable;\n" +
+ " private LambdaEnumLocalClassBug(Runnable runnable) {\n" +
+ " this.runnable = runnable;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " A.runnable.run();\n" +
+ " }\n" +
"}"},
"Success");
}
public void test476281a() {
this.runConformTest(new String[] {
"Test.java",
- "public enum Test {\n" +
- " B(new Runnable() {\n" +
- " public void run() {\n" +
- " //\n" +
- " class Foo {\n" +
- " \n" +
- " }\n" +
- " new Foo();\n" +
+ "public enum Test {\n" +
+ " B(new Runnable() {\n" +
+ " public void run() {\n" +
+ " //\n" +
+ " class Foo {\n" +
+ " \n" +
+ " }\n" +
+ " new Foo();\n" +
" System.out.println(\"Success\");\n" +
- " }\n" +
- "});\n" +
- " private final Runnable runnable;\n" +
- " private Test(Runnable runnable) {\n" +
- " this.runnable = runnable;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " B.runnable.run();\n" +
- " }\n" +
+ " }\n" +
+ "});\n" +
+ " private final Runnable runnable;\n" +
+ " private Test(Runnable runnable) {\n" +
+ " this.runnable = runnable;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " B.runnable.run();\n" +
+ " }\n" +
"}"},
"Success");
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExpressionContextTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExpressionContextTests.java
index 0eb14b7e5..80fdccca4 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExpressionContextTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExpressionContextTests.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Jesper S Moller - realigned with bug 399695
@@ -59,11 +59,11 @@ public void test001() {
" Object p = (I) () -> {};\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " Object o = () -> {};\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " Object o = () -> {};\n" +
" ^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
+ "The target type of this expression must be a functional interface\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399773, [1.8][compiler] Cast expression should allow for additional bounds to form intersection types
@@ -101,16 +101,16 @@ public void test003() {
" Object p = (int & I & J) () -> {};\n" +
"}\n" ,
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " Object p = (int & I & J) () -> {};\n" +
- " ^^^\n" +
- "Base types are not allowed in intersection cast operator\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " Object p = (int & I & J) () -> {};\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " Object p = (int & I & J) () -> {};\n" +
+ " ^^^\n" +
+ "Base types are not allowed in intersection cast operator\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " Object p = (int & I & J) () -> {};\n" +
" ^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
+ "The target type of this expression must be a functional interface\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399773, [1.8][compiler] Cast expression should allow for additional bounds to form intersection types
@@ -130,16 +130,16 @@ public void test004() {
" Object p = (X[] & Serializable & Cloneable) new X[0];\n" +
"}\n" ,
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " Object p = (X[] & Serializable & Cloneable) new X[0];\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Arrays are not allowed in intersection cast operator\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " Object p = (X[] & Serializable & Cloneable) new X[0];\n" +
- " ^^^^^^^^^^^^\n" +
- "Serializable cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " Object p = (X[] & Serializable & Cloneable) new X[0];\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Arrays are not allowed in intersection cast operator\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " Object p = (X[] & Serializable & Cloneable) new X[0];\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Serializable cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399773, [1.8][compiler] Cast expression should allow for additional bounds to form intersection types
@@ -159,16 +159,16 @@ public void test005() {
" Object p = (I & X) () -> {};\n" +
"}\n" ,
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " Object p = (I & X) () -> {};\n" +
- " ^\n" +
- "The type X is not an interface; it cannot be specified as a bounded parameter\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " Object p = (I & X) () -> {};\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " Object p = (I & X) () -> {};\n" +
+ " ^\n" +
+ "The type X is not an interface; it cannot be specified as a bounded parameter\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " Object p = (I & X) () -> {};\n" +
" ^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
+ "The target type of this expression must be a functional interface\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399773, [1.8][compiler] Cast expression should allow for additional bounds to form intersection types
@@ -188,16 +188,16 @@ public void test006() {
" Object p = (I & J & I) () -> {};\n" +
"}\n" ,
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " Object p = (I & J & I) () -> {};\n" +
- " ^\n" +
- "Duplicate type in intersection cast operator\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " Object p = (I & J & I) () -> {};\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " Object p = (I & J & I) () -> {};\n" +
+ " ^\n" +
+ "Duplicate type in intersection cast operator\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " Object p = (I & J & I) () -> {};\n" +
" ^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
+ "The target type of this expression must be a functional interface\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399773, [1.8][compiler] Cast expression should allow for additional bounds to form intersection types
@@ -216,11 +216,11 @@ public void test007() {
" I<X> i2 = (List<String> p) -> {};\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " I<X> i2 = (List<String> p) -> {};\n" +
- " ^^^^\n" +
- "Lambda expression\'s parameter p is expected to be of type List<X>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " I<X> i2 = (List<String> p) -> {};\n" +
+ " ^^^^\n" +
+ "Lambda expression\'s parameter p is expected to be of type List<X>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399773, [1.8][compiler] Cast expression should allow for additional bounds to form intersection types
@@ -240,26 +240,26 @@ public void test008() {
" Object p = (@Marker java.lang. @Readonly String & I & J) () -> {};\n" +
"}\n" ,
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " Object p = (@Marker java.lang. @Readonly String & I & J) () -> {};\n" +
- " ^^^^^^^\n" +
- "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " Object p = (@Marker java.lang. @Readonly String & I & J) () -> {};\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " Object p = (@Marker java.lang. @Readonly String & I & J) () -> {};\n" +
- " ^^^^^^^^\n" +
- "Readonly cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " Object p = (@Marker java.lang. @Readonly String & I & J) () -> {};\n" +
- " ^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " Object p = (@Marker java.lang. @Readonly String & I & J) () -> {};\n" +
+ " ^^^^^^^\n" +
+ "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " Object p = (@Marker java.lang. @Readonly String & I & J) () -> {};\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 10)\n" +
+ " Object p = (@Marker java.lang. @Readonly String & I & J) () -> {};\n" +
+ " ^^^^^^^^\n" +
+ "Readonly cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 10)\n" +
+ " Object p = (@Marker java.lang. @Readonly String & I & J) () -> {};\n" +
+ " ^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399773, [1.8][compiler] Cast expression should allow for additional bounds to form intersection types
@@ -280,11 +280,11 @@ public void test009() {
" I<X> i2 = (Map<String, String> & I<X>) null;\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " I<X> i2 = (Map<String, String> & I<X>) null;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from null to I<X> & Map<String,String>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " I<X> i2 = (Map<String, String> & I<X>) null;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unnecessary cast from null to I<X> & Map<String,String>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399773, [1.8][compiler] Cast expression should allow for additional bounds to form intersection types
@@ -303,16 +303,16 @@ public void test010() {
" I<X> i2 = (Map<String, String>.Entry & I<X> & Serializable) null;\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " I<X> i2 = (Map<String, String>.Entry & I<X> & Serializable) null;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The member type Map.Entry<K,V> cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type Map<String,String>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " I<X> i2 = (Map<String, String>.Entry & I<X> & Serializable) null;\n" +
- " ^^^^^^^^^^^^\n" +
- "Serializable cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " I<X> i2 = (Map<String, String>.Entry & I<X> & Serializable) null;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The member type Map.Entry<K,V> cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type Map<String,String>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " I<X> i2 = (Map<String, String>.Entry & I<X> & Serializable) null;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Serializable cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399773, [1.8][compiler] Cast expression should allow for additional bounds to form intersection types
@@ -332,11 +332,11 @@ public void test011() {
"class Y {\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " X X = (X & J & K) new Y();\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot cast from Y to X & J & K\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " X X = (X & J & K) new Y();\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot cast from Y to X & J & K\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399773, [1.8][compiler] Cast expression should allow for additional bounds to form intersection types
@@ -356,16 +356,16 @@ public void test012() {
"class Y extends X implements Zork {\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " X X = (X & J & K) new Y();\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from Y to X & J & K\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " class Y extends X implements Zork {\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " X X = (X & J & K) new Y();\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Unnecessary cast from Y to X & J & K\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " class Y extends X implements Zork {\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399773, [1.8][compiler] Cast expression should allow for additional bounds to form intersection types
@@ -385,16 +385,16 @@ public void test013() {
"final class Y extends X {\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " X X = (X & J & K) new Y();\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot cast from Y to X & J & K\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " X X = (X & J & K) new Y();\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from Y to X & J & K\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " X X = (X & J & K) new Y();\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot cast from Y to X & J & K\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " X X = (X & J & K) new Y();\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Unnecessary cast from Y to X & J & K\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399773, [1.8][compiler] Cast expression should allow for additional bounds to form intersection types
@@ -415,11 +415,11 @@ public void test014() {
"final class Y extends P {\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " final class Y extends P {\n" +
- " ^\n" +
- "P cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " final class Y extends P {\n" +
+ " ^\n" +
+ "P cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399773, [1.8][compiler] Cast expression should allow for additional bounds to form intersection types
@@ -439,16 +439,16 @@ public void test015() {
" Zork z;\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " X X = (X & J & K) i;\n" +
- " ^^^^^^^^^^^^^\n" +
- "Cannot cast from I to X & J & K\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " X X = (X & J & K) i;\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Cannot cast from I to X & J & K\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399773, [1.8][compiler] Cast expression should allow for additional bounds to form intersection types
@@ -468,11 +468,11 @@ public void test016() {
" Zork z;\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399773, [1.8][compiler] Cast expression should allow for additional bounds to form intersection types
@@ -492,16 +492,16 @@ public void test017() {
" Zork z;\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " X X = (X & J & K) (X & K & J) i;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from X & K & J to X & J & K\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " X X = (X & J & K) (X & K & J) i;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unnecessary cast from X & K & J to X & J & K\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399778, [1.8][compiler] Conditional operator expressions should propagate target types
@@ -521,11 +521,11 @@ public void test018() {
" I j = () -> {};\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " I i = 1 == 2 ? () -> {} : () -> {};\n" +
- " ^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 7)\n" +
+ " I i = 1 == 2 ? () -> {} : () -> {};\n" +
+ " ^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399778, [1.8][compiler] Conditional operator expressions should propagate target types
@@ -546,16 +546,16 @@ public void test019() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " I [] k = {(()->{}), ()->{}, 1 == 2 ? () -> {} : ()->{}};\n" +
- " ^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " I i = () -> {};\n" +
- " ^\n" +
- "The local variable i is hiding a field from type X\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " I [] k = {(()->{}), ()->{}, 1 == 2 ? () -> {} : ()->{}};\n" +
+ " ^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " I i = () -> {};\n" +
+ " ^\n" +
+ "The local variable i is hiding a field from type X\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399778, [1.8][compiler] Conditional operator expressions should propagate target types
@@ -578,11 +578,11 @@ public void test020() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " return x -> { return () -> () -> \"Hello\"; };\n" +
- " ^^^^^^^\n" +
- "Type mismatch: cannot convert from String to I\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " return x -> { return () -> () -> \"Hello\"; };\n" +
+ " ^^^^^^^\n" +
+ "Type mismatch: cannot convert from String to I\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399778, [1.8][compiler] Conditional operator expressions should propagate target types
@@ -608,26 +608,26 @@ public void test021() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " return \"Hello\" + () -> {};\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " return \"Hello\" + () -> {};\n" +
" ^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " return \"Hello\" + (I)(() -> {});\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from String to I\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 12)\n" +
- " return 10 + (() -> {});\n" +
+ "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " return \"Hello\" + (I)(() -> {});\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from String to I\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 12)\n" +
+ " return 10 + (() -> {});\n" +
" ^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 15)\n" +
- " return 10 + (I) (() -> {});\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The operator + is undefined for the argument type(s) int, I\n" +
+ "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 15)\n" +
+ " return 10 + (I) (() -> {});\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The operator + is undefined for the argument type(s) int, I\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401222, [1.8][compiler] Conditional operator expressions results differ from 8b76
@@ -645,16 +645,16 @@ public void test022() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " List<String> l = x == 2 ? (List<String>)(null) : 1;\n" +
- " ^\n" +
- "Type mismatch: cannot convert from int to List<String>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " List<String> m = x == 2 ? 1 : (List<String>)(null);\n" +
- " ^\n" +
- "Type mismatch: cannot convert from int to List<String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " List<String> l = x == 2 ? (List<String>)(null) : 1;\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from int to List<String>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " List<String> m = x == 2 ? 1 : (List<String>)(null);\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from int to List<String>\n" +
"----------\n");
}
public static Class testClass() {
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExternalizeStringLiterals15Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExternalizeStringLiterals15Test.java
index 413278c55..bc8501f0b 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExternalizeStringLiterals15Test.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExternalizeStringLiterals15Test.java
@@ -233,41 +233,41 @@ public void test007() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " @Annot({\n" +
+ "public class X {\n" +
+ " @Annot({\n" +
" @A(name = \"name\", //$NON-NLS-1$\n" +
- " value = \"Test\") //$NON-NLS-1$\n" +
- " })\n" +
- " @X2(\"\") //$NON-NLS-1$\n" +
- " void foo() {\n" +
- " }\n" +
+ " value = \"Test\") //$NON-NLS-1$\n" +
+ " })\n" +
+ " @X2(\"\") //$NON-NLS-1$\n" +
+ " void foo() {\n" +
+ " }\n" +
"}\n" +
- "@interface Annot {\n" +
- " A[] value();\n" +
+ "@interface Annot {\n" +
+ " A[] value();\n" +
"}\n" +
- "@interface A {\n" +
- " String name();\n" +
- " String value();\n" +
+ "@interface A {\n" +
+ " String name();\n" +
+ " String value();\n" +
"}\n" +
- "@interface X2 {\n" +
- " String value();\n" +
+ "@interface X2 {\n" +
+ " String value();\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " @A(name = \"name\", //$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " value = \"Test\") //$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " @X2(\"\") //$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " @A(name = \"name\", //$NON-NLS-1$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " value = \"Test\") //$NON-NLS-1$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " @X2(\"\") //$NON-NLS-1$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
"----------\n",
null,
true,
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FieldAccessTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FieldAccessTest.java
index 4efbaa856..e977f6a52 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FieldAccessTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FieldAccessTest.java
@@ -635,20 +635,20 @@ public void test021() {
this.runNegativeTest(
new String[] {
"X.java",
- "import java.util.ArrayList;\n" +
- "\n" +
- "public class X {\n" +
- " public void bar() {\n" +
- " ArrayList myList = new ArrayList();\n" +
- " int len = myList.length;\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public void bar() {\n" +
+ " ArrayList myList = new ArrayList();\n" +
+ " int len = myList.length;\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " int len = myList.length;\n" +
- " ^^^^^^\n" +
- "length cannot be resolved or is not a field\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " int len = myList.length;\n" +
+ " ^^^^^^\n" +
+ "length cannot be resolved or is not a field\n" +
"----------\n",
null,
true,
@@ -659,29 +659,29 @@ public void test022() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " static int NEW_FIELD;\n" +
+ "public class X {\n" +
+ " static int NEW_FIELD;\n" +
"}",
"Y.java",
- "public class Y {\n" +
- " void foo() {\n" +
- " int i = X.OLD_FIELD;\n" +
- " }\n" +
- " void bar() {\n" +
- " int j = X.OLD_FIELD;\n" +
- " }\n" +
+ "public class Y {\n" +
+ " void foo() {\n" +
+ " int i = X.OLD_FIELD;\n" +
+ " }\n" +
+ " void bar() {\n" +
+ " int j = X.OLD_FIELD;\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in Y.java (at line 3)\n" +
- " int i = X.OLD_FIELD;\n" +
- " ^^^^^^^^^\n" +
- "OLD_FIELD cannot be resolved or is not a field\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 6)\n" +
- " int j = X.OLD_FIELD;\n" +
- " ^^^^^^^^^\n" +
- "OLD_FIELD cannot be resolved or is not a field\n" +
+ "----------\n" +
+ "1. ERROR in Y.java (at line 3)\n" +
+ " int i = X.OLD_FIELD;\n" +
+ " ^^^^^^^^^\n" +
+ "OLD_FIELD cannot be resolved or is not a field\n" +
+ "----------\n" +
+ "2. ERROR in Y.java (at line 6)\n" +
+ " int j = X.OLD_FIELD;\n" +
+ " ^^^^^^^^^\n" +
+ "OLD_FIELD cannot be resolved or is not a field\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=318171
@@ -700,11 +700,11 @@ public void test023() {
" protected int field;\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in p2\\B.java (at line 4)\n" +
- " protected int field;\n" +
- " ^^^^^\n" +
- "The field B.field is hiding a field from type A\n" +
+ "----------\n" +
+ "1. WARNING in p2\\B.java (at line 4)\n" +
+ " protected int field;\n" +
+ " ^^^^^\n" +
+ "The field B.field is hiding a field from type A\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=318171
@@ -731,11 +731,11 @@ public void test024() {
" protected int field;\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in p2\\B.java (at line 4)\n" +
- " protected int field;\n" +
- " ^^^^^\n" +
- "The field B.field is hiding a field from type SuperSuper\n" +
+ "----------\n" +
+ "1. WARNING in p2\\B.java (at line 4)\n" +
+ " protected int field;\n" +
+ " ^^^^^\n" +
+ "The field B.field is hiding a field from type SuperSuper\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=318171
@@ -766,11 +766,11 @@ public void test025() {
" protected int field;\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in p2\\B.java (at line 4)\n" +
- " protected int field;\n" +
- " ^^^^^\n" +
- "The field B.field is hiding a field from type Interface\n" +
+ "----------\n" +
+ "1. WARNING in p2\\B.java (at line 4)\n" +
+ " protected int field;\n" +
+ " ^^^^^\n" +
+ "The field B.field is hiding a field from type Interface\n" +
"----------\n");
}
public void testBug361039() {
@@ -778,19 +778,19 @@ public void testBug361039() {
runNegativeTest(
new String[] {
"Bug361039.java",
- "public class Bug361039 {\n" +
- " public Bug361039(boolean b) {\n" +
- " }\n" +
- " private Object foo() {\n" +
- " return new Bug361039(!((Boolean)this.f));\n" +
- " }\n" +
+ "public class Bug361039 {\n" +
+ " public Bug361039(boolean b) {\n" +
+ " }\n" +
+ " private Object foo() {\n" +
+ " return new Bug361039(!((Boolean)this.f));\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Bug361039.java (at line 5)\n" +
- " return new Bug361039(!((Boolean)this.f));\n" +
- " ^\n" +
- "f cannot be resolved or is not a field\n" +
+ "----------\n" +
+ "1. ERROR in Bug361039.java (at line 5)\n" +
+ " return new Bug361039(!((Boolean)this.f));\n" +
+ " ^\n" +
+ "f cannot be resolved or is not a field\n" +
"----------\n");
}
public static Class testClass() {
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java
index ee6b34790..2abc30b1d 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java
@@ -66,18 +66,18 @@ public void test001() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public String foo(int i) {\n" +
- " ^^^^^^^^^^\n" +
- "This method must return a result of type String\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " if (i > 0) {\n" +
- " return null;\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public String foo(int i) {\n" +
+ " ^^^^^^^^^^\n" +
+ "This method must return a result of type String\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " if (i > 0) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n");
}
@@ -738,16 +738,16 @@ public void test023() {
" }\n" +
"}"
},
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " x = new X();\n" +
- " ^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " x.foo();\n" +
- " ^\n" +
- "The local variable x may not have been initialized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " x = new X();\n" +
+ " ^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " x.foo();\n" +
+ " ^\n" +
+ "The local variable x may not have been initialized\n" +
"----------\n",
JavacTestOptions.JavacHasABug.JavacBugFixed_6_10);
}
@@ -1194,19 +1194,19 @@ public void test037() {
" }\n" +
"}"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " if (false) {\n" +
- " String s;\n" +
- " System.out.println(s);\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " System.out.println(s);\n" +
- " ^\n" +
- "The local variable s may not have been initialized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " if (false) {\n" +
+ " String s;\n" +
+ " System.out.println(s);\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " System.out.println(s);\n" +
+ " ^\n" +
+ "The local variable s may not have been initialized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=166641
@@ -1243,21 +1243,21 @@ public void test039() {
" }\n" +
"}"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " if (false) {\n" +
- " String s;\n" +
- " if (System.out != null) {\n" +
- " System.out.println(s);\n" +
- " }\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " System.out.println(s);\n" +
- " ^\n" +
- "The local variable s may not have been initialized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " if (false) {\n" +
+ " String s;\n" +
+ " if (System.out != null) {\n" +
+ " System.out.println(s);\n" +
+ " }\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " System.out.println(s);\n" +
+ " ^\n" +
+ "The local variable s may not have been initialized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=166641
@@ -1275,18 +1275,18 @@ public void test040() {
" }\n" +
"}"
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " if (false) {\n" +
- " s = \"\";\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " s = \"\";\n" +
- " ^\n" +
- "The final local variable s cannot be assigned. It must be blank and not using a compound assignment\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " if (false) {\n" +
+ " s = \"\";\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " s = \"\";\n" +
+ " ^\n" +
+ "The final local variable s cannot be assigned. It must be blank and not using a compound assignment\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=166641
@@ -1323,18 +1323,18 @@ public void test042() {
" }\n" +
"}"
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " if (false) {\n" +
- " s = \"\";\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " s = \"\";\n" +
- " ^\n" +
- "The final local variable s may already have been assigned\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " if (false) {\n" +
+ " s = \"\";\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " s = \"\";\n" +
+ " ^\n" +
+ "The final local variable s may already have been assigned\n" +
"----------\n");
}
// switch and definite assignment
@@ -1432,11 +1432,11 @@ public void test046() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " for (final int i; 0 < (i = 1); i = i + 1) {\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " for (final int i; 0 < (i = 1); i = i + 1) {\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
"1",
"",
@@ -1483,11 +1483,11 @@ public void test048() {
"}\n"
},
false /* expectingCompilerErrors */,
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " label: while (bar()) {\n" +
- " ^^^^^\n" +
- "The label label is never explicitly referenced\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " label: while (bar()) {\n" +
+ " ^^^^^\n" +
+ "The label label is never explicitly referenced\n" +
"----------\n" /* expectedCompilerLog */,
"" /* expectedOutputString */,
"" /* expectedErrorString */,
@@ -1573,30 +1573,30 @@ public void test052() {
runNegativeTest(
new String[] { /* test files */
"X.java",
- "public class X {\n" +
- " void foo(boolean b) {\n" +
- " if (b && false) {\n" +
- " int i = 0; // deadcode\n" +
- " return; // 1\n" +
- " }\n" +
+ "public class X {\n" +
+ " void foo(boolean b) {\n" +
+ " if (b && false) {\n" +
+ " int i = 0; // deadcode\n" +
+ " return; // 1\n" +
+ " }\n" +
" return;\n" +
" return;\n" +
" }\n" +
"} \n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " if (b && false) {\n" +
- " int i = 0; // deadcode\n" +
- " return; // 1\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " return;\n" +
- " ^^^^^^^\n" +
- "Unreachable code\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " if (b && false) {\n" +
+ " int i = 0; // deadcode\n" +
+ " return; // 1\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " return;\n" +
+ " ^^^^^^^\n" +
+ "Unreachable code\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=48399 - variation
@@ -1604,35 +1604,35 @@ public void test053() {
runNegativeTest(
new String[] { /* test files */
"X.java",
- "public class X {\n" +
- " void foo(boolean b) {\n" +
- " if (false && b) {\n" +
- " int j = 0; // deadcode\n" +
- " return; // 2\n" +
- " }\n" +
+ "public class X {\n" +
+ " void foo(boolean b) {\n" +
+ " if (false && b) {\n" +
+ " int j = 0; // deadcode\n" +
+ " return; // 2\n" +
+ " }\n" +
" return;\n" +
" return;\n" +
" }\n" +
"} \n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " if (false && b) {\n" +
- " ^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " if (false && b) {\n" +
- " int j = 0; // deadcode\n" +
- " return; // 2\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " return;\n" +
- " ^^^^^^^\n" +
- "Unreachable code\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " if (false && b) {\n" +
+ " ^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " if (false && b) {\n" +
+ " int j = 0; // deadcode\n" +
+ " return; // 2\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " return;\n" +
+ " ^^^^^^^\n" +
+ "Unreachable code\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=48399 - variation
@@ -1640,27 +1640,27 @@ public void test054() {
runNegativeTest(
new String[] { /* test files */
"X.java",
- "public class X {\n" +
- " void foo(boolean b) {\n" +
- " while (true) {\n" +
- " if (true) break;\n" +
- " int k = 0; // deadcode\n" +
- " }\n" +
+ "public class X {\n" +
+ " void foo(boolean b) {\n" +
+ " while (true) {\n" +
+ " if (true) break;\n" +
+ " int k = 0; // deadcode\n" +
+ " }\n" +
" return;\n" +
" return;\n" +
" }\n" +
"} \n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " int k = 0; // deadcode\n" +
- " ^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " return;\n" +
- " ^^^^^^^\n" +
- "Unreachable code\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " int k = 0; // deadcode\n" +
+ " ^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " return;\n" +
+ " ^^^^^^^\n" +
+ "Unreachable code\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=48399 - variation
@@ -1668,32 +1668,32 @@ public void test055() {
runNegativeTest(
new String[] { /* test files */
"X.java",
- "public class X {\n" +
- " void foo(boolean b) {\n" +
- " if (true || b) {\n" +
- " int l = 0; // deadcode\n" +
- " return; // 2a\n" +
- " } \n" +
+ "public class X {\n" +
+ " void foo(boolean b) {\n" +
+ " if (true || b) {\n" +
+ " int l = 0; // deadcode\n" +
+ " return; // 2a\n" +
+ " } \n" +
" return;\n" +
" return;\n" +
" }\n" +
"} \n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " if (true || b) {\n" +
- " ^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " return;\n" +
- " ^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " return;\n" +
- " ^^^^^^^\n" +
- "Unreachable code\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " if (true || b) {\n" +
+ " ^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " return;\n" +
+ " ^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " return;\n" +
+ " ^^^^^^^\n" +
+ "Unreachable code\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=48399 - variation
@@ -1702,109 +1702,109 @@ public void test056() {
runNegativeTest(
new String[] { /* test files */
"X.java",
- "public class X {\n" +
- " void bar() {\n" +
- " return;\n" +
- " {\n" +
- " return; // 3\n" +
- " }\n" +
- " }\n" +
- " void baz() {\n" +
- " return;\n" +
- " {\n" +
- " }\n" +
- " } \n" +
- " void baz2() {\n" +
- " return;\n" +
- " ; // 4\n" +
- " } \n" +
+ "public class X {\n" +
+ " void bar() {\n" +
+ " return;\n" +
+ " {\n" +
+ " return; // 3\n" +
+ " }\n" +
+ " }\n" +
+ " void baz() {\n" +
+ " return;\n" +
+ " {\n" +
+ " }\n" +
+ " } \n" +
+ " void baz2() {\n" +
+ " return;\n" +
+ " ; // 4\n" +
+ " } \n" +
"} \n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " {\n" +
- " return; // 3\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " {\n" +
- " }\n" +
- " ^^^^^\n" +
- "Unreachable code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " {\n" +
+ " return; // 3\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " {\n" +
+ " }\n" +
+ " ^^^^^\n" +
+ "Unreachable code\n" +
"----------\n");
return;
}
runNegativeTest(
new String[] { /* test files */
"X.java",
- "public class X {\n" +
- " void bar() {\n" +
- " return;\n" +
- " {\n" +
- " return; // 3\n" +
- " }\n" +
- " }\n" +
- " void baz() {\n" +
- " return;\n" +
- " {\n" +
- " }\n" +
- " } \n" +
- " void baz2() {\n" +
- " return;\n" +
- " ; // 4\n" +
- " } \n" +
+ "public class X {\n" +
+ " void bar() {\n" +
+ " return;\n" +
+ " {\n" +
+ " return; // 3\n" +
+ " }\n" +
+ " }\n" +
+ " void baz() {\n" +
+ " return;\n" +
+ " {\n" +
+ " }\n" +
+ " } \n" +
+ " void baz2() {\n" +
+ " return;\n" +
+ " ; // 4\n" +
+ " } \n" +
"} \n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " {\n" +
- " return; // 3\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " {\n" +
- " }\n" +
- " ^^^^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 15)\n" +
- " ; // 4\n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n");
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " {\n" +
+ " return; // 3\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " {\n" +
+ " }\n" +
+ " ^^^^^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 15)\n" +
+ " ; // 4\n" +
+ " ^\n" +
+ "Unreachable code\n" +
+ "----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=110544
public void test057() {
runNegativeTest(
new String[] { /* test files */
"X.java",
- "public class X {\n" +
- " void foo(int x, int[] array) {\n" +
- " for (int i = 0; \n" +
- " i < array.length; \n" +
- " i++) {//dead code\n" +
- " if (x == array[i])\n" +
- " return;\n" +
- " else\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " void foo(int x, int[] array) {\n" +
+ " for (int i = 0; \n" +
+ " i < array.length; \n" +
+ " i++) {//dead code\n" +
+ " if (x == array[i])\n" +
+ " return;\n" +
+ " else\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " i++) {//dead code\n" +
- " ^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " break;\n" +
- " ^^^^^^\n" +
- "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " i++) {//dead code\n" +
+ " ^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " break;\n" +
+ " ^^^^^^\n" +
+ "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=48399 - variation
@@ -1812,54 +1812,54 @@ public void test058() {
runNegativeTest(
new String[] { /* test files */
"X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " if (false) {\n" +
- " class Local {\n" +
+ "public class X {\n" +
+ " void foo() {\n" +
+ " if (false) {\n" +
+ " class Local {\n" +
" int i = 12;\n" +
" { i++; }\n" +
- " void method() {\n" +
- " if (false)\n" +
- " System.out.println();\n" +
- " return;\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ " void method() {\n" +
+ " if (false)\n" +
+ " System.out.println();\n" +
+ " return;\n" +
+ " return;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " if (false) {\n" +
- " class Local {\n" +
- " int i = 12;\n" +
- " { i++; }\n" +
- " void method() {\n" +
- " if (false)\n" +
- " System.out.println();\n" +
- " return;\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " class Local {\n" +
- " ^^^^^\n" +
- "The type Local is never used locally\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 7)\n" +
- " void method() {\n" +
- " ^^^^^^^^\n" +
- "The method method() from the type Local is never used locally\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 11)\n" +
- " return;\n" +
- " ^^^^^^^\n" +
- "Unreachable code\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " if (false) {\n" +
+ " class Local {\n" +
+ " int i = 12;\n" +
+ " { i++; }\n" +
+ " void method() {\n" +
+ " if (false)\n" +
+ " System.out.println();\n" +
+ " return;\n" +
+ " return;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " class Local {\n" +
+ " ^^^^^\n" +
+ "The type Local is never used locally\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 7)\n" +
+ " void method() {\n" +
+ " ^^^^^^^^\n" +
+ "The method method() from the type Local is never used locally\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 11)\n" +
+ " return;\n" +
+ " ^^^^^^^\n" +
+ "Unreachable code\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=48399 - variation
@@ -1867,39 +1867,39 @@ public void test059() {
runNegativeTest(
new String[] { /* test files */
"X.java",
- "public class X {\n" +
- " void foo(boolean b) {\n" +
- " int i = false && b ? 0 : 1;\n" +
- " if (false) {\n" +
- " int j = false && b ? 0 : 1;\n" +
- " }\n" +
- " return;\n" +
- " return;\n" +
- " }\n" +
+ "public class X {\n" +
+ " void foo(boolean b) {\n" +
+ " int i = false && b ? 0 : 1;\n" +
+ " if (false) {\n" +
+ " int j = false && b ? 0 : 1;\n" +
+ " }\n" +
+ " return;\n" +
+ " return;\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " int i = false && b ? 0 : 1;\n" +
- " ^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " int i = false && b ? 0 : 1;\n" +
- " ^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 4)\n" +
- " if (false) {\n" +
- " int j = false && b ? 0 : 1;\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " return;\n" +
- " ^^^^^^^\n" +
- "Unreachable code\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " int i = false && b ? 0 : 1;\n" +
+ " ^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " int i = false && b ? 0 : 1;\n" +
+ " ^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 4)\n" +
+ " if (false) {\n" +
+ " int j = false && b ? 0 : 1;\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " return;\n" +
+ " ^^^^^^^\n" +
+ "Unreachable code\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=48399 - variation
@@ -1907,68 +1907,68 @@ public void test060() {
runNegativeTest(
new String[] { /* test files */
"X.java",
- "public class X {\n" +
- " static final boolean DEBUG = false;\n" +
- " static final int DEBUG_LEVEL = 0;\n" +
- " boolean check() { return true; }\n" +
- " void foo(boolean b) {\n" +
- " if (DEBUG)\n" +
- " System.out.println(\"fake reachable1\"); //$NON-NLS-1$\n" +
- " if (DEBUG && b)\n" +
- " System.out.println(\"fake reachable2\"); //$NON-NLS-1$\n" +
- " if (DEBUG && check())\n" +
- " System.out.println(\"fake reachable3\"); //$NON-NLS-1$\n" +
- " if (b && DEBUG)\n" +
- " System.out.println(\"fake reachable4\"); //$NON-NLS-1$\n" +
- " if (check() && DEBUG)\n" +
- " System.out.println(\"fake reachable5\"); //$NON-NLS-1$\n" +
- " if (DEBUG_LEVEL > 1) \n" +
- " System.out.println(\"fake reachable6\"); //$NON-NLS-1$\n" +
- " return;\n" +
- " return;\n" +
- " }\n" +
+ "public class X {\n" +
+ " static final boolean DEBUG = false;\n" +
+ " static final int DEBUG_LEVEL = 0;\n" +
+ " boolean check() { return true; }\n" +
+ " void foo(boolean b) {\n" +
+ " if (DEBUG)\n" +
+ " System.out.println(\"fake reachable1\"); //$NON-NLS-1$\n" +
+ " if (DEBUG && b)\n" +
+ " System.out.println(\"fake reachable2\"); //$NON-NLS-1$\n" +
+ " if (DEBUG && check())\n" +
+ " System.out.println(\"fake reachable3\"); //$NON-NLS-1$\n" +
+ " if (b && DEBUG)\n" +
+ " System.out.println(\"fake reachable4\"); //$NON-NLS-1$\n" +
+ " if (check() && DEBUG)\n" +
+ " System.out.println(\"fake reachable5\"); //$NON-NLS-1$\n" +
+ " if (DEBUG_LEVEL > 1) \n" +
+ " System.out.println(\"fake reachable6\"); //$NON-NLS-1$\n" +
+ " return;\n" +
+ " return;\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " if (DEBUG && b)\n" +
- " ^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " System.out.println(\"fake reachable2\"); //$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 10)\n" +
- " if (DEBUG && check())\n" +
- " ^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 11)\n" +
- " System.out.println(\"fake reachable3\"); //$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 13)\n" +
- " System.out.println(\"fake reachable4\"); //$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 15)\n" +
- " System.out.println(\"fake reachable5\"); //$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 17)\n" +
- " System.out.println(\"fake reachable6\"); //$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 19)\n" +
- " return;\n" +
- " ^^^^^^^\n" +
- "Unreachable code\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " if (DEBUG && b)\n" +
+ " ^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " System.out.println(\"fake reachable2\"); //$NON-NLS-1$\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 10)\n" +
+ " if (DEBUG && check())\n" +
+ " ^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 11)\n" +
+ " System.out.println(\"fake reachable3\"); //$NON-NLS-1$\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 13)\n" +
+ " System.out.println(\"fake reachable4\"); //$NON-NLS-1$\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 15)\n" +
+ " System.out.println(\"fake reachable5\"); //$NON-NLS-1$\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 17)\n" +
+ " System.out.println(\"fake reachable6\"); //$NON-NLS-1$\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 19)\n" +
+ " return;\n" +
+ " ^^^^^^^\n" +
+ "Unreachable code\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=265962
@@ -1976,25 +1976,25 @@ public void test061() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " private static final boolean isIS() {\n" +
- " return System.currentTimeMillis()<0 ;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " do {\n" +
- " return;\n" +
- " } while(isIS() && false);\n" +
- " }\n" +
+ "public class X {\n" +
+ " private static final boolean isIS() {\n" +
+ " return System.currentTimeMillis()<0 ;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " do {\n" +
+ " return;\n" +
+ " } while(isIS() && false);\n" +
+ " }\n" +
"}\n", // =================
},
"");
// ensure optimized boolean codegen sequence
String expectedOutput =
- " public static void main(java.lang.String[] args);\n" +
- " 0 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 7]\n" +
- " Local variable table:\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 7]\n" +
+ " Local variable table:\n" +
" [pc: 0, pc: 1] local: args index: 0 type: java.lang.String[]\n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -2015,23 +2015,23 @@ public void test062() {
runNegativeTest(
new String[] { /* test files */
"X.java",
- "public class X {\n" +
- " private static final boolean isIS() {\n" +
- " return System.currentTimeMillis()<0 ;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " do {\n" +
- " return;\n" +
- " } while(isIS() && false);\n" +
- " return;\n" +
- " }\n" +
+ "public class X {\n" +
+ " private static final boolean isIS() {\n" +
+ " return System.currentTimeMillis()<0 ;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " do {\n" +
+ " return;\n" +
+ " } while(isIS() && false);\n" +
+ " return;\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " return;\n" +
- " ^^^^^^^\n" +
- "Unreachable code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " return;\n" +
+ " ^^^^^^^\n" +
+ "Unreachable code\n" +
"----------\n");
}
@@ -2050,11 +2050,11 @@ public void test063() {
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " new IllegalArgumentException(\"You must not bar!\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The allocated object is never used\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " new IllegalArgumentException(\"You must not bar!\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The allocated object is never used\n" +
"----------\n",
null /* classLibraries */,
true /* shouldFlushOutputDirectory */,
@@ -2076,11 +2076,11 @@ public void test064() {
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " new String(\"You must not bar!\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The allocated object is never used\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " new String(\"You must not bar!\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The allocated object is never used\n" +
"----------\n",
null /* classLibraries */,
true /* shouldFlushOutputDirectory */,
@@ -2106,8 +2106,8 @@ public void test065() {
},
"" /* expectedOutputString */,
null /* classLib */,
- true /* shouldFlushOutputDirectory */,
- null /* vmArguments */,
+ true /* shouldFlushOutputDirectory */,
+ null /* vmArguments */,
compilerOptions /* customOptions */,
null /* clientRequestor */);
}
@@ -2147,8 +2147,8 @@ public void test067() {
},
"" /* expectedOutputString */,
null /* classLib */,
- true /* shouldFlushOutputDirectory */,
- null /* vmArguments */,
+ true /* shouldFlushOutputDirectory */,
+ null /* vmArguments */,
compilerOptions /* customOptions */,
null /* clientRequestor */);
}
@@ -2171,8 +2171,8 @@ public void test068() {
},
"" /* expectedOutputString */,
null /* classLib */,
- true /* shouldFlushOutputDirectory */,
- null /* vmArguments */,
+ true /* shouldFlushOutputDirectory */,
+ null /* vmArguments */,
compilerOptions /* customOptions */,
null /* clientRequestor */);
}
@@ -2192,11 +2192,11 @@ public void test069() {
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " new Object() {};\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The allocated object is never used\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " new Object() {};\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The allocated object is never used\n" +
"----------\n",
null /* classLibraries */,
true /* shouldFlushOutputDirectory */,
@@ -2218,11 +2218,11 @@ public void test070() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " Object first = true ? null : \"\"; \n" +
- " ^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " Object first = true ? null : \"\"; \n" +
+ " ^^\n" +
+ "Dead code\n" +
"----------\n",
null /* classLibraries */,
true /* shouldFlushOutputDirectory */,
@@ -2249,16 +2249,16 @@ public void test071() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " throw new IOException();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " throw new IOException();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " throw new IOException();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " throw new IOException();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n");
}
@@ -2270,24 +2270,24 @@ public void testBug338234a() {
new String[] {
"X.java",
"public class X {\n" +
- " public static void main(String[] args) {\n" +
- " int i;\n" +
- " String str = null;\n" +
- " if (str != null)\n" +
- " i++; \n" +
- " }\n" +
+ " public static void main(String[] args) {\n" +
+ " int i;\n" +
+ " String str = null;\n" +
+ " if (str != null)\n" +
+ " i++; \n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " i++; \n" +
- " ^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " i++; \n" +
- " ^\n" +
- "The local variable i may not have been initialized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " i++; \n" +
+ " ^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " i++; \n" +
+ " ^\n" +
+ "The local variable i may not have been initialized\n" +
"----------\n");
}
@@ -2299,15 +2299,15 @@ public void testBug338234b() {
new String[] {
"X.java",
"public class X {\n" +
- " public static void main(String[] args) {\n" +
- " int i;\n" +
+ " public static void main(String[] args) {\n" +
+ " int i;\n" +
" l: {\n" +
" if(false)\n" +
- " break l;\n" +
+ " break l;\n" +
" return;\n" +
- " }\n" +
- " i++; \n" +
- " }\n" +
+ " }\n" +
+ " i++; \n" +
+ " }\n" +
"}\n"
},
"");
@@ -2322,29 +2322,29 @@ public void testBug338234c() {
"X.java",
"public class X {\n" +
" public final int field1;\n" +
- " {\n" +
- " int i;\n" +
+ " {\n" +
+ " int i;\n" +
" String str = null;\n" +
" if(str != null)\n" +
- " i = field1;\n" +
- " }\n" +
+ " i = field1;\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public final int field1;\n" +
- " ^^^^^^\n" +
- "The blank final field field1 may not have been initialized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " i = field1;\n" +
- " ^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " i = field1;\n" +
- " ^^^^^^\n" +
- "The blank final field field1 may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public final int field1;\n" +
+ " ^^^^^^\n" +
+ "The blank final field field1 may not have been initialized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " i = field1;\n" +
+ " ^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " i = field1;\n" +
+ " ^^^^^^\n" +
+ "The blank final field field1 may not have been initialized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=338234
@@ -2357,22 +2357,22 @@ public void testBug338234d() {
"public class X {\n" +
" void foo(boolean b) {\n" +
" int i;\n" +
- " String str = null;\n" +
+ " String str = null;\n" +
" if(b){\n" +
" if(str == null)\n" +
" return;\n" +
" } else {\n" +
" i = 2;\n" +
" }\n" +
- " i++;\n" +
- " }\n" +
+ " i++;\n" +
+ " }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " i++;\n" +
- " ^\n" +
- "The local variable i may not have been initialized\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " i++;\n" +
+ " ^\n" +
+ "The local variable i may not have been initialized\n" +
"----------\n");
}
// Bug 349326 - [1.7] new warning for missing try-with-resources
@@ -2383,25 +2383,25 @@ public void testCloseable1() {
this.runNegativeTest(
new String[] {
"X.java",
- "import java.io.File;\n" +
- "import java.io.FileReader;\n" +
- "import java.io.IOException;\n" +
+ "import java.io.File;\n" +
+ "import java.io.FileReader;\n" +
+ "import java.io.IOException;\n" +
"public class X {\n" +
" void foo() throws IOException {\n" +
- " File file = new File(\"somefile\");\n" +
- " FileReader fileReader = new FileReader(file); // not closed\n" +
- " char[] in = new char[50];\n" +
- " fileReader.read(in);\n" +
- " }\n" +
+ " File file = new File(\"somefile\");\n" +
+ " FileReader fileReader = new FileReader(file); // not closed\n" +
+ " char[] in = new char[50];\n" +
+ " fileReader.read(in);\n" +
+ " }\n" +
"}\n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " FileReader fileReader = new FileReader(file); // not closed\n" +
- " ^^^^^^^^^^\n" +
- "Resource leak: 'fileReader' is never closed\n" +
+ },
+ "----------\n" +
+ "1. WARNING in X.java (at line 7)\n" +
+ " FileReader fileReader = new FileReader(file); // not closed\n" +
+ " ^^^^^^^^^^\n" +
+ "Resource leak: 'fileReader' is never closed\n" +
"----------\n",
- null, true, options);
+ null, true, options);
}
// Bug 349326 - [1.7] new warning for missing try-with-resources
// variant < 1.7 using Closeable: resource is closed, cannot suggest try-with-resources < 1.7
@@ -2411,21 +2411,21 @@ public void testCloseable2() {
this.runConformTest(
new String[] {
"X.java",
- "import java.io.File;\n" +
- "import java.io.FileReader;\n" +
- "import java.io.IOException;\n" +
+ "import java.io.File;\n" +
+ "import java.io.FileReader;\n" +
+ "import java.io.IOException;\n" +
"public class X {\n" +
" void foo() throws IOException {\n" +
- " File file = new File(\"somefile\");\n" +
- " FileReader fileReader = new FileReader(file); // not closed\n" +
- " char[] in = new char[50];\n" +
+ " File file = new File(\"somefile\");\n" +
+ " FileReader fileReader = new FileReader(file); // not closed\n" +
+ " char[] in = new char[50];\n" +
" fileReader.read(in);\n" +
- " fileReader.close();\n" +
- " }\n" +
+ " fileReader.close();\n" +
+ " }\n" +
"}\n"
- },
+ },
"",
- null, true, null, options, null);
+ null, true, null, options, null);
}
// Bug 360328 - [compiler][null] detect null problems in nested code (local class inside a loop)
// return/break/continue inside anonymous class inside try-catch inside initializer
@@ -2453,7 +2453,7 @@ public void testLocalClassInInitializer1() {
" } catch (RuntimeException re) {}\n" +
" }\n" +
"}\n"
- },
+ },
"");
}
// Bug 360328 - [compiler][null] detect null problems in nested code (local class inside a loop)
@@ -2484,27 +2484,27 @@ public void testLocalClassInInitializer2() {
" }\n" +
" } \n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " { if (true) break; }\n" +
- " ^^^^^^\n" +
- "break cannot be used outside of a loop or a switch\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 11)\n" +
- " outer: for (int i=1;true;i++) {\n" +
- " ^^^^^\n" +
- "The label outer is never explicitly referenced\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 15)\n" +
- " if (2 == j) continue outer;\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The label outer is missing\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 16)\n" +
- " else continue;\n" +
- " ^^^^^^^^^\n" +
- "continue cannot be used outside of a loop\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " { if (true) break; }\n" +
+ " ^^^^^^\n" +
+ "break cannot be used outside of a loop or a switch\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 11)\n" +
+ " outer: for (int i=1;true;i++) {\n" +
+ " ^^^^^\n" +
+ "The label outer is never explicitly referenced\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 15)\n" +
+ " if (2 == j) continue outer;\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The label outer is missing\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 16)\n" +
+ " else continue;\n" +
+ " ^^^^^^^^^\n" +
+ "continue cannot be used outside of a loop\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=380313
@@ -2516,40 +2516,40 @@ public void testBug380313() {
new String[] {
"X.java",
"public class X {\n" +
- "public void foo() throws Exception {\n" +
- " int i = 1;\n" +
- " int j = 2;\n" +
- " try {\n" +
- " if ((bar() == 1)) {\n" +
- " if ((i == 1)) {\n" +
- " int n = bar();\n" +
- " if (n == 35) {\n" +
- " j = 2;\n" +
- " } else {\n" +
- " if (bar() > 0)\n" +
- " return;\n" +
- " }\n" +
- " } else {\n" +
- " throw new Exception();\n" +
- " }\n" +
- " } else {\n" +
- " throw new Exception();\n" +
- " }\n" +
- " if (bar() == 0)\n" +
- " return;\n" +
- " } finally {\n" +
- " bar();\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private int bar() {\n" +
- " return 0;\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
+ "public void foo() throws Exception {\n" +
+ " int i = 1;\n" +
+ " int j = 2;\n" +
+ " try {\n" +
+ " if ((bar() == 1)) {\n" +
+ " if ((i == 1)) {\n" +
+ " int n = bar();\n" +
+ " if (n == 35) {\n" +
+ " j = 2;\n" +
+ " } else {\n" +
+ " if (bar() > 0)\n" +
+ " return;\n" +
+ " }\n" +
+ " } else {\n" +
+ " throw new Exception();\n" +
+ " }\n" +
+ " } else {\n" +
+ " throw new Exception();\n" +
+ " }\n" +
+ " if (bar() == 0)\n" +
+ " return;\n" +
+ " } finally {\n" +
+ " bar();\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " private int bar() {\n" +
+ " return 0;\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
" }\n" +
"}\n"
- },
+ },
"");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=380313
@@ -2564,30 +2564,30 @@ public void testBug380313b() {
"import java.io.FileInputStream;\n" +
"import java.io.IOException;\n" +
"public class X {\n" +
- "public void foo() throws Exception {\n" +
- " int i = 1;\n" +
- " try {\n" +
+ "public void foo() throws Exception {\n" +
+ " int i = 1;\n" +
+ " try {\n" +
" try (FileInputStream fis = new FileInputStream(\"\")) {\n" +
- " if (i == 2)" +
- " return;\n" +
- " }\n" +
- " if (i == 35) \n" +
- " return;\n" +
- " } catch(IOException e) {\n" +
- " bar();\n" +
- " } finally {\n" +
- " bar();\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private int bar() {\n" +
- " return 0;\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
+ " if (i == 2)" +
+ " return;\n" +
+ " }\n" +
+ " if (i == 35) \n" +
+ " return;\n" +
+ " } catch(IOException e) {\n" +
+ " bar();\n" +
+ " } finally {\n" +
+ " bar();\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " private int bar() {\n" +
+ " return 0;\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
" }\n" +
"}\n"
- },
+ },
"");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=380750
@@ -2598,19 +2598,19 @@ public void testBug380750() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " void foo(String[] args) {\n" +
- " String s0;\n" +
- " for(String s : singleton(s0=\"\")) {\n" +
- " System.out.println(s);\n" +
- " }\n" +
- " System.out.println(s0);\n" +
- " }\n" +
- " String[] singleton(String s) {\n" +
- " return new String[] {s};\n" +
- " }\n" +
+ "public class X {\n" +
+ " void foo(String[] args) {\n" +
+ " String s0;\n" +
+ " for(String s : singleton(s0=\"\")) {\n" +
+ " System.out.println(s);\n" +
+ " }\n" +
+ " System.out.println(s0);\n" +
+ " }\n" +
+ " String[] singleton(String s) {\n" +
+ " return new String[] {s};\n" +
+ " }\n" +
"}\n"
- },
+ },
"");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=391517
@@ -2619,37 +2619,37 @@ public void testBug391517() {
this.runConformTest(
new String[] {
"X.java",
- "import java.io.PrintWriter;\n" +
- "\n" +
- "public class X {\n" +
- "\n" +
- " private static final int CONSTANT = 0;\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " // TODO Auto-generated method stub\n" +
- "\n" +
- " }\n" +
- "\n" +
- " static void addStackTrace(String prefix) {\n" +
- " if (CONSTANT == 0) {\n" +
- " return;\n" +
- " }\n" +
- " PrintWriter pw = null;\n" +
- " new Exception().printStackTrace(pw);\n" +
- " if (bar() == null) {\n" +
- " System.out.println();\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " static Object bar() {\n" +
- " return null;\n" +
- " }\n" +
+ "import java.io.PrintWriter;\n" +
+ "\n" +
+ "public class X {\n" +
+ "\n" +
+ " private static final int CONSTANT = 0;\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " // TODO Auto-generated method stub\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
+ " static void addStackTrace(String prefix) {\n" +
+ " if (CONSTANT == 0) {\n" +
+ " return;\n" +
+ " }\n" +
+ " PrintWriter pw = null;\n" +
+ " new Exception().printStackTrace(pw);\n" +
+ " if (bar() == null) {\n" +
+ " System.out.println();\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " static Object bar() {\n" +
+ " return null;\n" +
+ " }\n" +
"}"
- },
+ },
"");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=415997
-// Bug 415997 - java.lang.VerifyError: Expecting a stackmap frame at branch target
+// Bug 415997 - java.lang.VerifyError: Expecting a stackmap frame at branch target
public void testBug415997a() {
this.runConformTest(
new String[] {
@@ -2713,19 +2713,19 @@ public void testBug499809() {
this.runConformTest(
new String[] {
"Foo.java",
- "public class Foo {\n" +
- " static void foo( ) {\n" +
- " String _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, a, b,\n" +
- " c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, s0, s1, s2, s3, s4, s5, s6, s7;\n" +
- " Object ob = new Object();\n" +
- " int int1 = 0, int2 = 2, int3, int4;\n" +
- " if (ob != null) {\n" +
- " int4 = 1;\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"Done\");\n" +
- " }\n" +
+ "public class Foo {\n" +
+ " static void foo( ) {\n" +
+ " String _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, a, b,\n" +
+ " c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, s0, s1, s2, s3, s4, s5, s6, s7;\n" +
+ " Object ob = new Object();\n" +
+ " int int1 = 0, int2 = 2, int3, int4;\n" +
+ " if (ob != null) {\n" +
+ " int4 = 1;\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"Done\");\n" +
+ " }\n" +
"}\n"
},
"Done");
@@ -2734,21 +2734,21 @@ public void testBug499809a() {
this.runConformTest(
new String[] {
"Foo.java",
- "public class Foo {\n" +
- " static void foo( ) {\n" +
- " String _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, a, b,\n" +
- " c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, s0, s1, s2, s3, s4, s5, s6, s7;\n" +
- " Object ob = new Object();\n" +
- " int int1 = 0, int2 = 2, int3, int4;\n" +
- " if (ob == null) {\n" +
- " int1 = 1;\n" +
- " } else {\n" +
+ "public class Foo {\n" +
+ " static void foo( ) {\n" +
+ " String _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, a, b,\n" +
+ " c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, s0, s1, s2, s3, s4, s5, s6, s7;\n" +
+ " Object ob = new Object();\n" +
+ " int int1 = 0, int2 = 2, int3, int4;\n" +
+ " if (ob == null) {\n" +
+ " int1 = 1;\n" +
+ " } else {\n" +
" int4 = 1;\n" +
" }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"Done\");\n" +
- " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"Done\");\n" +
+ " }\n" +
"}\n"
},
"Done");
@@ -2760,20 +2760,20 @@ public void testBug506315() {
this.runNegativeTest(
new String[] {
"Test.java",
- "import java.util.function.Consumer;\n" +
- "public class Test {\n" +
- " public void test(String method) {\n" +
- " String str;\n" +
- " if (!method.equals(\"\")) {\n" +
- " str = \"String\";\n" +
- " str.concat(method);\n" +
- " }\n" +
- " new Consumer<String>() {\n" +
- " public void accept(String s) {\n" +
- " str = \"String\";\n" +
- " }\n" +
- " };\n" +
- " }\n" +
+ "import java.util.function.Consumer;\n" +
+ "public class Test {\n" +
+ " public void test(String method) {\n" +
+ " String str;\n" +
+ " if (!method.equals(\"\")) {\n" +
+ " str = \"String\";\n" +
+ " str.concat(method);\n" +
+ " }\n" +
+ " new Consumer<String>() {\n" +
+ " public void accept(String s) {\n" +
+ " str = \"String\";\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
"}\n"
},
this.complianceLevel < ClassFileConstants.JDK1_8 ?
@@ -2797,10 +2797,10 @@ public void _testBug533435() {
"X.java",
"public interface X {}\n"
}, new ASTVisitor() {
- public boolean visit(TypeDeclaration typeDeclaration,
+ public boolean visit(TypeDeclaration typeDeclaration,
CompilationUnitScope scope) {
if (new String(typeDeclaration.name).equals("X")) {
- typeDeclaration.methods =
+ typeDeclaration.methods =
new AbstractMethodDeclaration[0];
typeDeclaration.fields = new FieldDeclaration[0];
scope.referenceContext.analyseCode();
@@ -2815,38 +2815,38 @@ public void testBug537804_comment0() {
runConformTest(
new String[] {
"Test.java",
- "public class Test\n" +
- "{\n" +
- " private boolean dummy;\n" +
- "\n" +
- "//Test\n" +
- " void testMethod()\n" +
- " {\n" +
- " @SuppressWarnings(\"unused\")\n" +
- " boolean action;\n" +
- "\n" +
- " OUTER:\n" +
- " {\n" +
- " while (true)\n" +
- " {\n" +
- " if (dummy)\n" +
- " break OUTER;\n" +
- "\n" +
- " action = true;\n" +
- " break;\n" +
- " }\n" +
- "\n" +
- " return;\n" +
- " }\n" +
- "\n" +
- " return;\n" +
- " }\n" +
- "\n" +
- "//Main Method\n" +
- " public static void main(String[] arguments)\n" +
- " {\n" +
- " //No operation\n" +
- " }\n" +
+ "public class Test\n" +
+ "{\n" +
+ " private boolean dummy;\n" +
+ "\n" +
+ "//Test\n" +
+ " void testMethod()\n" +
+ " {\n" +
+ " @SuppressWarnings(\"unused\")\n" +
+ " boolean action;\n" +
+ "\n" +
+ " OUTER:\n" +
+ " {\n" +
+ " while (true)\n" +
+ " {\n" +
+ " if (dummy)\n" +
+ " break OUTER;\n" +
+ "\n" +
+ " action = true;\n" +
+ " break;\n" +
+ " }\n" +
+ "\n" +
+ " return;\n" +
+ " }\n" +
+ "\n" +
+ " return;\n" +
+ " }\n" +
+ "\n" +
+ "//Main Method\n" +
+ " public static void main(String[] arguments)\n" +
+ " {\n" +
+ " //No operation\n" +
+ " }\n" +
"}\n"
});
}
@@ -2854,54 +2854,54 @@ public void testBug537804_comment5() {
runNegativeTest(
new String[] {
"Test.java",
- "public class Test\n" +
- "{\n" +
- " private boolean dummy;\n" +
- "\n" +
- "//Test\n" +
- " void testMethod()\n" +
- " {\n" +
- " boolean action;\n" +
- "\n" +
- " OUTER:\n" +
- " {\n" +
- " while (true)\n" +
- " {\n" +
- " if (dummy)\n" +
- " break OUTER;\n" +
- "\n" +
- " action = true;\n" +
- " break;\n" +
- " }\n" +
- "\n" +
- " if (action) //Okay.\n" +
- " noOp();\n" +
- "\n" +
- " return;\n" +
- " }\n" +
- "\n" +
- " if (action) //Missing error: 'action' may not be initialized!\n" +
- " noOp();\n" +
- "\n" +
- " return;\n" +
- " }\n" +
- " void noOp()\n" +
- " {\n" +
- " //No operation\n" +
- " }\n" +
- "\n" +
- "//Main Method\n" +
- " public static void main(String[] arguments)\n" +
- " {\n" +
- " //No operation\n" +
- " }\n" +
+ "public class Test\n" +
+ "{\n" +
+ " private boolean dummy;\n" +
+ "\n" +
+ "//Test\n" +
+ " void testMethod()\n" +
+ " {\n" +
+ " boolean action;\n" +
+ "\n" +
+ " OUTER:\n" +
+ " {\n" +
+ " while (true)\n" +
+ " {\n" +
+ " if (dummy)\n" +
+ " break OUTER;\n" +
+ "\n" +
+ " action = true;\n" +
+ " break;\n" +
+ " }\n" +
+ "\n" +
+ " if (action) //Okay.\n" +
+ " noOp();\n" +
+ "\n" +
+ " return;\n" +
+ " }\n" +
+ "\n" +
+ " if (action) //Missing error: 'action' may not be initialized!\n" +
+ " noOp();\n" +
+ "\n" +
+ " return;\n" +
+ " }\n" +
+ " void noOp()\n" +
+ " {\n" +
+ " //No operation\n" +
+ " }\n" +
+ "\n" +
+ "//Main Method\n" +
+ " public static void main(String[] arguments)\n" +
+ " {\n" +
+ " //No operation\n" +
+ " }\n" +
"}\n"
},
"----------\n" +
- "1. ERROR in Test.java (at line 27)\n" +
- " if (action) //Missing error: \'action\' may not be initialized!\n" +
- " ^^^^^^\n" +
- "The local variable action may not have been initialized\n" +
+ "1. ERROR in Test.java (at line 27)\n" +
+ " if (action) //Missing error: \'action\' may not be initialized!\n" +
+ " ^^^^^^\n" +
+ "The local variable action may not have been initialized\n" +
"----------\n");
}
public void testBug548318_001() {
@@ -2909,16 +2909,16 @@ public void testBug548318_001() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " yield k;\n" +
- " ^\n" +
- "The local variable k may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " return k + it;\n" +
- " ^\n" +
- "The local variable k may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " yield k;\n" +
+ " ^\n" +
+ "The local variable k may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " return k + it;\n" +
+ " ^\n" +
+ "The local variable k may not have been initialized\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -2961,16 +2961,16 @@ public void testBug548318_002() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " k = switch (i) { \n" +
- " ^\n" +
- "The final local variable k may already have been assigned\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " yield k;\n" +
- " ^\n" +
- "The local variable k may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " k = switch (i) { \n" +
+ " ^\n" +
+ "The final local variable k may already have been assigned\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " yield k;\n" +
+ " ^\n" +
+ "The local variable k may not have been initialized\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -3015,11 +3015,11 @@ public void testBug548318_003() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 23)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 23)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -3067,26 +3067,26 @@ public void testBug548318_004() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " k = 1;\n" +
- " ^\n" +
- "The final local variable k cannot be assigned. It must be blank and not using a compound assignment\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " k = 2;\n" +
- " ^\n" +
- "The final local variable k cannot be assigned. It must be blank and not using a compound assignment\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 15)\n" +
- " k = 3;\n" +
- " ^\n" +
- "The final local variable k cannot be assigned. It must be blank and not using a compound assignment\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 23)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " k = 1;\n" +
+ " ^\n" +
+ "The final local variable k cannot be assigned. It must be blank and not using a compound assignment\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " k = 2;\n" +
+ " ^\n" +
+ "The final local variable k cannot be assigned. It must be blank and not using a compound assignment\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 15)\n" +
+ " k = 3;\n" +
+ " ^\n" +
+ "The final local variable k cannot be assigned. It must be blank and not using a compound assignment\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 23)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -3134,21 +3134,21 @@ public void testBug548318_005() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " yield k ;\n" +
- " ^\n" +
- "The local variable k may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 18)\n" +
- " return k;\n" +
- " ^\n" +
- "The local variable k may not have been initialized\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 22)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " yield k ;\n" +
+ " ^\n" +
+ "The local variable k may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 18)\n" +
+ " return k;\n" +
+ " ^\n" +
+ "The local variable k may not have been initialized\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 22)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -3190,7 +3190,7 @@ public void testBug548318_005() {
}
/**
* From JLS 13 16.1.7 , Suppose that the switch expression has result expressions e1, …, en, all of
- * which are boolean-valued.
+ * which are boolean-valued.
* V is definitely assigned after a switch expression when true iff for every value yield statement with
* expression e in the switch block that may exit the switch expression, V is definitely assigned after e when true.
* V is definitely assigned after a switch expression when false iff for every value yield statement with
@@ -3203,11 +3203,11 @@ public void testBug548318_006() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 22)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 22)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -3264,16 +3264,16 @@ public void testBug548318_007() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 18)\n" +
- " return v + d;\n" +
- " ^\n" +
- "The local variable v may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 22)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 18)\n" +
+ " return v + d;\n" +
+ " ^\n" +
+ "The local variable v may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 22)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -3315,7 +3315,7 @@ public void testBug548318_007() {
}
/**
* From JLS 13 16.1.7 , Suppose that the switch expression has result expressions e1, …, en, all of
- * which are boolean-valued.
+ * which are boolean-valued.
* V is [un]assigned before the selector expression iff V is [un]assigned before the switch statement.
*/
public void testBug548318_008() {
@@ -3325,11 +3325,11 @@ public void testBug548318_008() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 22)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 22)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -3371,7 +3371,7 @@ public void testBug548318_008() {
}
/**
* From JLS 13 16.1.7 , Suppose that the switch expression has result expressions e1, …, en, all of
- * which are boolean-valued.
+ * which are boolean-valued.
* V is [un]assigned before the selector expression iff V is [un]assigned before the switch statement.
*/
public void testBug548318_009() {
@@ -3381,16 +3381,16 @@ public void testBug548318_009() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " boolean b = switch (v) {\n" +
- " ^\n" +
- "The local variable v may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 22)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " boolean b = switch (v) {\n" +
+ " ^\n" +
+ "The local variable v may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 22)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -3432,7 +3432,7 @@ public void testBug548318_009() {
}
/**
* From JLS 13 16.1.7 , Suppose that the switch expression has result expressions e1, …, en, all of
- * which are boolean-valued.
+ * which are boolean-valued.
* V is [un]assigned before the first statement of the first switch labeled statement group in the switch block
* iff V is [un]assigned after the selector expression.
*/
@@ -3443,11 +3443,11 @@ public void testBug548318_010() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 22)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 22)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -3489,7 +3489,7 @@ public void testBug548318_010() {
}
/**
* From JLS 13 16.1.7 , Suppose that the switch expression has result expressions e1, …, en, all of
- * which are boolean-valued.
+ * which are boolean-valued.
* V is [un]assigned before the first statement of the first switch labeled statement group in the switch block
* iff V is [un]assigned after the selector expression.
*/
@@ -3500,16 +3500,16 @@ public void testBug548318_011() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " v += 1;\n" +
- " ^\n" +
- "The local variable v may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 22)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " v += 1;\n" +
+ " ^\n" +
+ "The local variable v may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 22)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -3563,11 +3563,11 @@ public void testBug548318_012() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 22)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 22)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -3612,7 +3612,7 @@ public void testBug548318_012() {
* which are boolean-valued.
* V is [un]assigned before the first statement of any switch labeled statement group other than the first iff
* V is [un]assigned after the selector expression and V is [un]assigned after the preceding statement.
- * and V is [un]assigned after the preceding statement"
+ * and V is [un]assigned after the preceding statement"
*/
public void testBug548318_012b() {
if (!checkPreviewAllowed())
@@ -3621,16 +3621,16 @@ public void testBug548318_012b() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 15)\n" +
- " return v + d;\n" +
- " ^\n" +
- "The local variable v may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 19)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 15)\n" +
+ " return v + d;\n" +
+ " ^\n" +
+ "The local variable v may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 19)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -3669,7 +3669,7 @@ public void testBug548318_012b() {
}
/**
* From JLS 13 16.1.7 , Suppose that the switch expression has result expressions e1, …, en, all of
- * which are boolean-valued.
+ * which are boolean-valued.
* V is [un]assigned before the first statement of any switch labeled statement group other than the first iff
* V is [un]assigned after the selector expression and V is [un]assigned after the preceding statement.
* and V is [un]assigned after the preceding statement" needs to be checked
@@ -3681,16 +3681,16 @@ public void testBug548318_013() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " v += 2;\n" +
- " ^\n" +
- "The local variable v may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 22)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " v += 2;\n" +
+ " ^\n" +
+ "The local variable v may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 22)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -3732,14 +3732,14 @@ public void testBug548318_013() {
}
/**
* From JLS 13 16.1.7 , Suppose that the switch expression has result expressions e1, …, en, all of
- * which are boolean-valued.
+ * which are boolean-valued.
* The following rules apply only if the switch block of a switch expression consists of switch labeled rules:
* V is definitely assigned after a switch expression when true iff for every switch labeled rule one of the following is true:
* It is a switch labeled expression e and V is definitely assigned after e when true.
- * It is a switch labeled block b and for every value yield statement expression e contained in b that may exit the switch expression,
+ * It is a switch labeled block b and for every value yield statement expression e contained in b that may exit the switch expression,
* V is definitely assigned after e when true.
* It is a switch labeled throw statement.
- *
+ *
* V is definitely assigned after a switch expression when false iff for every switch labeled rule one of the following is true:
* It is a switch labeled expression e and V is definitely assigned after e when false.
* It is a switch labeled block b and for every value yield statement expression e contained in b that may exit the switch expression,
@@ -3753,11 +3753,11 @@ public void testBug548318_014() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 23)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 23)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -3804,19 +3804,19 @@ public void testBug548318_014() {
}
/**
* From JLS 13 16.1.7 , Suppose that the switch expression has result expressions e1, …, en, all of
- * which are boolean-valued.
+ * which are boolean-valued.
* The following rules apply only if the switch block of a switch expression consists of switch labeled rules:
* V is definitely unassigned after a switch expression when true iff for every switch labeled rule one of the following is true:
* It is a switch labeled expression e and V is definitely unassigned after e when true .
* It is a switch labeled block b and for every value yield statement expression e contained in b that
- * may exit the switch expression, V is definitely unassigned before the value yield statement and
+ * may exit the switch expression, V is definitely unassigned before the value yield statement and
* V is definitely unassigned after e when true.
* It is a switch labeled throw statement.
- *
+ *
* V is definitely unassigned after a switch expression when false iff for every switch labeled rule one of the following is true:
* It is a switch labeled expression e and V is definitely unassigned after e when false.
* It is a switch labeled block b and for every value yield statement expression e contained in b that may
- * exit the switch expression, V is definitely unassigned before the value yield statement and V is definitely unassigned
+ * exit the switch expression, V is definitely unassigned before the value yield statement and V is definitely unassigned
* after e when false.
* It is a switch labeled throw statement.
*/
@@ -3827,16 +3827,16 @@ public void testBug548318_015() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 17)\n" +
- " return v + d;\n" +
- " ^\n" +
- "The local variable v may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 21)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 17)\n" +
+ " return v + d;\n" +
+ " ^\n" +
+ "The local variable v may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 21)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -3881,7 +3881,7 @@ public void testBug548318_015() {
}
/**
* From JLS 13 16.1.7 , Suppose that the switch expression has result expressions e1, …, en, all of
- * which are boolean-valued.
+ * which are boolean-valued.
* V is [un]assigned before any switch labeled expression or statement in the switch
* block iff V is [un]assigned after the selector expression.
*/
@@ -3892,11 +3892,11 @@ public void testBug548318_016() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 14)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 14)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -3934,7 +3934,7 @@ public void testBug548318_016() {
}
/**
* From JLS 13 16.1.7 , Suppose that the switch expression has result expressions e1, …, en, all of
- * which are boolean-valued.
+ * which are boolean-valued.
* The following rules apply only if the switch block of a switch expression consists of switch labeled rules:
* V is [un]assigned before any switch labeled expression or statement in the switch
* block iff V is [un]assigned after the selector expression.
@@ -3946,21 +3946,21 @@ public void testBug548318_017() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " case 0 -> v != 0;\n" +
- " ^\n" +
- "The local variable v may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " return v + d;\n" +
- " ^\n" +
- "The local variable v may not have been initialized\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 14)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " case 0 -> v != 0;\n" +
+ " ^\n" +
+ "The local variable v may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " return v + d;\n" +
+ " ^\n" +
+ "The local variable v may not have been initialized\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 14)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -3999,7 +3999,7 @@ public void testBug548318_017() {
/**
* From JLS 13 16.1.8, V is [un]assigned after a switch expression (15.28) iff all of the following are true:
* V is [un]assigned before every yield statement that may exit the switch statement.
- * For each switch labeled rule (14.11.1) in the switch block, V is [un]assigned after the
+ * For each switch labeled rule (14.11.1) in the switch block, V is [un]assigned after the
* expression, block, or throw statement of the switch labeled rule.
*/
public void testBug548318_018() {
@@ -4009,11 +4009,11 @@ public void testBug548318_018() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 20)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 20)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -4054,7 +4054,7 @@ public void testBug548318_018() {
/**
* From JLS 13 16.1.8, V is [un]assigned after a switch expression (15.28) iff all of the following are true:
* V is [un]assigned before every yield statement that may exit the switch statement.
- * For each switch labeled rule (14.11.1) in the switch block, V is [un]assigned after the
+ * For each switch labeled rule (14.11.1) in the switch block, V is [un]assigned after the
* expression, block, or throw statement of the switch labeled rule.
*/
public void testBug548318_019() {
@@ -4064,16 +4064,16 @@ public void testBug548318_019() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 15)\n" +
- " return v + t;\n" +
- " ^\n" +
- "The local variable v may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 19)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 15)\n" +
+ " return v + t;\n" +
+ " ^\n" +
+ "The local variable v may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 19)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -4122,11 +4122,11 @@ public void testBug548318_020() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 19)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 19)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -4175,16 +4175,16 @@ public void testBug548318_021() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " int t = switch (v) {\n" +
- " ^\n" +
- "The local variable v may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 19)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " int t = switch (v) {\n" +
+ " ^\n" +
+ "The local variable v may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 19)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -4224,11 +4224,11 @@ public void testBug548318_021() {
/**
* From JLS 13 16.1.8, Suppose that the switch expression has result expressions e1, …, en, not all of
* which are boolean-valued.
- * V is [un]assigned before the first block statement of a switch labeled statement group (14.11.1) of a switch expression
+ * V is [un]assigned before the first block statement of a switch labeled statement group (14.11.1) of a switch expression
* iff both of following are true:
* V is [un]assigned after the selector expression of the switch statement.
- * If the switch labeled statement group is not the first in the switch block,
- * V is [un]assigned after the last block statement of the preceding switch labeled statement group.
+ * If the switch labeled statement group is not the first in the switch block,
+ * V is [un]assigned after the last block statement of the preceding switch labeled statement group.
*/
public void testBug548318_022() {
if (!checkPreviewAllowed())
@@ -4237,11 +4237,11 @@ public void testBug548318_022() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 19)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 19)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -4281,11 +4281,11 @@ public void testBug548318_022() {
/**
* From JLS 13 16.1.8, Suppose that the switch expression has result expressions e1, …, en, not all of
* which are boolean-valued.
- * V is [un]assigned before the first block statement of a switch labeled statement group (14.11.1) of a switch expression
+ * V is [un]assigned before the first block statement of a switch labeled statement group (14.11.1) of a switch expression
* iff both of following are true:
* V is [un]assigned after the selector expression of the switch statement.
- * If the switch labeled statement group is not the first in the switch block,
- * V is [un]assigned after the last block statement of the preceding switch labeled statement group.
+ * If the switch labeled statement group is not the first in the switch block,
+ * V is [un]assigned after the last block statement of the preceding switch labeled statement group.
*/
public void testBug548318_023() {
if (!checkPreviewAllowed())
@@ -4294,16 +4294,16 @@ public void testBug548318_023() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " yield v;\n" +
- " ^\n" +
- "The local variable v may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 19)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " yield v;\n" +
+ " ^\n" +
+ "The local variable v may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 19)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -4343,11 +4343,11 @@ public void testBug548318_023() {
/**
* From JLS 13 16.1.8, Suppose that the switch expression has result expressions e1, …, en, not all of
* which are boolean-valued.
- * V is [un]assigned before the first block statement of a switch labeled statement group (14.11.1) of a switch expression
+ * V is [un]assigned before the first block statement of a switch labeled statement group (14.11.1) of a switch expression
* iff both of following are true:
* V is [un]assigned after the selector expression of the switch statement.
- * If the switch labeled statement group is not the first in the switch block,
- * V is [un]assigned after the last block statement of the preceding switch labeled statement group.
+ * If the switch labeled statement group is not the first in the switch block,
+ * V is [un]assigned after the last block statement of the preceding switch labeled statement group.
*/
public void testBug548318_024() {
if (!checkPreviewAllowed())
@@ -4356,16 +4356,16 @@ public void testBug548318_024() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " yield v;\n" +
- " ^\n" +
- "The local variable v may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 19)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " yield v;\n" +
+ " ^\n" +
+ "The local variable v may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 19)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -4405,7 +4405,7 @@ public void testBug548318_024() {
/**
* From JLS 13 16.1.8, V is [un]assigned after a switch expression (15.28) iff all of the following are true:
* V is [un]assigned before every yield statement that may exit the switch statement.
- * For each switch labeled rule (14.11.1) in the switch block, V is [un]assigned after the
+ * For each switch labeled rule (14.11.1) in the switch block, V is [un]assigned after the
* expression, block, or throw statement of the switch labeled rule.
*/
public void testBug548318_025() {
@@ -4415,11 +4415,11 @@ public void testBug548318_025() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 20)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 20)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -4465,7 +4465,7 @@ public void testBug548318_025() {
/**
* From JLS 13 16.1.8, V is [un]assigned after a switch expression (15.28) iff all of the following are true:
* V is [un]assigned before every yield statement that may exit the switch statement.
- * For each switch labeled rule (14.11.1) in the switch block, V is [un]assigned after the
+ * For each switch labeled rule (14.11.1) in the switch block, V is [un]assigned after the
* expression, block, or throw statement of the switch labeled rule.
*/
public void testBug548318_026() {
@@ -4475,16 +4475,16 @@ public void testBug548318_026() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 16)\n" +
- " return v + t;\n" +
- " ^\n" +
- "The local variable v may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 20)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 16)\n" +
+ " return v + t;\n" +
+ " ^\n" +
+ "The local variable v may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 20)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -4540,11 +4540,11 @@ public void testBug548318_027() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 20)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 20)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -4600,16 +4600,16 @@ public void testBug548318_028() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " case 0 -> v;\n" +
- " ^\n" +
- "The local variable v may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 20)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " case 0 -> v;\n" +
+ " ^\n" +
+ "The local variable v may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 20)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -4670,11 +4670,11 @@ public void testBug548318_029() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 24)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 24)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
@@ -4739,16 +4739,16 @@ public void testBug548318_030() {
return;
Map<String, String> defaultOptions = setPresetPreviewOptions();
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 20)\n" +
- " return v;\n" +
- " ^\n" +
- "The local variable v may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 24)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 20)\n" +
+ " return v;\n" +
+ " ^\n" +
+ "The local variable v may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 24)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
String[] testFiles = new String[] {
"X.java", // =================
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest8.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest8.java
index 2b04f667f..590f2d872 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest8.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest8.java
@@ -58,18 +58,18 @@ public void testLambda_01() {
" ISAM printer = (p,o) -> p.concat(o.toString());\n" +
" }\n" +
"}\n"
- },
+ },
customOptions,
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " ISAM printer = (p,o) -> p.concat(o.toString());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type 'String' needs unchecked conversion to conform to \'@NonNull String\'\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " ISAM printer = (p,o) -> p.concat(o.toString());\n" +
- " ^\n" +
- "Potential null pointer access: this expression has a '@Nullable' type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " ISAM printer = (p,o) -> p.concat(o.toString());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type 'String' needs unchecked conversion to conform to \'@NonNull String\'\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " ISAM printer = (p,o) -> p.concat(o.toString());\n" +
+ " ^\n" +
+ "Potential null pointer access: this expression has a '@Nullable' type\n" +
"----------\n");
}
@@ -91,18 +91,18 @@ public void testLambda_02() {
" ISAM printer = (@NonNull Object o1, @NonNull Object o2, @NonNull Object o3) -> System.out.println(2);\n" +
" }\n" +
"}\n"
- },
+ },
customOptions,
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " ISAM printer = (@NonNull Object o1, @NonNull Object o2, @NonNull Object o3) -> System.out.println(2);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Illegal redefinition of parameter o2, inherited method from ISAM declares this parameter as @Nullable\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " ISAM printer = (@NonNull Object o1, @NonNull Object o2, @NonNull Object o3) -> System.out.println(2);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Illegal redefinition of parameter o3, inherited method from ISAM does not constrain this parameter\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " ISAM printer = (@NonNull Object o1, @NonNull Object o2, @NonNull Object o3) -> System.out.println(2);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Illegal redefinition of parameter o2, inherited method from ISAM declares this parameter as @Nullable\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " ISAM printer = (@NonNull Object o1, @NonNull Object o2, @NonNull Object o3) -> System.out.println(2);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Illegal redefinition of parameter o3, inherited method from ISAM does not constrain this parameter\n" +
"----------\n");
}
@@ -128,28 +128,28 @@ public void testLambda_03() {
" -> System.out.println(o1.toString()+o2.toString()+o3.toString());\n" +
" }\n" +
"}\n"
- },
+ },
customOptions,
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " -> System.out.println(o1.toString()+o2.toString()+o3.toString());\n" +
- " ^^\n" +
- "Potential null pointer access: The variable o2 may be null at this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " -> System.out.println(o1.toString()+o2.toString()+o3.toString());\n" +
- " ^^\n" +
- "Potential null pointer access: this expression has a '@Nullable' type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " -> System.out.println(o1.toString()+o2.toString()+o3.toString());\n" +
- " ^^\n" +
- "Potential null pointer access: this expression has a '@Nullable' type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " -> System.out.println(o1.toString()+o2.toString()+o3.toString());\n" +
- " ^^\n" +
- "Potential null pointer access: this expression has a '@Nullable' type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " -> System.out.println(o1.toString()+o2.toString()+o3.toString());\n" +
+ " ^^\n" +
+ "Potential null pointer access: The variable o2 may be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " -> System.out.println(o1.toString()+o2.toString()+o3.toString());\n" +
+ " ^^\n" +
+ "Potential null pointer access: this expression has a '@Nullable' type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " -> System.out.println(o1.toString()+o2.toString()+o3.toString());\n" +
+ " ^^\n" +
+ "Potential null pointer access: this expression has a '@Nullable' type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " -> System.out.println(o1.toString()+o2.toString()+o3.toString());\n" +
+ " ^^\n" +
+ "Potential null pointer access: this expression has a '@Nullable' type\n" +
"----------\n");
}
@@ -170,17 +170,17 @@ public void testLambda_04() {
" -> System.out.println(i);\n" +
" }\n" +
"}\n"
- },
+ },
customOptions,
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " ISAM printer1 = (@NonNull int i) \n" +
- " ^^^^^^^^\n" +
- "The nullness annotation @NonNull is not applicable for the primitive type int\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " ISAM printer1 = (@NonNull int i) \n" +
+ " ^^^^^^^^\n" +
+ "The nullness annotation @NonNull is not applicable for the primitive type int\n" +
"----------\n");
}
-// Lambda inherits null contract and has block with return statement
+// Lambda inherits null contract and has block with return statement
public void testLambda_05() {
Map customOptions = getCompilerOptions();
runNegativeTestWithLibs(
@@ -199,13 +199,13 @@ public void testLambda_05() {
" };\n" +
" }\n" +
"}\n"
- },
+ },
customOptions,
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " return null; // error\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " return null; // error\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n");
}
// Lambda has no descriptor (overriding method from Object), don't bail out with NPE during analysis
@@ -238,7 +238,7 @@ public void testLambda_05a() {
true /*flush*/,
customOptions);
}
-// Test flows with ReferenceExpression regarding:
+// Test flows with ReferenceExpression regarding:
// - definite assignment
// - unused local
public void testReferenceExpression1() {
@@ -271,21 +271,21 @@ public void testReferenceExpression1() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " I i = x::moo; // x is unassigned\n" +
- " ^\n" +
- "The local variable x may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " I is = xs::soo;\n" +
- " ^^^^^^^\n" +
- "The method soo() from the type X should be accessed in a static way \n" +
- "----------\n" +
- "3. ERROR in X.java (at line 15)\n" +
- " X x1 = this, x2 = this; // x2 is not used, only x is\n" +
- " ^^\n" +
- "The value of the local variable x2 is not used\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " I i = x::moo; // x is unassigned\n" +
+ " ^\n" +
+ "The local variable x may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 12)\n" +
+ " I is = xs::soo;\n" +
+ " ^^^^^^^\n" +
+ "The method soo() from the type X should be accessed in a static way \n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 15)\n" +
+ " X x1 = this, x2 = this; // x2 is not used, only x is\n" +
+ " ^^\n" +
+ "The value of the local variable x2 is not used\n" +
"----------\n",
null/*libs*/, true/*flush*/, options);
}
@@ -310,11 +310,11 @@ public void testReferenceExpression_null_1() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " I i = x::bar;\n" +
- " ^\n" +
- "Null pointer access: The variable x can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " I i = x::bar;\n" +
+ " ^\n" +
+ "Null pointer access: The variable x can only be null at this location\n" +
"----------\n",
null/*libs*/, true/*flush*/, options);
}
@@ -336,16 +336,16 @@ public void testReferenceExpression_nullAnnotation_1() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " I i = this::bar;\n" +
- " ^^^^^^^^^\n" +
- "Null type mismatch at parameter 1: required '@NonNull Object' but provided '@Nullable Object' via method descriptor I.foo(Object)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " I i = this::bar;\n" +
- " ^^^^^^^^^\n" +
- "Null type mismatch at method return type: Method descriptor I.foo(Object) promises '@NonNull String' but referenced method provides '@Nullable String'\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " I i = this::bar;\n" +
+ " ^^^^^^^^^\n" +
+ "Null type mismatch at parameter 1: required '@NonNull Object' but provided '@Nullable Object' via method descriptor I.foo(Object)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " I i = this::bar;\n" +
+ " ^^^^^^^^^\n" +
+ "Null type mismatch at method return type: Method descriptor I.foo(Object) promises '@NonNull String' but referenced method provides '@Nullable String'\n" +
"----------\n");
}
public void testReferenceExpression_nullAnnotation_2() {
@@ -367,11 +367,11 @@ public void testReferenceExpression_nullAnnotation_2() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " I i = this::bar;\n" +
- " ^^^^^^^^^\n" +
- "Null type safety at method return type: Method descriptor I.foo(Object) promises \'@NonNull String\' but referenced method provides \'String\'\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " I i = this::bar;\n" +
+ " ^^^^^^^^^\n" +
+ "Null type safety at method return type: Method descriptor I.foo(Object) promises \'@NonNull String\' but referenced method provides \'String\'\n" +
"----------\n");
}
public void testReferenceExpression_nullAnnotation_3() {
@@ -393,16 +393,16 @@ public void testReferenceExpression_nullAnnotation_3() {
" Zork zork;\n" + // make warning visible by forcing an error
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " I i = this::bar;\n" +
- " ^^^^^^^^^\n" +
- "Null type safety: parameter 1 provided via method descriptor I.foo(Object) needs unchecked conversion to conform to '@NonNull Object'\n" +
"----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " Zork zork;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " I i = this::bar;\n" +
+ " ^^^^^^^^^\n" +
+ "Null type safety: parameter 1 provided via method descriptor I.foo(Object) needs unchecked conversion to conform to '@NonNull Object'\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " Zork zork;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n",
this.LIBS,
true /*flush*/,
@@ -415,26 +415,26 @@ public void testBug535308a() {
runner.testFiles =
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" public int someTest() {\n" +
- " boolean unused = false;\n" +
- " final boolean thisIsFalse = false;\n" +
- " if (getSomeValue() == thisIsFalse) {\n" +
- " return 0;\n" +
- " }\n" +
- " return 1;\n" +
- " }\n" +
- " private boolean getSomeValue() {\n" +
- " return true;\n" +
- " }\n" +
+ " boolean unused = false;\n" +
+ " final boolean thisIsFalse = false;\n" +
+ " if (getSomeValue() == thisIsFalse) {\n" +
+ " return 0;\n" +
+ " }\n" +
+ " return 1;\n" +
+ " }\n" +
+ " private boolean getSomeValue() {\n" +
+ " return true;\n" +
+ " }\n" +
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " boolean unused = false;\n" +
- " ^^^^^^\n" +
- "The value of the local variable unused is not used\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " boolean unused = false;\n" +
+ " ^^^^^^\n" +
+ "The value of the local variable unused is not used\n" +
"----------\n";
runner.classLibraries =
this.LIBS;
@@ -448,27 +448,27 @@ public void testBug535308b() {
runner.testFiles =
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" public int someTest() {\n" +
- " boolean unused = false;\n" +
- " final boolean thisIsFalse = false;\n" +
- " if (getSomeValue() != thisIsFalse) {\n" +
- " return 0;\n" +
- " }\n" +
- " return 1;\n" +
- " }\n" +
- "\n" +
- " private boolean getSomeValue() {\n" +
- " return true;\n" +
- " }\n" +
+ " boolean unused = false;\n" +
+ " final boolean thisIsFalse = false;\n" +
+ " if (getSomeValue() != thisIsFalse) {\n" +
+ " return 0;\n" +
+ " }\n" +
+ " return 1;\n" +
+ " }\n" +
+ "\n" +
+ " private boolean getSomeValue() {\n" +
+ " return true;\n" +
+ " }\n" +
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " boolean unused = false;\n" +
- " ^^^^^^\n" +
- "The value of the local variable unused is not used\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " boolean unused = false;\n" +
+ " ^^^^^^\n" +
+ "The value of the local variable unused is not used\n" +
"----------\n";
runner.classLibraries =
this.LIBS;
@@ -482,27 +482,27 @@ public void testBug535308c() {
runner.testFiles =
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" public int someTest() {\n" +
- " boolean unused = false;\n" +
- " final boolean thisIsFalse = false;\n" +
- " if (thisIsFalse != getSomeValue()) {\n" +
- " return 0;\n" +
- " }\n" +
- " return 1;\n" +
- " }\n" +
- "\n" +
- " private boolean getSomeValue() {\n" +
- " return true;\n" +
- " }\n" +
+ " boolean unused = false;\n" +
+ " final boolean thisIsFalse = false;\n" +
+ " if (thisIsFalse != getSomeValue()) {\n" +
+ " return 0;\n" +
+ " }\n" +
+ " return 1;\n" +
+ " }\n" +
+ "\n" +
+ " private boolean getSomeValue() {\n" +
+ " return true;\n" +
+ " }\n" +
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " boolean unused = false;\n" +
- " ^^^^^^\n" +
- "The value of the local variable unused is not used\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " boolean unused = false;\n" +
+ " ^^^^^^\n" +
+ "The value of the local variable unused is not used\n" +
"----------\n";
runner.classLibraries =
this.LIBS;
@@ -516,27 +516,27 @@ public void testBug535308d() {
runner.testFiles =
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" public int someTest() {\n" +
- " boolean unused = false;\n" +
- " final boolean thisIsFalse = false;\n" +
- " if (thisIsFalse == getSomeValue()) {\n" +
- " return 0;\n" +
- " }\n" +
- " return 1;\n" +
- " }\n" +
- "\n" +
- " private boolean getSomeValue() {\n" +
- " return true;\n" +
- " }\n" +
+ " boolean unused = false;\n" +
+ " final boolean thisIsFalse = false;\n" +
+ " if (thisIsFalse == getSomeValue()) {\n" +
+ " return 0;\n" +
+ " }\n" +
+ " return 1;\n" +
+ " }\n" +
+ "\n" +
+ " private boolean getSomeValue() {\n" +
+ " return true;\n" +
+ " }\n" +
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " boolean unused = false;\n" +
- " ^^^^^^\n" +
- "The value of the local variable unused is not used\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " boolean unused = false;\n" +
+ " ^^^^^^\n" +
+ "The value of the local variable unused is not used\n" +
"----------\n";
runner.classLibraries =
this.LIBS;
@@ -550,27 +550,27 @@ public void testBug535308e() {
runner.testFiles =
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" public int someTest() {\n" +
- " boolean used = false;\n" +
- " final boolean thisIsFalse = false;\n" +
- " if (used == getSomeValue()) {\n" +
- " return 0;\n" +
- " }\n" +
- " return 1;\n" +
- " }\n" +
- "\n" +
- " private boolean getSomeValue() {\n" +
- " return true;\n" +
- " }\n" +
+ " boolean used = false;\n" +
+ " final boolean thisIsFalse = false;\n" +
+ " if (used == getSomeValue()) {\n" +
+ " return 0;\n" +
+ " }\n" +
+ " return 1;\n" +
+ " }\n" +
+ "\n" +
+ " private boolean getSomeValue() {\n" +
+ " return true;\n" +
+ " }\n" +
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " final boolean thisIsFalse = false;\n" +
- " ^^^^^^^^^^^\n" +
- "The value of the local variable thisIsFalse is not used\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " final boolean thisIsFalse = false;\n" +
+ " ^^^^^^^^^^^\n" +
+ "The value of the local variable thisIsFalse is not used\n" +
"----------\n";
runner.classLibraries =
this.LIBS;
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ForStatementTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ForStatementTest.java
index b1e9ebab8..2c1582767 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ForStatementTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ForStatementTest.java
@@ -283,931 +283,931 @@ public void test006() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public final class X {\n" +
- "\n" +
- " public void show() {\n" +
- " String s1 = \"\"; String s2 = \"\"; String s3 = \"\"; String s4 = \"\"; String s5 = \"\"; String s6 = \"\"; String s7 = \"\"; String s8 = \"\"; String s9 = \"\"; String s10 = \"\";\n" +
- " String s11 = \"\"; String s12 = \"\"; String s13 = \"\"; String s14 = \"\"; String s15 = \"\"; String s16 = \"\"; String s17 = \"\"; String s18 = \"\"; String s19 = \"\"; String s20 = \"\";\n" +
- " String s21 = \"\"; String s22 = \"\"; String s23 = \"\"; String s24 = \"\"; String s25 = \"\"; String s26 = \"\"; String s27 = \"\"; String s28 = \"\"; String s29 = \"\"; String s30 = \"\";\n" +
- " String s31 = \"\"; String s32 = \"\"; String s33 = \"\"; String s34 = \"\"; String s35 = \"\"; String s36 = \"\"; String s37 = \"\"; String s38 = \"\"; String s39 = \"\"; String s40 = \"\";\n" +
- " String s41 = \"\"; String s42 = \"\"; String s43 = \"\"; String s44 = \"\"; String s45 = \"\"; String s46 = \"\"; String s47 = \"\"; String s48 = \"\"; String s49 = \"\"; String s50 = \"\";\n" +
- " String s51 = \"\"; String s52 = \"\"; String s53 = \"\"; String s54 = \"\"; String s55 = \"\"; String s56 = \"\"; String s57 = \"\"; String s58 = \"\"; String s59 = \"\"; String s60 = \"\";\n" +
- " String s61 = \"\"; String s62 = \"\"; String s63 = \"\"; String s64 = \"\"; String s65 = \"\"; String s66 = \"\"; String s67 = \"\"; String s68 = \"\"; String s69 = \"\"; String s70 = \"\";\n" +
- " String s71 = \"\"; String s72 = \"\"; String s73 = \"\"; String s74 = \"\"; String s75 = \"\"; String s76 = \"\"; String s77 = \"\"; String s78 = \"\"; String s79 = \"\"; String s80 = \"\";\n" +
- " String s81 = \"\"; String s82 = \"\"; String s83 = \"\"; String s84 = \"\"; String s85 = \"\"; String s86 = \"\"; String s87 = \"\"; String s88 = \"\"; String s89 = \"\"; String s90 = \"\";\n" +
- " String s91 = \"\"; String s92 = \"\"; String s93 = \"\"; String s94 = \"\"; String s95 = \"\"; String s96 = \"\"; String s97 = \"\"; String s98 = \"\"; String s99 = \"\"; String s100 = \"\";\n" +
- " String s101 = \"\"; String s102 = \"\"; String s103 = \"\"; String s104 = \"\"; String s105 = \"\"; String s106 = \"\"; String s107 = \"\"; String s108 = \"\"; String s109 = \"\"; String s110 = \"\";\n" +
- " String s111 = \"\"; String s112 = \"\"; String s113 = \"\"; String s114 = \"\"; String s115 = \"\"; String s116 = \"\"; String s117 = \"\"; String s118 = \"\"; String s119 = \"\"; String s120 = \"\";\n" +
- " String s121 = \"\"; String s122 = \"\"; String s123 = \"\"; String s124 = \"\"; String s125 = \"\"; String s126 = \"\"; String s127 = \"\"; String s128 = \"\"; String s129 = \"\"; String s130 = \"\";\n" +
- " String s131 = \"\"; String s132 = \"\"; String s133 = \"\"; String s134 = \"\"; String s135 = \"\"; String s136 = \"\"; String s137 = \"\"; String s138 = \"\"; String s139 = \"\"; String s140 = \"\";\n" +
- " String s141 = \"\"; String s142 = \"\"; String s143 = \"\"; String s144 = \"\"; String s145 = \"\"; String s146 = \"\"; String s147 = \"\"; String s148 = \"\"; String s149 = \"\"; String s150 = \"\";\n" +
- " String s151 = \"\"; String s152 = \"\"; String s153 = \"\"; String s154 = \"\"; String s155 = \"\"; String s156 = \"\"; String s157 = \"\"; String s158 = \"\"; String s159 = \"\"; String s160 = \"\";\n" +
- " String s161 = \"\"; String s162 = \"\"; String s163 = \"\"; String s164 = \"\"; String s165 = \"\"; String s166 = \"\"; String s167 = \"\"; String s168 = \"\"; String s169 = \"\"; String s170 = \"\";\n" +
- " String s171 = \"\"; String s172 = \"\"; String s173 = \"\"; String s174 = \"\"; String s175 = \"\"; String s176 = \"\"; String s177 = \"\"; String s178 = \"\"; String s179 = \"\"; String s180 = \"\";\n" +
- " String s181 = \"\"; String s182 = \"\"; String s183 = \"\"; String s184 = \"\"; String s185 = \"\"; String s186 = \"\"; String s187 = \"\"; String s188 = \"\"; String s189 = \"\"; String s190 = \"\";\n" +
- " String s191 = \"\"; String s192 = \"\"; String s193 = \"\"; String s194 = \"\"; String s195 = \"\"; String s196 = \"\"; String s197 = \"\"; String s198 = \"\"; String s199 = \"\"; String s200 = \"\";\n" +
- " String s201 = \"\"; String s202 = \"\"; String s203 = \"\"; String s204 = \"\"; String s205 = \"\"; String s206 = \"\"; String s207 = \"\"; String s208 = \"\"; String s209 = \"\"; String s210 = \"\";\n" +
- " String s211 = \"\"; String s212 = \"\"; String s213 = \"\"; String s214 = \"\"; String s215 = \"\"; String s216 = \"\"; String s217 = \"\"; String s218 = \"\"; String s219 = \"\"; String s220 = \"\";\n" +
- " String s221 = \"\"; String s222 = \"\"; String s223 = \"\"; String s224 = \"\"; String s225 = \"\"; String s226 = \"\"; String s227 = \"\"; String s228 = \"\"; String s229 = \"\"; String s230 = \"\";\n" +
- " String s231 = \"\"; String s232 = \"\"; String s233 = \"\"; String s234 = \"\"; String s235 = \"\"; String s236 = \"\"; String s237 = \"\"; String s238 = \"\"; String s239 = \"\"; String s240 = \"\";\n" +
- " String s241 = \"\"; String s242 = \"\"; String s243 = \"\"; String s244 = \"\"; String s245 = \"\"; String s246 = \"\"; String s247 = \"\"; String s248 = \"\"; String s249 = \"\"; String s250 = \"\";\n" +
- " String s251 = \"\"; String s252 = \"\";\n" +
- "\n" +
- " int size1 = 1;\n" +
- " int size2 = 2;\n" +
- " int size3 = 3;\n" +
- "\n" +
- " int[][][] intArray = new int[size1][size2][size3];\n" +
- " \n" +
- " for (int i = 0; i < size1; i++) {\n" +
- " for (int j = 0; j < size2; j++) {\n" +
- " boolean on = false;\n" +
- " for (int k = 0; k < size3; k++) {\n" +
- " intArray[i][j][k] = on ? 0 : 1;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " new X().show();\n" +
- " }\n" +
+ "public final class X {\n" +
+ "\n" +
+ " public void show() {\n" +
+ " String s1 = \"\"; String s2 = \"\"; String s3 = \"\"; String s4 = \"\"; String s5 = \"\"; String s6 = \"\"; String s7 = \"\"; String s8 = \"\"; String s9 = \"\"; String s10 = \"\";\n" +
+ " String s11 = \"\"; String s12 = \"\"; String s13 = \"\"; String s14 = \"\"; String s15 = \"\"; String s16 = \"\"; String s17 = \"\"; String s18 = \"\"; String s19 = \"\"; String s20 = \"\";\n" +
+ " String s21 = \"\"; String s22 = \"\"; String s23 = \"\"; String s24 = \"\"; String s25 = \"\"; String s26 = \"\"; String s27 = \"\"; String s28 = \"\"; String s29 = \"\"; String s30 = \"\";\n" +
+ " String s31 = \"\"; String s32 = \"\"; String s33 = \"\"; String s34 = \"\"; String s35 = \"\"; String s36 = \"\"; String s37 = \"\"; String s38 = \"\"; String s39 = \"\"; String s40 = \"\";\n" +
+ " String s41 = \"\"; String s42 = \"\"; String s43 = \"\"; String s44 = \"\"; String s45 = \"\"; String s46 = \"\"; String s47 = \"\"; String s48 = \"\"; String s49 = \"\"; String s50 = \"\";\n" +
+ " String s51 = \"\"; String s52 = \"\"; String s53 = \"\"; String s54 = \"\"; String s55 = \"\"; String s56 = \"\"; String s57 = \"\"; String s58 = \"\"; String s59 = \"\"; String s60 = \"\";\n" +
+ " String s61 = \"\"; String s62 = \"\"; String s63 = \"\"; String s64 = \"\"; String s65 = \"\"; String s66 = \"\"; String s67 = \"\"; String s68 = \"\"; String s69 = \"\"; String s70 = \"\";\n" +
+ " String s71 = \"\"; String s72 = \"\"; String s73 = \"\"; String s74 = \"\"; String s75 = \"\"; String s76 = \"\"; String s77 = \"\"; String s78 = \"\"; String s79 = \"\"; String s80 = \"\";\n" +
+ " String s81 = \"\"; String s82 = \"\"; String s83 = \"\"; String s84 = \"\"; String s85 = \"\"; String s86 = \"\"; String s87 = \"\"; String s88 = \"\"; String s89 = \"\"; String s90 = \"\";\n" +
+ " String s91 = \"\"; String s92 = \"\"; String s93 = \"\"; String s94 = \"\"; String s95 = \"\"; String s96 = \"\"; String s97 = \"\"; String s98 = \"\"; String s99 = \"\"; String s100 = \"\";\n" +
+ " String s101 = \"\"; String s102 = \"\"; String s103 = \"\"; String s104 = \"\"; String s105 = \"\"; String s106 = \"\"; String s107 = \"\"; String s108 = \"\"; String s109 = \"\"; String s110 = \"\";\n" +
+ " String s111 = \"\"; String s112 = \"\"; String s113 = \"\"; String s114 = \"\"; String s115 = \"\"; String s116 = \"\"; String s117 = \"\"; String s118 = \"\"; String s119 = \"\"; String s120 = \"\";\n" +
+ " String s121 = \"\"; String s122 = \"\"; String s123 = \"\"; String s124 = \"\"; String s125 = \"\"; String s126 = \"\"; String s127 = \"\"; String s128 = \"\"; String s129 = \"\"; String s130 = \"\";\n" +
+ " String s131 = \"\"; String s132 = \"\"; String s133 = \"\"; String s134 = \"\"; String s135 = \"\"; String s136 = \"\"; String s137 = \"\"; String s138 = \"\"; String s139 = \"\"; String s140 = \"\";\n" +
+ " String s141 = \"\"; String s142 = \"\"; String s143 = \"\"; String s144 = \"\"; String s145 = \"\"; String s146 = \"\"; String s147 = \"\"; String s148 = \"\"; String s149 = \"\"; String s150 = \"\";\n" +
+ " String s151 = \"\"; String s152 = \"\"; String s153 = \"\"; String s154 = \"\"; String s155 = \"\"; String s156 = \"\"; String s157 = \"\"; String s158 = \"\"; String s159 = \"\"; String s160 = \"\";\n" +
+ " String s161 = \"\"; String s162 = \"\"; String s163 = \"\"; String s164 = \"\"; String s165 = \"\"; String s166 = \"\"; String s167 = \"\"; String s168 = \"\"; String s169 = \"\"; String s170 = \"\";\n" +
+ " String s171 = \"\"; String s172 = \"\"; String s173 = \"\"; String s174 = \"\"; String s175 = \"\"; String s176 = \"\"; String s177 = \"\"; String s178 = \"\"; String s179 = \"\"; String s180 = \"\";\n" +
+ " String s181 = \"\"; String s182 = \"\"; String s183 = \"\"; String s184 = \"\"; String s185 = \"\"; String s186 = \"\"; String s187 = \"\"; String s188 = \"\"; String s189 = \"\"; String s190 = \"\";\n" +
+ " String s191 = \"\"; String s192 = \"\"; String s193 = \"\"; String s194 = \"\"; String s195 = \"\"; String s196 = \"\"; String s197 = \"\"; String s198 = \"\"; String s199 = \"\"; String s200 = \"\";\n" +
+ " String s201 = \"\"; String s202 = \"\"; String s203 = \"\"; String s204 = \"\"; String s205 = \"\"; String s206 = \"\"; String s207 = \"\"; String s208 = \"\"; String s209 = \"\"; String s210 = \"\";\n" +
+ " String s211 = \"\"; String s212 = \"\"; String s213 = \"\"; String s214 = \"\"; String s215 = \"\"; String s216 = \"\"; String s217 = \"\"; String s218 = \"\"; String s219 = \"\"; String s220 = \"\";\n" +
+ " String s221 = \"\"; String s222 = \"\"; String s223 = \"\"; String s224 = \"\"; String s225 = \"\"; String s226 = \"\"; String s227 = \"\"; String s228 = \"\"; String s229 = \"\"; String s230 = \"\";\n" +
+ " String s231 = \"\"; String s232 = \"\"; String s233 = \"\"; String s234 = \"\"; String s235 = \"\"; String s236 = \"\"; String s237 = \"\"; String s238 = \"\"; String s239 = \"\"; String s240 = \"\";\n" +
+ " String s241 = \"\"; String s242 = \"\"; String s243 = \"\"; String s244 = \"\"; String s245 = \"\"; String s246 = \"\"; String s247 = \"\"; String s248 = \"\"; String s249 = \"\"; String s250 = \"\";\n" +
+ " String s251 = \"\"; String s252 = \"\";\n" +
+ "\n" +
+ " int size1 = 1;\n" +
+ " int size2 = 2;\n" +
+ " int size3 = 3;\n" +
+ "\n" +
+ " int[][][] intArray = new int[size1][size2][size3];\n" +
+ " \n" +
+ " for (int i = 0; i < size1; i++) {\n" +
+ " for (int j = 0; j < size2; j++) {\n" +
+ " boolean on = false;\n" +
+ " for (int k = 0; k < size3; k++) {\n" +
+ " intArray[i][j][k] = on ? 0 : 1;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().show();\n" +
+ " }\n" +
"}",
},
"",
settings);
String expectedOutput =
- " public void show();\n" +
- " 0 ldc <String \"\"> [15]\n" +
- " 2 astore_1 [s1]\n" +
- " 3 ldc <String \"\"> [15]\n" +
- " 5 astore_2 [s2]\n" +
- " 6 ldc <String \"\"> [15]\n" +
- " 8 astore_3 [s3]\n" +
- " 9 ldc <String \"\"> [15]\n" +
- " 11 astore 4 [s4]\n" +
- " 13 ldc <String \"\"> [15]\n" +
- " 15 astore 5 [s5]\n" +
- " 17 ldc <String \"\"> [15]\n" +
- " 19 astore 6 [s6]\n" +
- " 21 ldc <String \"\"> [15]\n" +
- " 23 astore 7 [s7]\n" +
- " 25 ldc <String \"\"> [15]\n" +
- " 27 astore 8 [s8]\n" +
- " 29 ldc <String \"\"> [15]\n" +
- " 31 astore 9 [s9]\n" +
- " 33 ldc <String \"\"> [15]\n" +
- " 35 astore 10 [s10]\n" +
- " 37 ldc <String \"\"> [15]\n" +
- " 39 astore 11 [s11]\n" +
- " 41 ldc <String \"\"> [15]\n" +
- " 43 astore 12 [s12]\n" +
- " 45 ldc <String \"\"> [15]\n" +
- " 47 astore 13 [s13]\n" +
- " 49 ldc <String \"\"> [15]\n" +
- " 51 astore 14 [s14]\n" +
- " 53 ldc <String \"\"> [15]\n" +
- " 55 astore 15 [s15]\n" +
- " 57 ldc <String \"\"> [15]\n" +
- " 59 astore 16 [s16]\n" +
- " 61 ldc <String \"\"> [15]\n" +
- " 63 astore 17 [s17]\n" +
- " 65 ldc <String \"\"> [15]\n" +
- " 67 astore 18 [s18]\n" +
- " 69 ldc <String \"\"> [15]\n" +
- " 71 astore 19 [s19]\n" +
- " 73 ldc <String \"\"> [15]\n" +
- " 75 astore 20 [s20]\n" +
- " 77 ldc <String \"\"> [15]\n" +
- " 79 astore 21 [s21]\n" +
- " 81 ldc <String \"\"> [15]\n" +
- " 83 astore 22 [s22]\n" +
- " 85 ldc <String \"\"> [15]\n" +
- " 87 astore 23 [s23]\n" +
- " 89 ldc <String \"\"> [15]\n" +
- " 91 astore 24 [s24]\n" +
- " 93 ldc <String \"\"> [15]\n" +
- " 95 astore 25 [s25]\n" +
- " 97 ldc <String \"\"> [15]\n" +
- " 99 astore 26 [s26]\n" +
- " 101 ldc <String \"\"> [15]\n" +
- " 103 astore 27 [s27]\n" +
- " 105 ldc <String \"\"> [15]\n" +
- " 107 astore 28 [s28]\n" +
- " 109 ldc <String \"\"> [15]\n" +
- " 111 astore 29 [s29]\n" +
- " 113 ldc <String \"\"> [15]\n" +
- " 115 astore 30 [s30]\n" +
- " 117 ldc <String \"\"> [15]\n" +
- " 119 astore 31 [s31]\n" +
- " 121 ldc <String \"\"> [15]\n" +
- " 123 astore 32 [s32]\n" +
- " 125 ldc <String \"\"> [15]\n" +
- " 127 astore 33 [s33]\n" +
- " 129 ldc <String \"\"> [15]\n" +
- " 131 astore 34 [s34]\n" +
- " 133 ldc <String \"\"> [15]\n" +
- " 135 astore 35 [s35]\n" +
- " 137 ldc <String \"\"> [15]\n" +
- " 139 astore 36 [s36]\n" +
- " 141 ldc <String \"\"> [15]\n" +
- " 143 astore 37 [s37]\n" +
- " 145 ldc <String \"\"> [15]\n" +
- " 147 astore 38 [s38]\n" +
- " 149 ldc <String \"\"> [15]\n" +
- " 151 astore 39 [s39]\n" +
- " 153 ldc <String \"\"> [15]\n" +
- " 155 astore 40 [s40]\n" +
- " 157 ldc <String \"\"> [15]\n" +
- " 159 astore 41 [s41]\n" +
- " 161 ldc <String \"\"> [15]\n" +
- " 163 astore 42 [s42]\n" +
- " 165 ldc <String \"\"> [15]\n" +
- " 167 astore 43 [s43]\n" +
- " 169 ldc <String \"\"> [15]\n" +
- " 171 astore 44 [s44]\n" +
- " 173 ldc <String \"\"> [15]\n" +
- " 175 astore 45 [s45]\n" +
- " 177 ldc <String \"\"> [15]\n" +
- " 179 astore 46 [s46]\n" +
- " 181 ldc <String \"\"> [15]\n" +
- " 183 astore 47 [s47]\n" +
- " 185 ldc <String \"\"> [15]\n" +
- " 187 astore 48 [s48]\n" +
- " 189 ldc <String \"\"> [15]\n" +
- " 191 astore 49 [s49]\n" +
- " 193 ldc <String \"\"> [15]\n" +
- " 195 astore 50 [s50]\n" +
- " 197 ldc <String \"\"> [15]\n" +
- " 199 astore 51 [s51]\n" +
- " 201 ldc <String \"\"> [15]\n" +
- " 203 astore 52 [s52]\n" +
- " 205 ldc <String \"\"> [15]\n" +
- " 207 astore 53 [s53]\n" +
- " 209 ldc <String \"\"> [15]\n" +
- " 211 astore 54 [s54]\n" +
- " 213 ldc <String \"\"> [15]\n" +
- " 215 astore 55 [s55]\n" +
- " 217 ldc <String \"\"> [15]\n" +
- " 219 astore 56 [s56]\n" +
- " 221 ldc <String \"\"> [15]\n" +
- " 223 astore 57 [s57]\n" +
- " 225 ldc <String \"\"> [15]\n" +
- " 227 astore 58 [s58]\n" +
- " 229 ldc <String \"\"> [15]\n" +
- " 231 astore 59 [s59]\n" +
- " 233 ldc <String \"\"> [15]\n" +
- " 235 astore 60 [s60]\n" +
- " 237 ldc <String \"\"> [15]\n" +
- " 239 astore 61 [s61]\n" +
- " 241 ldc <String \"\"> [15]\n" +
- " 243 astore 62 [s62]\n" +
- " 245 ldc <String \"\"> [15]\n" +
- " 247 astore 63 [s63]\n" +
- " 249 ldc <String \"\"> [15]\n" +
- " 251 astore 64 [s64]\n" +
- " 253 ldc <String \"\"> [15]\n" +
- " 255 astore 65 [s65]\n" +
- " 257 ldc <String \"\"> [15]\n" +
- " 259 astore 66 [s66]\n" +
- " 261 ldc <String \"\"> [15]\n" +
- " 263 astore 67 [s67]\n" +
- " 265 ldc <String \"\"> [15]\n" +
- " 267 astore 68 [s68]\n" +
- " 269 ldc <String \"\"> [15]\n" +
- " 271 astore 69 [s69]\n" +
- " 273 ldc <String \"\"> [15]\n" +
- " 275 astore 70 [s70]\n" +
- " 277 ldc <String \"\"> [15]\n" +
- " 279 astore 71 [s71]\n" +
- " 281 ldc <String \"\"> [15]\n" +
- " 283 astore 72 [s72]\n" +
- " 285 ldc <String \"\"> [15]\n" +
- " 287 astore 73 [s73]\n" +
- " 289 ldc <String \"\"> [15]\n" +
- " 291 astore 74 [s74]\n" +
- " 293 ldc <String \"\"> [15]\n" +
- " 295 astore 75 [s75]\n" +
- " 297 ldc <String \"\"> [15]\n" +
- " 299 astore 76 [s76]\n" +
- " 301 ldc <String \"\"> [15]\n" +
- " 303 astore 77 [s77]\n" +
- " 305 ldc <String \"\"> [15]\n" +
- " 307 astore 78 [s78]\n" +
- " 309 ldc <String \"\"> [15]\n" +
- " 311 astore 79 [s79]\n" +
- " 313 ldc <String \"\"> [15]\n" +
- " 315 astore 80 [s80]\n" +
- " 317 ldc <String \"\"> [15]\n" +
- " 319 astore 81 [s81]\n" +
- " 321 ldc <String \"\"> [15]\n" +
- " 323 astore 82 [s82]\n" +
- " 325 ldc <String \"\"> [15]\n" +
- " 327 astore 83 [s83]\n" +
- " 329 ldc <String \"\"> [15]\n" +
- " 331 astore 84 [s84]\n" +
- " 333 ldc <String \"\"> [15]\n" +
- " 335 astore 85 [s85]\n" +
- " 337 ldc <String \"\"> [15]\n" +
- " 339 astore 86 [s86]\n" +
- " 341 ldc <String \"\"> [15]\n" +
- " 343 astore 87 [s87]\n" +
- " 345 ldc <String \"\"> [15]\n" +
- " 347 astore 88 [s88]\n" +
- " 349 ldc <String \"\"> [15]\n" +
- " 351 astore 89 [s89]\n" +
- " 353 ldc <String \"\"> [15]\n" +
- " 355 astore 90 [s90]\n" +
- " 357 ldc <String \"\"> [15]\n" +
- " 359 astore 91 [s91]\n" +
- " 361 ldc <String \"\"> [15]\n" +
- " 363 astore 92 [s92]\n" +
- " 365 ldc <String \"\"> [15]\n" +
- " 367 astore 93 [s93]\n" +
- " 369 ldc <String \"\"> [15]\n" +
- " 371 astore 94 [s94]\n" +
- " 373 ldc <String \"\"> [15]\n" +
- " 375 astore 95 [s95]\n" +
- " 377 ldc <String \"\"> [15]\n" +
- " 379 astore 96 [s96]\n" +
- " 381 ldc <String \"\"> [15]\n" +
- " 383 astore 97 [s97]\n" +
- " 385 ldc <String \"\"> [15]\n" +
- " 387 astore 98 [s98]\n" +
- " 389 ldc <String \"\"> [15]\n" +
- " 391 astore 99 [s99]\n" +
- " 393 ldc <String \"\"> [15]\n" +
- " 395 astore 100 [s100]\n" +
- " 397 ldc <String \"\"> [15]\n" +
- " 399 astore 101 [s101]\n" +
- " 401 ldc <String \"\"> [15]\n" +
- " 403 astore 102 [s102]\n" +
- " 405 ldc <String \"\"> [15]\n" +
- " 407 astore 103 [s103]\n" +
- " 409 ldc <String \"\"> [15]\n" +
- " 411 astore 104 [s104]\n" +
- " 413 ldc <String \"\"> [15]\n" +
- " 415 astore 105 [s105]\n" +
- " 417 ldc <String \"\"> [15]\n" +
- " 419 astore 106 [s106]\n" +
- " 421 ldc <String \"\"> [15]\n" +
- " 423 astore 107 [s107]\n" +
- " 425 ldc <String \"\"> [15]\n" +
- " 427 astore 108 [s108]\n" +
- " 429 ldc <String \"\"> [15]\n" +
- " 431 astore 109 [s109]\n" +
- " 433 ldc <String \"\"> [15]\n" +
- " 435 astore 110 [s110]\n" +
- " 437 ldc <String \"\"> [15]\n" +
- " 439 astore 111 [s111]\n" +
- " 441 ldc <String \"\"> [15]\n" +
- " 443 astore 112 [s112]\n" +
- " 445 ldc <String \"\"> [15]\n" +
- " 447 astore 113 [s113]\n" +
- " 449 ldc <String \"\"> [15]\n" +
- " 451 astore 114 [s114]\n" +
- " 453 ldc <String \"\"> [15]\n" +
- " 455 astore 115 [s115]\n" +
- " 457 ldc <String \"\"> [15]\n" +
- " 459 astore 116 [s116]\n" +
- " 461 ldc <String \"\"> [15]\n" +
- " 463 astore 117 [s117]\n" +
- " 465 ldc <String \"\"> [15]\n" +
- " 467 astore 118 [s118]\n" +
- " 469 ldc <String \"\"> [15]\n" +
- " 471 astore 119 [s119]\n" +
- " 473 ldc <String \"\"> [15]\n" +
- " 475 astore 120 [s120]\n" +
- " 477 ldc <String \"\"> [15]\n" +
- " 479 astore 121 [s121]\n" +
- " 481 ldc <String \"\"> [15]\n" +
- " 483 astore 122 [s122]\n" +
- " 485 ldc <String \"\"> [15]\n" +
- " 487 astore 123 [s123]\n" +
- " 489 ldc <String \"\"> [15]\n" +
- " 491 astore 124 [s124]\n" +
- " 493 ldc <String \"\"> [15]\n" +
- " 495 astore 125 [s125]\n" +
- " 497 ldc <String \"\"> [15]\n" +
- " 499 astore 126 [s126]\n" +
- " 501 ldc <String \"\"> [15]\n" +
- " 503 astore 127 [s127]\n" +
- " 505 ldc <String \"\"> [15]\n" +
- " 507 astore 128 [s128]\n" +
- " 509 ldc <String \"\"> [15]\n" +
- " 511 astore 129 [s129]\n" +
- " 513 ldc <String \"\"> [15]\n" +
- " 515 astore 130 [s130]\n" +
- " 517 ldc <String \"\"> [15]\n" +
- " 519 astore 131 [s131]\n" +
- " 521 ldc <String \"\"> [15]\n" +
- " 523 astore 132 [s132]\n" +
- " 525 ldc <String \"\"> [15]\n" +
- " 527 astore 133 [s133]\n" +
- " 529 ldc <String \"\"> [15]\n" +
- " 531 astore 134 [s134]\n" +
- " 533 ldc <String \"\"> [15]\n" +
- " 535 astore 135 [s135]\n" +
- " 537 ldc <String \"\"> [15]\n" +
- " 539 astore 136 [s136]\n" +
- " 541 ldc <String \"\"> [15]\n" +
- " 543 astore 137 [s137]\n" +
- " 545 ldc <String \"\"> [15]\n" +
- " 547 astore 138 [s138]\n" +
- " 549 ldc <String \"\"> [15]\n" +
- " 551 astore 139 [s139]\n" +
- " 553 ldc <String \"\"> [15]\n" +
- " 555 astore 140 [s140]\n" +
- " 557 ldc <String \"\"> [15]\n" +
- " 559 astore 141 [s141]\n" +
- " 561 ldc <String \"\"> [15]\n" +
- " 563 astore 142 [s142]\n" +
- " 565 ldc <String \"\"> [15]\n" +
- " 567 astore 143 [s143]\n" +
- " 569 ldc <String \"\"> [15]\n" +
- " 571 astore 144 [s144]\n" +
- " 573 ldc <String \"\"> [15]\n" +
- " 575 astore 145 [s145]\n" +
- " 577 ldc <String \"\"> [15]\n" +
- " 579 astore 146 [s146]\n" +
- " 581 ldc <String \"\"> [15]\n" +
- " 583 astore 147 [s147]\n" +
- " 585 ldc <String \"\"> [15]\n" +
- " 587 astore 148 [s148]\n" +
- " 589 ldc <String \"\"> [15]\n" +
- " 591 astore 149 [s149]\n" +
- " 593 ldc <String \"\"> [15]\n" +
- " 595 astore 150 [s150]\n" +
- " 597 ldc <String \"\"> [15]\n" +
- " 599 astore 151 [s151]\n" +
- " 601 ldc <String \"\"> [15]\n" +
- " 603 astore 152 [s152]\n" +
- " 605 ldc <String \"\"> [15]\n" +
- " 607 astore 153 [s153]\n" +
- " 609 ldc <String \"\"> [15]\n" +
- " 611 astore 154 [s154]\n" +
- " 613 ldc <String \"\"> [15]\n" +
- " 615 astore 155 [s155]\n" +
- " 617 ldc <String \"\"> [15]\n" +
- " 619 astore 156 [s156]\n" +
- " 621 ldc <String \"\"> [15]\n" +
- " 623 astore 157 [s157]\n" +
- " 625 ldc <String \"\"> [15]\n" +
- " 627 astore 158 [s158]\n" +
- " 629 ldc <String \"\"> [15]\n" +
- " 631 astore 159 [s159]\n" +
- " 633 ldc <String \"\"> [15]\n" +
- " 635 astore 160 [s160]\n" +
- " 637 ldc <String \"\"> [15]\n" +
- " 639 astore 161 [s161]\n" +
- " 641 ldc <String \"\"> [15]\n" +
- " 643 astore 162 [s162]\n" +
- " 645 ldc <String \"\"> [15]\n" +
- " 647 astore 163 [s163]\n" +
- " 649 ldc <String \"\"> [15]\n" +
- " 651 astore 164 [s164]\n" +
- " 653 ldc <String \"\"> [15]\n" +
- " 655 astore 165 [s165]\n" +
- " 657 ldc <String \"\"> [15]\n" +
- " 659 astore 166 [s166]\n" +
- " 661 ldc <String \"\"> [15]\n" +
- " 663 astore 167 [s167]\n" +
- " 665 ldc <String \"\"> [15]\n" +
- " 667 astore 168 [s168]\n" +
- " 669 ldc <String \"\"> [15]\n" +
- " 671 astore 169 [s169]\n" +
- " 673 ldc <String \"\"> [15]\n" +
- " 675 astore 170 [s170]\n" +
- " 677 ldc <String \"\"> [15]\n" +
- " 679 astore 171 [s171]\n" +
- " 681 ldc <String \"\"> [15]\n" +
- " 683 astore 172 [s172]\n" +
- " 685 ldc <String \"\"> [15]\n" +
- " 687 astore 173 [s173]\n" +
- " 689 ldc <String \"\"> [15]\n" +
- " 691 astore 174 [s174]\n" +
- " 693 ldc <String \"\"> [15]\n" +
- " 695 astore 175 [s175]\n" +
- " 697 ldc <String \"\"> [15]\n" +
- " 699 astore 176 [s176]\n" +
- " 701 ldc <String \"\"> [15]\n" +
- " 703 astore 177 [s177]\n" +
- " 705 ldc <String \"\"> [15]\n" +
- " 707 astore 178 [s178]\n" +
- " 709 ldc <String \"\"> [15]\n" +
- " 711 astore 179 [s179]\n" +
- " 713 ldc <String \"\"> [15]\n" +
- " 715 astore 180 [s180]\n" +
- " 717 ldc <String \"\"> [15]\n" +
- " 719 astore 181 [s181]\n" +
- " 721 ldc <String \"\"> [15]\n" +
- " 723 astore 182 [s182]\n" +
- " 725 ldc <String \"\"> [15]\n" +
- " 727 astore 183 [s183]\n" +
- " 729 ldc <String \"\"> [15]\n" +
- " 731 astore 184 [s184]\n" +
- " 733 ldc <String \"\"> [15]\n" +
- " 735 astore 185 [s185]\n" +
- " 737 ldc <String \"\"> [15]\n" +
- " 739 astore 186 [s186]\n" +
- " 741 ldc <String \"\"> [15]\n" +
- " 743 astore 187 [s187]\n" +
- " 745 ldc <String \"\"> [15]\n" +
- " 747 astore 188 [s188]\n" +
- " 749 ldc <String \"\"> [15]\n" +
- " 751 astore 189 [s189]\n" +
- " 753 ldc <String \"\"> [15]\n" +
- " 755 astore 190 [s190]\n" +
- " 757 ldc <String \"\"> [15]\n" +
- " 759 astore 191 [s191]\n" +
- " 761 ldc <String \"\"> [15]\n" +
- " 763 astore 192 [s192]\n" +
- " 765 ldc <String \"\"> [15]\n" +
- " 767 astore 193 [s193]\n" +
- " 769 ldc <String \"\"> [15]\n" +
- " 771 astore 194 [s194]\n" +
- " 773 ldc <String \"\"> [15]\n" +
- " 775 astore 195 [s195]\n" +
- " 777 ldc <String \"\"> [15]\n" +
- " 779 astore 196 [s196]\n" +
- " 781 ldc <String \"\"> [15]\n" +
- " 783 astore 197 [s197]\n" +
- " 785 ldc <String \"\"> [15]\n" +
- " 787 astore 198 [s198]\n" +
- " 789 ldc <String \"\"> [15]\n" +
- " 791 astore 199 [s199]\n" +
- " 793 ldc <String \"\"> [15]\n" +
- " 795 astore 200 [s200]\n" +
- " 797 ldc <String \"\"> [15]\n" +
- " 799 astore 201 [s201]\n" +
- " 801 ldc <String \"\"> [15]\n" +
- " 803 astore 202 [s202]\n" +
- " 805 ldc <String \"\"> [15]\n" +
- " 807 astore 203 [s203]\n" +
- " 809 ldc <String \"\"> [15]\n" +
- " 811 astore 204 [s204]\n" +
- " 813 ldc <String \"\"> [15]\n" +
- " 815 astore 205 [s205]\n" +
- " 817 ldc <String \"\"> [15]\n" +
- " 819 astore 206 [s206]\n" +
- " 821 ldc <String \"\"> [15]\n" +
- " 823 astore 207 [s207]\n" +
- " 825 ldc <String \"\"> [15]\n" +
- " 827 astore 208 [s208]\n" +
- " 829 ldc <String \"\"> [15]\n" +
- " 831 astore 209 [s209]\n" +
- " 833 ldc <String \"\"> [15]\n" +
- " 835 astore 210 [s210]\n" +
- " 837 ldc <String \"\"> [15]\n" +
- " 839 astore 211 [s211]\n" +
- " 841 ldc <String \"\"> [15]\n" +
- " 843 astore 212 [s212]\n" +
- " 845 ldc <String \"\"> [15]\n" +
- " 847 astore 213 [s213]\n" +
- " 849 ldc <String \"\"> [15]\n" +
- " 851 astore 214 [s214]\n" +
- " 853 ldc <String \"\"> [15]\n" +
- " 855 astore 215 [s215]\n" +
- " 857 ldc <String \"\"> [15]\n" +
- " 859 astore 216 [s216]\n" +
- " 861 ldc <String \"\"> [15]\n" +
- " 863 astore 217 [s217]\n" +
- " 865 ldc <String \"\"> [15]\n" +
- " 867 astore 218 [s218]\n" +
- " 869 ldc <String \"\"> [15]\n" +
- " 871 astore 219 [s219]\n" +
- " 873 ldc <String \"\"> [15]\n" +
- " 875 astore 220 [s220]\n" +
- " 877 ldc <String \"\"> [15]\n" +
- " 879 astore 221 [s221]\n" +
- " 881 ldc <String \"\"> [15]\n" +
- " 883 astore 222 [s222]\n" +
- " 885 ldc <String \"\"> [15]\n" +
- " 887 astore 223 [s223]\n" +
- " 889 ldc <String \"\"> [15]\n" +
- " 891 astore 224 [s224]\n" +
- " 893 ldc <String \"\"> [15]\n" +
- " 895 astore 225 [s225]\n" +
- " 897 ldc <String \"\"> [15]\n" +
- " 899 astore 226 [s226]\n" +
- " 901 ldc <String \"\"> [15]\n" +
- " 903 astore 227 [s227]\n" +
- " 905 ldc <String \"\"> [15]\n" +
- " 907 astore 228 [s228]\n" +
- " 909 ldc <String \"\"> [15]\n" +
- " 911 astore 229 [s229]\n" +
- " 913 ldc <String \"\"> [15]\n" +
- " 915 astore 230 [s230]\n" +
- " 917 ldc <String \"\"> [15]\n" +
- " 919 astore 231 [s231]\n" +
- " 921 ldc <String \"\"> [15]\n" +
- " 923 astore 232 [s232]\n" +
- " 925 ldc <String \"\"> [15]\n" +
- " 927 astore 233 [s233]\n" +
- " 929 ldc <String \"\"> [15]\n" +
- " 931 astore 234 [s234]\n" +
- " 933 ldc <String \"\"> [15]\n" +
- " 935 astore 235 [s235]\n" +
- " 937 ldc <String \"\"> [15]\n" +
- " 939 astore 236 [s236]\n" +
- " 941 ldc <String \"\"> [15]\n" +
- " 943 astore 237 [s237]\n" +
- " 945 ldc <String \"\"> [15]\n" +
- " 947 astore 238 [s238]\n" +
- " 949 ldc <String \"\"> [15]\n" +
- " 951 astore 239 [s239]\n" +
- " 953 ldc <String \"\"> [15]\n" +
- " 955 astore 240 [s240]\n" +
- " 957 ldc <String \"\"> [15]\n" +
- " 959 astore 241 [s241]\n" +
- " 961 ldc <String \"\"> [15]\n" +
- " 963 astore 242 [s242]\n" +
- " 965 ldc <String \"\"> [15]\n" +
- " 967 astore 243 [s243]\n" +
- " 969 ldc <String \"\"> [15]\n" +
- " 971 astore 244 [s244]\n" +
- " 973 ldc <String \"\"> [15]\n" +
- " 975 astore 245 [s245]\n" +
- " 977 ldc <String \"\"> [15]\n" +
- " 979 astore 246 [s246]\n" +
- " 981 ldc <String \"\"> [15]\n" +
- " 983 astore 247 [s247]\n" +
- " 985 ldc <String \"\"> [15]\n" +
- " 987 astore 248 [s248]\n" +
- " 989 ldc <String \"\"> [15]\n" +
- " 991 astore 249 [s249]\n" +
- " 993 ldc <String \"\"> [15]\n" +
- " 995 astore 250 [s250]\n" +
- " 997 ldc <String \"\"> [15]\n" +
- " 999 astore 251 [s251]\n" +
- " 1001 ldc <String \"\"> [15]\n" +
- " 1003 astore 252 [s252]\n" +
- " 1005 iconst_1\n" +
- " 1006 istore 253 [size1]\n" +
- " 1008 iconst_2\n" +
- " 1009 istore 254 [size2]\n" +
- " 1011 iconst_3\n" +
- " 1012 istore 255 [size3]\n" +
- " 1014 iload 253 [size1]\n" +
- " 1016 iload 254 [size2]\n" +
- " 1018 iload 255 [size3]\n" +
- " 1020 multianewarray int[][][] [17]\n" +
- " 1024 wide\n" +
- " 1025 astore 256 [intArray]\n" +
- " 1028 iconst_0\n" +
- " 1029 wide\n" +
- " 1030 istore 257 [i]\n" +
- " 1033 goto 1124\n" +
- " 1036 iconst_0\n" +
- " 1037 wide\n" +
- " 1038 istore 258 [j]\n" +
- " 1041 goto 1109\n" +
- " 1044 iconst_0\n" +
- " 1045 wide\n" +
- " 1046 istore 259 [on]\n" +
- " 1049 iconst_0\n" +
- " 1050 wide\n" +
- " 1051 istore 260 [k]\n" +
- " 1054 goto 1094\n" +
- " 1057 wide\n" +
- " 1058 aload 256 [intArray]\n" +
- " 1061 wide\n" +
- " 1062 iload 257 [i]\n" +
- " 1065 aaload\n" +
- " 1066 wide\n" +
- " 1067 iload 258 [j]\n" +
- " 1070 aaload\n" +
- " 1071 wide\n" +
- " 1072 iload 260 [k]\n" +
- " 1075 wide\n" +
- " 1076 iload 259 [on]\n" +
- " 1079 ifeq 1086\n" +
- " 1082 iconst_0\n" +
- " 1083 goto 1087\n" +
- " 1086 iconst_1\n" +
- " 1087 iastore\n" +
- " 1088 wide\n" +
- " 1089 iinc 260 1 [k]\n" +
- " 1094 wide\n" +
- " 1095 iload 260 [k]\n" +
- " 1098 iload 255 [size3]\n" +
- " 1100 if_icmplt 1057\n" +
- " 1103 wide\n" +
- " 1104 iinc 258 1 [j]\n" +
- " 1109 wide\n" +
- " 1110 iload 258 [j]\n" +
- " 1113 iload 254 [size2]\n" +
- " 1115 if_icmplt 1044\n" +
- " 1118 wide\n" +
- " 1119 iinc 257 1 [i]\n" +
- " 1124 wide\n" +
- " 1125 iload 257 [i]\n" +
- " 1128 iload 253 [size1]\n" +
- " 1130 if_icmplt 1036\n" +
- " 1133 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 4]\n" +
- " [pc: 37, line: 5]\n" +
- " [pc: 77, line: 6]\n" +
- " [pc: 117, line: 7]\n" +
- " [pc: 157, line: 8]\n" +
- " [pc: 197, line: 9]\n" +
- " [pc: 237, line: 10]\n" +
- " [pc: 277, line: 11]\n" +
- " [pc: 317, line: 12]\n" +
- " [pc: 357, line: 13]\n" +
- " [pc: 397, line: 14]\n" +
- " [pc: 437, line: 15]\n" +
- " [pc: 477, line: 16]\n" +
- " [pc: 517, line: 17]\n" +
- " [pc: 557, line: 18]\n" +
- " [pc: 597, line: 19]\n" +
- " [pc: 637, line: 20]\n" +
- " [pc: 677, line: 21]\n" +
- " [pc: 717, line: 22]\n" +
- " [pc: 757, line: 23]\n" +
- " [pc: 797, line: 24]\n" +
- " [pc: 837, line: 25]\n" +
- " [pc: 877, line: 26]\n" +
- " [pc: 917, line: 27]\n" +
- " [pc: 957, line: 28]\n" +
- " [pc: 997, line: 29]\n" +
- " [pc: 1005, line: 31]\n" +
- " [pc: 1008, line: 32]\n" +
- " [pc: 1011, line: 33]\n" +
- " [pc: 1014, line: 35]\n" +
- " [pc: 1028, line: 37]\n" +
- " [pc: 1036, line: 38]\n" +
- " [pc: 1044, line: 39]\n" +
- " [pc: 1049, line: 40]\n" +
- " [pc: 1057, line: 41]\n" +
- " [pc: 1088, line: 40]\n" +
- " [pc: 1103, line: 38]\n" +
- " [pc: 1118, line: 37]\n" +
- " [pc: 1133, line: 46]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 1134] local: this index: 0 type: X\n" +
- " [pc: 3, pc: 1134] local: s1 index: 1 type: java.lang.String\n" +
- " [pc: 6, pc: 1134] local: s2 index: 2 type: java.lang.String\n" +
- " [pc: 9, pc: 1134] local: s3 index: 3 type: java.lang.String\n" +
- " [pc: 13, pc: 1134] local: s4 index: 4 type: java.lang.String\n" +
- " [pc: 17, pc: 1134] local: s5 index: 5 type: java.lang.String\n" +
- " [pc: 21, pc: 1134] local: s6 index: 6 type: java.lang.String\n" +
- " [pc: 25, pc: 1134] local: s7 index: 7 type: java.lang.String\n" +
- " [pc: 29, pc: 1134] local: s8 index: 8 type: java.lang.String\n" +
- " [pc: 33, pc: 1134] local: s9 index: 9 type: java.lang.String\n" +
- " [pc: 37, pc: 1134] local: s10 index: 10 type: java.lang.String\n" +
- " [pc: 41, pc: 1134] local: s11 index: 11 type: java.lang.String\n" +
- " [pc: 45, pc: 1134] local: s12 index: 12 type: java.lang.String\n" +
- " [pc: 49, pc: 1134] local: s13 index: 13 type: java.lang.String\n" +
- " [pc: 53, pc: 1134] local: s14 index: 14 type: java.lang.String\n" +
- " [pc: 57, pc: 1134] local: s15 index: 15 type: java.lang.String\n" +
- " [pc: 61, pc: 1134] local: s16 index: 16 type: java.lang.String\n" +
- " [pc: 65, pc: 1134] local: s17 index: 17 type: java.lang.String\n" +
- " [pc: 69, pc: 1134] local: s18 index: 18 type: java.lang.String\n" +
- " [pc: 73, pc: 1134] local: s19 index: 19 type: java.lang.String\n" +
- " [pc: 77, pc: 1134] local: s20 index: 20 type: java.lang.String\n" +
- " [pc: 81, pc: 1134] local: s21 index: 21 type: java.lang.String\n" +
- " [pc: 85, pc: 1134] local: s22 index: 22 type: java.lang.String\n" +
- " [pc: 89, pc: 1134] local: s23 index: 23 type: java.lang.String\n" +
- " [pc: 93, pc: 1134] local: s24 index: 24 type: java.lang.String\n" +
- " [pc: 97, pc: 1134] local: s25 index: 25 type: java.lang.String\n" +
- " [pc: 101, pc: 1134] local: s26 index: 26 type: java.lang.String\n" +
- " [pc: 105, pc: 1134] local: s27 index: 27 type: java.lang.String\n" +
- " [pc: 109, pc: 1134] local: s28 index: 28 type: java.lang.String\n" +
- " [pc: 113, pc: 1134] local: s29 index: 29 type: java.lang.String\n" +
- " [pc: 117, pc: 1134] local: s30 index: 30 type: java.lang.String\n" +
- " [pc: 121, pc: 1134] local: s31 index: 31 type: java.lang.String\n" +
- " [pc: 125, pc: 1134] local: s32 index: 32 type: java.lang.String\n" +
- " [pc: 129, pc: 1134] local: s33 index: 33 type: java.lang.String\n" +
- " [pc: 133, pc: 1134] local: s34 index: 34 type: java.lang.String\n" +
- " [pc: 137, pc: 1134] local: s35 index: 35 type: java.lang.String\n" +
- " [pc: 141, pc: 1134] local: s36 index: 36 type: java.lang.String\n" +
- " [pc: 145, pc: 1134] local: s37 index: 37 type: java.lang.String\n" +
- " [pc: 149, pc: 1134] local: s38 index: 38 type: java.lang.String\n" +
- " [pc: 153, pc: 1134] local: s39 index: 39 type: java.lang.String\n" +
- " [pc: 157, pc: 1134] local: s40 index: 40 type: java.lang.String\n" +
- " [pc: 161, pc: 1134] local: s41 index: 41 type: java.lang.String\n" +
- " [pc: 165, pc: 1134] local: s42 index: 42 type: java.lang.String\n" +
- " [pc: 169, pc: 1134] local: s43 index: 43 type: java.lang.String\n" +
- " [pc: 173, pc: 1134] local: s44 index: 44 type: java.lang.String\n" +
- " [pc: 177, pc: 1134] local: s45 index: 45 type: java.lang.String\n" +
- " [pc: 181, pc: 1134] local: s46 index: 46 type: java.lang.String\n" +
- " [pc: 185, pc: 1134] local: s47 index: 47 type: java.lang.String\n" +
- " [pc: 189, pc: 1134] local: s48 index: 48 type: java.lang.String\n" +
- " [pc: 193, pc: 1134] local: s49 index: 49 type: java.lang.String\n" +
- " [pc: 197, pc: 1134] local: s50 index: 50 type: java.lang.String\n" +
- " [pc: 201, pc: 1134] local: s51 index: 51 type: java.lang.String\n" +
- " [pc: 205, pc: 1134] local: s52 index: 52 type: java.lang.String\n" +
- " [pc: 209, pc: 1134] local: s53 index: 53 type: java.lang.String\n" +
- " [pc: 213, pc: 1134] local: s54 index: 54 type: java.lang.String\n" +
- " [pc: 217, pc: 1134] local: s55 index: 55 type: java.lang.String\n" +
- " [pc: 221, pc: 1134] local: s56 index: 56 type: java.lang.String\n" +
- " [pc: 225, pc: 1134] local: s57 index: 57 type: java.lang.String\n" +
- " [pc: 229, pc: 1134] local: s58 index: 58 type: java.lang.String\n" +
- " [pc: 233, pc: 1134] local: s59 index: 59 type: java.lang.String\n" +
- " [pc: 237, pc: 1134] local: s60 index: 60 type: java.lang.String\n" +
- " [pc: 241, pc: 1134] local: s61 index: 61 type: java.lang.String\n" +
- " [pc: 245, pc: 1134] local: s62 index: 62 type: java.lang.String\n" +
- " [pc: 249, pc: 1134] local: s63 index: 63 type: java.lang.String\n" +
- " [pc: 253, pc: 1134] local: s64 index: 64 type: java.lang.String\n" +
- " [pc: 257, pc: 1134] local: s65 index: 65 type: java.lang.String\n" +
- " [pc: 261, pc: 1134] local: s66 index: 66 type: java.lang.String\n" +
- " [pc: 265, pc: 1134] local: s67 index: 67 type: java.lang.String\n" +
- " [pc: 269, pc: 1134] local: s68 index: 68 type: java.lang.String\n" +
- " [pc: 273, pc: 1134] local: s69 index: 69 type: java.lang.String\n" +
- " [pc: 277, pc: 1134] local: s70 index: 70 type: java.lang.String\n" +
- " [pc: 281, pc: 1134] local: s71 index: 71 type: java.lang.String\n" +
- " [pc: 285, pc: 1134] local: s72 index: 72 type: java.lang.String\n" +
- " [pc: 289, pc: 1134] local: s73 index: 73 type: java.lang.String\n" +
- " [pc: 293, pc: 1134] local: s74 index: 74 type: java.lang.String\n" +
- " [pc: 297, pc: 1134] local: s75 index: 75 type: java.lang.String\n" +
- " [pc: 301, pc: 1134] local: s76 index: 76 type: java.lang.String\n" +
- " [pc: 305, pc: 1134] local: s77 index: 77 type: java.lang.String\n" +
- " [pc: 309, pc: 1134] local: s78 index: 78 type: java.lang.String\n" +
- " [pc: 313, pc: 1134] local: s79 index: 79 type: java.lang.String\n" +
- " [pc: 317, pc: 1134] local: s80 index: 80 type: java.lang.String\n" +
- " [pc: 321, pc: 1134] local: s81 index: 81 type: java.lang.String\n" +
- " [pc: 325, pc: 1134] local: s82 index: 82 type: java.lang.String\n" +
- " [pc: 329, pc: 1134] local: s83 index: 83 type: java.lang.String\n" +
- " [pc: 333, pc: 1134] local: s84 index: 84 type: java.lang.String\n" +
- " [pc: 337, pc: 1134] local: s85 index: 85 type: java.lang.String\n" +
- " [pc: 341, pc: 1134] local: s86 index: 86 type: java.lang.String\n" +
- " [pc: 345, pc: 1134] local: s87 index: 87 type: java.lang.String\n" +
- " [pc: 349, pc: 1134] local: s88 index: 88 type: java.lang.String\n" +
- " [pc: 353, pc: 1134] local: s89 index: 89 type: java.lang.String\n" +
- " [pc: 357, pc: 1134] local: s90 index: 90 type: java.lang.String\n" +
- " [pc: 361, pc: 1134] local: s91 index: 91 type: java.lang.String\n" +
- " [pc: 365, pc: 1134] local: s92 index: 92 type: java.lang.String\n" +
- " [pc: 369, pc: 1134] local: s93 index: 93 type: java.lang.String\n" +
- " [pc: 373, pc: 1134] local: s94 index: 94 type: java.lang.String\n" +
- " [pc: 377, pc: 1134] local: s95 index: 95 type: java.lang.String\n" +
- " [pc: 381, pc: 1134] local: s96 index: 96 type: java.lang.String\n" +
- " [pc: 385, pc: 1134] local: s97 index: 97 type: java.lang.String\n" +
- " [pc: 389, pc: 1134] local: s98 index: 98 type: java.lang.String\n" +
- " [pc: 393, pc: 1134] local: s99 index: 99 type: java.lang.String\n" +
- " [pc: 397, pc: 1134] local: s100 index: 100 type: java.lang.String\n" +
- " [pc: 401, pc: 1134] local: s101 index: 101 type: java.lang.String\n" +
- " [pc: 405, pc: 1134] local: s102 index: 102 type: java.lang.String\n" +
- " [pc: 409, pc: 1134] local: s103 index: 103 type: java.lang.String\n" +
- " [pc: 413, pc: 1134] local: s104 index: 104 type: java.lang.String\n" +
- " [pc: 417, pc: 1134] local: s105 index: 105 type: java.lang.String\n" +
- " [pc: 421, pc: 1134] local: s106 index: 106 type: java.lang.String\n" +
- " [pc: 425, pc: 1134] local: s107 index: 107 type: java.lang.String\n" +
- " [pc: 429, pc: 1134] local: s108 index: 108 type: java.lang.String\n" +
- " [pc: 433, pc: 1134] local: s109 index: 109 type: java.lang.String\n" +
- " [pc: 437, pc: 1134] local: s110 index: 110 type: java.lang.String\n" +
- " [pc: 441, pc: 1134] local: s111 index: 111 type: java.lang.String\n" +
- " [pc: 445, pc: 1134] local: s112 index: 112 type: java.lang.String\n" +
- " [pc: 449, pc: 1134] local: s113 index: 113 type: java.lang.String\n" +
- " [pc: 453, pc: 1134] local: s114 index: 114 type: java.lang.String\n" +
- " [pc: 457, pc: 1134] local: s115 index: 115 type: java.lang.String\n" +
- " [pc: 461, pc: 1134] local: s116 index: 116 type: java.lang.String\n" +
- " [pc: 465, pc: 1134] local: s117 index: 117 type: java.lang.String\n" +
- " [pc: 469, pc: 1134] local: s118 index: 118 type: java.lang.String\n" +
- " [pc: 473, pc: 1134] local: s119 index: 119 type: java.lang.String\n" +
- " [pc: 477, pc: 1134] local: s120 index: 120 type: java.lang.String\n" +
- " [pc: 481, pc: 1134] local: s121 index: 121 type: java.lang.String\n" +
- " [pc: 485, pc: 1134] local: s122 index: 122 type: java.lang.String\n" +
- " [pc: 489, pc: 1134] local: s123 index: 123 type: java.lang.String\n" +
- " [pc: 493, pc: 1134] local: s124 index: 124 type: java.lang.String\n" +
- " [pc: 497, pc: 1134] local: s125 index: 125 type: java.lang.String\n" +
- " [pc: 501, pc: 1134] local: s126 index: 126 type: java.lang.String\n" +
- " [pc: 505, pc: 1134] local: s127 index: 127 type: java.lang.String\n" +
- " [pc: 509, pc: 1134] local: s128 index: 128 type: java.lang.String\n" +
- " [pc: 513, pc: 1134] local: s129 index: 129 type: java.lang.String\n" +
- " [pc: 517, pc: 1134] local: s130 index: 130 type: java.lang.String\n" +
- " [pc: 521, pc: 1134] local: s131 index: 131 type: java.lang.String\n" +
- " [pc: 525, pc: 1134] local: s132 index: 132 type: java.lang.String\n" +
- " [pc: 529, pc: 1134] local: s133 index: 133 type: java.lang.String\n" +
- " [pc: 533, pc: 1134] local: s134 index: 134 type: java.lang.String\n" +
- " [pc: 537, pc: 1134] local: s135 index: 135 type: java.lang.String\n" +
- " [pc: 541, pc: 1134] local: s136 index: 136 type: java.lang.String\n" +
- " [pc: 545, pc: 1134] local: s137 index: 137 type: java.lang.String\n" +
- " [pc: 549, pc: 1134] local: s138 index: 138 type: java.lang.String\n" +
- " [pc: 553, pc: 1134] local: s139 index: 139 type: java.lang.String\n" +
- " [pc: 557, pc: 1134] local: s140 index: 140 type: java.lang.String\n" +
- " [pc: 561, pc: 1134] local: s141 index: 141 type: java.lang.String\n" +
- " [pc: 565, pc: 1134] local: s142 index: 142 type: java.lang.String\n" +
- " [pc: 569, pc: 1134] local: s143 index: 143 type: java.lang.String\n" +
- " [pc: 573, pc: 1134] local: s144 index: 144 type: java.lang.String\n" +
- " [pc: 577, pc: 1134] local: s145 index: 145 type: java.lang.String\n" +
- " [pc: 581, pc: 1134] local: s146 index: 146 type: java.lang.String\n" +
- " [pc: 585, pc: 1134] local: s147 index: 147 type: java.lang.String\n" +
- " [pc: 589, pc: 1134] local: s148 index: 148 type: java.lang.String\n" +
- " [pc: 593, pc: 1134] local: s149 index: 149 type: java.lang.String\n" +
- " [pc: 597, pc: 1134] local: s150 index: 150 type: java.lang.String\n" +
- " [pc: 601, pc: 1134] local: s151 index: 151 type: java.lang.String\n" +
- " [pc: 605, pc: 1134] local: s152 index: 152 type: java.lang.String\n" +
- " [pc: 609, pc: 1134] local: s153 index: 153 type: java.lang.String\n" +
- " [pc: 613, pc: 1134] local: s154 index: 154 type: java.lang.String\n" +
- " [pc: 617, pc: 1134] local: s155 index: 155 type: java.lang.String\n" +
- " [pc: 621, pc: 1134] local: s156 index: 156 type: java.lang.String\n" +
- " [pc: 625, pc: 1134] local: s157 index: 157 type: java.lang.String\n" +
- " [pc: 629, pc: 1134] local: s158 index: 158 type: java.lang.String\n" +
- " [pc: 633, pc: 1134] local: s159 index: 159 type: java.lang.String\n" +
- " [pc: 637, pc: 1134] local: s160 index: 160 type: java.lang.String\n" +
- " [pc: 641, pc: 1134] local: s161 index: 161 type: java.lang.String\n" +
- " [pc: 645, pc: 1134] local: s162 index: 162 type: java.lang.String\n" +
- " [pc: 649, pc: 1134] local: s163 index: 163 type: java.lang.String\n" +
- " [pc: 653, pc: 1134] local: s164 index: 164 type: java.lang.String\n" +
- " [pc: 657, pc: 1134] local: s165 index: 165 type: java.lang.String\n" +
- " [pc: 661, pc: 1134] local: s166 index: 166 type: java.lang.String\n" +
- " [pc: 665, pc: 1134] local: s167 index: 167 type: java.lang.String\n" +
- " [pc: 669, pc: 1134] local: s168 index: 168 type: java.lang.String\n" +
- " [pc: 673, pc: 1134] local: s169 index: 169 type: java.lang.String\n" +
- " [pc: 677, pc: 1134] local: s170 index: 170 type: java.lang.String\n" +
- " [pc: 681, pc: 1134] local: s171 index: 171 type: java.lang.String\n" +
- " [pc: 685, pc: 1134] local: s172 index: 172 type: java.lang.String\n" +
- " [pc: 689, pc: 1134] local: s173 index: 173 type: java.lang.String\n" +
- " [pc: 693, pc: 1134] local: s174 index: 174 type: java.lang.String\n" +
- " [pc: 697, pc: 1134] local: s175 index: 175 type: java.lang.String\n" +
- " [pc: 701, pc: 1134] local: s176 index: 176 type: java.lang.String\n" +
- " [pc: 705, pc: 1134] local: s177 index: 177 type: java.lang.String\n" +
- " [pc: 709, pc: 1134] local: s178 index: 178 type: java.lang.String\n" +
- " [pc: 713, pc: 1134] local: s179 index: 179 type: java.lang.String\n" +
- " [pc: 717, pc: 1134] local: s180 index: 180 type: java.lang.String\n" +
- " [pc: 721, pc: 1134] local: s181 index: 181 type: java.lang.String\n" +
- " [pc: 725, pc: 1134] local: s182 index: 182 type: java.lang.String\n" +
- " [pc: 729, pc: 1134] local: s183 index: 183 type: java.lang.String\n" +
- " [pc: 733, pc: 1134] local: s184 index: 184 type: java.lang.String\n" +
- " [pc: 737, pc: 1134] local: s185 index: 185 type: java.lang.String\n" +
- " [pc: 741, pc: 1134] local: s186 index: 186 type: java.lang.String\n" +
- " [pc: 745, pc: 1134] local: s187 index: 187 type: java.lang.String\n" +
- " [pc: 749, pc: 1134] local: s188 index: 188 type: java.lang.String\n" +
- " [pc: 753, pc: 1134] local: s189 index: 189 type: java.lang.String\n" +
- " [pc: 757, pc: 1134] local: s190 index: 190 type: java.lang.String\n" +
- " [pc: 761, pc: 1134] local: s191 index: 191 type: java.lang.String\n" +
- " [pc: 765, pc: 1134] local: s192 index: 192 type: java.lang.String\n" +
- " [pc: 769, pc: 1134] local: s193 index: 193 type: java.lang.String\n" +
- " [pc: 773, pc: 1134] local: s194 index: 194 type: java.lang.String\n" +
- " [pc: 777, pc: 1134] local: s195 index: 195 type: java.lang.String\n" +
- " [pc: 781, pc: 1134] local: s196 index: 196 type: java.lang.String\n" +
- " [pc: 785, pc: 1134] local: s197 index: 197 type: java.lang.String\n" +
- " [pc: 789, pc: 1134] local: s198 index: 198 type: java.lang.String\n" +
- " [pc: 793, pc: 1134] local: s199 index: 199 type: java.lang.String\n" +
- " [pc: 797, pc: 1134] local: s200 index: 200 type: java.lang.String\n" +
- " [pc: 801, pc: 1134] local: s201 index: 201 type: java.lang.String\n" +
- " [pc: 805, pc: 1134] local: s202 index: 202 type: java.lang.String\n" +
- " [pc: 809, pc: 1134] local: s203 index: 203 type: java.lang.String\n" +
- " [pc: 813, pc: 1134] local: s204 index: 204 type: java.lang.String\n" +
- " [pc: 817, pc: 1134] local: s205 index: 205 type: java.lang.String\n" +
- " [pc: 821, pc: 1134] local: s206 index: 206 type: java.lang.String\n" +
- " [pc: 825, pc: 1134] local: s207 index: 207 type: java.lang.String\n" +
- " [pc: 829, pc: 1134] local: s208 index: 208 type: java.lang.String\n" +
- " [pc: 833, pc: 1134] local: s209 index: 209 type: java.lang.String\n" +
- " [pc: 837, pc: 1134] local: s210 index: 210 type: java.lang.String\n" +
- " [pc: 841, pc: 1134] local: s211 index: 211 type: java.lang.String\n" +
- " [pc: 845, pc: 1134] local: s212 index: 212 type: java.lang.String\n" +
- " [pc: 849, pc: 1134] local: s213 index: 213 type: java.lang.String\n" +
- " [pc: 853, pc: 1134] local: s214 index: 214 type: java.lang.String\n" +
- " [pc: 857, pc: 1134] local: s215 index: 215 type: java.lang.String\n" +
- " [pc: 861, pc: 1134] local: s216 index: 216 type: java.lang.String\n" +
- " [pc: 865, pc: 1134] local: s217 index: 217 type: java.lang.String\n" +
- " [pc: 869, pc: 1134] local: s218 index: 218 type: java.lang.String\n" +
- " [pc: 873, pc: 1134] local: s219 index: 219 type: java.lang.String\n" +
- " [pc: 877, pc: 1134] local: s220 index: 220 type: java.lang.String\n" +
- " [pc: 881, pc: 1134] local: s221 index: 221 type: java.lang.String\n" +
- " [pc: 885, pc: 1134] local: s222 index: 222 type: java.lang.String\n" +
- " [pc: 889, pc: 1134] local: s223 index: 223 type: java.lang.String\n" +
- " [pc: 893, pc: 1134] local: s224 index: 224 type: java.lang.String\n" +
- " [pc: 897, pc: 1134] local: s225 index: 225 type: java.lang.String\n" +
- " [pc: 901, pc: 1134] local: s226 index: 226 type: java.lang.String\n" +
- " [pc: 905, pc: 1134] local: s227 index: 227 type: java.lang.String\n" +
- " [pc: 909, pc: 1134] local: s228 index: 228 type: java.lang.String\n" +
- " [pc: 913, pc: 1134] local: s229 index: 229 type: java.lang.String\n" +
- " [pc: 917, pc: 1134] local: s230 index: 230 type: java.lang.String\n" +
- " [pc: 921, pc: 1134] local: s231 index: 231 type: java.lang.String\n" +
- " [pc: 925, pc: 1134] local: s232 index: 232 type: java.lang.String\n" +
- " [pc: 929, pc: 1134] local: s233 index: 233 type: java.lang.String\n" +
- " [pc: 933, pc: 1134] local: s234 index: 234 type: java.lang.String\n" +
- " [pc: 937, pc: 1134] local: s235 index: 235 type: java.lang.String\n" +
- " [pc: 941, pc: 1134] local: s236 index: 236 type: java.lang.String\n" +
- " [pc: 945, pc: 1134] local: s237 index: 237 type: java.lang.String\n" +
- " [pc: 949, pc: 1134] local: s238 index: 238 type: java.lang.String\n" +
- " [pc: 953, pc: 1134] local: s239 index: 239 type: java.lang.String\n" +
- " [pc: 957, pc: 1134] local: s240 index: 240 type: java.lang.String\n" +
- " [pc: 961, pc: 1134] local: s241 index: 241 type: java.lang.String\n" +
- " [pc: 965, pc: 1134] local: s242 index: 242 type: java.lang.String\n" +
- " [pc: 969, pc: 1134] local: s243 index: 243 type: java.lang.String\n" +
- " [pc: 973, pc: 1134] local: s244 index: 244 type: java.lang.String\n" +
- " [pc: 977, pc: 1134] local: s245 index: 245 type: java.lang.String\n" +
- " [pc: 981, pc: 1134] local: s246 index: 246 type: java.lang.String\n" +
- " [pc: 985, pc: 1134] local: s247 index: 247 type: java.lang.String\n" +
- " [pc: 989, pc: 1134] local: s248 index: 248 type: java.lang.String\n" +
- " [pc: 993, pc: 1134] local: s249 index: 249 type: java.lang.String\n" +
- " [pc: 997, pc: 1134] local: s250 index: 250 type: java.lang.String\n" +
- " [pc: 1001, pc: 1134] local: s251 index: 251 type: java.lang.String\n" +
- " [pc: 1005, pc: 1134] local: s252 index: 252 type: java.lang.String\n" +
- " [pc: 1008, pc: 1134] local: size1 index: 253 type: int\n" +
- " [pc: 1011, pc: 1134] local: size2 index: 254 type: int\n" +
- " [pc: 1014, pc: 1134] local: size3 index: 255 type: int\n" +
- " [pc: 1028, pc: 1134] local: intArray index: 256 type: int[][][]\n" +
- " [pc: 1033, pc: 1133] local: i index: 257 type: int\n" +
- " [pc: 1041, pc: 1118] local: j index: 258 type: int\n" +
- " [pc: 1049, pc: 1103] local: on index: 259 type: boolean\n" +
+ " public void show();\n" +
+ " 0 ldc <String \"\"> [15]\n" +
+ " 2 astore_1 [s1]\n" +
+ " 3 ldc <String \"\"> [15]\n" +
+ " 5 astore_2 [s2]\n" +
+ " 6 ldc <String \"\"> [15]\n" +
+ " 8 astore_3 [s3]\n" +
+ " 9 ldc <String \"\"> [15]\n" +
+ " 11 astore 4 [s4]\n" +
+ " 13 ldc <String \"\"> [15]\n" +
+ " 15 astore 5 [s5]\n" +
+ " 17 ldc <String \"\"> [15]\n" +
+ " 19 astore 6 [s6]\n" +
+ " 21 ldc <String \"\"> [15]\n" +
+ " 23 astore 7 [s7]\n" +
+ " 25 ldc <String \"\"> [15]\n" +
+ " 27 astore 8 [s8]\n" +
+ " 29 ldc <String \"\"> [15]\n" +
+ " 31 astore 9 [s9]\n" +
+ " 33 ldc <String \"\"> [15]\n" +
+ " 35 astore 10 [s10]\n" +
+ " 37 ldc <String \"\"> [15]\n" +
+ " 39 astore 11 [s11]\n" +
+ " 41 ldc <String \"\"> [15]\n" +
+ " 43 astore 12 [s12]\n" +
+ " 45 ldc <String \"\"> [15]\n" +
+ " 47 astore 13 [s13]\n" +
+ " 49 ldc <String \"\"> [15]\n" +
+ " 51 astore 14 [s14]\n" +
+ " 53 ldc <String \"\"> [15]\n" +
+ " 55 astore 15 [s15]\n" +
+ " 57 ldc <String \"\"> [15]\n" +
+ " 59 astore 16 [s16]\n" +
+ " 61 ldc <String \"\"> [15]\n" +
+ " 63 astore 17 [s17]\n" +
+ " 65 ldc <String \"\"> [15]\n" +
+ " 67 astore 18 [s18]\n" +
+ " 69 ldc <String \"\"> [15]\n" +
+ " 71 astore 19 [s19]\n" +
+ " 73 ldc <String \"\"> [15]\n" +
+ " 75 astore 20 [s20]\n" +
+ " 77 ldc <String \"\"> [15]\n" +
+ " 79 astore 21 [s21]\n" +
+ " 81 ldc <String \"\"> [15]\n" +
+ " 83 astore 22 [s22]\n" +
+ " 85 ldc <String \"\"> [15]\n" +
+ " 87 astore 23 [s23]\n" +
+ " 89 ldc <String \"\"> [15]\n" +
+ " 91 astore 24 [s24]\n" +
+ " 93 ldc <String \"\"> [15]\n" +
+ " 95 astore 25 [s25]\n" +
+ " 97 ldc <String \"\"> [15]\n" +
+ " 99 astore 26 [s26]\n" +
+ " 101 ldc <String \"\"> [15]\n" +
+ " 103 astore 27 [s27]\n" +
+ " 105 ldc <String \"\"> [15]\n" +
+ " 107 astore 28 [s28]\n" +
+ " 109 ldc <String \"\"> [15]\n" +
+ " 111 astore 29 [s29]\n" +
+ " 113 ldc <String \"\"> [15]\n" +
+ " 115 astore 30 [s30]\n" +
+ " 117 ldc <String \"\"> [15]\n" +
+ " 119 astore 31 [s31]\n" +
+ " 121 ldc <String \"\"> [15]\n" +
+ " 123 astore 32 [s32]\n" +
+ " 125 ldc <String \"\"> [15]\n" +
+ " 127 astore 33 [s33]\n" +
+ " 129 ldc <String \"\"> [15]\n" +
+ " 131 astore 34 [s34]\n" +
+ " 133 ldc <String \"\"> [15]\n" +
+ " 135 astore 35 [s35]\n" +
+ " 137 ldc <String \"\"> [15]\n" +
+ " 139 astore 36 [s36]\n" +
+ " 141 ldc <String \"\"> [15]\n" +
+ " 143 astore 37 [s37]\n" +
+ " 145 ldc <String \"\"> [15]\n" +
+ " 147 astore 38 [s38]\n" +
+ " 149 ldc <String \"\"> [15]\n" +
+ " 151 astore 39 [s39]\n" +
+ " 153 ldc <String \"\"> [15]\n" +
+ " 155 astore 40 [s40]\n" +
+ " 157 ldc <String \"\"> [15]\n" +
+ " 159 astore 41 [s41]\n" +
+ " 161 ldc <String \"\"> [15]\n" +
+ " 163 astore 42 [s42]\n" +
+ " 165 ldc <String \"\"> [15]\n" +
+ " 167 astore 43 [s43]\n" +
+ " 169 ldc <String \"\"> [15]\n" +
+ " 171 astore 44 [s44]\n" +
+ " 173 ldc <String \"\"> [15]\n" +
+ " 175 astore 45 [s45]\n" +
+ " 177 ldc <String \"\"> [15]\n" +
+ " 179 astore 46 [s46]\n" +
+ " 181 ldc <String \"\"> [15]\n" +
+ " 183 astore 47 [s47]\n" +
+ " 185 ldc <String \"\"> [15]\n" +
+ " 187 astore 48 [s48]\n" +
+ " 189 ldc <String \"\"> [15]\n" +
+ " 191 astore 49 [s49]\n" +
+ " 193 ldc <String \"\"> [15]\n" +
+ " 195 astore 50 [s50]\n" +
+ " 197 ldc <String \"\"> [15]\n" +
+ " 199 astore 51 [s51]\n" +
+ " 201 ldc <String \"\"> [15]\n" +
+ " 203 astore 52 [s52]\n" +
+ " 205 ldc <String \"\"> [15]\n" +
+ " 207 astore 53 [s53]\n" +
+ " 209 ldc <String \"\"> [15]\n" +
+ " 211 astore 54 [s54]\n" +
+ " 213 ldc <String \"\"> [15]\n" +
+ " 215 astore 55 [s55]\n" +
+ " 217 ldc <String \"\"> [15]\n" +
+ " 219 astore 56 [s56]\n" +
+ " 221 ldc <String \"\"> [15]\n" +
+ " 223 astore 57 [s57]\n" +
+ " 225 ldc <String \"\"> [15]\n" +
+ " 227 astore 58 [s58]\n" +
+ " 229 ldc <String \"\"> [15]\n" +
+ " 231 astore 59 [s59]\n" +
+ " 233 ldc <String \"\"> [15]\n" +
+ " 235 astore 60 [s60]\n" +
+ " 237 ldc <String \"\"> [15]\n" +
+ " 239 astore 61 [s61]\n" +
+ " 241 ldc <String \"\"> [15]\n" +
+ " 243 astore 62 [s62]\n" +
+ " 245 ldc <String \"\"> [15]\n" +
+ " 247 astore 63 [s63]\n" +
+ " 249 ldc <String \"\"> [15]\n" +
+ " 251 astore 64 [s64]\n" +
+ " 253 ldc <String \"\"> [15]\n" +
+ " 255 astore 65 [s65]\n" +
+ " 257 ldc <String \"\"> [15]\n" +
+ " 259 astore 66 [s66]\n" +
+ " 261 ldc <String \"\"> [15]\n" +
+ " 263 astore 67 [s67]\n" +
+ " 265 ldc <String \"\"> [15]\n" +
+ " 267 astore 68 [s68]\n" +
+ " 269 ldc <String \"\"> [15]\n" +
+ " 271 astore 69 [s69]\n" +
+ " 273 ldc <String \"\"> [15]\n" +
+ " 275 astore 70 [s70]\n" +
+ " 277 ldc <String \"\"> [15]\n" +
+ " 279 astore 71 [s71]\n" +
+ " 281 ldc <String \"\"> [15]\n" +
+ " 283 astore 72 [s72]\n" +
+ " 285 ldc <String \"\"> [15]\n" +
+ " 287 astore 73 [s73]\n" +
+ " 289 ldc <String \"\"> [15]\n" +
+ " 291 astore 74 [s74]\n" +
+ " 293 ldc <String \"\"> [15]\n" +
+ " 295 astore 75 [s75]\n" +
+ " 297 ldc <String \"\"> [15]\n" +
+ " 299 astore 76 [s76]\n" +
+ " 301 ldc <String \"\"> [15]\n" +
+ " 303 astore 77 [s77]\n" +
+ " 305 ldc <String \"\"> [15]\n" +
+ " 307 astore 78 [s78]\n" +
+ " 309 ldc <String \"\"> [15]\n" +
+ " 311 astore 79 [s79]\n" +
+ " 313 ldc <String \"\"> [15]\n" +
+ " 315 astore 80 [s80]\n" +
+ " 317 ldc <String \"\"> [15]\n" +
+ " 319 astore 81 [s81]\n" +
+ " 321 ldc <String \"\"> [15]\n" +
+ " 323 astore 82 [s82]\n" +
+ " 325 ldc <String \"\"> [15]\n" +
+ " 327 astore 83 [s83]\n" +
+ " 329 ldc <String \"\"> [15]\n" +
+ " 331 astore 84 [s84]\n" +
+ " 333 ldc <String \"\"> [15]\n" +
+ " 335 astore 85 [s85]\n" +
+ " 337 ldc <String \"\"> [15]\n" +
+ " 339 astore 86 [s86]\n" +
+ " 341 ldc <String \"\"> [15]\n" +
+ " 343 astore 87 [s87]\n" +
+ " 345 ldc <String \"\"> [15]\n" +
+ " 347 astore 88 [s88]\n" +
+ " 349 ldc <String \"\"> [15]\n" +
+ " 351 astore 89 [s89]\n" +
+ " 353 ldc <String \"\"> [15]\n" +
+ " 355 astore 90 [s90]\n" +
+ " 357 ldc <String \"\"> [15]\n" +
+ " 359 astore 91 [s91]\n" +
+ " 361 ldc <String \"\"> [15]\n" +
+ " 363 astore 92 [s92]\n" +
+ " 365 ldc <String \"\"> [15]\n" +
+ " 367 astore 93 [s93]\n" +
+ " 369 ldc <String \"\"> [15]\n" +
+ " 371 astore 94 [s94]\n" +
+ " 373 ldc <String \"\"> [15]\n" +
+ " 375 astore 95 [s95]\n" +
+ " 377 ldc <String \"\"> [15]\n" +
+ " 379 astore 96 [s96]\n" +
+ " 381 ldc <String \"\"> [15]\n" +
+ " 383 astore 97 [s97]\n" +
+ " 385 ldc <String \"\"> [15]\n" +
+ " 387 astore 98 [s98]\n" +
+ " 389 ldc <String \"\"> [15]\n" +
+ " 391 astore 99 [s99]\n" +
+ " 393 ldc <String \"\"> [15]\n" +
+ " 395 astore 100 [s100]\n" +
+ " 397 ldc <String \"\"> [15]\n" +
+ " 399 astore 101 [s101]\n" +
+ " 401 ldc <String \"\"> [15]\n" +
+ " 403 astore 102 [s102]\n" +
+ " 405 ldc <String \"\"> [15]\n" +
+ " 407 astore 103 [s103]\n" +
+ " 409 ldc <String \"\"> [15]\n" +
+ " 411 astore 104 [s104]\n" +
+ " 413 ldc <String \"\"> [15]\n" +
+ " 415 astore 105 [s105]\n" +
+ " 417 ldc <String \"\"> [15]\n" +
+ " 419 astore 106 [s106]\n" +
+ " 421 ldc <String \"\"> [15]\n" +
+ " 423 astore 107 [s107]\n" +
+ " 425 ldc <String \"\"> [15]\n" +
+ " 427 astore 108 [s108]\n" +
+ " 429 ldc <String \"\"> [15]\n" +
+ " 431 astore 109 [s109]\n" +
+ " 433 ldc <String \"\"> [15]\n" +
+ " 435 astore 110 [s110]\n" +
+ " 437 ldc <String \"\"> [15]\n" +
+ " 439 astore 111 [s111]\n" +
+ " 441 ldc <String \"\"> [15]\n" +
+ " 443 astore 112 [s112]\n" +
+ " 445 ldc <String \"\"> [15]\n" +
+ " 447 astore 113 [s113]\n" +
+ " 449 ldc <String \"\"> [15]\n" +
+ " 451 astore 114 [s114]\n" +
+ " 453 ldc <String \"\"> [15]\n" +
+ " 455 astore 115 [s115]\n" +
+ " 457 ldc <String \"\"> [15]\n" +
+ " 459 astore 116 [s116]\n" +
+ " 461 ldc <String \"\"> [15]\n" +
+ " 463 astore 117 [s117]\n" +
+ " 465 ldc <String \"\"> [15]\n" +
+ " 467 astore 118 [s118]\n" +
+ " 469 ldc <String \"\"> [15]\n" +
+ " 471 astore 119 [s119]\n" +
+ " 473 ldc <String \"\"> [15]\n" +
+ " 475 astore 120 [s120]\n" +
+ " 477 ldc <String \"\"> [15]\n" +
+ " 479 astore 121 [s121]\n" +
+ " 481 ldc <String \"\"> [15]\n" +
+ " 483 astore 122 [s122]\n" +
+ " 485 ldc <String \"\"> [15]\n" +
+ " 487 astore 123 [s123]\n" +
+ " 489 ldc <String \"\"> [15]\n" +
+ " 491 astore 124 [s124]\n" +
+ " 493 ldc <String \"\"> [15]\n" +
+ " 495 astore 125 [s125]\n" +
+ " 497 ldc <String \"\"> [15]\n" +
+ " 499 astore 126 [s126]\n" +
+ " 501 ldc <String \"\"> [15]\n" +
+ " 503 astore 127 [s127]\n" +
+ " 505 ldc <String \"\"> [15]\n" +
+ " 507 astore 128 [s128]\n" +
+ " 509 ldc <String \"\"> [15]\n" +
+ " 511 astore 129 [s129]\n" +
+ " 513 ldc <String \"\"> [15]\n" +
+ " 515 astore 130 [s130]\n" +
+ " 517 ldc <String \"\"> [15]\n" +
+ " 519 astore 131 [s131]\n" +
+ " 521 ldc <String \"\"> [15]\n" +
+ " 523 astore 132 [s132]\n" +
+ " 525 ldc <String \"\"> [15]\n" +
+ " 527 astore 133 [s133]\n" +
+ " 529 ldc <String \"\"> [15]\n" +
+ " 531 astore 134 [s134]\n" +
+ " 533 ldc <String \"\"> [15]\n" +
+ " 535 astore 135 [s135]\n" +
+ " 537 ldc <String \"\"> [15]\n" +
+ " 539 astore 136 [s136]\n" +
+ " 541 ldc <String \"\"> [15]\n" +
+ " 543 astore 137 [s137]\n" +
+ " 545 ldc <String \"\"> [15]\n" +
+ " 547 astore 138 [s138]\n" +
+ " 549 ldc <String \"\"> [15]\n" +
+ " 551 astore 139 [s139]\n" +
+ " 553 ldc <String \"\"> [15]\n" +
+ " 555 astore 140 [s140]\n" +
+ " 557 ldc <String \"\"> [15]\n" +
+ " 559 astore 141 [s141]\n" +
+ " 561 ldc <String \"\"> [15]\n" +
+ " 563 astore 142 [s142]\n" +
+ " 565 ldc <String \"\"> [15]\n" +
+ " 567 astore 143 [s143]\n" +
+ " 569 ldc <String \"\"> [15]\n" +
+ " 571 astore 144 [s144]\n" +
+ " 573 ldc <String \"\"> [15]\n" +
+ " 575 astore 145 [s145]\n" +
+ " 577 ldc <String \"\"> [15]\n" +
+ " 579 astore 146 [s146]\n" +
+ " 581 ldc <String \"\"> [15]\n" +
+ " 583 astore 147 [s147]\n" +
+ " 585 ldc <String \"\"> [15]\n" +
+ " 587 astore 148 [s148]\n" +
+ " 589 ldc <String \"\"> [15]\n" +
+ " 591 astore 149 [s149]\n" +
+ " 593 ldc <String \"\"> [15]\n" +
+ " 595 astore 150 [s150]\n" +
+ " 597 ldc <String \"\"> [15]\n" +
+ " 599 astore 151 [s151]\n" +
+ " 601 ldc <String \"\"> [15]\n" +
+ " 603 astore 152 [s152]\n" +
+ " 605 ldc <String \"\"> [15]\n" +
+ " 607 astore 153 [s153]\n" +
+ " 609 ldc <String \"\"> [15]\n" +
+ " 611 astore 154 [s154]\n" +
+ " 613 ldc <String \"\"> [15]\n" +
+ " 615 astore 155 [s155]\n" +
+ " 617 ldc <String \"\"> [15]\n" +
+ " 619 astore 156 [s156]\n" +
+ " 621 ldc <String \"\"> [15]\n" +
+ " 623 astore 157 [s157]\n" +
+ " 625 ldc <String \"\"> [15]\n" +
+ " 627 astore 158 [s158]\n" +
+ " 629 ldc <String \"\"> [15]\n" +
+ " 631 astore 159 [s159]\n" +
+ " 633 ldc <String \"\"> [15]\n" +
+ " 635 astore 160 [s160]\n" +
+ " 637 ldc <String \"\"> [15]\n" +
+ " 639 astore 161 [s161]\n" +
+ " 641 ldc <String \"\"> [15]\n" +
+ " 643 astore 162 [s162]\n" +
+ " 645 ldc <String \"\"> [15]\n" +
+ " 647 astore 163 [s163]\n" +
+ " 649 ldc <String \"\"> [15]\n" +
+ " 651 astore 164 [s164]\n" +
+ " 653 ldc <String \"\"> [15]\n" +
+ " 655 astore 165 [s165]\n" +
+ " 657 ldc <String \"\"> [15]\n" +
+ " 659 astore 166 [s166]\n" +
+ " 661 ldc <String \"\"> [15]\n" +
+ " 663 astore 167 [s167]\n" +
+ " 665 ldc <String \"\"> [15]\n" +
+ " 667 astore 168 [s168]\n" +
+ " 669 ldc <String \"\"> [15]\n" +
+ " 671 astore 169 [s169]\n" +
+ " 673 ldc <String \"\"> [15]\n" +
+ " 675 astore 170 [s170]\n" +
+ " 677 ldc <String \"\"> [15]\n" +
+ " 679 astore 171 [s171]\n" +
+ " 681 ldc <String \"\"> [15]\n" +
+ " 683 astore 172 [s172]\n" +
+ " 685 ldc <String \"\"> [15]\n" +
+ " 687 astore 173 [s173]\n" +
+ " 689 ldc <String \"\"> [15]\n" +
+ " 691 astore 174 [s174]\n" +
+ " 693 ldc <String \"\"> [15]\n" +
+ " 695 astore 175 [s175]\n" +
+ " 697 ldc <String \"\"> [15]\n" +
+ " 699 astore 176 [s176]\n" +
+ " 701 ldc <String \"\"> [15]\n" +
+ " 703 astore 177 [s177]\n" +
+ " 705 ldc <String \"\"> [15]\n" +
+ " 707 astore 178 [s178]\n" +
+ " 709 ldc <String \"\"> [15]\n" +
+ " 711 astore 179 [s179]\n" +
+ " 713 ldc <String \"\"> [15]\n" +
+ " 715 astore 180 [s180]\n" +
+ " 717 ldc <String \"\"> [15]\n" +
+ " 719 astore 181 [s181]\n" +
+ " 721 ldc <String \"\"> [15]\n" +
+ " 723 astore 182 [s182]\n" +
+ " 725 ldc <String \"\"> [15]\n" +
+ " 727 astore 183 [s183]\n" +
+ " 729 ldc <String \"\"> [15]\n" +
+ " 731 astore 184 [s184]\n" +
+ " 733 ldc <String \"\"> [15]\n" +
+ " 735 astore 185 [s185]\n" +
+ " 737 ldc <String \"\"> [15]\n" +
+ " 739 astore 186 [s186]\n" +
+ " 741 ldc <String \"\"> [15]\n" +
+ " 743 astore 187 [s187]\n" +
+ " 745 ldc <String \"\"> [15]\n" +
+ " 747 astore 188 [s188]\n" +
+ " 749 ldc <String \"\"> [15]\n" +
+ " 751 astore 189 [s189]\n" +
+ " 753 ldc <String \"\"> [15]\n" +
+ " 755 astore 190 [s190]\n" +
+ " 757 ldc <String \"\"> [15]\n" +
+ " 759 astore 191 [s191]\n" +
+ " 761 ldc <String \"\"> [15]\n" +
+ " 763 astore 192 [s192]\n" +
+ " 765 ldc <String \"\"> [15]\n" +
+ " 767 astore 193 [s193]\n" +
+ " 769 ldc <String \"\"> [15]\n" +
+ " 771 astore 194 [s194]\n" +
+ " 773 ldc <String \"\"> [15]\n" +
+ " 775 astore 195 [s195]\n" +
+ " 777 ldc <String \"\"> [15]\n" +
+ " 779 astore 196 [s196]\n" +
+ " 781 ldc <String \"\"> [15]\n" +
+ " 783 astore 197 [s197]\n" +
+ " 785 ldc <String \"\"> [15]\n" +
+ " 787 astore 198 [s198]\n" +
+ " 789 ldc <String \"\"> [15]\n" +
+ " 791 astore 199 [s199]\n" +
+ " 793 ldc <String \"\"> [15]\n" +
+ " 795 astore 200 [s200]\n" +
+ " 797 ldc <String \"\"> [15]\n" +
+ " 799 astore 201 [s201]\n" +
+ " 801 ldc <String \"\"> [15]\n" +
+ " 803 astore 202 [s202]\n" +
+ " 805 ldc <String \"\"> [15]\n" +
+ " 807 astore 203 [s203]\n" +
+ " 809 ldc <String \"\"> [15]\n" +
+ " 811 astore 204 [s204]\n" +
+ " 813 ldc <String \"\"> [15]\n" +
+ " 815 astore 205 [s205]\n" +
+ " 817 ldc <String \"\"> [15]\n" +
+ " 819 astore 206 [s206]\n" +
+ " 821 ldc <String \"\"> [15]\n" +
+ " 823 astore 207 [s207]\n" +
+ " 825 ldc <String \"\"> [15]\n" +
+ " 827 astore 208 [s208]\n" +
+ " 829 ldc <String \"\"> [15]\n" +
+ " 831 astore 209 [s209]\n" +
+ " 833 ldc <String \"\"> [15]\n" +
+ " 835 astore 210 [s210]\n" +
+ " 837 ldc <String \"\"> [15]\n" +
+ " 839 astore 211 [s211]\n" +
+ " 841 ldc <String \"\"> [15]\n" +
+ " 843 astore 212 [s212]\n" +
+ " 845 ldc <String \"\"> [15]\n" +
+ " 847 astore 213 [s213]\n" +
+ " 849 ldc <String \"\"> [15]\n" +
+ " 851 astore 214 [s214]\n" +
+ " 853 ldc <String \"\"> [15]\n" +
+ " 855 astore 215 [s215]\n" +
+ " 857 ldc <String \"\"> [15]\n" +
+ " 859 astore 216 [s216]\n" +
+ " 861 ldc <String \"\"> [15]\n" +
+ " 863 astore 217 [s217]\n" +
+ " 865 ldc <String \"\"> [15]\n" +
+ " 867 astore 218 [s218]\n" +
+ " 869 ldc <String \"\"> [15]\n" +
+ " 871 astore 219 [s219]\n" +
+ " 873 ldc <String \"\"> [15]\n" +
+ " 875 astore 220 [s220]\n" +
+ " 877 ldc <String \"\"> [15]\n" +
+ " 879 astore 221 [s221]\n" +
+ " 881 ldc <String \"\"> [15]\n" +
+ " 883 astore 222 [s222]\n" +
+ " 885 ldc <String \"\"> [15]\n" +
+ " 887 astore 223 [s223]\n" +
+ " 889 ldc <String \"\"> [15]\n" +
+ " 891 astore 224 [s224]\n" +
+ " 893 ldc <String \"\"> [15]\n" +
+ " 895 astore 225 [s225]\n" +
+ " 897 ldc <String \"\"> [15]\n" +
+ " 899 astore 226 [s226]\n" +
+ " 901 ldc <String \"\"> [15]\n" +
+ " 903 astore 227 [s227]\n" +
+ " 905 ldc <String \"\"> [15]\n" +
+ " 907 astore 228 [s228]\n" +
+ " 909 ldc <String \"\"> [15]\n" +
+ " 911 astore 229 [s229]\n" +
+ " 913 ldc <String \"\"> [15]\n" +
+ " 915 astore 230 [s230]\n" +
+ " 917 ldc <String \"\"> [15]\n" +
+ " 919 astore 231 [s231]\n" +
+ " 921 ldc <String \"\"> [15]\n" +
+ " 923 astore 232 [s232]\n" +
+ " 925 ldc <String \"\"> [15]\n" +
+ " 927 astore 233 [s233]\n" +
+ " 929 ldc <String \"\"> [15]\n" +
+ " 931 astore 234 [s234]\n" +
+ " 933 ldc <String \"\"> [15]\n" +
+ " 935 astore 235 [s235]\n" +
+ " 937 ldc <String \"\"> [15]\n" +
+ " 939 astore 236 [s236]\n" +
+ " 941 ldc <String \"\"> [15]\n" +
+ " 943 astore 237 [s237]\n" +
+ " 945 ldc <String \"\"> [15]\n" +
+ " 947 astore 238 [s238]\n" +
+ " 949 ldc <String \"\"> [15]\n" +
+ " 951 astore 239 [s239]\n" +
+ " 953 ldc <String \"\"> [15]\n" +
+ " 955 astore 240 [s240]\n" +
+ " 957 ldc <String \"\"> [15]\n" +
+ " 959 astore 241 [s241]\n" +
+ " 961 ldc <String \"\"> [15]\n" +
+ " 963 astore 242 [s242]\n" +
+ " 965 ldc <String \"\"> [15]\n" +
+ " 967 astore 243 [s243]\n" +
+ " 969 ldc <String \"\"> [15]\n" +
+ " 971 astore 244 [s244]\n" +
+ " 973 ldc <String \"\"> [15]\n" +
+ " 975 astore 245 [s245]\n" +
+ " 977 ldc <String \"\"> [15]\n" +
+ " 979 astore 246 [s246]\n" +
+ " 981 ldc <String \"\"> [15]\n" +
+ " 983 astore 247 [s247]\n" +
+ " 985 ldc <String \"\"> [15]\n" +
+ " 987 astore 248 [s248]\n" +
+ " 989 ldc <String \"\"> [15]\n" +
+ " 991 astore 249 [s249]\n" +
+ " 993 ldc <String \"\"> [15]\n" +
+ " 995 astore 250 [s250]\n" +
+ " 997 ldc <String \"\"> [15]\n" +
+ " 999 astore 251 [s251]\n" +
+ " 1001 ldc <String \"\"> [15]\n" +
+ " 1003 astore 252 [s252]\n" +
+ " 1005 iconst_1\n" +
+ " 1006 istore 253 [size1]\n" +
+ " 1008 iconst_2\n" +
+ " 1009 istore 254 [size2]\n" +
+ " 1011 iconst_3\n" +
+ " 1012 istore 255 [size3]\n" +
+ " 1014 iload 253 [size1]\n" +
+ " 1016 iload 254 [size2]\n" +
+ " 1018 iload 255 [size3]\n" +
+ " 1020 multianewarray int[][][] [17]\n" +
+ " 1024 wide\n" +
+ " 1025 astore 256 [intArray]\n" +
+ " 1028 iconst_0\n" +
+ " 1029 wide\n" +
+ " 1030 istore 257 [i]\n" +
+ " 1033 goto 1124\n" +
+ " 1036 iconst_0\n" +
+ " 1037 wide\n" +
+ " 1038 istore 258 [j]\n" +
+ " 1041 goto 1109\n" +
+ " 1044 iconst_0\n" +
+ " 1045 wide\n" +
+ " 1046 istore 259 [on]\n" +
+ " 1049 iconst_0\n" +
+ " 1050 wide\n" +
+ " 1051 istore 260 [k]\n" +
+ " 1054 goto 1094\n" +
+ " 1057 wide\n" +
+ " 1058 aload 256 [intArray]\n" +
+ " 1061 wide\n" +
+ " 1062 iload 257 [i]\n" +
+ " 1065 aaload\n" +
+ " 1066 wide\n" +
+ " 1067 iload 258 [j]\n" +
+ " 1070 aaload\n" +
+ " 1071 wide\n" +
+ " 1072 iload 260 [k]\n" +
+ " 1075 wide\n" +
+ " 1076 iload 259 [on]\n" +
+ " 1079 ifeq 1086\n" +
+ " 1082 iconst_0\n" +
+ " 1083 goto 1087\n" +
+ " 1086 iconst_1\n" +
+ " 1087 iastore\n" +
+ " 1088 wide\n" +
+ " 1089 iinc 260 1 [k]\n" +
+ " 1094 wide\n" +
+ " 1095 iload 260 [k]\n" +
+ " 1098 iload 255 [size3]\n" +
+ " 1100 if_icmplt 1057\n" +
+ " 1103 wide\n" +
+ " 1104 iinc 258 1 [j]\n" +
+ " 1109 wide\n" +
+ " 1110 iload 258 [j]\n" +
+ " 1113 iload 254 [size2]\n" +
+ " 1115 if_icmplt 1044\n" +
+ " 1118 wide\n" +
+ " 1119 iinc 257 1 [i]\n" +
+ " 1124 wide\n" +
+ " 1125 iload 257 [i]\n" +
+ " 1128 iload 253 [size1]\n" +
+ " 1130 if_icmplt 1036\n" +
+ " 1133 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 4]\n" +
+ " [pc: 37, line: 5]\n" +
+ " [pc: 77, line: 6]\n" +
+ " [pc: 117, line: 7]\n" +
+ " [pc: 157, line: 8]\n" +
+ " [pc: 197, line: 9]\n" +
+ " [pc: 237, line: 10]\n" +
+ " [pc: 277, line: 11]\n" +
+ " [pc: 317, line: 12]\n" +
+ " [pc: 357, line: 13]\n" +
+ " [pc: 397, line: 14]\n" +
+ " [pc: 437, line: 15]\n" +
+ " [pc: 477, line: 16]\n" +
+ " [pc: 517, line: 17]\n" +
+ " [pc: 557, line: 18]\n" +
+ " [pc: 597, line: 19]\n" +
+ " [pc: 637, line: 20]\n" +
+ " [pc: 677, line: 21]\n" +
+ " [pc: 717, line: 22]\n" +
+ " [pc: 757, line: 23]\n" +
+ " [pc: 797, line: 24]\n" +
+ " [pc: 837, line: 25]\n" +
+ " [pc: 877, line: 26]\n" +
+ " [pc: 917, line: 27]\n" +
+ " [pc: 957, line: 28]\n" +
+ " [pc: 997, line: 29]\n" +
+ " [pc: 1005, line: 31]\n" +
+ " [pc: 1008, line: 32]\n" +
+ " [pc: 1011, line: 33]\n" +
+ " [pc: 1014, line: 35]\n" +
+ " [pc: 1028, line: 37]\n" +
+ " [pc: 1036, line: 38]\n" +
+ " [pc: 1044, line: 39]\n" +
+ " [pc: 1049, line: 40]\n" +
+ " [pc: 1057, line: 41]\n" +
+ " [pc: 1088, line: 40]\n" +
+ " [pc: 1103, line: 38]\n" +
+ " [pc: 1118, line: 37]\n" +
+ " [pc: 1133, line: 46]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 1134] local: this index: 0 type: X\n" +
+ " [pc: 3, pc: 1134] local: s1 index: 1 type: java.lang.String\n" +
+ " [pc: 6, pc: 1134] local: s2 index: 2 type: java.lang.String\n" +
+ " [pc: 9, pc: 1134] local: s3 index: 3 type: java.lang.String\n" +
+ " [pc: 13, pc: 1134] local: s4 index: 4 type: java.lang.String\n" +
+ " [pc: 17, pc: 1134] local: s5 index: 5 type: java.lang.String\n" +
+ " [pc: 21, pc: 1134] local: s6 index: 6 type: java.lang.String\n" +
+ " [pc: 25, pc: 1134] local: s7 index: 7 type: java.lang.String\n" +
+ " [pc: 29, pc: 1134] local: s8 index: 8 type: java.lang.String\n" +
+ " [pc: 33, pc: 1134] local: s9 index: 9 type: java.lang.String\n" +
+ " [pc: 37, pc: 1134] local: s10 index: 10 type: java.lang.String\n" +
+ " [pc: 41, pc: 1134] local: s11 index: 11 type: java.lang.String\n" +
+ " [pc: 45, pc: 1134] local: s12 index: 12 type: java.lang.String\n" +
+ " [pc: 49, pc: 1134] local: s13 index: 13 type: java.lang.String\n" +
+ " [pc: 53, pc: 1134] local: s14 index: 14 type: java.lang.String\n" +
+ " [pc: 57, pc: 1134] local: s15 index: 15 type: java.lang.String\n" +
+ " [pc: 61, pc: 1134] local: s16 index: 16 type: java.lang.String\n" +
+ " [pc: 65, pc: 1134] local: s17 index: 17 type: java.lang.String\n" +
+ " [pc: 69, pc: 1134] local: s18 index: 18 type: java.lang.String\n" +
+ " [pc: 73, pc: 1134] local: s19 index: 19 type: java.lang.String\n" +
+ " [pc: 77, pc: 1134] local: s20 index: 20 type: java.lang.String\n" +
+ " [pc: 81, pc: 1134] local: s21 index: 21 type: java.lang.String\n" +
+ " [pc: 85, pc: 1134] local: s22 index: 22 type: java.lang.String\n" +
+ " [pc: 89, pc: 1134] local: s23 index: 23 type: java.lang.String\n" +
+ " [pc: 93, pc: 1134] local: s24 index: 24 type: java.lang.String\n" +
+ " [pc: 97, pc: 1134] local: s25 index: 25 type: java.lang.String\n" +
+ " [pc: 101, pc: 1134] local: s26 index: 26 type: java.lang.String\n" +
+ " [pc: 105, pc: 1134] local: s27 index: 27 type: java.lang.String\n" +
+ " [pc: 109, pc: 1134] local: s28 index: 28 type: java.lang.String\n" +
+ " [pc: 113, pc: 1134] local: s29 index: 29 type: java.lang.String\n" +
+ " [pc: 117, pc: 1134] local: s30 index: 30 type: java.lang.String\n" +
+ " [pc: 121, pc: 1134] local: s31 index: 31 type: java.lang.String\n" +
+ " [pc: 125, pc: 1134] local: s32 index: 32 type: java.lang.String\n" +
+ " [pc: 129, pc: 1134] local: s33 index: 33 type: java.lang.String\n" +
+ " [pc: 133, pc: 1134] local: s34 index: 34 type: java.lang.String\n" +
+ " [pc: 137, pc: 1134] local: s35 index: 35 type: java.lang.String\n" +
+ " [pc: 141, pc: 1134] local: s36 index: 36 type: java.lang.String\n" +
+ " [pc: 145, pc: 1134] local: s37 index: 37 type: java.lang.String\n" +
+ " [pc: 149, pc: 1134] local: s38 index: 38 type: java.lang.String\n" +
+ " [pc: 153, pc: 1134] local: s39 index: 39 type: java.lang.String\n" +
+ " [pc: 157, pc: 1134] local: s40 index: 40 type: java.lang.String\n" +
+ " [pc: 161, pc: 1134] local: s41 index: 41 type: java.lang.String\n" +
+ " [pc: 165, pc: 1134] local: s42 index: 42 type: java.lang.String\n" +
+ " [pc: 169, pc: 1134] local: s43 index: 43 type: java.lang.String\n" +
+ " [pc: 173, pc: 1134] local: s44 index: 44 type: java.lang.String\n" +
+ " [pc: 177, pc: 1134] local: s45 index: 45 type: java.lang.String\n" +
+ " [pc: 181, pc: 1134] local: s46 index: 46 type: java.lang.String\n" +
+ " [pc: 185, pc: 1134] local: s47 index: 47 type: java.lang.String\n" +
+ " [pc: 189, pc: 1134] local: s48 index: 48 type: java.lang.String\n" +
+ " [pc: 193, pc: 1134] local: s49 index: 49 type: java.lang.String\n" +
+ " [pc: 197, pc: 1134] local: s50 index: 50 type: java.lang.String\n" +
+ " [pc: 201, pc: 1134] local: s51 index: 51 type: java.lang.String\n" +
+ " [pc: 205, pc: 1134] local: s52 index: 52 type: java.lang.String\n" +
+ " [pc: 209, pc: 1134] local: s53 index: 53 type: java.lang.String\n" +
+ " [pc: 213, pc: 1134] local: s54 index: 54 type: java.lang.String\n" +
+ " [pc: 217, pc: 1134] local: s55 index: 55 type: java.lang.String\n" +
+ " [pc: 221, pc: 1134] local: s56 index: 56 type: java.lang.String\n" +
+ " [pc: 225, pc: 1134] local: s57 index: 57 type: java.lang.String\n" +
+ " [pc: 229, pc: 1134] local: s58 index: 58 type: java.lang.String\n" +
+ " [pc: 233, pc: 1134] local: s59 index: 59 type: java.lang.String\n" +
+ " [pc: 237, pc: 1134] local: s60 index: 60 type: java.lang.String\n" +
+ " [pc: 241, pc: 1134] local: s61 index: 61 type: java.lang.String\n" +
+ " [pc: 245, pc: 1134] local: s62 index: 62 type: java.lang.String\n" +
+ " [pc: 249, pc: 1134] local: s63 index: 63 type: java.lang.String\n" +
+ " [pc: 253, pc: 1134] local: s64 index: 64 type: java.lang.String\n" +
+ " [pc: 257, pc: 1134] local: s65 index: 65 type: java.lang.String\n" +
+ " [pc: 261, pc: 1134] local: s66 index: 66 type: java.lang.String\n" +
+ " [pc: 265, pc: 1134] local: s67 index: 67 type: java.lang.String\n" +
+ " [pc: 269, pc: 1134] local: s68 index: 68 type: java.lang.String\n" +
+ " [pc: 273, pc: 1134] local: s69 index: 69 type: java.lang.String\n" +
+ " [pc: 277, pc: 1134] local: s70 index: 70 type: java.lang.String\n" +
+ " [pc: 281, pc: 1134] local: s71 index: 71 type: java.lang.String\n" +
+ " [pc: 285, pc: 1134] local: s72 index: 72 type: java.lang.String\n" +
+ " [pc: 289, pc: 1134] local: s73 index: 73 type: java.lang.String\n" +
+ " [pc: 293, pc: 1134] local: s74 index: 74 type: java.lang.String\n" +
+ " [pc: 297, pc: 1134] local: s75 index: 75 type: java.lang.String\n" +
+ " [pc: 301, pc: 1134] local: s76 index: 76 type: java.lang.String\n" +
+ " [pc: 305, pc: 1134] local: s77 index: 77 type: java.lang.String\n" +
+ " [pc: 309, pc: 1134] local: s78 index: 78 type: java.lang.String\n" +
+ " [pc: 313, pc: 1134] local: s79 index: 79 type: java.lang.String\n" +
+ " [pc: 317, pc: 1134] local: s80 index: 80 type: java.lang.String\n" +
+ " [pc: 321, pc: 1134] local: s81 index: 81 type: java.lang.String\n" +
+ " [pc: 325, pc: 1134] local: s82 index: 82 type: java.lang.String\n" +
+ " [pc: 329, pc: 1134] local: s83 index: 83 type: java.lang.String\n" +
+ " [pc: 333, pc: 1134] local: s84 index: 84 type: java.lang.String\n" +
+ " [pc: 337, pc: 1134] local: s85 index: 85 type: java.lang.String\n" +
+ " [pc: 341, pc: 1134] local: s86 index: 86 type: java.lang.String\n" +
+ " [pc: 345, pc: 1134] local: s87 index: 87 type: java.lang.String\n" +
+ " [pc: 349, pc: 1134] local: s88 index: 88 type: java.lang.String\n" +
+ " [pc: 353, pc: 1134] local: s89 index: 89 type: java.lang.String\n" +
+ " [pc: 357, pc: 1134] local: s90 index: 90 type: java.lang.String\n" +
+ " [pc: 361, pc: 1134] local: s91 index: 91 type: java.lang.String\n" +
+ " [pc: 365, pc: 1134] local: s92 index: 92 type: java.lang.String\n" +
+ " [pc: 369, pc: 1134] local: s93 index: 93 type: java.lang.String\n" +
+ " [pc: 373, pc: 1134] local: s94 index: 94 type: java.lang.String\n" +
+ " [pc: 377, pc: 1134] local: s95 index: 95 type: java.lang.String\n" +
+ " [pc: 381, pc: 1134] local: s96 index: 96 type: java.lang.String\n" +
+ " [pc: 385, pc: 1134] local: s97 index: 97 type: java.lang.String\n" +
+ " [pc: 389, pc: 1134] local: s98 index: 98 type: java.lang.String\n" +
+ " [pc: 393, pc: 1134] local: s99 index: 99 type: java.lang.String\n" +
+ " [pc: 397, pc: 1134] local: s100 index: 100 type: java.lang.String\n" +
+ " [pc: 401, pc: 1134] local: s101 index: 101 type: java.lang.String\n" +
+ " [pc: 405, pc: 1134] local: s102 index: 102 type: java.lang.String\n" +
+ " [pc: 409, pc: 1134] local: s103 index: 103 type: java.lang.String\n" +
+ " [pc: 413, pc: 1134] local: s104 index: 104 type: java.lang.String\n" +
+ " [pc: 417, pc: 1134] local: s105 index: 105 type: java.lang.String\n" +
+ " [pc: 421, pc: 1134] local: s106 index: 106 type: java.lang.String\n" +
+ " [pc: 425, pc: 1134] local: s107 index: 107 type: java.lang.String\n" +
+ " [pc: 429, pc: 1134] local: s108 index: 108 type: java.lang.String\n" +
+ " [pc: 433, pc: 1134] local: s109 index: 109 type: java.lang.String\n" +
+ " [pc: 437, pc: 1134] local: s110 index: 110 type: java.lang.String\n" +
+ " [pc: 441, pc: 1134] local: s111 index: 111 type: java.lang.String\n" +
+ " [pc: 445, pc: 1134] local: s112 index: 112 type: java.lang.String\n" +
+ " [pc: 449, pc: 1134] local: s113 index: 113 type: java.lang.String\n" +
+ " [pc: 453, pc: 1134] local: s114 index: 114 type: java.lang.String\n" +
+ " [pc: 457, pc: 1134] local: s115 index: 115 type: java.lang.String\n" +
+ " [pc: 461, pc: 1134] local: s116 index: 116 type: java.lang.String\n" +
+ " [pc: 465, pc: 1134] local: s117 index: 117 type: java.lang.String\n" +
+ " [pc: 469, pc: 1134] local: s118 index: 118 type: java.lang.String\n" +
+ " [pc: 473, pc: 1134] local: s119 index: 119 type: java.lang.String\n" +
+ " [pc: 477, pc: 1134] local: s120 index: 120 type: java.lang.String\n" +
+ " [pc: 481, pc: 1134] local: s121 index: 121 type: java.lang.String\n" +
+ " [pc: 485, pc: 1134] local: s122 index: 122 type: java.lang.String\n" +
+ " [pc: 489, pc: 1134] local: s123 index: 123 type: java.lang.String\n" +
+ " [pc: 493, pc: 1134] local: s124 index: 124 type: java.lang.String\n" +
+ " [pc: 497, pc: 1134] local: s125 index: 125 type: java.lang.String\n" +
+ " [pc: 501, pc: 1134] local: s126 index: 126 type: java.lang.String\n" +
+ " [pc: 505, pc: 1134] local: s127 index: 127 type: java.lang.String\n" +
+ " [pc: 509, pc: 1134] local: s128 index: 128 type: java.lang.String\n" +
+ " [pc: 513, pc: 1134] local: s129 index: 129 type: java.lang.String\n" +
+ " [pc: 517, pc: 1134] local: s130 index: 130 type: java.lang.String\n" +
+ " [pc: 521, pc: 1134] local: s131 index: 131 type: java.lang.String\n" +
+ " [pc: 525, pc: 1134] local: s132 index: 132 type: java.lang.String\n" +
+ " [pc: 529, pc: 1134] local: s133 index: 133 type: java.lang.String\n" +
+ " [pc: 533, pc: 1134] local: s134 index: 134 type: java.lang.String\n" +
+ " [pc: 537, pc: 1134] local: s135 index: 135 type: java.lang.String\n" +
+ " [pc: 541, pc: 1134] local: s136 index: 136 type: java.lang.String\n" +
+ " [pc: 545, pc: 1134] local: s137 index: 137 type: java.lang.String\n" +
+ " [pc: 549, pc: 1134] local: s138 index: 138 type: java.lang.String\n" +
+ " [pc: 553, pc: 1134] local: s139 index: 139 type: java.lang.String\n" +
+ " [pc: 557, pc: 1134] local: s140 index: 140 type: java.lang.String\n" +
+ " [pc: 561, pc: 1134] local: s141 index: 141 type: java.lang.String\n" +
+ " [pc: 565, pc: 1134] local: s142 index: 142 type: java.lang.String\n" +
+ " [pc: 569, pc: 1134] local: s143 index: 143 type: java.lang.String\n" +
+ " [pc: 573, pc: 1134] local: s144 index: 144 type: java.lang.String\n" +
+ " [pc: 577, pc: 1134] local: s145 index: 145 type: java.lang.String\n" +
+ " [pc: 581, pc: 1134] local: s146 index: 146 type: java.lang.String\n" +
+ " [pc: 585, pc: 1134] local: s147 index: 147 type: java.lang.String\n" +
+ " [pc: 589, pc: 1134] local: s148 index: 148 type: java.lang.String\n" +
+ " [pc: 593, pc: 1134] local: s149 index: 149 type: java.lang.String\n" +
+ " [pc: 597, pc: 1134] local: s150 index: 150 type: java.lang.String\n" +
+ " [pc: 601, pc: 1134] local: s151 index: 151 type: java.lang.String\n" +
+ " [pc: 605, pc: 1134] local: s152 index: 152 type: java.lang.String\n" +
+ " [pc: 609, pc: 1134] local: s153 index: 153 type: java.lang.String\n" +
+ " [pc: 613, pc: 1134] local: s154 index: 154 type: java.lang.String\n" +
+ " [pc: 617, pc: 1134] local: s155 index: 155 type: java.lang.String\n" +
+ " [pc: 621, pc: 1134] local: s156 index: 156 type: java.lang.String\n" +
+ " [pc: 625, pc: 1134] local: s157 index: 157 type: java.lang.String\n" +
+ " [pc: 629, pc: 1134] local: s158 index: 158 type: java.lang.String\n" +
+ " [pc: 633, pc: 1134] local: s159 index: 159 type: java.lang.String\n" +
+ " [pc: 637, pc: 1134] local: s160 index: 160 type: java.lang.String\n" +
+ " [pc: 641, pc: 1134] local: s161 index: 161 type: java.lang.String\n" +
+ " [pc: 645, pc: 1134] local: s162 index: 162 type: java.lang.String\n" +
+ " [pc: 649, pc: 1134] local: s163 index: 163 type: java.lang.String\n" +
+ " [pc: 653, pc: 1134] local: s164 index: 164 type: java.lang.String\n" +
+ " [pc: 657, pc: 1134] local: s165 index: 165 type: java.lang.String\n" +
+ " [pc: 661, pc: 1134] local: s166 index: 166 type: java.lang.String\n" +
+ " [pc: 665, pc: 1134] local: s167 index: 167 type: java.lang.String\n" +
+ " [pc: 669, pc: 1134] local: s168 index: 168 type: java.lang.String\n" +
+ " [pc: 673, pc: 1134] local: s169 index: 169 type: java.lang.String\n" +
+ " [pc: 677, pc: 1134] local: s170 index: 170 type: java.lang.String\n" +
+ " [pc: 681, pc: 1134] local: s171 index: 171 type: java.lang.String\n" +
+ " [pc: 685, pc: 1134] local: s172 index: 172 type: java.lang.String\n" +
+ " [pc: 689, pc: 1134] local: s173 index: 173 type: java.lang.String\n" +
+ " [pc: 693, pc: 1134] local: s174 index: 174 type: java.lang.String\n" +
+ " [pc: 697, pc: 1134] local: s175 index: 175 type: java.lang.String\n" +
+ " [pc: 701, pc: 1134] local: s176 index: 176 type: java.lang.String\n" +
+ " [pc: 705, pc: 1134] local: s177 index: 177 type: java.lang.String\n" +
+ " [pc: 709, pc: 1134] local: s178 index: 178 type: java.lang.String\n" +
+ " [pc: 713, pc: 1134] local: s179 index: 179 type: java.lang.String\n" +
+ " [pc: 717, pc: 1134] local: s180 index: 180 type: java.lang.String\n" +
+ " [pc: 721, pc: 1134] local: s181 index: 181 type: java.lang.String\n" +
+ " [pc: 725, pc: 1134] local: s182 index: 182 type: java.lang.String\n" +
+ " [pc: 729, pc: 1134] local: s183 index: 183 type: java.lang.String\n" +
+ " [pc: 733, pc: 1134] local: s184 index: 184 type: java.lang.String\n" +
+ " [pc: 737, pc: 1134] local: s185 index: 185 type: java.lang.String\n" +
+ " [pc: 741, pc: 1134] local: s186 index: 186 type: java.lang.String\n" +
+ " [pc: 745, pc: 1134] local: s187 index: 187 type: java.lang.String\n" +
+ " [pc: 749, pc: 1134] local: s188 index: 188 type: java.lang.String\n" +
+ " [pc: 753, pc: 1134] local: s189 index: 189 type: java.lang.String\n" +
+ " [pc: 757, pc: 1134] local: s190 index: 190 type: java.lang.String\n" +
+ " [pc: 761, pc: 1134] local: s191 index: 191 type: java.lang.String\n" +
+ " [pc: 765, pc: 1134] local: s192 index: 192 type: java.lang.String\n" +
+ " [pc: 769, pc: 1134] local: s193 index: 193 type: java.lang.String\n" +
+ " [pc: 773, pc: 1134] local: s194 index: 194 type: java.lang.String\n" +
+ " [pc: 777, pc: 1134] local: s195 index: 195 type: java.lang.String\n" +
+ " [pc: 781, pc: 1134] local: s196 index: 196 type: java.lang.String\n" +
+ " [pc: 785, pc: 1134] local: s197 index: 197 type: java.lang.String\n" +
+ " [pc: 789, pc: 1134] local: s198 index: 198 type: java.lang.String\n" +
+ " [pc: 793, pc: 1134] local: s199 index: 199 type: java.lang.String\n" +
+ " [pc: 797, pc: 1134] local: s200 index: 200 type: java.lang.String\n" +
+ " [pc: 801, pc: 1134] local: s201 index: 201 type: java.lang.String\n" +
+ " [pc: 805, pc: 1134] local: s202 index: 202 type: java.lang.String\n" +
+ " [pc: 809, pc: 1134] local: s203 index: 203 type: java.lang.String\n" +
+ " [pc: 813, pc: 1134] local: s204 index: 204 type: java.lang.String\n" +
+ " [pc: 817, pc: 1134] local: s205 index: 205 type: java.lang.String\n" +
+ " [pc: 821, pc: 1134] local: s206 index: 206 type: java.lang.String\n" +
+ " [pc: 825, pc: 1134] local: s207 index: 207 type: java.lang.String\n" +
+ " [pc: 829, pc: 1134] local: s208 index: 208 type: java.lang.String\n" +
+ " [pc: 833, pc: 1134] local: s209 index: 209 type: java.lang.String\n" +
+ " [pc: 837, pc: 1134] local: s210 index: 210 type: java.lang.String\n" +
+ " [pc: 841, pc: 1134] local: s211 index: 211 type: java.lang.String\n" +
+ " [pc: 845, pc: 1134] local: s212 index: 212 type: java.lang.String\n" +
+ " [pc: 849, pc: 1134] local: s213 index: 213 type: java.lang.String\n" +
+ " [pc: 853, pc: 1134] local: s214 index: 214 type: java.lang.String\n" +
+ " [pc: 857, pc: 1134] local: s215 index: 215 type: java.lang.String\n" +
+ " [pc: 861, pc: 1134] local: s216 index: 216 type: java.lang.String\n" +
+ " [pc: 865, pc: 1134] local: s217 index: 217 type: java.lang.String\n" +
+ " [pc: 869, pc: 1134] local: s218 index: 218 type: java.lang.String\n" +
+ " [pc: 873, pc: 1134] local: s219 index: 219 type: java.lang.String\n" +
+ " [pc: 877, pc: 1134] local: s220 index: 220 type: java.lang.String\n" +
+ " [pc: 881, pc: 1134] local: s221 index: 221 type: java.lang.String\n" +
+ " [pc: 885, pc: 1134] local: s222 index: 222 type: java.lang.String\n" +
+ " [pc: 889, pc: 1134] local: s223 index: 223 type: java.lang.String\n" +
+ " [pc: 893, pc: 1134] local: s224 index: 224 type: java.lang.String\n" +
+ " [pc: 897, pc: 1134] local: s225 index: 225 type: java.lang.String\n" +
+ " [pc: 901, pc: 1134] local: s226 index: 226 type: java.lang.String\n" +
+ " [pc: 905, pc: 1134] local: s227 index: 227 type: java.lang.String\n" +
+ " [pc: 909, pc: 1134] local: s228 index: 228 type: java.lang.String\n" +
+ " [pc: 913, pc: 1134] local: s229 index: 229 type: java.lang.String\n" +
+ " [pc: 917, pc: 1134] local: s230 index: 230 type: java.lang.String\n" +
+ " [pc: 921, pc: 1134] local: s231 index: 231 type: java.lang.String\n" +
+ " [pc: 925, pc: 1134] local: s232 index: 232 type: java.lang.String\n" +
+ " [pc: 929, pc: 1134] local: s233 index: 233 type: java.lang.String\n" +
+ " [pc: 933, pc: 1134] local: s234 index: 234 type: java.lang.String\n" +
+ " [pc: 937, pc: 1134] local: s235 index: 235 type: java.lang.String\n" +
+ " [pc: 941, pc: 1134] local: s236 index: 236 type: java.lang.String\n" +
+ " [pc: 945, pc: 1134] local: s237 index: 237 type: java.lang.String\n" +
+ " [pc: 949, pc: 1134] local: s238 index: 238 type: java.lang.String\n" +
+ " [pc: 953, pc: 1134] local: s239 index: 239 type: java.lang.String\n" +
+ " [pc: 957, pc: 1134] local: s240 index: 240 type: java.lang.String\n" +
+ " [pc: 961, pc: 1134] local: s241 index: 241 type: java.lang.String\n" +
+ " [pc: 965, pc: 1134] local: s242 index: 242 type: java.lang.String\n" +
+ " [pc: 969, pc: 1134] local: s243 index: 243 type: java.lang.String\n" +
+ " [pc: 973, pc: 1134] local: s244 index: 244 type: java.lang.String\n" +
+ " [pc: 977, pc: 1134] local: s245 index: 245 type: java.lang.String\n" +
+ " [pc: 981, pc: 1134] local: s246 index: 246 type: java.lang.String\n" +
+ " [pc: 985, pc: 1134] local: s247 index: 247 type: java.lang.String\n" +
+ " [pc: 989, pc: 1134] local: s248 index: 248 type: java.lang.String\n" +
+ " [pc: 993, pc: 1134] local: s249 index: 249 type: java.lang.String\n" +
+ " [pc: 997, pc: 1134] local: s250 index: 250 type: java.lang.String\n" +
+ " [pc: 1001, pc: 1134] local: s251 index: 251 type: java.lang.String\n" +
+ " [pc: 1005, pc: 1134] local: s252 index: 252 type: java.lang.String\n" +
+ " [pc: 1008, pc: 1134] local: size1 index: 253 type: int\n" +
+ " [pc: 1011, pc: 1134] local: size2 index: 254 type: int\n" +
+ " [pc: 1014, pc: 1134] local: size3 index: 255 type: int\n" +
+ " [pc: 1028, pc: 1134] local: intArray index: 256 type: int[][][]\n" +
+ " [pc: 1033, pc: 1133] local: i index: 257 type: int\n" +
+ " [pc: 1041, pc: 1118] local: j index: 258 type: int\n" +
+ " [pc: 1049, pc: 1103] local: on index: 259 type: boolean\n" +
" [pc: 1054, pc: 1103] local: k index: 260 type: int\n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -1229,57 +1229,57 @@ public void test007() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public final class X {\n" +
- "\n" +
- " public void show() {\n" +
- " String s1 = \"\"; String s2 = \"\"; String s3 = \"\"; String s4 = \"\"; String s5 = \"\"; String s6 = \"\"; String s7 = \"\"; String s8 = \"\"; String s9 = \"\"; String s10 = \"\";\n" +
- " String s11 = \"\"; String s12 = \"\"; String s13 = \"\"; String s14 = \"\"; String s15 = \"\"; String s16 = \"\"; String s17 = \"\"; String s18 = \"\"; String s19 = \"\"; String s20 = \"\";\n" +
- " String s21 = \"\"; String s22 = \"\"; String s23 = \"\"; String s24 = \"\"; String s25 = \"\"; String s26 = \"\"; String s27 = \"\"; String s28 = \"\"; String s29 = \"\"; String s30 = \"\";\n" +
- " String s31 = \"\"; String s32 = \"\"; String s33 = \"\"; String s34 = \"\"; String s35 = \"\"; String s36 = \"\"; String s37 = \"\"; String s38 = \"\"; String s39 = \"\"; String s40 = \"\";\n" +
- " String s41 = \"\"; String s42 = \"\"; String s43 = \"\"; String s44 = \"\"; String s45 = \"\"; String s46 = \"\"; String s47 = \"\"; String s48 = \"\"; String s49 = \"\"; String s50 = \"\";\n" +
- " String s51 = \"\"; String s52 = \"\"; String s53 = \"\"; String s54 = \"\"; String s55 = \"\"; String s56 = \"\"; String s57 = \"\"; String s58 = \"\"; String s59 = \"\"; String s60 = \"\";\n" +
- " String s61 = \"\"; String s62 = \"\"; String s63 = \"\"; String s64 = \"\"; String s65 = \"\"; String s66 = \"\"; String s67 = \"\"; String s68 = \"\"; String s69 = \"\"; String s70 = \"\";\n" +
- " String s71 = \"\"; String s72 = \"\"; String s73 = \"\"; String s74 = \"\"; String s75 = \"\"; String s76 = \"\"; String s77 = \"\"; String s78 = \"\"; String s79 = \"\"; String s80 = \"\";\n" +
- " String s81 = \"\"; String s82 = \"\"; String s83 = \"\"; String s84 = \"\"; String s85 = \"\"; String s86 = \"\"; String s87 = \"\"; String s88 = \"\"; String s89 = \"\"; String s90 = \"\";\n" +
- " String s91 = \"\"; String s92 = \"\"; String s93 = \"\"; String s94 = \"\"; String s95 = \"\"; String s96 = \"\"; String s97 = \"\"; String s98 = \"\"; String s99 = \"\"; String s100 = \"\";\n" +
- " String s101 = \"\"; String s102 = \"\"; String s103 = \"\"; String s104 = \"\"; String s105 = \"\"; String s106 = \"\"; String s107 = \"\"; String s108 = \"\"; String s109 = \"\"; String s110 = \"\";\n" +
- " String s111 = \"\"; String s112 = \"\"; String s113 = \"\"; String s114 = \"\"; String s115 = \"\"; String s116 = \"\"; String s117 = \"\"; String s118 = \"\"; String s119 = \"\"; String s120 = \"\";\n" +
- " String s121 = \"\"; String s122 = \"\"; String s123 = \"\"; String s124 = \"\"; String s125 = \"\"; String s126 = \"\"; String s127 = \"\"; String s128 = \"\"; String s129 = \"\"; String s130 = \"\";\n" +
- " String s131 = \"\"; String s132 = \"\"; String s133 = \"\"; String s134 = \"\"; String s135 = \"\"; String s136 = \"\"; String s137 = \"\"; String s138 = \"\"; String s139 = \"\"; String s140 = \"\";\n" +
- " String s141 = \"\"; String s142 = \"\"; String s143 = \"\"; String s144 = \"\"; String s145 = \"\"; String s146 = \"\"; String s147 = \"\"; String s148 = \"\"; String s149 = \"\"; String s150 = \"\";\n" +
- " String s151 = \"\"; String s152 = \"\"; String s153 = \"\"; String s154 = \"\"; String s155 = \"\"; String s156 = \"\"; String s157 = \"\"; String s158 = \"\"; String s159 = \"\"; String s160 = \"\";\n" +
- " String s161 = \"\"; String s162 = \"\"; String s163 = \"\"; String s164 = \"\"; String s165 = \"\"; String s166 = \"\"; String s167 = \"\"; String s168 = \"\"; String s169 = \"\"; String s170 = \"\";\n" +
- " String s171 = \"\"; String s172 = \"\"; String s173 = \"\"; String s174 = \"\"; String s175 = \"\"; String s176 = \"\"; String s177 = \"\"; String s178 = \"\"; String s179 = \"\"; String s180 = \"\";\n" +
- " String s181 = \"\"; String s182 = \"\"; String s183 = \"\"; String s184 = \"\"; String s185 = \"\"; String s186 = \"\"; String s187 = \"\"; String s188 = \"\"; String s189 = \"\"; String s190 = \"\";\n" +
- " String s191 = \"\"; String s192 = \"\"; String s193 = \"\"; String s194 = \"\"; String s195 = \"\"; String s196 = \"\"; String s197 = \"\"; String s198 = \"\"; String s199 = \"\"; String s200 = \"\";\n" +
- " String s201 = \"\"; String s202 = \"\"; String s203 = \"\"; String s204 = \"\"; String s205 = \"\"; String s206 = \"\"; String s207 = \"\"; String s208 = \"\"; String s209 = \"\"; String s210 = \"\";\n" +
- " String s211 = \"\"; String s212 = \"\"; String s213 = \"\"; String s214 = \"\"; String s215 = \"\"; String s216 = \"\"; String s217 = \"\"; String s218 = \"\"; String s219 = \"\"; String s220 = \"\";\n" +
- " String s221 = \"\"; String s222 = \"\"; String s223 = \"\"; String s224 = \"\"; String s225 = \"\"; String s226 = \"\"; String s227 = \"\"; String s228 = \"\"; String s229 = \"\"; String s230 = \"\";\n" +
- " String s231 = \"\"; String s232 = \"\"; String s233 = \"\"; String s234 = \"\"; String s235 = \"\"; String s236 = \"\"; String s237 = \"\"; String s238 = \"\"; String s239 = \"\"; String s240 = \"\";\n" +
- " String s241 = \"\"; String s242 = \"\"; String s243 = \"\"; String s244 = \"\"; String s245 = \"\"; String s246 = \"\"; String s247 = \"\"; String s248 = \"\"; String s249 = \"\"; String s250 = \"\";\n" +
- " String s251 = \"\"; String s252 = \"\";\n" +
- "\n" +
- " int size1 = 1;\n" +
- " int size2 = 2;\n" +
- " int size3 = 3;\n" +
- "\n" +
- " int[][][] intArray = new int[size1][size2][];\n" +
- " \n" +
- " for (int i = 0; i < size1; i++) {\n" +
- " for (int j = 0; j < size2; j++) {\n" +
- " boolean on = false;\n" +
- " intArray[i][j] = new int[size3];\n" +
- " for (int k = 0; k < size3; k++) {\n" +
- " intArray[i][j][k] = on ? 0 : 1;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " new X().show();\n" +
- " }\n" +
+ "public final class X {\n" +
+ "\n" +
+ " public void show() {\n" +
+ " String s1 = \"\"; String s2 = \"\"; String s3 = \"\"; String s4 = \"\"; String s5 = \"\"; String s6 = \"\"; String s7 = \"\"; String s8 = \"\"; String s9 = \"\"; String s10 = \"\";\n" +
+ " String s11 = \"\"; String s12 = \"\"; String s13 = \"\"; String s14 = \"\"; String s15 = \"\"; String s16 = \"\"; String s17 = \"\"; String s18 = \"\"; String s19 = \"\"; String s20 = \"\";\n" +
+ " String s21 = \"\"; String s22 = \"\"; String s23 = \"\"; String s24 = \"\"; String s25 = \"\"; String s26 = \"\"; String s27 = \"\"; String s28 = \"\"; String s29 = \"\"; String s30 = \"\";\n" +
+ " String s31 = \"\"; String s32 = \"\"; String s33 = \"\"; String s34 = \"\"; String s35 = \"\"; String s36 = \"\"; String s37 = \"\"; String s38 = \"\"; String s39 = \"\"; String s40 = \"\";\n" +
+ " String s41 = \"\"; String s42 = \"\"; String s43 = \"\"; String s44 = \"\"; String s45 = \"\"; String s46 = \"\"; String s47 = \"\"; String s48 = \"\"; String s49 = \"\"; String s50 = \"\";\n" +
+ " String s51 = \"\"; String s52 = \"\"; String s53 = \"\"; String s54 = \"\"; String s55 = \"\"; String s56 = \"\"; String s57 = \"\"; String s58 = \"\"; String s59 = \"\"; String s60 = \"\";\n" +
+ " String s61 = \"\"; String s62 = \"\"; String s63 = \"\"; String s64 = \"\"; String s65 = \"\"; String s66 = \"\"; String s67 = \"\"; String s68 = \"\"; String s69 = \"\"; String s70 = \"\";\n" +
+ " String s71 = \"\"; String s72 = \"\"; String s73 = \"\"; String s74 = \"\"; String s75 = \"\"; String s76 = \"\"; String s77 = \"\"; String s78 = \"\"; String s79 = \"\"; String s80 = \"\";\n" +
+ " String s81 = \"\"; String s82 = \"\"; String s83 = \"\"; String s84 = \"\"; String s85 = \"\"; String s86 = \"\"; String s87 = \"\"; String s88 = \"\"; String s89 = \"\"; String s90 = \"\";\n" +
+ " String s91 = \"\"; String s92 = \"\"; String s93 = \"\"; String s94 = \"\"; String s95 = \"\"; String s96 = \"\"; String s97 = \"\"; String s98 = \"\"; String s99 = \"\"; String s100 = \"\";\n" +
+ " String s101 = \"\"; String s102 = \"\"; String s103 = \"\"; String s104 = \"\"; String s105 = \"\"; String s106 = \"\"; String s107 = \"\"; String s108 = \"\"; String s109 = \"\"; String s110 = \"\";\n" +
+ " String s111 = \"\"; String s112 = \"\"; String s113 = \"\"; String s114 = \"\"; String s115 = \"\"; String s116 = \"\"; String s117 = \"\"; String s118 = \"\"; String s119 = \"\"; String s120 = \"\";\n" +
+ " String s121 = \"\"; String s122 = \"\"; String s123 = \"\"; String s124 = \"\"; String s125 = \"\"; String s126 = \"\"; String s127 = \"\"; String s128 = \"\"; String s129 = \"\"; String s130 = \"\";\n" +
+ " String s131 = \"\"; String s132 = \"\"; String s133 = \"\"; String s134 = \"\"; String s135 = \"\"; String s136 = \"\"; String s137 = \"\"; String s138 = \"\"; String s139 = \"\"; String s140 = \"\";\n" +
+ " String s141 = \"\"; String s142 = \"\"; String s143 = \"\"; String s144 = \"\"; String s145 = \"\"; String s146 = \"\"; String s147 = \"\"; String s148 = \"\"; String s149 = \"\"; String s150 = \"\";\n" +
+ " String s151 = \"\"; String s152 = \"\"; String s153 = \"\"; String s154 = \"\"; String s155 = \"\"; String s156 = \"\"; String s157 = \"\"; String s158 = \"\"; String s159 = \"\"; String s160 = \"\";\n" +
+ " String s161 = \"\"; String s162 = \"\"; String s163 = \"\"; String s164 = \"\"; String s165 = \"\"; String s166 = \"\"; String s167 = \"\"; String s168 = \"\"; String s169 = \"\"; String s170 = \"\";\n" +
+ " String s171 = \"\"; String s172 = \"\"; String s173 = \"\"; String s174 = \"\"; String s175 = \"\"; String s176 = \"\"; String s177 = \"\"; String s178 = \"\"; String s179 = \"\"; String s180 = \"\";\n" +
+ " String s181 = \"\"; String s182 = \"\"; String s183 = \"\"; String s184 = \"\"; String s185 = \"\"; String s186 = \"\"; String s187 = \"\"; String s188 = \"\"; String s189 = \"\"; String s190 = \"\";\n" +
+ " String s191 = \"\"; String s192 = \"\"; String s193 = \"\"; String s194 = \"\"; String s195 = \"\"; String s196 = \"\"; String s197 = \"\"; String s198 = \"\"; String s199 = \"\"; String s200 = \"\";\n" +
+ " String s201 = \"\"; String s202 = \"\"; String s203 = \"\"; String s204 = \"\"; String s205 = \"\"; String s206 = \"\"; String s207 = \"\"; String s208 = \"\"; String s209 = \"\"; String s210 = \"\";\n" +
+ " String s211 = \"\"; String s212 = \"\"; String s213 = \"\"; String s214 = \"\"; String s215 = \"\"; String s216 = \"\"; String s217 = \"\"; String s218 = \"\"; String s219 = \"\"; String s220 = \"\";\n" +
+ " String s221 = \"\"; String s222 = \"\"; String s223 = \"\"; String s224 = \"\"; String s225 = \"\"; String s226 = \"\"; String s227 = \"\"; String s228 = \"\"; String s229 = \"\"; String s230 = \"\";\n" +
+ " String s231 = \"\"; String s232 = \"\"; String s233 = \"\"; String s234 = \"\"; String s235 = \"\"; String s236 = \"\"; String s237 = \"\"; String s238 = \"\"; String s239 = \"\"; String s240 = \"\";\n" +
+ " String s241 = \"\"; String s242 = \"\"; String s243 = \"\"; String s244 = \"\"; String s245 = \"\"; String s246 = \"\"; String s247 = \"\"; String s248 = \"\"; String s249 = \"\"; String s250 = \"\";\n" +
+ " String s251 = \"\"; String s252 = \"\";\n" +
+ "\n" +
+ " int size1 = 1;\n" +
+ " int size2 = 2;\n" +
+ " int size3 = 3;\n" +
+ "\n" +
+ " int[][][] intArray = new int[size1][size2][];\n" +
+ " \n" +
+ " for (int i = 0; i < size1; i++) {\n" +
+ " for (int j = 0; j < size2; j++) {\n" +
+ " boolean on = false;\n" +
+ " intArray[i][j] = new int[size3];\n" +
+ " for (int k = 0; k < size3; k++) {\n" +
+ " intArray[i][j][k] = on ? 0 : 1;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().show();\n" +
+ " }\n" +
"}",
},
"",
@@ -1292,56 +1292,56 @@ public void test008() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public final class X {\n" +
- "\n" +
- " public void show() {\n" +
- " String s1 = \"\"; String s2 = \"\"; String s3 = \"\"; String s4 = \"\"; String s5 = \"\"; String s6 = \"\"; String s7 = \"\"; String s8 = \"\"; String s9 = \"\"; String s10 = \"\";\n" +
- " String s11 = \"\"; String s12 = \"\"; String s13 = \"\"; String s14 = \"\"; String s15 = \"\"; String s16 = \"\"; String s17 = \"\"; String s18 = \"\"; String s19 = \"\"; String s20 = \"\";\n" +
- " String s21 = \"\"; String s22 = \"\"; String s23 = \"\"; String s24 = \"\"; String s25 = \"\"; String s26 = \"\"; String s27 = \"\"; String s28 = \"\"; String s29 = \"\"; String s30 = \"\";\n" +
- " String s31 = \"\"; String s32 = \"\"; String s33 = \"\"; String s34 = \"\"; String s35 = \"\"; String s36 = \"\"; String s37 = \"\"; String s38 = \"\"; String s39 = \"\"; String s40 = \"\";\n" +
- " String s41 = \"\"; String s42 = \"\"; String s43 = \"\"; String s44 = \"\"; String s45 = \"\"; String s46 = \"\"; String s47 = \"\"; String s48 = \"\"; String s49 = \"\"; String s50 = \"\";\n" +
- " String s51 = \"\"; String s52 = \"\"; String s53 = \"\"; String s54 = \"\"; String s55 = \"\"; String s56 = \"\"; String s57 = \"\"; String s58 = \"\"; String s59 = \"\"; String s60 = \"\";\n" +
- " String s61 = \"\"; String s62 = \"\"; String s63 = \"\"; String s64 = \"\"; String s65 = \"\"; String s66 = \"\"; String s67 = \"\"; String s68 = \"\"; String s69 = \"\"; String s70 = \"\";\n" +
- " String s71 = \"\"; String s72 = \"\"; String s73 = \"\"; String s74 = \"\"; String s75 = \"\"; String s76 = \"\"; String s77 = \"\"; String s78 = \"\"; String s79 = \"\"; String s80 = \"\";\n" +
- " String s81 = \"\"; String s82 = \"\"; String s83 = \"\"; String s84 = \"\"; String s85 = \"\"; String s86 = \"\"; String s87 = \"\"; String s88 = \"\"; String s89 = \"\"; String s90 = \"\";\n" +
- " String s91 = \"\"; String s92 = \"\"; String s93 = \"\"; String s94 = \"\"; String s95 = \"\"; String s96 = \"\"; String s97 = \"\"; String s98 = \"\"; String s99 = \"\"; String s100 = \"\";\n" +
- " String s101 = \"\"; String s102 = \"\"; String s103 = \"\"; String s104 = \"\"; String s105 = \"\"; String s106 = \"\"; String s107 = \"\"; String s108 = \"\"; String s109 = \"\"; String s110 = \"\";\n" +
- " String s111 = \"\"; String s112 = \"\"; String s113 = \"\"; String s114 = \"\"; String s115 = \"\"; String s116 = \"\"; String s117 = \"\"; String s118 = \"\"; String s119 = \"\"; String s120 = \"\";\n" +
- " String s121 = \"\"; String s122 = \"\"; String s123 = \"\"; String s124 = \"\"; String s125 = \"\"; String s126 = \"\"; String s127 = \"\"; String s128 = \"\"; String s129 = \"\"; String s130 = \"\";\n" +
- " String s131 = \"\"; String s132 = \"\"; String s133 = \"\"; String s134 = \"\"; String s135 = \"\"; String s136 = \"\"; String s137 = \"\"; String s138 = \"\"; String s139 = \"\"; String s140 = \"\";\n" +
- " String s141 = \"\"; String s142 = \"\"; String s143 = \"\"; String s144 = \"\"; String s145 = \"\"; String s146 = \"\"; String s147 = \"\"; String s148 = \"\"; String s149 = \"\"; String s150 = \"\";\n" +
- " String s151 = \"\"; String s152 = \"\"; String s153 = \"\"; String s154 = \"\"; String s155 = \"\"; String s156 = \"\"; String s157 = \"\"; String s158 = \"\"; String s159 = \"\"; String s160 = \"\";\n" +
- " String s161 = \"\"; String s162 = \"\"; String s163 = \"\"; String s164 = \"\"; String s165 = \"\"; String s166 = \"\"; String s167 = \"\"; String s168 = \"\"; String s169 = \"\"; String s170 = \"\";\n" +
- " String s171 = \"\"; String s172 = \"\"; String s173 = \"\"; String s174 = \"\"; String s175 = \"\"; String s176 = \"\"; String s177 = \"\"; String s178 = \"\"; String s179 = \"\"; String s180 = \"\";\n" +
- " String s181 = \"\"; String s182 = \"\"; String s183 = \"\"; String s184 = \"\"; String s185 = \"\"; String s186 = \"\"; String s187 = \"\"; String s188 = \"\"; String s189 = \"\"; String s190 = \"\";\n" +
- " String s191 = \"\"; String s192 = \"\"; String s193 = \"\"; String s194 = \"\"; String s195 = \"\"; String s196 = \"\"; String s197 = \"\"; String s198 = \"\"; String s199 = \"\"; String s200 = \"\";\n" +
- " String s201 = \"\"; String s202 = \"\"; String s203 = \"\"; String s204 = \"\"; String s205 = \"\"; String s206 = \"\"; String s207 = \"\"; String s208 = \"\"; String s209 = \"\"; String s210 = \"\";\n" +
- " String s211 = \"\"; String s212 = \"\"; String s213 = \"\"; String s214 = \"\"; String s215 = \"\"; String s216 = \"\"; String s217 = \"\"; String s218 = \"\"; String s219 = \"\"; String s220 = \"\";\n" +
- " String s221 = \"\"; String s222 = \"\"; String s223 = \"\"; String s224 = \"\"; String s225 = \"\"; String s226 = \"\"; String s227 = \"\"; String s228 = \"\"; String s229 = \"\"; String s230 = \"\";\n" +
- " String s231 = \"\"; String s232 = \"\"; String s233 = \"\"; String s234 = \"\"; String s235 = \"\"; String s236 = \"\"; String s237 = \"\"; String s238 = \"\"; String s239 = \"\"; String s240 = \"\";\n" +
- " String s241 = \"\"; String s242 = \"\"; String s243 = \"\"; String s244 = \"\"; String s245 = \"\"; String s246 = \"\"; String s247 = \"\"; String s248 = \"\"; String s249 = \"\"; String s250 = \"\";\n" +
- " String s251 = \"\"; String s252 = \"\";\n" +
- "\n" +
- " int size1 = 1;\n" +
- " int size2 = 2;\n" +
- " int size3 = 3;\n" +
- "\n" +
- " String[][][] array = new String[size1][size2][size3];\n" +
- " \n" +
- " for (int i = 0; i < size1; i++) {\n" +
- " for (int j = 0; j < size2; j++) {\n" +
- " boolean on = false;\n" +
- " for (int k = 0; k < size3; k++) {\n" +
- " array[i][j][k] = on ? \"true\" : \"false\";\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " new X().show();\n" +
- " }\n" +
+ "public final class X {\n" +
+ "\n" +
+ " public void show() {\n" +
+ " String s1 = \"\"; String s2 = \"\"; String s3 = \"\"; String s4 = \"\"; String s5 = \"\"; String s6 = \"\"; String s7 = \"\"; String s8 = \"\"; String s9 = \"\"; String s10 = \"\";\n" +
+ " String s11 = \"\"; String s12 = \"\"; String s13 = \"\"; String s14 = \"\"; String s15 = \"\"; String s16 = \"\"; String s17 = \"\"; String s18 = \"\"; String s19 = \"\"; String s20 = \"\";\n" +
+ " String s21 = \"\"; String s22 = \"\"; String s23 = \"\"; String s24 = \"\"; String s25 = \"\"; String s26 = \"\"; String s27 = \"\"; String s28 = \"\"; String s29 = \"\"; String s30 = \"\";\n" +
+ " String s31 = \"\"; String s32 = \"\"; String s33 = \"\"; String s34 = \"\"; String s35 = \"\"; String s36 = \"\"; String s37 = \"\"; String s38 = \"\"; String s39 = \"\"; String s40 = \"\";\n" +
+ " String s41 = \"\"; String s42 = \"\"; String s43 = \"\"; String s44 = \"\"; String s45 = \"\"; String s46 = \"\"; String s47 = \"\"; String s48 = \"\"; String s49 = \"\"; String s50 = \"\";\n" +
+ " String s51 = \"\"; String s52 = \"\"; String s53 = \"\"; String s54 = \"\"; String s55 = \"\"; String s56 = \"\"; String s57 = \"\"; String s58 = \"\"; String s59 = \"\"; String s60 = \"\";\n" +
+ " String s61 = \"\"; String s62 = \"\"; String s63 = \"\"; String s64 = \"\"; String s65 = \"\"; String s66 = \"\"; String s67 = \"\"; String s68 = \"\"; String s69 = \"\"; String s70 = \"\";\n" +
+ " String s71 = \"\"; String s72 = \"\"; String s73 = \"\"; String s74 = \"\"; String s75 = \"\"; String s76 = \"\"; String s77 = \"\"; String s78 = \"\"; String s79 = \"\"; String s80 = \"\";\n" +
+ " String s81 = \"\"; String s82 = \"\"; String s83 = \"\"; String s84 = \"\"; String s85 = \"\"; String s86 = \"\"; String s87 = \"\"; String s88 = \"\"; String s89 = \"\"; String s90 = \"\";\n" +
+ " String s91 = \"\"; String s92 = \"\"; String s93 = \"\"; String s94 = \"\"; String s95 = \"\"; String s96 = \"\"; String s97 = \"\"; String s98 = \"\"; String s99 = \"\"; String s100 = \"\";\n" +
+ " String s101 = \"\"; String s102 = \"\"; String s103 = \"\"; String s104 = \"\"; String s105 = \"\"; String s106 = \"\"; String s107 = \"\"; String s108 = \"\"; String s109 = \"\"; String s110 = \"\";\n" +
+ " String s111 = \"\"; String s112 = \"\"; String s113 = \"\"; String s114 = \"\"; String s115 = \"\"; String s116 = \"\"; String s117 = \"\"; String s118 = \"\"; String s119 = \"\"; String s120 = \"\";\n" +
+ " String s121 = \"\"; String s122 = \"\"; String s123 = \"\"; String s124 = \"\"; String s125 = \"\"; String s126 = \"\"; String s127 = \"\"; String s128 = \"\"; String s129 = \"\"; String s130 = \"\";\n" +
+ " String s131 = \"\"; String s132 = \"\"; String s133 = \"\"; String s134 = \"\"; String s135 = \"\"; String s136 = \"\"; String s137 = \"\"; String s138 = \"\"; String s139 = \"\"; String s140 = \"\";\n" +
+ " String s141 = \"\"; String s142 = \"\"; String s143 = \"\"; String s144 = \"\"; String s145 = \"\"; String s146 = \"\"; String s147 = \"\"; String s148 = \"\"; String s149 = \"\"; String s150 = \"\";\n" +
+ " String s151 = \"\"; String s152 = \"\"; String s153 = \"\"; String s154 = \"\"; String s155 = \"\"; String s156 = \"\"; String s157 = \"\"; String s158 = \"\"; String s159 = \"\"; String s160 = \"\";\n" +
+ " String s161 = \"\"; String s162 = \"\"; String s163 = \"\"; String s164 = \"\"; String s165 = \"\"; String s166 = \"\"; String s167 = \"\"; String s168 = \"\"; String s169 = \"\"; String s170 = \"\";\n" +
+ " String s171 = \"\"; String s172 = \"\"; String s173 = \"\"; String s174 = \"\"; String s175 = \"\"; String s176 = \"\"; String s177 = \"\"; String s178 = \"\"; String s179 = \"\"; String s180 = \"\";\n" +
+ " String s181 = \"\"; String s182 = \"\"; String s183 = \"\"; String s184 = \"\"; String s185 = \"\"; String s186 = \"\"; String s187 = \"\"; String s188 = \"\"; String s189 = \"\"; String s190 = \"\";\n" +
+ " String s191 = \"\"; String s192 = \"\"; String s193 = \"\"; String s194 = \"\"; String s195 = \"\"; String s196 = \"\"; String s197 = \"\"; String s198 = \"\"; String s199 = \"\"; String s200 = \"\";\n" +
+ " String s201 = \"\"; String s202 = \"\"; String s203 = \"\"; String s204 = \"\"; String s205 = \"\"; String s206 = \"\"; String s207 = \"\"; String s208 = \"\"; String s209 = \"\"; String s210 = \"\";\n" +
+ " String s211 = \"\"; String s212 = \"\"; String s213 = \"\"; String s214 = \"\"; String s215 = \"\"; String s216 = \"\"; String s217 = \"\"; String s218 = \"\"; String s219 = \"\"; String s220 = \"\";\n" +
+ " String s221 = \"\"; String s222 = \"\"; String s223 = \"\"; String s224 = \"\"; String s225 = \"\"; String s226 = \"\"; String s227 = \"\"; String s228 = \"\"; String s229 = \"\"; String s230 = \"\";\n" +
+ " String s231 = \"\"; String s232 = \"\"; String s233 = \"\"; String s234 = \"\"; String s235 = \"\"; String s236 = \"\"; String s237 = \"\"; String s238 = \"\"; String s239 = \"\"; String s240 = \"\";\n" +
+ " String s241 = \"\"; String s242 = \"\"; String s243 = \"\"; String s244 = \"\"; String s245 = \"\"; String s246 = \"\"; String s247 = \"\"; String s248 = \"\"; String s249 = \"\"; String s250 = \"\";\n" +
+ " String s251 = \"\"; String s252 = \"\";\n" +
+ "\n" +
+ " int size1 = 1;\n" +
+ " int size2 = 2;\n" +
+ " int size3 = 3;\n" +
+ "\n" +
+ " String[][][] array = new String[size1][size2][size3];\n" +
+ " \n" +
+ " for (int i = 0; i < size1; i++) {\n" +
+ " for (int j = 0; j < size2; j++) {\n" +
+ " boolean on = false;\n" +
+ " for (int k = 0; k < size3; k++) {\n" +
+ " array[i][j][k] = on ? \"true\" : \"false\";\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().show();\n" +
+ " }\n" +
"}",
},
"",
@@ -1354,56 +1354,56 @@ public void test009() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public final class X {\n" +
- "\n" +
- " public void show() {\n" +
- " String s1 = \"\"; String s2 = \"\"; String s3 = \"\"; String s4 = \"\"; String s5 = \"\"; String s6 = \"\"; String s7 = \"\"; String s8 = \"\"; String s9 = \"\"; String s10 = \"\";\n" +
- " String s11 = \"\"; String s12 = \"\"; String s13 = \"\"; String s14 = \"\"; String s15 = \"\"; String s16 = \"\"; String s17 = \"\"; String s18 = \"\"; String s19 = \"\"; String s20 = \"\";\n" +
- " String s21 = \"\"; String s22 = \"\"; String s23 = \"\"; String s24 = \"\"; String s25 = \"\"; String s26 = \"\"; String s27 = \"\"; String s28 = \"\"; String s29 = \"\"; String s30 = \"\";\n" +
- " String s31 = \"\"; String s32 = \"\"; String s33 = \"\"; String s34 = \"\"; String s35 = \"\"; String s36 = \"\"; String s37 = \"\"; String s38 = \"\"; String s39 = \"\"; String s40 = \"\";\n" +
- " String s41 = \"\"; String s42 = \"\"; String s43 = \"\"; String s44 = \"\"; String s45 = \"\"; String s46 = \"\"; String s47 = \"\"; String s48 = \"\"; String s49 = \"\"; String s50 = \"\";\n" +
- " String s51 = \"\"; String s52 = \"\"; String s53 = \"\"; String s54 = \"\"; String s55 = \"\"; String s56 = \"\"; String s57 = \"\"; String s58 = \"\"; String s59 = \"\"; String s60 = \"\";\n" +
- " String s61 = \"\"; String s62 = \"\"; String s63 = \"\"; String s64 = \"\"; String s65 = \"\"; String s66 = \"\"; String s67 = \"\"; String s68 = \"\"; String s69 = \"\"; String s70 = \"\";\n" +
- " String s71 = \"\"; String s72 = \"\"; String s73 = \"\"; String s74 = \"\"; String s75 = \"\"; String s76 = \"\"; String s77 = \"\"; String s78 = \"\"; String s79 = \"\"; String s80 = \"\";\n" +
- " String s81 = \"\"; String s82 = \"\"; String s83 = \"\"; String s84 = \"\"; String s85 = \"\"; String s86 = \"\"; String s87 = \"\"; String s88 = \"\"; String s89 = \"\"; String s90 = \"\";\n" +
- " String s91 = \"\"; String s92 = \"\"; String s93 = \"\"; String s94 = \"\"; String s95 = \"\"; String s96 = \"\"; String s97 = \"\"; String s98 = \"\"; String s99 = \"\"; String s100 = \"\";\n" +
- " String s101 = \"\"; String s102 = \"\"; String s103 = \"\"; String s104 = \"\"; String s105 = \"\"; String s106 = \"\"; String s107 = \"\"; String s108 = \"\"; String s109 = \"\"; String s110 = \"\";\n" +
- " String s111 = \"\"; String s112 = \"\"; String s113 = \"\"; String s114 = \"\"; String s115 = \"\"; String s116 = \"\"; String s117 = \"\"; String s118 = \"\"; String s119 = \"\"; String s120 = \"\";\n" +
- " String s121 = \"\"; String s122 = \"\"; String s123 = \"\"; String s124 = \"\"; String s125 = \"\"; String s126 = \"\"; String s127 = \"\"; String s128 = \"\"; String s129 = \"\"; String s130 = \"\";\n" +
- " String s131 = \"\"; String s132 = \"\"; String s133 = \"\"; String s134 = \"\"; String s135 = \"\"; String s136 = \"\"; String s137 = \"\"; String s138 = \"\"; String s139 = \"\"; String s140 = \"\";\n" +
- " String s141 = \"\"; String s142 = \"\"; String s143 = \"\"; String s144 = \"\"; String s145 = \"\"; String s146 = \"\"; String s147 = \"\"; String s148 = \"\"; String s149 = \"\"; String s150 = \"\";\n" +
- " String s151 = \"\"; String s152 = \"\"; String s153 = \"\"; String s154 = \"\"; String s155 = \"\"; String s156 = \"\"; String s157 = \"\"; String s158 = \"\"; String s159 = \"\"; String s160 = \"\";\n" +
- " String s161 = \"\"; String s162 = \"\"; String s163 = \"\"; String s164 = \"\"; String s165 = \"\"; String s166 = \"\"; String s167 = \"\"; String s168 = \"\"; String s169 = \"\"; String s170 = \"\";\n" +
- " String s171 = \"\"; String s172 = \"\"; String s173 = \"\"; String s174 = \"\"; String s175 = \"\"; String s176 = \"\"; String s177 = \"\"; String s178 = \"\"; String s179 = \"\"; String s180 = \"\";\n" +
- " String s181 = \"\"; String s182 = \"\"; String s183 = \"\"; String s184 = \"\"; String s185 = \"\"; String s186 = \"\"; String s187 = \"\"; String s188 = \"\"; String s189 = \"\"; String s190 = \"\";\n" +
- " String s191 = \"\"; String s192 = \"\"; String s193 = \"\"; String s194 = \"\"; String s195 = \"\"; String s196 = \"\"; String s197 = \"\"; String s198 = \"\"; String s199 = \"\"; String s200 = \"\";\n" +
- " String s201 = \"\"; String s202 = \"\"; String s203 = \"\"; String s204 = \"\"; String s205 = \"\"; String s206 = \"\"; String s207 = \"\"; String s208 = \"\"; String s209 = \"\"; String s210 = \"\";\n" +
- " String s211 = \"\"; String s212 = \"\"; String s213 = \"\"; String s214 = \"\"; String s215 = \"\"; String s216 = \"\"; String s217 = \"\"; String s218 = \"\"; String s219 = \"\"; String s220 = \"\";\n" +
- " String s221 = \"\"; String s222 = \"\"; String s223 = \"\"; String s224 = \"\"; String s225 = \"\"; String s226 = \"\"; String s227 = \"\"; String s228 = \"\"; String s229 = \"\"; String s230 = \"\";\n" +
- " String s231 = \"\"; String s232 = \"\"; String s233 = \"\"; String s234 = \"\"; String s235 = \"\"; String s236 = \"\"; String s237 = \"\"; String s238 = \"\"; String s239 = \"\"; String s240 = \"\";\n" +
- " String s241 = \"\"; String s242 = \"\"; String s243 = \"\"; String s244 = \"\"; String s245 = \"\"; String s246 = \"\"; String s247 = \"\"; String s248 = \"\"; String s249 = \"\"; String s250 = \"\";\n" +
- " String s251 = \"\"; String s252 = \"\";\n" +
- "\n" +
- " int size1 = 1;\n" +
- " int size2 = 2;\n" +
- " int size3 = 3;\n" +
- "\n" +
- " boolean[][][] array = new boolean[size1][size2][size3];\n" +
- " \n" +
- " for (int i = 0; i < size1; i++) {\n" +
- " for (int j = 0; j < size2; j++) {\n" +
- " boolean on = false;\n" +
- " for (int k = 0; k < size3; k++) {\n" +
- " array[i][j][k] = on ? true : false;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " new X().show();\n" +
- " }\n" +
+ "public final class X {\n" +
+ "\n" +
+ " public void show() {\n" +
+ " String s1 = \"\"; String s2 = \"\"; String s3 = \"\"; String s4 = \"\"; String s5 = \"\"; String s6 = \"\"; String s7 = \"\"; String s8 = \"\"; String s9 = \"\"; String s10 = \"\";\n" +
+ " String s11 = \"\"; String s12 = \"\"; String s13 = \"\"; String s14 = \"\"; String s15 = \"\"; String s16 = \"\"; String s17 = \"\"; String s18 = \"\"; String s19 = \"\"; String s20 = \"\";\n" +
+ " String s21 = \"\"; String s22 = \"\"; String s23 = \"\"; String s24 = \"\"; String s25 = \"\"; String s26 = \"\"; String s27 = \"\"; String s28 = \"\"; String s29 = \"\"; String s30 = \"\";\n" +
+ " String s31 = \"\"; String s32 = \"\"; String s33 = \"\"; String s34 = \"\"; String s35 = \"\"; String s36 = \"\"; String s37 = \"\"; String s38 = \"\"; String s39 = \"\"; String s40 = \"\";\n" +
+ " String s41 = \"\"; String s42 = \"\"; String s43 = \"\"; String s44 = \"\"; String s45 = \"\"; String s46 = \"\"; String s47 = \"\"; String s48 = \"\"; String s49 = \"\"; String s50 = \"\";\n" +
+ " String s51 = \"\"; String s52 = \"\"; String s53 = \"\"; String s54 = \"\"; String s55 = \"\"; String s56 = \"\"; String s57 = \"\"; String s58 = \"\"; String s59 = \"\"; String s60 = \"\";\n" +
+ " String s61 = \"\"; String s62 = \"\"; String s63 = \"\"; String s64 = \"\"; String s65 = \"\"; String s66 = \"\"; String s67 = \"\"; String s68 = \"\"; String s69 = \"\"; String s70 = \"\";\n" +
+ " String s71 = \"\"; String s72 = \"\"; String s73 = \"\"; String s74 = \"\"; String s75 = \"\"; String s76 = \"\"; String s77 = \"\"; String s78 = \"\"; String s79 = \"\"; String s80 = \"\";\n" +
+ " String s81 = \"\"; String s82 = \"\"; String s83 = \"\"; String s84 = \"\"; String s85 = \"\"; String s86 = \"\"; String s87 = \"\"; String s88 = \"\"; String s89 = \"\"; String s90 = \"\";\n" +
+ " String s91 = \"\"; String s92 = \"\"; String s93 = \"\"; String s94 = \"\"; String s95 = \"\"; String s96 = \"\"; String s97 = \"\"; String s98 = \"\"; String s99 = \"\"; String s100 = \"\";\n" +
+ " String s101 = \"\"; String s102 = \"\"; String s103 = \"\"; String s104 = \"\"; String s105 = \"\"; String s106 = \"\"; String s107 = \"\"; String s108 = \"\"; String s109 = \"\"; String s110 = \"\";\n" +
+ " String s111 = \"\"; String s112 = \"\"; String s113 = \"\"; String s114 = \"\"; String s115 = \"\"; String s116 = \"\"; String s117 = \"\"; String s118 = \"\"; String s119 = \"\"; String s120 = \"\";\n" +
+ " String s121 = \"\"; String s122 = \"\"; String s123 = \"\"; String s124 = \"\"; String s125 = \"\"; String s126 = \"\"; String s127 = \"\"; String s128 = \"\"; String s129 = \"\"; String s130 = \"\";\n" +
+ " String s131 = \"\"; String s132 = \"\"; String s133 = \"\"; String s134 = \"\"; String s135 = \"\"; String s136 = \"\"; String s137 = \"\"; String s138 = \"\"; String s139 = \"\"; String s140 = \"\";\n" +
+ " String s141 = \"\"; String s142 = \"\"; String s143 = \"\"; String s144 = \"\"; String s145 = \"\"; String s146 = \"\"; String s147 = \"\"; String s148 = \"\"; String s149 = \"\"; String s150 = \"\";\n" +
+ " String s151 = \"\"; String s152 = \"\"; String s153 = \"\"; String s154 = \"\"; String s155 = \"\"; String s156 = \"\"; String s157 = \"\"; String s158 = \"\"; String s159 = \"\"; String s160 = \"\";\n" +
+ " String s161 = \"\"; String s162 = \"\"; String s163 = \"\"; String s164 = \"\"; String s165 = \"\"; String s166 = \"\"; String s167 = \"\"; String s168 = \"\"; String s169 = \"\"; String s170 = \"\";\n" +
+ " String s171 = \"\"; String s172 = \"\"; String s173 = \"\"; String s174 = \"\"; String s175 = \"\"; String s176 = \"\"; String s177 = \"\"; String s178 = \"\"; String s179 = \"\"; String s180 = \"\";\n" +
+ " String s181 = \"\"; String s182 = \"\"; String s183 = \"\"; String s184 = \"\"; String s185 = \"\"; String s186 = \"\"; String s187 = \"\"; String s188 = \"\"; String s189 = \"\"; String s190 = \"\";\n" +
+ " String s191 = \"\"; String s192 = \"\"; String s193 = \"\"; String s194 = \"\"; String s195 = \"\"; String s196 = \"\"; String s197 = \"\"; String s198 = \"\"; String s199 = \"\"; String s200 = \"\";\n" +
+ " String s201 = \"\"; String s202 = \"\"; String s203 = \"\"; String s204 = \"\"; String s205 = \"\"; String s206 = \"\"; String s207 = \"\"; String s208 = \"\"; String s209 = \"\"; String s210 = \"\";\n" +
+ " String s211 = \"\"; String s212 = \"\"; String s213 = \"\"; String s214 = \"\"; String s215 = \"\"; String s216 = \"\"; String s217 = \"\"; String s218 = \"\"; String s219 = \"\"; String s220 = \"\";\n" +
+ " String s221 = \"\"; String s222 = \"\"; String s223 = \"\"; String s224 = \"\"; String s225 = \"\"; String s226 = \"\"; String s227 = \"\"; String s228 = \"\"; String s229 = \"\"; String s230 = \"\";\n" +
+ " String s231 = \"\"; String s232 = \"\"; String s233 = \"\"; String s234 = \"\"; String s235 = \"\"; String s236 = \"\"; String s237 = \"\"; String s238 = \"\"; String s239 = \"\"; String s240 = \"\";\n" +
+ " String s241 = \"\"; String s242 = \"\"; String s243 = \"\"; String s244 = \"\"; String s245 = \"\"; String s246 = \"\"; String s247 = \"\"; String s248 = \"\"; String s249 = \"\"; String s250 = \"\";\n" +
+ " String s251 = \"\"; String s252 = \"\";\n" +
+ "\n" +
+ " int size1 = 1;\n" +
+ " int size2 = 2;\n" +
+ " int size3 = 3;\n" +
+ "\n" +
+ " boolean[][][] array = new boolean[size1][size2][size3];\n" +
+ " \n" +
+ " for (int i = 0; i < size1; i++) {\n" +
+ " for (int j = 0; j < size2; j++) {\n" +
+ " boolean on = false;\n" +
+ " for (int k = 0; k < size3; k++) {\n" +
+ " array[i][j][k] = on ? true : false;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().show();\n" +
+ " }\n" +
"}",
},
"",
@@ -1416,56 +1416,56 @@ public void test010() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public final class X {\n" +
- "\n" +
- " public void show() {\n" +
- " String s1 = \"\"; String s2 = \"\"; String s3 = \"\"; String s4 = \"\"; String s5 = \"\"; String s6 = \"\"; String s7 = \"\"; String s8 = \"\"; String s9 = \"\"; String s10 = \"\";\n" +
- " String s11 = \"\"; String s12 = \"\"; String s13 = \"\"; String s14 = \"\"; String s15 = \"\"; String s16 = \"\"; String s17 = \"\"; String s18 = \"\"; String s19 = \"\"; String s20 = \"\";\n" +
- " String s21 = \"\"; String s22 = \"\"; String s23 = \"\"; String s24 = \"\"; String s25 = \"\"; String s26 = \"\"; String s27 = \"\"; String s28 = \"\"; String s29 = \"\"; String s30 = \"\";\n" +
- " String s31 = \"\"; String s32 = \"\"; String s33 = \"\"; String s34 = \"\"; String s35 = \"\"; String s36 = \"\"; String s37 = \"\"; String s38 = \"\"; String s39 = \"\"; String s40 = \"\";\n" +
- " String s41 = \"\"; String s42 = \"\"; String s43 = \"\"; String s44 = \"\"; String s45 = \"\"; String s46 = \"\"; String s47 = \"\"; String s48 = \"\"; String s49 = \"\"; String s50 = \"\";\n" +
- " String s51 = \"\"; String s52 = \"\"; String s53 = \"\"; String s54 = \"\"; String s55 = \"\"; String s56 = \"\"; String s57 = \"\"; String s58 = \"\"; String s59 = \"\"; String s60 = \"\";\n" +
- " String s61 = \"\"; String s62 = \"\"; String s63 = \"\"; String s64 = \"\"; String s65 = \"\"; String s66 = \"\"; String s67 = \"\"; String s68 = \"\"; String s69 = \"\"; String s70 = \"\";\n" +
- " String s71 = \"\"; String s72 = \"\"; String s73 = \"\"; String s74 = \"\"; String s75 = \"\"; String s76 = \"\"; String s77 = \"\"; String s78 = \"\"; String s79 = \"\"; String s80 = \"\";\n" +
- " String s81 = \"\"; String s82 = \"\"; String s83 = \"\"; String s84 = \"\"; String s85 = \"\"; String s86 = \"\"; String s87 = \"\"; String s88 = \"\"; String s89 = \"\"; String s90 = \"\";\n" +
- " String s91 = \"\"; String s92 = \"\"; String s93 = \"\"; String s94 = \"\"; String s95 = \"\"; String s96 = \"\"; String s97 = \"\"; String s98 = \"\"; String s99 = \"\"; String s100 = \"\";\n" +
- " String s101 = \"\"; String s102 = \"\"; String s103 = \"\"; String s104 = \"\"; String s105 = \"\"; String s106 = \"\"; String s107 = \"\"; String s108 = \"\"; String s109 = \"\"; String s110 = \"\";\n" +
- " String s111 = \"\"; String s112 = \"\"; String s113 = \"\"; String s114 = \"\"; String s115 = \"\"; String s116 = \"\"; String s117 = \"\"; String s118 = \"\"; String s119 = \"\"; String s120 = \"\";\n" +
- " String s121 = \"\"; String s122 = \"\"; String s123 = \"\"; String s124 = \"\"; String s125 = \"\"; String s126 = \"\"; String s127 = \"\"; String s128 = \"\"; String s129 = \"\"; String s130 = \"\";\n" +
- " String s131 = \"\"; String s132 = \"\"; String s133 = \"\"; String s134 = \"\"; String s135 = \"\"; String s136 = \"\"; String s137 = \"\"; String s138 = \"\"; String s139 = \"\"; String s140 = \"\";\n" +
- " String s141 = \"\"; String s142 = \"\"; String s143 = \"\"; String s144 = \"\"; String s145 = \"\"; String s146 = \"\"; String s147 = \"\"; String s148 = \"\"; String s149 = \"\"; String s150 = \"\";\n" +
- " String s151 = \"\"; String s152 = \"\"; String s153 = \"\"; String s154 = \"\"; String s155 = \"\"; String s156 = \"\"; String s157 = \"\"; String s158 = \"\"; String s159 = \"\"; String s160 = \"\";\n" +
- " String s161 = \"\"; String s162 = \"\"; String s163 = \"\"; String s164 = \"\"; String s165 = \"\"; String s166 = \"\"; String s167 = \"\"; String s168 = \"\"; String s169 = \"\"; String s170 = \"\";\n" +
- " String s171 = \"\"; String s172 = \"\"; String s173 = \"\"; String s174 = \"\"; String s175 = \"\"; String s176 = \"\"; String s177 = \"\"; String s178 = \"\"; String s179 = \"\"; String s180 = \"\";\n" +
- " String s181 = \"\"; String s182 = \"\"; String s183 = \"\"; String s184 = \"\"; String s185 = \"\"; String s186 = \"\"; String s187 = \"\"; String s188 = \"\"; String s189 = \"\"; String s190 = \"\";\n" +
- " String s191 = \"\"; String s192 = \"\"; String s193 = \"\"; String s194 = \"\"; String s195 = \"\"; String s196 = \"\"; String s197 = \"\"; String s198 = \"\"; String s199 = \"\"; String s200 = \"\";\n" +
- " String s201 = \"\"; String s202 = \"\"; String s203 = \"\"; String s204 = \"\"; String s205 = \"\"; String s206 = \"\"; String s207 = \"\"; String s208 = \"\"; String s209 = \"\"; String s210 = \"\";\n" +
- " String s211 = \"\"; String s212 = \"\"; String s213 = \"\"; String s214 = \"\"; String s215 = \"\"; String s216 = \"\"; String s217 = \"\"; String s218 = \"\"; String s219 = \"\"; String s220 = \"\";\n" +
- " String s221 = \"\"; String s222 = \"\"; String s223 = \"\"; String s224 = \"\"; String s225 = \"\"; String s226 = \"\"; String s227 = \"\"; String s228 = \"\"; String s229 = \"\"; String s230 = \"\";\n" +
- " String s231 = \"\"; String s232 = \"\"; String s233 = \"\"; String s234 = \"\"; String s235 = \"\"; String s236 = \"\"; String s237 = \"\"; String s238 = \"\"; String s239 = \"\"; String s240 = \"\";\n" +
- " String s241 = \"\"; String s242 = \"\"; String s243 = \"\"; String s244 = \"\"; String s245 = \"\"; String s246 = \"\"; String s247 = \"\"; String s248 = \"\"; String s249 = \"\"; String s250 = \"\";\n" +
- " String s251 = \"\"; String s252 = \"\";\n" +
- "\n" +
- " int size1 = 1;\n" +
- " int size2 = 2;\n" +
- " int size3 = 3;\n" +
- "\n" +
- " long[][][] array = new long[size1][size2][size3];\n" +
- " \n" +
- " for (int i = 0; i < size1; i++) {\n" +
- " for (int j = 0; j < size2; j++) {\n" +
- " boolean on = false;\n" +
- " for (int k = 0; k < size3; k++) {\n" +
- " array[i][j][k] = on ? 234L : 12345L;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " new X().show();\n" +
- " }\n" +
+ "public final class X {\n" +
+ "\n" +
+ " public void show() {\n" +
+ " String s1 = \"\"; String s2 = \"\"; String s3 = \"\"; String s4 = \"\"; String s5 = \"\"; String s6 = \"\"; String s7 = \"\"; String s8 = \"\"; String s9 = \"\"; String s10 = \"\";\n" +
+ " String s11 = \"\"; String s12 = \"\"; String s13 = \"\"; String s14 = \"\"; String s15 = \"\"; String s16 = \"\"; String s17 = \"\"; String s18 = \"\"; String s19 = \"\"; String s20 = \"\";\n" +
+ " String s21 = \"\"; String s22 = \"\"; String s23 = \"\"; String s24 = \"\"; String s25 = \"\"; String s26 = \"\"; String s27 = \"\"; String s28 = \"\"; String s29 = \"\"; String s30 = \"\";\n" +
+ " String s31 = \"\"; String s32 = \"\"; String s33 = \"\"; String s34 = \"\"; String s35 = \"\"; String s36 = \"\"; String s37 = \"\"; String s38 = \"\"; String s39 = \"\"; String s40 = \"\";\n" +
+ " String s41 = \"\"; String s42 = \"\"; String s43 = \"\"; String s44 = \"\"; String s45 = \"\"; String s46 = \"\"; String s47 = \"\"; String s48 = \"\"; String s49 = \"\"; String s50 = \"\";\n" +
+ " String s51 = \"\"; String s52 = \"\"; String s53 = \"\"; String s54 = \"\"; String s55 = \"\"; String s56 = \"\"; String s57 = \"\"; String s58 = \"\"; String s59 = \"\"; String s60 = \"\";\n" +
+ " String s61 = \"\"; String s62 = \"\"; String s63 = \"\"; String s64 = \"\"; String s65 = \"\"; String s66 = \"\"; String s67 = \"\"; String s68 = \"\"; String s69 = \"\"; String s70 = \"\";\n" +
+ " String s71 = \"\"; String s72 = \"\"; String s73 = \"\"; String s74 = \"\"; String s75 = \"\"; String s76 = \"\"; String s77 = \"\"; String s78 = \"\"; String s79 = \"\"; String s80 = \"\";\n" +
+ " String s81 = \"\"; String s82 = \"\"; String s83 = \"\"; String s84 = \"\"; String s85 = \"\"; String s86 = \"\"; String s87 = \"\"; String s88 = \"\"; String s89 = \"\"; String s90 = \"\";\n" +
+ " String s91 = \"\"; String s92 = \"\"; String s93 = \"\"; String s94 = \"\"; String s95 = \"\"; String s96 = \"\"; String s97 = \"\"; String s98 = \"\"; String s99 = \"\"; String s100 = \"\";\n" +
+ " String s101 = \"\"; String s102 = \"\"; String s103 = \"\"; String s104 = \"\"; String s105 = \"\"; String s106 = \"\"; String s107 = \"\"; String s108 = \"\"; String s109 = \"\"; String s110 = \"\";\n" +
+ " String s111 = \"\"; String s112 = \"\"; String s113 = \"\"; String s114 = \"\"; String s115 = \"\"; String s116 = \"\"; String s117 = \"\"; String s118 = \"\"; String s119 = \"\"; String s120 = \"\";\n" +
+ " String s121 = \"\"; String s122 = \"\"; String s123 = \"\"; String s124 = \"\"; String s125 = \"\"; String s126 = \"\"; String s127 = \"\"; String s128 = \"\"; String s129 = \"\"; String s130 = \"\";\n" +
+ " String s131 = \"\"; String s132 = \"\"; String s133 = \"\"; String s134 = \"\"; String s135 = \"\"; String s136 = \"\"; String s137 = \"\"; String s138 = \"\"; String s139 = \"\"; String s140 = \"\";\n" +
+ " String s141 = \"\"; String s142 = \"\"; String s143 = \"\"; String s144 = \"\"; String s145 = \"\"; String s146 = \"\"; String s147 = \"\"; String s148 = \"\"; String s149 = \"\"; String s150 = \"\";\n" +
+ " String s151 = \"\"; String s152 = \"\"; String s153 = \"\"; String s154 = \"\"; String s155 = \"\"; String s156 = \"\"; String s157 = \"\"; String s158 = \"\"; String s159 = \"\"; String s160 = \"\";\n" +
+ " String s161 = \"\"; String s162 = \"\"; String s163 = \"\"; String s164 = \"\"; String s165 = \"\"; String s166 = \"\"; String s167 = \"\"; String s168 = \"\"; String s169 = \"\"; String s170 = \"\";\n" +
+ " String s171 = \"\"; String s172 = \"\"; String s173 = \"\"; String s174 = \"\"; String s175 = \"\"; String s176 = \"\"; String s177 = \"\"; String s178 = \"\"; String s179 = \"\"; String s180 = \"\";\n" +
+ " String s181 = \"\"; String s182 = \"\"; String s183 = \"\"; String s184 = \"\"; String s185 = \"\"; String s186 = \"\"; String s187 = \"\"; String s188 = \"\"; String s189 = \"\"; String s190 = \"\";\n" +
+ " String s191 = \"\"; String s192 = \"\"; String s193 = \"\"; String s194 = \"\"; String s195 = \"\"; String s196 = \"\"; String s197 = \"\"; String s198 = \"\"; String s199 = \"\"; String s200 = \"\";\n" +
+ " String s201 = \"\"; String s202 = \"\"; String s203 = \"\"; String s204 = \"\"; String s205 = \"\"; String s206 = \"\"; String s207 = \"\"; String s208 = \"\"; String s209 = \"\"; String s210 = \"\";\n" +
+ " String s211 = \"\"; String s212 = \"\"; String s213 = \"\"; String s214 = \"\"; String s215 = \"\"; String s216 = \"\"; String s217 = \"\"; String s218 = \"\"; String s219 = \"\"; String s220 = \"\";\n" +
+ " String s221 = \"\"; String s222 = \"\"; String s223 = \"\"; String s224 = \"\"; String s225 = \"\"; String s226 = \"\"; String s227 = \"\"; String s228 = \"\"; String s229 = \"\"; String s230 = \"\";\n" +
+ " String s231 = \"\"; String s232 = \"\"; String s233 = \"\"; String s234 = \"\"; String s235 = \"\"; String s236 = \"\"; String s237 = \"\"; String s238 = \"\"; String s239 = \"\"; String s240 = \"\";\n" +
+ " String s241 = \"\"; String s242 = \"\"; String s243 = \"\"; String s244 = \"\"; String s245 = \"\"; String s246 = \"\"; String s247 = \"\"; String s248 = \"\"; String s249 = \"\"; String s250 = \"\";\n" +
+ " String s251 = \"\"; String s252 = \"\";\n" +
+ "\n" +
+ " int size1 = 1;\n" +
+ " int size2 = 2;\n" +
+ " int size3 = 3;\n" +
+ "\n" +
+ " long[][][] array = new long[size1][size2][size3];\n" +
+ " \n" +
+ " for (int i = 0; i < size1; i++) {\n" +
+ " for (int j = 0; j < size2; j++) {\n" +
+ " boolean on = false;\n" +
+ " for (int k = 0; k < size3; k++) {\n" +
+ " array[i][j][k] = on ? 234L : 12345L;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().show();\n" +
+ " }\n" +
"}",
},
"",
@@ -1478,56 +1478,56 @@ public void test011() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public final class X {\n" +
- "\n" +
- " public void show() {\n" +
- " String s1 = \"\"; String s2 = \"\"; String s3 = \"\"; String s4 = \"\"; String s5 = \"\"; String s6 = \"\"; String s7 = \"\"; String s8 = \"\"; String s9 = \"\"; String s10 = \"\";\n" +
- " String s11 = \"\"; String s12 = \"\"; String s13 = \"\"; String s14 = \"\"; String s15 = \"\"; String s16 = \"\"; String s17 = \"\"; String s18 = \"\"; String s19 = \"\"; String s20 = \"\";\n" +
- " String s21 = \"\"; String s22 = \"\"; String s23 = \"\"; String s24 = \"\"; String s25 = \"\"; String s26 = \"\"; String s27 = \"\"; String s28 = \"\"; String s29 = \"\"; String s30 = \"\";\n" +
- " String s31 = \"\"; String s32 = \"\"; String s33 = \"\"; String s34 = \"\"; String s35 = \"\"; String s36 = \"\"; String s37 = \"\"; String s38 = \"\"; String s39 = \"\"; String s40 = \"\";\n" +
- " String s41 = \"\"; String s42 = \"\"; String s43 = \"\"; String s44 = \"\"; String s45 = \"\"; String s46 = \"\"; String s47 = \"\"; String s48 = \"\"; String s49 = \"\"; String s50 = \"\";\n" +
- " String s51 = \"\"; String s52 = \"\"; String s53 = \"\"; String s54 = \"\"; String s55 = \"\"; String s56 = \"\"; String s57 = \"\"; String s58 = \"\"; String s59 = \"\"; String s60 = \"\";\n" +
- " String s61 = \"\"; String s62 = \"\"; String s63 = \"\"; String s64 = \"\"; String s65 = \"\"; String s66 = \"\"; String s67 = \"\"; String s68 = \"\"; String s69 = \"\"; String s70 = \"\";\n" +
- " String s71 = \"\"; String s72 = \"\"; String s73 = \"\"; String s74 = \"\"; String s75 = \"\"; String s76 = \"\"; String s77 = \"\"; String s78 = \"\"; String s79 = \"\"; String s80 = \"\";\n" +
- " String s81 = \"\"; String s82 = \"\"; String s83 = \"\"; String s84 = \"\"; String s85 = \"\"; String s86 = \"\"; String s87 = \"\"; String s88 = \"\"; String s89 = \"\"; String s90 = \"\";\n" +
- " String s91 = \"\"; String s92 = \"\"; String s93 = \"\"; String s94 = \"\"; String s95 = \"\"; String s96 = \"\"; String s97 = \"\"; String s98 = \"\"; String s99 = \"\"; String s100 = \"\";\n" +
- " String s101 = \"\"; String s102 = \"\"; String s103 = \"\"; String s104 = \"\"; String s105 = \"\"; String s106 = \"\"; String s107 = \"\"; String s108 = \"\"; String s109 = \"\"; String s110 = \"\";\n" +
- " String s111 = \"\"; String s112 = \"\"; String s113 = \"\"; String s114 = \"\"; String s115 = \"\"; String s116 = \"\"; String s117 = \"\"; String s118 = \"\"; String s119 = \"\"; String s120 = \"\";\n" +
- " String s121 = \"\"; String s122 = \"\"; String s123 = \"\"; String s124 = \"\"; String s125 = \"\"; String s126 = \"\"; String s127 = \"\"; String s128 = \"\"; String s129 = \"\"; String s130 = \"\";\n" +
- " String s131 = \"\"; String s132 = \"\"; String s133 = \"\"; String s134 = \"\"; String s135 = \"\"; String s136 = \"\"; String s137 = \"\"; String s138 = \"\"; String s139 = \"\"; String s140 = \"\";\n" +
- " String s141 = \"\"; String s142 = \"\"; String s143 = \"\"; String s144 = \"\"; String s145 = \"\"; String s146 = \"\"; String s147 = \"\"; String s148 = \"\"; String s149 = \"\"; String s150 = \"\";\n" +
- " String s151 = \"\"; String s152 = \"\"; String s153 = \"\"; String s154 = \"\"; String s155 = \"\"; String s156 = \"\"; String s157 = \"\"; String s158 = \"\"; String s159 = \"\"; String s160 = \"\";\n" +
- " String s161 = \"\"; String s162 = \"\"; String s163 = \"\"; String s164 = \"\"; String s165 = \"\"; String s166 = \"\"; String s167 = \"\"; String s168 = \"\"; String s169 = \"\"; String s170 = \"\";\n" +
- " String s171 = \"\"; String s172 = \"\"; String s173 = \"\"; String s174 = \"\"; String s175 = \"\"; String s176 = \"\"; String s177 = \"\"; String s178 = \"\"; String s179 = \"\"; String s180 = \"\";\n" +
- " String s181 = \"\"; String s182 = \"\"; String s183 = \"\"; String s184 = \"\"; String s185 = \"\"; String s186 = \"\"; String s187 = \"\"; String s188 = \"\"; String s189 = \"\"; String s190 = \"\";\n" +
- " String s191 = \"\"; String s192 = \"\"; String s193 = \"\"; String s194 = \"\"; String s195 = \"\"; String s196 = \"\"; String s197 = \"\"; String s198 = \"\"; String s199 = \"\"; String s200 = \"\";\n" +
- " String s201 = \"\"; String s202 = \"\"; String s203 = \"\"; String s204 = \"\"; String s205 = \"\"; String s206 = \"\"; String s207 = \"\"; String s208 = \"\"; String s209 = \"\"; String s210 = \"\";\n" +
- " String s211 = \"\"; String s212 = \"\"; String s213 = \"\"; String s214 = \"\"; String s215 = \"\"; String s216 = \"\"; String s217 = \"\"; String s218 = \"\"; String s219 = \"\"; String s220 = \"\";\n" +
- " String s221 = \"\"; String s222 = \"\"; String s223 = \"\"; String s224 = \"\"; String s225 = \"\"; String s226 = \"\"; String s227 = \"\"; String s228 = \"\"; String s229 = \"\"; String s230 = \"\";\n" +
- " String s231 = \"\"; String s232 = \"\"; String s233 = \"\"; String s234 = \"\"; String s235 = \"\"; String s236 = \"\"; String s237 = \"\"; String s238 = \"\"; String s239 = \"\"; String s240 = \"\";\n" +
- " String s241 = \"\"; String s242 = \"\"; String s243 = \"\"; String s244 = \"\"; String s245 = \"\"; String s246 = \"\"; String s247 = \"\"; String s248 = \"\"; String s249 = \"\"; String s250 = \"\";\n" +
- " String s251 = \"\"; String s252 = \"\";\n" +
- "\n" +
- " int size1 = 1;\n" +
- " int size2 = 2;\n" +
- " int size3 = 3;\n" +
- "\n" +
- " double[][][] array = new double[size1][size2][size3];\n" +
- " \n" +
- " for (int i = 0; i < size1; i++) {\n" +
- " for (int j = 0; j < size2; j++) {\n" +
- " boolean on = false;\n" +
- " for (int k = 0; k < size3; k++) {\n" +
- " array[i][j][k] = on ? 2.0 : 3.0;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " new X().show();\n" +
- " }\n" +
+ "public final class X {\n" +
+ "\n" +
+ " public void show() {\n" +
+ " String s1 = \"\"; String s2 = \"\"; String s3 = \"\"; String s4 = \"\"; String s5 = \"\"; String s6 = \"\"; String s7 = \"\"; String s8 = \"\"; String s9 = \"\"; String s10 = \"\";\n" +
+ " String s11 = \"\"; String s12 = \"\"; String s13 = \"\"; String s14 = \"\"; String s15 = \"\"; String s16 = \"\"; String s17 = \"\"; String s18 = \"\"; String s19 = \"\"; String s20 = \"\";\n" +
+ " String s21 = \"\"; String s22 = \"\"; String s23 = \"\"; String s24 = \"\"; String s25 = \"\"; String s26 = \"\"; String s27 = \"\"; String s28 = \"\"; String s29 = \"\"; String s30 = \"\";\n" +
+ " String s31 = \"\"; String s32 = \"\"; String s33 = \"\"; String s34 = \"\"; String s35 = \"\"; String s36 = \"\"; String s37 = \"\"; String s38 = \"\"; String s39 = \"\"; String s40 = \"\";\n" +
+ " String s41 = \"\"; String s42 = \"\"; String s43 = \"\"; String s44 = \"\"; String s45 = \"\"; String s46 = \"\"; String s47 = \"\"; String s48 = \"\"; String s49 = \"\"; String s50 = \"\";\n" +
+ " String s51 = \"\"; String s52 = \"\"; String s53 = \"\"; String s54 = \"\"; String s55 = \"\"; String s56 = \"\"; String s57 = \"\"; String s58 = \"\"; String s59 = \"\"; String s60 = \"\";\n" +
+ " String s61 = \"\"; String s62 = \"\"; String s63 = \"\"; String s64 = \"\"; String s65 = \"\"; String s66 = \"\"; String s67 = \"\"; String s68 = \"\"; String s69 = \"\"; String s70 = \"\";\n" +
+ " String s71 = \"\"; String s72 = \"\"; String s73 = \"\"; String s74 = \"\"; String s75 = \"\"; String s76 = \"\"; String s77 = \"\"; String s78 = \"\"; String s79 = \"\"; String s80 = \"\";\n" +
+ " String s81 = \"\"; String s82 = \"\"; String s83 = \"\"; String s84 = \"\"; String s85 = \"\"; String s86 = \"\"; String s87 = \"\"; String s88 = \"\"; String s89 = \"\"; String s90 = \"\";\n" +
+ " String s91 = \"\"; String s92 = \"\"; String s93 = \"\"; String s94 = \"\"; String s95 = \"\"; String s96 = \"\"; String s97 = \"\"; String s98 = \"\"; String s99 = \"\"; String s100 = \"\";\n" +
+ " String s101 = \"\"; String s102 = \"\"; String s103 = \"\"; String s104 = \"\"; String s105 = \"\"; String s106 = \"\"; String s107 = \"\"; String s108 = \"\"; String s109 = \"\"; String s110 = \"\";\n" +
+ " String s111 = \"\"; String s112 = \"\"; String s113 = \"\"; String s114 = \"\"; String s115 = \"\"; String s116 = \"\"; String s117 = \"\"; String s118 = \"\"; String s119 = \"\"; String s120 = \"\";\n" +
+ " String s121 = \"\"; String s122 = \"\"; String s123 = \"\"; String s124 = \"\"; String s125 = \"\"; String s126 = \"\"; String s127 = \"\"; String s128 = \"\"; String s129 = \"\"; String s130 = \"\";\n" +
+ " String s131 = \"\"; String s132 = \"\"; String s133 = \"\"; String s134 = \"\"; String s135 = \"\"; String s136 = \"\"; String s137 = \"\"; String s138 = \"\"; String s139 = \"\"; String s140 = \"\";\n" +
+ " String s141 = \"\"; String s142 = \"\"; String s143 = \"\"; String s144 = \"\"; String s145 = \"\"; String s146 = \"\"; String s147 = \"\"; String s148 = \"\"; String s149 = \"\"; String s150 = \"\";\n" +
+ " String s151 = \"\"; String s152 = \"\"; String s153 = \"\"; String s154 = \"\"; String s155 = \"\"; String s156 = \"\"; String s157 = \"\"; String s158 = \"\"; String s159 = \"\"; String s160 = \"\";\n" +
+ " String s161 = \"\"; String s162 = \"\"; String s163 = \"\"; String s164 = \"\"; String s165 = \"\"; String s166 = \"\"; String s167 = \"\"; String s168 = \"\"; String s169 = \"\"; String s170 = \"\";\n" +
+ " String s171 = \"\"; String s172 = \"\"; String s173 = \"\"; String s174 = \"\"; String s175 = \"\"; String s176 = \"\"; String s177 = \"\"; String s178 = \"\"; String s179 = \"\"; String s180 = \"\";\n" +
+ " String s181 = \"\"; String s182 = \"\"; String s183 = \"\"; String s184 = \"\"; String s185 = \"\"; String s186 = \"\"; String s187 = \"\"; String s188 = \"\"; String s189 = \"\"; String s190 = \"\";\n" +
+ " String s191 = \"\"; String s192 = \"\"; String s193 = \"\"; String s194 = \"\"; String s195 = \"\"; String s196 = \"\"; String s197 = \"\"; String s198 = \"\"; String s199 = \"\"; String s200 = \"\";\n" +
+ " String s201 = \"\"; String s202 = \"\"; String s203 = \"\"; String s204 = \"\"; String s205 = \"\"; String s206 = \"\"; String s207 = \"\"; String s208 = \"\"; String s209 = \"\"; String s210 = \"\";\n" +
+ " String s211 = \"\"; String s212 = \"\"; String s213 = \"\"; String s214 = \"\"; String s215 = \"\"; String s216 = \"\"; String s217 = \"\"; String s218 = \"\"; String s219 = \"\"; String s220 = \"\";\n" +
+ " String s221 = \"\"; String s222 = \"\"; String s223 = \"\"; String s224 = \"\"; String s225 = \"\"; String s226 = \"\"; String s227 = \"\"; String s228 = \"\"; String s229 = \"\"; String s230 = \"\";\n" +
+ " String s231 = \"\"; String s232 = \"\"; String s233 = \"\"; String s234 = \"\"; String s235 = \"\"; String s236 = \"\"; String s237 = \"\"; String s238 = \"\"; String s239 = \"\"; String s240 = \"\";\n" +
+ " String s241 = \"\"; String s242 = \"\"; String s243 = \"\"; String s244 = \"\"; String s245 = \"\"; String s246 = \"\"; String s247 = \"\"; String s248 = \"\"; String s249 = \"\"; String s250 = \"\";\n" +
+ " String s251 = \"\"; String s252 = \"\";\n" +
+ "\n" +
+ " int size1 = 1;\n" +
+ " int size2 = 2;\n" +
+ " int size3 = 3;\n" +
+ "\n" +
+ " double[][][] array = new double[size1][size2][size3];\n" +
+ " \n" +
+ " for (int i = 0; i < size1; i++) {\n" +
+ " for (int j = 0; j < size2; j++) {\n" +
+ " boolean on = false;\n" +
+ " for (int k = 0; k < size3; k++) {\n" +
+ " array[i][j][k] = on ? 2.0 : 3.0;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().show();\n" +
+ " }\n" +
"}",
},
"",
@@ -1540,56 +1540,56 @@ public void test012() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public final class X {\n" +
- "\n" +
- " public void show() {\n" +
- " String s1 = \"\"; String s2 = \"\"; String s3 = \"\"; String s4 = \"\"; String s5 = \"\"; String s6 = \"\"; String s7 = \"\"; String s8 = \"\"; String s9 = \"\"; String s10 = \"\";\n" +
- " String s11 = \"\"; String s12 = \"\"; String s13 = \"\"; String s14 = \"\"; String s15 = \"\"; String s16 = \"\"; String s17 = \"\"; String s18 = \"\"; String s19 = \"\"; String s20 = \"\";\n" +
- " String s21 = \"\"; String s22 = \"\"; String s23 = \"\"; String s24 = \"\"; String s25 = \"\"; String s26 = \"\"; String s27 = \"\"; String s28 = \"\"; String s29 = \"\"; String s30 = \"\";\n" +
- " String s31 = \"\"; String s32 = \"\"; String s33 = \"\"; String s34 = \"\"; String s35 = \"\"; String s36 = \"\"; String s37 = \"\"; String s38 = \"\"; String s39 = \"\"; String s40 = \"\";\n" +
- " String s41 = \"\"; String s42 = \"\"; String s43 = \"\"; String s44 = \"\"; String s45 = \"\"; String s46 = \"\"; String s47 = \"\"; String s48 = \"\"; String s49 = \"\"; String s50 = \"\";\n" +
- " String s51 = \"\"; String s52 = \"\"; String s53 = \"\"; String s54 = \"\"; String s55 = \"\"; String s56 = \"\"; String s57 = \"\"; String s58 = \"\"; String s59 = \"\"; String s60 = \"\";\n" +
- " String s61 = \"\"; String s62 = \"\"; String s63 = \"\"; String s64 = \"\"; String s65 = \"\"; String s66 = \"\"; String s67 = \"\"; String s68 = \"\"; String s69 = \"\"; String s70 = \"\";\n" +
- " String s71 = \"\"; String s72 = \"\"; String s73 = \"\"; String s74 = \"\"; String s75 = \"\"; String s76 = \"\"; String s77 = \"\"; String s78 = \"\"; String s79 = \"\"; String s80 = \"\";\n" +
- " String s81 = \"\"; String s82 = \"\"; String s83 = \"\"; String s84 = \"\"; String s85 = \"\"; String s86 = \"\"; String s87 = \"\"; String s88 = \"\"; String s89 = \"\"; String s90 = \"\";\n" +
- " String s91 = \"\"; String s92 = \"\"; String s93 = \"\"; String s94 = \"\"; String s95 = \"\"; String s96 = \"\"; String s97 = \"\"; String s98 = \"\"; String s99 = \"\"; String s100 = \"\";\n" +
- " String s101 = \"\"; String s102 = \"\"; String s103 = \"\"; String s104 = \"\"; String s105 = \"\"; String s106 = \"\"; String s107 = \"\"; String s108 = \"\"; String s109 = \"\"; String s110 = \"\";\n" +
- " String s111 = \"\"; String s112 = \"\"; String s113 = \"\"; String s114 = \"\"; String s115 = \"\"; String s116 = \"\"; String s117 = \"\"; String s118 = \"\"; String s119 = \"\"; String s120 = \"\";\n" +
- " String s121 = \"\"; String s122 = \"\"; String s123 = \"\"; String s124 = \"\"; String s125 = \"\"; String s126 = \"\"; String s127 = \"\"; String s128 = \"\"; String s129 = \"\"; String s130 = \"\";\n" +
- " String s131 = \"\"; String s132 = \"\"; String s133 = \"\"; String s134 = \"\"; String s135 = \"\"; String s136 = \"\"; String s137 = \"\"; String s138 = \"\"; String s139 = \"\"; String s140 = \"\";\n" +
- " String s141 = \"\"; String s142 = \"\"; String s143 = \"\"; String s144 = \"\"; String s145 = \"\"; String s146 = \"\"; String s147 = \"\"; String s148 = \"\"; String s149 = \"\"; String s150 = \"\";\n" +
- " String s151 = \"\"; String s152 = \"\"; String s153 = \"\"; String s154 = \"\"; String s155 = \"\"; String s156 = \"\"; String s157 = \"\"; String s158 = \"\"; String s159 = \"\"; String s160 = \"\";\n" +
- " String s161 = \"\"; String s162 = \"\"; String s163 = \"\"; String s164 = \"\"; String s165 = \"\"; String s166 = \"\"; String s167 = \"\"; String s168 = \"\"; String s169 = \"\"; String s170 = \"\";\n" +
- " String s171 = \"\"; String s172 = \"\"; String s173 = \"\"; String s174 = \"\"; String s175 = \"\"; String s176 = \"\"; String s177 = \"\"; String s178 = \"\"; String s179 = \"\"; String s180 = \"\";\n" +
- " String s181 = \"\"; String s182 = \"\"; String s183 = \"\"; String s184 = \"\"; String s185 = \"\"; String s186 = \"\"; String s187 = \"\"; String s188 = \"\"; String s189 = \"\"; String s190 = \"\";\n" +
- " String s191 = \"\"; String s192 = \"\"; String s193 = \"\"; String s194 = \"\"; String s195 = \"\"; String s196 = \"\"; String s197 = \"\"; String s198 = \"\"; String s199 = \"\"; String s200 = \"\";\n" +
- " String s201 = \"\"; String s202 = \"\"; String s203 = \"\"; String s204 = \"\"; String s205 = \"\"; String s206 = \"\"; String s207 = \"\"; String s208 = \"\"; String s209 = \"\"; String s210 = \"\";\n" +
- " String s211 = \"\"; String s212 = \"\"; String s213 = \"\"; String s214 = \"\"; String s215 = \"\"; String s216 = \"\"; String s217 = \"\"; String s218 = \"\"; String s219 = \"\"; String s220 = \"\";\n" +
- " String s221 = \"\"; String s222 = \"\"; String s223 = \"\"; String s224 = \"\"; String s225 = \"\"; String s226 = \"\"; String s227 = \"\"; String s228 = \"\"; String s229 = \"\"; String s230 = \"\";\n" +
- " String s231 = \"\"; String s232 = \"\"; String s233 = \"\"; String s234 = \"\"; String s235 = \"\"; String s236 = \"\"; String s237 = \"\"; String s238 = \"\"; String s239 = \"\"; String s240 = \"\";\n" +
- " String s241 = \"\"; String s242 = \"\"; String s243 = \"\"; String s244 = \"\"; String s245 = \"\"; String s246 = \"\"; String s247 = \"\"; String s248 = \"\"; String s249 = \"\"; String s250 = \"\";\n" +
- " String s251 = \"\"; String s252 = \"\";\n" +
- "\n" +
- " int size1 = 1;\n" +
- " int size2 = 2;\n" +
- " int size3 = 3;\n" +
- "\n" +
- " float[][][] array = new float[size1][size2][size3];\n" +
- " \n" +
- " for (int i = 0; i < size1; i++) {\n" +
- " for (int j = 0; j < size2; j++) {\n" +
- " boolean on = false;\n" +
- " for (int k = 0; k < size3; k++) {\n" +
- " array[i][j][k] = on ? 2.0f : 3.0f;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " new X().show();\n" +
- " }\n" +
+ "public final class X {\n" +
+ "\n" +
+ " public void show() {\n" +
+ " String s1 = \"\"; String s2 = \"\"; String s3 = \"\"; String s4 = \"\"; String s5 = \"\"; String s6 = \"\"; String s7 = \"\"; String s8 = \"\"; String s9 = \"\"; String s10 = \"\";\n" +
+ " String s11 = \"\"; String s12 = \"\"; String s13 = \"\"; String s14 = \"\"; String s15 = \"\"; String s16 = \"\"; String s17 = \"\"; String s18 = \"\"; String s19 = \"\"; String s20 = \"\";\n" +
+ " String s21 = \"\"; String s22 = \"\"; String s23 = \"\"; String s24 = \"\"; String s25 = \"\"; String s26 = \"\"; String s27 = \"\"; String s28 = \"\"; String s29 = \"\"; String s30 = \"\";\n" +
+ " String s31 = \"\"; String s32 = \"\"; String s33 = \"\"; String s34 = \"\"; String s35 = \"\"; String s36 = \"\"; String s37 = \"\"; String s38 = \"\"; String s39 = \"\"; String s40 = \"\";\n" +
+ " String s41 = \"\"; String s42 = \"\"; String s43 = \"\"; String s44 = \"\"; String s45 = \"\"; String s46 = \"\"; String s47 = \"\"; String s48 = \"\"; String s49 = \"\"; String s50 = \"\";\n" +
+ " String s51 = \"\"; String s52 = \"\"; String s53 = \"\"; String s54 = \"\"; String s55 = \"\"; String s56 = \"\"; String s57 = \"\"; String s58 = \"\"; String s59 = \"\"; String s60 = \"\";\n" +
+ " String s61 = \"\"; String s62 = \"\"; String s63 = \"\"; String s64 = \"\"; String s65 = \"\"; String s66 = \"\"; String s67 = \"\"; String s68 = \"\"; String s69 = \"\"; String s70 = \"\";\n" +
+ " String s71 = \"\"; String s72 = \"\"; String s73 = \"\"; String s74 = \"\"; String s75 = \"\"; String s76 = \"\"; String s77 = \"\"; String s78 = \"\"; String s79 = \"\"; String s80 = \"\";\n" +
+ " String s81 = \"\"; String s82 = \"\"; String s83 = \"\"; String s84 = \"\"; String s85 = \"\"; String s86 = \"\"; String s87 = \"\"; String s88 = \"\"; String s89 = \"\"; String s90 = \"\";\n" +
+ " String s91 = \"\"; String s92 = \"\"; String s93 = \"\"; String s94 = \"\"; String s95 = \"\"; String s96 = \"\"; String s97 = \"\"; String s98 = \"\"; String s99 = \"\"; String s100 = \"\";\n" +
+ " String s101 = \"\"; String s102 = \"\"; String s103 = \"\"; String s104 = \"\"; String s105 = \"\"; String s106 = \"\"; String s107 = \"\"; String s108 = \"\"; String s109 = \"\"; String s110 = \"\";\n" +
+ " String s111 = \"\"; String s112 = \"\"; String s113 = \"\"; String s114 = \"\"; String s115 = \"\"; String s116 = \"\"; String s117 = \"\"; String s118 = \"\"; String s119 = \"\"; String s120 = \"\";\n" +
+ " String s121 = \"\"; String s122 = \"\"; String s123 = \"\"; String s124 = \"\"; String s125 = \"\"; String s126 = \"\"; String s127 = \"\"; String s128 = \"\"; String s129 = \"\"; String s130 = \"\";\n" +
+ " String s131 = \"\"; String s132 = \"\"; String s133 = \"\"; String s134 = \"\"; String s135 = \"\"; String s136 = \"\"; String s137 = \"\"; String s138 = \"\"; String s139 = \"\"; String s140 = \"\";\n" +
+ " String s141 = \"\"; String s142 = \"\"; String s143 = \"\"; String s144 = \"\"; String s145 = \"\"; String s146 = \"\"; String s147 = \"\"; String s148 = \"\"; String s149 = \"\"; String s150 = \"\";\n" +
+ " String s151 = \"\"; String s152 = \"\"; String s153 = \"\"; String s154 = \"\"; String s155 = \"\"; String s156 = \"\"; String s157 = \"\"; String s158 = \"\"; String s159 = \"\"; String s160 = \"\";\n" +
+ " String s161 = \"\"; String s162 = \"\"; String s163 = \"\"; String s164 = \"\"; String s165 = \"\"; String s166 = \"\"; String s167 = \"\"; String s168 = \"\"; String s169 = \"\"; String s170 = \"\";\n" +
+ " String s171 = \"\"; String s172 = \"\"; String s173 = \"\"; String s174 = \"\"; String s175 = \"\"; String s176 = \"\"; String s177 = \"\"; String s178 = \"\"; String s179 = \"\"; String s180 = \"\";\n" +
+ " String s181 = \"\"; String s182 = \"\"; String s183 = \"\"; String s184 = \"\"; String s185 = \"\"; String s186 = \"\"; String s187 = \"\"; String s188 = \"\"; String s189 = \"\"; String s190 = \"\";\n" +
+ " String s191 = \"\"; String s192 = \"\"; String s193 = \"\"; String s194 = \"\"; String s195 = \"\"; String s196 = \"\"; String s197 = \"\"; String s198 = \"\"; String s199 = \"\"; String s200 = \"\";\n" +
+ " String s201 = \"\"; String s202 = \"\"; String s203 = \"\"; String s204 = \"\"; String s205 = \"\"; String s206 = \"\"; String s207 = \"\"; String s208 = \"\"; String s209 = \"\"; String s210 = \"\";\n" +
+ " String s211 = \"\"; String s212 = \"\"; String s213 = \"\"; String s214 = \"\"; String s215 = \"\"; String s216 = \"\"; String s217 = \"\"; String s218 = \"\"; String s219 = \"\"; String s220 = \"\";\n" +
+ " String s221 = \"\"; String s222 = \"\"; String s223 = \"\"; String s224 = \"\"; String s225 = \"\"; String s226 = \"\"; String s227 = \"\"; String s228 = \"\"; String s229 = \"\"; String s230 = \"\";\n" +
+ " String s231 = \"\"; String s232 = \"\"; String s233 = \"\"; String s234 = \"\"; String s235 = \"\"; String s236 = \"\"; String s237 = \"\"; String s238 = \"\"; String s239 = \"\"; String s240 = \"\";\n" +
+ " String s241 = \"\"; String s242 = \"\"; String s243 = \"\"; String s244 = \"\"; String s245 = \"\"; String s246 = \"\"; String s247 = \"\"; String s248 = \"\"; String s249 = \"\"; String s250 = \"\";\n" +
+ " String s251 = \"\"; String s252 = \"\";\n" +
+ "\n" +
+ " int size1 = 1;\n" +
+ " int size2 = 2;\n" +
+ " int size3 = 3;\n" +
+ "\n" +
+ " float[][][] array = new float[size1][size2][size3];\n" +
+ " \n" +
+ " for (int i = 0; i < size1; i++) {\n" +
+ " for (int j = 0; j < size2; j++) {\n" +
+ " boolean on = false;\n" +
+ " for (int k = 0; k < size3; k++) {\n" +
+ " array[i][j][k] = on ? 2.0f : 3.0f;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().show();\n" +
+ " }\n" +
"}",
},
"",
@@ -1602,56 +1602,56 @@ public void test013() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public final class X {\n" +
- "\n" +
- " public void show() {\n" +
- " String s1 = \"\"; String s2 = \"\"; String s3 = \"\"; String s4 = \"\"; String s5 = \"\"; String s6 = \"\"; String s7 = \"\"; String s8 = \"\"; String s9 = \"\"; String s10 = \"\";\n" +
- " String s11 = \"\"; String s12 = \"\"; String s13 = \"\"; String s14 = \"\"; String s15 = \"\"; String s16 = \"\"; String s17 = \"\"; String s18 = \"\"; String s19 = \"\"; String s20 = \"\";\n" +
- " String s21 = \"\"; String s22 = \"\"; String s23 = \"\"; String s24 = \"\"; String s25 = \"\"; String s26 = \"\"; String s27 = \"\"; String s28 = \"\"; String s29 = \"\"; String s30 = \"\";\n" +
- " String s31 = \"\"; String s32 = \"\"; String s33 = \"\"; String s34 = \"\"; String s35 = \"\"; String s36 = \"\"; String s37 = \"\"; String s38 = \"\"; String s39 = \"\"; String s40 = \"\";\n" +
- " String s41 = \"\"; String s42 = \"\"; String s43 = \"\"; String s44 = \"\"; String s45 = \"\"; String s46 = \"\"; String s47 = \"\"; String s48 = \"\"; String s49 = \"\"; String s50 = \"\";\n" +
- " String s51 = \"\"; String s52 = \"\"; String s53 = \"\"; String s54 = \"\"; String s55 = \"\"; String s56 = \"\"; String s57 = \"\"; String s58 = \"\"; String s59 = \"\"; String s60 = \"\";\n" +
- " String s61 = \"\"; String s62 = \"\"; String s63 = \"\"; String s64 = \"\"; String s65 = \"\"; String s66 = \"\"; String s67 = \"\"; String s68 = \"\"; String s69 = \"\"; String s70 = \"\";\n" +
- " String s71 = \"\"; String s72 = \"\"; String s73 = \"\"; String s74 = \"\"; String s75 = \"\"; String s76 = \"\"; String s77 = \"\"; String s78 = \"\"; String s79 = \"\"; String s80 = \"\";\n" +
- " String s81 = \"\"; String s82 = \"\"; String s83 = \"\"; String s84 = \"\"; String s85 = \"\"; String s86 = \"\"; String s87 = \"\"; String s88 = \"\"; String s89 = \"\"; String s90 = \"\";\n" +
- " String s91 = \"\"; String s92 = \"\"; String s93 = \"\"; String s94 = \"\"; String s95 = \"\"; String s96 = \"\"; String s97 = \"\"; String s98 = \"\"; String s99 = \"\"; String s100 = \"\";\n" +
- " String s101 = \"\"; String s102 = \"\"; String s103 = \"\"; String s104 = \"\"; String s105 = \"\"; String s106 = \"\"; String s107 = \"\"; String s108 = \"\"; String s109 = \"\"; String s110 = \"\";\n" +
- " String s111 = \"\"; String s112 = \"\"; String s113 = \"\"; String s114 = \"\"; String s115 = \"\"; String s116 = \"\"; String s117 = \"\"; String s118 = \"\"; String s119 = \"\"; String s120 = \"\";\n" +
- " String s121 = \"\"; String s122 = \"\"; String s123 = \"\"; String s124 = \"\"; String s125 = \"\"; String s126 = \"\"; String s127 = \"\"; String s128 = \"\"; String s129 = \"\"; String s130 = \"\";\n" +
- " String s131 = \"\"; String s132 = \"\"; String s133 = \"\"; String s134 = \"\"; String s135 = \"\"; String s136 = \"\"; String s137 = \"\"; String s138 = \"\"; String s139 = \"\"; String s140 = \"\";\n" +
- " String s141 = \"\"; String s142 = \"\"; String s143 = \"\"; String s144 = \"\"; String s145 = \"\"; String s146 = \"\"; String s147 = \"\"; String s148 = \"\"; String s149 = \"\"; String s150 = \"\";\n" +
- " String s151 = \"\"; String s152 = \"\"; String s153 = \"\"; String s154 = \"\"; String s155 = \"\"; String s156 = \"\"; String s157 = \"\"; String s158 = \"\"; String s159 = \"\"; String s160 = \"\";\n" +
- " String s161 = \"\"; String s162 = \"\"; String s163 = \"\"; String s164 = \"\"; String s165 = \"\"; String s166 = \"\"; String s167 = \"\"; String s168 = \"\"; String s169 = \"\"; String s170 = \"\";\n" +
- " String s171 = \"\"; String s172 = \"\"; String s173 = \"\"; String s174 = \"\"; String s175 = \"\"; String s176 = \"\"; String s177 = \"\"; String s178 = \"\"; String s179 = \"\"; String s180 = \"\";\n" +
- " String s181 = \"\"; String s182 = \"\"; String s183 = \"\"; String s184 = \"\"; String s185 = \"\"; String s186 = \"\"; String s187 = \"\"; String s188 = \"\"; String s189 = \"\"; String s190 = \"\";\n" +
- " String s191 = \"\"; String s192 = \"\"; String s193 = \"\"; String s194 = \"\"; String s195 = \"\"; String s196 = \"\"; String s197 = \"\"; String s198 = \"\"; String s199 = \"\"; String s200 = \"\";\n" +
- " String s201 = \"\"; String s202 = \"\"; String s203 = \"\"; String s204 = \"\"; String s205 = \"\"; String s206 = \"\"; String s207 = \"\"; String s208 = \"\"; String s209 = \"\"; String s210 = \"\";\n" +
- " String s211 = \"\"; String s212 = \"\"; String s213 = \"\"; String s214 = \"\"; String s215 = \"\"; String s216 = \"\"; String s217 = \"\"; String s218 = \"\"; String s219 = \"\"; String s220 = \"\";\n" +
- " String s221 = \"\"; String s222 = \"\"; String s223 = \"\"; String s224 = \"\"; String s225 = \"\"; String s226 = \"\"; String s227 = \"\"; String s228 = \"\"; String s229 = \"\"; String s230 = \"\";\n" +
- " String s231 = \"\"; String s232 = \"\"; String s233 = \"\"; String s234 = \"\"; String s235 = \"\"; String s236 = \"\"; String s237 = \"\"; String s238 = \"\"; String s239 = \"\"; String s240 = \"\";\n" +
- " String s241 = \"\"; String s242 = \"\"; String s243 = \"\"; String s244 = \"\"; String s245 = \"\"; String s246 = \"\"; String s247 = \"\"; String s248 = \"\"; String s249 = \"\"; String s250 = \"\";\n" +
- " String s251 = \"\"; String s252 = \"\";\n" +
- "\n" +
- " int size1 = 1;\n" +
- " int size2 = 2;\n" +
- " int size3 = 3;\n" +
- "\n" +
- " char[][][] array = new char[size1][size2][size3];\n" +
- " \n" +
- " for (int i = 0; i < size1; i++) {\n" +
- " for (int j = 0; j < size2; j++) {\n" +
- " boolean on = false;\n" +
- " for (int k = 0; k < size3; k++) {\n" +
- " array[i][j][k] = on ? 'c' : 'd';\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " new X().show();\n" +
- " }\n" +
+ "public final class X {\n" +
+ "\n" +
+ " public void show() {\n" +
+ " String s1 = \"\"; String s2 = \"\"; String s3 = \"\"; String s4 = \"\"; String s5 = \"\"; String s6 = \"\"; String s7 = \"\"; String s8 = \"\"; String s9 = \"\"; String s10 = \"\";\n" +
+ " String s11 = \"\"; String s12 = \"\"; String s13 = \"\"; String s14 = \"\"; String s15 = \"\"; String s16 = \"\"; String s17 = \"\"; String s18 = \"\"; String s19 = \"\"; String s20 = \"\";\n" +
+ " String s21 = \"\"; String s22 = \"\"; String s23 = \"\"; String s24 = \"\"; String s25 = \"\"; String s26 = \"\"; String s27 = \"\"; String s28 = \"\"; String s29 = \"\"; String s30 = \"\";\n" +
+ " String s31 = \"\"; String s32 = \"\"; String s33 = \"\"; String s34 = \"\"; String s35 = \"\"; String s36 = \"\"; String s37 = \"\"; String s38 = \"\"; String s39 = \"\"; String s40 = \"\";\n" +
+ " String s41 = \"\"; String s42 = \"\"; String s43 = \"\"; String s44 = \"\"; String s45 = \"\"; String s46 = \"\"; String s47 = \"\"; String s48 = \"\"; String s49 = \"\"; String s50 = \"\";\n" +
+ " String s51 = \"\"; String s52 = \"\"; String s53 = \"\"; String s54 = \"\"; String s55 = \"\"; String s56 = \"\"; String s57 = \"\"; String s58 = \"\"; String s59 = \"\"; String s60 = \"\";\n" +
+ " String s61 = \"\"; String s62 = \"\"; String s63 = \"\"; String s64 = \"\"; String s65 = \"\"; String s66 = \"\"; String s67 = \"\"; String s68 = \"\"; String s69 = \"\"; String s70 = \"\";\n" +
+ " String s71 = \"\"; String s72 = \"\"; String s73 = \"\"; String s74 = \"\"; String s75 = \"\"; String s76 = \"\"; String s77 = \"\"; String s78 = \"\"; String s79 = \"\"; String s80 = \"\";\n" +
+ " String s81 = \"\"; String s82 = \"\"; String s83 = \"\"; String s84 = \"\"; String s85 = \"\"; String s86 = \"\"; String s87 = \"\"; String s88 = \"\"; String s89 = \"\"; String s90 = \"\";\n" +
+ " String s91 = \"\"; String s92 = \"\"; String s93 = \"\"; String s94 = \"\"; String s95 = \"\"; String s96 = \"\"; String s97 = \"\"; String s98 = \"\"; String s99 = \"\"; String s100 = \"\";\n" +
+ " String s101 = \"\"; String s102 = \"\"; String s103 = \"\"; String s104 = \"\"; String s105 = \"\"; String s106 = \"\"; String s107 = \"\"; String s108 = \"\"; String s109 = \"\"; String s110 = \"\";\n" +
+ " String s111 = \"\"; String s112 = \"\"; String s113 = \"\"; String s114 = \"\"; String s115 = \"\"; String s116 = \"\"; String s117 = \"\"; String s118 = \"\"; String s119 = \"\"; String s120 = \"\";\n" +
+ " String s121 = \"\"; String s122 = \"\"; String s123 = \"\"; String s124 = \"\"; String s125 = \"\"; String s126 = \"\"; String s127 = \"\"; String s128 = \"\"; String s129 = \"\"; String s130 = \"\";\n" +
+ " String s131 = \"\"; String s132 = \"\"; String s133 = \"\"; String s134 = \"\"; String s135 = \"\"; String s136 = \"\"; String s137 = \"\"; String s138 = \"\"; String s139 = \"\"; String s140 = \"\";\n" +
+ " String s141 = \"\"; String s142 = \"\"; String s143 = \"\"; String s144 = \"\"; String s145 = \"\"; String s146 = \"\"; String s147 = \"\"; String s148 = \"\"; String s149 = \"\"; String s150 = \"\";\n" +
+ " String s151 = \"\"; String s152 = \"\"; String s153 = \"\"; String s154 = \"\"; String s155 = \"\"; String s156 = \"\"; String s157 = \"\"; String s158 = \"\"; String s159 = \"\"; String s160 = \"\";\n" +
+ " String s161 = \"\"; String s162 = \"\"; String s163 = \"\"; String s164 = \"\"; String s165 = \"\"; String s166 = \"\"; String s167 = \"\"; String s168 = \"\"; String s169 = \"\"; String s170 = \"\";\n" +
+ " String s171 = \"\"; String s172 = \"\"; String s173 = \"\"; String s174 = \"\"; String s175 = \"\"; String s176 = \"\"; String s177 = \"\"; String s178 = \"\"; String s179 = \"\"; String s180 = \"\";\n" +
+ " String s181 = \"\"; String s182 = \"\"; String s183 = \"\"; String s184 = \"\"; String s185 = \"\"; String s186 = \"\"; String s187 = \"\"; String s188 = \"\"; String s189 = \"\"; String s190 = \"\";\n" +
+ " String s191 = \"\"; String s192 = \"\"; String s193 = \"\"; String s194 = \"\"; String s195 = \"\"; String s196 = \"\"; String s197 = \"\"; String s198 = \"\"; String s199 = \"\"; String s200 = \"\";\n" +
+ " String s201 = \"\"; String s202 = \"\"; String s203 = \"\"; String s204 = \"\"; String s205 = \"\"; String s206 = \"\"; String s207 = \"\"; String s208 = \"\"; String s209 = \"\"; String s210 = \"\";\n" +
+ " String s211 = \"\"; String s212 = \"\"; String s213 = \"\"; String s214 = \"\"; String s215 = \"\"; String s216 = \"\"; String s217 = \"\"; String s218 = \"\"; String s219 = \"\"; String s220 = \"\";\n" +
+ " String s221 = \"\"; String s222 = \"\"; String s223 = \"\"; String s224 = \"\"; String s225 = \"\"; String s226 = \"\"; String s227 = \"\"; String s228 = \"\"; String s229 = \"\"; String s230 = \"\";\n" +
+ " String s231 = \"\"; String s232 = \"\"; String s233 = \"\"; String s234 = \"\"; String s235 = \"\"; String s236 = \"\"; String s237 = \"\"; String s238 = \"\"; String s239 = \"\"; String s240 = \"\";\n" +
+ " String s241 = \"\"; String s242 = \"\"; String s243 = \"\"; String s244 = \"\"; String s245 = \"\"; String s246 = \"\"; String s247 = \"\"; String s248 = \"\"; String s249 = \"\"; String s250 = \"\";\n" +
+ " String s251 = \"\"; String s252 = \"\";\n" +
+ "\n" +
+ " int size1 = 1;\n" +
+ " int size2 = 2;\n" +
+ " int size3 = 3;\n" +
+ "\n" +
+ " char[][][] array = new char[size1][size2][size3];\n" +
+ " \n" +
+ " for (int i = 0; i < size1; i++) {\n" +
+ " for (int j = 0; j < size2; j++) {\n" +
+ " boolean on = false;\n" +
+ " for (int k = 0; k < size3; k++) {\n" +
+ " array[i][j][k] = on ? 'c' : 'd';\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().show();\n" +
+ " }\n" +
"}",
},
"",
@@ -1664,56 +1664,56 @@ public void test014() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public final class X {\n" +
- "\n" +
- " public void show() {\n" +
- " String s1 = \"\"; String s2 = \"\"; String s3 = \"\"; String s4 = \"\"; String s5 = \"\"; String s6 = \"\"; String s7 = \"\"; String s8 = \"\"; String s9 = \"\"; String s10 = \"\";\n" +
- " String s11 = \"\"; String s12 = \"\"; String s13 = \"\"; String s14 = \"\"; String s15 = \"\"; String s16 = \"\"; String s17 = \"\"; String s18 = \"\"; String s19 = \"\"; String s20 = \"\";\n" +
- " String s21 = \"\"; String s22 = \"\"; String s23 = \"\"; String s24 = \"\"; String s25 = \"\"; String s26 = \"\"; String s27 = \"\"; String s28 = \"\"; String s29 = \"\"; String s30 = \"\";\n" +
- " String s31 = \"\"; String s32 = \"\"; String s33 = \"\"; String s34 = \"\"; String s35 = \"\"; String s36 = \"\"; String s37 = \"\"; String s38 = \"\"; String s39 = \"\"; String s40 = \"\";\n" +
- " String s41 = \"\"; String s42 = \"\"; String s43 = \"\"; String s44 = \"\"; String s45 = \"\"; String s46 = \"\"; String s47 = \"\"; String s48 = \"\"; String s49 = \"\"; String s50 = \"\";\n" +
- " String s51 = \"\"; String s52 = \"\"; String s53 = \"\"; String s54 = \"\"; String s55 = \"\"; String s56 = \"\"; String s57 = \"\"; String s58 = \"\"; String s59 = \"\"; String s60 = \"\";\n" +
- " String s61 = \"\"; String s62 = \"\"; String s63 = \"\"; String s64 = \"\"; String s65 = \"\"; String s66 = \"\"; String s67 = \"\"; String s68 = \"\"; String s69 = \"\"; String s70 = \"\";\n" +
- " String s71 = \"\"; String s72 = \"\"; String s73 = \"\"; String s74 = \"\"; String s75 = \"\"; String s76 = \"\"; String s77 = \"\"; String s78 = \"\"; String s79 = \"\"; String s80 = \"\";\n" +
- " String s81 = \"\"; String s82 = \"\"; String s83 = \"\"; String s84 = \"\"; String s85 = \"\"; String s86 = \"\"; String s87 = \"\"; String s88 = \"\"; String s89 = \"\"; String s90 = \"\";\n" +
- " String s91 = \"\"; String s92 = \"\"; String s93 = \"\"; String s94 = \"\"; String s95 = \"\"; String s96 = \"\"; String s97 = \"\"; String s98 = \"\"; String s99 = \"\"; String s100 = \"\";\n" +
- " String s101 = \"\"; String s102 = \"\"; String s103 = \"\"; String s104 = \"\"; String s105 = \"\"; String s106 = \"\"; String s107 = \"\"; String s108 = \"\"; String s109 = \"\"; String s110 = \"\";\n" +
- " String s111 = \"\"; String s112 = \"\"; String s113 = \"\"; String s114 = \"\"; String s115 = \"\"; String s116 = \"\"; String s117 = \"\"; String s118 = \"\"; String s119 = \"\"; String s120 = \"\";\n" +
- " String s121 = \"\"; String s122 = \"\"; String s123 = \"\"; String s124 = \"\"; String s125 = \"\"; String s126 = \"\"; String s127 = \"\"; String s128 = \"\"; String s129 = \"\"; String s130 = \"\";\n" +
- " String s131 = \"\"; String s132 = \"\"; String s133 = \"\"; String s134 = \"\"; String s135 = \"\"; String s136 = \"\"; String s137 = \"\"; String s138 = \"\"; String s139 = \"\"; String s140 = \"\";\n" +
- " String s141 = \"\"; String s142 = \"\"; String s143 = \"\"; String s144 = \"\"; String s145 = \"\"; String s146 = \"\"; String s147 = \"\"; String s148 = \"\"; String s149 = \"\"; String s150 = \"\";\n" +
- " String s151 = \"\"; String s152 = \"\"; String s153 = \"\"; String s154 = \"\"; String s155 = \"\"; String s156 = \"\"; String s157 = \"\"; String s158 = \"\"; String s159 = \"\"; String s160 = \"\";\n" +
- " String s161 = \"\"; String s162 = \"\"; String s163 = \"\"; String s164 = \"\"; String s165 = \"\"; String s166 = \"\"; String s167 = \"\"; String s168 = \"\"; String s169 = \"\"; String s170 = \"\";\n" +
- " String s171 = \"\"; String s172 = \"\"; String s173 = \"\"; String s174 = \"\"; String s175 = \"\"; String s176 = \"\"; String s177 = \"\"; String s178 = \"\"; String s179 = \"\"; String s180 = \"\";\n" +
- " String s181 = \"\"; String s182 = \"\"; String s183 = \"\"; String s184 = \"\"; String s185 = \"\"; String s186 = \"\"; String s187 = \"\"; String s188 = \"\"; String s189 = \"\"; String s190 = \"\";\n" +
- " String s191 = \"\"; String s192 = \"\"; String s193 = \"\"; String s194 = \"\"; String s195 = \"\"; String s196 = \"\"; String s197 = \"\"; String s198 = \"\"; String s199 = \"\"; String s200 = \"\";\n" +
- " String s201 = \"\"; String s202 = \"\"; String s203 = \"\"; String s204 = \"\"; String s205 = \"\"; String s206 = \"\"; String s207 = \"\"; String s208 = \"\"; String s209 = \"\"; String s210 = \"\";\n" +
- " String s211 = \"\"; String s212 = \"\"; String s213 = \"\"; String s214 = \"\"; String s215 = \"\"; String s216 = \"\"; String s217 = \"\"; String s218 = \"\"; String s219 = \"\"; String s220 = \"\";\n" +
- " String s221 = \"\"; String s222 = \"\"; String s223 = \"\"; String s224 = \"\"; String s225 = \"\"; String s226 = \"\"; String s227 = \"\"; String s228 = \"\"; String s229 = \"\"; String s230 = \"\";\n" +
- " String s231 = \"\"; String s232 = \"\"; String s233 = \"\"; String s234 = \"\"; String s235 = \"\"; String s236 = \"\"; String s237 = \"\"; String s238 = \"\"; String s239 = \"\"; String s240 = \"\";\n" +
- " String s241 = \"\"; String s242 = \"\"; String s243 = \"\"; String s244 = \"\"; String s245 = \"\"; String s246 = \"\"; String s247 = \"\"; String s248 = \"\"; String s249 = \"\"; String s250 = \"\";\n" +
- " String s251 = \"\"; String s252 = \"\";\n" +
- "\n" +
- " int size1 = 1;\n" +
- " int size2 = 2;\n" +
- " int size3 = 3;\n" +
- "\n" +
- " byte[][][] array = new byte[size1][size2][size3];\n" +
- " \n" +
- " for (int i = 0; i < size1; i++) {\n" +
- " for (int j = 0; j < size2; j++) {\n" +
- " boolean on = false;\n" +
- " for (int k = 0; k < size3; k++) {\n" +
- " array[i][j][k] = on ? (byte) 1 : (byte) 0;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " new X().show();\n" +
- " }\n" +
+ "public final class X {\n" +
+ "\n" +
+ " public void show() {\n" +
+ " String s1 = \"\"; String s2 = \"\"; String s3 = \"\"; String s4 = \"\"; String s5 = \"\"; String s6 = \"\"; String s7 = \"\"; String s8 = \"\"; String s9 = \"\"; String s10 = \"\";\n" +
+ " String s11 = \"\"; String s12 = \"\"; String s13 = \"\"; String s14 = \"\"; String s15 = \"\"; String s16 = \"\"; String s17 = \"\"; String s18 = \"\"; String s19 = \"\"; String s20 = \"\";\n" +
+ " String s21 = \"\"; String s22 = \"\"; String s23 = \"\"; String s24 = \"\"; String s25 = \"\"; String s26 = \"\"; String s27 = \"\"; String s28 = \"\"; String s29 = \"\"; String s30 = \"\";\n" +
+ " String s31 = \"\"; String s32 = \"\"; String s33 = \"\"; String s34 = \"\"; String s35 = \"\"; String s36 = \"\"; String s37 = \"\"; String s38 = \"\"; String s39 = \"\"; String s40 = \"\";\n" +
+ " String s41 = \"\"; String s42 = \"\"; String s43 = \"\"; String s44 = \"\"; String s45 = \"\"; String s46 = \"\"; String s47 = \"\"; String s48 = \"\"; String s49 = \"\"; String s50 = \"\";\n" +
+ " String s51 = \"\"; String s52 = \"\"; String s53 = \"\"; String s54 = \"\"; String s55 = \"\"; String s56 = \"\"; String s57 = \"\"; String s58 = \"\"; String s59 = \"\"; String s60 = \"\";\n" +
+ " String s61 = \"\"; String s62 = \"\"; String s63 = \"\"; String s64 = \"\"; String s65 = \"\"; String s66 = \"\"; String s67 = \"\"; String s68 = \"\"; String s69 = \"\"; String s70 = \"\";\n" +
+ " String s71 = \"\"; String s72 = \"\"; String s73 = \"\"; String s74 = \"\"; String s75 = \"\"; String s76 = \"\"; String s77 = \"\"; String s78 = \"\"; String s79 = \"\"; String s80 = \"\";\n" +
+ " String s81 = \"\"; String s82 = \"\"; String s83 = \"\"; String s84 = \"\"; String s85 = \"\"; String s86 = \"\"; String s87 = \"\"; String s88 = \"\"; String s89 = \"\"; String s90 = \"\";\n" +
+ " String s91 = \"\"; String s92 = \"\"; String s93 = \"\"; String s94 = \"\"; String s95 = \"\"; String s96 = \"\"; String s97 = \"\"; String s98 = \"\"; String s99 = \"\"; String s100 = \"\";\n" +
+ " String s101 = \"\"; String s102 = \"\"; String s103 = \"\"; String s104 = \"\"; String s105 = \"\"; String s106 = \"\"; String s107 = \"\"; String s108 = \"\"; String s109 = \"\"; String s110 = \"\";\n" +
+ " String s111 = \"\"; String s112 = \"\"; String s113 = \"\"; String s114 = \"\"; String s115 = \"\"; String s116 = \"\"; String s117 = \"\"; String s118 = \"\"; String s119 = \"\"; String s120 = \"\";\n" +
+ " String s121 = \"\"; String s122 = \"\"; String s123 = \"\"; String s124 = \"\"; String s125 = \"\"; String s126 = \"\"; String s127 = \"\"; String s128 = \"\"; String s129 = \"\"; String s130 = \"\";\n" +
+ " String s131 = \"\"; String s132 = \"\"; String s133 = \"\"; String s134 = \"\"; String s135 = \"\"; String s136 = \"\"; String s137 = \"\"; String s138 = \"\"; String s139 = \"\"; String s140 = \"\";\n" +
+ " String s141 = \"\"; String s142 = \"\"; String s143 = \"\"; String s144 = \"\"; String s145 = \"\"; String s146 = \"\"; String s147 = \"\"; String s148 = \"\"; String s149 = \"\"; String s150 = \"\";\n" +
+ " String s151 = \"\"; String s152 = \"\"; String s153 = \"\"; String s154 = \"\"; String s155 = \"\"; String s156 = \"\"; String s157 = \"\"; String s158 = \"\"; String s159 = \"\"; String s160 = \"\";\n" +
+ " String s161 = \"\"; String s162 = \"\"; String s163 = \"\"; String s164 = \"\"; String s165 = \"\"; String s166 = \"\"; String s167 = \"\"; String s168 = \"\"; String s169 = \"\"; String s170 = \"\";\n" +
+ " String s171 = \"\"; String s172 = \"\"; String s173 = \"\"; String s174 = \"\"; String s175 = \"\"; String s176 = \"\"; String s177 = \"\"; String s178 = \"\"; String s179 = \"\"; String s180 = \"\";\n" +
+ " String s181 = \"\"; String s182 = \"\"; String s183 = \"\"; String s184 = \"\"; String s185 = \"\"; String s186 = \"\"; String s187 = \"\"; String s188 = \"\"; String s189 = \"\"; String s190 = \"\";\n" +
+ " String s191 = \"\"; String s192 = \"\"; String s193 = \"\"; String s194 = \"\"; String s195 = \"\"; String s196 = \"\"; String s197 = \"\"; String s198 = \"\"; String s199 = \"\"; String s200 = \"\";\n" +
+ " String s201 = \"\"; String s202 = \"\"; String s203 = \"\"; String s204 = \"\"; String s205 = \"\"; String s206 = \"\"; String s207 = \"\"; String s208 = \"\"; String s209 = \"\"; String s210 = \"\";\n" +
+ " String s211 = \"\"; String s212 = \"\"; String s213 = \"\"; String s214 = \"\"; String s215 = \"\"; String s216 = \"\"; String s217 = \"\"; String s218 = \"\"; String s219 = \"\"; String s220 = \"\";\n" +
+ " String s221 = \"\"; String s222 = \"\"; String s223 = \"\"; String s224 = \"\"; String s225 = \"\"; String s226 = \"\"; String s227 = \"\"; String s228 = \"\"; String s229 = \"\"; String s230 = \"\";\n" +
+ " String s231 = \"\"; String s232 = \"\"; String s233 = \"\"; String s234 = \"\"; String s235 = \"\"; String s236 = \"\"; String s237 = \"\"; String s238 = \"\"; String s239 = \"\"; String s240 = \"\";\n" +
+ " String s241 = \"\"; String s242 = \"\"; String s243 = \"\"; String s244 = \"\"; String s245 = \"\"; String s246 = \"\"; String s247 = \"\"; String s248 = \"\"; String s249 = \"\"; String s250 = \"\";\n" +
+ " String s251 = \"\"; String s252 = \"\";\n" +
+ "\n" +
+ " int size1 = 1;\n" +
+ " int size2 = 2;\n" +
+ " int size3 = 3;\n" +
+ "\n" +
+ " byte[][][] array = new byte[size1][size2][size3];\n" +
+ " \n" +
+ " for (int i = 0; i < size1; i++) {\n" +
+ " for (int j = 0; j < size2; j++) {\n" +
+ " boolean on = false;\n" +
+ " for (int k = 0; k < size3; k++) {\n" +
+ " array[i][j][k] = on ? (byte) 1 : (byte) 0;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().show();\n" +
+ " }\n" +
"}",
},
"",
@@ -1726,56 +1726,56 @@ public void test015() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public final class X {\n" +
- "\n" +
- " public void show() {\n" +
- " String s1 = \"\"; String s2 = \"\"; String s3 = \"\"; String s4 = \"\"; String s5 = \"\"; String s6 = \"\"; String s7 = \"\"; String s8 = \"\"; String s9 = \"\"; String s10 = \"\";\n" +
- " String s11 = \"\"; String s12 = \"\"; String s13 = \"\"; String s14 = \"\"; String s15 = \"\"; String s16 = \"\"; String s17 = \"\"; String s18 = \"\"; String s19 = \"\"; String s20 = \"\";\n" +
- " String s21 = \"\"; String s22 = \"\"; String s23 = \"\"; String s24 = \"\"; String s25 = \"\"; String s26 = \"\"; String s27 = \"\"; String s28 = \"\"; String s29 = \"\"; String s30 = \"\";\n" +
- " String s31 = \"\"; String s32 = \"\"; String s33 = \"\"; String s34 = \"\"; String s35 = \"\"; String s36 = \"\"; String s37 = \"\"; String s38 = \"\"; String s39 = \"\"; String s40 = \"\";\n" +
- " String s41 = \"\"; String s42 = \"\"; String s43 = \"\"; String s44 = \"\"; String s45 = \"\"; String s46 = \"\"; String s47 = \"\"; String s48 = \"\"; String s49 = \"\"; String s50 = \"\";\n" +
- " String s51 = \"\"; String s52 = \"\"; String s53 = \"\"; String s54 = \"\"; String s55 = \"\"; String s56 = \"\"; String s57 = \"\"; String s58 = \"\"; String s59 = \"\"; String s60 = \"\";\n" +
- " String s61 = \"\"; String s62 = \"\"; String s63 = \"\"; String s64 = \"\"; String s65 = \"\"; String s66 = \"\"; String s67 = \"\"; String s68 = \"\"; String s69 = \"\"; String s70 = \"\";\n" +
- " String s71 = \"\"; String s72 = \"\"; String s73 = \"\"; String s74 = \"\"; String s75 = \"\"; String s76 = \"\"; String s77 = \"\"; String s78 = \"\"; String s79 = \"\"; String s80 = \"\";\n" +
- " String s81 = \"\"; String s82 = \"\"; String s83 = \"\"; String s84 = \"\"; String s85 = \"\"; String s86 = \"\"; String s87 = \"\"; String s88 = \"\"; String s89 = \"\"; String s90 = \"\";\n" +
- " String s91 = \"\"; String s92 = \"\"; String s93 = \"\"; String s94 = \"\"; String s95 = \"\"; String s96 = \"\"; String s97 = \"\"; String s98 = \"\"; String s99 = \"\"; String s100 = \"\";\n" +
- " String s101 = \"\"; String s102 = \"\"; String s103 = \"\"; String s104 = \"\"; String s105 = \"\"; String s106 = \"\"; String s107 = \"\"; String s108 = \"\"; String s109 = \"\"; String s110 = \"\";\n" +
- " String s111 = \"\"; String s112 = \"\"; String s113 = \"\"; String s114 = \"\"; String s115 = \"\"; String s116 = \"\"; String s117 = \"\"; String s118 = \"\"; String s119 = \"\"; String s120 = \"\";\n" +
- " String s121 = \"\"; String s122 = \"\"; String s123 = \"\"; String s124 = \"\"; String s125 = \"\"; String s126 = \"\"; String s127 = \"\"; String s128 = \"\"; String s129 = \"\"; String s130 = \"\";\n" +
- " String s131 = \"\"; String s132 = \"\"; String s133 = \"\"; String s134 = \"\"; String s135 = \"\"; String s136 = \"\"; String s137 = \"\"; String s138 = \"\"; String s139 = \"\"; String s140 = \"\";\n" +
- " String s141 = \"\"; String s142 = \"\"; String s143 = \"\"; String s144 = \"\"; String s145 = \"\"; String s146 = \"\"; String s147 = \"\"; String s148 = \"\"; String s149 = \"\"; String s150 = \"\";\n" +
- " String s151 = \"\"; String s152 = \"\"; String s153 = \"\"; String s154 = \"\"; String s155 = \"\"; String s156 = \"\"; String s157 = \"\"; String s158 = \"\"; String s159 = \"\"; String s160 = \"\";\n" +
- " String s161 = \"\"; String s162 = \"\"; String s163 = \"\"; String s164 = \"\"; String s165 = \"\"; String s166 = \"\"; String s167 = \"\"; String s168 = \"\"; String s169 = \"\"; String s170 = \"\";\n" +
- " String s171 = \"\"; String s172 = \"\"; String s173 = \"\"; String s174 = \"\"; String s175 = \"\"; String s176 = \"\"; String s177 = \"\"; String s178 = \"\"; String s179 = \"\"; String s180 = \"\";\n" +
- " String s181 = \"\"; String s182 = \"\"; String s183 = \"\"; String s184 = \"\"; String s185 = \"\"; String s186 = \"\"; String s187 = \"\"; String s188 = \"\"; String s189 = \"\"; String s190 = \"\";\n" +
- " String s191 = \"\"; String s192 = \"\"; String s193 = \"\"; String s194 = \"\"; String s195 = \"\"; String s196 = \"\"; String s197 = \"\"; String s198 = \"\"; String s199 = \"\"; String s200 = \"\";\n" +
- " String s201 = \"\"; String s202 = \"\"; String s203 = \"\"; String s204 = \"\"; String s205 = \"\"; String s206 = \"\"; String s207 = \"\"; String s208 = \"\"; String s209 = \"\"; String s210 = \"\";\n" +
- " String s211 = \"\"; String s212 = \"\"; String s213 = \"\"; String s214 = \"\"; String s215 = \"\"; String s216 = \"\"; String s217 = \"\"; String s218 = \"\"; String s219 = \"\"; String s220 = \"\";\n" +
- " String s221 = \"\"; String s222 = \"\"; String s223 = \"\"; String s224 = \"\"; String s225 = \"\"; String s226 = \"\"; String s227 = \"\"; String s228 = \"\"; String s229 = \"\"; String s230 = \"\";\n" +
- " String s231 = \"\"; String s232 = \"\"; String s233 = \"\"; String s234 = \"\"; String s235 = \"\"; String s236 = \"\"; String s237 = \"\"; String s238 = \"\"; String s239 = \"\"; String s240 = \"\";\n" +
- " String s241 = \"\"; String s242 = \"\"; String s243 = \"\"; String s244 = \"\"; String s245 = \"\"; String s246 = \"\"; String s247 = \"\"; String s248 = \"\"; String s249 = \"\"; String s250 = \"\";\n" +
- " String s251 = \"\"; String s252 = \"\";\n" +
- "\n" +
- " int size1 = 1;\n" +
- " int size2 = 2;\n" +
- " int size3 = 3;\n" +
- "\n" +
- " short[][][] array = new short[size1][size2][size3];\n" +
- " \n" +
- " for (int i = 0; i < size1; i++) {\n" +
- " for (int j = 0; j < size2; j++) {\n" +
- " boolean on = false;\n" +
- " for (int k = 0; k < size3; k++) {\n" +
- " array[i][j][k] = on ? (short) 1 : (short) 0;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " new X().show();\n" +
- " }\n" +
+ "public final class X {\n" +
+ "\n" +
+ " public void show() {\n" +
+ " String s1 = \"\"; String s2 = \"\"; String s3 = \"\"; String s4 = \"\"; String s5 = \"\"; String s6 = \"\"; String s7 = \"\"; String s8 = \"\"; String s9 = \"\"; String s10 = \"\";\n" +
+ " String s11 = \"\"; String s12 = \"\"; String s13 = \"\"; String s14 = \"\"; String s15 = \"\"; String s16 = \"\"; String s17 = \"\"; String s18 = \"\"; String s19 = \"\"; String s20 = \"\";\n" +
+ " String s21 = \"\"; String s22 = \"\"; String s23 = \"\"; String s24 = \"\"; String s25 = \"\"; String s26 = \"\"; String s27 = \"\"; String s28 = \"\"; String s29 = \"\"; String s30 = \"\";\n" +
+ " String s31 = \"\"; String s32 = \"\"; String s33 = \"\"; String s34 = \"\"; String s35 = \"\"; String s36 = \"\"; String s37 = \"\"; String s38 = \"\"; String s39 = \"\"; String s40 = \"\";\n" +
+ " String s41 = \"\"; String s42 = \"\"; String s43 = \"\"; String s44 = \"\"; String s45 = \"\"; String s46 = \"\"; String s47 = \"\"; String s48 = \"\"; String s49 = \"\"; String s50 = \"\";\n" +
+ " String s51 = \"\"; String s52 = \"\"; String s53 = \"\"; String s54 = \"\"; String s55 = \"\"; String s56 = \"\"; String s57 = \"\"; String s58 = \"\"; String s59 = \"\"; String s60 = \"\";\n" +
+ " String s61 = \"\"; String s62 = \"\"; String s63 = \"\"; String s64 = \"\"; String s65 = \"\"; String s66 = \"\"; String s67 = \"\"; String s68 = \"\"; String s69 = \"\"; String s70 = \"\";\n" +
+ " String s71 = \"\"; String s72 = \"\"; String s73 = \"\"; String s74 = \"\"; String s75 = \"\"; String s76 = \"\"; String s77 = \"\"; String s78 = \"\"; String s79 = \"\"; String s80 = \"\";\n" +
+ " String s81 = \"\"; String s82 = \"\"; String s83 = \"\"; String s84 = \"\"; String s85 = \"\"; String s86 = \"\"; String s87 = \"\"; String s88 = \"\"; String s89 = \"\"; String s90 = \"\";\n" +
+ " String s91 = \"\"; String s92 = \"\"; String s93 = \"\"; String s94 = \"\"; String s95 = \"\"; String s96 = \"\"; String s97 = \"\"; String s98 = \"\"; String s99 = \"\"; String s100 = \"\";\n" +
+ " String s101 = \"\"; String s102 = \"\"; String s103 = \"\"; String s104 = \"\"; String s105 = \"\"; String s106 = \"\"; String s107 = \"\"; String s108 = \"\"; String s109 = \"\"; String s110 = \"\";\n" +
+ " String s111 = \"\"; String s112 = \"\"; String s113 = \"\"; String s114 = \"\"; String s115 = \"\"; String s116 = \"\"; String s117 = \"\"; String s118 = \"\"; String s119 = \"\"; String s120 = \"\";\n" +
+ " String s121 = \"\"; String s122 = \"\"; String s123 = \"\"; String s124 = \"\"; String s125 = \"\"; String s126 = \"\"; String s127 = \"\"; String s128 = \"\"; String s129 = \"\"; String s130 = \"\";\n" +
+ " String s131 = \"\"; String s132 = \"\"; String s133 = \"\"; String s134 = \"\"; String s135 = \"\"; String s136 = \"\"; String s137 = \"\"; String s138 = \"\"; String s139 = \"\"; String s140 = \"\";\n" +
+ " String s141 = \"\"; String s142 = \"\"; String s143 = \"\"; String s144 = \"\"; String s145 = \"\"; String s146 = \"\"; String s147 = \"\"; String s148 = \"\"; String s149 = \"\"; String s150 = \"\";\n" +
+ " String s151 = \"\"; String s152 = \"\"; String s153 = \"\"; String s154 = \"\"; String s155 = \"\"; String s156 = \"\"; String s157 = \"\"; String s158 = \"\"; String s159 = \"\"; String s160 = \"\";\n" +
+ " String s161 = \"\"; String s162 = \"\"; String s163 = \"\"; String s164 = \"\"; String s165 = \"\"; String s166 = \"\"; String s167 = \"\"; String s168 = \"\"; String s169 = \"\"; String s170 = \"\";\n" +
+ " String s171 = \"\"; String s172 = \"\"; String s173 = \"\"; String s174 = \"\"; String s175 = \"\"; String s176 = \"\"; String s177 = \"\"; String s178 = \"\"; String s179 = \"\"; String s180 = \"\";\n" +
+ " String s181 = \"\"; String s182 = \"\"; String s183 = \"\"; String s184 = \"\"; String s185 = \"\"; String s186 = \"\"; String s187 = \"\"; String s188 = \"\"; String s189 = \"\"; String s190 = \"\";\n" +
+ " String s191 = \"\"; String s192 = \"\"; String s193 = \"\"; String s194 = \"\"; String s195 = \"\"; String s196 = \"\"; String s197 = \"\"; String s198 = \"\"; String s199 = \"\"; String s200 = \"\";\n" +
+ " String s201 = \"\"; String s202 = \"\"; String s203 = \"\"; String s204 = \"\"; String s205 = \"\"; String s206 = \"\"; String s207 = \"\"; String s208 = \"\"; String s209 = \"\"; String s210 = \"\";\n" +
+ " String s211 = \"\"; String s212 = \"\"; String s213 = \"\"; String s214 = \"\"; String s215 = \"\"; String s216 = \"\"; String s217 = \"\"; String s218 = \"\"; String s219 = \"\"; String s220 = \"\";\n" +
+ " String s221 = \"\"; String s222 = \"\"; String s223 = \"\"; String s224 = \"\"; String s225 = \"\"; String s226 = \"\"; String s227 = \"\"; String s228 = \"\"; String s229 = \"\"; String s230 = \"\";\n" +
+ " String s231 = \"\"; String s232 = \"\"; String s233 = \"\"; String s234 = \"\"; String s235 = \"\"; String s236 = \"\"; String s237 = \"\"; String s238 = \"\"; String s239 = \"\"; String s240 = \"\";\n" +
+ " String s241 = \"\"; String s242 = \"\"; String s243 = \"\"; String s244 = \"\"; String s245 = \"\"; String s246 = \"\"; String s247 = \"\"; String s248 = \"\"; String s249 = \"\"; String s250 = \"\";\n" +
+ " String s251 = \"\"; String s252 = \"\";\n" +
+ "\n" +
+ " int size1 = 1;\n" +
+ " int size2 = 2;\n" +
+ " int size3 = 3;\n" +
+ "\n" +
+ " short[][][] array = new short[size1][size2][size3];\n" +
+ " \n" +
+ " for (int i = 0; i < size1; i++) {\n" +
+ " for (int j = 0; j < size2; j++) {\n" +
+ " boolean on = false;\n" +
+ " for (int k = 0; k < size3; k++) {\n" +
+ " array[i][j][k] = on ? (short) 1 : (short) 0;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().show();\n" +
+ " }\n" +
"}",
},
"",
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ForeachStatementTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ForeachStatementTest.java
index 352d8f021..01bd9dca2 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ForeachStatementTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ForeachStatementTest.java
@@ -83,11 +83,11 @@ public void test002() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " for (int value : new int[] {value}) {\n" +
- " ^^^^^\n" +
- "value cannot be resolved to a variable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " for (int value : new int[] {value}) {\n" +
+ " ^^^^^\n" +
+ "value cannot be resolved to a variable\n" +
"----------\n");
}
public void test003() {
@@ -103,11 +103,11 @@ public void test003() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " for (int value : value) {\n" +
- " ^^^^^\n" +
- "value cannot be resolved to a variable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " for (int value : value) {\n" +
+ " ^^^^^\n" +
+ "value cannot be resolved to a variable\n" +
"----------\n");
}
public void test004() {
@@ -1811,36 +1811,36 @@ public void test036() throws Exception {
},
"ab");
String expectedOutput =
- " // Method descriptor #37 (Ljava/lang/Runnable;)V\n" +
- " // Signature: <T::Ljava/lang/Runnable;:Ljava/lang/Iterable<Ljava/lang/String;>;>(TT;)V\n" +
- " // Stack: 2, Locals: 4\n" +
- " public void foo(java.lang.Runnable t);\n" +
- " 0 aload_1 [t]\n" +
- " 1 checkcast java.lang.Iterable [5]\n" +
- " 4 invokeinterface java.lang.Iterable.iterator() : java.util.Iterator [39] [nargs: 1]\n" +
- " 9 astore_3\n" +
- " 10 goto 30\n" +
- " 13 aload_3\n" +
- " 14 invokeinterface java.util.Iterator.next() : java.lang.Object [43] [nargs: 1]\n" +
- " 19 checkcast java.lang.String [18]\n" +
- " 22 astore_2 [s]\n" +
- " 23 getstatic java.lang.System.out : java.io.PrintStream [49]\n" +
- " 26 aload_2 [s]\n" +
- " 27 invokevirtual java.io.PrintStream.print(java.lang.String) : void [55]\n" +
- " 30 aload_3\n" +
- " 31 invokeinterface java.util.Iterator.hasNext() : boolean [61] [nargs: 1]\n" +
- " 36 ifne 13\n" +
- " 39 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 7]\n" +
- " [pc: 23, line: 8]\n" +
- " [pc: 30, line: 7]\n" +
- " [pc: 39, line: 9]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 40] local: this index: 0 type: X\n" +
- " [pc: 0, pc: 40] local: t index: 1 type: java.lang.Runnable\n" +
- " [pc: 23, pc: 30] local: s index: 2 type: java.lang.String\n" +
- " Local variable type table:\n" +
+ " // Method descriptor #37 (Ljava/lang/Runnable;)V\n" +
+ " // Signature: <T::Ljava/lang/Runnable;:Ljava/lang/Iterable<Ljava/lang/String;>;>(TT;)V\n" +
+ " // Stack: 2, Locals: 4\n" +
+ " public void foo(java.lang.Runnable t);\n" +
+ " 0 aload_1 [t]\n" +
+ " 1 checkcast java.lang.Iterable [5]\n" +
+ " 4 invokeinterface java.lang.Iterable.iterator() : java.util.Iterator [39] [nargs: 1]\n" +
+ " 9 astore_3\n" +
+ " 10 goto 30\n" +
+ " 13 aload_3\n" +
+ " 14 invokeinterface java.util.Iterator.next() : java.lang.Object [43] [nargs: 1]\n" +
+ " 19 checkcast java.lang.String [18]\n" +
+ " 22 astore_2 [s]\n" +
+ " 23 getstatic java.lang.System.out : java.io.PrintStream [49]\n" +
+ " 26 aload_2 [s]\n" +
+ " 27 invokevirtual java.io.PrintStream.print(java.lang.String) : void [55]\n" +
+ " 30 aload_3\n" +
+ " 31 invokeinterface java.util.Iterator.hasNext() : boolean [61] [nargs: 1]\n" +
+ " 36 ifne 13\n" +
+ " 39 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 7]\n" +
+ " [pc: 23, line: 8]\n" +
+ " [pc: 30, line: 7]\n" +
+ " [pc: 39, line: 9]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 40] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 40] local: t index: 1 type: java.lang.Runnable\n" +
+ " [pc: 23, pc: 30] local: s index: 2 type: java.lang.String\n" +
+ " Local variable type table:\n" +
" [pc: 0, pc: 40] local: t index: 1 type: T\n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -1882,34 +1882,34 @@ public void test037() throws Exception {
"ab");
String expectedOutput =
- " // Method descriptor #41 (Ljava/util/ArrayList;)V\n" +
- " // Signature: <T:Ljava/util/ArrayList<Ljava/lang/String;>;>(TT;)V\n" +
- " // Stack: 2, Locals: 3\n" +
- " public static void foo(java.util.ArrayList t);\n" +
- " 0 aload_0 [t]\n" +
- " 1 invokevirtual java.util.ArrayList.iterator() : java.util.Iterator [43]\n" +
- " 4 astore_2\n" +
- " 5 goto 25\n" +
- " 8 aload_2\n" +
- " 9 invokeinterface java.util.Iterator.next() : java.lang.Object [47] [nargs: 1]\n" +
- " 14 checkcast java.lang.String [19]\n" +
- " 17 astore_1 [s]\n" +
- " 18 getstatic java.lang.System.out : java.io.PrintStream [53]\n" +
- " 21 aload_1 [s]\n" +
- " 22 invokevirtual java.io.PrintStream.print(java.lang.String) : void [59]\n" +
- " 25 aload_2\n" +
- " 26 invokeinterface java.util.Iterator.hasNext() : boolean [65] [nargs: 1]\n" +
- " 31 ifne 8\n" +
- " 34 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 8]\n" +
- " [pc: 18, line: 9]\n" +
- " [pc: 25, line: 8]\n" +
- " [pc: 34, line: 10]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 35] local: t index: 0 type: java.util.ArrayList\n" +
- " [pc: 18, pc: 25] local: s index: 1 type: java.lang.String\n" +
- " Local variable type table:\n" +
+ " // Method descriptor #41 (Ljava/util/ArrayList;)V\n" +
+ " // Signature: <T:Ljava/util/ArrayList<Ljava/lang/String;>;>(TT;)V\n" +
+ " // Stack: 2, Locals: 3\n" +
+ " public static void foo(java.util.ArrayList t);\n" +
+ " 0 aload_0 [t]\n" +
+ " 1 invokevirtual java.util.ArrayList.iterator() : java.util.Iterator [43]\n" +
+ " 4 astore_2\n" +
+ " 5 goto 25\n" +
+ " 8 aload_2\n" +
+ " 9 invokeinterface java.util.Iterator.next() : java.lang.Object [47] [nargs: 1]\n" +
+ " 14 checkcast java.lang.String [19]\n" +
+ " 17 astore_1 [s]\n" +
+ " 18 getstatic java.lang.System.out : java.io.PrintStream [53]\n" +
+ " 21 aload_1 [s]\n" +
+ " 22 invokevirtual java.io.PrintStream.print(java.lang.String) : void [59]\n" +
+ " 25 aload_2\n" +
+ " 26 invokeinterface java.util.Iterator.hasNext() : boolean [65] [nargs: 1]\n" +
+ " 31 ifne 8\n" +
+ " 34 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 8]\n" +
+ " [pc: 18, line: 9]\n" +
+ " [pc: 25, line: 8]\n" +
+ " [pc: 34, line: 10]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 35] local: t index: 0 type: java.util.ArrayList\n" +
+ " [pc: 18, pc: 25] local: s index: 1 type: java.lang.String\n" +
+ " Local variable type table:\n" +
" [pc: 0, pc: 35] local: t index: 0 type: T\n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -2702,19 +2702,19 @@ public void test050() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T> {\n" +
- " private T values;\n" +
- " public X(T values) {\n" +
- " this.values = values;\n" +
- " }\n" +
- " public T getValues() {\n" +
- " return values;\n" +
- " }\n" +
+ "public class X<T> {\n" +
+ " private T values;\n" +
+ " public X(T values) {\n" +
+ " this.values = values;\n" +
+ " }\n" +
+ " public T getValues() {\n" +
+ " return values;\n" +
+ " }\n" +
" public static void main(String[] args) {\n" +
- " X<short[]> x = new X<short[]>(new short[] { 1, 2, 3, 4, 5 });\n" +
- " for (int i : x.getValues()) {\n" +
- " System.out.print(i);\n" +
- " }\n" +
+ " X<short[]> x = new X<short[]>(new short[] { 1, 2, 3, 4, 5 });\n" +
+ " for (int i : x.getValues()) {\n" +
+ " System.out.print(i);\n" +
+ " }\n" +
" }\n" +
"}",
},
@@ -2725,19 +2725,19 @@ public void test051() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T> {\n" +
- " private T values;\n" +
- " public X(T values) {\n" +
- " this.values = values;\n" +
- " }\n" +
- " public T getValues() {\n" +
- " return values;\n" +
- " }\n" +
+ "public class X<T> {\n" +
+ " private T values;\n" +
+ " public X(T values) {\n" +
+ " this.values = values;\n" +
+ " }\n" +
+ " public T getValues() {\n" +
+ " return values;\n" +
+ " }\n" +
" public static void main(String[] args) {\n" +
- " X<short[]> x = new X<short[]>(new short[] { 1, 2, 3, 4, 5 });\n" +
- " for (long l : x.getValues()) {\n" +
- " System.out.print(l);\n" +
- " }\n" +
+ " X<short[]> x = new X<short[]>(new short[] { 1, 2, 3, 4, 5 });\n" +
+ " for (long l : x.getValues()) {\n" +
+ " System.out.print(l);\n" +
+ " }\n" +
" }\n" +
"}",
},
@@ -2748,19 +2748,19 @@ public void test052() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T> {\n" +
- " private T values;\n" +
- " public X(T values) {\n" +
- " this.values = values;\n" +
- " }\n" +
- " public T getValues() {\n" +
- " return values;\n" +
- " }\n" +
+ "public class X<T> {\n" +
+ " private T values;\n" +
+ " public X(T values) {\n" +
+ " this.values = values;\n" +
+ " }\n" +
+ " public T getValues() {\n" +
+ " return values;\n" +
+ " }\n" +
" public static void main(String[] args) {\n" +
- " X<Short[]> x = new X<Short[]>(new Short[] { 1, 2, 3, 4, 5 });\n" +
- " for (int i : x.getValues()) {\n" +
- " System.out.print(i);\n" +
- " }\n" +
+ " X<Short[]> x = new X<Short[]>(new Short[] { 1, 2, 3, 4, 5 });\n" +
+ " for (int i : x.getValues()) {\n" +
+ " System.out.print(i);\n" +
+ " }\n" +
" }\n" +
"}",
},
@@ -2771,19 +2771,19 @@ public void test053() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T> {\n" +
- " private T values;\n" +
- " public X(T values) {\n" +
- " this.values = values;\n" +
- " }\n" +
- " public T getValues() {\n" +
- " return values;\n" +
- " }\n" +
+ "public class X<T> {\n" +
+ " private T values;\n" +
+ " public X(T values) {\n" +
+ " this.values = values;\n" +
+ " }\n" +
+ " public T getValues() {\n" +
+ " return values;\n" +
+ " }\n" +
" public static void main(String[] args) {\n" +
- " X<Short[]> x = new X<Short[]>(new Short[] { 1, 2, 3, 4, 5 });\n" +
- " for (long i : x.getValues()) {\n" +
- " System.out.print(i);\n" +
- " }\n" +
+ " X<Short[]> x = new X<Short[]>(new Short[] { 1, 2, 3, 4, 5 });\n" +
+ " for (long i : x.getValues()) {\n" +
+ " System.out.print(i);\n" +
+ " }\n" +
" }\n" +
"}",
},
@@ -2816,31 +2816,31 @@ public void test054() throws Exception {
" Zork z;\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " Set<String> [] OK= new Set[] { x, y };\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Set[] needs unchecked conversion to conform to Set<String>[]\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " for (Set<String> BUG : new Set[] { x, y }) {\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Elements of type Set need unchecked conversion to conform to Set<String>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 14)\n" +
- " Set [] set = new Set[] { x, y };\n" +
- " ^^^\n" +
- "Set is a raw type. References to generic type Set<E> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 15)\n" +
- " for (Set<String> BUG : set) {\n" +
- " ^^^\n" +
- "Type safety: Elements of type Set need unchecked conversion to conform to Set<String>\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 20)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " Set<String> [] OK= new Set[] { x, y };\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Set[] needs unchecked conversion to conform to Set<String>[]\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " for (Set<String> BUG : new Set[] { x, y }) {\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Elements of type Set need unchecked conversion to conform to Set<String>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 14)\n" +
+ " Set [] set = new Set[] { x, y };\n" +
+ " ^^^\n" +
+ "Set is a raw type. References to generic type Set<E> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 15)\n" +
+ " for (Set<String> BUG : set) {\n" +
+ " ^^^\n" +
+ "Type safety: Elements of type Set need unchecked conversion to conform to Set<String>\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 20)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/393719
@@ -2871,11 +2871,11 @@ public void test055() throws Exception {
" Zork z;\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 20)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 20)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/393719
@@ -2886,32 +2886,32 @@ public void test056() throws Exception {
"X.java",
"import java.util.List;\n" +
"public class X {\n" +
- " void testRawType(@SuppressWarnings(\"rawtypes\") List<List> lists) {\n" +
- " List<String> stringList = lists.get(0); // (1)\n" +
- " for (List<String> strings : lists) // (2)\n" +
- " stringList = strings;\n" +
- " for (@SuppressWarnings(\"unchecked\") List<String> strings : lists) // no warning\n" +
- " stringList = strings;\n" +
+ " void testRawType(@SuppressWarnings(\"rawtypes\") List<List> lists) {\n" +
+ " List<String> stringList = lists.get(0); // (1)\n" +
+ " for (List<String> strings : lists) // (2)\n" +
+ " stringList = strings;\n" +
+ " for (@SuppressWarnings(\"unchecked\") List<String> strings : lists) // no warning\n" +
+ " stringList = strings;\n" +
" System.out.println(stringList.get(0));\n" +
" }\n" +
" Zork z;\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " List<String> stringList = lists.get(0); // (1)\n" +
- " ^^^^^^^^^^^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<String>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " for (List<String> strings : lists) // (2)\n" +
- " ^^^^^\n" +
- "Type safety: Elements of type List need unchecked conversion to conform to List<String>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " List<String> stringList = lists.get(0); // (1)\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<String>\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " for (List<String> strings : lists) // (2)\n" +
+ " ^^^^^\n" +
+ "Type safety: Elements of type List need unchecked conversion to conform to List<String>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401853
@@ -2923,12 +2923,12 @@ public void test057() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "import java.util.ArrayList;\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] argv) {\n" +
- " for (long l : new ArrayList<Long>()) {}\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String[] argv) {\n" +
+ " for (long l : new ArrayList<Long>()) {}\n" +
+ " }\n" +
"}",
},
"",
@@ -2939,41 +2939,41 @@ public void test057() throws Exception {
null);
String expectedOutput =
- "public class X {\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [8]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- " \n" +
- " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
- " // Stack: 2, Locals: 2\n" +
- " public static void main(java.lang.String[] argv);\n" +
- " 0 new java.util.ArrayList [16]\n" +
- " 3 dup\n" +
- " 4 invokespecial java.util.ArrayList() [18]\n" +
- " 7 invokevirtual java.util.ArrayList.iterator() : java.util.Iterator [19]\n" +
- " 10 astore_1\n" +
- " 11 goto 27\n" +
- " 14 aload_1\n" +
- " 15 invokeinterface java.util.Iterator.next() : java.lang.Object [23] [nargs: 1]\n" +
- " 20 checkcast java.lang.Long [29]\n" +
- " 23 invokevirtual java.lang.Long.longValue() : long [31]\n" +
- " 26 pop2\n" +
- " 27 aload_1\n" +
- " 28 invokeinterface java.util.Iterator.hasNext() : boolean [35] [nargs: 1]\n" +
- " 33 ifne 14\n" +
- " 36 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 5]\n" +
- " [pc: 36, line: 6]\n" +
- " Local variable table:\n" +
+ "public class X {\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [8]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
+ " \n" +
+ " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
+ " // Stack: 2, Locals: 2\n" +
+ " public static void main(java.lang.String[] argv);\n" +
+ " 0 new java.util.ArrayList [16]\n" +
+ " 3 dup\n" +
+ " 4 invokespecial java.util.ArrayList() [18]\n" +
+ " 7 invokevirtual java.util.ArrayList.iterator() : java.util.Iterator [19]\n" +
+ " 10 astore_1\n" +
+ " 11 goto 27\n" +
+ " 14 aload_1\n" +
+ " 15 invokeinterface java.util.Iterator.next() : java.lang.Object [23] [nargs: 1]\n" +
+ " 20 checkcast java.lang.Long [29]\n" +
+ " 23 invokevirtual java.lang.Long.longValue() : long [31]\n" +
+ " 26 pop2\n" +
+ " 27 aload_1\n" +
+ " 28 invokeinterface java.util.Iterator.hasNext() : boolean [35] [nargs: 1]\n" +
+ " 33 ifne 14\n" +
+ " 36 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 5]\n" +
+ " [pc: 36, line: 6]\n" +
+ " Local variable table:\n" +
" [pc: 0, pc: 37] local: argv index: 0 type: java.lang.String[]\n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -2988,7 +2988,7 @@ public void test057() throws Exception {
assertEquals("Wrong contents", expectedOutput, result);
}
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425632, [1.8][compiler] Compiler gets the scope of enhanced for loop's expression wrong.
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425632, [1.8][compiler] Compiler gets the scope of enhanced for loop's expression wrong.
public void test425632() throws Exception {
this.runConformTest(
new String[] {
@@ -3021,40 +3021,40 @@ public void testBug508215() throws Exception {
"}\n" +
"",
}
- );
+ );
String expectedOutput =
- " public static void main(java.lang.String[] args);\n" +
- " 0 iconst_1\n" +
- " 1 anewarray java.lang.Integer [16]\n" +
- " 4 dup\n" +
- " 5 iconst_0\n" +
- " 6 iconst_1\n" +
- " 7 invokestatic java.lang.Integer.valueOf(int) : java.lang.Integer [18]\n" +
- " 10 aastore\n" +
- " 11 invokestatic java.util.Arrays.asList(java.lang.Object[]) : java.util.List [22]\n" +
- " 14 invokeinterface java.util.List.iterator() : java.util.Iterator [28] [nargs: 1]\n" +
- " 19 astore_2\n" +
- " 20 goto 40\n" +
- " 23 aload_2\n" +
- " 24 invokeinterface java.util.Iterator.next() : java.lang.Object [34] [nargs: 1]\n" +
- " 29 checkcast java.lang.Integer [16]\n" +
- " 32 astore_1 [i]\n" +
- " 33 getstatic java.lang.System.out : java.io.PrintStream [40]\n" +
- " 36 aload_1 [i]\n" +
- " 37 invokevirtual java.io.PrintStream.println(java.lang.Object) : void [46]\n" +
- " 40 aload_2\n" +
- " 41 invokeinterface java.util.Iterator.hasNext() : boolean [52] [nargs: 1]\n" +
- " 46 ifne 23\n" +
- " 49 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 6]\n" +
- " [pc: 33, line: 7]\n" +
- " [pc: 40, line: 6]\n" +
- " [pc: 49, line: 9]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 50] local: args index: 0 type: java.lang.String[]\n" +
- " [pc: 33, pc: 40] local: i index: 1 type: java.lang.Integer\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 iconst_1\n" +
+ " 1 anewarray java.lang.Integer [16]\n" +
+ " 4 dup\n" +
+ " 5 iconst_0\n" +
+ " 6 iconst_1\n" +
+ " 7 invokestatic java.lang.Integer.valueOf(int) : java.lang.Integer [18]\n" +
+ " 10 aastore\n" +
+ " 11 invokestatic java.util.Arrays.asList(java.lang.Object[]) : java.util.List [22]\n" +
+ " 14 invokeinterface java.util.List.iterator() : java.util.Iterator [28] [nargs: 1]\n" +
+ " 19 astore_2\n" +
+ " 20 goto 40\n" +
+ " 23 aload_2\n" +
+ " 24 invokeinterface java.util.Iterator.next() : java.lang.Object [34] [nargs: 1]\n" +
+ " 29 checkcast java.lang.Integer [16]\n" +
+ " 32 astore_1 [i]\n" +
+ " 33 getstatic java.lang.System.out : java.io.PrintStream [40]\n" +
+ " 36 aload_1 [i]\n" +
+ " 37 invokevirtual java.io.PrintStream.println(java.lang.Object) : void [46]\n" +
+ " 40 aload_2\n" +
+ " 41 invokeinterface java.util.Iterator.hasNext() : boolean [52] [nargs: 1]\n" +
+ " 46 ifne 23\n" +
+ " 49 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 6]\n" +
+ " [pc: 33, line: 7]\n" +
+ " [pc: 40, line: 6]\n" +
+ " [pc: 49, line: 9]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 50] local: args index: 0 type: java.lang.String[]\n" +
+ " [pc: 33, pc: 40] local: i index: 1 type: java.lang.Integer\n" +
"";
File f = new File(OUTPUT_DIR + File.separator + "linenumber" + File.separator + "DebugErrorVarargs1Arg.class");
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeSignatureTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeSignatureTest.java
index f557b387b..a1cec6c04 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeSignatureTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeSignatureTest.java
@@ -1283,13 +1283,13 @@ public class GenericTypeSignatureTest extends AbstractRegressionTest {
public void testBug460491() {
final String[] testsSource = new String[] {
"C.java",
- "public class C<E> {\n" +
- " static class F { }\n" +
- " interface G { }\n" +
- " class H { }\n" +
- " void m1(F f) {}\n" +
- " void m2(G g) {}\n" +
- " void m3(H h) {}\n" +
+ "public class C<E> {\n" +
+ " static class F { }\n" +
+ " interface G { }\n" +
+ " class H { }\n" +
+ " void m1(F f) {}\n" +
+ " void m2(G g) {}\n" +
+ " void m3(H h) {}\n" +
"}\n"
};
this.runConformTest(
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java
index 9b8512ebc..1ce1b6e81 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java
@@ -49,7 +49,7 @@ import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
@SuppressWarnings({ "unchecked", "rawtypes" })
public class GenericTypeTest extends AbstractComparableTest {
-
+
public GenericTypeTest(String name) {
super(name);
}
@@ -1965,12 +1965,12 @@ public class GenericTypeTest extends AbstractComparableTest {
"1. ERROR in test\\X1.java (at line 3)\n" +
" public class X1<A1>> {\n" +
//{ObjectTeams: our diagnose parser suggests a different correction:
-/* orig:
+/* orig:
" ^^\n" +
"Syntax error on token \">>\", > expected\n" +
:giro */
- " ^^\n" +
- "Syntax error, insert \"< typeAnchor\" to complete AnchoredTypeParameter\n" +
+ " ^^\n" +
+ "Syntax error, insert \"< typeAnchor\" to complete AnchoredTypeParameter\n" +
// SH}
"----------\n"
);
@@ -4352,7 +4352,7 @@ public class GenericTypeTest extends AbstractComparableTest {
" void bfoo() {}\n" +
"}\n",
},
- this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ this.complianceLevel < ClassFileConstants.JDK1_8 ?
"----------\n" +
"1. ERROR in X.java (at line 9)\n" +
" void bar(X<? extends X> x) {\n" +
@@ -4369,21 +4369,21 @@ public class GenericTypeTest extends AbstractComparableTest {
" ^^^^^^^^\n" +
"Bound mismatch: The generic method identity(X<P>) of type X<T> is not applicable for the arguments (X<capture#2-of ? extends X>). The inferred type capture#2-of ? extends X is not a valid substitute for the bounded parameter <P extends AX>\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " void bar(X<? extends X> x) {\n" +
- " ^^^^^^^^^^^\n" +
- "Bound mismatch: The type ? extends X is not a valid substitute for the bounded parameter <T extends AX> of the type X<T>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " void bar(X<? extends X> x) {\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " x = identity(x);\n" +
- " ^^^^^^^^\n" +
- "The method identity(X<P>) in the type X<T> is not applicable for the arguments (X<capture#2-of ? extends X>)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " void bar(X<? extends X> x) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "Bound mismatch: The type ? extends X is not a valid substitute for the bounded parameter <T extends AX> of the type X<T>\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " void bar(X<? extends X> x) {\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 10)\n" +
+ " x = identity(x);\n" +
+ " ^^^^^^^^\n" +
+ "The method identity(X<P>) in the type X<T> is not applicable for the arguments (X<capture#2-of ? extends X>)\n" +
"----------\n");
}
public void test0143() {
@@ -4576,11 +4576,11 @@ public class GenericTypeTest extends AbstractComparableTest {
" ^^^\n" +
"Bound mismatch: The generic method foo(T[], List<T>) of type X is not applicable for the arguments (String[], ArrayList<String>). The inferred type String is not a valid substitute for the bounded parameter <T extends X>\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " new X().foo(args, new ArrayList<String>());\n" +
- " ^^^\n" +
- "The method foo(T[], List<T>) in the type X is not applicable for the arguments (String[], ArrayList<String>)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " new X().foo(args, new ArrayList<String>());\n" +
+ " ^^^\n" +
+ "The method foo(T[], List<T>) in the type X is not applicable for the arguments (String[], ArrayList<String>)\n" +
"----------\n");
}
public void test0151() {
@@ -4610,16 +4610,16 @@ public class GenericTypeTest extends AbstractComparableTest {
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Bound mismatch: The generic constructor X(T[], List<T>) of type X<E> is not applicable for the arguments (String[], ArrayList<String>). The inferred type String is not a valid substitute for the bounded parameter <T extends X>\n" +
"----------\n" :
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " <T extends X> X(T[] ta, List<T> lt) {\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<E> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " new X<Object>(args, new ArrayList<String>());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The constructor X<Object>(String[], ArrayList<String>) is undefined\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " <T extends X> X(T[] ta, List<T> lt) {\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<E> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " new X<Object>(args, new ArrayList<String>());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The constructor X<Object>(String[], ArrayList<String>) is undefined\n" +
"----------\n");
}
// 60556
@@ -5386,21 +5386,21 @@ public class GenericTypeTest extends AbstractComparableTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (t instanceof X<T>) {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Cannot perform instanceof check against parameterized type X<T>. Use the form X<?> instead since further generic type information will be erased at runtime\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " } else if (t instanceof X<String>) {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Cannot perform instanceof check against parameterized type X<String>. Use the form X<?> instead since further generic type information will be erased at runtime\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " } else if (t instanceof T) {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Cannot perform instanceof check against type parameter T. Use its erasure Object instead since further generic type information will be erased at runtime\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " if (t instanceof X<T>) {\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Cannot perform instanceof check against parameterized type X<T>. Use the form X<?> instead since further generic type information will be erased at runtime\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " } else if (t instanceof X<String>) {\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Cannot perform instanceof check against parameterized type X<String>. Use the form X<?> instead since further generic type information will be erased at runtime\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 10)\n" +
+ " } else if (t instanceof T) {\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Cannot perform instanceof check against type parameter T. Use its erasure Object instead since further generic type information will be erased at runtime\n" +
"----------\n",
null,
true,
@@ -7345,7 +7345,7 @@ public class GenericTypeTest extends AbstractComparableTest {
" final Class<String> clazz3 = (Class<String>) classes.get(\"test\");\n" +
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Unnecessary cast from Class to Class<String>\n" +
- "----------\n",
+ "----------\n",
null, true, options );
}
public void test0243() {
@@ -7397,21 +7397,21 @@ public class GenericTypeTest extends AbstractComparableTest {
" @Override public X foo() { return new X(); }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in SubTypes.java (at line 5)\n" +
- " @Override public X foo() { return new X(); }\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type B\n" +
- "----------\n" +
- "2. ERROR in SubTypes.java (at line 6)\n" +
- " @Override public B foo() { return this; }\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type B\n" +
- "----------\n" +
- "3. ERROR in SubTypes.java (at line 9)\n" +
- " @Override public X foo() { return new X(); }\n" +
- " ^\n" +
- "The return type is incompatible with A.foo()\n" +
+ "----------\n" +
+ "1. ERROR in SubTypes.java (at line 5)\n" +
+ " @Override public X foo() { return new X(); }\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type B\n" +
+ "----------\n" +
+ "2. ERROR in SubTypes.java (at line 6)\n" +
+ " @Override public B foo() { return this; }\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type B\n" +
+ "----------\n" +
+ "3. ERROR in SubTypes.java (at line 9)\n" +
+ " @Override public X foo() { return new X(); }\n" +
+ " ^\n" +
+ "The return type is incompatible with A.foo()\n" +
"----------\n");
}
// generic method of raw type
@@ -7453,46 +7453,46 @@ public class GenericTypeTest extends AbstractComparableTest {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X <T> { \n" +
- " <G> T foo(G g) {\n" +
- " return null;\n" +
- " }\n" +
- " T bar(T t) {\n" +
- " return zork;\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " X rx = new X();\n" +
- " rx.<String>foo(\"hello\"); // Eclipse error here\n" +
- " rx.<String>bar(\"hello\"); // Eclipse error here\n" +
- " }\n" +
+ "public class X <T> { \n" +
+ " <G> T foo(G g) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " T bar(T t) {\n" +
+ " return zork;\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " X rx = new X();\n" +
+ " rx.<String>foo(\"hello\"); // Eclipse error here\n" +
+ " rx.<String>bar(\"hello\"); // Eclipse error here\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " return zork;\n" +
- " ^^^^\n" +
- "zork cannot be resolved to a variable\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " X rx = new X();\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 10)\n" +
- " X rx = new X();\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 11)\n" +
- " rx.<String>foo(\"hello\"); // Eclipse error here\n" +
- " ^^^\n" +
- "The method foo(Object) of raw type X is no longer generic; it cannot be parameterized with arguments <String>\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 12)\n" +
- " rx.<String>bar(\"hello\"); // Eclipse error here\n" +
- " ^^^\n" +
- "The method bar(Object) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " return zork;\n" +
+ " ^^^^\n" +
+ "zork cannot be resolved to a variable\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " X rx = new X();\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 10)\n" +
+ " X rx = new X();\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 11)\n" +
+ " rx.<String>foo(\"hello\"); // Eclipse error here\n" +
+ " ^^^\n" +
+ "The method foo(Object) of raw type X is no longer generic; it cannot be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 12)\n" +
+ " rx.<String>bar(\"hello\"); // Eclipse error here\n" +
+ " ^^^\n" +
+ "The method bar(Object) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
"----------\n",
JavacTestOptions.EclipseHasABug.EclipseBug236242);
return;
@@ -7500,51 +7500,51 @@ public class GenericTypeTest extends AbstractComparableTest {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X <T> { \n" +
- " <G> T foo(G g) {\n" +
- " return null;\n" +
- " }\n" +
- " T bar(T t) {\n" +
- " return zork;\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " X rx = new X();\n" +
- " rx.<String>foo(\"hello\"); // Eclipse error here\n" +
- " rx.<String>bar(\"hello\"); // Eclipse error here\n" +
- " }\n" +
+ "public class X <T> { \n" +
+ " <G> T foo(G g) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " T bar(T t) {\n" +
+ " return zork;\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " X rx = new X();\n" +
+ " rx.<String>foo(\"hello\"); // Eclipse error here\n" +
+ " rx.<String>bar(\"hello\"); // Eclipse error here\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " return zork;\n" +
- " ^^^^\n" +
- "zork cannot be resolved to a variable\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " X rx = new X();\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 10)\n" +
- " X rx = new X();\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 11)\n" +
- " rx.<String>foo(\"hello\"); // Eclipse error here\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method foo(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 12)\n" +
- " rx.<String>bar(\"hello\"); // Eclipse error here\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method bar(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 12)\n" +
- " rx.<String>bar(\"hello\"); // Eclipse error here\n" +
- " ^^^^^^\n" +
- "Unused type arguments for the non generic method bar(Object) of type X; it should not be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " return zork;\n" +
+ " ^^^^\n" +
+ "zork cannot be resolved to a variable\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " X rx = new X();\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 10)\n" +
+ " X rx = new X();\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 11)\n" +
+ " rx.<String>foo(\"hello\"); // Eclipse error here\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method foo(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 12)\n" +
+ " rx.<String>bar(\"hello\"); // Eclipse error here\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method bar(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 12)\n" +
+ " rx.<String>bar(\"hello\"); // Eclipse error here\n" +
+ " ^^^^^^\n" +
+ "Unused type arguments for the non generic method bar(Object) of type X; it should not be parameterized with arguments <String>\n" +
"----------\n",
JavacTestOptions.EclipseHasABug.EclipseBug236242);
}
@@ -9108,28 +9108,28 @@ public class GenericTypeTest extends AbstractComparableTest {
// 5: operator + cannot be applied to int,<any>.j
// 5: incompatible type, found : <nulltype>, required: int
:
-
+
// 1.7+ output, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=334622
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " public int foo(T t) { return t.i + t.i() + T.M.j; }\n" +
- " ^\n" +
- "The field X<T>.i is not visible\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " public int foo(T t) { return t.i + t.i() + T.M.j; }\n" +
- " ^\n" +
- "The method i() from the type X<T> is not visible\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " public int foo(T t) { return t.i + t.i() + T.M.j; }\n" +
- " ^^^\n" +
- "The type T.M is not visible\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " class Y extends Zork {\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " public int foo(T t) { return t.i + t.i() + T.M.j; }\n" +
+ " ^\n" +
+ "The field X<T>.i is not visible\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " public int foo(T t) { return t.i + t.i() + T.M.j; }\n" +
+ " ^\n" +
+ "The method i() from the type X<T> is not visible\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " public int foo(T t) { return t.i + t.i() + T.M.j; }\n" +
+ " ^^^\n" +
+ "The type T.M is not visible\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 9)\n" +
+ " class Y extends Zork {\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n"
);
}
@@ -10355,26 +10355,26 @@ public class GenericTypeTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " public abstract <T extends Exception> T bar(T t);\n" +
- " ^\n" +
- "The type parameter T is hiding the type T\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " static void foo(X x) {\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " x.<Exception>bar(null);\n" +
- " ^^^\n" +
- "The method bar(Exception) of raw type X is no longer generic; it cannot be parameterized with arguments <Exception>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 14)\n" +
- " X<R> xr = new X<R>(){ \n" +
- " ^^^^^^\n" +
- "The type new X<R>(){} must implement the inherited abstract method X<R>.bar(T)\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " public abstract <T extends Exception> T bar(T t);\n" +
+ " ^\n" +
+ "The type parameter T is hiding the type T\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " static void foo(X x) {\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " x.<Exception>bar(null);\n" +
+ " ^^^\n" +
+ "The method bar(Exception) of raw type X is no longer generic; it cannot be parameterized with arguments <Exception>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 14)\n" +
+ " X<R> xr = new X<R>(){ \n" +
+ " ^^^^^^\n" +
+ "The type new X<R>(){} must implement the inherited abstract method X<R>.bar(T)\n" +
"----------\n");
return;
}
@@ -10403,27 +10403,27 @@ public class GenericTypeTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " public abstract <T extends Exception> T bar(T t);\n" +
- " ^\n" +
- "The type parameter T is hiding the type T\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " static void foo(X x) {\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 8)\n" +
- " x.<Exception>bar(null);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method bar(Exception) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 14)\n" +
- " X<R> xr = new X<R>(){ \n" +
- " ^^^^^^\n" +
- "The type new X<R>(){} must implement the inherited abstract method X<R>.bar(T)\n" +
- "----------\n");
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " public abstract <T extends Exception> T bar(T t);\n" +
+ " ^\n" +
+ "The type parameter T is hiding the type T\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " static void foo(X x) {\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 8)\n" +
+ " x.<Exception>bar(null);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method bar(Exception) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 14)\n" +
+ " X<R> xr = new X<R>(){ \n" +
+ " ^^^^^^\n" +
+ "The type new X<R>(){} must implement the inherited abstract method X<R>.bar(T)\n" +
+ "----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=74594
public void test0345() {
@@ -10589,33 +10589,33 @@ public class GenericTypeTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public abstract <T extends Exception> T bar(T t);\n" +
- " ^\n" +
- "The type parameter T is hiding the type T\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " static void foo(X x) {\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 5)\n" +
- " x.<Exception>bar(null);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method bar(Exception) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " public void run() { zork = 0; }\n" +
- " ^^^^\n" +
- "zork cannot be resolved to a variable\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 10)\n" +
- " public <T extends Exception> T bar(T t) { return t; }\n" +
- " ^^^^^^^^\n" +
- "The method bar(T) of type new X<R>(){} should be tagged with @Override since it actually overrides a superclass method\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public abstract <T extends Exception> T bar(T t);\n" +
+ " ^\n" +
+ "The type parameter T is hiding the type T\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " static void foo(X x) {\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 5)\n" +
+ " x.<Exception>bar(null);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method bar(Exception) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " public void run() { zork = 0; }\n" +
+ " ^^^^\n" +
+ "zork cannot be resolved to a variable\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 10)\n" +
+ " public <T extends Exception> T bar(T t) { return t; }\n" +
+ " ^^^^^^^^\n" +
+ "The method bar(T) of type new X<R>(){} should be tagged with @Override since it actually overrides a superclass method\n" +
"----------\n",
- JavacTestOptions.EclipseHasABug.EclipseBug236242);
+ JavacTestOptions.EclipseHasABug.EclipseBug236242);
}
// test wildcard compatibilities
public void test0349() {
@@ -11838,16 +11838,16 @@ public class GenericTypeTest extends AbstractComparableTest {
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Type mismatch: cannot convert from String to String[]\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " String[] s = foo(null, new String[]{ \"hello\" });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from String to String[]\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " public <F> F foo(F f, F... others) {\n" +
- " ^^^^^^\n" +
- "Type safety: Potential heap pollution via varargs parameter others\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " String[] s = foo(null, new String[]{ \"hello\" });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from String to String[]\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " public <F> F foo(F f, F... others) {\n" +
+ " ^^^^^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter others\n" +
"----------\n"
);
}
@@ -12517,17 +12517,17 @@ public class GenericTypeTest extends AbstractComparableTest {
" Zork z;\n" +
" ^^^^\n" +
"Zork cannot be resolved to a type\n" +
- "----------\n" :
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public static <T> T first(T... args) {\n" +
- " ^^^^\n" +
- "Type safety: Potential heap pollution via varargs parameter args\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 15)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" :
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public static <T> T first(T... args) {\n" +
+ " ^^^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter args\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 15)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78467 - variation
@@ -12564,22 +12564,22 @@ public class GenericTypeTest extends AbstractComparableTest {
" Zork z;\n" +
" ^^^^\n" +
"Zork cannot be resolved to a type\n" +
- "----------\n" :
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " public static <T> T first(T... args) {\n" +
- " ^^^^\n" +
- "Type safety: Potential heap pollution via varargs parameter args\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " List<String> ls = first(); \n" +
- " ^^^^^^^\n" +
- "Type safety: A generic array of List<String> is created for a varargs parameter\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 16)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" :
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " public static <T> T first(T... args) {\n" +
+ " ^^^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter args\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " List<String> ls = first(); \n" +
+ " ^^^^^^^\n" +
+ "Type safety: A generic array of List<String> is created for a varargs parameter\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 16)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
@@ -14131,21 +14131,21 @@ public class GenericTypeTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 16)\n" +
- " return m_manager.getById(getClass(), Integer.valueOf(1));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation getById(Class<capture#1-of ? extends Test>, Integer) of the generic method getById(Class<T>, Integer) of type Test.Manager<C>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 16)\n" +
- " return m_manager.getById(getClass(), Integer.valueOf(1));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Test needs unchecked conversion to conform to ITest<C>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 16)\n" +
+ " return m_manager.getById(getClass(), Integer.valueOf(1));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation getById(Class<capture#1-of ? extends Test>, Integer) of the generic method getById(Class<T>, Integer) of type Test.Manager<C>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 16)\n" +
+ " return m_manager.getById(getClass(), Integer.valueOf(1));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Test needs unchecked conversion to conform to ITest<C>\n" +
"----------\n");
}
@@ -14534,46 +14534,46 @@ public class GenericTypeTest extends AbstractComparableTest {
" } \n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in test02\\FooBar.java (at line 6)\n" +
- " f.s = \"foo\"; \n" +
- " ^\n" +
- "The field Foo<String>.s is not visible\n" +
- "----------\n" +
- "2. ERROR in test02\\FooBar.java (at line 7)\n" +
- " this.s = \"foo\";\n" +
- " ^\n" +
- "The field Foo<R>.s is not visible\n" +
- "----------\n" +
- "3. ERROR in test02\\FooBar.java (at line 7)\n" +
- " this.s = \"foo\";\n" +
- " ^^^^^\n" +
- "Type mismatch: cannot convert from String to R\n" +
- "----------\n" +
- "4. ERROR in test02\\FooBar.java (at line 8)\n" +
- " f.dosomething(); \n" +
- " ^^^^^^^^^^^\n" +
- "The method dosomething() from the type Foo<String> is not visible\n" +
- "----------\n" +
- "5. ERROR in test02\\FooBar.java (at line 9)\n" +
- " this.dosomething(); \n" +
- " ^^^^^^^^^^^\n" +
- "The method dosomething() from the type Foo<R> is not visible\n" +
- "----------\n" +
- "6. ERROR in test02\\FooBar.java (at line 10)\n" +
- " Bar b1; \n" +
- " ^^^\n" +
- "The type Bar is not visible\n" +
- "----------\n" +
- "7. ERROR in test02\\FooBar.java (at line 11)\n" +
- " FooBar<String>.Bar b2; \n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The type FooBar.Bar is not visible\n" +
- "----------\n" +
- "8. ERROR in test02\\FooBar.java (at line 12)\n" +
- " Foo<String>.Bar b3; \n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The type Foo.Bar is not visible\n" +
+ "----------\n" +
+ "1. ERROR in test02\\FooBar.java (at line 6)\n" +
+ " f.s = \"foo\"; \n" +
+ " ^\n" +
+ "The field Foo<String>.s is not visible\n" +
+ "----------\n" +
+ "2. ERROR in test02\\FooBar.java (at line 7)\n" +
+ " this.s = \"foo\";\n" +
+ " ^\n" +
+ "The field Foo<R>.s is not visible\n" +
+ "----------\n" +
+ "3. ERROR in test02\\FooBar.java (at line 7)\n" +
+ " this.s = \"foo\";\n" +
+ " ^^^^^\n" +
+ "Type mismatch: cannot convert from String to R\n" +
+ "----------\n" +
+ "4. ERROR in test02\\FooBar.java (at line 8)\n" +
+ " f.dosomething(); \n" +
+ " ^^^^^^^^^^^\n" +
+ "The method dosomething() from the type Foo<String> is not visible\n" +
+ "----------\n" +
+ "5. ERROR in test02\\FooBar.java (at line 9)\n" +
+ " this.dosomething(); \n" +
+ " ^^^^^^^^^^^\n" +
+ "The method dosomething() from the type Foo<R> is not visible\n" +
+ "----------\n" +
+ "6. ERROR in test02\\FooBar.java (at line 10)\n" +
+ " Bar b1; \n" +
+ " ^^^\n" +
+ "The type Bar is not visible\n" +
+ "----------\n" +
+ "7. ERROR in test02\\FooBar.java (at line 11)\n" +
+ " FooBar<String>.Bar b2; \n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "The type FooBar.Bar is not visible\n" +
+ "----------\n" +
+ "8. ERROR in test02\\FooBar.java (at line 12)\n" +
+ " Foo<String>.Bar b3; \n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The type Foo.Bar is not visible\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=81594
@@ -15264,26 +15264,26 @@ public class GenericTypeTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " take(new A());\n" +
- " ^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation take(Super.A) of the generic method take(Super<S>.A<S>) of type Super<Double>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " take(new A());\n" +
- " ^^^^^^^\n" +
- "Type safety: The expression of type Super.A needs unchecked conversion to conform to Super<Double>.A<Double>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 8)\n" +
- " take(new A());\n" +
- " ^\n" +
- "Super.A is a raw type. References to generic type Super<S>.A<E> should be parameterized\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 14)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " take(new A());\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation take(Super.A) of the generic method take(Super<S>.A<S>) of type Super<Double>\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " take(new A());\n" +
+ " ^^^^^^^\n" +
+ "Type safety: The expression of type Super.A needs unchecked conversion to conform to Super<Double>.A<Double>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 8)\n" +
+ " take(new A());\n" +
+ " ^\n" +
+ "Super.A is a raw type. References to generic type Super<S>.A<E> should be parameterized\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 14)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
@@ -15347,7 +15347,7 @@ public void test0499(){
" }\n" +
"}\n"
},
- this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ this.complianceLevel < ClassFileConstants.JDK1_8 ?
"----------\n" +
"1. ERROR in X.java (at line 6)\n" +
" Integer[] var = cond ? tab1 : tab2;\n" +
@@ -15355,12 +15355,12 @@ public void test0499(){
"Type mismatch: cannot convert from Object&Serializable&" +
"" + intersection("Comparable<? extends Object&Serializable&" + intersection("Comparable<?>") + ">") +
"[] to Integer[]\n" +
- "----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " Integer[] var = cond ? tab1 : tab2;\n" +
- " ^^^^\n" +
- "Type mismatch: cannot convert from String[] to Integer[]\n" +
+ "----------\n":
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " Integer[] var = cond ? tab1 : tab2;\n" +
+ " ^^^^\n" +
+ "Type mismatch: cannot convert from String[] to Integer[]\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=84251
@@ -15563,88 +15563,88 @@ public void test0500(){
this.runConformTest(
new String[] {
"X.java",
- "class XA {}\n" +
- "interface XB {\n" +
- " XB CONST = new XB(){ public String toString() { return \"SUCCESS\"; }};\n" +
- "}\n" +
- "class XAB extends XA implements XB {}\n" +
- "\n" +
- "public class X <E extends XA&XB> {\n" +
- " E e;\n" +
- " public static void main(String[] args) {\n" +
- " System.out.print(new X<XAB>().e.CONST);\n" +
- " new X<XAB>().foo();\n" +
- " }\n" +
- " public void foo() {\n" +
- " System.out.print(this.e.CONST);\n" +
- " }\n" +
+ "class XA {}\n" +
+ "interface XB {\n" +
+ " XB CONST = new XB(){ public String toString() { return \"SUCCESS\"; }};\n" +
+ "}\n" +
+ "class XAB extends XA implements XB {}\n" +
+ "\n" +
+ "public class X <E extends XA&XB> {\n" +
+ " E e;\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.print(new X<XAB>().e.CONST);\n" +
+ " new X<XAB>().foo();\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " System.out.print(this.e.CONST);\n" +
+ " }\n" +
"}\n",
},
- "SUCCESSSUCCESS");
+ "SUCCESSSUCCESS");
String expectedOutput =
- "// Signature: <E:LXA;:LXB;>Ljava/lang/Object;\n" +
- "public class X {\n" +
- " \n" +
- " // Field descriptor #6 LXA;\n" +
- " // Signature: TE;\n" +
- " XA e;\n" +
- " \n" +
- " // Method descriptor #10 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [12]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 7]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- " Local variable type table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X<E>\n" +
- " \n" +
- " // Method descriptor #21 ([Ljava/lang/String;)V\n" +
- " // Stack: 3, Locals: 1\n" +
- " public static void main(java.lang.String[] args);\n" +
- " 0 getstatic java.lang.System.out : java.io.PrintStream [22]\n" +
- " 3 new X [1]\n" +
- " 6 dup\n" +
- " 7 invokespecial X() [28]\n" +
- " 10 getfield X.e : XA [29]\n" +
- " 13 checkcast XAB [31]\n" +
- " 16 pop\n" +
- " 17 getstatic XAB.CONST : XB [33]\n" +
- " 20 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [37]\n" +
- " 23 new X [1]\n" +
- " 26 dup\n" +
- " 27 invokespecial X() [28]\n" +
- " 30 invokevirtual X.foo() : void [43]\n" +
- " 33 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 10]\n" +
- " [pc: 23, line: 11]\n" +
- " [pc: 33, line: 12]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 34] local: args index: 0 type: java.lang.String[]\n" +
- " \n" +
- " // Method descriptor #10 ()V\n" +
- " // Stack: 2, Locals: 1\n" +
- " public void foo();\n" +
- " 0 getstatic java.lang.System.out : java.io.PrintStream [22]\n" +
- " 3 aload_0 [this]\n" +
- " 4 getfield X.e : XA [29]\n" +
- " 7 checkcast XB [48]\n" +
- " 10 pop\n" +
- " 11 getstatic XB.CONST : XB [50]\n" +
- " 14 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [37]\n" +
- " 17 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 14]\n" +
- " [pc: 17, line: 15]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 18] local: this index: 0 type: X\n" +
- " Local variable type table:\n" +
+ "// Signature: <E:LXA;:LXB;>Ljava/lang/Object;\n" +
+ "public class X {\n" +
+ " \n" +
+ " // Field descriptor #6 LXA;\n" +
+ " // Signature: TE;\n" +
+ " XA e;\n" +
+ " \n" +
+ " // Method descriptor #10 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [12]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 7]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
+ " Local variable type table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X<E>\n" +
+ " \n" +
+ " // Method descriptor #21 ([Ljava/lang/String;)V\n" +
+ " // Stack: 3, Locals: 1\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 getstatic java.lang.System.out : java.io.PrintStream [22]\n" +
+ " 3 new X [1]\n" +
+ " 6 dup\n" +
+ " 7 invokespecial X() [28]\n" +
+ " 10 getfield X.e : XA [29]\n" +
+ " 13 checkcast XAB [31]\n" +
+ " 16 pop\n" +
+ " 17 getstatic XAB.CONST : XB [33]\n" +
+ " 20 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [37]\n" +
+ " 23 new X [1]\n" +
+ " 26 dup\n" +
+ " 27 invokespecial X() [28]\n" +
+ " 30 invokevirtual X.foo() : void [43]\n" +
+ " 33 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 10]\n" +
+ " [pc: 23, line: 11]\n" +
+ " [pc: 33, line: 12]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 34] local: args index: 0 type: java.lang.String[]\n" +
+ " \n" +
+ " // Method descriptor #10 ()V\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " public void foo();\n" +
+ " 0 getstatic java.lang.System.out : java.io.PrintStream [22]\n" +
+ " 3 aload_0 [this]\n" +
+ " 4 getfield X.e : XA [29]\n" +
+ " 7 checkcast XB [48]\n" +
+ " 10 pop\n" +
+ " 11 getstatic XB.CONST : XB [50]\n" +
+ " 14 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [37]\n" +
+ " 17 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 14]\n" +
+ " [pc: 17, line: 15]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 18] local: this index: 0 type: X\n" +
+ " Local variable type table:\n" +
" [pc: 0, pc: 18] local: this index: 0 type: X<E>\n";
-
+
File f = new File(OUTPUT_DIR + File.separator + "X.class");
byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
@@ -15662,97 +15662,97 @@ public void test0500(){
this.runConformTest(
new String[] {
"X.java",
- "class XA {}\n" +
- "interface XB {\n" +
- " XB CONST = new XB(){ public String toString() { return \"SUCCESS\"; }};\n" +
- "}\n" +
- "class XAB extends XA implements XB {}\n" +
- "\n" +
- "public class X <E extends XA&XB> {\n" +
- " E e() { return null; }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.print(new X<XAB>().e().CONST);\n" +
- " new X<XAB>().foo();\n" +
- " }\n" +
- " public void foo() {\n" +
- " System.out.print(this.e().CONST);\n" +
- " }\n" +
+ "class XA {}\n" +
+ "interface XB {\n" +
+ " XB CONST = new XB(){ public String toString() { return \"SUCCESS\"; }};\n" +
+ "}\n" +
+ "class XAB extends XA implements XB {}\n" +
+ "\n" +
+ "public class X <E extends XA&XB> {\n" +
+ " E e() { return null; }\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.print(new X<XAB>().e().CONST);\n" +
+ " new X<XAB>().foo();\n" +
+ " }\n" +
+ " public void foo() {\n" +
+ " System.out.print(this.e().CONST);\n" +
+ " }\n" +
"}\n",
},
- "SUCCESSSUCCESS");
+ "SUCCESSSUCCESS");
String expectedOutput =
- "// Signature: <E:LXA;:LXB;>Ljava/lang/Object;\n" +
- "public class X {\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [8]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 7]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- " Local variable type table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X<E>\n" +
- " \n" +
- " // Method descriptor #17 ()LXA;\n" +
- " // Signature: ()TE;\n" +
- " // Stack: 1, Locals: 1\n" +
- " XA e();\n" +
- " 0 aconst_null\n" +
- " 1 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 8]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 2] local: this index: 0 type: X\n" +
- " Local variable type table:\n" +
- " [pc: 0, pc: 2] local: this index: 0 type: X<E>\n" +
- " \n" +
- " // Method descriptor #21 ([Ljava/lang/String;)V\n" +
- " // Stack: 3, Locals: 1\n" +
- " public static void main(java.lang.String[] args);\n" +
- " 0 getstatic java.lang.System.out : java.io.PrintStream [22]\n" +
- " 3 new X [1]\n" +
- " 6 dup\n" +
- " 7 invokespecial X() [28]\n" +
- " 10 invokevirtual X.e() : XA [29]\n" +
- " 13 checkcast XAB [31]\n" +
- " 16 pop\n" +
- " 17 getstatic XAB.CONST : XB [33]\n" +
- " 20 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [37]\n" +
- " 23 new X [1]\n" +
- " 26 dup\n" +
- " 27 invokespecial X() [28]\n" +
- " 30 invokevirtual X.foo() : void [43]\n" +
- " 33 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 10]\n" +
- " [pc: 23, line: 11]\n" +
- " [pc: 33, line: 12]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 34] local: args index: 0 type: java.lang.String[]\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 2, Locals: 1\n" +
- " public void foo();\n" +
- " 0 getstatic java.lang.System.out : java.io.PrintStream [22]\n" +
- " 3 aload_0 [this]\n" +
- " 4 invokevirtual X.e() : XA [29]\n" +
- " 7 checkcast XB [48]\n" +
- " 10 pop\n" +
- " 11 getstatic XB.CONST : XB [50]\n" +
- " 14 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [37]\n" +
- " 17 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 14]\n" +
- " [pc: 17, line: 15]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 18] local: this index: 0 type: X\n" +
- " Local variable type table:\n" +
+ "// Signature: <E:LXA;:LXB;>Ljava/lang/Object;\n" +
+ "public class X {\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [8]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 7]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
+ " Local variable type table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X<E>\n" +
+ " \n" +
+ " // Method descriptor #17 ()LXA;\n" +
+ " // Signature: ()TE;\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " XA e();\n" +
+ " 0 aconst_null\n" +
+ " 1 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 8]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 2] local: this index: 0 type: X\n" +
+ " Local variable type table:\n" +
+ " [pc: 0, pc: 2] local: this index: 0 type: X<E>\n" +
+ " \n" +
+ " // Method descriptor #21 ([Ljava/lang/String;)V\n" +
+ " // Stack: 3, Locals: 1\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 getstatic java.lang.System.out : java.io.PrintStream [22]\n" +
+ " 3 new X [1]\n" +
+ " 6 dup\n" +
+ " 7 invokespecial X() [28]\n" +
+ " 10 invokevirtual X.e() : XA [29]\n" +
+ " 13 checkcast XAB [31]\n" +
+ " 16 pop\n" +
+ " 17 getstatic XAB.CONST : XB [33]\n" +
+ " 20 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [37]\n" +
+ " 23 new X [1]\n" +
+ " 26 dup\n" +
+ " 27 invokespecial X() [28]\n" +
+ " 30 invokevirtual X.foo() : void [43]\n" +
+ " 33 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 10]\n" +
+ " [pc: 23, line: 11]\n" +
+ " [pc: 33, line: 12]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 34] local: args index: 0 type: java.lang.String[]\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " public void foo();\n" +
+ " 0 getstatic java.lang.System.out : java.io.PrintStream [22]\n" +
+ " 3 aload_0 [this]\n" +
+ " 4 invokevirtual X.e() : XA [29]\n" +
+ " 7 checkcast XB [48]\n" +
+ " 10 pop\n" +
+ " 11 getstatic XB.CONST : XB [50]\n" +
+ " 14 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [37]\n" +
+ " 17 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 14]\n" +
+ " [pc: 17, line: 15]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 18] local: this index: 0 type: X\n" +
+ " Local variable type table:\n" +
" [pc: 0, pc: 18] local: this index: 0 type: X<E>\n";
-
+
File f = new File(OUTPUT_DIR + File.separator + "X.class");
byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
@@ -15891,81 +15891,81 @@ public void test0500(){
" Zork z;\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " public void test(List list,final Comparator comparator, X x) {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " public void test(List list,final Comparator comparator, X x) {\n" +
- " ^^^^^^^^^^\n" +
- "Comparator is a raw type. References to generic type Comparator<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " public void test(List list,final Comparator comparator, X x) {\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<E> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 7)\n" +
- " foo(list, comparator);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation foo(List, Comparator) of the generic method foo(List<T>, Comparator<? super T>) of type X<E>\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 7)\n" +
- " foo(list, comparator);\n" +
- " ^^^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 7)\n" +
- " foo(list, comparator);\n" +
- " ^^^^^^^^^^\n" +
- "Type safety: The expression of type Comparator needs unchecked conversion to conform to Comparator<? super Object>\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 8)\n" +
- " bar(list, comparator);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation bar(List, Comparator) of the generic method bar(List<T>, Comparator<? super T>) of type X<E>\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 8)\n" +
- " bar(list, comparator);\n" +
- " ^^^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
- "----------\n" +
- "9. WARNING in X.java (at line 8)\n" +
- " bar(list, comparator);\n" +
- " ^^^^^^^^^^\n" +
- "Type safety: The expression of type Comparator needs unchecked conversion to conform to Comparator<? super Object>\n" +
- "----------\n" +
- "10. WARNING in X.java (at line 10)\n" +
- " x.foo(list, comparator);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method foo(List, Comparator) belongs to the raw type X. References to generic type X<E> should be parameterized\n" +
- "----------\n" +
- "11. WARNING in X.java (at line 11)\n" +
- " x.bar(list, comparator);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The static method bar(List<Object>, Comparator<? super Object>) from the type X should be accessed in a static way\n" +
- "----------\n" +
- "12. WARNING in X.java (at line 11)\n" +
- " x.bar(list, comparator);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation bar(List, Comparator) of the generic method bar(List<T>, Comparator<? super T>) of type X\n" +
- "----------\n" +
- "13. WARNING in X.java (at line 11)\n" +
- " x.bar(list, comparator);\n" +
- " ^^^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
- "----------\n" +
- "14. WARNING in X.java (at line 11)\n" +
- " x.bar(list, comparator);\n" +
- " ^^^^^^^^^^\n" +
- "Type safety: The expression of type Comparator needs unchecked conversion to conform to Comparator<? super Object>\n" +
- "----------\n" +
- "15. ERROR in X.java (at line 18)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " public void test(List list,final Comparator comparator, X x) {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " public void test(List list,final Comparator comparator, X x) {\n" +
+ " ^^^^^^^^^^\n" +
+ "Comparator is a raw type. References to generic type Comparator<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " public void test(List list,final Comparator comparator, X x) {\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<E> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 7)\n" +
+ " foo(list, comparator);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation foo(List, Comparator) of the generic method foo(List<T>, Comparator<? super T>) of type X<E>\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 7)\n" +
+ " foo(list, comparator);\n" +
+ " ^^^^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 7)\n" +
+ " foo(list, comparator);\n" +
+ " ^^^^^^^^^^\n" +
+ "Type safety: The expression of type Comparator needs unchecked conversion to conform to Comparator<? super Object>\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 8)\n" +
+ " bar(list, comparator);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation bar(List, Comparator) of the generic method bar(List<T>, Comparator<? super T>) of type X<E>\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 8)\n" +
+ " bar(list, comparator);\n" +
+ " ^^^^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
+ "----------\n" +
+ "9. WARNING in X.java (at line 8)\n" +
+ " bar(list, comparator);\n" +
+ " ^^^^^^^^^^\n" +
+ "Type safety: The expression of type Comparator needs unchecked conversion to conform to Comparator<? super Object>\n" +
+ "----------\n" +
+ "10. WARNING in X.java (at line 10)\n" +
+ " x.foo(list, comparator);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method foo(List, Comparator) belongs to the raw type X. References to generic type X<E> should be parameterized\n" +
+ "----------\n" +
+ "11. WARNING in X.java (at line 11)\n" +
+ " x.bar(list, comparator);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The static method bar(List<Object>, Comparator<? super Object>) from the type X should be accessed in a static way\n" +
+ "----------\n" +
+ "12. WARNING in X.java (at line 11)\n" +
+ " x.bar(list, comparator);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation bar(List, Comparator) of the generic method bar(List<T>, Comparator<? super T>) of type X\n" +
+ "----------\n" +
+ "13. WARNING in X.java (at line 11)\n" +
+ " x.bar(list, comparator);\n" +
+ " ^^^^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
+ "----------\n" +
+ "14. WARNING in X.java (at line 11)\n" +
+ " x.bar(list, comparator);\n" +
+ " ^^^^^^^^^^\n" +
+ "Type safety: The expression of type Comparator needs unchecked conversion to conform to Comparator<? super Object>\n" +
+ "----------\n" +
+ "15. ERROR in X.java (at line 18)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// array bound for wildcard
@@ -16012,7 +16012,7 @@ public void test0500(){
" }\n" +
"}\n"
},
- this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ this.complianceLevel < ClassFileConstants.JDK1_8 ?
"----------\n" +
"1. ERROR in X.java (at line 6)\n" +
" int i = l.get(0).length;\n" +
@@ -16024,16 +16024,16 @@ public void test0500(){
" ^^^^^^^^^^^^^^^^\n" +
"Type mismatch: cannot convert from Object to Serializable\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " int i = l.get(0).length;\n" +
- " ^^^^^^\n" +
- "length cannot be resolved or is not a field\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " Serializable s2 = b ? l.get(0) : s;\n" +
- " ^^^^^^^^\n" +
- "Type mismatch: cannot convert from capture#3-of ? super int[] to Serializable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " int i = l.get(0).length;\n" +
+ " ^^^^^^\n" +
+ "length cannot be resolved or is not a field\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 13)\n" +
+ " Serializable s2 = b ? l.get(0) : s;\n" +
+ " ^^^^^^^^\n" +
+ "Type mismatch: cannot convert from capture#3-of ? super int[] to Serializable\n" +
"----------\n");
}
// type parameter hiding
@@ -16822,38 +16822,38 @@ public void test0500(){
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " Class c = Foo.class;\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " EnumSet<Enum> eSet = EnumSet.allOf(c);\n" +
- " ^^^^\n" +
- "Enum is a raw type. References to generic type Enum<E> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " EnumSet<Enum> eSet = EnumSet.allOf(c);\n" +
- " ^^^^\n" +
- "Bound mismatch: The type Enum is not a valid substitute for the bounded parameter <E extends Enum<E>> of the type EnumSet<E>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 10)\n" +
- " EnumSet<Enum> eSet = EnumSet.allOf(c);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 10)\n" +
- " EnumSet<Enum> eSet = EnumSet.allOf(c);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type EnumSet needs unchecked conversion to conform to EnumSet<Enum>\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 10)\n" +
- " EnumSet<Enum> eSet = EnumSet.allOf(c);\n" +
- " ^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " Class c = Foo.class;\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " EnumSet<Enum> eSet = EnumSet.allOf(c);\n" +
+ " ^^^^\n" +
+ "Enum is a raw type. References to generic type Enum<E> should be parameterized\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 10)\n" +
+ " EnumSet<Enum> eSet = EnumSet.allOf(c);\n" +
+ " ^^^^\n" +
+ "Bound mismatch: The type Enum is not a valid substitute for the bounded parameter <E extends Enum<E>> of the type EnumSet<E>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 10)\n" +
+ " EnumSet<Enum> eSet = EnumSet.allOf(c);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 10)\n" +
+ " EnumSet<Enum> eSet = EnumSet.allOf(c);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type EnumSet needs unchecked conversion to conform to EnumSet<Enum>\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 10)\n" +
+ " EnumSet<Enum> eSet = EnumSet.allOf(c);\n" +
+ " ^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8
? "Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum>\n"
- : "Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum<Enum<E>>>\n") +
+ : "Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum<Enum<E>>>\n") +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86838 - variation
@@ -16917,31 +16917,31 @@ public void test0500(){
" Zork z;\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " Class c = Foo.class;\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " EnumSet<?> eSet = (EnumSet<?>) EnumSet.allOf(c);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from EnumSet to EnumSet<?>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 10)\n" +
- " EnumSet<?> eSet = (EnumSet<?>) EnumSet.allOf(c);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 10)\n" +
- " EnumSet<?> eSet = (EnumSet<?>) EnumSet.allOf(c);\n" +
- " ^\n" +
- "Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum<Enum<E>>>\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 12)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " Class c = Foo.class;\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " EnumSet<?> eSet = (EnumSet<?>) EnumSet.allOf(c);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unnecessary cast from EnumSet to EnumSet<?>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 10)\n" +
+ " EnumSet<?> eSet = (EnumSet<?>) EnumSet.allOf(c);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 10)\n" +
+ " EnumSet<?> eSet = (EnumSet<?>) EnumSet.allOf(c);\n" +
+ " ^\n" +
+ "Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum<Enum<E>>>\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 12)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n"
);
}
@@ -16964,26 +16964,26 @@ public void test0500(){
" Zork z;\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " Class c = Foo.class;\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " EnumSet<?> eSet = EnumSet.allOf(c);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 10)\n" +
- " EnumSet<?> eSet = EnumSet.allOf(c);\n" +
- " ^\n" +
- "Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum<Enum<E>>>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 12)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " Class c = Foo.class;\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " EnumSet<?> eSet = EnumSet.allOf(c);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 10)\n" +
+ " EnumSet<?> eSet = EnumSet.allOf(c);\n" +
+ " ^\n" +
+ "Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum<Enum<E>>>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 12)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86838 - variation
@@ -17005,57 +17005,57 @@ public void test0500(){
"}\n",
},
this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " Class c = Foo.class;\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
- " ^^^^\n" +
- "Bound mismatch: The type Enum<?> is not a valid substitute for the bounded parameter <E extends Enum<E>> of the type EnumSet<E>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 10)\n" +
- " EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 10)\n" +
- " EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type EnumSet needs unchecked conversion to conform to EnumSet<Enum<?>>\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 10)\n" +
- " EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
- " ^\n" +
- "Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum<?>>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " Class c = Foo.class;\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
+ " ^^^^\n" +
+ "Bound mismatch: The type Enum<?> is not a valid substitute for the bounded parameter <E extends Enum<E>> of the type EnumSet<E>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 10)\n" +
+ " EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 10)\n" +
+ " EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type EnumSet needs unchecked conversion to conform to EnumSet<Enum<?>>\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 10)\n" +
+ " EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
+ " ^\n" +
+ "Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum<?>>\n" +
"----------\n" :
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " Class c = Foo.class;\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
- " ^^^^\n" +
- "Bound mismatch: The type Enum<?> is not a valid substitute for the bounded parameter <E extends Enum<E>> of the type EnumSet<E>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 10)\n" +
- " EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 10)\n" +
- " EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type EnumSet needs unchecked conversion to conform to EnumSet<Enum<?>>\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 10)\n" +
- " EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
- " ^\n" +
- "Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum<Enum<E>>>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " Class c = Foo.class;\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
+ " ^^^^\n" +
+ "Bound mismatch: The type Enum<?> is not a valid substitute for the bounded parameter <E extends Enum<E>> of the type EnumSet<E>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 10)\n" +
+ " EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 10)\n" +
+ " EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type EnumSet needs unchecked conversion to conform to EnumSet<Enum<?>>\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 10)\n" +
+ " EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
+ " ^\n" +
+ "Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum<Enum<E>>>\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86838 - variation
@@ -17800,32 +17800,32 @@ public void test0500(){
public void test0561() {
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " void foo(A<String> a) {}\n" +
- " ^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " void foo(A<String> a) {}\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
"Erasure of method foo(A<String>) is the same as another method in type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " Object foo(A<Integer> a) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " Object foo(A<Integer> a) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
"Erasure of method foo(A<Integer>) is the same as another method in type X\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void foo(A<String> a) {}\n" +
- " ^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " void foo(A<String> a) {}\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
"Erasure of method foo(A<String>) is the same as another method in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " Object foo(A<Integer> a) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " Object foo(A<Integer> a) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
"Erasure of method foo(A<Integer>) is the same as another method in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " void test(A<Integer> a) { foo(a); }\n" +
- " ^^^\n" +
- "The method foo(A<String>) in the type X is not applicable for the arguments (A<Integer>)\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " void test(A<Integer> a) { foo(a); }\n" +
+ " ^^^\n" +
+ "The method foo(A<String>) in the type X is not applicable for the arguments (A<Integer>)\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -17851,32 +17851,32 @@ X.java:4: method foo in class X cannot be applied to given types
2 errors
*/
String expectedCompilerLog2 = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " Number foo(A<String> a) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " Number foo(A<String> a) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
"Erasure of method foo(A<String>) is the same as another method in type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " Integer foo(A<Integer> a) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " Integer foo(A<Integer> a) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
"Erasure of method foo(A<Integer>) is the same as another method in type X\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Number foo(A<String> a) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " Number foo(A<String> a) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
"Erasure of method foo(A<String>) is the same as another method in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " Integer foo(A<Integer> a) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " Integer foo(A<Integer> a) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
"Erasure of method foo(A<Integer>) is the same as another method in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " void test(A<Integer> a) { foo(a); }\n" +
- " ^^^\n" +
- "The method foo(A<String>) in the type X is not applicable for the arguments (A<Integer>)\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " void test(A<Integer> a) { foo(a); }\n" +
+ " ^^^\n" +
+ "The method foo(A<String>) in the type X is not applicable for the arguments (A<Integer>)\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -18220,52 +18220,52 @@ X.java:4: method foo in class X cannot be applied to given types
public void test0574() {
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " <T extends Integer> T foo(Object o) { return null; } // ok\n" +
- " ^^^^^^^\n" +
- "The type parameter T should not be bounded by the final type Integer. Final types cannot be further extended\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " <T extends Integer> T foo(Object o) { return null; } // ok\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C2\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 7)\n" +
- " <T extends String> T foo(Object o) { return null; } // ok\n" +
- " ^^^^^^\n" +
- "The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 7)\n" +
- " <T extends String> T foo(Object o) { return null; } // ok\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C2\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 10)\n" +
- " new X().new C2().foo((List<String>) null);\n" +
- " ^^^\n" +
- "The method foo(Object) is ambiguous for the type X.C2\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " <T extends Integer> T foo(Object o) { return null; } // ok\n" +
+ " ^^^^^^^\n" +
+ "The type parameter T should not be bounded by the final type Integer. Final types cannot be further extended\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " <T extends Integer> T foo(Object o) { return null; } // ok\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C2\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 7)\n" +
+ " <T extends String> T foo(Object o) { return null; } // ok\n" +
+ " ^^^^^^\n" +
+ "The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 7)\n" +
+ " <T extends String> T foo(Object o) { return null; } // ok\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C2\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 10)\n" +
+ " new X().new C2().foo((List<String>) null);\n" +
+ " ^^^\n" +
+ "The method foo(Object) is ambiguous for the type X.C2\n" +
"----------\n":
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " <T extends Integer> T foo(Object o) { return null; } // ok\n" +
- " ^^^^^^^\n" +
- "The type parameter T should not be bounded by the final type Integer. Final types cannot be further extended\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " <T extends Integer> T foo(Object o) { return null; } // ok\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C2\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 7)\n" +
- " <T extends String> T foo(Object o) { return null; } // ok\n" +
- " ^^^^^^\n" +
- "The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " <T extends String> T foo(Object o) { return null; } // ok\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C2\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " <T extends Integer> T foo(Object o) { return null; } // ok\n" +
+ " ^^^^^^^\n" +
+ "The type parameter T should not be bounded by the final type Integer. Final types cannot be further extended\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " <T extends Integer> T foo(Object o) { return null; } // ok\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C2\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 7)\n" +
+ " <T extends String> T foo(Object o) { return null; } // ok\n" +
+ " ^^^^^^\n" +
+ "The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " <T extends String> T foo(Object o) { return null; } // ok\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C2\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -19208,18 +19208,18 @@ X.java:6: name clash: <T#1>foo(Object) and <T#2>foo(Object) have the same erasur
" Collections.sort (lComp); \n" +
" ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Type safety: Unchecked invocation sort(List<Comparable>) of the generic method sort(List<T>) of type Collections\n" +
- (this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ (this.complianceLevel < ClassFileConstants.JDK1_8 ?
"----------\n" +
"4. ERROR in X.java (at line 15)\n" +
" Collections.sort (lStr);\n" +
" ^^^^\n" +
"Bound mismatch: The generic method sort(List<T>) of type Collections is not applicable for the arguments (List<Comparable<String>>). The inferred type Comparable<String> is not a valid substitute for the bounded parameter <T extends Comparable<? super T>>\n" +
- "----------\n" :
- "----------\n" +
- "4. ERROR in X.java (at line 15)\n" +
- " Collections.sort (lStr);\n" +
- " ^^^^\n" +
- "The method sort(List<T>) in the type Collections is not applicable for the arguments (List<Comparable<String>>)\n" +
+ "----------\n" :
+ "----------\n" +
+ "4. ERROR in X.java (at line 15)\n" +
+ " Collections.sort (lStr);\n" +
+ " ^^^^\n" +
+ "The method sort(List<T>) in the type Collections is not applicable for the arguments (List<Comparable<String>>)\n" +
"----------\n"));
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84284 - check warnings
@@ -19242,21 +19242,21 @@ X.java:6: name clash: <T#1>foo(Object) and <T#2>foo(Object) have the same erasur
" Zork z;\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in Ball.java (at line 2)\n" +
- " class Ball implements Comparable {\n" +
- " ^^^^^^^^^^\n" +
- "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in Ball.java (at line 10)\n" +
- " Collections.sort(foo);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation sort(LinkedList<Ball>) of the generic method sort(List<T>) of type Collections\n" +
- "----------\n" +
- "3. ERROR in Ball.java (at line 12)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in Ball.java (at line 2)\n" +
+ " class Ball implements Comparable {\n" +
+ " ^^^^^^^^^^\n" +
+ "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in Ball.java (at line 10)\n" +
+ " Collections.sort(foo);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation sort(LinkedList<Ball>) of the generic method sort(List<T>) of type Collections\n" +
+ "----------\n" +
+ "3. ERROR in Ball.java (at line 12)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=81831
@@ -19821,16 +19821,16 @@ public void test0617() {
" }\n" +
"}\n",
},
- this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ this.complianceLevel < ClassFileConstants.JDK1_8 ?
"----------\n" +
"1. ERROR in X.java (at line 10)\n" +
" String s = l1 != null ? foo(l1, l2) : l3;\n" +
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Type mismatch: cannot convert from List<capture#4-of ? extends Object> to String\n" +
- "----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " String s = l1 != null ? foo(l1, l2) : l3;\n" +
+ "----------\n" :
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " String s = l1 != null ? foo(l1, l2) : l3;\n" +
" ^^^^^^^^^^^\n" +
"Type mismatch: cannot convert from List<capture#2-of ? extends Number & "+intersection("Comparable<?>")+"> to String\n" +
"----------\n");
@@ -19921,18 +19921,18 @@ public void test0617() {
" }\n" +
"}\n",
},
- this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ this.complianceLevel < ClassFileConstants.JDK1_8 ?
"----------\n" +
"1. ERROR in X.java (at line 8)\n" +
" System.out.println(Enum.valueOf(c, \"CLASS\"));\n" +
" ^^^^^^^\n" +
"Bound mismatch: The generic method valueOf(Class<T>, String) of type Enum<E> is not applicable for the arguments (Class<capture#1-of ? extends Enum<?>>, String). The inferred type capture#1-of ? extends Enum<?> is not a valid substitute for the bounded parameter <T extends Enum<T>>\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " System.out.println(Enum.valueOf(c, \"CLASS\"));\n" +
- " ^^^^^^^\n" +
- "The method valueOf(Class<T>, String) in the type Enum is not applicable for the arguments (Class<capture#1-of ? extends Enum<?>>, String)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " System.out.println(Enum.valueOf(c, \"CLASS\"));\n" +
+ " ^^^^^^^\n" +
+ "The method valueOf(Class<T>, String) in the type Enum is not applicable for the arguments (Class<capture#1-of ? extends Enum<?>>, String)\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=92982
@@ -21904,11 +21904,11 @@ public void test0675() {
" Store<? extends Key<T>> store1;\n" +
" ^\n" +
"Bound mismatch: The type T is not a valid substitute for the bounded parameter <E extends Key<E>> of the type Key<E>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " Store<? extends Key<? extends T>> store2;\n" +
- " ^^^^^^^^^^^\n" +
- "Bound mismatch: The type ? extends T is not a valid substitute for the bounded parameter <E extends Key<E>> of the type Key<E>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " Store<? extends Key<? extends T>> store2;\n" +
+ " ^^^^^^^^^^^\n" +
+ "Bound mismatch: The type ? extends T is not a valid substitute for the bounded parameter <E extends Key<E>> of the type Key<E>\n" +
"----------\n",
// javac options
JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
@@ -22691,17 +22691,17 @@ public void test0705() {
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=97219
public void test0706() {
String outputExpectedBelow17 = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
- " ^^^^^^\n" +
- "Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
+ " ^^^^^^\n" +
+ "Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
- " ^^^^^^\n" +
- "Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
+ " ^^^^^^\n" +
+ "Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -22719,16 +22719,16 @@ public void test0706() {
},
(this.complianceLevel < ClassFileConstants.JDK1_7)
? outputExpectedBelow17
- : "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " bb.<Object>test();\n" +
- " ^^^^\n" +
- "The method test() is ambiguous for the type BB\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
- " ^^^^^^\n" +
- "Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" +
+ : "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " bb.<Object>test();\n" +
+ " ^^^^\n" +
+ "The method test() is ambiguous for the type BB\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
+ " ^^^^^^\n" +
+ "Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" +
"----------\n"
);
/*
@@ -22749,47 +22749,47 @@ class BB extends AA<CC> { <U> BB test() {return null;} }
public void test0706a() {
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " AA<Object> res1 = bb.test();\n" +
- " ^^^^\n" +
- "The method test() is ambiguous for the type BB\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " AA res3 = bb.test();\n" +
- " ^^\n" +
- "AA is a raw type. References to generic type AA<T> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " AA res3 = bb.test();\n" +
- " ^^^^\n" +
- "The method test() is ambiguous for the type BB\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 9)\n" +
- " class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
- " ^^^^^^\n" +
- "Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " AA<Object> res1 = bb.test();\n" +
+ " ^^^^\n" +
+ "The method test() is ambiguous for the type BB\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " AA res3 = bb.test();\n" +
+ " ^^\n" +
+ "AA is a raw type. References to generic type AA<T> should be parameterized\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " AA res3 = bb.test();\n" +
+ " ^^^^\n" +
+ "The method test() is ambiguous for the type BB\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 9)\n" +
+ " class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
+ " ^^^^^^\n" +
+ "Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " AA<Object> res1 = bb.test();\n" +
- " ^^^^\n" +
- "The method test() is ambiguous for the type BB\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " AA res3 = bb.test();\n" +
- " ^^\n" +
- "AA is a raw type. References to generic type AA<T> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " AA res3 = bb.test();\n" +
- " ^^^^\n" +
- "The method test() is ambiguous for the type BB\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
- " ^^^^^^\n" +
- "Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " AA<Object> res1 = bb.test();\n" +
+ " ^^^^\n" +
+ "The method test() is ambiguous for the type BB\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " AA res3 = bb.test();\n" +
+ " ^^\n" +
+ "AA is a raw type. References to generic type AA<T> should be parameterized\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " AA res3 = bb.test();\n" +
+ " ^^^^\n" +
+ "The method test() is ambiguous for the type BB\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 9)\n" +
+ " class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
+ " ^^^^^^\n" +
+ "Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -22830,37 +22830,37 @@ class BB extends AA<CC> { <U> BB test() {return null;} }
public void test0706b() {
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " AA<CC> res = bb.test();\n" +
- " ^^^^\n" +
- "The method test() is ambiguous for the type BB\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " BB res2 = bb.test();\n" +
- " ^^^^\n" +
- "The method test() is ambiguous for the type BB\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 9)\n" +
- " class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
- " ^^^^^^\n" +
- "Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " AA<CC> res = bb.test();\n" +
+ " ^^^^\n" +
+ "The method test() is ambiguous for the type BB\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " BB res2 = bb.test();\n" +
+ " ^^^^\n" +
+ "The method test() is ambiguous for the type BB\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 9)\n" +
+ " class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
+ " ^^^^^^\n" +
+ "Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " AA<CC> res = bb.test();\n" +
- " ^^^^\n" +
- "The method test() is ambiguous for the type BB\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " BB res2 = bb.test();\n" +
- " ^^^^\n" +
- "The method test() is ambiguous for the type BB\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
- " ^^^^^^\n" +
- "Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " AA<CC> res = bb.test();\n" +
+ " ^^^^\n" +
+ "The method test() is ambiguous for the type BB\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " BB res2 = bb.test();\n" +
+ " ^^^^\n" +
+ "The method test() is ambiguous for the type BB\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 9)\n" +
+ " class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
+ " ^^^^^^\n" +
+ "Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -23260,36 +23260,36 @@ public void test0718() {
" Zork z;\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 13)\n" +
- " public class ActionImpl<T extends Base> extends Action<T> implements Comparable<ActionImpl> {\n" +
- " ^^^^^^^^^^\n" +
- "X.ActionImpl is a raw type. References to generic type X.ActionImpl<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 14)\n" +
- " public int compareTo(ActionImpl o) {\n" +
- " ^^^^^^^^^^\n" +
- "X.ActionImpl is a raw type. References to generic type X.ActionImpl<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 20)\n" +
- " Set<ActionImpl> set = new TreeSet<ActionImpl>();\n" +
- " ^^^^^^^^^^\n" +
- "X.ActionImpl is a raw type. References to generic type X.ActionImpl<T> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 20)\n" +
- " Set<ActionImpl> set = new TreeSet<ActionImpl>();\n" +
- " ^^^^^^^^^^\n" +
- "X.ActionImpl is a raw type. References to generic type X.ActionImpl<T> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 21)\n" +
- " Collections.max(set);\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation max(Set<X.ActionImpl>) of the generic method max(Collection<? extends T>) of type Collections\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 23)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 13)\n" +
+ " public class ActionImpl<T extends Base> extends Action<T> implements Comparable<ActionImpl> {\n" +
+ " ^^^^^^^^^^\n" +
+ "X.ActionImpl is a raw type. References to generic type X.ActionImpl<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 14)\n" +
+ " public int compareTo(ActionImpl o) {\n" +
+ " ^^^^^^^^^^\n" +
+ "X.ActionImpl is a raw type. References to generic type X.ActionImpl<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 20)\n" +
+ " Set<ActionImpl> set = new TreeSet<ActionImpl>();\n" +
+ " ^^^^^^^^^^\n" +
+ "X.ActionImpl is a raw type. References to generic type X.ActionImpl<T> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 20)\n" +
+ " Set<ActionImpl> set = new TreeSet<ActionImpl>();\n" +
+ " ^^^^^^^^^^\n" +
+ "X.ActionImpl is a raw type. References to generic type X.ActionImpl<T> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 21)\n" +
+ " Collections.max(set);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation max(Set<X.ActionImpl>) of the generic method max(Collection<? extends T>) of type Collections\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 23)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=98364
@@ -23564,11 +23564,11 @@ public void test0728() {
" public U getContent();\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " foobar(ctrl.getView().getContent()); \n" +
- " ^^^^^^\n" +
- "The method foobar(X<String>) in the type X<E> is not applicable for the arguments (capture#2-of ?)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " foobar(ctrl.getView().getContent()); \n" +
+ " ^^^^^^\n" +
+ "The method foobar(X<String>) in the type X<E> is not applicable for the arguments (capture#2-of ?)\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=96586
@@ -24092,17 +24092,17 @@ public void test0747() {
public void test0748() {
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " public byte[] create(Class<byte[]> cl) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method create(Class<byte[]>) of type X has the same erasure as create(Class<U>) of type Factory<T> but does not override it\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " public byte[] create(Class<byte[]> cl) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method create(Class<byte[]>) of type X has the same erasure as create(Class<U>) of type Factory<T> but does not override it\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " public byte[] create(Class<byte[]> cl) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method create(Class<byte[]>) of type X has the same erasure as create(Class<U>) of type Factory<T> but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " public byte[] create(Class<byte[]> cl) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method create(Class<byte[]>) of type X has the same erasure as create(Class<U>) of type Factory<T> but does not override it\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -24475,7 +24475,7 @@ public void test0760() {
" X<Integer> x2 = itself((X<Integer>)make());\n" +
" ^^^^^^^^^^^^^^^^^^\n" +
"Cannot cast from X<Object> to X<Integer>\n" +
- "----------\n"
+ "----------\n"
));
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=100421
@@ -25307,17 +25307,17 @@ public void test0785() {
"}\n",
},
this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " getLonger(list, set);\n" +
- " ^^^^^^^^^\n" +
- "Bound mismatch: The generic method getLonger(T, T) of type X is not applicable for the arguments (HashSet<capture#3-of ?>, ArrayList<capture#4-of ?>). The inferred type AbstractCollection<? extends Object>&Cloneable&Serializable is not a valid substitute for the bounded parameter <T extends Collection<? extends Number>>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " getLonger(list, set);\n" +
+ " ^^^^^^^^^\n" +
+ "Bound mismatch: The generic method getLonger(T, T) of type X is not applicable for the arguments (HashSet<capture#3-of ?>, ArrayList<capture#4-of ?>). The inferred type AbstractCollection<? extends Object>&Cloneable&Serializable is not a valid substitute for the bounded parameter <T extends Collection<? extends Number>>\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " getLonger(list, set);\n" +
- " ^^^^^^^^^\n" +
- "The method getLonger(T, T) in the type X is not applicable for the arguments (HashSet<capture#3-of ?>, ArrayList<capture#4-of ?>)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " getLonger(list, set);\n" +
+ " ^^^^^^^^^\n" +
+ "The method getLonger(T, T) in the type X is not applicable for the arguments (HashSet<capture#3-of ?>, ArrayList<capture#4-of ?>)\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=103528 - variation
@@ -25355,17 +25355,17 @@ public void test0787() {
"}\n",
},
this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " getLonger(list, set);\n" +
- " ^^^^^^^^^\n" +
- "Bound mismatch: The generic method getLonger(T, T) of type X<U> is not applicable for the arguments (HashSet<capture#3-of ?>, ArrayList<capture#4-of ?>). The inferred type AbstractCollection<? extends Object>&Cloneable&Serializable is not a valid substitute for the bounded parameter <T extends Collection<? extends U>>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " getLonger(list, set);\n" +
+ " ^^^^^^^^^\n" +
+ "Bound mismatch: The generic method getLonger(T, T) of type X<U> is not applicable for the arguments (HashSet<capture#3-of ?>, ArrayList<capture#4-of ?>). The inferred type AbstractCollection<? extends Object>&Cloneable&Serializable is not a valid substitute for the bounded parameter <T extends Collection<? extends U>>\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " getLonger(list, set);\n" +
- " ^^^^^^^^^\n" +
- "The method getLonger(T, T) in the type X<U> is not applicable for the arguments (HashSet<capture#3-of ?>, ArrayList<capture#4-of ?>)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " getLonger(list, set);\n" +
+ " ^^^^^^^^^\n" +
+ "The method getLonger(T, T) in the type X<U> is not applicable for the arguments (HashSet<capture#3-of ?>, ArrayList<capture#4-of ?>)\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=103994
@@ -25478,31 +25478,31 @@ public void test0790() {
" ^^^^^^^^^^^^^^^^^\n" +
"Type safety: Unchecked invocation isGreater(Comparable, Comparable) of the generic method isGreater(T, T) of type X\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " if (isGreater(i, d)) \n" +
- " ^^^^^^^^^\n" +
- "The method isGreater(T, T) in the type X is not applicable for the arguments (Integer, Double)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 15)\n" +
- " isGreater(c1, c2);\n" +
- " ^^^^^^^^^\n" +
- "The method isGreater(T, T) in the type X is not applicable for the arguments (Comparable<capture#1-of ? extends Number>, Comparable<capture#2-of ? extends Number>)\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 18)\n" +
- " Comparable c1= i;\n" +
- " ^^^^^^^^^^\n" +
- "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 19)\n" +
- " Comparable c2= d;\n" +
- " ^^^^^^^^^^\n" +
- "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 20)\n" +
- " isGreater(c1, c2);\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation isGreater(Comparable, Comparable) of the generic method isGreater(T, T) of type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " if (isGreater(i, d)) \n" +
+ " ^^^^^^^^^\n" +
+ "The method isGreater(T, T) in the type X is not applicable for the arguments (Integer, Double)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 15)\n" +
+ " isGreater(c1, c2);\n" +
+ " ^^^^^^^^^\n" +
+ "The method isGreater(T, T) in the type X is not applicable for the arguments (Comparable<capture#1-of ? extends Number>, Comparable<capture#2-of ? extends Number>)\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 18)\n" +
+ " Comparable c1= i;\n" +
+ " ^^^^^^^^^^\n" +
+ "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 19)\n" +
+ " Comparable c2= d;\n" +
+ " ^^^^^^^^^^\n" +
+ "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 20)\n" +
+ " isGreater(c1, c2);\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation isGreater(Comparable, Comparable) of the generic method isGreater(T, T) of type X\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=104655
@@ -25699,29 +25699,29 @@ public void test0798() {
" System.out.println(max(1, 2.0, new BigDecimal(Math.PI)));\n" +
" ^^^\n" +
"Bound mismatch: The generic method max(T...) of type X is not applicable for the arguments (Integer, Double, BigDecimal). The inferred type Number&Comparable<?> is not a valid substitute for the bounded parameter <T extends Comparable<? super T>>\n" +
- "----------\n" :
- this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " private static <T extends Comparable<? super T>> T max(T... elems)\n" +
- " ^^^^^\n" +
- "Type safety: Potential heap pollution via varargs parameter elems\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 16)\n" +
- " System.out.println(max(1, 2.0, new BigDecimal(Math.PI)));\n" +
- " ^^^\n" +
- "Bound mismatch: The generic method max(T...) of type X is not applicable for the arguments (Integer, Double, BigDecimal). The inferred type Number&Comparable<?> is not a valid substitute for the bounded parameter <T extends Comparable<? super T>>\n" +
+ "----------\n" :
+ this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " private static <T extends Comparable<? super T>> T max(T... elems)\n" +
+ " ^^^^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter elems\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 16)\n" +
+ " System.out.println(max(1, 2.0, new BigDecimal(Math.PI)));\n" +
+ " ^^^\n" +
+ "Bound mismatch: The generic method max(T...) of type X is not applicable for the arguments (Integer, Double, BigDecimal). The inferred type Number&Comparable<?> is not a valid substitute for the bounded parameter <T extends Comparable<? super T>>\n" +
"----------\n" :
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " private static <T extends Comparable<? super T>> T max(T... elems)\n" +
- " ^^^^^\n" +
- "Type safety: Potential heap pollution via varargs parameter elems\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 16)\n" +
- " System.out.println(max(1, 2.0, new BigDecimal(Math.PI)));\n" +
- " ^^^\n" +
- "The method max(T...) in the type X is not applicable for the arguments (int, double, BigDecimal)\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " private static <T extends Comparable<? super T>> T max(T... elems)\n" +
+ " ^^^^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter elems\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 16)\n" +
+ " System.out.println(max(1, 2.0, new BigDecimal(Math.PI)));\n" +
+ " ^^^\n" +
+ "The method max(T...) in the type X is not applicable for the arguments (int, double, BigDecimal)\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=105531
@@ -25754,7 +25754,7 @@ public void test0799() {
" Y<E> next;\n" +
"}\n",
},
- this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ this.complianceLevel < ClassFileConstants.JDK1_8 ?
"----------\n" +
"1. WARNING in X.java (at line 2)\n" +
" Y first;\n" +
@@ -25790,57 +25790,57 @@ public void test0799() {
" return first == null ? ref : first;\n" +
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Type safety: The expression of type Y needs unchecked conversion to conform to Y<? extends T>\n" +
- "----------\n" :
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " Y first;\n" +
- " ^\n" +
- "Y is a raw type. References to generic type Y<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " Y first2;\n" +
- " ^\n" +
- "Y is a raw type. References to generic type Y<E> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " String s = foo(ref, first);\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Y to String\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 13)\n" +
- " ref.next = first == null ? ref : first;\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from Y<capture#3-of ? extends T> to Y<capture#2-of ? extends T>\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 13)\n" +
- " ref.next = first == null ? ref : first;\n" +
- " ^^^^^\n" +
- "Type safety: The expression of type Y needs unchecked conversion to conform to Y<capture#2-of ? extends T>\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 14)\n" +
- " String s = first == null ? ref : first;\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from Y<capture#4-of ? extends T> to String\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 14)\n" +
- " String s = first == null ? ref : first;\n" +
- " ^^^^^\n" +
- "Type mismatch: cannot convert from Y to String\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 15)\n" +
- " ref.next = first2 == null ? ref : first2;\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from Y<capture#6-of ? extends T> to Y<capture#5-of ? extends T>\n" +
- "----------\n" +
- "9. WARNING in X.java (at line 15)\n" +
- " ref.next = first2 == null ? ref : first2;\n" +
- " ^^^^^^\n" +
- "Type safety: The expression of type Y needs unchecked conversion to conform to Y<capture#5-of ? extends T>\n" +
- "----------\n" +
- "10. WARNING in X.java (at line 18)\n" +
- " return first == null ? ref : first;\n" +
- " ^^^^^\n" +
- "Type safety: The expression of type Y needs unchecked conversion to conform to Y<? extends T>\n" +
+ "----------\n" :
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " Y first;\n" +
+ " ^\n" +
+ "Y is a raw type. References to generic type Y<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " Y first2;\n" +
+ " ^\n" +
+ "Y is a raw type. References to generic type Y<E> should be parameterized\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 9)\n" +
+ " String s = foo(ref, first);\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Y to String\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 13)\n" +
+ " ref.next = first == null ? ref : first;\n" +
+ " ^^^\n" +
+ "Type mismatch: cannot convert from Y<capture#3-of ? extends T> to Y<capture#2-of ? extends T>\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 13)\n" +
+ " ref.next = first == null ? ref : first;\n" +
+ " ^^^^^\n" +
+ "Type safety: The expression of type Y needs unchecked conversion to conform to Y<capture#2-of ? extends T>\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 14)\n" +
+ " String s = first == null ? ref : first;\n" +
+ " ^^^\n" +
+ "Type mismatch: cannot convert from Y<capture#4-of ? extends T> to String\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 14)\n" +
+ " String s = first == null ? ref : first;\n" +
+ " ^^^^^\n" +
+ "Type mismatch: cannot convert from Y to String\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 15)\n" +
+ " ref.next = first2 == null ? ref : first2;\n" +
+ " ^^^\n" +
+ "Type mismatch: cannot convert from Y<capture#6-of ? extends T> to Y<capture#5-of ? extends T>\n" +
+ "----------\n" +
+ "9. WARNING in X.java (at line 15)\n" +
+ " ref.next = first2 == null ? ref : first2;\n" +
+ " ^^^^^^\n" +
+ "Type safety: The expression of type Y needs unchecked conversion to conform to Y<capture#5-of ? extends T>\n" +
+ "----------\n" +
+ "10. WARNING in X.java (at line 18)\n" +
+ " return first == null ? ref : first;\n" +
+ " ^^^^^\n" +
+ "Type safety: The expression of type Y needs unchecked conversion to conform to Y<? extends T>\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=106744
@@ -25975,38 +25975,38 @@ public void test0803() {
" }\n" +
"}\n",
},
- this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " return true ? list : list;\n" +
- " ^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " return true ? superList : superList;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from ArrayList<capture#3-of ? extends Object> to ArrayList<? super A>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 17)\n" +
- " return true ? extendsList : extendsList;\n" +
- " ^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" :
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " return true ? list : list;\n" +
- " ^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 13)\n" +
- " return true ? superList : superList;\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 17)\n" +
- " return true ? extendsList : extendsList;\n" +
- " ^^^^^^^^^^^\n" +
- "Dead code\n" +
+ this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " return true ? list : list;\n" +
+ " ^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 13)\n" +
+ " return true ? superList : superList;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from ArrayList<capture#3-of ? extends Object> to ArrayList<? super A>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 17)\n" +
+ " return true ? extendsList : extendsList;\n" +
+ " ^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" :
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " return true ? list : list;\n" +
+ " ^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 13)\n" +
+ " return true ? superList : superList;\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 17)\n" +
+ " return true ? extendsList : extendsList;\n" +
+ " ^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n"
);
}
@@ -26397,36 +26397,36 @@ public void test0814() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (o instanceof E[]) { //incorrect: cannot test non-reifiable type\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Cannot perform instanceof check against type parameter E[]. Use its erasure Object[] instead since further generic type information will be erased at runtime\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " E[] es = (E[]) o;\n" +
- " ^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to E[]\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " if (o instanceof List<E>[]) { //incorrect too\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot perform instanceof check against parameterized type List<E>[]. Use the form List<?>[] instead since further generic type information will be erased at runtime\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 8)\n" +
- " List<E>[] es = (List<E>[]) o; \n" +
- " ^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to List<E>[]\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 15)\n" +
- " if (al instanceof List<E>[]) { //incorrect too\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot perform instanceof check against parameterized type List<E>[]. Use the form List<?>[] instead since further generic type information will be erased at runtime\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 16)\n" +
- " List<E>[] es = (List<E>[]) al; \n" +
- " ^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from ArrayList<E>[] to List<E>[]\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " if (o instanceof E[]) { //incorrect: cannot test non-reifiable type\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Cannot perform instanceof check against type parameter E[]. Use its erasure Object[] instead since further generic type information will be erased at runtime\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " E[] es = (E[]) o;\n" +
+ " ^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to E[]\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " if (o instanceof List<E>[]) { //incorrect too\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot perform instanceof check against parameterized type List<E>[]. Use the form List<?>[] instead since further generic type information will be erased at runtime\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 8)\n" +
+ " List<E>[] es = (List<E>[]) o; \n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to List<E>[]\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 15)\n" +
+ " if (al instanceof List<E>[]) { //incorrect too\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot perform instanceof check against parameterized type List<E>[]. Use the form List<?>[] instead since further generic type information will be erased at runtime\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 16)\n" +
+ " List<E>[] es = (List<E>[]) al; \n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Unnecessary cast from ArrayList<E>[] to List<E>[]\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=104695 - variation
@@ -26467,16 +26467,16 @@ public void test0816() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (o instanceof List<E>[][]) { //incorrect too\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot perform instanceof check against parameterized type List<E>[][]. Use the form List<?>[][] instead since further generic type information will be erased at runtime\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " List<E>[][] es = (List<E>[][]) o; \n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object[] to List<E>[][]\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " if (o instanceof List<E>[][]) { //incorrect too\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot perform instanceof check against parameterized type List<E>[][]. Use the form List<?>[][] instead since further generic type information will be erased at runtime\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " List<E>[][] es = (List<E>[][]) o; \n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object[] to List<E>[][]\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=104695 - variation
@@ -26507,46 +26507,46 @@ public void test0817() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " if (this.inner instanceof X<?>.Inner) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The expression of type X<?>.Inner is already an instance of type X<?>.Inner\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " if (this.inners instanceof X<?>.Inner[]) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The expression of type X<?>.Inner[] is already an instance of type X<?>.Inner[]\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 14)\n" +
- " void foo(List l) {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 15)\n" +
- " if (l instanceof List<?>) {}\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The expression of type List is already an instance of type List<?>\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 16)\n" +
- " if (l instanceof List<? extends String>) {}\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Cannot perform instanceof check against parameterized type List<? extends String>. Use the form List<?> instead since further generic type information will be erased at runtime\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 18)\n" +
- " void foo(List[] ls) {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 19)\n" +
- " if (ls instanceof List<?>[]) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The expression of type List[] is already an instance of type List<?>\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 20)\n" +
- " if (ls instanceof List<? extends String>[]) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot perform instanceof check against parameterized type List<? extends String>[]. Use the form List<?>[] instead since further generic type information will be erased at runtime\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " if (this.inner instanceof X<?>.Inner) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The expression of type X<?>.Inner is already an instance of type X<?>.Inner\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " if (this.inners instanceof X<?>.Inner[]) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The expression of type X<?>.Inner[] is already an instance of type X<?>.Inner[]\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 14)\n" +
+ " void foo(List l) {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 15)\n" +
+ " if (l instanceof List<?>) {}\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The expression of type List is already an instance of type List<?>\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 16)\n" +
+ " if (l instanceof List<? extends String>) {}\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Cannot perform instanceof check against parameterized type List<? extends String>. Use the form List<?> instead since further generic type information will be erased at runtime\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 18)\n" +
+ " void foo(List[] ls) {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 19)\n" +
+ " if (ls instanceof List<?>[]) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The expression of type List[] is already an instance of type List<?>\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 20)\n" +
+ " if (ls instanceof List<? extends String>[]) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot perform instanceof check against parameterized type List<? extends String>[]. Use the form List<?>[] instead since further generic type information will be erased at runtime\n" +
"----------\n");
}
public void test0818() {
@@ -26872,105 +26872,105 @@ public void test0825() throws Exception {
},
"");
// ensure proper declaring class for #run() invocation
- String expectedOutput = this.complianceLevel < ClassFileConstants.JDK1_8 ?
- " // Method descriptor #17 (Ljava/io/Serializable;)V\n" +
- " // Signature: (TT;)V\n" +
- " // Stack: 2, Locals: 5\n" +
- " void foo(java.io.Serializable t);\n" +
- " 0 aload_1 [t]\n" +
- " 1 checkcast java.lang.Runnable [20]\n" +
- " 4 astore_2 [r1]\n" +
- " 5 aload_0 [this]\n" +
- " 6 ifnonnull 13\n" +
- " 9 aload_1 [t]\n" +
- " 10 goto 14\n" +
- " 13 aload_1 [t]\n" +
- " 14 astore_3 [r2]\n" +
- " 15 aload_1 [t]\n" +
- " 16 astore 4 [r3]\n" +
- " 18 aload_0 [this]\n" +
- " 19 aload_1 [t]\n" +
- " 20 checkcast java.lang.Runnable [20]\n" +
- " 23 invokevirtual X.bar(java.lang.Runnable) : void [22]\n" +
- " 26 aload_0 [this]\n" +
- " 27 aload_0 [this]\n" +
- " 28 ifnonnull 35\n" +
- " 31 aload_1 [t]\n" +
- " 32 goto 36\n" +
- " 35 aload_1 [t]\n" +
- " 36 invokevirtual X.bar(java.lang.Runnable) : void [22]\n" +
- " 39 aload_0 [this]\n" +
- " 40 aload_1 [t]\n" +
- " 41 invokevirtual X.bar(java.lang.Runnable) : void [22]\n" +
- " 44 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 5]\n" +
- " [pc: 5, line: 6]\n" +
- " [pc: 15, line: 7]\n" +
- " [pc: 18, line: 9]\n" +
- " [pc: 26, line: 10]\n" +
- " [pc: 39, line: 11]\n" +
- " [pc: 44, line: 12]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 45] local: this index: 0 type: X\n" +
- " [pc: 0, pc: 45] local: t index: 1 type: java.io.Serializable\n" +
- " [pc: 5, pc: 45] local: r1 index: 2 type: java.lang.Runnable\n" +
- " [pc: 15, pc: 45] local: r2 index: 3 type: java.lang.Runnable\n" +
- " [pc: 18, pc: 45] local: r3 index: 4 type: java.lang.Runnable\n" +
- " Local variable type table:\n" +
- " [pc: 0, pc: 45] local: this index: 0 type: X<T,V>\n" +
+ String expectedOutput = this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ " // Method descriptor #17 (Ljava/io/Serializable;)V\n" +
+ " // Signature: (TT;)V\n" +
+ " // Stack: 2, Locals: 5\n" +
+ " void foo(java.io.Serializable t);\n" +
+ " 0 aload_1 [t]\n" +
+ " 1 checkcast java.lang.Runnable [20]\n" +
+ " 4 astore_2 [r1]\n" +
+ " 5 aload_0 [this]\n" +
+ " 6 ifnonnull 13\n" +
+ " 9 aload_1 [t]\n" +
+ " 10 goto 14\n" +
+ " 13 aload_1 [t]\n" +
+ " 14 astore_3 [r2]\n" +
+ " 15 aload_1 [t]\n" +
+ " 16 astore 4 [r3]\n" +
+ " 18 aload_0 [this]\n" +
+ " 19 aload_1 [t]\n" +
+ " 20 checkcast java.lang.Runnable [20]\n" +
+ " 23 invokevirtual X.bar(java.lang.Runnable) : void [22]\n" +
+ " 26 aload_0 [this]\n" +
+ " 27 aload_0 [this]\n" +
+ " 28 ifnonnull 35\n" +
+ " 31 aload_1 [t]\n" +
+ " 32 goto 36\n" +
+ " 35 aload_1 [t]\n" +
+ " 36 invokevirtual X.bar(java.lang.Runnable) : void [22]\n" +
+ " 39 aload_0 [this]\n" +
+ " 40 aload_1 [t]\n" +
+ " 41 invokevirtual X.bar(java.lang.Runnable) : void [22]\n" +
+ " 44 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 5]\n" +
+ " [pc: 5, line: 6]\n" +
+ " [pc: 15, line: 7]\n" +
+ " [pc: 18, line: 9]\n" +
+ " [pc: 26, line: 10]\n" +
+ " [pc: 39, line: 11]\n" +
+ " [pc: 44, line: 12]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 45] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 45] local: t index: 1 type: java.io.Serializable\n" +
+ " [pc: 5, pc: 45] local: r1 index: 2 type: java.lang.Runnable\n" +
+ " [pc: 15, pc: 45] local: r2 index: 3 type: java.lang.Runnable\n" +
+ " [pc: 18, pc: 45] local: r3 index: 4 type: java.lang.Runnable\n" +
+ " Local variable type table:\n" +
+ " [pc: 0, pc: 45] local: this index: 0 type: X<T,V>\n" +
" [pc: 0, pc: 45] local: t index: 1 type: T\n" :
-
- " // Method descriptor #17 (Ljava/io/Serializable;)V\n" +
- " // Signature: (TT;)V\n" +
- " // Stack: 2, Locals: 5\n" +
- " void foo(java.io.Serializable t);\n" +
- " 0 aload_1 [t]\n" +
- " 1 checkcast java.lang.Runnable [20]\n" +
- " 4 astore_2 [r1]\n" +
- " 5 aload_0 [this]\n" +
- " 6 ifnonnull 16\n" +
- " 9 aload_1 [t]\n" +
- " 10 checkcast java.lang.Runnable [20]\n" +
- " 13 goto 20\n" +
- " 16 aload_1 [t]\n" +
- " 17 checkcast java.lang.Runnable [20]\n" +
- " 20 astore_3 [r2]\n" +
- " 21 aload_1 [t]\n" +
- " 22 astore 4 [r3]\n" +
- " 24 aload_0 [this]\n" +
- " 25 aload_1 [t]\n" +
- " 26 checkcast java.lang.Runnable [20]\n" +
- " 29 invokevirtual X.bar(java.lang.Runnable) : void [22]\n" +
- " 32 aload_0 [this]\n" +
- " 33 aload_0 [this]\n" +
- " 34 ifnonnull 44\n" +
- " 37 aload_1 [t]\n" +
- " 38 checkcast java.lang.Runnable [20]\n" +
- " 41 goto 48\n" +
- " 44 aload_1 [t]\n" +
- " 45 checkcast java.lang.Runnable [20]\n" +
- " 48 invokevirtual X.bar(java.lang.Runnable) : void [22]\n" +
- " 51 aload_0 [this]\n" +
- " 52 aload_1 [t]\n" +
- " 53 invokevirtual X.bar(java.lang.Runnable) : void [22]\n" +
- " 56 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 5]\n" +
- " [pc: 5, line: 6]\n" +
- " [pc: 21, line: 7]\n" +
- " [pc: 24, line: 9]\n" +
- " [pc: 32, line: 10]\n" +
- " [pc: 51, line: 11]\n" +
- " [pc: 56, line: 12]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 57] local: this index: 0 type: X\n" +
- " [pc: 0, pc: 57] local: t index: 1 type: java.io.Serializable\n" +
- " [pc: 5, pc: 57] local: r1 index: 2 type: java.lang.Runnable\n" +
- " [pc: 21, pc: 57] local: r2 index: 3 type: java.lang.Runnable\n" +
- " [pc: 24, pc: 57] local: r3 index: 4 type: java.lang.Runnable\n" +
- " Local variable type table:\n" +
- " [pc: 0, pc: 57] local: this index: 0 type: X<T,V>\n" +
+
+ " // Method descriptor #17 (Ljava/io/Serializable;)V\n" +
+ " // Signature: (TT;)V\n" +
+ " // Stack: 2, Locals: 5\n" +
+ " void foo(java.io.Serializable t);\n" +
+ " 0 aload_1 [t]\n" +
+ " 1 checkcast java.lang.Runnable [20]\n" +
+ " 4 astore_2 [r1]\n" +
+ " 5 aload_0 [this]\n" +
+ " 6 ifnonnull 16\n" +
+ " 9 aload_1 [t]\n" +
+ " 10 checkcast java.lang.Runnable [20]\n" +
+ " 13 goto 20\n" +
+ " 16 aload_1 [t]\n" +
+ " 17 checkcast java.lang.Runnable [20]\n" +
+ " 20 astore_3 [r2]\n" +
+ " 21 aload_1 [t]\n" +
+ " 22 astore 4 [r3]\n" +
+ " 24 aload_0 [this]\n" +
+ " 25 aload_1 [t]\n" +
+ " 26 checkcast java.lang.Runnable [20]\n" +
+ " 29 invokevirtual X.bar(java.lang.Runnable) : void [22]\n" +
+ " 32 aload_0 [this]\n" +
+ " 33 aload_0 [this]\n" +
+ " 34 ifnonnull 44\n" +
+ " 37 aload_1 [t]\n" +
+ " 38 checkcast java.lang.Runnable [20]\n" +
+ " 41 goto 48\n" +
+ " 44 aload_1 [t]\n" +
+ " 45 checkcast java.lang.Runnable [20]\n" +
+ " 48 invokevirtual X.bar(java.lang.Runnable) : void [22]\n" +
+ " 51 aload_0 [this]\n" +
+ " 52 aload_1 [t]\n" +
+ " 53 invokevirtual X.bar(java.lang.Runnable) : void [22]\n" +
+ " 56 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 5]\n" +
+ " [pc: 5, line: 6]\n" +
+ " [pc: 21, line: 7]\n" +
+ " [pc: 24, line: 9]\n" +
+ " [pc: 32, line: 10]\n" +
+ " [pc: 51, line: 11]\n" +
+ " [pc: 56, line: 12]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 57] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 57] local: t index: 1 type: java.io.Serializable\n" +
+ " [pc: 5, pc: 57] local: r1 index: 2 type: java.lang.Runnable\n" +
+ " [pc: 21, pc: 57] local: r2 index: 3 type: java.lang.Runnable\n" +
+ " [pc: 24, pc: 57] local: r3 index: 4 type: java.lang.Runnable\n" +
+ " Local variable type table:\n" +
+ " [pc: 0, pc: 57] local: this index: 0 type: X<T,V>\n" +
" [pc: 0, pc: 57] local: t index: 1 type: T\n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -27054,7 +27054,7 @@ public void test0827() {
"interface XA {}\n" +
"\n",
},
- this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ this.complianceLevel < ClassFileConstants.JDK1_8 ?
"----------\n" +
"1. WARNING in X.java (at line 7)\n" +
" X t1 = new X();\n" +
@@ -27076,26 +27076,26 @@ public void test0827() {
" ^^^^\n" +
"Bound mismatch: The generic method test(V1, V2) of type X<T> is not applicable for the arguments (XA, List<Object>). The inferred type List<Object> is not a valid substitute for the bounded parameter <V2 extends List<String>>\n" +
"----------\n" :
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " X t1 = new X();\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " X t1 = new X();\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 8)\n" +
- " t1.test(a, b); //this gives an error but should be OK\n" +
- " ^^^^^^^^^^^^^\n" +
- "Type safety: The method test(Object, List) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " t2.test(a, b); //this compiles OK\n" +
- " ^^^^\n" +
- "The method test(V1, V2) in the type X<Object> is not applicable for the arguments (XA, List<Object>)\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 7)\n" +
+ " X t1 = new X();\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " X t1 = new X();\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 8)\n" +
+ " t1.test(a, b); //this gives an error but should be OK\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Type safety: The method test(Object, List) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 10)\n" +
+ " t2.test(a, b); //this compiles OK\n" +
+ " ^^^^\n" +
+ "The method test(V1, V2) in the type X<Object> is not applicable for the arguments (XA, List<Object>)\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=109249
@@ -27204,41 +27204,41 @@ public void test0830() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " X x = (X) o;\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " X x = (X) o;\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " X<String> xs = (X<String>)o;\n" +
- " ^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to X<String>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 10)\n" +
- " List l = (List) al;\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 10)\n" +
- " List l = (List) al;\n" +
- " ^^^^^^^^^\n" +
- "Unnecessary cast from ArrayList<String> to List\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 10)\n" +
- " List l = (List) al;\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " X x = (X) o;\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " X x = (X) o;\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " X<String> xs = (X<String>)o;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to X<String>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 10)\n" +
+ " List l = (List) al;\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 10)\n" +
+ " List l = (List) al;\n" +
+ " ^^^^^^^^^\n" +
+ "Unnecessary cast from ArrayList<String> to List\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 10)\n" +
+ " List l = (List) al;\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
"----------\n");
}
//unnecessary cast may be combined with unchecked cast warning
@@ -27300,16 +27300,16 @@ public void test0832() {
" Zork z;\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " C1<T>.C11[] ts = (C1<T>.C11[]) new C1<?>.C11[5];\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from C1<?>.C11[] to C1<T>.C11[]\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " C1<T>.C11[] ts = (C1<T>.C11[]) new C1<?>.C11[5];\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from C1<?>.C11[] to C1<T>.C11[]\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=111014
@@ -27751,79 +27751,79 @@ public void test0848() throws Exception {
this.runNegativeTest(
new String[] {
"X.java", // =================
- "import java.util.*;\n" +
- "\n" +
- "public class X<E> {\n" +
+ "import java.util.*;\n" +
+ "\n" +
+ "public class X<E> {\n" +
" public static <T> List<T> asList(T a) { return null; }\n" +
- " Collection<? extends Number> asList= asList(1);\n" +
- " List<Number> nums= (List<Number>) asList; // correct warning\n" +
- " List<Number> numz= (LinkedList<Number>) asList; // type safety warning missing\n" +
- " Zork z;\n" +
+ " Collection<? extends Number> asList= asList(1);\n" +
+ " List<Number> nums= (List<Number>) asList; // correct warning\n" +
+ " List<Number> numz= (LinkedList<Number>) asList; // type safety warning missing\n" +
+ " Zork z;\n" +
"}\n", // =================
},
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " List<Number> nums= (List<Number>) asList; // correct warning\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Collection<capture#1-of ? extends Number> to List<Number>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " List<Number> numz= (LinkedList<Number>) asList; // type safety warning missing\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Collection<capture#2-of ? extends Number> to LinkedList<Number>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
-
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " List<Number> nums= (List<Number>) asList; // correct warning\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Collection<capture#1-of ? extends Number> to List<Number>\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " List<Number> numz= (LinkedList<Number>) asList; // type safety warning missing\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Collection<capture#2-of ? extends Number> to LinkedList<Number>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
+ "----------\n");
+
this.runConformTest(
new String[] {
"X.java", // =================
- "import java.util.*;\n" +
- "\n" +
- "public class X<E> {\n" +
- " Collection<? extends Number> asList= Arrays.asList(1, 2.2);\n" +
- " List<Number> nums= (List<Number>) asList; // correct warning\n" +
- " List<Number> numz= (LinkedList<Number>) asList; // type safety warning missing\n" +
+ "import java.util.*;\n" +
+ "\n" +
+ "public class X<E> {\n" +
+ " Collection<? extends Number> asList= Arrays.asList(1, 2.2);\n" +
+ " List<Number> nums= (List<Number>) asList; // correct warning\n" +
+ " List<Number> numz= (LinkedList<Number>) asList; // type safety warning missing\n" +
"}\n", // =================
},
"");
// ensure presence of: "checkcast java.util.LinkedList" before putfield X.numz
String expectedOutput =
- " // Method descriptor #14 ()V\n" +
- " // Stack: 6, Locals: 1\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [16]\n" +
- " 4 aload_0 [this]\n" +
- " 5 iconst_2\n" +
- " 6 anewarray java.lang.Number [18]\n" +
- " 9 dup\n" +
- " 10 iconst_0\n" +
- " 11 iconst_1\n" +
- " 12 invokestatic java.lang.Integer.valueOf(int) : java.lang.Integer [20]\n" +
- " 15 aastore\n" +
- " 16 dup\n" +
- " 17 iconst_1\n" +
- " 18 ldc2_w <Double 2.2> [26]\n" +
- " 21 invokestatic java.lang.Double.valueOf(double) : java.lang.Double [28]\n" +
- " 24 aastore\n" +
- " 25 invokestatic java.util.Arrays.asList(java.lang.Object[]) : java.util.List [33]\n" +
- " 28 putfield X.asList : java.util.Collection [38]\n" +
- " 31 aload_0 [this]\n" +
- " 32 aload_0 [this]\n" +
- " 33 getfield X.asList : java.util.Collection [38]\n" +
- " 36 checkcast java.util.List [40]\n" +
- " 39 putfield X.nums : java.util.List [42]\n" +
- " 42 aload_0 [this]\n" +
- " 43 aload_0 [this]\n" +
- " 44 getfield X.asList : java.util.Collection [38]\n" +
- " 47 checkcast java.util.LinkedList [44]\n" +
- " 50 putfield X.numz : java.util.List [46]\n" +
+ " // Method descriptor #14 ()V\n" +
+ " // Stack: 6, Locals: 1\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [16]\n" +
+ " 4 aload_0 [this]\n" +
+ " 5 iconst_2\n" +
+ " 6 anewarray java.lang.Number [18]\n" +
+ " 9 dup\n" +
+ " 10 iconst_0\n" +
+ " 11 iconst_1\n" +
+ " 12 invokestatic java.lang.Integer.valueOf(int) : java.lang.Integer [20]\n" +
+ " 15 aastore\n" +
+ " 16 dup\n" +
+ " 17 iconst_1\n" +
+ " 18 ldc2_w <Double 2.2> [26]\n" +
+ " 21 invokestatic java.lang.Double.valueOf(double) : java.lang.Double [28]\n" +
+ " 24 aastore\n" +
+ " 25 invokestatic java.util.Arrays.asList(java.lang.Object[]) : java.util.List [33]\n" +
+ " 28 putfield X.asList : java.util.Collection [38]\n" +
+ " 31 aload_0 [this]\n" +
+ " 32 aload_0 [this]\n" +
+ " 33 getfield X.asList : java.util.Collection [38]\n" +
+ " 36 checkcast java.util.List [40]\n" +
+ " 39 putfield X.nums : java.util.List [42]\n" +
+ " 42 aload_0 [this]\n" +
+ " 43 aload_0 [this]\n" +
+ " 44 getfield X.asList : java.util.Collection [38]\n" +
+ " 47 checkcast java.util.LinkedList [44]\n" +
+ " 50 putfield X.numz : java.util.List [46]\n" +
" 53 return\n";
-
+
File f = new File(OUTPUT_DIR + File.separator + "X.class");
byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
@@ -28345,42 +28345,42 @@ public void test0867() {
"\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 20)\n" +
- " List<List> o = Foo.foo1();\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 20)\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 20)\n" +
+ " List<List> o = Foo.foo1();\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 20)\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
" List<List> o = Foo.foo1();\n" +
- " ^^^^\n" +
+ " ^^^^\n" +
"The method foo1() in the type Foo is not applicable for the arguments ()\n"
:
" List<List> o = Foo.foo1();\n" +
" ^^^^^^^^^^\n" +
"Type mismatch: cannot convert from List<List<Runnable>> to List<List>\n" // TODO(stephan) more specific error message
- )+
- "----------\n" +
- "3. ERROR in X.java (at line 21)\n" +
- " Foo.bar1(o);\n" +
- " ^^^^\n" +
- "The method bar1(List<List<T>>) in the type Foo is not applicable for the arguments (List<List>)\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 24)\n" +
- " List o = Foo.foo2();\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 25)\n" +
- " Foo.bar2(o);\n" +
- " ^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation bar2(List) of the generic method bar2(List<T>) of type Foo\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 25)\n" +
- " Foo.bar2(o);\n" +
- " ^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<Runnable>\n" +
+ )+
+ "----------\n" +
+ "3. ERROR in X.java (at line 21)\n" +
+ " Foo.bar1(o);\n" +
+ " ^^^^\n" +
+ "The method bar1(List<List<T>>) in the type Foo is not applicable for the arguments (List<List>)\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 24)\n" +
+ " List o = Foo.foo2();\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 25)\n" +
+ " Foo.bar2(o);\n" +
+ " ^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation bar2(List) of the generic method bar2(List<T>) of type Foo\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 25)\n" +
+ " Foo.bar2(o);\n" +
+ " ^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<Runnable>\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=114365
@@ -28674,7 +28674,7 @@ public void test0875() {
" }\n" +
"}\n",
},
- this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ this.complianceLevel < ClassFileConstants.JDK1_8 ?
"----------\n" +
"1. WARNING in X.java (at line 6)\n" +
" private static final Map<Class<? extends DatabaseObject>, Class<? extends ObjectFormUI>> uiMap = new HashMap<Class<? extends DatabaseObject>, Class<? extends ObjectFormUI>>();\n" +
@@ -28697,27 +28697,27 @@ public void test0875() {
" : (Class<? extends ObjectFormUI<T>>) uiMap.get(persistentClass);\n" +
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Type safety: Unchecked cast from Class<capture#2-of ? extends X.ObjectFormUI> to Class<? extends X.ObjectFormUI<T>>\n" +
- "----------\n" :
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " private static final Map<Class<? extends DatabaseObject>, Class<? extends ObjectFormUI>> uiMap = new HashMap<Class<? extends DatabaseObject>, Class<? extends ObjectFormUI>>();\n" +
- " ^^^^^^^^^^^^\n" +
- "X.ObjectFormUI is a raw type. References to generic type X.ObjectFormUI<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " private static final Map<Class<? extends DatabaseObject>, Class<? extends ObjectFormUI>> uiMap = new HashMap<Class<? extends DatabaseObject>, Class<? extends ObjectFormUI>>();\n" +
- " ^^^^^^^^^^^^\n" +
- "X.ObjectFormUI is a raw type. References to generic type X.ObjectFormUI<T> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " ? uiMap.get(persistentClass)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Class<capture#1-of ? extends X.ObjectFormUI> to Class<? extends X.ObjectFormUI<T>>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 12)\n" +
- " : (Class<? extends ObjectFormUI<T>>) uiMap.get(persistentClass);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Class<capture#2-of ? extends X.ObjectFormUI> to Class<? extends X.ObjectFormUI<T>>\n" +
+ "----------\n" :
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " private static final Map<Class<? extends DatabaseObject>, Class<? extends ObjectFormUI>> uiMap = new HashMap<Class<? extends DatabaseObject>, Class<? extends ObjectFormUI>>();\n" +
+ " ^^^^^^^^^^^^\n" +
+ "X.ObjectFormUI is a raw type. References to generic type X.ObjectFormUI<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " private static final Map<Class<? extends DatabaseObject>, Class<? extends ObjectFormUI>> uiMap = new HashMap<Class<? extends DatabaseObject>, Class<? extends ObjectFormUI>>();\n" +
+ " ^^^^^^^^^^^^\n" +
+ "X.ObjectFormUI is a raw type. References to generic type X.ObjectFormUI<T> should be parameterized\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " ? uiMap.get(persistentClass)\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Class<capture#1-of ? extends X.ObjectFormUI> to Class<? extends X.ObjectFormUI<T>>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 12)\n" +
+ " : (Class<? extends ObjectFormUI<T>>) uiMap.get(persistentClass);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Class<capture#2-of ? extends X.ObjectFormUI> to Class<? extends X.ObjectFormUI<T>>\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=119395 - variation
@@ -29018,16 +29018,16 @@ public void test0883() {
"Bound mismatch: The generic method foo(U) of type X is not applicable for the arguments (List<V>). The inferred type List<V> is not a valid substitute for the bounded parameter <U extends List<U>>\n" +
"----------\n"
:
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " String s = (String)foo(listu);\n" +
- " ^^^\n" +
- "The method foo(U) in the type X is not applicable for the arguments (List<U>)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " String s = (String)foo(listv);\n" +
- " ^^^\n" +
- "The method foo(U) in the type X is not applicable for the arguments (List<V>)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " String s = (String)foo(listu);\n" +
+ " ^^^\n" +
+ "The method foo(U) in the type X is not applicable for the arguments (List<U>)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " String s = (String)foo(listv);\n" +
+ " ^^^\n" +
+ "The method foo(U) in the type X is not applicable for the arguments (List<V>)\n" +
"----------\n" ));
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=123078
@@ -29047,21 +29047,21 @@ public void test0884() {
" }\n" +
"}\n" ,
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " String s = getClass();\n" +
- " ^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Class<capture#1-of ? extends X> to String\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " return (String) getDefault(getClass());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot cast from X to String\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 8)\n" +
- " return (String) getDefault(getClass());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation getDefault(Class<capture#2-of ? extends X>) of the generic method getDefault(Class<T>) of type X<C>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " String s = getClass();\n" +
+ " ^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Class<capture#1-of ? extends X> to String\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " return (String) getDefault(getClass());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot cast from X to String\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 8)\n" +
+ " return (String) getDefault(getClass());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation getDefault(Class<capture#2-of ? extends X>) of the generic method getDefault(Class<T>) of type X<C>\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=125445
@@ -30534,7 +30534,7 @@ public void test0921() {
"}\n",
},
// javac options
- this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ this.complianceLevel < ClassFileConstants.JDK1_8 ?
(JavacTestOptions) JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 :
JavacTestOptions.DEFAULT/* javac test options */);
}
@@ -30730,7 +30730,7 @@ public void test0926() {
"Type mismatch: cannot convert from NonTerminalSourcePart<Tuple<Boolean,capture#3-of ? extends Term>> to NonTerminalSourcePart<? extends Tuple<Boolean,Term>>\n" +
"----------\n",
// javac options
- JavacTestOptions.JavacHasABug.JavacBug6557661 /* javac test options */);
+ JavacTestOptions.JavacHasABug.JavacBug6557661 /* javac test options */);
} else {
runConformTest(
new String[] {
@@ -30852,31 +30852,31 @@ public void test0929() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " Class<? extends Enum> enumType = null;\n" +
- " ^^^^\n" +
- "Enum is a raw type. References to generic type Enum<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " final Collection<E> test = allOf(enumType);\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation allOf(Class<capture#1-of ? extends Enum>) of the generic method allOf(Class<E>) of type X\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 7)\n" +
- " final Collection<E> test = allOf(enumType);\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Collection needs unchecked conversion to conform to Collection<E>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 9)\n" +
- " Collection<? extends Enum> colType = null;\n" +
- " ^^^^\n" +
- "Enum is a raw type. References to generic type Enum<E> should be parameterized\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 10)\n" +
- " final Collection<E> test2 = colType;\n" +
- " ^^^^^^^\n" +
- "Type mismatch: cannot convert from Collection<capture#2-of ? extends Enum> to Collection<E>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " Class<? extends Enum> enumType = null;\n" +
+ " ^^^^\n" +
+ "Enum is a raw type. References to generic type Enum<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " final Collection<E> test = allOf(enumType);\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation allOf(Class<capture#1-of ? extends Enum>) of the generic method allOf(Class<E>) of type X\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 7)\n" +
+ " final Collection<E> test = allOf(enumType);\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Collection needs unchecked conversion to conform to Collection<E>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 9)\n" +
+ " Collection<? extends Enum> colType = null;\n" +
+ " ^^^^\n" +
+ "Enum is a raw type. References to generic type Enum<E> should be parameterized\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 10)\n" +
+ " final Collection<E> test2 = colType;\n" +
+ " ^^^^^^^\n" +
+ "Type mismatch: cannot convert from Collection<capture#2-of ? extends Enum> to Collection<E>\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=119238
@@ -31355,7 +31355,7 @@ public void test0943() {
" Map<U,U> map2 = foo(u, v, lv.get(0));\n" +
" }\n" +
"}\n";
- if (this.complianceLevel < ClassFileConstants.JDK1_8) {
+ if (this.complianceLevel < ClassFileConstants.JDK1_8) {
this.runNegativeTest(
new String[] {
"X.java",
@@ -31571,37 +31571,37 @@ public void test0949() {
" Zork z;\n" +
" ^^^^\n" +
"Zork cannot be resolved to a type\n" +
- "----------\n" :
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " public <T> Iterable<T> m(T... ts) {\n" +
- " ^^\n" +
- "Type safety: Potential heap pollution via varargs parameter ts\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " public <T> void m3(Iterable<T>... ts) {\n" +
- " ^^\n" +
- "Type safety: Potential heap pollution via varargs parameter ts\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 10)\n" +
- " m3(m(3, 3, 3));\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Type safety: A generic array of Iterable<Integer> is created for a varargs parameter\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 11)\n" +
- " m3(m());\n" +
- " ^^^^^^^\n" +
- "Type safety: A generic array of Iterable<Object> is created for a varargs parameter\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 12)\n" +
- " m3(m(new Object[]{}));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: A generic array of Iterable<Object> is created for a varargs parameter\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 13)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" :
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " public <T> Iterable<T> m(T... ts) {\n" +
+ " ^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter ts\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " public <T> void m3(Iterable<T>... ts) {\n" +
+ " ^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter ts\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 10)\n" +
+ " m3(m(3, 3, 3));\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Type safety: A generic array of Iterable<Integer> is created for a varargs parameter\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 11)\n" +
+ " m3(m());\n" +
+ " ^^^^^^^\n" +
+ "Type safety: A generic array of Iterable<Object> is created for a varargs parameter\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 12)\n" +
+ " m3(m(new Object[]{}));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: A generic array of Iterable<Object> is created for a varargs parameter\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 13)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=128418 - variation
@@ -31646,41 +31646,41 @@ public void test0950() {
" Zork z;\n" +
" ^^^^\n" +
"Zork cannot be resolved to a type\n" +
- "----------\n" :
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " public <T> Iterable<T> m(T[]... ts) {\n" +
- " ^^\n" +
- "Type safety: Potential heap pollution via varargs parameter ts\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " public <T> void m3(Iterable<T>... ts) {\n" +
- " ^^\n" +
- "Type safety: Potential heap pollution via varargs parameter ts\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 10)\n" +
- " m3(m(new Integer[]{3, 3, 3}));\n" +
+ "----------\n" :
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " public <T> Iterable<T> m(T[]... ts) {\n" +
+ " ^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter ts\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " public <T> void m3(Iterable<T>... ts) {\n" +
+ " ^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter ts\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 10)\n" +
+ " m3(m(new Integer[]{3, 3, 3}));\n" +
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
(this.complianceLevel == ClassFileConstants.JDK1_7?
"Type safety: A generic array of Iterable<Object> is created for a varargs parameter\n"
:
- "Type safety: A generic array of Iterable<Integer> is created for a varargs parameter\n"
+ "Type safety: A generic array of Iterable<Integer> is created for a varargs parameter\n"
) +
- "----------\n" +
- "4. WARNING in X.java (at line 11)\n" +
- " m3(m());\n" +
- " ^^^^^^^\n" +
- "Type safety: A generic array of Iterable<Object> is created for a varargs parameter\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 12)\n" +
- " m3(m(new Object[][]{}));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: A generic array of Iterable<Object> is created for a varargs parameter\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 13)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 11)\n" +
+ " m3(m());\n" +
+ " ^^^^^^^\n" +
+ "Type safety: A generic array of Iterable<Object> is created for a varargs parameter\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 12)\n" +
+ " m3(m(new Object[][]{}));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: A generic array of Iterable<Object> is created for a varargs parameter\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 13)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=128418 - variation
@@ -31712,21 +31712,21 @@ public void test0951() {
" ^^^^\n" +
"Zork cannot be resolved to a type\n" +
"----------\n" :
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " public <T> Iterable<T> m(T[]... ts) {\n" +
- " ^^\n" +
- "Type safety: Potential heap pollution via varargs parameter ts\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " public <T> void m3(Iterable<T>... ts) {\n" +
- " ^^\n" +
- "Type safety: Potential heap pollution via varargs parameter ts\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 14)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " public <T> Iterable<T> m(T[]... ts) {\n" +
+ " ^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter ts\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " public <T> void m3(Iterable<T>... ts) {\n" +
+ " ^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter ts\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 14)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=128418 - variation
@@ -31762,37 +31762,37 @@ public void test0952() {
" Zork z;\n" +
" ^^^^\n" +
"Zork cannot be resolved to a type\n" +
- "----------\n" :
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " public <T> Iterable<T> m(T... ts) {\n" +
- " ^^\n" +
- "Type safety: Potential heap pollution via varargs parameter ts\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " public <T> void m3(Iterable<T>... ts) {\n" +
- " ^^\n" +
- "Type safety: Potential heap pollution via varargs parameter ts\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 8)\n" +
- " m3(m(null));\n" +
- " ^^^^^^^^^^^\n" +
- "Type safety: A generic array of Iterable<Object> is created for a varargs parameter\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 8)\n" +
- " m3(m(null));\n" +
- " ^^^^^^^\n" +
- "Type null of the last argument to method m(Object...) doesn't exactly match the vararg parameter type. Cast to Object[] to confirm the non-varargs invocation, or pass individual arguments of type Object for a varargs invocation.\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 9)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" :
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " public <T> Iterable<T> m(T... ts) {\n" +
+ " ^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter ts\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " public <T> void m3(Iterable<T>... ts) {\n" +
+ " ^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter ts\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 8)\n" +
+ " m3(m(null));\n" +
+ " ^^^^^^^^^^^\n" +
+ "Type safety: A generic array of Iterable<Object> is created for a varargs parameter\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 8)\n" +
+ " m3(m(null));\n" +
+ " ^^^^^^^\n" +
+ "Type null of the last argument to method m(Object...) doesn't exactly match the vararg parameter type. Cast to Object[] to confirm the non-varargs invocation, or pass individual arguments of type Object for a varargs invocation.\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 9)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=106325
public void test0953() {
- if (this.complianceLevel >= ClassFileConstants.JDK1_7) return;
+ if (this.complianceLevel >= ClassFileConstants.JDK1_7) return;
this.runNegativeTest(
new String[] {
"X.java", //================================
@@ -31936,16 +31936,16 @@ public void test0955() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (o instanceof List<E>[]) { //incorrect: bug 104695\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot perform instanceof check against parameterized type List<E>[]. Use the form List<?>[] instead since further generic type information will be erased at runtime\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " List<E>[] es= (List<E>[]) o; //unchecked\n" +
- " ^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to List<E>[]\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " if (o instanceof List<E>[]) { //incorrect: bug 104695\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot perform instanceof check against parameterized type List<E>[]. Use the form List<?>[] instead since further generic type information will be erased at runtime\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " List<E>[] es= (List<E>[]) o; //unchecked\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to List<E>[]\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=130128
@@ -32087,21 +32087,21 @@ public void test0960() {
" Zork z;\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " X x = newInstance();\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<A> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " return new X[] { x };\n" +
- " ^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type X[] needs unchecked conversion to conform to X<String>[]\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 7)\n" +
+ " X x = newInstance();\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<A> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " return new X[] { x };\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type X[] needs unchecked conversion to conform to X<String>[]\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 10)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=118273 - variation
@@ -33022,31 +33022,31 @@ public void test0986() {
public void test0987() {
String expectedOutput = new CompilerOptions(getCompilerOptions()).sourceLevel < ClassFileConstants.JDK1_6
? "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " abstract class GLinkElementView<M,CM> extends AbstractLinkView<M> {}\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The return types are incompatible for the inherited methods EditPart.getViewer(), AbstractLinkView<M>.getViewer()\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " public ISheetViewer getViewer() { return null; } \n" +
- " ^^^^^^^^^^^^\n" +
- "The return type is incompatible with EditPart.getViewer()\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " public ISheetViewer getViewer() { return null; } \n" +
- " ^^^^^^^^^^^\n" +
- "The method getViewer() of type AbstractLinkView<M> must override a superclass method\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " abstract class GLinkElementView<M,CM> extends AbstractLinkView<M> {}\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The return types are incompatible for the inherited methods EditPart.getViewer(), AbstractLinkView<M>.getViewer()\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " public ISheetViewer getViewer() { return null; } \n" +
+ " ^^^^^^^^^^^^\n" +
+ "The return type is incompatible with EditPart.getViewer()\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " public ISheetViewer getViewer() { return null; } \n" +
+ " ^^^^^^^^^^^\n" +
+ "The method getViewer() of type AbstractLinkView<M> must override a superclass method\n" +
"----------\n"
- : "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " abstract class GLinkElementView<M,CM> extends AbstractLinkView<M> {}\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The return types are incompatible for the inherited methods EditPart.getViewer(), AbstractLinkView<M>.getViewer()\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " public ISheetViewer getViewer() { return null; } \n" +
- " ^^^^^^^^^^^^\n" +
- "The return type is incompatible with EditPart.getViewer()\n" +
+ : "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " abstract class GLinkElementView<M,CM> extends AbstractLinkView<M> {}\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The return types are incompatible for the inherited methods EditPart.getViewer(), AbstractLinkView<M>.getViewer()\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " public ISheetViewer getViewer() { return null; } \n" +
+ " ^^^^^^^^^^^^\n" +
+ "The return type is incompatible with EditPart.getViewer()\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -33132,15 +33132,15 @@ public void test0988() {
"}", // =================
},
"----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " abstract class GLinkElementView<M,CM> extends AbstractLinkView<M> {}\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The return types are incompatible for the inherited methods EditPart.getViewer(), AbstractLinkView<M>.getViewer()\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " public SheetViewer getViewer() { return null; } \n" +
- " ^^^^^^^^^^^\n" +
- "The return type is incompatible with AbstractEditPart.getViewer()\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " abstract class GLinkElementView<M,CM> extends AbstractLinkView<M> {}\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The return types are incompatible for the inherited methods EditPart.getViewer(), AbstractLinkView<M>.getViewer()\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " public SheetViewer getViewer() { return null; } \n" +
+ " ^^^^^^^^^^^\n" +
+ "The return type is incompatible with AbstractEditPart.getViewer()\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=142653
@@ -33477,64 +33477,64 @@ public void test0999() {
"}", // =================
},
this.complianceLevel < ClassFileConstants.JDK1_7 ?
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation chain(Iterator[]) of the generic method chain(Iterator<E>...) of type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<Number>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 9)\n" +
- " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Iterator[] needs unchecked conversion to conform to Iterator<Number>[]\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 14)\n" +
- " Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" +
- " ^^^^^\n" +
- "The method chain(Iterator<E>...) in the type X is not applicable for the arguments (Iterator<Integer>, Iterator<Float>)\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 18)\n" +
- " Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: A generic array of Iterator<Integer> is created for a varargs parameter\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation chain(Iterator[]) of the generic method chain(Iterator<E>...) of type X\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<Number>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 9)\n" +
+ " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Iterator[] needs unchecked conversion to conform to Iterator<Number>[]\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 14)\n" +
+ " Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" +
+ " ^^^^^\n" +
+ "The method chain(Iterator<E>...) in the type X is not applicable for the arguments (Iterator<Integer>, Iterator<Float>)\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 18)\n" +
+ " Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: A generic array of Iterator<Integer> is created for a varargs parameter\n" +
"----------\n" :
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public static final <T,E extends T> Iterator<T> chain(Iterator<E>... it) {\n" +
- " ^^\n" +
- "Type safety: Potential heap pollution via varargs parameter it\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation chain(Iterator[]) of the generic method chain(Iterator<E>...) of type X\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 9)\n" +
- " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<Number>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 9)\n" +
- " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public static final <T,E extends T> Iterator<T> chain(Iterator<E>... it) {\n" +
+ " ^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter it\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation chain(Iterator[]) of the generic method chain(Iterator<E>...) of type X\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 9)\n" +
+ " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<Number>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 9)\n" +
+ " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8
? "Type safety: The expression of type Iterator[] needs unchecked conversion to conform to Iterator<Number>[]\n"
: "Type safety: The expression of type Iterator[] needs unchecked conversion to conform to Iterator<Object>[]\n") +
- "----------\n" +
- "5. ERROR in X.java (at line 14)\n" +
- " Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" +
- " ^^^^^\n" +
- "The method chain(Iterator<E>...) in the type X is not applicable for the arguments (Iterator<Integer>, Iterator<Float>)\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 18)\n" +
- " Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: A generic array of Iterator<Integer> is created for a varargs parameter\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 14)\n" +
+ " Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" +
+ " ^^^^^\n" +
+ "The method chain(Iterator<E>...) in the type X is not applicable for the arguments (Iterator<Integer>, Iterator<Float>)\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 18)\n" +
+ " Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: A generic array of Iterator<Integer> is created for a varargs parameter\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=144879
@@ -33564,115 +33564,115 @@ public void test1000() {
"}", // =================
},
this.complianceLevel < ClassFileConstants.JDK1_7 ?
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation chain(Iterator[]) of the generic method chain(Iterator<? extends T>...) of type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<Number>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 9)\n" +
- " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation chain(Iterator[]) of the generic method chain(Iterator<? extends T>...) of type X\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<Number>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 9)\n" +
+ " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Type safety: The expression of type Iterator[] needs unchecked conversion to conform to Iterator<? extends Number>[]\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 14)\n" +
- " Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: A generic array of Iterator<? extends "+ intersection("Number", "Comparable<?>") +"> is created for a varargs parameter\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 14)\n" +
- " Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Iterator<"+ intersection("Number", "Comparable<?>") +"> to Iterator<Number>\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 18)\n" +
- " Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: A generic array of Iterator<? extends Integer> is created for a varargs parameter\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 18)\n" +
- " Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Iterator<Integer> to Iterator<Number>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 14)\n" +
+ " Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: A generic array of Iterator<? extends "+ intersection("Number", "Comparable<?>") +"> is created for a varargs parameter\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 14)\n" +
+ " Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Iterator<"+ intersection("Number", "Comparable<?>") +"> to Iterator<Number>\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 18)\n" +
+ " Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: A generic array of Iterator<? extends Integer> is created for a varargs parameter\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 18)\n" +
+ " Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Iterator<Integer> to Iterator<Number>\n" +
"----------\n" :
(this.complianceLevel == ClassFileConstants.JDK1_7 ?
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public static final <T> Iterator<T> chain(Iterator<? extends T>... it) {\n" +
- " ^^\n" +
- "Type safety: Potential heap pollution via varargs parameter it\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation chain(Iterator[]) of the generic method chain(Iterator<? extends T>...) of type X\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 9)\n" +
- " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<Number>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 9)\n" +
- " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Iterator[] needs unchecked conversion to conform to Iterator<? extends Number>[]\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 14)\n" +
- " Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: A generic array of Iterator<? extends Number&"+ intersection("Comparable<?>") +"> is created for a varargs parameter\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 14)\n" +
- " Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Iterator<Number&"+ intersection("Comparable<?>") +"> to Iterator<Number>\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 18)\n" +
- " Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: A generic array of Iterator<? extends Integer> is created for a varargs parameter\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 18)\n" +
- " Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Iterator<Integer> to Iterator<Number>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public static final <T> Iterator<T> chain(Iterator<? extends T>... it) {\n" +
+ " ^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter it\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation chain(Iterator[]) of the generic method chain(Iterator<? extends T>...) of type X\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 9)\n" +
+ " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<Number>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 9)\n" +
+ " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Iterator[] needs unchecked conversion to conform to Iterator<? extends Number>[]\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 14)\n" +
+ " Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: A generic array of Iterator<? extends Number&"+ intersection("Comparable<?>") +"> is created for a varargs parameter\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 14)\n" +
+ " Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Iterator<Number&"+ intersection("Comparable<?>") +"> to Iterator<Number>\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 18)\n" +
+ " Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: A generic array of Iterator<? extends Integer> is created for a varargs parameter\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 18)\n" +
+ " Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Iterator<Integer> to Iterator<Number>\n" +
"----------\n"
: // no more errors in JDK1_8+
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public static final <T> Iterator<T> chain(Iterator<? extends T>... it) {\n" +
- " ^^\n" +
- "Type safety: Potential heap pollution via varargs parameter it\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation chain(Iterator[]) of the generic method chain(Iterator<? extends T>...) of type X\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 9)\n" +
- " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<Number>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 9)\n" +
- " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Iterator[] needs unchecked conversion to conform to Iterator<? extends Object>[]\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 14)\n" +
- " Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: A generic array of Iterator<? extends Number> is created for a varargs parameter\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 18)\n" +
- " Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: A generic array of Iterator<? extends Number> is created for a varargs parameter\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public static final <T> Iterator<T> chain(Iterator<? extends T>... it) {\n" +
+ " ^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter it\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation chain(Iterator[]) of the generic method chain(Iterator<? extends T>...) of type X\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 9)\n" +
+ " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<Number>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 9)\n" +
+ " Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Iterator[] needs unchecked conversion to conform to Iterator<? extends Object>[]\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 14)\n" +
+ " Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: A generic array of Iterator<? extends Number> is created for a varargs parameter\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 18)\n" +
+ " Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: A generic array of Iterator<? extends Number> is created for a varargs parameter\n" +
"----------\n"
)
);
@@ -33896,26 +33896,26 @@ public void test1008() {
"\n" +
"\n", // =================
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " void foo(L l, C<? extends X> c) {\n" +
- " ^\n" +
- "L is a raw type. References to generic type L<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " X x = bar(l, c);\n" +
- " ^^^^^^^^^\n" +
- "Type safety: Unchecked invocation bar(L, C<capture#1-of ? extends X>) of the generic method bar(L<T>, C<? extends T>) of type X\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 3)\n" +
- " X x = bar(l, c);\n" +
- " ^\n" +
- "Type safety: The expression of type L needs unchecked conversion to conform to L<X>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " return zork;\n" +
- " ^^^^\n" +
- "zork cannot be resolved to a variable\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " void foo(L l, C<? extends X> c) {\n" +
+ " ^\n" +
+ "L is a raw type. References to generic type L<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " X x = bar(l, c);\n" +
+ " ^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation bar(L, C<capture#1-of ? extends X>) of the generic method bar(L<T>, C<? extends T>) of type X\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 3)\n" +
+ " X x = bar(l, c);\n" +
+ " ^\n" +
+ "Type safety: The expression of type L needs unchecked conversion to conform to L<X>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " return zork;\n" +
+ " ^^^^\n" +
+ "zork cannot be resolved to a variable\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061 - variation
@@ -33990,36 +33990,36 @@ public void test1011() {
" <U> void bar3(Map<String,String> map, U s, Map<U,U> map2) {}\n" +
"}\n", // =================
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " void foo(HashMap map, String s, Map<String,String> map2) {\n" +
- " ^^^^^^^\n" +
- "HashMap is a raw type. References to generic type HashMap<K,V> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " bar(map, s, map2); //1\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation bar(HashMap, String, Map<String,String>) of the generic method bar(Map<U,U>, U, Map<U,U>) of type X\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 4)\n" +
- " bar(map, s, map2); //1\n" +
- " ^^^\n" +
- "Type safety: The expression of type HashMap needs unchecked conversion to conform to Map<String,String>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 6)\n" +
- " bar2(map, s, map2); //3\n" +
- " ^^^\n" +
- "Type safety: The expression of type HashMap needs unchecked conversion to conform to Map<String,String>\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 7)\n" +
- " bar3(map, s, map2); //4\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation bar3(HashMap, String, Map<String,String>) of the generic method bar3(Map<String,String>, U, Map<U,U>) of type X\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 7)\n" +
- " bar3(map, s, map2); //4\n" +
- " ^^^\n" +
- "Type safety: The expression of type HashMap needs unchecked conversion to conform to Map<String,String>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " void foo(HashMap map, String s, Map<String,String> map2) {\n" +
+ " ^^^^^^^\n" +
+ "HashMap is a raw type. References to generic type HashMap<K,V> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " bar(map, s, map2); //1\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation bar(HashMap, String, Map<String,String>) of the generic method bar(Map<U,U>, U, Map<U,U>) of type X\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 4)\n" +
+ " bar(map, s, map2); //1\n" +
+ " ^^^\n" +
+ "Type safety: The expression of type HashMap needs unchecked conversion to conform to Map<String,String>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 6)\n" +
+ " bar2(map, s, map2); //3\n" +
+ " ^^^\n" +
+ "Type safety: The expression of type HashMap needs unchecked conversion to conform to Map<String,String>\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 7)\n" +
+ " bar3(map, s, map2); //4\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation bar3(HashMap, String, Map<String,String>) of the generic method bar3(Map<String,String>, U, Map<U,U>) of type X\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 7)\n" +
+ " bar3(map, s, map2); //4\n" +
+ " ^^^\n" +
+ "Type safety: The expression of type HashMap needs unchecked conversion to conform to Map<String,String>\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061 - variation
@@ -34047,56 +34047,56 @@ public void test1012() {
"class C<E> {}\n" +
"class L<E> {}\n", // =================
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " void foo(L l, C<X> c) {\n" +
- " ^\n" +
- "L is a raw type. References to generic type L<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " X x = bar1(l, c);\n" +
- " ^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation bar1(L, C<X>) of the generic method bar1(L<T>, C<T>) of type X\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 3)\n" +
- " X x = bar1(l, c);\n" +
- " ^\n" +
- "Type safety: The expression of type L needs unchecked conversion to conform to L<X>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 4)\n" +
- " L<X> lx = bar2(l, c);\n" +
- " ^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation bar2(L, C<X>) of the generic method bar2(L<T>, C<T>) of type X\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 4)\n" +
- " L<X> lx = bar2(l, c);\n" +
- " ^^^^^^^^^^\n" +
- "Type safety: The expression of type L needs unchecked conversion to conform to L<X>\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 4)\n" +
- " L<X> lx = bar2(l, c);\n" +
- " ^\n" +
- "Type safety: The expression of type L needs unchecked conversion to conform to L<X>\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 5)\n" +
- " C<X> cx = bar3(l, c);\n" +
- " ^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation bar3(L, C<X>) of the generic method bar3(L<T>, C<T>) of type X\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 5)\n" +
- " C<X> cx = bar3(l, c);\n" +
- " ^^^^^^^^^^\n" +
- "Type safety: The expression of type C needs unchecked conversion to conform to C<X>\n" +
- "----------\n" +
- "9. WARNING in X.java (at line 5)\n" +
- " C<X> cx = bar3(l, c);\n" +
- " ^\n" +
- "Type safety: The expression of type L needs unchecked conversion to conform to L<X>\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 14)\n" +
- " return zork;\n" +
- " ^^^^\n" +
- "zork cannot be resolved to a variable\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " void foo(L l, C<X> c) {\n" +
+ " ^\n" +
+ "L is a raw type. References to generic type L<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " X x = bar1(l, c);\n" +
+ " ^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation bar1(L, C<X>) of the generic method bar1(L<T>, C<T>) of type X\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 3)\n" +
+ " X x = bar1(l, c);\n" +
+ " ^\n" +
+ "Type safety: The expression of type L needs unchecked conversion to conform to L<X>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 4)\n" +
+ " L<X> lx = bar2(l, c);\n" +
+ " ^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation bar2(L, C<X>) of the generic method bar2(L<T>, C<T>) of type X\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 4)\n" +
+ " L<X> lx = bar2(l, c);\n" +
+ " ^^^^^^^^^^\n" +
+ "Type safety: The expression of type L needs unchecked conversion to conform to L<X>\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 4)\n" +
+ " L<X> lx = bar2(l, c);\n" +
+ " ^\n" +
+ "Type safety: The expression of type L needs unchecked conversion to conform to L<X>\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 5)\n" +
+ " C<X> cx = bar3(l, c);\n" +
+ " ^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation bar3(L, C<X>) of the generic method bar3(L<T>, C<T>) of type X\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 5)\n" +
+ " C<X> cx = bar3(l, c);\n" +
+ " ^^^^^^^^^^\n" +
+ "Type safety: The expression of type C needs unchecked conversion to conform to C<X>\n" +
+ "----------\n" +
+ "9. WARNING in X.java (at line 5)\n" +
+ " C<X> cx = bar3(l, c);\n" +
+ " ^\n" +
+ "Type safety: The expression of type L needs unchecked conversion to conform to L<X>\n" +
+ "----------\n" +
+ "10. ERROR in X.java (at line 14)\n" +
+ " return zork;\n" +
+ " ^^^^\n" +
+ "zork cannot be resolved to a variable\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061 - variation
@@ -34131,41 +34131,41 @@ public void test1013() {
" }\n" +
"}\n", // =================
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " System.out.println(zork);\n" +
- " ^^^^\n" +
- "zork cannot be resolved to a variable\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 14)\n" +
- " void foo(List l1, List<X> l2) {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 15)\n" +
- " X x = bar1(l1, l2);\n" +
- " ^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation bar1(List, List<X>) of the generic method bar1(List<T>, List<T>) of type X\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 15)\n" +
- " X x = bar1(l1, l2);\n" +
- " ^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<X>\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 17)\n" +
- " List<X> lx = bar2(l1, l2);\n" +
- " ^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation bar2(List, List<X>) of the generic method bar2(List<T>, List<T>) of type X\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 17)\n" +
- " List<X> lx = bar2(l1, l2);\n" +
- " ^^^^^^^^^^^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<X>\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 17)\n" +
- " List<X> lx = bar2(l1, l2);\n" +
- " ^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<X>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " System.out.println(zork);\n" +
+ " ^^^^\n" +
+ "zork cannot be resolved to a variable\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 14)\n" +
+ " void foo(List l1, List<X> l2) {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 15)\n" +
+ " X x = bar1(l1, l2);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation bar1(List, List<X>) of the generic method bar1(List<T>, List<T>) of type X\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 15)\n" +
+ " X x = bar1(l1, l2);\n" +
+ " ^^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<X>\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 17)\n" +
+ " List<X> lx = bar2(l1, l2);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation bar2(List, List<X>) of the generic method bar2(List<T>, List<T>) of type X\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 17)\n" +
+ " List<X> lx = bar2(l1, l2);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<X>\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 17)\n" +
+ " List<X> lx = bar2(l1, l2);\n" +
+ " ^^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<X>\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061 - variation
@@ -34183,41 +34183,41 @@ public void test1014() {
" <U,V> Map<U,V> bar(List<U> lu, List<V> lv) { return null; }\n" +
"}\n", // =================
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " void foo1(List l, List<String> ls) {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " Set<Map.Entry<String,String>> mss1 = bar(l, ls).entrySet();\n" +
- " ^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation bar(List, List<String>) of the generic method bar(List<U>, List<V>) of type X\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 5)\n" +
- " Set<Map.Entry<String,String>> mss1 = bar(l, ls).entrySet();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Set needs unchecked conversion to conform to Set<Map.Entry<String,String>>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 5)\n" +
- " Set<Map.Entry<String,String>> mss1 = bar(l, ls).entrySet();\n" +
- " ^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 6)\n" +
- " String s = bar(l, ls).entrySet();\n" +
- " ^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation bar(List, List<String>) of the generic method bar(List<U>, List<V>) of type X\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 6)\n" +
- " String s = bar(l, ls).entrySet();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Set to String\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 6)\n" +
- " String s = bar(l, ls).entrySet();\n" +
- " ^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " void foo1(List l, List<String> ls) {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " Set<Map.Entry<String,String>> mss1 = bar(l, ls).entrySet();\n" +
+ " ^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation bar(List, List<String>) of the generic method bar(List<U>, List<V>) of type X\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 5)\n" +
+ " Set<Map.Entry<String,String>> mss1 = bar(l, ls).entrySet();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Set needs unchecked conversion to conform to Set<Map.Entry<String,String>>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 5)\n" +
+ " Set<Map.Entry<String,String>> mss1 = bar(l, ls).entrySet();\n" +
+ " ^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 6)\n" +
+ " String s = bar(l, ls).entrySet();\n" +
+ " ^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation bar(List, List<String>) of the generic method bar(List<U>, List<V>) of type X\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 6)\n" +
+ " String s = bar(l, ls).entrySet();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Set to String\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 6)\n" +
+ " String s = bar(l, ls).entrySet();\n" +
+ " ^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061 - variation
@@ -34237,41 +34237,41 @@ public void test1015() {
" <U,V> List<V> bar(List<U> lu, List<V> lv) { return null; }\n" +
"}\n", // =================
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " void foo1(List l, List<String> ls) {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " List<String> ls1 = bar(l, ls);\n" +
- " ^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation bar(List, List<String>) of the generic method bar(List<U>, List<V>) of type X\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 4)\n" +
- " List<String> ls1 = bar(l, ls);\n" +
- " ^^^^^^^^^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<String>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 4)\n" +
- " List<String> ls1 = bar(l, ls);\n" +
- " ^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 5)\n" +
- " String s = bar(l, ls);\n" +
- " ^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation bar(List, List<String>) of the generic method bar(List<U>, List<V>) of type X\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 5)\n" +
- " String s = bar(l, ls);\n" +
- " ^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from List to String\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 5)\n" +
- " String s = bar(l, ls);\n" +
- " ^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " void foo1(List l, List<String> ls) {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " List<String> ls1 = bar(l, ls);\n" +
+ " ^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation bar(List, List<String>) of the generic method bar(List<U>, List<V>) of type X\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 4)\n" +
+ " List<String> ls1 = bar(l, ls);\n" +
+ " ^^^^^^^^^^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<String>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 4)\n" +
+ " List<String> ls1 = bar(l, ls);\n" +
+ " ^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 5)\n" +
+ " String s = bar(l, ls);\n" +
+ " ^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation bar(List, List<String>) of the generic method bar(List<U>, List<V>) of type X\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 5)\n" +
+ " String s = bar(l, ls);\n" +
+ " ^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from List to String\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 5)\n" +
+ " String s = bar(l, ls);\n" +
+ " ^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061 - variation
@@ -34464,16 +34464,16 @@ public void test1021b() { // should this case be allowed?
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in p\\SomeClass2.java (at line 3)\n" +
- " public abstract class SomeClass2<T> extends M {\n" +
- " ^\n" +
- "M cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in p\\SomeClass2.java (at line 4)\n" +
- " public static class M1 extends M2 {}\n" +
- " ^^\n" +
- "Cycle detected: a cycle exists in the type hierarchy between SomeClass2.M1 and SomeClass2<T>\n" +
+ "----------\n" +
+ "1. ERROR in p\\SomeClass2.java (at line 3)\n" +
+ " public abstract class SomeClass2<T> extends M {\n" +
+ " ^\n" +
+ "M cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in p\\SomeClass2.java (at line 4)\n" +
+ " public static class M1 extends M2 {}\n" +
+ " ^^\n" +
+ "Cycle detected: a cycle exists in the type hierarchy between SomeClass2.M1 and SomeClass2<T>\n" +
"----------\n"
);
}
@@ -34683,7 +34683,7 @@ public void test1027() {
" return set;\n" +
" }\n" +
"}\n" +
- "\n" :
+ "\n" :
"import java.util.LinkedHashSet;\n" +
"import java.util.Set;\n" +
"\n" +
@@ -35008,11 +35008,11 @@ public void test1034() {
" ^^^^^^^^^^^\n" +
"The method getInstance(Closure<? super I>, Closure<? super I>) in the type ChainedClosure is not applicable for the arguments (Closure<capture#10-of ? super J>, Closure<capture#11-of ? super J>)\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in ChainedClosure.java (at line 33)\n" +
- " return ChainedClosure.getInstance(closure1, closure2);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Closure<capture#10-of ? super J & capture#11-of ? super J> to Closure<String>\n" +
+ "----------\n" +
+ "1. ERROR in ChainedClosure.java (at line 33)\n" +
+ " return ChainedClosure.getInstance(closure1, closure2);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Closure<capture#10-of ? super J & capture#11-of ? super J> to Closure<String>\n" +
"----------\n",
JavacTestOptions.DEFAULT);
}
@@ -37608,41 +37608,41 @@ public void test1085() {
" E e2 = e2.e;\n" +
"}", // =================
},
- "----------\n" +
- "1. ERROR in Y.java (at line 2)\n" +
- " Z z1 = z1;\n" +
- " ^^\n" +
- "Cannot reference a field before it is defined\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 3)\n" +
- " Z[] z2 = z2;\n" +
- " ^^\n" +
- "Cannot reference a field before it is defined\n" +
- "----------\n" +
- "3. ERROR in Y.java (at line 6)\n" +
- " E e0 = es[0];\n" +
- " ^^\n" +
- "Cannot reference a field before it is defined\n" +
- "----------\n" +
- "4. ERROR in Y.java (at line 7)\n" +
- " E e = e;\n" +
- " ^\n" +
- "Cannot reference a field before it is defined\n" +
- "----------\n" +
- "5. ERROR in Y.java (at line 8)\n" +
- " E[] es = es;\n" +
- " ^^\n" +
- "Cannot reference a field before it is defined\n" +
- "----------\n" +
- "6. ERROR in Y.java (at line 9)\n" +
- " E e2 = e2.e;\n" +
- " ^^\n" +
- "Cannot reference a field before it is defined\n" +
- "----------\n" +
- "7. ERROR in Y.java (at line 9)\n" +
- " E e2 = e2.e;\n" +
- " ^\n" +
- "e cannot be resolved or is not a field\n" +
+ "----------\n" +
+ "1. ERROR in Y.java (at line 2)\n" +
+ " Z z1 = z1;\n" +
+ " ^^\n" +
+ "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "2. ERROR in Y.java (at line 3)\n" +
+ " Z[] z2 = z2;\n" +
+ " ^^\n" +
+ "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "3. ERROR in Y.java (at line 6)\n" +
+ " E e0 = es[0];\n" +
+ " ^^\n" +
+ "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "4. ERROR in Y.java (at line 7)\n" +
+ " E e = e;\n" +
+ " ^\n" +
+ "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "5. ERROR in Y.java (at line 8)\n" +
+ " E[] es = es;\n" +
+ " ^^\n" +
+ "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "6. ERROR in Y.java (at line 9)\n" +
+ " E e2 = e2.e;\n" +
+ " ^^\n" +
+ "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "7. ERROR in Y.java (at line 9)\n" +
+ " E e2 = e2.e;\n" +
+ " ^\n" +
+ "e cannot be resolved or is not a field\n" +
"----------\n");
}
@@ -38126,7 +38126,7 @@ public void test1098() {
" class Y extends Zork {}\n" +
" ^^^^\n" +
"Zork cannot be resolved to a type\n" +
- "----------\n";
+ "----------\n";
this.runNegativeTest(new String[] {
"X.java",
"public class X { \n" +
@@ -38179,11 +38179,11 @@ public void test1099() {
},
// compiler results
this.complianceLevel < ClassFileConstants.JDK1_7 ? "" :
- "----------\n" +
- "1. WARNING in X.java (at line 21)\n" +
- " public <U, V extends U> List<U> newList(V... values) {\n" +
- " ^^^^^^\n" +
- "Type safety: Potential heap pollution via varargs parameter values\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 21)\n" +
+ " public <U, V extends U> List<U> newList(V... values) {\n" +
+ " ^^^^^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter values\n" +
"----------\n",
// runtime results
"SUCCESS" /* expected output string */,
@@ -38487,7 +38487,7 @@ public void test1109() {
" return true ? Z.bar() : null;\n" +
" ^^^^^^^^^^^^^^^^^^^^^\n" +
"Type mismatch: cannot convert from Y<Object> to Y<String>\n" +
- "----------\n");
+ "----------\n");
} else {
runConformTest(
new String[] {
@@ -38834,7 +38834,7 @@ public void test1118() {
"1. ERROR in X.java (at line 6)\n" +
" foo(cls);\n" +
" ^^^\n" +
- "The method foo(Class<T>) in the type X is not applicable for the arguments (Class<capture#1-of ? extends List<?>>)\n" +
+ "The method foo(Class<T>) in the type X is not applicable for the arguments (Class<capture#1-of ? extends List<?>>)\n" +
"----------\n");
}
}
@@ -39387,26 +39387,26 @@ public void test1129() {
" ^^^^^^^^^^^^^^^\n" +
"Type mismatch: cannot convert from Object&Comparable<?>&Serializable to String\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 18)\n" +
- " String s = b ? arg1 : arg2;\n" +
- " ^^^^\n" +
- "Type mismatch: cannot convert from IX<String> to String\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 18)\n" +
- " String s = b ? arg1 : arg2;\n" +
- " ^^^^\n" +
- "Type mismatch: cannot convert from IX<capture#1-of ? extends Object> to String\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 21)\n" +
- " String s = b ? arg1 : arg2;\n" +
- " ^^^^\n" +
- "Type mismatch: cannot convert from Arg1 to String\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 21)\n" +
- " String s = b ? arg1 : arg2;\n" +
- " ^^^^\n" +
- "Type mismatch: cannot convert from Arg2 to String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 18)\n" +
+ " String s = b ? arg1 : arg2;\n" +
+ " ^^^^\n" +
+ "Type mismatch: cannot convert from IX<String> to String\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 18)\n" +
+ " String s = b ? arg1 : arg2;\n" +
+ " ^^^^\n" +
+ "Type mismatch: cannot convert from IX<capture#1-of ? extends Object> to String\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 21)\n" +
+ " String s = b ? arg1 : arg2;\n" +
+ " ^^^^\n" +
+ "Type mismatch: cannot convert from Arg1 to String\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 21)\n" +
+ " String s = b ? arg1 : arg2;\n" +
+ " ^^^^\n" +
+ "Type mismatch: cannot convert from Arg2 to String\n" +
"----------\n");
}
public void test1130() {
@@ -39424,23 +39424,23 @@ public void test1130() {
" }\n" +
"}\n", // =================
},
- this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ this.complianceLevel < ClassFileConstants.JDK1_8 ?
"----------\n" +
"1. ERROR in X.java (at line 8)\n" +
" String s = b ? l1.get(0) : l2.get(0);\n" +
" ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Type mismatch: cannot convert from Comparable<T> to String\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " String s = b ? l1.get(0) : l2.get(0);\n" +
- " ^^^^^^^^^\n" +
- "Type mismatch: cannot convert from capture#1-of ? extends T to String\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " String s = b ? l1.get(0) : l2.get(0);\n" +
- " ^^^^^^^^^\n" +
- "Type mismatch: cannot convert from capture#2-of ? extends Comparable<T> to String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " String s = b ? l1.get(0) : l2.get(0);\n" +
+ " ^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from capture#1-of ? extends T to String\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " String s = b ? l1.get(0) : l2.get(0);\n" +
+ " ^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from capture#2-of ? extends Comparable<T> to String\n" +
"----------\n");
}
public void test1131() {
@@ -39456,23 +39456,23 @@ public void test1131() {
" }\n" +
"} \n", // =================
},
- this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ this.complianceLevel < ClassFileConstants.JDK1_8 ?
"----------\n" +
"1. ERROR in X.java (at line 6)\n" +
" String s = b ? l1.get(0) : l2.get(0);\n" +
" ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Type mismatch: cannot convert from Comparable<capture#3-of ? extends T> to String\n" +
- "----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " String s = b ? l1.get(0) : l2.get(0);\n" +
- " ^^^^^^^^^\n" +
- "Type mismatch: cannot convert from capture#1-of ? extends V to String\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " String s = b ? l1.get(0) : l2.get(0);\n" +
- " ^^^^^^^^^\n" +
- "Type mismatch: cannot convert from capture#2-of ? extends Comparable<V> to String\n" +
+ "----------\n" :
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " String s = b ? l1.get(0) : l2.get(0);\n" +
+ " ^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from capture#1-of ? extends V to String\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " String s = b ? l1.get(0) : l2.get(0);\n" +
+ " ^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from capture#2-of ? extends Comparable<V> to String\n" +
"----------\n");
}
public void test1132() {
@@ -39641,11 +39641,11 @@ public void test1135() {
" } \n" +
"}\n", // =================
},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " public class X extends Foo<X.Baz> {\n" +
- " ^^^^^\n" +
- "The type X.Baz is not visible\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " public class X extends Foo<X.Baz> {\n" +
+ " ^^^^^\n" +
+ "The type X.Baz is not visible\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=154029
@@ -39986,53 +39986,53 @@ public void test1146() {
"The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
"----------\n":
(this.complianceLevel == ClassFileConstants.JDK1_7 ?
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " Comparator<? super T>... rest) {\n" +
- " ^^^^\n" +
- "Type safety: Potential heap pollution via varargs parameter rest\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " int i = asList(a, b, rest);\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from List<Comparator<?>> to int\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " int j = asList2(a, b);\n" +
- " ^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from List<Comparator<? extends Object>> to int\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " return compound(asList(a, b, rest));\n" +
- " ^^^^^^^^\n" +
- "The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 14)\n" +
- " public static <E> List<E> asList(E a, E b, E... rest) {\n" +
- " ^^^^\n" +
- "Type safety: Potential heap pollution via varargs parameter rest\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " Comparator<? super T>... rest) {\n" +
+ " ^^^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter rest\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " int i = asList(a, b, rest);\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from List<Comparator<?>> to int\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " int j = asList2(a, b);\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from List<Comparator<? extends Object>> to int\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 9)\n" +
+ " return compound(asList(a, b, rest));\n" +
+ " ^^^^^^^^\n" +
+ "The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 14)\n" +
+ " public static <E> List<E> asList(E a, E b, E... rest) {\n" +
+ " ^^^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter rest\n" +
"----------\n"
: // 1.8 : one fewer error due to better type inference:
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " Comparator<? super T>... rest) {\n" +
- " ^^^^\n" +
- "Type safety: Potential heap pollution via varargs parameter rest\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " int i = asList(a, b, rest);\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from List<Comparator<? super T>> to int\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " int j = asList2(a, b);\n" +
- " ^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from List<Comparator<? extends Object>> to int\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 14)\n" +
- " public static <E> List<E> asList(E a, E b, E... rest) {\n" +
- " ^^^^\n" +
- "Type safety: Potential heap pollution via varargs parameter rest\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " Comparator<? super T>... rest) {\n" +
+ " ^^^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter rest\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " int i = asList(a, b, rest);\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from List<Comparator<? super T>> to int\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " int j = asList2(a, b);\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from List<Comparator<? extends Object>> to int\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 14)\n" +
+ " public static <E> List<E> asList(E a, E b, E... rest) {\n" +
+ " ^^^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter rest\n" +
"----------\n"));
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=190945 - variation
@@ -40136,78 +40136,78 @@ public void test1148() {
"The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
"----------\n":
this.complianceLevel == ClassFileConstants.JDK1_7 ?
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public static <T> Comparator<T> compound(Comparator<? super T> a, Comparator<? super T> b, Comparator<? super T>... rest) {\n" +
- " ^^^^\n" +
- "Type safety: Potential heap pollution via varargs parameter rest\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " int i = asList(a, b, rest);\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from List<Comparator<?>> to int\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " int j = compound(asList(a, b, rest));\n" +
- " ^^^^^^^^\n" +
- "The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " compound(asList(a, b, rest));\n" +
- " ^^^^^^^^\n" +
- "The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " if (true) return compound(asList(a, b, rest));\n" +
- " ^^^^^^^^\n" +
- "The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 10)\n" +
- " compound(c);\n" +
- " ^^^^^^^^\n" +
- "The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 11)\n" +
- " return compound(c);\n" +
- " ^^^^^^^^\n" +
- "The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 16)\n" +
- " public static <E> List<E> asList(E a, E b, E... rest) {\n" +
- " ^^^^\n" +
- "Type safety: Potential heap pollution via varargs parameter rest\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public static <T> Comparator<T> compound(Comparator<? super T> a, Comparator<? super T> b, Comparator<? super T>... rest) {\n" +
+ " ^^^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter rest\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " int i = asList(a, b, rest);\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from List<Comparator<?>> to int\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " int j = compound(asList(a, b, rest));\n" +
+ " ^^^^^^^^\n" +
+ "The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " compound(asList(a, b, rest));\n" +
+ " ^^^^^^^^\n" +
+ "The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 7)\n" +
+ " if (true) return compound(asList(a, b, rest));\n" +
+ " ^^^^^^^^\n" +
+ "The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 10)\n" +
+ " compound(c);\n" +
+ " ^^^^^^^^\n" +
+ "The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 11)\n" +
+ " return compound(c);\n" +
+ " ^^^^^^^^\n" +
+ "The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 16)\n" +
+ " public static <E> List<E> asList(E a, E b, E... rest) {\n" +
+ " ^^^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter rest\n" +
"----------\n"
: // fewer errors in 1.8+:
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public static <T> Comparator<T> compound(Comparator<? super T> a, Comparator<? super T> b, Comparator<? super T>... rest) {\n" +
- " ^^^^\n" +
- "Type safety: Potential heap pollution via varargs parameter rest\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " int i = asList(a, b, rest);\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from List<Comparator<?>> to int\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " int j = compound(asList(a, b, rest));\n" +
- " ^^^^^^^^\n" +
- "The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " compound(c);\n" +
- " ^^^^^^^^\n" +
- "The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 11)\n" +
- " return compound(c);\n" +
- " ^^^^^^^^\n" +
- "The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 16)\n" +
- " public static <E> List<E> asList(E a, E b, E... rest) {\n" +
- " ^^^^\n" +
- "Type safety: Potential heap pollution via varargs parameter rest\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public static <T> Comparator<T> compound(Comparator<? super T> a, Comparator<? super T> b, Comparator<? super T>... rest) {\n" +
+ " ^^^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter rest\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " int i = asList(a, b, rest);\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from List<Comparator<?>> to int\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " int j = compound(asList(a, b, rest));\n" +
+ " ^^^^^^^^\n" +
+ "The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 10)\n" +
+ " compound(c);\n" +
+ " ^^^^^^^^\n" +
+ "The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 11)\n" +
+ " return compound(c);\n" +
+ " ^^^^^^^^\n" +
+ "The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 16)\n" +
+ " public static <E> List<E> asList(E a, E b, E... rest) {\n" +
+ " ^^^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter rest\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=198051
@@ -40343,7 +40343,7 @@ public void test1151() throws Exception {
"}\n"
},
//"java.lang.ref.Reference<X<java.lang.String>.Other<java.lang.Thread>.Deeply>##java.lang.ref.Reference<X<java.lang.String>.Other<java.lang.Thread>.Deeply$Inside<java.lang.Number>>"
- (reflectNestedClassUseDollar
+ (reflectNestedClassUseDollar
? "java.lang.ref.Reference<X<java.lang.String>$Other<java.lang.Thread>$Deeply>"
: "java.lang.ref.Reference<X<java.lang.String>.Other<java.lang.Thread>.Deeply>")
);
@@ -40459,7 +40459,7 @@ public void test1153() {
"}\n"
},
"java.lang.ref.Reference<p.X$Rather$Deeply>##java.lang.ref.Reference<p.X$Rather>##java.lang.ref.Reference<p.X$Rather$Deeply$Inside>##"+
- (reflectNestedClassUseDollar
+ (reflectNestedClassUseDollar
? "java.lang.ref.Reference<p.X<java.lang.String>$Other<java.lang.Thread>$Deeply>"
: "java.lang.ref.Reference<p.X<java.lang.String>.Other<java.lang.Thread>.Deeply>"),
null,
@@ -40923,11 +40923,11 @@ public void test1167() {
" }\n" +
"}\n", // =================
},
- "----------\n" +
- "1. ERROR in Foo.java (at line 3)\n" +
- " Bar(Foo<? extends B> bar) {}\n" +
- " ^^^^^^^^^^^\n" +
- "Bound mismatch: The type ? extends B is not a valid substitute for the bounded parameter <F extends Enum<F>> of the type Foo<F>\n" +
+ "----------\n" +
+ "1. ERROR in Foo.java (at line 3)\n" +
+ " Bar(Foo<? extends B> bar) {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "Bound mismatch: The type ? extends B is not a valid substitute for the bounded parameter <F extends Enum<F>> of the type Foo<F>\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=169049
@@ -41320,87 +41320,87 @@ public void test1180() {
public void test1181() {
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public static <S, T extends Comparable<S>, R extends S & T> R max(T arg1, S arg2) {\n" +
- " ^\n" +
- "Cannot specify any additional bound T when first bound is a type parameter\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " public static <S, T extends Comparable<S>, R extends S & T> R max(T arg1, S arg2) {\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public static <S, T extends Comparable<S>, R extends S & T> R max(T arg1, S arg2) {\n" +
+ " ^\n" +
+ "Cannot specify any additional bound T when first bound is a type parameter\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " public static <S, T extends Comparable<S>, R extends S & T> R max(T arg1, S arg2) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method max(T, S) is the same as another method in type X\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 3)\n" +
- " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to R\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " public static <T extends Comparable<S>, S, R extends S & Comparable<S>> R max(T arg1, S arg2) {\n" +
- " ^^^^^^^^^^\n" +
- "Cannot specify any additional bound Comparable<S> when first bound is a type parameter\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 5)\n" +
- " public static <T extends Comparable<S>, S, R extends S & Comparable<S>> R max(T arg1, S arg2) {\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 3)\n" +
+ " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to R\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " public static <T extends Comparable<S>, S, R extends S & Comparable<S>> R max(T arg1, S arg2) {\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot specify any additional bound Comparable<S> when first bound is a type parameter\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 5)\n" +
+ " public static <T extends Comparable<S>, S, R extends S & Comparable<S>> R max(T arg1, S arg2) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method max(T, S) is the same as another method in type X\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 6)\n" +
- " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to R\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 8)\n" +
- " public static <T extends Comparable<S>, S, R extends Comparable<S>> R max(T arg1, S arg2) {\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 6)\n" +
+ " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to R\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 8)\n" +
+ " public static <T extends Comparable<S>, S, R extends Comparable<S>> R max(T arg1, S arg2) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method max(T, S) is the same as another method in type X\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 9)\n" +
- " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to R\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 9)\n" +
+ " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to R\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public static <S, T extends Comparable<S>, R extends S & T> R max(T arg1, S arg2) {\n" +
- " ^\n" +
- "Cannot specify any additional bound T when first bound is a type parameter\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " public static <S, T extends Comparable<S>, R extends S & T> R max(T arg1, S arg2) {\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public static <S, T extends Comparable<S>, R extends S & T> R max(T arg1, S arg2) {\n" +
+ " ^\n" +
+ "Cannot specify any additional bound T when first bound is a type parameter\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " public static <S, T extends Comparable<S>, R extends S & T> R max(T arg1, S arg2) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method max(T, S) is the same as another method in type X\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 3)\n" +
- " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to R\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " public static <T extends Comparable<S>, S, R extends S & Comparable<S>> R max(T arg1, S arg2) {\n" +
- " ^^^^^^^^^^\n" +
- "Cannot specify any additional bound Comparable<S> when first bound is a type parameter\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 5)\n" +
- " public static <T extends Comparable<S>, S, R extends S & Comparable<S>> R max(T arg1, S arg2) {\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 3)\n" +
+ " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to R\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " public static <T extends Comparable<S>, S, R extends S & Comparable<S>> R max(T arg1, S arg2) {\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot specify any additional bound Comparable<S> when first bound is a type parameter\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 5)\n" +
+ " public static <T extends Comparable<S>, S, R extends S & Comparable<S>> R max(T arg1, S arg2) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method max(T, S) is the same as another method in type X\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 6)\n" +
- " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to R\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 8)\n" +
- " public static <T extends Comparable<S>, S, R extends Comparable<S>> R max(T arg1, S arg2) {\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 6)\n" +
+ " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to R\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 8)\n" +
+ " public static <T extends Comparable<S>, S, R extends Comparable<S>> R max(T arg1, S arg2) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method max(T, S) is the same as another method in type X\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 9)\n" +
- " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to R\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 9)\n" +
+ " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to R\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -42207,21 +42207,21 @@ public void test1203a() {
// activated test in all modes so we can track any changes
public void test1203b() {
String expectedOutput = this.complianceLevel < ClassFileConstants.JDK1_7
- ? "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " return this.<String>foobar(one, two);\n" +
- " ^^^^^^\n" +
- "Unused type arguments for the non generic method foobar(String, String) of type X; it should not be parameterized with arguments <String>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " return this.<String>foobar2(one, two);// silenced\n" +
- " ^^^^^^^\n" +
- "The method foobar2(String, String) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 16)\n" +
- " this.<String,String>foobar(one, two);\n" +
- " ^^^^^^\n" +
- "Incorrect number of type arguments for generic method <T>foobar(String, String) of type Y; it cannot be parameterized with arguments <String, String>\n" +
+ ? "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " return this.<String>foobar(one, two);\n" +
+ " ^^^^^^\n" +
+ "Unused type arguments for the non generic method foobar(String, String) of type X; it should not be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " return this.<String>foobar2(one, two);// silenced\n" +
+ " ^^^^^^^\n" +
+ "The method foobar2(String, String) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 16)\n" +
+ " this.<String,String>foobar(one, two);\n" +
+ " ^^^^^^\n" +
+ "Incorrect number of type arguments for generic method <T>foobar(String, String) of type Y; it cannot be parameterized with arguments <String, String>\n" +
"----------\n"
: "----------\n" +
"1. WARNING in X.java (at line 4)\n" +
@@ -42291,51 +42291,51 @@ public void test1203c() {
if (this.complianceLevel < ClassFileConstants.JDK1_7) {
runNegativeTest(
sources,
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " new X().<String> a(s);\n" +
- " ^\n" +
- "The method a(String) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " new X().<String> b(s, s);\n" +
- " ^\n" +
- "The method b(String, Object) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " new X().<String> c(s, s);\n" +
- " ^^^^^^\n" +
- "Unused type arguments for the non generic method c(String, String) of type X; it should not be parameterized with arguments <String>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 7)\n" +
- " new X().<String> d(s, s);\n" +
- " ^^^^^^\n" +
- "Unused type arguments for the non generic method d(String, Object) of type X; it should not be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " new X().<String> a(s);\n" +
+ " ^\n" +
+ "The method a(String) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " new X().<String> b(s, s);\n" +
+ " ^\n" +
+ "The method b(String, Object) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " new X().<String> c(s, s);\n" +
+ " ^^^^^^\n" +
+ "Unused type arguments for the non generic method c(String, String) of type X; it should not be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 7)\n" +
+ " new X().<String> d(s, s);\n" +
+ " ^^^^^^\n" +
+ "Unused type arguments for the non generic method d(String, Object) of type X; it should not be parameterized with arguments <String>\n" +
"----------\n");
} else {
runConformTest(
true,
sources,
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " new X().<String> a(s);\n" +
- " ^^^^^^\n" +
- "Unused type arguments for the non generic method a(String) of type X; it should not be parameterized with arguments <String>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " new X().<String> b(s, s);\n" +
- " ^^^^^^\n" +
- "Unused type arguments for the non generic method b(String, Object) of type X; it should not be parameterized with arguments <String>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " new X().<String> c(s, s);\n" +
- " ^^^^^^\n" +
- "Unused type arguments for the non generic method c(String, String) of type X; it should not be parameterized with arguments <String>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 7)\n" +
- " new X().<String> d(s, s);\n" +
- " ^^^^^^\n" +
- "Unused type arguments for the non generic method d(String, Object) of type X; it should not be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " new X().<String> a(s);\n" +
+ " ^^^^^^\n" +
+ "Unused type arguments for the non generic method a(String) of type X; it should not be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " new X().<String> b(s, s);\n" +
+ " ^^^^^^\n" +
+ "Unused type arguments for the non generic method b(String, Object) of type X; it should not be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " new X().<String> c(s, s);\n" +
+ " ^^^^^^\n" +
+ "Unused type arguments for the non generic method c(String, String) of type X; it should not be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 7)\n" +
+ " new X().<String> d(s, s);\n" +
+ " ^^^^^^\n" +
+ "Unused type arguments for the non generic method d(String, Object) of type X; it should not be parameterized with arguments <String>\n" +
"----------\n",
null, null,
JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
@@ -42373,50 +42373,50 @@ public void test1203d() {
runNegativeTest(
sources,
"----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " new X().<String> a(s);\n" +
- " ^\n" +
- "The method a(String) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " new X().<String> b(s, s);\n" +
- " ^\n" +
- "The method b(String, Object) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " new X().<String> c(s, s);\n" +
- " ^\n" +
- "The method c(String, String) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " new X().<String> d(s, s);\n" +
- " ^\n" +
- "The method d(String, Object) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " new X().<String> a(s);\n" +
+ " ^\n" +
+ "The method a(String) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " new X().<String> b(s, s);\n" +
+ " ^\n" +
+ "The method b(String, Object) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " new X().<String> c(s, s);\n" +
+ " ^\n" +
+ "The method c(String, String) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " new X().<String> d(s, s);\n" +
+ " ^\n" +
+ "The method d(String, Object) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
"----------\n");
} else {
runConformTest(
true,
sources,
"----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " new X().<String> a(s);\n" +
- " ^^^^^^\n" +
- "Unused type arguments for the non generic method a(String) of type X; it should not be parameterized with arguments <String>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " new X().<String> b(s, s);\n" +
- " ^^^^^^\n" +
- "Unused type arguments for the non generic method b(String, Object) of type X; it should not be parameterized with arguments <String>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " new X().<String> c(s, s);\n" +
- " ^^^^^^\n" +
- "Unused type arguments for the non generic method c(String, String) of type X; it should not be parameterized with arguments <String>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 7)\n" +
- " new X().<String> d(s, s);\n" +
- " ^^^^^^\n" +
- "Unused type arguments for the non generic method d(String, Object) of type X; it should not be parameterized with arguments <String>\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " new X().<String> a(s);\n" +
+ " ^^^^^^\n" +
+ "Unused type arguments for the non generic method a(String) of type X; it should not be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " new X().<String> b(s, s);\n" +
+ " ^^^^^^\n" +
+ "Unused type arguments for the non generic method b(String, Object) of type X; it should not be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " new X().<String> c(s, s);\n" +
+ " ^^^^^^\n" +
+ "Unused type arguments for the non generic method c(String, String) of type X; it should not be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 7)\n" +
+ " new X().<String> d(s, s);\n" +
+ " ^^^^^^\n" +
+ "Unused type arguments for the non generic method d(String, Object) of type X; it should not be parameterized with arguments <String>\n" +
"----------\n",
null, null,
JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
@@ -42514,11 +42514,11 @@ public void test1207() {
" ^^^^^^\n" +
"Bound mismatch: The generic method throwE(E) of type X is not applicable for the arguments (Object[]). The inferred type Object[] is not a valid substitute for the bounded parameter <E extends Exception>\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " throwE(objs);\n" +
- " ^^^^^^\n" +
- "The method throwE(E) in the type X is not applicable for the arguments (Object[])\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " throwE(objs);\n" +
+ " ^^^^^^\n" +
+ "The method throwE(E) in the type X is not applicable for the arguments (Object[])\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=207573 - variation
@@ -42553,18 +42553,18 @@ public void test1209() {
" }\n" +
"}", // =================
},
- this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ this.complianceLevel < ClassFileConstants.JDK1_8 ?
"----------\n" +
"1. ERROR in X.java (at line 6)\n" +
" throwE(objs);\n" +
" ^^^^^^\n" +
"Bound mismatch: The generic method throwE(E, Object...) of type X is not applicable for the arguments (Object[]). The inferred type Object[] is not a valid substitute for the bounded parameter <E extends Exception>\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " throwE(objs);\n" +
- " ^^^^^^\n" +
- "The method throwE(E, Object...) in the type X is not applicable for the arguments (Object[])\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " throwE(objs);\n" +
+ " ^^^^^^\n" +
+ "The method throwE(E, Object...) in the type X is not applicable for the arguments (Object[])\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=207573 - variation
@@ -42583,23 +42583,23 @@ public void test1210() {
"}\n", // =================
},
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " Object[] o = throwE(objs);\n" +
- " ^^^^^^\n" +
- "Bound mismatch: The generic method throwE(Object...) of type X is not applicable for the arguments (Object[]). The inferred type Object[]&Exception is not a valid substitute for the bounded parameter <E extends Exception>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " Object[] o = throwE(objs);\n" +
- " ^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Object[]&Exception to Object[]\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " Object[] o = throwE(objs);\n" +
+ " ^^^^^^\n" +
+ "Bound mismatch: The generic method throwE(Object...) of type X is not applicable for the arguments (Object[]). The inferred type Object[]&Exception is not a valid substitute for the bounded parameter <E extends Exception>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " Object[] o = throwE(objs);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Object[]&Exception to Object[]\n" +
"----------\n"
:
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " Object[] o = throwE(objs);\n" +
- " ^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from RuntimeException to Object[]\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " Object[] o = throwE(objs);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from RuntimeException to Object[]\n" +
"----------\n"));
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=208030
@@ -43859,11 +43859,11 @@ public void test1244() {
" protected abstract E delegate();\n" +
"}\n", // =================
},
- "----------\n" +
- "1. ERROR in X.java (at line 14)\n" +
- " abstract class Pool<E extends Pool.Entry<E>> {\n" +
- " ^^^^^^^^^^\n" +
- "The type Pool.Entry is not visible\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 14)\n" +
+ " abstract class Pool<E extends Pool.Entry<E>> {\n" +
+ " ^^^^^^^^^^\n" +
+ "The type Pool.Entry is not visible\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=216100 - variation
@@ -43894,11 +43894,11 @@ public void test1246() {
" <U extends X.Private> void foo(U u) {}\n" +
"}\n", // =================
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<T extends X.Private> {\n" +
- " ^^^^^^^^^\n" +
- "The type X.Private is not visible\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X<T extends X.Private> {\n" +
+ " ^^^^^^^^^\n" +
+ "The type X.Private is not visible\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=216558
@@ -44566,7 +44566,7 @@ public void test1271() {
" }\n" +
"}\n", // =================
},
- this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ this.complianceLevel < ClassFileConstants.JDK1_8 ?
"----------\n" +
"1. ERROR in X.java (at line 24)\n" +
" put(Integer.class, combine(FUNC2, FUNC1));\n" +
@@ -44574,16 +44574,16 @@ public void test1271() {
"The method put(Class<E>, X.TO<? super E>) in the type X is not applicable for the arguments (Class<Integer>, X.OO<String,Object>)\n" +
"----------\n"
: // ATM, in 1.8+ we generate an extra error due to inner poly expression resolution after the target type is known.
- "----------\n" +
- "1. ERROR in X.java (at line 24)\n" +
- " put(Integer.class, combine(FUNC2, FUNC1));\n" +
- " ^^^\n" +
- "The method put(Class<E>, X.TO<? super E>) in the type X is not applicable for the arguments (Class<Integer>, X.OO<String,Object>)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 24)\n" +
- " put(Integer.class, combine(FUNC2, FUNC1));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from X.OO<String,Object> to X.TO<? super E>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 24)\n" +
+ " put(Integer.class, combine(FUNC2, FUNC1));\n" +
+ " ^^^\n" +
+ "The method put(Class<E>, X.TO<? super E>) in the type X is not applicable for the arguments (Class<Integer>, X.OO<String,Object>)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 24)\n" +
+ " put(Integer.class, combine(FUNC2, FUNC1));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from X.OO<String,Object> to X.TO<? super E>\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=216686 - variation
@@ -44670,11 +44670,11 @@ public void test1273() {
"X.java",
sourceX
},
- "----------\n" +
- "1. ERROR in X.java (at line 28)\n" +
- " put(Integer.class, combine(FUNC2, FUNC1));\n" +
- " ^^^^^^^\n" +
- "The method combine(X.TT, X.TO<? super Object>) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 28)\n" +
+ " put(Integer.class, combine(FUNC2, FUNC1));\n" +
+ " ^^^^^^^\n" +
+ "The method combine(X.TT, X.TO<? super Object>) is ambiguous for the type X\n" +
"----------\n" );
}
}
@@ -44718,7 +44718,7 @@ public void test1274() {
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=216686 - variation
public void test1275() {
- String[] input =
+ String[] input =
new String[] {
"X.java",
"public class X {\n" +
@@ -44759,11 +44759,11 @@ public void test1275() {
} else {
runNegativeTest(
input,
- "----------\n" +
- "1. ERROR in X.java (at line 28)\n" +
- " put(Integer.class, combine(FUNC2, FUNC1));\n" +
- " ^^^^^^^\n" +
- "The method combine(X.TT, X.TO<? super Object>) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 28)\n" +
+ " put(Integer.class, combine(FUNC2, FUNC1));\n" +
+ " ^^^^^^^\n" +
+ "The method combine(X.TT, X.TO<? super Object>) is ambiguous for the type X\n" +
"----------\n");
}
}
@@ -44890,11 +44890,11 @@ public void test1278() {
} else {
runNegativeTest(
input,
- "----------\n" +
- "1. ERROR in X.java (at line 32)\n" +
- " put(Integer.class, combine(FUNC2, FUNC1));\n" +
- " ^^^^^^^\n" +
- "The method combine(X.TT, X.TO<? super Object>) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 32)\n" +
+ " put(Integer.class, combine(FUNC2, FUNC1));\n" +
+ " ^^^^^^^\n" +
+ "The method combine(X.TT, X.TO<? super Object>) is ambiguous for the type X\n" +
"----------\n");
}
}
@@ -45412,16 +45412,16 @@ public void test1292() {
" ^^^^^^^^^^^^\n" +
"Bound mismatch: The generic method moreSpecific(List<D>) of type X is not applicable for the arguments (List<X.B>). The inferred type X.A is not a valid substitute for the bounded parameter <E extends D>\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " result.addAll( (List<?>)list );\n" +
- " ^^^^^^\n" +
- "The method addAll(Collection<? extends E>) in the type List<E> is not applicable for the arguments (List<capture#1-of ?>)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " List<A> a = moreSpecific(b);\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from List<X.B> to List<X.A>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " result.addAll( (List<?>)list );\n" +
+ " ^^^^^^\n" +
+ "The method addAll(Collection<? extends E>) in the type List<E> is not applicable for the arguments (List<capture#1-of ?>)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " List<A> a = moreSpecific(b);\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from List<X.B> to List<X.A>\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=220111
@@ -46074,91 +46074,91 @@ public void test1314() {
" } \n" +
"}\n", // =================
},
- "----------\n" +
- "1. WARNING in X.java (at line 11)\n" +
- " if (false) return new Y(b);//1\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 11)\n" +
- " if (false) return new Y(b);//1\n" +
- " ^^^^^^^^\n" +
- "Type safety: The constructor Y(Object) belongs to the raw type Y. References to generic type Y<K> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 11)\n" +
- " if (false) return new Y(b);//1\n" +
- " ^\n" +
- "Y is a raw type. References to generic type Y<K> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 12)\n" +
- " if (false) return new Y((K) b);//2\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 12)\n" +
- " if (false) return new Y((K) b);//2\n" +
- " ^^^^^^^^^^^^\n" +
- "Type safety: The constructor Y(Object) belongs to the raw type Y. References to generic type Y<K> should be parameterized\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 12)\n" +
- " if (false) return new Y((K) b);//2\n" +
- " ^\n" +
- "Y is a raw type. References to generic type Y<K> should be parameterized\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 12)\n" +
- " if (false) return new Y((K) b);//2\n" +
- " ^^^^^\n" +
- "Type safety: Unchecked cast from B to K\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 12)\n" +
- " if (false) return new Y((K) b);//2\n" +
- " ^^^^^\n" +
- "Unnecessary cast from B to K\n" +
- "----------\n" +
- "9. WARNING in X.java (at line 13)\n" +
- " return new Y((K) (Object) b);//3\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The constructor Y(Object) belongs to the raw type Y. References to generic type Y<K> should be parameterized\n" +
- "----------\n" +
- "10. WARNING in X.java (at line 13)\n" +
- " return new Y((K) (Object) b);//3\n" +
- " ^\n" +
- "Y is a raw type. References to generic type Y<K> should be parameterized\n" +
- "----------\n" +
- "11. WARNING in X.java (at line 13)\n" +
- " return new Y((K) (Object) b);//3\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to K\n" +
- "----------\n" +
- "12. WARNING in X.java (at line 13)\n" +
- " return new Y((K) (Object) b);//3\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from Object to K\n" +
- "----------\n" +
- "13. WARNING in X.java (at line 13)\n" +
- " return new Y((K) (Object) b);//3\n" +
- " ^^^^^^^^^^\n" +
- "Unnecessary cast from B to Object\n" +
- "----------\n" +
- "14. ERROR in X.java (at line 16)\n" +
- " if (false) return new Y<K>(b);//4\n" +
- " ^^^^^^^^^^^\n" +
- "The constructor Y<K>(B) is undefined\n" +
- "----------\n" +
- "15. WARNING in X.java (at line 17)\n" +
- " if (false) return new Y<K>((K) b);//5\n" +
- " ^^^^^\n" +
- "Type safety: Unchecked cast from B to K\n" +
- "----------\n" +
- "16. WARNING in X.java (at line 18)\n" +
- " return new Y<K>((K) (Object) b);//6\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to K\n" +
- "----------\n" +
- "17. WARNING in X.java (at line 18)\n" +
- " return new Y<K>((K) (Object) b);//6\n" +
- " ^^^^^^^^^^\n" +
- "Unnecessary cast from B to Object\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 11)\n" +
+ " if (false) return new Y(b);//1\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 11)\n" +
+ " if (false) return new Y(b);//1\n" +
+ " ^^^^^^^^\n" +
+ "Type safety: The constructor Y(Object) belongs to the raw type Y. References to generic type Y<K> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 11)\n" +
+ " if (false) return new Y(b);//1\n" +
+ " ^\n" +
+ "Y is a raw type. References to generic type Y<K> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 12)\n" +
+ " if (false) return new Y((K) b);//2\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 12)\n" +
+ " if (false) return new Y((K) b);//2\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Type safety: The constructor Y(Object) belongs to the raw type Y. References to generic type Y<K> should be parameterized\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 12)\n" +
+ " if (false) return new Y((K) b);//2\n" +
+ " ^\n" +
+ "Y is a raw type. References to generic type Y<K> should be parameterized\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 12)\n" +
+ " if (false) return new Y((K) b);//2\n" +
+ " ^^^^^\n" +
+ "Type safety: Unchecked cast from B to K\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 12)\n" +
+ " if (false) return new Y((K) b);//2\n" +
+ " ^^^^^\n" +
+ "Unnecessary cast from B to K\n" +
+ "----------\n" +
+ "9. WARNING in X.java (at line 13)\n" +
+ " return new Y((K) (Object) b);//3\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The constructor Y(Object) belongs to the raw type Y. References to generic type Y<K> should be parameterized\n" +
+ "----------\n" +
+ "10. WARNING in X.java (at line 13)\n" +
+ " return new Y((K) (Object) b);//3\n" +
+ " ^\n" +
+ "Y is a raw type. References to generic type Y<K> should be parameterized\n" +
+ "----------\n" +
+ "11. WARNING in X.java (at line 13)\n" +
+ " return new Y((K) (Object) b);//3\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to K\n" +
+ "----------\n" +
+ "12. WARNING in X.java (at line 13)\n" +
+ " return new Y((K) (Object) b);//3\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Unnecessary cast from Object to K\n" +
+ "----------\n" +
+ "13. WARNING in X.java (at line 13)\n" +
+ " return new Y((K) (Object) b);//3\n" +
+ " ^^^^^^^^^^\n" +
+ "Unnecessary cast from B to Object\n" +
+ "----------\n" +
+ "14. ERROR in X.java (at line 16)\n" +
+ " if (false) return new Y<K>(b);//4\n" +
+ " ^^^^^^^^^^^\n" +
+ "The constructor Y<K>(B) is undefined\n" +
+ "----------\n" +
+ "15. WARNING in X.java (at line 17)\n" +
+ " if (false) return new Y<K>((K) b);//5\n" +
+ " ^^^^^\n" +
+ "Type safety: Unchecked cast from B to K\n" +
+ "----------\n" +
+ "16. WARNING in X.java (at line 18)\n" +
+ " return new Y<K>((K) (Object) b);//6\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to K\n" +
+ "----------\n" +
+ "17. WARNING in X.java (at line 18)\n" +
+ " return new Y<K>((K) (Object) b);//6\n" +
+ " ^^^^^^^^^^\n" +
+ "Unnecessary cast from B to Object\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=228291
@@ -46254,31 +46254,31 @@ public void test1317() {
" }\n" +
"}\n", // =================
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " <T extends N<T>> T foo3(String name, T value) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "This method must return a result of type T\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 15)\n" +
- " new X().foo(\"HI\", null); // correctly report error\n" +
- " ^^^\n" +
- "The method foo(String, String) is ambiguous for the type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 16)\n" +
- " new X().foo2(\"HI\", null); // miss ambiguous error\n" +
- " ^^^^\n" +
- "The method foo2(String, String) is ambiguous for the type X\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 18)\n" +
- " Thread t1 = foo3(\"HI\", null);\n" +
- " ^^^^\n" +
- "The method foo3(String, null) is undefined for the type Test\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 19)\n" +
- " Thread t2 = (Thread)foo3(\"HI\", null);\n" +
- " ^^^^\n" +
- "The method foo3(String, null) is undefined for the type Test\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " <T extends N<T>> T foo3(String name, T value) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "This method must return a result of type T\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 15)\n" +
+ " new X().foo(\"HI\", null); // correctly report error\n" +
+ " ^^^\n" +
+ "The method foo(String, String) is ambiguous for the type X\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 16)\n" +
+ " new X().foo2(\"HI\", null); // miss ambiguous error\n" +
+ " ^^^^\n" +
+ "The method foo2(String, String) is ambiguous for the type X\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 18)\n" +
+ " Thread t1 = foo3(\"HI\", null);\n" +
+ " ^^^^\n" +
+ "The method foo3(String, null) is undefined for the type Test\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 19)\n" +
+ " Thread t2 = (Thread)foo3(\"HI\", null);\n" +
+ " ^^^^\n" +
+ "The method foo3(String, null) is undefined for the type Test\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=229928 - variation
@@ -46395,57 +46395,57 @@ public void test1322() {
"class Thingy<T extends Bob> {}\n", // =================
},
this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " x.doStuff(Bob.class, new Thingy());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation doStuff(Class<Bob>, Thingy) of the generic method doStuff(Class<T>, Thingy<T>) of type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " x.doStuff(Bob.class, new Thingy());\n" +
- " ^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Thingy needs unchecked conversion to conform to Thingy<Bob>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " x.doStuff(Bob.class, new Thingy());\n" +
- " ^^^^^^\n" +
- "Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 15)\n" +
- " x.doStuff(Jim.class, new Thingy());\n" +
- " ^^^^^^^\n" +
- "Bound mismatch: The generic method doStuff(Class<T>, Thingy<T>) of type X is not applicable for the arguments (Class<Jim>, Thingy). The inferred type Jim is not a valid substitute for the bounded parameter <T extends Bob>\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 15)\n" +
- " x.doStuff(Jim.class, new Thingy());\n" +
- " ^^^^^^\n" +
- "Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " x.doStuff(Bob.class, new Thingy());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation doStuff(Class<Bob>, Thingy) of the generic method doStuff(Class<T>, Thingy<T>) of type X\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " x.doStuff(Bob.class, new Thingy());\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Thingy needs unchecked conversion to conform to Thingy<Bob>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " x.doStuff(Bob.class, new Thingy());\n" +
+ " ^^^^^^\n" +
+ "Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 15)\n" +
+ " x.doStuff(Jim.class, new Thingy());\n" +
+ " ^^^^^^^\n" +
+ "Bound mismatch: The generic method doStuff(Class<T>, Thingy<T>) of type X is not applicable for the arguments (Class<Jim>, Thingy). The inferred type Jim is not a valid substitute for the bounded parameter <T extends Bob>\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 15)\n" +
+ " x.doStuff(Jim.class, new Thingy());\n" +
+ " ^^^^^^\n" +
+ "Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" +
"----------\n" :
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " x.doStuff(Bob.class, new Thingy());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation doStuff(Class<Bob>, Thingy) of the generic method doStuff(Class<T>, Thingy<T>) of type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " x.doStuff(Bob.class, new Thingy());\n" +
- " ^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Thingy needs unchecked conversion to conform to Thingy<Bob>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " x.doStuff(Bob.class, new Thingy());\n" +
- " ^^^^^^\n" +
- "Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 15)\n" +
- " x.doStuff(Jim.class, new Thingy());\n" +
- " ^^^^^^^\n" +
- "The method doStuff(Class<T>, Thingy<T>) in the type X is not applicable for the arguments (Class<Jim>, Thingy)\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 15)\n" +
- " x.doStuff(Jim.class, new Thingy());\n" +
- " ^^^^^^\n" +
- "Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " x.doStuff(Bob.class, new Thingy());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation doStuff(Class<Bob>, Thingy) of the generic method doStuff(Class<T>, Thingy<T>) of type X\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " x.doStuff(Bob.class, new Thingy());\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Thingy needs unchecked conversion to conform to Thingy<Bob>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " x.doStuff(Bob.class, new Thingy());\n" +
+ " ^^^^^^\n" +
+ "Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 15)\n" +
+ " x.doStuff(Jim.class, new Thingy());\n" +
+ " ^^^^^^^\n" +
+ "The method doStuff(Class<T>, Thingy<T>) in the type X is not applicable for the arguments (Class<Jim>, Thingy)\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 15)\n" +
+ " x.doStuff(Jim.class, new Thingy());\n" +
+ " ^^^^^^\n" +
+ "Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094 - variation
@@ -46469,36 +46469,36 @@ public void test1323() {
"class Bob2 extends Bob {}\n" +
"class Thingy<T extends Bob> {}\n", // =================
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " x.doStuff2(Jim.class, new Thingy());\n" +
- " ^^^^^^^^\n" +
- "Bound mismatch: The generic method doStuff2(Class<T>, Thingy<U>) of type X is not applicable for the arguments (Class<Jim>, Thingy). The inferred type Jim is not a valid substitute for the bounded parameter <T extends Bob>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " x.doStuff2(Jim.class, new Thingy());\n" +
- " ^^^^^^\n" +
- "Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 5)\n" +
- " String s = x.doStuff2(Bob2.class, new Thingy());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation doStuff2(Class<Bob2>, Thingy) of the generic method doStuff2(Class<T>, Thingy<U>) of type X\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " String s = x.doStuff2(Bob2.class, new Thingy());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Bob2 to String\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 5)\n" +
- " String s = x.doStuff2(Bob2.class, new Thingy());\n" +
- " ^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Thingy needs unchecked conversion to conform to Thingy<Bob>\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 5)\n" +
- " String s = x.doStuff2(Bob2.class, new Thingy());\n" +
- " ^^^^^^\n" +
- "Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " x.doStuff2(Jim.class, new Thingy());\n" +
+ " ^^^^^^^^\n" +
+ "Bound mismatch: The generic method doStuff2(Class<T>, Thingy<U>) of type X is not applicable for the arguments (Class<Jim>, Thingy). The inferred type Jim is not a valid substitute for the bounded parameter <T extends Bob>\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " x.doStuff2(Jim.class, new Thingy());\n" +
+ " ^^^^^^\n" +
+ "Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 5)\n" +
+ " String s = x.doStuff2(Bob2.class, new Thingy());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation doStuff2(Class<Bob2>, Thingy) of the generic method doStuff2(Class<T>, Thingy<U>) of type X\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " String s = x.doStuff2(Bob2.class, new Thingy());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Bob2 to String\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 5)\n" +
+ " String s = x.doStuff2(Bob2.class, new Thingy());\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Thingy needs unchecked conversion to conform to Thingy<Bob>\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 5)\n" +
+ " String s = x.doStuff2(Bob2.class, new Thingy());\n" +
+ " ^^^^^^\n" +
+ "Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094 - variation
@@ -46521,26 +46521,26 @@ public void test1324() {
"class Bob {}\n" +
"class Thingy<T extends Bob> {}\n", // =================
},
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " x.doStuff(Bob.class, new Thingy());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation doStuff(Class<Bob>, Thingy) of the generic method doStuff(Class<T>, Thingy<T>) of type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " x.doStuff(Bob.class, new Thingy());\n" +
- " ^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Thingy needs unchecked conversion to conform to Thingy<Bob>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " x.doStuff(Bob.class, new Thingy());\n" +
- " ^^^^^^\n" +
- "Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " x.doStuff(Bob.class, new Thingy());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation doStuff(Class<Bob>, Thingy) of the generic method doStuff(Class<T>, Thingy<T>) of type X\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " x.doStuff(Bob.class, new Thingy());\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Thingy needs unchecked conversion to conform to Thingy<Bob>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " x.doStuff(Bob.class, new Thingy());\n" +
+ " ^^^^^^\n" +
+ "Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094 - variation
@@ -46559,38 +46559,38 @@ public void test1325() {
},
(this.complianceLevel < ClassFileConstants.JDK1_8
?
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " void bar(X x) {\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " X<String> xs2 = foo(x);\n" +
- " ^^^^^^\n" +
- "Type safety: Unchecked invocation foo(X) of the generic method foo(X<T>) of type X<E>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " X<String> xs2 = foo(x);\n" +
- " ^^^^^^\n" +
- "Type safety: The expression of type X needs unchecked conversion to conform to X<String>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 6)\n" +
- " X<String> xs2 = foo(x);\n" +
- " ^\n" +
- "Type safety: The expression of type X needs unchecked conversion to conform to X<Object>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " void bar(X x) {\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " X<String> xs2 = foo(x);\n" +
+ " ^^^^^^\n" +
+ "Type safety: Unchecked invocation foo(X) of the generic method foo(X<T>) of type X<E>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " X<String> xs2 = foo(x);\n" +
+ " ^^^^^^\n" +
+ "Type safety: The expression of type X needs unchecked conversion to conform to X<String>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 6)\n" +
+ " X<String> xs2 = foo(x);\n" +
+ " ^\n" +
+ "Type safety: The expression of type X needs unchecked conversion to conform to X<Object>\n" +
"----------\n"
: // 1.8 is stricter:
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " void bar(X x) {\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<E> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " X<String> xs2 = foo(x);\n" +
- " ^^^^^^\n" +
- "Type mismatch: cannot convert from Object to X<String>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " void bar(X x) {\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<E> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " X<String> xs2 = foo(x);\n" +
+ " ^^^^^^\n" +
+ "Type mismatch: cannot convert from Object to X<String>\n" +
"----------\n"));
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094 - variation
@@ -46622,16 +46622,16 @@ public void test1326() {
" ^^^\n" +
"Bound mismatch: The generic method foo(X<T>, X<U>) of type X<E> is not applicable for the arguments (X<String>, X). The inferred type String is not a valid substitute for the bounded parameter <T extends Thread>\n" +
"----------\n" :
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " void bar(X x, X<String> xs) {\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<E> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " X<String> xs2 = foo(xs, x).identity();\n" +
- " ^^^\n" +
- "The method foo(X<T>, X<U>) in the type X<E> is not applicable for the arguments (X<String>, X)\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " void bar(X x, X<String> xs) {\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<E> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " X<String> xs2 = foo(xs, x).identity();\n" +
+ " ^^^\n" +
+ "The method foo(X<T>, X<U>) in the type X<E> is not applicable for the arguments (X<String>, X)\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094 - variation
@@ -46971,11 +46971,11 @@ public void test1336() {
" }\n" +
"}\n", // =================
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " Other<String>.Member m = (Other<String>.Member) om2;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Other2<?>.Member2<capture#1-of ?> to Other<String>.Member\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " Other<String>.Member m = (Other<String>.Member) om2;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Other2<?>.Member2<capture#1-of ?> to Other<String>.Member\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=233800 - variation
@@ -46996,11 +46996,11 @@ public void test1337() {
" }\n" +
"}\n", // =================
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " Other<String>.Member m = (Other<String>.Member) om2;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Other2.Member2<capture#1-of ?> to Other<String>.Member\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " Other<String>.Member m = (Other<String>.Member) om2;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Other2.Member2<capture#1-of ?> to Other<String>.Member\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=234619
@@ -47214,41 +47214,41 @@ public void test1344() throws Exception {
" }\n" +
"}\n", // =================
},
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " public class X<T> extends Adapter {\n" +
- " ^^^^^^^\n" +
- "Adapter is a raw type. References to generic type Adapter<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " public <V> X.Setter makeSetter() {\n" +
- " ^^^^^^^^\n" +
- "Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " public <V> X.Setter makeSetter() {\n" +
- " ^^^^^^^^^^^^\n" +
- "Name clash: The method makeSetter() of type X<T> has the same erasure as makeSetter() of type Adapter but does not override it\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 9)\n" +
- " return new X().new Setter() {};\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 9)\n" +
- " return new X().new Setter() {};\n" +
- " ^^^^^^\n" +
- "Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 12)\n" +
- " List<Adapter.Setter> l = new ArrayList<X.Setter>();\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 12)\n" +
- " List<Adapter.Setter> l = new ArrayList<X.Setter>();\n" +
- " ^^^^^^^^\n" +
- "Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 7)\n" +
+ " public class X<T> extends Adapter {\n" +
+ " ^^^^^^^\n" +
+ "Adapter is a raw type. References to generic type Adapter<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " public <V> X.Setter makeSetter() {\n" +
+ " ^^^^^^^^\n" +
+ "Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " public <V> X.Setter makeSetter() {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Name clash: The method makeSetter() of type X<T> has the same erasure as makeSetter() of type Adapter but does not override it\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 9)\n" +
+ " return new X().new Setter() {};\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 9)\n" +
+ " return new X().new Setter() {};\n" +
+ " ^^^^^^\n" +
+ "Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 12)\n" +
+ " List<Adapter.Setter> l = new ArrayList<X.Setter>();\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 12)\n" +
+ " List<Adapter.Setter> l = new ArrayList<X.Setter>();\n" +
+ " ^^^^^^^^\n" +
+ "Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
"----------\n"
);
}
@@ -47272,51 +47272,51 @@ public void test1345() throws Exception {
" }\n" +
"}\n", // =================
},
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " public class X<T> extends Adapter {\n" +
- " ^^^^^^^\n" +
- "Adapter is a raw type. References to generic type Adapter<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " public <V> X.Setter makeSetter() {\n" +
- " ^^^^^^^^\n" +
- "Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " public <V> X.Setter makeSetter() {\n" +
- " ^^^^^^^^^^^^\n" +
- "Name clash: The method makeSetter() of type X<T> has the same erasure as makeSetter() of type Adapter but does not override it\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " return (String) new X().new Setter() {};\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot cast from new Adapter.Setter(){} to String\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 9)\n" +
- " return (String) new X().new Setter() {};\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from String to Adapter.Setter\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 9)\n" +
- " return (String) new X().new Setter() {};\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 9)\n" +
- " return (String) new X().new Setter() {};\n" +
- " ^^^^^^\n" +
- "Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 12)\n" +
- " List<Adapter.Setter> l = new ArrayList<X.Setter>();\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
- "----------\n" +
- "9. WARNING in X.java (at line 12)\n" +
- " List<Adapter.Setter> l = new ArrayList<X.Setter>();\n" +
- " ^^^^^^^^\n" +
- "Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 7)\n" +
+ " public class X<T> extends Adapter {\n" +
+ " ^^^^^^^\n" +
+ "Adapter is a raw type. References to generic type Adapter<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " public <V> X.Setter makeSetter() {\n" +
+ " ^^^^^^^^\n" +
+ "Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " public <V> X.Setter makeSetter() {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Name clash: The method makeSetter() of type X<T> has the same erasure as makeSetter() of type Adapter but does not override it\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 9)\n" +
+ " return (String) new X().new Setter() {};\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot cast from new Adapter.Setter(){} to String\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 9)\n" +
+ " return (String) new X().new Setter() {};\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from String to Adapter.Setter\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 9)\n" +
+ " return (String) new X().new Setter() {};\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 9)\n" +
+ " return (String) new X().new Setter() {};\n" +
+ " ^^^^^^\n" +
+ "Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 12)\n" +
+ " List<Adapter.Setter> l = new ArrayList<X.Setter>();\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
+ "----------\n" +
+ "9. WARNING in X.java (at line 12)\n" +
+ " List<Adapter.Setter> l = new ArrayList<X.Setter>();\n" +
+ " ^^^^^^^^\n" +
+ "Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
"----------\n"
);
}
@@ -47448,41 +47448,41 @@ public void test1349() {
"class Y<S> {}\n" +
"class Z { Zork z; }\n", // =================
},
- "----------\n" +
- "1. WARNING in Scratch.java (at line 2)\n" +
- " private Y rawObject = new Y();\n" +
- " ^\n" +
- "Y is a raw type. References to generic type Y<S> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in Scratch.java (at line 2)\n" +
- " private Y rawObject = new Y();\n" +
- " ^\n" +
- "Y is a raw type. References to generic type Y<S> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in Scratch.java (at line 4)\n" +
- " method(new X<Y<Z>>(), rawObject); // compile error in javac, unchecked conversion in Eclipse\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation method(X<Y<Z>>, Y) of the generic method method(X<T>, T) of type Scratch\n" +
- "----------\n" +
- "4. WARNING in Scratch.java (at line 4)\n" +
- " method(new X<Y<Z>>(), rawObject); // compile error in javac, unchecked conversion in Eclipse\n" +
- " ^^^^^^^^^\n" +
- "Type safety: The expression of type Y needs unchecked conversion to conform to Y<Z>\n" +
- "----------\n" +
- "5. WARNING in Scratch.java (at line 5)\n" +
- " this.<Y<Z>>method(new X<Y<Z>>(), rawObject); // unchecked warning in both\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation method(X<Y<Z>>, Y) of the generic method method(X<T>, T) of type Scratch\n" +
- "----------\n" +
- "6. WARNING in Scratch.java (at line 5)\n" +
- " this.<Y<Z>>method(new X<Y<Z>>(), rawObject); // unchecked warning in both\n" +
- " ^^^^^^^^^\n" +
- "Type safety: The expression of type Y needs unchecked conversion to conform to Y<Z>\n" +
- "----------\n" +
- "7. ERROR in Scratch.java (at line 11)\n" +
- " class Z { Zork z; }\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in Scratch.java (at line 2)\n" +
+ " private Y rawObject = new Y();\n" +
+ " ^\n" +
+ "Y is a raw type. References to generic type Y<S> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in Scratch.java (at line 2)\n" +
+ " private Y rawObject = new Y();\n" +
+ " ^\n" +
+ "Y is a raw type. References to generic type Y<S> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in Scratch.java (at line 4)\n" +
+ " method(new X<Y<Z>>(), rawObject); // compile error in javac, unchecked conversion in Eclipse\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation method(X<Y<Z>>, Y) of the generic method method(X<T>, T) of type Scratch\n" +
+ "----------\n" +
+ "4. WARNING in Scratch.java (at line 4)\n" +
+ " method(new X<Y<Z>>(), rawObject); // compile error in javac, unchecked conversion in Eclipse\n" +
+ " ^^^^^^^^^\n" +
+ "Type safety: The expression of type Y needs unchecked conversion to conform to Y<Z>\n" +
+ "----------\n" +
+ "5. WARNING in Scratch.java (at line 5)\n" +
+ " this.<Y<Z>>method(new X<Y<Z>>(), rawObject); // unchecked warning in both\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation method(X<Y<Z>>, Y) of the generic method method(X<T>, T) of type Scratch\n" +
+ "----------\n" +
+ "6. WARNING in Scratch.java (at line 5)\n" +
+ " this.<Y<Z>>method(new X<Y<Z>>(), rawObject); // unchecked warning in both\n" +
+ " ^^^^^^^^^\n" +
+ "Type safety: The expression of type Y needs unchecked conversion to conform to Y<Z>\n" +
+ "----------\n" +
+ "7. ERROR in Scratch.java (at line 11)\n" +
+ " class Z { Zork z; }\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=238484
@@ -47490,41 +47490,41 @@ public void test1350() {
this.runConformTest(
new String[] {
"X.java", // =================
- "import java.io.IOException;\n" +
- "\n" +
- "interface TreeVisitor<T, U> {\n" +
- " public T visit(U location);\n" +
- "}\n" +
- "\n" +
- "interface TreeVisitable<U> {\n" +
- " public <T> T visit(TreeVisitor<T, U> visitor) throws IOException;\n" +
- "}\n" +
- "\n" +
- "abstract class Param implements TreeVisitable<Param> {\n" +
- " public final Param lookforParam(final String name) {\n" +
- " TreeVisitor<Param, Param> visitor = new TreeVisitor<Param, Param>() {\n" +
- " public Param visit(Param location) {\n" +
- " return null;\n" +
- " }\n" +
- " };\n" +
- " return visit(visitor);\n" +
- " }\n" +
- "\n" +
- " public abstract <T> T visit(TreeVisitor<T, Param> visitor);\n" +
- "}\n" +
- "\n" +
- "class StructParam extends Param {\n" +
- " public <T> T visit(TreeVisitor<T, Param> visitor) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " StructParam p = new StructParam();\n" +
- " p.lookforParam(\"abc\");\n" +
- " System.out.println(\"done\");\n" +
- " }\n" +
+ "import java.io.IOException;\n" +
+ "\n" +
+ "interface TreeVisitor<T, U> {\n" +
+ " public T visit(U location);\n" +
+ "}\n" +
+ "\n" +
+ "interface TreeVisitable<U> {\n" +
+ " public <T> T visit(TreeVisitor<T, U> visitor) throws IOException;\n" +
+ "}\n" +
+ "\n" +
+ "abstract class Param implements TreeVisitable<Param> {\n" +
+ " public final Param lookforParam(final String name) {\n" +
+ " TreeVisitor<Param, Param> visitor = new TreeVisitor<Param, Param>() {\n" +
+ " public Param visit(Param location) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " };\n" +
+ " return visit(visitor);\n" +
+ " }\n" +
+ "\n" +
+ " public abstract <T> T visit(TreeVisitor<T, Param> visitor);\n" +
+ "}\n" +
+ "\n" +
+ "class StructParam extends Param {\n" +
+ " public <T> T visit(TreeVisitor<T, Param> visitor) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " StructParam p = new StructParam();\n" +
+ " p.lookforParam(\"abc\");\n" +
+ " System.out.println(\"done\");\n" +
+ " }\n" +
"}\n", // =================
},
"done");
@@ -47534,32 +47534,32 @@ public void test1351() {
this.runConformTest(
new String[] {
"X.java", // =================
- "import java.io.IOException;\n" +
- "\n" +
- "interface IFoo {\n" +
- " <T> T foo(T t) throws IOException;\n" +
- "}\n" +
- "interface JFoo {\n" +
- " <T> T foo(T t) throws Exception;\n" +
- "}\n" +
- "abstract class Foo implements IFoo, JFoo {}\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Foo f = createFoo();\n" +
- " try {\n" +
- " f.foo(null);\n" +
- " } catch(IOException e) {\n" +
- " }\n" +
- " System.out.println(\"done\");\n" +
- " }\n" +
- " static Foo createFoo() {\n" +
- " return new Foo() {\n" +
- " public <T> T foo(T t) {\n" +
- " return t;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
+ "import java.io.IOException;\n" +
+ "\n" +
+ "interface IFoo {\n" +
+ " <T> T foo(T t) throws IOException;\n" +
+ "}\n" +
+ "interface JFoo {\n" +
+ " <T> T foo(T t) throws Exception;\n" +
+ "}\n" +
+ "abstract class Foo implements IFoo, JFoo {}\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Foo f = createFoo();\n" +
+ " try {\n" +
+ " f.foo(null);\n" +
+ " } catch(IOException e) {\n" +
+ " }\n" +
+ " System.out.println(\"done\");\n" +
+ " }\n" +
+ " static Foo createFoo() {\n" +
+ " return new Foo() {\n" +
+ " public <T> T foo(T t) {\n" +
+ " return t;\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
"}\n", // =================
},
"done");
@@ -47569,32 +47569,32 @@ public void test1352() {
this.runConformTest(
new String[] {
"X.java", // =================
- "import java.io.IOException;\n" +
- "\n" +
- "interface IFoo<U> {\n" +
- " <T> T foo(T t) throws IOException;\n" +
- "}\n" +
- "interface JFoo<U> {\n" +
- " <T> T foo(T t) throws Exception;\n" +
- "}\n" +
- "abstract class Foo implements IFoo<String>, JFoo<String> {}\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Foo f = createFoo();\n" +
- " try {\n" +
- " f.foo(null);\n" +
- " } catch(IOException e) {\n" +
- " }\n" +
- " System.out.println(\"done\"); //dd\n" +
- " }\n" +
- " static Foo createFoo() {\n" +
- " return new Foo() {\n" +
- " public <T> T foo(T t) {\n" +
- " return t;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
+ "import java.io.IOException;\n" +
+ "\n" +
+ "interface IFoo<U> {\n" +
+ " <T> T foo(T t) throws IOException;\n" +
+ "}\n" +
+ "interface JFoo<U> {\n" +
+ " <T> T foo(T t) throws Exception;\n" +
+ "}\n" +
+ "abstract class Foo implements IFoo<String>, JFoo<String> {}\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Foo f = createFoo();\n" +
+ " try {\n" +
+ " f.foo(null);\n" +
+ " } catch(IOException e) {\n" +
+ " }\n" +
+ " System.out.println(\"done\"); //dd\n" +
+ " }\n" +
+ " static Foo createFoo() {\n" +
+ " return new Foo() {\n" +
+ " public <T> T foo(T t) {\n" +
+ " return t;\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
"}\n", // =================
},
"done");
@@ -47604,39 +47604,39 @@ public void test1353() {
this.runNegativeTest(
new String[] {
"X.java", // =================
- "import java.io.IOException;\n" +
- "\n" +
- "interface IFoo<U> {\n" +
- " <T> T foo(T t) throws IOException;\n" +
- "}\n" +
- "interface JFoo<U> {\n" +
- " <T> T foo(T t);\n" +
- "}\n" +
- "abstract class Foo implements IFoo<String>, JFoo<String> {}\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Foo f = createFoo();\n" +
- " try {\n" +
- " f.foo(null);\n" +
- " } catch(IOException e) {\n" +
- " }\n" +
- " System.out.println(\"done\"); //dd\n" +
- " }\n" +
- " static Foo createFoo() {\n" +
- " return new Foo() {\n" +
- " public <T> T foo(T t) {\n" +
- " return t;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
+ "import java.io.IOException;\n" +
+ "\n" +
+ "interface IFoo<U> {\n" +
+ " <T> T foo(T t) throws IOException;\n" +
+ "}\n" +
+ "interface JFoo<U> {\n" +
+ " <T> T foo(T t);\n" +
+ "}\n" +
+ "abstract class Foo implements IFoo<String>, JFoo<String> {}\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Foo f = createFoo();\n" +
+ " try {\n" +
+ " f.foo(null);\n" +
+ " } catch(IOException e) {\n" +
+ " }\n" +
+ " System.out.println(\"done\"); //dd\n" +
+ " }\n" +
+ " static Foo createFoo() {\n" +
+ " return new Foo() {\n" +
+ " public <T> T foo(T t) {\n" +
+ " return t;\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
"}\n", // =================
},
- "----------\n" +
- "1. ERROR in X.java (at line 16)\n" +
- " } catch(IOException e) {\n" +
- " ^^^^^^^^^^^\n" +
- "Unreachable catch block for IOException. This exception is never thrown from the try statement body\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 16)\n" +
+ " } catch(IOException e) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "Unreachable catch block for IOException. This exception is never thrown from the try statement body\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=237912
@@ -47644,26 +47644,26 @@ public void test1354() {
this.runConformTest(
new String[] {
"X.java", // =================
- "interface Operation<In> extends CheckedOperation<In, RuntimeException> {\n" +
- " void op(In o);\n" +
- "}\n" +
- "\n" +
- "interface CheckedOperation<In, E extends Exception> {\n" +
- " void op(In o) throws E;\n" +
- "}\n" +
- "\n" +
- "class ToUpper implements Operation<String> {\n" +
- " public void op(String o) {\n" +
- " System.out.print(\"[\"+o.toUpperCase()+\"]\");\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " new ToUpper().op(\"hello world 1\"); // Works\n" +
- " Operation<String> t = new ToUpper();\n" +
- " t.op(\"hello world 2\"); // Doesn\'t work: Exception in thread \"main\" java.lang.NoSuchMethodError: Operation.op(Ljava/lang/String;)V\n" +
- " }\n" +
+ "interface Operation<In> extends CheckedOperation<In, RuntimeException> {\n" +
+ " void op(In o);\n" +
+ "}\n" +
+ "\n" +
+ "interface CheckedOperation<In, E extends Exception> {\n" +
+ " void op(In o) throws E;\n" +
+ "}\n" +
+ "\n" +
+ "class ToUpper implements Operation<String> {\n" +
+ " public void op(String o) {\n" +
+ " System.out.print(\"[\"+o.toUpperCase()+\"]\");\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " new ToUpper().op(\"hello world 1\"); // Works\n" +
+ " Operation<String> t = new ToUpper();\n" +
+ " t.op(\"hello world 2\"); // Doesn\'t work: Exception in thread \"main\" java.lang.NoSuchMethodError: Operation.op(Ljava/lang/String;)V\n" +
+ " }\n" +
"}\n", // =================
},
"[HELLO WORLD 1][HELLO WORLD 2]");
@@ -47673,26 +47673,26 @@ public void test1355() {
this.runConformTest(
new String[] {
"X.java", // =================
- "interface Operation<In> extends CheckedOperation<In, RuntimeException> {\n" +
- " void op(In o) throws RuntimeException;\n" +
- "}\n" +
- "\n" +
- "interface CheckedOperation<In, E extends Exception> {\n" +
- " void op(In o) throws E;\n" +
- "}\n" +
- "\n" +
- "class ToUpper implements Operation<String> {\n" +
- " public void op(String o) {\n" +
- " System.out.print(\"[\"+o.toUpperCase()+\"]\");\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " new ToUpper().op(\"hello world 1\"); // Works\n" +
- " Operation<String> t = new ToUpper();\n" +
- " t.op(\"hello world 2\"); // Doesn\'t work: Exception in thread \"main\" java.lang.NoSuchMethodError: Operation.op(Ljava/lang/String;)V\n" +
- " }\n" +
+ "interface Operation<In> extends CheckedOperation<In, RuntimeException> {\n" +
+ " void op(In o) throws RuntimeException;\n" +
+ "}\n" +
+ "\n" +
+ "interface CheckedOperation<In, E extends Exception> {\n" +
+ " void op(In o) throws E;\n" +
+ "}\n" +
+ "\n" +
+ "class ToUpper implements Operation<String> {\n" +
+ " public void op(String o) {\n" +
+ " System.out.print(\"[\"+o.toUpperCase()+\"]\");\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " new ToUpper().op(\"hello world 1\"); // Works\n" +
+ " Operation<String> t = new ToUpper();\n" +
+ " t.op(\"hello world 2\"); // Doesn\'t work: Exception in thread \"main\" java.lang.NoSuchMethodError: Operation.op(Ljava/lang/String;)V\n" +
+ " }\n" +
"}\n", // =================
},
"[HELLO WORLD 1][HELLO WORLD 2]");
@@ -47702,29 +47702,29 @@ public void test1356() {
this.runConformTest(
new String[] {
"X.java", // =================
- "class Activator {\n" +
- "}\n" +
- "interface Child<T> extends Parent<T> {\n" +
- " Activator get(T value);\n" +
- "}\n" +
- "interface Parent<T> {\n" +
- " Activator get(T value) throws RuntimeException;\n" +
- "}\n" +
- "public class X {\n" +
- " static class Impl<T> implements Child<T> {\n" +
- " public Activator get(T value) {\n" +
- " System.out.println(\"done\");\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " Child<Boolean> c = new Impl<Boolean>();\n" +
- " try {\n" +
- " c.get(true);\n" +
- " } catch (Throwable t) { \n" +
- " t.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ "class Activator {\n" +
+ "}\n" +
+ "interface Child<T> extends Parent<T> {\n" +
+ " Activator get(T value);\n" +
+ "}\n" +
+ "interface Parent<T> {\n" +
+ " Activator get(T value) throws RuntimeException;\n" +
+ "}\n" +
+ "public class X {\n" +
+ " static class Impl<T> implements Child<T> {\n" +
+ " public Activator get(T value) {\n" +
+ " System.out.println(\"done\");\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " Child<Boolean> c = new Impl<Boolean>();\n" +
+ " try {\n" +
+ " c.get(true);\n" +
+ " } catch (Throwable t) { \n" +
+ " t.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}\n", // =================
},
"done");
@@ -47734,34 +47734,34 @@ public void test1357() {
this.runNegativeTest(
new String[] {
"X.java", // =================
- "import java.util.*;\n" +
- "@interface Ann { Class<?> value(); }\n" +
- "\n" +
- "/**\n" +
- " * @see Private - Private is not visible here\n" +
- " */\n" +
- "@Ann(X.Private.class) // Private is not visible here\n" +
- "public abstract class X implements Map<X.Private,Secondary.SecondaryPrivate> {\n" +
- " /**\n" +
- " * @see Private - Private is visible here\n" +
- " */\n" +
- " private static interface Private {}\n" +
- " Private field;\n" +
- "}\n" +
- "class Secondary {\n" +
- " private static interface SecondaryPrivate {}\n" +
+ "import java.util.*;\n" +
+ "@interface Ann { Class<?> value(); }\n" +
+ "\n" +
+ "/**\n" +
+ " * @see Private - Private is not visible here\n" +
+ " */\n" +
+ "@Ann(X.Private.class) // Private is not visible here\n" +
+ "public abstract class X implements Map<X.Private,Secondary.SecondaryPrivate> {\n" +
+ " /**\n" +
+ " * @see Private - Private is visible here\n" +
+ " */\n" +
+ " private static interface Private {}\n" +
+ " Private field;\n" +
+ "}\n" +
+ "class Secondary {\n" +
+ " private static interface SecondaryPrivate {}\n" +
"}\n", // =================
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " public abstract class X implements Map<X.Private,Secondary.SecondaryPrivate> {\n" +
- " ^^^^^^^^^\n" +
- "The type X.Private is not visible\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " public abstract class X implements Map<X.Private,Secondary.SecondaryPrivate> {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The type Secondary.SecondaryPrivate is not visible\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " public abstract class X implements Map<X.Private,Secondary.SecondaryPrivate> {\n" +
+ " ^^^^^^^^^\n" +
+ "The type X.Private is not visible\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " public abstract class X implements Map<X.Private,Secondary.SecondaryPrivate> {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The type Secondary.SecondaryPrivate is not visible\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=185422 - variation
@@ -47769,22 +47769,22 @@ public void test1358() {
this.runNegativeTest(
new String[] {
"X.java", // =================
- "import java.util.List;\n" +
- "public abstract class X implements List<X.Inter.Private> {\n" +
- " /**\n" +
- " * @see Inter.Private - Private is visible here\n" +
- " */\n" +
- " class Inter {\n" +
- " private class Private {}\n" +
- " }\n" +
- " Inter.Private field;\n" +
+ "import java.util.List;\n" +
+ "public abstract class X implements List<X.Inter.Private> {\n" +
+ " /**\n" +
+ " * @see Inter.Private - Private is visible here\n" +
+ " */\n" +
+ " class Inter {\n" +
+ " private class Private {}\n" +
+ " }\n" +
+ " Inter.Private field;\n" +
"}\n", // =================
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public abstract class X implements List<X.Inter.Private> {\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The type X.Inter.Private is not visible\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public abstract class X implements List<X.Inter.Private> {\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The type X.Inter.Private is not visible\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=185422 - variation
@@ -47792,14 +47792,14 @@ public void test1359() {
this.runConformTest(
new String[] {
"X.java", // =================
- "public class X<T> {\n" +
- " class M1 <U>{\n" +
- " private class Private<U> {\n" +
- " }\n" +
- " }\n" +
- " void foo() {\n" +
- " M1<String>.Private<?> p;\n" +
- " }\n" +
+ "public class X<T> {\n" +
+ " class M1 <U>{\n" +
+ " private class Private<U> {\n" +
+ " }\n" +
+ " }\n" +
+ " void foo() {\n" +
+ " M1<String>.Private<?> p;\n" +
+ " }\n" +
"}\n", // =================
},
"");
@@ -47809,13 +47809,13 @@ public void test1360() {
this.runConformTest(
new String[] {
"X.java", // =================
- "public class X {\n" +
- " public static <T> T getValue(final Object bean, final String property) {\n" +
- " return (T)new Object();\n" +
- " }\n" +
- " public void testGenerics() {\n" +
- " int value = getValue(new Object(), \"\");\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static <T> T getValue(final Object bean, final String property) {\n" +
+ " return (T)new Object();\n" +
+ " }\n" +
+ " public void testGenerics() {\n" +
+ " int value = getValue(new Object(), \"\");\n" +
+ " }\n" +
"}\n", // =================
},
"");
@@ -47825,13 +47825,13 @@ public void test1361() {
this.runConformTest(
new String[] {
"X.java", // =================
- "public class X {\n" +
- " public static <T> T getValue(T t) {\n" +
- " return t;\n" +
- " }\n" +
- " public void testGenerics() {\n" +
- " int value = getValue(0);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static <T> T getValue(T t) {\n" +
+ " return t;\n" +
+ " }\n" +
+ " public void testGenerics() {\n" +
+ " int value = getValue(0);\n" +
+ " }\n" +
"}\n", // =================
},
"");
@@ -47841,13 +47841,13 @@ public void test1362() {
this.runConformTest(
new String[] {
"X.java", // =================
- "public class X {\n" +
- " public static <T> T getValue(T t1, T t2) {\n" +
- " return t1;\n" +
- " }\n" +
- " public void testGenerics() {\n" +
- " getValue(0, this);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static <T> T getValue(T t1, T t2) {\n" +
+ " return t1;\n" +
+ " }\n" +
+ " public void testGenerics() {\n" +
+ " getValue(0, this);\n" +
+ " }\n" +
"}\n", // =================
},
"");
@@ -47857,21 +47857,21 @@ public void test1363() {
this.runNegativeTest(
new String[] {
"X.java", // =================
- "public class X {\n" +
- " public static <T> T getValue(T t1, T t2) {\n" +
- " return t1;\n" +
- " }\n" +
- "\n" +
- " public void testGenerics(Comparable<String> s) {\n" +
- " int i = getValue(0, s);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static <T> T getValue(T t1, T t2) {\n" +
+ " return t1;\n" +
+ " }\n" +
+ "\n" +
+ " public void testGenerics(Comparable<String> s) {\n" +
+ " int i = getValue(0, s);\n" +
+ " }\n" +
"}\n", // =================
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " int i = getValue(0, s);\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Comparable<capture#1-of ? extends "+intersection("Object","Comparable<?>","Serializable")+"> to int\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " int i = getValue(0, s);\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Comparable<capture#1-of ? extends "+intersection("Object","Comparable<?>","Serializable")+"> to int\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239225
@@ -47879,39 +47879,39 @@ public void test1364() {
this.runNegativeTest(
new String[] {
"Status.java", // =================
- "import java.util.HashMap;\n" +
- "import java.util.Map;\n" +
- "\n" +
- "public enum Status {\n" +
- " GOOD((byte) 0x00), BAD((byte) 0x02);\n" +
- "\n" +
- " private static Map<Byte, Status> mapping;\n" +
- "\n" +
- " private Status(final byte newValue) {\n" +
- "\n" +
- " if (Status.mapping == null) {\n" +
- " Status.mapping = new HashMap<Byte, Status>();\n" +
- " }\n" +
- "\n" +
- " Status.mapping.put(newValue, this);\n" +
- " }\n" +
+ "import java.util.HashMap;\n" +
+ "import java.util.Map;\n" +
+ "\n" +
+ "public enum Status {\n" +
+ " GOOD((byte) 0x00), BAD((byte) 0x02);\n" +
+ "\n" +
+ " private static Map<Byte, Status> mapping;\n" +
+ "\n" +
+ " private Status(final byte newValue) {\n" +
+ "\n" +
+ " if (Status.mapping == null) {\n" +
+ " Status.mapping = new HashMap<Byte, Status>();\n" +
+ " }\n" +
+ "\n" +
+ " Status.mapping.put(newValue, this);\n" +
+ " }\n" +
"}\n", // =================
},
- "----------\n" +
- "1. ERROR in Status.java (at line 11)\n" +
- " if (Status.mapping == null) {\n" +
- " ^^^^^^^\n" +
- "Cannot refer to the static enum field Status.mapping within an initializer\n" +
- "----------\n" +
- "2. ERROR in Status.java (at line 12)\n" +
- " Status.mapping = new HashMap<Byte, Status>();\n" +
- " ^^^^^^^\n" +
- "Cannot refer to the static enum field Status.mapping within an initializer\n" +
- "----------\n" +
- "3. ERROR in Status.java (at line 15)\n" +
- " Status.mapping.put(newValue, this);\n" +
- " ^^^^^^^\n" +
- "Cannot refer to the static enum field Status.mapping within an initializer\n" +
+ "----------\n" +
+ "1. ERROR in Status.java (at line 11)\n" +
+ " if (Status.mapping == null) {\n" +
+ " ^^^^^^^\n" +
+ "Cannot refer to the static enum field Status.mapping within an initializer\n" +
+ "----------\n" +
+ "2. ERROR in Status.java (at line 12)\n" +
+ " Status.mapping = new HashMap<Byte, Status>();\n" +
+ " ^^^^^^^\n" +
+ "Cannot refer to the static enum field Status.mapping within an initializer\n" +
+ "----------\n" +
+ "3. ERROR in Status.java (at line 15)\n" +
+ " Status.mapping.put(newValue, this);\n" +
+ " ^^^^^^^\n" +
+ "Cannot refer to the static enum field Status.mapping within an initializer\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239203
@@ -47919,21 +47919,21 @@ public void test1365() {
this.runConformTest(
new String[] {
"C.java", // =================
- "class A<I extends B> {\n" +
- "}\n" +
- "\n" +
- "class B {\n" +
- "}\n" +
- "\n" +
- "public class C {\n" +
- " <U extends B, V extends A<U>> A<U> foo(Class<V> clazz) {\n" +
- " A<U> ret = bar(\"bla\");\n" +
- " return ret;\n" +
- " }\n" +
- "\n" +
- " <U extends B, V extends A<U>> A<U> bar(String clazzName) {\n" +
- " return null;\n" +
- " }\n" +
+ "class A<I extends B> {\n" +
+ "}\n" +
+ "\n" +
+ "class B {\n" +
+ "}\n" +
+ "\n" +
+ "public class C {\n" +
+ " <U extends B, V extends A<U>> A<U> foo(Class<V> clazz) {\n" +
+ " A<U> ret = bar(\"bla\");\n" +
+ " return ret;\n" +
+ " }\n" +
+ "\n" +
+ " <U extends B, V extends A<U>> A<U> bar(String clazzName) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n", // =================
},
"");
@@ -47943,22 +47943,22 @@ public void test1366() {
this.runConformTest(
new String[] {
"X.java", // =================
- "import java.io.IOException;\n" +
- "\n" +
- "interface IServiceAction<Response, Request, Fault extends Exception> {\n" +
- " Response execute(Request parameter) throws Fault;\n" +
- "}\n" +
- "\n" +
- "interface IServiceOperation<Response, Request, Fault extends Exception> extends IServiceAction<Response, Request, Fault> {\n" +
- " Response execute(Request parameter) throws Fault;\n" +
- "}\n" +
- "\n" +
- "public class X {\n" +
- " public String execute(String parameter) throws IOException {\n" +
- " return serviceOperation.execute(parameter);\n" +
- " }\n" +
- "\n" +
- " private final IServiceOperation<String, String, IOException> serviceOperation = null;\n" +
+ "import java.io.IOException;\n" +
+ "\n" +
+ "interface IServiceAction<Response, Request, Fault extends Exception> {\n" +
+ " Response execute(Request parameter) throws Fault;\n" +
+ "}\n" +
+ "\n" +
+ "interface IServiceOperation<Response, Request, Fault extends Exception> extends IServiceAction<Response, Request, Fault> {\n" +
+ " Response execute(Request parameter) throws Fault;\n" +
+ "}\n" +
+ "\n" +
+ "public class X {\n" +
+ " public String execute(String parameter) throws IOException {\n" +
+ " return serviceOperation.execute(parameter);\n" +
+ " }\n" +
+ "\n" +
+ " private final IServiceOperation<String, String, IOException> serviceOperation = null;\n" +
"}\n", // =================
},
"");
@@ -47975,21 +47975,21 @@ public void test1367() {
" }\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " private static Map<String, String> var;\n" +
- " ^^^\n" +
- "Map cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " var= new HashMap<String, String>();\n" +
- " ^^^\n" +
- "Map cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " var= new HashMap<String, String>();\n" +
- " ^^^^^^^\n" +
- "HashMap cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " private static Map<String, String> var;\n" +
+ " ^^^\n" +
+ "Map cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " var= new HashMap<String, String>();\n" +
+ " ^^^\n" +
+ "Map cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " var= new HashMap<String, String>();\n" +
+ " ^^^^^^^\n" +
+ "HashMap cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=244164
@@ -47997,25 +47997,25 @@ public void test1368() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "import java.util.HashMap;\n" +
- "import java.util.Map;\n" +
- "public class X {\n" +
- " private static Map<String, Zork> map = new HashMap<String, X>();\n" +
- " public static X foo(String s) {\n" +
- " return map.get(s);\n" +
- " }\n" +
+ "import java.util.HashMap;\n" +
+ "import java.util.Map;\n" +
+ "public class X {\n" +
+ " private static Map<String, Zork> map = new HashMap<String, X>();\n" +
+ " public static X foo(String s) {\n" +
+ " return map.get(s);\n" +
+ " }\n" +
"}",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " private static Map<String, Zork> map = new HashMap<String, X>();\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " return map.get(s);\n" +
- " ^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " private static Map<String, Zork> map = new HashMap<String, X>();\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " return map.get(s);\n" +
+ " ^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=244164
@@ -48023,28 +48023,28 @@ public void test1369() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "class X {\n" +
- " A<E> a; // E is undefined on purpose\n" +
- " X() { a = new A<E>(); } // causes Missing code implementation\n" +
+ "class X {\n" +
+ " A<E> a; // E is undefined on purpose\n" +
+ " X() { a = new A<E>(); } // causes Missing code implementation\n" +
"}",
"A.java",
"class A<E> {}",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " A<E> a; // E is undefined on purpose\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " X() { a = new A<E>(); } // causes Missing code implementation\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " X() { a = new A<E>(); } // causes Missing code implementation\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " A<E> a; // E is undefined on purpose\n" +
+ " ^\n" +
+ "E cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " X() { a = new A<E>(); } // causes Missing code implementation\n" +
+ " ^\n" +
+ "E cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " X() { a = new A<E>(); } // causes Missing code implementation\n" +
+ " ^\n" +
+ "E cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=242448
@@ -48052,28 +48052,28 @@ public void test1370() {
this.runConformTest(
new String[] {
"restricted/NonPublicInterface.java", //-----------------------------------------------------------------------
- "package restricted;\n" +
+ "package restricted;\n" +
"interface NonPublicInterface {}\n",
"restricted/NonPublicInterfaceImplementor.java", //-----------------------------------------------------------------------
- "package restricted;\n" +
- "public class NonPublicInterfaceImplementor<E> implements NonPublicInterface {\n" +
- " public NonPublicInterfaceImplementor<E> selfCall() {\n" +
- " return this;\n" +
- " }\n" +
- "}\n",
+ "package restricted;\n" +
+ "public class NonPublicInterfaceImplementor<E> implements NonPublicInterface {\n" +
+ " public NonPublicInterfaceImplementor<E> selfCall() {\n" +
+ " return this;\n" +
+ " }\n" +
+ "}\n",
"restricted/UnuseableOutsideRestrictedWithECJ.java", //-----------------------------------------------------------------------
- "package restricted;\n" +
- "public class UnuseableOutsideRestrictedWithECJ {\n" +
- " public void ecjDoesNotLikeGenericizedParameter(NonPublicInterface notVisible) { }\n" +
+ "package restricted;\n" +
+ "public class UnuseableOutsideRestrictedWithECJ {\n" +
+ " public void ecjDoesNotLikeGenericizedParameter(NonPublicInterface notVisible) { }\n" +
"}\n",
"usesrestricted/CannotCompileInEcj.java", //-----------------------------------------------------------------------
- "package usesrestricted;\n" +
- "import restricted.UnuseableOutsideRestrictedWithECJ;\n" +
- "import restricted.NonPublicInterfaceImplementor;\n" +
- "public class CannotCompileInEcj {\n" +
- " public static void main(String[] args) {\n" +
- " new UnuseableOutsideRestrictedWithECJ().ecjDoesNotLikeGenericizedParameter(new NonPublicInterfaceImplementor().selfCall());\n" +
- " }\n" +
+ "package usesrestricted;\n" +
+ "import restricted.UnuseableOutsideRestrictedWithECJ;\n" +
+ "import restricted.NonPublicInterfaceImplementor;\n" +
+ "public class CannotCompileInEcj {\n" +
+ " public static void main(String[] args) {\n" +
+ " new UnuseableOutsideRestrictedWithECJ().ecjDoesNotLikeGenericizedParameter(new NonPublicInterfaceImplementor().selfCall());\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
"");
@@ -48083,28 +48083,28 @@ public void test1371() {
this.runConformTest(
new String[] {
"restricted/NonPublicInterface.java", //-----------------------------------------------------------------------
- "package restricted;\n" +
+ "package restricted;\n" +
"interface NonPublicInterface {}\n",
"restricted/NonPublicInterfaceImplementor.java", //-----------------------------------------------------------------------
- "package restricted;\n" +
- "public class NonPublicInterfaceImplementor<E extends NonPublicInterface> implements NonPublicInterface {\n" +
- " public E selfCall() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n",
+ "package restricted;\n" +
+ "public class NonPublicInterfaceImplementor<E extends NonPublicInterface> implements NonPublicInterface {\n" +
+ " public E selfCall() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n",
"restricted/UnuseableOutsideRestrictedWithECJ.java", //-----------------------------------------------------------------------
- "package restricted;\n" +
- "public class UnuseableOutsideRestrictedWithECJ {\n" +
- " public void ecjDoesNotLikeGenericizedParameter(NonPublicInterface notVisible) { }\n" +
+ "package restricted;\n" +
+ "public class UnuseableOutsideRestrictedWithECJ {\n" +
+ " public void ecjDoesNotLikeGenericizedParameter(NonPublicInterface notVisible) { }\n" +
"}\n",
"usesrestricted/CannotCompileInEcj.java", //-----------------------------------------------------------------------
- "package usesrestricted;\n" +
- "import restricted.UnuseableOutsideRestrictedWithECJ;\n" +
- "import restricted.NonPublicInterfaceImplementor;\n" +
- "public class CannotCompileInEcj {\n" +
- " public static void main(String[] args) {\n" +
- " new UnuseableOutsideRestrictedWithECJ().ecjDoesNotLikeGenericizedParameter(new NonPublicInterfaceImplementor().selfCall());\n" +
- " }\n" +
+ "package usesrestricted;\n" +
+ "import restricted.UnuseableOutsideRestrictedWithECJ;\n" +
+ "import restricted.NonPublicInterfaceImplementor;\n" +
+ "public class CannotCompileInEcj {\n" +
+ " public static void main(String[] args) {\n" +
+ " new UnuseableOutsideRestrictedWithECJ().ecjDoesNotLikeGenericizedParameter(new NonPublicInterfaceImplementor().selfCall());\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
"");
@@ -48114,28 +48114,28 @@ public void test1372() {
this.runConformTest(
new String[] {
"restricted/NonPublicInterface.java", //-----------------------------------------------------------------------
- "package restricted;\n" +
+ "package restricted;\n" +
"interface NonPublicInterface {}\n",
"restricted/NonPublicInterfaceImplementor.java", //-----------------------------------------------------------------------
- "package restricted;\n" +
- "public class NonPublicInterfaceImplementor<E extends NonPublicInterfaceImplementor> implements NonPublicInterface {\n" +
- " public E selfCall() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n",
+ "package restricted;\n" +
+ "public class NonPublicInterfaceImplementor<E extends NonPublicInterfaceImplementor> implements NonPublicInterface {\n" +
+ " public E selfCall() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n",
"restricted/UnuseableOutsideRestrictedWithECJ.java", //-----------------------------------------------------------------------
- "package restricted;\n" +
- "public class UnuseableOutsideRestrictedWithECJ {\n" +
- " public void ecjDoesNotLikeGenericizedParameter(NonPublicInterface notVisible) { }\n" +
+ "package restricted;\n" +
+ "public class UnuseableOutsideRestrictedWithECJ {\n" +
+ " public void ecjDoesNotLikeGenericizedParameter(NonPublicInterface notVisible) { }\n" +
"}\n",
"usesrestricted/CannotCompileInEcj.java", //-----------------------------------------------------------------------
- "package usesrestricted;\n" +
- "import restricted.UnuseableOutsideRestrictedWithECJ;\n" +
- "import restricted.NonPublicInterfaceImplementor;\n" +
- "public class CannotCompileInEcj {\n" +
- " public static void main(String[] args) {\n" +
- " new UnuseableOutsideRestrictedWithECJ().ecjDoesNotLikeGenericizedParameter(new NonPublicInterfaceImplementor().selfCall());\n" +
- " }\n" +
+ "package usesrestricted;\n" +
+ "import restricted.UnuseableOutsideRestrictedWithECJ;\n" +
+ "import restricted.NonPublicInterfaceImplementor;\n" +
+ "public class CannotCompileInEcj {\n" +
+ " public static void main(String[] args) {\n" +
+ " new UnuseableOutsideRestrictedWithECJ().ecjDoesNotLikeGenericizedParameter(new NonPublicInterfaceImplementor().selfCall());\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
"");
@@ -48145,26 +48145,26 @@ public void test1373() {
this.runConformTest(
new String[] {
"restricted/NonPublicInterface.java", //-----------------------------------------------------------------------
- "package restricted;\n" +
+ "package restricted;\n" +
"interface NonPublicInterface {}\n",
"restricted/NonPublicInterfaceImplementor.java", //-----------------------------------------------------------------------
- "package restricted;\n" +
- "public class NonPublicInterfaceImplementor<E> implements NonPublicInterface {\n" +
- " public NonPublicInterfaceImplementor<E> next;\n" +
- "}\n",
+ "package restricted;\n" +
+ "public class NonPublicInterfaceImplementor<E> implements NonPublicInterface {\n" +
+ " public NonPublicInterfaceImplementor<E> next;\n" +
+ "}\n",
"restricted/UnuseableOutsideRestrictedWithECJ.java", //-----------------------------------------------------------------------
- "package restricted;\n" +
- "public class UnuseableOutsideRestrictedWithECJ {\n" +
- " public void ecjDoesNotLikeGenericizedParameter(NonPublicInterface notVisible) { }\n" +
+ "package restricted;\n" +
+ "public class UnuseableOutsideRestrictedWithECJ {\n" +
+ " public void ecjDoesNotLikeGenericizedParameter(NonPublicInterface notVisible) { }\n" +
"}\n",
"usesrestricted/CannotCompileInEcj.java", //-----------------------------------------------------------------------
- "package usesrestricted;\n" +
- "import restricted.UnuseableOutsideRestrictedWithECJ;\n" +
- "import restricted.NonPublicInterfaceImplementor;\n" +
- "public class CannotCompileInEcj {\n" +
- " public static void main(String[] args) {\n" +
- " new UnuseableOutsideRestrictedWithECJ().ecjDoesNotLikeGenericizedParameter(new NonPublicInterfaceImplementor().next);\n" +
- " }\n" +
+ "package usesrestricted;\n" +
+ "import restricted.UnuseableOutsideRestrictedWithECJ;\n" +
+ "import restricted.NonPublicInterfaceImplementor;\n" +
+ "public class CannotCompileInEcj {\n" +
+ " public static void main(String[] args) {\n" +
+ " new UnuseableOutsideRestrictedWithECJ().ecjDoesNotLikeGenericizedParameter(new NonPublicInterfaceImplementor().next);\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
"");
@@ -48174,27 +48174,27 @@ public void test1374() {
this.runConformTest(
new String[] {
"restricted/NonPublicInterface.java", //-----------------------------------------------------------------------
- "package restricted;\n" +
+ "package restricted;\n" +
"interface NonPublicInterface {}\n",
"restricted/NonPublicInterfaceImplementor.java", //-----------------------------------------------------------------------
- "package restricted;\n" +
- "public class NonPublicInterfaceImplementor<E> implements NonPublicInterface {\n" +
- " public NonPublicInterfaceImplementor<E> next;\n" +
- "}\n",
+ "package restricted;\n" +
+ "public class NonPublicInterfaceImplementor<E> implements NonPublicInterface {\n" +
+ " public NonPublicInterfaceImplementor<E> next;\n" +
+ "}\n",
"restricted/UnuseableOutsideRestrictedWithECJ.java", //-----------------------------------------------------------------------
- "package restricted;\n" +
- "public class UnuseableOutsideRestrictedWithECJ {\n" +
- " public void ecjDoesNotLikeGenericizedParameter(NonPublicInterface notVisible) { }\n" +
+ "package restricted;\n" +
+ "public class UnuseableOutsideRestrictedWithECJ {\n" +
+ " public void ecjDoesNotLikeGenericizedParameter(NonPublicInterface notVisible) { }\n" +
"}\n",
"usesrestricted/CannotCompileInEcj.java", //-----------------------------------------------------------------------
- "package usesrestricted;\n" +
- "import restricted.UnuseableOutsideRestrictedWithECJ;\n" +
- "import restricted.NonPublicInterfaceImplementor;\n" +
- "public class CannotCompileInEcj {\n" +
- " public static void main(String[] args) {\n" +
- " NonPublicInterfaceImplementor impl = new NonPublicInterfaceImplementor();\n" +
- " new UnuseableOutsideRestrictedWithECJ().ecjDoesNotLikeGenericizedParameter(impl.next);\n" +
- " }\n" +
+ "package usesrestricted;\n" +
+ "import restricted.UnuseableOutsideRestrictedWithECJ;\n" +
+ "import restricted.NonPublicInterfaceImplementor;\n" +
+ "public class CannotCompileInEcj {\n" +
+ " public static void main(String[] args) {\n" +
+ " NonPublicInterfaceImplementor impl = new NonPublicInterfaceImplementor();\n" +
+ " new UnuseableOutsideRestrictedWithECJ().ecjDoesNotLikeGenericizedParameter(impl.next);\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
"");
@@ -48204,27 +48204,27 @@ public void test1375() {
this.runConformTest(
new String[] {
"restricted/NonPublicInterface.java", //-----------------------------------------------------------------------
- "package restricted;\n" +
+ "package restricted;\n" +
"interface NonPublicInterface {}\n",
"restricted/NonPublicInterfaceImplementor.java", //-----------------------------------------------------------------------
- "package restricted;\n" +
- "public class NonPublicInterfaceImplementor<E> implements NonPublicInterface {\n" +
- " public NonPublicInterfaceImplementor<E> next;\n" +
- "}\n",
+ "package restricted;\n" +
+ "public class NonPublicInterfaceImplementor<E> implements NonPublicInterface {\n" +
+ " public NonPublicInterfaceImplementor<E> next;\n" +
+ "}\n",
"restricted/UnuseableOutsideRestrictedWithECJ.java", //-----------------------------------------------------------------------
- "package restricted;\n" +
- "public class UnuseableOutsideRestrictedWithECJ {\n" +
- " public void ecjDoesNotLikeGenericizedParameter(NonPublicInterface notVisible) { }\n" +
+ "package restricted;\n" +
+ "public class UnuseableOutsideRestrictedWithECJ {\n" +
+ " public void ecjDoesNotLikeGenericizedParameter(NonPublicInterface notVisible) { }\n" +
"}\n",
"usesrestricted/CannotCompileInEcj.java", //-----------------------------------------------------------------------
- "package usesrestricted;\n" +
- "import restricted.UnuseableOutsideRestrictedWithECJ;\n" +
- "import restricted.NonPublicInterfaceImplementor;\n" +
- "public class CannotCompileInEcj {\n" +
- " public static void main(String[] args) {\n" +
- " NonPublicInterfaceImplementor impl = new NonPublicInterfaceImplementor();\n" +
- " new UnuseableOutsideRestrictedWithECJ().ecjDoesNotLikeGenericizedParameter(impl.next.next);\n" +
- " }\n" +
+ "package usesrestricted;\n" +
+ "import restricted.UnuseableOutsideRestrictedWithECJ;\n" +
+ "import restricted.NonPublicInterfaceImplementor;\n" +
+ "public class CannotCompileInEcj {\n" +
+ " public static void main(String[] args) {\n" +
+ " NonPublicInterfaceImplementor impl = new NonPublicInterfaceImplementor();\n" +
+ " new UnuseableOutsideRestrictedWithECJ().ecjDoesNotLikeGenericizedParameter(impl.next.next);\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
"");
@@ -48234,25 +48234,25 @@ public void test1376() {
this.runConformTest(
new String[] {
"restricted/NonPublicInterface.java", //-----------------------------------------------------------------------
- "package restricted;\n" +
+ "package restricted;\n" +
"interface NonPublicInterface {}\n",
"restricted/NonPublicInterfaceImplementor.java", //-----------------------------------------------------------------------
- "package restricted;\n" +
+ "package restricted;\n" +
"public class NonPublicInterfaceImplementor<E> implements NonPublicInterface {}\n",
"restricted/UnuseableOutsideRestrictedWithECJ.java", //-----------------------------------------------------------------------
- "package restricted;\n" +
- "public class UnuseableOutsideRestrictedWithECJ {\n" +
- " public void ecjDoesNotLikeGenericizedParameter(NonPublicInterface notVisible) { }\n" +
+ "package restricted;\n" +
+ "public class UnuseableOutsideRestrictedWithECJ {\n" +
+ " public void ecjDoesNotLikeGenericizedParameter(NonPublicInterface notVisible) { }\n" +
"}\n",
"usesrestricted/CannotCompileInEcj.java", //-----------------------------------------------------------------------
- "package usesrestricted;\n" +
- "import restricted.UnuseableOutsideRestrictedWithECJ;\n" +
- "import restricted.NonPublicInterfaceImplementor;\n" +
- "public class CannotCompileInEcj<E> {\n" +
- " public NonPublicInterfaceImplementor<E> next;\n" +
- " public void foo() {\n" +
- " new UnuseableOutsideRestrictedWithECJ().ecjDoesNotLikeGenericizedParameter(next);\n" +
- " }\n" +
+ "package usesrestricted;\n" +
+ "import restricted.UnuseableOutsideRestrictedWithECJ;\n" +
+ "import restricted.NonPublicInterfaceImplementor;\n" +
+ "public class CannotCompileInEcj<E> {\n" +
+ " public NonPublicInterfaceImplementor<E> next;\n" +
+ " public void foo() {\n" +
+ " new UnuseableOutsideRestrictedWithECJ().ecjDoesNotLikeGenericizedParameter(next);\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
"");
@@ -48262,34 +48262,34 @@ public void test1377() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "import java.rmi.RemoteException;\n" +
- "public class X {\n" +
- " private static <T extends Exception> T foo() throws T {\n" +
- " throw (T) new InterruptedException();\n" +
- " }\n" +
- " private static void foo2() {\n" +
- " try {\n" +
- " RemoteException ex = foo();\n" +
- " } catch (RemoteException e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
- " public static void main( String[] args) {\n" +
- " foo2();\n" +
+ "import java.rmi.RemoteException;\n" +
+ "public class X {\n" +
+ " private static <T extends Exception> T foo() throws T {\n" +
+ " throw (T) new InterruptedException();\n" +
+ " }\n" +
+ " private static void foo2() {\n" +
+ " try {\n" +
+ " RemoteException ex = foo();\n" +
+ " } catch (RemoteException e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main( String[] args) {\n" +
+ " foo2();\n" +
" Zork z;\n" +
- " }\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " throw (T) new InterruptedException();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from InterruptedException to T\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 15)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " throw (T) new InterruptedException();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from InterruptedException to T\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 15)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=241502
@@ -48297,42 +48297,42 @@ public void test1378() {
this.runConformTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "//the remote-usable interface\n" +
- "class RemoteException extends Throwable {}\n" +
- " \n" +
- "interface RemoteStore {\n" +
- " public abstract <P> P get(Class<P> c) throws RemoteException;\n" +
- "}\n" +
- "\n" +
- "//the interface for local use\n" +
- "interface Store extends RemoteStore{\n" +
- " public <P> P get(Class<P> c) ;\n" +
- "}\n" +
- "\n" +
- "//the implementation\n" +
- "class StoreImpl implements Store {\n" +
- " public <P> P get(Class<P> c) {\n" +
- " System.out.print(\"[get]\");\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Persistent {\n" +
- "}\n" +
- "\n" +
- "public class X {\n" +
- "public static void main(String[] args) {\n" +
- " try {\n" +
- " RemoteStore t = new StoreImpl();\n" +
- " t.get(Object.class); //works\n" +
- " t.get(Persistent.class); //works\n" +
- " } catch (RemoteException e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " Store t = new StoreImpl();\n" +
- " t.get(Object.class); //works\n" +
- " t.get(Persistent.class); //NoSuchMethodError\n" +
- "} \n" +
+ "//the remote-usable interface\n" +
+ "class RemoteException extends Throwable {}\n" +
+ " \n" +
+ "interface RemoteStore {\n" +
+ " public abstract <P> P get(Class<P> c) throws RemoteException;\n" +
+ "}\n" +
+ "\n" +
+ "//the interface for local use\n" +
+ "interface Store extends RemoteStore{\n" +
+ " public <P> P get(Class<P> c) ;\n" +
+ "}\n" +
+ "\n" +
+ "//the implementation\n" +
+ "class StoreImpl implements Store {\n" +
+ " public <P> P get(Class<P> c) {\n" +
+ " System.out.print(\"[get]\");\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class Persistent {\n" +
+ "}\n" +
+ "\n" +
+ "public class X {\n" +
+ "public static void main(String[] args) {\n" +
+ " try {\n" +
+ " RemoteStore t = new StoreImpl();\n" +
+ " t.get(Object.class); //works\n" +
+ " t.get(Persistent.class); //works\n" +
+ " } catch (RemoteException e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " Store t = new StoreImpl();\n" +
+ " t.get(Object.class); //works\n" +
+ " t.get(Persistent.class); //NoSuchMethodError\n" +
+ "} \n" +
"}\n",//-----------------------------------------------------------------------
},
"[get][get][get][get]");
@@ -48342,27 +48342,27 @@ public void test1379() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "import java.rmi.RemoteException;\n" +
- "public class X{\n" +
- " private static <T extends Exception> T foo() {\n" +
- " return (T)new InterruptedException();\n" +
- " }\n" +
- " public static void main( String[] args) {\n" +
- " RemoteException ex = foo();\n" +
+ "import java.rmi.RemoteException;\n" +
+ "public class X{\n" +
+ " private static <T extends Exception> T foo() {\n" +
+ " return (T)new InterruptedException();\n" +
+ " }\n" +
+ " public static void main( String[] args) {\n" +
+ " RemoteException ex = foo();\n" +
" Zork z;\n" +
- " }\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " return (T)new InterruptedException();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from InterruptedException to T\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " return (T)new InterruptedException();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from InterruptedException to T\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=174447
@@ -48370,12 +48370,12 @@ public void test1380() {
this.runConformTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "public class X {\n" +
- " public static <E extends Enum<E>> void f() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " f();\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static <E extends Enum<E>> void f() {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " f();\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
"");
@@ -48386,48 +48386,48 @@ public void test1381() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T extends AA & p.IB> {\n" +
- " T t;\n" +
- " void foo() {\n" +
- " this.t.baz();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X<CC> xcc = new X<CC>();\n" +
- " xcc.t = new CC();\n" +
- " xcc.foo();\n" +
- " }\n" +
- "}\n" +
- "class AA {\n" +
- " void bar() {}\n" +
- "}\n" +
- "class CC extends AA implements p.IB {\n" +
- " public void baz() {\n" +
- " System.out.println(\"done\");\n" +
- " }\n" +
+ "public class X<T extends AA & p.IB> {\n" +
+ " T t;\n" +
+ " void foo() {\n" +
+ " this.t.baz();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X<CC> xcc = new X<CC>();\n" +
+ " xcc.t = new CC();\n" +
+ " xcc.foo();\n" +
+ " }\n" +
+ "}\n" +
+ "class AA {\n" +
+ " void bar() {}\n" +
+ "}\n" +
+ "class CC extends AA implements p.IB {\n" +
+ " public void baz() {\n" +
+ " System.out.println(\"done\");\n" +
+ " }\n" +
"}\n",
"p/IB.java", // =====================
"package p;\n" +
"interface IA {\n" + // non visible
- " void baz();\n" +
- "}\n" +
- "public interface IB extends IA {\n" +
+ " void baz();\n" +
+ "}\n" +
+ "public interface IB extends IA {\n" +
"}\n",
},
"done");
// check #baz() invocation declaring class is IB
String expectedOutput =
- " // Method descriptor #10 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " void foo();\n" +
- " 0 aload_0 [this]\n" +
- " 1 getfield X.t : AA [21]\n" +
- " 4 checkcast p.IB [23]\n" +
- " 7 invokeinterface p.IB.baz() : void [25] [nargs: 1]\n" +
- " 12 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 4]\n" +
- " [pc: 12, line: 5]\n" +
- " Local variable table:\n" +
+ " // Method descriptor #10 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " void foo();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 getfield X.t : AA [21]\n" +
+ " 4 checkcast p.IB [23]\n" +
+ " 7 invokeinterface p.IB.baz() : void [25] [nargs: 1]\n" +
+ " 12 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 4]\n" +
+ " [pc: 12, line: 5]\n" +
+ " Local variable table:\n" +
" [pc: 0, pc: 13] local: this index: 0 type: X\n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -48447,40 +48447,40 @@ public void test1382() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T> {\n" +
- " T get() { return null; }\n" +
- " \n" +
- " void foo() {\n" +
- " X<BB> xbb = new X<BB>();\n" +
- " xbb.get().bar();\n" +
- " }\n" +
- "}\n" +
- "class AA {\n" +
- " void bar() {}\n" +
- "}\n" +
+ "public class X<T> {\n" +
+ " T get() { return null; }\n" +
+ " \n" +
+ " void foo() {\n" +
+ " X<BB> xbb = new X<BB>();\n" +
+ " xbb.get().bar();\n" +
+ " }\n" +
+ "}\n" +
+ "class AA {\n" +
+ " void bar() {}\n" +
+ "}\n" +
"class BB extends AA {}\n"
},
"");
// check #bar() invocation declaring class is BB
String expectedOutput =
- " // Method descriptor #6 ()V\n" +
- " // Stack: 2, Locals: 2\n" +
- " void foo();\n" +
- " 0 new X [1]\n" +
- " 3 dup\n" +
- " 4 invokespecial X() [21]\n" +
- " 7 astore_1 [xbb]\n" +
- " 8 aload_1 [xbb]\n" +
- " 9 invokevirtual X.get() : java.lang.Object [22]\n" +
- " 12 checkcast BB [24]\n" +
- " 15 invokevirtual BB.bar() : void [26]\n" +
- " 18 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 5]\n" +
- " [pc: 8, line: 6]\n" +
- " [pc: 18, line: 7]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 19] local: this index: 0 type: X\n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 2, Locals: 2\n" +
+ " void foo();\n" +
+ " 0 new X [1]\n" +
+ " 3 dup\n" +
+ " 4 invokespecial X() [21]\n" +
+ " 7 astore_1 [xbb]\n" +
+ " 8 aload_1 [xbb]\n" +
+ " 9 invokevirtual X.get() : java.lang.Object [22]\n" +
+ " 12 checkcast BB [24]\n" +
+ " 15 invokevirtual BB.bar() : void [26]\n" +
+ " 18 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 5]\n" +
+ " [pc: 8, line: 6]\n" +
+ " [pc: 18, line: 7]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 19] local: this index: 0 type: X\n" +
" [pc: 8, pc: 19] local: xbb index: 1 type: X\n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -48500,42 +48500,42 @@ public void test1383() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T> {\n" +
- " T get() { return null; }\n" +
- " \n" +
- " void foo() {\n" +
- " X<BB> xbb = new X<BB>();\n" +
- " int j = xbb.get().bar;\n" +
- " }\n" +
- "}\n" +
- "class AA {\n" +
- " int bar;\n" +
- "}\n" +
+ "public class X<T> {\n" +
+ " T get() { return null; }\n" +
+ " \n" +
+ " void foo() {\n" +
+ " X<BB> xbb = new X<BB>();\n" +
+ " int j = xbb.get().bar;\n" +
+ " }\n" +
+ "}\n" +
+ "class AA {\n" +
+ " int bar;\n" +
+ "}\n" +
"class BB extends AA {}\n"
},
"");
// check #bar field read declaring class is BB
String expectedOutput =
- " // Method descriptor #6 ()V\n" +
- " // Stack: 2, Locals: 3\n" +
- " void foo();\n" +
- " 0 new X [1]\n" +
- " 3 dup\n" +
- " 4 invokespecial X() [21]\n" +
- " 7 astore_1 [xbb]\n" +
- " 8 aload_1 [xbb]\n" +
- " 9 invokevirtual X.get() : java.lang.Object [22]\n" +
- " 12 checkcast BB [24]\n" +
- " 15 getfield BB.bar : int [26]\n" +
- " 18 istore_2 [j]\n" +
- " 19 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 5]\n" +
- " [pc: 8, line: 6]\n" +
- " [pc: 19, line: 7]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 20] local: this index: 0 type: X\n" +
- " [pc: 8, pc: 20] local: xbb index: 1 type: X\n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 2, Locals: 3\n" +
+ " void foo();\n" +
+ " 0 new X [1]\n" +
+ " 3 dup\n" +
+ " 4 invokespecial X() [21]\n" +
+ " 7 astore_1 [xbb]\n" +
+ " 8 aload_1 [xbb]\n" +
+ " 9 invokevirtual X.get() : java.lang.Object [22]\n" +
+ " 12 checkcast BB [24]\n" +
+ " 15 getfield BB.bar : int [26]\n" +
+ " 18 istore_2 [j]\n" +
+ " 19 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 5]\n" +
+ " [pc: 8, line: 6]\n" +
+ " [pc: 19, line: 7]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 20] local: this index: 0 type: X\n" +
+ " [pc: 8, pc: 20] local: xbb index: 1 type: X\n" +
" [pc: 19, pc: 20] local: j index: 2 type: int\n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -48555,41 +48555,41 @@ public void test1384() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T> {\n" +
- " T get() { return null; }\n" +
- " \n" +
- " void foo() {\n" +
- " X<BB> xbb = new X<BB>();\n" +
- " xbb.get().bar = 12;\n" +
- " }\n" +
- "}\n" +
- "class AA {\n" +
- " int bar;\n" +
- "}\n" +
+ "public class X<T> {\n" +
+ " T get() { return null; }\n" +
+ " \n" +
+ " void foo() {\n" +
+ " X<BB> xbb = new X<BB>();\n" +
+ " xbb.get().bar = 12;\n" +
+ " }\n" +
+ "}\n" +
+ "class AA {\n" +
+ " int bar;\n" +
+ "}\n" +
"class BB extends AA {}\n"
},
"");
// check #bar field store declaring class is BB
String expectedOutput =
- " // Method descriptor #6 ()V\n" +
- " // Stack: 2, Locals: 2\n" +
- " void foo();\n" +
- " 0 new X [1]\n" +
- " 3 dup\n" +
- " 4 invokespecial X() [21]\n" +
- " 7 astore_1 [xbb]\n" +
- " 8 aload_1 [xbb]\n" +
- " 9 invokevirtual X.get() : java.lang.Object [22]\n" +
- " 12 checkcast BB [24]\n" +
- " 15 bipush 12\n" +
- " 17 putfield BB.bar : int [26]\n" +
- " 20 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 5]\n" +
- " [pc: 8, line: 6]\n" +
- " [pc: 20, line: 7]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 21] local: this index: 0 type: X\n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 2, Locals: 2\n" +
+ " void foo();\n" +
+ " 0 new X [1]\n" +
+ " 3 dup\n" +
+ " 4 invokespecial X() [21]\n" +
+ " 7 astore_1 [xbb]\n" +
+ " 8 aload_1 [xbb]\n" +
+ " 9 invokevirtual X.get() : java.lang.Object [22]\n" +
+ " 12 checkcast BB [24]\n" +
+ " 15 bipush 12\n" +
+ " 17 putfield BB.bar : int [26]\n" +
+ " 20 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 5]\n" +
+ " [pc: 8, line: 6]\n" +
+ " [pc: 20, line: 7]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 21] local: this index: 0 type: X\n" +
" [pc: 8, pc: 21] local: xbb index: 1 type: X\n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -48609,39 +48609,39 @@ public void test1385() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T extends AA & IB> {\n" +
- " T get() { return null; }\n" +
- " \n" +
- " void foo(X<T> xt) {\n" +
- " xt.get().baz();\n" +
- " }\n" +
- "}\n" +
- "class AA {\n" +
- " void bar() {}\n" +
- "}\n" +
- "interface IA {\n" +
- " void baz();\n" +
- "}\n" +
- "interface IB extends IA {\n" +
+ "public class X<T extends AA & IB> {\n" +
+ " T get() { return null; }\n" +
+ " \n" +
+ " void foo(X<T> xt) {\n" +
+ " xt.get().baz();\n" +
+ " }\n" +
+ "}\n" +
+ "class AA {\n" +
+ " void bar() {}\n" +
+ "}\n" +
+ "interface IA {\n" +
+ " void baz();\n" +
+ "}\n" +
+ "interface IB extends IA {\n" +
"}\n"
},
"");
// check #baz() invocation declaring class is not IA
String expectedOutput =
- " // Method descriptor #21 (LX;)V\n" +
- " // Signature: (LX<TT;>;)V\n" +
- " // Stack: 1, Locals: 2\n" +
- " void foo(X xt);\n" +
- " 0 aload_1 [xt]\n" +
- " 1 invokevirtual X.get() : AA [23]\n" +
- " 4 checkcast IB [25]\n" +
- " 7 invokeinterface IB.baz() : void [27] [nargs: 1]\n" +
- " 12 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 5]\n" +
- " [pc: 12, line: 6]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 13] local: this index: 0 type: X\n" +
+ " // Method descriptor #21 (LX;)V\n" +
+ " // Signature: (LX<TT;>;)V\n" +
+ " // Stack: 1, Locals: 2\n" +
+ " void foo(X xt);\n" +
+ " 0 aload_1 [xt]\n" +
+ " 1 invokevirtual X.get() : AA [23]\n" +
+ " 4 checkcast IB [25]\n" +
+ " 7 invokeinterface IB.baz() : void [27] [nargs: 1]\n" +
+ " 12 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 5]\n" +
+ " [pc: 12, line: 6]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 13] local: this index: 0 type: X\n" +
" [pc: 0, pc: 13] local: xt index: 1 type: X\n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -48662,41 +48662,41 @@ public void test1386() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T extends AA & p.IB> {\n" +
- " T get() { return null; }\n" +
- " \n" +
- " void foo(X<T> xt) {\n" +
- " xt.get().baz();\n" +
- " }\n" +
- "}\n" +
- "class AA {\n" +
- " void bar() {}\n" +
+ "public class X<T extends AA & p.IB> {\n" +
+ " T get() { return null; }\n" +
+ " \n" +
+ " void foo(X<T> xt) {\n" +
+ " xt.get().baz();\n" +
+ " }\n" +
+ "}\n" +
+ "class AA {\n" +
+ " void bar() {}\n" +
"}\n",
"p/IB.java", // =====================
"package p;\n" +
- "interface IA {\n" +
- " void baz();\n" +
- "}\n" +
- "public interface IB extends IA {\n" +
+ "interface IA {\n" +
+ " void baz();\n" +
+ "}\n" +
+ "public interface IB extends IA {\n" +
"}\n",
},
"");
// check #baz() invocation declaring class is not IA
String expectedOutput =
- " // Method descriptor #21 (LX;)V\n" +
- " // Signature: (LX<TT;>;)V\n" +
- " // Stack: 1, Locals: 2\n" +
- " void foo(X xt);\n" +
- " 0 aload_1 [xt]\n" +
- " 1 invokevirtual X.get() : AA [23]\n" +
- " 4 checkcast p.IB [25]\n" +
- " 7 invokeinterface p.IB.baz() : void [27] [nargs: 1]\n" +
- " 12 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 5]\n" +
- " [pc: 12, line: 6]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 13] local: this index: 0 type: X\n" +
+ " // Method descriptor #21 (LX;)V\n" +
+ " // Signature: (LX<TT;>;)V\n" +
+ " // Stack: 1, Locals: 2\n" +
+ " void foo(X xt);\n" +
+ " 0 aload_1 [xt]\n" +
+ " 1 invokevirtual X.get() : AA [23]\n" +
+ " 4 checkcast p.IB [25]\n" +
+ " 7 invokeinterface p.IB.baz() : void [27] [nargs: 1]\n" +
+ " 12 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 5]\n" +
+ " [pc: 12, line: 6]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 13] local: this index: 0 type: X\n" +
" [pc: 0, pc: 13] local: xt index: 1 type: X\n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -48717,48 +48717,48 @@ public void test1387() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T extends AA & p.IB> {\n" +
- " T t;\n" +
- " void foo() {\n" +
- " System.out.println(this.t.baz);\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X<CC> xcc = new X<CC>();\n" +
- " xcc.t = new CC();\n" +
- " xcc.foo();\n" +
- " }\n" +
- "}\n" +
- "class AA {\n" +
- " void bar() {}\n" +
- "}\n" +
- "class CC extends AA implements p.IB {\n" +
+ "public class X<T extends AA & p.IB> {\n" +
+ " T t;\n" +
+ " void foo() {\n" +
+ " System.out.println(this.t.baz);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X<CC> xcc = new X<CC>();\n" +
+ " xcc.t = new CC();\n" +
+ " xcc.foo();\n" +
+ " }\n" +
+ "}\n" +
+ "class AA {\n" +
+ " void bar() {}\n" +
+ "}\n" +
+ "class CC extends AA implements p.IB {\n" +
"}\n",
"p/IB.java", // =====================
"package p;\n" +
- "interface IA {\n" +
+ "interface IA {\n" +
" Object baz = \"done\";\n" +
- "}\n" +
- "public interface IB extends IA {\n" +
+ "}\n" +
+ "public interface IB extends IA {\n" +
"}\n",
},
"done");
// check #baz declaring class is not IA
String expectedOutput =
- " // Method descriptor #10 ()V\n" +
- " // Stack: 2, Locals: 1\n" +
- " void foo();\n" +
- " 0 getstatic java.lang.System.out : java.io.PrintStream [21]\n" +
- " 3 aload_0 [this]\n" +
- " 4 getfield X.t : AA [27]\n" +
- " 7 checkcast p.IB [29]\n" +
- " 10 pop\n" +
- " 11 getstatic p.IB.baz : java.lang.Object [31]\n" +
- " 14 invokevirtual java.io.PrintStream.println(java.lang.Object) : void [35]\n" +
- " 17 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 4]\n" +
- " [pc: 17, line: 5]\n" +
- " Local variable table:\n" +
+ " // Method descriptor #10 ()V\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " void foo();\n" +
+ " 0 getstatic java.lang.System.out : java.io.PrintStream [21]\n" +
+ " 3 aload_0 [this]\n" +
+ " 4 getfield X.t : AA [27]\n" +
+ " 7 checkcast p.IB [29]\n" +
+ " 10 pop\n" +
+ " 11 getstatic p.IB.baz : java.lang.Object [31]\n" +
+ " 14 invokevirtual java.io.PrintStream.println(java.lang.Object) : void [35]\n" +
+ " 17 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 4]\n" +
+ " [pc: 17, line: 5]\n" +
+ " Local variable table:\n" +
" [pc: 0, pc: 18] local: this index: 0 type: X\n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -48779,48 +48779,48 @@ public void test1388() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T extends AA & p.IB> {\n" +
- " T t;\n" +
- " void foo() {\n" +
- " System.out.println(t.baz);\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X<CC> xcc = new X<CC>();\n" +
- " xcc.t = new CC();\n" +
- " xcc.foo();\n" +
- " }\n" +
- "}\n" +
- "class AA {\n" +
- " void bar() {}\n" +
- "}\n" +
- "class CC extends AA implements p.IB {\n" +
+ "public class X<T extends AA & p.IB> {\n" +
+ " T t;\n" +
+ " void foo() {\n" +
+ " System.out.println(t.baz);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X<CC> xcc = new X<CC>();\n" +
+ " xcc.t = new CC();\n" +
+ " xcc.foo();\n" +
+ " }\n" +
+ "}\n" +
+ "class AA {\n" +
+ " void bar() {}\n" +
+ "}\n" +
+ "class CC extends AA implements p.IB {\n" +
"}\n",
"p/IB.java", // =====================
"package p;\n" +
- "interface IA {\n" +
+ "interface IA {\n" +
" Object baz = \"done\";\n" +
- "}\n" +
- "public interface IB extends IA {\n" +
+ "}\n" +
+ "public interface IB extends IA {\n" +
"}\n",
},
"done");
// check #baz declaring class is not IA
String expectedOutput =
- " // Method descriptor #10 ()V\n" +
- " // Stack: 2, Locals: 1\n" +
- " void foo();\n" +
- " 0 getstatic java.lang.System.out : java.io.PrintStream [21]\n" +
- " 3 aload_0 [this]\n" +
- " 4 getfield X.t : AA [27]\n" +
- " 7 checkcast p.IB [29]\n" +
- " 10 pop\n" +
- " 11 getstatic p.IB.baz : java.lang.Object [31]\n" +
- " 14 invokevirtual java.io.PrintStream.println(java.lang.Object) : void [35]\n" +
- " 17 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 4]\n" +
- " [pc: 17, line: 5]\n" +
- " Local variable table:\n" +
+ " // Method descriptor #10 ()V\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " void foo();\n" +
+ " 0 getstatic java.lang.System.out : java.io.PrintStream [21]\n" +
+ " 3 aload_0 [this]\n" +
+ " 4 getfield X.t : AA [27]\n" +
+ " 7 checkcast p.IB [29]\n" +
+ " 10 pop\n" +
+ " 11 getstatic p.IB.baz : java.lang.Object [31]\n" +
+ " 14 invokevirtual java.io.PrintStream.println(java.lang.Object) : void [35]\n" +
+ " 17 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 4]\n" +
+ " [pc: 17, line: 5]\n" +
+ " Local variable table:\n" +
" [pc: 0, pc: 18] local: this index: 0 type: X\n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -48840,37 +48840,37 @@ public void test1389() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X extends AA implements p.IB {\n" +
- " void foo() {\n" +
- " System.out.println(baz);\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new X().foo();\n" +
- " }\n" +
- "}\n" +
- "class AA {\n" +
- " void bar() {}\n" +
+ "public class X extends AA implements p.IB {\n" +
+ " void foo() {\n" +
+ " System.out.println(baz);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().foo();\n" +
+ " }\n" +
+ "}\n" +
+ "class AA {\n" +
+ " void bar() {}\n" +
"}\n",
"p/IB.java", // =====================
"package p;\n" +
- "interface IA {\n" +
+ "interface IA {\n" +
" Object baz = \"done\";\n" +
- "}\n" +
- "public interface IB extends IA {\n" +
+ "}\n" +
+ "public interface IB extends IA {\n" +
"}\n",
},
"done");
// check #baz declaring class is not IA
String expectedOutput =
- " // Method descriptor #8 ()V\n" +
- " // Stack: 2, Locals: 1\n" +
- " void foo();\n" +
- " 0 getstatic java.lang.System.out : java.io.PrintStream [17]\n" +
- " 3 getstatic X.baz : java.lang.Object [23]\n" +
- " 6 invokevirtual java.io.PrintStream.println(java.lang.Object) : void [27]\n" +
- " 9 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
+ " // Method descriptor #8 ()V\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " void foo();\n" +
+ " 0 getstatic java.lang.System.out : java.io.PrintStream [17]\n" +
+ " 3 getstatic X.baz : java.lang.Object [23]\n" +
+ " 6 invokevirtual java.io.PrintStream.println(java.lang.Object) : void [27]\n" +
+ " 9 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
" [pc: 9, line: 4]\n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -48889,70 +48889,70 @@ public void test1390() throws Exception {
this.runNegativeTest(
new String[] {
"X.java", //=================================
- "public class X<T extends SubX1<SubX2<T>>> {\n" +
- " T sx1() { return null; }\n" +
- " void foo(X<T> x0) {\n" +
- " x0.sx1().sx2().t().getClass();\n" +
- " }\n" +
- "}\n" +
- "interface X1<T extends SubX2<T>> {\n" +
- " T sx2();\n" +
- "}\n" +
- "abstract class SubX1<T extends SubX2<T>> implements X1<T> {\n" +
- "}\n" +
- "interface X2<T> {\n" +
- " T t();\n" +
- "}\n" +
- "abstract class SubX2<T> implements X2<T> {\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<T extends SubX1<SubX2<T>>> {\n" +
- " ^^^^^\n" +
- "Bound mismatch: The type SubX2<T> is not a valid substitute for the bounded parameter <T extends SubX2<T>> of the type SubX1<T>\n" +
+ "public class X<T extends SubX1<SubX2<T>>> {\n" +
+ " T sx1() { return null; }\n" +
+ " void foo(X<T> x0) {\n" +
+ " x0.sx1().sx2().t().getClass();\n" +
+ " }\n" +
+ "}\n" +
+ "interface X1<T extends SubX2<T>> {\n" +
+ " T sx2();\n" +
+ "}\n" +
+ "abstract class SubX1<T extends SubX2<T>> implements X1<T> {\n" +
+ "}\n" +
+ "interface X2<T> {\n" +
+ " T t();\n" +
+ "}\n" +
+ "abstract class SubX2<T> implements X2<T> {\n" +
+ "}\n",
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X<T extends SubX1<SubX2<T>>> {\n" +
+ " ^^^^^\n" +
+ "Bound mismatch: The type SubX2<T> is not a valid substitute for the bounded parameter <T extends SubX2<T>> of the type SubX1<T>\n" +
"----------\n");
}
public void test1391() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T extends SubX2<T>> {\n" +
- " T sx1() { return null; }\n" +
- " void foo(X<T> x0) {\n" +
- " x0.sx1().sx2().t().getClass();\n" +
- " }\n" +
- "}\n" +
- "interface X1<T extends SubX2<T>> {\n" +
- " T sx2();\n" +
- "}\n" +
- "abstract class SubX1<T extends SubX2<T>> implements X1<T> {\n" +
- "}\n" +
- "interface X2<T> {\n" +
- " T t();\n" +
- "}\n" +
- "abstract class SubX2<T extends SubX2<T>> implements X1<T>, X2<T> {\n" +
+ "public class X<T extends SubX2<T>> {\n" +
+ " T sx1() { return null; }\n" +
+ " void foo(X<T> x0) {\n" +
+ " x0.sx1().sx2().t().getClass();\n" +
+ " }\n" +
+ "}\n" +
+ "interface X1<T extends SubX2<T>> {\n" +
+ " T sx2();\n" +
+ "}\n" +
+ "abstract class SubX1<T extends SubX2<T>> implements X1<T> {\n" +
+ "}\n" +
+ "interface X2<T> {\n" +
+ " T t();\n" +
+ "}\n" +
+ "abstract class SubX2<T extends SubX2<T>> implements X1<T>, X2<T> {\n" +
"}\n",
},
"");
String expectedOutput =
- " // Method descriptor #21 (LX;)V\n" +
- " // Signature: (LX<TT;>;)V\n" +
- " // Stack: 1, Locals: 2\n" +
- " void foo(X x0);\n" +
- " 0 aload_1 [x0]\n" +
- " 1 invokevirtual X.sx1() : SubX2 [23]\n" +
- " 4 invokevirtual SubX2.sx2() : SubX2 [25]\n" +
- " 7 invokevirtual SubX2.t() : java.lang.Object [30]\n" +
- " 10 checkcast SubX2 [26]\n" +
- " 13 invokevirtual java.lang.Object.getClass() : java.lang.Class [34]\n" +
- " 16 pop\n" +
- " 17 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 4]\n" +
- " [pc: 17, line: 5]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 18] local: this index: 0 type: X\n" +
+ " // Method descriptor #21 (LX;)V\n" +
+ " // Signature: (LX<TT;>;)V\n" +
+ " // Stack: 1, Locals: 2\n" +
+ " void foo(X x0);\n" +
+ " 0 aload_1 [x0]\n" +
+ " 1 invokevirtual X.sx1() : SubX2 [23]\n" +
+ " 4 invokevirtual SubX2.sx2() : SubX2 [25]\n" +
+ " 7 invokevirtual SubX2.t() : java.lang.Object [30]\n" +
+ " 10 checkcast SubX2 [26]\n" +
+ " 13 invokevirtual java.lang.Object.getClass() : java.lang.Class [34]\n" +
+ " 16 pop\n" +
+ " 17 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 4]\n" +
+ " [pc: 17, line: 5]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 18] local: this index: 0 type: X\n" +
" [pc: 0, pc: 18] local: x0 index: 1 type: X\n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -48971,41 +48971,41 @@ public void test1392() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T extends SubX2<T>> {\n" +
- " T sx1;\n" +
- " void foo(X<T> x0) {\n" +
- " x0.sx1.sx2.t.getClass();\n" +
- " }\n" +
- "}\n" +
- "class X1<T extends SubX2<T>> {\n" +
- " T sx2;\n" +
- "}\n" +
- "abstract class SubX1<T extends SubX2<T>> extends X1<T> {\n" +
- "}\n" +
- "class X2<T extends SubX2<T>> extends X1<T>{\n" +
- " T t;\n" +
- "}\n" +
- "abstract class SubX2<T extends SubX2<T>> extends X2<T> {\n" +
+ "public class X<T extends SubX2<T>> {\n" +
+ " T sx1;\n" +
+ " void foo(X<T> x0) {\n" +
+ " x0.sx1.sx2.t.getClass();\n" +
+ " }\n" +
+ "}\n" +
+ "class X1<T extends SubX2<T>> {\n" +
+ " T sx2;\n" +
+ "}\n" +
+ "abstract class SubX1<T extends SubX2<T>> extends X1<T> {\n" +
+ "}\n" +
+ "class X2<T extends SubX2<T>> extends X1<T>{\n" +
+ " T t;\n" +
+ "}\n" +
+ "abstract class SubX2<T extends SubX2<T>> extends X2<T> {\n" +
"}\n",
},
"");
String expectedOutput =
- " // Method descriptor #21 (LX;)V\n" +
- " // Signature: (LX<TT;>;)V\n" +
- " // Stack: 1, Locals: 2\n" +
- " void foo(X x0);\n" +
- " 0 aload_1 [x0]\n" +
- " 1 getfield X.sx1 : SubX2 [23]\n" +
- " 4 getfield SubX2.sx2 : SubX2 [25]\n" +
- " 7 getfield SubX2.t : SubX2 [30]\n" +
- " 10 invokevirtual java.lang.Object.getClass() : java.lang.Class [33]\n" +
- " 13 pop\n" +
- " 14 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 4]\n" +
- " [pc: 14, line: 5]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 15] local: this index: 0 type: X\n" +
+ " // Method descriptor #21 (LX;)V\n" +
+ " // Signature: (LX<TT;>;)V\n" +
+ " // Stack: 1, Locals: 2\n" +
+ " void foo(X x0);\n" +
+ " 0 aload_1 [x0]\n" +
+ " 1 getfield X.sx1 : SubX2 [23]\n" +
+ " 4 getfield SubX2.sx2 : SubX2 [25]\n" +
+ " 7 getfield SubX2.t : SubX2 [30]\n" +
+ " 10 invokevirtual java.lang.Object.getClass() : java.lang.Class [33]\n" +
+ " 13 pop\n" +
+ " 14 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 4]\n" +
+ " [pc: 14, line: 5]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 15] local: this index: 0 type: X\n" +
" [pc: 0, pc: 15] local: x0 index: 1 type: X\n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -49024,43 +49024,43 @@ public void test1393() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T extends SubX2<T>> {\n" +
- " T sx1;\n" +
- " void foo(X<T> x0) {\n" +
- " x0.sx1.sx2.t.getClass();\n" +
- " }\n" +
- "}\n" +
- "interface X1<T extends X2<T>> {\n" +
- "}\n" +
- "abstract class SubX1<T extends X2<T>> implements X1<T> {\n" +
- " T sx2;\n" +
- "}\n" +
- "interface X2<T extends X2<T>> extends X1<T>{\n" +
- "}\n" +
- "abstract class SubX2<T extends X2<T>> extends SubX1<T> implements X2<T> {\n" +
- " T t;\n" +
+ "public class X<T extends SubX2<T>> {\n" +
+ " T sx1;\n" +
+ " void foo(X<T> x0) {\n" +
+ " x0.sx1.sx2.t.getClass();\n" +
+ " }\n" +
+ "}\n" +
+ "interface X1<T extends X2<T>> {\n" +
+ "}\n" +
+ "abstract class SubX1<T extends X2<T>> implements X1<T> {\n" +
+ " T sx2;\n" +
+ "}\n" +
+ "interface X2<T extends X2<T>> extends X1<T>{\n" +
+ "}\n" +
+ "abstract class SubX2<T extends X2<T>> extends SubX1<T> implements X2<T> {\n" +
+ " T t;\n" +
"}\n",
},
"");
String expectedOutput =
- " // Method descriptor #21 (LX;)V\n" +
- " // Signature: (LX<TT;>;)V\n" +
- " // Stack: 1, Locals: 2\n" +
- " void foo(X x0);\n" +
- " 0 aload_1 [x0]\n" +
- " 1 getfield X.sx1 : SubX2 [23]\n" +
- " 4 getfield SubX2.sx2 : X2 [25]\n" +
- " 7 checkcast SubX2 [26]\n" +
- " 10 getfield SubX2.t : X2 [31]\n" +
- " 13 checkcast SubX2 [26]\n" +
- " 16 invokevirtual java.lang.Object.getClass() : java.lang.Class [34]\n" +
- " 19 pop\n" +
- " 20 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 4]\n" +
- " [pc: 20, line: 5]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 21] local: this index: 0 type: X\n" +
+ " // Method descriptor #21 (LX;)V\n" +
+ " // Signature: (LX<TT;>;)V\n" +
+ " // Stack: 1, Locals: 2\n" +
+ " void foo(X x0);\n" +
+ " 0 aload_1 [x0]\n" +
+ " 1 getfield X.sx1 : SubX2 [23]\n" +
+ " 4 getfield SubX2.sx2 : X2 [25]\n" +
+ " 7 checkcast SubX2 [26]\n" +
+ " 10 getfield SubX2.t : X2 [31]\n" +
+ " 13 checkcast SubX2 [26]\n" +
+ " 16 invokevirtual java.lang.Object.getClass() : java.lang.Class [34]\n" +
+ " 19 pop\n" +
+ " 20 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 4]\n" +
+ " [pc: 20, line: 5]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 21] local: this index: 0 type: X\n" +
" [pc: 0, pc: 21] local: x0 index: 1 type: X\n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -49079,43 +49079,43 @@ public void test1394() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T extends SubX2<T>> {\n" +
- " T sx1(){return null;}\n" +
- " void foo(X<T> x0) {\n" +
- " x0.sx1().sx2().t().getClass();\n" +
- " }\n" +
- "}\n" +
- "interface X1<T extends X2<T>> {\n" +
- "}\n" +
- "abstract class SubX1<T extends X2<T>> implements X1<T> {\n" +
- " T sx2(){return null;}\n" +
- "}\n" +
- "interface X2<T extends X2<T>> extends X1<T>{\n" +
- "}\n" +
- "abstract class SubX2<T extends X2<T>> extends SubX1<T> implements X2<T> {\n" +
- " T t(){return null;}\n" +
+ "public class X<T extends SubX2<T>> {\n" +
+ " T sx1(){return null;}\n" +
+ " void foo(X<T> x0) {\n" +
+ " x0.sx1().sx2().t().getClass();\n" +
+ " }\n" +
+ "}\n" +
+ "interface X1<T extends X2<T>> {\n" +
+ "}\n" +
+ "abstract class SubX1<T extends X2<T>> implements X1<T> {\n" +
+ " T sx2(){return null;}\n" +
+ "}\n" +
+ "interface X2<T extends X2<T>> extends X1<T>{\n" +
+ "}\n" +
+ "abstract class SubX2<T extends X2<T>> extends SubX1<T> implements X2<T> {\n" +
+ " T t(){return null;}\n" +
"}\n",
},
"");
String expectedOutput =
- " // Method descriptor #21 (LX;)V\n" +
- " // Signature: (LX<TT;>;)V\n" +
- " // Stack: 1, Locals: 2\n" +
- " void foo(X x0);\n" +
- " 0 aload_1 [x0]\n" +
- " 1 invokevirtual X.sx1() : SubX2 [23]\n" +
- " 4 invokevirtual SubX2.sx2() : X2 [25]\n" +
- " 7 checkcast SubX2 [26]\n" +
- " 10 invokevirtual SubX2.t() : X2 [31]\n" +
- " 13 checkcast SubX2 [26]\n" +
- " 16 invokevirtual java.lang.Object.getClass() : java.lang.Class [34]\n" +
- " 19 pop\n" +
- " 20 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 4]\n" +
- " [pc: 20, line: 5]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 21] local: this index: 0 type: X\n" +
+ " // Method descriptor #21 (LX;)V\n" +
+ " // Signature: (LX<TT;>;)V\n" +
+ " // Stack: 1, Locals: 2\n" +
+ " void foo(X x0);\n" +
+ " 0 aload_1 [x0]\n" +
+ " 1 invokevirtual X.sx1() : SubX2 [23]\n" +
+ " 4 invokevirtual SubX2.sx2() : X2 [25]\n" +
+ " 7 checkcast SubX2 [26]\n" +
+ " 10 invokevirtual SubX2.t() : X2 [31]\n" +
+ " 13 checkcast SubX2 [26]\n" +
+ " 16 invokevirtual java.lang.Object.getClass() : java.lang.Class [34]\n" +
+ " 19 pop\n" +
+ " 20 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 4]\n" +
+ " [pc: 20, line: 5]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 21] local: this index: 0 type: X\n" +
" [pc: 0, pc: 21] local: x0 index: 1 type: X\n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -49134,43 +49134,43 @@ public void test1395() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T extends SubX2<T>> {\n" +
- " T sx1(){return null;}\n" +
- " void foo() {\n" +
- " this.sx1().sx2().t().getClass();\n" +
- " }\n" +
- "}\n" +
- "interface X1<T extends X2<T>> {\n" +
- "}\n" +
- "abstract class SubX1<T extends X2<T>> implements X1<T> {\n" +
- " T sx2(){return null;}\n" +
- "}\n" +
- "interface X2<T extends X2<T>> extends X1<T>{\n" +
- "}\n" +
- "abstract class SubX2<T extends X2<T>> extends SubX1<T> implements X2<T> {\n" +
- " T t(){return null;}\n" +
+ "public class X<T extends SubX2<T>> {\n" +
+ " T sx1(){return null;}\n" +
+ " void foo() {\n" +
+ " this.sx1().sx2().t().getClass();\n" +
+ " }\n" +
+ "}\n" +
+ "interface X1<T extends X2<T>> {\n" +
+ "}\n" +
+ "abstract class SubX1<T extends X2<T>> implements X1<T> {\n" +
+ " T sx2(){return null;}\n" +
+ "}\n" +
+ "interface X2<T extends X2<T>> extends X1<T>{\n" +
+ "}\n" +
+ "abstract class SubX2<T extends X2<T>> extends SubX1<T> implements X2<T> {\n" +
+ " T t(){return null;}\n" +
"}\n",
},
"");
String expectedOutput =
- " // Method descriptor #6 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " void foo();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokevirtual X.sx1() : SubX2 [21]\n" +
- " 4 invokevirtual SubX2.sx2() : X2 [23]\n" +
- " 7 checkcast SubX2 [24]\n" +
- " 10 invokevirtual SubX2.t() : X2 [29]\n" +
- " 13 checkcast SubX2 [24]\n" +
- " 16 invokevirtual java.lang.Object.getClass() : java.lang.Class [32]\n" +
- " 19 pop\n" +
- " 20 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 4]\n" +
- " [pc: 20, line: 5]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 21] local: this index: 0 type: X\n" +
- " Local variable type table:\n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " void foo();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokevirtual X.sx1() : SubX2 [21]\n" +
+ " 4 invokevirtual SubX2.sx2() : X2 [23]\n" +
+ " 7 checkcast SubX2 [24]\n" +
+ " 10 invokevirtual SubX2.t() : X2 [29]\n" +
+ " 13 checkcast SubX2 [24]\n" +
+ " 16 invokevirtual java.lang.Object.getClass() : java.lang.Class [32]\n" +
+ " 19 pop\n" +
+ " 20 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 4]\n" +
+ " [pc: 20, line: 5]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 21] local: this index: 0 type: X\n" +
+ " Local variable type table:\n" +
" [pc: 0, pc: 21] local: this index: 0 type: X<T>\n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -49189,42 +49189,42 @@ public void test1396() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T extends SubX2<T>> {\n" +
- " T sx1;\n" +
- " void foo(T t) {\n" +
- " t.sx2.t.getClass();\n" +
- " }\n" +
- "}\n" +
- "interface X1<T extends X2<T>> {\n" +
- "}\n" +
- "abstract class SubX1<T extends X2<T>> implements X1<T> {\n" +
- " T sx2;\n" +
- "}\n" +
- "interface X2<T extends X2<T>> extends X1<T>{\n" +
- "}\n" +
- "abstract class SubX2<T extends X2<T>> extends SubX1<T> implements X2<T> {\n" +
- " T t;\n" +
+ "public class X<T extends SubX2<T>> {\n" +
+ " T sx1;\n" +
+ " void foo(T t) {\n" +
+ " t.sx2.t.getClass();\n" +
+ " }\n" +
+ "}\n" +
+ "interface X1<T extends X2<T>> {\n" +
+ "}\n" +
+ "abstract class SubX1<T extends X2<T>> implements X1<T> {\n" +
+ " T sx2;\n" +
+ "}\n" +
+ "interface X2<T extends X2<T>> extends X1<T>{\n" +
+ "}\n" +
+ "abstract class SubX2<T extends X2<T>> extends SubX1<T> implements X2<T> {\n" +
+ " T t;\n" +
"}\n",
},
"");
String expectedOutput =
- " // Method descriptor #21 (LSubX2;)V\n" +
- " // Signature: (TT;)V\n" +
- " // Stack: 1, Locals: 2\n" +
- " void foo(SubX2 t);\n" +
- " 0 aload_1 [t]\n" +
- " 1 getfield SubX2.sx2 : X2 [23]\n" +
- " 4 checkcast SubX2 [24]\n" +
- " 7 getfield SubX2.t : X2 [29]\n" +
- " 10 checkcast SubX2 [24]\n" +
- " 13 invokevirtual java.lang.Object.getClass() : java.lang.Class [32]\n" +
- " 16 pop\n" +
- " 17 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 4]\n" +
- " [pc: 17, line: 5]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 18] local: this index: 0 type: X\n" +
+ " // Method descriptor #21 (LSubX2;)V\n" +
+ " // Signature: (TT;)V\n" +
+ " // Stack: 1, Locals: 2\n" +
+ " void foo(SubX2 t);\n" +
+ " 0 aload_1 [t]\n" +
+ " 1 getfield SubX2.sx2 : X2 [23]\n" +
+ " 4 checkcast SubX2 [24]\n" +
+ " 7 getfield SubX2.t : X2 [29]\n" +
+ " 10 checkcast SubX2 [24]\n" +
+ " 13 invokevirtual java.lang.Object.getClass() : java.lang.Class [32]\n" +
+ " 16 pop\n" +
+ " 17 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 4]\n" +
+ " [pc: 17, line: 5]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 18] local: this index: 0 type: X\n" +
" [pc: 0, pc: 18] local: t index: 1 type: SubX2\n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -49244,10 +49244,10 @@ public void _test1397() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "class A { }\n" +
- "class B<T> { }\n" +
- "class C<U> extends B<B<? super C<C<U>>>> {\n" +
- " B<? super C<A>> foo(C<A> c) { return c; }\n" +
+ "class A { }\n" +
+ "class B<T> { }\n" +
+ "class C<U> extends B<B<? super C<C<U>>>> {\n" +
+ " B<? super C<A>> foo(C<A> c) { return c; }\n" +
"}\n",
},
"");
@@ -49257,18 +49257,18 @@ public void test1398() throws Exception {
this.runNegativeTest(
new String[] {
"A.java",
- "public class A<T> {\n" +
- " void f() {\n" +
- " boolean b=null instanceof A; \n" +
+ "public class A<T> {\n" +
+ " void f() {\n" +
+ " boolean b=null instanceof A; \n" +
" Zork z;\n" +
- " }\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in A.java (at line 4)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 4)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=252120 - variation
@@ -49276,18 +49276,18 @@ public void test1399() throws Exception {
this.runNegativeTest(
new String[] {
"A.java",
- "public class A<T> {\n" +
- " void f() {\n" +
- " boolean b=null instanceof A<?>; \n" +
+ "public class A<T> {\n" +
+ " void f() {\n" +
+ " boolean b=null instanceof A<?>; \n" +
" Zork z;\n" +
- " }\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in A.java (at line 4)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 4)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=252120 - variation
@@ -49295,28 +49295,28 @@ public void test1400() throws Exception {
this.runNegativeTest(
new String[] {
"A.java",
- "public class A<T> {\n" +
- " void f() {\n" +
- " Object o = (A)this; \n" +
+ "public class A<T> {\n" +
+ " void f() {\n" +
+ " Object o = (A)this; \n" +
" Zork z;\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. WARNING in A.java (at line 3)\n" +
- " Object o = (A)this; \n" +
- " ^^^^^^^\n" +
- "Unnecessary cast from A<T> to A\n" +
- "----------\n" +
- "2. WARNING in A.java (at line 3)\n" +
- " Object o = (A)this; \n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in A.java (at line 4)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ " }\n" +
+ "}\n",
+ },
+ "----------\n" +
+ "1. WARNING in A.java (at line 3)\n" +
+ " Object o = (A)this; \n" +
+ " ^^^^^^^\n" +
+ "Unnecessary cast from A<T> to A\n" +
+ "----------\n" +
+ "2. WARNING in A.java (at line 3)\n" +
+ " Object o = (A)this; \n" +
+ " ^\n" +
+ "A is a raw type. References to generic type A<T> should be parameterized\n" +
+ "----------\n" +
+ "3. ERROR in A.java (at line 4)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=252120 - variation
@@ -49324,23 +49324,23 @@ public void test1401() throws Exception {
this.runNegativeTest(
new String[] {
"A.java",
- "public class A<T> {\n" +
- " void f() {\n" +
- " Object o = (A<?>)this; \n" +
+ "public class A<T> {\n" +
+ " void f() {\n" +
+ " Object o = (A<?>)this; \n" +
" Zork z;\n" +
- " }\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in A.java (at line 3)\n" +
- " Object o = (A<?>)this; \n" +
- " ^^^^^^^^^^\n" +
- "Unnecessary cast from A<T> to A<?>\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 4)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in A.java (at line 3)\n" +
+ " Object o = (A<?>)this; \n" +
+ " ^^^^^^^^^^\n" +
+ "Unnecessary cast from A<T> to A<?>\n" +
+ "----------\n" +
+ "2. ERROR in A.java (at line 4)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=252120 - variation
@@ -49348,18 +49348,18 @@ public void test1402() throws Exception {
this.runNegativeTest(
new String[] {
"A.java",
- "public class A<T> {\n" +
- " void f() {\n" +
- " Class<?> c = A.class; \n" +
+ "public class A<T> {\n" +
+ " void f() {\n" +
+ " Class<?> c = A.class; \n" +
" Zork z;\n" +
- " }\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in A.java (at line 4)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 4)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=252120 - variation
@@ -49367,27 +49367,27 @@ public void test1403() throws Exception {
this.runNegativeTest(
new String[] {
"A.java",
- "public class A<T> {\n" +
- " void f() {\n" +
- " Class<?> c = A<?>.class; \n" +
+ "public class A<T> {\n" +
+ " void f() {\n" +
+ " Class<?> c = A<?>.class; \n" +
" Zork z;\n" +
- " }\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in A.java (at line 3)\n" +
- " Class<?> c = A<?>.class; \n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 3)\n" +
+ " Class<?> c = A<?>.class; \n" +
//{ObjectTeams: we specifically have a rule that allows A<@t>.class
/* orig:
- " ^\n" +
- "Syntax error on token \"=\", ( expected after this token\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 3)\n" +
- " Class<?> c = A<?>.class; \n" +
- " ^^^\n" +
+ " ^\n" +
+ "Syntax error on token \"=\", ( expected after this token\n" +
+ "----------\n" +
+ "2. ERROR in A.java (at line 3)\n" +
+ " Class<?> c = A<?>.class; \n" +
+ " ^^^\n" +
:giro */
- " ^\n" +
- "Syntax error on token \"?\", invalid typeAnchor\n" +
+ " ^\n" +
+ "Syntax error on token \"?\", invalid typeAnchor\n" +
// SH}
"----------\n");
}
@@ -49397,16 +49397,16 @@ public void test1404() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<A> {\n" +
- " A get() { return null; }\n" +
- " <B extends Comparable<B>> X<B> bar() {\n" +
- " return null;\n" +
- " }\n" +
- " void foo() {\n" +
- " bar(); // 0 rejected\n" +
- " X raw = bar(); // 1 accepted\n" +
- " X<?> wild = bar(); // 2 rejected\n" +
- " }\n" +
+ "public class X<A> {\n" +
+ " A get() { return null; }\n" +
+ " <B extends Comparable<B>> X<B> bar() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " void foo() {\n" +
+ " bar(); // 0 rejected\n" +
+ " X raw = bar(); // 1 accepted\n" +
+ " X<?> wild = bar(); // 2 rejected\n" +
+ " }\n" +
"}\n",
});
}
@@ -49415,442 +49415,442 @@ public void test1405() throws Exception {
this.runNegativeTest(
new String[] {
"X.java",
- "import java.util.*;\n" +
- "public class X {\n" +
- " X(List rawList, List<?> unboundList) {\n" +
- " Throwable t0 = (Throwable) Collections.emptyList();\n" +
- " Throwable t1 = (Throwable) rawList;\n" +
- " Throwable t2 = (Throwable) unboundList;\n" +
- " Map m0 = (Map) Collections.emptyList();\n" +
- " Map m1 = (Map) rawList;\n" +
- " Map m2 = (Map) unboundList;\n" +
- " Zork z;\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " X(List rawList, List<?> unboundList) {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " Map m0 = (Map) Collections.emptyList();\n" +
- " ^^^\n" +
- "Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 7)\n" +
- " Map m0 = (Map) Collections.emptyList();\n" +
- " ^^^\n" +
- "Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 8)\n" +
- " Map m1 = (Map) rawList;\n" +
- " ^^^\n" +
- "Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 8)\n" +
- " Map m1 = (Map) rawList;\n" +
- " ^^^\n" +
- "Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 9)\n" +
- " Map m2 = (Map) unboundList;\n" +
- " ^^^\n" +
- "Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 9)\n" +
- " Map m2 = (Map) unboundList;\n" +
- " ^^^\n" +
- "Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 10)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "import java.util.*;\n" +
+ "public class X {\n" +
+ " X(List rawList, List<?> unboundList) {\n" +
+ " Throwable t0 = (Throwable) Collections.emptyList();\n" +
+ " Throwable t1 = (Throwable) rawList;\n" +
+ " Throwable t2 = (Throwable) unboundList;\n" +
+ " Map m0 = (Map) Collections.emptyList();\n" +
+ " Map m1 = (Map) rawList;\n" +
+ " Map m2 = (Map) unboundList;\n" +
+ " Zork z;\n" +
+ " }\n" +
+ "}\n",
+ },
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " X(List rawList, List<?> unboundList) {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " Map m0 = (Map) Collections.emptyList();\n" +
+ " ^^^\n" +
+ "Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 7)\n" +
+ " Map m0 = (Map) Collections.emptyList();\n" +
+ " ^^^\n" +
+ "Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 8)\n" +
+ " Map m1 = (Map) rawList;\n" +
+ " ^^^\n" +
+ "Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 8)\n" +
+ " Map m1 = (Map) rawList;\n" +
+ " ^^^\n" +
+ "Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 9)\n" +
+ " Map m2 = (Map) unboundList;\n" +
+ " ^^^\n" +
+ "Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 9)\n" +
+ " Map m2 = (Map) unboundList;\n" +
+ " ^^^\n" +
+ "Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 10)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
public void test1406() {
this.runNegativeTest(
new String[] {
"GenericTest.java", //-----------------------------------------------------------------------
- "import java.util.*;\n" +
- "\n" +
- "public class GenericTest {\n" +
- " public static void test() {\n" +
- " Set testList = GenericTest.method1(new Class[] { ArrayList.class });\n" +
- " }\n" +
- " \n" +
- " public static <I> I method1(Class<List>[] params) {\n" +
- " return null;\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "\n" +
+ "public class GenericTest {\n" +
+ " public static void test() {\n" +
+ " Set testList = GenericTest.method1(new Class[] { ArrayList.class });\n" +
+ " }\n" +
+ " \n" +
+ " public static <I> I method1(Class<List>[] params) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. WARNING in GenericTest.java (at line 5)\n" +
- " Set testList = GenericTest.method1(new Class[] { ArrayList.class });\n" +
- " ^^^\n" +
- "Set is a raw type. References to generic type Set<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in GenericTest.java (at line 5)\n" +
- " Set testList = GenericTest.method1(new Class[] { ArrayList.class });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation method1(Class[]) of the generic method method1(Class<List>[]) of type GenericTest\n" +
- "----------\n" +
- "3. WARNING in GenericTest.java (at line 5)\n" +
- " Set testList = GenericTest.method1(new Class[] { ArrayList.class });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Class[] needs unchecked conversion to conform to Class<List>[]\n" +
- "----------\n" +
- "4. WARNING in GenericTest.java (at line 8)\n" +
- " public static <I> I method1(Class<List>[] params) {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in GenericTest.java (at line 5)\n" +
+ " Set testList = GenericTest.method1(new Class[] { ArrayList.class });\n" +
+ " ^^^\n" +
+ "Set is a raw type. References to generic type Set<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in GenericTest.java (at line 5)\n" +
+ " Set testList = GenericTest.method1(new Class[] { ArrayList.class });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation method1(Class[]) of the generic method method1(Class<List>[]) of type GenericTest\n" +
+ "----------\n" +
+ "3. WARNING in GenericTest.java (at line 5)\n" +
+ " Set testList = GenericTest.method1(new Class[] { ArrayList.class });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Class[] needs unchecked conversion to conform to Class<List>[]\n" +
+ "----------\n" +
+ "4. WARNING in GenericTest.java (at line 8)\n" +
+ " public static <I> I method1(Class<List>[] params) {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
"----------\n" :
- "----------\n" +
- "1. WARNING in GenericTest.java (at line 5)\n" +
- " Set testList = GenericTest.method1(new Class[] { ArrayList.class });\n" +
- " ^^^\n" +
- "Set is a raw type. References to generic type Set<E> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in GenericTest.java (at line 5)\n" +
- " Set testList = GenericTest.method1(new Class[] { ArrayList.class });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Object to Set\n" +
"----------\n" +
- "3. WARNING in GenericTest.java (at line 8)\n" +
- " public static <I> I method1(Class<List>[] params) {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "1. WARNING in GenericTest.java (at line 5)\n" +
+ " Set testList = GenericTest.method1(new Class[] { ArrayList.class });\n" +
+ " ^^^\n" +
+ "Set is a raw type. References to generic type Set<E> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in GenericTest.java (at line 5)\n" +
+ " Set testList = GenericTest.method1(new Class[] { ArrayList.class });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Object to Set\n" +
+ "----------\n" +
+ "3. WARNING in GenericTest.java (at line 8)\n" +
+ " public static <I> I method1(Class<List>[] params) {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
"----------\n");
}
public void test1407() {
this.runNegativeTest(
new String[] {
"Foo.java", //-----------------------------------------------------------------------
- "public class Foo {\n" +
- " public static <I> I m1(Class<Foo> c) { return null; }\n" +
- " void bar() {\n" +
- " Foo l1 = m1((Class)Foo.class);\n" +
- " }\n" +
+ "public class Foo {\n" +
+ " public static <I> I m1(Class<Foo> c) { return null; }\n" +
+ " void bar() {\n" +
+ " Foo l1 = m1((Class)Foo.class);\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. WARNING in Foo.java (at line 4)\n" +
- " Foo l1 = m1((Class)Foo.class);\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation m1(Class) of the generic method m1(Class<Foo>) of type Foo\n" +
- "----------\n" +
- "2. WARNING in Foo.java (at line 4)\n" +
- " Foo l1 = m1((Class)Foo.class);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Class needs unchecked conversion to conform to Class<Foo>\n" +
- "----------\n" +
- "3. WARNING in Foo.java (at line 4)\n" +
- " Foo l1 = m1((Class)Foo.class);\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n" :
- "----------\n" +
- "1. WARNING in Foo.java (at line 4)\n" +
- " Foo l1 = m1((Class)Foo.class);\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in Foo.java (at line 4)\n" +
- " Foo l1 = m1((Class)Foo.class);\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Object to Foo\n" +
+ "----------\n" +
+ "1. WARNING in Foo.java (at line 4)\n" +
+ " Foo l1 = m1((Class)Foo.class);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation m1(Class) of the generic method m1(Class<Foo>) of type Foo\n" +
+ "----------\n" +
+ "2. WARNING in Foo.java (at line 4)\n" +
+ " Foo l1 = m1((Class)Foo.class);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Class needs unchecked conversion to conform to Class<Foo>\n" +
+ "----------\n" +
+ "3. WARNING in Foo.java (at line 4)\n" +
+ " Foo l1 = m1((Class)Foo.class);\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" :
+ "----------\n" +
+ "1. WARNING in Foo.java (at line 4)\n" +
+ " Foo l1 = m1((Class)Foo.class);\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in Foo.java (at line 4)\n" +
+ " Foo l1 = m1((Class)Foo.class);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Object to Foo\n" +
"----------\n");
}
public void test1408() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "import java.util.*;\n" +
- "public class X {\n" +
- " void foo(Collection<? extends X> i) {\n" +
- " Zork z = (List<? extends X>) i;\n" +
- " }\n" +
- " void bar(List<? extends X> i) {\n" +
- " Zork z = (ArrayList<? extends X>) i;\n" +
- " } \n" +
+ "import java.util.*;\n" +
+ "public class X {\n" +
+ " void foo(Collection<? extends X> i) {\n" +
+ " Zork z = (List<? extends X>) i;\n" +
+ " }\n" +
+ " void bar(List<? extends X> i) {\n" +
+ " Zork z = (ArrayList<? extends X>) i;\n" +
+ " } \n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " Zork z = (List<? extends X>) i;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " Zork z = (ArrayList<? extends X>) i;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " Zork z = (List<? extends X>) i;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " Zork z = (ArrayList<? extends X>) i;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
public void test1409() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "import java.util.*;\n" +
- "public class X {\n" +
- " void foo(List<X> lx, List<?> lw) {\n" +
- " LinkedList<Object> lo = (LinkedList<Object>) lx;\n" +
- " LinkedList<String> ls = (LinkedList<String>) lw;\n" +
- " }\n" +
- " void bar(List<X> lx, List<Integer> li) {\n" +
- " LinkedList<? extends Object> lo = (LinkedList<? extends Object>) lx;\n" +
- " LinkedList<? extends Number> ln = (LinkedList<? extends Number>) li; \n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "public class X {\n" +
+ " void foo(List<X> lx, List<?> lw) {\n" +
+ " LinkedList<Object> lo = (LinkedList<Object>) lx;\n" +
+ " LinkedList<String> ls = (LinkedList<String>) lw;\n" +
+ " }\n" +
+ " void bar(List<X> lx, List<Integer> li) {\n" +
+ " LinkedList<? extends Object> lo = (LinkedList<? extends Object>) lx;\n" +
+ " LinkedList<? extends Number> ln = (LinkedList<? extends Number>) li; \n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " LinkedList<Object> lo = (LinkedList<Object>) lx;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot cast from List<X> to LinkedList<Object>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " LinkedList<String> ls = (LinkedList<String>) lw;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from List<capture#1-of ?> to LinkedList<String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " LinkedList<Object> lo = (LinkedList<Object>) lx;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot cast from List<X> to LinkedList<Object>\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " LinkedList<String> ls = (LinkedList<String>) lw;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from List<capture#1-of ?> to LinkedList<String>\n" +
"----------\n");
}
public void test1410() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "interface I<T> {}\n" +
- "class Y<T> implements I<T> {}\n" +
- "public class X {\n" +
- " I<Short>[] x = null;\n" +
- " Y<? extends Number>[] y1 = (Y<? extends Number>[]) x;\n" +
- " Y<? extends Number> y2 = (Y<? extends Number>) x[0];\n" +
- " Y<? extends X>[] y3 = (Y<? extends X>[]) x;\n" +
+ "interface I<T> {}\n" +
+ "class Y<T> implements I<T> {}\n" +
+ "public class X {\n" +
+ " I<Short>[] x = null;\n" +
+ " Y<? extends Number>[] y1 = (Y<? extends Number>[]) x;\n" +
+ " Y<? extends Number> y2 = (Y<? extends Number>) x[0];\n" +
+ " Y<? extends X>[] y3 = (Y<? extends X>[]) x;\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " Y<? extends X>[] y3 = (Y<? extends X>[]) x;\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot cast from I<Short>[] to Y<? extends X>[]\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " Y<? extends X>[] y3 = (Y<? extends X>[]) x;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot cast from I<Short>[] to Y<? extends X>[]\n" +
"----------\n");
}
public void test1411() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "public class X<T> {\n" +
- " static class Child extends X<Object> { }\n" +
- " static <U> X<U> create() {\n" +
- " Child child = new Child();\n" +
- " child.set(new Object());\n" +
- " return (X<U>) child;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X<Number> c = create();\n" +
- " Number n = c.get();\n" +
- " }\n" +
- " T t;\n" +
- " void set(T t) {\n" +
- " this.t = t;\n" +
- " }\n" +
- " T get() {\n" +
- " return t;\n" +
- " }\n" +
- " static X<Object> willWarn = new X<Object>();\n" +
- " static <U> X<U> raisesTheWarning() {\n" +
- " return (X<U>) willWarn;\n" +
- " }\n" +
- " Zork z;\n" +
+ "public class X<T> {\n" +
+ " static class Child extends X<Object> { }\n" +
+ " static <U> X<U> create() {\n" +
+ " Child child = new Child();\n" +
+ " child.set(new Object());\n" +
+ " return (X<U>) child;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X<Number> c = create();\n" +
+ " Number n = c.get();\n" +
+ " }\n" +
+ " T t;\n" +
+ " void set(T t) {\n" +
+ " this.t = t;\n" +
+ " }\n" +
+ " T get() {\n" +
+ " return t;\n" +
+ " }\n" +
+ " static X<Object> willWarn = new X<Object>();\n" +
+ " static <U> X<U> raisesTheWarning() {\n" +
+ " return (X<U>) willWarn;\n" +
+ " }\n" +
+ " Zork z;\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " return (X<U>) child;\n" +
- " ^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from X.Child to X<U>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 21)\n" +
- " return (X<U>) willWarn;\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from X<Object> to X<U>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 23)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " return (X<U>) child;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from X.Child to X<U>\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 21)\n" +
+ " return (X<U>) willWarn;\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from X<Object> to X<U>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 23)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
public void test1412() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "import java.util.List;\n" +
- "class A<T> {\n" +
- " List<String> foo() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "class B<U> {\n" +
- " A a1 = new A<U>();\n" +
- " A<?> a2 = new A<U>();\n" +
- "}\n" +
- "class X {\n" +
- " void bar() {\n" +
- " B<X> bx = new B<X>();\n" +
- " List<String> s1 = bx.a1.foo();\n" +
- " List<String> s2 = bx.a2.foo();\n" +
- " Zork z;\n" +
- " }\n" +
+ "import java.util.List;\n" +
+ "class A<T> {\n" +
+ " List<String> foo() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "class B<U> {\n" +
+ " A a1 = new A<U>();\n" +
+ " A<?> a2 = new A<U>();\n" +
+ "}\n" +
+ "class X {\n" +
+ " void bar() {\n" +
+ " B<X> bx = new B<X>();\n" +
+ " List<String> s1 = bx.a1.foo();\n" +
+ " List<String> s2 = bx.a2.foo();\n" +
+ " Zork z;\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " A a1 = new A<U>();\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 14)\n" +
- " List<String> s1 = bx.a1.foo();\n" +
- " ^^^^^^^^^^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<String>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 16)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " A a1 = new A<U>();\n" +
+ " ^\n" +
+ "A is a raw type. References to generic type A<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 14)\n" +
+ " List<String> s1 = bx.a1.foo();\n" +
+ " ^^^^^^^^^^^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<String>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 16)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
public void test1413() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "import java.util.*;\n" +
- "public class X {\n" +
- " HashMap <String, ArrayList> m = new HashMap<String, ArrayList>();\n" +
- " ArrayList <X> ax = m.get(\"\");\n" +
- " Zork z;\n" +
+ "import java.util.*;\n" +
+ "public class X {\n" +
+ " HashMap <String, ArrayList> m = new HashMap<String, ArrayList>();\n" +
+ " ArrayList <X> ax = m.get(\"\");\n" +
+ " Zork z;\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " HashMap <String, ArrayList> m = new HashMap<String, ArrayList>();\n" +
- " ^^^^^^^^^\n" +
- "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " HashMap <String, ArrayList> m = new HashMap<String, ArrayList>();\n" +
- " ^^^^^^^^^\n" +
- "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 4)\n" +
- " ArrayList <X> ax = m.get(\"\");\n" +
- " ^^^^^^^^^\n" +
- "Type safety: The expression of type ArrayList needs unchecked conversion to conform to ArrayList<X>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " HashMap <String, ArrayList> m = new HashMap<String, ArrayList>();\n" +
+ " ^^^^^^^^^\n" +
+ "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " HashMap <String, ArrayList> m = new HashMap<String, ArrayList>();\n" +
+ " ^^^^^^^^^\n" +
+ "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 4)\n" +
+ " ArrayList <X> ax = m.get(\"\");\n" +
+ " ^^^^^^^^^\n" +
+ "Type safety: The expression of type ArrayList needs unchecked conversion to conform to ArrayList<X>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
public void test1414() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "interface A<T> {}\n" +
- "class B<T> {}\n" +
- "public class X {\n" +
- " A<?> a = null;\n" +
- " B y = (B)a;\n" +
- " Zork z;\n" +
+ "interface A<T> {}\n" +
+ "class B<T> {}\n" +
+ "public class X {\n" +
+ " A<?> a = null;\n" +
+ " B y = (B)a;\n" +
+ " Zork z;\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " B y = (B)a;\n" +
- " ^\n" +
- "B is a raw type. References to generic type B<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " B y = (B)a;\n" +
- " ^\n" +
- "B is a raw type. References to generic type B<T> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " B y = (B)a;\n" +
+ " ^\n" +
+ "B is a raw type. References to generic type B<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " B y = (B)a;\n" +
+ " ^\n" +
+ "B is a raw type. References to generic type B<T> should be parameterized\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
public void test1415() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "public class X {\n" +
- " <T, U extends T, V extends T> T foo(boolean b, U u, V v) {\n" +
- " return b ? (T) u: v;\n" +
- " }\n" +
- " Zork z;\n" +
+ "public class X {\n" +
+ " <T, U extends T, V extends T> T foo(boolean b, U u, V v) {\n" +
+ " return b ? (T) u: v;\n" +
+ " }\n" +
+ " Zork z;\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
public void test1416() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "interface A {}\n" +
- "interface B<RELATED extends A> extends A {}\n" +
- "interface C<RELATED extends A, SOURCE extends RELATED> extends B<RELATED> {}\n" +
- "interface D<RELATED extends A, SOURCE extends B<?>> extends C<RELATED, SOURCE> {}\n" +
- "interface E<RELATED extends B<?>, SOURCE extends RELATED> extends C<RELATED, SOURCE> {}\n" +
- "public class X {\n" +
- " C<B<?>,C<?,?>> ok;\n" +
- " C<C<?,?>,B<?>> wrong;\n" +
+ "interface A {}\n" +
+ "interface B<RELATED extends A> extends A {}\n" +
+ "interface C<RELATED extends A, SOURCE extends RELATED> extends B<RELATED> {}\n" +
+ "interface D<RELATED extends A, SOURCE extends B<?>> extends C<RELATED, SOURCE> {}\n" +
+ "interface E<RELATED extends B<?>, SOURCE extends RELATED> extends C<RELATED, SOURCE> {}\n" +
+ "public class X {\n" +
+ " C<B<?>,C<?,?>> ok;\n" +
+ " C<C<?,?>,B<?>> wrong;\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " interface D<RELATED extends A, SOURCE extends B<?>> extends C<RELATED, SOURCE> {}\n" +
- " ^^^^^^\n" +
- "Bound mismatch: The type SOURCE is not a valid substitute for the bounded parameter <SOURCE extends RELATED> of the type C<RELATED,SOURCE>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " C<C<?,?>,B<?>> wrong;\n" +
- " ^\n" +
- "Bound mismatch: The type B<?> is not a valid substitute for the bounded parameter <SOURCE extends RELATED> of the type C<RELATED,SOURCE>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " interface D<RELATED extends A, SOURCE extends B<?>> extends C<RELATED, SOURCE> {}\n" +
+ " ^^^^^^\n" +
+ "Bound mismatch: The type SOURCE is not a valid substitute for the bounded parameter <SOURCE extends RELATED> of the type C<RELATED,SOURCE>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " C<C<?,?>,B<?>> wrong;\n" +
+ " ^\n" +
+ "Bound mismatch: The type B<?> is not a valid substitute for the bounded parameter <SOURCE extends RELATED> of the type C<RELATED,SOURCE>\n" +
"----------\n");
}
public void test1417() {
this.runConformTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "class XSuper {\n" +
- " protected void bar() {}\n" +
- "}\n" +
- "interface I {\n" +
- " void baz();\n" +
- "}\n" +
- "public class X extends XSuper implements I{\n" +
- " public void baz() {}\n" +
- " public static void main(String argv[]) {\n" +
- " testMethod(new X());\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " static <T extends XSuper & I, U extends T> void testMethod(U u) {\n" +
- " u.baz();\n" +
- " u.bar();\n" +
- " }\n" +
+ "class XSuper {\n" +
+ " protected void bar() {}\n" +
+ "}\n" +
+ "interface I {\n" +
+ " void baz();\n" +
+ "}\n" +
+ "public class X extends XSuper implements I{\n" +
+ " public void baz() {}\n" +
+ " public static void main(String argv[]) {\n" +
+ " testMethod(new X());\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " }\n" +
+ " static <T extends XSuper & I, U extends T> void testMethod(U u) {\n" +
+ " u.baz();\n" +
+ " u.bar();\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
"SUCCESS");
@@ -49860,42 +49860,42 @@ public void test1418() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "class Box<U extends Box<?, ?>, V extends U> {\n" +
- " V value;\n" +
- " Box<U, V> next;\n" +
- " Box(V value) {\n" +
- " this.value = value;\n" +
- " }\n" +
- " Box() {}\n" +
- "}\n" +
- "class A extends Box<A, A> {}\n" +
- "class B extends Box<B, B> {}\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Box<Box<A, A>, Box<A, A>> a = new Box<Box<A, A>, Box<A, A>>(new Box<A, A>(new A()));\n" +
- " Box<?, ?> b = a;\n" +
- " b.value.next = new Box<B, B>(new B());\n" +
- " A c = a.value.next.value;\n" +
- " String s = b.value;\n" +
- " b.value.next.next = new Box<B, B>(new B());\n" +
- " }\n" +
+ "class Box<U extends Box<?, ?>, V extends U> {\n" +
+ " V value;\n" +
+ " Box<U, V> next;\n" +
+ " Box(V value) {\n" +
+ " this.value = value;\n" +
+ " }\n" +
+ " Box() {}\n" +
+ "}\n" +
+ "class A extends Box<A, A> {}\n" +
+ "class B extends Box<B, B> {}\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Box<Box<A, A>, Box<A, A>> a = new Box<Box<A, A>, Box<A, A>>(new Box<A, A>(new A()));\n" +
+ " Box<?, ?> b = a;\n" +
+ " b.value.next = new Box<B, B>(new B());\n" +
+ " A c = a.value.next.value;\n" +
+ " String s = b.value;\n" +
+ " b.value.next.next = new Box<B, B>(new B());\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. ERROR in X.java (at line 15)\n" +
- " b.value.next = new Box<B, B>(new B());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Box<B,B> to Box<capture#3-of ?,capture#4-of ?>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 17)\n" +
- " String s = b.value;\n" +
- " ^^^^^^^\n" +
- "Type mismatch: cannot convert from capture#6-of ? to String\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 18)\n" +
- " b.value.next.next = new Box<B, B>(new B());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Box<B,B> to Box<capture#9-of ?,capture#10-of ?>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 15)\n" +
+ " b.value.next = new Box<B, B>(new B());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Box<B,B> to Box<capture#3-of ?,capture#4-of ?>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 17)\n" +
+ " String s = b.value;\n" +
+ " ^^^^^^^\n" +
+ "Type mismatch: cannot convert from capture#6-of ? to String\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 18)\n" +
+ " b.value.next.next = new Box<B, B>(new B());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Box<B,B> to Box<capture#9-of ?,capture#10-of ?>\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=257434 - variation
@@ -49903,43 +49903,43 @@ public void test1419() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "class Box<U extends Box<?, ?>, V extends U> {\n" +
- " private V value;\n" +
- " Box<U, V> next;\n" +
- " Box(V value) {\n" +
- " this.value = value;\n" +
- " }\n" +
- " Box() {}\n" +
- " V getValue() { return this.value; }\n" +
- "}\n" +
- "class A extends Box<A, A> {}\n" +
- "class B extends Box<B, B> {}\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Box<Box<A, A>, Box<A, A>> a = new Box<Box<A, A>, Box<A, A>>(new Box<A, A>(new A()));\n" +
- " Box<?, ?> b = a;\n" +
- " b.getValue().next = new Box<B, B>(new B());\n" +
- " A c = a.getValue().next.getValue();\n" +
- " String s = b.getValue();\n" +
- " b.getValue().next.next = new Box<B, B>(new B());\n" +
- " }\n" +
+ "class Box<U extends Box<?, ?>, V extends U> {\n" +
+ " private V value;\n" +
+ " Box<U, V> next;\n" +
+ " Box(V value) {\n" +
+ " this.value = value;\n" +
+ " }\n" +
+ " Box() {}\n" +
+ " V getValue() { return this.value; }\n" +
+ "}\n" +
+ "class A extends Box<A, A> {}\n" +
+ "class B extends Box<B, B> {}\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Box<Box<A, A>, Box<A, A>> a = new Box<Box<A, A>, Box<A, A>>(new Box<A, A>(new A()));\n" +
+ " Box<?, ?> b = a;\n" +
+ " b.getValue().next = new Box<B, B>(new B());\n" +
+ " A c = a.getValue().next.getValue();\n" +
+ " String s = b.getValue();\n" +
+ " b.getValue().next.next = new Box<B, B>(new B());\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. ERROR in X.java (at line 16)\n" +
- " b.getValue().next = new Box<B, B>(new B());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Box<B,B> to Box<capture#3-of ?,capture#4-of ?>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 18)\n" +
- " String s = b.getValue();\n" +
- " ^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from capture#6-of ? to String\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 19)\n" +
- " b.getValue().next.next = new Box<B, B>(new B());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Box<B,B> to Box<capture#9-of ?,capture#10-of ?>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 16)\n" +
+ " b.getValue().next = new Box<B, B>(new B());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Box<B,B> to Box<capture#3-of ?,capture#4-of ?>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 18)\n" +
+ " String s = b.getValue();\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from capture#6-of ? to String\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 19)\n" +
+ " b.getValue().next.next = new Box<B, B>(new B());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Box<B,B> to Box<capture#9-of ?,capture#10-of ?>\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=257434 - variation
@@ -49947,35 +49947,35 @@ public void test1420() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "class Box<U extends Box<?, ?>, V extends U> {\n" +
- " V value;\n" +
- " Box<U, V> next(V v) { return new Box<U,V>(v); }\n" +
- " Box(V value) {\n" +
- " this.value = value;\n" +
- " }\n" +
- " Box() {/**/}\n" +
- "}\n" +
- "class A extends Box<A, A> {/**/}\n" +
- "class B extends Box<B, B> {/**/}\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Box<Box<A, A>, Box<A, A>> a = new Box<Box<A, A>, Box<A, A>>(new Box<A, A>(new A()));\n" +
- " Box<?, ?> b = a;\n" +
- " b.value.next(new Box<B, B>(new B()));\n" +
- " b.value.next(b.value);\n" +
- " }\n" +
+ "class Box<U extends Box<?, ?>, V extends U> {\n" +
+ " V value;\n" +
+ " Box<U, V> next(V v) { return new Box<U,V>(v); }\n" +
+ " Box(V value) {\n" +
+ " this.value = value;\n" +
+ " }\n" +
+ " Box() {/**/}\n" +
+ "}\n" +
+ "class A extends Box<A, A> {/**/}\n" +
+ "class B extends Box<B, B> {/**/}\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Box<Box<A, A>, Box<A, A>> a = new Box<Box<A, A>, Box<A, A>>(new Box<A, A>(new A()));\n" +
+ " Box<?, ?> b = a;\n" +
+ " b.value.next(new Box<B, B>(new B()));\n" +
+ " b.value.next(b.value);\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. ERROR in X.java (at line 15)\n" +
- " b.value.next(new Box<B, B>(new B()));\n" +
- " ^^^^\n" +
- "The method next(capture#4-of ?) in the type Box<capture#3-of ?,capture#4-of ?> is not applicable for the arguments (Box<B,B>)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 16)\n" +
- " b.value.next(b.value);\n" +
- " ^^^^\n" +
- "The method next(capture#10-of ?) in the type Box<capture#9-of ?,capture#10-of ?> is not applicable for the arguments (capture#8-of ?)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 15)\n" +
+ " b.value.next(new Box<B, B>(new B()));\n" +
+ " ^^^^\n" +
+ "The method next(capture#4-of ?) in the type Box<capture#3-of ?,capture#4-of ?> is not applicable for the arguments (Box<B,B>)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 16)\n" +
+ " b.value.next(b.value);\n" +
+ " ^^^^\n" +
+ "The method next(capture#10-of ?) in the type Box<capture#9-of ?,capture#10-of ?> is not applicable for the arguments (capture#8-of ?)\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=257849
@@ -49983,27 +49983,27 @@ public void test1420() {
public void test1421() {
this.runNegativeTest(
false /* skipJavac */,
- this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ this.complianceLevel < ClassFileConstants.JDK1_8 ?
null : JavacTestOptions.Excuse.JavacCompilesIncorrectSource,
new String[] {
"X.java", //-----------------------------------------------------------------------
- "public class X {\n" +
- " public interface ID { };\n" +
- " public abstract class DomainObject<T extends ID> {};\n" +
- " public interface DAO<T extends DomainObject<ID>> { };\n" +
- " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<ID>> {};\n" +
+ "public class X {\n" +
+ " public interface ID { };\n" +
+ " public abstract class DomainObject<T extends ID> {};\n" +
+ " public interface DAO<T extends DomainObject<ID>> { };\n" +
+ " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<ID>> {};\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<ID>> {};\n" +
- " ^^^^^^^^^^^^\n" +
- "The type parameter DomainObject is hiding the type X.DomainObject<T>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<ID>> {};\n" +
- " ^^^^^^^^^^^^\n" +
- "The type DomainObject is not generic; it cannot be parameterized with arguments <X.ID>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<ID>> {};\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The type parameter DomainObject is hiding the type X.DomainObject<T>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<ID>> {};\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The type DomainObject is not generic; it cannot be parameterized with arguments <X.ID>\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=257849 - variation
@@ -50011,23 +50011,23 @@ public void test1422() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "public class X {\n" +
- " public interface ID { };\n" +
- " public abstract class DomainObject<T extends ID> {};\n" +
- " public interface DAO<T extends DomainObject<ID>> { };\n" +
- " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<ID>.Zork> {};\n" +
+ "public class X {\n" +
+ " public interface ID { };\n" +
+ " public abstract class DomainObject<T extends ID> {};\n" +
+ " public interface DAO<T extends DomainObject<ID>> { };\n" +
+ " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<ID>.Zork> {};\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<ID>.Zork> {};\n" +
- " ^^^^^^^^^^^^\n" +
- "The type parameter DomainObject is hiding the type X.DomainObject<T>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<ID>.Zork> {};\n" +
- " ^^^^^^^^^^^^\n" +
- "The type DomainObject is not generic; it cannot be parameterized with arguments <X.ID>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<ID>.Zork> {};\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The type parameter DomainObject is hiding the type X.DomainObject<T>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<ID>.Zork> {};\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The type DomainObject is not generic; it cannot be parameterized with arguments <X.ID>\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=257849
@@ -50035,28 +50035,28 @@ public void test1423() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "public class X {\n" +
- " public interface ID { };\n" +
- " public abstract class DomainObject<T extends ID> {};\n" +
- " public interface DAO<T extends DomainObject<ID>> { };\n" +
- " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>> {};\n" +
+ "public class X {\n" +
+ " public interface ID { };\n" +
+ " public abstract class DomainObject<T extends ID> {};\n" +
+ " public interface DAO<T extends DomainObject<ID>> { };\n" +
+ " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>> {};\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>> {};\n" +
- " ^^^^^^^^^^^^\n" +
- "The type parameter DomainObject is hiding the type X.DomainObject<T>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>> {};\n" +
- " ^^^^^^^^^^^^\n" +
- "The type DomainObject is not generic; it cannot be parameterized with arguments <? extends Zork>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>> {};\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>> {};\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The type parameter DomainObject is hiding the type X.DomainObject<T>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>> {};\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The type DomainObject is not generic; it cannot be parameterized with arguments <? extends Zork>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>> {};\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=257849 - variation
@@ -50064,28 +50064,28 @@ public void test1424() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "public class X {\n" +
- " public interface ID { };\n" +
- " public abstract class DomainObject<T extends ID> {};\n" +
- " public interface DAO<T extends DomainObject<ID>> { };\n" +
- " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>.Zork> {};\n" +
+ "public class X {\n" +
+ " public interface ID { };\n" +
+ " public abstract class DomainObject<T extends ID> {};\n" +
+ " public interface DAO<T extends DomainObject<ID>> { };\n" +
+ " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>.Zork> {};\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>.Zork> {};\n" +
- " ^^^^^^^^^^^^\n" +
- "The type parameter DomainObject is hiding the type X.DomainObject<T>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>.Zork> {};\n" +
- " ^^^^^^^^^^^^\n" +
- "The type DomainObject is not generic; it cannot be parameterized with arguments <? extends Zork>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>.Zork> {};\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>.Zork> {};\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The type parameter DomainObject is hiding the type X.DomainObject<T>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>.Zork> {};\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The type DomainObject is not generic; it cannot be parameterized with arguments <? extends Zork>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>.Zork> {};\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=206123
@@ -50093,44 +50093,44 @@ public void test1425() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "public class X {\n" +
- " void test() {\n" +
- " B b = new C();\n" +
- " Class<? extends B> cb = C.class;\n" +
- " \n" +
- " YYY<C> y = new XXX();\n" +
- " Class<? extends YYY<C>> cy = XXX.class;\n" +
- " \n" +
- " YYY<? extends B> yb = new XXX();\n" +
- " Class<? extends YYY<? extends B>> ybc = XXX.class;\n" +
- " \n" +
- " Class<? extends YYY> ybb = yb.getClass();\n" +
- " Class<? extends YYY<?>> ybb2 = yb.getClass();\n" +
- " Class<? extends YYY<? extends B>> ybb3 = yb.getClass();\n" +
- " }\n" +
- "}\n" +
- "class Obj {}\n" +
- "class B extends Obj {}\n" +
- "class C extends B {}\n" +
- "class ZZZ<T extends Obj> {}\n" +
- "class YYY<T extends B> extends ZZZ<T> {}\n" +
+ "public class X {\n" +
+ " void test() {\n" +
+ " B b = new C();\n" +
+ " Class<? extends B> cb = C.class;\n" +
+ " \n" +
+ " YYY<C> y = new XXX();\n" +
+ " Class<? extends YYY<C>> cy = XXX.class;\n" +
+ " \n" +
+ " YYY<? extends B> yb = new XXX();\n" +
+ " Class<? extends YYY<? extends B>> ybc = XXX.class;\n" +
+ " \n" +
+ " Class<? extends YYY> ybb = yb.getClass();\n" +
+ " Class<? extends YYY<?>> ybb2 = yb.getClass();\n" +
+ " Class<? extends YYY<? extends B>> ybb3 = yb.getClass();\n" +
+ " }\n" +
+ "}\n" +
+ "class Obj {}\n" +
+ "class B extends Obj {}\n" +
+ "class C extends B {}\n" +
+ "class ZZZ<T extends Obj> {}\n" +
+ "class YYY<T extends B> extends ZZZ<T> {}\n" +
"class XXX extends YYY<C> {}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. WARNING in X.java (at line 12)\n" +
- " Class<? extends YYY> ybb = yb.getClass();\n" +
- " ^^^\n" +
- "YYY is a raw type. References to generic type YYY<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " Class<? extends YYY<?>> ybb2 = yb.getClass();\n" +
- " ^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Class<capture#4-of ? extends YYY> to Class<? extends YYY<?>>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 14)\n" +
- " Class<? extends YYY<? extends B>> ybb3 = yb.getClass();\n" +
- " ^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Class<capture#6-of ? extends YYY> to Class<? extends YYY<? extends B>>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 12)\n" +
+ " Class<? extends YYY> ybb = yb.getClass();\n" +
+ " ^^^\n" +
+ "YYY is a raw type. References to generic type YYY<T> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 13)\n" +
+ " Class<? extends YYY<?>> ybb2 = yb.getClass();\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Class<capture#4-of ? extends YYY> to Class<? extends YYY<?>>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 14)\n" +
+ " Class<? extends YYY<? extends B>> ybb3 = yb.getClass();\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Class<capture#6-of ? extends YYY> to Class<? extends YYY<? extends B>>\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=258039
@@ -50138,53 +50138,53 @@ public void test1426() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "import java.util.*;\n" +
- "public class X {\n" +
- " boolean foo() {\n" +
- " return null instanceof List<Object>;\n" +
- " }\n" +
- " <T extends List<Object>> boolean foo2() {\n" +
- " return null instanceof T;\n" +
- " }\n" +
- " boolean foo3() {\n" +
- " return null instanceof Map<Object,String>;\n" +
- " }\n" +
- " <T extends Map<Object,String>> boolean foo4() {\n" +
- " return null instanceof T;\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "public class X {\n" +
+ " boolean foo() {\n" +
+ " return null instanceof List<Object>;\n" +
+ " }\n" +
+ " <T extends List<Object>> boolean foo2() {\n" +
+ " return null instanceof T;\n" +
+ " }\n" +
+ " boolean foo3() {\n" +
+ " return null instanceof Map<Object,String>;\n" +
+ " }\n" +
+ " <T extends Map<Object,String>> boolean foo4() {\n" +
+ " return null instanceof T;\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " return null instanceof List<Object>;\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot perform instanceof check against parameterized type List<Object>. Use the form List<?> instead since further generic type information will be erased at runtime\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " return null instanceof T;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Cannot perform instanceof check against type parameter T. Use its erasure List<?> instead since further generic type information will be erased at runtime\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " return null instanceof Map<Object,String>;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot perform instanceof check against parameterized type Map<Object,String>. Use the form Map<?,?> instead since further generic type information will be erased at runtime\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 13)\n" +
- " return null instanceof T;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Cannot perform instanceof check against type parameter T. Use its erasure Map<?,?> instead since further generic type information will be erased at runtime\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " return null instanceof List<Object>;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot perform instanceof check against parameterized type List<Object>. Use the form List<?> instead since further generic type information will be erased at runtime\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " return null instanceof T;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Cannot perform instanceof check against type parameter T. Use its erasure List<?> instead since further generic type information will be erased at runtime\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 10)\n" +
+ " return null instanceof Map<Object,String>;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot perform instanceof check against parameterized type Map<Object,String>. Use the form Map<?,?> instead since further generic type information will be erased at runtime\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 13)\n" +
+ " return null instanceof T;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Cannot perform instanceof check against type parameter T. Use its erasure Map<?,?> instead since further generic type information will be erased at runtime\n" +
"----------\n");
}
public void test1427() {
String xSource =
- "import java.util.List;\n" +
- "public class X {\n" +
- " public <T> List<T> nil() { return null; }\n" +
- " public <T> T getHead(List<T> x) { return null; }\n" +
- " X() {\n" +
- " String s = getHead(nil());\n" +
- " }\n" +
+ "import java.util.List;\n" +
+ "public class X {\n" +
+ " public <T> List<T> nil() { return null; }\n" +
+ " public <T> T getHead(List<T> x) { return null; }\n" +
+ " X() {\n" +
+ " String s = getHead(nil());\n" +
+ " }\n" +
"}\n";
if (this.complianceLevel < ClassFileConstants.JDK1_8) {
this.runNegativeTest(
@@ -50192,11 +50192,11 @@ public void test1427() {
"X.java",
xSource
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " String s = getHead(nil());\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Object to String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " String s = getHead(nil());\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Object to String\n" +
"----------\n");
} else {
runConformTest(
@@ -50211,16 +50211,16 @@ public void test1428() {
this.runConformTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "class A<I extends B> {}\n" +
- "class B {}\n" +
- "public class X {\n" +
- " public <I extends B, C extends A<I>> A<I> foo(Class<C> clazz) {\n" +
- " A<I> ret = bar(\"bla\");\n" +
- " return ret;\n" +
- " }\n" +
- " public <I extends B, C extends A<I>> A<I> bar(String clazzName) {\n" +
- " return null;\n" +
- " }\n" +
+ "class A<I extends B> {}\n" +
+ "class B {}\n" +
+ "public class X {\n" +
+ " public <I extends B, C extends A<I>> A<I> foo(Class<C> clazz) {\n" +
+ " A<I> ret = bar(\"bla\");\n" +
+ " return ret;\n" +
+ " }\n" +
+ " public <I extends B, C extends A<I>> A<I> bar(String clazzName) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
"");
@@ -50230,48 +50230,48 @@ public void test1429() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "class Foo<T> {}\n" +
- "public class X {\n" +
- " public void test() {\n" +
- " Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" +
- " }\n" +
- " public <T> T m(Foo<T> x, T t) {\n" +
- " return t;\n" +
- " }\n" +
+ "class Foo<T> {}\n" +
+ "public class X {\n" +
+ " public void test() {\n" +
+ " Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" +
+ " }\n" +
+ " public <T> T m(Foo<T> x, T t) {\n" +
+ " return t;\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation m(Foo<Foo<Integer>>, Foo) of the generic method m(Foo<T>, T) of type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Foo to Integer\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 4)\n" +
- " Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" +
- " ^^^^^^^^^\n" +
- "Type safety: The expression of type Foo needs unchecked conversion to conform to Foo<Integer>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 4)\n" +
- " Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" +
- " ^^^\n" +
- "Foo is a raw type. References to generic type Foo<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation m(Foo<Foo<Integer>>, Foo) of the generic method m(Foo<T>, T) of type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Foo to Integer\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 4)\n" +
+ " Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" +
+ " ^^^^^^^^^\n" +
+ "Type safety: The expression of type Foo needs unchecked conversion to conform to Foo<Integer>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 4)\n" +
+ " Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" +
+ " ^^^\n" +
+ "Foo is a raw type. References to generic type Foo<T> should be parameterized\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Foo to Integer\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" +
- " ^^^\n" +
- "Foo is a raw type. References to generic type Foo<T> should be parameterized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Foo to Integer\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" +
+ " ^^^\n" +
+ "Foo is a raw type. References to generic type Foo<T> should be parameterized\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798 - variation
@@ -50279,29 +50279,29 @@ public void test1430() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "class Foo<T> {}\n" +
- "public class X {\n" +
- " public void test() {\n" +
- " m(new Foo<Foo<Integer>>(), new Foo());\n" +
- " }\n" +
- " public <T> void m(Foo<T> x, T t) {}\n" +
+ "class Foo<T> {}\n" +
+ "public class X {\n" +
+ " public void test() {\n" +
+ " m(new Foo<Foo<Integer>>(), new Foo());\n" +
+ " }\n" +
+ " public <T> void m(Foo<T> x, T t) {}\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " m(new Foo<Foo<Integer>>(), new Foo());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation m(Foo<Foo<Integer>>, Foo) of the generic method m(Foo<T>, T) of type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " m(new Foo<Foo<Integer>>(), new Foo());\n" +
- " ^^^^^^^^^\n" +
- "Type safety: The expression of type Foo needs unchecked conversion to conform to Foo<Integer>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 4)\n" +
- " m(new Foo<Foo<Integer>>(), new Foo());\n" +
- " ^^^\n" +
- "Foo is a raw type. References to generic type Foo<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " m(new Foo<Foo<Integer>>(), new Foo());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation m(Foo<Foo<Integer>>, Foo) of the generic method m(Foo<T>, T) of type X\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " m(new Foo<Foo<Integer>>(), new Foo());\n" +
+ " ^^^^^^^^^\n" +
+ "Type safety: The expression of type Foo needs unchecked conversion to conform to Foo<Integer>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 4)\n" +
+ " m(new Foo<Foo<Integer>>(), new Foo());\n" +
+ " ^^^\n" +
+ "Foo is a raw type. References to generic type Foo<T> should be parameterized\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=258039
@@ -50309,38 +50309,38 @@ public void test1431() throws Exception {
this.runNegativeTest(
new String[] {
"X.java", //=================================
- "public class X {\n" +
- " void foo() {\n" +
- " class M<T extends Number> {}\n" +
- " class N extends M<String> {}\n" +
- " class O implements I<String>, I<Number> {}\n" +
- " }\n" +
- " class MM<T extends Number> {}\n" +
- " class NN extends MM<String> {}\n" +
- " class OO implements I<String>, I<Number> {}\n" +
+ "public class X {\n" +
+ " void foo() {\n" +
+ " class M<T extends Number> {}\n" +
+ " class N extends M<String> {}\n" +
+ " class O implements I<String>, I<Number> {}\n" +
+ " }\n" +
+ " class MM<T extends Number> {}\n" +
+ " class NN extends MM<String> {}\n" +
+ " class OO implements I<String>, I<Number> {}\n" +
"}\n" +
"interface I<T> {}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " class N extends M<String> {}\n" +
- " ^^^^^^\n" +
- "Bound mismatch: The type String is not a valid substitute for the bounded parameter <T extends Number> of the type M<T>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " class O implements I<String>, I<Number> {}\n" +
- " ^\n" +
- "The interface I cannot be implemented more than once with different arguments: I<Number> and I<String>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " class NN extends MM<String> {}\n" +
- " ^^^^^^\n" +
- "Bound mismatch: The type String is not a valid substitute for the bounded parameter <T extends Number> of the type X.MM<T>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " class OO implements I<String>, I<Number> {}\n" +
- " ^^\n" +
- "The interface I cannot be implemented more than once with different arguments: I<Number> and I<String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " class N extends M<String> {}\n" +
+ " ^^^^^^\n" +
+ "Bound mismatch: The type String is not a valid substitute for the bounded parameter <T extends Number> of the type M<T>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " class O implements I<String>, I<Number> {}\n" +
+ " ^\n" +
+ "The interface I cannot be implemented more than once with different arguments: I<Number> and I<String>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " class NN extends MM<String> {}\n" +
+ " ^^^^^^\n" +
+ "Bound mismatch: The type String is not a valid substitute for the bounded parameter <T extends Number> of the type X.MM<T>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 9)\n" +
+ " class OO implements I<String>, I<Number> {}\n" +
+ " ^^\n" +
+ "The interface I cannot be implemented more than once with different arguments: I<Number> and I<String>\n" +
"----------\n"
);
}
@@ -50349,35 +50349,35 @@ public void test1432() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "class Foo<T> {\n" +
- " T bar(Foo<T> ft, T t) {\n" +
- " return t;\n" +
- " }\n" +
- "}\n" +
- "public class X {\n" +
- " public void test() {\n" +
- " Foo<Foo<Integer>> ffi = new Foo<Foo<Integer>>();\n" +
- " Integer j = ffi.bar(ffi, new Foo());\n" +
- " }\n" +
+ "class Foo<T> {\n" +
+ " T bar(Foo<T> ft, T t) {\n" +
+ " return t;\n" +
+ " }\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public void test() {\n" +
+ " Foo<Foo<Integer>> ffi = new Foo<Foo<Integer>>();\n" +
+ " Integer j = ffi.bar(ffi, new Foo());\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " Integer j = ffi.bar(ffi, new Foo());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " Integer j = ffi.bar(ffi, new Foo());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8
? "Type mismatch: cannot convert from Foo<Integer> to Integer\n"
: "Type mismatch: cannot convert from Foo to Integer\n") +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " Integer j = ffi.bar(ffi, new Foo());\n" +
- " ^^^^^^^^^\n" +
- "Type safety: The expression of type Foo needs unchecked conversion to conform to Foo<Integer>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 9)\n" +
- " Integer j = ffi.bar(ffi, new Foo());\n" +
- " ^^^\n" +
- "Foo is a raw type. References to generic type Foo<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " Integer j = ffi.bar(ffi, new Foo());\n" +
+ " ^^^^^^^^^\n" +
+ "Type safety: The expression of type Foo needs unchecked conversion to conform to Foo<Integer>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 9)\n" +
+ " Integer j = ffi.bar(ffi, new Foo());\n" +
+ " ^^^\n" +
+ "Foo is a raw type. References to generic type Foo<T> should be parameterized\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798 - variation
@@ -50385,35 +50385,35 @@ public void test1433() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "import java.util.*;\n" +
- "public class X<T> {\n" +
+ "import java.util.*;\n" +
+ "public class X<T> {\n" +
" Zork z;\n" +
- " <U> void foo(X<U> xu) {}\n" +
- " void bar(X x) {\n" +
- " foo(x);\n" +
- " }\n" +
+ " <U> void foo(X<U> xu) {}\n" +
+ " void bar(X x) {\n" +
+ " foo(x);\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " void bar(X x) {\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " foo(x);\n" +
- " ^^^^^^\n" +
- "Type safety: Unchecked invocation foo(X) of the generic method foo(X<U>) of type X<T>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 6)\n" +
- " foo(x);\n" +
- " ^\n" +
- "Type safety: The expression of type X needs unchecked conversion to conform to X<Object>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " void bar(X x) {\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " foo(x);\n" +
+ " ^^^^^^\n" +
+ "Type safety: Unchecked invocation foo(X) of the generic method foo(X<U>) of type X<T>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 6)\n" +
+ " foo(x);\n" +
+ " ^\n" +
+ "Type safety: The expression of type X needs unchecked conversion to conform to X<Object>\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798 - variation
@@ -50421,61 +50421,61 @@ public void test1434() {
this.runNegativeTest(
new String[] {
"Foo.java", //-----------------------------------------------------------------------
- "public class Foo {\n" +
- " public static <I> I m2(Class<I> c) { return null; } \n" +
- " void bar() {\n" +
- " Foo l2 = m2((Class)Foo.class);\n" +
- " }\n" +
+ "public class Foo {\n" +
+ " public static <I> I m2(Class<I> c) { return null; } \n" +
+ " void bar() {\n" +
+ " Foo l2 = m2((Class)Foo.class);\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. WARNING in Foo.java (at line 4)\n" +
- " Foo l2 = m2((Class)Foo.class);\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation m2(Class) of the generic method m2(Class<I>) of type Foo\n" +
- "----------\n" +
- "2. WARNING in Foo.java (at line 4)\n" +
- " Foo l2 = m2((Class)Foo.class);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Class needs unchecked conversion to conform to Class<Foo>\n" +
- "----------\n" +
- "3. WARNING in Foo.java (at line 4)\n" +
- " Foo l2 = m2((Class)Foo.class);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from Class<Foo> to Class\n" +
- "----------\n" +
- "4. WARNING in Foo.java (at line 4)\n" +
- " Foo l2 = m2((Class)Foo.class);\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in Foo.java (at line 4)\n" +
+ " Foo l2 = m2((Class)Foo.class);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation m2(Class) of the generic method m2(Class<I>) of type Foo\n" +
+ "----------\n" +
+ "2. WARNING in Foo.java (at line 4)\n" +
+ " Foo l2 = m2((Class)Foo.class);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Class needs unchecked conversion to conform to Class<Foo>\n" +
+ "----------\n" +
+ "3. WARNING in Foo.java (at line 4)\n" +
+ " Foo l2 = m2((Class)Foo.class);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Unnecessary cast from Class<Foo> to Class\n" +
+ "----------\n" +
+ "4. WARNING in Foo.java (at line 4)\n" +
+ " Foo l2 = m2((Class)Foo.class);\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
"----------\n"
: // 1.8 is stricter:
- "----------\n" +
- "1. ERROR in Foo.java (at line 4)\n" +
- " Foo l2 = m2((Class)Foo.class);\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Object to Foo\n" +
- "----------\n" +
- "2. WARNING in Foo.java (at line 4)\n" +
- " Foo l2 = m2((Class)Foo.class);\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "1. ERROR in Foo.java (at line 4)\n" +
+ " Foo l2 = m2((Class)Foo.class);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Object to Foo\n" +
+ "----------\n" +
+ "2. WARNING in Foo.java (at line 4)\n" +
+ " Foo l2 = m2((Class)Foo.class);\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
"----------\n"));
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798 - variation
public void test1435() {
String xSource =
- "public class X {\n" +
- " <T extends Comparable<T>> T min(T x, T y) { return x; }\n" +
- " \n" +
- " void foo(Foo f, Bar b) {\n" +
- " min(f, f);\n" +
- " min(b, b);\n" +
- " }\n" +
- "}\n" +
- "abstract class Foo implements Comparable<Foo> {\n" +
- "}\n" +
+ "public class X {\n" +
+ " <T extends Comparable<T>> T min(T x, T y) { return x; }\n" +
+ " \n" +
+ " void foo(Foo f, Bar b) {\n" +
+ " min(f, f);\n" +
+ " min(b, b);\n" +
+ " }\n" +
+ "}\n" +
+ "abstract class Foo implements Comparable<Foo> {\n" +
+ "}\n" +
"abstract class Bar extends Foo {}\n";
if (this.complianceLevel < ClassFileConstants.JDK1_8) {
this.runNegativeTest(
@@ -50498,46 +50498,46 @@ public void test1436() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "import java.util.*;\n" +
- "public class X {\n" +
- " <U extends List<?>, T extends Throwable> void foo(List<U> lu, T t) throws T {\n" +
- " if (lu.isEmpty()) throw t;\n" +
- " }\n" +
- " void bar(List l, IllegalArgumentException iae) {\n" +
- " try {\n" +
- " foo(l, iae);\n" +
- " } catch (IllegalArgumentException e) {\n" +
- " }\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "public class X {\n" +
+ " <U extends List<?>, T extends Throwable> void foo(List<U> lu, T t) throws T {\n" +
+ " if (lu.isEmpty()) throw t;\n" +
+ " }\n" +
+ " void bar(List l, IllegalArgumentException iae) {\n" +
+ " try {\n" +
+ " foo(l, iae);\n" +
+ " } catch (IllegalArgumentException e) {\n" +
+ " }\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " void bar(List l, IllegalArgumentException iae) {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " foo(l, iae);\n" +
- " ^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation foo(List, IllegalArgumentException) of the generic method foo(List<U>, T) of type X\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " void bar(List l, IllegalArgumentException iae) {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " foo(l, iae);\n" +
+ " ^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation foo(List, IllegalArgumentException) of the generic method foo(List<U>, T) of type X\n" +
"----------\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8
?
- "3. WARNING in X.java (at line 8)\n" +
- " foo(l, iae);\n" +
- " ^\n" +
+ "3. WARNING in X.java (at line 8)\n" +
+ " foo(l, iae);\n" +
+ " ^\n" +
"Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n"
:
- "3. ERROR in X.java (at line 8)\n" +
- " foo(l, iae);\n" +
- " ^^^^^^^^^^^\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " foo(l, iae);\n" +
+ " ^^^^^^^^^^^\n" +
"Unhandled exception type Throwable\n" + // new error since 1.8 (bug 473657)
- "----------\n" +
- "4. WARNING in X.java (at line 8)\n" +
- " foo(l, iae);\n" +
- " ^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n"
+ "----------\n" +
+ "4. WARNING in X.java (at line 8)\n" +
+ " foo(l, iae);\n" +
+ " ^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n"
) +
"----------\n");
}
@@ -50546,46 +50546,46 @@ public void test1437() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "import java.util.*;\n" +
- "public class X {\n" +
- " <U extends List<?>, T extends Throwable> X(List<U> lu, T t) throws T {\n" +
- " if (lu.isEmpty()) throw t;\n" +
- " }\n" +
- " void bar(List l, IllegalArgumentException iae) {\n" +
- " try {\n" +
- " new X(l, iae);\n" +
- " } catch (IllegalArgumentException e) {\n" +
- " }\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "public class X {\n" +
+ " <U extends List<?>, T extends Throwable> X(List<U> lu, T t) throws T {\n" +
+ " if (lu.isEmpty()) throw t;\n" +
+ " }\n" +
+ " void bar(List l, IllegalArgumentException iae) {\n" +
+ " try {\n" +
+ " new X(l, iae);\n" +
+ " } catch (IllegalArgumentException e) {\n" +
+ " }\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " void bar(List l, IllegalArgumentException iae) {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " new X(l, iae);\n" +
- " ^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation X(List, IllegalArgumentException) of the generic constructor X(List<U>, T) of type X\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " void bar(List l, IllegalArgumentException iae) {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " new X(l, iae);\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation X(List, IllegalArgumentException) of the generic constructor X(List<U>, T) of type X\n" +
"----------\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8
?
- "3. WARNING in X.java (at line 8)\n" +
- " new X(l, iae);\n" +
- " ^\n" +
+ "3. WARNING in X.java (at line 8)\n" +
+ " new X(l, iae);\n" +
+ " ^\n" +
"Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n"
:
- "3. ERROR in X.java (at line 8)\n" +
- " new X(l, iae);\n" +
- " ^^^^^^^^^^^^^\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " new X(l, iae);\n" +
+ " ^^^^^^^^^^^^^\n" +
"Unhandled exception type Throwable\n" + // new error since 1.8 (bug 473657)
- "----------\n" +
- "4. WARNING in X.java (at line 8)\n" +
- " new X(l, iae);\n" +
- " ^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n"
+ "----------\n" +
+ "4. WARNING in X.java (at line 8)\n" +
+ " new X(l, iae);\n" +
+ " ^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n"
) +
"----------\n");
}
@@ -50594,46 +50594,46 @@ public void test1438() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "import java.util.*;\n" +
- "public class X {\n" +
- " <U extends List<?>, T extends Throwable> X(List<U> lu, T t) throws T {\n" +
- " if (lu.isEmpty()) throw t;\n" +
- " }\n" +
- " void bar(List l, IllegalArgumentException iae) {\n" +
- " try {\n" +
- " new X(l, iae){};\n" +
- " } catch (IllegalArgumentException e) {\n" +
- " }\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "public class X {\n" +
+ " <U extends List<?>, T extends Throwable> X(List<U> lu, T t) throws T {\n" +
+ " if (lu.isEmpty()) throw t;\n" +
+ " }\n" +
+ " void bar(List l, IllegalArgumentException iae) {\n" +
+ " try {\n" +
+ " new X(l, iae){};\n" +
+ " } catch (IllegalArgumentException e) {\n" +
+ " }\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " void bar(List l, IllegalArgumentException iae) {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " new X(l, iae){};\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation X(List, IllegalArgumentException) of the generic constructor X(List<U>, T) of type X\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " void bar(List l, IllegalArgumentException iae) {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " new X(l, iae){};\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation X(List, IllegalArgumentException) of the generic constructor X(List<U>, T) of type X\n" +
"----------\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8
?
- "3. WARNING in X.java (at line 8)\n" +
- " new X(l, iae){};\n" +
- " ^\n" +
+ "3. WARNING in X.java (at line 8)\n" +
+ " new X(l, iae){};\n" +
+ " ^\n" +
"Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n"
:
- "3. ERROR in X.java (at line 8)\n" +
- " new X(l, iae){};\n" +
- " ^^^^^^^^^^^^^^^\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " new X(l, iae){};\n" +
+ " ^^^^^^^^^^^^^^^\n" +
"Unhandled exception type Throwable\n" + // new error since 1.8 (bug 473657)
- "----------\n" +
- "4. WARNING in X.java (at line 8)\n" +
- " new X(l, iae){};\n" +
- " ^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n"
+ "----------\n" +
+ "4. WARNING in X.java (at line 8)\n" +
+ " new X(l, iae){};\n" +
+ " ^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n"
) +
"----------\n");
}
@@ -50642,61 +50642,61 @@ public void test1439() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "import java.util.*;\n" +
- "public class X {\n" +
- " <U extends List<?>, T extends Throwable> X(List<U> lu, T t) throws T {\n" +
- " if (lu.isEmpty()) throw t;\n" +
- " }\n" +
- " X() { \n" +
- " this((List) null, null);\n" +
- " }\n" +
- "}\n" +
- "class Y extends X {\n" +
- " <U extends List<?>, T extends Throwable> Y(List<U> lu, T t) {\n" +
- " super((List)lu, t);\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "public class X {\n" +
+ " <U extends List<?>, T extends Throwable> X(List<U> lu, T t) throws T {\n" +
+ " if (lu.isEmpty()) throw t;\n" +
+ " }\n" +
+ " X() { \n" +
+ " this((List) null, null);\n" +
+ " }\n" +
+ "}\n" +
+ "class Y extends X {\n" +
+ " <U extends List<?>, T extends Throwable> Y(List<U> lu, T t) {\n" +
+ " super((List)lu, t);\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " this((List) null, null);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation X(List, null) of the generic constructor X(List<U>, T) of type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " this((List) null, null);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type Throwable\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 7)\n" +
- " this((List) null, null);\n" +
- " ^^^^^^^^^^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 7)\n" +
- " this((List) null, null);\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 12)\n" +
- " super((List)lu, t);\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation X(List, T) of the generic constructor X(List<U>, T) of type X\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 12)\n" +
- " super((List)lu, t);\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type Throwable\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 12)\n" +
- " super((List)lu, t);\n" +
- " ^^^^^^^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 12)\n" +
- " super((List)lu, t);\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 7)\n" +
+ " this((List) null, null);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation X(List, null) of the generic constructor X(List<U>, T) of type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " this((List) null, null);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type Throwable\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 7)\n" +
+ " this((List) null, null);\n" +
+ " ^^^^^^^^^^^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 7)\n" +
+ " this((List) null, null);\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 12)\n" +
+ " super((List)lu, t);\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation X(List, T) of the generic constructor X(List<U>, T) of type X\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 12)\n" +
+ " super((List)lu, t);\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type Throwable\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 12)\n" +
+ " super((List)lu, t);\n" +
+ " ^^^^^^^^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 12)\n" +
+ " super((List)lu, t);\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=260567
@@ -50704,33 +50704,33 @@ public void test1440() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "import java.util.*;\n" +
- "interface GenricInterface<T> {}\n" +
+ "import java.util.*;\n" +
+ "interface GenricInterface<T> {}\n" +
"class NewMapType<U, V, R extends GenricInterface<U>> extends HashMap<R<U>, V> {}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " class NewMapType<U, V, R extends GenricInterface<U>> extends HashMap<R<U>, V> {}\n" +
- " ^\n" +
- "The type R is not generic; it cannot be parameterized with arguments <U>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " class NewMapType<U, V, R extends GenricInterface<U>> extends HashMap<R<U>, V> {}\n" +
+ " ^\n" +
+ "The type R is not generic; it cannot be parameterized with arguments <U>\n" +
"----------\n");
}
public void test1441() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "public class X<T> {\n" +
- " void bar(T t) {}\n" +
- " void foo(X<? extends String> x1, X<? extends Integer> x2) {\n" +
- " (x1 != null ? x1 : x2).bar(new Object());\n" +
- " }\n" +
+ "public class X<T> {\n" +
+ " void bar(T t) {}\n" +
+ " void foo(X<? extends String> x1, X<? extends Integer> x2) {\n" +
+ " (x1 != null ? x1 : x2).bar(new Object());\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " (x1 != null ? x1 : x2).bar(new Object());\n" +
- " ^^^\n" +
- "The method bar(capture#4-of ? extends "+intersection("Object","Serializable","Comparable<? extends "+intersection("Object","Serializable","Comparable<?>")+">")+") in the type X<capture#4-of ? extends "+intersection("Object","Serializable","Comparable<? extends "+intersection("Object","Serializable","Comparable<?>")+">")+"> is not applicable for the arguments (Object)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " (x1 != null ? x1 : x2).bar(new Object());\n" +
+ " ^^^\n" +
+ "The method bar(capture#4-of ? extends "+intersection("Object","Serializable","Comparable<? extends "+intersection("Object","Serializable","Comparable<?>")+">")+") in the type X<capture#4-of ? extends "+intersection("Object","Serializable","Comparable<? extends "+intersection("Object","Serializable","Comparable<?>")+">")+"> is not applicable for the arguments (Object)\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=221253
@@ -50738,33 +50738,33 @@ public void test1442() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "public class X<T extends Comparable<T>> {\n" +
- " T[] array;\n" +
- "\n" +
- " @Override public boolean equals(Object o) {\n" +
- " X<Comparable<T>> x;\n" +
- " if (array.length == ((X<Comparable<T>>) o).array.length) {\n" +
- " return true;\n" +
- " }\n" +
- " return false;\n" +
- " }\n" +
+ "public class X<T extends Comparable<T>> {\n" +
+ " T[] array;\n" +
+ "\n" +
+ " @Override public boolean equals(Object o) {\n" +
+ " X<Comparable<T>> x;\n" +
+ " if (array.length == ((X<Comparable<T>>) o).array.length) {\n" +
+ " return true;\n" +
+ " }\n" +
+ " return false;\n" +
+ " }\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " X<Comparable<T>> x;\n" +
- " ^^^^^^^^^^\n" +
- "Bound mismatch: The type Comparable<T> is not a valid substitute for the bounded parameter <T extends Comparable<T>> of the type X<T>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " if (array.length == ((X<Comparable<T>>) o).array.length) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to X<Comparable<T>>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " if (array.length == ((X<Comparable<T>>) o).array.length) {\n" +
- " ^^^^^^^^^^\n" +
- "Bound mismatch: The type Comparable<T> is not a valid substitute for the bounded parameter <T extends Comparable<T>> of the type X<T>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " X<Comparable<T>> x;\n" +
+ " ^^^^^^^^^^\n" +
+ "Bound mismatch: The type Comparable<T> is not a valid substitute for the bounded parameter <T extends Comparable<T>> of the type X<T>\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " if (array.length == ((X<Comparable<T>>) o).array.length) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to X<Comparable<T>>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " if (array.length == ((X<Comparable<T>>) o).array.length) {\n" +
+ " ^^^^^^^^^^\n" +
+ "Bound mismatch: The type Comparable<T> is not a valid substitute for the bounded parameter <T extends Comparable<T>> of the type X<T>\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=254627
@@ -50772,59 +50772,59 @@ public void test1443() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "import java.util.List;\n" +
- "public class X {\n" +
- " private static class C {}\n" +
- " private static class B<T extends C> {}\n" +
- " private static class A<T extends B<? extends C>> {}\n" +
- " void bar (List<A> a) {\n" +
- " baz((List)a);\n" +
- " // Neither of these two following statements compile under javac\n" +
- " buz(a);\n" +
- " buz((List)a);\n" +
- " // Side note: the following statement is correctly identified as an error\n" +
- " // by Eclipse, but it does not suggest casting as a Quick Fix.\n" +
- " baz(a);\n" +
- " }\n" +
- " <R extends C, T extends B<R>> void baz(List<A<T>> a) {}\n" +
- " <R extends C, T extends B<R>> void buz(List a) {}\n" +
+ "import java.util.List;\n" +
+ "public class X {\n" +
+ " private static class C {}\n" +
+ " private static class B<T extends C> {}\n" +
+ " private static class A<T extends B<? extends C>> {}\n" +
+ " void bar (List<A> a) {\n" +
+ " baz((List)a);\n" +
+ " // Neither of these two following statements compile under javac\n" +
+ " buz(a);\n" +
+ " buz((List)a);\n" +
+ " // Side note: the following statement is correctly identified as an error\n" +
+ " // by Eclipse, but it does not suggest casting as a Quick Fix.\n" +
+ " baz(a);\n" +
+ " }\n" +
+ " <R extends C, T extends B<R>> void baz(List<A<T>> a) {}\n" +
+ " <R extends C, T extends B<R>> void buz(List a) {}\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " void bar (List<A> a) {\n" +
- " ^\n" +
- "X.A is a raw type. References to generic type X.A<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " baz((List)a);\n" +
- " ^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation baz(List) of the generic method baz(List<X.A<T>>) of type X\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 7)\n" +
- " baz((List)a);\n" +
- " ^^^^^^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<X.A<X.B<X.C>>>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 7)\n" +
- " baz((List)a);\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 10)\n" +
- " buz((List)a);\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 13)\n" +
- " baz(a);\n" +
- " ^^^\n" +
- "The method baz(List<X.A<T>>) in the type X is not applicable for the arguments (List<X.A>)\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 16)\n" +
- " <R extends C, T extends B<R>> void buz(List a) {}\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " void bar (List<A> a) {\n" +
+ " ^\n" +
+ "X.A is a raw type. References to generic type X.A<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " baz((List)a);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation baz(List) of the generic method baz(List<X.A<T>>) of type X\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 7)\n" +
+ " baz((List)a);\n" +
+ " ^^^^^^^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<X.A<X.B<X.C>>>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 7)\n" +
+ " baz((List)a);\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 10)\n" +
+ " buz((List)a);\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 13)\n" +
+ " baz(a);\n" +
+ " ^^^\n" +
+ "The method baz(List<X.A<T>>) in the type X is not applicable for the arguments (List<X.A>)\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 16)\n" +
+ " <R extends C, T extends B<R>> void buz(List a) {}\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=263215
@@ -50832,78 +50832,78 @@ public void test1444() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "import java.util.ArrayList;\n" +
- "import java.util.Iterator;\n" +
- "import java.util.List;\n" +
- "\n" +
- "public class X {\n" +
- " @SuppressWarnings(\"all\") public static <T> T[] asArray(Iterator<? extends T> it, Class<T> clazz) {\n" +
- " List<T> lst = new ArrayList<T>();\n" +
- " while (it.hasNext()) {\n" +
- " lst.add(it.next());\n" +
- " }\n" +
- " return lst.toArray((T[]) java.lang.reflect.Array.newInstance(clazz, lst.size()));\n" +
- " }\n" +
- " public void test() {\n" +
- " String[] asString = null;\n" +
- " // eclipse 3.5M4 this worked in build I20090129-1200 it doesnt anymore\n" +
- " asString = X.<String> asArray(getIterator(), String.class);\n" +
- " // now i have to do this:\n" +
- " Iterator<String> iterator = getIterator();\n" +
- " asString = X.<String> asArray(iterator, String.class);\n" +
- " // this also works except if i have remove unnecessary cast enabled then\n" +
- " // the cast is removed and i get a compile error\n" +
- " asString = X.<String> asArray((Iterator<String>) getIterator(), String.class);\n" +
- " }\n" +
- " @SuppressWarnings(\"all\") public Iterator getIterator() {\n" +
- " return new Iterator() {\n" +
- " public void remove() {\n" +
- " }\n" +
- " public Object next() {\n" +
- " return null;\n" +
- " }\n" +
- " public boolean hasNext() {\n" +
- " return false;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.Iterator;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class X {\n" +
+ " @SuppressWarnings(\"all\") public static <T> T[] asArray(Iterator<? extends T> it, Class<T> clazz) {\n" +
+ " List<T> lst = new ArrayList<T>();\n" +
+ " while (it.hasNext()) {\n" +
+ " lst.add(it.next());\n" +
+ " }\n" +
+ " return lst.toArray((T[]) java.lang.reflect.Array.newInstance(clazz, lst.size()));\n" +
+ " }\n" +
+ " public void test() {\n" +
+ " String[] asString = null;\n" +
+ " // eclipse 3.5M4 this worked in build I20090129-1200 it doesnt anymore\n" +
+ " asString = X.<String> asArray(getIterator(), String.class);\n" +
+ " // now i have to do this:\n" +
+ " Iterator<String> iterator = getIterator();\n" +
+ " asString = X.<String> asArray(iterator, String.class);\n" +
+ " // this also works except if i have remove unnecessary cast enabled then\n" +
+ " // the cast is removed and i get a compile error\n" +
+ " asString = X.<String> asArray((Iterator<String>) getIterator(), String.class);\n" +
+ " }\n" +
+ " @SuppressWarnings(\"all\") public Iterator getIterator() {\n" +
+ " return new Iterator() {\n" +
+ " public void remove() {\n" +
+ " }\n" +
+ " public Object next() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public boolean hasNext() {\n" +
+ " return false;\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
" Zork z;\n" +
"}\n",//-----------------------------------------------------------------------
},
- "----------\n" +
- "1. WARNING in X.java (at line 16)\n" +
- " asString = X.<String> asArray(getIterator(), String.class);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation asArray(Iterator, Class<String>) of the generic method asArray(Iterator<? extends T>, Class<T>) of type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 16)\n" +
- " asString = X.<String> asArray(getIterator(), String.class);\n" +
- " ^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<? extends String>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 18)\n" +
- " Iterator<String> iterator = getIterator();\n" +
- " ^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<String>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 22)\n" +
- " asString = X.<String> asArray((Iterator<String>) getIterator(), String.class);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Iterator to Iterator<String>\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 16)\n" +
+ " asString = X.<String> asArray(getIterator(), String.class);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation asArray(Iterator, Class<String>) of the generic method asArray(Iterator<? extends T>, Class<T>) of type X\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 16)\n" +
+ " asString = X.<String> asArray(getIterator(), String.class);\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<? extends String>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 18)\n" +
+ " Iterator<String> iterator = getIterator();\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<String>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 22)\n" +
+ " asString = X.<String> asArray((Iterator<String>) getIterator(), String.class);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Iterator to Iterator<String>\n" +
+ "----------\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "5. WARNING in X.java (at line 22)\n" +
- " asString = X.<String> asArray((Iterator<String>) getIterator(), String.class);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from Iterator to Iterator<String>\n" +
- "----------\n" +
+ "5. WARNING in X.java (at line 22)\n" +
+ " asString = X.<String> asArray((Iterator<String>) getIterator(), String.class);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unnecessary cast from Iterator to Iterator<String>\n" +
+ "----------\n" +
"6. ERROR in X.java (at line 36)\n"
: // secondary error no longer reported at 1.8+
"5. ERROR in X.java (at line 36)\n"
) +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=263215 - variation
@@ -50911,134 +50911,134 @@ public void test1445() {
this.runNegativeTest(
new String[] {
"X.java", //-----------------------------------------------------------------------
- "import java.io.IOException;\n" +
- "import java.util.List;\n" +
- "\n" +
- "public class X {\n" +
- " <T extends Throwable> X(List<T> lt) throws T { }\n" +
- " <T extends Throwable> List<T> foo(List<T> t) throws T { return t; }\n" +
- "\n" +
- " static void bar(List l) {\n" +
- " new X(l).foo(l);\n" +
- " }\n" +
- " static void baz(List l) throws IOException {\n" +
- " new <IOException> X(l). <IOException> foo(l);\n" +
- " }\n" +
- " \n" +
- " X(List l, long l2) throws IOException {\n" +
- " <IOException> this(l);\n" +
- " }\n" +
- "\n" +
- " static void baz2(List l) throws IOException {\n" +
- " new <IOException> X(l){}. <IOException> foo(l);\n" +
- " }\n" +
- "\n" +
- "}\n",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " static void bar(List l) {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " new X(l).foo(l);\n" +
- " ^^^^^^^^\n" +
- "Type safety: Unchecked invocation X(List) of the generic constructor X(List<T>) of type X\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 9)\n" +
- " new X(l).foo(l);\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation foo(List) of the generic method foo(List<T>) of type X\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " new X(l).foo(l);\n" +
- " ^^^^^^^^\n" +
- "Unhandled exception type Throwable\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 9)\n" +
- " new X(l).foo(l);\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type Throwable\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 9)\n" +
- " new X(l).foo(l);\n" +
- " ^\n" +
+ "import java.io.IOException;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class X {\n" +
+ " <T extends Throwable> X(List<T> lt) throws T { }\n" +
+ " <T extends Throwable> List<T> foo(List<T> t) throws T { return t; }\n" +
+ "\n" +
+ " static void bar(List l) {\n" +
+ " new X(l).foo(l);\n" +
+ " }\n" +
+ " static void baz(List l) throws IOException {\n" +
+ " new <IOException> X(l). <IOException> foo(l);\n" +
+ " }\n" +
+ " \n" +
+ " X(List l, long l2) throws IOException {\n" +
+ " <IOException> this(l);\n" +
+ " }\n" +
+ "\n" +
+ " static void baz2(List l) throws IOException {\n" +
+ " new <IOException> X(l){}. <IOException> foo(l);\n" +
+ " }\n" +
+ "\n" +
+ "}\n",
+ },
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " static void bar(List l) {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " new X(l).foo(l);\n" +
+ " ^^^^^^^^\n" +
+ "Type safety: Unchecked invocation X(List) of the generic constructor X(List<T>) of type X\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 9)\n" +
+ " new X(l).foo(l);\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation foo(List) of the generic method foo(List<T>) of type X\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 9)\n" +
+ " new X(l).foo(l);\n" +
+ " ^^^^^^^^\n" +
+ "Unhandled exception type Throwable\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 9)\n" +
+ " new X(l).foo(l);\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type Throwable\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 9)\n" +
+ " new X(l).foo(l);\n" +
+ " ^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8
? "Type safety: The expression of type List needs unchecked conversion to conform to List<Throwable>\n"
: "Type safety: The expression of type List needs unchecked conversion to conform to List<RuntimeException>\n" ) +
- "----------\n" +
- "7. WARNING in X.java (at line 9)\n" +
- " new X(l).foo(l);\n" +
- " ^\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 9)\n" +
+ " new X(l).foo(l);\n" +
+ " ^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8
? "Type safety: The expression of type List needs unchecked conversion to conform to List<Throwable>\n"
: "Type safety: The expression of type List needs unchecked conversion to conform to List<RuntimeException>\n" ) +
- "----------\n" +
- "8. WARNING in X.java (at line 11)\n" +
- " static void baz(List l) throws IOException {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "9. WARNING in X.java (at line 12)\n" +
- " new <IOException> X(l). <IOException> foo(l);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation X(List) of the generic constructor X(List<T>) of type X\n" +
- "----------\n" +
- "10. WARNING in X.java (at line 12)\n" +
- " new <IOException> X(l). <IOException> foo(l);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation foo(List) of the generic method foo(List<T>) of type X\n" +
- "----------\n" +
- "11. WARNING in X.java (at line 12)\n" +
- " new <IOException> X(l). <IOException> foo(l);\n" +
- " ^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<IOException>\n" +
- "----------\n" +
- "12. WARNING in X.java (at line 12)\n" +
- " new <IOException> X(l). <IOException> foo(l);\n" +
- " ^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<IOException>\n" +
- "----------\n" +
- "13. WARNING in X.java (at line 15)\n" +
- " X(List l, long l2) throws IOException {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "14. WARNING in X.java (at line 16)\n" +
- " <IOException> this(l);\n" +
- " ^^^^^^^^\n" +
- "Type safety: Unchecked invocation X(List) of the generic constructor X(List<T>) of type X\n" +
- "----------\n" +
- "15. WARNING in X.java (at line 16)\n" +
- " <IOException> this(l);\n" +
- " ^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<IOException>\n" +
- "----------\n" +
- "16. WARNING in X.java (at line 19)\n" +
- " static void baz2(List l) throws IOException {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "17. WARNING in X.java (at line 20)\n" +
- " new <IOException> X(l){}. <IOException> foo(l);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation X(List) of the generic constructor X(List<T>) of type X\n" +
- "----------\n" +
- "18. WARNING in X.java (at line 20)\n" +
- " new <IOException> X(l){}. <IOException> foo(l);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation foo(List) of the generic method foo(List<T>) of type X\n" +
- "----------\n" +
- "19. WARNING in X.java (at line 20)\n" +
- " new <IOException> X(l){}. <IOException> foo(l);\n" +
- " ^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<IOException>\n" +
- "----------\n" +
- "20. WARNING in X.java (at line 20)\n" +
- " new <IOException> X(l){}. <IOException> foo(l);\n" +
- " ^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<IOException>\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 11)\n" +
+ " static void baz(List l) throws IOException {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "9. WARNING in X.java (at line 12)\n" +
+ " new <IOException> X(l). <IOException> foo(l);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation X(List) of the generic constructor X(List<T>) of type X\n" +
+ "----------\n" +
+ "10. WARNING in X.java (at line 12)\n" +
+ " new <IOException> X(l). <IOException> foo(l);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation foo(List) of the generic method foo(List<T>) of type X\n" +
+ "----------\n" +
+ "11. WARNING in X.java (at line 12)\n" +
+ " new <IOException> X(l). <IOException> foo(l);\n" +
+ " ^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<IOException>\n" +
+ "----------\n" +
+ "12. WARNING in X.java (at line 12)\n" +
+ " new <IOException> X(l). <IOException> foo(l);\n" +
+ " ^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<IOException>\n" +
+ "----------\n" +
+ "13. WARNING in X.java (at line 15)\n" +
+ " X(List l, long l2) throws IOException {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "14. WARNING in X.java (at line 16)\n" +
+ " <IOException> this(l);\n" +
+ " ^^^^^^^^\n" +
+ "Type safety: Unchecked invocation X(List) of the generic constructor X(List<T>) of type X\n" +
+ "----------\n" +
+ "15. WARNING in X.java (at line 16)\n" +
+ " <IOException> this(l);\n" +
+ " ^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<IOException>\n" +
+ "----------\n" +
+ "16. WARNING in X.java (at line 19)\n" +
+ " static void baz2(List l) throws IOException {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "17. WARNING in X.java (at line 20)\n" +
+ " new <IOException> X(l){}. <IOException> foo(l);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation X(List) of the generic constructor X(List<T>) of type X\n" +
+ "----------\n" +
+ "18. WARNING in X.java (at line 20)\n" +
+ " new <IOException> X(l){}. <IOException> foo(l);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation foo(List) of the generic method foo(List<T>) of type X\n" +
+ "----------\n" +
+ "19. WARNING in X.java (at line 20)\n" +
+ " new <IOException> X(l){}. <IOException> foo(l);\n" +
+ " ^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<IOException>\n" +
+ "----------\n" +
+ "20. WARNING in X.java (at line 20)\n" +
+ " new <IOException> X(l){}. <IOException> foo(l);\n" +
+ " ^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<IOException>\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=202393
@@ -51046,7 +51046,7 @@ public void test1446() {
this.runConformTest(
new String[] {
"Bug202393.java",
- "public class Bug202393 {\n" +
+ "public class Bug202393 {\n" +
" static <T> T id(T in) { return in; }\n" +
" public static void main(String[] args) {\n" +
" try {" +
@@ -51067,21 +51067,21 @@ public void test1447() {
this.runConformTest(
new String[] {
"X.java",
- "public abstract class X implements Visitable {\n" +
- " public <T, U extends Visitor<T>> T accept(U v) {\n" +
- " return null;\n" +
- " }\n" +
- " public <T, U extends Visitor<T>> T accept2(U v) {\n" +
- " if (v == null)\n" +
- " return this.accept(v);\n" +
- " else \n" +
- " return this.<T, U> accept(v);\n" +
- " }\n" +
- "}\n" +
- "interface Visitable {\n" +
- " <T, U extends Visitor<T>> T accept(U v);\n" +
- "}\n" +
- "interface Visitor<T> {\n" +
+ "public abstract class X implements Visitable {\n" +
+ " public <T, U extends Visitor<T>> T accept(U v) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public <T, U extends Visitor<T>> T accept2(U v) {\n" +
+ " if (v == null)\n" +
+ " return this.accept(v);\n" +
+ " else \n" +
+ " return this.<T, U> accept(v);\n" +
+ " }\n" +
+ "}\n" +
+ "interface Visitable {\n" +
+ " <T, U extends Visitor<T>> T accept(U v);\n" +
+ "}\n" +
+ "interface Visitor<T> {\n" +
"}\n",
},
""
@@ -51093,21 +51093,21 @@ public void test1448() {
this.runConformTest(
new String[] {
"X.java",
- "public abstract class X implements Visitable {\n" +
- " public <T, U extends Visitor> T accept(U v) {\n" +
- " return null;\n" +
- " }\n" +
- " public <T, U extends Visitor> T accept2(U v) {\n" +
- " if (v == null)\n" +
- " return this.accept(v);\n" +
- " else \n" +
- " return this.<T, U> accept(v);\n" +
- " }\n" +
- "}\n" +
- "interface Visitable {\n" +
- " <T, U extends Visitor> T accept(U v);\n" +
- "}\n" +
- "interface Visitor{\n" +
+ "public abstract class X implements Visitable {\n" +
+ " public <T, U extends Visitor> T accept(U v) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public <T, U extends Visitor> T accept2(U v) {\n" +
+ " if (v == null)\n" +
+ " return this.accept(v);\n" +
+ " else \n" +
+ " return this.<T, U> accept(v);\n" +
+ " }\n" +
+ "}\n" +
+ "interface Visitable {\n" +
+ " <T, U extends Visitor> T accept(U v);\n" +
+ "}\n" +
+ "interface Visitor{\n" +
"}\n",
},
""
@@ -51118,20 +51118,20 @@ public void test1449() {
this.runConformTest(
new String[] {
"X.java",
- "interface Visitor<T, C, O, P, EL, PM, S, COA, SSA, CT> {\n" +
- "}\n" +
- "public class X<U> {\n" +
- " public <T, U extends Visitor<T, ?, ?, ?, ?, ?, ?, ?, ?, ?>> T accept(U v) {\n" +
- " throw new UnsupportedOperationException();\n" +
- " }\n" +
- "}\n" +
- "class Y<V> extends X<V> {\n" +
- " public <T, U extends Visitor<T, ?, ?, ?, ?, ?, ?, ?, ?, ?>> T accept(U v) {\n" +
- " if (v == null)\n" +
- " return super.accept(v);\n" +
- " else\n" +
- " return super.<T, U> accept(v);\n" +
- " }\n" +
+ "interface Visitor<T, C, O, P, EL, PM, S, COA, SSA, CT> {\n" +
+ "}\n" +
+ "public class X<U> {\n" +
+ " public <T, U extends Visitor<T, ?, ?, ?, ?, ?, ?, ?, ?, ?>> T accept(U v) {\n" +
+ " throw new UnsupportedOperationException();\n" +
+ " }\n" +
+ "}\n" +
+ "class Y<V> extends X<V> {\n" +
+ " public <T, U extends Visitor<T, ?, ?, ?, ?, ?, ?, ?, ?, ?>> T accept(U v) {\n" +
+ " if (v == null)\n" +
+ " return super.accept(v);\n" +
+ " else\n" +
+ " return super.<T, U> accept(v);\n" +
+ " }\n" +
"}\n",
},
""
@@ -51151,26 +51151,26 @@ public void test1450() {
"class E<T extends Number> {}\n" +
"class Y<T> extends E<D<T>> {}",
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " class X<T extends ArrayList<B<Integer>>> extends TreeMap<Integer, B<String>> {}\n" +
- " ^\n" +
- "The serializable class X does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " class X<T extends ArrayList<B<Integer>>> extends TreeMap<Integer, B<String>> {}\n" +
- " ^^^^^^^\n" +
- "Bound mismatch: The type Integer is not a valid substitute for the bounded parameter <T extends A> of the type B<T>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " class X<T extends ArrayList<B<Integer>>> extends TreeMap<Integer, B<String>> {}\n" +
- " ^^^^^^\n" +
- "Bound mismatch: The type String is not a valid substitute for the bounded parameter <T extends A> of the type B<T>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " class Y<T> extends E<D<T>> {}\n" +
- " ^\n" +
- "Bound mismatch: The type D<T> is not a valid substitute for the bounded parameter <T extends Number> of the type E<T>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " class X<T extends ArrayList<B<Integer>>> extends TreeMap<Integer, B<String>> {}\n" +
+ " ^\n" +
+ "The serializable class X does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " class X<T extends ArrayList<B<Integer>>> extends TreeMap<Integer, B<String>> {}\n" +
+ " ^^^^^^^\n" +
+ "Bound mismatch: The type Integer is not a valid substitute for the bounded parameter <T extends A> of the type B<T>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " class X<T extends ArrayList<B<Integer>>> extends TreeMap<Integer, B<String>> {}\n" +
+ " ^^^^^^\n" +
+ "Bound mismatch: The type String is not a valid substitute for the bounded parameter <T extends A> of the type B<T>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " class Y<T> extends E<D<T>> {}\n" +
+ " ^\n" +
+ "Bound mismatch: The type D<T> is not a valid substitute for the bounded parameter <T extends Number> of the type E<T>\n" +
"----------\n"
);
}
@@ -51186,31 +51186,31 @@ public void test1451() {
"class Y<T> extends A<A<B<T>>> {}\n" +
"class Z<T> extends C<B<T>, A<B<T>>> {}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " class X<T1, T2> extends C<A<A<B<T1>>>, A<B<T2>>> {}\n" +
- " ^^\n" +
- "Bound mismatch: The type T1 is not a valid substitute for the bounded parameter <T2 extends Number> of the type B<T2>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " class X<T1, T2> extends C<A<A<B<T1>>>, A<B<T2>>> {}\n" +
- " ^^\n" +
- "Bound mismatch: The type T2 is not a valid substitute for the bounded parameter <T2 extends Number> of the type B<T2>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " class Y<T> extends A<A<B<T>>> {}\n" +
- " ^\n" +
- "Bound mismatch: The type T is not a valid substitute for the bounded parameter <T2 extends Number> of the type B<T2>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " class Z<T> extends C<B<T>, A<B<T>>> {}\n" +
- " ^\n" +
- "Bound mismatch: The type T is not a valid substitute for the bounded parameter <T2 extends Number> of the type B<T2>\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 6)\n" +
- " class Z<T> extends C<B<T>, A<B<T>>> {}\n" +
- " ^\n" +
- "Bound mismatch: The type T is not a valid substitute for the bounded parameter <T2 extends Number> of the type B<T2>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " class X<T1, T2> extends C<A<A<B<T1>>>, A<B<T2>>> {}\n" +
+ " ^^\n" +
+ "Bound mismatch: The type T1 is not a valid substitute for the bounded parameter <T2 extends Number> of the type B<T2>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " class X<T1, T2> extends C<A<A<B<T1>>>, A<B<T2>>> {}\n" +
+ " ^^\n" +
+ "Bound mismatch: The type T2 is not a valid substitute for the bounded parameter <T2 extends Number> of the type B<T2>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " class Y<T> extends A<A<B<T>>> {}\n" +
+ " ^\n" +
+ "Bound mismatch: The type T is not a valid substitute for the bounded parameter <T2 extends Number> of the type B<T2>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " class Z<T> extends C<B<T>, A<B<T>>> {}\n" +
+ " ^\n" +
+ "Bound mismatch: The type T is not a valid substitute for the bounded parameter <T2 extends Number> of the type B<T2>\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 6)\n" +
+ " class Z<T> extends C<B<T>, A<B<T>>> {}\n" +
+ " ^\n" +
+ "Bound mismatch: The type T is not a valid substitute for the bounded parameter <T2 extends Number> of the type B<T2>\n" +
"----------\n"
);
}
@@ -51236,16 +51236,16 @@ public void test1452() {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in A.java (at line 2)\n" +
- " class B extends A<B.Secret> {\n" +
- " ^^^^^^^^\n" +
- "The type B.Secret is not visible\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 7)\n" +
- " class C extends B.Secret {}\n" +
- " ^^^^^^^^\n" +
- "The type B.Secret is not visible\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 2)\n" +
+ " class B extends A<B.Secret> {\n" +
+ " ^^^^^^^^\n" +
+ "The type B.Secret is not visible\n" +
+ "----------\n" +
+ "2. ERROR in A.java (at line 7)\n" +
+ " class C extends B.Secret {}\n" +
+ " ^^^^^^^^\n" +
+ "The type B.Secret is not visible\n" +
"----------\n"
);
}
@@ -51260,16 +51260,16 @@ public void test1453() {
"class Y implements I<?> {}\n" +
"interface I<T> {}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " I<?> i = new I<?>() {};\n" +
- " ^\n" +
- "The type new I(){} cannot extend or implement I<?>. A supertype may not specify any wildcard\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " class Y implements I<?> {}\n" +
- " ^\n" +
- "The type Y cannot extend or implement I<?>. A supertype may not specify any wildcard\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " I<?> i = new I<?>() {};\n" +
+ " ^\n" +
+ "The type new I(){} cannot extend or implement I<?>. A supertype may not specify any wildcard\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " class Y implements I<?> {}\n" +
+ " ^\n" +
+ "The type Y cannot extend or implement I<?>. A supertype may not specify any wildcard\n" +
"----------\n"
);
}
@@ -51325,11 +51325,11 @@ public void test1455() {
" }\n" +
"}"
},
- "----------\n" +
- "1. WARNING in Outer.java (at line 8)\n" +
- " Inner that = (Inner) other;\n" +
- " ^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to Outer<E>.Inner\n" +
+ "----------\n" +
+ "1. WARNING in Outer.java (at line 8)\n" +
+ " Inner that = (Inner) other;\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to Outer<E>.Inner\n" +
"----------\n"
);
}
@@ -51338,19 +51338,19 @@ public void test1456() {
this.runConformTest(
new String[] {
"X.java",
- "import java.util.ArrayList;\n" +
- "\n" +
- "public class X<K,V> {\n" +
- " interface E<V> {}\n" +
- " class S implements E<V> {\n" +
- " V value;\n" +
- " }\n" +
- " class M implements E<V> {\n" +
- " ArrayList<V> list = new ArrayList<V>();\n" +
- " M(E<V> se) {\n" +
- " list.add(((S)se).value);\n" +
- " }\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "\n" +
+ "public class X<K,V> {\n" +
+ " interface E<V> {}\n" +
+ " class S implements E<V> {\n" +
+ " V value;\n" +
+ " }\n" +
+ " class M implements E<V> {\n" +
+ " ArrayList<V> list = new ArrayList<V>();\n" +
+ " M(E<V> se) {\n" +
+ " list.add(((S)se).value);\n" +
+ " }\n" +
+ " }\n" +
"}"
},
""
@@ -51416,29 +51416,29 @@ public void test1458() {
" }\n",
},
this.complianceLevel <= ClassFileConstants.JDK1_6 ?
- "----------\n" +
- "1. ERROR in CompilerBug.java (at line 23)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in CompilerBug.java (at line 23)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n" :
-
+
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=334622
- "----------\n" +
- "1. ERROR in CompilerBug.java (at line 18)\n" +
- " getClass().newInstance().privateMethod();\n" +
- " ^^^^^^^^^^^^^\n" +
- "The method privateMethod() from the type CompilerBug is not visible\n" +
- "----------\n" +
- "2. ERROR in CompilerBug.java (at line 20)\n" +
- " getClass().newInstance().privateInt = 10;\n" +
- " ^^^^^^^^^^\n" +
- "The field CompilerBug.privateInt is not visible\n" +
- "----------\n" +
- "3. ERROR in CompilerBug.java (at line 23)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in CompilerBug.java (at line 18)\n" +
+ " getClass().newInstance().privateMethod();\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The method privateMethod() from the type CompilerBug is not visible\n" +
+ "----------\n" +
+ "2. ERROR in CompilerBug.java (at line 20)\n" +
+ " getClass().newInstance().privateInt = 10;\n" +
+ " ^^^^^^^^^^\n" +
+ "The field CompilerBug.privateInt is not visible\n" +
+ "----------\n" +
+ "3. ERROR in CompilerBug.java (at line 23)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n"
);
}
@@ -51447,17 +51447,17 @@ public void test1459() {
this.runConformTest(
new String[] {
"B.java",
- "import java.util.Collection;\n" +
- "public class B extends X<Collection<?>> {\n" +
- " public B(Collection<X<?>> c, I i) {\n" +
- " super(c, i);\n" +
- " }\n" +
+ "import java.util.Collection;\n" +
+ "public class B extends X<Collection<?>> {\n" +
+ " public B(Collection<X<?>> c, I i) {\n" +
+ " super(c, i);\n" +
+ " }\n" +
"}",
"I.java",
"public interface I<T>{}",
"X.java",
- "public class X<T> {\n" +
- " public <V extends T> X(V v, I<T> i, Object... o) {}\n" +
+ "public class X<T> {\n" +
+ " public <V extends T> X(V v, I<T> i, Object... o) {}\n" +
"}"
},
""); // no specific success output string
@@ -51499,16 +51499,16 @@ public void test277643() {
"public abstract class Logic extends AbstractLogic {}\n" +
"}"
},
- "----------\n" +
- "1. WARNING in Test.java (at line 4)\n" +
- " W_Description wdescription = get(W_Description.class, object);\n" +
- " ^^^^^^^^^^^^^\n" +
- "Test.W_Description is a raw type. References to generic type Test.W_Description<WRAPPED> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in Test.java (at line 4)\n" +
- " W_Description wdescription = get(W_Description.class, object);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation get(Class<Test.W_Description>, Object) of the generic method get(Class<W>, T) of type Test\n" +
+ "----------\n" +
+ "1. WARNING in Test.java (at line 4)\n" +
+ " W_Description wdescription = get(W_Description.class, object);\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Test.W_Description is a raw type. References to generic type Test.W_Description<WRAPPED> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in Test.java (at line 4)\n" +
+ " W_Description wdescription = get(W_Description.class, object);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation get(Class<Test.W_Description>, Object) of the generic method get(Class<W>, T) of type Test\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=280054
@@ -51539,26 +51539,26 @@ public void test280054() {
"}\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " return l.get(vtype(), B.class);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation get(Class<V>, Class<X.B>) of the generic method get(Class<V>, Class<S>) of type X.L\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " return l.get(vtype(), B.class);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type X.B needs unchecked conversion to conform to X.A<V>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 18)\n" +
- " return l.get(vtype(), B.class);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation get(Class<V>, Class<X.B>) of the generic method get(Class<V>, Class<S>) of type X.L\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 18)\n" +
- " return l.get(vtype(), B.class);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type X.B needs unchecked conversion to conform to X.B<V>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " return l.get(vtype(), B.class);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation get(Class<V>, Class<X.B>) of the generic method get(Class<V>, Class<S>) of type X.L\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " return l.get(vtype(), B.class);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type X.B needs unchecked conversion to conform to X.A<V>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 18)\n" +
+ " return l.get(vtype(), B.class);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation get(Class<V>, Class<X.B>) of the generic method get(Class<V>, Class<S>) of type X.L\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 18)\n" +
+ " return l.get(vtype(), B.class);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type X.B needs unchecked conversion to conform to X.B<V>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=283306
@@ -51583,16 +51583,16 @@ public void test283306() {
"class WWorkflow<T extends Workflow> extends WrapperLogic<T> {}\n" +
"abstract class WrapperLogic<WRAPPED> {}\n"
},
- "----------\n" +
- "1. WARNING in Test.java (at line 3)\n" +
- " return get(WWorkflow.class, null);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation get(Class<WWorkflow>, null) of the generic method get(Class<W>, T) of type Test\n" +
- "----------\n" +
- "2. WARNING in Test.java (at line 3)\n" +
- " return get(WWorkflow.class, null);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type WWorkflow needs unchecked conversion to conform to WWorkflow<? extends Workflow>\n" +
+ "----------\n" +
+ "1. WARNING in Test.java (at line 3)\n" +
+ " return get(WWorkflow.class, null);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation get(Class<WWorkflow>, null) of the generic method get(Class<W>, T) of type Test\n" +
+ "----------\n" +
+ "2. WARNING in Test.java (at line 3)\n" +
+ " return get(WWorkflow.class, null);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type WWorkflow needs unchecked conversion to conform to WWorkflow<? extends Workflow>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=294724
@@ -51620,16 +51620,16 @@ public void test294724() {
" private class Data implements Interface {}\n" +
"}"
},
- "----------\n" +
- "1. WARNING in SimpleExample.java (at line 10)\n" +
- " clone.setData(cloneCollection(data, HashSet.class, Data.class));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation cloneCollection(Set<SimpleExample.Data>, Class<HashSet>, Class<SimpleExample.Data>) of the generic method cloneCollection(T, Class<? extends T>, Class<U>) of type SimpleExample\n" +
- "----------\n" +
- "2. WARNING in SimpleExample.java (at line 10)\n" +
- " clone.setData(cloneCollection(data, HashSet.class, Data.class));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Set needs unchecked conversion to conform to Set<SimpleExample.Data>\n" +
+ "----------\n" +
+ "1. WARNING in SimpleExample.java (at line 10)\n" +
+ " clone.setData(cloneCollection(data, HashSet.class, Data.class));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation cloneCollection(Set<SimpleExample.Data>, Class<HashSet>, Class<SimpleExample.Data>) of the generic method cloneCollection(T, Class<? extends T>, Class<U>) of type SimpleExample\n" +
+ "----------\n" +
+ "2. WARNING in SimpleExample.java (at line 10)\n" +
+ " clone.setData(cloneCollection(data, HashSet.class, Data.class));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Set needs unchecked conversion to conform to Set<SimpleExample.Data>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=268798
@@ -51651,16 +51651,16 @@ public void test268798() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in GenericDemo.java (at line 4)\n" +
- " static class A implements Comparable {\n" +
- " ^^^^^^^^^^\n" +
- "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in GenericDemo.java (at line 10)\n" +
- " A min = Collections.min(list); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation min(List<GenericDemo.A>) of the generic method min(Collection<? extends T>) of type Collections\n" +
+ "----------\n" +
+ "1. WARNING in GenericDemo.java (at line 4)\n" +
+ " static class A implements Comparable {\n" +
+ " ^^^^^^^^^^\n" +
+ "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in GenericDemo.java (at line 10)\n" +
+ " A min = Collections.min(list); \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation min(List<GenericDemo.A>) of the generic method min(Collection<? extends T>) of type Collections\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=268798
@@ -51682,16 +51682,16 @@ public void test268798a() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in Bug268798.java (at line 4)\n" +
- " class A implements SomeInterface {\n" +
- " ^^^^^^^^^^^^^\n" +
- "Bug268798.SomeInterface is a raw type. References to generic type Bug268798.SomeInterface<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in Bug268798.java (at line 10)\n" +
- " A a = someMethod();\n" +
- " ^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation someMethod() of the generic method someMethod() of type Bug268798\n" +
+ "----------\n" +
+ "1. WARNING in Bug268798.java (at line 4)\n" +
+ " class A implements SomeInterface {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Bug268798.SomeInterface is a raw type. References to generic type Bug268798.SomeInterface<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in Bug268798.java (at line 10)\n" +
+ " A a = someMethod();\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation someMethod() of the generic method someMethod() of type Bug268798\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=307885
@@ -51699,26 +51699,26 @@ public void test1460() {
this.runNegativeTest(
new String[] {
"Test.java",
- "class Test<A> {\n" +
- " interface MyInt<K> {\n" +
- " K getKey();\n" +
- " }\n" +
- " class MyEntry implements MyInt<A> {\n" +
- " public A getKey() { return null; }\n" +
- " @Override\n" +
- " public boolean equals(Object o) {\n" +
- " if(!(o instanceof MyEntry))\n" +
- " return false;\n" +
- " return true;\n" +
- " }\n" +
- " }\n" +
+ "class Test<A> {\n" +
+ " interface MyInt<K> {\n" +
+ " K getKey();\n" +
+ " }\n" +
+ " class MyEntry implements MyInt<A> {\n" +
+ " public A getKey() { return null; }\n" +
+ " @Override\n" +
+ " public boolean equals(Object o) {\n" +
+ " if(!(o instanceof MyEntry))\n" +
+ " return false;\n" +
+ " return true;\n" +
+ " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 9)\n" +
- " if(!(o instanceof MyEntry))\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot perform instanceof check against parameterized type Test<A>.MyEntry. Use the form Test.MyEntry instead since further generic type information will be erased at runtime\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 9)\n" +
+ " if(!(o instanceof MyEntry))\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot perform instanceof check against parameterized type Test<A>.MyEntry. Use the form Test.MyEntry instead since further generic type information will be erased at runtime\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=306464
@@ -51726,318 +51726,318 @@ public void test1461() {
this.runNegativeTest(
new String[] {
"JoinImpl.java",
- "import javax.persistence.criteria.Expression;\n" +
- "import javax.persistence.criteria.Fetch;\n" +
- "import javax.persistence.criteria.From;\n" +
- "import javax.persistence.criteria.Join;\n" +
- "import javax.persistence.criteria.JoinType;\n" +
- "import javax.persistence.criteria.Path;\n" +
- "import javax.persistence.metamodel.Attribute;\n" +
- "import javax.persistence.metamodel.Bindable;\n" +
- "import javax.persistence.metamodel.ManagedType;\n" +
- "import javax.persistence.metamodel.Metamodel;\n" +
- "public class JoinImpl<Z, X> extends FromImpl<Z, X> implements Join<Z, X>, Fetch<Z, X> {\n" +
+ "import javax.persistence.criteria.Expression;\n" +
+ "import javax.persistence.criteria.Fetch;\n" +
+ "import javax.persistence.criteria.From;\n" +
+ "import javax.persistence.criteria.Join;\n" +
+ "import javax.persistence.criteria.JoinType;\n" +
+ "import javax.persistence.criteria.Path;\n" +
+ "import javax.persistence.metamodel.Attribute;\n" +
+ "import javax.persistence.metamodel.Bindable;\n" +
+ "import javax.persistence.metamodel.ManagedType;\n" +
+ "import javax.persistence.metamodel.Metamodel;\n" +
+ "public class JoinImpl<Z, X> extends FromImpl<Z, X> implements Join<Z, X>, Fetch<Z, X> {\n" +
"}",
"FromImpl.java",
- "import java.util.ArrayList;\n" +
- "import java.util.HashSet;\n" +
- "import java.util.List;\n" +
- "import java.util.Set;\n" +
- "import java.util.Stack;\n" +
- "\n" +
- "import javax.persistence.criteria.CollectionJoin;\n" +
- "import javax.persistence.criteria.Expression;\n" +
- "import javax.persistence.criteria.Fetch;\n" +
- "import javax.persistence.criteria.From;\n" +
- "import javax.persistence.criteria.Join;\n" +
- "import javax.persistence.criteria.JoinType;\n" +
- "import javax.persistence.criteria.ListJoin;\n" +
- "import javax.persistence.criteria.MapJoin;\n" +
- "import javax.persistence.criteria.Path;\n" +
- "import javax.persistence.criteria.SetJoin;\n" +
- "import javax.persistence.metamodel.Attribute;\n" +
- "import javax.persistence.metamodel.Bindable;\n" +
- "import javax.persistence.metamodel.CollectionAttribute;\n" +
- "import javax.persistence.metamodel.ListAttribute;\n" +
- "import javax.persistence.metamodel.ManagedType;\n" +
- "import javax.persistence.metamodel.MapAttribute;\n" +
- "import javax.persistence.metamodel.Metamodel;\n" +
- "import javax.persistence.metamodel.PluralAttribute;\n" +
- "import javax.persistence.metamodel.SingularAttribute;\n" +
- "import javax.persistence.metamodel.Attribute.PersistentAttributeType;\n" +
- "import javax.persistence.metamodel.PluralAttribute.CollectionType;\n" +
- "import javax.persistence.metamodel.Type.PersistenceType;\n" +
- "\n" +
- "import org.eclipse.persistence.internal.helper.ClassConstants;\n" +
- "import org.eclipse.persistence.internal.localization.ExceptionLocalization;\n" +
- "\n" +
- "public class FromImpl<Z, X> extends PathImpl<X> implements javax.persistence.criteria.From<Z, X> {\n" +
- "\n" +
- " protected Set<Join<X, ?>> joins;\n" +
- " \n" +
- " public Set<Join<X, ?>> getJoins() {\n" +
- " return joins;\n" +
- " }\n" +
- "\n" +
- " public void findJoins(AbstractQueryImpl query){\n" +
- " Stack stack = new Stack();\n" +
- " stack.push(this);\n" +
- " while(!stack.isEmpty()){\n" +
- " FromImpl currentJoin = (FromImpl) stack.pop();\n" +
- " stack.addAll(currentJoin.getJoins());\n" +
- " if (currentJoin.isLeaf){\n" +
- " query.addJoin(currentJoin);\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.HashSet;\n" +
+ "import java.util.List;\n" +
+ "import java.util.Set;\n" +
+ "import java.util.Stack;\n" +
+ "\n" +
+ "import javax.persistence.criteria.CollectionJoin;\n" +
+ "import javax.persistence.criteria.Expression;\n" +
+ "import javax.persistence.criteria.Fetch;\n" +
+ "import javax.persistence.criteria.From;\n" +
+ "import javax.persistence.criteria.Join;\n" +
+ "import javax.persistence.criteria.JoinType;\n" +
+ "import javax.persistence.criteria.ListJoin;\n" +
+ "import javax.persistence.criteria.MapJoin;\n" +
+ "import javax.persistence.criteria.Path;\n" +
+ "import javax.persistence.criteria.SetJoin;\n" +
+ "import javax.persistence.metamodel.Attribute;\n" +
+ "import javax.persistence.metamodel.Bindable;\n" +
+ "import javax.persistence.metamodel.CollectionAttribute;\n" +
+ "import javax.persistence.metamodel.ListAttribute;\n" +
+ "import javax.persistence.metamodel.ManagedType;\n" +
+ "import javax.persistence.metamodel.MapAttribute;\n" +
+ "import javax.persistence.metamodel.Metamodel;\n" +
+ "import javax.persistence.metamodel.PluralAttribute;\n" +
+ "import javax.persistence.metamodel.SingularAttribute;\n" +
+ "import javax.persistence.metamodel.Attribute.PersistentAttributeType;\n" +
+ "import javax.persistence.metamodel.PluralAttribute.CollectionType;\n" +
+ "import javax.persistence.metamodel.Type.PersistenceType;\n" +
+ "\n" +
+ "import org.eclipse.persistence.internal.helper.ClassConstants;\n" +
+ "import org.eclipse.persistence.internal.localization.ExceptionLocalization;\n" +
+ "\n" +
+ "public class FromImpl<Z, X> extends PathImpl<X> implements javax.persistence.criteria.From<Z, X> {\n" +
+ "\n" +
+ " protected Set<Join<X, ?>> joins;\n" +
+ " \n" +
+ " public Set<Join<X, ?>> getJoins() {\n" +
+ " return joins;\n" +
+ " }\n" +
+ "\n" +
+ " public void findJoins(AbstractQueryImpl query){\n" +
+ " Stack stack = new Stack();\n" +
+ " stack.push(this);\n" +
+ " while(!stack.isEmpty()){\n" +
+ " FromImpl currentJoin = (FromImpl) stack.pop();\n" +
+ " stack.addAll(currentJoin.getJoins());\n" +
+ " if (currentJoin.isLeaf){\n" +
+ " query.addJoin(currentJoin);\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in JoinImpl.java (at line 1)\n" +
- " import javax.persistence.criteria.Expression;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in JoinImpl.java (at line 2)\n" +
- " import javax.persistence.criteria.Fetch;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "3. ERROR in JoinImpl.java (at line 3)\n" +
- " import javax.persistence.criteria.From;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "4. ERROR in JoinImpl.java (at line 4)\n" +
- " import javax.persistence.criteria.Join;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "5. ERROR in JoinImpl.java (at line 5)\n" +
- " import javax.persistence.criteria.JoinType;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "6. ERROR in JoinImpl.java (at line 6)\n" +
- " import javax.persistence.criteria.Path;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "7. ERROR in JoinImpl.java (at line 7)\n" +
- " import javax.persistence.metamodel.Attribute;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "8. ERROR in JoinImpl.java (at line 8)\n" +
- " import javax.persistence.metamodel.Bindable;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "9. ERROR in JoinImpl.java (at line 9)\n" +
- " import javax.persistence.metamodel.ManagedType;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "10. ERROR in JoinImpl.java (at line 10)\n" +
- " import javax.persistence.metamodel.Metamodel;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "11. ERROR in JoinImpl.java (at line 11)\n" +
- " public class JoinImpl<Z, X> extends FromImpl<Z, X> implements Join<Z, X>, Fetch<Z, X> {\n" +
- " ^^^^\n" +
- "Join cannot be resolved to a type\n" +
- "----------\n" +
- "12. ERROR in JoinImpl.java (at line 11)\n" +
- " public class JoinImpl<Z, X> extends FromImpl<Z, X> implements Join<Z, X>, Fetch<Z, X> {\n" +
- " ^^^^^\n" +
- "Fetch cannot be resolved to a type\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in FromImpl.java (at line 7)\n" +
- " import javax.persistence.criteria.CollectionJoin;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in FromImpl.java (at line 8)\n" +
- " import javax.persistence.criteria.Expression;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "3. ERROR in FromImpl.java (at line 9)\n" +
- " import javax.persistence.criteria.Fetch;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "4. ERROR in FromImpl.java (at line 10)\n" +
- " import javax.persistence.criteria.From;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "5. ERROR in FromImpl.java (at line 11)\n" +
- " import javax.persistence.criteria.Join;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "6. ERROR in FromImpl.java (at line 12)\n" +
- " import javax.persistence.criteria.JoinType;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "7. ERROR in FromImpl.java (at line 13)\n" +
- " import javax.persistence.criteria.ListJoin;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "8. ERROR in FromImpl.java (at line 14)\n" +
- " import javax.persistence.criteria.MapJoin;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "9. ERROR in FromImpl.java (at line 15)\n" +
- " import javax.persistence.criteria.Path;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "10. ERROR in FromImpl.java (at line 16)\n" +
- " import javax.persistence.criteria.SetJoin;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "11. ERROR in FromImpl.java (at line 17)\n" +
- " import javax.persistence.metamodel.Attribute;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "12. ERROR in FromImpl.java (at line 18)\n" +
- " import javax.persistence.metamodel.Bindable;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "13. ERROR in FromImpl.java (at line 19)\n" +
- " import javax.persistence.metamodel.CollectionAttribute;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "14. ERROR in FromImpl.java (at line 20)\n" +
- " import javax.persistence.metamodel.ListAttribute;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "15. ERROR in FromImpl.java (at line 21)\n" +
- " import javax.persistence.metamodel.ManagedType;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "16. ERROR in FromImpl.java (at line 22)\n" +
- " import javax.persistence.metamodel.MapAttribute;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "17. ERROR in FromImpl.java (at line 23)\n" +
- " import javax.persistence.metamodel.Metamodel;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "18. ERROR in FromImpl.java (at line 24)\n" +
- " import javax.persistence.metamodel.PluralAttribute;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "19. ERROR in FromImpl.java (at line 25)\n" +
- " import javax.persistence.metamodel.SingularAttribute;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "20. ERROR in FromImpl.java (at line 26)\n" +
- " import javax.persistence.metamodel.Attribute.PersistentAttributeType;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "21. ERROR in FromImpl.java (at line 27)\n" +
- " import javax.persistence.metamodel.PluralAttribute.CollectionType;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "22. ERROR in FromImpl.java (at line 28)\n" +
- " import javax.persistence.metamodel.Type.PersistenceType;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import javax.persistence cannot be resolved\n" +
- "----------\n" +
- "23. ERROR in FromImpl.java (at line 30)\n" +
- " import org.eclipse.persistence.internal.helper.ClassConstants;\n" +
- " ^^^^^^^^^^^\n" +
- "The import org.eclipse cannot be resolved\n" +
- "----------\n" +
- "24. ERROR in FromImpl.java (at line 31)\n" +
- " import org.eclipse.persistence.internal.localization.ExceptionLocalization;\n" +
- " ^^^^^^^^^^^\n" +
- "The import org.eclipse cannot be resolved\n" +
- "----------\n" +
- "25. ERROR in FromImpl.java (at line 33)\n" +
- " public class FromImpl<Z, X> extends PathImpl<X> implements javax.persistence.criteria.From<Z, X> {\n" +
- " ^^^^^^^^\n" +
- "PathImpl cannot be resolved to a type\n" +
- "----------\n" +
- "26. ERROR in FromImpl.java (at line 33)\n" +
- " public class FromImpl<Z, X> extends PathImpl<X> implements javax.persistence.criteria.From<Z, X> {\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "javax.persistence cannot be resolved to a type\n" +
- "----------\n" +
- "27. ERROR in FromImpl.java (at line 35)\n" +
- " protected Set<Join<X, ?>> joins;\n" +
- " ^^^^\n" +
- "Join cannot be resolved to a type\n" +
- "----------\n" +
- "28. ERROR in FromImpl.java (at line 37)\n" +
- " public Set<Join<X, ?>> getJoins() {\n" +
- " ^^^^\n" +
- "Join cannot be resolved to a type\n" +
- "----------\n" +
- "29. ERROR in FromImpl.java (at line 38)\n" +
- " return joins;\n" +
- " ^^^^^\n" +
- "Join cannot be resolved to a type\n" +
- "----------\n" +
- "30. ERROR in FromImpl.java (at line 41)\n" +
- " public void findJoins(AbstractQueryImpl query){\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "AbstractQueryImpl cannot be resolved to a type\n" +
- "----------\n" +
- "31. WARNING in FromImpl.java (at line 42)\n" +
- " Stack stack = new Stack();\n" +
- " ^^^^^\n" +
- "Stack is a raw type. References to generic type Stack<E> should be parameterized\n" +
- "----------\n" +
- "32. WARNING in FromImpl.java (at line 42)\n" +
- " Stack stack = new Stack();\n" +
- " ^^^^^\n" +
- "Stack is a raw type. References to generic type Stack<E> should be parameterized\n" +
- "----------\n" +
- "33. WARNING in FromImpl.java (at line 43)\n" +
- " stack.push(this);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method push(Object) belongs to the raw type Stack. References to generic type Stack<E> should be parameterized\n" +
- "----------\n" +
- "34. WARNING in FromImpl.java (at line 45)\n" +
- " FromImpl currentJoin = (FromImpl) stack.pop();\n" +
- " ^^^^^^^^\n" +
- "FromImpl is a raw type. References to generic type FromImpl<Z,X> should be parameterized\n" +
- "----------\n" +
- "35. WARNING in FromImpl.java (at line 45)\n" +
- " FromImpl currentJoin = (FromImpl) stack.pop();\n" +
- " ^^^^^^^^\n" +
- "FromImpl is a raw type. References to generic type FromImpl<Z,X> should be parameterized\n" +
- "----------\n" +
- "36. WARNING in FromImpl.java (at line 46)\n" +
- " stack.addAll(currentJoin.getJoins());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method addAll(Collection) belongs to the raw type Vector. References to generic type Vector<E> should be parameterized\n" +
- "----------\n" +
- "37. ERROR in FromImpl.java (at line 47)\n" +
- " if (currentJoin.isLeaf){\n" +
- " ^^^^^^\n" +
- "isLeaf cannot be resolved or is not a field\n" +
+ "----------\n" +
+ "1. ERROR in JoinImpl.java (at line 1)\n" +
+ " import javax.persistence.criteria.Expression;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "2. ERROR in JoinImpl.java (at line 2)\n" +
+ " import javax.persistence.criteria.Fetch;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "3. ERROR in JoinImpl.java (at line 3)\n" +
+ " import javax.persistence.criteria.From;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "4. ERROR in JoinImpl.java (at line 4)\n" +
+ " import javax.persistence.criteria.Join;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "5. ERROR in JoinImpl.java (at line 5)\n" +
+ " import javax.persistence.criteria.JoinType;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "6. ERROR in JoinImpl.java (at line 6)\n" +
+ " import javax.persistence.criteria.Path;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "7. ERROR in JoinImpl.java (at line 7)\n" +
+ " import javax.persistence.metamodel.Attribute;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "8. ERROR in JoinImpl.java (at line 8)\n" +
+ " import javax.persistence.metamodel.Bindable;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "9. ERROR in JoinImpl.java (at line 9)\n" +
+ " import javax.persistence.metamodel.ManagedType;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "10. ERROR in JoinImpl.java (at line 10)\n" +
+ " import javax.persistence.metamodel.Metamodel;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "11. ERROR in JoinImpl.java (at line 11)\n" +
+ " public class JoinImpl<Z, X> extends FromImpl<Z, X> implements Join<Z, X>, Fetch<Z, X> {\n" +
+ " ^^^^\n" +
+ "Join cannot be resolved to a type\n" +
+ "----------\n" +
+ "12. ERROR in JoinImpl.java (at line 11)\n" +
+ " public class JoinImpl<Z, X> extends FromImpl<Z, X> implements Join<Z, X>, Fetch<Z, X> {\n" +
+ " ^^^^^\n" +
+ "Fetch cannot be resolved to a type\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in FromImpl.java (at line 7)\n" +
+ " import javax.persistence.criteria.CollectionJoin;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "2. ERROR in FromImpl.java (at line 8)\n" +
+ " import javax.persistence.criteria.Expression;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "3. ERROR in FromImpl.java (at line 9)\n" +
+ " import javax.persistence.criteria.Fetch;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "4. ERROR in FromImpl.java (at line 10)\n" +
+ " import javax.persistence.criteria.From;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "5. ERROR in FromImpl.java (at line 11)\n" +
+ " import javax.persistence.criteria.Join;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "6. ERROR in FromImpl.java (at line 12)\n" +
+ " import javax.persistence.criteria.JoinType;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "7. ERROR in FromImpl.java (at line 13)\n" +
+ " import javax.persistence.criteria.ListJoin;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "8. ERROR in FromImpl.java (at line 14)\n" +
+ " import javax.persistence.criteria.MapJoin;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "9. ERROR in FromImpl.java (at line 15)\n" +
+ " import javax.persistence.criteria.Path;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "10. ERROR in FromImpl.java (at line 16)\n" +
+ " import javax.persistence.criteria.SetJoin;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "11. ERROR in FromImpl.java (at line 17)\n" +
+ " import javax.persistence.metamodel.Attribute;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "12. ERROR in FromImpl.java (at line 18)\n" +
+ " import javax.persistence.metamodel.Bindable;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "13. ERROR in FromImpl.java (at line 19)\n" +
+ " import javax.persistence.metamodel.CollectionAttribute;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "14. ERROR in FromImpl.java (at line 20)\n" +
+ " import javax.persistence.metamodel.ListAttribute;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "15. ERROR in FromImpl.java (at line 21)\n" +
+ " import javax.persistence.metamodel.ManagedType;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "16. ERROR in FromImpl.java (at line 22)\n" +
+ " import javax.persistence.metamodel.MapAttribute;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "17. ERROR in FromImpl.java (at line 23)\n" +
+ " import javax.persistence.metamodel.Metamodel;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "18. ERROR in FromImpl.java (at line 24)\n" +
+ " import javax.persistence.metamodel.PluralAttribute;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "19. ERROR in FromImpl.java (at line 25)\n" +
+ " import javax.persistence.metamodel.SingularAttribute;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "20. ERROR in FromImpl.java (at line 26)\n" +
+ " import javax.persistence.metamodel.Attribute.PersistentAttributeType;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "21. ERROR in FromImpl.java (at line 27)\n" +
+ " import javax.persistence.metamodel.PluralAttribute.CollectionType;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "22. ERROR in FromImpl.java (at line 28)\n" +
+ " import javax.persistence.metamodel.Type.PersistenceType;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The import javax.persistence cannot be resolved\n" +
+ "----------\n" +
+ "23. ERROR in FromImpl.java (at line 30)\n" +
+ " import org.eclipse.persistence.internal.helper.ClassConstants;\n" +
+ " ^^^^^^^^^^^\n" +
+ "The import org.eclipse cannot be resolved\n" +
+ "----------\n" +
+ "24. ERROR in FromImpl.java (at line 31)\n" +
+ " import org.eclipse.persistence.internal.localization.ExceptionLocalization;\n" +
+ " ^^^^^^^^^^^\n" +
+ "The import org.eclipse cannot be resolved\n" +
+ "----------\n" +
+ "25. ERROR in FromImpl.java (at line 33)\n" +
+ " public class FromImpl<Z, X> extends PathImpl<X> implements javax.persistence.criteria.From<Z, X> {\n" +
+ " ^^^^^^^^\n" +
+ "PathImpl cannot be resolved to a type\n" +
+ "----------\n" +
+ "26. ERROR in FromImpl.java (at line 33)\n" +
+ " public class FromImpl<Z, X> extends PathImpl<X> implements javax.persistence.criteria.From<Z, X> {\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "javax.persistence cannot be resolved to a type\n" +
+ "----------\n" +
+ "27. ERROR in FromImpl.java (at line 35)\n" +
+ " protected Set<Join<X, ?>> joins;\n" +
+ " ^^^^\n" +
+ "Join cannot be resolved to a type\n" +
+ "----------\n" +
+ "28. ERROR in FromImpl.java (at line 37)\n" +
+ " public Set<Join<X, ?>> getJoins() {\n" +
+ " ^^^^\n" +
+ "Join cannot be resolved to a type\n" +
+ "----------\n" +
+ "29. ERROR in FromImpl.java (at line 38)\n" +
+ " return joins;\n" +
+ " ^^^^^\n" +
+ "Join cannot be resolved to a type\n" +
+ "----------\n" +
+ "30. ERROR in FromImpl.java (at line 41)\n" +
+ " public void findJoins(AbstractQueryImpl query){\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "AbstractQueryImpl cannot be resolved to a type\n" +
+ "----------\n" +
+ "31. WARNING in FromImpl.java (at line 42)\n" +
+ " Stack stack = new Stack();\n" +
+ " ^^^^^\n" +
+ "Stack is a raw type. References to generic type Stack<E> should be parameterized\n" +
+ "----------\n" +
+ "32. WARNING in FromImpl.java (at line 42)\n" +
+ " Stack stack = new Stack();\n" +
+ " ^^^^^\n" +
+ "Stack is a raw type. References to generic type Stack<E> should be parameterized\n" +
+ "----------\n" +
+ "33. WARNING in FromImpl.java (at line 43)\n" +
+ " stack.push(this);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method push(Object) belongs to the raw type Stack. References to generic type Stack<E> should be parameterized\n" +
+ "----------\n" +
+ "34. WARNING in FromImpl.java (at line 45)\n" +
+ " FromImpl currentJoin = (FromImpl) stack.pop();\n" +
+ " ^^^^^^^^\n" +
+ "FromImpl is a raw type. References to generic type FromImpl<Z,X> should be parameterized\n" +
+ "----------\n" +
+ "35. WARNING in FromImpl.java (at line 45)\n" +
+ " FromImpl currentJoin = (FromImpl) stack.pop();\n" +
+ " ^^^^^^^^\n" +
+ "FromImpl is a raw type. References to generic type FromImpl<Z,X> should be parameterized\n" +
+ "----------\n" +
+ "36. WARNING in FromImpl.java (at line 46)\n" +
+ " stack.addAll(currentJoin.getJoins());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method addAll(Collection) belongs to the raw type Vector. References to generic type Vector<E> should be parameterized\n" +
+ "----------\n" +
+ "37. ERROR in FromImpl.java (at line 47)\n" +
+ " if (currentJoin.isLeaf){\n" +
+ " ^^^^^^\n" +
+ "isLeaf cannot be resolved or is not a field\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=316889
@@ -52045,7 +52045,7 @@ public void test1462() {
this.runNegativeTest(
new String[] {
"AnotherClass.java",
- "public class AnotherClass<I extends IRecursiveInterface<? super I>> {}\n" +
+ "public class AnotherClass<I extends IRecursiveInterface<? super I>> {}\n" +
"class ImplementingClass implements IRecursiveInterface<IReferencedInterface>, IReferencedInterface {\n" +
" private AnotherClass<IReferencedInterface> m_var;\n" +
" public void setAnother(final AnotherClass<? extends IReferencedInterface> a) {\n" +
@@ -52057,11 +52057,11 @@ public void test1462() {
"}\n" +
"interface IReferencedInterface extends IRecursiveInterface<IReferencedInterface> {}\n"
},
- "----------\n" +
- "1. ERROR in AnotherClass.java (at line 5)\n" +
- " m_var = a;\n" +
- " ^\n" +
- "Type mismatch: cannot convert from AnotherClass<capture#1-of ? extends IReferencedInterface> to AnotherClass<IReferencedInterface>\n" +
+ "----------\n" +
+ "1. ERROR in AnotherClass.java (at line 5)\n" +
+ " m_var = a;\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from AnotherClass<capture#1-of ? extends IReferencedInterface> to AnotherClass<IReferencedInterface>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=314556
@@ -52075,11 +52075,11 @@ public void test1463() {
"interface SubType<T extends BaseType & java.io.Closeable> extends BaseType {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in BaseType.java (at line 4)\n" +
- " interface SubType<T extends BaseType & java.io.Closeable> extends BaseType {\n" +
- " ^\n" +
- "The inherited method Object.clone() cannot hide the public abstract method in BaseType\n" +
+ "----------\n" +
+ "1. ERROR in BaseType.java (at line 4)\n" +
+ " interface SubType<T extends BaseType & java.io.Closeable> extends BaseType {\n" +
+ " ^\n" +
+ "The inherited method Object.clone() cannot hide the public abstract method in BaseType\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=319603
@@ -52101,11 +52101,11 @@ public void test1464() {
" Zork z;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=320275
@@ -52154,21 +52154,21 @@ public void test1466() {
" }\n"+
"}\n"
},
- "----------\n" +
- "1. ERROR in Outer.java (at line 8)\n" +
- " Class<Outer<T>.Cell> cellClass = Cell.class;\n" +
- " ^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Class<Outer.Cell> to Class<Outer<T>.Cell>\n" +
- "----------\n" +
- "2. ERROR in Outer.java (at line 10)\n" +
- " this.cellClass = Cell.class;\n" +
- " ^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Class<Outer.Cell> to Class<Outer<T>.Cell>\n" +
- "----------\n" +
- "3. ERROR in Outer.java (at line 11)\n" +
- " this.cellClass = Outer.Cell.class;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Class<Outer.Cell> to Class<Outer<T>.Cell>\n" +
+ "----------\n" +
+ "1. ERROR in Outer.java (at line 8)\n" +
+ " Class<Outer<T>.Cell> cellClass = Cell.class;\n" +
+ " ^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Class<Outer.Cell> to Class<Outer<T>.Cell>\n" +
+ "----------\n" +
+ "2. ERROR in Outer.java (at line 10)\n" +
+ " this.cellClass = Cell.class;\n" +
+ " ^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Class<Outer.Cell> to Class<Outer<T>.Cell>\n" +
+ "----------\n" +
+ "3. ERROR in Outer.java (at line 11)\n" +
+ " this.cellClass = Outer.Cell.class;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Class<Outer.Cell> to Class<Outer<T>.Cell>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=312076
@@ -52197,11 +52197,11 @@ public void test1467() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " super(Arr.class);\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The constructor X.Base<X<T>.Arr>(Class<X.Arr>) is undefined\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " super(Arr.class);\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The constructor X.Base<X<T>.Arr>(Class<X.Arr>) is undefined\n" +
"----------\n");
}
public void testBug401783() {
@@ -52222,15 +52222,15 @@ public void testBug433989() {
this.runConformTest(
new String[] {
"A.java",
- "class A<V> {\n" +
- " public static class Container {\n" +
- " public static class In<T> {\n" +
- " public static class Inner<U> {}\n" +
- " }\n" +
- " public static <X> void doit() {\n" +
- " new In.Inner<X>();\n" +
- " }\n" +
- " }\n" +
+ "class A<V> {\n" +
+ " public static class Container {\n" +
+ " public static class In<T> {\n" +
+ " public static class Inner<U> {}\n" +
+ " }\n" +
+ " public static <X> void doit() {\n" +
+ " new In.Inner<X>();\n" +
+ " }\n" +
+ " }\n" +
"}\n"
});
}
@@ -52239,22 +52239,22 @@ public void testBug433989a() {
this.runNegativeTest(
new String[] {
"A.java",
- "class A<V> {\n" +
- " public static class Nested {\n" +
- " public class In<U> {\n" +
- " public class Inner<V> {}\n" +
- " }\n" +
- " public <X> void create() {\n" +
- " new In.Inner<X>();\n" +
- " }\n" +
- " }\n" +
+ "class A<V> {\n" +
+ " public static class Nested {\n" +
+ " public class In<U> {\n" +
+ " public class Inner<V> {}\n" +
+ " }\n" +
+ " public <X> void create() {\n" +
+ " new In.Inner<X>();\n" +
+ " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in A.java (at line 7)\n" +
- " new In.Inner<X>();\n" +
- " ^^^^^^^^\n" +
- "The member type A.Nested.In.Inner<X> must be qualified with a parameterized type, since it is not static\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 7)\n" +
+ " new In.Inner<X>();\n" +
+ " ^^^^^^^^\n" +
+ "The member type A.Nested.In.Inner<X> must be qualified with a parameterized type, since it is not static\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=433989
@@ -52262,22 +52262,22 @@ public void testBug433989b() {
this.runNegativeTest(
new String[] {
"A.java",
- "class A<V> {\n" +
- " public class Nested {\n" +
- " public class In<U> {\n" +
- " public class Inner<W> {}\n" +
- " }\n" +
- " public <X> void create() {\n" +
- " new In.Inner<X>();\n" +
- " }\n" +
- " }\n" +
+ "class A<V> {\n" +
+ " public class Nested {\n" +
+ " public class In<U> {\n" +
+ " public class Inner<W> {}\n" +
+ " }\n" +
+ " public <X> void create() {\n" +
+ " new In.Inner<X>();\n" +
+ " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in A.java (at line 7)\n" +
- " new In.Inner<X>();\n" +
- " ^^\n" +
- "The member type A<V>.Nested.In must be parameterized, since it is qualified with a parameterized type\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 7)\n" +
+ " new In.Inner<X>();\n" +
+ " ^^\n" +
+ "The member type A<V>.Nested.In must be parameterized, since it is qualified with a parameterized type\n" +
"----------\n");
}
@@ -52286,27 +52286,27 @@ public void testBug469201_A(){
this.runConformTest(
new String[]{
"T2.java",
- "import java.util.*;\n" +
- "\n" +
- "class Bar { }\n" +
- "\n" +
- "class FooPrime extends Bar {\n" +
- " void bar(Bar bar) { }\n" +
- "}\n" +
- "\n" +
- "class Foo extends FooPrime { }\n" +
- "\n" +
- "public class T2 {\n" +
- "\n" +
- " public static void someMethod(List<? extends Foo> foos ) {\n" +
- " Bar bar = new Bar(); \n" +
- " foos.get(0).bar(bar);\n" +
- " }\n" +
- " public static void main(String... args) {\n" +
- " List<Foo> foos = new ArrayList<Foo>();\n" +
- " foos.add(new Foo());\n" +
- " someMethod(foos);\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "\n" +
+ "class Bar { }\n" +
+ "\n" +
+ "class FooPrime extends Bar {\n" +
+ " void bar(Bar bar) { }\n" +
+ "}\n" +
+ "\n" +
+ "class Foo extends FooPrime { }\n" +
+ "\n" +
+ "public class T2 {\n" +
+ "\n" +
+ " public static void someMethod(List<? extends Foo> foos ) {\n" +
+ " Bar bar = new Bar(); \n" +
+ " foos.get(0).bar(bar);\n" +
+ " }\n" +
+ " public static void main(String... args) {\n" +
+ " List<Foo> foos = new ArrayList<Foo>();\n" +
+ " foos.add(new Foo());\n" +
+ " someMethod(foos);\n" +
+ " }\n" +
"}"
});
}
@@ -52315,33 +52315,33 @@ public void testBug469201_B(){
this.runNegativeTest(
new String[]{
"A.java",
- "package bug469201.p1;\n" +
- "public class A {\n" +
- " void bar(Bar bar) { }\n" +
- "}\n" +
- "class Bar {}\n",
+ "package bug469201.p1;\n" +
+ "public class A {\n" +
+ " void bar(Bar bar) { }\n" +
+ "}\n" +
+ "class Bar {}\n",
"D.java",
"package bug469201.p1;\n" +
"import java.util.ArrayList;\n" +
"import java.util.List;\n" +
- "import bug469201.p2.B;\n" +
- "public class D{\n" +
- " public static void main(String... args) {\n" +
- " List<? extends B> foos = new ArrayList<B>();\n" +
- " Bar bar = new Bar();\n" +
- " foos.get(0).bar(bar);\n" +
- " }\n" +
+ "import bug469201.p2.B;\n" +
+ "public class D{\n" +
+ " public static void main(String... args) {\n" +
+ " List<? extends B> foos = new ArrayList<B>();\n" +
+ " Bar bar = new Bar();\n" +
+ " foos.get(0).bar(bar);\n" +
+ " }\n" +
"}",
"B.java",
- "package bug469201.p2;\n" +
- "import bug469201.p1.A;\n" +
+ "package bug469201.p2;\n" +
+ "import bug469201.p1.A;\n" +
"public class B extends A {}\n"
},
- "----------\n" +
- "1. ERROR in D.java (at line 9)\n" +
- " foos.get(0).bar(bar);\n" +
- " ^^^\n" +
- "The method bar(Bar) from the type A is not visible\n" +
+ "----------\n" +
+ "1. ERROR in D.java (at line 9)\n" +
+ " foos.get(0).bar(bar);\n" +
+ " ^^^\n" +
+ "The method bar(Bar) from the type A is not visible\n" +
"----------\n");
}
public void testBug460491() {
@@ -52368,29 +52368,29 @@ public void testBug492450_comment0() {
runConformTest(
new String[] {
"DocumentObject.java",
- "\n" +
- "import java.util.ArrayList;\n" +
- "\n" +
- "interface IDocumentElementNode {\n" +
- " public ArrayList<?> getChildNodesList();\n" +
- "}\n" +
- "\n" +
- "abstract class DocumentElementNode implements IDocumentElementNode {\n" +
- " @Override\n" +
- " public ArrayList<IDocumentElementNode> getChildNodesList() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "interface IDocumentObject extends IDocumentElementNode {\n" +
- " public ArrayList<?> getChildNodesList(Class<?>[] classes, boolean match);\n" +
- "}\n" +
- "\n" +
- "public abstract class DocumentObject extends DocumentElementNode implements IDocumentObject {\n" +
- " @Override\n" +
- " public ArrayList<IDocumentElementNode> getChildNodesList(Class<?>[] classes, boolean match) {\n" +
- " return null;\n" +
- " }\n" +
+ "\n" +
+ "import java.util.ArrayList;\n" +
+ "\n" +
+ "interface IDocumentElementNode {\n" +
+ " public ArrayList<?> getChildNodesList();\n" +
+ "}\n" +
+ "\n" +
+ "abstract class DocumentElementNode implements IDocumentElementNode {\n" +
+ " @Override\n" +
+ " public ArrayList<IDocumentElementNode> getChildNodesList() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "interface IDocumentObject extends IDocumentElementNode {\n" +
+ " public ArrayList<?> getChildNodesList(Class<?>[] classes, boolean match);\n" +
+ "}\n" +
+ "\n" +
+ "public abstract class DocumentObject extends DocumentElementNode implements IDocumentObject {\n" +
+ " @Override\n" +
+ " public ArrayList<IDocumentElementNode> getChildNodesList(Class<?>[] classes, boolean match) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
});
}
@@ -52400,43 +52400,43 @@ public void testBug532653() {
runConformTest(
new String[] {
"Builder.java",
- "public interface Builder<T> {\n" +
- " T build();\n" +
- "}\n",
+ "public interface Builder<T> {\n" +
+ " T build();\n" +
+ "}\n",
"ConcreteBuilder.java",
- "public class ConcreteBuilder<B extends ConcreteBuilder<B>> implements Builder<String> {\n" +
- " private String s = \"\";\n" +
- " protected B b;\n" +
- " @Override\n" +
- " public String build() {\n" +
- " return s;\n" +
- " }\n" +
- " public B append(String s) {\n" +
- " this.s += s;\n" +
- " return b;\n" +
- " }\n" +
- " public static ConcreteBuilder<?> create() {\n" +
- " class ConcreteStringBuilder extends ConcreteBuilder<ConcreteStringBuilder> {\n" +
- " public ConcreteStringBuilder() {\n" +
- " b = this;\n" +
- " }\n" +
- " }\n" +
- " return new ConcreteStringBuilder();\n" +
- " }\n" +
+ "public class ConcreteBuilder<B extends ConcreteBuilder<B>> implements Builder<String> {\n" +
+ " private String s = \"\";\n" +
+ " protected B b;\n" +
+ " @Override\n" +
+ " public String build() {\n" +
+ " return s;\n" +
+ " }\n" +
+ " public B append(String s) {\n" +
+ " this.s += s;\n" +
+ " return b;\n" +
+ " }\n" +
+ " public static ConcreteBuilder<?> create() {\n" +
+ " class ConcreteStringBuilder extends ConcreteBuilder<ConcreteStringBuilder> {\n" +
+ " public ConcreteStringBuilder() {\n" +
+ " b = this;\n" +
+ " }\n" +
+ " }\n" +
+ " return new ConcreteStringBuilder();\n" +
+ " }\n" +
"}",
"ConcreteSubBuilder.java",
- "public class ConcreteSubBuilder<B extends ConcreteSubBuilder<B>> extends ConcreteBuilder<B>{\n" +
- " public B appendTwice(String s) {\n" +
- " return super.append(s).append(s);\n" +
- " }\n" +
- " public static ConcreteSubBuilder<?> create() {\n" +
- " class ConcreteSubStringBuilder extends ConcreteSubBuilder<ConcreteSubStringBuilder> {\n" +
- " public ConcreteSubStringBuilder() {\n" +
- " b = this;\n" +
- " }\n" +
- " }\n" +
- " return new ConcreteSubStringBuilder();\n" +
- " }\n" +
+ "public class ConcreteSubBuilder<B extends ConcreteSubBuilder<B>> extends ConcreteBuilder<B>{\n" +
+ " public B appendTwice(String s) {\n" +
+ " return super.append(s).append(s);\n" +
+ " }\n" +
+ " public static ConcreteSubBuilder<?> create() {\n" +
+ " class ConcreteSubStringBuilder extends ConcreteSubBuilder<ConcreteSubStringBuilder> {\n" +
+ " public ConcreteSubStringBuilder() {\n" +
+ " b = this;\n" +
+ " }\n" +
+ " }\n" +
+ " return new ConcreteSubStringBuilder();\n" +
+ " }\n" +
"}\n"
});
}
@@ -52456,7 +52456,7 @@ public void testBug541772() {
"",
getCompilerOptions()
);
-
+
runConformTest(
new String[] {
"token/Token.java",
@@ -52536,7 +52536,7 @@ public void testBug541772_typeannotations() {
"",
getCompilerOptions()
);
-
+
runConformTest(
new String[] {
"token/Ann.java",
@@ -52614,69 +52614,69 @@ public void testBug543480BasedOnTest2FromComment4ToSameSameOptimization() {
final List<Duration> durationsFor2TypeParameters = compileTimesAfterWarmup(() -> runConformTest(
new String[] {
"Test2_2.java",
- "public class Test2_2 {\n" +
- " void test() {\n" +
- " m(s(\n" +
- " f(1),\n" +
- " f(2)\n" +
- " ));\n" +
- " }\n" +
- "\n" +
- " static <R> R m(S<R> s) { return null; }\n" +
- " static <T> F<T> f(T t) { return null; }\n" +
- " static <T1> S<R1<T1>> s(F<T1> t1) { return null; }\n" +
- " static <T1, T2> S<R2<T1, T2>> s(F<T1> t1, F<T2> t2) { return null; }\n" +
- "}\n" +
- "interface F<T> {}\n" +
- "interface S<R> {}\n" +
- "interface R1<T1> {}\n" +
+ "public class Test2_2 {\n" +
+ " void test() {\n" +
+ " m(s(\n" +
+ " f(1),\n" +
+ " f(2)\n" +
+ " ));\n" +
+ " }\n" +
+ "\n" +
+ " static <R> R m(S<R> s) { return null; }\n" +
+ " static <T> F<T> f(T t) { return null; }\n" +
+ " static <T1> S<R1<T1>> s(F<T1> t1) { return null; }\n" +
+ " static <T1, T2> S<R2<T1, T2>> s(F<T1> t1, F<T2> t2) { return null; }\n" +
+ "}\n" +
+ "interface F<T> {}\n" +
+ "interface S<R> {}\n" +
+ "interface R1<T1> {}\n" +
"interface R2<T1, T2> {}\n"
}));
final List<Duration> durationsFor11TypeParameters = compileTimesAfterWarmup(() -> runConformTest(
new String[] {
"Test2_11.java",
- "public class Test2_11 {\n" +
- " void test() {\n" +
- " m(s(\n" +
- " f(1),\n" +
- " f(2),\n" +
- " f(3),\n" +
- " f(4),\n" +
- " f(5),\n" +
- " f(6),\n" +
- " f(7),\n" +
- " f(8),\n" +
- " f(9),\n" +
- " f(10),\n" +
- " f(11)\n" +
- " ));\n" +
- " }\n" +
- "\n" +
- " static <R> R m(S<R> s) { return null; }\n" +
- " static <T> F<T> f(T t) { return null; }\n" +
- " static <T1> S<R1<T1>> s(F<T1> t1) { return null; }\n" +
- " static <T1, T2> S<R2<T1, T2>> s(F<T1> t1, F<T2> t2) { return null; }\n" +
- " static <T1, T2, T3> S<R3<T1, T2, T3>> s(F<T1> t1, F<T2> t2, F<T3> t3) { return null; }\n" +
- " static <T1, T2, T3, T4> S<R4<T1, T2, T3, T4>> s(F<T1> t1, F<T2> t2, F<T3> t3, F<T4> t4) { return null; }\n" +
- " static <T1, T2, T3, T4, T5> S<R5<T1, T2, T3, T4, T5>> s(F<T1> t1, F<T2> t2, F<T3> t3, F<T4> t4, F<T5> t5) { return null; }\n" +
- " static <T1, T2, T3, T4, T5, T6> S<R6<T1, T2, T3, T4, T5, T6>> s(F<T1> t1, F<T2> t2, F<T3> t3, F<T4> t4, F<T5> t5, F<T6> t6) { return null; }\n" +
- " static <T1, T2, T3, T4, T5, T6, T7> S<R7<T1, T2, T3, T4, T5, T6, T7>> s(F<T1> t1, F<T2> t2, F<T3> t3, F<T4> t4, F<T5> t5, F<T6> t6, F<T7> t7) { return null; }\n" +
- " static <T1, T2, T3, T4, T5, T6, T7, T8> S<R8<T1, T2, T3, T4, T5, T6, T7, T8>> s(F<T1> t1, F<T2> t2, F<T3> t3, F<T4> t4, F<T5> t5, F<T6> t6, F<T7> t7, F<T8> t8) { return null; }\n" +
- " static <T1, T2, T3, T4, T5, T6, T7, T8, T9> S<R9<T1, T2, T3, T4, T5, T6, T7, T8, T9>> s(F<T1> t1, F<T2> t2, F<T3> t3, F<T4> t4, F<T5> t5, F<T6> t6, F<T7> t7, F<T8> t8, F<T9> t9) { return null; }\n" +
+ "public class Test2_11 {\n" +
+ " void test() {\n" +
+ " m(s(\n" +
+ " f(1),\n" +
+ " f(2),\n" +
+ " f(3),\n" +
+ " f(4),\n" +
+ " f(5),\n" +
+ " f(6),\n" +
+ " f(7),\n" +
+ " f(8),\n" +
+ " f(9),\n" +
+ " f(10),\n" +
+ " f(11)\n" +
+ " ));\n" +
+ " }\n" +
+ "\n" +
+ " static <R> R m(S<R> s) { return null; }\n" +
+ " static <T> F<T> f(T t) { return null; }\n" +
+ " static <T1> S<R1<T1>> s(F<T1> t1) { return null; }\n" +
+ " static <T1, T2> S<R2<T1, T2>> s(F<T1> t1, F<T2> t2) { return null; }\n" +
+ " static <T1, T2, T3> S<R3<T1, T2, T3>> s(F<T1> t1, F<T2> t2, F<T3> t3) { return null; }\n" +
+ " static <T1, T2, T3, T4> S<R4<T1, T2, T3, T4>> s(F<T1> t1, F<T2> t2, F<T3> t3, F<T4> t4) { return null; }\n" +
+ " static <T1, T2, T3, T4, T5> S<R5<T1, T2, T3, T4, T5>> s(F<T1> t1, F<T2> t2, F<T3> t3, F<T4> t4, F<T5> t5) { return null; }\n" +
+ " static <T1, T2, T3, T4, T5, T6> S<R6<T1, T2, T3, T4, T5, T6>> s(F<T1> t1, F<T2> t2, F<T3> t3, F<T4> t4, F<T5> t5, F<T6> t6) { return null; }\n" +
+ " static <T1, T2, T3, T4, T5, T6, T7> S<R7<T1, T2, T3, T4, T5, T6, T7>> s(F<T1> t1, F<T2> t2, F<T3> t3, F<T4> t4, F<T5> t5, F<T6> t6, F<T7> t7) { return null; }\n" +
+ " static <T1, T2, T3, T4, T5, T6, T7, T8> S<R8<T1, T2, T3, T4, T5, T6, T7, T8>> s(F<T1> t1, F<T2> t2, F<T3> t3, F<T4> t4, F<T5> t5, F<T6> t6, F<T7> t7, F<T8> t8) { return null; }\n" +
+ " static <T1, T2, T3, T4, T5, T6, T7, T8, T9> S<R9<T1, T2, T3, T4, T5, T6, T7, T8, T9>> s(F<T1> t1, F<T2> t2, F<T3> t3, F<T4> t4, F<T5> t5, F<T6> t6, F<T7> t7, F<T8> t8, F<T9> t9) { return null; }\n" +
" static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> S<R10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>> s(F<T1> t1, F<T2> t2, F<T3> t3, F<T4> t4, F<T5> t5, F<T6> t6, F<T7> t7, F<T8> t8, F<T9> t9, F<T10> t10) { return null; }\n" +
" static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> S<R11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>> s(F<T1> t1, F<T2> t2, F<T3> t3, F<T4> t4, F<T5> t5, F<T6> t6, F<T7> t7, F<T8> t8, F<T9> t9, F<T10> t10, F<T11> t11) { return null; }\n" +
- "}\n" +
- "interface F<T> {}\n" +
- "interface S<R> {}\n" +
- "interface R1<T1> {}\n" +
+ "}\n" +
+ "interface F<T> {}\n" +
+ "interface S<R> {}\n" +
+ "interface R1<T1> {}\n" +
"interface R2<T1, T2> {}\n" +
- "interface R3<T1, T2, T3> {}\n" +
- "interface R4<T1, T2, T3, T4> {}\n" +
- "interface R5<T1, T2, T3, T4, T5> {}\n" +
- "interface R6<T1, T2, T3, T4, T5, T6> {}\n" +
- "interface R7<T1, T2, T3, T4, T5, T6, T7> {}\n" +
- "interface R8<T1, T2, T3, T4, T5, T6, T7, T8> {}\n" +
- "interface R9<T1, T2, T3, T4, T5, T6, T7, T8, T9> {}\n" +
+ "interface R3<T1, T2, T3> {}\n" +
+ "interface R4<T1, T2, T3, T4> {}\n" +
+ "interface R5<T1, T2, T3, T4, T5> {}\n" +
+ "interface R6<T1, T2, T3, T4, T5, T6> {}\n" +
+ "interface R7<T1, T2, T3, T4, T5, T6, T7> {}\n" +
+ "interface R8<T1, T2, T3, T4, T5, T6, T7, T8> {}\n" +
+ "interface R9<T1, T2, T3, T4, T5, T6, T7, T8, T9> {}\n" +
"interface R10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> {}\n" +
"interface R11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> {}\n"
}));
@@ -52693,13 +52693,13 @@ public void testBug543480WithSameSubSuperOptimization() {
final List<Duration> durationsFor2TypeParameters = compileTimesAfterWarmup(() -> runConformTest(
new String[] {
"WithParameterizedDependencies_2.java",
- "abstract class WithParameterizedDependencies_2 {\n" +
+ "abstract class WithParameterizedDependencies_2 {\n" +
" <T1, T2> \n" +
" Type1<T1, T2>\n" +
" s1(Type1<T1, T2> t) {\n" +
// This line causes the optimization in BoundSet.combineSameSubSuperWithProperType(...) to be effective.
- " return s2(new Type1<>(t));\n" +
- " }\n" +
+ " return s2(new Type1<>(t));\n" +
+ " }\n" +
" abstract <E> E s2(E e);\n" +
"}\n" +
"class Type1<T1, T2> {\n" +
@@ -52709,13 +52709,13 @@ public void testBug543480WithSameSubSuperOptimization() {
final List<Duration> durationsFor12TypeParameters = compileTimesAfterWarmup(() -> runConformTest(
new String[] {
"WithParameterizedDependencies_12.java",
- "abstract class WithParameterizedDependencies_12 {\n" +
+ "abstract class WithParameterizedDependencies_12 {\n" +
" <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> \n" +
" Type1<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>\n" +
" s1(Type1<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> t) {\n" +
// This line causes the optimization in BoundSet.combineSameSubSuperWithProperType(...) to be effective.
- " return s2(new Type1<>(t));\n" +
- " }\n" +
+ " return s2(new Type1<>(t));\n" +
+ " }\n" +
" abstract <E> E s2(E e);\n" +
"}\n" +
"class Type1<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> {\n" +
@@ -52735,20 +52735,20 @@ public void testBug543480WithoutNullPointerExceptionDuringBytecodeGeneration() {
runConformTest(
new String[] {
"Test.java",
- "import java.util.function.BiConsumer;\n" +
- "\n" +
- "public class Test {\n" +
- " \n" +
- " interface I0<T extends I0<T>> {}\n" +
- "\n" +
- " class Type<T extends I0<T>, D> {\n" +
- " // TODO: The problem might be that BiConsumer is not declared in the same file?\n" +
- " public Type(final BiConsumer<T, D> b) { }\n" +
- " }\n" +
- "\n" +
- " public void foo() {\n" +
- " new Type<>((unused0, unused1) -> {});\n" +
- " }\n" +
+ "import java.util.function.BiConsumer;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " \n" +
+ " interface I0<T extends I0<T>> {}\n" +
+ "\n" +
+ " class Type<T extends I0<T>, D> {\n" +
+ " // TODO: The problem might be that BiConsumer is not declared in the same file?\n" +
+ " public Type(final BiConsumer<T, D> b) { }\n" +
+ " }\n" +
+ "\n" +
+ " public void foo() {\n" +
+ " new Type<>((unused0, unused1) -> {});\n" +
+ " }\n" +
"}"
});
}
@@ -52816,7 +52816,7 @@ protected static class Duration implements Comparable<Duration> {
protected final int index;
protected final long durationMs;
protected boolean isExcluded = false;
-
+
public Duration(final int index, final long durationMs) {
this.index = index;
this.durationMs = durationMs;
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java
index 021bc6580..93d3ff6a6 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java
@@ -31,7 +31,7 @@
* Bug 434570 - Generic type mismatch for parametrized class annotation attribute with inner class
* Bug 434044 - Java 8 generics thinks single method is ambiguous
* Bug 434793 - [1.8][null][compiler] AIOOBE in ParameterizedGenericMethodBinding.substitute when inlining a method
- * Bug 438337 - StackOverflow after update from Kepler to Luna
+ * Bug 438337 - StackOverflow after update from Kepler to Luna
* Bug 452194 - Code no longer compiles in 4.4.1, but with confusing error
* Bug 456459 - Discrepancy between Eclipse compiler and javac - Enums, interfaces, and generics
* Bug 456924 - StackOverflowError during compilation
@@ -96,21 +96,21 @@ public class GenericsRegressionTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " clazz == clazz || \n" +
- " ^^^^^^^^^^^^^^\n" +
- "Comparing identical expressions\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " I.class == X.class ||\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Incompatible operand types Class<I> and Class<X>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 13)\n" +
- " X.class == I.class;\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Incompatible operand types Class<X> and Class<I>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " clazz == clazz || \n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Comparing identical expressions\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 12)\n" +
+ " I.class == X.class ||\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Incompatible operand types Class<I> and Class<X>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 13)\n" +
+ " X.class == I.class;\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Incompatible operand types Class<X> and Class<I>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=322531
@@ -143,16 +143,16 @@ public class GenericsRegressionTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " x.getClass() == clazz || \n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Incompatible operand types Class<capture#1-of ? extends X> and Class<T>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " clazz == x.getClass(); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Incompatible operand types Class<T> and Class<capture#2-of ? extends X>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " x.getClass() == clazz || \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Incompatible operand types Class<capture#1-of ? extends X> and Class<T>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " clazz == x.getClass(); \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Incompatible operand types Class<T> and Class<capture#2-of ? extends X>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=322531
@@ -185,16 +185,16 @@ public class GenericsRegressionTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " x.getClass() == clazz || \n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Incompatible operand types Class<capture#1-of ? extends X> and Class<T>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " clazz == x.getClass(); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Incompatible operand types Class<T> and Class<capture#2-of ? extends X>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " x.getClass() == clazz || \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Incompatible operand types Class<capture#1-of ? extends X> and Class<T>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " clazz == x.getClass(); \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Incompatible operand types Class<T> and Class<capture#2-of ? extends X>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=322531
@@ -220,46 +220,46 @@ public class GenericsRegressionTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " boolean b = ci == X.class ||\n" +
- " ^^^^^^^^^^^^^\n" +
- "Incompatible operand types Class<I> and Class<X>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " X.class == ci ||\n" +
- " ^^^^^^^^^^^^^\n" +
- "Incompatible operand types Class<X> and Class<I>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " I.class == X.class ||\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Incompatible operand types Class<I> and Class<X>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 11)\n" +
- " X.class == I.class ||\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Incompatible operand types Class<X> and Class<I>\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 12)\n" +
- " ti == I.class ||\n" +
- " ^^^^^^^^^^^^^\n" +
- "Incompatible operand types Class<X> and Class<I>\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 13)\n" +
- " I.class == ti ||\n" +
- " ^^^^^^^^^^^^^\n" +
- "Incompatible operand types Class<I> and Class<X>\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 14)\n" +
- " ti == ci ||\n" +
- " ^^^^^^^^\n" +
- "Incompatible operand types Class<X> and Class<I>\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 15)\n" +
- " ci == ti;\n" +
- " ^^^^^^^^\n" +
- "Incompatible operand types Class<I> and Class<X>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " boolean b = ci == X.class ||\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Incompatible operand types Class<I> and Class<X>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " X.class == ci ||\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Incompatible operand types Class<X> and Class<I>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 10)\n" +
+ " I.class == X.class ||\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Incompatible operand types Class<I> and Class<X>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 11)\n" +
+ " X.class == I.class ||\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Incompatible operand types Class<X> and Class<I>\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 12)\n" +
+ " ti == I.class ||\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Incompatible operand types Class<X> and Class<I>\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 13)\n" +
+ " I.class == ti ||\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Incompatible operand types Class<I> and Class<X>\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 14)\n" +
+ " ti == ci ||\n" +
+ " ^^^^^^^^\n" +
+ "Incompatible operand types Class<X> and Class<I>\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 15)\n" +
+ " ci == ti;\n" +
+ " ^^^^^^^^\n" +
+ "Incompatible operand types Class<I> and Class<X>\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=282152
@@ -321,11 +321,11 @@ public void test282152b() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Client.java (at line 5)\n" +
- " t1.test(new Impl<Double>(), n);\n" +
- " ^^^^\n" +
- "The method test(Test<? super U>, U) in the type Impl<Integer> is not applicable for the arguments (Impl<Double>, Number)\n" +
+ "----------\n" +
+ "1. ERROR in Client.java (at line 5)\n" +
+ " t1.test(new Impl<Double>(), n);\n" +
+ " ^^^^\n" +
+ "The method test(Test<? super U>, U) in the type Impl<Integer> is not applicable for the arguments (Impl<Double>, Number)\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=282152
@@ -339,11 +339,11 @@ public void test282152c() {
" public void setValue(T v);" +
"}"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " public <U extends Exception> void test(Test<? super U> t, U value);\n" +
- " ^^^^^^^^^\n" +
- "Bound mismatch: The type ? super U is not a valid substitute for the bounded parameter <T extends Number> of the type Test<T>\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 2)\n" +
+ " public <U extends Exception> void test(Test<? super U> t, U value);\n" +
+ " ^^^^^^^^^\n" +
+ "Bound mismatch: The type ? super U is not a valid substitute for the bounded parameter <T extends Number> of the type Test<T>\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=282152
@@ -388,11 +388,11 @@ public void test282152e() {
" public void setValue(T v);" +
"}"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " public <U> void test(Test<U> t, U value);\n" +
- " ^\n" +
- "Bound mismatch: The type U is not a valid substitute for the bounded parameter <T extends Number> of the type Test<T>\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 2)\n" +
+ " public <U> void test(Test<U> t, U value);\n" +
+ " ^\n" +
+ "Bound mismatch: The type U is not a valid substitute for the bounded parameter <T extends Number> of the type Test<T>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=330869
@@ -433,11 +433,11 @@ public void test322817() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " public Object getAdapter(Class clazz); \n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " public Object getAdapter(Class clazz); \n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
"----------\n",
null,
true,
@@ -459,16 +459,16 @@ public void test322817b() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " public Object getAdapter(Class clazz); \n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " public Object getAdapter(Class clazz) {\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " public Object getAdapter(Class clazz); \n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " public Object getAdapter(Class clazz) {\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
"----------\n",
null,
true,
@@ -490,11 +490,11 @@ public void test322817c() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " public Object getAdapter(Class clazz) {\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " public Object getAdapter(Class clazz) {\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
"----------\n",
null,
true,
@@ -523,11 +523,11 @@ public void test322817d() {
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " public Object getAdapter(Class clazz) {\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " public Object getAdapter(Class clazz) {\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
"----------\n",
null,
true,
@@ -557,16 +557,16 @@ public void test322817e() {
"public class X {\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public void set(List arg) { } // OK to warn in 1.5 code\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " public List get() { return null; } // OK to warn in 1.5 code\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public void set(List arg) { } // OK to warn in 1.5 code\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " public List get() { return null; } // OK to warn in 1.5 code\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
"----------\n",
null,
true,
@@ -596,21 +596,21 @@ public void test322817f() {
"public class X {\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public void set(List arg) { } // OK to warn in 1.5 code\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 11)\n" +
- " public List get() { // should warn (super\'s return type is not raw)\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 11)\n" +
- " public List get() { // should warn (super\'s return type is not raw)\n" +
- " ^^^^\n" +
- "Type safety: The return type List for get() from the type Sub needs unchecked conversion to conform to List<String> from the type Top\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public void set(List arg) { } // OK to warn in 1.5 code\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 11)\n" +
+ " public List get() { // should warn (super\'s return type is not raw)\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 11)\n" +
+ " public List get() { // should warn (super\'s return type is not raw)\n" +
+ " ^^^^\n" +
+ "Type safety: The return type List for get() from the type Sub needs unchecked conversion to conform to List<String> from the type Top\n" +
"----------\n",
null,
true,
@@ -661,37 +661,37 @@ public void test322817g() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in Top.java (at line 3)\n" +
- " public void set(List arg) { } // OK to warn in 1.5 code\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in Top.java (at line 4)\n" +
- " public List get() { return null; } // OK to warn in 1.5 code\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in Top.java (at line 5)\n" +
- " List list; // OK to warn in 1.5 code\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " List raw= new Top().get(); // OK to warn (\'raw\' declared here)\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " raw.add(\"arg\"); // OK to warn (\'raw\' declared here)\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 14)\n" +
- " List<String> cast= (List<String>) new Top().get();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from List to List<String>\n" +
+ "----------\n" +
+ "1. WARNING in Top.java (at line 3)\n" +
+ " public void set(List arg) { } // OK to warn in 1.5 code\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in Top.java (at line 4)\n" +
+ " public List get() { return null; } // OK to warn in 1.5 code\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in Top.java (at line 5)\n" +
+ " List list; // OK to warn in 1.5 code\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " List raw= new Top().get(); // OK to warn (\'raw\' declared here)\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " raw.add(\"arg\"); // OK to warn (\'raw\' declared here)\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 14)\n" +
+ " List<String> cast= (List<String>) new Top().get();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unnecessary cast from List to List<String>\n" +
"----------\n",
null,
true,
@@ -738,73 +738,73 @@ public void test322817h() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in Top.java (at line 3)\n" +
- " public void set(List arg) { }\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in Top.java (at line 4)\n" +
- " public List get() { return null; }\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in Top.java (at line 5)\n" +
- " List list;\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in Sub.java (at line 4)\n" +
- " public void set(List arg) {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in Sub.java (at line 6)\n" +
- " arg.set(0, \"A\");\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type safety: The method set(int, Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in Sub.java (at line 9)\n" +
- " public List get() {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " new Top().list.add(\"arg\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " new Top().get().add(\"arg\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " List raw= new Top().get();\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 7)\n" +
- " raw.add(\"arg\");\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 8)\n" +
- " List<String> unchecked= new Top().get();\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<String>\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 10)\n" +
- " List<String> cast= (List<String>) new Top().get();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from List to List<String>\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 10)\n" +
- " List<String> cast= (List<String>) new Top().get();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from List to List<String>\n" +
+ "----------\n" +
+ "1. WARNING in Top.java (at line 3)\n" +
+ " public void set(List arg) { }\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in Top.java (at line 4)\n" +
+ " public List get() { return null; }\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in Top.java (at line 5)\n" +
+ " List list;\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in Sub.java (at line 4)\n" +
+ " public void set(List arg) {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in Sub.java (at line 6)\n" +
+ " arg.set(0, \"A\");\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method set(int, Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in Sub.java (at line 9)\n" +
+ " public List get() {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " new Top().list.add(\"arg\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " new Top().get().add(\"arg\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " List raw= new Top().get();\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 7)\n" +
+ " raw.add(\"arg\");\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 8)\n" +
+ " List<String> unchecked= new Top().get();\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<String>\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 10)\n" +
+ " List<String> cast= (List<String>) new Top().get();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from List to List<String>\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 10)\n" +
+ " List<String> cast= (List<String>) new Top().get();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unnecessary cast from List to List<String>\n" +
"----------\n",
null,
true,
@@ -850,73 +850,73 @@ public void test322817i() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in Top.java (at line 3)\n" +
- " public void set(List arg) { }\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in Top.java (at line 4)\n" +
- " public List get() { return null; }\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in Top.java (at line 5)\n" +
- " List list;\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in Sub.java (at line 4)\n" +
- " public void set(List arg) {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in Sub.java (at line 6)\n" +
- " arg.set(0, \"A\");\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type safety: The method set(int, Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in Sub.java (at line 9)\n" +
- " public List get() {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " new Top().list.add(\"arg\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " new Top().get().add(\"arg\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " List raw= new Top().get();\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 7)\n" +
- " raw.add(\"arg\");\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 8)\n" +
- " List<String> unchecked= new Top().get();\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<String>\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 10)\n" +
- " List<String> cast= (List<String>) new Top().get();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from List to List<String>\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 10)\n" +
- " List<String> cast= (List<String>) new Top().get();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from List to List<String>\n" +
+ "----------\n" +
+ "1. WARNING in Top.java (at line 3)\n" +
+ " public void set(List arg) { }\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in Top.java (at line 4)\n" +
+ " public List get() { return null; }\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in Top.java (at line 5)\n" +
+ " List list;\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in Sub.java (at line 4)\n" +
+ " public void set(List arg) {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in Sub.java (at line 6)\n" +
+ " arg.set(0, \"A\");\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method set(int, Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in Sub.java (at line 9)\n" +
+ " public List get() {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " new Top().list.add(\"arg\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " new Top().get().add(\"arg\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " List raw= new Top().get();\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 7)\n" +
+ " raw.add(\"arg\");\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 8)\n" +
+ " List<String> unchecked= new Top().get();\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<String>\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 10)\n" +
+ " List<String> cast= (List<String>) new Top().get();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from List to List<String>\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 10)\n" +
+ " List<String> cast= (List<String>) new Top().get();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unnecessary cast from List to List<String>\n" +
"----------\n",
null,
true,
@@ -957,46 +957,46 @@ public void test322817j() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public void set(List arg) { } // OK to warn in 1.5 code\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " public List get() { return null; } // OK to warn in 1.5 code\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 19)\n" +
- " new Top().get().add(\"arg\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 20)\n" +
- " List raw= new Top().get(); // OK to warn (\'raw\' declared here)\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 21)\n" +
- " raw.add(\"arg\"); // OK to warn (\'raw\' declared here)\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 22)\n" +
- " List<String> unchecked= new Top().get();\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<String>\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 24)\n" +
- " List<String> cast= (List<String>) new Top().get();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from List to List<String>\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 24)\n" +
- " List<String> cast= (List<String>) new Top().get();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from List to List<String>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public void set(List arg) { } // OK to warn in 1.5 code\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " public List get() { return null; } // OK to warn in 1.5 code\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 19)\n" +
+ " new Top().get().add(\"arg\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 20)\n" +
+ " List raw= new Top().get(); // OK to warn (\'raw\' declared here)\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 21)\n" +
+ " raw.add(\"arg\"); // OK to warn (\'raw\' declared here)\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 22)\n" +
+ " List<String> unchecked= new Top().get();\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<String>\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 24)\n" +
+ " List<String> cast= (List<String>) new Top().get();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from List to List<String>\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 24)\n" +
+ " List<String> cast= (List<String>) new Top().get();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unnecessary cast from List to List<String>\n" +
"----------\n",
null,
true,
@@ -1018,21 +1018,21 @@ public void test322817k() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " Set set= new HashSet(Arrays.asList(elements));\n" +
- " ^^^\n" +
- "Set is a raw type. References to generic type Set<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " Set set= new HashSet(Arrays.asList(elements));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The constructor HashSet(Collection) belongs to the raw type HashSet. References to generic type HashSet<E> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " Set set= new HashSet(Arrays.asList(elements));\n" +
- " ^^^^^^^\n" +
- "HashSet is a raw type. References to generic type HashSet<E> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " Set set= new HashSet(Arrays.asList(elements));\n" +
+ " ^^^\n" +
+ "Set is a raw type. References to generic type Set<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " Set set= new HashSet(Arrays.asList(elements));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The constructor HashSet(Collection) belongs to the raw type HashSet. References to generic type HashSet<E> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " Set set= new HashSet(Arrays.asList(elements));\n" +
+ " ^^^^^^^\n" +
+ "HashSet is a raw type. References to generic type HashSet<E> should be parameterized\n" +
"----------\n",
null,
true,
@@ -1042,112 +1042,112 @@ public void test322817k() {
public void test338350() {
String[] testFiles = new String[] {
"Try.java",
- "import java.lang.reflect.Array;\n" +
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "public class Try<E> {\n" +
- " void fooObj() {\n" +
- " takeObj((E) Bar.getObject());\n" +
- " takeObj((E) Bar.getArray());\n" +
- " takeObj((E) Array.newInstance(Integer.class, 2));\n" +
- " }\n" +
- " void takeObj(E obj) { }\n" +
- " void fooArray() {\n" +
- " takeArray((E[]) Bar.getArray());\n" +
- " takeArray((E[]) Array.newInstance(Integer.class, 2));\n" +
- " }\n" +
- " void takeArray(E[] array) { }\n" +
- " <L> void foo(List<L> list) {\n" +
- " list.toArray((L[]) Bar.getArray());\n" +
- " list.toArray((L[]) Array.newInstance(Integer.class, 2));\n" +
- " }\n" +
- " void bar() {\n" +
- " List<String> l = (List<String>) Bar.getObject();\n" +
- " List<String> l2 = Bar.getRawList();\n" +
- " ArrayList<String> l3 = (ArrayList<String>) Bar.getRawList();\n" +
- " }\n" +
+ "import java.lang.reflect.Array;\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "public class Try<E> {\n" +
+ " void fooObj() {\n" +
+ " takeObj((E) Bar.getObject());\n" +
+ " takeObj((E) Bar.getArray());\n" +
+ " takeObj((E) Array.newInstance(Integer.class, 2));\n" +
+ " }\n" +
+ " void takeObj(E obj) { }\n" +
+ " void fooArray() {\n" +
+ " takeArray((E[]) Bar.getArray());\n" +
+ " takeArray((E[]) Array.newInstance(Integer.class, 2));\n" +
+ " }\n" +
+ " void takeArray(E[] array) { }\n" +
+ " <L> void foo(List<L> list) {\n" +
+ " list.toArray((L[]) Bar.getArray());\n" +
+ " list.toArray((L[]) Array.newInstance(Integer.class, 2));\n" +
+ " }\n" +
+ " void bar() {\n" +
+ " List<String> l = (List<String>) Bar.getObject();\n" +
+ " List<String> l2 = Bar.getRawList();\n" +
+ " ArrayList<String> l3 = (ArrayList<String>) Bar.getRawList();\n" +
+ " }\n" +
"}\n",
"Bar.java",
- "import java.lang.reflect.Array;\n" +
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "public class Bar {\n" +
- " public static Object getObject() {\n" +
- " return new Object();\n" +
- " }\n" +
- " public static Object[] getArray() {\n" +
- " return (Object[]) Array.newInstance(Integer.class, 2);\n" +
- " }\n" +
- " public static List getRawList() {\n" +
- " return new ArrayList();\n" +
- " }\n" +
+ "import java.lang.reflect.Array;\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "public class Bar {\n" +
+ " public static Object getObject() {\n" +
+ " return new Object();\n" +
+ " }\n" +
+ " public static Object[] getArray() {\n" +
+ " return (Object[]) Array.newInstance(Integer.class, 2);\n" +
+ " }\n" +
+ " public static List getRawList() {\n" +
+ " return new ArrayList();\n" +
+ " }\n" +
"}\n"
};
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportUnavoidableGenericTypeProblems, CompilerOptions.ENABLED);
this.runNegativeTest(
testFiles,
- "----------\n" +
- "1. WARNING in Try.java (at line 6)\n" +
- " takeObj((E) Bar.getObject());\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to E\n" +
- "----------\n" +
- "2. WARNING in Try.java (at line 7)\n" +
- " takeObj((E) Bar.getArray());\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object[] to E\n" +
- "----------\n" +
- "3. WARNING in Try.java (at line 8)\n" +
- " takeObj((E) Array.newInstance(Integer.class, 2));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to E\n" +
- "----------\n" +
- "4. WARNING in Try.java (at line 12)\n" +
- " takeArray((E[]) Bar.getArray());\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object[] to E[]\n" +
- "----------\n" +
- "5. WARNING in Try.java (at line 13)\n" +
- " takeArray((E[]) Array.newInstance(Integer.class, 2));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to E[]\n" +
- "----------\n" +
- "6. WARNING in Try.java (at line 17)\n" +
- " list.toArray((L[]) Bar.getArray());\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object[] to L[]\n" +
- "----------\n" +
- "7. WARNING in Try.java (at line 18)\n" +
- " list.toArray((L[]) Array.newInstance(Integer.class, 2));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to L[]\n" +
- "----------\n" +
- "8. WARNING in Try.java (at line 21)\n" +
- " List<String> l = (List<String>) Bar.getObject();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to List<String>\n" +
- "----------\n" +
- "9. WARNING in Try.java (at line 22)\n" +
- " List<String> l2 = Bar.getRawList();\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<String>\n" +
- "----------\n" +
- "10. WARNING in Try.java (at line 23)\n" +
- " ArrayList<String> l3 = (ArrayList<String>) Bar.getRawList();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from List to ArrayList<String>\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in Bar.java (at line 11)\n" +
- " public static List getRawList() {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in Bar.java (at line 12)\n" +
- " return new ArrayList();\n" +
- " ^^^^^^^^^\n" +
- "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in Try.java (at line 6)\n" +
+ " takeObj((E) Bar.getObject());\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to E\n" +
+ "----------\n" +
+ "2. WARNING in Try.java (at line 7)\n" +
+ " takeObj((E) Bar.getArray());\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object[] to E\n" +
+ "----------\n" +
+ "3. WARNING in Try.java (at line 8)\n" +
+ " takeObj((E) Array.newInstance(Integer.class, 2));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to E\n" +
+ "----------\n" +
+ "4. WARNING in Try.java (at line 12)\n" +
+ " takeArray((E[]) Bar.getArray());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object[] to E[]\n" +
+ "----------\n" +
+ "5. WARNING in Try.java (at line 13)\n" +
+ " takeArray((E[]) Array.newInstance(Integer.class, 2));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to E[]\n" +
+ "----------\n" +
+ "6. WARNING in Try.java (at line 17)\n" +
+ " list.toArray((L[]) Bar.getArray());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object[] to L[]\n" +
+ "----------\n" +
+ "7. WARNING in Try.java (at line 18)\n" +
+ " list.toArray((L[]) Array.newInstance(Integer.class, 2));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to L[]\n" +
+ "----------\n" +
+ "8. WARNING in Try.java (at line 21)\n" +
+ " List<String> l = (List<String>) Bar.getObject();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to List<String>\n" +
+ "----------\n" +
+ "9. WARNING in Try.java (at line 22)\n" +
+ " List<String> l2 = Bar.getRawList();\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<String>\n" +
+ "----------\n" +
+ "10. WARNING in Try.java (at line 23)\n" +
+ " ArrayList<String> l3 = (ArrayList<String>) Bar.getRawList();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from List to ArrayList<String>\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in Bar.java (at line 11)\n" +
+ " public static List getRawList() {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in Bar.java (at line 12)\n" +
+ " return new ArrayList();\n" +
+ " ^^^^^^^^^\n" +
+ "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
"----------\n",
null,
true,
@@ -1155,57 +1155,57 @@ public void test338350() {
customOptions.put(CompilerOptions.OPTION_ReportUnavoidableGenericTypeProblems, CompilerOptions.DISABLED);
this.runNegativeTest(
testFiles,
- "----------\n" +
- "1. WARNING in Try.java (at line 6)\n" +
- " takeObj((E) Bar.getObject());\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to E\n" +
- "----------\n" +
- "2. WARNING in Try.java (at line 7)\n" +
- " takeObj((E) Bar.getArray());\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object[] to E\n" +
- "----------\n" +
- "3. WARNING in Try.java (at line 8)\n" +
- " takeObj((E) Array.newInstance(Integer.class, 2));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to E\n" +
- "----------\n" +
- "4. WARNING in Try.java (at line 12)\n" +
- " takeArray((E[]) Bar.getArray());\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object[] to E[]\n" +
- "----------\n" +
- "5. WARNING in Try.java (at line 13)\n" +
- " takeArray((E[]) Array.newInstance(Integer.class, 2));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to E[]\n" +
- "----------\n" +
- "6. WARNING in Try.java (at line 17)\n" +
- " list.toArray((L[]) Bar.getArray());\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object[] to L[]\n" +
- "----------\n" +
- "7. WARNING in Try.java (at line 18)\n" +
- " list.toArray((L[]) Array.newInstance(Integer.class, 2));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to L[]\n" +
- "----------\n" +
- "8. WARNING in Try.java (at line 21)\n" +
- " List<String> l = (List<String>) Bar.getObject();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to List<String>\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in Bar.java (at line 11)\n" +
- " public static List getRawList() {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in Bar.java (at line 12)\n" +
- " return new ArrayList();\n" +
- " ^^^^^^^^^\n" +
- "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in Try.java (at line 6)\n" +
+ " takeObj((E) Bar.getObject());\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to E\n" +
+ "----------\n" +
+ "2. WARNING in Try.java (at line 7)\n" +
+ " takeObj((E) Bar.getArray());\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object[] to E\n" +
+ "----------\n" +
+ "3. WARNING in Try.java (at line 8)\n" +
+ " takeObj((E) Array.newInstance(Integer.class, 2));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to E\n" +
+ "----------\n" +
+ "4. WARNING in Try.java (at line 12)\n" +
+ " takeArray((E[]) Bar.getArray());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object[] to E[]\n" +
+ "----------\n" +
+ "5. WARNING in Try.java (at line 13)\n" +
+ " takeArray((E[]) Array.newInstance(Integer.class, 2));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to E[]\n" +
+ "----------\n" +
+ "6. WARNING in Try.java (at line 17)\n" +
+ " list.toArray((L[]) Bar.getArray());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object[] to L[]\n" +
+ "----------\n" +
+ "7. WARNING in Try.java (at line 18)\n" +
+ " list.toArray((L[]) Array.newInstance(Integer.class, 2));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to L[]\n" +
+ "----------\n" +
+ "8. WARNING in Try.java (at line 21)\n" +
+ " List<String> l = (List<String>) Bar.getObject();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to List<String>\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in Bar.java (at line 11)\n" +
+ " public static List getRawList() {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in Bar.java (at line 12)\n" +
+ " return new ArrayList();\n" +
+ " ^^^^^^^^^\n" +
+ "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
"----------\n",
null,
true,
@@ -1231,22 +1231,22 @@ public void test334622a() {
" Zork z;\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in p\\X.java (at line 3)\n" +
- " private Object foo;\n" +
- " ^^^\n" +
- "The value of the field X.foo is not used\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in q\\Y.java (at line 5)\n" +
- " System.out.println(t.foo);\n" +
- " ^^^\n" +
- "The field X.foo is not visible\n" +
- "----------\n" +
- "2. ERROR in q\\Y.java (at line 7)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in p\\X.java (at line 3)\n" +
+ " private Object foo;\n" +
+ " ^^^\n" +
+ "The value of the field X.foo is not used\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in q\\Y.java (at line 5)\n" +
+ " System.out.println(t.foo);\n" +
+ " ^^^\n" +
+ "The field X.foo is not visible\n" +
+ "----------\n" +
+ "2. ERROR in q\\Y.java (at line 7)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=334622 (private access - same package)
@@ -1267,22 +1267,22 @@ public void test334622b() {
" Zork z;\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in p\\X.java (at line 3)\n" +
- " private Object foo;\n" +
- " ^^^\n" +
- "The value of the field X.foo is not used\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in p\\Y.java (at line 4)\n" +
- " System.out.println(t.foo);\n" +
- " ^^^\n" +
- "The field X.foo is not visible\n" +
- "----------\n" +
- "2. ERROR in p\\Y.java (at line 6)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in p\\X.java (at line 3)\n" +
+ " private Object foo;\n" +
+ " ^^^\n" +
+ "The value of the field X.foo is not used\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in p\\Y.java (at line 4)\n" +
+ " System.out.println(t.foo);\n" +
+ " ^^^\n" +
+ "The field X.foo is not visible\n" +
+ "----------\n" +
+ "2. ERROR in p\\Y.java (at line 6)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=334622 (member of type variable shouldn't contain private members of class constituting intersection type)
@@ -1299,29 +1299,29 @@ public void test334622c() {
"}\n"
},
this.complianceLevel <= ClassFileConstants.JDK1_6 ?
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" :
-
- // 1.7+ output.
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " private Object foo;\n" +
- " ^^^\n" +
- "The value of the field X.foo is not used\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " System.out.println(t.foo);\n" +
- " ^^^\n" +
- "The field X.foo is not visible\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
+ "----------\n" :
+
+ // 1.7+ output.
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " private Object foo;\n" +
+ " ^^^\n" +
+ "The value of the field X.foo is not used\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " System.out.println(t.foo);\n" +
+ " ^^^\n" +
+ "The field X.foo is not visible\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=334622 (member of type variable shouldn't contain private members of class constituting intersection type)
@@ -1338,24 +1338,24 @@ public void test334622d() {
"}\n"
},
this.complianceLevel <= ClassFileConstants.JDK1_6 ?
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" :
-
- // 1.7+ output.
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " t.foo();\n" +
- " ^^^\n" +
- "The method foo() from the type X is not visible\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
+ "----------\n" :
+
+ // 1.7+ output.
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " t.foo();\n" +
+ " ^^^\n" +
+ "The method foo() from the type X is not visible\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=335751 ([1.7][compiler] Cycle inheritance in type arguments is not detected)
@@ -1366,19 +1366,19 @@ public void test335751() {
"public class X<A extends B, B extends A> {}\n"
},
this.complianceLevel <= ClassFileConstants.JDK1_6 ?
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<A extends B, B extends A> {}\n" +
- " ^\n" +
- "Illegal forward reference to type parameter B\n" +
- "----------\n" :
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X<A extends B, B extends A> {}\n" +
+ " ^\n" +
+ "Illegal forward reference to type parameter B\n" +
+ "----------\n" :
- // 1.7+ output.
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<A extends B, B extends A> {}\n" +
- " ^\n" +
- "Cycle detected: a cycle exists in the type hierarchy between B and A\n" +
+ // 1.7+ output.
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X<A extends B, B extends A> {}\n" +
+ " ^\n" +
+ "Cycle detected: a cycle exists in the type hierarchy between B and A\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=334121 ([1.7][compiler] Stackoverflow error if compiled in 1.7 compliance mode)
@@ -1389,22 +1389,22 @@ public void test334121() {
"public class X<A extends A> {}\n"
},
this.complianceLevel <= ClassFileConstants.JDK1_6 ?
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<A extends A> {}\n" +
- " ^\n" +
- "Illegal forward reference to type parameter A\n" +
- "----------\n" :
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X<A extends A> {}\n" +
+ " ^\n" +
+ "Illegal forward reference to type parameter A\n" +
+ "----------\n" :
- // 1.7+ output.
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<A extends A> {}\n" +
- " ^\n" +
- "Cycle detected: the type A cannot extend/implement itself or one of its own member types\n" +
+ // 1.7+ output.
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X<A extends A> {}\n" +
+ " ^\n" +
+ "Cycle detected: the type A cannot extend/implement itself or one of its own member types\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=337751
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=337751
public void test337751() {
Map compilerOptions14 = getCompilerOptions();
compilerOptions14.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_2);
@@ -1426,7 +1426,7 @@ public void test337751() {
null,
compilerOptions14,
null);
-
+
Map compilerOptions15 = getCompilerOptions();
compilerOptions15.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
compilerOptions15.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
@@ -1445,28 +1445,28 @@ public void test337751() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in Y.java (at line 5)\n" +
- " project != null ? project.getOptions(true) : null;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Map needs unchecked conversion to conform to Map<String,String>\n" +
- "----------\n" +
- "2. WARNING in Y.java (at line 6)\n" +
- " options = project.getOptions(true);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Map needs unchecked conversion to conform to Map<String,String>\n" +
- "----------\n" +
- "3. WARNING in Y.java (at line 7)\n" +
- " options = project == null ? null : project.getOptions(true);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Map needs unchecked conversion to conform to Map<String,String>\n" +
+ "----------\n" +
+ "1. WARNING in Y.java (at line 5)\n" +
+ " project != null ? project.getOptions(true) : null;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Map needs unchecked conversion to conform to Map<String,String>\n" +
+ "----------\n" +
+ "2. WARNING in Y.java (at line 6)\n" +
+ " options = project.getOptions(true);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Map needs unchecked conversion to conform to Map<String,String>\n" +
+ "----------\n" +
+ "3. WARNING in Y.java (at line 7)\n" +
+ " options = project == null ? null : project.getOptions(true);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Map needs unchecked conversion to conform to Map<String,String>\n" +
"----------\n",
null,
false,
compilerOptions15,
null);
}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=337751
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=337751
public void test337751a() {
Map compilerOptions14 = getCompilerOptions();
compilerOptions14.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_2);
@@ -1488,7 +1488,7 @@ public void test337751a() {
null,
compilerOptions14,
null);
-
+
Map compilerOptions15 = getCompilerOptions();
compilerOptions15.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
compilerOptions15.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
@@ -1514,7 +1514,7 @@ public void test337751a() {
null,
JavacTestOptions.Excuse.JavacHasWarningsEclipseNotConfigured);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=337962
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=337962
public void test337962() {
Map compilerOptions15 = getCompilerOptions();
compilerOptions15.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
@@ -1550,78 +1550,78 @@ public void test337962() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " protected List fList;\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " protected List fSubList; // raw type warning (good)\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 9)\n" +
- " fSubList = new ArrayList();\n" +
- " ^^^^^^^^^\n" +
- "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 10)\n" +
- " fList.add(null); // type safety warning (TODO: bad, should be hidden)\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 11)\n" +
- " super.fList.add(null); // type safety warning (TODO: bad, should be hidden)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 12)\n" +
- " fSubList.add(null); // type safety warning (good, should not be hidden)\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 15)\n" +
- " fList.add(s); // type safety warning (TODO: bad, should be hidden)\n" +
- " ^^^^^^^^^^^^\n" +
- "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 16)\n" +
- " super.fList.add(s); // type safety warning (TODO: bad, should be hidden)\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "9. WARNING in X.java (at line 17)\n" +
- " fSubList.add(s); // type safety warning (good, should not be hidden)\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "10. WARNING in X.java (at line 20)\n" +
- " fSubList = new ArrayList();\n" +
- " ^^^^^^^^^\n" +
- "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
- "----------\n" +
- "11. WARNING in X.java (at line 21)\n" +
- " fList.add(s); // type safety warning (TODO: bad, should be hidden)\n" +
- " ^^^^^^^^^^^^\n" +
- "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "12. WARNING in X.java (at line 22)\n" +
- " super.fList.add(s); // type safety warning (TODO: bad, should be hidden)\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "13. WARNING in X.java (at line 23)\n" +
- " fSubList.add(s); // type safety warning (good, should not be hidden)\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " protected List fList;\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " protected List fSubList; // raw type warning (good)\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 9)\n" +
+ " fSubList = new ArrayList();\n" +
+ " ^^^^^^^^^\n" +
+ "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 10)\n" +
+ " fList.add(null); // type safety warning (TODO: bad, should be hidden)\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 11)\n" +
+ " super.fList.add(null); // type safety warning (TODO: bad, should be hidden)\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 12)\n" +
+ " fSubList.add(null); // type safety warning (good, should not be hidden)\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 15)\n" +
+ " fList.add(s); // type safety warning (TODO: bad, should be hidden)\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 16)\n" +
+ " super.fList.add(s); // type safety warning (TODO: bad, should be hidden)\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "9. WARNING in X.java (at line 17)\n" +
+ " fSubList.add(s); // type safety warning (good, should not be hidden)\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "10. WARNING in X.java (at line 20)\n" +
+ " fSubList = new ArrayList();\n" +
+ " ^^^^^^^^^\n" +
+ "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
+ "----------\n" +
+ "11. WARNING in X.java (at line 21)\n" +
+ " fList.add(s); // type safety warning (TODO: bad, should be hidden)\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "12. WARNING in X.java (at line 22)\n" +
+ " super.fList.add(s); // type safety warning (TODO: bad, should be hidden)\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "13. WARNING in X.java (at line 23)\n" +
+ " fSubList.add(s); // type safety warning (good, should not be hidden)\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
"----------\n",
null,
false,
compilerOptions15,
null);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=337962
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=337962
public void test337962b() {
Map compilerOptions15 = getCompilerOptions();
compilerOptions15.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
@@ -1657,48 +1657,48 @@ public void test337962b() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " protected List fList;\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " protected List fSubList; // raw type warning (good)\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 9)\n" +
- " fSubList = new ArrayList();\n" +
- " ^^^^^^^^^\n" +
- "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 12)\n" +
- " fSubList.add(null); // type safety warning (good, should not be hidden)\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 17)\n" +
- " fSubList.add(s); // type safety warning (good, should not be hidden)\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 20)\n" +
- " fSubList = new ArrayList();\n" +
- " ^^^^^^^^^\n" +
- "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 23)\n" +
- " fSubList.add(s); // type safety warning (good, should not be hidden)\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " protected List fList;\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " protected List fSubList; // raw type warning (good)\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 9)\n" +
+ " fSubList = new ArrayList();\n" +
+ " ^^^^^^^^^\n" +
+ "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 12)\n" +
+ " fSubList.add(null); // type safety warning (good, should not be hidden)\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 17)\n" +
+ " fSubList.add(s); // type safety warning (good, should not be hidden)\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 20)\n" +
+ " fSubList = new ArrayList();\n" +
+ " ^^^^^^^^^\n" +
+ "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 23)\n" +
+ " fSubList.add(s); // type safety warning (good, should not be hidden)\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
"----------\n",
null,
false,
compilerOptions15,
null);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=338011
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=338011
public void test338011() {
Map compilerOptions15 = getCompilerOptions();
compilerOptions15.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
@@ -1725,28 +1725,28 @@ public void test338011() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public X(Map m) { // should warn about raw type m\n" +
- " ^^^\n" +
- "Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " m.put(\"one\", 1); // warns about raw method invocation (good)\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type safety: The method put(Object, Object) belongs to the raw type Map. References to generic type Map<K,V> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 14)\n" +
- " public A (Map m) {\n" +
- " ^^^\n" +
- "Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public X(Map m) { // should warn about raw type m\n" +
+ " ^^^\n" +
+ "Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " m.put(\"one\", 1); // warns about raw method invocation (good)\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method put(Object, Object) belongs to the raw type Map. References to generic type Map<K,V> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 14)\n" +
+ " public A (Map m) {\n" +
+ " ^^^\n" +
+ "Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
"----------\n",
null,
false,
compilerOptions15,
null);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=338011
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=338011
public void test338011b() {
Map compilerOptions15 = getCompilerOptions();
compilerOptions15.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
@@ -1773,21 +1773,21 @@ public void test338011b() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public X(Map m) { // should warn about raw type m\n" +
- " ^^^\n" +
- "Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " m.put(\"one\", 1); // warns about raw method invocation (good)\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type safety: The method put(Object, Object) belongs to the raw type Map. References to generic type Map<K,V> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 14)\n" +
- " public A (Map m) {\n" +
- " ^^^\n" +
- "Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public X(Map m) { // should warn about raw type m\n" +
+ " ^^^\n" +
+ "Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " m.put(\"one\", 1); // warns about raw method invocation (good)\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method put(Object, Object) belongs to the raw type Map. References to generic type Map<K,V> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 14)\n" +
+ " public A (Map m) {\n" +
+ " ^^^\n" +
+ "Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
"----------\n",
null,
false,
@@ -1802,21 +1802,21 @@ public void test339478a() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X<T> {\n" +
- " public static void main(String[] args) {\n" +
- " X<String> x = new X<>();\n" +
- " x.testFunction(\"SUCCESS\");\n" +
+ "public class X<T> {\n" +
+ " public static void main(String[] args) {\n" +
+ " X<String> x = new X<>();\n" +
+ " x.testFunction(\"SUCCESS\");\n" +
" }\n" +
" public void testFunction(T param){\n" +
" System.out.println(param);\n" +
- " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " X<String> x = new X<>();\n" +
- " ^\n" +
- "\'<>\' operator is not allowed for source level below 1.7\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " X<String> x = new X<>();\n" +
+ " ^\n" +
+ "\'<>\' operator is not allowed for source level below 1.7\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=339478
@@ -1826,16 +1826,16 @@ public void test339478b() {
new String[] {
"X.java",
"public class X<T> {\n" +
- " public static void main(String[] args) {\n" +
+ " public static void main(String[] args) {\n" +
" X<> x1 = null;\n" +
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " X<> x1 = null;\n" +
- " ^\n" +
- "Incorrect number of arguments for type X<T>; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " X<> x1 = null;\n" +
+ " ^\n" +
+ "Incorrect number of arguments for type X<T>; it cannot be parameterized with arguments <>\n" +
"----------\n");
}
public void test339478c() {
@@ -1849,21 +1849,21 @@ public void test339478c() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public class X implements Map<> {\n" +
- " ^^^\n" +
- "Incorrect number of arguments for type Map<K,V>; it cannot be parameterized with arguments <>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " static Map<> foo (Map<> x) { \n" +
- " ^^^\n" +
- "Incorrect number of arguments for type Map<K,V>; it cannot be parameterized with arguments <>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " static Map<> foo (Map<> x) { \n" +
- " ^^^\n" +
- "Incorrect number of arguments for type Map<K,V>; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public class X implements Map<> {\n" +
+ " ^^^\n" +
+ "Incorrect number of arguments for type Map<K,V>; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " static Map<> foo (Map<> x) { \n" +
+ " ^^^\n" +
+ "Incorrect number of arguments for type Map<K,V>; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " static Map<> foo (Map<> x) { \n" +
+ " ^^^\n" +
+ "Incorrect number of arguments for type Map<K,V>; it cannot be parameterized with arguments <>\n" +
"----------\n");
}
public void test339478d() {
@@ -1877,11 +1877,11 @@ public void test339478d() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " static Map<> foo () { \n" +
- " ^^^\n" +
- "Incorrect number of arguments for type Map<K,V>; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " static Map<> foo () { \n" +
+ " ^^^\n" +
+ "Incorrect number of arguments for type Map<K,V>; it cannot be parameterized with arguments <>\n" +
"----------\n");
}
public void test339478e() {
@@ -1896,11 +1896,11 @@ public void test339478e() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " X<String>.Y<> [] y = null; \n" +
- " ^^^^^^^^^^^\n" +
- "Incorrect number of arguments for type X<String>.Y; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " X<String>.Y<> [] y = null; \n" +
+ " ^^^^^^^^^^^\n" +
+ "Incorrect number of arguments for type X<String>.Y; it cannot be parameterized with arguments <>\n" +
"----------\n");
}
public void test339478f() {
@@ -1915,11 +1915,11 @@ public void test339478f() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " X<String>.Y<> y = null; \n" +
- " ^^^^^^^^^^^\n" +
- "Incorrect number of arguments for type X<String>.Y; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " X<String>.Y<> y = null; \n" +
+ " ^^^^^^^^^^^\n" +
+ "Incorrect number of arguments for type X<String>.Y; it cannot be parameterized with arguments <>\n" +
"----------\n");
}
public void test339478g() {
@@ -1933,11 +1933,11 @@ public void test339478g() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " if (x instanceof X<>) { \n" +
- " ^\n" +
- "Incorrect number of arguments for type X<T>; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " if (x instanceof X<>) { \n" +
+ " ^\n" +
+ "Incorrect number of arguments for type X<T>; it cannot be parameterized with arguments <>\n" +
"----------\n");
}
public void test339478h() {
@@ -1952,16 +1952,16 @@ public void test339478h() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public void foo(Object x) throws X.Y<>.LException {\n" +
- " ^^^\n" +
- "Incorrect number of arguments for type X.Y<T>; it cannot be parameterized with arguments <>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " static class LException extends Throwable {}\n" +
- " ^^^^^^^^^^\n" +
- "The serializable class LException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public void foo(Object x) throws X.Y<>.LException {\n" +
+ " ^^^\n" +
+ "Incorrect number of arguments for type X.Y<T>; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " static class LException extends Throwable {}\n" +
+ " ^^^^^^^^^^\n" +
+ "The serializable class LException does not declare a static final serialVersionUID field of type long\n" +
"----------\n");
}
public void test339478i() {
@@ -1974,11 +1974,11 @@ public void test339478i() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Object o = new X<> [10];\n" +
- " ^\n" +
- "Incorrect number of arguments for type X<T>; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " Object o = new X<> [10];\n" +
+ " ^\n" +
+ "Incorrect number of arguments for type X<T>; it cannot be parameterized with arguments <>\n" +
"----------\n");
}
public void test339478j() {
@@ -1986,16 +1986,16 @@ public void test339478j() {
new String[] {
"X.java",
"public class X<T> {\n" +
- " public static void main(String[] args) {\n" +
+ " public static void main(String[] args) {\n" +
" X<>[] x1 = null;\n" +
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " X<>[] x1 = null;\n" +
- " ^\n" +
- "Incorrect number of arguments for type X<T>; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " X<>[] x1 = null;\n" +
+ " ^\n" +
+ "Incorrect number of arguments for type X<T>; it cannot be parameterized with arguments <>\n" +
"----------\n");
}
public void test339478k() {
@@ -2006,11 +2006,11 @@ public void test339478k() {
" X<>[] x1 = null;\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " X<>[] x1 = null;\n" +
- " ^\n" +
- "Incorrect number of arguments for type X<T>; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " X<>[] x1 = null;\n" +
+ " ^\n" +
+ "Incorrect number of arguments for type X<T>; it cannot be parameterized with arguments <>\n" +
"----------\n");
}
public void test339478l() {
@@ -2018,16 +2018,16 @@ public void test339478l() {
new String[] {
"X.java",
"public class X<T> {\n" +
- " public static void main(String[] args) {\n" +
- " X<> x1 = null;\n" +
+ " public static void main(String[] args) {\n" +
+ " X<> x1 = null;\n" +
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " X<> x1 = null;\n" +
- " ^\n" +
- "Incorrect number of arguments for type X<T>; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " X<> x1 = null;\n" +
+ " ^\n" +
+ "Incorrect number of arguments for type X<T>; it cannot be parameterized with arguments <>\n" +
"----------\n");
}
public void test339478m() {
@@ -2035,14 +2035,14 @@ public void test339478m() {
new String[] {
"X.java",
"public class X<T> {\n" +
- " X<> f1 = null;\n" +
+ " X<> f1 = null;\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " X<> f1 = null;\n" +
- " ^\n" +
- "Incorrect number of arguments for type X<T>; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " X<> f1 = null;\n" +
+ " ^\n" +
+ "Incorrect number of arguments for type X<T>; it cannot be parameterized with arguments <>\n" +
"----------\n");
}
public void test339478n() {
@@ -2050,160 +2050,160 @@ public void test339478n() {
new String[] {
"X.java",
"public class X<T> {\n" +
- " public void foo(X<> args) {\n" +
+ " public void foo(X<> args) {\n" +
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public void foo(X<> args) {\n" +
- " ^\n" +
- "Incorrect number of arguments for type X<T>; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public void foo(X<> args) {\n" +
+ " ^\n" +
+ "Incorrect number of arguments for type X<T>; it cannot be parameterized with arguments <>\n" +
"----------\n");
}
public void test339478o() {
- String log_18 =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " new X<>(){\n" +
- " ^\n" +
- "\'<>\' cannot be used with anonymous classes\n" +
+ String log_18 =
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " new X<>(){\n" +
+ " ^\n" +
+ "\'<>\' cannot be used with anonymous classes\n" +
"----------\n";
- String log_9 =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " void newMethod(){\n" +
- " ^^^^^^^^^^^\n" +
- "The method newMethod() of type new X<Object>(){} must override or implement a supertype method\n" +
+ String log_9 =
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " void newMethod(){\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method newMethod() of type new X<Object>(){} must override or implement a supertype method\n" +
"----------\n";
String errorMsg = this.complianceLevel < ClassFileConstants.JDK9 ? log_18 : log_9;
this.runNegativeTest(
new String[] {
"X.java",
- "public class X<T> {\n" +
- " public static void main(String[] args) {\n" +
+ "public class X<T> {\n" +
+ " public static void main(String[] args) {\n" +
" new X<>(){\n" +
" void newMethod(){\n" +
" }\n" +
- " }.testFunction(\"SUCCESS\");\n" +
+ " }.testFunction(\"SUCCESS\");\n" +
" }\n" +
" public void testFunction(T param){\n" +
" System.out.println(param);\n" +
- " }\n" +
+ " }\n" +
"}",
},
this.complianceLevel < ClassFileConstants.JDK1_7 ?
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " new X<>(){\n" +
- " ^\n" +
- "\'<>\' operator is not allowed for source level below 1.7\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " new X<>(){\n" +
- " ^\n" +
- "\'<>\' cannot be used with anonymous classes\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " new X<>(){\n" +
+ " ^\n" +
+ "\'<>\' operator is not allowed for source level below 1.7\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " new X<>(){\n" +
+ " ^\n" +
+ "\'<>\' cannot be used with anonymous classes\n" +
"----------\n":
errorMsg);
}
public void test339478p() {
- String log_18 =
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " X Test = new X<>(){\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " X Test = new X<>(){\n" +
- " ^\n" +
- "\'<>\' cannot be used with anonymous classes\n" +
+ String log_18 =
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " X Test = new X<>(){\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " X Test = new X<>(){\n" +
+ " ^\n" +
+ "\'<>\' cannot be used with anonymous classes\n" +
"----------\n";
- String log_9 =
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " X Test = new X<>(){\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " X Test = new X<>(){\n" +
- " void newMethod(){\n" +
- " }\n" +
- " }.testFunction(\"SUCCESS\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from void to X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " void newMethod(){\n" +
- " ^^^^^^^^^^^\n" +
- "The method newMethod() of type new X<Object>(){} must override or implement a supertype method\n" +
+ String log_9 =
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " X Test = new X<>(){\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " X Test = new X<>(){\n" +
+ " void newMethod(){\n" +
+ " }\n" +
+ " }.testFunction(\"SUCCESS\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from void to X\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " void newMethod(){\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method newMethod() of type new X<Object>(){} must override or implement a supertype method\n" +
"----------\n";
String errorMsg = this.complianceLevel < ClassFileConstants.JDK9 ? log_18 : log_9;
this.runNegativeTest(
new String[] {
"X.java",
- "public class X<T> {\n" +
- " public static void main(String[] args) {\n" +
+ "public class X<T> {\n" +
+ " public static void main(String[] args) {\n" +
" X Test = new X<>(){\n" +
" void newMethod(){\n" +
" }\n" +
- " }.testFunction(\"SUCCESS\");\n" +
+ " }.testFunction(\"SUCCESS\");\n" +
" }\n" +
" public void testFunction(T param){\n" +
" System.out.println(param);\n" +
- " }\n" +
+ " }\n" +
"}",
},
this.complianceLevel < ClassFileConstants.JDK1_7 ?
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " X Test = new X<>(){\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " X Test = new X<>(){\n" +
- " ^\n" +
- "\'<>\' operator is not allowed for source level below 1.7\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " X Test = new X<>(){\n" +
- " ^\n" +
- "\'<>\' cannot be used with anonymous classes\n" +
- "----------\n" :
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " X Test = new X<>(){\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " X Test = new X<>(){\n" +
+ " ^\n" +
+ "\'<>\' operator is not allowed for source level below 1.7\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " X Test = new X<>(){\n" +
+ " ^\n" +
+ "\'<>\' cannot be used with anonymous classes\n" +
+ "----------\n" :
errorMsg);
}
public void test339478q() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
" X Test = new X<>();\n" +
" }\n" +
"}",
},
this.complianceLevel < ClassFileConstants.JDK1_7 ?
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " X Test = new X<>();\n" +
- " ^\n" +
- "\'<>\' operator is not allowed for source level below 1.7\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " X Test = new X<>();\n" +
- " ^\n" +
- "The type X is not generic; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " X Test = new X<>();\n" +
+ " ^\n" +
+ "\'<>\' operator is not allowed for source level below 1.7\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " X Test = new X<>();\n" +
+ " ^\n" +
+ "The type X is not generic; it cannot be parameterized with arguments <>\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " X Test = new X<>();\n" +
- " ^\n" +
- "The type X is not generic; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " X Test = new X<>();\n" +
+ " ^\n" +
+ "The type X is not generic; it cannot be parameterized with arguments <>\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=334493
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=334493
public void test334493() {
this.runNegativeTest(
new String[] {
@@ -2223,27 +2223,27 @@ public void test334493() {
"}\n"
},
this.complianceLevel < ClassFileConstants.JDK1_7 ?
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " t = (T) s; //casting to raw type, no error\n" +
- " ^^^^^\n" +
- "Cannot cast from S<Integer> to T\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " t = (T) s; //casting to raw type, no error\n" +
- " ^^^^^\n" +
- "Type safety: The expression of type T needs unchecked conversion to conform to T<Integer>\n" +
- "----------\n" :
- "----------\n" +
- "1. WARNING in X.java (at line 10)\n" +
- " t = (T) s; //casting to raw type, no error\n" +
- " ^^^^^\n" +
- "Type safety: The expression of type T needs unchecked conversion to conform to T<Integer>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " t = (T) s; //casting to raw type, no error\n" +
- " ^\n" +
- "T is a raw type. References to generic type T<B> should be parameterized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " t = (T) s; //casting to raw type, no error\n" +
+ " ^^^^^\n" +
+ "Cannot cast from S<Integer> to T\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " t = (T) s; //casting to raw type, no error\n" +
+ " ^^^^^\n" +
+ "Type safety: The expression of type T needs unchecked conversion to conform to T<Integer>\n" +
+ "----------\n" :
+ "----------\n" +
+ "1. WARNING in X.java (at line 10)\n" +
+ " t = (T) s; //casting to raw type, no error\n" +
+ " ^^^^^\n" +
+ "Type safety: The expression of type T needs unchecked conversion to conform to T<Integer>\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " t = (T) s; //casting to raw type, no error\n" +
+ " ^\n" +
+ "T is a raw type. References to generic type T<B> should be parameterized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=334313
@@ -2257,13 +2257,13 @@ public void test334313() {
"}\n" +
"public class X extends C<String> {\n" +
" zork z;\n" +
- "}\n"
+ "}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " zork z;\n" +
- " ^^^^\n" +
- "zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " zork z;\n" +
+ " ^^^^\n" +
+ "zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=334313
@@ -2276,13 +2276,13 @@ public void test334313b() {
" public Object foo(String x){ return 1; }\n" +
"}\n" +
"public class X extends C<String> {\n" +
- "}\n"
+ "}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " public class X extends C<String> {\n" +
- " ^\n" +
- "The type X must implement the inherited abstract method C<String>.foo(String) to override C<String>.foo(String)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " public class X extends C<String> {\n" +
+ " ^\n" +
+ "The type X must implement the inherited abstract method C<String>.foo(String) to override C<String>.foo(String)\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=334313
@@ -2298,13 +2298,13 @@ public void test334313c() {
"}\n" +
"public class X extends C<String> {\n" +
" zork z;\n" +
- "}\n"
+ "}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " zork z;\n" +
- " ^^^^\n" +
- "zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " zork z;\n" +
+ " ^^^^\n" +
+ "zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=334313
@@ -2319,13 +2319,13 @@ public void test334313d() {
" public Object foo(String x){ return 1; }\n" +
"}\n" +
"public class X extends C<String> {\n" +
- "}\n"
+ "}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " public class X extends C<String> {\n" +
- " ^\n" +
- "The type X must implement the inherited abstract method B<String>.foo(String) to override C<String>.foo(String)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " public class X extends C<String> {\n" +
+ " ^\n" +
+ "The type X must implement the inherited abstract method B<String>.foo(String) to override C<String>.foo(String)\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=334313
@@ -2338,13 +2338,13 @@ public void test334313e() {
" public static Integer foo(String x){ return 1; }\n" +
"}\n" +
"public class X extends C<String> {\n" +
- "}\n"
+ "}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " public class X extends C<String> {\n" +
- " ^\n" +
- "The static method foo(String) conflicts with the abstract method in C<String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " public class X extends C<String> {\n" +
+ " ^\n" +
+ "The static method foo(String) conflicts with the abstract method in C<String>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=347145
@@ -2363,16 +2363,16 @@ public void test347145() {
" F<? extends B, ? extends B<? extends B>> f011 = F.g();\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " F<? extends B, ? extends B<? extends B>> f011 = F.g();\n" +
- " ^\n" +
- "B is a raw type. References to generic type B<V> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " F<? extends B, ? extends B<? extends B>> f011 = F.g();\n" +
- " ^\n" +
- "B is a raw type. References to generic type B<V> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " F<? extends B, ? extends B<? extends B>> f011 = F.g();\n" +
+ " ^\n" +
+ "B is a raw type. References to generic type B<V> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " F<? extends B, ? extends B<? extends B>> f011 = F.g();\n" +
+ " ^\n" +
+ "B is a raw type. References to generic type B<V> should be parameterized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=347426
@@ -2427,7 +2427,7 @@ public void test347426c() {
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=283353
public void test283353() {
- String source =
+ String source =
"public class X {\n" +
" public static void main(String[] args) {\n" +
" EntityKey entityKey = null;\n" +
@@ -2444,19 +2444,19 @@ public void test283353() {
" K extends EntityKey<I>> {\n" +
" }\n" +
"}\n";
-
+
runNegativeTest(
new String[] { "X.java", source },
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " EntityKey entityKey = null;\n" +
- " ^^^^^^^^^\n" +
- "X.EntityKey is a raw type. References to generic type X.EntityKey<I> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " new EntityCondenser().condense(entityKey); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation condense(X.EntityKey) of the generic method condense(K) of type X.EntityCondenser\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " EntityKey entityKey = null;\n" +
+ " ^^^^^^^^^\n" +
+ "X.EntityKey is a raw type. References to generic type X.EntityKey<I> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " new EntityCondenser().condense(entityKey); \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation condense(X.EntityKey) of the generic method condense(K) of type X.EntityCondenser\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=347600
@@ -2475,11 +2475,11 @@ public void test347600() {
" X<B, ? extends D, ? extends E> f = getX(); \n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " X<B, ? extends D, ? extends E> f = getX(); \n" +
- " ^\n" +
- "B is a raw type. References to generic type B<V> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " X<B, ? extends D, ? extends E> f = getX(); \n" +
+ " ^\n" +
+ "B is a raw type. References to generic type B<V> should be parameterized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=347746
@@ -2512,25 +2512,25 @@ public void test348493() {
new String[] {
"X.java",
"public class X<T> {\n" +
- " class X2<Z> {}\n" +
- " public static void main(String[] args) {\n" +
- " X<String>.X2<> x = new X<String>().new X2<>();\n" +
+ " class X2<Z> {}\n" +
+ " public static void main(String[] args) {\n" +
+ " X<String>.X2<> x = new X<String>().new X2<>();\n" +
" }\n" +
" public void testFunction(T param){\n" +
" System.out.println(param);\n" +
- " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " X<String>.X2<> x = new X<String>().new X2<>();\n" +
- " ^^^^^^^^^^^^\n" +
- "Incorrect number of arguments for type X<String>.X2; it cannot be parameterized with arguments <>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " X<String>.X2<> x = new X<String>().new X2<>();\n" +
- " ^^\n" +
- "\'<>\' operator is not allowed for source level below 1.7\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " X<String>.X2<> x = new X<String>().new X2<>();\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Incorrect number of arguments for type X<String>.X2; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " X<String>.X2<> x = new X<String>().new X2<>();\n" +
+ " ^^\n" +
+ "\'<>\' operator is not allowed for source level below 1.7\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=348493
@@ -2542,24 +2542,24 @@ public void test348493a() {
new String[] {
"X.java",
"public class X<T> {\n" +
- " public static void main(String[] args) {\n" +
- " X<> x = new X<>();\n" +
+ " public static void main(String[] args) {\n" +
+ " X<> x = new X<>();\n" +
" }\n" +
" public void testFunction(T param){\n" +
" System.out.println(param);\n" +
- " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " X<> x = new X<>();\n" +
- " ^\n" +
- "Incorrect number of arguments for type X<T>; it cannot be parameterized with arguments <>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " X<> x = new X<>();\n" +
- " ^\n" +
- "\'<>\' operator is not allowed for source level below 1.7\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " X<> x = new X<>();\n" +
+ " ^\n" +
+ "Incorrect number of arguments for type X<T>; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " X<> x = new X<>();\n" +
+ " ^\n" +
+ "\'<>\' operator is not allowed for source level below 1.7\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=366131
@@ -2614,40 +2614,40 @@ public void test366131b() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 13)\n" +
- " return castTo((Class) null).containsNC((Comparable) null);\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation castTo(Class) of the generic method castTo(Class<N>) of type NumberRange<T>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 13)\n" +
- " return castTo((Class) null).containsNC((Comparable) null);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method containsNC(Comparable) belongs to the raw type Range. References to generic type Range<T> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 13)\n" +
- " return castTo((Class) null).containsNC((Comparable) null);\n" +
- " ^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 13)\n" +
+ " return castTo((Class) null).containsNC((Comparable) null);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation castTo(Class) of the generic method castTo(Class<N>) of type NumberRange<T>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 13)\n" +
+ " return castTo((Class) null).containsNC((Comparable) null);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method containsNC(Comparable) belongs to the raw type Range. References to generic type Range<T> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 13)\n" +
+ " return castTo((Class) null).containsNC((Comparable) null);\n" +
+ " ^^^^^^^^^^^^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
"Type safety: The expression of type Class needs unchecked conversion to conform to Class<Number&Comparable<? super Number&Comparable<? super N>>>\n"
:
"Type safety: The expression of type Class needs unchecked conversion to conform to Class<Comparable<? super Comparable<? super N>&Number>&Number>\n"
) +
- "----------\n" +
- "5. WARNING in X.java (at line 13)\n" +
- " return castTo((Class) null).containsNC((Comparable) null);\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 13)\n" +
- " return castTo((Class) null).containsNC((Comparable) null);\n" +
- " ^^^^^^^^^^\n" +
- "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 13)\n" +
+ " return castTo((Class) null).containsNC((Comparable) null);\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 13)\n" +
+ " return castTo((Class) null).containsNC((Comparable) null);\n" +
+ " ^^^^^^^^^^\n" +
+ "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=375394
@@ -2663,17 +2663,17 @@ public void test375394() {
"}\n",
},
this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " return foo(c2,c); \n" +
- " ^^^\n" +
- "Bound mismatch: The generic method foo(C1, C2) of type X is not applicable for the arguments (C2, C1). The inferred type C1 is not a valid substitute for the bounded parameter <C2 extends Collection<Object>>\n" +
- "----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " return foo(c2,c); \n" +
- " ^^^\n" +
- "The method foo(C1, C2) in the type X is not applicable for the arguments (C2, C1)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " return foo(c2,c); \n" +
+ " ^^^\n" +
+ "Bound mismatch: The generic method foo(C1, C2) of type X is not applicable for the arguments (C2, C1). The inferred type C1 is not a valid substitute for the bounded parameter <C2 extends Collection<Object>>\n" +
+ "----------\n" :
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " return foo(c2,c); \n" +
+ " ^^^\n" +
+ "The method foo(C1, C2) in the type X is not applicable for the arguments (C2, C1)\n" +
"----------\n");
}
@@ -2705,26 +2705,26 @@ public void test385780() {
"}"+
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<T> {\n" +
- " ^\n" +
- "Unused type parameter T\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " public <S> X() {\n" +
- " ^\n" +
- "Unused type parameter S\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " interface doNothingInterface<T> {\n" +
- " ^\n" +
- "Unused type parameter T\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " public <T> void doNothingMethod() {}\n" +
- " ^\n" +
- "Unused type parameter T\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X<T> {\n" +
+ " ^\n" +
+ "Unused type parameter T\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " public <S> X() {\n" +
+ " ^\n" +
+ "Unused type parameter S\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " interface doNothingInterface<T> {\n" +
+ " ^\n" +
+ "Unused type parameter T\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 10)\n" +
+ " public <T> void doNothingMethod() {}\n" +
+ " ^\n" +
+ "Unused type parameter T\n" +
"----------\n",
null, true, customOptions);
}
@@ -2734,12 +2734,12 @@ public void test385780() {
public void testBug395002_1() {
runConformTest(new String[] {
"Client.java",
- "interface SelfBound<S extends SelfBound<S, T>, T> {\n" +
+ "interface SelfBound<S extends SelfBound<S, T>, T> {\n" +
"}\n" +
"public class Client {\n" +
- " <A extends SelfBound<?,A>> void foo3(A arg3) {\n" +
- " SelfBound<?, A> var3 = arg3;\n" +
- " SelfBound<? extends SelfBound<?, A>, ?> var4 = var3;\n" +
+ " <A extends SelfBound<?,A>> void foo3(A arg3) {\n" +
+ " SelfBound<?, A> var3 = arg3;\n" +
+ " SelfBound<? extends SelfBound<?, A>, ?> var4 = var3;\n" +
" }\n" +
"}\n"
});
@@ -2750,11 +2750,11 @@ public void testBug395002_1() {
public void testBug395002_2() {
runConformTest(new String[] {
"Client.java",
- "interface SelfBound<S extends SelfBound<S, T>, T> {\n" +
+ "interface SelfBound<S extends SelfBound<S, T>, T> {\n" +
"}\n" +
"public class Client {\n" +
- " <A extends SelfBound<?,A>> void foo2(A arg2) {\n" +
- " SelfBound<? extends SelfBound<?, A>, ?> var2 = arg2;\n" +
+ " <A extends SelfBound<?,A>> void foo2(A arg2) {\n" +
+ " SelfBound<? extends SelfBound<?, A>, ?> var2 = arg2;\n" +
" }\n" +
"}\n"
});
@@ -2765,12 +2765,12 @@ public void testBug395002_2() {
public void testBug395002_3() {
runConformTest(new String[] {
"Client.java",
- "interface SelfBound<S extends SelfBound<S, T>, T> {\n" +
+ "interface SelfBound<S extends SelfBound<S, T>, T> {\n" +
"}\n" +
"public class Client<A extends SelfBound<?,A>> {\n" +
" SelfBound<? extends SelfBound<?, A>, ?> field2;\n" +
- " void foo2(A arg2) {\n" +
- " field2 = arg2;\n" +
+ " void foo2(A arg2) {\n" +
+ " field2 = arg2;\n" +
" }\n" +
"}\n"
});
@@ -2781,12 +2781,12 @@ public void testBug395002_3() {
public void testBug395002_4() {
runConformTest(new String[] {
"Client.java",
- "interface SelfBound<S extends SelfBound<S, T>, T> {\n" +
+ "interface SelfBound<S extends SelfBound<S, T>, T> {\n" +
"}\n" +
"public class Client<A extends SelfBound<?,A>> {\n" +
" void bar(SelfBound<? extends SelfBound<?, A>, ?> argBar) {};\n" +
- " void foo2(A arg2) {\n" +
- " bar(arg2);\n" +
+ " void foo2(A arg2) {\n" +
+ " bar(arg2);\n" +
" }\n" +
"}\n"
});
@@ -2797,14 +2797,14 @@ public void testBug395002_4() {
public void testBug395002_full() {
runConformTest(new String[] {
"Bug.java",
- "interface SelfBound<S extends SelfBound<S, T>, T> {\n" +
+ "interface SelfBound<S extends SelfBound<S, T>, T> {\n" +
"}\n" +
- "class Test<X extends SelfBound<? extends Y, ?>, Y> {\n" +
+ "class Test<X extends SelfBound<? extends Y, ?>, Y> {\n" +
"}\n" +
- "public class Bug<A extends SelfBound<?, A>> {\n" +
- " public Bug() {\n" +
- " new Test<A, SelfBound<?, A>>();\n" +
- " }\n" +
+ "public class Bug<A extends SelfBound<?, A>> {\n" +
+ " public Bug() {\n" +
+ " new Test<A, SelfBound<?, A>>();\n" +
+ " }\n" +
"}\n"
});
}
@@ -2814,14 +2814,14 @@ public void testBug395002_full() {
public void testBug395002_combined() {
runConformTest(new String[] {
"Client.java",
- "interface SelfBound<S extends SelfBound<S, T>, T> {\n" +
+ "interface SelfBound<S extends SelfBound<S, T>, T> {\n" +
"}\n" +
- "class Test<X extends SelfBound<? extends Y, ?>, Y> {\n" +
+ "class Test<X extends SelfBound<? extends Y, ?>, Y> {\n" +
"}\n" +
"public class Client {\n" +
- " <A extends SelfBound<?,A>> void foo2(A arg2) {\n" +
- " Object o = new Test<A, SelfBound<?, A>>();\n" +
- " SelfBound<? extends SelfBound<?, A>, ?> var2 = arg2;\n" +
+ " <A extends SelfBound<?,A>> void foo2(A arg2) {\n" +
+ " Object o = new Test<A, SelfBound<?, A>>();\n" +
+ " SelfBound<? extends SelfBound<?, A>, ?> var2 = arg2;\n" +
" }\n" +
"}\n"
});
@@ -2852,14 +2852,14 @@ public void test397888a() {
" }\n"+
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " public <S> void ph(int i) {\n" +
- " ^\n" +
- "The value of the parameter i is not used\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " public <S> void ph(int i) {\n" +
+ " ^\n" +
+ "The value of the parameter i is not used\n" +
"----------\n",
null, true, customOptions);
-}
+}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=397888
public void test397888b() {
@@ -2885,16 +2885,16 @@ public void test397888b() {
"}\n"+
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public class X <T> {\n" +
- " ^\n" +
- "Unused type parameter T\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " public <S> void ph() {\n" +
- " ^\n" +
- "Unused type parameter S\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " public class X <T> {\n" +
+ " ^\n" +
+ "Unused type parameter T\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " public <S> void ph() {\n" +
+ " ^\n" +
+ "Unused type parameter S\n" +
"----------\n",
null, true, customOptions);
}
@@ -2943,26 +2943,26 @@ public void testBug405706a() {
runNegativeTest(
new String[] {
"TypeUnsafe.java",
- "import java.util.Collection;\n" +
- "\n" +
- "public class TypeUnsafe {\n" +
- " public static <Type,\n" +
- " CollectionType extends Collection<Type>>\n" +
- " CollectionType\n" +
- " nullAsCollection(Class<Type> clazz) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " Collection<Integer> integers = nullAsCollection(String.class);\n" +
- " }\n" +
+ "import java.util.Collection;\n" +
+ "\n" +
+ "public class TypeUnsafe {\n" +
+ " public static <Type,\n" +
+ " CollectionType extends Collection<Type>>\n" +
+ " CollectionType\n" +
+ " nullAsCollection(Class<Type> clazz) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " Collection<Integer> integers = nullAsCollection(String.class);\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in TypeUnsafe.java (at line 12)\n" +
- " Collection<Integer> integers = nullAsCollection(String.class);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Collection<String> to Collection<Integer>\n" +
+ "----------\n" +
+ "1. ERROR in TypeUnsafe.java (at line 12)\n" +
+ " Collection<Integer> integers = nullAsCollection(String.class);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Collection<String> to Collection<Integer>\n" +
"----------\n");
}
// https://bugs.eclipse.org/405706 - Eclipse compiler fails to give compiler error when return type is a inferred generic
@@ -2971,27 +2971,27 @@ public void testBug405706b() {
runNegativeTest(
new String[] {
"TypeUnsafe.java",
- "import java.util.Collection;\n" +
- "import java.util.List;\n" +
- "\n" +
- "public class TypeUnsafe {\n" +
- " public static <Type,\n" +
- " CollectionType extends List<Type>>\n" +
- " CollectionType\n" +
- " nullAsList(Class<Type> clazz) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " Collection<Integer> integers = nullAsList(String.class);\n" +
- " }\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class TypeUnsafe {\n" +
+ " public static <Type,\n" +
+ " CollectionType extends List<Type>>\n" +
+ " CollectionType\n" +
+ " nullAsList(Class<Type> clazz) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " Collection<Integer> integers = nullAsList(String.class);\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in TypeUnsafe.java (at line 13)\n" +
- " Collection<Integer> integers = nullAsList(String.class);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from List<String> to Collection<Integer>\n" +
+ "----------\n" +
+ "1. ERROR in TypeUnsafe.java (at line 13)\n" +
+ " Collection<Integer> integers = nullAsList(String.class);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from List<String> to Collection<Integer>\n" +
"----------\n");
}
@@ -3000,30 +3000,30 @@ public void testBug408441() {
runConformTest(
new String[] {
"TypeMistmatchIssue.java",
- "import java.util.Arrays;\n" +
- "import java.util.List;\n" +
- "\n" +
- "\n" +
- "public class TypeMistmatchIssue {\n" +
- " static interface A {\n" +
- " }\n" +
- " static class B implements A {\n" +
- " }\n" +
- " static class C implements A {\n" +
- " }\n" +
- " static class D implements A {\n" +
- " }\n" +
- " \n" +
- " void illustrate() {\n" +
- " List<Class<? extends A>> no1= Arrays.asList(B.class, A.class); // compiles\n" +
- " List<Class<? extends A>> no2= Arrays.asList(C.class, B.class, A.class); // compiles\n" +
- " List<Class<? extends A>> no3= Arrays.asList(D.class, B.class, A.class); // compiles\n" +
- " \n" +
- " List<Class<? extends A>> no4= Arrays.asList(D.class, C.class, B.class, A.class); // cannot convert error !!!\n" +
- "\n" +
- " List<Class<? extends A>> no5= Arrays.asList(A.class, B.class, C.class, D.class); // compiles\n" +
- " List<Class<? extends A>> no6= Arrays.asList(A.class, D.class, C.class, B.class); // compiles\n" +
- " }\n" +
+ "import java.util.Arrays;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "\n" +
+ "public class TypeMistmatchIssue {\n" +
+ " static interface A {\n" +
+ " }\n" +
+ " static class B implements A {\n" +
+ " }\n" +
+ " static class C implements A {\n" +
+ " }\n" +
+ " static class D implements A {\n" +
+ " }\n" +
+ " \n" +
+ " void illustrate() {\n" +
+ " List<Class<? extends A>> no1= Arrays.asList(B.class, A.class); // compiles\n" +
+ " List<Class<? extends A>> no2= Arrays.asList(C.class, B.class, A.class); // compiles\n" +
+ " List<Class<? extends A>> no3= Arrays.asList(D.class, B.class, A.class); // compiles\n" +
+ " \n" +
+ " List<Class<? extends A>> no4= Arrays.asList(D.class, C.class, B.class, A.class); // cannot convert error !!!\n" +
+ "\n" +
+ " List<Class<? extends A>> no5= Arrays.asList(A.class, B.class, C.class, D.class); // compiles\n" +
+ " List<Class<? extends A>> no6= Arrays.asList(A.class, D.class, C.class, B.class); // compiles\n" +
+ " }\n" +
"}\n"
});
}
@@ -3222,7 +3222,7 @@ public void test426534() {
"public class B extends A {\n" +
" public <T extends A> void foo(T ... o) { }\n" +
"}\n",
-
+
"X.java",
"import p.*;\n" +
"public class X {\n" +
@@ -3231,24 +3231,24 @@ public void test426534() {
" }\n" +
"}\n"
},
- this.complianceLevel < ClassFileConstants.JDK1_7 ?
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " new B().foo(null, null);\n" +
- " ^^^\n" +
- "The method foo(T...) of type B is not applicable as the formal varargs element type T is not accessible here\n" +
- "----------\n" :
- "----------\n" +
- "1. WARNING in p\\B.java (at line 5)\n" +
- " public <T extends A> void foo(T ... o) { }\n" +
- " ^\n" +
- "Type safety: Potential heap pollution via varargs parameter o\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " new B().foo(null, null);\n" +
- " ^^^\n" +
- "The method foo(T...) of type B is not applicable as the formal varargs element type T is not accessible here\n" +
+ this.complianceLevel < ClassFileConstants.JDK1_7 ?
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " new B().foo(null, null);\n" +
+ " ^^^\n" +
+ "The method foo(T...) of type B is not applicable as the formal varargs element type T is not accessible here\n" +
+ "----------\n" :
+ "----------\n" +
+ "1. WARNING in p\\B.java (at line 5)\n" +
+ " public <T extends A> void foo(T ... o) { }\n" +
+ " ^\n" +
+ "Type safety: Potential heap pollution via varargs parameter o\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " new B().foo(null, null);\n" +
+ " ^^^\n" +
+ "The method foo(T...) of type B is not applicable as the formal varargs element type T is not accessible here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426589, [1.8][compiler] Compiler error with generic method/constructor invocation as vargs argument
@@ -3266,33 +3266,33 @@ public void test426589() {
" return \"hi\";\n" +
" }\n" +
"}\n"
- },
+ },
"");
}
public void testBug426590() {
runConformTest(
new String[] {
"A.java",
- "public class A {\n" +
- " \n" +
- " }\n" +
- " \n" +
- " class B extends A {\n" +
- " \n" +
- " }\n" +
- " \n" +
- " class C extends B {\n" +
- " \n" +
- " }\n" +
- " \n" +
- " class D {\n" +
- " D(A a) {\n" +
- " \n" +
- " }\n" +
- " \n" +
- " D(boolean b) {\n" +
- " this(b ? new B() : new C());\n" +
- " }\n" +
+ "public class A {\n" +
+ " \n" +
+ " }\n" +
+ " \n" +
+ " class B extends A {\n" +
+ " \n" +
+ " }\n" +
+ " \n" +
+ " class C extends B {\n" +
+ " \n" +
+ " }\n" +
+ " \n" +
+ " class D {\n" +
+ " D(A a) {\n" +
+ " \n" +
+ " }\n" +
+ " \n" +
+ " D(boolean b) {\n" +
+ " this(b ? new B() : new C());\n" +
+ " }\n" +
" }\n"
});
}
@@ -3300,26 +3300,26 @@ public void testBug426590b() {
runConformTest(
new String[] {
"A.java",
- "public class A {\n" +
- " \n" +
- " }\n" +
- " \n" +
- " class B extends A {\n" +
- " \n" +
- " }\n" +
- " \n" +
- " class C extends B {\n" +
- " \n" +
- " }\n" +
- " \n" +
- " class D {\n" +
- " void bla(boolean b) {\n" +
- " test(b ? new B() : new C());\n" +
- " }\n" +
- " \n" +
- " void test(A a) {\n" +
- " \n" +
- " }\n" +
+ "public class A {\n" +
+ " \n" +
+ " }\n" +
+ " \n" +
+ " class B extends A {\n" +
+ " \n" +
+ " }\n" +
+ " \n" +
+ " class C extends B {\n" +
+ " \n" +
+ " }\n" +
+ " \n" +
+ " class D {\n" +
+ " void bla(boolean b) {\n" +
+ " test(b ? new B() : new C());\n" +
+ " }\n" +
+ " \n" +
+ " void test(A a) {\n" +
+ " \n" +
+ " }\n" +
" }\n"
});
}
@@ -3342,40 +3342,40 @@ public void test426633() {
"}\n"
},
- this.complianceLevel >= ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " <T> void foo (T... p);\n" +
- " ^\n" +
- "Type safety: Potential heap pollution via varargs parameter p\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " public void foo(Object [] p) {}\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Varargs methods should only override or be overridden by other varargs methods unlike A.foo(Object[]) and I.foo(Object...)\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " a.foo(\"hello\", \"world\");\n" +
- " ^^^\n" +
- "The method foo(Object[]) in the type A is not applicable for the arguments (String, String)\n" +
- "----------\n" :
+ this.complianceLevel >= ClassFileConstants.JDK1_8 ?
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " <T> void foo (T... p);\n" +
+ " ^\n" +
+ "Type safety: Potential heap pollution via varargs parameter p\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " public void foo(Object [] p) {}\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Varargs methods should only override or be overridden by other varargs methods unlike A.foo(Object[]) and I.foo(Object...)\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 10)\n" +
+ " a.foo(\"hello\", \"world\");\n" +
+ " ^^^\n" +
+ "The method foo(Object[]) in the type A is not applicable for the arguments (String, String)\n" +
+ "----------\n" :
this.complianceLevel >= ClassFileConstants.JDK1_7 ?
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " <T> void foo (T... p);\n" +
- " ^\n" +
- "Type safety: Potential heap pollution via varargs parameter p\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " public void foo(Object [] p) {}\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Varargs methods should only override or be overridden by other varargs methods unlike A.foo(Object[]) and I.foo(Object...)\n" +
- "----------\n" :
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " public void foo(Object [] p) {}\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Varargs methods should only override or be overridden by other varargs methods unlike A.foo(Object[]) and I.foo(Object...)\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " <T> void foo (T... p);\n" +
+ " ^\n" +
+ "Type safety: Potential heap pollution via varargs parameter p\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " public void foo(Object [] p) {}\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Varargs methods should only override or be overridden by other varargs methods unlike A.foo(Object[]) and I.foo(Object...)\n" +
+ "----------\n" :
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " public void foo(Object [] p) {}\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Varargs methods should only override or be overridden by other varargs methods unlike A.foo(Object[]) and I.foo(Object...)\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426633, [1.8][compiler] Compiler generates code that invokes inapplicable method.
@@ -3400,55 +3400,55 @@ public void test426633a() {
" }\n" +
"}\n"
},
- this.complianceLevel >= ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " <T> void foo (T... p);\n" +
- " ^\n" +
- "Type safety: Potential heap pollution via varargs parameter p\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " abstract class B extends A implements I {\n" +
- " ^\n" +
- "Varargs methods should only override or be overridden by other varargs methods unlike A.foo(Object[]) and I.foo(Object...)\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 11)\n" +
- " public class X extends B implements I {\n" +
- " ^\n" +
- "Varargs methods should only override or be overridden by other varargs methods unlike A.foo(Object[]) and I.foo(Object...)\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 14)\n" +
- " b.foo(\"hello\", \"world\");\n" +
- " ^^^\n" +
- "The method foo(T...) of type I cannot be invoked as it is overridden by an inapplicable method\n" +
- "----------\n" :
+ this.complianceLevel >= ClassFileConstants.JDK1_8 ?
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " <T> void foo (T... p);\n" +
+ " ^\n" +
+ "Type safety: Potential heap pollution via varargs parameter p\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " abstract class B extends A implements I {\n" +
+ " ^\n" +
+ "Varargs methods should only override or be overridden by other varargs methods unlike A.foo(Object[]) and I.foo(Object...)\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 11)\n" +
+ " public class X extends B implements I {\n" +
+ " ^\n" +
+ "Varargs methods should only override or be overridden by other varargs methods unlike A.foo(Object[]) and I.foo(Object...)\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 14)\n" +
+ " b.foo(\"hello\", \"world\");\n" +
+ " ^^^\n" +
+ "The method foo(T...) of type I cannot be invoked as it is overridden by an inapplicable method\n" +
+ "----------\n" :
this.complianceLevel >= ClassFileConstants.JDK1_7 ?
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " <T> void foo (T... p);\n" +
- " ^\n" +
- "Type safety: Potential heap pollution via varargs parameter p\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " abstract class B extends A implements I {\n" +
- " ^\n" +
- "Varargs methods should only override or be overridden by other varargs methods unlike A.foo(Object[]) and I.foo(Object...)\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 11)\n" +
- " public class X extends B implements I {\n" +
- " ^\n" +
- "Varargs methods should only override or be overridden by other varargs methods unlike A.foo(Object[]) and I.foo(Object...)\n" +
- "----------\n" :
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " abstract class B extends A implements I {\n" +
- " ^\n" +
- "Varargs methods should only override or be overridden by other varargs methods unlike A.foo(Object[]) and I.foo(Object...)\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 11)\n" +
- " public class X extends B implements I {\n" +
- " ^\n" +
- "Varargs methods should only override or be overridden by other varargs methods unlike A.foo(Object[]) and I.foo(Object...)\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " <T> void foo (T... p);\n" +
+ " ^\n" +
+ "Type safety: Potential heap pollution via varargs parameter p\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " abstract class B extends A implements I {\n" +
+ " ^\n" +
+ "Varargs methods should only override or be overridden by other varargs methods unlike A.foo(Object[]) and I.foo(Object...)\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 11)\n" +
+ " public class X extends B implements I {\n" +
+ " ^\n" +
+ "Varargs methods should only override or be overridden by other varargs methods unlike A.foo(Object[]) and I.foo(Object...)\n" +
+ "----------\n" :
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " abstract class B extends A implements I {\n" +
+ " ^\n" +
+ "Varargs methods should only override or be overridden by other varargs methods unlike A.foo(Object[]) and I.foo(Object...)\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 11)\n" +
+ " public class X extends B implements I {\n" +
+ " ^\n" +
+ "Varargs methods should only override or be overridden by other varargs methods unlike A.foo(Object[]) and I.foo(Object...)\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426633, [1.8][compiler] Compiler generates code that invokes inapplicable method.
@@ -3471,11 +3471,11 @@ public void test426633b() {
"}\n"
},
this.complianceLevel >= ClassFileConstants.JDK1_7 ?
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " <T> void foo (T... p);\n" +
- " ^\n" +
- "Type safety: Potential heap pollution via varargs parameter p\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " <T> void foo (T... p);\n" +
+ " ^\n" +
+ "Type safety: Potential heap pollution via varargs parameter p\n" +
"----------\n" : "");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426678, [1.8][compiler] Another issue with vararg type element accessibility
@@ -3489,7 +3489,7 @@ public void test426678() {
" new B().foo(null, null);\n" +
" }\n" +
"}\n",
-
+
"p/B.java",
"package p;\n" +
"class A {\n" +
@@ -3499,24 +3499,24 @@ public void test426678() {
" public void foo(Object... o) { System.out.println(\"MB\"); }\n" +
"}\n",
},
- this.complianceLevel < ClassFileConstants.JDK1_7 ?
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " new B().foo(null, null);\n" +
- " ^^^\n" +
- "The method foo(T...) of type B is not applicable as the formal varargs element type T is not accessible here\n" +
+ this.complianceLevel < ClassFileConstants.JDK1_7 ?
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " new B().foo(null, null);\n" +
+ " ^^^\n" +
+ "The method foo(T...) of type B is not applicable as the formal varargs element type T is not accessible here\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " new B().foo(null, null);\n" +
- " ^^^\n" +
- "The method foo(T...) of type B is not applicable as the formal varargs element type T is not accessible here\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in p\\B.java (at line 5)\n" +
- " public <T extends A> void foo(T ... o) { System.out.println(\"PGMB\"); }\n" +
- " ^\n" +
- "Type safety: Potential heap pollution via varargs parameter o\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " new B().foo(null, null);\n" +
+ " ^^^\n" +
+ "The method foo(T...) of type B is not applicable as the formal varargs element type T is not accessible here\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in p\\B.java (at line 5)\n" +
+ " public <T extends A> void foo(T ... o) { System.out.println(\"PGMB\"); }\n" +
+ " ^\n" +
+ "Type safety: Potential heap pollution via varargs parameter o\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426678, [1.8][compiler] Another issue with vararg type element accessibility
@@ -3554,7 +3554,7 @@ public void test421922() {
" new B().foo(null, null);\n" +
" }\n" +
"}\n",
-
+
"p/B.java",
"package p;\n" +
"interface A {\n" +
@@ -3564,24 +3564,24 @@ public void test421922() {
" public void foo(Object... o) { System.out.println(\"MB\"); }\n" +
"}\n",
},
- this.complianceLevel < ClassFileConstants.JDK1_7 ?
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " new B().foo(null, null);\n" +
- " ^^^\n" +
- "The method foo(T...) of type B is not applicable as the formal varargs element type T is not accessible here\n" +
+ this.complianceLevel < ClassFileConstants.JDK1_7 ?
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " new B().foo(null, null);\n" +
+ " ^^^\n" +
+ "The method foo(T...) of type B is not applicable as the formal varargs element type T is not accessible here\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " new B().foo(null, null);\n" +
- " ^^^\n" +
- "The method foo(T...) of type B is not applicable as the formal varargs element type T is not accessible here\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in p\\B.java (at line 5)\n" +
- " public <T extends A> void foo(T ... o) { System.out.println(\"PGMB\"); }\n" +
- " ^\n" +
- "Type safety: Potential heap pollution via varargs parameter o\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " new B().foo(null, null);\n" +
+ " ^^^\n" +
+ "The method foo(T...) of type B is not applicable as the formal varargs element type T is not accessible here\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in p\\B.java (at line 5)\n" +
+ " public <T extends A> void foo(T ... o) { System.out.println(\"PGMB\"); }\n" +
+ " ^\n" +
+ "Type safety: Potential heap pollution via varargs parameter o\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425719, [1.8][compiler] Bogus ambiguous call error from compiler.
@@ -3591,7 +3591,7 @@ public void test425719() {
" default <T> void foo(List<T> list) {\n" +
" System.out.println(\"interface method\");\n" +
" }\n";
-
+
runConformTest(
new String[] {
"X.java",
@@ -3620,7 +3620,7 @@ public void test425719a() {
" default <T> void foo(List<T> list) {\n" +
" System.out.println(\"interface method\");\n" +
" }\n";
-
+
runNegativeTest(
new String[] {
"X.java",
@@ -3640,11 +3640,11 @@ public void test425719a() {
"}\n" +
"class Y extends X {}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 17)\n" +
- " class Y extends X {}\n" +
- " ^\n" +
- "The type Y must implement the inherited abstract method Base.foo(List<T>)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 17)\n" +
+ " class Y extends X {}\n" +
+ " ^\n" +
+ "The type Y must implement the inherited abstract method Base.foo(List<T>)\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425719, [1.8][compiler] Bogus ambiguous call error from compiler.
@@ -3656,7 +3656,7 @@ public void test425719b() {
" default <T> void foo(List<T> list) {\n" +
" System.out.println(\"interface method\");\n" +
" }\n";
-
+
runConformTest(
new String[] {
"X.java",
@@ -3704,27 +3704,27 @@ public void test427282() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 10)\n" +
- " for (X a : as) {\n" +
- " ^^\n" +
- "Null pointer access: The variable as can only be null at this location\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 10)\n" +
+ " for (X a : as) {\n" +
+ " ^^\n" +
+ "Null pointer access: The variable as can only be null at this location\n" +
"----------\n");
}
public void testBug427216() {
runConformTest(
new String[] {
"Test.java",
- "public class Test\n" +
- "{\n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " foo(args); // ok in 1.7 and 1.8\n" +
+ "public class Test\n" +
+ "{\n" +
+ " public static void main(String[] args)\n" +
+ " {\n" +
+ " foo(args); // ok in 1.7 and 1.8\n" +
" foo(java.util.Arrays.asList(\"1\").toArray(new String[0]));\n" +
- " System.out.println(\"good\");\n" +
- " }\n" +
- "\n" +
- " private static void foo(String... args) { }\n" +
+ " System.out.println(\"good\");\n" +
+ " }\n" +
+ "\n" +
+ " private static void foo(String... args) { }\n" +
"}\n"
},
"good");
@@ -3800,19 +3800,19 @@ public void testBug427438c3() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " return (List<A>) data(b ? (Serializable) get() : null);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Serializable to List<X.A>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 14)\n" +
- " public class A implements Serializable {\n" +
- " ^\n" +
- "The serializable class A does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " return (List<A>) data(b ? (Serializable) get() : null);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Serializable to List<X.A>\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 14)\n" +
+ " public class A implements Serializable {\n" +
+ " ^\n" +
+ "The serializable class A does not declare a static final serialVersionUID field of type long\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427411, [1.8][generics] JDT reports type mismatch when using method that returns generic type
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427411, [1.8][generics] JDT reports type mismatch when using method that returns generic type
public void test427411() {
runNegativeTest(
new String[] {
@@ -3821,39 +3821,39 @@ public void test427411() {
"public class X {\n" +
"\n" +
" public static void main() {\n" +
-
+
" List<Object> list = null;\n" +
" Object o = null;\n" +
-
+
" genericMethod(list, genericClassTransformer(genericClassFactory(o)));\n" +
-
+
" genericMethod(list, genericClassFactory(o)); // works\n" +
-
+
" GenericClass<Iterable<? super Object>> tempVariable = genericClassTransformer(genericClassFactory(o));\n" +
-
+
" GenericClass<Iterable<? super Object>> tempVariable2 = genericClassFactory(o); // works\n" +
-
+
" }\n" +
-
+
" private static <T> void genericMethod(T param1, GenericClass<? super T> param2) {\n" +
" throw new UnsupportedOperationException();\n" +
" }\n" +
-
+
" public static <T> GenericClass<Iterable<? super T>> genericClassFactory(T item) {\n" +
" throw new UnsupportedOperationException();\n" +
" }\n" +
-
+
" public static <T> GenericClass<T> genericClassTransformer(GenericClass<T> matcher) {\n" +
" throw new UnsupportedOperationException();\n" +
" }\n" +
-
+
" private static class GenericClass<T> {\n" +
" }\n" +
"}\n"
},
"");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427728, [1.8] Type Inference rejects calls requiring boxing/unboxing
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427728, [1.8] Type Inference rejects calls requiring boxing/unboxing
public void test427728() {
runConformTest(
new String[] {
@@ -3872,7 +3872,7 @@ public void test427728() {
},
"1234");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427728, [1.8] Type Inference rejects calls requiring boxing/unboxing
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427728, [1.8] Type Inference rejects calls requiring boxing/unboxing
public void test427728a() {
runNegativeTest(
new String[] {
@@ -3887,7 +3887,7 @@ public void test427728a() {
},
"");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427736, [1.8][generics] Method not applicable error with identical parameter types
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427736, [1.8][generics] Method not applicable error with identical parameter types
public void test427736() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.ENABLED);
@@ -3909,7 +3909,7 @@ public void test427736() {
},
"", null, true, customOptions);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426836, [1.8] special handling for return type in references to method getClass() ?
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426836, [1.8] special handling for return type in references to method getClass() ?
public void test426836() {
runNegativeTest(
new String[] {
@@ -3921,13 +3921,13 @@ public void test426836() {
" public static void main(String[] args) {\n" +
" Class<? extends String> id = id(new X().getClass());\n" +
" }\n" +
- "}\n"
+ "}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " Class<? extends String> id = id(new X().getClass());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Class<capture#1-of ? extends X> to Class<? extends String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " Class<? extends String> id = id(new X().getClass());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Class<capture#1-of ? extends X> to Class<? extends String>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428071, [1.8][compiler] Bogus error about incompatible return type during override
@@ -3951,17 +3951,17 @@ public void test428071() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in K1.java (at line 4)\n" +
- " public Map<String,List> get();\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in K.java (at line 4)\n" +
- " public Map<String, List> get() {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in K1.java (at line 4)\n" +
+ " public Map<String,List> get();\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in K.java (at line 4)\n" +
+ " public Map<String, List> get() {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
"----------\n",
null,
true,
@@ -4024,11 +4024,11 @@ public void testBug428366() {
" Zork z;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
public void test429733b() {
@@ -4070,7 +4070,7 @@ public void test429733c() {
},
"1.1");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426537, [1.8][inference] Eclipse compiler thinks I<? super J> is compatible with I<J<?>> - raw type J involved
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426537, [1.8][inference] Eclipse compiler thinks I<? super J> is compatible with I<J<?>> - raw type J involved
public void testBug426537() { // non generic case
runNegativeTest(
new String[] {
@@ -4086,34 +4086,34 @@ public void testBug426537() { // non generic case
"interface I<T> {}\n" +
"interface J<T> {}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " void foo(J[] list, I<J<?>> i) {\n" +
- " ^\n" +
- "J is a raw type. References to generic type J<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " sort(list, i);\n" +
- " ^^^^\n" +
- "The method sort(J[], I<? super J>) in the type X is not applicable for the arguments (J[], I<J<?>>)\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 5)\n" +
- " J[] sort(J[] list, I<? super J> i) {\n" +
- " ^\n" +
- "J is a raw type. References to generic type J<T> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 5)\n" +
- " J[] sort(J[] list, I<? super J> i) {\n" +
- " ^\n" +
- "J is a raw type. References to generic type J<T> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 5)\n" +
- " J[] sort(J[] list, I<? super J> i) {\n" +
- " ^\n" +
- "J is a raw type. References to generic type J<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " void foo(J[] list, I<J<?>> i) {\n" +
+ " ^\n" +
+ "J is a raw type. References to generic type J<T> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " sort(list, i);\n" +
+ " ^^^^\n" +
+ "The method sort(J[], I<? super J>) in the type X is not applicable for the arguments (J[], I<J<?>>)\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 5)\n" +
+ " J[] sort(J[] list, I<? super J> i) {\n" +
+ " ^\n" +
+ "J is a raw type. References to generic type J<T> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 5)\n" +
+ " J[] sort(J[] list, I<? super J> i) {\n" +
+ " ^\n" +
+ "J is a raw type. References to generic type J<T> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 5)\n" +
+ " J[] sort(J[] list, I<? super J> i) {\n" +
+ " ^\n" +
+ "J is a raw type. References to generic type J<T> should be parameterized\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426537, [1.8][inference] Eclipse compiler thinks I<? super J> is compatible with I<J<?>> - raw type J involved
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426537, [1.8][inference] Eclipse compiler thinks I<? super J> is compatible with I<J<?>> - raw type J involved
public void testBug426537_generic() {
runNegativeTest(
new String[] {
@@ -4129,19 +4129,19 @@ public void testBug426537_generic() {
"interface I<T> {}\n" +
"interface J<T> {}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " void foo(J[] list, I<J<?>> i) {\n" +
- " ^\n" +
- "J is a raw type. References to generic type J<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " sort(list, i);\n" +
- " ^^^^\n" +
- "The method sort(T[], I<? super T>) in the type X is not applicable for the arguments (J[], I<J<?>>)\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " void foo(J[] list, I<J<?>> i) {\n" +
+ " ^\n" +
+ "J is a raw type. References to generic type J<T> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " sort(list, i);\n" +
+ " ^^^^\n" +
+ "The method sort(T[], I<? super T>) in the type X is not applicable for the arguments (J[], I<J<?>>)\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427957, [1.8] Type inference incorrect when a wildcard is missing
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427957, [1.8] Type inference incorrect when a wildcard is missing
public void testBug427957() {
runNegativeTest(
new String[] {
@@ -4154,16 +4154,16 @@ public void testBug427957() {
"}\n" +
"interface I<T> {}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " void foo(I[] e, I<I<?>> comp) {\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " sort(e, comp);\n" +
- " ^^^^\n" +
- "The method sort(T[], I<? super T>) in the type X is not applicable for the arguments (I[], I<I<?>>)\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " void foo(I[] e, I<I<?>> comp) {\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<T> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " sort(e, comp);\n" +
+ " ^^^^\n" +
+ "The method sort(T[], I<? super T>) in the type X is not applicable for the arguments (I[], I<I<?>>)\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427992, [1.8] compiler difference to javac involving a raw array
@@ -4207,149 +4207,149 @@ public void test427992() {
"}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import static org.junit.Assert.assertArrayEquals;\n" +
- " ^^^^^^^^^\n" +
- "The import org.junit cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " import org.junit.Test;\n" +
- " ^^^^^^^^^\n" +
- "The import org.junit cannot be resolved\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " @Test(expected = IllegalArgumentException.class)\n" +
- " ^^^^\n" +
- "Test cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " Arrays.sort(new Class[] {Chimp.class, Cat.class}, ClassInheritanceDepthComparator.INSTANCE);\n" +
- " ^^^^\n" +
- "The method sort(T[], Comparator<? super T>) in the type Arrays is not applicable for the arguments (Class[], X.ClassInheritanceDepthComparator)\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 17)\n" +
- " public static class ClassInheritanceDepthComparator implements Comparator<Class<?>> {\n" +
- " ^^^^^^^^^^\n" +
- "Comparator cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 20)\n" +
- " public int compare(Class<?> c1, Class<?> c2) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The method compare(Class<?>, Class<?>) of type X.ClassInheritanceDepthComparator must override or implement a supertype method\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " import static org.junit.Assert.assertArrayEquals;\n" +
+ " ^^^^^^^^^\n" +
+ "The import org.junit cannot be resolved\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " import org.junit.Test;\n" +
+ " ^^^^^^^^^\n" +
+ "The import org.junit cannot be resolved\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " @Test(expected = IllegalArgumentException.class)\n" +
+ " ^^^^\n" +
+ "Test cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " Arrays.sort(new Class[] {Chimp.class, Cat.class}, ClassInheritanceDepthComparator.INSTANCE);\n" +
+ " ^^^^\n" +
+ "The method sort(T[], Comparator<? super T>) in the type Arrays is not applicable for the arguments (Class[], X.ClassInheritanceDepthComparator)\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 17)\n" +
+ " public static class ClassInheritanceDepthComparator implements Comparator<Class<?>> {\n" +
+ " ^^^^^^^^^^\n" +
+ "Comparator cannot be resolved to a type\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 20)\n" +
+ " public int compare(Class<?> c1, Class<?> c2) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The method compare(Class<?>, Class<?>) of type X.ClassInheritanceDepthComparator must override or implement a supertype method\n" +
"----------\n");
}
public void testBug430987() {
String source =
- "public class X {\n" +
- "\n" +
- " public static interface Foo<T> {\n" +
- " // no content\n" +
- " }\n" +
- "\n" +
- " public void compileError() {\n" +
- " doSomethingWithFoo( any( Foo.class ), any( Foo.class ) );\n" +
- " }\n" +
- "\n" +
- " public void noCompileError() {\n" +
- " Foo foo = any( Foo.class );\n" +
- " doSomethingWithFoo( foo, foo );\n" +
- " }\n" +
- "\n" +
- " public void fix() {\n" +
- " this.<Object>doSomethingWithFoo( any( Foo.class ), any( Foo.class ) );\n" +
- " }\n" +
- "\n" +
- " public <T> void doSomethingWithFoo( Foo<T> foo, Foo<T> foo2 ) {\n" +
- " // do something\n" +
- " }\n" +
- "\n" +
- " public static <T> T any(Class<T> clazz) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
+ "public class X {\n" +
+ "\n" +
+ " public static interface Foo<T> {\n" +
+ " // no content\n" +
+ " }\n" +
+ "\n" +
+ " public void compileError() {\n" +
+ " doSomethingWithFoo( any( Foo.class ), any( Foo.class ) );\n" +
+ " }\n" +
+ "\n" +
+ " public void noCompileError() {\n" +
+ " Foo foo = any( Foo.class );\n" +
+ " doSomethingWithFoo( foo, foo );\n" +
+ " }\n" +
+ "\n" +
+ " public void fix() {\n" +
+ " this.<Object>doSomethingWithFoo( any( Foo.class ), any( Foo.class ) );\n" +
+ " }\n" +
+ "\n" +
+ " public <T> void doSomethingWithFoo( Foo<T> foo, Foo<T> foo2 ) {\n" +
+ " // do something\n" +
+ " }\n" +
+ "\n" +
+ " public static <T> T any(Class<T> clazz) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
"}\n";
runNegativeTest(
new String[] {
"X.java",
source
},
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " doSomethingWithFoo( any( Foo.class ), any( Foo.class ) );\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation doSomethingWithFoo(X.Foo, X.Foo) of the generic method doSomethingWithFoo(X.Foo<T>, X.Foo<T>) of type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " doSomethingWithFoo( any( Foo.class ), any( Foo.class ) );\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type X.Foo needs unchecked conversion to conform to X.Foo<Object>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 8)\n" +
- " doSomethingWithFoo( any( Foo.class ), any( Foo.class ) );\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type X.Foo needs unchecked conversion to conform to X.Foo<Object>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 12)\n" +
- " Foo foo = any( Foo.class );\n" +
- " ^^^\n" +
- "X.Foo is a raw type. References to generic type X.Foo<T> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 13)\n" +
- " doSomethingWithFoo( foo, foo );\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation doSomethingWithFoo(X.Foo, X.Foo) of the generic method doSomethingWithFoo(X.Foo<T>, X.Foo<T>) of type X\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 13)\n" +
- " doSomethingWithFoo( foo, foo );\n" +
- " ^^^\n" +
- "Type safety: The expression of type X.Foo needs unchecked conversion to conform to X.Foo<Object>\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 13)\n" +
- " doSomethingWithFoo( foo, foo );\n" +
- " ^^^\n" +
- "Type safety: The expression of type X.Foo needs unchecked conversion to conform to X.Foo<Object>\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 17)\n" +
- " this.<Object>doSomethingWithFoo( any( Foo.class ), any( Foo.class ) );\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation doSomethingWithFoo(X.Foo, X.Foo) of the generic method doSomethingWithFoo(X.Foo<T>, X.Foo<T>) of type X\n" +
- "----------\n" +
- "9. WARNING in X.java (at line 17)\n" +
- " this.<Object>doSomethingWithFoo( any( Foo.class ), any( Foo.class ) );\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type X.Foo needs unchecked conversion to conform to X.Foo<Object>\n" +
- "----------\n" +
- "10. WARNING in X.java (at line 17)\n" +
- " this.<Object>doSomethingWithFoo( any( Foo.class ), any( Foo.class ) );\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type X.Foo needs unchecked conversion to conform to X.Foo<Object>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " doSomethingWithFoo( any( Foo.class ), any( Foo.class ) );\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation doSomethingWithFoo(X.Foo, X.Foo) of the generic method doSomethingWithFoo(X.Foo<T>, X.Foo<T>) of type X\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " doSomethingWithFoo( any( Foo.class ), any( Foo.class ) );\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type X.Foo needs unchecked conversion to conform to X.Foo<Object>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 8)\n" +
+ " doSomethingWithFoo( any( Foo.class ), any( Foo.class ) );\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type X.Foo needs unchecked conversion to conform to X.Foo<Object>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 12)\n" +
+ " Foo foo = any( Foo.class );\n" +
+ " ^^^\n" +
+ "X.Foo is a raw type. References to generic type X.Foo<T> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 13)\n" +
+ " doSomethingWithFoo( foo, foo );\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation doSomethingWithFoo(X.Foo, X.Foo) of the generic method doSomethingWithFoo(X.Foo<T>, X.Foo<T>) of type X\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 13)\n" +
+ " doSomethingWithFoo( foo, foo );\n" +
+ " ^^^\n" +
+ "Type safety: The expression of type X.Foo needs unchecked conversion to conform to X.Foo<Object>\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 13)\n" +
+ " doSomethingWithFoo( foo, foo );\n" +
+ " ^^^\n" +
+ "Type safety: The expression of type X.Foo needs unchecked conversion to conform to X.Foo<Object>\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 17)\n" +
+ " this.<Object>doSomethingWithFoo( any( Foo.class ), any( Foo.class ) );\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation doSomethingWithFoo(X.Foo, X.Foo) of the generic method doSomethingWithFoo(X.Foo<T>, X.Foo<T>) of type X\n" +
+ "----------\n" +
+ "9. WARNING in X.java (at line 17)\n" +
+ " this.<Object>doSomethingWithFoo( any( Foo.class ), any( Foo.class ) );\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type X.Foo needs unchecked conversion to conform to X.Foo<Object>\n" +
+ "----------\n" +
+ "10. WARNING in X.java (at line 17)\n" +
+ " this.<Object>doSomethingWithFoo( any( Foo.class ), any( Foo.class ) );\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type X.Foo needs unchecked conversion to conform to X.Foo<Object>\n" +
"----------\n");
}
public void testBug430686() {
runConformTest(
new String[] {
"TestClass.java",
- "\n" +
- "public class TestClass\n" +
- "{\n" +
- " private static class Alice<A extends Alice<A, B>, B extends Bob>\n" +
- " {\n" +
- " }\n" +
- "\n" +
- " public static class Bob\n" +
- " {\n" +
- " }\n" +
- "\n" +
- " public void callingMethod()\n" +
- " {\n" +
- " calledMethod(); // error: The method calledMethod() in the type TestClass is not applicable for the arguments ()\n" +
- " }\n" +
- "\n" +
- " private <A extends Alice<A, B>, B extends Bob> A calledMethod()\n" +
- " {\n" +
- " return null;\n" +
- " }\n" +
+ "\n" +
+ "public class TestClass\n" +
+ "{\n" +
+ " private static class Alice<A extends Alice<A, B>, B extends Bob>\n" +
+ " {\n" +
+ " }\n" +
+ "\n" +
+ " public static class Bob\n" +
+ " {\n" +
+ " }\n" +
+ "\n" +
+ " public void callingMethod()\n" +
+ " {\n" +
+ " calledMethod(); // error: The method calledMethod() in the type TestClass is not applicable for the arguments ()\n" +
+ " }\n" +
+ "\n" +
+ " private <A extends Alice<A, B>, B extends Bob> A calledMethod()\n" +
+ " {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
});
}
@@ -4357,36 +4357,36 @@ public void testBug430759() {
runConformTest(
new String[] {
"A.java",
- "class CriteriaBuilder {\n" +
- "\n" +
- "}\n" +
- "\n" +
- "class CriteriaQuery<T> {\n" +
- "\n" +
- "}\n" +
- "\n" +
- "class Root<T> {\n" +
- "\n" +
- "}\n" +
- "\n" +
- "public class A<E> {\n" +
- "\n" +
- " protected abstract class CustomGenericQuery<T> {\n" +
- " }\n" +
- "\n" +
- " protected <T> T executeCustomSingleQuery(CustomGenericQuery<T> customQuery, Class<T> resultClass) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " public Long getCount() {\n" +
- " return executeCustomSingleQuery(\n" +
- "\n" +
- " new CustomGenericQuery<Long>() {\n" +
- " public void customizeQuery(final Root<E> root, final CriteriaBuilder cb,\n" +
- " CriteriaQuery<Long> cq) {\n" +
- " }\n" +
- " }, Long.class);\n" +
- " }\n" +
+ "class CriteriaBuilder {\n" +
+ "\n" +
+ "}\n" +
+ "\n" +
+ "class CriteriaQuery<T> {\n" +
+ "\n" +
+ "}\n" +
+ "\n" +
+ "class Root<T> {\n" +
+ "\n" +
+ "}\n" +
+ "\n" +
+ "public class A<E> {\n" +
+ "\n" +
+ " protected abstract class CustomGenericQuery<T> {\n" +
+ " }\n" +
+ "\n" +
+ " protected <T> T executeCustomSingleQuery(CustomGenericQuery<T> customQuery, Class<T> resultClass) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " public Long getCount() {\n" +
+ " return executeCustomSingleQuery(\n" +
+ "\n" +
+ " new CustomGenericQuery<Long>() {\n" +
+ " public void customizeQuery(final Root<E> root, final CriteriaBuilder cb,\n" +
+ " CriteriaQuery<Long> cq) {\n" +
+ " }\n" +
+ " }, Long.class);\n" +
+ " }\n" +
"}\n"
});
}
@@ -4394,28 +4394,28 @@ public void testBug431408() {
runConformTest(
new String[] {
"EclipseJava8Generics.java",
- "public class EclipseJava8Generics {\n" +
- "\n" +
- " public interface Foo<V> {\n" +
- " }\n" +
- "\n" +
- " public static class FooBar<V, T extends Foo<V>> {\n" +
- " }\n" +
- "\n" +
- " public static class BaseClass {\n" +
- " protected <V> FooBar<V, ? extends Foo<V>> doSomething() {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static class DerivedClass extends BaseClass {\n" +
- " @Override\n" +
- " protected <V> FooBar<V, ? extends Foo<V>> doSomething() {\n" +
- " //Eclipse 4.3.2 with Java 8 can't compile the next line \n" +
- " FooBar<V, ? extends Foo<V>> prop = super.doSomething();\n" +
- " return prop;\n" +
- " }\n" +
- " }\n" +
+ "public class EclipseJava8Generics {\n" +
+ "\n" +
+ " public interface Foo<V> {\n" +
+ " }\n" +
+ "\n" +
+ " public static class FooBar<V, T extends Foo<V>> {\n" +
+ " }\n" +
+ "\n" +
+ " public static class BaseClass {\n" +
+ " protected <V> FooBar<V, ? extends Foo<V>> doSomething() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public static class DerivedClass extends BaseClass {\n" +
+ " @Override\n" +
+ " protected <V> FooBar<V, ? extends Foo<V>> doSomething() {\n" +
+ " //Eclipse 4.3.2 with Java 8 can't compile the next line \n" +
+ " FooBar<V, ? extends Foo<V>> prop = super.doSomething();\n" +
+ " return prop;\n" +
+ " }\n" +
+ " }\n" +
"}\n"
});
}
@@ -4424,74 +4424,74 @@ public void testBug431581() {
runNegativeTest(
new String[] {
"BugEclipse.java",
- "public class BugEclipse\n" +
- "{\n" +
- " static Dog dog = new Dog();\n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " System.out.println(\"bug compile eclipse\");\n" +
- " Cat cat = getDog(); // <- error here, eclipse compile this line but the execution print ClassCastException\n" +
- " }\n" +
- " public static <T extends Dog> T getDog()\n" +
- " {\n" +
- " return (T) dog;\n" +
- " }\n" +
- " static class Cat {\n" +
- " }\n" +
- " static class Dog {\n" +
- " }\n" +
+ "public class BugEclipse\n" +
+ "{\n" +
+ " static Dog dog = new Dog();\n" +
+ " public static void main(String[] args)\n" +
+ " {\n" +
+ " System.out.println(\"bug compile eclipse\");\n" +
+ " Cat cat = getDog(); // <- error here, eclipse compile this line but the execution print ClassCastException\n" +
+ " }\n" +
+ " public static <T extends Dog> T getDog()\n" +
+ " {\n" +
+ " return (T) dog;\n" +
+ " }\n" +
+ " static class Cat {\n" +
+ " }\n" +
+ " static class Dog {\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in BugEclipse.java (at line 7)\n" +
- " Cat cat = getDog(); // <- error here, eclipse compile this line but the execution print ClassCastException\n" +
+ "----------\n" +
+ "1. ERROR in BugEclipse.java (at line 7)\n" +
+ " Cat cat = getDog(); // <- error here, eclipse compile this line but the execution print ClassCastException\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- " ^^^^^^\n" +
+ " ^^^^^^\n" +
"Bound mismatch: The generic method getDog() of type BugEclipse is not applicable for the arguments (). The inferred type BugEclipse.Cat&BugEclipse.Dog is not a valid substitute for the bounded parameter <T extends BugEclipse.Dog>\n"
- :
- " ^^^^^^^^\n" +
+ :
+ " ^^^^^^^^\n" +
"Type mismatch: cannot convert from BugEclipse.Dog to BugEclipse.Cat\n"
) +
- "----------\n" +
- "2. WARNING in BugEclipse.java (at line 11)\n" +
- " return (T) dog;\n" +
- " ^^^^^^^\n" +
- "Type safety: Unchecked cast from BugEclipse.Dog to T\n" +
+ "----------\n" +
+ "2. WARNING in BugEclipse.java (at line 11)\n" +
+ " return (T) dog;\n" +
+ " ^^^^^^^\n" +
+ "Type safety: Unchecked cast from BugEclipse.Dog to T\n" +
"----------\n");
}
public void testBug432603() {
runNegativeTest(
new String[] {
"Test.java",
- "import java.util.Map;\n" +
- "import java.util.Map.Entry;\n" +
- "\n" +
+ "import java.util.Map;\n" +
+ "import java.util.Map.Entry;\n" +
+ "\n" +
"abstract class Optional<T> {\n" +
" public static <T> Optional<T> fromNullable(T t) { return null; }\n" +
- " abstract Optional<T> or(Optional<? extends T> secondChoice);\n" +
- " abstract T or(Supplier<? extends T> supplier);\n" +
+ " abstract Optional<T> or(Optional<? extends T> secondChoice);\n" +
+ " abstract T or(Supplier<? extends T> supplier);\n" +
" abstract T or(T defaultValue);\n" +
- "}\n" +
+ "}\n" +
"\n" +
"interface Supplier<T> { T get(); }\n" +
- "\n" +
- "public class Test {\n" +
- "\n" +
- " private static final Object NO_VALUE = new Object();\n" +
- "\n" +
- " public void method(Map<String, ?> map) {\n" +
- " for (Entry<String, ?> entry : map.entrySet()) {\n" +
- " Optional.fromNullable(entry.getValue()).or(NO_VALUE);\n" +
- "// ^^ error here\n" +
- " }\n" +
- " }\n" +
+ "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " private static final Object NO_VALUE = new Object();\n" +
+ "\n" +
+ " public void method(Map<String, ?> map) {\n" +
+ " for (Entry<String, ?> entry : map.entrySet()) {\n" +
+ " Optional.fromNullable(entry.getValue()).or(NO_VALUE);\n" +
+ "// ^^ error here\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 19)\n" +
- " Optional.fromNullable(entry.getValue()).or(NO_VALUE);\n" +
- " ^^\n" +
- "The method or(Optional<? extends capture#2-of ?>) in the type Optional<capture#2-of ?> is not applicable for the arguments (Object)\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 19)\n" +
+ " Optional.fromNullable(entry.getValue()).or(NO_VALUE);\n" +
+ " ^^\n" +
+ "The method or(Optional<? extends capture#2-of ?>) in the type Optional<capture#2-of ?> is not applicable for the arguments (Object)\n" +
"----------\n",
JavacTestOptions.Excuse.JavacCompilesIncorrectSource);
}
@@ -4499,28 +4499,28 @@ public void testBug432603a() {
runConformTest(
new String[] {
"Test.java",
- "import java.util.Map;\n" +
- "import java.util.Map.Entry;\n" +
- "\n" +
+ "import java.util.Map;\n" +
+ "import java.util.Map.Entry;\n" +
+ "\n" +
"abstract class Optional<T> {\n" +
" public static <T> Optional<T> fromNullable(T t) { return null; }\n" +
- " abstract Optional<T> or(Optional<? extends T> secondChoice);\n" +
- " abstract T or(Supplier<? extends T> supplier);\n" +
+ " abstract Optional<T> or(Optional<? extends T> secondChoice);\n" +
+ " abstract T or(Supplier<? extends T> supplier);\n" +
" abstract T or(T defaultValue);\n" +
- "}\n" +
+ "}\n" +
"\n" +
"interface Supplier<T> { T get(); }\n" +
- "\n" +
- "public class Test {\n" +
- "\n" +
- " private static final Object NO_VALUE = new Object();\n" +
- "\n" +
- " public void method(Map<String, ?> map) {\n" +
- " for (Entry<String, ?> entry : map.entrySet()) {\n" +
- " Optional.<Object>fromNullable(entry.getValue()).or(NO_VALUE);\n" +
- "// ^^ error here\n" +
- " }\n" +
- " }\n" +
+ "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " private static final Object NO_VALUE = new Object();\n" +
+ "\n" +
+ " public void method(Map<String, ?> map) {\n" +
+ " for (Entry<String, ?> entry : map.entrySet()) {\n" +
+ " Optional.<Object>fromNullable(entry.getValue()).or(NO_VALUE);\n" +
+ "// ^^ error here\n" +
+ " }\n" +
+ " }\n" +
"}\n"
});
}
@@ -4530,109 +4530,109 @@ public void testBug399527() {
JavacTestOptions.Excuse.JavacCompilesIncorrectSource,
new String[] {
"TypeInferenceProblem.java",
- "\n" +
- "public class TypeInferenceProblem {\n" +
- " interface HeaderAccess<T> {\n" +
- " T getHeader();\n" +
- " }\n" +
- "\n" +
- " interface IExpectationSetters<T> {\n" +
- " IExpectationSetters<T> andReturn(T value);\n" +
- " }\n" +
- "\n" +
- " static class MocksControl implements IExpectationSetters<Object> {\n" +
- " public IExpectationSetters<Object> andReturn(Object value) {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " @SuppressWarnings(\"unchecked\")\n" +
- " public static <T> IExpectationSetters<T> expect(final T value) {\n" +
- " return (IExpectationSetters<T>) new MocksControl();\n" +
- " }\n" +
- "\n" +
- " private HeaderAccess<Object> mockHeaderAccess;\n" +
- " private HeaderAccess<?> unboundedMockHeaderAccess;\n" +
- "\n" +
- " public void test() {\n" +
- " // No error\n" +
- " expect(mockHeaderAccess.getHeader()).andReturn(new Object());\n" +
- " /*\n" +
- " * Error: The method andReturn(capture#1-of ?) in the type\n" +
- " * TypeInferenceProblem.IExpectationSetters<capture#1-of ?> \n" +
- " * is not applicable for the arguments (Object)\n" +
- " */\n" +
- " expect(unboundedMockHeaderAccess.getHeader()).andReturn(new Object());\n" +
- " }\n" +
+ "\n" +
+ "public class TypeInferenceProblem {\n" +
+ " interface HeaderAccess<T> {\n" +
+ " T getHeader();\n" +
+ " }\n" +
+ "\n" +
+ " interface IExpectationSetters<T> {\n" +
+ " IExpectationSetters<T> andReturn(T value);\n" +
+ " }\n" +
+ "\n" +
+ " static class MocksControl implements IExpectationSetters<Object> {\n" +
+ " public IExpectationSetters<Object> andReturn(Object value) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " @SuppressWarnings(\"unchecked\")\n" +
+ " public static <T> IExpectationSetters<T> expect(final T value) {\n" +
+ " return (IExpectationSetters<T>) new MocksControl();\n" +
+ " }\n" +
+ "\n" +
+ " private HeaderAccess<Object> mockHeaderAccess;\n" +
+ " private HeaderAccess<?> unboundedMockHeaderAccess;\n" +
+ "\n" +
+ " public void test() {\n" +
+ " // No error\n" +
+ " expect(mockHeaderAccess.getHeader()).andReturn(new Object());\n" +
+ " /*\n" +
+ " * Error: The method andReturn(capture#1-of ?) in the type\n" +
+ " * TypeInferenceProblem.IExpectationSetters<capture#1-of ?> \n" +
+ " * is not applicable for the arguments (Object)\n" +
+ " */\n" +
+ " expect(unboundedMockHeaderAccess.getHeader()).andReturn(new Object());\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in TypeInferenceProblem.java (at line 33)\n" +
- " expect(unboundedMockHeaderAccess.getHeader()).andReturn(new Object());\n" +
- " ^^^^^^^^^\n" +
- "The method andReturn(capture#1-of ?) in the type TypeInferenceProblem.IExpectationSetters<capture#1-of ?> is not applicable for the arguments (Object)\n" +
+ "----------\n" +
+ "1. ERROR in TypeInferenceProblem.java (at line 33)\n" +
+ " expect(unboundedMockHeaderAccess.getHeader()).andReturn(new Object());\n" +
+ " ^^^^^^^^^\n" +
+ "The method andReturn(capture#1-of ?) in the type TypeInferenceProblem.IExpectationSetters<capture#1-of ?> is not applicable for the arguments (Object)\n" +
"----------\n");
}
public void testBug399527_corrected() {
runConformTest(
new String[] {
"TypeInferenceProblem.java",
- "\n" +
- "public class TypeInferenceProblem {\n" +
- " interface HeaderAccess<T> {\n" +
- " T getHeader();\n" +
- " }\n" +
- "\n" +
- " interface IExpectationSetters<T> {\n" +
- " IExpectationSetters<T> andReturn(T value);\n" +
- " }\n" +
- "\n" +
- " static class MocksControl implements IExpectationSetters<Object> {\n" +
- " public IExpectationSetters<Object> andReturn(Object value) {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " @SuppressWarnings(\"unchecked\")\n" +
- " public static <T> IExpectationSetters<T> expect(final T value) {\n" +
- " return (IExpectationSetters<T>) new MocksControl();\n" +
- " }\n" +
- "\n" +
- " private HeaderAccess<Object> mockHeaderAccess;\n" +
- " private HeaderAccess<?> unboundedMockHeaderAccess;\n" +
- "\n" +
- " public void test() {\n" +
- " // No error\n" +
- " expect(mockHeaderAccess.getHeader()).andReturn(new Object());\n" +
- " this.<Object>expect(unboundedMockHeaderAccess.getHeader()).andReturn(new Object());\n" +
- " }\n" +
+ "\n" +
+ "public class TypeInferenceProblem {\n" +
+ " interface HeaderAccess<T> {\n" +
+ " T getHeader();\n" +
+ " }\n" +
+ "\n" +
+ " interface IExpectationSetters<T> {\n" +
+ " IExpectationSetters<T> andReturn(T value);\n" +
+ " }\n" +
+ "\n" +
+ " static class MocksControl implements IExpectationSetters<Object> {\n" +
+ " public IExpectationSetters<Object> andReturn(Object value) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " @SuppressWarnings(\"unchecked\")\n" +
+ " public static <T> IExpectationSetters<T> expect(final T value) {\n" +
+ " return (IExpectationSetters<T>) new MocksControl();\n" +
+ " }\n" +
+ "\n" +
+ " private HeaderAccess<Object> mockHeaderAccess;\n" +
+ " private HeaderAccess<?> unboundedMockHeaderAccess;\n" +
+ "\n" +
+ " public void test() {\n" +
+ " // No error\n" +
+ " expect(mockHeaderAccess.getHeader()).andReturn(new Object());\n" +
+ " this.<Object>expect(unboundedMockHeaderAccess.getHeader()).andReturn(new Object());\n" +
+ " }\n" +
"}\n"
});
}
public void testBug399527_comment1() {
String sourceString =
- "public class TypeInferenceProblemMin {\n" +
- " interface HeaderAccess<T> {\n" +
- " T getHeader();\n" +
- " }\n" +
- "\n" +
- " interface IExpectationSetters<T> {\n" +
- " }\n" +
- "\n" +
- " public static <T> IExpectationSetters<T> expect(final T value) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " private HeaderAccess<?> unboundedMockHeaderAccess;\n" +
- " \n" +
- " public void test() {\n" +
- " // no error:\n" +
- " Object header = unboundedMockHeaderAccess.getHeader();\n" +
- " IExpectationSetters<Object> exp1 = expect(header);\n" +
- "\n" +
- " // Type mismatch: cannot convert from TypeInferenceProblemMin.IExpectationSetters<capture#2-of ?> to TypeInferenceProblemMin.IExpectationSetters<Object>\n" +
- " IExpectationSetters<Object> exp2 = expect(unboundedMockHeaderAccess.getHeader());\n" +
- " }\n" +
+ "public class TypeInferenceProblemMin {\n" +
+ " interface HeaderAccess<T> {\n" +
+ " T getHeader();\n" +
+ " }\n" +
+ "\n" +
+ " interface IExpectationSetters<T> {\n" +
+ " }\n" +
+ "\n" +
+ " public static <T> IExpectationSetters<T> expect(final T value) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " private HeaderAccess<?> unboundedMockHeaderAccess;\n" +
+ " \n" +
+ " public void test() {\n" +
+ " // no error:\n" +
+ " Object header = unboundedMockHeaderAccess.getHeader();\n" +
+ " IExpectationSetters<Object> exp1 = expect(header);\n" +
+ "\n" +
+ " // Type mismatch: cannot convert from TypeInferenceProblemMin.IExpectationSetters<capture#2-of ?> to TypeInferenceProblemMin.IExpectationSetters<Object>\n" +
+ " IExpectationSetters<Object> exp2 = expect(unboundedMockHeaderAccess.getHeader());\n" +
+ " }\n" +
"}\n";
if (this.complianceLevel < ClassFileConstants.JDK1_8)
runNegativeTest(
@@ -4640,11 +4640,11 @@ public void testBug399527_comment1() {
"TypeInferenceProblemMin.java",
sourceString
},
- "----------\n" +
- "1. ERROR in TypeInferenceProblemMin.java (at line 21)\n" +
- " IExpectationSetters<Object> exp2 = expect(unboundedMockHeaderAccess.getHeader());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from TypeInferenceProblemMin.IExpectationSetters<capture#2-of ?> to TypeInferenceProblemMin.IExpectationSetters<Object>\n" +
+ "----------\n" +
+ "1. ERROR in TypeInferenceProblemMin.java (at line 21)\n" +
+ " IExpectationSetters<Object> exp2 = expect(unboundedMockHeaderAccess.getHeader());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from TypeInferenceProblemMin.IExpectationSetters<capture#2-of ?> to TypeInferenceProblemMin.IExpectationSetters<Object>\n" +
"----------\n");
else
// conform due to target typing
@@ -4658,40 +4658,40 @@ public void testBug434570() {
runConformTest(
new String[] {
"example/Example.java",
- "package example;\n" +
- "\n" +
- "import example.Example.Config;\n" +
- "import example.Example.CustomInitializer;\n" +
- "\n" +
- "@Config(initializers = CustomInitializer.class)\n" +
- "public class Example {\n" +
- "\n" +
- " static interface Context {\n" +
- " }\n" +
- "\n" +
- " static interface ConfigurableContext extends Context {\n" +
- " }\n" +
- "\n" +
- " static abstract class AbstractContext implements ConfigurableContext {\n" +
- " }\n" +
- "\n" +
- " static class GenericContext extends AbstractContext {\n" +
- " }\n" +
- "\n" +
- " static interface Initializer<C extends ConfigurableContext> {\n" +
- " }\n" +
- "\n" +
- " static @interface Config {\n" +
- " Class<? extends Initializer<? extends ConfigurableContext>>[] initializers() default {};\n" +
- " }\n" +
- "\n" +
- " static class CustomInitializer implements Initializer<GenericContext> {\n" +
- " }\n" +
- "\n" +
- " @Config(initializers = CustomInitializer.class)\n" +
- " static class CompilationSuccess {\n" +
- " }\n" +
- "\n" +
+ "package example;\n" +
+ "\n" +
+ "import example.Example.Config;\n" +
+ "import example.Example.CustomInitializer;\n" +
+ "\n" +
+ "@Config(initializers = CustomInitializer.class)\n" +
+ "public class Example {\n" +
+ "\n" +
+ " static interface Context {\n" +
+ " }\n" +
+ "\n" +
+ " static interface ConfigurableContext extends Context {\n" +
+ " }\n" +
+ "\n" +
+ " static abstract class AbstractContext implements ConfigurableContext {\n" +
+ " }\n" +
+ "\n" +
+ " static class GenericContext extends AbstractContext {\n" +
+ " }\n" +
+ "\n" +
+ " static interface Initializer<C extends ConfigurableContext> {\n" +
+ " }\n" +
+ "\n" +
+ " static @interface Config {\n" +
+ " Class<? extends Initializer<? extends ConfigurableContext>>[] initializers() default {};\n" +
+ " }\n" +
+ "\n" +
+ " static class CustomInitializer implements Initializer<GenericContext> {\n" +
+ " }\n" +
+ "\n" +
+ " @Config(initializers = CustomInitializer.class)\n" +
+ " static class CompilationSuccess {\n" +
+ " }\n" +
+ "\n" +
"}\n"
});
}
@@ -4702,18 +4702,18 @@ public void testBug434630() {
"interface Provider<T> {}\n" +
"@interface ProvidedBy {\n" +
" Class<? extends Provider<?>> value();" +
- "}\n" +
- "\n" +
- "@ProvidedBy(Foo.SomeProvider.class)\n" +
- "public interface Foo {\n" +
- " \n" +
- " public static class SomeProvider implements Provider<Foo> {\n" +
- "\n" +
- " public Foo get() {\n" +
- " return null;\n" +
- " }\n" +
- " \n" +
- " }\n" +
+ "}\n" +
+ "\n" +
+ "@ProvidedBy(Foo.SomeProvider.class)\n" +
+ "public interface Foo {\n" +
+ " \n" +
+ " public static class SomeProvider implements Provider<Foo> {\n" +
+ "\n" +
+ " public Foo get() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " \n" +
+ " }\n" +
"}\n"
});
}
@@ -4721,63 +4721,63 @@ public void testBug434570_comment3() {
runConformTest(
new String[] {
"TestWontCompile.java",
- "import org.bug.AnnotationWithClassParameter;\n" +
- "import org.bug.CustomHandler;\n" +
- "import org.bug.Handler;\n" +
- "\n" +
- "\n" +
- "@AnnotationWithClassParameter(CustomHandler.class)\n" +
- "public class TestWontCompile extends ATest<Object> {\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " Class<? extends Handler<?>> h = CustomHandler.class;\n" +
- " }\n" +
- "\n" +
+ "import org.bug.AnnotationWithClassParameter;\n" +
+ "import org.bug.CustomHandler;\n" +
+ "import org.bug.Handler;\n" +
+ "\n" +
+ "\n" +
+ "@AnnotationWithClassParameter(CustomHandler.class)\n" +
+ "public class TestWontCompile extends ATest<Object> {\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " Class<? extends Handler<?>> h = CustomHandler.class;\n" +
+ " }\n" +
+ "\n" +
"}\n",
"ATest.java",
- "public abstract class ATest<T> {\n" +
- "\n" +
+ "public abstract class ATest<T> {\n" +
+ "\n" +
"}\n",
"org/bug/Item.java",
- "package org.bug;\n" +
- "\n" +
- "public interface Item {\n" +
- "\n" +
+ "package org.bug;\n" +
+ "\n" +
+ "public interface Item {\n" +
+ "\n" +
"}\n",
"org/bug/CustomItem.java",
- "package org.bug;\n" +
- "\n" +
- "public class CustomItem implements Item {\n" +
- "\n" +
+ "package org.bug;\n" +
+ "\n" +
+ "public class CustomItem implements Item {\n" +
+ "\n" +
"}\n",
"org/bug/Handler.java",
- "package org.bug;\n" +
- "\n" +
- "public abstract class Handler<T extends Item> {\n" +
- "\n" +
+ "package org.bug;\n" +
+ "\n" +
+ "public abstract class Handler<T extends Item> {\n" +
+ "\n" +
"}\n",
"org/bug/CustomHandler.java",
- "package org.bug;\n" +
- "\n" +
- "public class CustomHandler extends Handler<CustomItem> {\n" +
- "\n" +
+ "package org.bug;\n" +
+ "\n" +
+ "public class CustomHandler extends Handler<CustomItem> {\n" +
+ "\n" +
"}\n",
"org/bug/AnnotationWithClassParameter.java",
- "package org.bug;\n" +
- "\n" +
- "import java.lang.annotation.Documented;\n" +
- "import java.lang.annotation.ElementType;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
- "import java.lang.annotation.Target;\n" +
- "\n" +
- "@Target(ElementType.TYPE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@Documented\n" +
- "public @interface AnnotationWithClassParameter {\n" +
- " \n" +
- " Class<? extends Handler<?>> value();\n" +
- "\n" +
+ "package org.bug;\n" +
+ "\n" +
+ "import java.lang.annotation.Documented;\n" +
+ "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "\n" +
+ "@Target(ElementType.TYPE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@Documented\n" +
+ "public @interface AnnotationWithClassParameter {\n" +
+ " \n" +
+ " Class<? extends Handler<?>> value();\n" +
+ "\n" +
"}\n"
});
}
@@ -4788,63 +4788,63 @@ public void testBug434570_comment3b() {
runConformTest(
new String[] {
"TestWontCompile.java",
- "import org.bug.AnnotationWithClassParameter;\n" +
- "import org.bug.CustomHandler;\n" +
- "import org.bug.Handler;\n" +
- "\n" +
- "\n" +
- "@AnnotationWithClassParameter(CustomHandler.class)\n" +
- "public class TestWontCompile extends ATest<Object> {\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " Class<? extends Handler<?>> h = CustomHandler.class;\n" +
- " }\n" +
- "\n" +
+ "import org.bug.AnnotationWithClassParameter;\n" +
+ "import org.bug.CustomHandler;\n" +
+ "import org.bug.Handler;\n" +
+ "\n" +
+ "\n" +
+ "@AnnotationWithClassParameter(CustomHandler.class)\n" +
+ "public class TestWontCompile extends ATest<Object> {\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " Class<? extends Handler<?>> h = CustomHandler.class;\n" +
+ " }\n" +
+ "\n" +
"}\n",
"ATest.java",
- "public abstract class ATest<T> {\n" +
- "\n" +
+ "public abstract class ATest<T> {\n" +
+ "\n" +
"}\n",
"org/bug/Item.java",
- "package org.bug;\n" +
- "\n" +
- "public interface Item {\n" +
- "\n" +
+ "package org.bug;\n" +
+ "\n" +
+ "public interface Item {\n" +
+ "\n" +
"}\n",
"org/bug/CustomItem.java",
- "package org.bug;\n" +
- "\n" +
- "public class CustomItem implements Item {\n" +
- "\n" +
+ "package org.bug;\n" +
+ "\n" +
+ "public class CustomItem implements Item {\n" +
+ "\n" +
"}\n",
"org/bug/Handler.java",
- "package org.bug;\n" +
- "\n" +
- "public abstract class Handler<T extends Item> {\n" +
- "\n" +
+ "package org.bug;\n" +
+ "\n" +
+ "public abstract class Handler<T extends Item> {\n" +
+ "\n" +
"}\n",
"org/bug/CustomHandler.java",
- "package org.bug;\n" +
- "\n" +
- "public class CustomHandler extends Handler<CustomItem> {\n" +
- "\n" +
+ "package org.bug;\n" +
+ "\n" +
+ "public class CustomHandler extends Handler<CustomItem> {\n" +
+ "\n" +
"}\n",
"org/bug/AnnotationWithClassParameter.java",
- "package org.bug;\n" +
- "\n" +
- "import java.lang.annotation.Documented;\n" +
- "import java.lang.annotation.ElementType;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
- "import java.lang.annotation.Target;\n" +
- "\n" +
- "@Target(ElementType.TYPE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@Documented\n" +
- "public @interface AnnotationWithClassParameter {\n" +
- " \n" +
- " Class<? extends Handler<?>> value();\n" +
- "\n" +
+ "package org.bug;\n" +
+ "\n" +
+ "import java.lang.annotation.Documented;\n" +
+ "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "\n" +
+ "@Target(ElementType.TYPE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@Documented\n" +
+ "public @interface AnnotationWithClassParameter {\n" +
+ " \n" +
+ " Class<? extends Handler<?>> value();\n" +
+ "\n" +
"}\n"
},
options);
@@ -4853,28 +4853,28 @@ public void testBug434630_comment7() {
runConformTest(
new String[] {
"test/FooImpl.java",
- "package test;\n" +
- "\n" +
- "public class FooImpl implements Foo {\n" +
- "\n" +
+ "package test;\n" +
+ "\n" +
+ "public class FooImpl implements Foo {\n" +
+ "\n" +
"}\n",
"test/Foo.java",
"package test;\n" +
"interface Provider<T> {}\n" +
"@interface ProvidedBy {\n" +
" Class<? extends Provider<?>> value();" +
- "}\n" +
- "\n" +
- "@ProvidedBy(Foo.SomeProvider.class)\n" +
- "public interface Foo {\n" +
- " \n" +
- " public static class SomeProvider implements Provider<Foo> {\n" +
- "\n" +
- " public Foo get() {\n" +
- " return null;\n" +
- " }\n" +
- " \n" +
- " }\n" +
+ "}\n" +
+ "\n" +
+ "@ProvidedBy(Foo.SomeProvider.class)\n" +
+ "public interface Foo {\n" +
+ " \n" +
+ " public static class SomeProvider implements Provider<Foo> {\n" +
+ "\n" +
+ " public Foo get() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " \n" +
+ " }\n" +
"}\n"
});
}
@@ -4882,32 +4882,32 @@ public void testBug434044() {
runConformTest(
new String[] {
"EclipseJava8Generics.java",
- "public class EclipseJava8Generics {\n" +
- "\n" +
- " public interface Foo<V> {\n" +
- " public V doFoo();\n" +
- " }\n" +
- "\n" +
- " public static class FooBar<V, T extends Foo<V>> {\n" +
- " public T getBar() {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static class Factory {\n" +
- "\n" +
- " public static <V, T extends Foo<V>> FooBar<V, T> createFooBar() {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static void test() {\n" +
- " final FooBar<?, ? extends Foo<?>> typedProperty = Factory.createFooBar();\n" +
- " //TODO Eclipse Bug 434044\n" +
- " final Object propertyValue = typedProperty.getBar().doFoo();\n" +
- "\n" +
- " }\n" +
- "\n" +
+ "public class EclipseJava8Generics {\n" +
+ "\n" +
+ " public interface Foo<V> {\n" +
+ " public V doFoo();\n" +
+ " }\n" +
+ "\n" +
+ " public static class FooBar<V, T extends Foo<V>> {\n" +
+ " public T getBar() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public static class Factory {\n" +
+ "\n" +
+ " public static <V, T extends Foo<V>> FooBar<V, T> createFooBar() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public static void test() {\n" +
+ " final FooBar<?, ? extends Foo<?>> typedProperty = Factory.createFooBar();\n" +
+ " //TODO Eclipse Bug 434044\n" +
+ " final Object propertyValue = typedProperty.getBar().doFoo();\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
"}\n"
});
}
@@ -4915,33 +4915,33 @@ public void testBug434044_comment20() {
runConformTest(
new String[] {
"EclipseJava8Generics.java",
- "public class EclipseJava8Generics {\n" +
- "\n" +
- " public interface Foo<V> {\n" +
- " public V doFoo();\n" +
- " }\n" +
- "\n" +
- " public static class FooBar<V, T extends Foo<V>> {\n" +
- " public T getBar() {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static abstract class AbstractFoo<V> implements Foo<V> {\n" +
- " }\n" +
- "\n" +
- " public static class Factory {\n" +
- " public static <V, T extends AbstractFoo<V>> FooBar<V, T> createFooBar() {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static void test() {\n" +
- " final FooBar<?, ? extends AbstractFoo<?>> typedProperty = Factory.createFooBar();\n" +
- " //TODO Eclipse Bug 434044 still exists\n" +
- " final Object propertyValue = typedProperty.getBar().doFoo();\n" +
- " }\n" +
- "\n" +
+ "public class EclipseJava8Generics {\n" +
+ "\n" +
+ " public interface Foo<V> {\n" +
+ " public V doFoo();\n" +
+ " }\n" +
+ "\n" +
+ " public static class FooBar<V, T extends Foo<V>> {\n" +
+ " public T getBar() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public static abstract class AbstractFoo<V> implements Foo<V> {\n" +
+ " }\n" +
+ "\n" +
+ " public static class Factory {\n" +
+ " public static <V, T extends AbstractFoo<V>> FooBar<V, T> createFooBar() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public static void test() {\n" +
+ " final FooBar<?, ? extends AbstractFoo<?>> typedProperty = Factory.createFooBar();\n" +
+ " //TODO Eclipse Bug 434044 still exists\n" +
+ " final Object propertyValue = typedProperty.getBar().doFoo();\n" +
+ " }\n" +
+ "\n" +
"}\n"
});
}
@@ -4949,42 +4949,42 @@ public void testBug434044_comment36() {
runNegativeTest(
new String[] {
"EclipseJava8Generics.java",
- "public class EclipseJava8Generics {\n" +
- "\n" +
- " public interface Nasty {\n" +
- " public Object doFoo(Integer a);\n" +
- " }\n" +
- " public interface Foo<V> {\n" +
- " public V doFoo(String a);\n" +
- " }\n" +
- "\n" +
- " public static class FooBar<V, T extends Foo<V>> {\n" +
- " public T getBar() {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static abstract class AbstractFoo<V> implements Foo<V>, Nasty {\n" +
- " }\n" +
- "\n" +
- " public static class Factory {\n" +
- " public static <V, T extends AbstractFoo<V>> FooBar<V, T> createFooBar() {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static void test() {\n" +
- " final FooBar<?, ? extends AbstractFoo<?>> typedProperty = Factory.createFooBar();\n" +
- " //TODO Eclipse Bug 434044 still exists\n" +
- " final Object propertyValue = typedProperty.getBar().doFoo(null);\n" +
- " }\n" +
+ "public class EclipseJava8Generics {\n" +
+ "\n" +
+ " public interface Nasty {\n" +
+ " public Object doFoo(Integer a);\n" +
+ " }\n" +
+ " public interface Foo<V> {\n" +
+ " public V doFoo(String a);\n" +
+ " }\n" +
+ "\n" +
+ " public static class FooBar<V, T extends Foo<V>> {\n" +
+ " public T getBar() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public static abstract class AbstractFoo<V> implements Foo<V>, Nasty {\n" +
+ " }\n" +
+ "\n" +
+ " public static class Factory {\n" +
+ " public static <V, T extends AbstractFoo<V>> FooBar<V, T> createFooBar() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public static void test() {\n" +
+ " final FooBar<?, ? extends AbstractFoo<?>> typedProperty = Factory.createFooBar();\n" +
+ " //TODO Eclipse Bug 434044 still exists\n" +
+ " final Object propertyValue = typedProperty.getBar().doFoo(null);\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in EclipseJava8Generics.java (at line 28)\n" +
- " final Object propertyValue = typedProperty.getBar().doFoo(null);\n" +
- " ^^^^^\n" +
- "The method doFoo(String) is ambiguous for the type capture#2-of ? extends EclipseJava8Generics.AbstractFoo<?>\n" +
+ "----------\n" +
+ "1. ERROR in EclipseJava8Generics.java (at line 28)\n" +
+ " final Object propertyValue = typedProperty.getBar().doFoo(null);\n" +
+ " ^^^^^\n" +
+ "The method doFoo(String) is ambiguous for the type capture#2-of ? extends EclipseJava8Generics.AbstractFoo<?>\n" +
"----------\n");
}
public void testBug434793() {
@@ -4993,14 +4993,14 @@ public void testBug434793() {
runConformTest(
new String[] {
"Outer.java",
- "import java.util.*;\n" +
- "\n" +
- "public class Outer {\n" +
+ "import java.util.*;\n" +
+ "\n" +
+ "public class Outer {\n" +
" private static class SingletonList<E>\n" +
" extends AbstractList<E>\n" +
" implements java.util.RandomAccess, java.io.Serializable {\n" +
" public E get(int i) { throw new RuntimeException(); }\n" +
- " public int size() { return 0; }\n" +
+ " public int size() { return 0; }\n" +
" }\n" +
"}\n"
},
@@ -5010,43 +5010,43 @@ public void testBug435643() {
runConformTest(
new String[] {
"test/Main.java",
- "package test;\n" +
- "abstract class ASTNode<T extends ASTNode> implements Iterable<T> {\n" +
- " public T getChild(int i) { return null; }\n" +
- "} \n" +
- "abstract class List<T extends ASTNode> extends ASTNode<T> { }\n" +
- "class Joiner {\n" +
- " public static Joiner on(String separator) {\n" +
- " return null;\n" +
- " }\n" +
- " String join(Iterable<?> parts) {\n" +
- " return \"\";\n" +
- " }\n" +
- "}\n" +
- "class AstFunctions {\n" +
- " public static <T extends ASTNode<?>> Function<T, String> prettyPrint() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "class Iterables {\n" +
- " public static <F, T> Iterable<T> transform(final Iterable<F> fromIterable,\n" +
- " final Function<? super F, ? extends T> function) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "interface Function<F, T> {\n" +
- " T apply(F input);\n" +
- "}\n" +
- "public class Main {\n" +
- "\n" +
- " String test(ASTNode<?> node, ASTNode rawNode) {\n" +
- " rawNode.getChild(0); \n" +
- " \n" +
- " @SuppressWarnings(\"unchecked\")\n" +
- " List<? extends ASTNode<?>> list = (List<? extends ASTNode<?>>) node;\n" +
- " return Joiner.on(\", \").join(Iterables.transform(list, AstFunctions.prettyPrint()));\n" +
- " }\n" +
- "\n" +
+ "package test;\n" +
+ "abstract class ASTNode<T extends ASTNode> implements Iterable<T> {\n" +
+ " public T getChild(int i) { return null; }\n" +
+ "} \n" +
+ "abstract class List<T extends ASTNode> extends ASTNode<T> { }\n" +
+ "class Joiner {\n" +
+ " public static Joiner on(String separator) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " String join(Iterable<?> parts) {\n" +
+ " return \"\";\n" +
+ " }\n" +
+ "}\n" +
+ "class AstFunctions {\n" +
+ " public static <T extends ASTNode<?>> Function<T, String> prettyPrint() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "class Iterables {\n" +
+ " public static <F, T> Iterable<T> transform(final Iterable<F> fromIterable,\n" +
+ " final Function<? super F, ? extends T> function) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "interface Function<F, T> {\n" +
+ " T apply(F input);\n" +
+ "}\n" +
+ "public class Main {\n" +
+ "\n" +
+ " String test(ASTNode<?> node, ASTNode rawNode) {\n" +
+ " rawNode.getChild(0); \n" +
+ " \n" +
+ " @SuppressWarnings(\"unchecked\")\n" +
+ " List<? extends ASTNode<?>> list = (List<? extends ASTNode<?>>) node;\n" +
+ " return Joiner.on(\", \").join(Iterables.transform(list, AstFunctions.prettyPrint()));\n" +
+ " }\n" +
+ "\n" +
"}\n"
});
}
@@ -5062,7 +5062,7 @@ public void testBug438337comment5() {
"I18nResource.java",
"public interface I18nResource<E extends Internationalized<? extends I18nResource<E>>> extends BusinessObject {}\n",
"Internationalized.java",
- "public interface Internationalized<E extends I18nResource<? extends Internationalized<E>>>\n" +
+ "public interface Internationalized<E extends I18nResource<? extends Internationalized<E>>>\n" +
" extends BusinessObject {}\n",
"BusinessObject.java",
"public interface BusinessObject {}\n"
@@ -5072,11 +5072,11 @@ public void testBug438337comment3() {
runConformTest(
new String[] {
"PermissionDrivenPresenter.java",
- "public abstract class PermissionDrivenPresenter<V extends BaseView<? extends Presenter<V>>> extends BasePresenter<V> {\n" +
- "\n" +
- " public void updatePermissions() {\n" +
- " getView().setReadOnly(true);\n" +
- " }\n" +
+ "public abstract class PermissionDrivenPresenter<V extends BaseView<? extends Presenter<V>>> extends BasePresenter<V> {\n" +
+ "\n" +
+ " public void updatePermissions() {\n" +
+ " getView().setReadOnly(true);\n" +
+ " }\n" +
"}\n",
"View.java",
"public interface View<P extends Presenter<? extends View<P>>> { }\n",
@@ -5087,10 +5087,10 @@ public void testBug438337comment3() {
" void setReadOnly(boolean f) {}\n" +
"}\n",
"BasePresenter.java",
- "public abstract class BasePresenter<V extends View<? extends Presenter<V>>> implements Presenter<V> {\n" +
- " public V getView() {\n" +
- " return null;\n" +
- " }\n" +
+ "public abstract class BasePresenter<V extends View<? extends Presenter<V>>> implements Presenter<V> {\n" +
+ " public V getView() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
});
}
@@ -5131,7 +5131,7 @@ public void test416480() {
" System.out.println(\"CCE\");\n" +
" }\n" +
" }\n" +
- "}\n"
+ "}\n"
},
"CCE");
}
@@ -5181,7 +5181,7 @@ public void test440019() {
},
"");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=443596, [1.8][compiler] Failure for overload resolution in case of Generics and Varags
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=443596, [1.8][compiler] Failure for overload resolution in case of Generics and Varags
public void test443596() {
this.runNegativeTest(
new String[] {
@@ -5198,15 +5198,15 @@ public void test443596() {
"}\n",
},
this.complianceLevel < ClassFileConstants.JDK1_7 ?
- "" :
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " public static <T> Predicate<T> and(Predicate<? super T>... arg) { return null; }\n" +
- " ^^^\n" +
- "Type safety: Potential heap pollution via varargs parameter arg\n" +
+ "" :
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " public static <T> Predicate<T> and(Predicate<? super T>... arg) { return null; }\n" +
+ " ^^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter arg\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=446235, Java8 generics and boxing
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=446235, Java8 generics and boxing
public void test446235() {
this.runConformTest(
new String[] {
@@ -5224,7 +5224,7 @@ public void test446235() {
},
"");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=440019, [1.8][compiler] Type mismatch error with autoboxing/scalar types (works with 1.6)
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=440019, [1.8][compiler] Type mismatch error with autoboxing/scalar types (works with 1.6)
public void test440019_c9() {
this.runConformTest(
new String[] {
@@ -5245,7 +5245,7 @@ public void test440019_c9() {
},
"size: 3 ttl: 60");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=446223, [1.8][compiler] Java8 generics eclipse doesn't compile
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=446223, [1.8][compiler] Java8 generics eclipse doesn't compile
public void test446223() {
this.runNegativeTest(
false /* skipJavac */,
@@ -5268,19 +5268,19 @@ public void test446223() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " public interface Interface2<X> {\n" +
- " ^\n" +
- "The type parameter X is hiding the type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 12)\n" +
- " private static <X, T extends Interface2<X> & Interface1> void DoNothing() {\n" +
- " ^\n" +
- "The type parameter X is hiding the type X\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " public interface Interface2<X> {\n" +
+ " ^\n" +
+ "The type parameter X is hiding the type X\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 12)\n" +
+ " private static <X, T extends Interface2<X> & Interface1> void DoNothing() {\n" +
+ " ^\n" +
+ "The type parameter X is hiding the type X\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=444334, [1.8][compiler] Compiler generates error instead of warning on unchecked conversion
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=444334, [1.8][compiler] Compiler generates error instead of warning on unchecked conversion
public void test444334() {
this.runNegativeTest(
new String[] {
@@ -5306,34 +5306,34 @@ public void test444334() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " doSomething(returnClassType(Class.class));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation doSomething(Class) of the generic method doSomething(Class<T>) of type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " doSomething(returnClassType(Class.class));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Class needs unchecked conversion to conform to Class<Object>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " doSomething(returnListType(new ArrayList<List>()));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation doSomething(List) of the generic method doSomething(List<T>) of type X\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 6)\n" +
- " doSomething(returnListType(new ArrayList<List>()));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 6)\n" +
- " doSomething(returnListType(new ArrayList<List>()));\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " doSomething(returnClassType(Class.class));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation doSomething(Class) of the generic method doSomething(Class<T>) of type X\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " doSomething(returnClassType(Class.class));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Class needs unchecked conversion to conform to Class<Object>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " doSomething(returnListType(new ArrayList<List>()));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation doSomething(List) of the generic method doSomething(List<T>) of type X\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 6)\n" +
+ " doSomething(returnListType(new ArrayList<List>()));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 6)\n" +
+ " doSomething(returnListType(new ArrayList<List>()));\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=438246, [1.8][compiler] Java 8 static methods compilation error
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=438246, [1.8][compiler] Java 8 static methods compilation error
public void test438246() {
this.runNegativeTest(
new String[] {
@@ -5353,14 +5353,14 @@ public void test438246() {
},
this.complianceLevel < ClassFileConstants.JDK1_7 ?
"" :
- "----------\n" +
- "1. WARNING in Foo.java (at line 9)\n" +
- " public static <C> void doit( Foo<C>... workers )\n" +
- " ^^^^^^^\n" +
- "Type safety: Potential heap pollution via varargs parameter workers\n" +
+ "----------\n" +
+ "1. WARNING in Foo.java (at line 9)\n" +
+ " public static <C> void doit( Foo<C>... workers )\n" +
+ " ^^^^^^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter workers\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=448795, [1.8][compiler] Inference should discriminate between strict and loose modes
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=448795, [1.8][compiler] Inference should discriminate between strict and loose modes
public void test448795() {
this.runNegativeTest(
new String[] {
@@ -5374,14 +5374,14 @@ public void test448795() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " int x = element(new int [] { 1234 });\n" +
- " ^^^^^^^\n" +
- "The method element(T[]) in the type X<T> is not applicable for the arguments (int[])\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " int x = element(new int [] { 1234 });\n" +
+ " ^^^^^^^\n" +
+ "The method element(T[]) in the type X<T> is not applicable for the arguments (int[])\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=448795, [1.8][compiler] Inference should discriminate between strict and loose modes
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=448795, [1.8][compiler] Inference should discriminate between strict and loose modes
public void test448795a() {
this.runConformTest(
new String[] {
@@ -5402,7 +5402,7 @@ public void test448795a() {
},
"Strict");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=448795, [1.8][compiler] Inference should discriminate between strict and loose modes
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=448795, [1.8][compiler] Inference should discriminate between strict and loose modes
public void test448795b() {
this.runConformTest(
new String[] {
@@ -5423,7 +5423,7 @@ public void test448795b() {
},
"non-generic");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=448795, [1.8][compiler] Inference should discriminate between strict and loose modes
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=448795, [1.8][compiler] Inference should discriminate between strict and loose modes
public void test448795c() {
this.runConformTest(
new String[] {
@@ -5444,7 +5444,7 @@ public void test448795c() {
},
"generic");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=434118, [1.8][compiler] Compilation error on generic capture/type inference
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=434118, [1.8][compiler] Compilation error on generic capture/type inference
public void test434118() {
this.runConformTest(
new String[] {
@@ -5468,41 +5468,41 @@ public void testBug452194() {
runNegativeTest(
new String[]{
"test/Main.java",
- "package test;\n" +
- "\n" +
- "import java.util.Map.Entry;\n" +
- "\n" +
- "public class Main {\n" +
- " public static void main(String[] args) {\n" +
- " EcoreEMap map = new EcoreEMap();\n" +
- " map.addUnique(new Object()); //Error here ONLY in 4.4\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "interface InternalEList<E> {\n" +
- " public void addUnique(E object);\n" +
- "}\n" +
- "\n" +
- "class EcoreEMap<K, V> implements InternalEList<Entry<K, V>> {\n" +
- " public void addUnique(Entry<K, V> object) {\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "import java.util.Map.Entry;\n" +
+ "\n" +
+ "public class Main {\n" +
+ " public static void main(String[] args) {\n" +
+ " EcoreEMap map = new EcoreEMap();\n" +
+ " map.addUnique(new Object()); //Error here ONLY in 4.4\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "interface InternalEList<E> {\n" +
+ " public void addUnique(E object);\n" +
+ "}\n" +
+ "\n" +
+ "class EcoreEMap<K, V> implements InternalEList<Entry<K, V>> {\n" +
+ " public void addUnique(Entry<K, V> object) {\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in test\\Main.java (at line 7)\n" +
- " EcoreEMap map = new EcoreEMap();\n" +
- " ^^^^^^^^^\n" +
- "EcoreEMap is a raw type. References to generic type EcoreEMap<K,V> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in test\\Main.java (at line 7)\n" +
- " EcoreEMap map = new EcoreEMap();\n" +
- " ^^^^^^^^^\n" +
- "EcoreEMap is a raw type. References to generic type EcoreEMap<K,V> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in test\\Main.java (at line 8)\n" +
- " map.addUnique(new Object()); //Error here ONLY in 4.4\n" +
- " ^^^^^^^^^\n" +
- "The method addUnique(Map.Entry) in the type EcoreEMap is not applicable for the arguments (Object)\n" +
+ "----------\n" +
+ "1. WARNING in test\\Main.java (at line 7)\n" +
+ " EcoreEMap map = new EcoreEMap();\n" +
+ " ^^^^^^^^^\n" +
+ "EcoreEMap is a raw type. References to generic type EcoreEMap<K,V> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in test\\Main.java (at line 7)\n" +
+ " EcoreEMap map = new EcoreEMap();\n" +
+ " ^^^^^^^^^\n" +
+ "EcoreEMap is a raw type. References to generic type EcoreEMap<K,V> should be parameterized\n" +
+ "----------\n" +
+ "3. ERROR in test\\Main.java (at line 8)\n" +
+ " map.addUnique(new Object()); //Error here ONLY in 4.4\n" +
+ " ^^^^^^^^^\n" +
+ "The method addUnique(Map.Entry) in the type EcoreEMap is not applicable for the arguments (Object)\n" +
"----------\n");
}
public void testBug454644() {
@@ -5511,147 +5511,147 @@ public void testBug454644() {
runNegativeTest(
new String[] {
"example/CollectionFactory.java",
- "/*\n" +
- " * Copyright 2002-2014 the original author or authors.\n" +
- " *\n" +
- " * Licensed under the Apache License, Version 2.0 (the \"License\");\n" +
- " * you may not use this file except in compliance with the License.\n" +
- " * You may obtain a copy of the License at\n" +
- " *\n" +
- " * http://www.apache.org/licenses/LICENSE-2.0\n" +
- " *\n" +
- " * Unless required by applicable law or agreed to in writing, software\n" +
- " * distributed under the License is distributed on an \"AS IS\" BASIS,\n" +
- " * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" +
- " * See the License for the specific language governing permissions and\n" +
- " * limitations under the License.\n" +
- " */\n" +
- "\n" +
- "package example;\n" +
- "\n" +
- "import java.util.ArrayList;\n" +
- "import java.util.Collection;\n" +
- "import java.util.EnumSet;\n" +
- "import java.util.LinkedHashSet;\n" +
- "import java.util.LinkedList;\n" +
- "import java.util.List;\n" +
- "import java.util.NavigableSet;\n" +
- "import java.util.Set;\n" +
- "import java.util.SortedSet;\n" +
- "import java.util.TreeSet;\n" +
- "\n" +
- "/**\n" +
- " * The code in this class is taken directly from the Spring Framework for the purpose\n" +
- " * of reproducing a bug.\n" +
- " * <p>\n" +
- " * Specifically, the code comes from {@code org.springframework.core.CollectionFactory}.\n" +
- " *\n" +
- " * @author Juergen Hoeller\n" +
- " * @author Arjen Poutsma\n" +
- " * @author Sam Brannen\n" +
- " */\n" +
- "public abstract class CollectionFactory {\n" +
- "\n" +
- " @SuppressWarnings({ \"unchecked\", \"cast\" })\n" +
- " public static <E> Collection<E> createApproximateCollection(Object collection, int capacity) {\n" +
- " if (collection instanceof LinkedList) {\n" +
- " return new LinkedList<E>();\n" +
- " }\n" +
- " else if (collection instanceof List) {\n" +
- " return new ArrayList<E>(capacity);\n" +
- " }\n" +
- " else if (collection instanceof EnumSet) {\n" +
- " // superfluous cast necessary for bug in Eclipse 4.4.1.\n" +
- " // return (Collection<E>) EnumSet.copyOf((EnumSet) collection);\n" +
- "\n" +
- " // Original code which compiles using OpenJDK 1.8.0_40-ea-b11 and IntelliJ IDEA\n" +
- " return EnumSet.copyOf((EnumSet) collection);\n" +
- " }\n" +
- " else if (collection instanceof SortedSet) {\n" +
- " return new TreeSet<E>(((SortedSet<E>) collection).comparator());\n" +
- " }\n" +
- " else {\n" +
- " return new LinkedHashSet<E>(capacity);\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static <E> Collection<E> createCollection(Class<?> collectionClass, Class<?> elementType, int capacity) {\n" +
- " if (collectionClass.isInterface()) {\n" +
- " if (Set.class.equals(collectionClass) || Collection.class.equals(collectionClass)) {\n" +
- " return new LinkedHashSet<E>(capacity);\n" +
- " }\n" +
- " else if (List.class.equals(collectionClass)) {\n" +
- " return new ArrayList<E>(capacity);\n" +
- " }\n" +
- " else if (SortedSet.class.equals(collectionClass) || NavigableSet.class.equals(collectionClass)) {\n" +
- " return new TreeSet<E>();\n" +
- " }\n" +
- " else {\n" +
- " throw new IllegalArgumentException(\"Unsupported Collection interface: \" + collectionClass.getName());\n" +
- " }\n" +
- " }\n" +
- " else if (EnumSet.class.equals(collectionClass)) {\n" +
- " // Assert.notNull(elementType, \"Cannot create EnumSet for unknown element type\");\n" +
- "\n" +
- " // superfluous cast necessary for bug in Eclipse 4.4.1.\n" +
- " // return (Collection<E>) EnumSet.noneOf((Class) elementType);\n" +
- "\n" +
- " // Original code which compiles using OpenJDK 1.8.0_40-ea-b11 and IntelliJ IDEA\n" +
- " return EnumSet.noneOf((Class) elementType);\n" +
- " }\n" +
- " else {\n" +
- " if (!Collection.class.isAssignableFrom(collectionClass)) {\n" +
- " throw new IllegalArgumentException(\"Unsupported Collection type: \" + collectionClass.getName());\n" +
- " }\n" +
- " try {\n" +
- " return (Collection<E>) collectionClass.newInstance();\n" +
- " }\n" +
- " catch (Exception ex) {\n" +
- " throw new IllegalArgumentException(\n" +
- " \"Could not instantiate Collection type: \" + collectionClass.getName(), ex);\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "\n" +
+ "/*\n" +
+ " * Copyright 2002-2014 the original author or authors.\n" +
+ " *\n" +
+ " * Licensed under the Apache License, Version 2.0 (the \"License\");\n" +
+ " * you may not use this file except in compliance with the License.\n" +
+ " * You may obtain a copy of the License at\n" +
+ " *\n" +
+ " * http://www.apache.org/licenses/LICENSE-2.0\n" +
+ " *\n" +
+ " * Unless required by applicable law or agreed to in writing, software\n" +
+ " * distributed under the License is distributed on an \"AS IS\" BASIS,\n" +
+ " * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" +
+ " * See the License for the specific language governing permissions and\n" +
+ " * limitations under the License.\n" +
+ " */\n" +
+ "\n" +
+ "package example;\n" +
+ "\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.EnumSet;\n" +
+ "import java.util.LinkedHashSet;\n" +
+ "import java.util.LinkedList;\n" +
+ "import java.util.List;\n" +
+ "import java.util.NavigableSet;\n" +
+ "import java.util.Set;\n" +
+ "import java.util.SortedSet;\n" +
+ "import java.util.TreeSet;\n" +
+ "\n" +
+ "/**\n" +
+ " * The code in this class is taken directly from the Spring Framework for the purpose\n" +
+ " * of reproducing a bug.\n" +
+ " * <p>\n" +
+ " * Specifically, the code comes from {@code org.springframework.core.CollectionFactory}.\n" +
+ " *\n" +
+ " * @author Juergen Hoeller\n" +
+ " * @author Arjen Poutsma\n" +
+ " * @author Sam Brannen\n" +
+ " */\n" +
+ "public abstract class CollectionFactory {\n" +
+ "\n" +
+ " @SuppressWarnings({ \"unchecked\", \"cast\" })\n" +
+ " public static <E> Collection<E> createApproximateCollection(Object collection, int capacity) {\n" +
+ " if (collection instanceof LinkedList) {\n" +
+ " return new LinkedList<E>();\n" +
+ " }\n" +
+ " else if (collection instanceof List) {\n" +
+ " return new ArrayList<E>(capacity);\n" +
+ " }\n" +
+ " else if (collection instanceof EnumSet) {\n" +
+ " // superfluous cast necessary for bug in Eclipse 4.4.1.\n" +
+ " // return (Collection<E>) EnumSet.copyOf((EnumSet) collection);\n" +
+ "\n" +
+ " // Original code which compiles using OpenJDK 1.8.0_40-ea-b11 and IntelliJ IDEA\n" +
+ " return EnumSet.copyOf((EnumSet) collection);\n" +
+ " }\n" +
+ " else if (collection instanceof SortedSet) {\n" +
+ " return new TreeSet<E>(((SortedSet<E>) collection).comparator());\n" +
+ " }\n" +
+ " else {\n" +
+ " return new LinkedHashSet<E>(capacity);\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public static <E> Collection<E> createCollection(Class<?> collectionClass, Class<?> elementType, int capacity) {\n" +
+ " if (collectionClass.isInterface()) {\n" +
+ " if (Set.class.equals(collectionClass) || Collection.class.equals(collectionClass)) {\n" +
+ " return new LinkedHashSet<E>(capacity);\n" +
+ " }\n" +
+ " else if (List.class.equals(collectionClass)) {\n" +
+ " return new ArrayList<E>(capacity);\n" +
+ " }\n" +
+ " else if (SortedSet.class.equals(collectionClass) || NavigableSet.class.equals(collectionClass)) {\n" +
+ " return new TreeSet<E>();\n" +
+ " }\n" +
+ " else {\n" +
+ " throw new IllegalArgumentException(\"Unsupported Collection interface: \" + collectionClass.getName());\n" +
+ " }\n" +
+ " }\n" +
+ " else if (EnumSet.class.equals(collectionClass)) {\n" +
+ " // Assert.notNull(elementType, \"Cannot create EnumSet for unknown element type\");\n" +
+ "\n" +
+ " // superfluous cast necessary for bug in Eclipse 4.4.1.\n" +
+ " // return (Collection<E>) EnumSet.noneOf((Class) elementType);\n" +
+ "\n" +
+ " // Original code which compiles using OpenJDK 1.8.0_40-ea-b11 and IntelliJ IDEA\n" +
+ " return EnumSet.noneOf((Class) elementType);\n" +
+ " }\n" +
+ " else {\n" +
+ " if (!Collection.class.isAssignableFrom(collectionClass)) {\n" +
+ " throw new IllegalArgumentException(\"Unsupported Collection type: \" + collectionClass.getName());\n" +
+ " }\n" +
+ " try {\n" +
+ " return (Collection<E>) collectionClass.newInstance();\n" +
+ " }\n" +
+ " catch (Exception ex) {\n" +
+ " throw new IllegalArgumentException(\n" +
+ " \"Could not instantiate Collection type: \" + collectionClass.getName(), ex);\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in example\\CollectionFactory.java (at line 42)\n" +
- " @SuppressWarnings({ \"unchecked\", \"cast\" })\n" +
- " ^^^^^^\n" +
- "Unnecessary @SuppressWarnings(\"cast\")\n" +
- "----------\n" +
- "2. WARNING in example\\CollectionFactory.java (at line 55)\n" +
- " return EnumSet.copyOf((EnumSet) collection);\n" +
- " ^^^^^^^\n" +
- "EnumSet is a raw type. References to generic type EnumSet<E> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in example\\CollectionFactory.java (at line 87)\n" +
- " return EnumSet.noneOf((Class) elementType);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation noneOf(Class) of the generic method noneOf(Class<E>) of type EnumSet\n" +
- "----------\n" +
- "4. WARNING in example\\CollectionFactory.java (at line 87)\n" +
- " return EnumSet.noneOf((Class) elementType);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type EnumSet needs unchecked conversion to conform to Collection<E>\n" +
- "----------\n" +
- "5. WARNING in example\\CollectionFactory.java (at line 87)\n" +
- " return EnumSet.noneOf((Class) elementType);\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- (this.complianceLevel < ClassFileConstants.JDK1_8
+ "----------\n" +
+ "1. WARNING in example\\CollectionFactory.java (at line 42)\n" +
+ " @SuppressWarnings({ \"unchecked\", \"cast\" })\n" +
+ " ^^^^^^\n" +
+ "Unnecessary @SuppressWarnings(\"cast\")\n" +
+ "----------\n" +
+ "2. WARNING in example\\CollectionFactory.java (at line 55)\n" +
+ " return EnumSet.copyOf((EnumSet) collection);\n" +
+ " ^^^^^^^\n" +
+ "EnumSet is a raw type. References to generic type EnumSet<E> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in example\\CollectionFactory.java (at line 87)\n" +
+ " return EnumSet.noneOf((Class) elementType);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation noneOf(Class) of the generic method noneOf(Class<E>) of type EnumSet\n" +
+ "----------\n" +
+ "4. WARNING in example\\CollectionFactory.java (at line 87)\n" +
+ " return EnumSet.noneOf((Class) elementType);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type EnumSet needs unchecked conversion to conform to Collection<E>\n" +
+ "----------\n" +
+ "5. WARNING in example\\CollectionFactory.java (at line 87)\n" +
+ " return EnumSet.noneOf((Class) elementType);\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ (this.complianceLevel < ClassFileConstants.JDK1_8
? "Type safety: The expression of type Class needs unchecked conversion to conform to Class<E>\n"
- : "Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum<Enum<E>>>\n") +
- "----------\n" +
- "6. WARNING in example\\CollectionFactory.java (at line 87)\n" +
- " return EnumSet.noneOf((Class) elementType);\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n" +
- "7. WARNING in example\\CollectionFactory.java (at line 94)\n" +
- " return (Collection<E>) collectionClass.newInstance();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from capture#13-of ? to Collection<E>\n" +
+ : "Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum<Enum<E>>>\n") +
+ "----------\n" +
+ "6. WARNING in example\\CollectionFactory.java (at line 87)\n" +
+ " return EnumSet.noneOf((Class) elementType);\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "7. WARNING in example\\CollectionFactory.java (at line 94)\n" +
+ " return (Collection<E>) collectionClass.newInstance();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from capture#13-of ? to Collection<E>\n" +
"----------\n",
null, true, options);
}
@@ -5660,42 +5660,42 @@ public void testBug456459a() {
runNegativeTest(
new String[] {
"EnumTest.java",
- "import java.util.EnumSet;\n" +
- "public class EnumTest {\n" +
- " \n" +
- " static enum Cloneables implements Cloneable {\n" +
- " One, Two, Three;\n" +
- " }\n" +
- " \n" +
- " public <T extends Cloneable> T getOne(Class enumType) {\n" +
- " EnumSet<? extends T> set = EnumSet.allOf(enumType);\n" +
- " return set.iterator().next();\n" +
- " }\n" +
+ "import java.util.EnumSet;\n" +
+ "public class EnumTest {\n" +
+ " \n" +
+ " static enum Cloneables implements Cloneable {\n" +
+ " One, Two, Three;\n" +
+ " }\n" +
+ " \n" +
+ " public <T extends Cloneable> T getOne(Class enumType) {\n" +
+ " EnumSet<? extends T> set = EnumSet.allOf(enumType);\n" +
+ " return set.iterator().next();\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in EnumTest.java (at line 8)\n" +
- " public <T extends Cloneable> T getOne(Class enumType) {\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in EnumTest.java (at line 9)\n" +
- " EnumSet<? extends T> set = EnumSet.allOf(enumType);\n" +
- " ^^^^^^^^^^^\n" +
- "Bound mismatch: The type ? extends T is not a valid substitute for the bounded parameter <E extends Enum<E>> of the type EnumSet<E>\n" +
- "----------\n" +
- "3. WARNING in EnumTest.java (at line 9)\n" +
- " EnumSet<? extends T> set = EnumSet.allOf(enumType);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" +
- "----------\n" +
- "4. WARNING in EnumTest.java (at line 9)\n" +
- " EnumSet<? extends T> set = EnumSet.allOf(enumType);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type EnumSet needs unchecked conversion to conform to EnumSet<? extends T>\n" +
- "----------\n" +
- "5. WARNING in EnumTest.java (at line 9)\n" +
- " EnumSet<? extends T> set = EnumSet.allOf(enumType);\n" +
+ "----------\n" +
+ "1. WARNING in EnumTest.java (at line 8)\n" +
+ " public <T extends Cloneable> T getOne(Class enumType) {\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in EnumTest.java (at line 9)\n" +
+ " EnumSet<? extends T> set = EnumSet.allOf(enumType);\n" +
+ " ^^^^^^^^^^^\n" +
+ "Bound mismatch: The type ? extends T is not a valid substitute for the bounded parameter <E extends Enum<E>> of the type EnumSet<E>\n" +
+ "----------\n" +
+ "3. WARNING in EnumTest.java (at line 9)\n" +
+ " EnumSet<? extends T> set = EnumSet.allOf(enumType);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" +
+ "----------\n" +
+ "4. WARNING in EnumTest.java (at line 9)\n" +
+ " EnumSet<? extends T> set = EnumSet.allOf(enumType);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type EnumSet needs unchecked conversion to conform to EnumSet<? extends T>\n" +
+ "----------\n" +
+ "5. WARNING in EnumTest.java (at line 9)\n" +
+ " EnumSet<? extends T> set = EnumSet.allOf(enumType);\n" +
" ^^^^^^^^\n" +
"Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum<Enum<E>>>\n" +
"----------\n");
@@ -5705,28 +5705,28 @@ public void testBug456459b() {
runNegativeTest(
new String[] {
"EnumTest.java",
- "import java.util.EnumSet;\n" +
- "public class EnumTest {\n" +
- " \n" +
- " static enum Cloneables implements Cloneable {\n" +
- " One, Two, Three;\n" +
- " }\n" +
- " \n" +
- " public void getOne(Class enumType) {\n" +
- " EnumSet<? extends EnumTest> set = null;\n" +
- " }\n" +
+ "import java.util.EnumSet;\n" +
+ "public class EnumTest {\n" +
+ " \n" +
+ " static enum Cloneables implements Cloneable {\n" +
+ " One, Two, Three;\n" +
+ " }\n" +
+ " \n" +
+ " public void getOne(Class enumType) {\n" +
+ " EnumSet<? extends EnumTest> set = null;\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in EnumTest.java (at line 8)\n" +
- " public void getOne(Class enumType) {\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in EnumTest.java (at line 9)\n" +
- " EnumSet<? extends EnumTest> set = null;\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Bound mismatch: The type ? extends EnumTest is not a valid substitute for the bounded parameter <E extends Enum<E>> of the type EnumSet<E>\n" +
+ "----------\n" +
+ "1. WARNING in EnumTest.java (at line 8)\n" +
+ " public void getOne(Class enumType) {\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in EnumTest.java (at line 9)\n" +
+ " EnumSet<? extends EnumTest> set = null;\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Bound mismatch: The type ? extends EnumTest is not a valid substitute for the bounded parameter <E extends Enum<E>> of the type EnumSet<E>\n" +
"----------\n");
}
// indirect conflict via wildcard's bound's bound.
@@ -5735,54 +5735,54 @@ public void testBug456459c() {
new String[] {
"X.java",
"class A {};\n" +
- "class B {};\n" +
- "public class X<T extends A> {\n" +
+ "class B {};\n" +
+ "public class X<T extends A> {\n" +
" <U extends B> void m() {\n" +
" X<? extends U> l = null;\n" +
- " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " X<? extends U> l = null;\n" +
- " ^^^^^^^^^^^\n" +
- "Bound mismatch: The type ? extends U is not a valid substitute for the bounded parameter <T extends A> of the type X<T>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " X<? extends U> l = null;\n" +
+ " ^^^^^^^^^^^\n" +
+ "Bound mismatch: The type ? extends U is not a valid substitute for the bounded parameter <T extends A> of the type X<T>\n" +
"----------\n");
}
public void testBug456924() {
runConformTest(
new String[] {
"Test1.java",
- "class Test1<E> {\n" +
- " <T extends Test1<T>> void method1(Class<T> t) {\n" +
- " Test2<? super T> test2 = getTest2(t);\n" +
- " // getTest2(t); // --> no error\n" +
- " }\n" +
- " <T extends Test1<T>> Test2<? super T> getTest2(Class<T> t){\n" +
- " return null;\n" +
- " }\n" +
- " \n" +
- "}\n" +
+ "class Test1<E> {\n" +
+ " <T extends Test1<T>> void method1(Class<T> t) {\n" +
+ " Test2<? super T> test2 = getTest2(t);\n" +
+ " // getTest2(t); // --> no error\n" +
+ " }\n" +
+ " <T extends Test1<T>> Test2<? super T> getTest2(Class<T> t){\n" +
+ " return null;\n" +
+ " }\n" +
+ " \n" +
+ "}\n" +
"\n",
"Test2.java",
"class Test2<E extends Test1<E>>{}\n"
});
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425203, [compiler][1.7][inference] ECJ rejects valid code using bounded wildcards
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425203, [compiler][1.7][inference] ECJ rejects valid code using bounded wildcards
public void test425203() {
- String source =
- "import java.util.Arrays;\n" +
- "import java.util.List;\n" +
- "interface MyFunction<Input, Output> {\n" +
- " Output apply(Input input);\n" +
- "}\n" +
- "public class Test {\n" +
- " public <Input, Output> List<Output> wrap(MyFunction<? super Input, ? extends Output> function, Input input) {\n" +
- " return Arrays.asList(function.apply(input));\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"Done\");\n" +
- " }\n" +
+ String source =
+ "import java.util.Arrays;\n" +
+ "import java.util.List;\n" +
+ "interface MyFunction<Input, Output> {\n" +
+ " Output apply(Input input);\n" +
+ "}\n" +
+ "public class Test {\n" +
+ " public <Input, Output> List<Output> wrap(MyFunction<? super Input, ? extends Output> function, Input input) {\n" +
+ " return Arrays.asList(function.apply(input));\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"Done\");\n" +
+ " }\n" +
"}";
if (this.complianceLevel < ClassFileConstants.JDK1_7) {
this.runNegativeTest(
@@ -5791,10 +5791,10 @@ public void test425203() {
source,
},
"----------\n" +
- "1. WARNING in Test.java (at line 8)\n" +
- " return Arrays.asList(function.apply(input));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: A generic array of capture#2-of ? extends Output is created for a varargs parameter\n" +
+ "1. WARNING in Test.java (at line 8)\n" +
+ " return Arrays.asList(function.apply(input));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: A generic array of capture#2-of ? extends Output is created for a varargs parameter\n" +
"----------\n" +
"2. ERROR in Test.java (at line 8)\n" +
" return Arrays.asList(function.apply(input));\n" +
@@ -5805,21 +5805,21 @@ public void test425203() {
runConformTest(new String[]{ "Test.java", source }, "Done");
}
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=489636, [1.8] "Bound mismatch" for a generic method parameter
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=489636, [1.8] "Bound mismatch" for a generic method parameter
public void test489636() {
this.runConformTest(
new String[] {
"Test.java",
- "interface I<T> {\n" +
- " I<T> get();\n" +
- "}\n" +
- "public class Test {\n" +
- "\n" +
- " @SuppressWarnings(\"unused\")\n" +
- " private static <T, S extends I<T>> void test(S p) {\n" +
- " I<T> i = p.get();\n" +
- " test(i); // Bound mismatch\n" +
- " }\n" +
+ "interface I<T> {\n" +
+ " I<T> get();\n" +
+ "}\n" +
+ "public class Test {\n" +
+ "\n" +
+ " @SuppressWarnings(\"unused\")\n" +
+ " private static <T, S extends I<T>> void test(S p) {\n" +
+ " I<T> i = p.get();\n" +
+ " test(i); // Bound mismatch\n" +
+ " }\n" +
"}"
});
}
@@ -5889,16 +5889,16 @@ public void testBug460491_comment23() {
runConformTest(
new String[] {
"PM.java",
- "public class PM<E extends Enum<E>> {\n" +
- " public PM(Class<E> clazz) {\n" +
- " }\n" +
- "\n" +
- " enum MyEnum {\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " new PM<MyEnum>(MyEnum.class);\n" +
- " }\n" +
+ "public class PM<E extends Enum<E>> {\n" +
+ " public PM(Class<E> clazz) {\n" +
+ " }\n" +
+ "\n" +
+ " enum MyEnum {\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " new PM<MyEnum>(MyEnum.class);\n" +
+ " }\n" +
"}\n"
});
}
@@ -5986,7 +5986,7 @@ public void testBug499126() {
" Object f() {return bug_ise_immutablelist.Test.f;}\n" +
"}\n" +
"",
- },
+ },
null,
null,
null,
@@ -5997,59 +5997,59 @@ public void testBug441905() {
runConformTest(
new String[] {
"EclipseJava8Generics.java",
- "import java.util.List;\n" +
- "\n" +
- "public class EclipseJava8Generics {\n" +
- "\n" +
- " public interface Foo<V> {\n" +
- " }\n" +
- "\n" +
- " public static class FooBar<V, T extends Foo<V>> {\n" +
- " }\n" +
- "\n" +
- " protected void doFoos(List<FooBar<?, ? extends Foo<?>>> fooBars) {\n" +
- " FooBar<?, ? extends Foo<?>> fooBar = fooBars.iterator().next();\n" +
- " doFoo(fooBar);\n" +
- " }\n" +
- "\n" +
- " protected static <F> void doFoo(FooBar<F, ? extends Foo<F>> fooBar) {\n" +
- " }\n" +
- "\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class EclipseJava8Generics {\n" +
+ "\n" +
+ " public interface Foo<V> {\n" +
+ " }\n" +
+ "\n" +
+ " public static class FooBar<V, T extends Foo<V>> {\n" +
+ " }\n" +
+ "\n" +
+ " protected void doFoos(List<FooBar<?, ? extends Foo<?>>> fooBars) {\n" +
+ " FooBar<?, ? extends Foo<?>> fooBar = fooBars.iterator().next();\n" +
+ " doFoo(fooBar);\n" +
+ " }\n" +
+ "\n" +
+ " protected static <F> void doFoo(FooBar<F, ? extends Foo<F>> fooBar) {\n" +
+ " }\n" +
+ "\n" +
"}\n"
});
}
public void testBug469297() {
- String source = " import java.util.List;\n" +
- " \n" +
- " public class Test {\n" +
- " \n" +
- " static final void a(Class<? extends List<?>> type) {\n" +
- " b(newList(type));\n" +
- " }\n" +
- " \n" +
- " static final <T> List<T> b(List<T> list) {\n" +
- " return list;\n" +
- " }\n" +
- " \n" +
+ String source = " import java.util.List;\n" +
+ " \n" +
+ " public class Test {\n" +
+ " \n" +
+ " static final void a(Class<? extends List<?>> type) {\n" +
+ " b(newList(type));\n" +
+ " }\n" +
+ " \n" +
+ " static final <T> List<T> b(List<T> list) {\n" +
+ " return list;\n" +
+ " }\n" +
+ " \n" +
" @SuppressWarnings(\"deprecation\")\n" +
- " static final <L extends List<?>> L newList(Class<L> type) {\n" +
- " try {\n" +
- " return type.newInstance();\n" +
- " }\n" +
- " catch (Exception e) {\n" +
- " throw new RuntimeException(e);\n" +
- " }\n" +
- " }\n" +
+ " static final <L extends List<?>> L newList(Class<L> type) {\n" +
+ " try {\n" +
+ " return type.newInstance();\n" +
+ " }\n" +
+ " catch (Exception e) {\n" +
+ " throw new RuntimeException(e);\n" +
+ " }\n" +
+ " }\n" +
" }\n";
if (this.complianceLevel < ClassFileConstants.JDK1_8) {
runConformTest(new String[] { "Test.java", source });
} else {
runNegativeTest(new String[] { "Test.java", source },
- "----------\n" +
- "1. ERROR in Test.java (at line 6)\n" +
- " b(newList(type));\n" +
- " ^\n" +
- "The method b(List<T>) in the type Test is not applicable for the arguments (capture#1-of ? extends List<?>)\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 6)\n" +
+ " b(newList(type));\n" +
+ " ^\n" +
+ "The method b(List<T>) in the type Test is not applicable for the arguments (capture#1-of ? extends List<?>)\n" +
"----------\n");
}
}
@@ -6166,40 +6166,40 @@ public void testBug521212() {
runNegativeTest(
new String[] {
"X.java",
- "class Y<U extends Z> {}\n" +
- "class Z {}\n" +
- "public class X<T> {\n" +
- " public static <V> Y<? extends V> one() {\n" +
- " return null;\n" +
- " }\n" +
+ "class Y<U extends Z> {}\n" +
+ "class Z {}\n" +
+ "public class X<T> {\n" +
+ " public static <V> Y<? extends V> one() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public static <V> Y<? extends V> one() {\n" +
- " ^^^^^^^^^^^\n" +
- "Bound mismatch: The type ? extends V is not a valid substitute for the bounded parameter <U extends Z> of the type Y<U>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " public static <V> Y<? extends V> one() {\n" +
+ " ^^^^^^^^^^^\n" +
+ "Bound mismatch: The type ? extends V is not a valid substitute for the bounded parameter <U extends Z> of the type Y<U>\n" +
"----------\n");
}
public void testBug526423() {
runConformTest(
new String[] {
"test/compileBug/TestCompileBug.java",
- "package test.compileBug;\n" +
- "\n" +
- "import java.util.ArrayList;\n" +
- "import java.util.LinkedHashMap;\n" +
- "import java.util.List;\n" +
- "import java.util.Map;\n" +
- "import java.util.Map.Entry;\n" +
- "\n" +
- "public class TestCompileBug {\n" +
- " @SuppressWarnings({ \"rawtypes\" })\n" +
- " private static void cannotCompile(Object token) {\n" +
- " // change the type to List<Entry> and ArrayList<Entry> and it compiles\n" +
- " @SuppressWarnings(\"unchecked\")\n" +
- " List<Map.Entry> identityServicesToTokensMap = new ArrayList<Map.Entry>(((LinkedHashMap) token).entrySet());\n" +
- " }\n" +
+ "package test.compileBug;\n" +
+ "\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.LinkedHashMap;\n" +
+ "import java.util.List;\n" +
+ "import java.util.Map;\n" +
+ "import java.util.Map.Entry;\n" +
+ "\n" +
+ "public class TestCompileBug {\n" +
+ " @SuppressWarnings({ \"rawtypes\" })\n" +
+ " private static void cannotCompile(Object token) {\n" +
+ " // change the type to List<Entry> and ArrayList<Entry> and it compiles\n" +
+ " @SuppressWarnings(\"unchecked\")\n" +
+ " List<Map.Entry> identityServicesToTokensMap = new ArrayList<Map.Entry>(((LinkedHashMap) token).entrySet());\n" +
+ " }\n" +
"}"
}
);
@@ -6210,53 +6210,53 @@ public void testBug526132() {
runNegativeTest(
new String[] {
"Test.java",
- "import java.util.HashMap;\n" +
- "import java.util.Map;\n" +
- "public class Test {\n" +
- " private Map field = new HashMap();\n" +
- " private void method() {\n" +
- " field.put(\"key\", \"value\");\n" +
+ "import java.util.HashMap;\n" +
+ "import java.util.Map;\n" +
+ "public class Test {\n" +
+ " private Map field = new HashMap();\n" +
+ " private void method() {\n" +
+ " field.put(\"key\", \"value\");\n" +
" }\n" +
- " private void method() {\n" +
- " field.put(\"key\", \"value\");\n" +
+ " private void method() {\n" +
+ " field.put(\"key\", \"value\");\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in Test.java (at line 4)\n" +
- " private Map field = new HashMap();\n" +
- " ^^^\n" +
- "Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in Test.java (at line 4)\n" +
- " private Map field = new HashMap();\n" +
- " ^^^^^^^\n" +
- "HashMap is a raw type. References to generic type HashMap<K,V> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 5)\n" +
- " private void method() {\n" +
- " ^^^^^^^^\n" +
- "Duplicate method method() in type Test\n" +
- "----------\n" +
- "4. WARNING in Test.java (at line 5)\n" +
- " private void method() {\n" +
- " ^^^^^^^^\n" +
- "The method method() from the type Test is never used locally\n" +
- "----------\n" +
- "5. WARNING in Test.java (at line 6)\n" +
- " field.put(\"key\", \"value\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method put(Object, Object) belongs to the raw type Map. References to generic type Map<K,V> should be parameterized\n" +
- "----------\n" +
- "6. ERROR in Test.java (at line 8)\n" +
- " private void method() {\n" +
- " ^^^^^^^^\n" +
- "Duplicate method method() in type Test\n" +
- "----------\n" +
- "7. WARNING in Test.java (at line 9)\n" +
- " field.put(\"key\", \"value\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method put(Object, Object) belongs to the raw type Map. References to generic type Map<K,V> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in Test.java (at line 4)\n" +
+ " private Map field = new HashMap();\n" +
+ " ^^^\n" +
+ "Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in Test.java (at line 4)\n" +
+ " private Map field = new HashMap();\n" +
+ " ^^^^^^^\n" +
+ "HashMap is a raw type. References to generic type HashMap<K,V> should be parameterized\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 5)\n" +
+ " private void method() {\n" +
+ " ^^^^^^^^\n" +
+ "Duplicate method method() in type Test\n" +
+ "----------\n" +
+ "4. WARNING in Test.java (at line 5)\n" +
+ " private void method() {\n" +
+ " ^^^^^^^^\n" +
+ "The method method() from the type Test is never used locally\n" +
+ "----------\n" +
+ "5. WARNING in Test.java (at line 6)\n" +
+ " field.put(\"key\", \"value\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method put(Object, Object) belongs to the raw type Map. References to generic type Map<K,V> should be parameterized\n" +
+ "----------\n" +
+ "6. ERROR in Test.java (at line 8)\n" +
+ " private void method() {\n" +
+ " ^^^^^^^^\n" +
+ "Duplicate method method() in type Test\n" +
+ "----------\n" +
+ "7. WARNING in Test.java (at line 9)\n" +
+ " field.put(\"key\", \"value\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method put(Object, Object) belongs to the raw type Map. References to generic type Map<K,V> should be parameterized\n" +
"----------\n",
null,
true,
@@ -6284,18 +6284,18 @@ public void testBug520482() {
"package test;\n" +
"\n" +
"public class B extends A {\n" +
- " public static test() {\n" +
- " f.add(new B());\n" +
+ " public static test() {\n" +
+ " f.add(new B());\n" +
" }\n" +
"}\n"
},
null,
customOptions,
- "----------\n" +
- "1. ERROR in test\\B.java (at line 4)\n" +
- " public static test() {\n" +
- " ^^^^^^\n" +
- "Return type for the method is missing\n" +
+ "----------\n" +
+ "1. ERROR in test\\B.java (at line 4)\n" +
+ " public static test() {\n" +
+ " ^^^^^^\n" +
+ "Return type for the method is missing\n" +
"----------\n",
"", "", null
);
@@ -6365,11 +6365,11 @@ public void testBug532137() {
"}\n" +
"",
},
- "----------\n" +
- "1. WARNING in subtypes\\TestImpl.java (at line 8)\n" +
- " protected List<Class<? extends GenericType>> giveMeAListOfTypes() {\n" +
- " ^^^^^^^^^^^\n" +
- "GenericType is a raw type. References to generic type GenericType<REQ,RES> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in subtypes\\TestImpl.java (at line 8)\n" +
+ " protected List<Class<? extends GenericType>> giveMeAListOfTypes() {\n" +
+ " ^^^^^^^^^^^\n" +
+ "GenericType is a raw type. References to generic type GenericType<REQ,RES> should be parameterized\n" +
"----------\n",
null,
false
@@ -6380,17 +6380,17 @@ public void testBug540313() {
Runner runner = new Runner();
runner.testFiles = new String[] {
"X/C120644mr.java",
- "package X;\n" +
- "\n" +
- "public class C120644mr<V, X extends java.lang.Exception> extends X.C16280iv<V> {\n" +
+ "package X;\n" +
+ "\n" +
+ "public class C120644mr<V, X extends java.lang.Exception> extends X.C16280iv<V> {\n" +
"}\n"
};
- runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X\\C120644mr.java (at line 3)\n" +
- " public class C120644mr<V, X extends java.lang.Exception> extends X.C16280iv<V> {\n" +
- " ^^^^^^^^^^\n" +
- "X.C16280iv cannot be resolved to a type\n" +
+ runner.expectedCompilerLog =
+ "----------\n" +
+ "1. ERROR in X\\C120644mr.java (at line 3)\n" +
+ " public class C120644mr<V, X extends java.lang.Exception> extends X.C16280iv<V> {\n" +
+ " ^^^^^^^^^^\n" +
+ "X.C16280iv cannot be resolved to a type\n" +
"----------\n";
runner.runNegativeTest();
}
@@ -6399,20 +6399,20 @@ public void testBug540313a() {
Runner runner = new Runner();
runner.testFiles = new String[] {
"X/C120644mr.java",
- "package X;\n" +
- "\n" +
+ "package X;\n" +
+ "\n" +
"class Outer {\n" +
" class Inner<Z> {}\n" +
- "}\n" +
- "public class C120644mr<V, X extends Outer> extends X.Inner<V> {\n" +
+ "}\n" +
+ "public class C120644mr<V, X extends Outer> extends X.Inner<V> {\n" +
"}\n"
};
- runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X\\C120644mr.java (at line 6)\n" +
- " public class C120644mr<V, X extends Outer> extends X.Inner<V> {\n" +
- " ^^^^^^^\n" +
- "X.Inner cannot be resolved to a type\n" +
+ runner.expectedCompilerLog =
+ "----------\n" +
+ "1. ERROR in X\\C120644mr.java (at line 6)\n" +
+ " public class C120644mr<V, X extends Outer> extends X.Inner<V> {\n" +
+ " ^^^^^^^\n" +
+ "X.Inner cannot be resolved to a type\n" +
"----------\n";
runner.runNegativeTest();
}
@@ -6421,11 +6421,11 @@ public void testBug540313b() {
Runner runner = new Runner();
runner.testFiles = new String[] {
"X/C120644mr.java",
- "package X;\n" +
- "\n" +
+ "package X;\n" +
+ "\n" +
"class Outer {\n" +
" class Inner<Z> {}\n" +
- "}\n" +
+ "}\n" +
"public class C120644mr<X extends Outer, V> {\n" +
" X.Inner<V> inner;\n" + // is this backed by JLS?
"}\n"
@@ -6436,43 +6436,43 @@ public void testBug478708() {
Runner runner = new Runner();
runner.testFiles = new String[] {
"bug/IInterface.java",
- "package bug;\n" +
- "\n" +
- "public class IInterface {\n" +
- "\n" +
+ "package bug;\n" +
+ "\n" +
+ "public class IInterface {\n" +
+ "\n" +
"}\n",
"bug/AbstractA.java",
- "package bug;\n" +
- "\n" +
- "public abstract class AbstractA<T extends IInterface> {\n" +
- "\n" +
- " public abstract class AbstractD<U> {\n" +
- "\n" +
- " }\n" +
+ "package bug;\n" +
+ "\n" +
+ "public abstract class AbstractA<T extends IInterface> {\n" +
+ "\n" +
+ " public abstract class AbstractD<U> {\n" +
+ "\n" +
+ " }\n" +
"}\n",
"bug/AbstractC.java",
- "package bug;\n" +
- "\n" +
- "\n" +
- "public abstract class AbstractC<T extends IInterface> extends T.AbstractD<E> {\n" +
- "\n" +
- " public AbstractC(AbstractA<T> a) {\n" +
- " a.super();\n" +
- " }\n" +
+ "package bug;\n" +
+ "\n" +
+ "\n" +
+ "public abstract class AbstractC<T extends IInterface> extends T.AbstractD<E> {\n" +
+ "\n" +
+ " public AbstractC(AbstractA<T> a) {\n" +
+ " a.super();\n" +
+ " }\n" +
"}\n",
"bug/E.java",
- "package bug;\n" +
- "\n" +
- "public class E {\n" +
- "\n" +
+ "package bug;\n" +
+ "\n" +
+ "public class E {\n" +
+ "\n" +
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in bug\\AbstractC.java (at line 4)\n" +
- " public abstract class AbstractC<T extends IInterface> extends T.AbstractD<E> {\n" +
- " ^^^^^^^^^^^\n" +
- "T.AbstractD cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in bug\\AbstractC.java (at line 4)\n" +
+ " public abstract class AbstractC<T extends IInterface> extends T.AbstractD<E> {\n" +
+ " ^^^^^^^^^^^\n" +
+ "T.AbstractD cannot be resolved to a type\n" +
"----------\n";
runner.runNegativeTest();
}
@@ -6487,11 +6487,11 @@ public void testBug543526() {
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in C.java (at line 3)\n" +
- " return x instanceof String;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Incompatible conditional operand types T and String\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 3)\n" +
+ " return x instanceof String;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Incompatible conditional operand types T and String\n" +
"----------\n";
runner.runNegativeTest();
}
@@ -6511,104 +6511,104 @@ public void testBug552388() {
runNegativeTest(
new String[] {
"A.java",
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "\n" +
- "public class A<T extends B> {\n" +
- " protected List<C> list = new ArrayList<C>();\n" +
- "\n" +
- " class C {}\n" +
- "\n" +
- " public void createIO() {\n" +
- " A<? extends B> x = null;\n" +
- " List<A<? extends B>.C> y = x.list;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class B {\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class A<T extends B> {\n" +
+ " protected List<C> list = new ArrayList<C>();\n" +
+ "\n" +
+ " class C {}\n" +
+ "\n" +
+ " public void createIO() {\n" +
+ " A<? extends B> x = null;\n" +
+ " List<A<? extends B>.C> y = x.list;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class B {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in A.java (at line 11)\n" +
- " List<A<? extends B>.C> y = x.list;\n" +
- " ^^^^^^\n" +
- "Type mismatch: cannot convert from List<A<capture#1-of ? extends B>.C> to List<A<? extends B>.C>\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 11)\n" +
+ " List<A<? extends B>.C> y = x.list;\n" +
+ " ^^^^^^\n" +
+ "Type mismatch: cannot convert from List<A<capture#1-of ? extends B>.C> to List<A<? extends B>.C>\n" +
"----------\n");
}
public void testBug552388b() {
String output = this.complianceLevel > ClassFileConstants.JDK1_6 ?
- "----------\n" +
- "1. ERROR in A.java (at line 17)\n" +
- " foo(l);\n" +
- " ^^^\n" +
- "The method foo(List<A<?>.C>) in the type A<T> is not applicable for the arguments (List<A<T>.C>)\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 33)\n" +
- " foo2(l); \n" +
- " ^^^^\n" +
- "The method foo2(List<A<?>>) in the type A<T> is not applicable for the arguments (List<A<T>>)\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 17)\n" +
+ " foo(l);\n" +
+ " ^^^\n" +
+ "The method foo(List<A<?>.C>) in the type A<T> is not applicable for the arguments (List<A<T>.C>)\n" +
+ "----------\n" +
+ "2. ERROR in A.java (at line 33)\n" +
+ " foo2(l); \n" +
+ " ^^^^\n" +
+ "The method foo2(List<A<?>>) in the type A<T> is not applicable for the arguments (List<A<T>>)\n" +
"----------\n"
:
- "----------\n" +
- "1. ERROR in A.java (at line 16)\n" +
- " List<C> l = new ArrayList<>();\n" +
- " ^^^^^^^^^\n" +
- "\'<>\' operator is not allowed for source level below 1.7\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 17)\n" +
- " foo(l);\n" +
- " ^^^\n" +
- "The method foo(List<A<?>.C>) in the type A<T> is not applicable for the arguments (List<A<T>.C>)\n" +
- "----------\n" +
- "3. ERROR in A.java (at line 32)\n" +
- " List<A<T>> l = new ArrayList<>();\n" +
- " ^^^^^^^^^\n" +
- "\'<>\' operator is not allowed for source level below 1.7\n" +
- "----------\n" +
- "4. ERROR in A.java (at line 33)\n" +
- " foo2(l); \n" +
- " ^^^^\n" +
- "The method foo2(List<A<?>>) in the type A<T> is not applicable for the arguments (List<A<T>>)\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 16)\n" +
+ " List<C> l = new ArrayList<>();\n" +
+ " ^^^^^^^^^\n" +
+ "\'<>\' operator is not allowed for source level below 1.7\n" +
+ "----------\n" +
+ "2. ERROR in A.java (at line 17)\n" +
+ " foo(l);\n" +
+ " ^^^\n" +
+ "The method foo(List<A<?>.C>) in the type A<T> is not applicable for the arguments (List<A<T>.C>)\n" +
+ "----------\n" +
+ "3. ERROR in A.java (at line 32)\n" +
+ " List<A<T>> l = new ArrayList<>();\n" +
+ " ^^^^^^^^^\n" +
+ "\'<>\' operator is not allowed for source level below 1.7\n" +
+ "----------\n" +
+ "4. ERROR in A.java (at line 33)\n" +
+ " foo2(l); \n" +
+ " ^^^^\n" +
+ "The method foo2(List<A<?>>) in the type A<T> is not applicable for the arguments (List<A<T>>)\n" +
"----------\n";
runNegativeTest(
new String[] {
"A.java",
- "import java.util.*;\n" +
- "class A<T> {\n" +
- " class C {\n" +
- " T f;\n" +
- " }\n" +
- " C c = new C();\n" +
- " A(T t) {\n" +
- " c = new C();\n" +
- " c.f = t;\n" +
- " }\n" +
- " void foo(List<A<?>.C> list) {\n" +
- " list.add(new A<String>(\"\").c);\n" +
- " list.add(new A<Number>(3).c);\n" +
- " }\n" +
- " T test() {\n" +
- " List<C> l = new ArrayList<>();\n" +
- " foo(l);\n" +
- " return l.get(0).f;\n" +
- " }\n" +
- " public static void main(String... args) {\n" +
- "// Number n = new A<Number>(1).test();\n" +
- "// System.out.print(n.intValue());\n" +
- " Number n = new A<Number>(1).test2();\n" +
- " System.out.print(n.intValue());\n" +
- " }\n" +
- " \n" +
- " void foo2(List<A<?>> list) {\n" +
- " list.add(new A<String>(\"\"));\n" +
- " list.add(new A<Number>(3));\n" +
- " }\n" +
- " T test2() {\n" +
- " List<A<T>> l = new ArrayList<>();\n" +
- " foo2(l); \n" +
- " return l.get(0).c.f;\n" +
- " }\n" +
- " \n" +
+ "import java.util.*;\n" +
+ "class A<T> {\n" +
+ " class C {\n" +
+ " T f;\n" +
+ " }\n" +
+ " C c = new C();\n" +
+ " A(T t) {\n" +
+ " c = new C();\n" +
+ " c.f = t;\n" +
+ " }\n" +
+ " void foo(List<A<?>.C> list) {\n" +
+ " list.add(new A<String>(\"\").c);\n" +
+ " list.add(new A<Number>(3).c);\n" +
+ " }\n" +
+ " T test() {\n" +
+ " List<C> l = new ArrayList<>();\n" +
+ " foo(l);\n" +
+ " return l.get(0).f;\n" +
+ " }\n" +
+ " public static void main(String... args) {\n" +
+ "// Number n = new A<Number>(1).test();\n" +
+ "// System.out.print(n.intValue());\n" +
+ " Number n = new A<Number>(1).test2();\n" +
+ " System.out.print(n.intValue());\n" +
+ " }\n" +
+ " \n" +
+ " void foo2(List<A<?>> list) {\n" +
+ " list.add(new A<String>(\"\"));\n" +
+ " list.add(new A<Number>(3));\n" +
+ " }\n" +
+ " T test2() {\n" +
+ " List<A<T>> l = new ArrayList<>();\n" +
+ " foo2(l); \n" +
+ " return l.get(0).c.f;\n" +
+ " }\n" +
+ " \n" +
"}\n"
},
output);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_7.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_7.java
index de2acc889..317d34169 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_7.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_7.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Stephan Herrmann - Contribution for
@@ -44,14 +44,14 @@ public void test001() {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T> {\n" +
- " public static void main(String[] args) {\n" +
- " X<String> x = new X<>();\n" +
- " x.testFunction(\"SUCCESS\");\n" +
+ "public class X<T> {\n" +
+ " public static void main(String[] args) {\n" +
+ " X<String> x = new X<>();\n" +
+ " x.testFunction(\"SUCCESS\");\n" +
" }\n" +
" public void testFunction(T param){\n" +
" System.out.println(param);\n" +
- " }\n" +
+ " }\n" +
"}",
},
"SUCCESS");
@@ -60,32 +60,32 @@ public void test001a() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X<T> {\n" +
- " public static void main(String[] args) {\n" +
- " X<String> x = new X<>();\n" +
- " x.testFunction(1);\n" +
+ "public class X<T> {\n" +
+ " public static void main(String[] args) {\n" +
+ " X<String> x = new X<>();\n" +
+ " x.testFunction(1);\n" +
" }\n" +
" public void testFunction(T param){\n" +
" System.out.println(param);\n" +
- " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " x.testFunction(1);\n" +
- " ^^^^^^^^^^^^\n" +
- "The method testFunction(String) in the type X<String> is not applicable for the arguments (int)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " x.testFunction(1);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The method testFunction(String) in the type X<String> is not applicable for the arguments (int)\n" +
"----------\n");
}
public void test001b() {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T> {\n" +
- " public static void main(String[] args) {\n" +
- " java.util.ArrayList<String> x = new java.util.ArrayList<>();\n" +
+ "public class X<T> {\n" +
+ " public static void main(String[] args) {\n" +
+ " java.util.ArrayList<String> x = new java.util.ArrayList<>();\n" +
" x.add(\"\");\n" +
- " System.out.println(\"SUCCESS\");\n" +
+ " System.out.println(\"SUCCESS\");\n" +
" }\n" +
"}",
},
@@ -97,10 +97,10 @@ public void test001b_1() {
new String[] {
"X.java",
"public class X<T> {\n" +
- " static java.util.ArrayList<String> x = new java.util.ArrayList<>();\n" +
- " public static void main(String[] args) {\n" +
+ " static java.util.ArrayList<String> x = new java.util.ArrayList<>();\n" +
+ " public static void main(String[] args) {\n" +
" X.x.add(\"\");\n" +
- " System.out.println(\"SUCCESS\");\n" +
+ " System.out.println(\"SUCCESS\");\n" +
" }\n" +
"}",
},
@@ -110,19 +110,19 @@ public void test001c() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X<T> {\n" +
- " public static void main(String[] args) {\n" +
- " java.util.ArrayList<String> x = new java.util.ArrayList<>();\n" +
+ "public class X<T> {\n" +
+ " public static void main(String[] args) {\n" +
+ " java.util.ArrayList<String> x = new java.util.ArrayList<>();\n" +
" x.add(1);\n" +
- " System.out.println(\"SUCCESS\");\n" +
+ " System.out.println(\"SUCCESS\");\n" +
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " x.add(1);\n" +
- " ^^^\n" +
- "The method add(int, String) in the type ArrayList<String> is not applicable for the arguments (int)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " x.add(1);\n" +
+ " ^^^\n" +
+ "The method add(int, String) in the type ArrayList<String> is not applicable for the arguments (int)\n" +
"----------\n");
}
// fields
@@ -131,18 +131,18 @@ public void test001c_1() {
new String[] {
"X.java",
"public class X<T> {\n" +
- " static java.util.ArrayList<String> x = new java.util.ArrayList<>();\n" +
- " public static void main(String[] args) {\n" +
+ " static java.util.ArrayList<String> x = new java.util.ArrayList<>();\n" +
+ " public static void main(String[] args) {\n" +
" X.x.add(1);\n" +
- " System.out.println(\"SUCCESS\");\n" +
+ " System.out.println(\"SUCCESS\");\n" +
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " X.x.add(1);\n" +
- " ^^^\n" +
- "The method add(int, String) in the type ArrayList<String> is not applicable for the arguments (int)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " X.x.add(1);\n" +
+ " ^^^\n" +
+ "The method add(int, String) in the type ArrayList<String> is not applicable for the arguments (int)\n" +
"----------\n");
}
public void test001d() {
@@ -152,20 +152,20 @@ public void test001d() {
"X.java",
"import java.util.ArrayList;\n" +
"public class X<T> {" +
- " public void ab(ArrayList<String> al){\n" +
+ " public void ab(ArrayList<String> al){\n" +
" System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X<String> x = new X<>();\n" +
- " x.ab(new ArrayList<>());\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X<String> x = new X<>();\n" +
+ " x.ab(new ArrayList<>());\n" +
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " x.ab(new ArrayList<>());\n" +
- " ^^\n" +
- "The method ab(ArrayList<String>) in the type X<String> is not applicable for the arguments (ArrayList<Object>)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " x.ab(new ArrayList<>());\n" +
+ " ^^\n" +
+ "The method ab(ArrayList<String>) in the type X<String> is not applicable for the arguments (ArrayList<Object>)\n" +
"----------\n");
} else {
this.runConformTest(
@@ -173,12 +173,12 @@ public void test001d() {
"X.java",
"import java.util.ArrayList;\n" +
"public class X<T> {" +
- " public void ab(ArrayList<String> al){\n" +
+ " public void ab(ArrayList<String> al){\n" +
" System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X<String> x = new X<>();\n" +
- " x.ab(new ArrayList<>());\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X<String> x = new X<>();\n" +
+ " x.ab(new ArrayList<>());\n" +
" }\n" +
"}",
},
@@ -192,20 +192,20 @@ public void test001e() {
"X.java",
"import java.util.ArrayList;\n" +
"public class X<T> {" +
- " public void ab(ArrayList<T> al){\n" +
+ " public void ab(ArrayList<T> al){\n" +
" System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X<String> x = new X<>();\n" +
- " x.ab(new ArrayList<>());\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X<String> x = new X<>();\n" +
+ " x.ab(new ArrayList<>());\n" +
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " x.ab(new ArrayList<>());\n" +
- " ^^\n" +
- "The method ab(ArrayList<String>) in the type X<String> is not applicable for the arguments (ArrayList<Object>)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " x.ab(new ArrayList<>());\n" +
+ " ^^\n" +
+ "The method ab(ArrayList<String>) in the type X<String> is not applicable for the arguments (ArrayList<Object>)\n" +
"----------\n");
} else {
this.runConformTest(
@@ -213,12 +213,12 @@ public void test001e() {
"X.java",
"import java.util.ArrayList;\n" +
"public class X<T> {" +
- " public void ab(ArrayList<T> al){\n" +
+ " public void ab(ArrayList<T> al){\n" +
" System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X<String> x = new X<>();\n" +
- " x.ab(new ArrayList<>());\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X<String> x = new X<>();\n" +
+ " x.ab(new ArrayList<>());\n" +
" }\n" +
"}",
},
@@ -234,22 +234,22 @@ public void test001f() {
" void methodx(T param){\n" +
" System.out.println(param);\n" +
" }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X<String>.X2<String> x = new X<>().new X2<>();\n" +
- " x.methodx(\"SUCCESS\");\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X<String>.X2<String> x = new X<>().new X2<>();\n" +
+ " x.methodx(\"SUCCESS\");\n" +
" }\n" +
"}",
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " class X2<T>{\n" +
- " ^\n" +
- "The type parameter T is hiding the type T\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " X<String>.X2<String> x = new X<>().new X2<>();\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " class X2<T>{\n" +
+ " ^\n" +
+ "The type parameter T is hiding the type T\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " X<String>.X2<String> x = new X<>().new X2<>();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
"Type mismatch: cannot convert from X<Object>.X2<String> to X<String>.X2<String>\n"
:
@@ -268,11 +268,11 @@ public void test001f_1() {
" System.out.println(param);\n" +
" }\n" +
" }\n" +
- " X<String>.X2<String> x;\n" +
+ " X<String>.X2<String> x;\n" +
" public static void main(String[] args) {\n" +
- " X test = new X();\n" +
- " test.x = new X<>().new X2<>();\n" +
- " test.x.methodx(\"SUCCESS\");\n" +
+ " X test = new X();\n" +
+ " test.x = new X<>().new X2<>();\n" +
+ " test.x.methodx(\"SUCCESS\");\n" +
" }\n" +
"}",
},
@@ -288,17 +288,17 @@ public void test001g() {
" System.out.println(param);\n" +
" System.out.println(param2);\n" +
" }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X<String>.X2<Integer> x = new X<>().new X2<>();\n" +
- " x.methodx(\"SUCCESS\",1);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X<String>.X2<Integer> x = new X<>().new X2<>();\n" +
+ " x.methodx(\"SUCCESS\",1);\n" +
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " X<String>.X2<Integer> x = new X<>().new X2<>();\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " X<String>.X2<Integer> x = new X<>().new X2<>();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
"Type mismatch: cannot convert from X<Object>.X2<Integer> to X<String>.X2<Integer>\n"
:
@@ -317,11 +317,11 @@ public void test001g_1() {
" System.out.println(param2);\n" +
" }\n" +
" }\n" +
- " X<String>.X2<Integer> x;\n" +
+ " X<String>.X2<Integer> x;\n" +
" public static void main(String[] args) {\n" +
- " X test = new X();" +
- " test.x = new X<>().new X2<>();\n" +
- " test.x.methodx(\"SUCCESS\",1);\n" +
+ " X test = new X();" +
+ " test.x = new X<>().new X2<>();\n" +
+ " test.x.methodx(\"SUCCESS\",1);\n" +
" }\n" +
"}",
},
@@ -336,32 +336,32 @@ public void test001h() {
" void methodx(T param){\n" +
" System.out.println(param);\n" +
" }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X<String>.X2<String> x = new X<>().new X2<>();\n" +
- " x.methodx(1);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X<String>.X2<String> x = new X<>().new X2<>();\n" +
+ " x.methodx(1);\n" +
" }\n" +
"}",
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " class X2<T>{\n" +
- " ^\n" +
- "The type parameter T is hiding the type T\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " X<String>.X2<String> x = new X<>().new X2<>();\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " class X2<T>{\n" +
+ " ^\n" +
+ "The type parameter T is hiding the type T\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " X<String>.X2<String> x = new X<>().new X2<>();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
"Type mismatch: cannot convert from X<Object>.X2<String> to X<String>.X2<String>\n"
:
"Cannot infer type arguments for X2<>\n"
) +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " x.methodx(1);\n" +
- " ^^^^^^^\n" +
- "The method methodx(String) in the type X<String>.X2<String> is not applicable for the arguments (int)\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 9)\n" +
+ " x.methodx(1);\n" +
+ " ^^^^^^^\n" +
+ "The method methodx(String) in the type X<String>.X2<String> is not applicable for the arguments (int)\n" +
"----------\n");
}
public void test001h_1() {
@@ -374,39 +374,39 @@ public void test001h_1() {
" System.out.println(param);\n" +
" }\n" +
" }\n" +
- " X<String>.X2<String> x;\n" +
+ " X<String>.X2<String> x;\n" +
" public static void main(String[] args) {\n" +
- " X test = new X();\n" +
- " test.x = new X<>().new X2<>();\n" +
- " test.x.methodx(1);\n" +
+ " X test = new X();\n" +
+ " test.x = new X<>().new X2<>();\n" +
+ " test.x.methodx(1);\n" +
" }\n" +
"}",
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " class X2<T>{\n" +
- " ^\n" +
- "The type parameter T is hiding the type T\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " X test = new X();\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 9)\n" +
- " X test = new X();\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 10)\n" +
- " test.x = new X<>().new X2<>();\n" +
- " ^\n" +
- "Type safety: The field x from the raw type X is assigned a value of type X<Object>.X2<Object>. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 11)\n" +
- " test.x.methodx(1);\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method methodx(Object) belongs to the raw type X.X2. References to generic type X<T>.X2<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " class X2<T>{\n" +
+ " ^\n" +
+ "The type parameter T is hiding the type T\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " X test = new X();\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 9)\n" +
+ " X test = new X();\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 10)\n" +
+ " test.x = new X<>().new X2<>();\n" +
+ " ^\n" +
+ "Type safety: The field x from the raw type X is assigned a value of type X<Object>.X2<Object>. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 11)\n" +
+ " test.x.methodx(1);\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method methodx(Object) belongs to the raw type X.X2. References to generic type X<T>.X2<T> should be parameterized\n" +
"----------\n");
}
public void test001h_2() {
@@ -419,11 +419,11 @@ public void test001h_2() {
" System.out.println(param);\n" +
" }\n" +
" }\n" +
- " X<String>.X2<String> x;\n" +
+ " X<String>.X2<String> x;\n" +
" public static void main(String[] args) {\n" +
- " X test = new X();\n" +
- " test.x = new X<>().new X2<>();\n" +
- " test.x.methodx(1);\n" +
+ " X test = new X();\n" +
+ " test.x = new X<>().new X2<>();\n" +
+ " test.x.methodx(1);\n" +
" }\n" +
"}",
},
@@ -440,20 +440,20 @@ public void test001i() {
" System.out.println(param);\n" +
" }\n" +
" }\n" +
- " }\n" +
+ " }\n" +
" public static void main(String[] args) {\n" +
- " X<String> test = new X<>();" +
- " X<String>.X2<Integer>.X22<X<String>> x = new X<>().new X2<>().new X22<>();\n" +
- " x.methodx(\"SUCCESS\", 1, test);\n" +
+ " X<String> test = new X<>();" +
+ " X<String>.X2<Integer>.X22<X<String>> x = new X<>().new X2<>().new X22<>();\n" +
+ " x.methodx(\"SUCCESS\", 1, test);\n" +
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " X<String> test = new X<>(); X<String>.X2<Integer>.X22<X<String>> x = new X<>().new X2<>().new X22<>();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " X<String> test = new X<>(); X<String>.X2<Integer>.X22<X<String>> x = new X<>().new X2<>().new X22<>();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "Type mismatch: cannot convert from X<Object>.X2<Object>.X22<X<String>> to X<String>.X2<Integer>.X22<X<String>>\n"
+ "Type mismatch: cannot convert from X<Object>.X2<Object>.X22<X<String>> to X<String>.X2<Integer>.X22<X<String>>\n"
:
"Cannot infer type arguments for X22<>\n"
) +
@@ -463,39 +463,39 @@ public void test002() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X<T> {\n" +
- " public static void main(String[] args) {\n" +
- " X x = new X<>();\n" +
- " x.testFunction(\"SUCCESS\");\n" +
+ "public class X<T> {\n" +
+ " public static void main(String[] args) {\n" +
+ " X x = new X<>();\n" +
+ " x.testFunction(\"SUCCESS\");\n" +
" }\n" +
" public void testFunction(T param){\n" +
" System.out.println(param);\n" +
- " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " X x = new X<>();\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " x.testFunction(\"SUCCESS\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method testFunction(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " X x = new X<>();\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " x.testFunction(\"SUCCESS\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method testFunction(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
"----------\n");
}
public void test003() {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T> {\n" +
- " public static void main(String[] args) {\n" +
- " new X<>().testFunction(\"SUCCESS\");\n" +
+ "public class X<T> {\n" +
+ " public static void main(String[] args) {\n" +
+ " new X<>().testFunction(\"SUCCESS\");\n" +
" }\n" +
" public void testFunction(T param){\n" +
" System.out.println(param);\n" +
- " }\n" +
+ " }\n" +
"}",
},
"SUCCESS");
@@ -507,27 +507,27 @@ public void test004b() {
"X.java",
"public class X<T> {\n" +
" class X2<U> {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
" new X<>().new X2<>(){\n" +
" void newMethod(){\n" +
" }\n" +
- " };\n" +
+ " };\n" +
" }\n" +
"}",
},
this.complianceLevel < ClassFileConstants.JDK9 ?
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " new X<>().new X2<>(){\n" +
- " ^^\n" +
- "\'<>\' cannot be used with anonymous classes\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " new X<>().new X2<>(){\n" +
+ " ^^\n" +
+ "\'<>\' cannot be used with anonymous classes\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " void newMethod(){\n" +
- " ^^^^^^^^^^^\n" +
- "The method newMethod() of type new X<Object>.X2<Object>(){} must override or implement a supertype method\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " void newMethod(){\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method newMethod() of type new X<Object>.X2<Object>(){} must override or implement a supertype method\n" +
"----------\n");
}
public void test004c() {
@@ -541,12 +541,12 @@ public void test004c() {
" this.f1 = a;" +
" System.out.println(this.f1);\n" +
" }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
" new X<>().new X2<Integer>(){\n" +
" void newMethod(){\n" +
" }\n" +
- " }.setF(1);\n" +
+ " }.setF(1);\n" +
" }\n" +
"}",
},
@@ -561,16 +561,16 @@ public void test006() {
" int abc = 1;\n" +
" public void testFunction(T param){\n" +
" System.out.println(param + \"X1\");\n" +
- " }\n" +
+ " }\n" +
"}\n" +
- "public class X<T> extends X1<T> {\n" +
- " public static void main(String[] args) {\n" +
- " X1<String> x = new X<>();\n" +
- " x.testFunction(\"SUCCESS\");\n" +
+ "public class X<T> extends X1<T> {\n" +
+ " public static void main(String[] args) {\n" +
+ " X1<String> x = new X<>();\n" +
+ " x.testFunction(\"SUCCESS\");\n" +
" }\n" +
" public void testFunction(T param){\n" +
" System.out.println(param);\n" +
- " }\n" +
+ " }\n" +
"}",
},
"SUCCESS");
@@ -585,7 +585,7 @@ public void test007() {
" public X(T param){\n" +
" field1 = param;\n" +
" }\n" +
- " public static void main(String[] args) {\n" +
+ " public static void main(String[] args) {\n" +
" X.testFunction(new X<>(\"hello\").getField());\n" + // prints 1
" X.testFunction(new X(\"hello\").getField());\n" + //prints 2
" }\n" +
@@ -597,10 +597,10 @@ public void test007() {
" }\n" +
" public T getField(){\n" +
" return field1;" +
- " }\n" +
+ " }\n" +
"}",
},
- "1\n" +
+ "1\n" +
"2");
}
public void test007a() {
@@ -617,32 +617,32 @@ public void test007a() {
" public static void testFunction(X<String> param){\n" +
" System.out.println(\"SUCCESS\");\n" +
" }\n" +
- " public static void main(String[] args) {\n" +
- " X.testFunction(new X<>());\n" +
+ " public static void main(String[] args) {\n" +
+ " X.testFunction(new X<>());\n" +
" X.testFunction(new X(\"hello\"));\n" +
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " X.testFunction(new X<>());\n" +
- " ^^^^^^^^^^^^\n" +
- "The method testFunction(X<String>) in the type X is not applicable for the arguments (X<Object>)\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 12)\n" +
- " X.testFunction(new X(\"hello\"));\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Type safety: The constructor X(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 12)\n" +
- " X.testFunction(new X(\"hello\"));\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type X needs unchecked conversion to conform to X<String>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 12)\n" +
- " X.testFunction(new X(\"hello\"));\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " X.testFunction(new X<>());\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The method testFunction(X<String>) in the type X is not applicable for the arguments (X<Object>)\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 12)\n" +
+ " X.testFunction(new X(\"hello\"));\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Type safety: The constructor X(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 12)\n" +
+ " X.testFunction(new X(\"hello\"));\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type X needs unchecked conversion to conform to X<String>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 12)\n" +
+ " X.testFunction(new X(\"hello\"));\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
"----------\n");
} else {
this.runConformTest(
@@ -657,14 +657,14 @@ public void test007a() {
" public static void testFunction(X<String> param){\n" +
" System.out.println(\"SUCCESS\");\n" +
" }\n" +
- " public static void main(String[] args) {\n" +
- " X.testFunction(new X<>());\n" +
+ " public static void main(String[] args) {\n" +
+ " X.testFunction(new X<>());\n" +
" X.testFunction(new X(\"hello\"));\n" +
" }\n" +
"}",
},
- "SUCCESS\n" +
- "hello\n" +
+ "SUCCESS\n" +
+ "hello\n" +
"SUCCESS");
}
}
@@ -678,35 +678,35 @@ public void test008() {
" public X(T param){\n" +
" field1 = param;\n" +
" }\n" +
- " public static void main(String[] args) {\n" +
+ " public static void main(String[] args) {\n" +
" X<?> x1 = new X(1).get(\"\");\n" + // ok - passing String where Object is expected
" X<?> x2 = new X<>(1).get(\"\");\n" + // bad - passing String where Integer is expected
" }\n" +
" public X<T> get(T t){\n" +
" return this;" +
- " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " X<?> x1 = new X(1).get(\"\");\n" +
- " ^^^^^^^^\n" +
- "Type safety: The constructor X(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " X<?> x1 = new X(1).get(\"\");\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method get(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 7)\n" +
- " X<?> x1 = new X(1).get(\"\");\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " X<?> x2 = new X<>(1).get(\"\");\n" +
- " ^^^\n" +
- "The method get(Integer) in the type X<Integer> is not applicable for the arguments (String)\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 7)\n" +
+ " X<?> x1 = new X(1).get(\"\");\n" +
+ " ^^^^^^^^\n" +
+ "Type safety: The constructor X(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " X<?> x1 = new X(1).get(\"\");\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method get(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 7)\n" +
+ " X<?> x1 = new X(1).get(\"\");\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " X<?> x2 = new X<>(1).get(\"\");\n" +
+ " ^^^\n" +
+ "The method get(Integer) in the type X<Integer> is not applicable for the arguments (String)\n" +
"----------\n");
}
@@ -714,15 +714,15 @@ public void test0014() {
this.runConformTest(
new String[] {
"X.java",
- "public class X<J,K> {\n" +
- " public static void main(String[] args) {\n" +
- " X<String,Integer> x = new X<>();\n" +
- " x.testFunction(\"SUCCESS\", 123);\n" +
+ "public class X<J,K> {\n" +
+ " public static void main(String[] args) {\n" +
+ " X<String,Integer> x = new X<>();\n" +
+ " x.testFunction(\"SUCCESS\", 123);\n" +
" }\n" +
" public void testFunction(J param, K param2){\n" +
" System.out.println(param);\n" +
" System.out.println(param2);\n" +
- " }\n" +
+ " }\n" +
"}",
},
"SUCCESS\n" +
@@ -732,22 +732,22 @@ public void test0014a() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X<J,K> {\n" +
- " public static void main(String[] args) {\n" +
- " X<String,Integer> x = new X<>();\n" +
- " x.testFunction(123, \"SUCCESS\");\n" +
+ "public class X<J,K> {\n" +
+ " public static void main(String[] args) {\n" +
+ " X<String,Integer> x = new X<>();\n" +
+ " x.testFunction(123, \"SUCCESS\");\n" +
" }\n" +
" public void testFunction(J param, K param2){\n" +
" System.out.println(param);\n" +
" System.out.println(param2);\n" +
- " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " x.testFunction(123, \"SUCCESS\");\n" +
- " ^^^^^^^^^^^^\n" +
- "The method testFunction(String, Integer) in the type X<String,Integer> is not applicable for the arguments (int, String)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " x.testFunction(123, \"SUCCESS\");\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The method testFunction(String, Integer) in the type X<String,Integer> is not applicable for the arguments (int, String)\n" +
"----------\n");
}
public void test0015() {
@@ -760,10 +760,10 @@ public void test0015() {
" }\n" +
" X (T t) {\n" +
" System.out.println(\"const.2\");\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X<String> x = new X<>();\n" +
- " X<String> x2 = new X<>(\"\");\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X<String> x = new X<>();\n" +
+ " X<String> x2 = new X<>(\"\");\n" +
" }\n" +
"}",
},
@@ -771,7 +771,7 @@ public void test0015() {
}
// To verify that <> cannot be used with explicit type arguments to generic constructor.
public void test0016() {
- this.runNegativeTest(
+ this.runNegativeTest(
new String[] {
"X.java",
"public class X<T> {\n" +
@@ -780,23 +780,23 @@ public void test0016() {
" }\n" +
" <K,J> X (Integer i) {\n" +
" System.out.println(\"const.2\");\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X<String> x = new <String>X<>();\n" +
- " X<String> x2 = new <String, Integer>X<>(1);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X<String> x = new <String>X<>();\n" +
+ " X<String> x2 = new <String, Integer>X<>(1);\n" +
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " X<String> x = new <String>X<>();\n" +
- " ^^^^^^\n" +
- "Explicit type arguments cannot be used with \'<>\' in an allocation expression\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " X<String> x2 = new <String, Integer>X<>(1);\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Explicit type arguments cannot be used with \'<>\' in an allocation expression\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " X<String> x = new <String>X<>();\n" +
+ " ^^^^^^\n" +
+ "Explicit type arguments cannot be used with \'<>\' in an allocation expression\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " X<String> x2 = new <String, Integer>X<>(1);\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Explicit type arguments cannot be used with \'<>\' in an allocation expression\n" +
"----------\n");
}
public void test0016a() {
@@ -809,10 +809,10 @@ public void test0016a() {
" }\n" +
" <K,J> X (Integer i) {\n" +
" System.out.println(\"const.2\");\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X<String> x = new X<>();\n" +
- " X<String> x2 = new X<>(1);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X<String> x = new X<>();\n" +
+ " X<String> x2 = new X<>(1);\n" +
" }\n" +
"}",
},
@@ -831,29 +831,29 @@ public void test0016b() {
" }\n" +
" <K,J> X (Integer i) {\n" +
" System.out.println(\"const.2\");\n" +
- " }\n" +
+ " }\n" +
" public static void main(String[] args) {\n" +
- " X<Integer> test = new <String>X<>();\n" +
- " test.x = new <String>X<>();\n" +
- " test.x2 = new <String, Integer>X<>(1);\n" +
+ " X<Integer> test = new <String>X<>();\n" +
+ " test.x = new <String>X<>();\n" +
+ " test.x2 = new <String, Integer>X<>(1);\n" +
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " X<Integer> test = new <String>X<>();\n" +
- " ^^^^^^\n" +
- "Explicit type arguments cannot be used with \'<>\' in an allocation expression\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " test.x = new <String>X<>();\n" +
- " ^^^^^^\n" +
- "Explicit type arguments cannot be used with \'<>\' in an allocation expression\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 13)\n" +
- " test.x2 = new <String, Integer>X<>(1);\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Explicit type arguments cannot be used with \'<>\' in an allocation expression\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " X<Integer> test = new <String>X<>();\n" +
+ " ^^^^^^\n" +
+ "Explicit type arguments cannot be used with \'<>\' in an allocation expression\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 12)\n" +
+ " test.x = new <String>X<>();\n" +
+ " ^^^^^^\n" +
+ "Explicit type arguments cannot be used with \'<>\' in an allocation expression\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 13)\n" +
+ " test.x2 = new <String, Integer>X<>(1);\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Explicit type arguments cannot be used with \'<>\' in an allocation expression\n" +
"----------\n");
}
//To verify that a parameterized invocation of a generic constructor works even if <> is used
@@ -870,11 +870,11 @@ public void test0016c() {
" }\n" +
" <K,J> X (Integer i) {\n" +
" System.out.println(\"const.2\");\n" +
- " }\n" +
+ " }\n" +
" public static void main(String[] args) {\n" +
- " X<Integer> test = new X<>();\n" +
- " test.x = new X<>();\n" +
- " test.x2 = new X<>(1);\n" +
+ " X<Integer> test = new X<>();\n" +
+ " test.x = new X<>();\n" +
+ " test.x2 = new X<>(1);\n" +
" }\n" +
"}",
},
@@ -891,25 +891,25 @@ public void test0017() {
" }\n" +
" <K,J> X (Integer i) {\n" +
" System.out.println(\"const.2\");\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X<String> x = new X<>(1);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X<String> x = new X<>(1);\n" +
" X<String> x2 = new <String, Integer>X<>(1);\n" +
- " Integer i = 1;\n" +
- " X<String> x3 = new <String, Integer>X<>(i);\n" +
+ " Integer i = 1;\n" +
+ " X<String> x3 = new <String, Integer>X<>(i);\n" +
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " X<String> x2 = new <String, Integer>X<>(1);\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Explicit type arguments cannot be used with \'<>\' in an allocation expression\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " X<String> x3 = new <String, Integer>X<>(i);\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Explicit type arguments cannot be used with \'<>\' in an allocation expression\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " X<String> x2 = new <String, Integer>X<>(1);\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Explicit type arguments cannot be used with \'<>\' in an allocation expression\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 12)\n" +
+ " X<String> x3 = new <String, Integer>X<>(i);\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Explicit type arguments cannot be used with \'<>\' in an allocation expression\n" +
"----------\n"
);
}
@@ -925,12 +925,12 @@ public void test0017a() {
" }\n" +
" <K,J> X (Integer i) {\n" +
" System.out.println(\"const.2\");\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X<String> x = new X<>(1);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X<String> x = new X<>(1);\n" +
" X<String> x2 = new X<>(1);\n" +
- " Integer i = 1;\n" +
- " X<String> x3 = new X<>(i);\n" +
+ " Integer i = 1;\n" +
+ " X<String> x3 = new X<>(i);\n" +
" }\n" +
"}",
},
@@ -947,34 +947,34 @@ public void test0018() {
" }\n" +
" X (T t, Integer i) {\n" +
" System.out.println(\"const.2\");\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X x = new X<>(\"\");\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X x = new X<>(\"\");\n" +
" X x2 = new X<>(\"\",1);\n" +
" }\n" +
"}",
},
"const.1\nconst.2");
}
-// To verify that the correct constructor is found by parameter substitution
+// To verify that the correct constructor is found by parameter substitution
// in the diamond case -- fields
public void test0018b() {
this.runConformTest(
new String[] {
"X.java",
"public class X<T> {\n" +
- " X f1;\n" +
+ " X f1;\n" +
" X f2;\n" +
" X(T t){\n" +
" System.out.println(\"const.1\");\n" +
" }\n" +
" X (T t, Integer i) {\n" +
" System.out.println(\"const.2\");\n" +
- " }\n" +
+ " }\n" +
" public static void main(String[] args) {\n" +
- " X x = new X<>(\"\");\n" +
+ " X x = new X<>(\"\");\n" +
" x.f1 = new X<>(\"\");\n" +
- " x.f2 = new X<>(\"\",1);\n" +
+ " x.f2 = new X<>(\"\",1);\n" +
" }\n" +
"}",
},
@@ -988,11 +988,11 @@ public void test0019() {
" String s = new String<>(\"junk\");\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " String s = new String<>(\"junk\");\n" +
- " ^^^^^^\n" +
- "The type String is not generic; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " String s = new String<>(\"junk\");\n" +
+ " ^^^^^^\n" +
+ "The type String is not generic; it cannot be parameterized with arguments <>\n" +
"----------\n");
}
// check inference at method argument position.
@@ -1007,11 +1007,11 @@ public void test0020() {
" int x = f(new X<>(\"\"));\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//check inference at method argument position.
@@ -1028,11 +1028,11 @@ public void test0021() {
" int x = f(new ArrayList<>());\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " int x = f(new ArrayList<>());\n" +
- " ^\n" +
- "The method f(List<String>) in the type X<T> is not applicable for the arguments (ArrayList<Object>)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " int x = f(new ArrayList<>());\n" +
+ " ^\n" +
+ "The method f(List<String>) in the type X<T> is not applicable for the arguments (ArrayList<Object>)\n" +
"----------\n");
} else {
this.runNegativeTest(
@@ -1087,21 +1087,21 @@ public void test0023() {
" Map<String, Integer> m2 = new IntegerValueHashMap<>();\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " class StringKeyHashMap<V> extends HashMap<String, V> { \n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The serializable class StringKeyHashMap does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " class IntegerValueHashMap<K> extends HashMap<K, Integer> { \n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The serializable class IntegerValueHashMap does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " Map<String, Integer> m1 = new StringKeyHashMap<>(10);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for StringKeyHashMap<>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " class StringKeyHashMap<V> extends HashMap<String, V> { \n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The serializable class StringKeyHashMap does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " class IntegerValueHashMap<K> extends HashMap<K, Integer> { \n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The serializable class IntegerValueHashMap does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " Map<String, Integer> m1 = new StringKeyHashMap<>(10);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for StringKeyHashMap<>\n" +
"----------\n");
}
// check inference at return expression.
@@ -1116,11 +1116,11 @@ public void test0024() {
" X<String> f(List<String> p) {return new X<>();}\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " import java.util.ArrayList;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The import java.util.ArrayList is never used\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " import java.util.ArrayList;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The import java.util.ArrayList is never used\n" +
"----------\n");
}
// check inference at cast expression.
@@ -1135,11 +1135,11 @@ public void test0025() {
" void f(List<String> p) { Object o = (X<String>) new X<>();}\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " void f(List<String> p) { Object o = (X<String>) new X<>();}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot cast from X<Object> to X<String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " void f(List<String> p) { Object o = (X<String>) new X<>();}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot cast from X<Object> to X<String>\n" +
"----------\n");
}
// Test various scenarios.
@@ -1165,33 +1165,33 @@ public void test0026() {
" X<?> x6 = new X<>(list);\n" +
"}\n"
},
- this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " X<Number> x = new X<>(1);\n" +
- " ^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from X<Integer> to X<Number>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " X<Object> x4 = new X<>(1).idem();\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from X<Integer> to X<Object>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 13)\n" +
- " X<Object> x5 = new X<>(1);\n" +
- " ^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from X<Integer> to X<Object>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 15)\n" +
- " int i = m(new X<>(\"\"));\n" +
- " ^\n" +
- "The method m(X<String>) in the type X<T> is not applicable for the arguments (X<Object>)\n" +
+ this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " X<Number> x = new X<>(1);\n" +
+ " ^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from X<Integer> to X<Number>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 12)\n" +
+ " X<Object> x4 = new X<>(1).idem();\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from X<Integer> to X<Object>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 13)\n" +
+ " X<Object> x5 = new X<>(1);\n" +
+ " ^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from X<Integer> to X<Object>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 15)\n" +
+ " int i = m(new X<>(\"\"));\n" +
+ " ^\n" +
+ "The method m(X<String>) in the type X<T> is not applicable for the arguments (X<Object>)\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " X<Object> x4 = new X<>(1).idem();\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from X<Integer> to X<Object>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " X<Object> x4 = new X<>(1).idem();\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from X<Integer> to X<Object>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=344655
@@ -1214,16 +1214,16 @@ public void test0027() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " X<String> x = new <String, Integer> X<>(1);\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Explicit type arguments cannot be used with \'<>\' in an allocation expression\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " X<String> x2 = x.new <String, Integer> Y<>(1);\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Explicit type arguments cannot be used with \'<>\' in an allocation expression\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " X<String> x = new <String, Integer> X<>(1);\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Explicit type arguments cannot be used with \'<>\' in an allocation expression\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 12)\n" +
+ " X<String> x2 = x.new <String, Integer> Y<>(1);\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Explicit type arguments cannot be used with \'<>\' in an allocation expression\n" +
"----------\n"
);
}
@@ -1241,16 +1241,16 @@ public void test0028() {
if (this.complianceLevel < ClassFileConstants.JDK9) {
this.runNegativeTest(
testFiles,
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " X<String> x = new X<> () {}\n" +
- " ^\n" +
- "\'<>\' cannot be used with anonymous classes\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " X<String>.Y<String> y = x.new Y<>() {};\n" +
- " ^\n" +
- "\'<>\' cannot be used with anonymous classes\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " X<String> x = new X<> () {}\n" +
+ " ^\n" +
+ "\'<>\' cannot be used with anonymous classes\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " X<String>.Y<String> y = x.new Y<>() {};\n" +
+ " ^\n" +
+ "\'<>\' cannot be used with anonymous classes\n" +
"----------\n");
} else {
this.runConformTest(testFiles);
@@ -1266,11 +1266,11 @@ public void test0029() {
" X<String> f2 = new X<>(new Y()); \n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " X<String> f2 = new X<>(new Y()); \n" +
- " ^\n" +
- "Y cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " X<String> f2 = new X<>(new Y()); \n" +
+ " ^\n" +
+ "Y cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=345359
@@ -1285,11 +1285,11 @@ public void test0029a() {
" X.I<String> f = new X().new I<>(new Y()); \n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " X.I<String> f = new X().new I<>(new Y()); \n" +
- " ^\n" +
- "Y cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " X.I<String> f = new X().new I<>(new Y()); \n" +
+ " ^\n" +
+ "Y cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=346026
@@ -1304,11 +1304,11 @@ public void test0030() {
" X f = new X<>();\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " X f = new X<>();\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " X f = new X<>();\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=346026
@@ -1355,11 +1355,11 @@ public void test0033() {
" X f2 = getX();\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " X f2 = getX();\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 7)\n" +
+ " X f2 = getX();\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=345559
@@ -1390,43 +1390,43 @@ public void test0034() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " X<Integer> x1 = new X<>(1,1);\n" +
- " ^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for X<>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " X<Integer>.Y<String> y1 = new X<>(1,1).new Y<>();\n" +
- " ^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for X<>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 15)\n" +
- " X<Integer>.Y<String> y2 = new X<>(1,1).new Y<>(1);\n" +
- " ^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for X<>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 16)\n" +
- " X<Integer>.Y<String> y3 = new X<>(1).new Y<>(1);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for Y<>\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 17)\n" +
- " X<Integer>.Y<String> y4 = new X<>(1).new Y<>(\"\",\"\");\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " X<Integer> x1 = new X<>(1,1);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for X<>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " X<Integer>.Y<String> y1 = new X<>(1,1).new Y<>();\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for X<>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 15)\n" +
+ " X<Integer>.Y<String> y2 = new X<>(1,1).new Y<>(1);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for X<>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 16)\n" +
+ " X<Integer>.Y<String> y3 = new X<>(1).new Y<>(1);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for Y<>\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 17)\n" +
+ " X<Integer>.Y<String> y4 = new X<>(1).new Y<>(\"\",\"\");\n" +
" ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for Y<>\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 19)\n" +
- " X<Integer>.Y<String> y6 = new X<>().new Y<>(1,\"\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for Y<>\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 19)\n" +
+ " X<Integer>.Y<String> y6 = new X<>().new Y<>(1,\"\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
"Type mismatch: cannot convert from X<Object>.Y<String> to X<Integer>.Y<String>\n"
:
"Cannot infer type arguments for Y<>\n"
) +
- "----------\n" +
- "7. ERROR in X.java (at line 20)\n" +
- " X<Integer>.Y<String> y7 = new X<>().new Y<>(1,1);\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 20)\n" +
+ " X<Integer>.Y<String> y7 = new X<>().new Y<>(1,1);\n" +
" ^^^^^^^^^^^^^^^^^^^^^^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
"Type mismatch: cannot convert from X<Object>.Y<Integer> to X<Integer>.Y<String>\n"
@@ -1457,11 +1457,11 @@ public void test0034b() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 14)\n" +
- " X<Integer>.Y<String> y4 = new X<>(1).new Y<>(\"\",\"\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for Y<>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 14)\n" +
+ " X<Integer>.Y<String> y4 = new X<>(1).new Y<>(\"\",\"\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for Y<>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=345559
@@ -1498,50 +1498,50 @@ public void test0035() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 14)\n" +
- " X<Integer> x1 = new X<>(1,1);\n" +
- " ^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for X<>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 18)\n" +
- " X<Integer> x5 = new X<>(\"\",\"\",\"\");\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 14)\n" +
+ " X<Integer> x1 = new X<>(1,1);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for X<>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 18)\n" +
+ " X<Integer> x5 = new X<>(\"\",\"\",\"\");\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
"Type mismatch: cannot convert from X<String> to X<Integer>\n"
:
"Cannot infer type arguments for X<>\n"
) +
- "----------\n" +
- "3. ERROR in X.java (at line 20)\n" +
- " X<Integer>.Y<String> y1 = new X<>(1,1).new Y<>();\n" +
- " ^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for X<>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 21)\n" +
- " X<Integer>.Y<String> y2 = new X<>(\"\",1).new Y<>(\"\");\n" +
- " ^^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for X<>\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 22)\n" +
- " X<Integer>.Y<String> y3 = new X<>(1).new Y<>(1);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for Y<>\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 25)\n" +
- " X<Integer>.Y<String> y6 = new X<>().new Y<>(1,\"\",1);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 20)\n" +
+ " X<Integer>.Y<String> y1 = new X<>(1,1).new Y<>();\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for X<>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 21)\n" +
+ " X<Integer>.Y<String> y2 = new X<>(\"\",1).new Y<>(\"\");\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for X<>\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 22)\n" +
+ " X<Integer>.Y<String> y3 = new X<>(1).new Y<>(1);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for Y<>\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 25)\n" +
+ " X<Integer>.Y<String> y6 = new X<>().new Y<>(1,\"\",1);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
"Type mismatch: cannot convert from X<Object>.Y<Integer> to X<Integer>.Y<String>\n"
:
"Cannot infer type arguments for Y<>\n"
) +
- "----------\n" +
- "7. ERROR in X.java (at line 26)\n" +
- " X<Integer>.Y<String> y7 = new X<>().new Y<>(\"\",\"\",1);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 26)\n" +
+ " X<Integer>.Y<String> y7 = new X<>().new Y<>(\"\",\"\",1);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "Type mismatch: cannot convert from X<Object>.Y<Integer> to X<Integer>.Y<String>\n"
+ "Type mismatch: cannot convert from X<Object>.Y<Integer> to X<Integer>.Y<String>\n"
:
"Cannot infer type arguments for Y<>\n"
) +
@@ -1579,50 +1579,50 @@ public void test0036() {
" X<Integer>.Y<String> y7 = new X<>().new Y<>(\"\",\"\",1);\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " X<Integer> x1 = new X<>(1,1);\n" +
- " ^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for X<>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 17)\n" +
- " X<Integer> x5 = new X<>(\"\",\"\",\"\");\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " X<Integer> x1 = new X<>(1,1);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for X<>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 17)\n" +
+ " X<Integer> x5 = new X<>(\"\",\"\",\"\");\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "Type mismatch: cannot convert from X<String> to X<Integer>\n"
+ "Type mismatch: cannot convert from X<String> to X<Integer>\n"
:
"Cannot infer type arguments for X<>\n"
) +
- "----------\n" +
- "3. ERROR in X.java (at line 19)\n" +
- " X<Integer>.Y<String> y1 = new X<>(1,1).new Y<>();\n" +
- " ^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for X<>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 20)\n" +
- " X<Integer>.Y<String> y2 = new X<>(\"\",1).new Y<>(\"\");\n" +
- " ^^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for X<>\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 21)\n" +
- " X<Integer>.Y<String> y3 = new X<>(1).new Y<>(1);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for Y<>\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 24)\n" +
- " X<Integer>.Y<String> y6 = new X<>().new Y<>(1,\"\",1);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 19)\n" +
+ " X<Integer>.Y<String> y1 = new X<>(1,1).new Y<>();\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for X<>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 20)\n" +
+ " X<Integer>.Y<String> y2 = new X<>(\"\",1).new Y<>(\"\");\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for X<>\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 21)\n" +
+ " X<Integer>.Y<String> y3 = new X<>(1).new Y<>(1);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for Y<>\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 24)\n" +
+ " X<Integer>.Y<String> y6 = new X<>().new Y<>(1,\"\",1);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "Type mismatch: cannot convert from X<Object>.Y<Integer> to X<Integer>.Y<String>\n"
+ "Type mismatch: cannot convert from X<Object>.Y<Integer> to X<Integer>.Y<String>\n"
:
"Cannot infer type arguments for Y<>\n"
) +
- "----------\n" +
- "7. ERROR in X.java (at line 25)\n" +
- " X<Integer>.Y<String> y7 = new X<>().new Y<>(\"\",\"\",1);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 25)\n" +
+ " X<Integer>.Y<String> y7 = new X<>().new Y<>(\"\",\"\",1);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "Type mismatch: cannot convert from X<Object>.Y<Integer> to X<Integer>.Y<String>\n"
+ "Type mismatch: cannot convert from X<Object>.Y<Integer> to X<Integer>.Y<String>\n"
:
"Cannot infer type arguments for Y<>\n"
) +
@@ -1646,11 +1646,11 @@ public void test0034a() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " X<Integer> x1 = new X<>(1,1);\n" +
- " ^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for X<>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " X<Integer> x1 = new X<>(1,1);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for X<>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=345559
@@ -1676,17 +1676,17 @@ public void test0035a() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " X<Integer> x1 = new X<>(1,1);\n" +
- " ^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for X<>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " X<Integer> x5 = new X<>(\"\",\"\",\"\");\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " X<Integer> x1 = new X<>(1,1);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for X<>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " X<Integer> x5 = new X<>(\"\",\"\",\"\");\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "Type mismatch: cannot convert from X<String> to X<Integer>\n"
+ "Type mismatch: cannot convert from X<String> to X<Integer>\n"
:
"Cannot infer type arguments for X<>\n"
) +
@@ -1713,17 +1713,17 @@ public void test0036a() {
" X<Integer> x6 = new X<>(\"\",\"\",1);\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " X<Integer> x1 = new X<>(1,1);\n" +
- " ^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for X<>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " X<Integer> x5 = new X<>(\"\",\"\",\"\");\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " X<Integer> x1 = new X<>(1,1);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for X<>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 13)\n" +
+ " X<Integer> x5 = new X<>(\"\",\"\",\"\");\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "Type mismatch: cannot convert from X<String> to X<Integer>\n"
+ "Type mismatch: cannot convert from X<String> to X<Integer>\n"
:
"Cannot infer type arguments for X<>\n"
) +
@@ -1754,26 +1754,26 @@ public void test0037() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 14)\n" +
- " X<Integer>.Y<String> y1 = new X<>().new Y<>(1);\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for Y<>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 15)\n" +
- " X<Integer>.Y<String> y2 = new X<>(1).new Y<>(1);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for Y<>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 16)\n" +
- " X<Integer>.Y<String> y3 = new X<>(\"\",\"\",1).new Y<>(1);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for Y<>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 17)\n" +
- " X<Integer>.Y<String> y4 = new X<>(1,\"\").new Y<>(1,\"\");\n" +
- " ^^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for X<>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 14)\n" +
+ " X<Integer>.Y<String> y1 = new X<>().new Y<>(1);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for Y<>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 15)\n" +
+ " X<Integer>.Y<String> y2 = new X<>(1).new Y<>(1);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for Y<>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 16)\n" +
+ " X<Integer>.Y<String> y3 = new X<>(\"\",\"\",1).new Y<>(1);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for Y<>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 17)\n" +
+ " X<Integer>.Y<String> y4 = new X<>(1,\"\").new Y<>(1,\"\");\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for X<>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=341795
@@ -1810,7 +1810,7 @@ public void test0039() {
" private static <T extends Comparable<?> & Serializable> T createObject() {\n" +
" return null;\n" +
" }\n" +
- "}\n"
+ "}\n"
},
"");
}
@@ -1860,10 +1860,10 @@ public void test0044() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " X<String>.Y<String> x = new X<>().new Y<>(\"\",\"\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " X<String>.Y<String> x = new X<>().new Y<>(\"\",\"\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
"Type mismatch: cannot convert from X<Object>.Y<String> to X<String>.Y<String>\n"
:
@@ -1938,16 +1938,16 @@ public void test0048() {
" Zork z;\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " <T> X(T t) {\n" +
- " ^\n" +
- "The type parameter T is hiding the type T\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " <T> X(T t) {\n" +
+ " ^\n" +
+ "The type parameter T is hiding the type T\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=345968
@@ -2009,8 +2009,8 @@ public void test0051() {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=340747
public void test0052() {
Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
- customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
+ customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
+ customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
"X.java",
@@ -2030,73 +2030,73 @@ public void test0052() {
"class AX<T>{}\n"
},
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " X<String> x2 = new X<String>(\"SUCCESS\");\n" +
- " ^\n" +
- "Redundant specification of type arguments <String>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " X<Integer> x3 = new X<Integer>(1);\n" +
- " ^\n" +
- "Redundant specification of type arguments <Integer>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " X<AX> x4 = new X<AX>(new AX());\n" +
- " ^\n" +
- "Redundant specification of type arguments <AX>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " X<? extends AX> x5 = new X<AX<String>>(new AX<String>());\n" +
- " ^\n" +
- "Redundant specification of type arguments <AX<String>>\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 10)\n" +
- " X<?> x6 = new X<AX<String>>(new AX<String>());\n" +
- " ^\n" +
- "Redundant specification of type arguments <AX<String>>\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 11)\n" +
- " X<Class<? extends Object>> x7 = new X<Class<? extends Object>>();\n" +
- " ^\n" +
- "Redundant specification of type arguments <Class<? extends Object>>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " X<String> x2 = new X<String>(\"SUCCESS\");\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <String>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " X<Integer> x3 = new X<Integer>(1);\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <Integer>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " X<AX> x4 = new X<AX>(new AX());\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <AX>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 9)\n" +
+ " X<? extends AX> x5 = new X<AX<String>>(new AX<String>());\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <AX<String>>\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 10)\n" +
+ " X<?> x6 = new X<AX<String>>(new AX<String>());\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <AX<String>>\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 11)\n" +
+ " X<Class<? extends Object>> x7 = new X<Class<? extends Object>>();\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <Class<? extends Object>>\n" +
"----------\n"
: // additional error at line 5 due to better inference:
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " X<Number> x = new X<Number>(1);\n" +
- " ^\n" +
- "Redundant specification of type arguments <Number>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " X<String> x2 = new X<String>(\"SUCCESS\");\n" +
- " ^\n" +
- "Redundant specification of type arguments <String>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " X<Integer> x3 = new X<Integer>(1);\n" +
- " ^\n" +
- "Redundant specification of type arguments <Integer>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " X<AX> x4 = new X<AX>(new AX());\n" +
- " ^\n" +
- "Redundant specification of type arguments <AX>\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 9)\n" +
- " X<? extends AX> x5 = new X<AX<String>>(new AX<String>());\n" +
- " ^\n" +
- "Redundant specification of type arguments <AX<String>>\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 10)\n" +
- " X<?> x6 = new X<AX<String>>(new AX<String>());\n" +
- " ^\n" +
- "Redundant specification of type arguments <AX<String>>\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 11)\n" +
- " X<Class<? extends Object>> x7 = new X<Class<? extends Object>>();\n" +
- " ^\n" +
- "Redundant specification of type arguments <Class<? extends Object>>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " X<Number> x = new X<Number>(1);\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <Number>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " X<String> x2 = new X<String>(\"SUCCESS\");\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <String>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " X<Integer> x3 = new X<Integer>(1);\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <Integer>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " X<AX> x4 = new X<AX>(new AX());\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <AX>\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 9)\n" +
+ " X<? extends AX> x5 = new X<AX<String>>(new AX<String>());\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <AX<String>>\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 10)\n" +
+ " X<?> x6 = new X<AX<String>>(new AX<String>());\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <AX<String>>\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 11)\n" +
+ " X<Class<? extends Object>> x7 = new X<Class<? extends Object>>();\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <Class<? extends Object>>\n" +
"----------\n"
),
null,
@@ -2106,8 +2106,8 @@ public void test0052() {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=340747
public void test0052b() {
Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
- customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
+ customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
+ customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
"X.java",
@@ -2130,53 +2130,53 @@ public void test0052b() {
"}\n"
},
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " X<String> x2 = new X<String>(\"SUCCESS\");\n" +
- " ^\n" +
- "Redundant specification of type arguments <String>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " X<String> x22 = new X<String>(1,\"SUCCESS\");\n" +
- " ^\n" +
- "Redundant specification of type arguments <String>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " X<Integer> x3 = new X<Integer>(1);\n" +
- " ^\n" +
- "Redundant specification of type arguments <Integer>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 11)\n" +
- " String s = foo(new X<String>(\"aaa\"));\n" +
- " ^\n" +
- "Redundant specification of type arguments <String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " X<String> x2 = new X<String>(\"SUCCESS\");\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <String>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " X<String> x22 = new X<String>(1,\"SUCCESS\");\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <String>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 10)\n" +
+ " X<Integer> x3 = new X<Integer>(1);\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <Integer>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 11)\n" +
+ " String s = foo(new X<String>(\"aaa\"));\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <String>\n" +
"----------\n"
: // additional error at line 7 due to better inference
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " X<Number> x = new X<Number>(1);\n" +
- " ^\n" +
- "Redundant specification of type arguments <Number>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " X<String> x2 = new X<String>(\"SUCCESS\");\n" +
- " ^\n" +
- "Redundant specification of type arguments <String>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " X<String> x22 = new X<String>(1,\"SUCCESS\");\n" +
- " ^\n" +
- "Redundant specification of type arguments <String>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " X<Integer> x3 = new X<Integer>(1);\n" +
- " ^\n" +
- "Redundant specification of type arguments <Integer>\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 11)\n" +
- " String s = foo(new X<String>(\"aaa\"));\n" +
- " ^\n" +
- "Redundant specification of type arguments <String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " X<Number> x = new X<Number>(1);\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <Number>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " X<String> x2 = new X<String>(\"SUCCESS\");\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <String>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 9)\n" +
+ " X<String> x22 = new X<String>(1,\"SUCCESS\");\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <String>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 10)\n" +
+ " X<Integer> x3 = new X<Integer>(1);\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <Integer>\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 11)\n" +
+ " String s = foo(new X<String>(\"aaa\"));\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <String>\n" +
"----------\n"
),
null,
@@ -2186,8 +2186,8 @@ public void test0052b() {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=340747
public void test0052c() {
Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
- customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
+ customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
+ customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
"X.java",
@@ -2203,16 +2203,16 @@ public void test0052c() {
" void foo3(X<Integer> x) {}\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " X<Integer> x = new X<Integer>(\"\",\"\");\n" +
- " ^\n" +
- "Redundant specification of type arguments <Integer>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " return new X<Integer>(\"\",\"\");\n" +
- " ^\n" +
- "Redundant specification of type arguments <Integer>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " X<Integer> x = new X<Integer>(\"\",\"\");\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <Integer>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " return new X<Integer>(\"\",\"\");\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <Integer>\n" +
"----------\n",
null,
false,
@@ -2221,8 +2221,8 @@ public void test0052c() {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=340747
public void test0052d() {
Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
- customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
+ customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
+ customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
"X.java",
@@ -2236,12 +2236,12 @@ public void test0052d() {
"class AX<T>{}\n"
},
this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "" :
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " X<Number> x = new X<Number>(1);\n" +
- " ^\n" +
- "Redundant specification of type arguments <Number>\n" +
+ "" :
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " X<Number> x = new X<Number>(1);\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <Number>\n" +
"----------\n",
null,
false,
@@ -2250,8 +2250,8 @@ public void test0052d() {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=340747
public void test0053() {
Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
- customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
+ customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
+ customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
"Z.java",
@@ -2265,11 +2265,11 @@ public void test0053() {
"class ZB {\n" +
"}"
},
- "----------\n" +
- "1. ERROR in Z.java (at line 3)\n" +
- " foo(new Z<ZB>());\n" +
- " ^\n" +
- "Redundant specification of type arguments <ZB>\n" +
+ "----------\n" +
+ "1. ERROR in Z.java (at line 3)\n" +
+ " foo(new Z<ZB>());\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <ZB>\n" +
"----------\n",
null,
false,
@@ -2278,8 +2278,8 @@ public void test0053() {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=340747
public void test0054() {
Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
- customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
+ customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
+ customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
"Y.java",
@@ -2290,11 +2290,11 @@ public void test0054() {
"}\n" +
"class ABC{}\n"
},
- "----------\n" +
- "1. ERROR in Y.java (at line 3)\n" +
- " return new Y<W>();\n" +
- " ^\n" +
- "Redundant specification of type arguments <W>\n" +
+ "----------\n" +
+ "1. ERROR in Y.java (at line 3)\n" +
+ " return new Y<W>();\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <W>\n" +
"----------\n",
null,
false,
@@ -2303,8 +2303,8 @@ public void test0054() {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=340747
public void test0055() {
Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
- customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
+ customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
+ customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
"X.java",
@@ -2323,36 +2323,36 @@ public void test0055() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " X<String>.Inner<Integer> a= new X<String>().new Inner<Integer>();\n" +
- " ^^^^^\n" +
- "Redundant specification of type arguments <Integer>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " Inner<Integer> b= new X<A>().new Inner<Integer>();\n" +
- " ^^^^^\n" +
- "Redundant specification of type arguments <Integer>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " Inner<Integer> c= new Inner<Integer>();\n" +
- " ^^^^^\n" +
- "Redundant specification of type arguments <Integer>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " X<A>.Inner<Integer> e= new X<A>().new Inner<Integer>();\n" +
- " ^^^^^\n" +
- "Redundant specification of type arguments <Integer>\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 11)\n" +
- " X<A>.Inner<Integer> f= new Inner<Integer>();\n" +
- " ^^^^^\n" +
- "Redundant specification of type arguments <Integer>\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 12)\n" +
- " X.Inner2<Integer> d3 = new X.Inner2<Integer>();\n" +
- " ^^^^^^\n" +
- "Redundant specification of type arguments <Integer>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " X<String>.Inner<Integer> a= new X<String>().new Inner<Integer>();\n" +
+ " ^^^^^\n" +
+ "Redundant specification of type arguments <Integer>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " Inner<Integer> b= new X<A>().new Inner<Integer>();\n" +
+ " ^^^^^\n" +
+ "Redundant specification of type arguments <Integer>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 9)\n" +
+ " Inner<Integer> c= new Inner<Integer>();\n" +
+ " ^^^^^\n" +
+ "Redundant specification of type arguments <Integer>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 10)\n" +
+ " X<A>.Inner<Integer> e= new X<A>().new Inner<Integer>();\n" +
+ " ^^^^^\n" +
+ "Redundant specification of type arguments <Integer>\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 11)\n" +
+ " X<A>.Inner<Integer> f= new Inner<Integer>();\n" +
+ " ^^^^^\n" +
+ "Redundant specification of type arguments <Integer>\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 12)\n" +
+ " X.Inner2<Integer> d3 = new X.Inner2<Integer>();\n" +
+ " ^^^^^^\n" +
+ "Redundant specification of type arguments <Integer>\n" +
"----------\n",
null,
false,
@@ -2362,8 +2362,8 @@ public void test0055() {
// qualified allocation
public void test0056() {
Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
- customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
+ customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
+ customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
"X.java",
@@ -2377,26 +2377,26 @@ public void test0056() {
" class Item <E> {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " X<String>.Item<Thread> i = new X<Exception>().new Item<Thread>();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from X<Exception>.Item<Thread> to X<String>.Item<Thread>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " X<String>.Item<Thread> i = new X<Exception>().new Item<Thread>();\n" +
- " ^^^^\n" +
- "Redundant specification of type arguments <Thread>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " X<Exception>.Item<Thread> j = new X<Exception>.Item<Thread>();\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Cannot allocate the member type X<Exception>.Item<Thread> using a parameterized compound name; use its simple name and an enclosing instance of type X<Exception>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " X<Exception>.Item<Thread> j = new X<Exception>.Item<Thread>();\n" +
- " ^^^^\n" +
- "Redundant specification of type arguments <Thread>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " X<String>.Item<Thread> i = new X<Exception>().new Item<Thread>();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from X<Exception>.Item<Thread> to X<String>.Item<Thread>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " X<String>.Item<Thread> i = new X<Exception>().new Item<Thread>();\n" +
+ " ^^^^\n" +
+ "Redundant specification of type arguments <Thread>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " X<Exception>.Item<Thread> j = new X<Exception>.Item<Thread>();\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Cannot allocate the member type X<Exception>.Item<Thread> using a parameterized compound name; use its simple name and an enclosing instance of type X<Exception>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " X<Exception>.Item<Thread> j = new X<Exception>.Item<Thread>();\n" +
+ " ^^^^\n" +
+ "Redundant specification of type arguments <Thread>\n" +
"----------\n",
null,
false,
@@ -2406,8 +2406,8 @@ public void test0056() {
// qualified allocation
public void test0056b() {
Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
- customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
+ customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
+ customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
"X.java",
@@ -2420,23 +2420,23 @@ public void test0056b() {
"}\n"
},
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " X1<Integer> x1 = new X.X1<Integer>(1);\n" +
- " ^^\n" +
- "Redundant specification of type arguments <Integer>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " X1<Integer> x1 = new X.X1<Integer>(1);\n" +
+ " ^^\n" +
+ "Redundant specification of type arguments <Integer>\n" +
"----------\n"
: // additional error at line 6 due to better inference:
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " X1<Integer> x1 = new X.X1<Integer>(1);\n" +
- " ^^\n" +
- "Redundant specification of type arguments <Integer>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " X1<Number> x2 = new X.X1<Number>(1);\n" +
- " ^^\n" +
- "Redundant specification of type arguments <Number>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " X1<Integer> x1 = new X.X1<Integer>(1);\n" +
+ " ^^\n" +
+ "Redundant specification of type arguments <Integer>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " X1<Number> x2 = new X.X1<Number>(1);\n" +
+ " ^^\n" +
+ "Redundant specification of type arguments <Number>\n" +
"----------\n"
),
null,
@@ -2447,8 +2447,8 @@ public void test0056b() {
// qualified allocation
public void test0056c() {
Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
- customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
+ customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
+ customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
"X.java",
@@ -2461,23 +2461,23 @@ public void test0056c() {
"}\n"
},
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " X<Integer>.X1<Number> x1 = new X<Integer>(1).new X1<Number>(1);\n" +
- " ^\n" +
- "Redundant specification of type arguments <Integer>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " X<Integer>.X1<Number> x1 = new X<Integer>(1).new X1<Number>(1);\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <Integer>\n" +
"----------\n"
: // additional error (2.) at inner allocation due to better inference:
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " X<Integer>.X1<Number> x1 = new X<Integer>(1).new X1<Number>(1);\n" +
- " ^\n" +
- "Redundant specification of type arguments <Integer>\n" +
"----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " X<Integer>.X1<Number> x1 = new X<Integer>(1).new X1<Number>(1);\n" +
- " ^^\n" +
- "Redundant specification of type arguments <Number>\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " X<Integer>.X1<Number> x1 = new X<Integer>(1).new X1<Number>(1);\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <Integer>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " X<Integer>.X1<Number> x1 = new X<Integer>(1).new X1<Number>(1);\n" +
+ " ^^\n" +
+ "Redundant specification of type arguments <Number>\n" +
"----------\n"
),
null,
@@ -2487,8 +2487,8 @@ public void test0056c() {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=340747
public void test0057() {
Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
- customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
+ customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
+ customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
"X.java",
@@ -2502,11 +2502,11 @@ public void test0057() {
"class InvertedPair<A, B> extends Pair<B, A> {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Pair<Double, Integer> p = new InvertedPair<Integer, Double>();\n" +
- " ^^^^^^^^^^^^\n" +
- "Redundant specification of type arguments <Integer, Double>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " Pair<Double, Integer> p = new InvertedPair<Integer, Double>();\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Redundant specification of type arguments <Integer, Double>\n" +
"----------\n",
null,
false,
@@ -2515,8 +2515,8 @@ public void test0057() {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=340747
public void test0058() {
Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
- customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
+ customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
+ customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
"X.java",
@@ -2531,11 +2531,11 @@ public void test0058() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " : new ArrayList<Object>();\n" +
- " ^^^^^^^^^\n" +
- "Redundant specification of type arguments <Object>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " : new ArrayList<Object>();\n" +
+ " ^^^^^^^^^\n" +
+ "Redundant specification of type arguments <Object>\n" +
"----------\n",
null,
false,
@@ -2544,8 +2544,8 @@ public void test0058() {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=340747
public void test0059() {
Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
- customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
+ customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
+ customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
"X.java",
@@ -2578,16 +2578,16 @@ public void test0060() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " new ArrayList<>();\n" +
- " ^^^^^^^^^\n" +
- "\'<>\' operator is not allowed for source level below 1.7\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " new ArrayList<>();\n" +
- " ^^^^^^^^^\n" +
- "Incorrect number of arguments for type ArrayList<E>; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " new ArrayList<>();\n" +
+ " ^^^^^^^^^\n" +
+ "\'<>\' operator is not allowed for source level below 1.7\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " new ArrayList<>();\n" +
+ " ^^^^^^^^^\n" +
+ "Incorrect number of arguments for type ArrayList<E>; it cannot be parameterized with arguments <>\n" +
"----------\n",
null,
false,
@@ -2596,7 +2596,7 @@ public void test0060() {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=351965
public void test0060a() {
Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4);
+ customOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4);
this.runNegativeTest(
new String[] {
"X.java",
@@ -2607,16 +2607,16 @@ public void test0060a() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " new java.util.ArrayList<>();\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "\'<>\' operator is not allowed for source level below 1.7\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " new java.util.ArrayList<>();\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Incorrect number of arguments for type ArrayList<E>; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " new java.util.ArrayList<>();\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "\'<>\' operator is not allowed for source level below 1.7\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " new java.util.ArrayList<>();\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Incorrect number of arguments for type ArrayList<E>; it cannot be parameterized with arguments <>\n" +
"----------\n",
null,
false,
@@ -2638,27 +2638,27 @@ public void test0061() {
"}\n"
},
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " FileSystems.<String, Object>newFileSystem(uri, Collections.emptyMap());\n" +
- " ^^^^^^^^^^^^^\n" +
- "The method newFileSystem(URI, Map<String,?>) in the type FileSystems is not applicable for the arguments (URI, Map<Object,Object>)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " FileSystems.<String, Object>newFileSystem(uri, Collections.emptyMap());\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The method newFileSystem(URI, Map<String,?>) in the type FileSystems is not applicable for the arguments (URI, Map<Object,Object>)\n" +
"----------\n"
: // with better inference, method is applicable, but then we have another problem:
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " FileSystems.<String, Object>newFileSystem(uri, Collections.emptyMap());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type IOException\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " FileSystems.<String, Object>newFileSystem(uri, Collections.emptyMap());\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Unused type arguments for the non generic method newFileSystem(URI, Map<String,?>) of type FileSystems; it should not be parameterized with arguments <String, Object>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " FileSystems.<String, Object>newFileSystem(uri, Collections.emptyMap());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type IOException\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " FileSystems.<String, Object>newFileSystem(uri, Collections.emptyMap());\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Unused type arguments for the non generic method newFileSystem(URI, Map<String,?>) of type FileSystems; it should not be parameterized with arguments <String, Object>\n" +
"----------\n"
));
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428220, [1.8][compiler] Javadoc processing interferes with type inference.
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428220, [1.8][compiler] Javadoc processing interferes with type inference.
public void test428220() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.ENABLED);
@@ -2677,14 +2677,14 @@ public void test428220() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class HashMap<K, V> {\n" +
- " ^^^^^^^\n" +
- "The public type HashMap must be defined in its own file\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class HashMap<K, V> {\n" +
+ " ^^^^^^^\n" +
+ "The public type HashMap must be defined in its own file\n" +
"----------\n", null, true, customOptions);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428220, [1.8][compiler] Javadoc processing interferes with type inference.
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428220, [1.8][compiler] Javadoc processing interferes with type inference.
public void test428220a() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_Store_Annotations, CompilerOptions.ENABLED);
@@ -2703,14 +2703,14 @@ public void test428220a() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class HashMap<K, V> {\n" +
- " ^^^^^^^\n" +
- "The public type HashMap must be defined in its own file\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class HashMap<K, V> {\n" +
+ " ^^^^^^^\n" +
+ "The public type HashMap must be defined in its own file\n" +
"----------\n", null, true, customOptions);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=442929, [1.8][compiler] ClassCastException during runtime where is no cast
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=442929, [1.8][compiler] ClassCastException during runtime where is no cast
public void test442929() {
this.runConformTest(
new String[] {
@@ -2749,10 +2749,10 @@ public void test442929() {
},
"Expected CCE");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=448028, [1.8] 1.8 cannot infer type arguments where 1.7 does
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=448028, [1.8] 1.8 cannot infer type arguments where 1.7 does
public void test448028() {
Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
+ customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
this.runNegativeTest(
new String[] {
"X.java",
@@ -2820,15 +2820,15 @@ public void test448028() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 34)\n" +
- " return inspect(new W<C>(c, o)); // - WARNING: Redundant specification of type arguments <F.C> F.java\n" +
- " ^\n" +
- "Redundant specification of type arguments <X.C>\n" +
- "----------\n",
+ "----------\n" +
+ "1. ERROR in X.java (at line 34)\n" +
+ " return inspect(new W<C>(c, o)); // - WARNING: Redundant specification of type arguments <F.C> F.java\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <X.C>\n" +
+ "----------\n",
null, false, customOptions);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449619, [1.8][compiler] Qualified <> allocation fails to compile.
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449619, [1.8][compiler] Qualified <> allocation fails to compile.
public void test449619() {
String source = "public class X {\n" +
" public class Y<T> {\n" +
@@ -2846,17 +2846,17 @@ public void test449619() {
source,
},
"");
- else
+ else
this.runNegativeTest(
new String[] {
"X.java",
source,
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " foo(new X().new Y<>());\n" +
- " ^^^\n" +
- "The method foo(X.Y<String>) in the type X is not applicable for the arguments (X.Y<Object>)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " foo(new X().new Y<>());\n" +
+ " ^^^\n" +
+ "The method foo(X.Y<String>) in the type X is not applicable for the arguments (X.Y<Object>)\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429733, [1.8][bytecode] Bad type on operand stack
@@ -2914,24 +2914,24 @@ public void test375394a() {
"class B <T, U extends C<T>, V extends U>{}\n" +
"class C<T> {}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " B<C, ? extends C<C>, ? extends C<C>> b = new B<>();\n" +
- " ^\n" +
- "C is a raw type. References to generic type C<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 2)\n" +
- " B<C, ? extends C<C>, ? extends C<C>> b = new B<>();\n" +
- " ^\n" +
- "C is a raw type. References to generic type C<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 2)\n" +
- " B<C, ? extends C<C>, ? extends C<C>> b = new B<>();\n" +
- " ^\n" +
- "C is a raw type. References to generic type C<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " B<C, ? extends C<C>, ? extends C<C>> b = new B<>();\n" +
+ " ^\n" +
+ "C is a raw type. References to generic type C<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 2)\n" +
+ " B<C, ? extends C<C>, ? extends C<C>> b = new B<>();\n" +
+ " ^\n" +
+ "C is a raw type. References to generic type C<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 2)\n" +
+ " B<C, ? extends C<C>, ? extends C<C>> b = new B<>();\n" +
+ " ^\n" +
+ "C is a raw type. References to generic type C<T> should be parameterized\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427728, [1.8] Type Inference rejects calls requiring boxing/unboxing
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427728, [1.8] Type Inference rejects calls requiring boxing/unboxing
public void test427728b() {
runConformTest(
new String[] {
@@ -2959,81 +2959,81 @@ public void testBug456508() {
runNegativeTest(
new String[] {
"QueryAtom.java",
- "public class QueryAtom<T, P> {\n" +
- " public QueryAtom(SingularAttribute<? super T, P> path) {\n" +
- " }\n" +
+ "public class QueryAtom<T, P> {\n" +
+ " public QueryAtom(SingularAttribute<? super T, P> path) {\n" +
+ " }\n" +
"}\n",
"SubqueryIn.java",
- "public class SubqueryIn<S, P> {\n" +
- " public SubqueryIn(QueryAtom<S, P>... subqueryAtoms) {\n" +
- " }\n" +
+ "public class SubqueryIn<S, P> {\n" +
+ " public SubqueryIn(QueryAtom<S, P>... subqueryAtoms) {\n" +
+ " }\n" +
"}\n",
"Test.java",
- "class PAccount {}\n" +
- "class PGroepAccount {}\n" +
- "interface SingularAttribute<X, T> {}\n" +
- "\n" +
- "public class Test {\n" +
- " public static volatile SingularAttribute<PGroepAccount, PAccount> account;\n" +
- "\n" +
- " public void nietInGroep() {\n" +
- " recordFilter(new SubqueryIn<>(new QueryAtom<>(account)));\n" +
- " }\n" +
- "\n" +
- " protected <P> void recordFilter(SubqueryIn<?, P> atom) {\n" +
- " }\n" +
+ "class PAccount {}\n" +
+ "class PGroepAccount {}\n" +
+ "interface SingularAttribute<X, T> {}\n" +
+ "\n" +
+ "public class Test {\n" +
+ " public static volatile SingularAttribute<PGroepAccount, PAccount> account;\n" +
+ "\n" +
+ " public void nietInGroep() {\n" +
+ " recordFilter(new SubqueryIn<>(new QueryAtom<>(account)));\n" +
+ " }\n" +
+ "\n" +
+ " protected <P> void recordFilter(SubqueryIn<?, P> atom) {\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in SubqueryIn.java (at line 2)\n" +
- " public SubqueryIn(QueryAtom<S, P>... subqueryAtoms) {\n" +
- " ^^^^^^^^^^^^^\n" +
- "Type safety: Potential heap pollution via varargs parameter subqueryAtoms\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in Test.java (at line 9)\n" +
- " recordFilter(new SubqueryIn<>(new QueryAtom<>(account)));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: A generic array of QueryAtom<PGroepAccount,PAccount> is created for a varargs parameter\n" +
+ "----------\n" +
+ "1. WARNING in SubqueryIn.java (at line 2)\n" +
+ " public SubqueryIn(QueryAtom<S, P>... subqueryAtoms) {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter subqueryAtoms\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in Test.java (at line 9)\n" +
+ " recordFilter(new SubqueryIn<>(new QueryAtom<>(account)));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: A generic array of QueryAtom<PGroepAccount,PAccount> is created for a varargs parameter\n" +
"----------\n");
}
public void testBug462083() {
runConformTest(
new String[] {
"Java8InterfaceTest.java",
- "public abstract class Java8InterfaceTest\n" +
- "{\n" +
- " public static interface Entity {}\n" +
- "\n" +
- " public static interface Service<T1 extends Entity> {}\n" +
- "\n" +
- " public static interface ServiceLocator<T2 extends Entity> {}\n" +
- "\n" +
- " public static class ConcreteClass<T3 extends Entity, S extends Service<T3>> implements ServiceLocator<T3> {}\n" +
- "\n" +
- " protected abstract <T4 extends Entity> ConcreteClass<T4, ?> getParameterized(T4 entity);\n" +
- "\n" +
- " protected <T5 extends Entity> ServiceLocator<T5> getInterface(T5 entity)\n" +
- " {\n" +
- " return getParameterized(entity);\n" +
- " }\n" +
+ "public abstract class Java8InterfaceTest\n" +
+ "{\n" +
+ " public static interface Entity {}\n" +
+ "\n" +
+ " public static interface Service<T1 extends Entity> {}\n" +
+ "\n" +
+ " public static interface ServiceLocator<T2 extends Entity> {}\n" +
+ "\n" +
+ " public static class ConcreteClass<T3 extends Entity, S extends Service<T3>> implements ServiceLocator<T3> {}\n" +
+ "\n" +
+ " protected abstract <T4 extends Entity> ConcreteClass<T4, ?> getParameterized(T4 entity);\n" +
+ "\n" +
+ " protected <T5 extends Entity> ServiceLocator<T5> getInterface(T5 entity)\n" +
+ " {\n" +
+ " return getParameterized(entity);\n" +
+ " }\n" +
"}\n"
});
}
public void testBug469653() {
String codeContent =
- "import java.util.*;\n" +
+ "import java.util.*;\n" +
"\n" +
"class ImmutableList<E> {\n" +
" static <F> ImmutableList<F> copyOf(Iterable<? extends F> in) { return null; }\n" +
" ImmutableList<E> reverse() { return this; }\n" +
" Iterator<E> iterator() { return null; }\n" +
- "}\n" +
- "public class Code {\n" +
- " public static void test() {\n" +
- " Iterable<? extends String> services = null;\n" +
- " Iterator<String> reverseServices = ImmutableList.copyOf(services).reverse().iterator();\n" +
- " }\n" +
+ "}\n" +
+ "public class Code {\n" +
+ " public static void test() {\n" +
+ " Iterable<? extends String> services = null;\n" +
+ " Iterator<String> reverseServices = ImmutableList.copyOf(services).reverse().iterator();\n" +
+ " }\n" +
"}";
if (this.complianceLevel < ClassFileConstants.JDK1_8) {
runConformTest(
@@ -3041,11 +3041,11 @@ public void testBug469653() {
} else {
runNegativeTest(
new String[] { "Code.java", codeContent },
- "----------\n" +
- "1. ERROR in Code.java (at line 11)\n" +
- " Iterator<String> reverseServices = ImmutableList.copyOf(services).reverse().iterator();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Iterator<capture#1-of ? extends String> to Iterator<String>\n" +
+ "----------\n" +
+ "1. ERROR in Code.java (at line 11)\n" +
+ " Iterator<String> reverseServices = ImmutableList.copyOf(services).reverse().iterator();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Iterator<capture#1-of ? extends String> to Iterator<String>\n" +
"----------\n");
}
}
@@ -3054,17 +3054,17 @@ public void testBug488649_JDK6791481_ex1() {
runNegativeTest(
new String[] {
"Test.java",
- "class Test<X> {\n" +
- " X m(Class<X> c) {return null;}\n" +
- " X x = m((Class)String.class);\n" +
+ "class Test<X> {\n" +
+ " X m(Class<X> c) {return null;}\n" +
+ " X x = m((Class)String.class);\n" +
"}\n"
},
- "----------\n" +
+ "----------\n" +
(this.complianceLevel >= ClassFileConstants.JDK1_8
?
- (count++)+". ERROR in Test.java (at line 3)\n" +
- " X x = m((Class)String.class);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ (count++)+". ERROR in Test.java (at line 3)\n" +
+ " X x = m((Class)String.class);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
"Type mismatch: cannot convert from Object to X\n" + // <- want to see this error, but at 1.7- we keep javac compatibility
"----------\n"
:
@@ -3072,13 +3072,13 @@ public void testBug488649_JDK6791481_ex1() {
)+
(count++)+". WARNING in Test.java (at line 3)\n" +
" X x = m((Class)String.class);\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Class needs unchecked conversion to conform to Class<X>\n" +
- "----------\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Class needs unchecked conversion to conform to Class<X>\n" +
+ "----------\n" +
(count++)+". WARNING in Test.java (at line 3)\n" +
- " X x = m((Class)String.class);\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ " X x = m((Class)String.class);\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
"----------\n");
}
public static Class testClass() {
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java
index ee051f54b..48d5e1f3b 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Stephan Herrmann - initial API and implementation
* IBM Corporation - additional tests
@@ -45,36 +45,36 @@ public void testBug423070() {
this.runConformTest(
new String[] {
"junk/Junk3.java",
- "package junk;\n" +
- "\n" +
- "import java.util.ArrayList;\n" +
- "import java.util.Collections;\n" +
- "import java.util.List;\n" +
- "\n" +
- "class ZZObject extends Object {\n" +
- "}\n" +
- "\n" +
- "public class Junk3 {\n" +
- "\n" +
- " public static final List EMPTY_LIST = new ArrayList<>();\n" +
- " public static final <T> List<T> emptyList() {\n" +
- " return (List<T>) EMPTY_LIST;\n" +
- " }\n" +
- " \n" +
- " public Junk3(List<ZZObject> list) {\n" +
- " }\n" +
- " \n" +
- " //FAILS - if passed as argument\n" +
- " public Junk3() {\n" +
- " this(emptyList());\n" +
- " }\n" +
- " \n" +
- "\n" +
- " //WORKS - if you assign it (and lose type info?)\n" +
- " static List works = emptyList();\n" +
- " public Junk3(boolean bogus) {\n" +
- " this(works);\n" +
- " }\n" +
+ "package junk;\n" +
+ "\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.Collections;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "class ZZObject extends Object {\n" +
+ "}\n" +
+ "\n" +
+ "public class Junk3 {\n" +
+ "\n" +
+ " public static final List EMPTY_LIST = new ArrayList<>();\n" +
+ " public static final <T> List<T> emptyList() {\n" +
+ " return (List<T>) EMPTY_LIST;\n" +
+ " }\n" +
+ " \n" +
+ " public Junk3(List<ZZObject> list) {\n" +
+ " }\n" +
+ " \n" +
+ " //FAILS - if passed as argument\n" +
+ " public Junk3() {\n" +
+ " this(emptyList());\n" +
+ " }\n" +
+ " \n" +
+ "\n" +
+ " //WORKS - if you assign it (and lose type info?)\n" +
+ " static List works = emptyList();\n" +
+ " public Junk3(boolean bogus) {\n" +
+ " this(works);\n" +
+ " }\n" +
"}",
});
}
@@ -98,21 +98,21 @@ public void testConditionalExpression2() {
runConformTest(
new String[] {
"X.java",
- "class A{/**/}\n" +
- "class B extends A {/**/}\n" +
- "class C extends B {/**/}\n" +
- "class G<T> {/**/}\n" +
- "\n" +
- "public class X {\n" +
- "G<A> ga=null;\n" +
- "G<B> gb=null;\n" +
- "G<C> gc=null;\n" +
- "G<? super A> gsa=null;\n" +
- "G<? super B> gsb=null;\n" +
- "G<? super C> gsc=null;\n" +
- "\n" +
- "@SuppressWarnings(\"unused\")\n" +
- " public void test(boolean f) {\n" +
+ "class A{/**/}\n" +
+ "class B extends A {/**/}\n" +
+ "class C extends B {/**/}\n" +
+ "class G<T> {/**/}\n" +
+ "\n" +
+ "public class X {\n" +
+ "G<A> ga=null;\n" +
+ "G<B> gb=null;\n" +
+ "G<C> gc=null;\n" +
+ "G<? super A> gsa=null;\n" +
+ "G<? super B> gsb=null;\n" +
+ "G<? super C> gsc=null;\n" +
+ "\n" +
+ "@SuppressWarnings(\"unused\")\n" +
+ " public void test(boolean f) {\n" +
" G<? super B> l1 = (f) ? gsa : gb;\n" +
" G<? super B> l2 = (f) ? gsb : gb;\n" +
" G<? super C> l3 = (f) ? gsc : gb;\n" +
@@ -125,16 +125,16 @@ public void testBug423839() {
runConformTest(
new String[] {
"Test.java",
- "import java.util.ArrayList;\n" +
- "import java.util.Collection;\n" +
- "import java.util.List;\n" +
- "\n" +
- "public class Test<T> {\n" +
- "\n" +
- " public <T> T randomElement(Collection<T> list) {\n" +
- " return randomElement(list instanceof List ? list : new ArrayList<>(list));\n" +
- " }\n" +
- "\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class Test<T> {\n" +
+ "\n" +
+ " public <T> T randomElement(Collection<T> list) {\n" +
+ " return randomElement(list instanceof List ? list : new ArrayList<>(list));\n" +
+ " }\n" +
+ "\n" +
"}\n"
});
}
@@ -142,29 +142,29 @@ public void testBug418807() {
runConformTest(
new String[] {
"Word.java",
- "import java.util.Arrays;\n" +
- "import java.util.List;\n" +
- "import java.util.stream.Collectors;\n" +
- "import java.util.stream.Stream;\n" +
- " \n" +
- "public class Word {\n" +
- " private final String str;\n" +
- "\n" +
- " public Word(String s) {\n" +
- " str = s;\n" +
- " }\n" +
- "\n" +
- " @Override\n" +
- " public String toString() {\n" +
- " return str;\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " List<String> names = Arrays.asList(\"Aaron\", \"Jack\", \"Ben\");\n" +
- " Stream<Word> ws = names.stream().map(Word::new);\n" +
- " List<Word> words = ws.collect(Collectors.toList());\n" +
- " words.forEach(System.out::println);\n" +
- " }\n" +
+ "import java.util.Arrays;\n" +
+ "import java.util.List;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "import java.util.stream.Stream;\n" +
+ " \n" +
+ "public class Word {\n" +
+ " private final String str;\n" +
+ "\n" +
+ " public Word(String s) {\n" +
+ " str = s;\n" +
+ " }\n" +
+ "\n" +
+ " @Override\n" +
+ " public String toString() {\n" +
+ " return str;\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " List<String> names = Arrays.asList(\"Aaron\", \"Jack\", \"Ben\");\n" +
+ " Stream<Word> ws = names.stream().map(Word::new);\n" +
+ " List<Word> words = ws.collect(Collectors.toList());\n" +
+ " words.forEach(System.out::println);\n" +
+ " }\n" +
"}\n"
});
}
@@ -172,19 +172,19 @@ public void testBug414631() {
runConformTest(
new String[] {
"test/Y.java",
- "package test;\n" +
- "import java.util.function.Supplier;\n" +
- "public abstract class Y<E> {\n" +
- " public static <E> Y<E> empty() { return null;}\n" +
- " public static <E> Y<E> cons(E head, Supplier<Y<E>> tailFun) {return null;}\n" +
+ "package test;\n" +
+ "import java.util.function.Supplier;\n" +
+ "public abstract class Y<E> {\n" +
+ " public static <E> Y<E> empty() { return null;}\n" +
+ " public static <E> Y<E> cons(E head, Supplier<Y<E>> tailFun) {return null;}\n" +
"}",
"test/X.java",
- "package test;\n" +
- "import static test.Y.*;\n" +
- "public class X {\n" +
- " public void foo() {\n" +
- " Y<String> generated = cons(\"a\", () -> cons(\"b\", Y::<String>empty));\n" +
- " }\n" +
+ "package test;\n" +
+ "import static test.Y.*;\n" +
+ "public class X {\n" +
+ " public void foo() {\n" +
+ " Y<String> generated = cons(\"a\", () -> cons(\"b\", Y::<String>empty));\n" +
+ " }\n" +
"}\n"
});
}
@@ -194,47 +194,47 @@ public void testBug424038() {
"Foo.java",
"import java.util.*;\n" +
"import java.util.function.*;\n" +
- "public class Foo<E> {\n" +
- "\n" +
- " public void gather() {\n" +
- " StreamLike<E> stream = null;\n" +
- " List<Stuff<E>> list1 = stream.gather(() -> new Stuff<>()).toList();\n" +
- " List<Consumer<E>> list2 = stream.gather(() -> new Stuff<>()).toList(); // ERROR\n" +
- " }\n" +
- "\n" +
- " interface StreamLike<E> {\n" +
- " <T extends Consumer<E>> StreamLike<T> gather(Supplier<T> gatherer);\n" +
- "\n" +
- " List<E> toList();\n" +
- " }\n" +
- "\n" +
- " static class Stuff<T> implements Consumer<T> {\n" +
- " public void accept(T t) {}\n" +
- " }\n" +
+ "public class Foo<E> {\n" +
+ "\n" +
+ " public void gather() {\n" +
+ " StreamLike<E> stream = null;\n" +
+ " List<Stuff<E>> list1 = stream.gather(() -> new Stuff<>()).toList();\n" +
+ " List<Consumer<E>> list2 = stream.gather(() -> new Stuff<>()).toList(); // ERROR\n" +
+ " }\n" +
+ "\n" +
+ " interface StreamLike<E> {\n" +
+ " <T extends Consumer<E>> StreamLike<T> gather(Supplier<T> gatherer);\n" +
+ "\n" +
+ " List<E> toList();\n" +
+ " }\n" +
+ "\n" +
+ " static class Stuff<T> implements Consumer<T> {\n" +
+ " public void accept(T t) {}\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Foo.java (at line 8)\n" +
- " List<Consumer<E>> list2 = stream.gather(() -> new Stuff<>()).toList(); // ERROR\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from List<Foo.Stuff<E>> to List<Consumer<E>>\n" +
+ "----------\n" +
+ "1. ERROR in Foo.java (at line 8)\n" +
+ " List<Consumer<E>> list2 = stream.gather(() -> new Stuff<>()).toList(); // ERROR\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from List<Foo.Stuff<E>> to List<Consumer<E>>\n" +
"----------\n");
}
-// https://bugs.eclipse.org/423504 - [1.8] Implement "18.5.3 Functional Interface Parameterization Inference"
+// https://bugs.eclipse.org/423504 - [1.8] Implement "18.5.3 Functional Interface Parameterization Inference"
public void testBug423504() {
runConformTest(
new String[] {
"X.java",
"import java.util.*;\n" +
- "public class X {\n" +
- " public static void main(String argv[]) {\n" +
- " I<? extends Collection<String>> sorter = (List<String> m) -> { /* sort */ };\n" +
- " }\n" +
- "} \n" +
- "\n" +
- "interface I<T> { \n" +
- " public void sort(T col);\n" +
+ "public class X {\n" +
+ " public static void main(String argv[]) {\n" +
+ " I<? extends Collection<String>> sorter = (List<String> m) -> { /* sort */ };\n" +
+ " }\n" +
+ "} \n" +
+ "\n" +
+ "interface I<T> { \n" +
+ " public void sort(T col);\n" +
"}\n"
});
}
@@ -243,31 +243,31 @@ public void testBug420525() {
runConformTest(
new String[] {
"X.java",
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "import java.util.concurrent.CompletableFuture;\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "import java.util.concurrent.CompletableFuture;\n" +
"import java.util.concurrent.ExecutionException;\n" +
"public class X {\n" +
- " void test(List<CompletableFuture<Integer>> futures) {\n" +
- " CompletableFuture.allOf(futures.toArray(new CompletableFuture<?>[]{})).thenApplyAsync( (Void v) -> {\n" +
- " Integer finalResult = futures.stream().map( (CompletableFuture<Integer> f) -> {\n" +
- " try {\n" +
- " return f.get();\n" +
- " } catch (InterruptedException | ExecutionException e) {\n" +
- " return 0;\n" +
- " }\n" +
- " }).reduce(0, Integer::sum);\n" +
- " \n" +
- " log(\"final result is \" + finalResult);\n" +
- " if (finalResult != 50){\n" +
- " throw new RuntimeException(\"FAILED\");\n" +
- " } else{\n" +
- " log(\"SUCCESS\");\n" +
- " }\n" +
- " \n" +
- " return null;\n" +
- " });\n" +
- "\n" +
+ " void test(List<CompletableFuture<Integer>> futures) {\n" +
+ " CompletableFuture.allOf(futures.toArray(new CompletableFuture<?>[]{})).thenApplyAsync( (Void v) -> {\n" +
+ " Integer finalResult = futures.stream().map( (CompletableFuture<Integer> f) -> {\n" +
+ " try {\n" +
+ " return f.get();\n" +
+ " } catch (InterruptedException | ExecutionException e) {\n" +
+ " return 0;\n" +
+ " }\n" +
+ " }).reduce(0, Integer::sum);\n" +
+ " \n" +
+ " log(\"final result is \" + finalResult);\n" +
+ " if (finalResult != 50){\n" +
+ " throw new RuntimeException(\"FAILED\");\n" +
+ " } else{\n" +
+ " log(\"SUCCESS\");\n" +
+ " }\n" +
+ " \n" +
+ " return null;\n" +
+ " });\n" +
+ "\n" +
" }\n" +
" void log(String msg) {}\n" +
"}\n"
@@ -278,18 +278,18 @@ public void testBug420525_mini() {
runConformTest(
new String[] {
"X.java",
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "import java.util.concurrent.CompletableFuture;\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "import java.util.concurrent.CompletableFuture;\n" +
"import java.util.concurrent.ExecutionException;\n" +
"public class X {\n" +
- " void test(List<CompletableFuture<Integer>> futures, boolean b) {\n" +
+ " void test(List<CompletableFuture<Integer>> futures, boolean b) {\n" +
" Integer finalResult = futures.stream().map( (CompletableFuture<Integer> f) -> {\n" +
" if (b) \n" +
" return 1;\n" +
" else\n" +
" return Integer.valueOf(13);" +
- " }).reduce(0, Integer::sum);\n" +
+ " }).reduce(0, Integer::sum);\n" +
" }\n" +
"}\n"
});
@@ -300,23 +300,23 @@ public void testBug420525a() {
runNegativeTest(
new String[] {
"Main.java",
- "interface I<T> {\n" +
- " T bold(T t);\n" +
- "}\n" +
- "\n" +
- "class Main { \n" +
- " public String foo(String x) { return \"<b>\" + x + \"</b>\"; }\n" +
- " String bar() {\n" +
- " I<? extends String> i = this::foo;\n" +
- " return i.bold(\"1\");\n" +
- " } \n" +
+ "interface I<T> {\n" +
+ " T bold(T t);\n" +
+ "}\n" +
+ "\n" +
+ "class Main { \n" +
+ " public String foo(String x) { return \"<b>\" + x + \"</b>\"; }\n" +
+ " String bar() {\n" +
+ " I<? extends String> i = this::foo;\n" +
+ " return i.bold(\"1\");\n" +
+ " } \n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Main.java (at line 9)\n" +
- " return i.bold(\"1\");\n" +
- " ^^^^\n" +
- "The method bold(capture#1-of ? extends String) in the type I<capture#1-of ? extends String> is not applicable for the arguments (String)\n" +
+ "----------\n" +
+ "1. ERROR in Main.java (at line 9)\n" +
+ " return i.bold(\"1\");\n" +
+ " ^^^^\n" +
+ "The method bold(capture#1-of ? extends String) in the type I<capture#1-of ? extends String> is not applicable for the arguments (String)\n" +
"----------\n");
}
@@ -324,24 +324,24 @@ public void testBug424415() {
runConformTest(
new String[] {
"X.java",
- "\n" +
- "import java.util.ArrayList;\n" +
- "import java.util.Collection;\n" +
- "\n" +
- "interface Functional<T> {\n" +
- " T apply();\n" +
- "}\n" +
- "\n" +
- "class X {\n" +
- " void foo(Object o) { }\n" +
- "\n" +
- " <Q extends Collection<?>> Q goo(Functional<Q> s) {\n" +
- " return null;\n" +
- " } \n" +
- "\n" +
- " void test() {\n" +
- " foo(goo(ArrayList<String>::new));\n" +
- " }\n" +
+ "\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.Collection;\n" +
+ "\n" +
+ "interface Functional<T> {\n" +
+ " T apply();\n" +
+ "}\n" +
+ "\n" +
+ "class X {\n" +
+ " void foo(Object o) { }\n" +
+ "\n" +
+ " <Q extends Collection<?>> Q goo(Functional<Q> s) {\n" +
+ " return null;\n" +
+ " } \n" +
+ "\n" +
+ " void test() {\n" +
+ " foo(goo(ArrayList<String>::new));\n" +
+ " }\n" +
"}\n"
});
}
@@ -350,24 +350,24 @@ public void testBug424415b() {
runConformTest(
new String[] {
"X.java",
- "import java.util.ArrayList;\n" +
- "import java.util.Collection;\n" +
- "\n" +
- "interface Functional<T> {\n" +
- " T apply();\n" +
- "}\n" +
- "\n" +
- "class X {\n" +
- " void foo(Object o) { }\n" +
- " void foo(String str) {} \n" +
- "\n" +
- " <Q extends Collection<?>> Q goo(Functional<Q> s) {\n" +
- " return null;\n" +
- " } \n" +
- "\n" +
- " void test() {\n" +
- " foo(goo(ArrayList<String>::new));\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.Collection;\n" +
+ "\n" +
+ "interface Functional<T> {\n" +
+ " T apply();\n" +
+ "}\n" +
+ "\n" +
+ "class X {\n" +
+ " void foo(Object o) { }\n" +
+ " void foo(String str) {} \n" +
+ "\n" +
+ " <Q extends Collection<?>> Q goo(Functional<Q> s) {\n" +
+ " return null;\n" +
+ " } \n" +
+ "\n" +
+ " void test() {\n" +
+ " foo(goo(ArrayList<String>::new));\n" +
+ " }\n" +
"}\n"
});
}
@@ -376,43 +376,43 @@ public void testBug424415c() {
runConformTest(
new String[] {
"com/example/MyEmployee.java",
- "package com.example;\n" +
- "class MyEmployee {\n" +
- " \n" +
- " public enum Gender { MALE, FEMALE, OTHERS }\n" +
- "\n" +
- " private int age = 0;\n" +
- " private Gender gender = Gender.MALE;\n" +
- " \n" +
- " public MyEmployee(int age, Gender gender) {\n" +
- " this.age = age;\n" +
- " this.gender = gender;\n" +
- " } \n" +
- " \n" +
- " public int getAge() {\n" +
- " return age;\n" +
- " }\n" +
- " \n" +
- " public Gender getGender() {\n" +
- " return gender;\n" +
- " }\n" +
+ "package com.example;\n" +
+ "class MyEmployee {\n" +
+ " \n" +
+ " public enum Gender { MALE, FEMALE, OTHERS }\n" +
+ "\n" +
+ " private int age = 0;\n" +
+ " private Gender gender = Gender.MALE;\n" +
+ " \n" +
+ " public MyEmployee(int age, Gender gender) {\n" +
+ " this.age = age;\n" +
+ " this.gender = gender;\n" +
+ " } \n" +
+ " \n" +
+ " public int getAge() {\n" +
+ " return age;\n" +
+ " }\n" +
+ " \n" +
+ " public Gender getGender() {\n" +
+ " return gender;\n" +
+ " }\n" +
"}",
"com/example/Test.java",
- "package com.example;\n" +
- "\n" +
- "import java.util.List;\n" +
- "import java.util.concurrent.ConcurrentMap;\n" +
- "import java.util.stream.Collectors;\n" +
- "\n" +
- "public class Test {\n" +
- "\n" +
- " ConcurrentMap<MyEmployee.Gender, List<MyEmployee>> test(List<MyEmployee> el) {\n" +
- " return el.parallelStream()\n" +
- " .collect(\n" +
- " Collectors.groupingByConcurrent(MyEmployee::getGender)\n" +
- " );\n" +
- " }\n" +
- " \n" +
+ "package com.example;\n" +
+ "\n" +
+ "import java.util.List;\n" +
+ "import java.util.concurrent.ConcurrentMap;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " ConcurrentMap<MyEmployee.Gender, List<MyEmployee>> test(List<MyEmployee> el) {\n" +
+ " return el.parallelStream()\n" +
+ " .collect(\n" +
+ " Collectors.groupingByConcurrent(MyEmployee::getGender)\n" +
+ " );\n" +
+ " }\n" +
+ " \n" +
"}"
});
}
@@ -420,23 +420,23 @@ public void testBug424631() {
runConformTest(
new String[] {
"X.java",
- "import java.util.ArrayList;\n" +
- "import java.util.Collection;\n" +
- "\n" +
- "interface Functional<T> {\n" +
- " T apply();\n" +
- "}\n" +
- "\n" +
- "class X {\n" +
- " void foo(Collection<String> o) { }\n" +
- "\n" +
- " <Q extends Collection<?>> Q goo(Functional<Q> s) {\n" +
- " return null;\n" +
- " } \n" +
- "\n" +
- " void test() { \n" +
- " foo(goo(ArrayList<String>::new));\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.Collection;\n" +
+ "\n" +
+ "interface Functional<T> {\n" +
+ " T apply();\n" +
+ "}\n" +
+ "\n" +
+ "class X {\n" +
+ " void foo(Collection<String> o) { }\n" +
+ "\n" +
+ " <Q extends Collection<?>> Q goo(Functional<Q> s) {\n" +
+ " return null;\n" +
+ " } \n" +
+ "\n" +
+ " void test() { \n" +
+ " foo(goo(ArrayList<String>::new));\n" +
+ " }\n" +
"}\n"
});
}
@@ -445,17 +445,17 @@ public void testBug424403() {
runConformTest(
new String[] {
"X.java",
- "interface Functional { int foo(); }\n" +
- "\n" +
- "public class X {\n" +
- " static int bar() {\n" +
- " return -1;\n" +
- " }\n" +
- " static <T> T consume(T t) { return null; }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " Functional f = consume(X::bar);\n" +
- " } \n" +
+ "interface Functional { int foo(); }\n" +
+ "\n" +
+ "public class X {\n" +
+ " static int bar() {\n" +
+ " return -1;\n" +
+ " }\n" +
+ " static <T> T consume(T t) { return null; }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " Functional f = consume(X::bar);\n" +
+ " } \n" +
"}\n"
});
}
@@ -466,45 +466,45 @@ public void testBug401850a() {
null : JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings,
new String[] {
"X.java",
- "import java.util.List;\n" +
- "import java.util.ArrayList;\n" +
- "public class X<T> {\n" +
- " X(T t) {}\n" +
- " X(String s) {}\n" +
- " int m(X<String> xs) { return 0; }\n" +
- " int i = m(new X<>(\"\"));\n" +
+ "import java.util.List;\n" +
+ "import java.util.ArrayList;\n" +
+ "public class X<T> {\n" +
+ " X(T t) {}\n" +
+ " X(String s) {}\n" +
+ " int m(X<String> xs) { return 0; }\n" +
+ " int i = m(new X<>(\"\"));\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 1)\n" +
- " import java.util.List;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The import java.util.List is never used\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 2)\n" +
- " import java.util.ArrayList;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The import java.util.ArrayList is never used\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 1)\n" +
+ " import java.util.List;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The import java.util.List is never used\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 2)\n" +
+ " import java.util.ArrayList;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The import java.util.ArrayList is never used\n" +
"----------\n");
}
public void testBug401850b() {
runNegativeTest(
new String[] {
"X.java",
- "import java.util.List;\n" +
- "import java.util.ArrayList;\n" +
- "public class X<T> {\n" +
- " X(T t) {}\n" +
- " X(String s) {}\n" +
- " int m(X<String> xs) { return 0; }\n" +
- " int i = m(new X<String>(\"\"));\n" +
+ "import java.util.List;\n" +
+ "import java.util.ArrayList;\n" +
+ "public class X<T> {\n" +
+ " X(T t) {}\n" +
+ " X(String s) {}\n" +
+ " int m(X<String> xs) { return 0; }\n" +
+ " int i = m(new X<String>(\"\"));\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " int i = m(new X<String>(\"\"));\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The constructor X<String>(String) is ambiguous\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " int i = m(new X<String>(\"\"));\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The constructor X<String>(String) is ambiguous\n" +
"----------\n");
}
@@ -512,30 +512,30 @@ public void testBug424710() {
runConformTest(
new String[] {
"MapperTest.java",
- "import java.util.ArrayList;\n" +
- "import java.util.Arrays;\n" +
- "import java.util.List;\n" +
- "import java.util.function.Function;\n" +
- "import java.util.regex.Matcher;\n" +
- "import java.util.regex.Pattern;\n" +
- "import java.util.stream.Stream;\n" +
- "\n" +
- "public class MapperTest {\n" +
- "\n" +
- " public static void main( String... argv ){\n" +
- " List<String> data = Arrays.asList(\"abc\", \"123\", \"1a\", \"?!?\");\n" +
- " List<Pattern> patterns = Arrays.asList(Pattern.compile(\"[a-z]+\"), Pattern.compile(\"[0-9]+\"));\n" +
- " patterns.stream()\n" +
- " .flatMap(\n" +
- " p -> {\n" +
- " Stream<Matcher> map = data.stream().map(p::matcher);\n" +
- " Stream<Matcher> filter = map.filter(Matcher::find);\n" +
- " Function<? super Matcher, ? extends Object> mapper = Matcher::group;\n" +
- " mapper = matcher -> matcher.group();\n" +
- " return filter.map(mapper);\n" +
- " })\n" +
- " .forEach(System.out::println);\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.Arrays;\n" +
+ "import java.util.List;\n" +
+ "import java.util.function.Function;\n" +
+ "import java.util.regex.Matcher;\n" +
+ "import java.util.regex.Pattern;\n" +
+ "import java.util.stream.Stream;\n" +
+ "\n" +
+ "public class MapperTest {\n" +
+ "\n" +
+ " public static void main( String... argv ){\n" +
+ " List<String> data = Arrays.asList(\"abc\", \"123\", \"1a\", \"?!?\");\n" +
+ " List<Pattern> patterns = Arrays.asList(Pattern.compile(\"[a-z]+\"), Pattern.compile(\"[0-9]+\"));\n" +
+ " patterns.stream()\n" +
+ " .flatMap(\n" +
+ " p -> {\n" +
+ " Stream<Matcher> map = data.stream().map(p::matcher);\n" +
+ " Stream<Matcher> filter = map.filter(Matcher::find);\n" +
+ " Function<? super Matcher, ? extends Object> mapper = Matcher::group;\n" +
+ " mapper = matcher -> matcher.group();\n" +
+ " return filter.map(mapper);\n" +
+ " })\n" +
+ " .forEach(System.out::println);\n" +
+ " }\n" +
"}\n"
});
}
@@ -544,17 +544,17 @@ public void testBug424075() {
runConformTest(
new String[] {
"X.java",
- "import java.util.*;\n" +
- "import java.util.function.*;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Consumer<Object> c = null;\n" +
- " Arrays.asList(pred(), c);\n" +
- " }\n" +
- "\n" +
- " static <T> Predicate<T> pred() {\n" +
- " return null;\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "import java.util.function.*;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Consumer<Object> c = null;\n" +
+ " Arrays.asList(pred(), c);\n" +
+ " }\n" +
+ "\n" +
+ " static <T> Predicate<T> pred() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
});
}
@@ -562,18 +562,18 @@ public void testBug424205a() {
runConformTest(
new String[] {
"X.java",
- "interface I {\n" +
- " void bar(String t);\n" +
- "}\n" +
- "class X<T> implements I {\n" +
- " public void bar(String t) {}\n" +
- " X(String x) {}\n" +
- " X(T x) {}\n" +
- " public void one(X<I> c){}\n" +
- " public void two() {\n" +
- " X<I> i = new X<>((String s) -> { });\n" +
- " one (i);\n" +
- " }\n" +
+ "interface I {\n" +
+ " void bar(String t);\n" +
+ "}\n" +
+ "class X<T> implements I {\n" +
+ " public void bar(String t) {}\n" +
+ " X(String x) {}\n" +
+ " X(T x) {}\n" +
+ " public void one(X<I> c){}\n" +
+ " public void two() {\n" +
+ " X<I> i = new X<>((String s) -> { });\n" +
+ " one (i);\n" +
+ " }\n" +
"}\n"
});
}
@@ -581,23 +581,23 @@ public void testBug424205b() {
runConformTest(
new String[] {
"X.java",
- "interface I {\n" +
- " void bar(String t);\n" +
- "}\n" +
- "public class X<T> implements I {\n" +
- " public void bar(String t) {}\n" +
- " X(String x) {}\n" +
- " X(T x) {}\n" +
- " public void one(X<I> c){}\n" +
- " public void two() {\n" +
- " one(new X<>((String s) -> { })); // 1. Three errors\n" +
- " X<I> i = new X<>((String s) -> { }); // 2. Error - Comment out the previous line to see this error go away.\n" +
- " one (i);\n" +
+ "interface I {\n" +
+ " void bar(String t);\n" +
+ "}\n" +
+ "public class X<T> implements I {\n" +
+ " public void bar(String t) {}\n" +
+ " X(String x) {}\n" +
+ " X(T x) {}\n" +
+ " public void one(X<I> c){}\n" +
+ " public void two() {\n" +
+ " one(new X<>((String s) -> { })); // 1. Three errors\n" +
+ " X<I> i = new X<>((String s) -> { }); // 2. Error - Comment out the previous line to see this error go away.\n" +
+ " one (i);\n" +
" }\n" +
" public static void main(String[] args) {\n" +
" System.out.println(\"main\");\n" +
" new X<Integer>(\"one\").two();\n" +
- " }\n" +
+ " }\n" +
"}\n"
},
"main");
@@ -606,47 +606,47 @@ public void testBug424712a() {
runNegativeTest(
new String[] {
"X.java",
- "import java.util.Collection;\n" +
- "import java.util.function.Supplier;\n" +
- "import java.util.Set;\n" +
- "\n" +
- "public class X {\n" +
- " public static <T, SOURCE extends Collection<T>, DEST extends Collection<T>>\n" +
- " DEST foo(SOURCE sourceCollection, DEST collectionFactory) {\n" +
- " return null;\n" +
- " } \n" +
- " \n" +
- " public static void main(String... args) {\n" +
- " Set<Y> rosterSet = (Set<Y>) foo(null, Set::new);\n" +
- " }\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.function.Supplier;\n" +
+ "import java.util.Set;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static <T, SOURCE extends Collection<T>, DEST extends Collection<T>>\n" +
+ " DEST foo(SOURCE sourceCollection, DEST collectionFactory) {\n" +
+ " return null;\n" +
+ " } \n" +
+ " \n" +
+ " public static void main(String... args) {\n" +
+ " Set<Y> rosterSet = (Set<Y>) foo(null, Set::new);\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " Set<Y> rosterSet = (Set<Y>) foo(null, Set::new);\n" +
- " ^\n" +
- "Y cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " Set<Y> rosterSet = (Set<Y>) foo(null, Set::new);\n" +
- " ^\n" +
- "Y cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 12)\n" +
- " Set<Y> rosterSet = (Set<Y>) foo(null, Set::new);\n" +
- " ^^^\n" +
- "Cannot instantiate the type Set\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " Set<Y> rosterSet = (Set<Y>) foo(null, Set::new);\n" +
+ " ^\n" +
+ "Y cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 12)\n" +
+ " Set<Y> rosterSet = (Set<Y>) foo(null, Set::new);\n" +
+ " ^\n" +
+ "Y cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 12)\n" +
+ " Set<Y> rosterSet = (Set<Y>) foo(null, Set::new);\n" +
+ " ^^^\n" +
+ "Cannot instantiate the type Set\n" +
"----------\n");
}
public void testBug424712b() {
runConformTest(
new String[] {
"X.java",
- "import java.util.Comparator;\n" +
+ "import java.util.Comparator;\n" +
"public class X {\n" +
- " <T> void test() {\n" +
+ " <T> void test() {\n" +
" Comparator<? super T> comparator = (Comparator<? super T>) Comparator.naturalOrder();\n" +
- " System.out.println(\"OK\");\n" +
+ " System.out.println(\"OK\");\n" +
" }\n" +
" public static void main(String[] args) {\n" +
" new X().test();\n" +
@@ -659,186 +659,186 @@ public void testBug425142_minimal() {
runNegativeTest(
new String[] {
"SomethingBreaks.java",
- "import java.io.IOException;\n" +
- "import java.nio.file.Files;\n" +
- "import java.nio.file.Paths;\n" +
- "import java.util.function.Consumer;\n" +
- "\n" +
- "@FunctionalInterface interface Use<T, E extends Throwable> { void accept(T t) throws E; }\n" +
- "\n" +
- "@SuppressWarnings(\"unused\") public class SomethingBreaks<T, E extends Throwable> {\n" +
- " protected static SomethingBreaks<String, IOException> stream() { return null; }\n" +
- "\n" +
- " public void forEach(Consumer<T> use) throws E {}\n" +
- "\n" +
- " public <E2 extends E> void forEach(Use<T, E2> use) throws E, E2 {}\n" +
- "\n" +
- " private static void methodReference(String s) throws IOException {\n" +
- " System.out.println(Files.size(Paths.get(s)));\n" +
- " }\n" +
- " \n" +
- " public static void useCase9() throws IOException {\n" +
- " stream().forEach((String s) -> System.out.println(Files.size(Paths.get(s))));\n" +
- " }\n" +
+ "import java.io.IOException;\n" +
+ "import java.nio.file.Files;\n" +
+ "import java.nio.file.Paths;\n" +
+ "import java.util.function.Consumer;\n" +
+ "\n" +
+ "@FunctionalInterface interface Use<T, E extends Throwable> { void accept(T t) throws E; }\n" +
+ "\n" +
+ "@SuppressWarnings(\"unused\") public class SomethingBreaks<T, E extends Throwable> {\n" +
+ " protected static SomethingBreaks<String, IOException> stream() { return null; }\n" +
+ "\n" +
+ " public void forEach(Consumer<T> use) throws E {}\n" +
+ "\n" +
+ " public <E2 extends E> void forEach(Use<T, E2> use) throws E, E2 {}\n" +
+ "\n" +
+ " private static void methodReference(String s) throws IOException {\n" +
+ " System.out.println(Files.size(Paths.get(s)));\n" +
+ " }\n" +
+ " \n" +
+ " public static void useCase9() throws IOException {\n" +
+ " stream().forEach((String s) -> System.out.println(Files.size(Paths.get(s))));\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in SomethingBreaks.java (at line 20)\n" +
- " stream().forEach((String s) -> System.out.println(Files.size(Paths.get(s))));\n" +
- " ^^^^^^^\n" +
- "The method forEach(Consumer<String>) is ambiguous for the type SomethingBreaks<String,IOException>\n" +
+ "----------\n" +
+ "1. ERROR in SomethingBreaks.java (at line 20)\n" +
+ " stream().forEach((String s) -> System.out.println(Files.size(Paths.get(s))));\n" +
+ " ^^^^^^^\n" +
+ "The method forEach(Consumer<String>) is ambiguous for the type SomethingBreaks<String,IOException>\n" +
"----------\n");
}
public void testBug425142_full() {
runNegativeTest(
new String[] {
"SomethingBreaks.java",
- "import java.io.IOException;\n" +
- "import java.nio.file.Files;\n" +
- "import java.nio.file.Paths;\n" +
- "import java.util.function.Consumer;\n" +
- "\n" +
- "@FunctionalInterface interface Use<T, E extends Throwable> { void accept(T t) throws E; }\n" +
- "\n" +
- "@SuppressWarnings(\"unused\") public class SomethingBreaks<T, E extends Throwable> {\n" +
- " protected static SomethingBreaks<String, IOException> stream() { return null; }\n" +
- "\n" +
- " public void forEach(Consumer<T> use) throws E {}\n" +
- "\n" +
- " public <E2 extends E> void forEach(Use<T, E2> use) throws E, E2 {}\n" +
- "\n" +
- " private static void methodReference(String s) throws IOException {\n" +
- " System.out.println(Files.size(Paths.get(s)));\n" +
- " }\n" +
- " \n" +
- " public static void useCase1() throws IOException {\n" +
- " Use<String, IOException> c =\n" +
- " (String s) -> System.out.println(Files.size(Paths.get(s)));\n" +
- " stream().forEach(c);\n" +
- " }\n" +
- " \n" +
- " public static void useCase2() throws IOException {\n" +
- " Use<String, IOException> c = SomethingBreaks::methodReference;\n" +
- " stream().forEach(c);\n" +
- " }\n" +
- " \n" +
- " public static void useCase3() throws IOException {\n" +
- " stream().forEach((Use<String, IOException>) (String s) -> System.out.println(Files.size(Paths.get(s))));\n" +
- " }\n" +
- " \n" +
- " public static void useCase4() throws IOException {\n" +
- " stream().forEach((Use<String, IOException>) SomethingBreaks::methodReference);\n" +
- " }\n" +
- " \n" +
- " public static void useCase5() throws IOException {\n" +
- " stream().<IOException> forEach((String s) -> System.out.println(Files.size(Paths.get(s))));\n" +
- " }\n" +
- " \n" +
- " public static void useCase6() throws IOException {\n" +
- " stream().<IOException> forEach(SomethingBreaks::methodReference);\n" +
- " }\n" +
- " \n" +
- " public static void useCase7() throws IOException {\n" +
- " stream().<Use<String, IOException>> forEach((String s) -> System.out.println(Files.size(Paths.get(s))));\n" +
- " }\n" +
- " \n" +
- " public static void useCase8() throws IOException {\n" +
- " stream().<Use<String, IOException>> forEach(SomethingBreaks::methodReference);\n" +
- " }\n" +
- " \n" +
- " public static void useCase9() throws IOException {\n" +
- " stream().forEach((String s) -> System.out.println(Files.size(Paths.get(s))));\n" +
- " }\n" +
- " \n" +
- " public static void useCase10() throws IOException {\n" +
- " stream().forEach(SomethingBreaks::methodReference);\n" +
- " }\n" +
+ "import java.io.IOException;\n" +
+ "import java.nio.file.Files;\n" +
+ "import java.nio.file.Paths;\n" +
+ "import java.util.function.Consumer;\n" +
+ "\n" +
+ "@FunctionalInterface interface Use<T, E extends Throwable> { void accept(T t) throws E; }\n" +
+ "\n" +
+ "@SuppressWarnings(\"unused\") public class SomethingBreaks<T, E extends Throwable> {\n" +
+ " protected static SomethingBreaks<String, IOException> stream() { return null; }\n" +
+ "\n" +
+ " public void forEach(Consumer<T> use) throws E {}\n" +
+ "\n" +
+ " public <E2 extends E> void forEach(Use<T, E2> use) throws E, E2 {}\n" +
+ "\n" +
+ " private static void methodReference(String s) throws IOException {\n" +
+ " System.out.println(Files.size(Paths.get(s)));\n" +
+ " }\n" +
+ " \n" +
+ " public static void useCase1() throws IOException {\n" +
+ " Use<String, IOException> c =\n" +
+ " (String s) -> System.out.println(Files.size(Paths.get(s)));\n" +
+ " stream().forEach(c);\n" +
+ " }\n" +
+ " \n" +
+ " public static void useCase2() throws IOException {\n" +
+ " Use<String, IOException> c = SomethingBreaks::methodReference;\n" +
+ " stream().forEach(c);\n" +
+ " }\n" +
+ " \n" +
+ " public static void useCase3() throws IOException {\n" +
+ " stream().forEach((Use<String, IOException>) (String s) -> System.out.println(Files.size(Paths.get(s))));\n" +
+ " }\n" +
+ " \n" +
+ " public static void useCase4() throws IOException {\n" +
+ " stream().forEach((Use<String, IOException>) SomethingBreaks::methodReference);\n" +
+ " }\n" +
+ " \n" +
+ " public static void useCase5() throws IOException {\n" +
+ " stream().<IOException> forEach((String s) -> System.out.println(Files.size(Paths.get(s))));\n" +
+ " }\n" +
+ " \n" +
+ " public static void useCase6() throws IOException {\n" +
+ " stream().<IOException> forEach(SomethingBreaks::methodReference);\n" +
+ " }\n" +
+ " \n" +
+ " public static void useCase7() throws IOException {\n" +
+ " stream().<Use<String, IOException>> forEach((String s) -> System.out.println(Files.size(Paths.get(s))));\n" +
+ " }\n" +
+ " \n" +
+ " public static void useCase8() throws IOException {\n" +
+ " stream().<Use<String, IOException>> forEach(SomethingBreaks::methodReference);\n" +
+ " }\n" +
+ " \n" +
+ " public static void useCase9() throws IOException {\n" +
+ " stream().forEach((String s) -> System.out.println(Files.size(Paths.get(s))));\n" +
+ " }\n" +
+ " \n" +
+ " public static void useCase10() throws IOException {\n" +
+ " stream().forEach(SomethingBreaks::methodReference);\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in SomethingBreaks.java (at line 39)\n" +
- " stream().<IOException> forEach((String s) -> System.out.println(Files.size(Paths.get(s))));\n" +
- " ^^^^^^^\n" +
- "The method forEach(Consumer<String>) is ambiguous for the type SomethingBreaks<String,IOException>\n" +
- "----------\n" +
- "2. ERROR in SomethingBreaks.java (at line 43)\n" +
- " stream().<IOException> forEach(SomethingBreaks::methodReference);\n" +
- " ^^^^^^^\n" +
- "The method forEach(Consumer<String>) is ambiguous for the type SomethingBreaks<String,IOException>\n" +
- "----------\n" +
- "3. ERROR in SomethingBreaks.java (at line 43)\n" +
- " stream().<IOException> forEach(SomethingBreaks::methodReference);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type IOException\n" +
- "----------\n" +
- "4. ERROR in SomethingBreaks.java (at line 47)\n" +
- " stream().<Use<String, IOException>> forEach((String s) -> System.out.println(Files.size(Paths.get(s))));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type IOException\n" +
- "----------\n" +
- "5. ERROR in SomethingBreaks.java (at line 51)\n" +
- " stream().<Use<String, IOException>> forEach(SomethingBreaks::methodReference);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type IOException\n" +
- "----------\n" +
- "6. ERROR in SomethingBreaks.java (at line 55)\n" +
- " stream().forEach((String s) -> System.out.println(Files.size(Paths.get(s))));\n" +
- " ^^^^^^^\n" +
- "The method forEach(Consumer<String>) is ambiguous for the type SomethingBreaks<String,IOException>\n" +
- "----------\n" +
- "7. ERROR in SomethingBreaks.java (at line 59)\n" +
- " stream().forEach(SomethingBreaks::methodReference);\n" +
- " ^^^^^^^\n" +
- "The method forEach(Consumer<String>) is ambiguous for the type SomethingBreaks<String,IOException>\n" +
- "----------\n" +
- "8. ERROR in SomethingBreaks.java (at line 59)\n" +
- " stream().forEach(SomethingBreaks::methodReference);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type IOException\n" +
+ "----------\n" +
+ "1. ERROR in SomethingBreaks.java (at line 39)\n" +
+ " stream().<IOException> forEach((String s) -> System.out.println(Files.size(Paths.get(s))));\n" +
+ " ^^^^^^^\n" +
+ "The method forEach(Consumer<String>) is ambiguous for the type SomethingBreaks<String,IOException>\n" +
+ "----------\n" +
+ "2. ERROR in SomethingBreaks.java (at line 43)\n" +
+ " stream().<IOException> forEach(SomethingBreaks::methodReference);\n" +
+ " ^^^^^^^\n" +
+ "The method forEach(Consumer<String>) is ambiguous for the type SomethingBreaks<String,IOException>\n" +
+ "----------\n" +
+ "3. ERROR in SomethingBreaks.java (at line 43)\n" +
+ " stream().<IOException> forEach(SomethingBreaks::methodReference);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type IOException\n" +
+ "----------\n" +
+ "4. ERROR in SomethingBreaks.java (at line 47)\n" +
+ " stream().<Use<String, IOException>> forEach((String s) -> System.out.println(Files.size(Paths.get(s))));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type IOException\n" +
+ "----------\n" +
+ "5. ERROR in SomethingBreaks.java (at line 51)\n" +
+ " stream().<Use<String, IOException>> forEach(SomethingBreaks::methodReference);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type IOException\n" +
+ "----------\n" +
+ "6. ERROR in SomethingBreaks.java (at line 55)\n" +
+ " stream().forEach((String s) -> System.out.println(Files.size(Paths.get(s))));\n" +
+ " ^^^^^^^\n" +
+ "The method forEach(Consumer<String>) is ambiguous for the type SomethingBreaks<String,IOException>\n" +
+ "----------\n" +
+ "7. ERROR in SomethingBreaks.java (at line 59)\n" +
+ " stream().forEach(SomethingBreaks::methodReference);\n" +
+ " ^^^^^^^\n" +
+ "The method forEach(Consumer<String>) is ambiguous for the type SomethingBreaks<String,IOException>\n" +
+ "----------\n" +
+ "8. ERROR in SomethingBreaks.java (at line 59)\n" +
+ " stream().forEach(SomethingBreaks::methodReference);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type IOException\n" +
"----------\n");
}
public void testBug424195a() {
runNegativeTestMultiResult(
new String[] {
"NPEOnCollector.java",
- "import java.io.IOException;\n" +
- "import java.nio.file.Path;\n" +
- "import java.util.ArrayList;\n" +
- "import java.util.function.Function;\n" +
- "import java.util.function.Predicate;\n" +
- "import java.util.jar.JarEntry;\n" +
- "import java.util.jar.JarFile;\n" +
- "import java.util.stream.Collectors;\n" +
- "import java.util.stream.Stream;\n" +
- "\n" +
- "\n" +
- "public class NPEOnCollector {\n" +
- " static void processJar(Path plugin) throws IOException {\n" +
- " \n" +
- " try(JarFile jar = new JarFile(plugin.toFile())) {\n" +
- " try(Stream<JarEntry> entries = jar.stream()) {\n" +
- " Stream<JarEntry> stream = entries\n" +
- " .distinct().collect(Collectors.toCollection(ArrayList::new));\n" +
- " \n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "import java.io.IOException;\n" +
+ "import java.nio.file.Path;\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.function.Function;\n" +
+ "import java.util.function.Predicate;\n" +
+ "import java.util.jar.JarEntry;\n" +
+ "import java.util.jar.JarFile;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "import java.util.stream.Stream;\n" +
+ "\n" +
+ "\n" +
+ "public class NPEOnCollector {\n" +
+ " static void processJar(Path plugin) throws IOException {\n" +
+ " \n" +
+ " try(JarFile jar = new JarFile(plugin.toFile())) {\n" +
+ " try(Stream<JarEntry> entries = jar.stream()) {\n" +
+ " Stream<JarEntry> stream = entries\n" +
+ " .distinct().collect(Collectors.toCollection(ArrayList::new));\n" +
+ " \n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
null,
new String[] {
- "----------\n" +
- "1. ERROR in NPEOnCollector.java (at line 17)\n" +
- " Stream<JarEntry> stream = entries\n" +
- " .distinct().collect(Collectors.toCollection(ArrayList::new));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Collection<JarEntry> to Stream<JarEntry>\n" +
+ "----------\n" +
+ "1. ERROR in NPEOnCollector.java (at line 17)\n" +
+ " Stream<JarEntry> stream = entries\n" +
+ " .distinct().collect(Collectors.toCollection(ArrayList::new));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Collection<JarEntry> to Stream<JarEntry>\n" +
"----------\n",
- "----------\n" +
- "1. ERROR in NPEOnCollector.java (at line 18)\n" +
- " .distinct().collect(Collectors.toCollection(ArrayList::new));\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The constructed object of type ArrayList is incompatible with the descriptor\'s return type: Stream<JarEntry>&Collection<T#2>&Collection<JarEntry>\n" +
+ "----------\n" +
+ "1. ERROR in NPEOnCollector.java (at line 18)\n" +
+ " .distinct().collect(Collectors.toCollection(ArrayList::new));\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The constructed object of type ArrayList is incompatible with the descriptor\'s return type: Stream<JarEntry>&Collection<T#2>&Collection<JarEntry>\n" +
"----------\n"
});
}
@@ -846,29 +846,29 @@ public void testBug424195b() {
runConformTest(
new String[] {
"NPEOnCollector.java",
- "import java.io.IOException;\n" +
- "import java.nio.file.Path;\n" +
- "import java.util.ArrayList;\n" +
- "import java.util.Collection;\n" +
- "import java.util.function.Function;\n" +
- "import java.util.function.Predicate;\n" +
- "import java.util.jar.JarEntry;\n" +
- "import java.util.jar.JarFile;\n" +
- "import java.util.stream.Collectors;\n" +
- "import java.util.stream.Stream;\n" +
- "\n" +
- "\n" +
- "public class NPEOnCollector {\n" +
- " static void processJar(Path plugin) throws IOException {\n" +
- " \n" +
- " try(JarFile jar = new JarFile(plugin.toFile())) {\n" +
- " try(Stream<JarEntry> entries = jar.stream()) {\n" +
- " Collection<JarEntry> collection = entries\n" +
- " .distinct().collect(Collectors.toCollection(ArrayList::new));\n" +
- " \n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "import java.io.IOException;\n" +
+ "import java.nio.file.Path;\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.function.Function;\n" +
+ "import java.util.function.Predicate;\n" +
+ "import java.util.jar.JarEntry;\n" +
+ "import java.util.jar.JarFile;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "import java.util.stream.Stream;\n" +
+ "\n" +
+ "\n" +
+ "public class NPEOnCollector {\n" +
+ " static void processJar(Path plugin) throws IOException {\n" +
+ " \n" +
+ " try(JarFile jar = new JarFile(plugin.toFile())) {\n" +
+ " try(Stream<JarEntry> entries = jar.stream()) {\n" +
+ " Collection<JarEntry> collection = entries\n" +
+ " .distinct().collect(Collectors.toCollection(ArrayList::new));\n" +
+ " \n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
});
}
@@ -876,19 +876,19 @@ public void testBug424195_comment2() {
runConformTest(
new String[] {
"X.java",
- "import java.io.PrintStream;\n" +
- "import java.util.ArrayList;\n" +
- "import java.util.stream.Collectors;\n" +
- "import java.util.stream.*;\n" +
- "public class X {\n" +
- "\n" +
- " public static void main(String argv[]) {\n" +
- " ArrayList<Integer> al = IntStream\n" +
- " .range(0, 10_000)\n" +
- " .boxed()\n" +
- " .collect(Collectors.toCollection(ArrayList::new));\n" +
- "\n" +
- " }\n" +
+ "import java.io.PrintStream;\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "import java.util.stream.*;\n" +
+ "public class X {\n" +
+ "\n" +
+ " public static void main(String argv[]) {\n" +
+ " ArrayList<Integer> al = IntStream\n" +
+ " .range(0, 10_000)\n" +
+ " .boxed()\n" +
+ " .collect(Collectors.toCollection(ArrayList::new));\n" +
+ "\n" +
+ " }\n" +
"}\n"
});
}
@@ -896,64 +896,64 @@ public void testBug425153() {
runNegativeTest(
new String[] {
"Main.java",
- "class C1 {}\n" +
- "class C2 {}\n" +
- "\n" +
- "interface I<P1 extends C1, P2 extends P1> {\n" +
- " P2 foo(P1 p1);\n" +
- "}\n" +
- "\n" +
- "public class Main {\n" +
- " public static void main(String argv[]) {\n" +
- " I<?, ?> i = (C1 c1) -> { return new C2(); };\n" +
- " Object c2 = i.foo(null);\n" +
- " }\n" +
+ "class C1 {}\n" +
+ "class C2 {}\n" +
+ "\n" +
+ "interface I<P1 extends C1, P2 extends P1> {\n" +
+ " P2 foo(P1 p1);\n" +
+ "}\n" +
+ "\n" +
+ "public class Main {\n" +
+ " public static void main(String argv[]) {\n" +
+ " I<?, ?> i = (C1 c1) -> { return new C2(); };\n" +
+ " Object c2 = i.foo(null);\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Main.java (at line 10)\n" +
- " I<?, ?> i = (C1 c1) -> { return new C2(); };\n" +
- " ^^^^^^^^^^\n" +
- "The target type of this expression is not a well formed parameterized type due to bound(s) mismatch\n" +
+ "----------\n" +
+ "1. ERROR in Main.java (at line 10)\n" +
+ " I<?, ?> i = (C1 c1) -> { return new C2(); };\n" +
+ " ^^^^^^^^^^\n" +
+ "The target type of this expression is not a well formed parameterized type due to bound(s) mismatch\n" +
"----------\n");
}
public void testBug424845() {
runConformTest(
new String[] {
"Test.java",
- "import java.util.ArrayList;\n" +
- "import java.util.Collections;\n" +
- "import java.util.Comparator;\n" +
- "import java.util.List;\n" +
- "\n" +
- "public class Test {\n" +
- " \n" +
- "\n" +
- " interface Function<K, V>{\n" +
- " public V apply(K orig);\n" +
- " }\n" +
- " \n" +
- " \n" +
- " static class Ordering<O> {\n" +
- "\n" +
- " public <K> Comparator<K> onResultOf(Function<K, ? extends O> function) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " \n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " List<Object> list = new ArrayList<>();\n" +
- " Function<Object, String> function = new Function<Object, String>() {\n" +
- " public String apply(Object arg0) {\n" +
- " return arg0.toString();\n" +
- " }\n" +
- " };\n" +
- " Ordering<Comparable<String>> natural = new Ordering<>();\n" +
- " Collections.sort(list, natural.onResultOf(function));\n" +
- " }\n" +
- " \n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.Collections;\n" +
+ "import java.util.Comparator;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " \n" +
+ "\n" +
+ " interface Function<K, V>{\n" +
+ " public V apply(K orig);\n" +
+ " }\n" +
+ " \n" +
+ " \n" +
+ " static class Ordering<O> {\n" +
+ "\n" +
+ " public <K> Comparator<K> onResultOf(Function<K, ? extends O> function) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " \n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " List<Object> list = new ArrayList<>();\n" +
+ " Function<Object, String> function = new Function<Object, String>() {\n" +
+ " public String apply(Object arg0) {\n" +
+ " return arg0.toString();\n" +
+ " }\n" +
+ " };\n" +
+ " Ordering<Comparable<String>> natural = new Ordering<>();\n" +
+ " Collections.sort(list, natural.onResultOf(function));\n" +
+ " }\n" +
+ " \n" +
"}\n"
});
}
@@ -961,14 +961,14 @@ public void testBug425278() {
runConformTest(
new String[] {
"X.java",
- "interface I<T, S extends X<T>> { \n" +
- " T foo(S p);\n" +
- "}\n" +
- "\n" +
- "public class X<T> {\n" +
- " public void bar() {\n" +
- " I<Object, X<Object>> f = (p) -> p; // Error\n" +
- " }\n" +
+ "interface I<T, S extends X<T>> { \n" +
+ " T foo(S p);\n" +
+ "}\n" +
+ "\n" +
+ "public class X<T> {\n" +
+ " public void bar() {\n" +
+ " I<Object, X<Object>> f = (p) -> p; // Error\n" +
+ " }\n" +
"}\n"
});
}
@@ -978,7 +978,7 @@ public void testBug425783() {
"Test.java",
"class MyType<S extends MyType<S>> {\n" +
" S myself() { return (S)this; }\n" +
- "}\n" +
+ "}\n" +
"public class Test {\n" +
" MyType test() {\n" +
" return newInstance().myself();\n" +
@@ -986,8 +986,8 @@ public void testBug425783() {
" MyType test2() {\n" +
" return newInstance().myself();\n" +
" }\n" +
- " public <T extends MyType> T newInstance() {\n" +
- " return (T) new MyType();\n" +
+ " public <T extends MyType> T newInstance() {\n" +
+ " return (T) new MyType();\n" +
" }" +
"}\n"
});
@@ -1000,11 +1000,11 @@ public void testBug425798() {
"import java.util.*;\n" +
"import java.util.function.*;\n" +
"import java.util.stream.*;\n" +
- "interface MyCollector<T, A, R> extends Collector<T, A, R> {\n" +
+ "interface MyCollector<T, A, R> extends Collector<T, A, R> {\n" +
"}\n" +
"public abstract class X {\n" +
- " abstract <T, K, U, M extends Map<K, U>>\n" +
- " MyCollector<T, ?, M> toMap(Function<? super T, ? extends K> km,\n" +
+ " abstract <T, K, U, M extends Map<K, U>>\n" +
+ " MyCollector<T, ?, M> toMap(Function<? super T, ? extends K> km,\n" +
" BinaryOperator<U> mf);" +
" void test(Stream<Annotation> annotations) {\n" +
" annotations\n" +
@@ -1023,11 +1023,11 @@ public void testBug425798a() {
"import java.util.*;\n" +
"import java.util.function.*;\n" +
"import java.util.stream.*;\n" +
- "interface MyCollector<T, A, R> extends Collector<T, A, R> {\n" +
+ "interface MyCollector<T, A, R> extends Collector<T, A, R> {\n" +
"}\n" +
"public abstract class X {\n" +
- " abstract <T, K, U, M extends Map<K, U>>\n" +
- " MyCollector<T, ?, M> toMap(Function<? super T, ? extends K> km,\n" +
+ " abstract <T, K, U, M extends Map<K, U>>\n" +
+ " MyCollector<T, ?, M> toMap(Function<? super T, ? extends K> km,\n" +
" BinaryOperator<U> mf);" +
" void test(Stream<Annotation> annotations) {\n" +
" annotations\n" +
@@ -1043,28 +1043,28 @@ public void testBug425798b() {
runConformTest(
new String[] {
"X.java",
- "import java.util.Objects;\n" +
- "import java.util.PrimitiveIterator;\n" +
- "import java.util.Spliterator;\n" +
- "import java.util.Spliterator.OfInt;\n" +
- "import java.util.function.Consumer;\n" +
- "import java.util.function.IntConsumer;\n" +
- "\n" +
- "class IntIteratorSpliterator implements OfInt {\n" +
- " public IntIteratorSpliterator(PrimitiveIterator.OfInt arg) { }\n" +
- " public void forEachRemaining(IntConsumer action) { }\n" +
- " public boolean tryAdvance(Consumer<? super Integer> action) { return false; }\n" +
- " public long estimateSize() { return 0; }\n" +
- " public int characteristics() { return 0; }\n" +
- " public OfInt trySplit() { return null; }\n" +
- " public boolean tryAdvance(IntConsumer action) { return false; }\n" +
- "}\n" +
- "public class X {\n" +
- "\n" +
- " public Spliterator.OfInt spliterator(PrimitiveIterator.OfInt iterator) {\n" +
- " return new IntIteratorSpliterator(id(iterator));\n" +
- " }\n" +
- " <T> T id(T e) { return e; }\n" +
+ "import java.util.Objects;\n" +
+ "import java.util.PrimitiveIterator;\n" +
+ "import java.util.Spliterator;\n" +
+ "import java.util.Spliterator.OfInt;\n" +
+ "import java.util.function.Consumer;\n" +
+ "import java.util.function.IntConsumer;\n" +
+ "\n" +
+ "class IntIteratorSpliterator implements OfInt {\n" +
+ " public IntIteratorSpliterator(PrimitiveIterator.OfInt arg) { }\n" +
+ " public void forEachRemaining(IntConsumer action) { }\n" +
+ " public boolean tryAdvance(Consumer<? super Integer> action) { return false; }\n" +
+ " public long estimateSize() { return 0; }\n" +
+ " public int characteristics() { return 0; }\n" +
+ " public OfInt trySplit() { return null; }\n" +
+ " public boolean tryAdvance(IntConsumer action) { return false; }\n" +
+ "}\n" +
+ "public class X {\n" +
+ "\n" +
+ " public Spliterator.OfInt spliterator(PrimitiveIterator.OfInt iterator) {\n" +
+ " return new IntIteratorSpliterator(id(iterator));\n" +
+ " }\n" +
+ " <T> T id(T e) { return e; }\n" +
"}\n"
});
}
@@ -1074,10 +1074,10 @@ public void testBug425460orig() {
"X.java",
"import java.util.Arrays;\n" +
"public class X {\n" +
- " final Integer[] boom =\n" +
- " Arrays.asList(\"1\", \"22\", \"333\")\n" +
- " .stream()\n" +
- " .map(str -> str.length())\n" +
+ " final Integer[] boom =\n" +
+ " Arrays.asList(\"1\", \"22\", \"333\")\n" +
+ " .stream()\n" +
+ " .map(str -> str.length())\n" +
" .toArray(i -> new Integer[i]);\n" +
"}\n"
});
@@ -1088,10 +1088,10 @@ public void testBug425460variant() {
"X.java",
"import java.util.Arrays;\n" +
"public class X {\n" +
- " final Integer[] boom =\n" +
- " Arrays.asList(\"1\", \"22\", \"333\")\n" +
- " .stream()\n" +
- " .map(str -> str.length())\n" +
+ " final Integer[] boom =\n" +
+ " Arrays.asList(\"1\", \"22\", \"333\")\n" +
+ " .stream()\n" +
+ " .map(str -> str.length())\n" +
" .toArray((int i) -> new Integer[i]);\n" +
"}\n"
});
@@ -1100,76 +1100,76 @@ public void testBug425951() {
runNegativeTest(
new String[] {
"Test.java",
- "import java.util.List;\n" +
- "\n" +
- "public class Test {\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " index(new A().test());\n" +
- " }\n" +
- "\n" +
- " public static <X> void index(Iterable<X> collection)\n" +
- " {\n" +
- " }\n" +
- " \n" +
- " public class A<S extends A<S>>\n" +
- " {\n" +
- " protected A() {}\n" +
- " \n" +
- " public <T> List<T> test()\n" +
- " {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " index(new A().test());\n" +
+ " }\n" +
+ "\n" +
+ " public static <X> void index(Iterable<X> collection)\n" +
+ " {\n" +
+ " }\n" +
+ " \n" +
+ " public class A<S extends A<S>>\n" +
+ " {\n" +
+ " protected A() {}\n" +
+ " \n" +
+ " public <T> List<T> test()\n" +
+ " {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in Test.java (at line 6)\n" +
- " index(new A().test());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation index(List) of the generic method index(Iterable<X>) of type Test\n" +
- "----------\n" +
- "2. WARNING in Test.java (at line 6)\n" +
- " index(new A().test());\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to Iterable<Object>\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 6)\n" +
- " index(new A().test());\n" +
- " ^^^^^^^\n" +
- "No enclosing instance of type Test is accessible. Must qualify the allocation with an enclosing instance of type Test (e.g. x.new A() where x is an instance of Test).\n" +
- "----------\n" +
- "4. WARNING in Test.java (at line 6)\n" +
- " index(new A().test());\n" +
- " ^\n" +
- "Test.A is a raw type. References to generic type Test.A<S> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in Test.java (at line 6)\n" +
+ " index(new A().test());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation index(List) of the generic method index(Iterable<X>) of type Test\n" +
+ "----------\n" +
+ "2. WARNING in Test.java (at line 6)\n" +
+ " index(new A().test());\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to Iterable<Object>\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 6)\n" +
+ " index(new A().test());\n" +
+ " ^^^^^^^\n" +
+ "No enclosing instance of type Test is accessible. Must qualify the allocation with an enclosing instance of type Test (e.g. x.new A() where x is an instance of Test).\n" +
+ "----------\n" +
+ "4. WARNING in Test.java (at line 6)\n" +
+ " index(new A().test());\n" +
+ " ^\n" +
+ "Test.A is a raw type. References to generic type Test.A<S> should be parameterized\n" +
"----------\n");
}
public void testBug425951a() {
runConformTest(
new String[] {
"Test.java",
- "import java.util.List;\n" +
- "\n" +
- "public class Test {\n" +
- "\n" +
- " public void test() {\n" +
- " index(new A().test());\n" +
- " }\n" +
- "\n" +
- " public static <X> void index(Iterable<X> collection)\n" +
- " {\n" +
- " }\n" +
- " \n" +
- " public class A<S extends A<S>>\n" +
- " {\n" +
- " protected A() {}\n" +
- " \n" +
- " public <T> List<T> test()\n" +
- " {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " public void test() {\n" +
+ " index(new A().test());\n" +
+ " }\n" +
+ "\n" +
+ " public static <X> void index(Iterable<X> collection)\n" +
+ " {\n" +
+ " }\n" +
+ " \n" +
+ " public class A<S extends A<S>>\n" +
+ " {\n" +
+ " protected A() {}\n" +
+ " \n" +
+ " public <T> List<T> test()\n" +
+ " {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
"}\n"
});
}
@@ -1177,16 +1177,16 @@ public void testBug424906() {
runConformTest(
new String[] {
"Main.java",
- "public class Main {\n" +
- " public <T> void test(Result r) {}\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " new Main().test(r -> System.out.println(\"Hmmm...\" + r));\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "interface Result {\n" +
- " public void result(Object object);\n" +
+ "public class Main {\n" +
+ " public <T> void test(Result r) {}\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " new Main().test(r -> System.out.println(\"Hmmm...\" + r));\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "interface Result {\n" +
+ " public void result(Object object);\n" +
"}"
});
}
@@ -1194,16 +1194,16 @@ public void testBug425156() {
runConformTest(
new String[] {
"X.java",
- "interface I<T> {\n" +
- " void foo(T t);\n" +
- "}\n" +
- "public class X {\n" +
- " void bar(I<?> i) {\n" +
- " i.foo(null);\n" +
- " }\n" +
- " void run() {\n" +
- " bar((X x) -> {}); // Incompatible error reported\n" +
- " }\n" +
+ "interface I<T> {\n" +
+ " void foo(T t);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " void bar(I<?> i) {\n" +
+ " i.foo(null);\n" +
+ " }\n" +
+ " void run() {\n" +
+ " bar((X x) -> {}); // Incompatible error reported\n" +
+ " }\n" +
"}\n"
});
}
@@ -1211,71 +1211,71 @@ public void testBug425493() {
runNegativeTest(
new String[] {
"Test.java",
- "public class Test {\n" +
- " public void addAttributeBogus(Attribute<?> attribute) {\n" +
- " addAttribute(java.util.Objects.requireNonNull(attribute, \"\"),\n" +
- " attribute.getDefault());\n" +
- " addAttribute(attribute, attribute.getDefault());\n" +
- " }\n" +
- " public <T> void addAttributeOK(Attribute<T> attribute) {\n" +
- " addAttribute(java.util.Objects.requireNonNull(attribute, \"\"),\n" +
- " attribute.getDefault());\n" +
- " addAttribute(attribute, attribute.getDefault());\n" +
- " }\n" +
- "\n" +
- " private <T> void addAttribute(Attribute<T> attribute, T defaultValue) {}\n" +
- "\n" +
- " static class Attribute<T> {\n" +
- "\n" +
- " T getDefault() {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " public void addAttributeBogus(Attribute<?> attribute) {\n" +
+ " addAttribute(java.util.Objects.requireNonNull(attribute, \"\"),\n" +
+ " attribute.getDefault());\n" +
+ " addAttribute(attribute, attribute.getDefault());\n" +
+ " }\n" +
+ " public <T> void addAttributeOK(Attribute<T> attribute) {\n" +
+ " addAttribute(java.util.Objects.requireNonNull(attribute, \"\"),\n" +
+ " attribute.getDefault());\n" +
+ " addAttribute(attribute, attribute.getDefault());\n" +
+ " }\n" +
+ "\n" +
+ " private <T> void addAttribute(Attribute<T> attribute, T defaultValue) {}\n" +
+ "\n" +
+ " static class Attribute<T> {\n" +
+ "\n" +
+ " T getDefault() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 3)\n" +
- " addAttribute(java.util.Objects.requireNonNull(attribute, \"\"),\n" +
- " ^^^^^^^^^^^^\n" +
- "The method addAttribute(Test.Attribute<T>, T) in the type Test is not applicable for the arguments (Test.Attribute<capture#1-of ?>, capture#2-of ?)\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 5)\n" +
- " addAttribute(attribute, attribute.getDefault());\n" +
- " ^^^^^^^^^^^^\n" +
- "The method addAttribute(Test.Attribute<T>, T) in the type Test is not applicable for the arguments (Test.Attribute<capture#3-of ?>, capture#4-of ?)\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 3)\n" +
+ " addAttribute(java.util.Objects.requireNonNull(attribute, \"\"),\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The method addAttribute(Test.Attribute<T>, T) in the type Test is not applicable for the arguments (Test.Attribute<capture#1-of ?>, capture#2-of ?)\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 5)\n" +
+ " addAttribute(attribute, attribute.getDefault());\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The method addAttribute(Test.Attribute<T>, T) in the type Test is not applicable for the arguments (Test.Attribute<capture#3-of ?>, capture#4-of ?)\n" +
"----------\n");
}
public void testBug426366() {
runConformTest(
new String[] {
"a/Test.java",
- "package a;\n" +
- "\n" +
- "import java.util.Collections;\n" +
- "import java.util.List;\n" +
- "\n" +
- "/**\n" +
- " * @author tomschindl\n" +
- " *\n" +
- " */\n" +
- "public class Test {\n" +
- " public static class A {\n" +
- " public A(B newSelectedObject, String editorController) {\n" +
- " }\n" +
- "\n" +
- " public A(List<B> newSelectedObjects, String editorController) {\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " public static class B {\n" +
- " \n" +
- " }\n" +
- " \n" +
- " public static class C extends A {\n" +
- " public C() {\n" +
- " super(Collections.emptyList(), \"\");\n" +
- " }\n" +
- " }\n" +
+ "package a;\n" +
+ "\n" +
+ "import java.util.Collections;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "/**\n" +
+ " * @author tomschindl\n" +
+ " *\n" +
+ " */\n" +
+ "public class Test {\n" +
+ " public static class A {\n" +
+ " public A(B newSelectedObject, String editorController) {\n" +
+ " }\n" +
+ "\n" +
+ " public A(List<B> newSelectedObjects, String editorController) {\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " public static class B {\n" +
+ " \n" +
+ " }\n" +
+ " \n" +
+ " public static class C extends A {\n" +
+ " public C() {\n" +
+ " super(Collections.emptyList(), \"\");\n" +
+ " }\n" +
+ " }\n" +
"}\n"
});
}
@@ -1283,25 +1283,25 @@ public void testBug426290() {
runConformTest(
new String[] {
"X.java",
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String argv[]) {\n" +
- " goo(foo());\n" +
- " }\n" +
- "\n" +
- " static <T extends Number> List<T> foo() {\n" +
- " return new ArrayList<T>();\n" +
- " }\n" +
- "\n" +
- " static void goo(Object p1) {\n" +
- " System.out.println(\"goo(Object)\");\n" +
- " }\n" +
- "\n" +
- " static void goo(List<Integer> p1) {\n" +
- " System.out.println(\"goo(List<Integer>)\");\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String argv[]) {\n" +
+ " goo(foo());\n" +
+ " }\n" +
+ "\n" +
+ " static <T extends Number> List<T> foo() {\n" +
+ " return new ArrayList<T>();\n" +
+ " }\n" +
+ "\n" +
+ " static void goo(Object p1) {\n" +
+ " System.out.println(\"goo(Object)\");\n" +
+ " }\n" +
+ "\n" +
+ " static void goo(List<Integer> p1) {\n" +
+ " System.out.println(\"goo(List<Integer>)\");\n" +
+ " }\n" +
"}\n"
},
"goo(List<Integer>)");
@@ -1310,23 +1310,23 @@ public void testBug425152() {
runConformTest(
new String[] {
"packDown/SorterNew.java",
- "package packDown;\n" +
- "\n" +
- "import java.util.ArrayList;\n" +
- "import java.util.Collections;\n" +
- "import java.util.Comparator;\n" +
- "\n" +
- "public class SorterNew {\n" +
- " void sort() {\n" +
- " Collections.sort(new ArrayList<Person>(),\n" +
- " Comparator.comparing((Person p) -> p.getName()));\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Person {\n" +
- " public String getName() {\n" +
- " return \"p\";\n" +
- " }\n" +
+ "package packDown;\n" +
+ "\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.Collections;\n" +
+ "import java.util.Comparator;\n" +
+ "\n" +
+ "public class SorterNew {\n" +
+ " void sort() {\n" +
+ " Collections.sort(new ArrayList<Person>(),\n" +
+ " Comparator.comparing((Person p) -> p.getName()));\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class Person {\n" +
+ " public String getName() {\n" +
+ " return \"p\";\n" +
+ " }\n" +
"}\n"
});
}
@@ -1334,68 +1334,68 @@ public void testBug426048() {
runNegativeTest(
new String[] {
"MyFunction.java",
- "import java.lang.annotation.Annotation;\n" +
- "import java.lang.annotation.ElementType;\n" +
- "import java.lang.annotation.Target;\n" +
- "\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@interface Throws {\n" +
- " Class<? extends Throwable>[] value() default Throwable.class;\n" +
- " Returns method() default @Returns(Annotation.class);\n" +
- "}\n" +
- "\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@interface Returns {\n" +
- " Class<? extends Annotation> value() default Annotation.class;\n" +
- "}\n" +
- "\n" +
- "@FunctionalInterface public interface MyFunction<T, @Returns R> {\n" +
- " @Returns R apply(T t);\n" +
- "\n" +
- " default <V> @Throws(((MyFunction<? super V, ? extends T>) before::apply) @Returns MyFunction<V, @Returns R>\n" +
- " compose(MyFunction<? super V, ? extends T> before) {\n" +
- "\n" +
- " return (V v) -> apply(before.apply(v));\n" +
- " }\n" +
+ "import java.lang.annotation.Annotation;\n" +
+ "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@interface Throws {\n" +
+ " Class<? extends Throwable>[] value() default Throwable.class;\n" +
+ " Returns method() default @Returns(Annotation.class);\n" +
+ "}\n" +
+ "\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@interface Returns {\n" +
+ " Class<? extends Annotation> value() default Annotation.class;\n" +
+ "}\n" +
+ "\n" +
+ "@FunctionalInterface public interface MyFunction<T, @Returns R> {\n" +
+ " @Returns R apply(T t);\n" +
+ "\n" +
+ " default <V> @Throws(((MyFunction<? super V, ? extends T>) before::apply) @Returns MyFunction<V, @Returns R>\n" +
+ " compose(MyFunction<? super V, ? extends T> before) {\n" +
+ "\n" +
+ " return (V v) -> apply(before.apply(v));\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in MyFunction.java (at line 19)\n" +
- " default <V> @Throws(((MyFunction<? super V, ? extends T>) before::apply) @Returns MyFunction<V, @Returns R>\n" +
- " ^\n" +
- "Syntax error, insert \"Type Identifier (\" to complete MethodHeaderName\n" +
- "----------\n" +
- "2. ERROR in MyFunction.java (at line 19)\n" +
- " default <V> @Throws(((MyFunction<? super V, ? extends T>) before::apply) @Returns MyFunction<V, @Returns R>\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from MyFunction<capture#1-of ? super V,capture#2-of ? extends T> to Class<? extends Throwable>[]\n" +
- "----------\n" +
- "3. ERROR in MyFunction.java (at line 19)\n" +
- " default <V> @Throws(((MyFunction<? super V, ? extends T>) before::apply) @Returns MyFunction<V, @Returns R>\n" +
- " ^^^^^^\n" +
- "before cannot be resolved\n" +
- "----------\n" +
- "4. ERROR in MyFunction.java (at line 19)\n" +
- " default <V> @Throws(((MyFunction<? super V, ? extends T>) before::apply) @Returns MyFunction<V, @Returns R>\n" +
- " ^\n" +
- "Syntax error, insert \")\" to complete Modifiers\n" +
- "----------\n" +
- "5. ERROR in MyFunction.java (at line 20)\n" +
- " compose(MyFunction<? super V, ? extends T> before) {\n" +
- " ^\n" +
- "Syntax error on token \"(\", , expected\n" +
+ "----------\n" +
+ "1. ERROR in MyFunction.java (at line 19)\n" +
+ " default <V> @Throws(((MyFunction<? super V, ? extends T>) before::apply) @Returns MyFunction<V, @Returns R>\n" +
+ " ^\n" +
+ "Syntax error, insert \"Type Identifier (\" to complete MethodHeaderName\n" +
+ "----------\n" +
+ "2. ERROR in MyFunction.java (at line 19)\n" +
+ " default <V> @Throws(((MyFunction<? super V, ? extends T>) before::apply) @Returns MyFunction<V, @Returns R>\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from MyFunction<capture#1-of ? super V,capture#2-of ? extends T> to Class<? extends Throwable>[]\n" +
+ "----------\n" +
+ "3. ERROR in MyFunction.java (at line 19)\n" +
+ " default <V> @Throws(((MyFunction<? super V, ? extends T>) before::apply) @Returns MyFunction<V, @Returns R>\n" +
+ " ^^^^^^\n" +
+ "before cannot be resolved\n" +
+ "----------\n" +
+ "4. ERROR in MyFunction.java (at line 19)\n" +
+ " default <V> @Throws(((MyFunction<? super V, ? extends T>) before::apply) @Returns MyFunction<V, @Returns R>\n" +
+ " ^\n" +
+ "Syntax error, insert \")\" to complete Modifiers\n" +
+ "----------\n" +
+ "5. ERROR in MyFunction.java (at line 20)\n" +
+ " compose(MyFunction<? super V, ? extends T> before) {\n" +
+ " ^\n" +
+ "Syntax error on token \"(\", , expected\n" +
"----------\n");
}
public void testBug426540() {
runConformTest(
new String[] {
"X.java",
- "import java.util.stream.Stream;\n" +
- "import java.util.Collections;\n" +
- "import static java.util.stream.Collectors.collectingAndThen;\n" +
- "import static java.util.stream.Collectors.toList;\n" +
- "public class X {\n" +
- " Object o = ((Stream<Integer>) null).collect(collectingAndThen(toList(), Collections::unmodifiableList));\n" +
+ "import java.util.stream.Stream;\n" +
+ "import java.util.Collections;\n" +
+ "import static java.util.stream.Collectors.collectingAndThen;\n" +
+ "import static java.util.stream.Collectors.toList;\n" +
+ "public class X {\n" +
+ " Object o = ((Stream<Integer>) null).collect(collectingAndThen(toList(), Collections::unmodifiableList));\n" +
"}\n"
});
}
@@ -1403,15 +1403,15 @@ public void testBug426671_ok() {
runConformTest(
new String[] {
"X.java",
- "import java.util.stream.Stream;\n" +
- "import java.util.*;\n" +
- "import static java.util.stream.Collectors.collectingAndThen;\n" +
- "import static java.util.stream.Collectors.toList;\n" +
+ "import java.util.stream.Stream;\n" +
+ "import java.util.*;\n" +
+ "import static java.util.stream.Collectors.collectingAndThen;\n" +
+ "import static java.util.stream.Collectors.toList;\n" +
"public class X {\n" +
" void test(Stream<List<Integer>> stream) {\n" +
" stream.collect(collectingAndThen(toList(), Collections::<List<Integer>>unmodifiableList))\n" +
" .remove(0);\n" +
- " }\n" +
+ " }\n" +
"}\n"
});
}
@@ -1419,15 +1419,15 @@ public void testBug426671_medium() {
runConformTest(
new String[] {
"X.java",
- "import java.util.stream.Stream;\n" +
- "import java.util.*;\n" +
- "import static java.util.stream.Collectors.collectingAndThen;\n" +
- "import static java.util.stream.Collectors.toList;\n" +
+ "import java.util.stream.Stream;\n" +
+ "import java.util.*;\n" +
+ "import static java.util.stream.Collectors.collectingAndThen;\n" +
+ "import static java.util.stream.Collectors.toList;\n" +
"public class X {\n" +
" void test(Stream<List<Integer>> stream) {\n" +
" stream.collect(collectingAndThen(toList(), Collections::unmodifiableList))\n" +
" .remove(0);\n" +
- " }\n" +
+ " }\n" +
"}\n"
});
}
@@ -1435,15 +1435,15 @@ public void testBug426671_full() {
runConformTest(
new String[] {
"X.java",
- "import java.util.stream.Stream;\n" +
- "import java.util.*;\n" +
- "import static java.util.stream.Collectors.collectingAndThen;\n" +
- "import static java.util.stream.Collectors.toList;\n" +
+ "import java.util.stream.Stream;\n" +
+ "import java.util.*;\n" +
+ "import static java.util.stream.Collectors.collectingAndThen;\n" +
+ "import static java.util.stream.Collectors.toList;\n" +
"public class X {\n" +
" void test() {\n" +
" Arrays.asList((List<Integer>) null).stream().collect(collectingAndThen(toList(), Collections::unmodifiableList))\n" +
" .remove(0);\n" +
- " }\n" +
+ " }\n" +
"}\n"
});
}
@@ -1451,40 +1451,40 @@ public void testBug426671b() {
runNegativeTest(
new String[] {
"Test.java",
- "interface I<X,Y> {\n" +
- " Y fun(X y);\n" +
- "}\n" +
- "public class Test {\n" +
- " static <S> S id(S s) { return s; }\n" +
- " void test() {\n" +
- " m1(Test::id, \"Hi\");\n" +
- " m2(Test::id, \"Hi\").toUpperCase();\n" +
- " m3(Test::id, \"Hi\").toUpperCase();\n" +
- " }\n" +
- "\n" +
+ "interface I<X,Y> {\n" +
+ " Y fun(X y);\n" +
+ "}\n" +
+ "public class Test {\n" +
+ " static <S> S id(S s) { return s; }\n" +
+ " void test() {\n" +
+ " m1(Test::id, \"Hi\");\n" +
+ " m2(Test::id, \"Hi\").toUpperCase();\n" +
+ " m3(Test::id, \"Hi\").toUpperCase();\n" +
+ " }\n" +
+ "\n" +
" <U,V> void m1(I<V,U> i, U u) { }\n" +
- " <U,V> V m2(I<V,U> i, U u) {\n" +
- " return null;\n" +
- " }\n" +
- " <U,V> V m3(I<U,V> i, U u) {\n" +
- " return null;\n" +
- " }\n" +
+ " <U,V> V m2(I<V,U> i, U u) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " <U,V> V m3(I<U,V> i, U u) {\n" +
+ " return null;\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 8)\n" +
- " m2(Test::id, \"Hi\").toUpperCase();\n" +
- " ^^^^^^^^^^^\n" +
- "The method toUpperCase() is undefined for the type Object\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 8)\n" +
+ " m2(Test::id, \"Hi\").toUpperCase();\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method toUpperCase() is undefined for the type Object\n" +
"----------\n");
}
public void testBug426652() {
runConformTest(
new String[] {
"X.java",
- "import static java.util.stream.Collectors.toList;\n" +
- "public class X {\n" +
- " Object o = toList();\n" +
+ "import static java.util.stream.Collectors.toList;\n" +
+ "public class X {\n" +
+ " Object o = toList();\n" +
"}\n"
});
}
@@ -1492,21 +1492,21 @@ public void testBug426778() {
runConformTest(
new String[] {
"X.java",
- "import java.util.*;\n" +
- "public class X {\n" +
- " void test(List<CourseProviderEmploymentStatistics> result) {\n" +
- " Collections.sort( result, \n" +
- " Comparator.comparingInt(\n" +
- " (CourseProviderEmploymentStatistics stat) -> stat.doneTrainingsTotal\n" +
- " )\n" +
- " .reversed()\n" +
- " .thenComparing(\n" +
- " (CourseProviderEmploymentStatistics stat) -> stat.courseProviderName ) );\n" +
- " }\n" +
- "}\n" +
- "class CourseProviderEmploymentStatistics {\n" +
- " int doneTrainingsTotal;\n" +
- " String courseProviderName;\n" +
+ "import java.util.*;\n" +
+ "public class X {\n" +
+ " void test(List<CourseProviderEmploymentStatistics> result) {\n" +
+ " Collections.sort( result, \n" +
+ " Comparator.comparingInt(\n" +
+ " (CourseProviderEmploymentStatistics stat) -> stat.doneTrainingsTotal\n" +
+ " )\n" +
+ " .reversed()\n" +
+ " .thenComparing(\n" +
+ " (CourseProviderEmploymentStatistics stat) -> stat.courseProviderName ) );\n" +
+ " }\n" +
+ "}\n" +
+ "class CourseProviderEmploymentStatistics {\n" +
+ " int doneTrainingsTotal;\n" +
+ " String courseProviderName;\n" +
"}\n"
});
}
@@ -1514,24 +1514,24 @@ public void testBug426676() {
runConformTest(
new String[] {
"Test.java",
- "import java.util.Arrays;\n" +
- "import java.util.function.Supplier;\n" +
- "import java.util.stream.Stream;\n" +
- "\n" +
- "\n" +
- "public class Test {\n" +
- " public static void main(String[] args) throws Exception {\n" +
- " // Type inference works on map call.\n" +
- " Stream<String> s1 =\n" +
- " Arrays.stream(new Integer[] { 1, 2 })\n" +
- " .map(i -> i.toString());\n" +
- " \n" +
- " // Type inference doesn't work on map call.\n" +
- " Stream<String> s2 =\n" +
- " Arrays.stream(new Integer[] { 1, 2 })\n" +
- " .map(i -> i.toString())\n" +
- " .distinct();\n" +
- " }\n" +
+ "import java.util.Arrays;\n" +
+ "import java.util.function.Supplier;\n" +
+ "import java.util.stream.Stream;\n" +
+ "\n" +
+ "\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) throws Exception {\n" +
+ " // Type inference works on map call.\n" +
+ " Stream<String> s1 =\n" +
+ " Arrays.stream(new Integer[] { 1, 2 })\n" +
+ " .map(i -> i.toString());\n" +
+ " \n" +
+ " // Type inference doesn't work on map call.\n" +
+ " Stream<String> s2 =\n" +
+ " Arrays.stream(new Integer[] { 1, 2 })\n" +
+ " .map(i -> i.toString())\n" +
+ " .distinct();\n" +
+ " }\n" +
"}\n"
});
}
@@ -1539,14 +1539,14 @@ public void testBug424591_comment20() {
runConformTest(
new String[] {
"MyList.java",
- "import java.util.Arrays;\n" +
- "public class MyList {\n" +
- " protected Object[] elements;\n" +
- " private int size;\n" +
- " @SuppressWarnings(\"unchecked\")\n" +
- " public <A> A[] toArray(A[] a) {\n" +
- " return (A[]) Arrays.copyOf(elements, size, a.getClass());\n" +
- " }\n" +
+ "import java.util.Arrays;\n" +
+ "public class MyList {\n" +
+ " protected Object[] elements;\n" +
+ " private int size;\n" +
+ " @SuppressWarnings(\"unchecked\")\n" +
+ " public <A> A[] toArray(A[] a) {\n" +
+ " return (A[]) Arrays.copyOf(elements, size, a.getClass());\n" +
+ " }\n" +
"}\n"
});
}
@@ -1554,35 +1554,35 @@ public void testBug424591_comment20_variant() {
runNegativeTest(
new String[] {
"MyList.java",
- "import java.util.Arrays;\n" +
- "public class MyList {\n" +
- " protected Object[] elements;\n" +
- " private int size;\n" +
- " @SuppressWarnings(\"unchecked\")\n" +
- " public <A> A[] toArray(A[] a) {\n" +
- " return (A[]) Arrays.copyOf(elements, size, getClass());\n" +
- " }\n" +
+ "import java.util.Arrays;\n" +
+ "public class MyList {\n" +
+ " protected Object[] elements;\n" +
+ " private int size;\n" +
+ " @SuppressWarnings(\"unchecked\")\n" +
+ " public <A> A[] toArray(A[] a) {\n" +
+ " return (A[]) Arrays.copyOf(elements, size, getClass());\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in MyList.java (at line 7)\n" +
- " return (A[]) Arrays.copyOf(elements, size, getClass());\n" +
- " ^^^^^^\n" +
- "The method copyOf(U[], int, Class<? extends T[]>) in the type Arrays is not applicable for the arguments (Object[], int, Class<capture#1-of ? extends MyList>)\n" +
+ "----------\n" +
+ "1. ERROR in MyList.java (at line 7)\n" +
+ " return (A[]) Arrays.copyOf(elements, size, getClass());\n" +
+ " ^^^^^^\n" +
+ "The method copyOf(U[], int, Class<? extends T[]>) in the type Arrays is not applicable for the arguments (Object[], int, Class<capture#1-of ? extends MyList>)\n" +
"----------\n");
}
public void testBug424591_comment22() {
runConformTest(
new String[] {
"Test.java",
- "import java.util.*;\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " Test.forObject(new HashSet<>());\n" +
- " }\n" +
- " public static Test forObject(Object o) {\n" +
- " return null;\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " Test.forObject(new HashSet<>());\n" +
+ " }\n" +
+ " public static Test forObject(Object o) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
});
}
@@ -1590,11 +1590,11 @@ public void testBug425063() {
runConformTest(
new String[] {
"ComparatorUse.java",
- "import java.util.Comparator;\n" +
- "public class ComparatorUse {\n" +
- " Comparator<String> c =\n" +
- " Comparator.comparing((String s)->s.toString())\n" +
- " .thenComparing(s -> s.length());\n" +
+ "import java.util.Comparator;\n" +
+ "public class ComparatorUse {\n" +
+ " Comparator<String> c =\n" +
+ " Comparator.comparing((String s)->s.toString())\n" +
+ " .thenComparing(s -> s.length());\n" +
"}\n"
});
}
@@ -1602,16 +1602,16 @@ public void testBug426764() {
runConformTest(
new String[] {
"X.java",
- "interface I {}\n" +
- "class C1 implements I {}\n" +
- "class C2 implements I {}\n" +
- "public class X {\n" +
- " <T > void foo(T p1, I p2) {}\n" +
- " <T extends I> void foo(T p1, I p2) {}\n" +
- " void bar() {\n" +
- " foo(true ? new C1(): new C2(), false ? new C2(): new C1());\n" +
- " foo(new C1(), false ? new C2(): new C1());\n" +
- " }\n" +
+ "interface I {}\n" +
+ "class C1 implements I {}\n" +
+ "class C2 implements I {}\n" +
+ "public class X {\n" +
+ " <T > void foo(T p1, I p2) {}\n" +
+ " <T extends I> void foo(T p1, I p2) {}\n" +
+ " void bar() {\n" +
+ " foo(true ? new C1(): new C2(), false ? new C2(): new C1());\n" +
+ " foo(new C1(), false ? new C2(): new C1());\n" +
+ " }\n" +
"}\n"
});
}
@@ -1620,21 +1620,21 @@ public void testBug424930a() {
runConformTest(
new String[] {
"X.java",
- "import java.util.ArrayDeque;\n" +
- "import java.util.Deque;\n" +
- "import java.util.function.Supplier;\n" +
- "\n" +
- "public class X<S, T extends Deque<S>> {\n" +
- " private final Supplier<T> supplier;\n" +
- "\n" +
- " public X(Supplier<T> supplier) {\n" +
- " this.supplier = supplier;\n" +
- " }\n" +
+ "import java.util.ArrayDeque;\n" +
+ "import java.util.Deque;\n" +
+ "import java.util.function.Supplier;\n" +
+ "\n" +
+ "public class X<S, T extends Deque<S>> {\n" +
+ " private final Supplier<T> supplier;\n" +
+ "\n" +
+ " public X(Supplier<T> supplier) {\n" +
+ " this.supplier = supplier;\n" +
+ " }\n" +
" \n" +
- " int dequeCapacity;\n" +
- " public static <S> X<S, Deque<S>> newDefaultMap() {\n" +
- " return new X<>(() -> new ArrayDeque<>(13));\n" +
- " }\n" +
+ " int dequeCapacity;\n" +
+ " public static <S> X<S, Deque<S>> newDefaultMap() {\n" +
+ " return new X<>(() -> new ArrayDeque<>(13));\n" +
+ " }\n" +
"}\n"
});
}
@@ -1643,20 +1643,20 @@ public void testBug424930b() {
runConformTest(
new String[] {
"X.java",
- "import java.util.ArrayDeque;\n" +
- "import java.util.Deque;\n" +
- "import java.util.function.Supplier;\n" +
- "\n" +
- "public class X<S, T extends Deque<S>> {\n" +
- " private final Supplier<T> supplier;\n" +
- "\n" +
- " public X(Supplier<T> supplier) {\n" +
- " this.supplier = supplier;\n" +
- " }\n" +
- " \n" +
- " public static <S> X<S, Deque<S>> newDefaultMap(int dequeCapacity) {\n" +
- " return new X<>(() -> new ArrayDeque<>(dequeCapacity));\n" +
- " }\n" +
+ "import java.util.ArrayDeque;\n" +
+ "import java.util.Deque;\n" +
+ "import java.util.function.Supplier;\n" +
+ "\n" +
+ "public class X<S, T extends Deque<S>> {\n" +
+ " private final Supplier<T> supplier;\n" +
+ "\n" +
+ " public X(Supplier<T> supplier) {\n" +
+ " this.supplier = supplier;\n" +
+ " }\n" +
+ " \n" +
+ " public static <S> X<S, Deque<S>> newDefaultMap(int dequeCapacity) {\n" +
+ " return new X<>(() -> new ArrayDeque<>(dequeCapacity));\n" +
+ " }\n" +
"}\n"
});
}
@@ -1665,40 +1665,40 @@ public void testBug424930c() {
runNegativeTest(
new String[] {
"X.java",
- "import java.util.ArrayDeque;\n" +
- "import java.util.Deque;\n" +
- "import java.util.function.Supplier;\n" +
- "\n" +
- "public class X<S, T extends Deque<S>> {\n" +
- " private final Supplier<T> supplier;\n" +
- "\n" +
- " public X(Supplier<T> supplier) {\n" +
- " this.supplier = supplier;\n" +
- " }\n" +
+ "import java.util.ArrayDeque;\n" +
+ "import java.util.Deque;\n" +
+ "import java.util.function.Supplier;\n" +
+ "\n" +
+ "public class X<S, T extends Deque<S>> {\n" +
+ " private final Supplier<T> supplier;\n" +
+ "\n" +
+ " public X(Supplier<T> supplier) {\n" +
+ " this.supplier = supplier;\n" +
+ " }\n" +
" \n" +
- " int dequeCapacity;\n" +
- " public static <S> X<S, Deque<S>> newDefaultMap() {\n" +
- " return new X<>(() -> new ArrayDeque<>(dequeCapacity));\n" +
- " }\n" +
+ " int dequeCapacity;\n" +
+ " public static <S> X<S, Deque<S>> newDefaultMap() {\n" +
+ " return new X<>(() -> new ArrayDeque<>(dequeCapacity));\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 14)\n" +
- " return new X<>(() -> new ArrayDeque<>(dequeCapacity));\n" +
- " ^^^^^^^^^^^^^\n" +
- "Cannot make a static reference to the non-static field dequeCapacity\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 14)\n" +
+ " return new X<>(() -> new ArrayDeque<>(dequeCapacity));\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Cannot make a static reference to the non-static field dequeCapacity\n" +
"----------\n");
}
public void testBug426998a() {
runConformTest(
new String[] {
"Snippet.java",
- "public class Snippet {\n" +
- " static void call(Class type, long init) {\n" +
- " String string = new String();\n" +
- " method(type, init == 0 ? new String() : string);\n" +
- " }\n" +
- " private static void method(Class type, String s) {}\n" +
+ "public class Snippet {\n" +
+ " static void call(Class type, long init) {\n" +
+ " String string = new String();\n" +
+ " method(type, init == 0 ? new String() : string);\n" +
+ " }\n" +
+ " private static void method(Class type, String s) {}\n" +
"}\n"
});
}
@@ -1707,14 +1707,14 @@ public void testBug426998b() {
runConformTest(
new String[] {
"Snippet.java",
- "public class Snippet {\n" +
- " private static final String PLACEHOLDER_MEMORY = new String();\n" +
- "\n" +
- " static void newInstance(Class type, long init) {\n" +
- " method(type, init == 0 ? new String() : PLACEHOLDER_MEMORY);\n" +
- " }\n" +
- "\n" +
- " private static void method(Class type, String str) {}\n" +
+ "public class Snippet {\n" +
+ " private static final String PLACEHOLDER_MEMORY = new String();\n" +
+ "\n" +
+ " static void newInstance(Class type, long init) {\n" +
+ " method(type, init == 0 ? new String() : PLACEHOLDER_MEMORY);\n" +
+ " }\n" +
+ "\n" +
+ " private static void method(Class type, String str) {}\n" +
"}\n"
});
}
@@ -1722,34 +1722,34 @@ public void testBug427164() {
runNegativeTest(
new String[] {
"NNLambda.java",
- "import java.util.*;\n" +
- "\n" +
- "@FunctionalInterface\n" +
- "interface FInter {\n" +
- " String allToString(List<String> input);\n" +
- "}\n" +
- "\n" +
- "public abstract class NNLambda {\n" +
- " abstract <INP> void printem(FInter conv, INP single);\n" +
- " \n" +
- " void test() {\n" +
- " printem((i) -> {\n" +
- " Collections.<String>singletonList(\"const\")\n" +
- " }, \n" +
- " \"single\");\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "\n" +
+ "@FunctionalInterface\n" +
+ "interface FInter {\n" +
+ " String allToString(List<String> input);\n" +
+ "}\n" +
+ "\n" +
+ "public abstract class NNLambda {\n" +
+ " abstract <INP> void printem(FInter conv, INP single);\n" +
+ " \n" +
+ " void test() {\n" +
+ " printem((i) -> {\n" +
+ " Collections.<String>singletonList(\"const\")\n" +
+ " }, \n" +
+ " \"single\");\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in NNLambda.java (at line 1)\n" +
- " printem((i) -> {\n" +
- " ^^^^^^^\n" +
- "The method printem(FInter, INP) in the type NNLambda is not applicable for the arguments (FInter, String)\n" +
- "----------\n" +
- "2. ERROR in NNLambda.java (at line 13)\n" +
- " Collections.<String>singletonList(\"const\")\n" +
- " ^\n" +
- "Syntax error, insert \";\" to complete BlockStatements\n" +
+ "----------\n" +
+ "1. ERROR in NNLambda.java (at line 1)\n" +
+ " printem((i) -> {\n" +
+ " ^^^^^^^\n" +
+ "The method printem(FInter, INP) in the type NNLambda is not applicable for the arguments (FInter, String)\n" +
+ "----------\n" +
+ "2. ERROR in NNLambda.java (at line 13)\n" +
+ " Collections.<String>singletonList(\"const\")\n" +
+ " ^\n" +
+ "Syntax error, insert \";\" to complete BlockStatements\n" +
"----------\n",
true); // statement recovery
}
@@ -1757,50 +1757,50 @@ public void testBug427168() {
runNegativeTest(
new String[] {
"X.java",
- "interface Producer<T> {\n" +
- " <P> P produce();\n" +
- "}\n" +
- "public class X {\n" +
- " <T> void perform(Producer<T> r) { }\n" +
- " void test() {\n" +
- " perform(() -> 13); \n" +
- " }\n" +
+ "interface Producer<T> {\n" +
+ " <P> P produce();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " <T> void perform(Producer<T> r) { }\n" +
+ " void test() {\n" +
+ " perform(() -> 13); \n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " perform(() -> 13); \n" +
- " ^^^^^^^\n" +
- "The method perform(Producer<T>) in the type X is not applicable for the arguments (() -> {})\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " perform(() -> 13); \n" +
- " ^^^^^^^^\n" +
- "Illegal lambda expression: Method produce of type Producer<T> is generic \n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " perform(() -> 13); \n" +
+ " ^^^^^^^\n" +
+ "The method perform(Producer<T>) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " perform(() -> 13); \n" +
+ " ^^^^^^^^\n" +
+ "Illegal lambda expression: Method produce of type Producer<T> is generic \n" +
"----------\n");
}
public void testBug427196() {
runConformTest(
new String[] {
"MainTest.java",
- "import java.util.ArrayList;\n" +
- "import java.util.Collection;\n" +
- "import java.util.List;\n" +
- "import java.util.function.Function;\n" +
- "\n" +
- "public class MainTest {\n" +
- " public static <T> List<T> copyOf (Collection<T> c) {\n" +
- " return new ArrayList<>(c);\n" +
- " }\n" +
- " \n" +
- " public static <T> List<T> copyOf (Iterable<T> c) {\n" +
- " return new ArrayList<>();\n" +
- " }\n" +
- " \n" +
- " public static void main (String[] args) {\n" +
- " Function<Collection<String>, List<String>> function1 = c -> MainTest.copyOf(c); //OK\n" +
- " Function<Collection<String>, List<String>> function2 = MainTest::copyOf; //error\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.List;\n" +
+ "import java.util.function.Function;\n" +
+ "\n" +
+ "public class MainTest {\n" +
+ " public static <T> List<T> copyOf (Collection<T> c) {\n" +
+ " return new ArrayList<>(c);\n" +
+ " }\n" +
+ " \n" +
+ " public static <T> List<T> copyOf (Iterable<T> c) {\n" +
+ " return new ArrayList<>();\n" +
+ " }\n" +
+ " \n" +
+ " public static void main (String[] args) {\n" +
+ " Function<Collection<String>, List<String>> function1 = c -> MainTest.copyOf(c); //OK\n" +
+ " Function<Collection<String>, List<String>> function2 = MainTest::copyOf; //error\n" +
+ " }\n" +
"}\n"
});
}
@@ -1809,12 +1809,12 @@ public void testBug427224() {
new String[] {
"Test2.java",
"import java.util.*;\n" +
- "public class Test2 {\n" +
- " public static native <T> T applyToSet(java.util.Set<String> s);\n" +
- "\n" +
- " public static void applyToList(java.util.List<String> s) {\n" +
- " applyToSet(new java.util.HashSet<>(s));\n" +
- " }\n" +
+ "public class Test2 {\n" +
+ " public static native <T> T applyToSet(java.util.Set<String> s);\n" +
+ "\n" +
+ " public static void applyToList(java.util.List<String> s) {\n" +
+ " applyToSet(new java.util.HashSet<>(s));\n" +
+ " }\n" +
"}\n"
});
}
@@ -1825,27 +1825,27 @@ public void testBug424637() {
runConformTest(
new String[] {
"X.java",
- "interface I {\n" +
- " String foo(X x, String s2);\n" +
- "}\n" +
- "\n" +
- "public class X {\n" +
- " String goo(String ...ts) {\n" +
- " System.out.println(ts[0]); \n" +
- " return ts[0];\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = X::goo;\n" +
- " String s = i.foo(new X(), \"world\");\n" +
- " System.out.println(s); \n" +
- " }\n" +
+ "interface I {\n" +
+ " String foo(X x, String s2);\n" +
+ "}\n" +
+ "\n" +
+ "public class X {\n" +
+ " String goo(String ...ts) {\n" +
+ " System.out.println(ts[0]); \n" +
+ " return ts[0];\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " I i = X::goo;\n" +
+ " String s = i.foo(new X(), \"world\");\n" +
+ " System.out.println(s); \n" +
+ " }\n" +
"}\n"
},
"world\n" +
"world",
options);
}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=427218, [1.8][compiler] Verify error varargs + inference
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=427218, [1.8][compiler] Verify error varargs + inference
public void test427218_reduced() {
runNegativeTest(
new String[] {
@@ -1858,24 +1858,24 @@ public void test427218_reduced() {
" public static void match(boolean b, Object foo) { }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " match(getLast(\"a\"), null);\n" +
- " ^^^^^\n" +
- "The method match(boolean, Object) in the type X is not applicable for the arguments (String, null)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " match(getLast(\"a\"), null);\n" +
- " ^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from String to boolean\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 5)\n" +
- " public static <T> T getLast(T... array) { return null; } // same with T[]\n" +
- " ^^^^^\n" +
- "Type safety: Potential heap pollution via varargs parameter array\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " match(getLast(\"a\"), null);\n" +
+ " ^^^^^\n" +
+ "The method match(boolean, Object) in the type X is not applicable for the arguments (String, null)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " match(getLast(\"a\"), null);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from String to boolean\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 5)\n" +
+ " public static <T> T getLast(T... array) { return null; } // same with T[]\n" +
+ " ^^^^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter array\n" +
"----------\n");
}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=427218, [1.8][compiler] Verify error varargs + inference
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=427218, [1.8][compiler] Verify error varargs + inference
public void test427218() {
runConformTest(
new String[] {
@@ -1896,16 +1896,16 @@ public void testBug427223() {
new String[] {
"Test.java",
"import java.util.*;\n" +
- "public class Test {\n" +
- "\n" +
- " List<Object> toList(Object o) {\n" +
- " if (o instanceof Optional) {\n" +
- " return Arrays.asList(((Optional<?>) o).orElse(null));\n" +
- " } else {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " List<Object> toList(Object o) {\n" +
+ " if (o instanceof Optional) {\n" +
+ " return Arrays.asList(((Optional<?>) o).orElse(null));\n" +
+ " } else {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
"}\n"
});
}
@@ -1915,9 +1915,9 @@ public void testBug425183_comment8() {
new String[] {
"X.java",
"public class X {\n" +
- " public static void main(String... args) {\n" +
+ " public static void main(String... args) {\n" +
" java.util.Comparator.reverseOrder().thenComparingLong(X::toLong);\n" +
- " System.out.println(\"ok\");\n" +
+ " System.out.println(\"ok\");\n" +
" }\n" +
" static <T> long toLong(T in) { return 0L; }\n" +
"}\n"
@@ -1931,11 +1931,11 @@ public void testBug427483() {
"import java.util.*;\n" +
"public class X {\n" +
" void test() {\n" +
- " new TreeSet<>((String qn1, String qn2) -> {\n" +
- " boolean b = true;\n" +
- " System.out.println(b); // ok\n" +
- " if(b) { }\n" +
- " return qn1.compareTo(qn2);\n" +
+ " new TreeSet<>((String qn1, String qn2) -> {\n" +
+ " boolean b = true;\n" +
+ " System.out.println(b); // ok\n" +
+ " if(b) { }\n" +
+ " return qn1.compareTo(qn2);\n" +
" });\n" +
" }\n" +
"}\n"
@@ -1945,16 +1945,16 @@ public void testBug427504() {
runConformTest(
new String[] {
"Test.java",
- "public class Test {\n" +
- "\n" +
- " public static <T> Tree<T> model(T o) {\n" +
- " return Node(Leaf(o), Leaf(o));\n" +
- " }\n" +
- " \n" +
- " interface Tree<T> {}\n" +
- " static <T> Tree<T> Node(Tree<T>... children) { return null; }\n" +
- " static <T> Tree<T> Leaf(T o) { return null; }\n" +
- " \n" +
+ "public class Test {\n" +
+ "\n" +
+ " public static <T> Tree<T> model(T o) {\n" +
+ " return Node(Leaf(o), Leaf(o));\n" +
+ " }\n" +
+ " \n" +
+ " interface Tree<T> {}\n" +
+ " static <T> Tree<T> Node(Tree<T>... children) { return null; }\n" +
+ " static <T> Tree<T> Leaf(T o) { return null; }\n" +
+ " \n" +
"}\n"
});
}
@@ -1962,36 +1962,36 @@ public void testBug427479() {
runConformTest(
new String[] {
"Bug.java",
- "import java.util.*;\n" +
- "import java.util.function.BinaryOperator; \n" +
- "import java.util.stream.*;\n" +
- "\n" +
- "public class Bug {\n" +
- " \n" +
- " static List<String> names = Arrays.asList(\n" +
- " \"ddd\",\n" +
- " \"s\",\n" +
- " \"sdfs\",\n" +
- " \"sfdf d\"); \n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " BinaryOperator<List<String>> merge = (List<String> first, List<String> second) -> {\n" +
- " first.addAll(second);\n" +
- " return first;\n" +
- " };\n" +
- " \n" +
- " Collector<String,?,Map<Integer,List<String>>> collector= Collectors.toMap(\n" +
- " s -> s.length(), \n" +
- " Arrays::asList,\n" +
- " merge); \n" +
- " Map<Integer, List<String>> lengthToStrings = names.stream().collect(collector);\n" +
- " \n" +
- " lengthToStrings.forEach((Integer i, List<String> l)-> {\n" +
- " System.out.println(i + \" : \" + Arrays.deepToString(l.toArray()));\n" +
- " });\n" +
- "\n" +
- " }\n" +
- "\n" +
+ "import java.util.*;\n" +
+ "import java.util.function.BinaryOperator; \n" +
+ "import java.util.stream.*;\n" +
+ "\n" +
+ "public class Bug {\n" +
+ " \n" +
+ " static List<String> names = Arrays.asList(\n" +
+ " \"ddd\",\n" +
+ " \"s\",\n" +
+ " \"sdfs\",\n" +
+ " \"sfdf d\"); \n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " BinaryOperator<List<String>> merge = (List<String> first, List<String> second) -> {\n" +
+ " first.addAll(second);\n" +
+ " return first;\n" +
+ " };\n" +
+ " \n" +
+ " Collector<String,?,Map<Integer,List<String>>> collector= Collectors.toMap(\n" +
+ " s -> s.length(), \n" +
+ " Arrays::asList,\n" +
+ " merge); \n" +
+ " Map<Integer, List<String>> lengthToStrings = names.stream().collect(collector);\n" +
+ " \n" +
+ " lengthToStrings.forEach((Integer i, List<String> l)-> {\n" +
+ " System.out.println(i + \" : \" + Arrays.deepToString(l.toArray()));\n" +
+ " });\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
"}\n"
});
}
@@ -1999,70 +1999,70 @@ public void testBug427479b() {
runNegativeTest(
new String[] {
"Bug419048.java",
- "import java.util.List;\n" +
- "import java.util.Map;\n" +
- "import java.util.stream.Collectors;\n" +
- "\n" +
- "\n" +
- "public class Bug419048 {\n" +
- " void test1(List<Object> roster) {\n" +
- " Map<String, Object> map = \n" +
- " roster\n" +
- " .stream()\n" +
- " .collect(\n" +
- " Collectors.toMap(\n" +
- " p -> p.getLast(),\n" +
- " p -> p.getLast()\n" +
- " ));\n" +
- " }\n" +
+ "import java.util.List;\n" +
+ "import java.util.Map;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "\n" +
+ "\n" +
+ "public class Bug419048 {\n" +
+ " void test1(List<Object> roster) {\n" +
+ " Map<String, Object> map = \n" +
+ " roster\n" +
+ " .stream()\n" +
+ " .collect(\n" +
+ " Collectors.toMap(\n" +
+ " p -> p.getLast(),\n" +
+ " p -> p.getLast()\n" +
+ " ));\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Bug419048.java (at line 9)\n" +
- " roster\n" +
- " .stream()\n" +
- " .collect(\n" +
- " Collectors.toMap(\n" +
- " p -> p.getLast(),\n" +
- " p -> p.getLast()\n" +
- " ));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Map<Object,Object> to Map<String,Object>\n" +
- "----------\n" +
- "2. ERROR in Bug419048.java (at line 13)\n" +
- " p -> p.getLast(),\n" +
- " ^^^^^^^\n" +
- "The method getLast() is undefined for the type Object\n" +
- "----------\n" +
- "3. ERROR in Bug419048.java (at line 14)\n" +
- " p -> p.getLast()\n" +
- " ^^^^^^^\n" +
- "The method getLast() is undefined for the type Object\n" +
+ "----------\n" +
+ "1. ERROR in Bug419048.java (at line 9)\n" +
+ " roster\n" +
+ " .stream()\n" +
+ " .collect(\n" +
+ " Collectors.toMap(\n" +
+ " p -> p.getLast(),\n" +
+ " p -> p.getLast()\n" +
+ " ));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Map<Object,Object> to Map<String,Object>\n" +
+ "----------\n" +
+ "2. ERROR in Bug419048.java (at line 13)\n" +
+ " p -> p.getLast(),\n" +
+ " ^^^^^^^\n" +
+ "The method getLast() is undefined for the type Object\n" +
+ "----------\n" +
+ "3. ERROR in Bug419048.java (at line 14)\n" +
+ " p -> p.getLast()\n" +
+ " ^^^^^^^\n" +
+ "The method getLast() is undefined for the type Object\n" +
"----------\n");
}
public void testBug427626() {
runNegativeTest(
new String[] {
"X.java",
- "import java.util.Arrays;\n" +
- "import java.util.List;\n" +
- "\n" +
- "public class X {\n" +
- " void m() {\n" +
- " List<String> ss = Arrays.asList(\"1\", \"2\", \"3\");\n" +
- " \n" +
- " ss.stream().map(s -> {\n" +
- " class L1 {};\n" +
- " class L2 {\n" +
- " void mm(L1 l) {}\n" +
- " }\n" +
- " return new L2().mm(new L1());\n" +
- " }).forEach(e -> System.out.println(e));\n" +
- " }\n" +
+ "import java.util.Arrays;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class X {\n" +
+ " void m() {\n" +
+ " List<String> ss = Arrays.asList(\"1\", \"2\", \"3\");\n" +
+ " \n" +
+ " ss.stream().map(s -> {\n" +
+ " class L1 {};\n" +
+ " class L2 {\n" +
+ " void mm(L1 l) {}\n" +
+ " }\n" +
+ " return new L2().mm(new L1());\n" +
+ " }).forEach(e -> System.out.println(e));\n" +
+ " }\n" +
"}"
},
// 8u20 emits just one message inferred type not conforming to upper bound.
- "----------\n" +
+ "----------\n" +
"1. ERROR in X.java (at line 8)\n" +
" ss.stream().map(s -> {\n" +
" class L1 {};\n" +
@@ -2074,10 +2074,10 @@ public void testBug427626() {
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Cannot infer type argument(s) for <R> map(Function<? super T,? extends R>)\n" +
"----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " return new L2().mm(new L1());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot return a void result\n" +
+ "2. ERROR in X.java (at line 13)\n" +
+ " return new L2().mm(new L1());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot return a void result\n" +
"----------\n");
}
public void testBug426542() {
@@ -2085,18 +2085,18 @@ public void testBug426542() {
new String[] {
"X.java",
"import java.io.Serializable;\n" +
- "public class X {\n" +
- " \n" +
- " <T extends Comparable & Serializable> void foo(T o1) {\n" +
- " }\n" +
- "\n" +
- " <T extends Serializable> void foo(T o1) {\n" +
- " }\n" +
- "\n" +
- " void bar() {\n" +
- " foo((Comparable & Serializable)0);\n" +
- " foo(0);\n" +
- " }\n" +
+ "public class X {\n" +
+ " \n" +
+ " <T extends Comparable & Serializable> void foo(T o1) {\n" +
+ " }\n" +
+ "\n" +
+ " <T extends Serializable> void foo(T o1) {\n" +
+ " }\n" +
+ "\n" +
+ " void bar() {\n" +
+ " foo((Comparable & Serializable)0);\n" +
+ " foo(0);\n" +
+ " }\n" +
"}\n"
});
}
@@ -2104,17 +2104,17 @@ public void testBug426836() {
runConformTest(
new String[] {
"ReferenceToGetClass.java",
- "import java.util.function.Supplier;\n" +
- "\n" +
- "\n" +
- "public class ReferenceToGetClass {\n" +
- " <T> T extract(Supplier<T> s) {\n" +
- " return s.get();\n" +
- " }\n" +
- " Class<?> test() {\n" +
- " Class<? extends ReferenceToGetClass> c = extract(this::getClass);\n" +
- " return c;\n" +
- " }\n" +
+ "import java.util.function.Supplier;\n" +
+ "\n" +
+ "\n" +
+ "public class ReferenceToGetClass {\n" +
+ " <T> T extract(Supplier<T> s) {\n" +
+ " return s.get();\n" +
+ " }\n" +
+ " Class<?> test() {\n" +
+ " Class<? extends ReferenceToGetClass> c = extract(this::getClass);\n" +
+ " return c;\n" +
+ " }\n" +
"}\n"
} );
}
@@ -2122,24 +2122,24 @@ public void testBug428019() {
runConformTest(
new String[] {
"X.java",
- "final public class X {\n" +
- " static class Obj {}\n" +
- " static class Dial<T> {}\n" +
- "\n" +
- " <T> void put(Class<T> clazz, T data) {\n" +
- " }\n" +
- "\n" +
- " static <T> Dial<T> wrap(Dial<T> dl) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " static void foo(Dial<? super Obj> dial, X context) {\n" +
- " context.put(Dial.class, wrap(dial));\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " X.foo(new Dial<Obj>(), new X());\n" +
- " }\n" +
+ "final public class X {\n" +
+ " static class Obj {}\n" +
+ " static class Dial<T> {}\n" +
+ "\n" +
+ " <T> void put(Class<T> clazz, T data) {\n" +
+ " }\n" +
+ "\n" +
+ " static <T> Dial<T> wrap(Dial<T> dl) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " static void foo(Dial<? super Obj> dial, X context) {\n" +
+ " context.put(Dial.class, wrap(dial));\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " X.foo(new Dial<Obj>(), new X());\n" +
+ " }\n" +
"}\n"
});
}
@@ -2147,19 +2147,19 @@ public void testBug428198() {
runConformTest(
new String[] {
"Snippet.java",
- "import java.util.*;\n" +
- "interface BundleRevision {}\n" +
- "interface BundleDescription extends BundleRevision {}\n" +
- "public class Snippet {\n" +
- " static Collection<BundleRevision> test(BundleDescription[] triggers) {\n" +
- " @SuppressWarnings(\"unchecked\")\n" +
- " Collection<BundleRevision> triggerRevisions =\n" +
- " //Type mismatch: cannot convert from Collection<Object> to Collection<BundleRevision>\n" +
- " Collections\n" +
- " .unmodifiableCollection(triggers == null ? Collections.EMPTY_LIST\n" +
- " : Arrays.asList((BundleRevision[]) triggers));\n" +
- " return triggerRevisions;\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "interface BundleRevision {}\n" +
+ "interface BundleDescription extends BundleRevision {}\n" +
+ "public class Snippet {\n" +
+ " static Collection<BundleRevision> test(BundleDescription[] triggers) {\n" +
+ " @SuppressWarnings(\"unchecked\")\n" +
+ " Collection<BundleRevision> triggerRevisions =\n" +
+ " //Type mismatch: cannot convert from Collection<Object> to Collection<BundleRevision>\n" +
+ " Collections\n" +
+ " .unmodifiableCollection(triggers == null ? Collections.EMPTY_LIST\n" +
+ " : Arrays.asList((BundleRevision[]) triggers));\n" +
+ " return triggerRevisions;\n" +
+ " }\n" +
"}\n"
});
}
@@ -2167,18 +2167,18 @@ public void testBug428198b() {
runConformTest(
new String[] {
"Snippet.java",
- "import java.util.*;\n" +
- "interface BundleRevision {}\n" +
- "interface BundleDescription extends BundleRevision {}\n" +
- "public class Snippet {\n" +
- " static Collection<BundleRevision> test(BundleDescription[] triggers) {\n" +
- " @SuppressWarnings(\"unchecked\")\n" +
- " Collection<BundleRevision> triggerRevisions =\n" +
- " Collections\n" +
- " .unmodifiableCollection(triggers == null ? Collections.emptyList()\n" +
- " : Arrays.asList((BundleRevision[]) triggers));\n" +
- " return triggerRevisions;\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "interface BundleRevision {}\n" +
+ "interface BundleDescription extends BundleRevision {}\n" +
+ "public class Snippet {\n" +
+ " static Collection<BundleRevision> test(BundleDescription[] triggers) {\n" +
+ " @SuppressWarnings(\"unchecked\")\n" +
+ " Collection<BundleRevision> triggerRevisions =\n" +
+ " Collections\n" +
+ " .unmodifiableCollection(triggers == null ? Collections.emptyList()\n" +
+ " : Arrays.asList((BundleRevision[]) triggers));\n" +
+ " return triggerRevisions;\n" +
+ " }\n" +
"}\n"
});
}
@@ -2186,18 +2186,18 @@ public void testBug428264() {
runConformTest(
new String[] {
"Y.java",
- "import java.util.function.*;\n" +
- "import java.util.Optional;\n" +
- "\n" +
- "interface I<E,F> {}\n" +
- "class A<G> implements I<G, Optional<G>> {}\n" +
- "\n" +
- "public class Y<S,T> {\n" +
- " Y(T o, Predicate<T> p, Supplier<I<S,T>> s) {}\n" +
- "\n" +
- " static <Z> Y<Z, Optional<Z>> m() {\n" +
- " return new Y<>(Optional.empty(), Optional::isPresent, A::new);\n" +
- " }\n" +
+ "import java.util.function.*;\n" +
+ "import java.util.Optional;\n" +
+ "\n" +
+ "interface I<E,F> {}\n" +
+ "class A<G> implements I<G, Optional<G>> {}\n" +
+ "\n" +
+ "public class Y<S,T> {\n" +
+ " Y(T o, Predicate<T> p, Supplier<I<S,T>> s) {}\n" +
+ "\n" +
+ " static <Z> Y<Z, Optional<Z>> m() {\n" +
+ " return new Y<>(Optional.empty(), Optional::isPresent, A::new);\n" +
+ " }\n" +
"}\n"
});
}
@@ -2205,35 +2205,35 @@ public void testBug428294() {
runConformTest(
new String[] {
"Junk5.java",
- "import java.util.Collection;\n" +
- "import java.util.List;\n" +
- "import java.util.stream.Collectors;\n" +
- "\n" +
- "\n" +
- "public class Junk5 {\n" +
- "\n" +
- " class TestTouchDevice {\n" +
- " public Object [] points;\n" +
- " }\n" +
- " \n" +
- " public static List<TestTouchDevice> getTouchDevices() {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " public static Collection<Object[]> getTouchDeviceParameters2(int minPoints) {\n" +
- " Collection c = getTouchDevices().stream()\n" +
- " .filter(d -> d.points.length >= minPoints)\n" +
- " .map(d -> new Object[] { d })\n" +
- " .collect(Collectors.toList());\n" +
- " return c;\n" +
- " }\n" +
- " \n" +
- " public static Collection<Object[]> getTouchDeviceParameters3(int minPoints) {\n" +
- " return getTouchDevices().stream()\n" +
- " .filter(d -> d.points.length >= minPoints)\n" +
- " .map(d -> new Object[] { d })\n" +
- " .collect(Collectors.toList());\n" +
- " }\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.List;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "\n" +
+ "\n" +
+ "public class Junk5 {\n" +
+ "\n" +
+ " class TestTouchDevice {\n" +
+ " public Object [] points;\n" +
+ " }\n" +
+ " \n" +
+ " public static List<TestTouchDevice> getTouchDevices() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " public static Collection<Object[]> getTouchDeviceParameters2(int minPoints) {\n" +
+ " Collection c = getTouchDevices().stream()\n" +
+ " .filter(d -> d.points.length >= minPoints)\n" +
+ " .map(d -> new Object[] { d })\n" +
+ " .collect(Collectors.toList());\n" +
+ " return c;\n" +
+ " }\n" +
+ " \n" +
+ " public static Collection<Object[]> getTouchDeviceParameters3(int minPoints) {\n" +
+ " return getTouchDevices().stream()\n" +
+ " .filter(d -> d.points.length >= minPoints)\n" +
+ " .map(d -> new Object[] { d })\n" +
+ " .collect(Collectors.toList());\n" +
+ " }\n" +
"}\n"
});
}
@@ -2241,86 +2241,86 @@ public void testBug428291() {
runConformTest(
new String[] {
"AC3.java",
- "import java.util.List;\n" +
- "\n" +
- "interface I0<T> { }\n" +
- "\n" +
- "interface I1 { }\n" +
- "interface I1List<E> extends List<E>, I1 {}\n" +
- "interface I2<T> extends I1 {\n" +
- " void foo(I0<? super T> arg1);\n" +
- " void bar(I0<? super T> arg2);\n" +
- "}\n" +
- "interface I3<T> extends I2<T> {}\n" +
- "interface I4<T> extends I2<T> { }\n" +
- "interface I3List<E> extends I3<I1List<E>>, I1List<E> {}\n" +
- "abstract class AC1<E> implements I3List<E> { }\n" +
- "\n" +
- "abstract class AC2<E> {\n" +
- " public static <E> AC2<E> bork(AC2<E> f1, I3List<E> i3l, I0<? super I1List<E>> i1l) {\n" +
- " return null;\n" +
- " }\n" +
- " public static <E> AC2<E> garp(AC2<E> f2, I0<? super I1List<E>> i1l) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "public abstract class AC3<E> extends AC1<E> implements I4<I1List<E>> {\n" +
- "\n" +
- " AC2<E> f = null;\n" +
- "\n" +
- " @Override\n" +
- " public void foo(I0<? super I1List<E>> arg1) {\n" +
- " f = AC2.bork(f, this, arg1);\n" +
- " }\n" +
- "\n" +
- " @Override\n" +
- " public void bar(I0<? super I1List<E>> arg2) {\n" +
- " f = AC2.garp(f, arg2);\n" +
- " }\n" +
- "}\n"
- });
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428275, [1.8][compiler] CCE in InferenceContext18.varArgTypes
+ "import java.util.List;\n" +
+ "\n" +
+ "interface I0<T> { }\n" +
+ "\n" +
+ "interface I1 { }\n" +
+ "interface I1List<E> extends List<E>, I1 {}\n" +
+ "interface I2<T> extends I1 {\n" +
+ " void foo(I0<? super T> arg1);\n" +
+ " void bar(I0<? super T> arg2);\n" +
+ "}\n" +
+ "interface I3<T> extends I2<T> {}\n" +
+ "interface I4<T> extends I2<T> { }\n" +
+ "interface I3List<E> extends I3<I1List<E>>, I1List<E> {}\n" +
+ "abstract class AC1<E> implements I3List<E> { }\n" +
+ "\n" +
+ "abstract class AC2<E> {\n" +
+ " public static <E> AC2<E> bork(AC2<E> f1, I3List<E> i3l, I0<? super I1List<E>> i1l) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public static <E> AC2<E> garp(AC2<E> f2, I0<? super I1List<E>> i1l) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "public abstract class AC3<E> extends AC1<E> implements I4<I1List<E>> {\n" +
+ "\n" +
+ " AC2<E> f = null;\n" +
+ "\n" +
+ " @Override\n" +
+ " public void foo(I0<? super I1List<E>> arg1) {\n" +
+ " f = AC2.bork(f, this, arg1);\n" +
+ " }\n" +
+ "\n" +
+ " @Override\n" +
+ " public void bar(I0<? super I1List<E>> arg2) {\n" +
+ " f = AC2.garp(f, arg2);\n" +
+ " }\n" +
+ "}\n"
+ });
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428275, [1.8][compiler] CCE in InferenceContext18.varArgTypes
public void testBug428275() {
runConformTest(
new String[] {
"p1/C1.java",
- "package p1;\n" +
- "\n" +
- "import java.util.List;\n" +
- "\n" +
- "public class C1<T1> {\n" +
- "\n" +
- " public static class CInner<T2A,T2B> {\n" +
- " public CInner(T2A a, T2B b) {}\n" +
- " }\n" +
- " \n" +
- " public static class CInner2<T3A,T3B> {\n" +
- " public CInner2(String n, List<CInner<T3A,T3B>> arg) {}\n" +
- " }\n" +
- " \n" +
- " public static <E> List<E> getList1(E... items) {\n" +
- " return null;\n" +
- " }\n" +
+ "package p1;\n" +
+ "\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class C1<T1> {\n" +
+ "\n" +
+ " public static class CInner<T2A,T2B> {\n" +
+ " public CInner(T2A a, T2B b) {}\n" +
+ " }\n" +
+ " \n" +
+ " public static class CInner2<T3A,T3B> {\n" +
+ " public CInner2(String n, List<CInner<T3A,T3B>> arg) {}\n" +
+ " }\n" +
+ " \n" +
+ " public static <E> List<E> getList1(E... items) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n",
"Test.java",
- "import java.util.List;\n" +
- "\n" +
- "import p1.C1;\n" +
- "\n" +
- "public class Test {\n" +
- " void test2(List<C1.CInner2> l) {\n" +
- " l.add(\n" +
- " new C1.CInner2<>(\"a\",\n" +
- " C1.getList1(new C1.CInner<>(\"b\", 13))\n" +
- " )\n" +
- " );\n" +
- " }\n" +
- "}\n"
- });
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428352, [1.8][compiler] NPE in AllocationExpression.analyseCode when trying to pass Consumer as Function
+ "import java.util.List;\n" +
+ "\n" +
+ "import p1.C1;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " void test2(List<C1.CInner2> l) {\n" +
+ " l.add(\n" +
+ " new C1.CInner2<>(\"a\",\n" +
+ " C1.getList1(new C1.CInner<>(\"b\", 13))\n" +
+ " )\n" +
+ " );\n" +
+ " }\n" +
+ "}\n"
+ });
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428352, [1.8][compiler] NPE in AllocationExpression.analyseCode when trying to pass Consumer as Function
public void test428352() {
runNegativeTest(
new String[] {
@@ -2341,11 +2341,11 @@ public void test428352() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in OperationsPile.java (at line 13)\n" +
- " addAll3(combined, new OperationsPile<>(handler));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for OperationsPile<>\n" +
+ "----------\n" +
+ "1. ERROR in OperationsPile.java (at line 13)\n" +
+ " addAll3(combined, new OperationsPile<>(handler));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for OperationsPile<>\n" +
"----------\n");
}
public void test428352b() {
@@ -2377,31 +2377,31 @@ public void testBug428307() {
runConformTest(
new String[] {
"X.java",
- "import java.util.*;\n" +
- "import java.util.function.Function;\n" +
- "import java.util.stream.*;\n" +
- "\n" +
- "interface Bar {\n" +
- " Class<? extends Bar> type();\n" +
- "}\n" +
- "public class X {\n" +
- " \n" +
- " <T extends Bar> T[] test(Class<T> barClass, Stream<Bar> bars) {\n" +
- " return get(bars.\n" +
- " collect(Collectors.toMap(Bar::type,\n" +
- " Function.identity(),\n" +
- " ((first,second) -> first),\n" +
- " HashMap::new)),\n" +
- " barClass);\n" +
- " }\n" +
- " \n" +
- " <A extends Bar> A[] get(Map<Class<? extends Bar>,Bar> m, Class<A> c) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n"
- });
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428524, [1.8][compiler] NPE when using JSE8 Class Constructor ref "TheClass::new" and "TheClass" is using default no-arg constructor
+ "import java.util.*;\n" +
+ "import java.util.function.Function;\n" +
+ "import java.util.stream.*;\n" +
+ "\n" +
+ "interface Bar {\n" +
+ " Class<? extends Bar> type();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " \n" +
+ " <T extends Bar> T[] test(Class<T> barClass, Stream<Bar> bars) {\n" +
+ " return get(bars.\n" +
+ " collect(Collectors.toMap(Bar::type,\n" +
+ " Function.identity(),\n" +
+ " ((first,second) -> first),\n" +
+ " HashMap::new)),\n" +
+ " barClass);\n" +
+ " }\n" +
+ " \n" +
+ " <A extends Bar> A[] get(Map<Class<? extends Bar>,Bar> m, Class<A> c) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n"
+ });
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428524, [1.8][compiler] NPE when using JSE8 Class Constructor ref "TheClass::new" and "TheClass" is using default no-arg constructor
public void test428524() {
runConformTest(
new String[] {
@@ -2428,8 +2428,8 @@ public void test428524() {
" }\n" +
" }\n" +
"}\n"
- },
- "WithNoArgConstructor\n" +
+ },
+ "WithNoArgConstructor\n" +
"WithOutNoArgConstructor");
}
public void testBug428786() {
@@ -2437,16 +2437,16 @@ public void testBug428786() {
new String[] {
"Junk9.java",
"import java.util.*;\n" +
- "public class Junk9 {\n" +
- " class Node {\n" +
- " public double getLayoutY() {return 12;}\n" +
- " }\n" +
- " class Node2 extends Node {\n" +
- " }\n" +
- " void junk() {\n" +
- " List<Node2> visibleCells = new ArrayList<>(20);\n" +
- " Collections.sort(visibleCells, (Node o1, Node o2) -> Double.compare(o1.getLayoutY(), o2.getLayoutY()));\n" +
- " }\n" +
+ "public class Junk9 {\n" +
+ " class Node {\n" +
+ " public double getLayoutY() {return 12;}\n" +
+ " }\n" +
+ " class Node2 extends Node {\n" +
+ " }\n" +
+ " void junk() {\n" +
+ " List<Node2> visibleCells = new ArrayList<>(20);\n" +
+ " Collections.sort(visibleCells, (Node o1, Node o2) -> Double.compare(o1.getLayoutY(), o2.getLayoutY()));\n" +
+ " }\n" +
"}\n"
});
}
@@ -2454,64 +2454,64 @@ public void testBug429090_comment1() {
runNegativeTest(
new String[] {
"Junk10.java",
- "\n" +
- "public class Junk10 {\n" +
- " class Observable<T> {}\n" +
- " interface InvalidationListener {\n" +
- " public void invalidated(Observable<?> observable);\n" +
- " }\n" +
- " public static abstract class Change<E2> {}\n" +
- " interface SetChangeListener<E1> {\n" +
- " void onChanged(Change<? extends E1> change);\n" +
- " }\n" +
- " class SetListenerHelper<T> {}\n" +
+ "\n" +
+ "public class Junk10 {\n" +
+ " class Observable<T> {}\n" +
+ " interface InvalidationListener {\n" +
+ " public void invalidated(Observable<?> observable);\n" +
+ " }\n" +
+ " public static abstract class Change<E2> {}\n" +
+ " interface SetChangeListener<E1> {\n" +
+ " void onChanged(Change<? extends E1> change);\n" +
+ " }\n" +
+ " class SetListenerHelper<T> {}\n" +
" public static <E> SetListenerHelper<E> addListener(\n" +
- " SetListenerHelper<E> helper, SetChangeListener<? super E> listener) {\n" +
- " return helper;\n" +
- " }\n" +
- " void junk() {\n" +
- " addListener(null, (SetChangeListener.Change<?> c) -> {});\n" +
- " }\n" +
+ " SetListenerHelper<E> helper, SetChangeListener<? super E> listener) {\n" +
+ " return helper;\n" +
+ " }\n" +
+ " void junk() {\n" +
+ " addListener(null, (SetChangeListener.Change<?> c) -> {});\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Junk10.java (at line 17)\n" +
- " addListener(null, (SetChangeListener.Change<?> c) -> {});\n" +
- " ^^^^^^^^^^^\n" +
- "The method addListener(Junk10.SetListenerHelper<E>, Junk10.SetChangeListener<? super E>) in the type Junk10 is not applicable for the arguments (null, (SetChangeListener.Change<?> c) -> {})\n" +
- "----------\n" +
- "2. ERROR in Junk10.java (at line 17)\n" +
- " addListener(null, (SetChangeListener.Change<?> c) -> {});\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "SetChangeListener.Change cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in Junk10.java (at line 17)\n" +
+ " addListener(null, (SetChangeListener.Change<?> c) -> {});\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method addListener(Junk10.SetListenerHelper<E>, Junk10.SetChangeListener<? super E>) in the type Junk10 is not applicable for the arguments (null, (SetChangeListener.Change<?> c) -> {})\n" +
+ "----------\n" +
+ "2. ERROR in Junk10.java (at line 17)\n" +
+ " addListener(null, (SetChangeListener.Change<?> c) -> {});\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "SetChangeListener.Change cannot be resolved to a type\n" +
"----------\n");
}
public void testBug429090() {
runConformTest(
new String[] {
"Junk10.java",
- "public class Junk10 {\n" +
- " class Observable<T> {}\n" +
- " interface InvalidationListener {\n" +
- " public void invalidated(Observable observable);\n" +
- " }\n" +
- " interface SetChangeListener<E> {\n" +
- " public static abstract class Change<E> {}\n" +
- " void onChanged(Change<? extends E> change);\n" +
- " }\n" +
- " class SetListenerHelper<T> {}\n" +
- " public static <E> SetListenerHelper<E> addListener(SetListenerHelper<E> helper, InvalidationListener listener) {\n" +
- " return helper;\n" +
- " }\n" +
- " public static <E> SetListenerHelper<E> addListener(SetListenerHelper<E> helper, SetChangeListener<? super E> listener) {\n" +
- " return helper;\n" +
- " }\n" +
- " void junk() {\n" +
- " addListener(null, new SetChangeListener () {\n" +
- " public void onChanged(SetChangeListener.Change change) {}\n" +
- " });\n" +
- " addListener(null, (SetChangeListener.Change<? extends Object> c) -> {});\n" + // original was without "extends Object"
- " }\n" +
+ "public class Junk10 {\n" +
+ " class Observable<T> {}\n" +
+ " interface InvalidationListener {\n" +
+ " public void invalidated(Observable observable);\n" +
+ " }\n" +
+ " interface SetChangeListener<E> {\n" +
+ " public static abstract class Change<E> {}\n" +
+ " void onChanged(Change<? extends E> change);\n" +
+ " }\n" +
+ " class SetListenerHelper<T> {}\n" +
+ " public static <E> SetListenerHelper<E> addListener(SetListenerHelper<E> helper, InvalidationListener listener) {\n" +
+ " return helper;\n" +
+ " }\n" +
+ " public static <E> SetListenerHelper<E> addListener(SetListenerHelper<E> helper, SetChangeListener<? super E> listener) {\n" +
+ " return helper;\n" +
+ " }\n" +
+ " void junk() {\n" +
+ " addListener(null, new SetChangeListener () {\n" +
+ " public void onChanged(SetChangeListener.Change change) {}\n" +
+ " });\n" +
+ " addListener(null, (SetChangeListener.Change<? extends Object> c) -> {});\n" + // original was without "extends Object"
+ " }\n" +
"}\n"
});
}
@@ -2519,30 +2519,30 @@ public void testBug429490_comment33() {
runConformTest(
new String[] {
"Junk12.java",
- "public class Junk12 {\n" +
- " class Observable<T> {}\n" +
- " class ObservableValue<T> {}\n" +
- " interface InvalidationListener {\n" +
- " public void invalidated(Observable observable);\n" +
- " }\n" +
- " public interface ChangeListener<T> {\n" +
- " void changed(ObservableValue<? extends T> observable, T oldValue, T newValue);\n" +
- " }\n" +
- " class ExpressionHelper<T> {}\n" +
- " public static <T> ExpressionHelper<T> addListener(ExpressionHelper<T> helper, ObservableValue<T> observable, InvalidationListener listener) {\n" +
- " return helper;\n" +
- " }\n" +
- " public static <T> ExpressionHelper<T> addListener(ExpressionHelper<T> helper, ObservableValue<T> observable, ChangeListener<? super T> listener) {\n" +
- " return helper;\n" +
- " }\n" +
- " void junk() {\n" +
- " addListener(null, null, new ChangeListener () {\n" +
- " public void changed(ObservableValue observable, Object oldValue, Object newValue) {\n" +
- " throw new RuntimeException();\n" +
- " }\n" +
- " });\n" +
- " addListener(null, null, (value, o1, o2) -> {throw new RuntimeException();});\n" +
- " }\n" +
+ "public class Junk12 {\n" +
+ " class Observable<T> {}\n" +
+ " class ObservableValue<T> {}\n" +
+ " interface InvalidationListener {\n" +
+ " public void invalidated(Observable observable);\n" +
+ " }\n" +
+ " public interface ChangeListener<T> {\n" +
+ " void changed(ObservableValue<? extends T> observable, T oldValue, T newValue);\n" +
+ " }\n" +
+ " class ExpressionHelper<T> {}\n" +
+ " public static <T> ExpressionHelper<T> addListener(ExpressionHelper<T> helper, ObservableValue<T> observable, InvalidationListener listener) {\n" +
+ " return helper;\n" +
+ " }\n" +
+ " public static <T> ExpressionHelper<T> addListener(ExpressionHelper<T> helper, ObservableValue<T> observable, ChangeListener<? super T> listener) {\n" +
+ " return helper;\n" +
+ " }\n" +
+ " void junk() {\n" +
+ " addListener(null, null, new ChangeListener () {\n" +
+ " public void changed(ObservableValue observable, Object oldValue, Object newValue) {\n" +
+ " throw new RuntimeException();\n" +
+ " }\n" +
+ " });\n" +
+ " addListener(null, null, (value, o1, o2) -> {throw new RuntimeException();});\n" +
+ " }\n" +
"}\n"
});
}
@@ -2550,48 +2550,48 @@ public void testBug428811() {
runConformTest(
new String[] {
"MoreCollectors.java",
- "import java.util.AbstractList;\n" +
- "import java.util.ArrayList;\n" +
- "import java.util.Arrays;\n" +
- "import java.util.Collection;\n" +
- "import java.util.List;\n" +
- "import java.util.stream.Collector;\n" +
- "\n" +
- "public class MoreCollectors {\n" +
- " public static void main (String[] args) {\n" +
- " ImmutableList<String> list = Arrays.asList(\"a\", \"b\", \"c\").stream().collect(toImmutableList());\n" +
- " \n" +
- " System.out.println(list);\n" +
- " }\n" +
- " \n" +
- " public static <T> Collector<T, ?, ImmutableList<T>> toImmutableList () {\n" +
- " return Collector.of(ArrayList<T>::new,\n" +
- " List<T>::add,\n" +
- " (left, right) -> { left.addAll(right); return left; },\n" +
- " ImmutableList::copyOf);\n" +
- " }\n" +
- " \n" +
- " private static class ImmutableList<T> extends AbstractList<T> {\n" +
- " public static <T> ImmutableList<T> copyOf (Collection<T> c) {\n" +
- " return new ImmutableList<>(c.toArray());\n" +
- " }\n" +
- "\n" +
- " private Object[] array;\n" +
- " \n" +
- " private ImmutableList (Object[] array) {\n" +
- " this.array = array;\n" +
- " }\n" +
- "\n" +
- " @Override @SuppressWarnings(\"unchecked\")\n" +
- " public T get(int index) {\n" +
- " return (T)array[index];\n" +
- " }\n" +
- "\n" +
- " @Override\n" +
- " public int size() {\n" +
- " return array.length;\n" +
- " }\n" +
- " }\n" +
+ "import java.util.AbstractList;\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.Arrays;\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.List;\n" +
+ "import java.util.stream.Collector;\n" +
+ "\n" +
+ "public class MoreCollectors {\n" +
+ " public static void main (String[] args) {\n" +
+ " ImmutableList<String> list = Arrays.asList(\"a\", \"b\", \"c\").stream().collect(toImmutableList());\n" +
+ " \n" +
+ " System.out.println(list);\n" +
+ " }\n" +
+ " \n" +
+ " public static <T> Collector<T, ?, ImmutableList<T>> toImmutableList () {\n" +
+ " return Collector.of(ArrayList<T>::new,\n" +
+ " List<T>::add,\n" +
+ " (left, right) -> { left.addAll(right); return left; },\n" +
+ " ImmutableList::copyOf);\n" +
+ " }\n" +
+ " \n" +
+ " private static class ImmutableList<T> extends AbstractList<T> {\n" +
+ " public static <T> ImmutableList<T> copyOf (Collection<T> c) {\n" +
+ " return new ImmutableList<>(c.toArray());\n" +
+ " }\n" +
+ "\n" +
+ " private Object[] array;\n" +
+ " \n" +
+ " private ImmutableList (Object[] array) {\n" +
+ " this.array = array;\n" +
+ " }\n" +
+ "\n" +
+ " @Override @SuppressWarnings(\"unchecked\")\n" +
+ " public T get(int index) {\n" +
+ " return (T)array[index];\n" +
+ " }\n" +
+ "\n" +
+ " @Override\n" +
+ " public int size() {\n" +
+ " return array.length;\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
"[a, b, c]");
@@ -2601,21 +2601,21 @@ public void testBug429430() {
runConformTest(
new String[] {
"Main.java",
- "import java.io.*;\n" +
- "public class Main {\n" +
- " public static interface Closer<T, X extends Exception> {\n" +
- " void closeIt(T it) throws X;\n" +
- " }\n" +
- "\n" +
- " public static <T, X extends Exception> void close( Closer<T, X> closer, T it ) throws X {\n" +
- " closer.closeIt(it);\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) throws IOException {\n" +
- " InputStream in = new ByteArrayInputStream(\"hello\".getBytes());\n" +
+ "import java.io.*;\n" +
+ "public class Main {\n" +
+ " public static interface Closer<T, X extends Exception> {\n" +
+ " void closeIt(T it) throws X;\n" +
+ " }\n" +
+ "\n" +
+ " public static <T, X extends Exception> void close( Closer<T, X> closer, T it ) throws X {\n" +
+ " closer.closeIt(it);\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) throws IOException {\n" +
+ " InputStream in = new ByteArrayInputStream(\"hello\".getBytes());\n" +
" close( x -> x.close(), in );\n" +
- " close( InputStream::close, in );\n" +
- " close( (Closer<InputStream, IOException>)InputStream::close, in );\n" +
+ " close( InputStream::close, in );\n" +
+ " close( (Closer<InputStream, IOException>)InputStream::close, in );\n" +
" }\n" +
"}\n"
});
@@ -2626,27 +2626,27 @@ public void testBug429430a() {
new String[] {
"Main.java",
"import java.io.*;\n" +
- "@SuppressWarnings(\"serial\") class EmptyStream extends Exception {}\n" +
- "public class Main {\n" +
- " public static interface Closer<T, X extends Exception> {\n" +
- " void closeIt(T it) throws X;\n" +
- " }\n" +
- "\n" +
- " public static <T, X extends Exception> void close( Closer<T, X> closer, T it ) throws X {\n" +
- " closer.closeIt(it);\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) throws IOException, EmptyStream {\n" +
- " InputStream in = new ByteArrayInputStream(\"hello\".getBytes());\n" +
- " close( x -> { if (in.available() == 0) throw new EmptyStream(); x.close(); }, in );\n" +
+ "@SuppressWarnings(\"serial\") class EmptyStream extends Exception {}\n" +
+ "public class Main {\n" +
+ " public static interface Closer<T, X extends Exception> {\n" +
+ " void closeIt(T it) throws X;\n" +
+ " }\n" +
+ "\n" +
+ " public static <T, X extends Exception> void close( Closer<T, X> closer, T it ) throws X {\n" +
+ " closer.closeIt(it);\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) throws IOException, EmptyStream {\n" +
+ " InputStream in = new ByteArrayInputStream(\"hello\".getBytes());\n" +
+ " close( x -> { if (in.available() == 0) throw new EmptyStream(); x.close(); }, in );\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Main.java (at line 14)\n" +
- " close( x -> { if (in.available() == 0) throw new EmptyStream(); x.close(); }, in );\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type Exception\n" +
+ "----------\n" +
+ "1. ERROR in Main.java (at line 14)\n" +
+ " close( x -> { if (in.available() == 0) throw new EmptyStream(); x.close(); }, in );\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type Exception\n" +
"----------\n");
}
// one of two incompatible exceptions is caught
@@ -2655,24 +2655,24 @@ public void testBug429430b() {
new String[] {
"Main.java",
"import java.io.*;\n" +
- "@SuppressWarnings(\"serial\") class EmptyStream extends Exception {}\n" +
- "public class Main {\n" +
- " public static interface Closer<T, X extends Exception> {\n" +
- " void closeIt(T it) throws X;\n" +
- " }\n" +
- "\n" +
- " public static <T, X extends Exception> void close( Closer<T, X> closer, T it ) throws X {\n" +
- " closer.closeIt(it);\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) throws EmptyStream {\n" +
- " InputStream in = new ByteArrayInputStream(\"hello\".getBytes());\n" +
- " close( x -> {\n" +
- " try {\n" +
- " x.close();\n" +
- " } catch (IOException ioex) { throw new EmptyStream(); } \n" +
+ "@SuppressWarnings(\"serial\") class EmptyStream extends Exception {}\n" +
+ "public class Main {\n" +
+ " public static interface Closer<T, X extends Exception> {\n" +
+ " void closeIt(T it) throws X;\n" +
+ " }\n" +
+ "\n" +
+ " public static <T, X extends Exception> void close( Closer<T, X> closer, T it ) throws X {\n" +
+ " closer.closeIt(it);\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) throws EmptyStream {\n" +
+ " InputStream in = new ByteArrayInputStream(\"hello\".getBytes());\n" +
+ " close( x -> {\n" +
+ " try {\n" +
+ " x.close();\n" +
+ " } catch (IOException ioex) { throw new EmptyStream(); } \n" +
" }," +
- " in);\n" +
+ " in);\n" +
" }\n" +
"}\n"
});
@@ -2704,16 +2704,16 @@ public void testBug429430b2() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 16)\n" +
- " throw new IOException();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type IOException\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 18)\n" +
- " throw new EmptyStream(); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 16)\n" +
+ " throw new IOException();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type IOException\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 18)\n" +
+ " throw new EmptyStream(); \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
"----------\n");
}
// ensure type annotation on exception doesn't confuse the inference
@@ -2725,26 +2725,26 @@ public void testBug429430c() {
"Main.java",
"import java.io.*;\n" +
"import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE) @interface Severe {}\n" +
- "public class Main {\n" +
- " public static interface Closer<T, X extends Exception> {\n" +
- " void closeIt(T it) throws X;\n" +
- " }\n" +
- "\n" +
- " public static <T, X extends Exception> void close( Closer<T, X> closer, T it ) throws X {\n" +
- " closer.closeIt(it);\n" +
- " }\n" +
- "\n" +
- " static @Severe IOException getException() { return new IOException(\"severe\"); }\n" +
- " public static void main(String[] args) throws IOException {\n" +
- " InputStream in = new ByteArrayInputStream(\"hello\".getBytes());\n" +
+ "@Target(ElementType.TYPE_USE) @interface Severe {}\n" +
+ "public class Main {\n" +
+ " public static interface Closer<T, X extends Exception> {\n" +
+ " void closeIt(T it) throws X;\n" +
+ " }\n" +
+ "\n" +
+ " public static <T, X extends Exception> void close( Closer<T, X> closer, T it ) throws X {\n" +
+ " closer.closeIt(it);\n" +
+ " }\n" +
+ "\n" +
+ " static @Severe IOException getException() { return new IOException(\"severe\"); }\n" +
+ " public static void main(String[] args) throws IOException {\n" +
+ " InputStream in = new ByteArrayInputStream(\"hello\".getBytes());\n" +
" close( x -> {\n" +
" if (in.available() > 0)\n" +
" x.close();\n" +
" else\n" +
" throw getException();\n" +
" },\n" +
- " in);\n" +
+ " in);\n" +
" }\n" +
"}\n"
},
@@ -2754,28 +2754,28 @@ public void testBug429490() {
runConformTest(
new String[] {
"Junk11.java",
- "public class Junk11 {\n" +
- " class Observable<T> {}\n" +
- " class ObservableValue<T> {}\n" +
- " interface InvalidationListener {\n" +
- " public void invalidated(Observable observable);\n" +
- " }\n" +
- " public interface ChangeListener<T> {\n" +
- " void changed(ObservableValue<? extends T> observable, T oldValue, T newValue);\n" +
- " }\n" +
- " class ExpressionHelper<T> {}\n" +
- " public static <T> ExpressionHelper<T> addListener(ExpressionHelper<T> helper, ObservableValue<T> observable, InvalidationListener listener) {\n" +
- " return helper;\n" +
- " }\n" +
- " public static <T> ExpressionHelper<T> addListener(ExpressionHelper<T> helper, ObservableValue<T> observable, ChangeListener<? super T> listener) {\n" +
- " return helper;\n" +
- " }\n" +
- " void junk() {\n" +
- " addListener(null, null, new InvalidationListener () {\n" +
- " public void invalidated(Observable o) {throw new RuntimeException();}\n" +
- " });\n" +
- " addListener(null, null, (o) -> {throw new RuntimeException();});\n" +
- " }\n" +
+ "public class Junk11 {\n" +
+ " class Observable<T> {}\n" +
+ " class ObservableValue<T> {}\n" +
+ " interface InvalidationListener {\n" +
+ " public void invalidated(Observable observable);\n" +
+ " }\n" +
+ " public interface ChangeListener<T> {\n" +
+ " void changed(ObservableValue<? extends T> observable, T oldValue, T newValue);\n" +
+ " }\n" +
+ " class ExpressionHelper<T> {}\n" +
+ " public static <T> ExpressionHelper<T> addListener(ExpressionHelper<T> helper, ObservableValue<T> observable, InvalidationListener listener) {\n" +
+ " return helper;\n" +
+ " }\n" +
+ " public static <T> ExpressionHelper<T> addListener(ExpressionHelper<T> helper, ObservableValue<T> observable, ChangeListener<? super T> listener) {\n" +
+ " return helper;\n" +
+ " }\n" +
+ " void junk() {\n" +
+ " addListener(null, null, new InvalidationListener () {\n" +
+ " public void invalidated(Observable o) {throw new RuntimeException();}\n" +
+ " });\n" +
+ " addListener(null, null, (o) -> {throw new RuntimeException();});\n" +
+ " }\n" +
"}\n"
});
}
@@ -2783,18 +2783,18 @@ public void testBug429424() {
runConformTest(
new String[] {
"X.java",
- "import java.util.*;\n" +
- "public class X {\n" +
- " public static void main (String[] args) {\n" +
- " List<String> list = new ArrayList<>();\n" +
- " list.addAll(X.newArrayList());\n" +
- " System.out.println(list);\n" +
- " }\n" +
- " \n" +
- " public static <T> List<T> newArrayList () {\n" +
- " return new ArrayList<T>();\n" +
- " }\n" +
- "}\n" +
+ "import java.util.*;\n" +
+ "public class X {\n" +
+ " public static void main (String[] args) {\n" +
+ " List<String> list = new ArrayList<>();\n" +
+ " list.addAll(X.newArrayList());\n" +
+ " System.out.println(list);\n" +
+ " }\n" +
+ " \n" +
+ " public static <T> List<T> newArrayList () {\n" +
+ " return new ArrayList<T>();\n" +
+ " }\n" +
+ "}\n" +
"\n"
});
}
@@ -2802,83 +2802,83 @@ public void testBug426537() {
runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " void foo(J[] list, I<J<?>> i) {\n" +
- " sort(list, i);\n" +
- " }\n" +
- " \n" +
- " <T> T[] sort(T[] list, I<? super T> i) {\n" +
- " return list;\n" +
- " }\n" +
- "}\n" +
- "interface I<T> {}\n" +
+ "public class X {\n" +
+ " void foo(J[] list, I<J<?>> i) {\n" +
+ " sort(list, i);\n" +
+ " }\n" +
+ " \n" +
+ " <T> T[] sort(T[] list, I<? super T> i) {\n" +
+ " return list;\n" +
+ " }\n" +
+ "}\n" +
+ "interface I<T> {}\n" +
"interface J<T> {}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " void foo(J[] list, I<J<?>> i) {\n" +
- " ^\n" +
- "J is a raw type. References to generic type J<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " sort(list, i);\n" +
- " ^^^^\n" +
- "The method sort(T[], I<? super T>) in the type X is not applicable for the arguments (J[], I<J<?>>)\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " void foo(J[] list, I<J<?>> i) {\n" +
+ " ^\n" +
+ "J is a raw type. References to generic type J<T> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " sort(list, i);\n" +
+ " ^^^^\n" +
+ "The method sort(T[], I<? super T>) in the type X is not applicable for the arguments (J[], I<J<?>>)\n" +
"----------\n");
}
public void testBug426537b() {
runConformTest(
new String[] {
"Test.java",
- "interface C<T, A, R> {}\n" +
- "\n" +
- "class MImpl<K, V> {}\n" +
- "\n" +
- "interface S<T> { T get(); }\n" +
- "\n" +
- "public class Test {\n" +
- " static <T, K, D> C<T, ?, MImpl<K, D>> m1() {\n" +
- " return m2(MImpl::new);\n" +
- " }\n" +
- " \n" +
- " static <T, K, D, M extends MImpl<K, D>> C<T, ?, M> m2(S<M> s) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
+ "interface C<T, A, R> {}\n" +
+ "\n" +
+ "class MImpl<K, V> {}\n" +
+ "\n" +
+ "interface S<T> { T get(); }\n" +
+ "\n" +
+ "public class Test {\n" +
+ " static <T, K, D> C<T, ?, MImpl<K, D>> m1() {\n" +
+ " return m2(MImpl::new);\n" +
+ " }\n" +
+ " \n" +
+ " static <T, K, D, M extends MImpl<K, D>> C<T, ?, M> m2(S<M> s) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
"\n"
});
}
public void testBug426537c() {
- // touching MImpl#RAW before type inference we got undesired results from #typeArguments()
+ // touching MImpl#RAW before type inference we got undesired results from #typeArguments()
runConformTest(
new String[] {
"Ups.java",
- "public class Ups {\n" +
- " static Object innocent(MImpl o) {\n" +
+ "public class Ups {\n" +
+ " static Object innocent(MImpl o) {\n" +
" return o.remove(\"nice\");\n" + // method lookup triggers initialization of the RawTypeBinding.
- " }\n" +
+ " }\n" +
"}\n",
"Test.java",
- "interface S<T> { T get(); }\n" +
- "interface F<T, R> { R apply(T t); }\n" +
- "interface C<T, A, R> { }\n" +
- "interface IM<K,V> {}\n" +
- "class MImpl<K,V> implements IM<K,V> { \n" +
- " public V remove(Object key) { return null; } \n" +
- "}\n" +
- "public final class Test {\n" +
- "\n" +
- " static <T, K, A, D>\n" +
- " C<T, ?, IM<K, D>> m1(F<? super T, ? extends K> f, C<? super T, A, D> c) {\n" +
- " return m2(f, MImpl::new, c);\n" +
- " }\n" +
- "\n" +
- " static <T, K, D, A, M extends IM<K, D>>\n" +
- " C<T, ?, M> m2(F<? super T, ? extends K> classifier,\n" +
- " S<M> mapFactory,\n" +
- " C<? super T, A, D> downstream) {\n" +
- " return null;\n" +
- " }\n" +
+ "interface S<T> { T get(); }\n" +
+ "interface F<T, R> { R apply(T t); }\n" +
+ "interface C<T, A, R> { }\n" +
+ "interface IM<K,V> {}\n" +
+ "class MImpl<K,V> implements IM<K,V> { \n" +
+ " public V remove(Object key) { return null; } \n" +
+ "}\n" +
+ "public final class Test {\n" +
+ "\n" +
+ " static <T, K, A, D>\n" +
+ " C<T, ?, IM<K, D>> m1(F<? super T, ? extends K> f, C<? super T, A, D> c) {\n" +
+ " return m2(f, MImpl::new, c);\n" +
+ " }\n" +
+ "\n" +
+ " static <T, K, D, A, M extends IM<K, D>>\n" +
+ " C<T, ?, M> m2(F<? super T, ? extends K> classifier,\n" +
+ " S<M> mapFactory,\n" +
+ " C<? super T, A, D> downstream) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
});
}
@@ -2890,93 +2890,93 @@ public void testBug429203() {
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError,
new String[] {
"DTest.java",
- "import java.util.function.Function;\n" +
- "\n" +
- "\n" +
- "public class DTest<T> {\n" +
- " public DTest(Function<T, T> func) { }\n" +
- " \n" +
- " public DTest(DTest<Integer> dti) {}\n" +
- " public DTest() {}\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " DTest<String> t1 = new DTest<String>(new DTest<Integer>());\n" +
- " }\n" +
+ "import java.util.function.Function;\n" +
+ "\n" +
+ "\n" +
+ "public class DTest<T> {\n" +
+ " public DTest(Function<T, T> func) { }\n" +
+ " \n" +
+ " public DTest(DTest<Integer> dti) {}\n" +
+ " public DTest() {}\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " DTest<String> t1 = new DTest<String>(new DTest<Integer>());\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in DTest.java (at line 11)\n" +
- " DTest<String> t1 = new DTest<String>(new DTest<Integer>());\n" +
- " ^^^^^\n" +
- "Redundant specification of type arguments <String>\n" +
- "----------\n",
+ "----------\n" +
+ "1. ERROR in DTest.java (at line 11)\n" +
+ " DTest<String> t1 = new DTest<String>(new DTest<Integer>());\n" +
+ " ^^^^^\n" +
+ "Redundant specification of type arguments <String>\n" +
+ "----------\n",
null, true, customOptions);
}
public void testBug430296() {
runNegativeTest(
new String[] {
"AnnotationCollector.java",
- "import java.lang.annotation.*;\n" +
- "import java.util.*;\n" +
- "import java.util.function.*;\n" +
- "import java.util.stream.*;\n" +
- "\n" +
- "public abstract class AnnotationCollector {\n" +
- " \n" +
- " Map<String, Person> test2(Stream<Person> persons) {\n" +
- " return persons.collect(Collectors.toMap((Person p) -> p.getLastName(),\n" +
- " Function::identity,\n" +
- " (p1, p2) -> p1));\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Person {\n" +
- " String getLastName() { return \"\"; }\n" +
+ "import java.lang.annotation.*;\n" +
+ "import java.util.*;\n" +
+ "import java.util.function.*;\n" +
+ "import java.util.stream.*;\n" +
+ "\n" +
+ "public abstract class AnnotationCollector {\n" +
+ " \n" +
+ " Map<String, Person> test2(Stream<Person> persons) {\n" +
+ " return persons.collect(Collectors.toMap((Person p) -> p.getLastName(),\n" +
+ " Function::identity,\n" +
+ " (p1, p2) -> p1));\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class Person {\n" +
+ " String getLastName() { return \"\"; }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in AnnotationCollector.java (at line 9)\n" +
- " return persons.collect(Collectors.toMap((Person p) -> p.getLastName(),\n" +
- " ^^^^^\n" +
- "The method toMap(Function<? super T,? extends K>, Function<? super T,? extends U>, BinaryOperator<U>) in the type Collectors is not applicable for the arguments ((Person p) -> {}, Function::identity, BinaryOperator<U>)\n" +
- "----------\n" +
- "2. ERROR in AnnotationCollector.java (at line 9)\n" +
- " return persons.collect(Collectors.toMap((Person p) -> p.getLastName(),\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Function<Person,? extends K> to Function<? super T,? extends K>\n" +
- "----------\n" +
- "3. ERROR in AnnotationCollector.java (at line 10)\n" +
- " Function::identity,\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The type Function does not define identity(T) that is applicable here\n" +
+ "----------\n" +
+ "1. ERROR in AnnotationCollector.java (at line 9)\n" +
+ " return persons.collect(Collectors.toMap((Person p) -> p.getLastName(),\n" +
+ " ^^^^^\n" +
+ "The method toMap(Function<? super T,? extends K>, Function<? super T,? extends U>, BinaryOperator<U>) in the type Collectors is not applicable for the arguments ((Person p) -> {}, Function::identity, BinaryOperator<U>)\n" +
+ "----------\n" +
+ "2. ERROR in AnnotationCollector.java (at line 9)\n" +
+ " return persons.collect(Collectors.toMap((Person p) -> p.getLastName(),\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Function<Person,? extends K> to Function<? super T,? extends K>\n" +
+ "----------\n" +
+ "3. ERROR in AnnotationCollector.java (at line 10)\n" +
+ " Function::identity,\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "The type Function does not define identity(T) that is applicable here\n" +
"----------\n");
}
public void testBug430759() {
runConformTest(
new String[] {
"Test.java",
- "import java.beans.*;\n" +
- "import java.util.*;\n" +
- "import java.util.function.*;\n" +
- "\n" +
- "public abstract class Test<T,R> implements Function<T,R> {\n" +
- "\n" +
- " public static final <T,R> Test<T,R> getTest() {\n" +
- " return new Test<T,R>() {\n" +
- " protected final Map<T,ResultSupplier> results = Collections.synchronizedMap(new HashMap<T,ResultSupplier>());\n" +
- " @Override\n" +
- " public R apply(final T t) {\n" +
- " ResultSupplier result = results.get(t);\n" +
- " return result.get();\n" +
- " }\n" +
- " class ResultSupplier implements Supplier<R> {\n" +
- " @Override\n" +
- " public synchronized R get() {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- " };\n" +
- " }\n" +
+ "import java.beans.*;\n" +
+ "import java.util.*;\n" +
+ "import java.util.function.*;\n" +
+ "\n" +
+ "public abstract class Test<T,R> implements Function<T,R> {\n" +
+ "\n" +
+ " public static final <T,R> Test<T,R> getTest() {\n" +
+ " return new Test<T,R>() {\n" +
+ " protected final Map<T,ResultSupplier> results = Collections.synchronizedMap(new HashMap<T,ResultSupplier>());\n" +
+ " @Override\n" +
+ " public R apply(final T t) {\n" +
+ " ResultSupplier result = results.get(t);\n" +
+ " return result.get();\n" +
+ " }\n" +
+ " class ResultSupplier implements Supplier<R> {\n" +
+ " @Override\n" +
+ " public synchronized R get() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
"}\n"
});
}
@@ -2985,24 +2985,24 @@ public void testBug431577() {
runConformTest(
new String[] {
"Test.java",
- "import java.util.function.Function;\n" +
- "import java.util.function.IntFunction;\n" +
- "public class Test<R> {\n" +
- " public static void main(String[] args) {\n" +
- " new Test<>().test((Integer i) -> null);\n" +
- " }\n" +
- " <T> void test(Function<T, R> f) {\n" +
- " }\n" +
- " void test(int i, IntFunction<R> f) {\n" +
- " new State<>(new Val<>(i));\n" +
- " }\n" +
- " static class State<R> {\n" +
- " State(Val<?> o) {\n" +
- " }\n" +
- " }\n" +
- " static class Val<T> {\n" +
- " Val(T t) {}\n" +
- " }\n" +
+ "import java.util.function.Function;\n" +
+ "import java.util.function.IntFunction;\n" +
+ "public class Test<R> {\n" +
+ " public static void main(String[] args) {\n" +
+ " new Test<>().test((Integer i) -> null);\n" +
+ " }\n" +
+ " <T> void test(Function<T, R> f) {\n" +
+ " }\n" +
+ " void test(int i, IntFunction<R> f) {\n" +
+ " new State<>(new Val<>(i));\n" +
+ " }\n" +
+ " static class State<R> {\n" +
+ " State(Val<?> o) {\n" +
+ " }\n" +
+ " }\n" +
+ " static class Val<T> {\n" +
+ " Val(T t) {}\n" +
+ " }\n" +
"}"
});
}
@@ -3010,89 +3010,89 @@ public void testBug432110() {
runConformTest(
new String[] {
"Bug.java",
- "import java.util.List;\n" +
- "import java.util.function.Function;\n" +
- "import java.util.stream.Stream;\n" +
- "\n" +
- "class Bug\n" +
- "{\n" +
- " // fully inline\n" +
- " // compiles successfully\n" +
- " Stream<? extends Integer> flatten1(\n" +
- " final Stream<List<Integer>> input)\n" +
- " {\n" +
- " return input.flatMap(item -> item.stream().map(value -> value));\n" +
- " }\n" +
- "\n" +
- " // lambda using braces\n" +
- " // compiles with error in eclipse, successfully with javac\n" +
- " Stream<? extends Integer> flatten2(\n" +
- " final Stream<List<Integer>> input)\n" +
- " {\n" +
- " return input.flatMap(item -> {\n" +
- " return item.stream().map(value -> value);\n" +
- " });\n" +
- " }\n" +
- "\n" +
- " // without map step\n" +
- " // compiles successfully\n" +
- " Stream<? extends Integer> flatten3(\n" +
- " final Stream<List<Integer>> input)\n" +
- " {\n" +
- " return input.flatMap(item -> {\n" +
- " return item.stream();\n" +
- " });\n" +
- " }\n" +
- "\n" +
- " // with map step, but not inline\n" +
- " // compiles successfully\n" +
- " Stream<? extends Integer> flatten4(\n" +
- " final Stream<List<Integer>> input)\n" +
- " {\n" +
- " return input.flatMap(item -> {\n" +
- " final Function<? super Integer, ? extends Integer> mapper = value -> value;\n" +
- " return item.stream().map(mapper);\n" +
- " });\n" +
- " }\n" +
- "\n" +
- " // with map step, but outer lambda is not inline\n" +
- " // compiles successfully\n" +
- " Stream<? extends Integer> flatten5(\n" +
- " final Stream<List<Integer>> input)\n" +
- " {\n" +
- " final Function<? super List<Integer>, ? extends Stream<? extends Integer>> func = item -> {\n" +
- " return item.stream().map(value -> value);\n" +
- " };\n" +
- " return input.flatMap(func);\n" +
- " }\n" +
+ "import java.util.List;\n" +
+ "import java.util.function.Function;\n" +
+ "import java.util.stream.Stream;\n" +
+ "\n" +
+ "class Bug\n" +
+ "{\n" +
+ " // fully inline\n" +
+ " // compiles successfully\n" +
+ " Stream<? extends Integer> flatten1(\n" +
+ " final Stream<List<Integer>> input)\n" +
+ " {\n" +
+ " return input.flatMap(item -> item.stream().map(value -> value));\n" +
+ " }\n" +
+ "\n" +
+ " // lambda using braces\n" +
+ " // compiles with error in eclipse, successfully with javac\n" +
+ " Stream<? extends Integer> flatten2(\n" +
+ " final Stream<List<Integer>> input)\n" +
+ " {\n" +
+ " return input.flatMap(item -> {\n" +
+ " return item.stream().map(value -> value);\n" +
+ " });\n" +
+ " }\n" +
+ "\n" +
+ " // without map step\n" +
+ " // compiles successfully\n" +
+ " Stream<? extends Integer> flatten3(\n" +
+ " final Stream<List<Integer>> input)\n" +
+ " {\n" +
+ " return input.flatMap(item -> {\n" +
+ " return item.stream();\n" +
+ " });\n" +
+ " }\n" +
+ "\n" +
+ " // with map step, but not inline\n" +
+ " // compiles successfully\n" +
+ " Stream<? extends Integer> flatten4(\n" +
+ " final Stream<List<Integer>> input)\n" +
+ " {\n" +
+ " return input.flatMap(item -> {\n" +
+ " final Function<? super Integer, ? extends Integer> mapper = value -> value;\n" +
+ " return item.stream().map(mapper);\n" +
+ " });\n" +
+ " }\n" +
+ "\n" +
+ " // with map step, but outer lambda is not inline\n" +
+ " // compiles successfully\n" +
+ " Stream<? extends Integer> flatten5(\n" +
+ " final Stream<List<Integer>> input)\n" +
+ " {\n" +
+ " final Function<? super List<Integer>, ? extends Stream<? extends Integer>> func = item -> {\n" +
+ " return item.stream().map(value -> value);\n" +
+ " };\n" +
+ " return input.flatMap(func);\n" +
+ " }\n" +
"}\n"});
}
public void testBug433158() {
runNegativeTest(
new String[] {
"CollectorsMaps.java",
- "\n" +
- "import java.util.List;\n" +
- "import java.util.Map;\n" +
- "import static java.util.stream.Collectors.*;\n" +
- "\n" +
- "public class CollectorsMaps {/*Q*/\n" +
- " private static class Pair<L, R> {\n" +
- " public final L lhs; public final R rhs;\n" +
- " public Pair(L lhs, R rhs) { this.lhs = lhs; this.rhs = rhs; }\n" +
- " public R rhs() { return rhs; }\n" +
- " public L lhs() { return lhs; }\n" +
- " public <N> Pair<N, R> keepingRhs(N newLhs) { return new Pair<>(newLhs, rhs); }\n" +
- " /*E*/}\n" +
- "\n" +
- " static Map<String, List<String>> invert(Map<String, List<String>> packages) {\n" +
- " return packages.entrySet().stream().map(e -> new Pair<>(e.getValue(), e.getKey())).flatMap(\n" +
- " //The method collect(Collector<? super Object,A,R>) in the type Stream<Object>\n" +
- " //is not applicable for the arguments \n" +
- " //(Collector<CollectorsMaps.Pair<String,String>,capture#3-of ?,Map<String,List<String>>>)\n" +
- " p -> p.lhs.stream().map(p::keepingRhs)).collect(\n" +
- " groupingBy(Pair<String, String>::lhs, mapping(Pair<String, String>::rhs, toList())));\n" +
- " }\n" +
+ "\n" +
+ "import java.util.List;\n" +
+ "import java.util.Map;\n" +
+ "import static java.util.stream.Collectors.*;\n" +
+ "\n" +
+ "public class CollectorsMaps {/*Q*/\n" +
+ " private static class Pair<L, R> {\n" +
+ " public final L lhs; public final R rhs;\n" +
+ " public Pair(L lhs, R rhs) { this.lhs = lhs; this.rhs = rhs; }\n" +
+ " public R rhs() { return rhs; }\n" +
+ " public L lhs() { return lhs; }\n" +
+ " public <N> Pair<N, R> keepingRhs(N newLhs) { return new Pair<>(newLhs, rhs); }\n" +
+ " /*E*/}\n" +
+ "\n" +
+ " static Map<String, List<String>> invert(Map<String, List<String>> packages) {\n" +
+ " return packages.entrySet().stream().map(e -> new Pair<>(e.getValue(), e.getKey())).flatMap(\n" +
+ " //The method collect(Collector<? super Object,A,R>) in the type Stream<Object>\n" +
+ " //is not applicable for the arguments \n" +
+ " //(Collector<CollectorsMaps.Pair<String,String>,capture#3-of ?,Map<String,List<String>>>)\n" +
+ " p -> p.lhs.stream().map(p::keepingRhs)).collect(\n" +
+ " groupingBy(Pair<String, String>::lhs, mapping(Pair<String, String>::rhs, toList())));\n" +
+ " }\n" +
"}\n"
},
"");
@@ -3101,65 +3101,65 @@ public void testBug432626() {
runConformTest(
new String[] {
"StreamInterface2.java",
- "import java.util.ArrayList;\n" +
- "import java.util.HashMap;\n" +
- "import java.util.Map;\n" +
- "import java.util.function.Function;\n" +
- "import java.util.function.Supplier;\n" +
- "import java.util.stream.Collector;\n" +
- "import java.util.stream.Collectors;\n" +
- "import java.util.stream.Stream;\n" +
- "\n" +
- "public interface StreamInterface2 {\n" +
- "\n" +
- " static <T, E extends Exception, K> Map<K, ArrayList<T>> terminalAsMapToList(\n" +
- " Function<? super T, ? extends K> classifier,\n" +
- " Supplier<Stream<T>> supplier,\n" +
- " Class<E> classOfE) throws E {\n" +
- " return terminalAsCollected(classOfE, Collectors.groupingBy(\n" +
- " classifier,\n" +
- " //This is OK:\n" +
- " //Redundant specification of type arguments <K, ArrayList<T>>\n" +
- " () -> new HashMap<K, ArrayList<T>>(),\n" +
- " Collector.<T, ArrayList<T>> of(\n" +
- " () -> new ArrayList<>(),\n" +
- " (left, value) -> left.add(value),\n" +
- " (left, right) -> combined(left, right))), supplier);\n" +
- " }\n" +
- " static <T, E extends Exception, K> Map<K, ArrayList<T>> terminalAsMapToList2(\n" +
- " Function<? super T, ? extends K> classifier,\n" +
- " Supplier<Stream<T>> supplier,\n" +
- " Class<E> classOfE) throws E {\n" +
- " //After removing type arguments, ECJ shows error, javac doesn't:\n" +
- " //Type mismatch: cannot convert from HashMap<capture#2-of ? extends K,ArrayList<T>> to Map<K,ArrayList<T>>\n" +
- " return terminalAsCollected(classOfE, Collectors.groupingBy(\n" +
- " classifier,\n" +
- " () -> new HashMap<>(),\n" +
- " Collector.<T, ArrayList<T>> of(\n" +
- " () -> new ArrayList<>(),\n" +
- " (left, value) -> left.add(value),\n" +
- " (left, right) -> combined(left, right))), supplier);\n" +
- " }\n" +
- " static <E extends Exception, T, M> M terminalAsCollected(\n" +
- " Class<E> classOfE,\n" +
- " Collector<T, ?, M> collector,\n" +
- " Supplier<Stream<T>> supplier) throws E {\n" +
- " try(Stream<T> s = supplier.get()) {\n" +
- " return s.collect(collector);\n" +
- " } catch(RuntimeException e) {\n" +
- " throw unwrapCause(classOfE, e);\n" +
- " }\n" +
- " }\n" +
- " static <E extends Exception> E unwrapCause(Class<E> classOfE, RuntimeException e) throws E {\n" +
- " Throwable cause = e.getCause();\n" +
- " if(classOfE.isInstance(cause) == false) {\n" +
- " throw e;\n" +
- " }\n" +
- " throw classOfE.cast(cause);\n" +
- " }\n" +
- " static <T> ArrayList<T> combined(ArrayList<T> left, ArrayList<T> right) {\n" +
- " left.addAll(right);\n" +
- " return left;\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.HashMap;\n" +
+ "import java.util.Map;\n" +
+ "import java.util.function.Function;\n" +
+ "import java.util.function.Supplier;\n" +
+ "import java.util.stream.Collector;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "import java.util.stream.Stream;\n" +
+ "\n" +
+ "public interface StreamInterface2 {\n" +
+ "\n" +
+ " static <T, E extends Exception, K> Map<K, ArrayList<T>> terminalAsMapToList(\n" +
+ " Function<? super T, ? extends K> classifier,\n" +
+ " Supplier<Stream<T>> supplier,\n" +
+ " Class<E> classOfE) throws E {\n" +
+ " return terminalAsCollected(classOfE, Collectors.groupingBy(\n" +
+ " classifier,\n" +
+ " //This is OK:\n" +
+ " //Redundant specification of type arguments <K, ArrayList<T>>\n" +
+ " () -> new HashMap<K, ArrayList<T>>(),\n" +
+ " Collector.<T, ArrayList<T>> of(\n" +
+ " () -> new ArrayList<>(),\n" +
+ " (left, value) -> left.add(value),\n" +
+ " (left, right) -> combined(left, right))), supplier);\n" +
+ " }\n" +
+ " static <T, E extends Exception, K> Map<K, ArrayList<T>> terminalAsMapToList2(\n" +
+ " Function<? super T, ? extends K> classifier,\n" +
+ " Supplier<Stream<T>> supplier,\n" +
+ " Class<E> classOfE) throws E {\n" +
+ " //After removing type arguments, ECJ shows error, javac doesn't:\n" +
+ " //Type mismatch: cannot convert from HashMap<capture#2-of ? extends K,ArrayList<T>> to Map<K,ArrayList<T>>\n" +
+ " return terminalAsCollected(classOfE, Collectors.groupingBy(\n" +
+ " classifier,\n" +
+ " () -> new HashMap<>(),\n" +
+ " Collector.<T, ArrayList<T>> of(\n" +
+ " () -> new ArrayList<>(),\n" +
+ " (left, value) -> left.add(value),\n" +
+ " (left, right) -> combined(left, right))), supplier);\n" +
+ " }\n" +
+ " static <E extends Exception, T, M> M terminalAsCollected(\n" +
+ " Class<E> classOfE,\n" +
+ " Collector<T, ?, M> collector,\n" +
+ " Supplier<Stream<T>> supplier) throws E {\n" +
+ " try(Stream<T> s = supplier.get()) {\n" +
+ " return s.collect(collector);\n" +
+ " } catch(RuntimeException e) {\n" +
+ " throw unwrapCause(classOfE, e);\n" +
+ " }\n" +
+ " }\n" +
+ " static <E extends Exception> E unwrapCause(Class<E> classOfE, RuntimeException e) throws E {\n" +
+ " Throwable cause = e.getCause();\n" +
+ " if(classOfE.isInstance(cause) == false) {\n" +
+ " throw e;\n" +
+ " }\n" +
+ " throw classOfE.cast(cause);\n" +
+ " }\n" +
+ " static <T> ArrayList<T> combined(ArrayList<T> left, ArrayList<T> right) {\n" +
+ " left.addAll(right);\n" +
+ " return left;\n" +
" }\n" +
"}\n"
});
@@ -3191,21 +3191,21 @@ public void testBug432626_reduced() {
public void testBug433825() {
this.runConformTest(
new String[] {
- "X.java",
- "import java.util.ArrayList;\n" +
- "import java.util.Collection;\n" +
- "import java.util.List;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public void bla() {\n" +
- " boolean b = Boolean.TRUE.booleanValue();\n" +
- " List<String> c1 = new ArrayList<>();\n" +
- " new Bar(b ? c1 : new ArrayList<>()); // this line crashes ecj (4.4 I20140429-0800), but not ecj (eclipse 3.8.2) and javac\n" +
- " }\n" +
- " private static class Bar {\n" +
- " public Bar(Collection<?> col) { }\n" +
- " }\n" +
+ "X.java",
+ "import java.util.ArrayList;\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.List;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
+ " public void bla() {\n" +
+ " boolean b = Boolean.TRUE.booleanValue();\n" +
+ " List<String> c1 = new ArrayList<>();\n" +
+ " new Bar(b ? c1 : new ArrayList<>()); // this line crashes ecj (4.4 I20140429-0800), but not ecj (eclipse 3.8.2) and javac\n" +
+ " }\n" +
+ " private static class Bar {\n" +
+ " public Bar(Collection<?> col) { }\n" +
+ " }\n" +
"}"
});
}
@@ -3213,58 +3213,58 @@ public void testBug433825() {
public void testBug433825a() {
this.runNegativeTest(
new String[] {
- "X.java",
- "import java.util.ArrayList;\n" +
- "import java.util.Collection;\n" +
- "import java.util.List;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public void bla() {\n" +
- " boolean b = Boolean.TRUE.booleanValue();\n" +
- " new Bar(b ? 0 : new ArrayList<>());\n" +
- " }\n" +
- " private static class Bar {\n" +
- " public Bar(Collection<String> col) { }\n" +
- " }\n" +
+ "X.java",
+ "import java.util.ArrayList;\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.List;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
+ " public void bla() {\n" +
+ " boolean b = Boolean.TRUE.booleanValue();\n" +
+ " new Bar(b ? 0 : new ArrayList<>());\n" +
+ " }\n" +
+ " private static class Bar {\n" +
+ " public Bar(Collection<String> col) { }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " new Bar(b ? 0 : new ArrayList<>());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The constructor X.Bar((b ? 0 : new ArrayList<>())) is undefined\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " new Bar(b ? 0 : new ArrayList<>());\n" +
- " ^\n" +
- "Type mismatch: cannot convert from int to Collection<String>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 12)\n" +
- " public Bar(Collection<String> col) { }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The constructor X.Bar(Collection<String>) is never used locally\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " new Bar(b ? 0 : new ArrayList<>());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The constructor X.Bar((b ? 0 : new ArrayList<>())) is undefined\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " new Bar(b ? 0 : new ArrayList<>());\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from int to Collection<String>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 12)\n" +
+ " public Bar(Collection<String> col) { }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The constructor X.Bar(Collection<String>) is never used locally\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=435462 [1.8] NPE in codegen with nested conditional and allocation expressions
public void testBug435462() {
this.runConformTest(
new String[] {
- "X.java",
- "import java.util.ArrayList;\n" +
- "import java.util.Collection;\n" +
- "import java.util.List;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public void bla() {\n" +
- " boolean b = Boolean.TRUE.booleanValue();\n" +
- " List<String> c1 = new ArrayList<>();\n" +
- " new Bar(b ? new ArrayList<>(b ? new ArrayList<>() : c1) : c1);\n" +
- " }\n" +
- " private static class Bar {\n" +
- " public Bar(Collection<?> col) { }\n" +
- " }\n" +
+ "X.java",
+ "import java.util.ArrayList;\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.List;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
+ " public void bla() {\n" +
+ " boolean b = Boolean.TRUE.booleanValue();\n" +
+ " List<String> c1 = new ArrayList<>();\n" +
+ " new Bar(b ? new ArrayList<>(b ? new ArrayList<>() : c1) : c1);\n" +
+ " }\n" +
+ " private static class Bar {\n" +
+ " public Bar(Collection<?> col) { }\n" +
+ " }\n" +
"}"
});
}
@@ -3272,18 +3272,18 @@ public void testBug437007() {
runConformTest(
new String[] {
"ExecutorTests.java",
- "import java.util.*;\n" +
- "\n" +
- "public class ExecutorTests {\n" +
- " List<Runnable> tasks = Arrays.asList(\n" +
- " () -> {\n" +
- " System.out.println(\"task1 start\");\n" +
- " }\n" +
- " );\n" +
- "\n" +
- " public void executeInSync(){\n" +
- " tasks.stream().forEach(Runnable::run);\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "\n" +
+ "public class ExecutorTests {\n" +
+ " List<Runnable> tasks = Arrays.asList(\n" +
+ " () -> {\n" +
+ " System.out.println(\"task1 start\");\n" +
+ " }\n" +
+ " );\n" +
+ "\n" +
+ " public void executeInSync(){\n" +
+ " tasks.stream().forEach(Runnable::run);\n" +
+ " }\n" +
"}\n"
});
}
@@ -3292,16 +3292,16 @@ public void testBug435689() {
new String[] {
"Test.java",
"import java.util.function.*;\n" +
- "class Foo<T> {\n" +
- " <U> void apply(Function<T, Consumer<U>> bar) {}\n" +
- "}\n" +
- "\n" +
- "class Bar {\n" +
- " void setBar(String bar){}\n" +
+ "class Foo<T> {\n" +
+ " <U> void apply(Function<T, Consumer<U>> bar) {}\n" +
+ "}\n" +
+ "\n" +
+ "class Bar {\n" +
+ " void setBar(String bar){}\n" +
"}\n" +
"public class Test {\n" +
" void test() {\n" +
- " new Foo<Bar>().apply(bar -> bar::setBar);\n" +
+ " new Foo<Bar>().apply(bar -> bar::setBar);\n" +
" }\n" +
"}\n"
});
@@ -3310,64 +3310,64 @@ public void testBug433845() {
runNegativeTest(
new String[] {
"test/Test.java",
- "package test;\n" +
- "\n" +
- "\n" +
- "public abstract class Test {\n" +
- " public interface MUIElement {\n" +
- " \n" +
- " }\n" +
- "\n" +
- " private interface Listener<W extends WWidget<?>> {\n" +
- " public void call(Event<W> event);\n" +
- " }\n" +
- " \n" +
- " public static class Event<W extends WWidget<?>> {\n" +
- " \n" +
- " }\n" +
- " \n" +
- " public interface WWidget<M extends MUIElement> {\n" +
- " public void set(Listener<? extends WWidget<M>> handler);\n" +
- " }\n" +
- " \n" +
- " public static abstract class A<M extends MUIElement, W extends WWidget<M>> {\n" +
- " \n" +
- " public final W createWidget(final M element) {\n" +
- " W w = get(); \n" +
- " // works\n" +
- " w.set((Event<W>e) -> call(e));\n" +
- " // fails\n" +
- " w.set(this::call);\n" +
- " // fails\n" +
- " w.set((e) -> call(e));\n" +
- " return w;\n" +
- " }\n" +
- " \n" +
- " private W get() {\n" +
- " return null;\n" +
- " }\n" +
- " \n" +
- " private void call(Event<W> event) {\n" +
- " \n" +
- " }\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "\n" +
+ "public abstract class Test {\n" +
+ " public interface MUIElement {\n" +
+ " \n" +
+ " }\n" +
+ "\n" +
+ " private interface Listener<W extends WWidget<?>> {\n" +
+ " public void call(Event<W> event);\n" +
+ " }\n" +
+ " \n" +
+ " public static class Event<W extends WWidget<?>> {\n" +
+ " \n" +
+ " }\n" +
+ " \n" +
+ " public interface WWidget<M extends MUIElement> {\n" +
+ " public void set(Listener<? extends WWidget<M>> handler);\n" +
+ " }\n" +
+ " \n" +
+ " public static abstract class A<M extends MUIElement, W extends WWidget<M>> {\n" +
+ " \n" +
+ " public final W createWidget(final M element) {\n" +
+ " W w = get(); \n" +
+ " // works\n" +
+ " w.set((Event<W>e) -> call(e));\n" +
+ " // fails\n" +
+ " w.set(this::call);\n" +
+ " // fails\n" +
+ " w.set((e) -> call(e));\n" +
+ " return w;\n" +
+ " }\n" +
+ " \n" +
+ " private W get() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " \n" +
+ " private void call(Event<W> event) {\n" +
+ " \n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in test\\Test.java (at line 28)\n" +
- " w.set(this::call);\n" +
- " ^^^\n" +
- "The method set(Test.Listener<? extends Test.WWidget<M>>) in the type Test.WWidget<M> is not applicable for the arguments (this::call)\n" +
- "----------\n" +
- "2. ERROR in test\\Test.java (at line 28)\n" +
- " w.set(this::call);\n" +
- " ^^^^^^^^^^\n" +
- "The type Test.A<M,W> does not define call(Test.Event<Test.WWidget<M>>) that is applicable here\n" +
- "----------\n" +
- "3. ERROR in test\\Test.java (at line 30)\n" +
- " w.set((e) -> call(e));\n" +
- " ^^^^\n" +
- "The method call(Test.Event<W>) in the type Test.A<M,W> is not applicable for the arguments (Test.Event<Test.WWidget<M>>)\n" +
+ "----------\n" +
+ "1. ERROR in test\\Test.java (at line 28)\n" +
+ " w.set(this::call);\n" +
+ " ^^^\n" +
+ "The method set(Test.Listener<? extends Test.WWidget<M>>) in the type Test.WWidget<M> is not applicable for the arguments (this::call)\n" +
+ "----------\n" +
+ "2. ERROR in test\\Test.java (at line 28)\n" +
+ " w.set(this::call);\n" +
+ " ^^^^^^^^^^\n" +
+ "The type Test.A<M,W> does not define call(Test.Event<Test.WWidget<M>>) that is applicable here\n" +
+ "----------\n" +
+ "3. ERROR in test\\Test.java (at line 30)\n" +
+ " w.set((e) -> call(e));\n" +
+ " ^^^^\n" +
+ "The method call(Test.Event<W>) in the type Test.A<M,W> is not applicable for the arguments (Test.Event<Test.WWidget<M>>)\n" +
"----------\n");
}
public void testBug435187() {
@@ -3376,36 +3376,36 @@ public void testBug435187() {
JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings,
new String[] {
"ExtractLocalLambda.java",
- "\n" +
- "import java.util.List;\n" +
- "import java.util.Map;\n" +
- "import java.util.Map.Entry;\n" +
- "import java.util.function.Function;\n" +
- "import java.util.stream.Collector;\n" +
- "import java.util.stream.Stream;\n" +
- "\n" +
- "public class ExtractLocalLambda {\n" +
- " static Stream<Entry<List<String>, String>> map;\n" +
- " static Collector<Entry<String, String>, ?, Map<String, List<String>>> groupingBy;\n" +
- " private static Stream<String> stream(Entry<List<String>, String> p) { return null; }\n" +
- " private static Entry<String, String> keep(Entry<List<String>, String> p, String leftHS2) { return null; }\n" +
- "\n" +
- " static Map<String, List<String>> beforeRefactoring() {\n" +
- " // Extract local variable from the parameter to flatMap:\n" +
- " return map.flatMap(\n" +
- " p -> stream(p).map(leftHS -> {\n" +
- " String leftHS2 = leftHS;\n" +
- " return keep(p, leftHS2);\n" +
- " })\n" +
- " ).collect(groupingBy);\n" +
- " }\n" +
+ "\n" +
+ "import java.util.List;\n" +
+ "import java.util.Map;\n" +
+ "import java.util.Map.Entry;\n" +
+ "import java.util.function.Function;\n" +
+ "import java.util.stream.Collector;\n" +
+ "import java.util.stream.Stream;\n" +
+ "\n" +
+ "public class ExtractLocalLambda {\n" +
+ " static Stream<Entry<List<String>, String>> map;\n" +
+ " static Collector<Entry<String, String>, ?, Map<String, List<String>>> groupingBy;\n" +
+ " private static Stream<String> stream(Entry<List<String>, String> p) { return null; }\n" +
+ " private static Entry<String, String> keep(Entry<List<String>, String> p, String leftHS2) { return null; }\n" +
+ "\n" +
+ " static Map<String, List<String>> beforeRefactoring() {\n" +
+ " // Extract local variable from the parameter to flatMap:\n" +
+ " return map.flatMap(\n" +
+ " p -> stream(p).map(leftHS -> {\n" +
+ " String leftHS2 = leftHS;\n" +
+ " return keep(p, leftHS2);\n" +
+ " })\n" +
+ " ).collect(groupingBy);\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in ExtractLocalLambda.java (at line 5)\n" +
- " import java.util.function.Function;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The import java.util.function.Function is never used\n" +
+ "----------\n" +
+ "1. WARNING in ExtractLocalLambda.java (at line 5)\n" +
+ " import java.util.function.Function;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The import java.util.function.Function is never used\n" +
"----------\n");
}
public void testBug435767() {
@@ -3415,40 +3415,40 @@ public void testBug435767() {
"import java.util.*;\n" +
"import java.util.function.*;\n" +
"import java.util.stream.*;\n" +
- "public class DummyClass {\n" +
- "\n" +
- " public void method() {\n" +
- "\n" +
- " // Cases where there is no error\n" +
- " final Supplier<Set<String>> suppliers = this.memoize(() -> new HashSet<>());\n" +
- "\n" +
- " final Supplier<Map<Object, Object>> noMemoize = () -> suppliers.get().stream()\n" +
- " .filter(path -> path.startsWith(\"\"))\n" +
- " .collect(Collectors.toMap(path -> this.getKey(path), path -> this.getValue(path)));\n" +
- "\n" +
- " // Case where there is errors.\n" +
- " final Supplier<Map<Object, Object>> memoize = this.memoize(() -> suppliers.get().stream()\n" +
- " .filter(path -> path.startsWith(\"\"))\n" +
- " .collect(Collectors.toMap(path -> this.getKey(path), path -> this.getValue(path))));\n" +
- "\n" +
- " // Error message are : Description\n" +
- " // Resource Path Location Type\n" +
- " // The method getKey(String) in the type DummyClass is not applicable for the arguments (Object) DummyClass.java line 23 Java Problem\n" +
- " // The method getValue(String) in the type DummyClass is not applicable for the arguments (Object) DummyClass.java line 23 Java Problem\n" +
- "\n" +
- " }\n" +
- "\n" +
- " private <T> Supplier<T> memoize(final Supplier<T> delegate) {\n" +
- " return delegate;\n" +
- " }\n" +
- "\n" +
- " private Object getKey(final String path) {\n" +
- " return path;\n" +
- " }\n" +
- "\n" +
- " private Object getValue(final String path) {\n" +
- " return path;\n" +
- " }\n" +
+ "public class DummyClass {\n" +
+ "\n" +
+ " public void method() {\n" +
+ "\n" +
+ " // Cases where there is no error\n" +
+ " final Supplier<Set<String>> suppliers = this.memoize(() -> new HashSet<>());\n" +
+ "\n" +
+ " final Supplier<Map<Object, Object>> noMemoize = () -> suppliers.get().stream()\n" +
+ " .filter(path -> path.startsWith(\"\"))\n" +
+ " .collect(Collectors.toMap(path -> this.getKey(path), path -> this.getValue(path)));\n" +
+ "\n" +
+ " // Case where there is errors.\n" +
+ " final Supplier<Map<Object, Object>> memoize = this.memoize(() -> suppliers.get().stream()\n" +
+ " .filter(path -> path.startsWith(\"\"))\n" +
+ " .collect(Collectors.toMap(path -> this.getKey(path), path -> this.getValue(path))));\n" +
+ "\n" +
+ " // Error message are : Description\n" +
+ " // Resource Path Location Type\n" +
+ " // The method getKey(String) in the type DummyClass is not applicable for the arguments (Object) DummyClass.java line 23 Java Problem\n" +
+ " // The method getValue(String) in the type DummyClass is not applicable for the arguments (Object) DummyClass.java line 23 Java Problem\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
+ " private <T> Supplier<T> memoize(final Supplier<T> delegate) {\n" +
+ " return delegate;\n" +
+ " }\n" +
+ "\n" +
+ " private Object getKey(final String path) {\n" +
+ " return path;\n" +
+ " }\n" +
+ "\n" +
+ " private Object getValue(final String path) {\n" +
+ " return path;\n" +
+ " }\n" +
"}\n"
},
"");
@@ -3458,19 +3458,19 @@ public void testBug434483() {
new String[] {
"Foo.java",
"import java.util.*;\n" +
- "public class Foo {\n" +
- " \n" +
- " // Similar to Guava's newLinkedList()\n" +
- " public static <E> LinkedList<E> newLinkedList() {\n" +
- " return new LinkedList<E>();\n" +
- " }\n" +
- " \n" +
- " private final ThreadLocal<Queue<String>> brokenQueue = ThreadLocal.withInitial(Foo::newLinkedList);\n" +
- " \n" +
- " private final ThreadLocal<Queue<String>> workingQueue1 = ThreadLocal.withInitial(Foo::<String>newLinkedList);\n" +
- " \n" +
- " private final ThreadLocal<Queue<String>> workingQueue2 = ThreadLocal.withInitial(() -> Foo.<String>newLinkedList());\n" +
- "\n" +
+ "public class Foo {\n" +
+ " \n" +
+ " // Similar to Guava's newLinkedList()\n" +
+ " public static <E> LinkedList<E> newLinkedList() {\n" +
+ " return new LinkedList<E>();\n" +
+ " }\n" +
+ " \n" +
+ " private final ThreadLocal<Queue<String>> brokenQueue = ThreadLocal.withInitial(Foo::newLinkedList);\n" +
+ " \n" +
+ " private final ThreadLocal<Queue<String>> workingQueue1 = ThreadLocal.withInitial(Foo::<String>newLinkedList);\n" +
+ " \n" +
+ " private final ThreadLocal<Queue<String>> workingQueue2 = ThreadLocal.withInitial(() -> Foo.<String>newLinkedList());\n" +
+ "\n" +
"}\n"
});
}
@@ -3480,27 +3480,27 @@ public void testBug441734() {
"Example.java",
"import java.util.*;\n" +
"import java.util.function.*;\n" +
- "class Example {\n" +
- " void foo(Iterable<Number> x) { }\n" +
- "\n" +
- " <T> void bar(Consumer<Iterable<T>> f) { }\n" +
- "\n" +
- " void test() {\n" +
- " //call 1: lambda w/argument type - OK\n" +
- " bar((Iterable<Number> x) -> foo(x));\n" +
- "\n" +
- " //call 2: lambda w/explicit type - OK\n" +
- " this.<Number> bar(x -> foo(x));\n" +
- "\n" +
- " //call 3: method ref w/explicit type - OK\n" +
- " this.<Number> bar(this::foo);\n" +
- "\n" +
- " //call 4: lambda w/implicit type - correctly(?) fails*\n" +
- " //bar(x -> foo(x));\n" +
- "\n" +
- " //call 5: method ref w/implicit type - BUG!\n" +
- " bar(this::foo); // errors!\n" +
- " }\n" +
+ "class Example {\n" +
+ " void foo(Iterable<Number> x) { }\n" +
+ "\n" +
+ " <T> void bar(Consumer<Iterable<T>> f) { }\n" +
+ "\n" +
+ " void test() {\n" +
+ " //call 1: lambda w/argument type - OK\n" +
+ " bar((Iterable<Number> x) -> foo(x));\n" +
+ "\n" +
+ " //call 2: lambda w/explicit type - OK\n" +
+ " this.<Number> bar(x -> foo(x));\n" +
+ "\n" +
+ " //call 3: method ref w/explicit type - OK\n" +
+ " this.<Number> bar(this::foo);\n" +
+ "\n" +
+ " //call 4: lambda w/implicit type - correctly(?) fails*\n" +
+ " //bar(x -> foo(x));\n" +
+ "\n" +
+ " //call 5: method ref w/implicit type - BUG!\n" +
+ " bar(this::foo); // errors!\n" +
+ " }\n" +
"}\n"
});
}
@@ -3610,7 +3610,7 @@ public void testBug442245() {
" R apply(T t);\n" +
" }\n" +
"}\n",
- "test/Tuples.java",
+ "test/Tuples.java",
"package test;\n"+
"\n"+
"import java.io.Serializable;\n"+
@@ -4471,7 +4471,7 @@ public void testBug442245() {
public void test439594() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"import java.util.ArrayList;\n" +
"import java.util.List;\n" +
"import java.util.function.Function;\n" +
@@ -4546,7 +4546,7 @@ public void test439594() {
public void _test439594_small() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"import java.util.ArrayList;\n" +
"import java.util.List;\n" +
"import java.util.function.Function;\n" +
@@ -4587,7 +4587,7 @@ public void _test439594_small() {
public void test433852() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"import java.util.Optional;\n" +
"import java.util.function.Function;\n" +
"import java.util.stream.Stream;\n" +
@@ -4609,24 +4609,24 @@ public void test433852() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " return s31.map(s2 -> s2.map(s1 -> Integer.parseInt(s1))).findAny();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Optional<Stream<Integer>> to Optional<Stream<Object>>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " return s3.map(s2 -> s2.map(s1 -> Integer.parseInt(s1))).flatMap(Function.identity()).findAny().orElse(\n" +
- " ^^^^^^\n" +
- "The method orElse(Integer) in the type Optional<Integer> is not applicable for the arguments (Class<X>)\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 18)\n" +
- " return s3.map(s2 -> s2.map(s1 -> Integer.parseInt(s1))).findAny().orElse(Stream.of(new Object()));\n" +
- " ^^^^^^\n" +
- "The method orElse(Stream<Integer>) in the type Optional<Stream<Integer>> is not applicable for the arguments (Stream<Object>)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " return s31.map(s2 -> s2.map(s1 -> Integer.parseInt(s1))).findAny();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Optional<Stream<Integer>> to Optional<Stream<Object>>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " return s3.map(s2 -> s2.map(s1 -> Integer.parseInt(s1))).flatMap(Function.identity()).findAny().orElse(\n" +
+ " ^^^^^^\n" +
+ "The method orElse(Integer) in the type Optional<Integer> is not applicable for the arguments (Class<X>)\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 18)\n" +
+ " return s3.map(s2 -> s2.map(s1 -> Integer.parseInt(s1))).findAny().orElse(Stream.of(new Object()));\n" +
+ " ^^^^^^\n" +
+ "The method orElse(Stream<Integer>) in the type Optional<Stream<Integer>> is not applicable for the arguments (Stream<Object>)\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=442916, [1.8][inference] Type Inference is broken for CompletableFuture then-methods
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=442916, [1.8][inference] Type Inference is broken for CompletableFuture then-methods
public void test442916() {
this.runConformTest(
new String[] {
@@ -4649,7 +4649,7 @@ public void test442916() {
},
"3");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=442769, [1.8][compiler] Invalid type inference using Stream
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=442769, [1.8][compiler] Invalid type inference using Stream
public void test442769() {
this.runConformTest(
new String[] {
@@ -4736,12 +4736,12 @@ public void test437444_c113() {
" return (T) x;\n" +
" }\n" +
"}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " final List<String>[] ls = Util.cast(new List<>[] { null });\n" +
- " ^^^^\n" +
- "Incorrect number of arguments for type List<E>; it cannot be parameterized with arguments <>\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " final List<String>[] ls = Util.cast(new List<>[] { null });\n" +
+ " ^^^^\n" +
+ "Incorrect number of arguments for type List<E>; it cannot be parameterized with arguments <>\n" +
"----------\n");
}
// Error while building JRE8: https://bugs.eclipse.org/bugs/show_bug.cgi?id=437444#c113
@@ -4760,7 +4760,7 @@ public void test437444_c113a() {
" return (T) x;\n" +
" }\n" +
"}\n",
- },
+ },
"");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=434394, [1.8] inference fails in some cases when conditional expression is involved
@@ -4797,7 +4797,7 @@ public void test434394() {
" Val(T t) {}\n" +
" }\n" +
"}\n",
- },
+ },
"");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=445725, [1.8][inference] Type inference not occurring with lambda expression and constructor reference
@@ -4847,7 +4847,7 @@ public void test445725() {
" }\n" +
" }\n" +
"}\n",
- },
+ },
"");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=447767, [1.8][compiler] Spurious method not applicable error due to interaction between overload resolution and type inference
@@ -4872,7 +4872,7 @@ public void test447767() {
" new X(\"\").two();\n" +
" }\n" +
"}\n",
- },
+ },
"Here");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426633, [1.8][compiler] Compiler generates code that invokes inapplicable method.
@@ -4894,11 +4894,11 @@ public void test426633c() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " default <T> void foo (T... p) {}\n" +
- " ^\n" +
- "Type safety: Potential heap pollution via varargs parameter p\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " default <T> void foo (T... p) {}\n" +
+ " ^\n" +
+ "Type safety: Potential heap pollution via varargs parameter p\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426633, [1.8][compiler] Compiler generates code that invokes inapplicable method.
@@ -4920,26 +4920,26 @@ public void test426633d() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " default <T> void foo (T... p) {}\n" +
- " ^\n" +
- "Type safety: Potential heap pollution via varargs parameter p\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " abstract class B extends A implements I {\n" +
- " ^\n" +
- "Varargs methods should only override or be overridden by other varargs methods unlike A.foo(Object[]) and I.foo(Object...)\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 9)\n" +
- " public abstract class X extends B implements I {\n" +
- " ^\n" +
- "Varargs methods should only override or be overridden by other varargs methods unlike A.foo(Object[]) and I.foo(Object...)\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 11)\n" +
- " b.foo(\"hello\", \"world\");\n" +
- " ^^^\n" +
- "The method foo(T...) of type I cannot be invoked as it is overridden by an inapplicable method\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " default <T> void foo (T... p) {}\n" +
+ " ^\n" +
+ "Type safety: Potential heap pollution via varargs parameter p\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " abstract class B extends A implements I {\n" +
+ " ^\n" +
+ "Varargs methods should only override or be overridden by other varargs methods unlike A.foo(Object[]) and I.foo(Object...)\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 9)\n" +
+ " public abstract class X extends B implements I {\n" +
+ " ^\n" +
+ "Varargs methods should only override or be overridden by other varargs methods unlike A.foo(Object[]) and I.foo(Object...)\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 11)\n" +
+ " b.foo(\"hello\", \"world\");\n" +
+ " ^^^\n" +
+ "The method foo(T...) of type I cannot be invoked as it is overridden by an inapplicable method\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426633, [1.8][compiler] Compiler generates code that invokes inapplicable method.
@@ -4961,11 +4961,11 @@ public void test426633e() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " default <T> void foo (T... p) {}\n" +
- " ^\n" +
- "Type safety: Potential heap pollution via varargs parameter p\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " default <T> void foo (T... p) {}\n" +
+ " ^\n" +
+ "Type safety: Potential heap pollution via varargs parameter p\n" +
"----------\n");
}
// original:
@@ -4973,17 +4973,17 @@ public void testBug452788a() {
runConformTest(
new String[] {
"Test.java",
- "import java.util.function.Function;\n" +
- "\n" +
- "interface Test<A> {\n" +
- "\n" +
- " <B3> Test<B3> create(B3 b);\n" +
- "\n" +
- " <B2> Test<B2> transform(Function<? extends A, Test<B2>> f);\n" +
- "\n" +
- " default <B1> Test<B1> wrap(Function<? super A, ? extends B1> f) {\n" +
- " return transform(a -> create(f.apply(a)));\n" +
- " }\n" +
+ "import java.util.function.Function;\n" +
+ "\n" +
+ "interface Test<A> {\n" +
+ "\n" +
+ " <B3> Test<B3> create(B3 b);\n" +
+ "\n" +
+ " <B2> Test<B2> transform(Function<? extends A, Test<B2>> f);\n" +
+ "\n" +
+ " default <B1> Test<B1> wrap(Function<? super A, ? extends B1> f) {\n" +
+ " return transform(a -> create(f.apply(a)));\n" +
+ " }\n" +
"}\n"
});
}
@@ -4992,23 +4992,23 @@ public void testBug452788b() {
runConformTest(
new String[] {
"Test.java",
- "import java.util.function.Function;\n" +
- "\n" +
- "interface Test<A> {\n" +
- "\n" +
- " <B3> Test<B3> create(B3 b);\n" +
- "\n" +
- " <B2> Test<B2> transform(Function<? extends A, Test<B2>> f);\n" +
- "\n" +
- " default <B1> Test<B1> wrap(Function<? super A, ? extends B1> f) {\n" +
+ "import java.util.function.Function;\n" +
+ "\n" +
+ "interface Test<A> {\n" +
+ "\n" +
+ " <B3> Test<B3> create(B3 b);\n" +
+ "\n" +
+ " <B2> Test<B2> transform(Function<? extends A, Test<B2>> f);\n" +
+ "\n" +
+ " default <B1> Test<B1> wrap(Function<? super A, ? extends B1> f) {\n" +
" return transform((A a) -> create(f.apply(a)));\n" + // explicitly typed lambda
" }\n" +
- " default <B> Function<? extends A, Test<B>> test1(Function<? super A, ? extends B> f) {\n" +
+ " default <B> Function<? extends A, Test<B>> test1(Function<? super A, ? extends B> f) {\n" +
" return a -> create(f.apply(a));\n" + // remove outer invocation
- " }\n" +
- " default <B> Function<? extends A, Function<? extends A, Test<B>>> test2(Function<? super A, ? extends B> f) {\n" +
+ " }\n" +
+ " default <B> Function<? extends A, Function<? extends A, Test<B>>> test2(Function<? super A, ? extends B> f) {\n" +
" return a1 -> a2 -> create(f.apply(a2));\n" + // outer lambda instead of outer invocation
- " }\n" +
+ " }\n" +
"}\n"
});
}
@@ -5017,25 +5017,25 @@ public void testBug452788c() {
runConformTest(
new String[] {
"Test2.java",
- "import java.util.function.Function;\n" +
- "\n" +
- "\n" +
- "public interface Test2<A> {\n" +
- " <B2> Test2<B2> transform(Function<? extends A, Test2<B2>> f);\n" +
- "\n" +
- " default <B1> Test2<B1> wrap(Function<? super A, ? extends B1> f) {\n" +
- " return transform(a -> new TestImpl<>(f.apply(a)));\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class TestImpl<A> implements Test2<A> {\n" +
- "\n" +
- " public TestImpl(A a) { }\n" +
- "\n" +
- " @Override\n" +
- " public <B2> Test2<B2> transform(Function<? extends A, Test2<B2>> f) {\n" +
- " return null;\n" +
- " } \n" +
+ "import java.util.function.Function;\n" +
+ "\n" +
+ "\n" +
+ "public interface Test2<A> {\n" +
+ " <B2> Test2<B2> transform(Function<? extends A, Test2<B2>> f);\n" +
+ "\n" +
+ " default <B1> Test2<B1> wrap(Function<? super A, ? extends B1> f) {\n" +
+ " return transform(a -> new TestImpl<>(f.apply(a)));\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class TestImpl<A> implements Test2<A> {\n" +
+ "\n" +
+ " public TestImpl(A a) { }\n" +
+ "\n" +
+ " @Override\n" +
+ " public <B2> Test2<B2> transform(Function<? extends A, Test2<B2>> f) {\n" +
+ " return null;\n" +
+ " } \n" +
"}\n"
});
}
@@ -5043,19 +5043,19 @@ public void testBug457079() {
runConformTest(
new String[] {
"Foo.java",
- "import java.util.Collections;\n" +
- "import java.util.Map;\n" +
- "import java.util.Set;\n" +
- "import java.util.function.Function;\n" +
- "\n" +
- "class Foo {\n" +
- " static <K, V> Map<K, V> foo(K value, Function<? super K, V> function) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " static void bar(Set<String> set) {\n" +
- " Map<String, Set<String>> map = foo(\"\", e -> Collections.emptySet());\n" +
- " }\n" +
+ "import java.util.Collections;\n" +
+ "import java.util.Map;\n" +
+ "import java.util.Set;\n" +
+ "import java.util.function.Function;\n" +
+ "\n" +
+ "class Foo {\n" +
+ " static <K, V> Map<K, V> foo(K value, Function<? super K, V> function) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " static void bar(Set<String> set) {\n" +
+ " Map<String, Set<String>> map = foo(\"\", e -> Collections.emptySet());\n" +
+ " }\n" +
"}\n"
});
}
@@ -5063,93 +5063,93 @@ public void testBug458396() {
runNegativeTest(
new String[] {
"Main.java",
- "import java.util.List;\n" +
- "\n" +
- "interface MyTickContext { }\n" +
- "abstract class MyEntity {\n" +
- " abstract void tick(MyTickContext ctx);\n" +
- "}\n" +
- "\n" +
- "public class Main {\n" +
- "\n" +
- " protected static final MyTickContext tickContext = new MyTickContext() {\n" +
- " public void method1(MyEntity e) {\n" +
- " removeEntity( e );\n" +
- " }\n" +
- " };\n" +
- "\n" +
- " public static final class Game {\n" +
- " public void method2(List<MyEntity> ents) {\n" +
- " ents.forEach( e -> e.tick(tickContext) );\n" +
- " }\n" +
- " }\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "interface MyTickContext { }\n" +
+ "abstract class MyEntity {\n" +
+ " abstract void tick(MyTickContext ctx);\n" +
+ "}\n" +
+ "\n" +
+ "public class Main {\n" +
+ "\n" +
+ " protected static final MyTickContext tickContext = new MyTickContext() {\n" +
+ " public void method1(MyEntity e) {\n" +
+ " removeEntity( e );\n" +
+ " }\n" +
+ " };\n" +
+ "\n" +
+ " public static final class Game {\n" +
+ " public void method2(List<MyEntity> ents) {\n" +
+ " ents.forEach( e -> e.tick(tickContext) );\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Main.java (at line 12)\n" +
- " removeEntity( e );\n" +
- " ^^^^^^^^^^^^\n" +
- "The method removeEntity(MyEntity) is undefined for the type new MyTickContext(){}\n" +
+ "----------\n" +
+ "1. ERROR in Main.java (at line 12)\n" +
+ " removeEntity( e );\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The method removeEntity(MyEntity) is undefined for the type new MyTickContext(){}\n" +
"----------\n");
}
public void testBug455945() {
runConformTest(
new String[] {
"Test.java",
- "import java.util.function.BiFunction;\n" +
- "import java.util.function.Function;\n" +
- "import java.util.function.Predicate;\n" +
- "import java.util.stream.Stream;\n" +
- "\n" +
- "public class Test {\n" +
- "\n" +
- " static <T> Tuple2<Seq<T>, Seq<T>> splitAtDoesntCompile(Stream<T> stream, long position) {\n" +
- " return seq(stream)\n" +
- " .zipWithIndex()\n" +
- " .partition(t -> t.v2 < position)\n" +
- " .map((v1, v2) -> tuple(\n" +
- " v1.map(t -> t.v1),\n" +
- " v2.map(t -> t.v1)\n" +
- " ));\n" +
- " }\n" +
- "\n" +
- " static <T> Tuple2<Seq<T>, Seq<T>> splitAtCompiles(Stream<T> stream, long position) {\n" +
- " return seq(stream)\n" +
- " .zipWithIndex()\n" +
- " .partition(t -> t.v2 < position)\n" +
- " .map((v1, v2) -> Test.<Seq<T>, Seq<T>>tuple(\n" +
- " v1.map(t -> t.v1),\n" +
- " v2.map(t -> t.v1)\n" +
- " ));\n" +
- " }\n" +
- "\n" +
- " static <T> Seq<T> seq(Stream<T> stream) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " static <T1, T2> Tuple2<T1, T2> tuple(T1 v1, T2 v2) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "interface I<T> {\n" +
- " T get();\n" +
- " <U> I<U> map(Function<T, U> f);\n" +
- "}\n" +
- "\n" +
- "interface Seq<T> {\n" +
- " Seq<Tuple2<T, Long>> zipWithIndex();\n" +
- " Tuple2<Seq<T>, Seq<T>> partition(Predicate<? super T> predicate);\n" +
- " <R> Seq<R> map(Function<? super T, ? extends R> mapper);\n" +
- "}\n" +
- "\n" +
- "class Tuple2<T1, T2> {\n" +
- " T1 v1;\n" +
- " T2 v2;\n" +
- " \n" +
- " <R> R map(BiFunction<T1, T2, R> function) {\n" +
- " return null;\n" +
- " }\n" +
+ "import java.util.function.BiFunction;\n" +
+ "import java.util.function.Function;\n" +
+ "import java.util.function.Predicate;\n" +
+ "import java.util.stream.Stream;\n" +
+ "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " static <T> Tuple2<Seq<T>, Seq<T>> splitAtDoesntCompile(Stream<T> stream, long position) {\n" +
+ " return seq(stream)\n" +
+ " .zipWithIndex()\n" +
+ " .partition(t -> t.v2 < position)\n" +
+ " .map((v1, v2) -> tuple(\n" +
+ " v1.map(t -> t.v1),\n" +
+ " v2.map(t -> t.v1)\n" +
+ " ));\n" +
+ " }\n" +
+ "\n" +
+ " static <T> Tuple2<Seq<T>, Seq<T>> splitAtCompiles(Stream<T> stream, long position) {\n" +
+ " return seq(stream)\n" +
+ " .zipWithIndex()\n" +
+ " .partition(t -> t.v2 < position)\n" +
+ " .map((v1, v2) -> Test.<Seq<T>, Seq<T>>tuple(\n" +
+ " v1.map(t -> t.v1),\n" +
+ " v2.map(t -> t.v1)\n" +
+ " ));\n" +
+ " }\n" +
+ "\n" +
+ " static <T> Seq<T> seq(Stream<T> stream) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " static <T1, T2> Tuple2<T1, T2> tuple(T1 v1, T2 v2) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "interface I<T> {\n" +
+ " T get();\n" +
+ " <U> I<U> map(Function<T, U> f);\n" +
+ "}\n" +
+ "\n" +
+ "interface Seq<T> {\n" +
+ " Seq<Tuple2<T, Long>> zipWithIndex();\n" +
+ " Tuple2<Seq<T>, Seq<T>> partition(Predicate<? super T> predicate);\n" +
+ " <R> Seq<R> map(Function<? super T, ? extends R> mapper);\n" +
+ "}\n" +
+ "\n" +
+ "class Tuple2<T1, T2> {\n" +
+ " T1 v1;\n" +
+ " T2 v2;\n" +
+ " \n" +
+ " <R> R map(BiFunction<T1, T2, R> function) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
});
}
@@ -5279,35 +5279,35 @@ public void testBug463728() {
runConformTest(
new String[] {
"Main.java",
- "import java.util.function.Function;\n" +
- "\n" +
- "\n" +
- "class Color {\n" +
- " \n" +
- "}\n" +
- "\n" +
- "class TypeMapper<R> {\n" +
- "\n" +
- " public TypeMapper() {\n" +
- " }\n" +
- " public R orElse(R result) {\n" +
- " return result;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "public class Main {\n" +
- " Color A;\n" +
- " Color B;\n" +
- "\n" +
- " public static <T, R> TypeMapper<R> mapType(Function<T, R> mapper) {\n" +
- " return new TypeMapper<R>();\n" +
- " }\n" +
- "\n" +
- " public Color getForeground(Object element) {\n" +
- " return mapType(library -> {\n" +
- " return (element != null ? A : B);\n" +
- " }).orElse(null);\n" +
- " }\n" +
+ "import java.util.function.Function;\n" +
+ "\n" +
+ "\n" +
+ "class Color {\n" +
+ " \n" +
+ "}\n" +
+ "\n" +
+ "class TypeMapper<R> {\n" +
+ "\n" +
+ " public TypeMapper() {\n" +
+ " }\n" +
+ " public R orElse(R result) {\n" +
+ " return result;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "public class Main {\n" +
+ " Color A;\n" +
+ " Color B;\n" +
+ "\n" +
+ " public static <T, R> TypeMapper<R> mapType(Function<T, R> mapper) {\n" +
+ " return new TypeMapper<R>();\n" +
+ " }\n" +
+ "\n" +
+ " public Color getForeground(Object element) {\n" +
+ " return mapType(library -> {\n" +
+ " return (element != null ? A : B);\n" +
+ " }).orElse(null);\n" +
+ " }\n" +
"}\n"
});
}
@@ -5315,31 +5315,31 @@ public void testBug470942() {
runConformTest(
new String[] {
"EclipeMarsLamdaIssueWontBuild.java",
- "import java.util.function.Supplier;\n" +
- "\n" +
- "public class EclipeMarsLamdaIssueWontBuild {\n" +
- " class MyClass {\n" +
- " long getNumber() {\n" +
- " return 0;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private interface VoidSupplier {\n" +
- " void perform();\n" +
- " }\n" +
- "\n" +
- " long processTxContent() {\n" +
- " return withLogging(() -> new MyClass().getNumber());\n" +
- " }\n" +
- "\n" +
- " private static void withLogging(final VoidSupplier supplier) {\n" +
- " // Do some logging\n" +
- " }\n" +
- "\n" +
- " private static <T> T withLogging(final Supplier<T> supplier) {\n" +
- " // Do some logging\n" +
- " return null;\n" +
- " }\n" +
+ "import java.util.function.Supplier;\n" +
+ "\n" +
+ "public class EclipeMarsLamdaIssueWontBuild {\n" +
+ " class MyClass {\n" +
+ " long getNumber() {\n" +
+ " return 0;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " private interface VoidSupplier {\n" +
+ " void perform();\n" +
+ " }\n" +
+ "\n" +
+ " long processTxContent() {\n" +
+ " return withLogging(() -> new MyClass().getNumber());\n" +
+ " }\n" +
+ "\n" +
+ " private static void withLogging(final VoidSupplier supplier) {\n" +
+ " // Do some logging\n" +
+ " }\n" +
+ "\n" +
+ " private static <T> T withLogging(final Supplier<T> supplier) {\n" +
+ " // Do some logging\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
});
}
@@ -5347,32 +5347,32 @@ public void testBug468999() {
runConformTest(
new String[] {
"Main.java",
- "interface ExceptionAction<T>\n" +
- "{\n" +
- " T run() throws Exception;\n" +
- "}\n" +
- "\n" +
- "interface Action<U> extends ExceptionAction<U>\n" +
- "{\n" +
- " @Override\n" +
- " U run();\n" +
- "}\n" +
- "\n" +
- "public class Main\n" +
- "{\n" +
- " public static void main(String[] args) {\n" +
- " runAction(() -> { // ERROR HERE\n" +
- " return \"\";\n" +
- " });\n" +
- " }\n" +
- "\n" +
- " static <V> void runAction(ExceptionAction<V> action) {\n" +
- " System.out.println(\"run with exceptions\");\n" +
- " }\n" +
- "\n" +
- " static <W> void runAction(Action<W> action) {\n" +
- " System.out.println(\"run without exceptions\");\n" +
- " }\n" +
+ "interface ExceptionAction<T>\n" +
+ "{\n" +
+ " T run() throws Exception;\n" +
+ "}\n" +
+ "\n" +
+ "interface Action<U> extends ExceptionAction<U>\n" +
+ "{\n" +
+ " @Override\n" +
+ " U run();\n" +
+ "}\n" +
+ "\n" +
+ "public class Main\n" +
+ "{\n" +
+ " public static void main(String[] args) {\n" +
+ " runAction(() -> { // ERROR HERE\n" +
+ " return \"\";\n" +
+ " });\n" +
+ " }\n" +
+ "\n" +
+ " static <V> void runAction(ExceptionAction<V> action) {\n" +
+ " System.out.println(\"run with exceptions\");\n" +
+ " }\n" +
+ "\n" +
+ " static <W> void runAction(Action<W> action) {\n" +
+ " System.out.println(\"run without exceptions\");\n" +
+ " }\n" +
"}\n"
});
}
@@ -5380,25 +5380,25 @@ public void testBug470826() {
runConformTest(
new String[] {
"EcjVsCollect.java",
- "import java.util.ArrayList;\n" +
- "import java.util.stream.Stream;\n" +
- "\n" +
- "public class EcjVsCollect {\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " try (final Stream<Record<String>> stream = getStream()) {\n" +
- " stream.collect(ArrayList::new, ArrayList::add, ArrayList::addAll);\n" +
- "// ArrayList<Record<String>> foo = stream.collect(ArrayList::new, ArrayList::add, ArrayList::addAll);\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private static <K> Stream<Record<K>> getStream() {\n" +
- " return Stream.empty();\n" +
- " }\n" +
- "\n" +
- " private interface Record<K> {\n" +
- " K getKey();\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.stream.Stream;\n" +
+ "\n" +
+ "public class EcjVsCollect {\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " try (final Stream<Record<String>> stream = getStream()) {\n" +
+ " stream.collect(ArrayList::new, ArrayList::add, ArrayList::addAll);\n" +
+ "// ArrayList<Record<String>> foo = stream.collect(ArrayList::new, ArrayList::add, ArrayList::addAll);\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " private static <K> Stream<Record<K>> getStream() {\n" +
+ " return Stream.empty();\n" +
+ " }\n" +
+ "\n" +
+ " private interface Record<K> {\n" +
+ " K getKey();\n" +
+ " }\n" +
"}\n"
});
}
@@ -5406,20 +5406,20 @@ public void testBug466487() {
runConformTest(
new String[] {
"C.java",
- "import java.util.*;\n" +
- "import java.util.stream.*;\n" +
- "import static java.util.Arrays.asList;\n" +
- "\n" +
- "public class C {\n" +
- " static final List<Integer> DIGITS = Collections.unmodifiableList(asList(0,1,2,3,4,5,6,7,8,9));\n" +
- " \n" +
- " Collection<String> flatMapSolutions(final boolean b) {\n" +
- " Collection<String> solutions = \n" +
- " DIGITS.stream().flatMap( s -> {\n" +
- " return b ? Stream.empty() : Stream.of(\"\");\n" +
- " }) .collect(Collectors.toList());\n" +
- " return solutions;\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "import java.util.stream.*;\n" +
+ "import static java.util.Arrays.asList;\n" +
+ "\n" +
+ "public class C {\n" +
+ " static final List<Integer> DIGITS = Collections.unmodifiableList(asList(0,1,2,3,4,5,6,7,8,9));\n" +
+ " \n" +
+ " Collection<String> flatMapSolutions(final boolean b) {\n" +
+ " Collection<String> solutions = \n" +
+ " DIGITS.stream().flatMap( s -> {\n" +
+ " return b ? Stream.empty() : Stream.of(\"\");\n" +
+ " }) .collect(Collectors.toList());\n" +
+ " return solutions;\n" +
+ " }\n" +
"}\n"
});
}
@@ -5427,35 +5427,35 @@ public void testBug472426() {
runConformTest(
new String[] {
"InferenceBug.java",
- "import java.util.Collections;\n" +
- "import java.util.List;\n" +
- "import java.util.function.BiFunction;\n" +
- "\n" +
- "public class InferenceBug {\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- "\n" +
- " // compiles\n" +
- " List<String> l = Collections.singletonList(\"foo\");\n" +
- " apply(Foo::foo, l);\n" +
- "\n" +
- " // won't compile\n" +
- " apply(Foo::foo, Collections.singletonList(\"foo\"));\n" +
- " }\n" +
- "\n" +
- " static <T> void apply(BiFunction<Foo, T, Foo> fun, T value) {\n" +
- " }\n" +
- "\n" +
- " static class Foo {\n" +
- " public Foo foo(List<String> i) {\n" +
- " return this;\n" +
- " }\n" +
- "\n" +
- " public Foo foo(String... i) {\n" +
- " return this;\n" +
- " }\n" +
- " }\n" +
- "\n" +
+ "import java.util.Collections;\n" +
+ "import java.util.List;\n" +
+ "import java.util.function.BiFunction;\n" +
+ "\n" +
+ "public class InferenceBug {\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ "\n" +
+ " // compiles\n" +
+ " List<String> l = Collections.singletonList(\"foo\");\n" +
+ " apply(Foo::foo, l);\n" +
+ "\n" +
+ " // won't compile\n" +
+ " apply(Foo::foo, Collections.singletonList(\"foo\"));\n" +
+ " }\n" +
+ "\n" +
+ " static <T> void apply(BiFunction<Foo, T, Foo> fun, T value) {\n" +
+ " }\n" +
+ "\n" +
+ " static class Foo {\n" +
+ " public Foo foo(List<String> i) {\n" +
+ " return this;\n" +
+ " }\n" +
+ "\n" +
+ " public Foo foo(String... i) {\n" +
+ " return this;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
"}\n"
});
}
@@ -5463,32 +5463,32 @@ public void testBug469753() {
runConformTest(
new String[] {
"LambdaBug.java",
- "import java.util.AbstractMap;\n" +
- "import java.util.Iterator;\n" +
- "import java.util.Map.Entry;\n" +
- "import java.util.function.Function;\n" +
- "\n" +
- "public class LambdaBug {\n" +
- "\n" +
- " class Item {\n" +
- " String foo;\n" +
- " }\n" +
- "\n" +
- " public void bug(String catalogKey, Iterator<Item> items) {\n" +
- " go(transform(items, i -> pair(i.foo, i)));\n" +
- " }\n" +
- "\n" +
- " public static <K, V> Entry<K, V> pair(K key, V value) {\n" +
- " return new AbstractMap.SimpleImmutableEntry<K, V>(key, value);\n" +
- " }\n" +
- "\n" +
- " void go(Iterator<Entry<String, Item>> items) {\n" +
- " }\n" +
- "\n" +
- " public static <F, T> Iterator<T> transform(Iterator<F> fromIterator, Function<? super F, ? extends T> function) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
+ "import java.util.AbstractMap;\n" +
+ "import java.util.Iterator;\n" +
+ "import java.util.Map.Entry;\n" +
+ "import java.util.function.Function;\n" +
+ "\n" +
+ "public class LambdaBug {\n" +
+ "\n" +
+ " class Item {\n" +
+ " String foo;\n" +
+ " }\n" +
+ "\n" +
+ " public void bug(String catalogKey, Iterator<Item> items) {\n" +
+ " go(transform(items, i -> pair(i.foo, i)));\n" +
+ " }\n" +
+ "\n" +
+ " public static <K, V> Entry<K, V> pair(K key, V value) {\n" +
+ " return new AbstractMap.SimpleImmutableEntry<K, V>(key, value);\n" +
+ " }\n" +
+ "\n" +
+ " void go(Iterator<Entry<String, Item>> items) {\n" +
+ " }\n" +
+ "\n" +
+ " public static <F, T> Iterator<T> transform(Iterator<F> fromIterator, Function<? super F, ? extends T> function) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
"}\n"
});
}
@@ -5496,25 +5496,25 @@ public void testBug470958() {
runConformTest(
new String[] {
"Bug470958.java",
- "import java.time.*;\n" +
- "import java.util.*;\n" +
- "import java.util.concurrent.*;\n" +
- "import static java.util.concurrent.CompletableFuture.*;\n" +
- "import static java.util.stream.Collectors.*;\n" +
- "\n" +
- "class Hotel {}\n" +
- "\n" +
- "class Bug470958 {\n" +
- " public Map<String, CompletableFuture<List<Hotel>>> asyncLoadMany(List<String> codes, LocalDate begin, LocalDate end) {\n" +
- " return loadMany(codes, begin, end)\n" +
- " .entrySet()\n" +
- " .stream()\n" +
- " .collect(toMap(Map.Entry::getKey, entry -> completedFuture(entry.getValue())));\n" +
- " }\n" +
- "\n" +
- " public Map<String, List<Hotel>> loadMany(List<String> codes, LocalDate begin, LocalDate end) {\n" +
- " return null;\n" +
- " }\n" +
+ "import java.time.*;\n" +
+ "import java.util.*;\n" +
+ "import java.util.concurrent.*;\n" +
+ "import static java.util.concurrent.CompletableFuture.*;\n" +
+ "import static java.util.stream.Collectors.*;\n" +
+ "\n" +
+ "class Hotel {}\n" +
+ "\n" +
+ "class Bug470958 {\n" +
+ " public Map<String, CompletableFuture<List<Hotel>>> asyncLoadMany(List<String> codes, LocalDate begin, LocalDate end) {\n" +
+ " return loadMany(codes, begin, end)\n" +
+ " .entrySet()\n" +
+ " .stream()\n" +
+ " .collect(toMap(Map.Entry::getKey, entry -> completedFuture(entry.getValue())));\n" +
+ " }\n" +
+ "\n" +
+ " public Map<String, List<Hotel>> loadMany(List<String> codes, LocalDate begin, LocalDate end) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
});
}
@@ -5522,50 +5522,50 @@ public void testBug470542() {
runNegativeTest(
new String[] {
"X.java",
- "import java.util.function.Consumer;\n" +
- "\n" +
- "public class X {\n" +
- " void test() {\n" +
- " process(missing::new);\n" +
- " }\n" +
- " \n" +
- " <T> void process(Consumer<T> c) { }\n" +
+ "import java.util.function.Consumer;\n" +
+ "\n" +
+ "public class X {\n" +
+ " void test() {\n" +
+ " process(missing::new);\n" +
+ " }\n" +
+ " \n" +
+ " <T> void process(Consumer<T> c) { }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " process(missing::new);\n" +
- " ^^^^^^^\n" +
- "missing cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " process(missing::new);\n" +
+ " ^^^^^^^\n" +
+ "missing cannot be resolved to a type\n" +
"----------\n");
}
public void testBug471280_comment0() {
runConformTest(
new String[] {
"Test0.java",
- "import java.util.*;\n" +
- "import java.util.function.*;\n" +
- "import java.util.concurrent.*;\n" +
- "\n" +
- "public class Test0 {\n" +
- " public CompletableFuture<List<String>> does_not_compile() throws Exception {\n" +
- " CompletableFuture<List<String>> firstAsync = new CompletableFuture<>();\n" +
- " firstAsync.complete(Collections.singletonList(\"test\"));\n" +
- " // The following line gives error \"Type mismatch: cannot convert from CompletableFuture<Object> to CompletableFuture<List<String>>\"\n" +
- " return transform(firstAsync, first -> Collections.singletonList(first.get(0)));\n" +
- " }\n" +
- "\n" +
- " public CompletableFuture<List<String>> does_compile() throws Exception {\n" +
- " CompletableFuture<List<String>> firstAsync = new CompletableFuture<>();\n" +
- " firstAsync.complete(Collections.singletonList(\"test\"));\n" +
- " return transform(firstAsync, first -> {\n" +
- " return Collections.singletonList(first.get(0));\n" +
- " });\n" +
- " }\n" +
- "\n" +
- " public <T, R> CompletableFuture<R> transform(CompletableFuture<T> future, Function<T, R> fun) throws Exception {\n" +
- " return future.thenApply(fun);\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "import java.util.function.*;\n" +
+ "import java.util.concurrent.*;\n" +
+ "\n" +
+ "public class Test0 {\n" +
+ " public CompletableFuture<List<String>> does_not_compile() throws Exception {\n" +
+ " CompletableFuture<List<String>> firstAsync = new CompletableFuture<>();\n" +
+ " firstAsync.complete(Collections.singletonList(\"test\"));\n" +
+ " // The following line gives error \"Type mismatch: cannot convert from CompletableFuture<Object> to CompletableFuture<List<String>>\"\n" +
+ " return transform(firstAsync, first -> Collections.singletonList(first.get(0)));\n" +
+ " }\n" +
+ "\n" +
+ " public CompletableFuture<List<String>> does_compile() throws Exception {\n" +
+ " CompletableFuture<List<String>> firstAsync = new CompletableFuture<>();\n" +
+ " firstAsync.complete(Collections.singletonList(\"test\"));\n" +
+ " return transform(firstAsync, first -> {\n" +
+ " return Collections.singletonList(first.get(0));\n" +
+ " });\n" +
+ " }\n" +
+ "\n" +
+ " public <T, R> CompletableFuture<R> transform(CompletableFuture<T> future, Function<T, R> fun) throws Exception {\n" +
+ " return future.thenApply(fun);\n" +
+ " }\n" +
"}\n"
});
}
@@ -5573,20 +5573,20 @@ public void testBug471280_comment3() {
runConformTest(
new String[] {
"Test3.java",
- "import java.util.*;\n" +
- "import java.util.stream.*;\n" +
- "\n" +
- "public class Test3 {\n" +
- " public <T> T generic(T value) {\n" +
- " return value;\n" +
- " }\n" +
- "\n" +
- " public void mapExample(Map<String, String> input) {\n" +
- " // does not compile with ejc: Type mismatch: cannot convert from Map<Object,Object> to Map<String,String>\n" +
- " Map<String, String> mapped = input.entrySet()\n" +
- " .stream()\n" +
- " .collect(Collectors.toMap(e -> e.getKey(), e -> generic(e.getValue())));\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "import java.util.stream.*;\n" +
+ "\n" +
+ "public class Test3 {\n" +
+ " public <T> T generic(T value) {\n" +
+ " return value;\n" +
+ " }\n" +
+ "\n" +
+ " public void mapExample(Map<String, String> input) {\n" +
+ " // does not compile with ejc: Type mismatch: cannot convert from Map<Object,Object> to Map<String,String>\n" +
+ " Map<String, String> mapped = input.entrySet()\n" +
+ " .stream()\n" +
+ " .collect(Collectors.toMap(e -> e.getKey(), e -> generic(e.getValue())));\n" +
+ " }\n" +
"}\n"
});
}
@@ -5594,22 +5594,22 @@ public void testBug464496() {
runConformTest(
new String[] {
"Value.java",
- "public class Value<V> {\n" +
- " private final V value;\n" +
- " public Value(V value) {\n" +
- " this.value = value;\n" +
- " }\n" +
- " public V get() {\n" +
- " return value;\n" +
- " }\n" +
- " public static <V> V getValue(Value<V> value) {\n" +
- " return value.get();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " Value<Integer> intValue = new Value<>(42);\n" +
- " long longPrimitive = getValue(intValue); // fails in 1.8 compiler \n" +
- " System.out.println(longPrimitive);\n" +
- " }\n" +
+ "public class Value<V> {\n" +
+ " private final V value;\n" +
+ " public Value(V value) {\n" +
+ " this.value = value;\n" +
+ " }\n" +
+ " public V get() {\n" +
+ " return value;\n" +
+ " }\n" +
+ " public static <V> V getValue(Value<V> value) {\n" +
+ " return value.get();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " Value<Integer> intValue = new Value<>(42);\n" +
+ " long longPrimitive = getValue(intValue); // fails in 1.8 compiler \n" +
+ " System.out.println(longPrimitive);\n" +
+ " }\n" +
"}\n"
},
"42");
@@ -5618,29 +5618,29 @@ public void testBug473657() {
runConformTest(
new String[] {
"T2.java",
- "interface I<T> {\n" +
- "}\n" +
- "\n" +
- "@SuppressWarnings({\"unchecked\", \"rawtypes\"})\n" +
- "abstract class T1<T> implements I<T> {\n" +
- " public I<T> t(I<? extends Number> l2) {\n" +
- " return T2.m((I) this, (I) l2);\n" +
- " }\n" +
- " public I<T> t(Number l2) {\n" +
- " return T2.m((I) this, (I) T2.t(l2));\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "public abstract class T2 {\n" +
- " public static <T> I<T> t(T t) {\n" +
- " return null;\n" +
- " }\n" +
- " public static <T extends Number> I<T> m(I<T> l1, I<? extends Number> l2) {\n" +
- " return null;\n" +
- " }\n" +
- " public static <T extends Number> I<T> m(T l1, Number l2) {\n" +
- " return null;\n" +
- " }\n" +
+ "interface I<T> {\n" +
+ "}\n" +
+ "\n" +
+ "@SuppressWarnings({\"unchecked\", \"rawtypes\"})\n" +
+ "abstract class T1<T> implements I<T> {\n" +
+ " public I<T> t(I<? extends Number> l2) {\n" +
+ " return T2.m((I) this, (I) l2);\n" +
+ " }\n" +
+ " public I<T> t(Number l2) {\n" +
+ " return T2.m((I) this, (I) T2.t(l2));\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "public abstract class T2 {\n" +
+ " public static <T> I<T> t(T t) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public static <T extends Number> I<T> m(I<T> l1, I<? extends Number> l2) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public static <T extends Number> I<T> m(T l1, Number l2) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
});
}
@@ -5648,34 +5648,34 @@ public void testBug478848() {
runConformTest(
new String[] {
"InferenceBug.java",
- "import java.util.*;\n" +
- "public class InferenceBug {\n" +
- " \n" +
- " static class Wrapper<T> {\n" +
- " T value;\n" +
- " public T getValue() {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " static class C1 {\n" +
- " //an optional array of String wrappers\n" +
- " public Optional<? extends Wrapper<String>[]> optionalArrayOfStringWrappers() {\n" +
- " return Optional.empty();\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " C1 c1 = new C1();\n" +
- " try {\n" +
- " for (Wrapper<String> attribute: c1.optionalArrayOfStringWrappers().get()) {\n" +
- " // error in previous line:\n" +
+ "import java.util.*;\n" +
+ "public class InferenceBug {\n" +
+ " \n" +
+ " static class Wrapper<T> {\n" +
+ " T value;\n" +
+ " public T getValue() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " static class C1 {\n" +
+ " //an optional array of String wrappers\n" +
+ " public Optional<? extends Wrapper<String>[]> optionalArrayOfStringWrappers() {\n" +
+ " return Optional.empty();\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " C1 c1 = new C1();\n" +
+ " try {\n" +
+ " for (Wrapper<String> attribute: c1.optionalArrayOfStringWrappers().get()) {\n" +
+ " // error in previous line:\n" +
" // Can only iterate over an array or an instance of java.lang.Iterable\n" +
- " }\n" +
+ " }\n" +
" } catch (NoSuchElementException nsee) {\n" +
" System.out.print(\"No such element\");\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
"No such element");
@@ -5684,20 +5684,20 @@ public void testBug479167() {
runConformTest(
new String[] {
"ToArray.java",
- "import java.io.Serializable;\n" +
- "interface ArrayFunction<E> {\n" +
- " <S extends E> E[] apply(@SuppressWarnings(\"unchecked\") S... es);\n" +
- "}\n" +
- "public class ToArray<E extends Cloneable & Serializable> implements ArrayFunction<E> {\n" +
- " public final @SafeVarargs @Override <S extends E> E[] apply(S... es) {\n" +
- " return es;\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " ArrayFunction<String[]> toArray = new ToArray<>();\n" +
- " String[][] array = toArray.apply(args);\n" +
- " System.out.print(array.getClass().getName());\n" +
- " }\n" +
+ "import java.io.Serializable;\n" +
+ "interface ArrayFunction<E> {\n" +
+ " <S extends E> E[] apply(@SuppressWarnings(\"unchecked\") S... es);\n" +
+ "}\n" +
+ "public class ToArray<E extends Cloneable & Serializable> implements ArrayFunction<E> {\n" +
+ " public final @SafeVarargs @Override <S extends E> E[] apply(S... es) {\n" +
+ " return es;\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " ArrayFunction<String[]> toArray = new ToArray<>();\n" +
+ " String[][] array = toArray.apply(args);\n" +
+ " System.out.print(array.getClass().getName());\n" +
+ " }\n" +
"}\n"
},
"[[Ljava.lang.String;");
@@ -5706,21 +5706,21 @@ public void testBug477751() {
runConformTest(
new String[] {
"Test.java",
- "import java.util.function.Function;\n" +
- "class Test {\n" +
- " public static <T, U> U map(T value, Function<T, U> mapper) {\n" +
- " if (value != null)\n" +
- " return mapper.apply(value);\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " String value;\n" +
- " \n" +
- " void test() {\n" +
- " map(map(value, nnVal1 -> nnVal1.toLowerCase()),\n" +
- " nnVal2 -> nnVal2.length());\n" +
- " }\n" +
- "\n" +
+ "import java.util.function.Function;\n" +
+ "class Test {\n" +
+ " public static <T, U> U map(T value, Function<T, U> mapper) {\n" +
+ " if (value != null)\n" +
+ " return mapper.apply(value);\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " String value;\n" +
+ " \n" +
+ " void test() {\n" +
+ " map(map(value, nnVal1 -> nnVal1.toLowerCase()),\n" +
+ " nnVal2 -> nnVal2.length());\n" +
+ " }\n" +
+ "\n" +
"}\n"
});
}
@@ -5728,42 +5728,42 @@ public void testBug482416() {
runConformTest(
new String[] {
"CompilerRegression.java",
- "import java.util.Comparator;\n" +
- "import java.util.concurrent.Callable;\n" +
- "\n" +
- "public class CompilerRegression<T> {\n" +
- " private ObjectProperty<Comparator<TreeItem<T>>> comparator = new ObjectProperty<Comparator<TreeItem<T>>>();\n" +
- "\n" +
- " void sample() {\n" +
- " //Fails in Mars.1 succeeds in Mars.0\n" +
- " {\n" +
- " ObjectBinding<Comparator<TreeItem<T>>> b = Bindings.createObjectBinding(() -> {\n" +
- " if (this.comparator.get() == null)\n" +
- " return null;\n" +
- " return (o1, o2) -> this.comparator.get().compare(o1, o2);\n" +
- " }, this.comparator);\n" +
- " }\n" +
- "\n" +
- " // Succeeds in both\n" +
- " {\n" +
- " ObjectBinding<Comparator<TreeItem<T>>> b = Bindings.createObjectBinding(() -> {\n" +
- " if (this.comparator.get() == null)\n" +
- " return null;\n" +
- " Comparator<TreeItem<T>> cp = (o1, o2) -> this.comparator.get().compare(o1, o2);\n" +
- " return cp;\n" +
- " }, this.comparator);\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Bindings {\n" +
- " public static <X> ObjectBinding<X> createObjectBinding(final Callable<X> func, final Observable... dependencies) { return null; }\n" +
- "}\n" +
- "class ObjectBinding<U> { }\n" +
- "class TreeItem<V> { }\n" +
- "class ObjectProperty<W> implements Observable {\n" +
- " W get() { return null; }\n" +
- "}\n" +
+ "import java.util.Comparator;\n" +
+ "import java.util.concurrent.Callable;\n" +
+ "\n" +
+ "public class CompilerRegression<T> {\n" +
+ " private ObjectProperty<Comparator<TreeItem<T>>> comparator = new ObjectProperty<Comparator<TreeItem<T>>>();\n" +
+ "\n" +
+ " void sample() {\n" +
+ " //Fails in Mars.1 succeeds in Mars.0\n" +
+ " {\n" +
+ " ObjectBinding<Comparator<TreeItem<T>>> b = Bindings.createObjectBinding(() -> {\n" +
+ " if (this.comparator.get() == null)\n" +
+ " return null;\n" +
+ " return (o1, o2) -> this.comparator.get().compare(o1, o2);\n" +
+ " }, this.comparator);\n" +
+ " }\n" +
+ "\n" +
+ " // Succeeds in both\n" +
+ " {\n" +
+ " ObjectBinding<Comparator<TreeItem<T>>> b = Bindings.createObjectBinding(() -> {\n" +
+ " if (this.comparator.get() == null)\n" +
+ " return null;\n" +
+ " Comparator<TreeItem<T>> cp = (o1, o2) -> this.comparator.get().compare(o1, o2);\n" +
+ " return cp;\n" +
+ " }, this.comparator);\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class Bindings {\n" +
+ " public static <X> ObjectBinding<X> createObjectBinding(final Callable<X> func, final Observable... dependencies) { return null; }\n" +
+ "}\n" +
+ "class ObjectBinding<U> { }\n" +
+ "class TreeItem<V> { }\n" +
+ "class ObjectProperty<W> implements Observable {\n" +
+ " W get() { return null; }\n" +
+ "}\n" +
"interface Observable {}\n"
});
}
@@ -5771,29 +5771,29 @@ public void testBug483019() {
runConformTest(
new String[] {
"Test.java",
- "import sub.B;\n" +
- "import sub.Marker;\n" +
- "\n" +
- "public class Test {\n" +
- " public int test(B b) {\n" +
- " return (((B & Marker) b).getValue());\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(new Test().test(new B()));\n" +
- " }\n" +
+ "import sub.B;\n" +
+ "import sub.Marker;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " public int test(B b) {\n" +
+ " return (((B & Marker) b).getValue());\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(new Test().test(new B()));\n" +
+ " }\n" +
"}",
"sub/A.java",
- "package sub;\n" +
- "class A {\n" +
- " public int getValue() {\n" +
- " return 1;\n" +
- " }\n" +
+ "package sub;\n" +
+ "class A {\n" +
+ " public int getValue() {\n" +
+ " return 1;\n" +
+ " }\n" +
"}\n",
"sub/B.java",
- "package sub;\n" +
+ "package sub;\n" +
"public class B extends A implements Marker{ }\n",
"sub/Marker.java",
- "package sub;\n" +
+ "package sub;\n" +
"public interface Marker{ }\n"
},
"1");
@@ -5804,27 +5804,27 @@ public void testBug483019a() {
JavacTestOptions.Excuse.JavacHasErrorsEclipseHasNone,
new String[] {
"Test.java",
- "import sub.J;\n" +
- "import sub.Marker;\n" +
- "\n" +
- "public class Test {\n" +
- " public int test(J j) {\n" +
- " return (((Marker & J) j).getValue());\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(new Test().test((J & Marker)() -> 0));\n" +
- " }\n" +
+ "import sub.J;\n" +
+ "import sub.Marker;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " public int test(J j) {\n" +
+ " return (((Marker & J) j).getValue());\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(new Test().test((J & Marker)() -> 0));\n" +
+ " }\n" +
"}",
"sub/I.java",
- "package sub;\n" +
- "interface I {\n" +
- " int getValue();\n" +
+ "package sub;\n" +
+ "interface I {\n" +
+ " int getValue();\n" +
"}\n",
"sub/J.java",
- "package sub;\n" +
+ "package sub;\n" +
"public interface J extends I{ }\n",
"sub/Marker.java",
- "package sub;\n" +
+ "package sub;\n" +
"public interface Marker{ }\n"
},
"0");
@@ -5838,7 +5838,7 @@ public void testBug484448() {
new String[] {
"test/Test.java",
"package test;\n" +
- "\n" +
+ "\n" +
"public final class Test {\n" +
" /**\n" +
" * @see #g(T, Class)\n" +
@@ -5846,25 +5846,25 @@ public void testBug484448() {
" public static <T> T f(T t, Class<T> c1) {\n" +
" return g(t, c1);\n" +
" }\n" +
- "\n" +
+ "\n" +
" public static <U> U g(U u, Class<U> c2) {\n" +
" return u;\n" +
" }\n" +
"}\n"
},
- options);
+ options);
}
public void testBug485593() {
runConformTest(
new String[] {
"Test.java",
- "import java.util.*;\n" +
- "\n" +
- "public class Test {\n" +
- " void test() {\n" +
- " double[][] d = new double[][]{{1,2},{3,4},{5,6}};\n" +
- " double[][] e = Arrays.stream(d).map(double[]::clone).toArray(double[][]::new);\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " void test() {\n" +
+ " double[][] d = new double[][]{{1,2},{3,4},{5,6}};\n" +
+ " double[][] e = Arrays.stream(d).map(double[]::clone).toArray(double[][]::new);\n" +
+ " }\n" +
"}\n"
});
}
@@ -5872,84 +5872,84 @@ public void testBug483228a() {
runNegativeTest(
new String[] {
"X.java",
- "interface UnaryOp<T> { T apply(T arg); }\n" +
- "interface IntegerToNumber { Number apply(Integer arg); }\n" +
- "\n" +
- "public class X {\n" +
- "\n" +
- " <T> void m(UnaryOp<T> f) {}\n" +
- " void m(IntegerToNumber f) {}\n" +
- "\n" +
- " void test() {\n" +
- " m((Integer i) -> i);\n" +
- " } \n" +
+ "interface UnaryOp<T> { T apply(T arg); }\n" +
+ "interface IntegerToNumber { Number apply(Integer arg); }\n" +
+ "\n" +
+ "public class X {\n" +
+ "\n" +
+ " <T> void m(UnaryOp<T> f) {}\n" +
+ " void m(IntegerToNumber f) {}\n" +
+ "\n" +
+ " void test() {\n" +
+ " m((Integer i) -> i);\n" +
+ " } \n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " m((Integer i) -> i);\n" +
- " ^\n" +
- "The method m(UnaryOp<Integer>) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " m((Integer i) -> i);\n" +
+ " ^\n" +
+ "The method m(UnaryOp<Integer>) is ambiguous for the type X\n" +
"----------\n");
}
public void testBug449824a() {
runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " interface FI1<T> {\n" +
- " public T get(X x, T n);\n" +
- " }\n" +
- " interface FI2 {\n" +
- " public Integer get(X x, Integer t);\n" +
- " }\n" +
- " void m(FI1<Number> fi) { }\n" +
- " void m(FI2 fi) { }\n" +
- " Integer id(Number n) {\n" +
- " return null;\n" +
- " }\n" +
- " void test() {\n" +
- " m(X::id);\n" +
- " }\n" +
+ "public class X {\n" +
+ " interface FI1<T> {\n" +
+ " public T get(X x, T n);\n" +
+ " }\n" +
+ " interface FI2 {\n" +
+ " public Integer get(X x, Integer t);\n" +
+ " }\n" +
+ " void m(FI1<Number> fi) { }\n" +
+ " void m(FI2 fi) { }\n" +
+ " Integer id(Number n) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " void test() {\n" +
+ " m(X::id);\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 14)\n" +
- " m(X::id);\n" +
- " ^\n" +
- "The method m(X.FI1<Number>) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 14)\n" +
+ " m(X::id);\n" +
+ " ^\n" +
+ "The method m(X.FI1<Number>) is ambiguous for the type X\n" +
"----------\n");
}
public void testBug449824b() {
runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " interface FI1<T> {\n" +
- " public T get(T... n);\n" +
- " }\n" +
- " interface FI2 {\n" +
- " public Integer get(Integer... t);\n" +
- " }\n" +
- " void m(FI1<Number> fi) { }\n" +
- " void m(FI2 fi) { }\n" +
- " Integer id(Number[] n) {\n" +
- " return null;\n" +
- " }\n" +
- " void test() {\n" +
- " m(this::id);\n" +
- " }\n" +
+ "public class X {\n" +
+ " interface FI1<T> {\n" +
+ " public T get(T... n);\n" +
+ " }\n" +
+ " interface FI2 {\n" +
+ " public Integer get(Integer... t);\n" +
+ " }\n" +
+ " void m(FI1<Number> fi) { }\n" +
+ " void m(FI2 fi) { }\n" +
+ " Integer id(Number[] n) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " void test() {\n" +
+ " m(this::id);\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public T get(T... n);\n" +
- " ^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public T get(T... n);\n" +
+ " ^\n" +
"Type safety: Potential heap pollution via varargs parameter n\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " m(this::id);\n" +
- " ^\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " m(this::id);\n" +
+ " ^\n" +
"The method m(X.FI1<Number>) is ambiguous for the type X\n" +
"----------\n");
}
@@ -5957,35 +5957,35 @@ public void testBug487746_comment2() {
runConformTest(
new String[] {
"Example.java",
- "\n" +
- "import java.time.Instant;\n" +
- "import java.util.Comparator;\n" +
- "import java.util.stream.Collectors;\n" +
- "\n" +
- "public class Example {\n" +
- " public void test1() {\n" +
- " // Returns Collector<Something,?,Something> - CORRECT\n" +
- " Collectors.collectingAndThen(\n" +
- " Collectors.<Something>toList(),\n" +
- " list -> list.stream().sorted(Comparator.comparing(Something::getTime)).limit(1).findAny().orElse(null)\n" +
- " );\n" +
- " }\n" +
- " \n" +
- " public void test2() {\n" +
- " Collectors.collectingAndThen(\n" +
- " Collectors.<Something>toList(),\n" +
- " list -> list.stream().collect(Collectors.groupingBy(Something::getSize,\n" +
- " // Returns Collector<Something,?,Object> - INCORRECT!\n" +
- " Collectors.collectingAndThen(\n" +
- " Collectors.<Something>toList(),\n" +
- " list2 -> list2.stream().sorted(Comparator.comparing(Something::getTime)).limit(1).findAny().orElse(null)\n" +
- " )\n" +
- " )));\n" +
+ "\n" +
+ "import java.time.Instant;\n" +
+ "import java.util.Comparator;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "\n" +
+ "public class Example {\n" +
+ " public void test1() {\n" +
+ " // Returns Collector<Something,?,Something> - CORRECT\n" +
+ " Collectors.collectingAndThen(\n" +
+ " Collectors.<Something>toList(),\n" +
+ " list -> list.stream().sorted(Comparator.comparing(Something::getTime)).limit(1).findAny().orElse(null)\n" +
+ " );\n" +
+ " }\n" +
+ " \n" +
+ " public void test2() {\n" +
+ " Collectors.collectingAndThen(\n" +
+ " Collectors.<Something>toList(),\n" +
+ " list -> list.stream().collect(Collectors.groupingBy(Something::getSize,\n" +
+ " // Returns Collector<Something,?,Object> - INCORRECT!\n" +
+ " Collectors.collectingAndThen(\n" +
+ " Collectors.<Something>toList(),\n" +
+ " list2 -> list2.stream().sorted(Comparator.comparing(Something::getTime)).limit(1).findAny().orElse(null)\n" +
+ " )\n" +
+ " )));\n" +
" }\n" +
- " private interface Something {\n" +
- " public int getSize();\n" +
- " public Instant getTime();\n" +
- " }\n" +
+ " private interface Something {\n" +
+ " public int getSize();\n" +
+ " public Instant getTime();\n" +
+ " }\n" +
"}\n"
});
}
@@ -5993,32 +5993,32 @@ public void _testBug487746_comment9() { // FIXME: still reports an unexpected er
runConformTest(
new String[] {
"Example.java",
- "\n" +
- "import java.time.Instant;\n" +
- "import java.util.Comparator;\n" +
- "import java.util.List;\n" +
- "import java.util.stream.Collectors;\n" +
- "\n" +
- "public class Example {\n" +
- " public void doesntCompile(List<Something> things) {\n" +
- " things.stream()\n" +
- " .filter(thing -> thing.getSize() > 100)\n" +
- " .collect(Collectors.collectingAndThen(\n" +
- " Collectors.<Something>toList(),\n" +
- " list -> list.stream().collect(Collectors.groupingBy(Something::getSize,\n" +
- " Collectors.collectingAndThen(\n" +
- " Collectors.<Something>toList(),\n" +
- " list2 -> list2.stream().sorted(Comparator.comparing(Something::getTime)).limit(1).findAny().orElse(null)\n" +
- " )\n" +
- " ))))\n" +
- " .forEach((size, thing) -> {\n" +
- " System.out.println(thing.getSize()); // Compile error because Eclipse thinks 'thing' is Object\n" +
- " });\n" +
- " }\n" +
- " private interface Something {\n" +
- " public int getSize();\n" +
- " public Instant getTime();\n" +
- " }\n" +
+ "\n" +
+ "import java.time.Instant;\n" +
+ "import java.util.Comparator;\n" +
+ "import java.util.List;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "\n" +
+ "public class Example {\n" +
+ " public void doesntCompile(List<Something> things) {\n" +
+ " things.stream()\n" +
+ " .filter(thing -> thing.getSize() > 100)\n" +
+ " .collect(Collectors.collectingAndThen(\n" +
+ " Collectors.<Something>toList(),\n" +
+ " list -> list.stream().collect(Collectors.groupingBy(Something::getSize,\n" +
+ " Collectors.collectingAndThen(\n" +
+ " Collectors.<Something>toList(),\n" +
+ " list2 -> list2.stream().sorted(Comparator.comparing(Something::getTime)).limit(1).findAny().orElse(null)\n" +
+ " )\n" +
+ " ))))\n" +
+ " .forEach((size, thing) -> {\n" +
+ " System.out.println(thing.getSize()); // Compile error because Eclipse thinks 'thing' is Object\n" +
+ " });\n" +
+ " }\n" +
+ " private interface Something {\n" +
+ " public int getSize();\n" +
+ " public Instant getTime();\n" +
+ " }\n" +
"}\n"
});
}
@@ -6029,10 +6029,10 @@ public void testBug480075() {
"import java.util.stream.*;\n" +
"public class X {\n" +
" void test() {\n" +
- " IntStream.of(42).mapToObj(i -> i > 42 ? \"gt\" : i < 42 ? \"lt\" : \"42\").findFirst();\n" +
- "\n" +
- " Stream.generate(Object::new).map(o -> o != null ? o : o == null ? o : o).findAny();\n" +
- "\n" +
+ " IntStream.of(42).mapToObj(i -> i > 42 ? \"gt\" : i < 42 ? \"lt\" : \"42\").findFirst();\n" +
+ "\n" +
+ " Stream.generate(Object::new).map(o -> o != null ? o : o == null ? o : o).findAny();\n" +
+ "\n" +
" }\n" +
"}\n"
});
@@ -6049,44 +6049,44 @@ public void testBug488649() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " void test(A a) {\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " get(a).missing();\n" +
- " ^^^^^^\n" +
- "Type safety: Unchecked invocation get(A) of the generic method get(A<U>) of type X\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 5)\n" +
- " get(a).missing();\n" +
- " ^\n" +
- "Type safety: The expression of type A needs unchecked conversion to conform to A<Object>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " get(a).missing();\n" +
- " ^^^^^^^\n" +
- "The method missing() is undefined for the type Object\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " void test(A a) {\n" +
+ " ^\n" +
+ "A is a raw type. References to generic type A<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " get(a).missing();\n" +
+ " ^^^^^^\n" +
+ "Type safety: Unchecked invocation get(A) of the generic method get(A<U>) of type X\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 5)\n" +
+ " get(a).missing();\n" +
+ " ^\n" +
+ "Type safety: The expression of type A needs unchecked conversion to conform to A<Object>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " get(a).missing();\n" +
+ " ^^^^^^^\n" +
+ "The method missing() is undefined for the type Object\n" +
"----------\n");
}
public void testBug488672() {
runConformTest(
new String[] {
"X.java",
- "import java.util.*;\n" +
- "\n" +
- "public class X {\n" +
- " void foo(Manager manager) {\n" +
- " HashSet<String> activeBindings = new HashSet<>(manager.getActiveBindingsDisregardingContextFlat());\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Manager {\n" +
- " Collection getActiveBindingsDisregardingContextFlat() {\n" +
- " return null;\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "\n" +
+ "public class X {\n" +
+ " void foo(Manager manager) {\n" +
+ " HashSet<String> activeBindings = new HashSet<>(manager.getActiveBindingsDisregardingContextFlat());\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class Manager {\n" +
+ " Collection getActiveBindingsDisregardingContextFlat() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
});
}
@@ -6110,20 +6110,20 @@ public void testBug489976() {
runConformTest(
new String[] {
"Test.java",
- "import java.util.*;\n" +
- "import static java.util.stream.Collectors.*;\n" +
- "import java.util.stream.Collectors;\n" +
- "\n" +
- "class Key {}\n" +
- "class Value {}\n" +
- "public class Test {\n" +
- " void test (List<Map<Key, Value>> maps) {\n" +
- " maps.stream().flatMap(s->s.entrySet().stream()).collect(\n" +
- " groupingBy(e -> e.getKey(), \n" +
- " mapping(e -> e.getValue(), collectingAndThen(toList(),x->x))\n" +
- " )\n" +
- " );\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "import static java.util.stream.Collectors.*;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "\n" +
+ "class Key {}\n" +
+ "class Value {}\n" +
+ "public class Test {\n" +
+ " void test (List<Map<Key, Value>> maps) {\n" +
+ " maps.stream().flatMap(s->s.entrySet().stream()).collect(\n" +
+ " groupingBy(e -> e.getKey(), \n" +
+ " mapping(e -> e.getValue(), collectingAndThen(toList(),x->x))\n" +
+ " )\n" +
+ " );\n" +
+ " }\n" +
"}\n"
});
}
@@ -6131,25 +6131,25 @@ public void testBug491934() {
runConformTest(
new String[] {
"Main.java",
- "import java.util.Arrays;\n" +
- "import java.util.HashSet;\n" +
- "import java.util.Set;\n" +
- "\n" +
- "public class Main {\n" +
- "\n" +
+ "import java.util.Arrays;\n" +
+ "import java.util.HashSet;\n" +
+ "import java.util.Set;\n" +
+ "\n" +
+ "public class Main {\n" +
+ "\n" +
" public static void main(String[] args) {\n" +
- " // gives compile error in Neon\n" +
- " // was warning \"unchecked\" in Mars\n" +
- " Set<String> genericSet = new HashSet<>(oldApiReturningUntypedSet());\n" +
- " }\n" +
- "\n" +
- " @SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n" +
- " private static Set oldApiReturningUntypedSet() {\n" +
- " HashSet set = new HashSet();\n" +
- " set.add(\"one\");\n" +
- " return set;\n" +
- " }\n" +
- "\n" +
+ " // gives compile error in Neon\n" +
+ " // was warning \"unchecked\" in Mars\n" +
+ " Set<String> genericSet = new HashSet<>(oldApiReturningUntypedSet());\n" +
+ " }\n" +
+ "\n" +
+ " @SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n" +
+ " private static Set oldApiReturningUntypedSet() {\n" +
+ " HashSet set = new HashSet();\n" +
+ " set.add(\"one\");\n" +
+ " return set;\n" +
+ " }\n" +
+ "\n" +
"}\n"
});
}
@@ -6157,34 +6157,34 @@ public void testBug491485() {
runNegativeTest(
new String[] {
"Tester.java",
- "interface SAM<X, Y, Z extends X3> {\n" +
- " Z bar(X a, Y b);\n" +
- "}\n" +
- "interface I<T> {\n" +
- " \n" +
- "}\n" +
- "class X3 {\n" +
- " \n" +
- "}\n" +
- "public class Tester {\n" +
- "\n" +
- " X3 method(SAM<?, ?, ?> s) {\n" +
- " return s.bar(null, null);\n" +
- " }\n" +
- " \n" +
- " Object foo(Object a, Object b) {\n" +
- " return null;\n" +
- " }\n" +
- " X3 junk() {\n" +
- " return method((SAM<?,?,?> & I <?>) this::foo);\n" +
- " }\n" +
+ "interface SAM<X, Y, Z extends X3> {\n" +
+ " Z bar(X a, Y b);\n" +
+ "}\n" +
+ "interface I<T> {\n" +
+ " \n" +
+ "}\n" +
+ "class X3 {\n" +
+ " \n" +
+ "}\n" +
+ "public class Tester {\n" +
+ "\n" +
+ " X3 method(SAM<?, ?, ?> s) {\n" +
+ " return s.bar(null, null);\n" +
+ " }\n" +
+ " \n" +
+ " Object foo(Object a, Object b) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " X3 junk() {\n" +
+ " return method((SAM<?,?,?> & I <?>) this::foo);\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Tester.java (at line 20)\n" +
- " return method((SAM<?,?,?> & I <?>) this::foo);\n" +
- " ^^^^^^^^^\n" +
- "The type of foo(Object, Object) from the type Tester is Object, this is incompatible with the descriptor\'s return type: X3\n" +
+ "----------\n" +
+ "1. ERROR in Tester.java (at line 20)\n" +
+ " return method((SAM<?,?,?> & I <?>) this::foo);\n" +
+ " ^^^^^^^^^\n" +
+ "The type of foo(Object, Object) from the type Tester is Object, this is incompatible with the descriptor\'s return type: X3\n" +
"----------\n");
}
@@ -6192,31 +6192,31 @@ public void testBug485057() {
runNegativeTest(
new String[] {
"Task.java",
- "public class Task {\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " foo(rt -> true); // PROBLEM HERE\n" +
- " }\n" +
- "\n" +
- " public static <T extends java.io.Serializable> Task foo(T serialiable) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " public static Task foo(java.util.function.Predicate<?> predicate) {\n" +
- " return null;\n" +
- " }\n" +
+ "public class Task {\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " foo(rt -> true); // PROBLEM HERE\n" +
+ " }\n" +
+ "\n" +
+ " public static <T extends java.io.Serializable> Task foo(T serialiable) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " public static Task foo(java.util.function.Predicate<?> predicate) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Task.java (at line 4)\n" +
- " foo(rt -> true); // PROBLEM HERE\n" +
- " ^^^\n" +
- "The method foo(Serializable) is ambiguous for the type Task\n" +
- "----------\n" +
- "2. ERROR in Task.java (at line 4)\n" +
- " foo(rt -> true); // PROBLEM HERE\n" +
- " ^^^^^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "1. ERROR in Task.java (at line 4)\n" +
+ " foo(rt -> true); // PROBLEM HERE\n" +
+ " ^^^\n" +
+ "The method foo(Serializable) is ambiguous for the type Task\n" +
+ "----------\n" +
+ "2. ERROR in Task.java (at line 4)\n" +
+ " foo(rt -> true); // PROBLEM HERE\n" +
+ " ^^^^^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
"----------\n");
}
@@ -6224,26 +6224,26 @@ public void testBug485373() {
runNegativeTest(
new String[] {
"TestGenericsFunctional.java",
- "import java.util.Collection;\n" +
- "import java.util.function.Consumer;\n" +
- "\n" +
- "public class TestGenericsFunctional {\n" +
- "\n" +
- " public static void doStuff(String str, Consumer<String> consumer) {\n" +
- " consumer.accept(str);\n" +
- " }\n" +
- " \n" +
- " public static <C extends Collection<String>> C doStuff(String str, C collection) {\n" +
- " doStuff(str, st -> collection.add(st));\n" +
- " return collection;\n" +
- " }\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.function.Consumer;\n" +
+ "\n" +
+ "public class TestGenericsFunctional {\n" +
+ "\n" +
+ " public static void doStuff(String str, Consumer<String> consumer) {\n" +
+ " consumer.accept(str);\n" +
+ " }\n" +
+ " \n" +
+ " public static <C extends Collection<String>> C doStuff(String str, C collection) {\n" +
+ " doStuff(str, st -> collection.add(st));\n" +
+ " return collection;\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in TestGenericsFunctional.java (at line 11)\n" +
- " doStuff(str, st -> collection.add(st));\n" +
- " ^^^^^^^\n" +
- "The method doStuff(String, Consumer<String>) is ambiguous for the type TestGenericsFunctional\n" +
+ "----------\n" +
+ "1. ERROR in TestGenericsFunctional.java (at line 11)\n" +
+ " doStuff(str, st -> collection.add(st));\n" +
+ " ^^^^^^^\n" +
+ "The method doStuff(String, Consumer<String>) is ambiguous for the type TestGenericsFunctional\n" +
"----------\n");
}
@@ -6251,120 +6251,120 @@ public void testBug487563() {
runNegativeTest(
new String[] {
"Java8TypeInferenceProblem.java",
- "\n" +
- "import java.util.Iterator;\n" +
- "import java.util.List;\n" +
- "\n" +
- "public class Java8TypeInferenceProblem {\n" +
- "\n" +
- " public ValueObjectImpl myTestMethod() {\n" +
- " return copyToValueObject(loadBusinessObject(), ValueObjectImpl.class);\n" +
- " }\n" +
- "\n" +
- " public <T extends ValueObject> T copyToValueObject(BusinessObject param, Class<T> voClass) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " public <T extends ValueObject> List<T> copyToValueObject(Iterator<BusinessObject> params, Class<T> voClass) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " public <T extends BusinessObject> T loadBusinessObject() {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " private interface BusinessObject { }\n" +
- "\n" +
- " private interface ValueObject { }\n" +
- "\n" +
- " private class ValueObjectImpl implements ValueObject { }\n" +
- "\n" +
+ "\n" +
+ "import java.util.Iterator;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class Java8TypeInferenceProblem {\n" +
+ "\n" +
+ " public ValueObjectImpl myTestMethod() {\n" +
+ " return copyToValueObject(loadBusinessObject(), ValueObjectImpl.class);\n" +
+ " }\n" +
+ "\n" +
+ " public <T extends ValueObject> T copyToValueObject(BusinessObject param, Class<T> voClass) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " public <T extends ValueObject> List<T> copyToValueObject(Iterator<BusinessObject> params, Class<T> voClass) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " public <T extends BusinessObject> T loadBusinessObject() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " private interface BusinessObject { }\n" +
+ "\n" +
+ " private interface ValueObject { }\n" +
+ "\n" +
+ " private class ValueObjectImpl implements ValueObject { }\n" +
+ "\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Java8TypeInferenceProblem.java (at line 8)\n" +
- " return copyToValueObject(loadBusinessObject(), ValueObjectImpl.class);\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The method copyToValueObject(Java8TypeInferenceProblem.BusinessObject, Class<Java8TypeInferenceProblem.ValueObjectImpl>) is ambiguous for the type Java8TypeInferenceProblem\n" +
+ "----------\n" +
+ "1. ERROR in Java8TypeInferenceProblem.java (at line 8)\n" +
+ " return copyToValueObject(loadBusinessObject(), ValueObjectImpl.class);\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The method copyToValueObject(Java8TypeInferenceProblem.BusinessObject, Class<Java8TypeInferenceProblem.ValueObjectImpl>) is ambiguous for the type Java8TypeInferenceProblem\n" +
"----------\n");
}
public void testBug492939a() {
runConformTest(
new String[] {
"EclipseInference.java",
- "import java.lang.reflect.Type;\n" +
- "import java.sql.ResultSet;\n" +
- "import java.sql.SQLException;\n" +
- "import java.util.List;\n" +
- "import java.util.Optional;\n" +
- "import java.util.concurrent.ConcurrentHashMap;\n" +
- "import java.util.concurrent.CopyOnWriteArrayList;\n" +
- "import java.util.function.Supplier;\n" +
- "import java.util.stream.Stream;\n" +
- "\n" +
- "public class EclipseInference {\n" +
- "\n" +
- " private final List<RowMapperFactory> rowFactories = new CopyOnWriteArrayList<>();\n" +
- " private final ConcurrentHashMap<Type, RowMapper<?>> rowCache = new ConcurrentHashMap<>();\n" +
- "\n" +
- " @SuppressWarnings(\"unchecked\")\n" +
- " public Optional<RowMapper<?>> findRowMapperFor(Type type) {\n" +
- " return Optional.ofNullable(rowCache.computeIfAbsent(type, t ->\n" +
- " findFirstPresent(\n" +
- " () -> rowFactories.stream()\n" +
- " .flatMap(factory -> toStream(factory.build(t)))\n" +
- " .findFirst(),\n" +
- " () -> findColumnMapperFor(t)\n" +
+ "import java.lang.reflect.Type;\n" +
+ "import java.sql.ResultSet;\n" +
+ "import java.sql.SQLException;\n" +
+ "import java.util.List;\n" +
+ "import java.util.Optional;\n" +
+ "import java.util.concurrent.ConcurrentHashMap;\n" +
+ "import java.util.concurrent.CopyOnWriteArrayList;\n" +
+ "import java.util.function.Supplier;\n" +
+ "import java.util.stream.Stream;\n" +
+ "\n" +
+ "public class EclipseInference {\n" +
+ "\n" +
+ " private final List<RowMapperFactory> rowFactories = new CopyOnWriteArrayList<>();\n" +
+ " private final ConcurrentHashMap<Type, RowMapper<?>> rowCache = new ConcurrentHashMap<>();\n" +
+ "\n" +
+ " @SuppressWarnings(\"unchecked\")\n" +
+ " public Optional<RowMapper<?>> findRowMapperFor(Type type) {\n" +
+ " return Optional.ofNullable(rowCache.computeIfAbsent(type, t ->\n" +
+ " findFirstPresent(\n" +
+ " () -> rowFactories.stream()\n" +
+ " .flatMap(factory -> toStream(factory.build(t)))\n" +
+ " .findFirst(),\n" +
+ " () -> findColumnMapperFor(t)\n" +
" .map(SingleColumnMapper::new))\n" + // HERE: ReferenceExpression had a bug
- " .orElse(null)));\n" +
- " }\n" +
- "\n" +
- " private Optional<ColumnMapper<?>> findColumnMapperFor(Type t) {\n" +
- " return Optional.empty();\n" +
- " }\n" +
- "\n" +
- " @SafeVarargs\n" +
- " static <T> Optional<T> findFirstPresent(Supplier<Optional<T>>... suppliers) {\n" +
- " return Stream.of(suppliers)\n" +
- " .flatMap(supplier -> toStream(supplier.get()))\n" +
- " .findFirst();\n" +
- " }\n" +
- " static <T> Stream<T> toStream(Optional<T> optional) {\n" +
- " return optional.isPresent() ? Stream.of(optional.get()) : Stream.empty();\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class SingleColumnMapper<T> implements RowMapper<T> {\n" +
- " SingleColumnMapper(ColumnMapper<T> mapper) {\n" +
- " }\n" +
- " @Override\n" +
- " public T map(ResultSet r) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "@FunctionalInterface\n" +
- "interface RowMapper<T>\n" +
- "{\n" +
- " T map(ResultSet r);\n" +
- "}\n" +
- "\n" +
- "@FunctionalInterface\n" +
- "interface ColumnMapper<T>\n" +
- "{\n" +
- " T map(ResultSet r, int columnNumber) throws SQLException;\n" +
- "}\n" +
- "\n" +
- "@FunctionalInterface\n" +
- "interface RowMapperFactory\n" +
- "{\n" +
- " Optional<RowMapper<?>> build(Type type);\n" +
- "}\n" +
- "\n" +
- "@FunctionalInterface\n" +
- "interface ColumnMapperFactory\n" +
- "{\n" +
- " Optional<ColumnMapper<?>> build(Type type);\n" +
+ " .orElse(null)));\n" +
+ " }\n" +
+ "\n" +
+ " private Optional<ColumnMapper<?>> findColumnMapperFor(Type t) {\n" +
+ " return Optional.empty();\n" +
+ " }\n" +
+ "\n" +
+ " @SafeVarargs\n" +
+ " static <T> Optional<T> findFirstPresent(Supplier<Optional<T>>... suppliers) {\n" +
+ " return Stream.of(suppliers)\n" +
+ " .flatMap(supplier -> toStream(supplier.get()))\n" +
+ " .findFirst();\n" +
+ " }\n" +
+ " static <T> Stream<T> toStream(Optional<T> optional) {\n" +
+ " return optional.isPresent() ? Stream.of(optional.get()) : Stream.empty();\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class SingleColumnMapper<T> implements RowMapper<T> {\n" +
+ " SingleColumnMapper(ColumnMapper<T> mapper) {\n" +
+ " }\n" +
+ " @Override\n" +
+ " public T map(ResultSet r) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "@FunctionalInterface\n" +
+ "interface RowMapper<T>\n" +
+ "{\n" +
+ " T map(ResultSet r);\n" +
+ "}\n" +
+ "\n" +
+ "@FunctionalInterface\n" +
+ "interface ColumnMapper<T>\n" +
+ "{\n" +
+ " T map(ResultSet r, int columnNumber) throws SQLException;\n" +
+ "}\n" +
+ "\n" +
+ "@FunctionalInterface\n" +
+ "interface RowMapperFactory\n" +
+ "{\n" +
+ " Optional<RowMapper<?>> build(Type type);\n" +
+ "}\n" +
+ "\n" +
+ "@FunctionalInterface\n" +
+ "interface ColumnMapperFactory\n" +
+ "{\n" +
+ " Optional<ColumnMapper<?>> build(Type type);\n" +
"}\n"
});
}
@@ -6372,79 +6372,79 @@ public void testBug492939b() {
runConformTest(
new String[] {
"EclipseInference.java",
- "import java.lang.reflect.Type;\n" +
- "import java.sql.ResultSet;\n" +
- "import java.sql.SQLException;\n" +
- "import java.util.List;\n" +
- "import java.util.Optional;\n" +
- "import java.util.concurrent.ConcurrentHashMap;\n" +
- "import java.util.concurrent.CopyOnWriteArrayList;\n" +
- "import java.util.function.Supplier;\n" +
- "import java.util.stream.Stream;\n" +
- "\n" +
- "public class EclipseInference {\n" +
- "\n" +
- " private final List<RowMapperFactory> rowFactories = new CopyOnWriteArrayList<>();\n" +
- " private final ConcurrentHashMap<Type, RowMapper<?>> rowCache = new ConcurrentHashMap<>();\n" +
- "\n" +
- " @SuppressWarnings(\"unchecked\")\n" +
- " public Optional<RowMapper<?>> findRowMapperFor(Type type) {\n" +
- " return Optional.ofNullable(rowCache.computeIfAbsent(type, t ->\n" +
- " findFirstPresent(\n" +
- " () -> rowFactories.stream()\n" +
- " .flatMap(factory -> toStream(factory.build(t)))\n" +
- " .findFirst(),\n" +
- " () -> findColumnMapperFor(t)\n" +
- " .map(c -> new SingleColumnMapper<>(c)))\n" + // HERE: LambdaExpression already worked
- " .orElse(null)));\n" +
- " }\n" +
- "\n" +
- " private Optional<ColumnMapper<?>> findColumnMapperFor(Type t) {\n" +
- " return Optional.empty();\n" +
- " }\n" +
- "\n" +
- " @SafeVarargs\n" +
- " static <T> Optional<T> findFirstPresent(Supplier<Optional<T>>... suppliers) {\n" +
- " return Stream.of(suppliers)\n" +
- " .flatMap(supplier -> toStream(supplier.get()))\n" +
- " .findFirst();\n" +
- " }\n" +
- " static <T> Stream<T> toStream(Optional<T> optional) {\n" +
- " return optional.isPresent() ? Stream.of(optional.get()) : Stream.empty();\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class SingleColumnMapper<T> implements RowMapper<T> {\n" +
- " SingleColumnMapper(ColumnMapper<T> mapper) {\n" +
- " }\n" +
- " @Override\n" +
- " public T map(ResultSet r) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "@FunctionalInterface\n" +
- "interface RowMapper<T>\n" +
- "{\n" +
- " T map(ResultSet r);\n" +
- "}\n" +
- "\n" +
- "@FunctionalInterface\n" +
- "interface ColumnMapper<T>\n" +
- "{\n" +
- " T map(ResultSet r, int columnNumber) throws SQLException;\n" +
- "}\n" +
- "\n" +
- "@FunctionalInterface\n" +
- "interface RowMapperFactory\n" +
- "{\n" +
- " Optional<RowMapper<?>> build(Type type);\n" +
- "}\n" +
- "\n" +
- "@FunctionalInterface\n" +
- "interface ColumnMapperFactory\n" +
- "{\n" +
- " Optional<ColumnMapper<?>> build(Type type);\n" +
+ "import java.lang.reflect.Type;\n" +
+ "import java.sql.ResultSet;\n" +
+ "import java.sql.SQLException;\n" +
+ "import java.util.List;\n" +
+ "import java.util.Optional;\n" +
+ "import java.util.concurrent.ConcurrentHashMap;\n" +
+ "import java.util.concurrent.CopyOnWriteArrayList;\n" +
+ "import java.util.function.Supplier;\n" +
+ "import java.util.stream.Stream;\n" +
+ "\n" +
+ "public class EclipseInference {\n" +
+ "\n" +
+ " private final List<RowMapperFactory> rowFactories = new CopyOnWriteArrayList<>();\n" +
+ " private final ConcurrentHashMap<Type, RowMapper<?>> rowCache = new ConcurrentHashMap<>();\n" +
+ "\n" +
+ " @SuppressWarnings(\"unchecked\")\n" +
+ " public Optional<RowMapper<?>> findRowMapperFor(Type type) {\n" +
+ " return Optional.ofNullable(rowCache.computeIfAbsent(type, t ->\n" +
+ " findFirstPresent(\n" +
+ " () -> rowFactories.stream()\n" +
+ " .flatMap(factory -> toStream(factory.build(t)))\n" +
+ " .findFirst(),\n" +
+ " () -> findColumnMapperFor(t)\n" +
+ " .map(c -> new SingleColumnMapper<>(c)))\n" + // HERE: LambdaExpression already worked
+ " .orElse(null)));\n" +
+ " }\n" +
+ "\n" +
+ " private Optional<ColumnMapper<?>> findColumnMapperFor(Type t) {\n" +
+ " return Optional.empty();\n" +
+ " }\n" +
+ "\n" +
+ " @SafeVarargs\n" +
+ " static <T> Optional<T> findFirstPresent(Supplier<Optional<T>>... suppliers) {\n" +
+ " return Stream.of(suppliers)\n" +
+ " .flatMap(supplier -> toStream(supplier.get()))\n" +
+ " .findFirst();\n" +
+ " }\n" +
+ " static <T> Stream<T> toStream(Optional<T> optional) {\n" +
+ " return optional.isPresent() ? Stream.of(optional.get()) : Stream.empty();\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class SingleColumnMapper<T> implements RowMapper<T> {\n" +
+ " SingleColumnMapper(ColumnMapper<T> mapper) {\n" +
+ " }\n" +
+ " @Override\n" +
+ " public T map(ResultSet r) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "@FunctionalInterface\n" +
+ "interface RowMapper<T>\n" +
+ "{\n" +
+ " T map(ResultSet r);\n" +
+ "}\n" +
+ "\n" +
+ "@FunctionalInterface\n" +
+ "interface ColumnMapper<T>\n" +
+ "{\n" +
+ " T map(ResultSet r, int columnNumber) throws SQLException;\n" +
+ "}\n" +
+ "\n" +
+ "@FunctionalInterface\n" +
+ "interface RowMapperFactory\n" +
+ "{\n" +
+ " Optional<RowMapper<?>> build(Type type);\n" +
+ "}\n" +
+ "\n" +
+ "@FunctionalInterface\n" +
+ "interface ColumnMapperFactory\n" +
+ "{\n" +
+ " Optional<ColumnMapper<?>> build(Type type);\n" +
"}\n"
});
}
@@ -6452,34 +6452,34 @@ public void testBug496942() {
runConformTest(
new String[] {
"ProductManager.java",
- "import java.util.Set;\n" +
- "import java.util.concurrent.Callable;\n" +
- "import java.util.function.Function;\n" +
- "import java.util.stream.Stream;\n" +
- "\n" +
- "class Product { }\n" +
- "class ItineraryDTO { }\n" +
- "class Result<K, V> {\n" +
- " public static <T, U> Function<T, ListenableFuture<Result<T, U>>> \n" +
- " asyncCall(Function<T, ListenableFuture<U>> asyncMethod)\n" +
- " {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "interface ListeningExecutorService {\n" +
- " <T> ListenableFuture<T> submit(Callable<T> c);\n" +
- " ListenableFuture<?> submit(Runnable r);\n" +
- "}\n" +
- "interface ListenableFuture<T> {}\n" +
- "\n" +
- "public class ProductManager {\n" +
- " public Stream<ListenableFuture<Result<Product, ItineraryDTO>>> \n" +
- " test(ListeningExecutorService executor, Set<Product> productsSet)\n" +
- " {\n" +
- " return productsSet.stream().map(Result.asyncCall(product ->\n" +
- " executor.submit(() -> new ItineraryDTO()\n" +
- " )));\n" +
- " }\n" +
+ "import java.util.Set;\n" +
+ "import java.util.concurrent.Callable;\n" +
+ "import java.util.function.Function;\n" +
+ "import java.util.stream.Stream;\n" +
+ "\n" +
+ "class Product { }\n" +
+ "class ItineraryDTO { }\n" +
+ "class Result<K, V> {\n" +
+ " public static <T, U> Function<T, ListenableFuture<Result<T, U>>> \n" +
+ " asyncCall(Function<T, ListenableFuture<U>> asyncMethod)\n" +
+ " {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "interface ListeningExecutorService {\n" +
+ " <T> ListenableFuture<T> submit(Callable<T> c);\n" +
+ " ListenableFuture<?> submit(Runnable r);\n" +
+ "}\n" +
+ "interface ListenableFuture<T> {}\n" +
+ "\n" +
+ "public class ProductManager {\n" +
+ " public Stream<ListenableFuture<Result<Product, ItineraryDTO>>> \n" +
+ " test(ListeningExecutorService executor, Set<Product> productsSet)\n" +
+ " {\n" +
+ " return productsSet.stream().map(Result.asyncCall(product ->\n" +
+ " executor.submit(() -> new ItineraryDTO()\n" +
+ " )));\n" +
+ " }\n" +
"}\n"
});
}
@@ -6487,45 +6487,45 @@ public void testBug496574() {
runConformTest(
new String[] {
"EclipseNeonBug.java",
- "import java.util.ArrayList;\n" +
- "import java.util.Collections;\n" +
- "import java.util.List;\n" +
- "import java.util.Map;\n" +
- "import java.util.Optional;\n" +
- "import java.util.stream.Collectors;\n" +
- "\n" +
- "public class EclipseNeonBug {\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " List<KeyValueObj> keyValObjs = new ArrayList<>();\n" +
- " Map<String, String> mses = Optional.ofNullable(keyValObjs)\n" +
- " .filter(ms -> !ms.isEmpty())\n" +
- " .map(ms -> ms.stream().collect(Collectors.toMap(\n" +
- " metafield -> metafield.getKey(),\n" +
- " metafield -> metafield.getValue())))\n" +
- " .orElseGet(() -> Collections.emptyMap());\n" +
- " }\n" +
- "\n" +
- " public static class KeyValueObj {\n" +
- " private String key;\n" +
- " private String value;\n" +
- "\n" +
- " public String getKey() {\n" +
- " return key;\n" +
- " }\n" +
- "\n" +
- " public void setKey(String key) {\n" +
- " this.key = key;\n" +
- " }\n" +
- "\n" +
- " public String getValue() {\n" +
- " return value;\n" +
- " }\n" +
- "\n" +
- " public void setValue(String value) {\n" +
- " this.value = value;\n" +
- " }\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.Collections;\n" +
+ "import java.util.List;\n" +
+ "import java.util.Map;\n" +
+ "import java.util.Optional;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "\n" +
+ "public class EclipseNeonBug {\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " List<KeyValueObj> keyValObjs = new ArrayList<>();\n" +
+ " Map<String, String> mses = Optional.ofNullable(keyValObjs)\n" +
+ " .filter(ms -> !ms.isEmpty())\n" +
+ " .map(ms -> ms.stream().collect(Collectors.toMap(\n" +
+ " metafield -> metafield.getKey(),\n" +
+ " metafield -> metafield.getValue())))\n" +
+ " .orElseGet(() -> Collections.emptyMap());\n" +
+ " }\n" +
+ "\n" +
+ " public static class KeyValueObj {\n" +
+ " private String key;\n" +
+ " private String value;\n" +
+ "\n" +
+ " public String getKey() {\n" +
+ " return key;\n" +
+ " }\n" +
+ "\n" +
+ " public void setKey(String key) {\n" +
+ " this.key = key;\n" +
+ " }\n" +
+ "\n" +
+ " public String getValue() {\n" +
+ " return value;\n" +
+ " }\n" +
+ "\n" +
+ " public void setValue(String value) {\n" +
+ " this.value = value;\n" +
+ " }\n" +
+ " }\n" +
"}\n"
});
}
@@ -6533,22 +6533,22 @@ public void testBug496574_small() {
runConformTest(
new String[] {
"Small.java",
- "import java.util.*;\n" +
- "import java.util.stream.*;\n" +
- "\n" +
- "interface KeyValueObj {\n" +
- " String getKey();\n" +
- " String getValue();\n" +
- "}\n" +
- "\n" +
- "public class Small {\n" +
- "\n" +
- " public void test(Optional<List<KeyValueObj>> optList) {\n" +
- " Optional<Map<String, String>> mses = optList\n" +
- " .map(ms -> ms.stream().collect(Collectors.toMap(\n" +
- " metafield -> metafield.getKey(),\n" +
- " metafield -> metafield.getValue())));\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "import java.util.stream.*;\n" +
+ "\n" +
+ "interface KeyValueObj {\n" +
+ " String getKey();\n" +
+ " String getValue();\n" +
+ "}\n" +
+ "\n" +
+ "public class Small {\n" +
+ "\n" +
+ " public void test(Optional<List<KeyValueObj>> optList) {\n" +
+ " Optional<Map<String, String>> mses = optList\n" +
+ " .map(ms -> ms.stream().collect(Collectors.toMap(\n" +
+ " metafield -> metafield.getKey(),\n" +
+ " metafield -> metafield.getValue())));\n" +
+ " }\n" +
"}\n"
});
}
@@ -6556,25 +6556,25 @@ public void testBug496579() {
runConformTest(
new String[] {
"EclipseNeonBug2.java",
- "import java.util.HashMap;\n" +
- "import java.util.Map;\n" +
- "import java.util.stream.Collectors;\n" +
- "\n" +
- "public class EclipseNeonBug2 {\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " Map<String, Map<String, Object>> stuff = new HashMap<>();\n" +
- " Map<String, Map<String, Integer>> result = stuff.entrySet().stream()\n" +
- " .collect(Collectors.toMap(\n" +
- " k -> k.getKey(), \n" +
- " o -> {\n" +
- " Map<String, Object> child = o.getValue();\n" +
- " return child.entrySet().stream().collect(Collectors.toMap(\n" +
- " k -> k.getKey(), \n" +
- " v -> Integer.parseInt(v.getValue().toString())));\n" +
- " }));\n" +
- " }\n" +
- " \n" +
+ "import java.util.HashMap;\n" +
+ "import java.util.Map;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "\n" +
+ "public class EclipseNeonBug2 {\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " Map<String, Map<String, Object>> stuff = new HashMap<>();\n" +
+ " Map<String, Map<String, Integer>> result = stuff.entrySet().stream()\n" +
+ " .collect(Collectors.toMap(\n" +
+ " k -> k.getKey(), \n" +
+ " o -> {\n" +
+ " Map<String, Object> child = o.getValue();\n" +
+ " return child.entrySet().stream().collect(Collectors.toMap(\n" +
+ " k -> k.getKey(), \n" +
+ " v -> Integer.parseInt(v.getValue().toString())));\n" +
+ " }));\n" +
+ " }\n" +
+ " \n" +
"}\n"
});
}
@@ -6582,26 +6582,26 @@ public void testBug496761() {
runConformTest(
new String[] {
"RepoCase.java",
- "import java.util.HashMap;\n" +
- "import java.util.Map;\n" +
- "import java.util.Map.Entry;\n" +
- "import java.util.Optional;\n" +
- "import java.util.function.Supplier;\n" +
- "import java.util.stream.Collectors;\n" +
- "\n" +
- "public class RepoCase {\n" +
- " private Map<String, Supplier<?>> dependencyMap = new HashMap<>();\n" +
- " \n" +
- " void compilerNPE() {\n" +
- "// Leads to NPE in compiler\n" +
- " Map<String, Object> map = Optional.ofNullable(this.dependencyMap)\n" +
- " .map(m -> m.entrySet().stream().collect(Collectors.toMap(Entry::getKey, e -> (Object) e.getValue().get())))\n" +
- " .orElse(new HashMap<>());\n" +
- " \n" +
- "// Compiler error (might be the real cause for the above NPE) \n" +
- " Optional<Map<String, Object>> o = Optional.ofNullable(this.dependencyMap)\n" +
- " .map(m -> m.entrySet().stream().collect(Collectors.toMap(Entry::getKey, e -> (Object) e.getValue().get())));\n" +
- " }\n" +
+ "import java.util.HashMap;\n" +
+ "import java.util.Map;\n" +
+ "import java.util.Map.Entry;\n" +
+ "import java.util.Optional;\n" +
+ "import java.util.function.Supplier;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "\n" +
+ "public class RepoCase {\n" +
+ " private Map<String, Supplier<?>> dependencyMap = new HashMap<>();\n" +
+ " \n" +
+ " void compilerNPE() {\n" +
+ "// Leads to NPE in compiler\n" +
+ " Map<String, Object> map = Optional.ofNullable(this.dependencyMap)\n" +
+ " .map(m -> m.entrySet().stream().collect(Collectors.toMap(Entry::getKey, e -> (Object) e.getValue().get())))\n" +
+ " .orElse(new HashMap<>());\n" +
+ " \n" +
+ "// Compiler error (might be the real cause for the above NPE) \n" +
+ " Optional<Map<String, Object>> o = Optional.ofNullable(this.dependencyMap)\n" +
+ " .map(m -> m.entrySet().stream().collect(Collectors.toMap(Entry::getKey, e -> (Object) e.getValue().get())));\n" +
+ " }\n" +
"}\n"
});
}
@@ -6609,22 +6609,22 @@ public void testBug496624() {
runConformTest(
new String[] {
"JDTNPETest.java",
- "import java.util.*;\n" +
- "import java.util.stream.Collectors;\n" +
- "\n" +
- "interface HttpSession{\n" +
- " Enumeration<String> getAttributeNames();\n" +
- " Object getAttribute(String name);\n" +
- "}\n" +
- "public class JDTNPETest {\n" +
- " \n" +
- " public static void main(String[] args){\n" +
- " Map<String, Object> sessionAttributes = Optional.<HttpSession>ofNullable(null)\n" +
- " .map(s -> Collections.list(s.getAttributeNames()).stream()\n" +
- " .collect(Collectors.toMap(name -> name, name -> s.getAttribute(name))))\n" +
- " .orElse(null);\n" +
- " }\n" +
- "\n" +
+ "import java.util.*;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "\n" +
+ "interface HttpSession{\n" +
+ " Enumeration<String> getAttributeNames();\n" +
+ " Object getAttribute(String name);\n" +
+ "}\n" +
+ "public class JDTNPETest {\n" +
+ " \n" +
+ " public static void main(String[] args){\n" +
+ " Map<String, Object> sessionAttributes = Optional.<HttpSession>ofNullable(null)\n" +
+ " .map(s -> Collections.list(s.getAttributeNames()).stream()\n" +
+ " .collect(Collectors.toMap(name -> name, name -> s.getAttribute(name))))\n" +
+ " .orElse(null);\n" +
+ " }\n" +
+ "\n" +
"}\n"
});
}
@@ -6632,28 +6632,28 @@ public void testBug497193() {
runConformTest(
new String[] {
"EclipseBug.java",
- "import java.util.function.Function;\n" +
- "\n" +
- "public class EclipseBug {\n" +
- " public static class Class1<K, V > {\n" +
- " public Class1( Function<K, V > arg ) {}\n" +
- " }\n" +
- "\n" +
- " public static <T, R> R method1( T object, Function<T, R > function ) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " public static class Class2 {\n" +
- " public static Class2 method1( String arg ) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " String method2() {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private final Class1<String, String > member = new Class1<>( arg -> method1( Class2.method1( arg ), class2 -> class2.method2() ) );\n" +
+ "import java.util.function.Function;\n" +
+ "\n" +
+ "public class EclipseBug {\n" +
+ " public static class Class1<K, V > {\n" +
+ " public Class1( Function<K, V > arg ) {}\n" +
+ " }\n" +
+ "\n" +
+ " public static <T, R> R method1( T object, Function<T, R > function ) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " public static class Class2 {\n" +
+ " public static Class2 method1( String arg ) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " String method2() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " private final Class1<String, String > member = new Class1<>( arg -> method1( Class2.method1( arg ), class2 -> class2.method2() ) );\n" +
"}\n"
});
}
@@ -6661,47 +6661,47 @@ public void testBug496578() {
runConformTest(
new String[] {
"Test.java",
- "import java.util.function.BinaryOperator;\n" +
- "import java.util.function.Function;\n" +
- "\n" +
- "public class Test {\n" +
- " private Long[] v, v_small;\n" +
- " public Long method(String[] args) {\n" +
- " ExecPushFactory alg = new ExecPushFactory();\n" +
- " Long value = Id.prj(\n" +
- " alg.reduce(0L, Long::sum,\n" +
- " alg.flatMap(x ->\n" +
- " alg.map(y -> x * y,\n" +
- " alg.source(v_small)),\n" +
- " alg.source(v)))).value;\n" +
- " return value;\n" +
- " }\n" +
- "}\n" +
- "class ExecPushFactory {\n" +
- " public <T, R> App<Id.t, R> flatMap(Function<T, App<Id.t, R>> mapper, App<Id.t, T> app) {\n" +
- " return null;\n" +
- " }\n" +
- " public <T> App<Id.t, T> source(T[] array) {\n" +
- " return null;\n" +
- " }\n" +
- " public <T, R> App<Id.t, R> map(Function<T, R> mapper, App<Id.t, T> app) {\n" +
- " return null;\n" +
- " }\n" +
- " public <T> App<Id.t, T> reduce(T identity, BinaryOperator<T> accumulator, App<Id.t, T> app) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
+ "import java.util.function.BinaryOperator;\n" +
+ "import java.util.function.Function;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " private Long[] v, v_small;\n" +
+ " public Long method(String[] args) {\n" +
+ " ExecPushFactory alg = new ExecPushFactory();\n" +
+ " Long value = Id.prj(\n" +
+ " alg.reduce(0L, Long::sum,\n" +
+ " alg.flatMap(x ->\n" +
+ " alg.map(y -> x * y,\n" +
+ " alg.source(v_small)),\n" +
+ " alg.source(v)))).value;\n" +
+ " return value;\n" +
+ " }\n" +
+ "}\n" +
+ "class ExecPushFactory {\n" +
+ " public <T, R> App<Id.t, R> flatMap(Function<T, App<Id.t, R>> mapper, App<Id.t, T> app) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public <T> App<Id.t, T> source(T[] array) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public <T, R> App<Id.t, R> map(Function<T, R> mapper, App<Id.t, T> app) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public <T> App<Id.t, T> reduce(T identity, BinaryOperator<T> accumulator, App<Id.t, T> app) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
"class Id<T> implements App<Id.t, T>{\n" +
- " public T value;\n" +
- " public static class t {\n" +
- " \n" +
- " }\n" +
- " public static <A> Id<A> prj(App<Id.t, A> app) {\n" +
- " return (Id<A>) app;\n" +
- " }\n" +
- "}\n" +
- "interface App<C, T> {\n" +
- " \n" +
+ " public T value;\n" +
+ " public static class t {\n" +
+ " \n" +
+ " }\n" +
+ " public static <A> Id<A> prj(App<Id.t, A> app) {\n" +
+ " return (Id<A>) app;\n" +
+ " }\n" +
+ "}\n" +
+ "interface App<C, T> {\n" +
+ " \n" +
"}\n"
});
}
@@ -6709,15 +6709,15 @@ public void testBug496675() {
runConformTest(
new String[] {
"Test.java",
- "public class Test {\n" +
- " public class B<X, Y> {\n" +
- " public class C {}\n" +
- " }\n" +
- " public class D<X> extends B<String, X> {}\n" +
- " \n" +
- " /* This fails with an internal ArrayIndexOutOfBoundsException in \n" +
- " * ParameterizedTypeBinding.boundCheck. */\n" +
- " public class E<X extends D<?>.C> {}\n" +
+ "public class Test {\n" +
+ " public class B<X, Y> {\n" +
+ " public class C {}\n" +
+ " }\n" +
+ " public class D<X> extends B<String, X> {}\n" +
+ " \n" +
+ " /* This fails with an internal ArrayIndexOutOfBoundsException in \n" +
+ " * ParameterizedTypeBinding.boundCheck. */\n" +
+ " public class E<X extends D<?>.C> {}\n" +
"}\n"
});
}
@@ -6725,46 +6725,46 @@ public void testBug496675_comment4() {
runNegativeTest(
new String[] {
"Test.java",
- "public class Test {\n" +
- " public class B<X, Y> {\n" +
- " public class C {}\n" +
- " }\n" +
- " public class D<X extends Number> extends B<String, X> {}\n" +
- " \n" +
- " /* This fails with an internal ArrayIndexOutOfBoundsException in \n" +
- " * ParameterizedTypeBinding.boundCheck. */\n" +
- " public class E<X extends D<String>.C> {}\n" +
+ "public class Test {\n" +
+ " public class B<X, Y> {\n" +
+ " public class C {}\n" +
+ " }\n" +
+ " public class D<X extends Number> extends B<String, X> {}\n" +
+ " \n" +
+ " /* This fails with an internal ArrayIndexOutOfBoundsException in \n" +
+ " * ParameterizedTypeBinding.boundCheck. */\n" +
+ " public class E<X extends D<String>.C> {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 9)\n" +
- " public class E<X extends D<String>.C> {}\n" +
- " ^^^^^^\n" +
- "Bound mismatch: The type String is not a valid substitute for the bounded parameter <X extends Number> of the type Test.D<X>\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 9)\n" +
+ " public class E<X extends D<String>.C> {}\n" +
+ " ^^^^^^\n" +
+ "Bound mismatch: The type String is not a valid substitute for the bounded parameter <X extends Number> of the type Test.D<X>\n" +
"----------\n");
}
public void testBug496675_problem() {
runNegativeTest(
new String[] {
"Test.java",
- "public class Test {\n" +
- " <X extends wrong.D<?>.C> void m() {}\n" +
+ "public class Test {\n" +
+ " <X extends wrong.D<?>.C> void m() {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " <X extends wrong.D<?>.C> void m() {}\n" +
- " ^^^^^\n" +
- "wrong cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 2)\n" +
+ " <X extends wrong.D<?>.C> void m() {}\n" +
+ " ^^^^^\n" +
+ "wrong cannot be resolved to a type\n" +
"----------\n");
}
public void testBug496886() {
runConformTest(
new String[] {
"Outer.java",
- "public interface Outer<E> {\n" +
- " public interface Inner<E> {\n" +
- " }\n" +
+ "public interface Outer<E> {\n" +
+ " public interface Inner<E> {\n" +
+ " }\n" +
"}\n",
"SubInterface.java",
"public interface SubInterface extends Outer<String> {}\n"
@@ -6783,19 +6783,19 @@ public void testBug497603() {
runConformTest(
new String[] {
"InferBug.java",
- "import java.util.Iterator;\n" +
- "import java.util.Map.Entry;\n" +
- "import java.util.function.BiPredicate;\n" +
- "import java.util.function.Function;\n" +
- "\n" +
- "public class InferBug {\n" +
- " public static void main(String[] args) {\n" +
- " Iterator<Iterator<Entry<String, String>>> x = null;\n" +
- " Iterator<Iterator<String>> p = foo(x, i -> foo(i, Entry::getValue));\n" +
- " }\n" +
- " static <F, T> Iterator<T> foo(Iterator<F> a, Function<F, T> b) {\n" +
- " return null;\n" +
- " }\n" +
+ "import java.util.Iterator;\n" +
+ "import java.util.Map.Entry;\n" +
+ "import java.util.function.BiPredicate;\n" +
+ "import java.util.function.Function;\n" +
+ "\n" +
+ "public class InferBug {\n" +
+ " public static void main(String[] args) {\n" +
+ " Iterator<Iterator<Entry<String, String>>> x = null;\n" +
+ " Iterator<Iterator<String>> p = foo(x, i -> foo(i, Entry::getValue));\n" +
+ " }\n" +
+ " static <F, T> Iterator<T> foo(Iterator<F> a, Function<F, T> b) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
});
}
@@ -6804,22 +6804,22 @@ public void testBug498113a() {
new String[] {
"NPETest.java",
"import java.util.*;\n" +
- "public class NPETest {\n" +
- "\n" +
- " public void test(\n" +
- " final Set<String> set,\n" +
- " final List<Dummy<String>> dummies) {\n" +
- " set.stream()\n" +
+ "public class NPETest {\n" +
+ "\n" +
+ " public void test(\n" +
+ " final Set<String> set,\n" +
+ " final List<Dummy<String>> dummies) {\n" +
+ " set.stream()\n" +
" .map(Dummy::new)\n" + // true varargs invocation
- " .forEach(dummies::add);\n" +
- " }\n" +
- " \n" +
- " class Dummy<T> {\n" +
- " \n" +
- " public Dummy(T... args) {\n" +
- " \n" +
- " }\n" +
- " }\n" +
+ " .forEach(dummies::add);\n" +
+ " }\n" +
+ " \n" +
+ " class Dummy<T> {\n" +
+ " \n" +
+ " public Dummy(T... args) {\n" +
+ " \n" +
+ " }\n" +
+ " }\n" +
"}\n"
});
}
@@ -6828,22 +6828,22 @@ public void testBug498113b() {
new String[] {
"NPETest.java",
"import java.util.*;\n" +
- "public class NPETest {\n" +
- "\n" +
- " public void test(\n" +
- " final Set<String[]> set,\n" +
- " final List<Dummy<String>> dummies) {\n" +
- " set.stream()\n" +
+ "public class NPETest {\n" +
+ "\n" +
+ " public void test(\n" +
+ " final Set<String[]> set,\n" +
+ " final List<Dummy<String>> dummies) {\n" +
+ " set.stream()\n" +
" .map(Dummy::new)\n" + // pass String[] for a strict invocation
- " .forEach(dummies::add);\n" +
- " }\n" +
- " \n" +
- " class Dummy<T> {\n" +
- " \n" +
- " public Dummy(T... args) {\n" +
- " \n" +
- " }\n" +
- " }\n" +
+ " .forEach(dummies::add);\n" +
+ " }\n" +
+ " \n" +
+ " class Dummy<T> {\n" +
+ " \n" +
+ " public Dummy(T... args) {\n" +
+ " \n" +
+ " }\n" +
+ " }\n" +
"}\n"
});
}
@@ -6856,8 +6856,8 @@ public void testBug498362_comment0() {
" static final byte[] EMPTY_BYTE_ARRAY = new byte[0];\n" +
" private byte[] stream;\n" +
" void test() {\n" +
- " this.stream = Optional.ofNullable(stream)\n" +
- " .map(byte[]::clone)\n" +
+ " this.stream = Optional.ofNullable(stream)\n" +
+ " .map(byte[]::clone)\n" +
" .orElse(EMPTY_BYTE_ARRAY);" +
" }\n" +
"}\n"
@@ -6867,27 +6867,27 @@ public void testBug498362_comment5() {
runConformTest(
new String[] {
"CloneVerifyError.java",
- "public class CloneVerifyError {\n" +
- " public interface PublicCloneable<T> extends Cloneable {\n" +
- " public T clone();\n" +
- " }\n" +
- "\n" +
- " public static <T> T[] clone0(T[] input) {\n" +
- " return input == null ? null : input.clone();\n" +
- " }\n" +
- "\n" +
- " public static <T extends PublicCloneable<T>> T clone0(T input) {\n" +
- " if (input == null) {\n" +
- " return null;\n" +
- " } else {\n" +
- " return input.clone();\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " Object[] array = null;\n" +
- " clone0(array);\n" +
- " }\n" +
+ "public class CloneVerifyError {\n" +
+ " public interface PublicCloneable<T> extends Cloneable {\n" +
+ " public T clone();\n" +
+ " }\n" +
+ "\n" +
+ " public static <T> T[] clone0(T[] input) {\n" +
+ " return input == null ? null : input.clone();\n" +
+ " }\n" +
+ "\n" +
+ " public static <T extends PublicCloneable<T>> T clone0(T input) {\n" +
+ " if (input == null) {\n" +
+ " return null;\n" +
+ " } else {\n" +
+ " return input.clone();\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " Object[] array = null;\n" +
+ " clone0(array);\n" +
+ " }\n" +
"}\n"
});
}
@@ -6895,34 +6895,34 @@ public void testBug470667() {
runNegativeTest(
new String[] {
"Test.java",
- "import java.math.BigInteger;\n" +
- "import java.util.function.Function;\n" +
- "public class Test {\n" +
- " protected <T> T m(Class<T> c, String s, Function<String, T> f) {\n" +
- " return f.apply(s);\n" +
- " }\n" +
- " protected <T> T m(Class<T> c, BigInteger i, Function<BigInteger, T> f) {\n" +
- " return f.apply(i);\n" +
- " }\n" +
- " protected <T> Data<T> createData() {\n" +
- " return new Data<T>() {\n" +
- " };\n" +
- " }\n" +
- " private <T> Data<T> doA(BigInteger i) {\n" +
+ "import java.math.BigInteger;\n" +
+ "import java.util.function.Function;\n" +
+ "public class Test {\n" +
+ " protected <T> T m(Class<T> c, String s, Function<String, T> f) {\n" +
+ " return f.apply(s);\n" +
+ " }\n" +
+ " protected <T> T m(Class<T> c, BigInteger i, Function<BigInteger, T> f) {\n" +
+ " return f.apply(i);\n" +
+ " }\n" +
+ " protected <T> Data<T> createData() {\n" +
+ " return new Data<T>() {\n" +
+ " };\n" +
+ " }\n" +
+ " private <T> Data<T> doA(BigInteger i) {\n" +
" String str = \"titi \";\n" +
" @SuppressWarnings(\"unchecked\")\n" +
- " Data<T> r = m(Data.class, \"toto \",\n" +
- " (x) -> m(Data.class, str, (y) -> m(Data.class, BigInteger.ZERO, (z) -> createData(i, x, y, z))));\n" +
- " return r;\n" +
- " }\n" +
- "}\n" +
+ " Data<T> r = m(Data.class, \"toto \",\n" +
+ " (x) -> m(Data.class, str, (y) -> m(Data.class, BigInteger.ZERO, (z) -> createData(i, x, y, z))));\n" +
+ " return r;\n" +
+ " }\n" +
+ "}\n" +
"interface Data<T> { }\n"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 18)\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 18)\n" +
" (x) -> m(Data.class, str, (y) -> m(Data.class, BigInteger.ZERO, (z) -> createData(i, x, y, z))));\n" +
- " ^^^^^^^^^^\n" +
- "The method createData() in the type Test is not applicable for the arguments (BigInteger, String, String, BigInteger)\n" +
+ " ^^^^^^^^^^\n" +
+ "The method createData() in the type Test is not applicable for the arguments (BigInteger, String, String, BigInteger)\n" +
"----------\n");
}
public void testBug497239() {
@@ -6953,28 +6953,28 @@ public void testBug472851() {
runNegativeTest(
new String[] {
"Test.java",
- "import java.util.*;\n" +
- "\n" +
- "public class Test {\n" +
- " public static void main(String... arg) {\n" +
- " List<Integer> l1=Arrays.asList(0, 1, 2);\n" +
- " List<String> l2=Arrays.asList(\"0\", \"1\", \"2\");\n" +
- " a(Arrays.asList(l1, l2));\n" +
- "}\n" +
- "static final void a(List<? extends List<?>> type) {\n" +
- " test(type);\n" +
- "}\n" +
- "static final <Y,L extends List<Y>> void test(List<L> type) {\n" +
- " L l1=type.get(0), l2=type.get(1);\n" +
- " l2.set(0, l1.get(0));\n" +
- "}\n" +
+ "import java.util.*;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " public static void main(String... arg) {\n" +
+ " List<Integer> l1=Arrays.asList(0, 1, 2);\n" +
+ " List<String> l2=Arrays.asList(\"0\", \"1\", \"2\");\n" +
+ " a(Arrays.asList(l1, l2));\n" +
+ "}\n" +
+ "static final void a(List<? extends List<?>> type) {\n" +
+ " test(type);\n" +
+ "}\n" +
+ "static final <Y,L extends List<Y>> void test(List<L> type) {\n" +
+ " L l1=type.get(0), l2=type.get(1);\n" +
+ " l2.set(0, l1.get(0));\n" +
+ "}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 10)\n" +
- " test(type);\n" +
- " ^^^^\n" +
- "The method test(List<L>) in the type Test is not applicable for the arguments (List<capture#1-of ? extends List<?>>)\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 10)\n" +
+ " test(type);\n" +
+ " ^^^^\n" +
+ "The method test(List<L>) in the type Test is not applicable for the arguments (List<capture#1-of ? extends List<?>>)\n" +
"----------\n");
}
public void testBug502350() {
@@ -7005,11 +7005,11 @@ public void testBug502350() {
"\n" +
"",
},
- "----------\n" +
- "1. ERROR in makeCompilerFreeze\\EclipseJava8Bug.java (at line 20)\n" +
- " Stuff.func(Comparator.naturalOrder());\n" +
- " ^^^^\n" +
- "The method func(Comparator<T>) in the type Stuff is not applicable for the arguments (Comparator<Comparable<Comparable<B>>>)\n" +
+ "----------\n" +
+ "1. ERROR in makeCompilerFreeze\\EclipseJava8Bug.java (at line 20)\n" +
+ " Stuff.func(Comparator.naturalOrder());\n" +
+ " ^^^^\n" +
+ "The method func(Comparator<T>) in the type Stuff is not applicable for the arguments (Comparator<Comparable<Comparable<B>>>)\n" +
"----------\n"
);
}
@@ -7017,65 +7017,65 @@ public void testBug499351() {
runConformTest(
new String[] {
"Bug.java",
- "import java.util.HashMap;\n" +
- "import java.util.List;\n" +
- "import java.util.Map;\n" +
- "import java.util.Set;\n" +
- "import java.util.stream.Collectors;\n" +
- "\n" +
- "public class Bug {\n" +
- " private static final Validator VALIDATOR = new Validator();\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " Map<String, List<Promotion>> promotions = new HashMap<>();\n" +
- "\n" +
- " Set<ConstraintViolation> cvs = promotions.entrySet().stream()\n" +
- " .flatMap(e -> e.getValue().stream()\n" +
- " .flatMap(promotion -> VALIDATOR.validate(promotion).stream())\n" +
- " )\n" +
- " .collect(Collectors.toSet());\n" +
- "\n" +
- " Set<ExtendedConstraintViolation> ecvs = promotions.entrySet().stream()\n" +
- " .flatMap(e -> e.getValue().stream()\n" +
- " .map(constraintViolation -> new ExtendedConstraintViolation(\"\", null))\n" +
- " )\n" +
- " .collect(Collectors.toSet());\n" +
- "\n" +
- " Set<ExtendedConstraintViolation> ecvs2 = promotions.entrySet().stream()\n" +
- " .flatMap(e -> e.getValue().stream())\n" +
- " .flatMap(promotion -> VALIDATOR.validate(promotion).stream())\n" +
- " .map(constraintViolation -> new ExtendedConstraintViolation(\"promotions/2\", constraintViolation))\n" +
- " .collect(Collectors.toSet());\n" +
- "\n" +
- " // Below does not compile with 4.7M1, but worked fine in 4.5 (also compiles fine with Oracle/JDK8)\n" +
- " //\n" +
- " // --> Type mismatch: cannot convert from Set<Object> to Set<Bug.ExtendedConstraintViolation>\n" +
- " //\n" +
- " Set<ExtendedConstraintViolation> ecvs3 = promotions.entrySet().stream()\n" +
- " .flatMap(e -> e.getValue().stream()\n" +
- " .flatMap(promotion -> VALIDATOR.validate(promotion).stream()\n" +
- " .map(constraintViolation -> new ExtendedConstraintViolation(\"promotions/\" + e.getKey(), constraintViolation))\n" +
- " )\n" +
- " )\n" +
- " .collect(Collectors.toSet());\n" +
- " }\n" +
- "\n" +
- " private static class ExtendedConstraintViolation {\n" +
- " public ExtendedConstraintViolation(String key, ConstraintViolation cv) {\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private static class ConstraintViolation {\n" +
- " }\n" +
- "\n" +
- " private static class Promotion {\n" +
- " }\n" +
- "\n" +
- " private static class Validator {\n" +
- " public Set<ConstraintViolation> validate(Object o) {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
+ "import java.util.HashMap;\n" +
+ "import java.util.List;\n" +
+ "import java.util.Map;\n" +
+ "import java.util.Set;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "\n" +
+ "public class Bug {\n" +
+ " private static final Validator VALIDATOR = new Validator();\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " Map<String, List<Promotion>> promotions = new HashMap<>();\n" +
+ "\n" +
+ " Set<ConstraintViolation> cvs = promotions.entrySet().stream()\n" +
+ " .flatMap(e -> e.getValue().stream()\n" +
+ " .flatMap(promotion -> VALIDATOR.validate(promotion).stream())\n" +
+ " )\n" +
+ " .collect(Collectors.toSet());\n" +
+ "\n" +
+ " Set<ExtendedConstraintViolation> ecvs = promotions.entrySet().stream()\n" +
+ " .flatMap(e -> e.getValue().stream()\n" +
+ " .map(constraintViolation -> new ExtendedConstraintViolation(\"\", null))\n" +
+ " )\n" +
+ " .collect(Collectors.toSet());\n" +
+ "\n" +
+ " Set<ExtendedConstraintViolation> ecvs2 = promotions.entrySet().stream()\n" +
+ " .flatMap(e -> e.getValue().stream())\n" +
+ " .flatMap(promotion -> VALIDATOR.validate(promotion).stream())\n" +
+ " .map(constraintViolation -> new ExtendedConstraintViolation(\"promotions/2\", constraintViolation))\n" +
+ " .collect(Collectors.toSet());\n" +
+ "\n" +
+ " // Below does not compile with 4.7M1, but worked fine in 4.5 (also compiles fine with Oracle/JDK8)\n" +
+ " //\n" +
+ " // --> Type mismatch: cannot convert from Set<Object> to Set<Bug.ExtendedConstraintViolation>\n" +
+ " //\n" +
+ " Set<ExtendedConstraintViolation> ecvs3 = promotions.entrySet().stream()\n" +
+ " .flatMap(e -> e.getValue().stream()\n" +
+ " .flatMap(promotion -> VALIDATOR.validate(promotion).stream()\n" +
+ " .map(constraintViolation -> new ExtendedConstraintViolation(\"promotions/\" + e.getKey(), constraintViolation))\n" +
+ " )\n" +
+ " )\n" +
+ " .collect(Collectors.toSet());\n" +
+ " }\n" +
+ "\n" +
+ " private static class ExtendedConstraintViolation {\n" +
+ " public ExtendedConstraintViolation(String key, ConstraintViolation cv) {\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " private static class ConstraintViolation {\n" +
+ " }\n" +
+ "\n" +
+ " private static class Promotion {\n" +
+ " }\n" +
+ "\n" +
+ " private static class Validator {\n" +
+ " public Set<ConstraintViolation> validate(Object o) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
"}\n"
});
}
@@ -7084,31 +7084,31 @@ public void _testBug499351_small() {
runConformTest(
new String[] {
"Small.java",
- "import java.util.*;\n" +
- "import java.util.stream.Collectors;\n" +
- "\n" +
- "public class Small {\n" +
- "\n" +
- " public static void test(Map<String, List<Promotion>> promotions, Validator validator) {\n" +
- "\n" +
- " Set<ExtendedConstraintViolation> ecvs = promotions.entrySet().stream()\n" +
- " .flatMap(e -> e.getValue().stream()\n" +
- " .flatMap(promotion -> validator.validate(promotion).stream()\n" +
- " .map(constraintViolation -> new ExtendedConstraintViolation(\"promotions/\" + e.getKey(), constraintViolation))\n" +
- " )\n" +
- " )\n" +
- " .collect(Collectors.toSet());\n" +
- " }\n" +
- "\n" +
- "}\n" +
- "class ExtendedConstraintViolation {\n" +
- " public ExtendedConstraintViolation(String key, ConstraintViolation cv) { }\n" +
- "}\n" +
- "\n" +
- "class ConstraintViolation { }\n" +
- "class Promotion { }\n" +
- "class Validator {\n" +
- " public Set<ConstraintViolation> validate(Object o) { return null; }\n" +
+ "import java.util.*;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "\n" +
+ "public class Small {\n" +
+ "\n" +
+ " public static void test(Map<String, List<Promotion>> promotions, Validator validator) {\n" +
+ "\n" +
+ " Set<ExtendedConstraintViolation> ecvs = promotions.entrySet().stream()\n" +
+ " .flatMap(e -> e.getValue().stream()\n" +
+ " .flatMap(promotion -> validator.validate(promotion).stream()\n" +
+ " .map(constraintViolation -> new ExtendedConstraintViolation(\"promotions/\" + e.getKey(), constraintViolation))\n" +
+ " )\n" +
+ " )\n" +
+ " .collect(Collectors.toSet());\n" +
+ " }\n" +
+ "\n" +
+ "}\n" +
+ "class ExtendedConstraintViolation {\n" +
+ " public ExtendedConstraintViolation(String key, ConstraintViolation cv) { }\n" +
+ "}\n" +
+ "\n" +
+ "class ConstraintViolation { }\n" +
+ "class Promotion { }\n" +
+ "class Validator {\n" +
+ " public Set<ConstraintViolation> validate(Object o) { return null; }\n" +
"}\n"
});
}
@@ -7116,17 +7116,17 @@ public void test499351_extra1() {
runConformTest(
new String[] {
"Example.java",
- "import java.util.function.Function;\n" +
- "\n" +
- "public class Example {\n" +
- " static <T> T id(T t) { return t; }\n" +
- " static <T,X> T f1 (X x) { return null; }\n" +
- " \n" +
- " String test() {\n" +
+ "import java.util.function.Function;\n" +
+ "\n" +
+ "public class Example {\n" +
+ " static <T> T id(T t) { return t; }\n" +
+ " static <T,X> T f1 (X x) { return null; }\n" +
+ " \n" +
+ " String test() {\n" +
" return f3(y -> y.f2(Example::f1, id(y)));\n" +
- " }\n" +
- " <U,V> V f2(Function<U, V> f, U u) {return f.apply(null);}\n" +
- " <R> R f3(Function<Example,R> f) { return null; }\n" +
+ " }\n" +
+ " <U,V> V f2(Function<U, V> f, U u) {return f.apply(null);}\n" +
+ " <R> R f3(Function<Example,R> f) { return null; }\n" +
"}\n"
});
}
@@ -7134,19 +7134,19 @@ public void test499351_extra2() {
runConformTest(
new String[] {
"BadInferenceMars451.java",
- "import java.util.*;\n" +
- "import java.util.function.Function;\n" +
- "import java.util.stream.Collectors;\n" +
- "public class BadInferenceMars451 {\n" +
- " public static Map<Object, List<X>> BadInferenceMars451Casus1() {\n" +
- " List<X> stuff = new ArrayList<>();\n" +
- " return stuff.stream().collect(Collectors.toMap(Function.identity(), t -> Arrays.asList(t), BadInferenceMars451::sum));\n" +
- " }\n" +
- " public static <T> List<T> sum(List<T> l1, List<T> l2) {\n" +
- " return null;\n" +
- " }\n" +
- " public static class X {\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "import java.util.function.Function;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "public class BadInferenceMars451 {\n" +
+ " public static Map<Object, List<X>> BadInferenceMars451Casus1() {\n" +
+ " List<X> stuff = new ArrayList<>();\n" +
+ " return stuff.stream().collect(Collectors.toMap(Function.identity(), t -> Arrays.asList(t), BadInferenceMars451::sum));\n" +
+ " }\n" +
+ " public static <T> List<T> sum(List<T> l1, List<T> l2) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public static class X {\n" +
+ " }\n" +
"}"
});
}
@@ -7154,58 +7154,58 @@ public void testBug501949() {
runConformTest(
new String[] {
"DefaultClientRequestsV2.java",
- "import java.io.IOException;\n" +
- "import java.util.List;\n" +
- "import java.util.function.Function;\n" +
- "import java.util.function.Supplier;\n" +
- "\n" +
- "\n" +
- "interface Flux<T> extends Publisher<T> {\n" +
- " <R> Flux<R> flatMap(Function<? super T, ? extends Publisher<? extends R>> f);\n" +
- " <V> Flux<V> map(Function<T,V> mapper);\n" +
- " Mono<List<T>> collectList();\n" +
- "}\n" +
- "abstract class Mono<T> implements Publisher<T> {\n" +
- " abstract T block();\n" +
- " abstract <R> Flux<R> flatMap(Function<? super T, ? extends Publisher<? extends R>> f);\n" +
- "}\n" +
- "interface Publisher<T> {}\n" +
- "interface CloudFoundryOperations {\n" +
- " Flux<SpaceSummary> list();\n" +
- "}\n" +
- "class SpaceSummary { }\n" +
- "class OrganizationSummary {\n" +
- " String getId() { return \"\"; }\n" +
- "}\n" +
- "interface CFSpace {}\n" +
- "public class DefaultClientRequestsV2 {\n" +
- "\n" +
- " private Flux<OrganizationSummary> _orglist;\n" +
- "\n" +
- " private Mono<CloudFoundryOperations> operationsFor(OrganizationSummary org) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " public List<CFSpace> getSpaces() {\n" +
- " return get(\n" +
- " _orglist\n" +
- " .flatMap((OrganizationSummary org) -> {\n" +
- " return operationsFor(org).flatMap((operations) ->\n" +
- " operations\n" +
- " .list()\n" +
- " .map((space) -> wrap(org, space)\n" +
- " )\n" +
- " );\n" +
- " })\n" +
- " .collectList()\n" +
- " );\n" +
- " }\n" +
- " public static <T> T get(Mono<T> mono) {\n" +
- " return mono.block();\n" +
- " }\n" +
- " public static CFSpace wrap(OrganizationSummary org, SpaceSummary space) {\n" +
- " return null;\n" +
- " }\n" +
+ "import java.io.IOException;\n" +
+ "import java.util.List;\n" +
+ "import java.util.function.Function;\n" +
+ "import java.util.function.Supplier;\n" +
+ "\n" +
+ "\n" +
+ "interface Flux<T> extends Publisher<T> {\n" +
+ " <R> Flux<R> flatMap(Function<? super T, ? extends Publisher<? extends R>> f);\n" +
+ " <V> Flux<V> map(Function<T,V> mapper);\n" +
+ " Mono<List<T>> collectList();\n" +
+ "}\n" +
+ "abstract class Mono<T> implements Publisher<T> {\n" +
+ " abstract T block();\n" +
+ " abstract <R> Flux<R> flatMap(Function<? super T, ? extends Publisher<? extends R>> f);\n" +
+ "}\n" +
+ "interface Publisher<T> {}\n" +
+ "interface CloudFoundryOperations {\n" +
+ " Flux<SpaceSummary> list();\n" +
+ "}\n" +
+ "class SpaceSummary { }\n" +
+ "class OrganizationSummary {\n" +
+ " String getId() { return \"\"; }\n" +
+ "}\n" +
+ "interface CFSpace {}\n" +
+ "public class DefaultClientRequestsV2 {\n" +
+ "\n" +
+ " private Flux<OrganizationSummary> _orglist;\n" +
+ "\n" +
+ " private Mono<CloudFoundryOperations> operationsFor(OrganizationSummary org) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " public List<CFSpace> getSpaces() {\n" +
+ " return get(\n" +
+ " _orglist\n" +
+ " .flatMap((OrganizationSummary org) -> {\n" +
+ " return operationsFor(org).flatMap((operations) ->\n" +
+ " operations\n" +
+ " .list()\n" +
+ " .map((space) -> wrap(org, space)\n" +
+ " )\n" +
+ " );\n" +
+ " })\n" +
+ " .collectList()\n" +
+ " );\n" +
+ " }\n" +
+ " public static <T> T get(Mono<T> mono) {\n" +
+ " return mono.block();\n" +
+ " }\n" +
+ " public static CFSpace wrap(OrganizationSummary org, SpaceSummary space) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
});
}
@@ -7213,37 +7213,37 @@ public void testBug502568() {
runConformTest(
new String[] {
"Test.java",
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "import java.util.Optional;\n" +
- "import java.util.UUID;\n" +
- "import java.util.concurrent.CompletableFuture;\n" +
- "import java.util.function.Function;\n" +
- "\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " \n" +
- " public CompletableFuture<UUID> test() {\n" +
- " UUID id = UUID.randomUUID();\n" +
- " \n" +
- " return transaction(conn -> {\n" +
- " return query().thenCompose(rs1 -> {\n" +
- " return query().thenCompose(rs2 -> {\n" +
- " return query();\n" +
- " });\n" +
- " });\n" +
- " })\n" +
- " .thenApply(rs -> id);\n" +
- " }\n" +
- " \n" +
- " public <T> CompletableFuture<T> transaction(Function<String,CompletableFuture<T>> param1) {\n" +
- " return param1.apply(\"test\");\n" +
- " }\n" +
- " \n" +
- " public CompletableFuture<Optional<List<String>>> query() {\n" +
- " return CompletableFuture.completedFuture(Optional.of(new ArrayList<String>()));\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "import java.util.Optional;\n" +
+ "import java.util.UUID;\n" +
+ "import java.util.concurrent.CompletableFuture;\n" +
+ "import java.util.function.Function;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
+ " \n" +
+ " public CompletableFuture<UUID> test() {\n" +
+ " UUID id = UUID.randomUUID();\n" +
+ " \n" +
+ " return transaction(conn -> {\n" +
+ " return query().thenCompose(rs1 -> {\n" +
+ " return query().thenCompose(rs2 -> {\n" +
+ " return query();\n" +
+ " });\n" +
+ " });\n" +
+ " })\n" +
+ " .thenApply(rs -> id);\n" +
+ " }\n" +
+ " \n" +
+ " public <T> CompletableFuture<T> transaction(Function<String,CompletableFuture<T>> param1) {\n" +
+ " return param1.apply(\"test\");\n" +
+ " }\n" +
+ " \n" +
+ " public CompletableFuture<Optional<List<String>>> query() {\n" +
+ " return CompletableFuture.completedFuture(Optional.of(new ArrayList<String>()));\n" +
+ " }\n" +
"}\n"
});
}
@@ -7251,73 +7251,73 @@ public void testBug499725() {
runConformTest(
new String[] {
"Try22.java",
- "import java.rmi.RemoteException;\n" +
- "import java.util.Arrays;\n" +
- "import java.util.Collection;\n" +
- "import java.util.Collections;\n" +
- "import java.util.List;\n" +
- "import java.util.function.Function;\n" +
- "import java.util.stream.Collectors;\n" +
- "\n" +
- "\n" +
- "public class Try22 {\n" +
- " public static class RemoteExceptionWrapper {\n" +
- " @FunctionalInterface\n" +
- " public static interface FunctionRemote<T, R> {\n" +
- " R apply(T t) throws RemoteException;\n" +
- " }\n" +
- " \n" +
- " public static <T, R> Function<T, R> wrapFunction(FunctionRemote<T, R> f) {\n" +
- " return x -> {\n" +
- " try {\n" +
- " return f.apply(x);\n" +
- " }\n" +
- " catch(RemoteException e) {\n" +
- " throw new RuntimeException(e);\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " }\n" +
- "\n" +
- "\n" +
- " private static class ThrowingThingy {\n" +
- " public Collection<String> listStuff(String in) throws RemoteException {\n" +
- " return Collections.emptyList();\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " List<String> stagedNodes = Arrays.asList(\"a\", \"b\", \"c\");\n" +
- " ThrowingThingy remoteThing = new ThrowingThingy(); // simulation of a rmi remote, hence the exceptio\n" +
- " \n" +
- " List<String> resultingStuff = stagedNodes.stream()\n" +
- " .flatMap(RemoteExceptionWrapper.wrapFunction(\n" +
- " node -> remoteThing.listStuff(node) // HERE\n" +
- " .stream()\n" +
- " .map(sub -> node + \"/\" + sub)))\n" +
- " .collect(Collectors.toList());\n" +
- " \n" +
- " System.out.println(resultingStuff);\n" +
- " }\n" +
+ "import java.rmi.RemoteException;\n" +
+ "import java.util.Arrays;\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.Collections;\n" +
+ "import java.util.List;\n" +
+ "import java.util.function.Function;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "\n" +
+ "\n" +
+ "public class Try22 {\n" +
+ " public static class RemoteExceptionWrapper {\n" +
+ " @FunctionalInterface\n" +
+ " public static interface FunctionRemote<T, R> {\n" +
+ " R apply(T t) throws RemoteException;\n" +
+ " }\n" +
+ " \n" +
+ " public static <T, R> Function<T, R> wrapFunction(FunctionRemote<T, R> f) {\n" +
+ " return x -> {\n" +
+ " try {\n" +
+ " return f.apply(x);\n" +
+ " }\n" +
+ " catch(RemoteException e) {\n" +
+ " throw new RuntimeException(e);\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ "\n" +
+ " private static class ThrowingThingy {\n" +
+ " public Collection<String> listStuff(String in) throws RemoteException {\n" +
+ " return Collections.emptyList();\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " List<String> stagedNodes = Arrays.asList(\"a\", \"b\", \"c\");\n" +
+ " ThrowingThingy remoteThing = new ThrowingThingy(); // simulation of a rmi remote, hence the exceptio\n" +
+ " \n" +
+ " List<String> resultingStuff = stagedNodes.stream()\n" +
+ " .flatMap(RemoteExceptionWrapper.wrapFunction(\n" +
+ " node -> remoteThing.listStuff(node) // HERE\n" +
+ " .stream()\n" +
+ " .map(sub -> node + \"/\" + sub)))\n" +
+ " .collect(Collectors.toList());\n" +
+ " \n" +
+ " System.out.println(resultingStuff);\n" +
+ " }\n" +
"}\n"
});
}
-// Redundant type argument specification error for anonymous types should not occur below source level 9
+// Redundant type argument specification error for anonymous types should not occur below source level 9
public void testBug488663() {
Map<String, String> options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.ERROR);
String[] testFiles = new String[] {
"C.java",
- "import java.util.Comparator;\n" +
- "public class C {\n" +
- " Comparator<String> comparator = new Comparator<String>() { //\n" +
- " @Override\n" +
- " public int compare(String o1, String o2) {\n" +
- " return 0;\n" +
- " }\n" +
- " };\n" +
+ "import java.util.Comparator;\n" +
+ "public class C {\n" +
+ " Comparator<String> comparator = new Comparator<String>() { //\n" +
+ " @Override\n" +
+ " public int compare(String o1, String o2) {\n" +
+ " return 0;\n" +
+ " }\n" +
+ " };\n" +
"}"
};
if (this.complianceLevel < ClassFileConstants.JDK9) {
@@ -7326,12 +7326,12 @@ public void testBug488663() {
"", options);
} else {
this.runNegativeTest(
- testFiles,
- "----------\n" +
- "1. ERROR in C.java (at line 3)\n" +
- " Comparator<String> comparator = new Comparator<String>() { //\n" +
- " ^^^^^^^^^^\n" +
- "Redundant specification of type arguments <String>\n" +
+ testFiles,
+ "----------\n" +
+ "1. ERROR in C.java (at line 3)\n" +
+ " Comparator<String> comparator = new Comparator<String>() { //\n" +
+ " ^^^^^^^^^^\n" +
+ "Redundant specification of type arguments <String>\n" +
"----------\n",
null, true, options);
}
@@ -7341,55 +7341,55 @@ public void testBug499725a() {
runConformTest(
new String[] {
"Try22.java",
- "import java.rmi.RemoteException;\n" +
- "import java.util.Arrays;\n" +
- "import java.util.Collection;\n" +
- "import java.util.Collections;\n" +
- "import java.util.List;\n" +
- "import java.util.function.Function;\n" +
- "import java.util.stream.Collectors;\n" +
- "\n" +
- "\n" +
- "public class Try22 {\n" +
- " public static class RemoteExceptionWrapper {\n" +
- " @FunctionalInterface\n" +
- " public static interface FunctionRemote<T, R> {\n" +
- " R apply(T t) throws RemoteException;\n" +
- " }\n" +
- " \n" +
- " public static <T, R> Function<T, R> wrapFunction(FunctionRemote<T, R> f) {\n" +
- " return x -> {\n" +
- " try {\n" +
- " return f.apply(x);\n" +
- " }\n" +
- " catch(RemoteException e) {\n" +
- " throw new RuntimeException(e);\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " }\n" +
- "\n" +
- "\n" +
- " private static class ThrowingThingy {\n" +
- " public Collection<String> listStuff(String in) throws RemoteException {\n" +
- " return Collections.emptyList();\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " List<String> stagedNodes = Arrays.asList(\"a\", \"b\", \"c\");\n" +
- " ThrowingThingy remoteThing = new ThrowingThingy(); // simulation of a rmi remote, hence the exceptio\n" +
- " \n" +
- " List<String> resultingStuff = stagedNodes.stream()\n" +
- " .flatMap(RemoteExceptionWrapper.wrapFunction(\n" +
- " (String node) -> remoteThing.listStuff(node) // HERE\n" +
- " .stream()\n" +
- " .map(sub -> node + \"/\" + sub)))\n" +
- " .collect(Collectors.toList());\n" +
- " \n" +
- " System.out.println(resultingStuff);\n" +
- " }\n" +
+ "import java.rmi.RemoteException;\n" +
+ "import java.util.Arrays;\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.Collections;\n" +
+ "import java.util.List;\n" +
+ "import java.util.function.Function;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "\n" +
+ "\n" +
+ "public class Try22 {\n" +
+ " public static class RemoteExceptionWrapper {\n" +
+ " @FunctionalInterface\n" +
+ " public static interface FunctionRemote<T, R> {\n" +
+ " R apply(T t) throws RemoteException;\n" +
+ " }\n" +
+ " \n" +
+ " public static <T, R> Function<T, R> wrapFunction(FunctionRemote<T, R> f) {\n" +
+ " return x -> {\n" +
+ " try {\n" +
+ " return f.apply(x);\n" +
+ " }\n" +
+ " catch(RemoteException e) {\n" +
+ " throw new RuntimeException(e);\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ "\n" +
+ " private static class ThrowingThingy {\n" +
+ " public Collection<String> listStuff(String in) throws RemoteException {\n" +
+ " return Collections.emptyList();\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " List<String> stagedNodes = Arrays.asList(\"a\", \"b\", \"c\");\n" +
+ " ThrowingThingy remoteThing = new ThrowingThingy(); // simulation of a rmi remote, hence the exceptio\n" +
+ " \n" +
+ " List<String> resultingStuff = stagedNodes.stream()\n" +
+ " .flatMap(RemoteExceptionWrapper.wrapFunction(\n" +
+ " (String node) -> remoteThing.listStuff(node) // HERE\n" +
+ " .stream()\n" +
+ " .map(sub -> node + \"/\" + sub)))\n" +
+ " .collect(Collectors.toList());\n" +
+ " \n" +
+ " System.out.println(resultingStuff);\n" +
+ " }\n" +
"}\n"
});
}
@@ -7397,16 +7397,16 @@ public void testBug508834() {
runConformTest(
new String[] {
"FlatMapper.java",
- "import java.util.stream.Stream;\n" +
- "public class FlatMapper {\n" +
- "\n" +
- " private String[] stuff;\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " Stream.of(new FlatMapper[]{})\n" +
- " .flatMap(fl -> Stream.of(fl.stuff)) //\n" +
- " .filter(st -> !st.isEmpty()); //\n" +
- " }\n" +
+ "import java.util.stream.Stream;\n" +
+ "public class FlatMapper {\n" +
+ "\n" +
+ " private String[] stuff;\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " Stream.of(new FlatMapper[]{})\n" +
+ " .flatMap(fl -> Stream.of(fl.stuff)) //\n" +
+ " .filter(st -> !st.isEmpty()); //\n" +
+ " }\n" +
"}\n"
},
"");
@@ -7415,48 +7415,48 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"test/TypeB.java",
- "package test;\n" +
- "public class TypeB {\n" +
- " public String getText() {\n" +
- " return \"\";\n" +
- " }\n" +
- "\n" +
+ "package test;\n" +
+ "public class TypeB {\n" +
+ " public String getText() {\n" +
+ " return \"\";\n" +
+ " }\n" +
+ "\n" +
"}\n",
"test/TypeA.java",
- "package test;\n" +
- "public class TypeA {\n" +
- " public TypeB[] getArrayOfB() {\n" +
- " return null;\n" +
- " }\n" +
- " public TypeB getB() {\n" +
- " return null;\n" +
- " }\n" +
+ "package test;\n" +
+ "public class TypeA {\n" +
+ " public TypeB[] getArrayOfB() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public TypeB getB() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n",
"test/Test1.java",
- "package test;\n" +
- "import java.util.stream.Stream;\n" +
- "public class Test1 {\n" +
- " private TypeA[] arrayOfType() {\n" +
- " return null;\n" +
- " }\n" +
- " private String[] test1() {\n" +
- " return Stream\n" +
- " .of(arrayOfType())\n" +
- " .filter(a -> a.getB() != null)\n" +
- " .flatMap(a -> Stream.of(a.getB()))\n" +
- " .map(TypeB::getText)\n" +
- " .sorted()\n" +
- " .toArray(String[]::new);\n" +
- " }\n" +
- " private String[] test2() {\n" +
- " return Stream\n" +
- " .of(arrayOfType())\n" +
- " .filter(a -> a.getArrayOfB() != null)\n" +
- " .flatMap(a -> Stream.of(a.getArrayOfB()))\n" +
- " .map(TypeB::getText)\n" +
- " .sorted()\n" +
- " .toArray(String[]::new);\n" +
- " }\n" +
+ "package test;\n" +
+ "import java.util.stream.Stream;\n" +
+ "public class Test1 {\n" +
+ " private TypeA[] arrayOfType() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " private String[] test1() {\n" +
+ " return Stream\n" +
+ " .of(arrayOfType())\n" +
+ " .filter(a -> a.getB() != null)\n" +
+ " .flatMap(a -> Stream.of(a.getB()))\n" +
+ " .map(TypeB::getText)\n" +
+ " .sorted()\n" +
+ " .toArray(String[]::new);\n" +
+ " }\n" +
+ " private String[] test2() {\n" +
+ " return Stream\n" +
+ " .of(arrayOfType())\n" +
+ " .filter(a -> a.getArrayOfB() != null)\n" +
+ " .flatMap(a -> Stream.of(a.getArrayOfB()))\n" +
+ " .map(TypeB::getText)\n" +
+ " .sorted()\n" +
+ " .toArray(String[]::new);\n" +
+ " }\n" +
"}\n"
},
"");
@@ -7465,116 +7465,116 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"NfaUtil.java",
- "/*******************************************************************************\n" +
- " * Copyright (c) 2011 itemis AG (http://www.itemis.eu) and others.\n" +
- " * All rights reserved. This program and the accompanying materials\n" +
- " * are made available under the terms of the Eclipse Public License v1.0\n" +
- " * which accompanies this distribution, and is available at\n" +
- " * http://www.eclipse.org/legal/epl-v10.html\n" +
- " *******************************************************************************/\n" +
- "import java.util.*;\n" +
- "\n" +
- "class Lists {\n" +
- " public static <E> LinkedList<E> newLinkedList() {\n" +
- " return new LinkedList<E>();\n" +
- " }\n" +
- "\n" +
- " public static <E> LinkedList<E> newLinkedList(Iterable<? extends E> elements) {\n" +
- " return newLinkedList();\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Maps {\n" +
- " public static <K, V> HashMap<K, V> newHashMap() {\n" +
- " return new HashMap<K, V>();\n" +
- " }\n" +
- "\n" +
- " public static <K, V> LinkedHashMap<K, V> newLinkedHashMap() {\n" +
- " return new LinkedHashMap<K, V>();\n" +
- " }\n" +
- "\n" +
- " public static <K, V> LinkedHashMap<K, V> newLinkedHashMap(Map<? extends K, ? extends V> map) {\n" +
- " return new LinkedHashMap<K, V>(map);\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Sets {\n" +
- " public static <E> HashSet<E> newHashSet(Iterable<? extends E> elements) {\n" +
- " return new HashSet<E>();\n" +
- " }\n" +
- "\n" +
- " public static <E> HashSet<E> newHashSet(E... elements) {\n" +
- " HashSet<E> set = new HashSet<>();\n" +
- " Collections.addAll(set, elements);\n" +
- " return set;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "interface IAcceptor<T> {\n" +
- " void accept(T t);\n" +
- "}\n" +
- "\n" +
- "interface Nfa<STATE> extends DirectedGraph<STATE> {\n" +
- " STATE getStop();\n" +
- " STATE getStart();\n" +
- "}\n" +
- "interface DirectedGraph<NODE> {\n" +
- " Iterable<NODE> getFollowers(NODE state);\n" +
- "}\n" +
- "\n" +
- "/**\n" +
- " * @author Moritz Eysholdt - Initial contribution and API\n" +
- " */\n" +
- "public class NfaUtil {\n" +
- "\n" +
- " public <S> Map<S, Set<S>> findCycles(Nfa<S> nfa) {\n" +
- " Map<S, Set<S>> cycles = Maps.newLinkedHashMap();\n" +
- " findCycles(nfa, nfa.getStart(), (List<S> t) -> {\n" +
- " Set<S> cycle = Sets.newHashSet(t);\n" +
- " for (S cycleNode : t) {\n" +
- " // We have two cycles that are connected via at least\n" +
- " // one node. Treat them as one cycle.\n" +
- " Set<S> existingCycle = cycles.get(cycleNode);\n" +
- " if (existingCycle != null) {\n" +
- " cycle.addAll(existingCycle);\n" +
- " }\n" +
- " }\n" +
- " for (S n : cycle) {\n" +
- " cycles.put(n, cycle);\n" +
- " }\n" +
- " }, Maps.newHashMap(), Lists.newLinkedList());\n" +
- " return cycles;\n" +
- " }\n" +
- "\n" +
- " public <S> void findCycles(Nfa<S> nfa, IAcceptor<List<S>> cycleAcceptor) {\n" +
- " findCycles(nfa, nfa.getStart(), cycleAcceptor, Maps.newHashMap(), Lists.newLinkedList());\n" +
- " }\n" +
- "\n" +
- " private static final int DFS_VISITED = 1;\n" +
- " private static final int DFS_ON_STACK = 2;\n" +
- "\n" +
- " protected <S> void findCycles(Nfa<S> nfa, S node, IAcceptor<List<S>> cycleAcceptor, Map<S, Integer> dfsMark,\n" +
- " LinkedList<S> dfsStack) {\n" +
- " dfsStack.push(node);\n" +
- " dfsMark.put(node, DFS_ON_STACK);\n" +
- " for (S follower : nfa.getFollowers(node)) {\n" +
- " Integer followerMark = dfsMark.get(follower);\n" +
- " if (followerMark == null) {\n" +
- " findCycles(nfa, follower, cycleAcceptor, dfsMark, dfsStack);\n" +
- " } else if (followerMark == DFS_ON_STACK) {\n" +
- " LinkedList<S> cycle = Lists.newLinkedList();\n" +
- " Iterator<S> stackIter = dfsStack.iterator();\n" +
- " S cycleNode;\n" +
- " do {\n" +
- " cycleNode = stackIter.next();\n" +
- " cycle.addFirst(cycleNode);\n" +
- " } while (cycleNode != follower && stackIter.hasNext());\n" +
- " cycleAcceptor.accept(cycle);\n" +
- " }\n" +
- " }\n" +
- " dfsStack.pop();\n" +
- " dfsMark.put(node, DFS_VISITED);\n" +
- " }\n" +
+ "/*******************************************************************************\n" +
+ " * Copyright (c) 2011 itemis AG (http://www.itemis.eu) and others.\n" +
+ " * All rights reserved. This program and the accompanying materials\n" +
+ " * are made available under the terms of the Eclipse Public License v1.0\n" +
+ " * which accompanies this distribution, and is available at\n" +
+ " * http://www.eclipse.org/legal/epl-v10.html\n" +
+ " *******************************************************************************/\n" +
+ "import java.util.*;\n" +
+ "\n" +
+ "class Lists {\n" +
+ " public static <E> LinkedList<E> newLinkedList() {\n" +
+ " return new LinkedList<E>();\n" +
+ " }\n" +
+ "\n" +
+ " public static <E> LinkedList<E> newLinkedList(Iterable<? extends E> elements) {\n" +
+ " return newLinkedList();\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class Maps {\n" +
+ " public static <K, V> HashMap<K, V> newHashMap() {\n" +
+ " return new HashMap<K, V>();\n" +
+ " }\n" +
+ "\n" +
+ " public static <K, V> LinkedHashMap<K, V> newLinkedHashMap() {\n" +
+ " return new LinkedHashMap<K, V>();\n" +
+ " }\n" +
+ "\n" +
+ " public static <K, V> LinkedHashMap<K, V> newLinkedHashMap(Map<? extends K, ? extends V> map) {\n" +
+ " return new LinkedHashMap<K, V>(map);\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class Sets {\n" +
+ " public static <E> HashSet<E> newHashSet(Iterable<? extends E> elements) {\n" +
+ " return new HashSet<E>();\n" +
+ " }\n" +
+ "\n" +
+ " public static <E> HashSet<E> newHashSet(E... elements) {\n" +
+ " HashSet<E> set = new HashSet<>();\n" +
+ " Collections.addAll(set, elements);\n" +
+ " return set;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "interface IAcceptor<T> {\n" +
+ " void accept(T t);\n" +
+ "}\n" +
+ "\n" +
+ "interface Nfa<STATE> extends DirectedGraph<STATE> {\n" +
+ " STATE getStop();\n" +
+ " STATE getStart();\n" +
+ "}\n" +
+ "interface DirectedGraph<NODE> {\n" +
+ " Iterable<NODE> getFollowers(NODE state);\n" +
+ "}\n" +
+ "\n" +
+ "/**\n" +
+ " * @author Moritz Eysholdt - Initial contribution and API\n" +
+ " */\n" +
+ "public class NfaUtil {\n" +
+ "\n" +
+ " public <S> Map<S, Set<S>> findCycles(Nfa<S> nfa) {\n" +
+ " Map<S, Set<S>> cycles = Maps.newLinkedHashMap();\n" +
+ " findCycles(nfa, nfa.getStart(), (List<S> t) -> {\n" +
+ " Set<S> cycle = Sets.newHashSet(t);\n" +
+ " for (S cycleNode : t) {\n" +
+ " // We have two cycles that are connected via at least\n" +
+ " // one node. Treat them as one cycle.\n" +
+ " Set<S> existingCycle = cycles.get(cycleNode);\n" +
+ " if (existingCycle != null) {\n" +
+ " cycle.addAll(existingCycle);\n" +
+ " }\n" +
+ " }\n" +
+ " for (S n : cycle) {\n" +
+ " cycles.put(n, cycle);\n" +
+ " }\n" +
+ " }, Maps.newHashMap(), Lists.newLinkedList());\n" +
+ " return cycles;\n" +
+ " }\n" +
+ "\n" +
+ " public <S> void findCycles(Nfa<S> nfa, IAcceptor<List<S>> cycleAcceptor) {\n" +
+ " findCycles(nfa, nfa.getStart(), cycleAcceptor, Maps.newHashMap(), Lists.newLinkedList());\n" +
+ " }\n" +
+ "\n" +
+ " private static final int DFS_VISITED = 1;\n" +
+ " private static final int DFS_ON_STACK = 2;\n" +
+ "\n" +
+ " protected <S> void findCycles(Nfa<S> nfa, S node, IAcceptor<List<S>> cycleAcceptor, Map<S, Integer> dfsMark,\n" +
+ " LinkedList<S> dfsStack) {\n" +
+ " dfsStack.push(node);\n" +
+ " dfsMark.put(node, DFS_ON_STACK);\n" +
+ " for (S follower : nfa.getFollowers(node)) {\n" +
+ " Integer followerMark = dfsMark.get(follower);\n" +
+ " if (followerMark == null) {\n" +
+ " findCycles(nfa, follower, cycleAcceptor, dfsMark, dfsStack);\n" +
+ " } else if (followerMark == DFS_ON_STACK) {\n" +
+ " LinkedList<S> cycle = Lists.newLinkedList();\n" +
+ " Iterator<S> stackIter = dfsStack.iterator();\n" +
+ " S cycleNode;\n" +
+ " do {\n" +
+ " cycleNode = stackIter.next();\n" +
+ " cycle.addFirst(cycleNode);\n" +
+ " } while (cycleNode != follower && stackIter.hasNext());\n" +
+ " cycleAcceptor.accept(cycle);\n" +
+ " }\n" +
+ " }\n" +
+ " dfsStack.pop();\n" +
+ " dfsMark.put(node, DFS_VISITED);\n" +
+ " }\n" +
"}\n"
});
}
@@ -7582,37 +7582,37 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"CompilerBugUncheckedCast.java",
- "public class CompilerBugUncheckedCast {\n" +
- " public static void main(String[] args) {\n" +
- " Create(true);\n" +
- " Create(false);\n" +
- " }\n" +
- " public interface Base {\n" +
- " default String def() { return \"Base\"; }\n" +
- " }\n" +
- " public interface Intermediate extends Base {\n" +
- " @Override default String def() { return \"Intermediate\"; }\n" +
- " }\n" +
- " public interface Derived extends Intermediate { }\n" +
- " public static class MyObject implements Base { }\n" +
- " public static final class OldObject extends MyObject implements Derived { }\n" +
- " public static final class NewObject extends MyObject implements Derived { }\n" +
- " public static <OBJECT extends MyObject & Derived> void Make(OBJECT o) { }\n" +
- " public static MyObject Create(boolean old) {\n" +
- " MyObject f;\n" +
- " if (old) {\n" +
- " f = new OldObject();\n" +
- " } else {\n" +
- " f = new NewObject();\n" +
- " }\n" +
- " Make(uncheckedCast(f));\n" +
- " System.out.println(old);\n" +
- " return f;\n" +
- " }\n" +
- " @SuppressWarnings(\"unchecked\")\n" +
- " private static <T extends MyObject & Derived> T uncheckedCast(MyObject f) {\n" +
- " return (T) f;\n" +
- " }\n" +
+ "public class CompilerBugUncheckedCast {\n" +
+ " public static void main(String[] args) {\n" +
+ " Create(true);\n" +
+ " Create(false);\n" +
+ " }\n" +
+ " public interface Base {\n" +
+ " default String def() { return \"Base\"; }\n" +
+ " }\n" +
+ " public interface Intermediate extends Base {\n" +
+ " @Override default String def() { return \"Intermediate\"; }\n" +
+ " }\n" +
+ " public interface Derived extends Intermediate { }\n" +
+ " public static class MyObject implements Base { }\n" +
+ " public static final class OldObject extends MyObject implements Derived { }\n" +
+ " public static final class NewObject extends MyObject implements Derived { }\n" +
+ " public static <OBJECT extends MyObject & Derived> void Make(OBJECT o) { }\n" +
+ " public static MyObject Create(boolean old) {\n" +
+ " MyObject f;\n" +
+ " if (old) {\n" +
+ " f = new OldObject();\n" +
+ " } else {\n" +
+ " f = new NewObject();\n" +
+ " }\n" +
+ " Make(uncheckedCast(f));\n" +
+ " System.out.println(old);\n" +
+ " return f;\n" +
+ " }\n" +
+ " @SuppressWarnings(\"unchecked\")\n" +
+ " private static <T extends MyObject & Derived> T uncheckedCast(MyObject f) {\n" +
+ " return (T) f;\n" +
+ " }\n" +
"}"
},
"true\n" +
@@ -7622,13 +7622,13 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"BrokenTypeInference.java",
- "import java.util.Optional;\n" +
- "import java.util.stream.Stream;\n" +
- "\n" +
- "public class BrokenTypeInference {\n" +
- " public static void main(String[] args) {\n" +
- " Optional.of(\"42,43\").map(s -> Stream.of(s.split(\",\")));\n" +
- " }\n" +
+ "import java.util.Optional;\n" +
+ "import java.util.stream.Stream;\n" +
+ "\n" +
+ "public class BrokenTypeInference {\n" +
+ " public static void main(String[] args) {\n" +
+ " Optional.of(\"42,43\").map(s -> Stream.of(s.split(\",\")));\n" +
+ " }\n" +
"}\n"
});
}
@@ -7636,21 +7636,21 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"BrokenTypeInference.java",
- "import java.util.List;\n" +
- "import java.util.Optional;\n" +
- "\n" +
- "public class BrokenTypeInference {\n" +
- " public static void main(String[] args) {\n" +
- " Optional.of(\"42,43\").map(s -> x(s.split(\",\")));\n" +
- " }\n" +
- "\n" +
- " private static <X> List<X> x(X ... xs) {\n" +
- " return java.util.Collections.emptyList();\n" +
- " }\n" +
- "\n" +
- " private static <X> List<X> x(X x) {\n" +
- " return java.util.Collections.emptyList();\n" +
- " }\n" +
+ "import java.util.List;\n" +
+ "import java.util.Optional;\n" +
+ "\n" +
+ "public class BrokenTypeInference {\n" +
+ " public static void main(String[] args) {\n" +
+ " Optional.of(\"42,43\").map(s -> x(s.split(\",\")));\n" +
+ " }\n" +
+ "\n" +
+ " private static <X> List<X> x(X ... xs) {\n" +
+ " return java.util.Collections.emptyList();\n" +
+ " }\n" +
+ "\n" +
+ " private static <X> List<X> x(X x) {\n" +
+ " return java.util.Collections.emptyList();\n" +
+ " }\n" +
"}\n"
});
}
@@ -7658,48 +7658,48 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"testgenerics/TestGenerics.java",
- "package testgenerics;\n" +
- "\n" +
- "import java.time.Duration;\n" +
- "import java.util.function.Function;\n" +
- "import java.util.function.Supplier;\n" +
- "\n" +
- "interface Publisher<T> {}\n" +
- "\n" +
- "abstract class Mono<T> implements Publisher<T> {\n" +
- " public static <T> Mono<T> just(T data) { return null; }\n" +
- " public static <T> Mono<T> empty() { return null; }\n" +
- " public final <R> Mono<R> then(Function<? super T, ? extends Mono<? extends R>> transformer) {\n" +
- " return null;\n" +
- " }\n" +
- " public T block() { return null; }\n" +
- " public final T block(Duration timeout) { return null; }\n" +
- "}\n" +
- "class Info {\n" +
- " public String getApplicationSshEndpoint() { return null; }\n" +
- "}\n" +
- "class SshHost {\n" +
- " public SshHost(String host, int port, String fingerPrint) { }\n" +
- "}\n" +
- "\n" +
- "public class TestGenerics {\n" +
- "\n" +
- " private Mono<Info> info = Mono.just(new Info());\n" +
- "\n" +
- " public static <T> T ru_get(Mono<T> mono) throws Exception {\n" +
- " return mono.block();\n" +
- " }\n" +
- "\n" +
- " public SshHost getSshHost() throws Exception {\n" +
- " return ru_get(\n" +
- " info.then((i) -> {\n" +
- " String host = i.getApplicationSshEndpoint();\n" +
- " if (host!=null) {\n" +
- " return Mono.just(new SshHost(host, 0, host));\n" +
- " }\n" +
- " return Mono.empty();\n" +
- " })\n" +
- " );\n" +
+ "package testgenerics;\n" +
+ "\n" +
+ "import java.time.Duration;\n" +
+ "import java.util.function.Function;\n" +
+ "import java.util.function.Supplier;\n" +
+ "\n" +
+ "interface Publisher<T> {}\n" +
+ "\n" +
+ "abstract class Mono<T> implements Publisher<T> {\n" +
+ " public static <T> Mono<T> just(T data) { return null; }\n" +
+ " public static <T> Mono<T> empty() { return null; }\n" +
+ " public final <R> Mono<R> then(Function<? super T, ? extends Mono<? extends R>> transformer) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public T block() { return null; }\n" +
+ " public final T block(Duration timeout) { return null; }\n" +
+ "}\n" +
+ "class Info {\n" +
+ " public String getApplicationSshEndpoint() { return null; }\n" +
+ "}\n" +
+ "class SshHost {\n" +
+ " public SshHost(String host, int port, String fingerPrint) { }\n" +
+ "}\n" +
+ "\n" +
+ "public class TestGenerics {\n" +
+ "\n" +
+ " private Mono<Info> info = Mono.just(new Info());\n" +
+ "\n" +
+ " public static <T> T ru_get(Mono<T> mono) throws Exception {\n" +
+ " return mono.block();\n" +
+ " }\n" +
+ "\n" +
+ " public SshHost getSshHost() throws Exception {\n" +
+ " return ru_get(\n" +
+ " info.then((i) -> {\n" +
+ " String host = i.getApplicationSshEndpoint();\n" +
+ " if (host!=null) {\n" +
+ " return Mono.just(new SshHost(host, 0, host));\n" +
+ " }\n" +
+ " return Mono.empty();\n" +
+ " })\n" +
+ " );\n" +
" }\n" +
"}\n"
});
@@ -7708,55 +7708,55 @@ public void testBug508834_comment0() {
runNegativeTest(
new String[] {
"Test.java",
- "import java.util.stream.Stream;\n" +
- "\n" +
- "public class Test {\n" +
- " public static <T> Field<T> coalesce(T value, T... values) {\n" +
- " return coalesce(field(value), fields(values));\n" +
- " }\n" +
- " public static <T> Field<T> coalesce(Field<T> field, T value) {\n" +
- " return coalesce(field, field(value));\n" +
- " }\n" +
- "\n" +
- " public static <T> Field<T> coalesce(Field<T> field, Field<?>... fields) {\n" +
- " // irrelevant\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " static <T> Field<T> field(T value) {\n" +
- " return new Field<T>(value);\n" +
- " }\n" +
- "\n" +
- " static <T> Field<T>[] fields(T... values) {\n" +
- " return Stream.of(values).map(Test::field).toArray(Field[]::new);\n" +
- " }\n" +
- "\n" +
- " static class Field<T> {\n" +
- " public Field(T t) {\n" +
- " }\n" +
- " }\n" +
+ "import java.util.stream.Stream;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " public static <T> Field<T> coalesce(T value, T... values) {\n" +
+ " return coalesce(field(value), fields(values));\n" +
+ " }\n" +
+ " public static <T> Field<T> coalesce(Field<T> field, T value) {\n" +
+ " return coalesce(field, field(value));\n" +
+ " }\n" +
+ "\n" +
+ " public static <T> Field<T> coalesce(Field<T> field, Field<?>... fields) {\n" +
+ " // irrelevant\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " static <T> Field<T> field(T value) {\n" +
+ " return new Field<T>(value);\n" +
+ " }\n" +
+ "\n" +
+ " static <T> Field<T>[] fields(T... values) {\n" +
+ " return Stream.of(values).map(Test::field).toArray(Field[]::new);\n" +
+ " }\n" +
+ "\n" +
+ " static class Field<T> {\n" +
+ " public Field(T t) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in Test.java (at line 4)\n" +
- " public static <T> Field<T> coalesce(T value, T... values) {\n" +
- " ^^^^^^\n" +
- "Type safety: Potential heap pollution via varargs parameter values\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 5)\n" +
- " return coalesce(field(value), fields(values));\n" +
- " ^^^^^^^^\n" +
- "The method coalesce(Test.Field<T>, Test.Field<T>[]) is ambiguous for the type Test\n" +
- "----------\n" +
- "3. WARNING in Test.java (at line 20)\n" +
- " static <T> Field<T>[] fields(T... values) {\n" +
- " ^^^^^^\n" +
- "Type safety: Potential heap pollution via varargs parameter values\n" +
- "----------\n" +
- "4. WARNING in Test.java (at line 21)\n" +
- " return Stream.of(values).map(Test::field).toArray(Field[]::new);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Test.Field[] needs unchecked conversion to conform to Test.Field<T>[]\n" +
+ "----------\n" +
+ "1. WARNING in Test.java (at line 4)\n" +
+ " public static <T> Field<T> coalesce(T value, T... values) {\n" +
+ " ^^^^^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter values\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 5)\n" +
+ " return coalesce(field(value), fields(values));\n" +
+ " ^^^^^^^^\n" +
+ "The method coalesce(Test.Field<T>, Test.Field<T>[]) is ambiguous for the type Test\n" +
+ "----------\n" +
+ "3. WARNING in Test.java (at line 20)\n" +
+ " static <T> Field<T>[] fields(T... values) {\n" +
+ " ^^^^^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter values\n" +
+ "----------\n" +
+ "4. WARNING in Test.java (at line 21)\n" +
+ " return Stream.of(values).map(Test::field).toArray(Field[]::new);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Test.Field[] needs unchecked conversion to conform to Test.Field<T>[]\n" +
"----------\n");
}
@@ -7764,58 +7764,58 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"util/ClasspathScanner.java",
- "package util;\n" +
- "\n" +
- "import java.io.*;\n" +
- "import java.lang.reflect.Method;\n" +
- "import java.util.*;\n" +
- "import java.util.stream.Stream;\n" +
- "\n" +
- "class ClassPath {\n" +
+ "package util;\n" +
+ "\n" +
+ "import java.io.*;\n" +
+ "import java.lang.reflect.Method;\n" +
+ "import java.util.*;\n" +
+ "import java.util.stream.Stream;\n" +
+ "\n" +
+ "class ClassPath {\n" +
" public static ClassPath from(ClassLoader classloader) throws IOException {\n" +
- " return new ClassPath();\n" +
- " }\n" +
- " public Set<ClassInfo> getTopLevelClasses() {\n" +
- " return Collections.emptySet();\n" +
- " }\n" +
- "}\n" +
- "class ClassInfo {\n" +
- " public Class<?> load() { return null; }\n" +
- " public String getPackageName() { return \"\"; }\n" +
- "}\n" +
- "\n" +
- "/**\n" +
- " * @see https://blog.jooq.org/2016/04/21/the-parameterless-generic-method-antipattern/\n" +
- " */\n" +
- "public class ClasspathScanner {\n" +
- " /**\n" +
- " * This will produce all the generic, parameterless methods on your class path.\n" +
- " */\n" +
+ " return new ClassPath();\n" +
+ " }\n" +
+ " public Set<ClassInfo> getTopLevelClasses() {\n" +
+ " return Collections.emptySet();\n" +
+ " }\n" +
+ "}\n" +
+ "class ClassInfo {\n" +
+ " public Class<?> load() { return null; }\n" +
+ " public String getPackageName() { return \"\"; }\n" +
+ "}\n" +
+ "\n" +
+ "/**\n" +
+ " * @see https://blog.jooq.org/2016/04/21/the-parameterless-generic-method-antipattern/\n" +
+ " */\n" +
+ "public class ClasspathScanner {\n" +
+ " /**\n" +
+ " * This will produce all the generic, parameterless methods on your class path.\n" +
+ " */\n" +
" public static void main(String[] args) throws Exception {\n" +
- " ClassPath.from(Thread.currentThread().getContextClassLoader())\n" +
- " .getTopLevelClasses()\n" +
- " .stream()\n" +
- " .filter(info -> !info.getPackageName().startsWith(\"akka\") && !info.getPackageName().startsWith(\"scala\") && !info.getPackageName().startsWith(\"java\"))\n" +
- " .flatMap(info -> {\n" +
- " try {\n" +
- " return Stream.of(info.load());\n" +
- " }\n" +
- " catch (Throwable ignore) {\n" +
- " return Stream.empty();\n" +
- " }\n" +
- " }).flatMap(c -> {\n" +
- " try {\n" +
- " return Stream.of(c.getMethods());\n" +
- " }\n" +
- " catch (Throwable ignore) {\n" +
- " return Stream.<Method> of();\n" +
- " }\n" +
- " })\n" +
- " .filter(m -> m.getTypeParameters().length > 0 && m.getParameterCount() == 0)\n" +
- " .sorted(Comparator.comparing(Method::toString))\n" +
- " .map(Method::toGenericString)\n" +
- " .forEach(System.out::println);\n" +
- " }\n" +
+ " ClassPath.from(Thread.currentThread().getContextClassLoader())\n" +
+ " .getTopLevelClasses()\n" +
+ " .stream()\n" +
+ " .filter(info -> !info.getPackageName().startsWith(\"akka\") && !info.getPackageName().startsWith(\"scala\") && !info.getPackageName().startsWith(\"java\"))\n" +
+ " .flatMap(info -> {\n" +
+ " try {\n" +
+ " return Stream.of(info.load());\n" +
+ " }\n" +
+ " catch (Throwable ignore) {\n" +
+ " return Stream.empty();\n" +
+ " }\n" +
+ " }).flatMap(c -> {\n" +
+ " try {\n" +
+ " return Stream.of(c.getMethods());\n" +
+ " }\n" +
+ " catch (Throwable ignore) {\n" +
+ " return Stream.<Method> of();\n" +
+ " }\n" +
+ " })\n" +
+ " .filter(m -> m.getTypeParameters().length > 0 && m.getParameterCount() == 0)\n" +
+ " .sorted(Comparator.comparing(Method::toString))\n" +
+ " .map(Method::toGenericString)\n" +
+ " .forEach(System.out::println);\n" +
+ " }\n" +
"}\n"
});
}
@@ -7824,60 +7824,60 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"Test.java",
- "import java.util.ArrayList;\n" +
- "import java.util.Collections;\n" +
- "import java.util.Comparator;\n" +
- "import java.util.List;\n" +
- "\n" +
- "public class Test {\n" +
- "\n" +
- " public static final class Entity {\n" +
- "\n" +
- " public int getIndex() {\n" +
- " return 1;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- "\n" +
- " final List<Entity> list = new ArrayList<>();\n" +
- " // Eclipse fails to compile the next line with error\n" +
- " // Type mismatch: cannot convert from int to Comparable<? super Comparable<? super U>>\n" +
- " Collections.sort( list , Comparator.comparing( a -> a.getIndex() ) ); \n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.Collections;\n" +
+ "import java.util.Comparator;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " public static final class Entity {\n" +
+ "\n" +
+ " public int getIndex() {\n" +
+ " return 1;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ "\n" +
+ " final List<Entity> list = new ArrayList<>();\n" +
+ " // Eclipse fails to compile the next line with error\n" +
+ " // Type mismatch: cannot convert from int to Comparable<? super Comparable<? super U>>\n" +
+ " Collections.sort( list , Comparator.comparing( a -> a.getIndex() ) ); \n" +
+ " }\n" +
"}"
});
}
-
+
public void testBug511750() {
runConformTest(
new String[] {
"SomeClass.java",
- "import java.util.Collections;\n" +
- "import java.util.Set;\n" +
- "import java.util.stream.Collectors;\n" +
- "\n" +
- "public class SomeClass {\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(foo().iterator().next().getBaz());\n" +
- " }\n" +
- "\n" +
- " public interface Baz {\n" +
- " public String getBaz();\n" +
- " }\n" +
- "\n" +
- " public static Set<Baz> foo() {\n" +
- " Set<String> stringSet = Collections.singleton(\"someString\");\n" +
- " return stringSet.stream().map(s -> new Baz() {\n" +
- "\n" +
- " @Override\n" +
- " public String getBaz() {\n" +
- " return s;\n" +
- " }\n" +
- "\n" +
- " }).collect(Collectors.toSet());\n" +
- " }\n" +
+ "import java.util.Collections;\n" +
+ "import java.util.Set;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "\n" +
+ "public class SomeClass {\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(foo().iterator().next().getBaz());\n" +
+ " }\n" +
+ "\n" +
+ " public interface Baz {\n" +
+ " public String getBaz();\n" +
+ " }\n" +
+ "\n" +
+ " public static Set<Baz> foo() {\n" +
+ " Set<String> stringSet = Collections.singleton(\"someString\");\n" +
+ " return stringSet.stream().map(s -> new Baz() {\n" +
+ "\n" +
+ " @Override\n" +
+ " public String getBaz() {\n" +
+ " return s;\n" +
+ " }\n" +
+ "\n" +
+ " }).collect(Collectors.toSet());\n" +
+ " }\n" +
"}\n"
});
}
@@ -7912,23 +7912,23 @@ public void testBug508834_comment0() {
" }\n" +
"}\n" +
"",
- },
- "----------\n" +
- "1. ERROR in test\\ATestClass.java (at line 11)\n" +
- " f(e -> e.matches(\"\"));\n" +
- " ^^^^^^^\n" +
- "The method matches(Type) from the type ClassWithMethodWithMissingArgType refers to the missing type Type\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in test\\ClassWithMethodWithMissingArgType.java (at line 5)\n" +
- " import missing.Type;\n" +
- " ^^^^^^^\n" +
- "The import missing cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in test\\ClassWithMethodWithMissingArgType.java (at line 8)\n" +
- " public void matches(Type arg) {\n" +
- " ^^^^\n" +
- "Type cannot be resolved to a type\n" +
+ },
+ "----------\n" +
+ "1. ERROR in test\\ATestClass.java (at line 11)\n" +
+ " f(e -> e.matches(\"\"));\n" +
+ " ^^^^^^^\n" +
+ "The method matches(Type) from the type ClassWithMethodWithMissingArgType refers to the missing type Type\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in test\\ClassWithMethodWithMissingArgType.java (at line 5)\n" +
+ " import missing.Type;\n" +
+ " ^^^^^^^\n" +
+ "The import missing cannot be resolved\n" +
+ "----------\n" +
+ "2. ERROR in test\\ClassWithMethodWithMissingArgType.java (at line 8)\n" +
+ " public void matches(Type arg) {\n" +
+ " ^^^^\n" +
+ "Type cannot be resolved to a type\n" +
"----------\n"
);
}
@@ -7941,20 +7941,20 @@ public void testBug508834_comment0() {
"import java.util.function.*;\n" +
"import java.util.concurrent.*;\n" +
"import java.net.URI;\n" +
- "public class ConfigurationServiceLocator {\n" +
- "\n" +
- " private final Map<String, URI> services = new HashMap<>();\n" +
- "\n" +
- " public <T> CompletionStage<Optional<T>> doWithService(String name, Function<URI, CompletionStage<T>> block) {\n" +
- " return Optional.ofNullable(services.get(name))\n" +
- " .map(block.andThen(cs -> cs.thenApply(Optional::ofNullable)))\n" +
- " .orElse(CompletableFuture.completedFuture(Optional.empty()));\n" +
- " }\n" +
- "\n" +
+ "public class ConfigurationServiceLocator {\n" +
+ "\n" +
+ " private final Map<String, URI> services = new HashMap<>();\n" +
+ "\n" +
+ " public <T> CompletionStage<Optional<T>> doWithService(String name, Function<URI, CompletionStage<T>> block) {\n" +
+ " return Optional.ofNullable(services.get(name))\n" +
+ " .map(block.andThen(cs -> cs.thenApply(Optional::ofNullable)))\n" +
+ " .orElse(CompletableFuture.completedFuture(Optional.empty()));\n" +
+ " }\n" +
+ "\n" +
"}\n"
});
}
-
+
public void testBug511252simplified() {
runConformTest(
new String[] {
@@ -7963,14 +7963,14 @@ public void testBug508834_comment0() {
"import java.util.function.*;\n" +
"import java.util.concurrent.*;\n" +
"import java.net.URI;\n" +
- "public class ConfigurationServiceLocator {\n" +
- "\n" +
- " public <T> CompletionStage<Optional<T>> doWithService(Optional<URI> uriopt, Function<URI, CompletionStage<T>> block) {\n" +
- " return uriopt\n" +
- " .map(block.andThen(cs -> cs.thenApply(Optional::ofNullable)))\n" +
- " .orElse(CompletableFuture.completedFuture(Optional.empty()));\n" +
- " }\n" +
- "\n" +
+ "public class ConfigurationServiceLocator {\n" +
+ "\n" +
+ " public <T> CompletionStage<Optional<T>> doWithService(Optional<URI> uriopt, Function<URI, CompletionStage<T>> block) {\n" +
+ " return uriopt\n" +
+ " .map(block.andThen(cs -> cs.thenApply(Optional::ofNullable)))\n" +
+ " .orElse(CompletableFuture.completedFuture(Optional.empty()));\n" +
+ " }\n" +
+ "\n" +
"}\n"
});
}
@@ -7980,37 +7980,37 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"SimpleParser.java",
- "import java.util.function.Function;\n" +
- "\n" +
- "\n" +
- "public interface SimpleParser<T> {\n" +
- "\n" +
- " static class Tuple<A,B> {\n" +
- " }\n" +
- " \n" +
- " /** the type of the functional interface: Parser<T> :: CharSequence -> Tuple<T, CharSequence>> */\n" +
- " abstract Tuple<T, CharSequence> parse(CharSequence cs);\n" +
- " \n" +
- " default <V> SimpleParser<V> andThenBinding(Function<? super T, SimpleParser<V>> f) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " default <W> SimpleParser<W> andThen(SimpleParser<W> p) {\n" +
- " return null;\n" +
- " }\n" +
- " \n" +
- " static <X> SimpleParser<X> output(X v) {\n" +
- " return null;\n" +
- " }\n" +
- " \n" +
- " static SimpleParser<String> space() {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " static <Y> SimpleParser<Y> token(SimpleParser<Y> p) {\n" +
- " return space().andThen(p.andThenBinding(v -> space().andThen(output(v))));\n" +
- " }\n" +
- "\n" +
+ "import java.util.function.Function;\n" +
+ "\n" +
+ "\n" +
+ "public interface SimpleParser<T> {\n" +
+ "\n" +
+ " static class Tuple<A,B> {\n" +
+ " }\n" +
+ " \n" +
+ " /** the type of the functional interface: Parser<T> :: CharSequence -> Tuple<T, CharSequence>> */\n" +
+ " abstract Tuple<T, CharSequence> parse(CharSequence cs);\n" +
+ " \n" +
+ " default <V> SimpleParser<V> andThenBinding(Function<? super T, SimpleParser<V>> f) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " default <W> SimpleParser<W> andThen(SimpleParser<W> p) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " \n" +
+ " static <X> SimpleParser<X> output(X v) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " \n" +
+ " static SimpleParser<String> space() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " static <Y> SimpleParser<Y> token(SimpleParser<Y> p) {\n" +
+ " return space().andThen(p.andThenBinding(v -> space().andThen(output(v))));\n" +
+ " }\n" +
+ "\n" +
"}\n"
});
}
@@ -8062,7 +8062,7 @@ public void testBug508834_comment0() {
" }\n" +
"}\n" +
"",
- }
+ }
);
}
@@ -8099,22 +8099,22 @@ public void testBug508834_comment0() {
" }\n" +
"}\n" +
"",
- },
- "----------\n" +
- "1. WARNING in test\\Test.java (at line 24)\n" +
- " return map(this.properties(), property -> new ComputerProperty(property));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The constructor ComputerProperty(Property) belongs to the raw type ComputerProperty. References to generic type ComputerProperty<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in test\\Test.java (at line 24)\n" +
- " return map(this.properties(), property -> new ComputerProperty(property));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type ComputerProperty needs unchecked conversion to conform to Property<I>\n" +
- "----------\n" +
- "3. WARNING in test\\Test.java (at line 24)\n" +
- " return map(this.properties(), property -> new ComputerProperty(property));\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "ComputerProperty is a raw type. References to generic type ComputerProperty<E> should be parameterized\n" +
+ },
+ "----------\n" +
+ "1. WARNING in test\\Test.java (at line 24)\n" +
+ " return map(this.properties(), property -> new ComputerProperty(property));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The constructor ComputerProperty(Property) belongs to the raw type ComputerProperty. References to generic type ComputerProperty<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in test\\Test.java (at line 24)\n" +
+ " return map(this.properties(), property -> new ComputerProperty(property));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type ComputerProperty needs unchecked conversion to conform to Property<I>\n" +
+ "----------\n" +
+ "3. WARNING in test\\Test.java (at line 24)\n" +
+ " return map(this.properties(), property -> new ComputerProperty(property));\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "ComputerProperty is a raw type. References to generic type ComputerProperty<E> should be parameterized\n" +
"----------\n"
);
}
@@ -8122,18 +8122,18 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"Minimal.java",
- "import java.io.*;\n" +
- "public class Minimal {\n" +
- " public void iCrash() throws IOException {\n" +
- " try (Closeable o = consumes(sneaky()::withVarargs)) {\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private Minimal sneaky() { return this; }\n" +
- "\n" +
- " private void withVarargs(String... test) {}\n" +
- "\n" +
- " private Closeable consumes(Runnable r) { return null; }\n" +
+ "import java.io.*;\n" +
+ "public class Minimal {\n" +
+ " public void iCrash() throws IOException {\n" +
+ " try (Closeable o = consumes(sneaky()::withVarargs)) {\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " private Minimal sneaky() { return this; }\n" +
+ "\n" +
+ " private void withVarargs(String... test) {}\n" +
+ "\n" +
+ " private Closeable consumes(Runnable r) { return null; }\n" +
"}\n"
});
}
@@ -8144,23 +8144,23 @@ public void testBug508834_comment0() {
"X.java",
"import java.util.*;\n" +
"public class X {\n" +
- " public static void main(String[] args) {\n" +
- " List<Integer> integerList = new ArrayList<>();\n" +
- " Set<List<Number>> numbetListSet = Collections.singleton(toWildcardGeneric(integerList));\n" +
- " numbetListSet.iterator().next().add(Float.valueOf(1.0f));\n" +
- " Integer i = integerList.get(0); // Throws ClassCastException\n" +
- " }\n" +
- " \n" +
- " static <T> List<? extends T> toWildcardGeneric(List<T> l) {\n" +
- " return l;\n" +
+ " public static void main(String[] args) {\n" +
+ " List<Integer> integerList = new ArrayList<>();\n" +
+ " Set<List<Number>> numbetListSet = Collections.singleton(toWildcardGeneric(integerList));\n" +
+ " numbetListSet.iterator().next().add(Float.valueOf(1.0f));\n" +
+ " Integer i = integerList.get(0); // Throws ClassCastException\n" +
+ " }\n" +
+ " \n" +
+ " static <T> List<? extends T> toWildcardGeneric(List<T> l) {\n" +
+ " return l;\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " Set<List<Number>> numbetListSet = Collections.singleton(toWildcardGeneric(integerList));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Set<List<Integer>> to Set<List<Number>>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " Set<List<Number>> numbetListSet = Collections.singleton(toWildcardGeneric(integerList));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Set<List<Integer>> to Set<List<Number>>\n" +
"----------\n");
}
@@ -8170,27 +8170,27 @@ public void testBug508834_comment0() {
"X.java",
"import java.util.*;\n" +
"public class X {\n" +
- "public static void main(String[] args) {\n" +
- " List<Integer> integerList = new ArrayList<>();\n" +
- " List<Object> objectList = id(toWildcardGeneric(integerList));\n" +
- " objectList.add(\"Woo?\");\n" +
- " Integer i = integerList.get(0);\n" +
- "}\n" +
- "\n" +
- "static <T> T id(T o) {\n" +
- " return o;\n" +
- "}\n" +
- "\n" +
- "static <T> List<? extends T> toWildcardGeneric(List<T> l) {\n" +
- " return l;\n" +
+ "public static void main(String[] args) {\n" +
+ " List<Integer> integerList = new ArrayList<>();\n" +
+ " List<Object> objectList = id(toWildcardGeneric(integerList));\n" +
+ " objectList.add(\"Woo?\");\n" +
+ " Integer i = integerList.get(0);\n" +
+ "}\n" +
+ "\n" +
+ "static <T> T id(T o) {\n" +
+ " return o;\n" +
+ "}\n" +
+ "\n" +
+ "static <T> List<? extends T> toWildcardGeneric(List<T> l) {\n" +
+ " return l;\n" +
"}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " List<Object> objectList = id(toWildcardGeneric(integerList));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from List<Integer> to List<Object>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " List<Object> objectList = id(toWildcardGeneric(integerList));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from List<Integer> to List<Object>\n" +
"----------\n");
}
@@ -8211,21 +8211,21 @@ public void testBug508834_comment0() {
"}"
},
- "----------\n" +
- "1. WARNING in test\\Test.java (at line 5)\n" +
- " Function function = x -> x;\n" +
- " ^^^^^^^^\n" +
- "Function is a raw type. References to generic type Function<T,R> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in test\\Test.java (at line 6)\n" +
- " String [] z = test2(function, \"\");\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation test2(Function, String) of the generic method test2(Function<T,T>, T) of type Test\n" +
- "----------\n" +
- "3. WARNING in test\\Test.java (at line 6)\n" +
- " String [] z = test2(function, \"\");\n" +
- " ^^^^^^^^\n" +
- "Type safety: The expression of type Function needs unchecked conversion to conform to Function<String,String>\n" +
+ "----------\n" +
+ "1. WARNING in test\\Test.java (at line 5)\n" +
+ " Function function = x -> x;\n" +
+ " ^^^^^^^^\n" +
+ "Function is a raw type. References to generic type Function<T,R> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in test\\Test.java (at line 6)\n" +
+ " String [] z = test2(function, \"\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation test2(Function, String) of the generic method test2(Function<T,T>, T) of type Test\n" +
+ "----------\n" +
+ "3. WARNING in test\\Test.java (at line 6)\n" +
+ " String [] z = test2(function, \"\");\n" +
+ " ^^^^^^^^\n" +
+ "Type safety: The expression of type Function needs unchecked conversion to conform to Function<String,String>\n" +
"----------\n");
}
public void testBug517710() {
@@ -8256,38 +8256,38 @@ public void testBug508834_comment0() {
"\n" +
"}\n" +
"",
- }
+ }
);
}
public void testBug513567() {
runConformTest(
new String[] {
"Foo.java",
- "import java.util.Collection;\n" +
- "import java.util.Optional;\n" +
- "\n" +
- "public class Foo {\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " new Foo().test();\n" +
- " }\n" +
- "\n" +
- " private Collection<String> createCollection(Optional<String> foo) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " private <T> void consumeCollection(Collection<T> bar) {\n" +
- " // no-op\n" +
- " }\n" +
- "\n" +
- " @SuppressWarnings({\"rawtypes\", \"unchecked\"})\n" +
- " public void test() {\n" +
- " consumeCollection(createCollection((Optional) null));\n" +
- " }\n" +
- "\n" +
- "}\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.Optional;\n" +
+ "\n" +
+ "public class Foo {\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " new Foo().test();\n" +
+ " }\n" +
+ "\n" +
+ " private Collection<String> createCollection(Optional<String> foo) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " private <T> void consumeCollection(Collection<T> bar) {\n" +
+ " // no-op\n" +
+ " }\n" +
+ "\n" +
+ " @SuppressWarnings({\"rawtypes\", \"unchecked\"})\n" +
+ " public void test() {\n" +
+ " consumeCollection(createCollection((Optional) null));\n" +
+ " }\n" +
+ "\n" +
+ "}\n" +
"",
- }
+ }
);
}
@@ -8322,24 +8322,24 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"Test.java",
- "import java.util.List;\n" +
- "interface I<U> {\n" +
- " List<U> foo(int i);\n" +
- "}\n" +
- "class X<T> {\n" +
- " List<T> t;\n" +
- " X(I<T> i) {\n" +
- " this.t = i.foo(0);\n" +
- " }\n" +
- "}\n" +
- "class Y<T> extends X<T> {\n" +
- " Y(I<T> t) {super(t);}\n" +
- "}\n" +
- "class Z {\n" +
- " static List<?> method(int ... i) {return null;}\n" +
- "}\n" +
- "public class Test {\n" +
- " static X x = new Y<>(Z::method);\n" +
+ "import java.util.List;\n" +
+ "interface I<U> {\n" +
+ " List<U> foo(int i);\n" +
+ "}\n" +
+ "class X<T> {\n" +
+ " List<T> t;\n" +
+ " X(I<T> i) {\n" +
+ " this.t = i.foo(0);\n" +
+ " }\n" +
+ "}\n" +
+ "class Y<T> extends X<T> {\n" +
+ " Y(I<T> t) {super(t);}\n" +
+ "}\n" +
+ "class Z {\n" +
+ " static List<?> method(int ... i) {return null;}\n" +
+ "}\n" +
+ "public class Test {\n" +
+ " static X x = new Y<>(Z::method);\n" +
"}\n"
});
}
@@ -8348,48 +8348,48 @@ public void testBug508834_comment0() {
this.runNegativeTest(
new String[] {
"Test.java",
- "public class Test<T> {\n" +
+ "public class Test<T> {\n" +
" private static class Inner {" +
- " public Inner(){}\n" +
- " }\n" +
- " public Inner get() {\n" +
- " return new Inner();\n" +
- " }\n" +
+ " public Inner(){}\n" +
+ " }\n" +
+ " public Inner get() {\n" +
+ " return new Inner();\n" +
+ " }\n" +
"}\n",
"Z.java",
- "class Z<T> implements I<T> {\n" +
- " public Z(Runnable r, T... t1) {}\n" +
- " public String toString (T t) {\n" +
- " return t.toString();\n" +
- " }\n" +
+ "class Z<T> implements I<T> {\n" +
+ " public Z(Runnable r, T... t1) {}\n" +
+ " public String toString (T t) {\n" +
+ " return t.toString();\n" +
+ " }\n" +
"}",
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Test<String> t = new Test<>();\n" +
- " Z z = new Z<>(()->{System.out.println(\"asdad\");}, t.get());\n" +
- " }\n" +
- "}\n" +
- "interface I<T> {\n" +
- " String toString();\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Test<String> t = new Test<>();\n" +
+ " Z z = new Z<>(()->{System.out.println(\"asdad\");}, t.get());\n" +
+ " }\n" +
+ "}\n" +
+ "interface I<T> {\n" +
+ " String toString();\n" +
"}"
},
"----------\n" +
- "1. WARNING in Z.java (at line 2)\n" +
- " public Z(Runnable r, T... t1) {}\n" +
- " ^^\n" +
- "Type safety: Potential heap pollution via varargs parameter t1\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " Z z = new Z<>(()->{System.out.println(\"asdad\");}, t.get());\n" +
- " ^\n" +
- "Z is a raw type. References to generic type Z<T> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " Z z = new Z<>(()->{System.out.println(\"asdad\");}, t.get());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The type Test.Inner is not visible\n" +
+ "1. WARNING in Z.java (at line 2)\n" +
+ " public Z(Runnable r, T... t1) {}\n" +
+ " ^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter t1\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " Z z = new Z<>(()->{System.out.println(\"asdad\");}, t.get());\n" +
+ " ^\n" +
+ "Z is a raw type. References to generic type Z<T> should be parameterized\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " Z z = new Z<>(()->{System.out.println(\"asdad\");}, t.get());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The type Test.Inner is not visible\n" +
"----------\n");
}
@@ -8397,57 +8397,57 @@ public void testBug508834_comment0() {
this.runNegativeTest(
new String[] {
"Test.java",
- "public class Test<T> {\n" +
+ "public class Test<T> {\n" +
" private static class Inner {" +
- " public Inner(){}\n" +
- " }\n" +
- " public Inner get() {\n" +
- " return new Inner();\n" +
- " }\n" +
+ " public Inner(){}\n" +
+ " }\n" +
+ " public Inner get() {\n" +
+ " return new Inner();\n" +
+ " }\n" +
"}\n",
"Z.java",
- "class Z<T> implements I<T> {\n" +
- " public class Q<TT> {\n" +
- " public Q(Runnable r, TT... ts) {}\n" +
+ "class Z<T> implements I<T> {\n" +
+ " public class Q<TT> {\n" +
+ " public Q(Runnable r, TT... ts) {}\n" +
+ " }\n" +
+ " public Z(Runnable r, T... t1) {}\n" +
+ " public String toString (T t) {\n" +
+ " return t.toString();\n" +
" }\n" +
- " public Z(Runnable r, T... t1) {}\n" +
- " public String toString (T t) {\n" +
- " return t.toString();\n" +
- " }\n" +
"}",
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Test<String> t = new Test<>();\n" +
- " Z<Object> zr = new Z<>(null, new Object[0]);\n" +
- " Z.Q zq = zr.new Q<>(null, t.get());\n" +
- " }\n" +
- "}\n" +
- "interface I<T> {\n" +
- " String toString();\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Test<String> t = new Test<>();\n" +
+ " Z<Object> zr = new Z<>(null, new Object[0]);\n" +
+ " Z.Q zq = zr.new Q<>(null, t.get());\n" +
+ " }\n" +
+ "}\n" +
+ "interface I<T> {\n" +
+ " String toString();\n" +
"}"
},
"----------\n" +
- "1. WARNING in Z.java (at line 3)\n" +
- " public Q(Runnable r, TT... ts) {}\n" +
- " ^^\n" +
- "Type safety: Potential heap pollution via varargs parameter ts\n" +
+ "1. WARNING in Z.java (at line 3)\n" +
+ " public Q(Runnable r, TT... ts) {}\n" +
+ " ^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter ts\n" +
+ "----------\n" +
+ "2. WARNING in Z.java (at line 5)\n" +
+ " public Z(Runnable r, T... t1) {}\n" +
+ " ^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter t1\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " Z.Q zq = zr.new Q<>(null, t.get());\n" +
+ " ^^^\n" +
+ "Z.Q is a raw type. References to generic type Z<T>.Q<TT> should be parameterized\n" +
"----------\n" +
- "2. WARNING in Z.java (at line 5)\n" +
- " public Z(Runnable r, T... t1) {}\n" +
- " ^^\n" +
- "Type safety: Potential heap pollution via varargs parameter t1\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " Z.Q zq = zr.new Q<>(null, t.get());\n" +
- " ^^^\n" +
- "Z.Q is a raw type. References to generic type Z<T>.Q<TT> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " Z.Q zq = zr.new Q<>(null, t.get());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The type Test.Inner is not visible\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " Z.Q zq = zr.new Q<>(null, t.get());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The type Test.Inner is not visible\n" +
"----------\n");
}
@@ -8455,145 +8455,145 @@ public void testBug508834_comment0() {
this.runNegativeTest(
new String[] {
"Test.java",
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "class Foo<T> {\n" +
- " public Foo(T a1, List<String> a2){ }\n" +
- "}\n" +
- "class Bar<T> {\n" +
- " Bar(T item) { }\n" +
- "}\n" +
- "public class Test {\n" +
- " static <T> Bar<T> getBar(T item) {\n" +
- " return new Bar<>(item);\n" +
- " }\n" +
- " static <Q> Foo<Q> method(Bar<? extends Foo<Q>> f) {\n" +
- " return null;\n" +
- " }\n" +
- " static void test() {\n" +
- " method(getBar(\n" +
- " new Foo<>(\"str\", new ArrayList())\n" +
- " ));\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "class Foo<T> {\n" +
+ " public Foo(T a1, List<String> a2){ }\n" +
+ "}\n" +
+ "class Bar<T> {\n" +
+ " Bar(T item) { }\n" +
+ "}\n" +
+ "public class Test {\n" +
+ " static <T> Bar<T> getBar(T item) {\n" +
+ " return new Bar<>(item);\n" +
+ " }\n" +
+ " static <Q> Foo<Q> method(Bar<? extends Foo<Q>> f) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " static void test() {\n" +
+ " method(getBar(\n" +
+ " new Foo<>(\"str\", new ArrayList())\n" +
+ " ));\n" +
+ " }\n" +
"}"
},
"----------\n" +
- "1. ERROR in Test.java (at line 17)\n" +
- " method(getBar(\n" +
- " ^^^^^^\n" +
- "The method method(Bar<? extends Foo<Q>>) in the type Test is not applicable for the arguments (Bar<Foo>)\n" +
+ "1. ERROR in Test.java (at line 17)\n" +
+ " method(getBar(\n" +
+ " ^^^^^^\n" +
+ "The method method(Bar<? extends Foo<Q>>) in the type Test is not applicable for the arguments (Bar<Foo>)\n" +
"----------\n" +
- "2. WARNING in Test.java (at line 18)\n" +
- " new Foo<>(\"str\", new ArrayList())\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The constructor Foo(Object, List) belongs to the raw type Foo. References to generic type Foo<T> should be parameterized\n" +
+ "2. WARNING in Test.java (at line 18)\n" +
+ " new Foo<>(\"str\", new ArrayList())\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The constructor Foo(Object, List) belongs to the raw type Foo. References to generic type Foo<T> should be parameterized\n" +
"----------\n" +
- "3. WARNING in Test.java (at line 18)\n" +
- " new Foo<>(\"str\", new ArrayList())\n" +
- " ^^^^^^^^^\n" +
- "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
+ "3. WARNING in Test.java (at line 18)\n" +
+ " new Foo<>(\"str\", new ArrayList())\n" +
+ " ^^^^^^^^^\n" +
+ "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
"----------\n");
}
public void testBug525576() {
this.runNegativeTest(
new String[] {
"test/Action.java",
- "package test;\n" +
- "\n" +
- "public class Action<S2 extends Service> {\n" +
- " void setService(S2 s) {\n" +
- " }\n" +
- "}\n" +
+ "package test;\n" +
+ "\n" +
+ "public class Action<S2 extends Service> {\n" +
+ " void setService(S2 s) {\n" +
+ " }\n" +
+ "}\n" +
"",
"test/Device.java",
- "package test;\n" +
- "\n" +
- "public abstract class Device<DI, S1 extends Service> {\n" +
- " private DI identity;\n" +
- "\n" +
- " protected void find(Service service) {\n" +
- " service.getDevice();\n" +
- " }\n" +
- "\n" +
- " public Object equals(Device obj) {\n" +
- " return obj.identity;\n" +
- " }\n" +
- "}\n" +
+ "package test;\n" +
+ "\n" +
+ "public abstract class Device<DI, S1 extends Service> {\n" +
+ " private DI identity;\n" +
+ "\n" +
+ " protected void find(Service service) {\n" +
+ " service.getDevice();\n" +
+ " }\n" +
+ "\n" +
+ " public Object equals(Device obj) {\n" +
+ " return obj.identity;\n" +
+ " }\n" +
+ "}\n" +
"",
"test/Service.java",
- "package test;\n" +
- "\n" +
- "import java.util.Collection;\n" +
- "\n" +
- "public abstract class Service<D1 extends Device, S2 extends Service> {\n" +
- " public Service(Action<S2>[] actionArr) {\n" +
- " for (Action action : actionArr) {\n" +
- " action.setService(this);\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public Action<S2>[] getActions(Collection<Action> actions) {\n" +
- " return actions.toArray(new Action[actions.size()]);\n" +
- " }\n" +
- "\n" +
- " public D1 getDevice() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
+ "package test;\n" +
+ "\n" +
+ "import java.util.Collection;\n" +
+ "\n" +
+ "public abstract class Service<D1 extends Device, S2 extends Service> {\n" +
+ " public Service(Action<S2>[] actionArr) {\n" +
+ " for (Action action : actionArr) {\n" +
+ " action.setService(this);\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public Action<S2>[] getActions(Collection<Action> actions) {\n" +
+ " return actions.toArray(new Action[actions.size()]);\n" +
+ " }\n" +
+ "\n" +
+ " public D1 getDevice() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
""
},
- "----------\n" +
- "1. WARNING in test\\Action.java (at line 3)\n" +
- " public class Action<S2 extends Service> {\n" +
- " ^^^^^^^\n" +
- "Service is a raw type. References to generic type Service<D1,S2> should be parameterized\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in test\\Device.java (at line 3)\n" +
- " public abstract class Device<DI, S1 extends Service> {\n" +
- " ^^^^^^^\n" +
- "Service is a raw type. References to generic type Service<D1,S2> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in test\\Device.java (at line 6)\n" +
- " protected void find(Service service) {\n" +
- " ^^^^^^^\n" +
- "Service is a raw type. References to generic type Service<D1,S2> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in test\\Device.java (at line 10)\n" +
- " public Object equals(Device obj) {\n" +
- " ^^^^^^\n" +
- "Device is a raw type. References to generic type Device<DI,S1> should be parameterized\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in test\\Service.java (at line 5)\n" +
- " public abstract class Service<D1 extends Device, S2 extends Service> {\n" +
- " ^^^^^^\n" +
- "Device is a raw type. References to generic type Device<DI,S1> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in test\\Service.java (at line 5)\n" +
- " public abstract class Service<D1 extends Device, S2 extends Service> {\n" +
- " ^^^^^^^\n" +
- "Service is a raw type. References to generic type Service<D1,S2> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in test\\Service.java (at line 7)\n" +
- " for (Action action : actionArr) {\n" +
- " ^^^^^^\n" +
- "Action is a raw type. References to generic type Action<S2> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in test\\Service.java (at line 8)\n" +
- " action.setService(this);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method setService(Service) belongs to the raw type Action. References to generic type Action<S2> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in test\\Service.java (at line 12)\n" +
- " public Action<S2>[] getActions(Collection<Action> actions) {\n" +
- " ^^^^^^\n" +
- "Action is a raw type. References to generic type Action<S2> should be parameterized\n" +
- "----------\n" +
- "6. WARNING in test\\Service.java (at line 13)\n" +
- " return actions.toArray(new Action[actions.size()]);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type Action[] needs unchecked conversion to conform to Action<S2>[]\n" +
+ "----------\n" +
+ "1. WARNING in test\\Action.java (at line 3)\n" +
+ " public class Action<S2 extends Service> {\n" +
+ " ^^^^^^^\n" +
+ "Service is a raw type. References to generic type Service<D1,S2> should be parameterized\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in test\\Device.java (at line 3)\n" +
+ " public abstract class Device<DI, S1 extends Service> {\n" +
+ " ^^^^^^^\n" +
+ "Service is a raw type. References to generic type Service<D1,S2> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in test\\Device.java (at line 6)\n" +
+ " protected void find(Service service) {\n" +
+ " ^^^^^^^\n" +
+ "Service is a raw type. References to generic type Service<D1,S2> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in test\\Device.java (at line 10)\n" +
+ " public Object equals(Device obj) {\n" +
+ " ^^^^^^\n" +
+ "Device is a raw type. References to generic type Device<DI,S1> should be parameterized\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in test\\Service.java (at line 5)\n" +
+ " public abstract class Service<D1 extends Device, S2 extends Service> {\n" +
+ " ^^^^^^\n" +
+ "Device is a raw type. References to generic type Device<DI,S1> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in test\\Service.java (at line 5)\n" +
+ " public abstract class Service<D1 extends Device, S2 extends Service> {\n" +
+ " ^^^^^^^\n" +
+ "Service is a raw type. References to generic type Service<D1,S2> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in test\\Service.java (at line 7)\n" +
+ " for (Action action : actionArr) {\n" +
+ " ^^^^^^\n" +
+ "Action is a raw type. References to generic type Action<S2> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in test\\Service.java (at line 8)\n" +
+ " action.setService(this);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method setService(Service) belongs to the raw type Action. References to generic type Action<S2> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in test\\Service.java (at line 12)\n" +
+ " public Action<S2>[] getActions(Collection<Action> actions) {\n" +
+ " ^^^^^^\n" +
+ "Action is a raw type. References to generic type Action<S2> should be parameterized\n" +
+ "----------\n" +
+ "6. WARNING in test\\Service.java (at line 13)\n" +
+ " return actions.toArray(new Action[actions.size()]);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type Action[] needs unchecked conversion to conform to Action<S2>[]\n" +
"----------\n");
}
public void testBug515600() {
@@ -8635,90 +8635,90 @@ public void testBug508834_comment0() {
runConformTest(new String[] {
"test/Test.java",
"package test;\n" +
- "import java.util.stream.*;\n" +
- "import java.util.*;\n" +
- "\n" +
- "class Test {\n" +
- "\n" +
- " public void f() {\n" +
- "\n" +
- " Map<Integer, String> map = new HashMap<>();\n" +
- " map.put(1, \"x\");\n" +
- " map.put(2, \"y\");\n" +
- " map.put(3, \"x\");\n" +
- " map.put(4, \"z\");\n" +
- "\n" +
- " //the following line has error\n" +
- " Map<String, ArrayList<Integer>> reverseMap = new java.util.HashMap<>(map.entrySet().stream()\n" +
- " .collect(Collectors.groupingBy(Map.Entry::getValue)).values().stream()\n" +
- " .collect(Collectors.toMap(item -> item.get(0).getValue(),\n" +
- " item -> new ArrayList<>(item.stream().map(Map.Entry::getKey).collect(Collectors.toList()))))); \n" +
- " System.out.println(reverseMap);\n" +
- "\n" +
- " }\n" +
- "\n" +
+ "import java.util.stream.*;\n" +
+ "import java.util.*;\n" +
+ "\n" +
+ "class Test {\n" +
+ "\n" +
+ " public void f() {\n" +
+ "\n" +
+ " Map<Integer, String> map = new HashMap<>();\n" +
+ " map.put(1, \"x\");\n" +
+ " map.put(2, \"y\");\n" +
+ " map.put(3, \"x\");\n" +
+ " map.put(4, \"z\");\n" +
+ "\n" +
+ " //the following line has error\n" +
+ " Map<String, ArrayList<Integer>> reverseMap = new java.util.HashMap<>(map.entrySet().stream()\n" +
+ " .collect(Collectors.groupingBy(Map.Entry::getValue)).values().stream()\n" +
+ " .collect(Collectors.toMap(item -> item.get(0).getValue(),\n" +
+ " item -> new ArrayList<>(item.stream().map(Map.Entry::getKey).collect(Collectors.toList()))))); \n" +
+ " System.out.println(reverseMap);\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
"}",
-
+
});
}
public void testBug528045() {
runConformTest(new String[] {
"test/Test.java",
- "package test;\n" +
- "\n" +
- "interface List<A0> {\n" +
- " List<A0> append(List<A0> other);\n" +
- "}\n" +
- "\n" +
- "interface Function<A1, B1> {\n" +
- " B1 f(A1 a);\n" +
- "}\n" +
- "\n" +
- "interface BiFunction<A2, B2, C2> {\n" +
- " C2 f(A2 a, B2 b);\n" +
- "}\n" +
- "\n" +
- "interface Stream<A3> {\n" +
- " <B3> B3 foldLeft(Function<B3, Function<A3, B3>> f, B3 b);\n" +
- "\n" +
- " <C3> C3 foldLeft(BiFunction<C3, A3, C3> f, C3 b);\n" +
- "}\n" +
- "\n" +
- "public class Test {\n" +
- " <A> List<A> f(Stream<List<A>> map, List<A> nil) {\n" +
- " return map.foldLeft(List::append, nil);\n" +
- " }\n" +
- "}\n" +
+ "package test;\n" +
+ "\n" +
+ "interface List<A0> {\n" +
+ " List<A0> append(List<A0> other);\n" +
+ "}\n" +
+ "\n" +
+ "interface Function<A1, B1> {\n" +
+ " B1 f(A1 a);\n" +
+ "}\n" +
+ "\n" +
+ "interface BiFunction<A2, B2, C2> {\n" +
+ " C2 f(A2 a, B2 b);\n" +
+ "}\n" +
+ "\n" +
+ "interface Stream<A3> {\n" +
+ " <B3> B3 foldLeft(Function<B3, Function<A3, B3>> f, B3 b);\n" +
+ "\n" +
+ " <C3> C3 foldLeft(BiFunction<C3, A3, C3> f, C3 b);\n" +
+ "}\n" +
+ "\n" +
+ "public class Test {\n" +
+ " <A> List<A> f(Stream<List<A>> map, List<A> nil) {\n" +
+ " return map.foldLeft(List::append, nil);\n" +
+ " }\n" +
+ "}\n" +
""
});
}
public void testBug528046() {
runConformTest(new String[] {
"test2/Test.java",
- "package test2;\n" +
- "\n" +
- "interface Supplier<A0> {\n" +
- " A0 f();\n" +
- "}\n" +
- "\n" +
- "interface Function<A1, B2> {\n" +
- " B2 f(A1 a);\n" +
- "}\n" +
- "\n" +
- "interface P {\n" +
- " <A3> void lazy(Supplier<A3> f);\n" +
- "\n" +
- " <A4> void lazy(Function<Object, A4> f);\n" +
- "}\n" +
- "\n" +
- "class Nil<A5> {\n" +
- "}\n" +
- "\n" +
- "class Test {\n" +
- " static void test(P p) {\n" +
- " p.lazy(Nil::new);\n" +
- " }\n" +
- "}\n" +
+ "package test2;\n" +
+ "\n" +
+ "interface Supplier<A0> {\n" +
+ " A0 f();\n" +
+ "}\n" +
+ "\n" +
+ "interface Function<A1, B2> {\n" +
+ " B2 f(A1 a);\n" +
+ "}\n" +
+ "\n" +
+ "interface P {\n" +
+ " <A3> void lazy(Supplier<A3> f);\n" +
+ "\n" +
+ " <A4> void lazy(Function<Object, A4> f);\n" +
+ "}\n" +
+ "\n" +
+ "class Nil<A5> {\n" +
+ "}\n" +
+ "\n" +
+ "class Test {\n" +
+ " static void test(P p) {\n" +
+ " p.lazy(Nil::new);\n" +
+ " }\n" +
+ "}\n" +
""
});
}
@@ -8728,36 +8728,36 @@ public void testBug508834_comment0() {
"TestLambda.java",
"import java.util.*;\n" +
"import java.util.function.*;\n" +
- "public class TestLambda {\n" +
- "\n" +
- " protected static <K, V> Map<K, V> newMap(final Function<K, V> loader) {\n" +
- " return new HashMap<>();\n" +
- " }\n" +
- "\n" +
- " private final Map<Integer, Integer> working = newMap(key -> {\n" +
- "\n" +
- " final List<String> strings = new ArrayList<>();\n" +
- "\n" +
- " final String[] array = strings.toArray(new String[strings.size()]);\n" +
- " foo(array);\n" +
- "\n" +
- " return null;\n" +
- " });\n" +
- "\n" +
- " private final Map<Void, Void> notWorking = newMap(key -> {\n" +
- "\n" +
- " final List<String> strings = new ArrayList<>();\n" +
- "\n" +
- " // This line seems to be the root of all evils\n" +
- " foo(strings.toArray(new String[strings.size()]));\n" +
- "\n" +
- " return null;\n" +
- " });\n" +
- "\n" +
- " private void foo(final String[] x) {}\n" +
- "\n" +
- " private void foo(final Integer[] x) {}\n" +
- "\n" +
+ "public class TestLambda {\n" +
+ "\n" +
+ " protected static <K, V> Map<K, V> newMap(final Function<K, V> loader) {\n" +
+ " return new HashMap<>();\n" +
+ " }\n" +
+ "\n" +
+ " private final Map<Integer, Integer> working = newMap(key -> {\n" +
+ "\n" +
+ " final List<String> strings = new ArrayList<>();\n" +
+ "\n" +
+ " final String[] array = strings.toArray(new String[strings.size()]);\n" +
+ " foo(array);\n" +
+ "\n" +
+ " return null;\n" +
+ " });\n" +
+ "\n" +
+ " private final Map<Void, Void> notWorking = newMap(key -> {\n" +
+ "\n" +
+ " final List<String> strings = new ArrayList<>();\n" +
+ "\n" +
+ " // This line seems to be the root of all evils\n" +
+ " foo(strings.toArray(new String[strings.size()]));\n" +
+ "\n" +
+ " return null;\n" +
+ " });\n" +
+ "\n" +
+ " private void foo(final String[] x) {}\n" +
+ "\n" +
+ " private void foo(final Integer[] x) {}\n" +
+ "\n" +
"}\n"
});
}
@@ -8765,35 +8765,35 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"Main.java",
- "import java.util.HashMap;\n" +
- "import java.util.HashSet;\n" +
- "import java.util.Set;\n" +
- "\n" +
- "public class Main<MyKey, MyValue> {\n" +
- "\n" +
- " static class MyMap<K, V> extends HashMap<K, V> {\n" +
- " public MyMap<K, V> putAllReturning(MyMap<K, V> c) { putAll(c); return this; }\n" +
- " public MyMap<K, V> putReturning(K key, V value) { put(key, value); return this; }\n" +
- " }\n" +
- "\n" +
- " public Main() {\n" +
- " Set<MyValue> values = new HashSet<>(); // actually something better\n" +
- " final MyMap<MyKey, MyValue> myMap =\n" +
- " values.stream()\n" +
- " .reduce(\n" +
- " new MyMap<MyKey, MyValue>(),\n" +
- " (map, value) -> {\n" +
- " Set<MyKey> keys = new HashSet<>(); // actually something better\n" +
- "\n" +
- " return keys.stream()\n" +
- " .reduce(\n" +
- " map, // this would work syntactically: new MyMap<MyKey, MyValue>(),\n" +
- " (map2, key) -> map2.putReturning(key, value),\n" +
- " MyMap::putAllReturning);\n" +
- " },\n" +
- " MyMap::putAllReturning\n" +
- " );\n" +
- " }\n" +
+ "import java.util.HashMap;\n" +
+ "import java.util.HashSet;\n" +
+ "import java.util.Set;\n" +
+ "\n" +
+ "public class Main<MyKey, MyValue> {\n" +
+ "\n" +
+ " static class MyMap<K, V> extends HashMap<K, V> {\n" +
+ " public MyMap<K, V> putAllReturning(MyMap<K, V> c) { putAll(c); return this; }\n" +
+ " public MyMap<K, V> putReturning(K key, V value) { put(key, value); return this; }\n" +
+ " }\n" +
+ "\n" +
+ " public Main() {\n" +
+ " Set<MyValue> values = new HashSet<>(); // actually something better\n" +
+ " final MyMap<MyKey, MyValue> myMap =\n" +
+ " values.stream()\n" +
+ " .reduce(\n" +
+ " new MyMap<MyKey, MyValue>(),\n" +
+ " (map, value) -> {\n" +
+ " Set<MyKey> keys = new HashSet<>(); // actually something better\n" +
+ "\n" +
+ " return keys.stream()\n" +
+ " .reduce(\n" +
+ " map, // this would work syntactically: new MyMap<MyKey, MyValue>(),\n" +
+ " (map2, key) -> map2.putReturning(key, value),\n" +
+ " MyMap::putAllReturning);\n" +
+ " },\n" +
+ " MyMap::putAllReturning\n" +
+ " );\n" +
+ " }\n" +
"}\n"
});
}
@@ -8829,11 +8829,11 @@ public void testBug508834_comment0() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 24)\n" +
- " fun3(test(Integer.valueOf(2), 3), 4);\n" +
- " ^^^^\n" +
- "The method fun3(int, int) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 24)\n" +
+ " fun3(test(Integer.valueOf(2), 3), 4);\n" +
+ " ^^^^\n" +
+ "The method fun3(int, int) is ambiguous for the type X\n" +
"----------\n");
}
@@ -8842,25 +8842,25 @@ public void testBug508834_comment0() {
run.testFiles = new String[] {
"Try.java",
"import java.util.function.*;\n" +
- "public class Try<T> {\n" +
- " @FunctionalInterface\n" +
- " interface CheckedSupplier<R> {\n" +
- " R get() throws Throwable;\n" +
- " }\n" +
- " static <T> Try<T> of(CheckedSupplier<? extends T> supplier) {\n" +
- " return null;\n" +
- " }\n" +
- " T getOrElseGet(Function<? super Throwable, ? extends T> other) { return null; }\n" +
+ "public class Try<T> {\n" +
+ " @FunctionalInterface\n" +
+ " interface CheckedSupplier<R> {\n" +
+ " R get() throws Throwable;\n" +
+ " }\n" +
+ " static <T> Try<T> of(CheckedSupplier<? extends T> supplier) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " T getOrElseGet(Function<? super Throwable, ? extends T> other) { return null; }\n" +
"}\n",
"X.java",
- "import java.util.*;\n" +
- "\n" +
- "public class X {\n" +
- " byte[] decode(byte[] base64Bytes) {\n" +
- " return Try.of(() -> Base64.getDecoder().decode(base64Bytes))\n" +
- " .getOrElseGet(t -> null);\n" +
- " }\n" +
- "}\n" +
+ "import java.util.*;\n" +
+ "\n" +
+ "public class X {\n" +
+ " byte[] decode(byte[] base64Bytes) {\n" +
+ " return Try.of(() -> Base64.getDecoder().decode(base64Bytes))\n" +
+ " .getOrElseGet(t -> null);\n" +
+ " }\n" +
+ "}\n" +
""
};
run.runConformTest();
@@ -8872,13 +8872,13 @@ public void testBug508834_comment0() {
"import java.util.*;\n" +
"import java.util.concurrent.atomic.*;\n" +
"public class X {\n" +
- " public static <T> List<T> returnNull(Class<? extends T> clazz) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " public static void main( String[] args )\n" +
- " {\n" +
- " List<AtomicReference<?>> l = returnNull(AtomicReference.class);\n" +
+ " public static <T> List<T> returnNull(Class<? extends T> clazz) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " public static void main( String[] args )\n" +
+ " {\n" +
+ " List<AtomicReference<?>> l = returnNull(AtomicReference.class);\n" +
" }" +
"}\n"
});
@@ -8887,29 +8887,29 @@ public void testBug508834_comment0() {
runNegativeTest(
new String[] {
"X.java",
- "interface MySupplier<V> {\n" +
- " V get(Object x) throws Exception;\n" +
- "}\n" +
- "\n" +
- "public class X {\n" +
- " public <S> S getSmth() {\n" +
- " return exec(s -> {return X.getType(Integer.class);}); /*here the error*/\n" +
- " }\n" +
- " \n" +
- " public static <T> T getType(Class<T> class1) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " public <U> U exec(MySupplier<U> supplier) {\n" +
- " throw new RuntimeException(\"Not implemented yet\");\n" +
- " }\n" +
+ "interface MySupplier<V> {\n" +
+ " V get(Object x) throws Exception;\n" +
+ "}\n" +
+ "\n" +
+ "public class X {\n" +
+ " public <S> S getSmth() {\n" +
+ " return exec(s -> {return X.getType(Integer.class);}); /*here the error*/\n" +
+ " }\n" +
+ " \n" +
+ " public static <T> T getType(Class<T> class1) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " public <U> U exec(MySupplier<U> supplier) {\n" +
+ " throw new RuntimeException(\"Not implemented yet\");\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " return exec(s -> {return X.getType(Integer.class);}); /*here the error*/\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Object to S\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " return exec(s -> {return X.getType(Integer.class);}); /*here the error*/\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Object to S\n" +
"----------\n");
}
public void testBug531681() {
@@ -8917,24 +8917,24 @@ public void testBug508834_comment0() {
runner.testFiles =
new String[] {
"X.java",
- "\n" +
- "import java.util.Arrays;\n" +
- "import java.util.function.IntFunction;\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " final long[][] someData = new long[0][];\n" +
- "\n" +
- " IntFunction<long[][]> function1 = long[][]::new;\n" +
- " IntFunction<long[][]> function2 = new IntFunction<long[][]>() {\n" +
- " @Override\n" +
- " public long[][] apply(int value) { return new long[value][]; }\n" +
- " };\n" +
- "\n" +
- " long[][] array1 = Arrays.stream(someData).toArray(long[][]::new); // works\n" +
- " long[][] array2 = Arrays.stream(someData).toArray(function2); // compile error in ecj at compliance 1.8\n" +
- " long[][] array3 = Arrays.stream(someData).toArray(function1); // compile error in ecj at compliance 1.8\n" +
- " }\n" +
+ "\n" +
+ "import java.util.Arrays;\n" +
+ "import java.util.function.IntFunction;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " final long[][] someData = new long[0][];\n" +
+ "\n" +
+ " IntFunction<long[][]> function1 = long[][]::new;\n" +
+ " IntFunction<long[][]> function2 = new IntFunction<long[][]>() {\n" +
+ " @Override\n" +
+ " public long[][] apply(int value) { return new long[value][]; }\n" +
+ " };\n" +
+ "\n" +
+ " long[][] array1 = Arrays.stream(someData).toArray(long[][]::new); // works\n" +
+ " long[][] array2 = Arrays.stream(someData).toArray(function2); // compile error in ecj at compliance 1.8\n" +
+ " long[][] array3 = Arrays.stream(someData).toArray(function1); // compile error in ecj at compliance 1.8\n" +
+ " }\n" +
"}\n"
};
runner.runConformTest();
@@ -8990,20 +8990,20 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"Test.java",
- "import java.util.List;\n" +
- "import java.util.stream.Collectors;\n" +
- "import java.util.stream.Stream;\n" +
- "\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " List<String> strings = Stream.of(1, 2, 3).map(i -> {\n" +
- " return new Object() {\n" +
- " final Integer myInt = i;\n" +
- " };\n" +
- " }).map(o -> {\n" +
- " return o.myInt.toString();\n" +
- " }).collect(Collectors.toList());\n" +
- " }\n" +
+ "import java.util.List;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "import java.util.stream.Stream;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " List<String> strings = Stream.of(1, 2, 3).map(i -> {\n" +
+ " return new Object() {\n" +
+ " final Integer myInt = i;\n" +
+ " };\n" +
+ " }).map(o -> {\n" +
+ " return o.myInt.toString();\n" +
+ " }).collect(Collectors.toList());\n" +
+ " }\n" +
"}\n"
});
}
@@ -9011,53 +9011,53 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"B.java",
- "\n" +
- "import java.util.Optional;\n" +
+ "\n" +
+ "import java.util.Optional;\n" +
"import java.util.function.Supplier;\n" +
- "import java.io.Serializable;\n" +
- "\n" +
- "public class B {\n" +
- " public static void main(String[] args) {\n" +
- "\n" +
- " // This works fine:\n" +
- " System.out.println(new Object() {\n" +
- " int j = 5;\n" +
- " }.j);\n" +
- "\n" +
- " // This also\n" +
- " System.out.println(trace(new Object() {\n" +
- " int j = 5;\n" +
- " }).j);\n" +
- "\n" +
- " // Also no problem\n" +
- " System.out.println(unwrapAndTrace(Optional.of(new Object() {\n" +
- " int j = 5;\n" +
- " })).j);\n" +
- "\n" +
- " // Lambdas work:\n" +
- " System.out.println(((Supplier & Serializable) () -> new Object()).get()); \n" +
- "\n" +
- " // This doesn't work.\n" +
- " System.out.println(invokeAndTrace(() -> new Object() {\n" +
- " int j = 5;\n" +
- " }).j);\n" +
- " }\n" +
- "\n" +
- " public static <T> T trace(T obj) {\n" +
- " System.out.println(obj);\n" +
- " return obj;\n" +
- " }\n" +
- "\n" +
- " public static <T> T invokeAndTrace(Supplier<T> supplier) {\n" +
- " T result = supplier.get();\n" +
- " System.out.println(result);\n" +
- " return result;\n" +
- " }\n" +
- "\n" +
- " public static <T> T unwrapAndTrace(Optional<T> optional) {\n" +
- " T result = optional.get();\n" +
- " System.out.println(result);\n" +
- " return result;\n" +
+ "import java.io.Serializable;\n" +
+ "\n" +
+ "public class B {\n" +
+ " public static void main(String[] args) {\n" +
+ "\n" +
+ " // This works fine:\n" +
+ " System.out.println(new Object() {\n" +
+ " int j = 5;\n" +
+ " }.j);\n" +
+ "\n" +
+ " // This also\n" +
+ " System.out.println(trace(new Object() {\n" +
+ " int j = 5;\n" +
+ " }).j);\n" +
+ "\n" +
+ " // Also no problem\n" +
+ " System.out.println(unwrapAndTrace(Optional.of(new Object() {\n" +
+ " int j = 5;\n" +
+ " })).j);\n" +
+ "\n" +
+ " // Lambdas work:\n" +
+ " System.out.println(((Supplier & Serializable) () -> new Object()).get()); \n" +
+ "\n" +
+ " // This doesn't work.\n" +
+ " System.out.println(invokeAndTrace(() -> new Object() {\n" +
+ " int j = 5;\n" +
+ " }).j);\n" +
+ " }\n" +
+ "\n" +
+ " public static <T> T trace(T obj) {\n" +
+ " System.out.println(obj);\n" +
+ " return obj;\n" +
+ " }\n" +
+ "\n" +
+ " public static <T> T invokeAndTrace(Supplier<T> supplier) {\n" +
+ " T result = supplier.get();\n" +
+ " System.out.println(result);\n" +
+ " return result;\n" +
+ " }\n" +
+ "\n" +
+ " public static <T> T unwrapAndTrace(Optional<T> optional) {\n" +
+ " T result = optional.get();\n" +
+ " System.out.println(result);\n" +
+ " return result;\n" +
" }\n" +
"}\n"
});
@@ -9066,27 +9066,27 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"Main.java",
- "public class Main {\n" +
- " static class Foo<T> {\n" +
- " private final T arg;\n" +
- " public Foo(T arg) {\n" +
- " this.arg = arg;\n" +
- " }\n" +
- " <R> Foo<R> select(java.util.function.Function<T, R> transformer) {\n" +
- " return new Foo<>(transformer.apply(this.arg));\n" +
- " }\n" +
- " <R> R select2(java.util.function.Function<T, R> transformer) {\n" +
- " return transformer.apply(this.arg);\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " String out = new Foo<Object>(null)\n" +
- " .select(x -> new Object() {\n" +
- " String alias = \"anonymous#1\";\n" +
- " })\n" +
- " .select2(x -> x.alias);\n" +
- " System.out.println(out);\n" +
- " }\n" +
+ "public class Main {\n" +
+ " static class Foo<T> {\n" +
+ " private final T arg;\n" +
+ " public Foo(T arg) {\n" +
+ " this.arg = arg;\n" +
+ " }\n" +
+ " <R> Foo<R> select(java.util.function.Function<T, R> transformer) {\n" +
+ " return new Foo<>(transformer.apply(this.arg));\n" +
+ " }\n" +
+ " <R> R select2(java.util.function.Function<T, R> transformer) {\n" +
+ " return transformer.apply(this.arg);\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " String out = new Foo<Object>(null)\n" +
+ " .select(x -> new Object() {\n" +
+ " String alias = \"anonymous#1\";\n" +
+ " })\n" +
+ " .select2(x -> x.alias);\n" +
+ " System.out.println(out);\n" +
+ " }\n" +
"}\n"
});
}
@@ -9094,14 +9094,14 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"X.java",
- "import java.util.Arrays;\n" +
- "import java.util.List;\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " List<String> ss = Arrays.asList(\"1\", \"2\", \"3\");\n" +
- " ss.stream().map(s -> new Object() { });\n" +
- " }\n" +
+ "import java.util.Arrays;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " List<String> ss = Arrays.asList(\"1\", \"2\", \"3\");\n" +
+ " ss.stream().map(s -> new Object() { });\n" +
+ " }\n" +
"}\n"
});
}
@@ -9109,21 +9109,21 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"X.java",
- "import java.util.Arrays;\n" +
- "import java.util.List;\n" +
- "\n" +
- "public class X {\n" +
- " void m() {\n" +
- " List<String> ss = Arrays.asList(\"1\", \"2\", \"3\");\n" +
- " \n" +
- " ss.stream().map(s -> {\n" +
- " class L1 {};\n" +
- " class L2 {\n" +
- " L1 mm(L1 l) { return l;}\n" +
- " }\n" +
- " return new L2().mm(new L1());\n" +
- " }).forEach(e -> System.out.println(e));\n" +
- " }\n" +
+ "import java.util.Arrays;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class X {\n" +
+ " void m() {\n" +
+ " List<String> ss = Arrays.asList(\"1\", \"2\", \"3\");\n" +
+ " \n" +
+ " ss.stream().map(s -> {\n" +
+ " class L1 {};\n" +
+ " class L2 {\n" +
+ " L1 mm(L1 l) { return l;}\n" +
+ " }\n" +
+ " return new L2().mm(new L1());\n" +
+ " }).forEach(e -> System.out.println(e));\n" +
+ " }\n" +
"}\n"
});
}
@@ -9132,79 +9132,79 @@ public void testBug508834_comment0() {
runner.customOptions = new HashMap<String, String>();
runner.customOptions.put(JavaCore.COMPILER_PB_DEPRECATION, JavaCore.IGNORE);
runner.testFiles =
- new String[] {
+ new String[] {
"org/a/a/g/d.java",
- "package org.a.a.g;\n" +
- "\n" +
- "public class d {\n" +
- "\n" +
- " public <T extends e> T a(Class<T> cls) {\n" +
- " T t = (e) cls.newInstance();\n" +
- " while (size >= 0) {\n" +
- " T a = ((b) this.e.m.get(size)).a();\n" +
- " t = a;\n" +
- " }\n" +
- " return t;\n" +
- " }\n" +
- "\n" +
- " public interface b {\n" +
- " <T extends e> T a();\n" +
- "\n" +
- " <T extends j> T b();\n" +
- " }\n" +
+ "package org.a.a.g;\n" +
+ "\n" +
+ "public class d {\n" +
+ "\n" +
+ " public <T extends e> T a(Class<T> cls) {\n" +
+ " T t = (e) cls.newInstance();\n" +
+ " while (size >= 0) {\n" +
+ " T a = ((b) this.e.m.get(size)).a();\n" +
+ " t = a;\n" +
+ " }\n" +
+ " return t;\n" +
+ " }\n" +
+ "\n" +
+ " public interface b {\n" +
+ " <T extends e> T a();\n" +
+ "\n" +
+ " <T extends j> T b();\n" +
+ " }\n" +
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in org\\a\\a\\g\\d.java (at line 5)\n" +
- " public <T extends e> T a(Class<T> cls) {\n" +
- " ^\n" +
- "e cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in org\\a\\a\\g\\d.java (at line 6)\n" +
- " T t = (e) cls.newInstance();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "e cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in org\\a\\a\\g\\d.java (at line 6)\n" +
- " T t = (e) cls.newInstance();\n" +
- " ^\n" +
- "e cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in org\\a\\a\\g\\d.java (at line 7)\n" +
- " while (size >= 0) {\n" +
- " ^^^^\n" +
- "size cannot be resolved to a variable\n" +
- "----------\n" +
- "5. ERROR in org\\a\\a\\g\\d.java (at line 8)\n" +
- " T a = ((b) this.e.m.get(size)).a();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from e to T\n" +
- "----------\n" +
- "6. ERROR in org\\a\\a\\g\\d.java (at line 8)\n" +
- " T a = ((b) this.e.m.get(size)).a();\n" +
- " ^\n" +
- "e cannot be resolved or is not a field\n" +
- "----------\n" +
- "7. ERROR in org\\a\\a\\g\\d.java (at line 8)\n" +
- " T a = ((b) this.e.m.get(size)).a();\n" +
- " ^^^^\n" +
- "size cannot be resolved to a variable\n" +
- "----------\n" +
- "8. ERROR in org\\a\\a\\g\\d.java (at line 15)\n" +
- " <T extends e> T a();\n" +
- " ^\n" +
- "e cannot be resolved to a type\n" +
- "----------\n" +
- "9. ERROR in org\\a\\a\\g\\d.java (at line 17)\n" +
- " <T extends j> T b();\n" +
- " ^\n" +
- "j cannot be resolved to a type\n" +
- "----------\n" +
- "10. WARNING in org\\a\\a\\g\\d.java (at line 17)\n" +
- " <T extends j> T b();\n" +
- " ^^^\n" +
- "This method has a constructor name\n" +
+ "----------\n" +
+ "1. ERROR in org\\a\\a\\g\\d.java (at line 5)\n" +
+ " public <T extends e> T a(Class<T> cls) {\n" +
+ " ^\n" +
+ "e cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in org\\a\\a\\g\\d.java (at line 6)\n" +
+ " T t = (e) cls.newInstance();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "e cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in org\\a\\a\\g\\d.java (at line 6)\n" +
+ " T t = (e) cls.newInstance();\n" +
+ " ^\n" +
+ "e cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in org\\a\\a\\g\\d.java (at line 7)\n" +
+ " while (size >= 0) {\n" +
+ " ^^^^\n" +
+ "size cannot be resolved to a variable\n" +
+ "----------\n" +
+ "5. ERROR in org\\a\\a\\g\\d.java (at line 8)\n" +
+ " T a = ((b) this.e.m.get(size)).a();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from e to T\n" +
+ "----------\n" +
+ "6. ERROR in org\\a\\a\\g\\d.java (at line 8)\n" +
+ " T a = ((b) this.e.m.get(size)).a();\n" +
+ " ^\n" +
+ "e cannot be resolved or is not a field\n" +
+ "----------\n" +
+ "7. ERROR in org\\a\\a\\g\\d.java (at line 8)\n" +
+ " T a = ((b) this.e.m.get(size)).a();\n" +
+ " ^^^^\n" +
+ "size cannot be resolved to a variable\n" +
+ "----------\n" +
+ "8. ERROR in org\\a\\a\\g\\d.java (at line 15)\n" +
+ " <T extends e> T a();\n" +
+ " ^\n" +
+ "e cannot be resolved to a type\n" +
+ "----------\n" +
+ "9. ERROR in org\\a\\a\\g\\d.java (at line 17)\n" +
+ " <T extends j> T b();\n" +
+ " ^\n" +
+ "j cannot be resolved to a type\n" +
+ "----------\n" +
+ "10. WARNING in org\\a\\a\\g\\d.java (at line 17)\n" +
+ " <T extends j> T b();\n" +
+ " ^^^\n" +
+ "This method has a constructor name\n" +
"----------\n";
runner.runNegativeTest();
}
@@ -9215,101 +9215,101 @@ public void testBug508834_comment0() {
runner.testFiles =
new String[] {
"xxxxxx/iiibii.java",
- "package xxxxxx;\n" +
- "\n" +
- "public class iiibii {\n" +
- "\n" +
- " public <T extends xxxxxx.jajaja> T b041D041D041D041DН041DН(xxxxxx.jjajaa jjajaa) {\n" +
- " }\n" +
- "\n" +
- " public xxxxxx.jajaja bН041D041D041DН041DН(byte b, byte b2) {\n" +
- " return b041D041D041D041DН041DН(new xxxxxx.jjajaa(b, b2));\n" +
- " }\n" +
+ "package xxxxxx;\n" +
+ "\n" +
+ "public class iiibii {\n" +
+ "\n" +
+ " public <T extends xxxxxx.jajaja> T b041D041D041D041DН041DН(xxxxxx.jjajaa jjajaa) {\n" +
+ " }\n" +
+ "\n" +
+ " public xxxxxx.jajaja bН041D041D041DН041DН(byte b, byte b2) {\n" +
+ " return b041D041D041D041DН041DН(new xxxxxx.jjajaa(b, b2));\n" +
+ " }\n" +
"}\n",
"xxxxxx/jjajaa.java",
- "package xxxxxx;\n" +
- "\n" +
- "public class jjajaa implements java.io.Serializable, java.lang.Comparable<xxxxxx.jjajaa> {\n" +
- " private byte b0445х0445хх04450445;\n" +
- " private byte bхх0445хх04450445;\n" +
- "\n" +
- " public jjajaa(byte b, byte b2) {\n" +
- " this.bхх0445хх04450445 = b;\n" +
- " this.b0445х0445хх04450445 = b2;\n" +
- " }\n" +
- "\n" +
- " public int b043704370437з04370437з(xxxxxx.jjajaa jjajaa) {\n" +
- " int i = this.bхх0445хх04450445 - jjajaa.bхх0445хх04450445;\n" +
- " return i != 0 ? i : this.b0445х0445хх04450445 - jjajaa.b0445х0445хх04450445;\n" +
- " }\n" +
- "\n" +
- " public byte[] bззз043704370437з() {\n" +
- " return new byte[]{this.bхх0445хх04450445, this.b0445х0445хх04450445};\n" +
- " }\n" +
- "\n" +
- " public /* synthetic */ int compareTo(java.lang.Object obj) {\n" +
- " return b043704370437з04370437з((xxxxxx.jjajaa) obj);\n" +
- " }\n" +
- "\n" +
- " public boolean equals(java.lang.Object obj) {\n" +
- " if (obj == null || getClass() != obj.getClass()) {\n" +
- " return false;\n" +
- " }\n" +
- " xxxxxx.jjajaa jjajaa = (xxxxxx.jjajaa) obj;\n" +
- " return this.bхх0445хх04450445 == jjajaa.bхх0445хх04450445 && this.b0445х0445хх04450445 == jjajaa.b0445х0445хх04450445;\n" +
- " }\n" +
- "\n" +
- " public int hashCode() {\n" +
- " return ((this.bхх0445хх04450445 + 427) * 61) + this.b0445х0445хх04450445;\n" +
- " }\n" +
- "\n" +
- " public java.lang.String toString() {\n" +
- " return xxxxxx.ttotoo.bг04330433г04330433г(this.bхх0445хх04450445) + xxxxxx.ttotoo.bг04330433г04330433г(this.b0445х0445хх04450445);\n" +
- " }\n" +
+ "package xxxxxx;\n" +
+ "\n" +
+ "public class jjajaa implements java.io.Serializable, java.lang.Comparable<xxxxxx.jjajaa> {\n" +
+ " private byte b0445х0445хх04450445;\n" +
+ " private byte bхх0445хх04450445;\n" +
+ "\n" +
+ " public jjajaa(byte b, byte b2) {\n" +
+ " this.bхх0445хх04450445 = b;\n" +
+ " this.b0445х0445хх04450445 = b2;\n" +
+ " }\n" +
+ "\n" +
+ " public int b043704370437з04370437з(xxxxxx.jjajaa jjajaa) {\n" +
+ " int i = this.bхх0445хх04450445 - jjajaa.bхх0445хх04450445;\n" +
+ " return i != 0 ? i : this.b0445х0445хх04450445 - jjajaa.b0445х0445хх04450445;\n" +
+ " }\n" +
+ "\n" +
+ " public byte[] bззз043704370437з() {\n" +
+ " return new byte[]{this.bхх0445хх04450445, this.b0445х0445хх04450445};\n" +
+ " }\n" +
+ "\n" +
+ " public /* synthetic */ int compareTo(java.lang.Object obj) {\n" +
+ " return b043704370437з04370437з((xxxxxx.jjajaa) obj);\n" +
+ " }\n" +
+ "\n" +
+ " public boolean equals(java.lang.Object obj) {\n" +
+ " if (obj == null || getClass() != obj.getClass()) {\n" +
+ " return false;\n" +
+ " }\n" +
+ " xxxxxx.jjajaa jjajaa = (xxxxxx.jjajaa) obj;\n" +
+ " return this.bхх0445хх04450445 == jjajaa.bхх0445хх04450445 && this.b0445х0445хх04450445 == jjajaa.b0445х0445хх04450445;\n" +
+ " }\n" +
+ "\n" +
+ " public int hashCode() {\n" +
+ " return ((this.bхх0445хх04450445 + 427) * 61) + this.b0445х0445хх04450445;\n" +
+ " }\n" +
+ "\n" +
+ " public java.lang.String toString() {\n" +
+ " return xxxxxx.ttotoo.bг04330433г04330433г(this.bхх0445хх04450445) + xxxxxx.ttotoo.bг04330433г04330433г(this.b0445х0445хх04450445);\n" +
+ " }\n" +
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in xxxxxx\\iiibii.java (at line 5)\n" +
- " public <T extends xxxxxx.jajaja> T b041D041D041D041DН041DН(xxxxxx.jjajaa jjajaa) {\n" +
- " ^^^^^^^^^^^^^\n" +
- "xxxxxx.jajaja cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in xxxxxx\\iiibii.java (at line 8)\n" +
- " public xxxxxx.jajaja bН041D041D041DН041DН(byte b, byte b2) {\n" +
- " ^^^^^^^^^^^^^\n" +
- "xxxxxx.jajaja cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in xxxxxx\\iiibii.java (at line 9)\n" +
- " return b041D041D041D041DН041DН(new xxxxxx.jjajaa(b, b2));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from jajaja to jajaja\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in xxxxxx\\jjajaa.java (at line 3)\n" +
- " public class jjajaa implements java.io.Serializable, java.lang.Comparable<xxxxxx.jjajaa> {\n" +
- " ^^^^^^\n" +
- "The type jjajaa must implement the inherited abstract method Comparable<jjajaa>.compareTo(jjajaa)\n" +
- "----------\n" +
- "2. WARNING in xxxxxx\\jjajaa.java (at line 3)\n" +
- " public class jjajaa implements java.io.Serializable, java.lang.Comparable<xxxxxx.jjajaa> {\n" +
- " ^^^^^^\n" +
- "The serializable class jjajaa does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. ERROR in xxxxxx\\jjajaa.java (at line 21)\n" +
- " public /* synthetic */ int compareTo(java.lang.Object obj) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method compareTo(Object) of type jjajaa has the same erasure as compareTo(T) of type Comparable<T> but does not override it\n" +
- "----------\n" +
- "4. ERROR in xxxxxx\\jjajaa.java (at line 38)\n" +
- " return xxxxxx.ttotoo.bг04330433г04330433г(this.bхх0445хх04450445) + xxxxxx.ttotoo.bг04330433г04330433г(this.b0445х0445хх04450445);\n" +
- " ^^^^^^^^^^^^^\n" +
- "xxxxxx.ttotoo cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in xxxxxx\\jjajaa.java (at line 38)\n" +
- " return xxxxxx.ttotoo.bг04330433г04330433г(this.bхх0445хх04450445) + xxxxxx.ttotoo.bг04330433г04330433г(this.b0445х0445хх04450445);\n" +
- " ^^^^^^^^^^^^^\n" +
- "xxxxxx.ttotoo cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in xxxxxx\\iiibii.java (at line 5)\n" +
+ " public <T extends xxxxxx.jajaja> T b041D041D041D041DН041DН(xxxxxx.jjajaa jjajaa) {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "xxxxxx.jajaja cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in xxxxxx\\iiibii.java (at line 8)\n" +
+ " public xxxxxx.jajaja bН041D041D041DН041DН(byte b, byte b2) {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "xxxxxx.jajaja cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in xxxxxx\\iiibii.java (at line 9)\n" +
+ " return b041D041D041D041DН041DН(new xxxxxx.jjajaa(b, b2));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from jajaja to jajaja\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in xxxxxx\\jjajaa.java (at line 3)\n" +
+ " public class jjajaa implements java.io.Serializable, java.lang.Comparable<xxxxxx.jjajaa> {\n" +
+ " ^^^^^^\n" +
+ "The type jjajaa must implement the inherited abstract method Comparable<jjajaa>.compareTo(jjajaa)\n" +
+ "----------\n" +
+ "2. WARNING in xxxxxx\\jjajaa.java (at line 3)\n" +
+ " public class jjajaa implements java.io.Serializable, java.lang.Comparable<xxxxxx.jjajaa> {\n" +
+ " ^^^^^^\n" +
+ "The serializable class jjajaa does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "3. ERROR in xxxxxx\\jjajaa.java (at line 21)\n" +
+ " public /* synthetic */ int compareTo(java.lang.Object obj) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method compareTo(Object) of type jjajaa has the same erasure as compareTo(T) of type Comparable<T> but does not override it\n" +
+ "----------\n" +
+ "4. ERROR in xxxxxx\\jjajaa.java (at line 38)\n" +
+ " return xxxxxx.ttotoo.bг04330433г04330433г(this.bхх0445хх04450445) + xxxxxx.ttotoo.bг04330433г04330433г(this.b0445х0445хх04450445);\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "xxxxxx.ttotoo cannot be resolved to a type\n" +
+ "----------\n" +
+ "5. ERROR in xxxxxx\\jjajaa.java (at line 38)\n" +
+ " return xxxxxx.ttotoo.bг04330433г04330433г(this.bхх0445хх04450445) + xxxxxx.ttotoo.bг04330433г04330433г(this.b0445х0445хх04450445);\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "xxxxxx.ttotoo cannot be resolved to a type\n" +
"----------\n";
runner.runNegativeTest();
}
@@ -9317,70 +9317,70 @@ public void testBug508834_comment0() {
runNegativeTest(
new String[] {
"Test.java",
- "public class Test {\n" +
- " public <T> void setValue(Parameter<T> parameter, T value) {\n" +
- " System.out.println(\"Object\");\n" +
- " }\n" +
- "\n" +
- " public <T> void setValue(Parameter<T> parameter, Field<T> value) {\n" +
- " System.out.println(\"Field\");\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " new Test().test();\n" +
- " }\n" +
- "\n" +
- " private void test() {\n" +
- " Parameter<String> p1 = p1();\n" +
- " Field<String> f1 = f1();\n" +
+ "public class Test {\n" +
+ " public <T> void setValue(Parameter<T> parameter, T value) {\n" +
+ " System.out.println(\"Object\");\n" +
+ " }\n" +
+ "\n" +
+ " public <T> void setValue(Parameter<T> parameter, Field<T> value) {\n" +
+ " System.out.println(\"Field\");\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " new Test().test();\n" +
+ " }\n" +
+ "\n" +
+ " private void test() {\n" +
+ " Parameter<String> p1 = p1();\n" +
+ " Field<String> f1 = f1();\n" +
" setValue(p1, f1);\n" +
- " setValue(p1, null);\n" +
- "\n" +
- " Parameter<Object> p2 = p2();\n" +
- " Field<Object> f2 = f2();\n" +
- " setValue(p2, f2);\n" +
- " setValue(p2, null);" +
- " }\n" +
- "\n" +
- " private Field<String> f1() {\n" +
- " Field<String> f1 = null;\n" +
- " return f1;\n" +
- " }\n" +
- "\n" +
- " private Parameter<String> p1() {\n" +
- " Parameter<String> p1 = null;\n" +
- " return p1;\n" +
- " }\n" +
- "\n" +
- " private Parameter<Object> p2() {\n" +
- " Parameter<Object> p2 = null;\n" +
- " return p2;\n" +
- " }\n" +
- "\n" +
- " private Field<Object> f2() {\n" +
- " Field<Object> f2 = null;\n" +
- " return f2;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "interface Field<T> {}\n" +
+ " setValue(p1, null);\n" +
+ "\n" +
+ " Parameter<Object> p2 = p2();\n" +
+ " Field<Object> f2 = f2();\n" +
+ " setValue(p2, f2);\n" +
+ " setValue(p2, null);" +
+ " }\n" +
+ "\n" +
+ " private Field<String> f1() {\n" +
+ " Field<String> f1 = null;\n" +
+ " return f1;\n" +
+ " }\n" +
+ "\n" +
+ " private Parameter<String> p1() {\n" +
+ " Parameter<String> p1 = null;\n" +
+ " return p1;\n" +
+ " }\n" +
+ "\n" +
+ " private Parameter<Object> p2() {\n" +
+ " Parameter<Object> p2 = null;\n" +
+ " return p2;\n" +
+ " }\n" +
+ "\n" +
+ " private Field<Object> f2() {\n" +
+ " Field<Object> f2 = null;\n" +
+ " return f2;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "interface Field<T> {}\n" +
"interface Parameter <T> {}\n"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 18)\n" +
- " setValue(p1, null);\n" +
- " ^^^^^^^^\n" +
- "The method setValue(Parameter<String>, String) is ambiguous for the type Test\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 22)\n" +
- " setValue(p2, f2);\n" +
- " ^^^^^^^^\n" +
- "The method setValue(Parameter<Object>, Object) is ambiguous for the type Test\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 23)\n" +
- " setValue(p2, null); }\n" +
- " ^^^^^^^^\n" +
- "The method setValue(Parameter<Object>, Object) is ambiguous for the type Test\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 18)\n" +
+ " setValue(p1, null);\n" +
+ " ^^^^^^^^\n" +
+ "The method setValue(Parameter<String>, String) is ambiguous for the type Test\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 22)\n" +
+ " setValue(p2, f2);\n" +
+ " ^^^^^^^^\n" +
+ "The method setValue(Parameter<Object>, Object) is ambiguous for the type Test\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 23)\n" +
+ " setValue(p2, null); }\n" +
+ " ^^^^^^^^\n" +
+ "The method setValue(Parameter<Object>, Object) is ambiguous for the type Test\n" +
"----------\n");
}
public void testBug333011() {
@@ -9388,39 +9388,39 @@ public void testBug508834_comment0() {
new String[] {
"Example.java",
"import java.util.ArrayList;\n" +
- "public class Example {\n" +
- " public static void doSomething() {\n" +
- " DoJobMr bean = getOnlyElement(new ArrayList());\n" +
- " }\n" +
- " public static <T> T getOnlyElement(Iterable<T> iterable) { \n" +
- " return null;\n" +
- " }\n" +
- " public static class DoJobMr {\n" +
- " }\n" +
+ "public class Example {\n" +
+ " public static void doSomething() {\n" +
+ " DoJobMr bean = getOnlyElement(new ArrayList());\n" +
+ " }\n" +
+ " public static <T> T getOnlyElement(Iterable<T> iterable) { \n" +
+ " return null;\n" +
+ " }\n" +
+ " public static class DoJobMr {\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Example.java (at line 4)\n" +
- " DoJobMr bean = getOnlyElement(new ArrayList());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Object to Example.DoJobMr\n" +
- "----------\n" +
- "2. WARNING in Example.java (at line 4)\n" +
- " DoJobMr bean = getOnlyElement(new ArrayList());\n" +
- " ^^^^^^^^^\n" +
- "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
+ "----------\n" +
+ "1. ERROR in Example.java (at line 4)\n" +
+ " DoJobMr bean = getOnlyElement(new ArrayList());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Object to Example.DoJobMr\n" +
+ "----------\n" +
+ "2. WARNING in Example.java (at line 4)\n" +
+ " DoJobMr bean = getOnlyElement(new ArrayList());\n" +
+ " ^^^^^^^^^\n" +
+ "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
"----------\n");
}
public void testBug537089() {
runConformTest(
new String[] {
"EclipseBug.java",
- "public class EclipseBug {\n" +
- " public static <T> void foo(T p1, T p2) {}\n" +
- "\n" +
- " public void shouldCompile() {\n" +
- " foo(new int[0], new byte[0]);\n" +
- " }\n" +
+ "public class EclipseBug {\n" +
+ " public static <T> void foo(T p1, T p2) {}\n" +
+ "\n" +
+ " public void shouldCompile() {\n" +
+ " foo(new int[0], new byte[0]);\n" +
+ " }\n" +
"}\n"
});
}
@@ -9428,29 +9428,29 @@ public void testBug508834_comment0() {
Runner runner = new Runner();
runner.testFiles = new String[] {
"Bug539329.java",
- " import java.util.*;\n" +
- " \n" +
- " public class Bug539329 {\n" +
- "\n" +
- " public static Collection<Class<? extends Interface>> getClasses() {\n" +
- " // This yields a compile error in 2018-09, but works in Photon.\n" +
- " return Arrays.asList(One.class, Two.class, Three.class);\n" +
- " }\n" +
- "\n" +
- " public static Collection<Class<? extends Interface>> getClassesThatWorks() {\n" +
- " // This works surprisinly in both versions\n" +
- " return Arrays.asList(One.class, Two.class);\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " class One extends Parent<String> implements Interface { }\n" +
- "\n" +
- " class Two extends Parent<Integer> implements Interface { }\n" +
- "\n" +
- " class Three extends Parent<Object> implements Interface { }\n" +
- "\n" +
- " class Parent<T> { }\n" +
- "\n" +
+ " import java.util.*;\n" +
+ " \n" +
+ " public class Bug539329 {\n" +
+ "\n" +
+ " public static Collection<Class<? extends Interface>> getClasses() {\n" +
+ " // This yields a compile error in 2018-09, but works in Photon.\n" +
+ " return Arrays.asList(One.class, Two.class, Three.class);\n" +
+ " }\n" +
+ "\n" +
+ " public static Collection<Class<? extends Interface>> getClassesThatWorks() {\n" +
+ " // This works surprisinly in both versions\n" +
+ " return Arrays.asList(One.class, Two.class);\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " class One extends Parent<String> implements Interface { }\n" +
+ "\n" +
+ " class Two extends Parent<Integer> implements Interface { }\n" +
+ "\n" +
+ " class Three extends Parent<Object> implements Interface { }\n" +
+ "\n" +
+ " class Parent<T> { }\n" +
+ "\n" +
" interface Interface { }\n"
};
runner.runConformTest();
@@ -9460,13 +9460,13 @@ public void testBug508834_comment0() {
runner.testFiles = new String[] {
"Bug543128.java",
"public class Bug543128 {\n" +
- " static class A {}\n" +
- " static class B<F, S extends A> extends A {}\n" +
- " static class C<G extends A> {}\n" +
- " \n" +
- " public static <H extends A, T> void test(C<? super B<? super T, ? super H>> test)\n" +
- " {\n" +
- " test(test); // fails compilation (incorrect)\n" +
+ " static class A {}\n" +
+ " static class B<F, S extends A> extends A {}\n" +
+ " static class C<G extends A> {}\n" +
+ " \n" +
+ " public static <H extends A, T> void test(C<? super B<? super T, ? super H>> test)\n" +
+ " {\n" +
+ " test(test); // fails compilation (incorrect)\n" +
" }\n" +
"}\n"
};
@@ -9476,10 +9476,10 @@ public void testBug508834_comment0() {
Runner runner = new Runner();
runner.testFiles = new String[] {
"A.java",
- "import java.util.concurrent.atomic.AtomicReference;\n" +
+ "import java.util.concurrent.atomic.AtomicReference;\n" +
"import java.util.Optional;\n" +
"public class A {\n" +
- " private final ThreadLocal<AtomicReference<Optional<Long>>> var =\n" +
+ " private final ThreadLocal<AtomicReference<Optional<Long>>> var =\n" +
" ThreadLocal.withInitial(() -> new AtomicReference<>(Optional.empty()));" +
"}\n"
};
@@ -9489,25 +9489,25 @@ public void testBug508834_comment0() {
Runner runner = new Runner();
runner.testFiles = new String[] {
"Test.java",
- "import java.util.*;\n" +
- "import java.util.stream.*;\n" +
- "import java.math.*;\n" +
- "\n" +
- "public class Test {\n" +
- " private List<Object> getRowValues(Map<String, BigDecimal> record, Stream<String> factors) {\n" +
- " return Stream.concat(\n" +
- " factors.map(f -> {\n" +
- " if (f.equals(\"x\")) {\n" +
- " return record.get(f);\n" +
- " } else {\n" +
- " return \"NM\";\n" +
- " }\n" +
- " }),\n" +
- " Stream.of(BigDecimal.ONE)\n" +
- " )\n" +
- " .map(v -> (v instanceof BigDecimal) ? ((BigDecimal) v).setScale(10, BigDecimal.ROUND_HALF_UP) : v)\n" +
- " .collect(Collectors.toList());\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "import java.util.stream.*;\n" +
+ "import java.math.*;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " private List<Object> getRowValues(Map<String, BigDecimal> record, Stream<String> factors) {\n" +
+ " return Stream.concat(\n" +
+ " factors.map(f -> {\n" +
+ " if (f.equals(\"x\")) {\n" +
+ " return record.get(f);\n" +
+ " } else {\n" +
+ " return \"NM\";\n" +
+ " }\n" +
+ " }),\n" +
+ " Stream.of(BigDecimal.ONE)\n" +
+ " )\n" +
+ " .map(v -> (v instanceof BigDecimal) ? ((BigDecimal) v).setScale(10, BigDecimal.ROUND_HALF_UP) : v)\n" +
+ " .collect(Collectors.toList());\n" +
+ " }\n" +
"}\n"
};
runner.runConformTest();
@@ -9516,13 +9516,13 @@ public void testBug508834_comment0() {
Runner runner = new Runner();
runner.testFiles = new String[] {
"Test.java",
- "import java.util.*;\n" +
+ "import java.util.*;\n" +
"import java.util.function.Function;\n" +
- "interface ListFunc<T> extends Function<List<String>, T> {}\n" +
- "interface MapFunc<T> extends Function<Map<String,String>, T> {}\n" +
- "class DTT {\n" +
- " public <T> DTT(Class<T> c, ListFunc<T> f) {}\n" +
- " public <T> DTT(Class<T> c, MapFunc<T> f) {} \n" +
+ "interface ListFunc<T> extends Function<List<String>, T> {}\n" +
+ "interface MapFunc<T> extends Function<Map<String,String>, T> {}\n" +
+ "class DTT {\n" +
+ " public <T> DTT(Class<T> c, ListFunc<T> f) {}\n" +
+ " public <T> DTT(Class<T> c, MapFunc<T> f) {} \n" +
"}\n" +
"public class Test {\n" +
" void test() {\n" +
@@ -9536,39 +9536,39 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"Snippet.java",
- "import java.io.IOException;\n" +
- "import java.io.InputStream;\n" +
- "import java.nio.file.Path;\n" +
- "import java.util.Map;\n" +
- "import java.util.concurrent.Callable;\n" +
- "import java.util.function.Function;\n" +
- "\n" +
- "interface EntityReader<T, S> { }\n" +
- "class ExtraIOUtils {\n" +
- " public static Callable<InputStream> getInputStreamProvider() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "public class Snippet {\n" +
- " public <T> EntityReader<T, Path> createEntityReader(\n" +
- " Function<? super String, ? extends String> colNameMapper,\n" +
- " Function<? super String[], ? extends T> instantiator,\n" +
- " Map<String, ?> runtimeValues)\n" +
- " throws IOException {\n" +
- " EntityReader<T, ?> streamReader =\n" +
- " createEntityStreamReader(\n" +
- " ExtraIOUtils.getInputStreamProvider(),\n" +
+ "import java.io.IOException;\n" +
+ "import java.io.InputStream;\n" +
+ "import java.nio.file.Path;\n" +
+ "import java.util.Map;\n" +
+ "import java.util.concurrent.Callable;\n" +
+ "import java.util.function.Function;\n" +
+ "\n" +
+ "interface EntityReader<T, S> { }\n" +
+ "class ExtraIOUtils {\n" +
+ " public static Callable<InputStream> getInputStreamProvider() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "public class Snippet {\n" +
+ " public <T> EntityReader<T, Path> createEntityReader(\n" +
+ " Function<? super String, ? extends String> colNameMapper,\n" +
+ " Function<? super String[], ? extends T> instantiator,\n" +
+ " Map<String, ?> runtimeValues)\n" +
+ " throws IOException {\n" +
+ " EntityReader<T, ?> streamReader =\n" +
+ " createEntityStreamReader(\n" +
+ " ExtraIOUtils.getInputStreamProvider(),\n" +
" colNameMapper, instantiator, runtimeValues);\n" +
- " return null;\n" +
- " }\n" +
- " public <T> EntityReader<T, Callable<InputStream>> createEntityStreamReader(\n" +
- " Callable<InputStream> streamProvider,\n" +
- " Function<? super String, ? extends String> colNameMapper, Function<? super String[], ? extends T> instantiator,\n" +
- " Map<String, ?> runtimeValues)\n" +
- " throws IOException {\n" +
- " return null;\n" +
- " }\n" +
+ " return null;\n" +
+ " }\n" +
+ " public <T> EntityReader<T, Callable<InputStream>> createEntityStreamReader(\n" +
+ " Callable<InputStream> streamProvider,\n" +
+ " Function<? super String, ? extends String> colNameMapper, Function<? super String[], ? extends T> instantiator,\n" +
+ " Map<String, ?> runtimeValues)\n" +
+ " throws IOException {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
});
}
@@ -9576,12 +9576,12 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " <T extends V, U extends T, V> void foo(U arg1, T arg2, V arg3) {}\n" +
- "\n" +
- " void check() {\n" +
- " foo((Long) 0l, 0d, \"\");\n" +
- " }\n" +
+ "public class X {\n" +
+ " <T extends V, U extends T, V> void foo(U arg1, T arg2, V arg3) {}\n" +
+ "\n" +
+ " void check() {\n" +
+ " foo((Long) 0l, 0d, \"\");\n" +
+ " }\n" +
"}\n"
});
}
@@ -9589,18 +9589,18 @@ public void testBug508834_comment0() {
Runner runner = new Runner();
runner.testFiles = new String[] {
"Test.java",
- "import java.util.stream.Collectors;\n" +
- "import java.util.stream.Stream;\n" +
- "\n" +
- "public class Test {\n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " println(Stream.of(42).collect(Collectors.summingDouble(d -> d))); \n" +
- " }\n" +
- " public static void println(double x) {}\n" +
- " public static void println(char[] x) {}\n" +
- " public static void println(String x) {}\n" +
- " public static void println(Object x) {} \n" +
+ "import java.util.stream.Collectors;\n" +
+ "import java.util.stream.Stream;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args)\n" +
+ " {\n" +
+ " println(Stream.of(42).collect(Collectors.summingDouble(d -> d))); \n" +
+ " }\n" +
+ " public static void println(double x) {}\n" +
+ " public static void println(char[] x) {}\n" +
+ " public static void println(String x) {}\n" +
+ " public static void println(Object x) {} \n" +
"}\n"
};
runner.runConformTest();
@@ -9609,22 +9609,22 @@ public void testBug508834_comment0() {
Runner runner = new Runner();
runner.testFiles = new String[] {
"Test.java",
- "import java.util.stream.Collectors;\n" +
- "import java.util.stream.Stream;\n" +
- "\n" +
+ "import java.util.stream.Collectors;\n" +
+ "import java.util.stream.Stream;\n" +
+ "\n" +
"public class Test {\n" +
- " char[] f;" +
- " public void test() {\n" +
- " f = Stream.of(42).collect(Collectors.summingDouble(d -> d)); \n" +
- " }\n" +
+ " char[] f;" +
+ " public void test() {\n" +
+ " f = Stream.of(42).collect(Collectors.summingDouble(d -> d)); \n" +
+ " }\n" +
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in Test.java (at line 6)\n" +
- " f = Stream.of(42).collect(Collectors.summingDouble(d -> d)); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Double to char[]\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 6)\n" +
+ " f = Stream.of(42).collect(Collectors.summingDouble(d -> d)); \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Double to char[]\n" +
"----------\n";
runner.runNegativeTest();
}
@@ -9632,59 +9632,59 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"TestFor3TypeParameters.java",
- "import java.util.Objects;\n" +
- "import java.util.stream.Stream;\n" +
- "import java.util.stream.StreamSupport;\n" +
- "\n" +
- "/**\n" +
- " * For comprehension for 3 iterables. Adapted from the http://javaslang.io library to help finding JDT performance bottlenecks.\n" +
- " *\n" +
- " */\n" +
- "public class TestFor3TypeParameters {\n" +
- "\n" +
- " public interface Function3<T1, T2, T3, R> {\n" +
- " R apply(T1 t1, T2 t2, T3 t3);\n" +
- " } \n" +
- " \n" +
- " public static class For3<T1, T2, T3> {\n" +
- "\n" +
- " private final Iterable<T1> ts1;\n" +
- " private final Iterable<T2> ts2;\n" +
- " private final Iterable<T3> ts3;\n" +
- "\n" +
- " private For3(Iterable<T1> ts1, Iterable<T2> ts2, Iterable<T3> ts3) {\n" +
- " this.ts1 = ts1;\n" +
- " this.ts2 = ts2;\n" +
- " this.ts3 = ts3;\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Yields a result for elements of the cross product of the underlying Iterables.\n" +
- " *\n" +
- " * @param f\n" +
- " * a function that maps an element of the cross product to a result\n" +
- " * @param <R>\n" +
- " * type of the resulting {@code Iterator} elements\n" +
- " * @return an {@code Iterator} of mapped results\n" +
- " */\n" +
- " public <R> Stream<R> yield(\n" +
- " Function3<? super T1, ? super T2, ? super T3, ? extends R> f) {\n" +
- " Objects.requireNonNull(f, \"f is null\");\n" +
- " return this.stream(ts1)\n" +
- " .flatMap(t1 ->\n" +
- " stream(ts2).flatMap(t2 -> \n" +
- " stream(ts3).map(t3 ->\n" +
- " f.apply(t1, t2, t3)\n" +
- " )\n" +
- " )\n" +
- " );\n" +
- " }\n" +
- "\n" +
- " private <T> Stream<T> stream(Iterable<T> iterable) {\n" +
- " return StreamSupport.stream(iterable.spliterator(), false);\n" +
- " }\n" +
- "\n" +
- " }\n" +
+ "import java.util.Objects;\n" +
+ "import java.util.stream.Stream;\n" +
+ "import java.util.stream.StreamSupport;\n" +
+ "\n" +
+ "/**\n" +
+ " * For comprehension for 3 iterables. Adapted from the http://javaslang.io library to help finding JDT performance bottlenecks.\n" +
+ " *\n" +
+ " */\n" +
+ "public class TestFor3TypeParameters {\n" +
+ "\n" +
+ " public interface Function3<T1, T2, T3, R> {\n" +
+ " R apply(T1 t1, T2 t2, T3 t3);\n" +
+ " } \n" +
+ " \n" +
+ " public static class For3<T1, T2, T3> {\n" +
+ "\n" +
+ " private final Iterable<T1> ts1;\n" +
+ " private final Iterable<T2> ts2;\n" +
+ " private final Iterable<T3> ts3;\n" +
+ "\n" +
+ " private For3(Iterable<T1> ts1, Iterable<T2> ts2, Iterable<T3> ts3) {\n" +
+ " this.ts1 = ts1;\n" +
+ " this.ts2 = ts2;\n" +
+ " this.ts3 = ts3;\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Yields a result for elements of the cross product of the underlying Iterables.\n" +
+ " *\n" +
+ " * @param f\n" +
+ " * a function that maps an element of the cross product to a result\n" +
+ " * @param <R>\n" +
+ " * type of the resulting {@code Iterator} elements\n" +
+ " * @return an {@code Iterator} of mapped results\n" +
+ " */\n" +
+ " public <R> Stream<R> yield(\n" +
+ " Function3<? super T1, ? super T2, ? super T3, ? extends R> f) {\n" +
+ " Objects.requireNonNull(f, \"f is null\");\n" +
+ " return this.stream(ts1)\n" +
+ " .flatMap(t1 ->\n" +
+ " stream(ts2).flatMap(t2 -> \n" +
+ " stream(ts3).map(t3 ->\n" +
+ " f.apply(t1, t2, t3)\n" +
+ " )\n" +
+ " )\n" +
+ " );\n" +
+ " }\n" +
+ "\n" +
+ " private <T> Stream<T> stream(Iterable<T> iterable) {\n" +
+ " return StreamSupport.stream(iterable.spliterator(), false);\n" +
+ " }\n" +
+ "\n" +
+ " }\n" +
"}\n"
});
}
@@ -9692,88 +9692,88 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"Test10.java",
- "import java.util.Objects;\n" +
- "import java.util.stream.Stream;\n" +
- "import java.util.stream.StreamSupport;\n" +
- "\n" +
- "/**\n" +
- " * For comprehension for 10 iterables. Adapted from the http://javaslang.io library to help finding JDT performance bottlenecks.\n" +
- " *\n" +
- " */\n" +
- "public class Test10 {\n" +
- "\n" +
- " public interface Function10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R> {\n" +
- " R apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10);\n" +
- " } \n" +
- " \n" +
- " public static class For10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> {\n" +
- "\n" +
- " private final Iterable<T1> ts1;\n" +
- " private final Iterable<T2> ts2;\n" +
- " private final Iterable<T3> ts3;\n" +
- " private final Iterable<T4> ts4;\n" +
- " private final Iterable<T5> ts5;\n" +
- " private final Iterable<T6> ts6;\n" +
- " private final Iterable<T7> ts7;\n" +
- " private final Iterable<T8> ts8;\n" +
- " private final Iterable<T9> ts9;\n" +
- " private final Iterable<T10> ts10;\n" +
- "\n" +
- " private For10(Iterable<T1> ts1, Iterable<T2> ts2, Iterable<T3> ts3, Iterable<T4> ts4, Iterable<T5> ts5, Iterable<T6> ts6,\n" +
- " Iterable<T7> ts7, Iterable<T8> ts8, Iterable<T9> ts9, Iterable<T10> ts10) {\n" +
- " this.ts1 = ts1;\n" +
- " this.ts2 = ts2;\n" +
- " this.ts3 = ts3;\n" +
- " this.ts4 = ts4;\n" +
- " this.ts5 = ts5;\n" +
- " this.ts6 = ts6;\n" +
- " this.ts7 = ts7;\n" +
- " this.ts8 = ts8;\n" +
- " this.ts9 = ts9;\n" +
- " this.ts10 = ts10;\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Yields a result for elements of the cross product of the underlying Iterables.\n" +
- " *\n" +
- " * @param f\n" +
- " * a function that maps an element of the cross product to a result\n" +
- " * @param <R>\n" +
- " * type of the resulting {@code Iterator} elements\n" +
- " * @return an {@code Iterator} of mapped results\n" +
- " */\n" +
- " public <R> Stream<R> yield(\n" +
- " Function10<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? extends R> f) {\n" +
- " Objects.requireNonNull(f, \"f is null\");\n" +
- " return this.stream(ts1)\n" +
- " .flatMap(t1 ->\n" +
- " stream(ts2).flatMap(t2 -> \n" +
- " stream(ts3).flatMap(t3 -> \n" +
- " stream(ts4).flatMap(t4 -> \n" +
- " stream(ts5).flatMap(t5 -> \n" +
- " stream(ts6).flatMap(t6 -> \n" +
- " stream(ts7).flatMap(t7 -> \n" +
- " stream(ts8).flatMap(t8 ->\n" +
- " stream(ts9).flatMap(t9 ->\n" +
- " stream(ts10).map(t10 -> /**/\n" +
- " f.apply(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10)\n" +
- " )\n" +
- " )\n" +
- " )\n" +
- " )\n" +
- " )\n" +
- " )\n" +
- " )\n" +
- " )\n" +
- " )\n" +
- " );\n" +
- " }\n" +
- "\n" +
- " private <T> Stream<T> stream(Iterable<T> iterable) {\n" +
- " return StreamSupport.stream(iterable.spliterator(), false);\n" +
- " }\n" +
- "\n" +
- " }\n" +
+ "import java.util.Objects;\n" +
+ "import java.util.stream.Stream;\n" +
+ "import java.util.stream.StreamSupport;\n" +
+ "\n" +
+ "/**\n" +
+ " * For comprehension for 10 iterables. Adapted from the http://javaslang.io library to help finding JDT performance bottlenecks.\n" +
+ " *\n" +
+ " */\n" +
+ "public class Test10 {\n" +
+ "\n" +
+ " public interface Function10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R> {\n" +
+ " R apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10);\n" +
+ " } \n" +
+ " \n" +
+ " public static class For10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> {\n" +
+ "\n" +
+ " private final Iterable<T1> ts1;\n" +
+ " private final Iterable<T2> ts2;\n" +
+ " private final Iterable<T3> ts3;\n" +
+ " private final Iterable<T4> ts4;\n" +
+ " private final Iterable<T5> ts5;\n" +
+ " private final Iterable<T6> ts6;\n" +
+ " private final Iterable<T7> ts7;\n" +
+ " private final Iterable<T8> ts8;\n" +
+ " private final Iterable<T9> ts9;\n" +
+ " private final Iterable<T10> ts10;\n" +
+ "\n" +
+ " private For10(Iterable<T1> ts1, Iterable<T2> ts2, Iterable<T3> ts3, Iterable<T4> ts4, Iterable<T5> ts5, Iterable<T6> ts6,\n" +
+ " Iterable<T7> ts7, Iterable<T8> ts8, Iterable<T9> ts9, Iterable<T10> ts10) {\n" +
+ " this.ts1 = ts1;\n" +
+ " this.ts2 = ts2;\n" +
+ " this.ts3 = ts3;\n" +
+ " this.ts4 = ts4;\n" +
+ " this.ts5 = ts5;\n" +
+ " this.ts6 = ts6;\n" +
+ " this.ts7 = ts7;\n" +
+ " this.ts8 = ts8;\n" +
+ " this.ts9 = ts9;\n" +
+ " this.ts10 = ts10;\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Yields a result for elements of the cross product of the underlying Iterables.\n" +
+ " *\n" +
+ " * @param f\n" +
+ " * a function that maps an element of the cross product to a result\n" +
+ " * @param <R>\n" +
+ " * type of the resulting {@code Iterator} elements\n" +
+ " * @return an {@code Iterator} of mapped results\n" +
+ " */\n" +
+ " public <R> Stream<R> yield(\n" +
+ " Function10<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? extends R> f) {\n" +
+ " Objects.requireNonNull(f, \"f is null\");\n" +
+ " return this.stream(ts1)\n" +
+ " .flatMap(t1 ->\n" +
+ " stream(ts2).flatMap(t2 -> \n" +
+ " stream(ts3).flatMap(t3 -> \n" +
+ " stream(ts4).flatMap(t4 -> \n" +
+ " stream(ts5).flatMap(t5 -> \n" +
+ " stream(ts6).flatMap(t6 -> \n" +
+ " stream(ts7).flatMap(t7 -> \n" +
+ " stream(ts8).flatMap(t8 ->\n" +
+ " stream(ts9).flatMap(t9 ->\n" +
+ " stream(ts10).map(t10 -> /**/\n" +
+ " f.apply(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10)\n" +
+ " )\n" +
+ " )\n" +
+ " )\n" +
+ " )\n" +
+ " )\n" +
+ " )\n" +
+ " )\n" +
+ " )\n" +
+ " )\n" +
+ " );\n" +
+ " }\n" +
+ "\n" +
+ " private <T> Stream<T> stream(Iterable<T> iterable) {\n" +
+ " return StreamSupport.stream(iterable.spliterator(), false);\n" +
+ " }\n" +
+ "\n" +
+ " }\n" +
"}\n"
});
}
@@ -9781,47 +9781,47 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"test2/Problematic.java",
- "package test2;\n" +
- "\n" +
- "import java.io.IOException;\n" +
- "import java.util.Collections;\n" +
- "import java.util.Set;\n" +
- "import java.util.function.Consumer;\n" +
- "\n" +
- "public class Problematic {\n" +
- "\n" +
- " @FunctionalInterface\n" +
- " private interface ThrowingConsumer<T, E extends Throwable> {\n" +
- " void accept(T t) throws E;\n" +
- " }\n" +
- "\n" +
- " private class FileAsset {\n" +
- " public FileAsset move(String path) throws IOException {\n" +
- " System.out.println(path);\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " static <T, E extends Exception> void process(Consumer<Consumer<T>> code, ThrowingConsumer<T, E> throwingConsumer)\n" +
- " throws E {\n" +
- " code.accept(t -> {\n" +
- " try {\n" +
- " throwingConsumer.accept(t);\n" +
- " } catch (Exception e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- "\n" +
- " public void execute(String path) throws IOException {\n" +
- " Set<FileAsset> set = Collections.singleton(new FileAsset());\n" +
- " process(set::forEach, (asset) -> {\n" +
- " process(set::forEach, (asset2) -> {\n" +
- " asset2.move(path);\n" +
- " });\n" +
- " });\n" +
- "\n" +
- " }\n" +
+ "package test2;\n" +
+ "\n" +
+ "import java.io.IOException;\n" +
+ "import java.util.Collections;\n" +
+ "import java.util.Set;\n" +
+ "import java.util.function.Consumer;\n" +
+ "\n" +
+ "public class Problematic {\n" +
+ "\n" +
+ " @FunctionalInterface\n" +
+ " private interface ThrowingConsumer<T, E extends Throwable> {\n" +
+ " void accept(T t) throws E;\n" +
+ " }\n" +
+ "\n" +
+ " private class FileAsset {\n" +
+ " public FileAsset move(String path) throws IOException {\n" +
+ " System.out.println(path);\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " static <T, E extends Exception> void process(Consumer<Consumer<T>> code, ThrowingConsumer<T, E> throwingConsumer)\n" +
+ " throws E {\n" +
+ " code.accept(t -> {\n" +
+ " try {\n" +
+ " throwingConsumer.accept(t);\n" +
+ " } catch (Exception e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
+ "\n" +
+ " public void execute(String path) throws IOException {\n" +
+ " Set<FileAsset> set = Collections.singleton(new FileAsset());\n" +
+ " process(set::forEach, (asset) -> {\n" +
+ " process(set::forEach, (asset2) -> {\n" +
+ " asset2.move(path);\n" +
+ " });\n" +
+ " });\n" +
+ "\n" +
+ " }\n" +
"}\n"
});
}
@@ -9829,29 +9829,29 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"Main.java",
- "public class Main {\n" +
- " public static void main(String[] args) { \n" +
- " System.out.println(new Main().getDetailCellCssFactory().getReturn());\n" +
- " }\n" +
- "\n" +
- " public FIReturnType getDetailCellCssFactory() {\n" +
- " \n" +
- " return method1(()-> {\n" +
- " return () ->{\n" +
- " return \"something\";\n" +
- " };\n" +
- " });\n" +
- " }\n" +
- " \n" +
- " public <X> X method1(FIWithGenerics<X> init) {\n" +
- " return init.init(); \n" +
- " }\n" +
- "}\n" +
- "interface FIReturnType {\n" +
- " String getReturn();\n" +
- "}\n" +
- "interface FIWithGenerics<X> {\n" +
- " X init();\n" +
+ "public class Main {\n" +
+ " public static void main(String[] args) { \n" +
+ " System.out.println(new Main().getDetailCellCssFactory().getReturn());\n" +
+ " }\n" +
+ "\n" +
+ " public FIReturnType getDetailCellCssFactory() {\n" +
+ " \n" +
+ " return method1(()-> {\n" +
+ " return () ->{\n" +
+ " return \"something\";\n" +
+ " };\n" +
+ " });\n" +
+ " }\n" +
+ " \n" +
+ " public <X> X method1(FIWithGenerics<X> init) {\n" +
+ " return init.init(); \n" +
+ " }\n" +
+ "}\n" +
+ "interface FIReturnType {\n" +
+ " String getReturn();\n" +
+ "}\n" +
+ "interface FIWithGenerics<X> {\n" +
+ " X init();\n" +
"}\n"
});
}
@@ -9859,50 +9859,50 @@ public void testBug508834_comment0() {
runNegativeTest(
new String[] {
"ECJTest.java",
- "import java.util.*;\n" +
- "import java.util.function.*;\n" +
- "\n" +
- "public class ECJTest {\n" +
- "\n" +
- " static {\n" +
- " final List<String> list = new ArrayList<>();\n" +
- " accept(list::add);\n" +
- " }\n" +
- "\n" +
- " static void accept(Consumer<String> yay) {};\n" +
- " static void accept(BiConsumer<String, String> nooo) {};\n" +
+ "import java.util.*;\n" +
+ "import java.util.function.*;\n" +
+ "\n" +
+ "public class ECJTest {\n" +
+ "\n" +
+ " static {\n" +
+ " final List<String> list = new ArrayList<>();\n" +
+ " accept(list::add);\n" +
+ " }\n" +
+ "\n" +
+ " static void accept(Consumer<String> yay) {};\n" +
+ " static void accept(BiConsumer<String, String> nooo) {};\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in ECJTest.java (at line 8)\n" +
- " accept(list::add);\n" +
- " ^^^^^^\n" +
- "The method accept(Consumer<String>) is ambiguous for the type ECJTest\n" +
+ "----------\n" +
+ "1. ERROR in ECJTest.java (at line 8)\n" +
+ " accept(list::add);\n" +
+ " ^^^^^^\n" +
+ "The method accept(Consumer<String>) is ambiguous for the type ECJTest\n" +
"----------\n");
}
public void testBug502327() {
runConformTest(
new String[] {
"Bug.java",
- "public class Bug {\n" +
- "\n" +
- " public void execute() {\n" +
- " foo(bar(new ExampleType()));\n" +
- " }\n" +
- "\n" +
- " public <VC> void foo(ClassB<VC> a) {}\n" +
- "\n" +
- " public <T> ClassC<T> bar(T t) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " public class ClassC<T> extends ClassB<ClassC<T>.NestedClassC> {\n" +
- " public class NestedClassC {}\n" +
- " }\n" +
- "\n" +
- " public abstract static class ClassB<VC> {}\n" +
- "\n" +
- " public class ExampleType {}\n" +
+ "public class Bug {\n" +
+ "\n" +
+ " public void execute() {\n" +
+ " foo(bar(new ExampleType()));\n" +
+ " }\n" +
+ "\n" +
+ " public <VC> void foo(ClassB<VC> a) {}\n" +
+ "\n" +
+ " public <T> ClassC<T> bar(T t) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " public class ClassC<T> extends ClassB<ClassC<T>.NestedClassC> {\n" +
+ " public class NestedClassC {}\n" +
+ " }\n" +
+ "\n" +
+ " public abstract static class ClassB<VC> {}\n" +
+ "\n" +
+ " public class ExampleType {}\n" +
"}\n"
});
}
@@ -9910,19 +9910,19 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"DslStep1.java",
- "public interface DslStep1 {\n" +
- " DslStep2<?> nextStep();\n" +
+ "public interface DslStep1 {\n" +
+ " DslStep2<?> nextStep();\n" +
"}\n",
"DslStep2.java",
- "public interface DslStep2<S extends DslStep2<? extends S>> {\n" +
- " S doSomething();\n" +
+ "public interface DslStep2<S extends DslStep2<? extends S>> {\n" +
+ " S doSomething();\n" +
"}\n",
"CallBug.java",
- "public class CallBug {\n" +
- " public void doesNotCompileWithEcj(DslStep1 step1) {\n" +
- " // Note we need three chained calls for the problem to show up. Two is not enough.\n" +
- " step1.nextStep().doSomething().doSomething().doSomething();\n" +
- " }\n" +
+ "public class CallBug {\n" +
+ " public void doesNotCompileWithEcj(DslStep1 step1) {\n" +
+ " // Note we need three chained calls for the problem to show up. Two is not enough.\n" +
+ " step1.nextStep().doSomething().doSomething().doSomething();\n" +
+ " }\n" +
"}\n"
});
}
@@ -9930,28 +9930,28 @@ public void testBug508834_comment0() {
runConformTest(
new String[] {
"InferenceCheck.java",
- "import java.util.*;\n" +
- "import java.util.function.*;\n" +
- "\n" +
- "public class InferenceCheck {\n" +
- "\n" +
- " public interface P<T> {\n" +
- "\n" +
- " public boolean apply(T value); \n" +
- " }\n" +
- "\n" +
- " public static <T> P<T> compilation_failed(P<T> predicate) {\n" +
- " List<P<T>> list = Collections.emptyList();\n" +
- " list.stream().map(InferenceCheck::compilation_failed);\n" +
- " return null;\n" +
- " } \n" +
- "\n" +
- " public static <T> P<T> compilation_ok(P<T> predicate) {\n" +
- " List<P<T>> list = Collections.emptyList();\n" +
- " Function<P<T>, P<T>> f = InferenceCheck::compilation_ok;\n" +
- " list.stream().map(f);\n" +
- " return null;\n" +
- " } \n" +
+ "import java.util.*;\n" +
+ "import java.util.function.*;\n" +
+ "\n" +
+ "public class InferenceCheck {\n" +
+ "\n" +
+ " public interface P<T> {\n" +
+ "\n" +
+ " public boolean apply(T value); \n" +
+ " }\n" +
+ "\n" +
+ " public static <T> P<T> compilation_failed(P<T> predicate) {\n" +
+ " List<P<T>> list = Collections.emptyList();\n" +
+ " list.stream().map(InferenceCheck::compilation_failed);\n" +
+ " return null;\n" +
+ " } \n" +
+ "\n" +
+ " public static <T> P<T> compilation_ok(P<T> predicate) {\n" +
+ " List<P<T>> list = Collections.emptyList();\n" +
+ " Function<P<T>, P<T>> f = InferenceCheck::compilation_ok;\n" +
+ " list.stream().map(f);\n" +
+ " return null;\n" +
+ " } \n" +
"}\n"
});
}
@@ -9960,50 +9960,50 @@ public void testBug508834_comment0() {
runNegativeTest(
new String[] {
"test/TODO.java",
- "package test;\n" +
- "public interface TODO {\n" +
- " boolean test();\n" +
+ "package test;\n" +
+ "public interface TODO {\n" +
+ " boolean test();\n" +
"}\n",
"test/FuncN.java",
- "package test;\n" +
- "\n" +
- "@FunctionalInterface\n" +
- "public interface FuncN {\n" +
- " State zip(State ...states);\n" +
+ "package test;\n" +
+ "\n" +
+ "@FunctionalInterface\n" +
+ "public interface FuncN {\n" +
+ " State zip(State ...states);\n" +
"}\n",
"test/Test.java",
- "package test;\n" +
- "public class Test {\n" +
- "\n" +
- " public static Test define(FuncN zipperFunc,TODO... tasks) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " public static Test define(TODO... tasks) {\n" +
- " return null;\n" +
- " }\n" +
+ "package test;\n" +
+ "public class Test {\n" +
+ "\n" +
+ " public static Test define(FuncN zipperFunc,TODO... tasks) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " public static Test define(TODO... tasks) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n",
"test/State.java",
- "package test;\n" +
- "public class State {\n" +
- " public static State mergeStates(State ...states) {\n" +
- " return null;\n" +
- " }\n" +
+ "package test;\n" +
+ "public class State {\n" +
+ " public static State mergeStates(State ...states) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n",
"test/Main.java",
- "package test;\n" +
- "\n" +
- "public class Main {\n" +
- " public static void main(String[] args) {\n" +
- " Test.define(State::mergeStates,()->true);\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "public class Main {\n" +
+ " public static void main(String[] args) {\n" +
+ " Test.define(State::mergeStates,()->true);\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in test\\Main.java (at line 5)\n" +
- " Test.define(State::mergeStates,()->true);\n" +
- " ^^^^^^\n" +
- "The method define(FuncN, TODO[]) is ambiguous for the type Test\n" +
+ "----------\n" +
+ "1. ERROR in test\\Main.java (at line 5)\n" +
+ " Test.define(State::mergeStates,()->true);\n" +
+ " ^^^^^^\n" +
+ "The method define(FuncN, TODO[]) is ambiguous for the type Test\n" +
"----------\n");
}
@@ -10036,7 +10036,7 @@ public void testBug508834_comment0() {
runner.shouldFlushOutputDirectory = false;
runner.testFiles = new String[] {
"p/X.java",
- sourceX
+ sourceX
};
runner.runConformTest(); // don't use pre-compiled p/X$1.class
}
@@ -10064,24 +10064,24 @@ public void testBug508834_comment0() {
Runner runner = new Runner();
runner.testFiles = new String[] {
"MyClass.java",
- "public class MyClass {\n" +
- " private void myRun() {\n" +
- " }\n" +
- " private void myMethod(final Runnable r) {\n" +
- " }\n" +
- " public void test() {\n" +
- " // second opening brace causes endless loop while saving\n" +
- " myMethod((this::myRun);\n" +
- " }\n" +
+ "public class MyClass {\n" +
+ " private void myRun() {\n" +
+ " }\n" +
+ " private void myMethod(final Runnable r) {\n" +
+ " }\n" +
+ " public void test() {\n" +
+ " // second opening brace causes endless loop while saving\n" +
+ " myMethod((this::myRun);\n" +
+ " }\n" +
"}\n"
};
runner.performStatementsRecovery = true;
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in MyClass.java (at line 8)\n" +
- " myMethod((this::myRun);\n" +
- " ^\n" +
- "Syntax error, insert \")\" to complete Expression\n" +
+ "----------\n" +
+ "1. ERROR in MyClass.java (at line 8)\n" +
+ " myMethod((this::myRun);\n" +
+ " ^\n" +
+ "Syntax error, insert \")\" to complete Expression\n" +
"----------\n";
runner.runNegativeTest();
}
@@ -10092,19 +10092,19 @@ public void testBug508834_comment0() {
"no/Demo.java",
"package no;\n" +
"public class Demo {\n" +
- " static void broken_method_dispatch_on_bounded_type_in_lambda_argument_with_Eclipse_compiler() {\n" +
- " WithMessageRecipients withRecipients = new Message(new EmailRecipient(\"Jane\", \"jane@example.com\"), new EmailRecipient(\"Joe\", \"joe@example.com\"));\n" +
- "\n" +
- " withRecipients.getMessageRecipients()\n" +
- " .stream()\n" +
- " .forEach(recipient -> System.out.println(recipient.getName() + \" <\" + recipient.getEmailAddress() + \">\"));\n" +
- " }\n" +
- " static void works_fine_in_for_loop() {\n" +
- " WithMessageRecipients withRecipients = new Message(new EmailRecipient(\"Jane\", \"jane@example.com\"), new EmailRecipient(\"Joe\", \"joe@example.com\"));\n" +
- "\n" +
- " for (var recipient : withRecipients.getMessageRecipients()) {\n" +
- " System.out.println(recipient.getName() + \" <\" + recipient.getEmailAddress() + \">\");\n" +
- " }\n" +
+ " static void broken_method_dispatch_on_bounded_type_in_lambda_argument_with_Eclipse_compiler() {\n" +
+ " WithMessageRecipients withRecipients = new Message(new EmailRecipient(\"Jane\", \"jane@example.com\"), new EmailRecipient(\"Joe\", \"joe@example.com\"));\n" +
+ "\n" +
+ " withRecipients.getMessageRecipients()\n" +
+ " .stream()\n" +
+ " .forEach(recipient -> System.out.println(recipient.getName() + \" <\" + recipient.getEmailAddress() + \">\"));\n" +
+ " }\n" +
+ " static void works_fine_in_for_loop() {\n" +
+ " WithMessageRecipients withRecipients = new Message(new EmailRecipient(\"Jane\", \"jane@example.com\"), new EmailRecipient(\"Joe\", \"joe@example.com\"));\n" +
+ "\n" +
+ " for (var recipient : withRecipients.getMessageRecipients()) {\n" +
+ " System.out.println(recipient.getName() + \" <\" + recipient.getEmailAddress() + \">\");\n" +
+ " }\n" +
" }\n" +
" public static void main(String... args) {\n" +
" works_fine_in_for_loop();\n" +
@@ -10112,77 +10112,77 @@ public void testBug508834_comment0() {
" }\n" +
"}\n",
"no/WithName.java",
- "package no;\n" +
- "public interface WithName {\n" +
- " String getName();\n" +
+ "package no;\n" +
+ "public interface WithName {\n" +
+ " String getName();\n" +
"}",
"no/WithEmailAddress.java",
- "package no;\n" +
- "public interface WithEmailAddress {\n" +
- " String getEmailAddress();\n" +
+ "package no;\n" +
+ "public interface WithEmailAddress {\n" +
+ " String getEmailAddress();\n" +
"}\n",
"no/WithMessageRecipients.java",
- "package no;\n" +
- "import java.util.List;\n" +
- "public interface WithMessageRecipients {\n" +
- " <CONTACT extends WithName & WithEmailAddress> List<? extends CONTACT> getMessageRecipients();\n" +
+ "package no;\n" +
+ "import java.util.List;\n" +
+ "public interface WithMessageRecipients {\n" +
+ " <CONTACT extends WithName & WithEmailAddress> List<? extends CONTACT> getMessageRecipients();\n" +
"}",
"no/EmailRecipient.java",
- "package no;\n" +
- "public class EmailRecipient implements WithName, WithEmailAddress {\n" +
- " private final String name;\n" +
- " private final String emailAddress;\n" +
- " public EmailRecipient(String name, String emailAddress) {\n" +
- " this.name = name;\n" +
- " this.emailAddress = emailAddress;\n" +
- " }\n" +
- " @Override\n" +
- " public String getEmailAddress() {\n" +
- " return emailAddress;\n" +
- " }\n" +
- " @Override\n" +
- " public String getName() {\n" +
- " return name;\n" +
- " }\n" +
+ "package no;\n" +
+ "public class EmailRecipient implements WithName, WithEmailAddress {\n" +
+ " private final String name;\n" +
+ " private final String emailAddress;\n" +
+ " public EmailRecipient(String name, String emailAddress) {\n" +
+ " this.name = name;\n" +
+ " this.emailAddress = emailAddress;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public String getEmailAddress() {\n" +
+ " return emailAddress;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public String getName() {\n" +
+ " return name;\n" +
+ " }\n" +
"}",
"no/Message.java",
- "package no;\n" +
- "import java.util.List;\n" +
- "public class Message implements WithMessageRecipients {\n" +
- " private final List<EmailRecipient> recipients;\n" +
- " public Message(EmailRecipient ... recipients) {\n" +
- " this.recipients = List.of(recipients);\n" +
- " }\n" +
- " @Override\n" +
- " public List<EmailRecipient> getMessageRecipients() {\n" +
- " return recipients;\n" +
- " }\n" +
+ "package no;\n" +
+ "import java.util.List;\n" +
+ "public class Message implements WithMessageRecipients {\n" +
+ " private final List<EmailRecipient> recipients;\n" +
+ " public Message(EmailRecipient ... recipients) {\n" +
+ " this.recipients = List.of(recipients);\n" +
+ " }\n" +
+ " @Override\n" +
+ " public List<EmailRecipient> getMessageRecipients() {\n" +
+ " return recipients;\n" +
+ " }\n" +
"}"
},
- "Jane <jane@example.com>\n" +
- "Joe <joe@example.com>\n" +
- "Jane <jane@example.com>\n" +
+ "Jane <jane@example.com>\n" +
+ "Joe <joe@example.com>\n" +
+ "Jane <jane@example.com>\n" +
"Joe <joe@example.com>");
}
public void testBug560566() {
runNegativeTest(
new String[] {
"Tester.java",
- "import java.util.ArrayList;\n" +
- "import java.util.stream.Collectors;\n" +
- "import java.util.stream.Stream;\n" +
- "\n" +
- "public class Tester {\n" +
- " {\n" +
- " Stream.empty().collect(Collectors.toList(ArrayList::new));\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "import java.util.stream.Stream;\n" +
+ "\n" +
+ "public class Tester {\n" +
+ " {\n" +
+ " Stream.empty().collect(Collectors.toList(ArrayList::new));\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in Tester.java (at line 7)\n" +
- " Stream.empty().collect(Collectors.toList(ArrayList::new));\n" +
- " ^^^^^^\n" +
- "The method toList() in the type Collectors is not applicable for the arguments (ArrayList::new)\n" +
+ "----------\n" +
+ "1. ERROR in Tester.java (at line 7)\n" +
+ " Stream.empty().collect(Collectors.toList(ArrayList::new));\n" +
+ " ^^^^^^\n" +
+ "The method toList() in the type Collectors is not applicable for the arguments (ArrayList::new)\n" +
"----------\n");
}
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_9.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_9.java
index 7dd6dce7b..ba91a25c7 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_9.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_9.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -95,16 +95,16 @@ public void testBug488663_002() {
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Y<String> y = new Y<>() {\n" +
- " ^^^^^\n" +
- "The type new Y<String>(){} must implement the inherited abstract method Y<String>.foo(String)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public void foo(T t) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " Y<String> y = new Y<>() {\n" +
+ " ^^^^^\n" +
+ "The type new Y<String>(){} must implement the inherited abstract method Y<String>.foo(String)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " public void foo(T t) {\n" +
+ " ^\n" +
+ "T cannot be resolved to a type\n" +
"----------\n");
}
@@ -163,12 +163,12 @@ public void testBug488663_005() {
"}\n",
},
"----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " Y<?> y = new Y<>() {};\n" +
- " ^\n" +
- "Type Y<I & J> inferred for Y<>, is not valid for an anonymous class with '<>'\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " Y<?> y = new Y<>() {};\n" +
+ " ^\n" +
+ "Type Y<I & J> inferred for Y<>, is not valid for an anonymous class with '<>'\n" +
"----------\n");
-
+
}
//compiler error for non-denotable anonymous type with diamond operator - negative test
@@ -188,38 +188,38 @@ public void testBug488663_006() {
"}\n",
},
"----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " Y<?> f = new Y<>(fi){};\n" +
- " ^\n" +
- "Type Y<Y<capture#1-of ? extends Integer>> inferred for Y<>, is not valid for an anonymous class with '<>'\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " Y<?> f = new Y<>(fi){};\n" +
+ " ^\n" +
+ "Type Y<Y<capture#1-of ? extends Integer>> inferred for Y<>, is not valid for an anonymous class with '<>'\n" +
"----------\n");
-
+
}
-// instantiate an interface using the anonymous diamond
+// instantiate an interface using the anonymous diamond
public void testBug488663_007() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " String name;\n" +
- " public X(String name) {\n" +
- " this.name = name;\n" +
- " }\n" +
- " String name() {\n" +
- " return this.name;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X x = new X(\"Success\");\n" +
- " I<X> i = new I<>() {\n" +
- " public String toString(X x1) {\n" +
- " return x1.name();\n" +
- " }\n" +
- " };\n" +
+ "public class X {\n" +
+ " String name;\n" +
+ " public X(String name) {\n" +
+ " this.name = name;\n" +
+ " }\n" +
+ " String name() {\n" +
+ " return this.name;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X x = new X(\"Success\");\n" +
+ " I<X> i = new I<>() {\n" +
+ " public String toString(X x1) {\n" +
+ " return x1.name();\n" +
+ " }\n" +
+ " };\n" +
" System.out.println(i.toString(x));\n" +
- " }\n" +
- "}\n" +
- "interface I<T> {\n" +
- " String toString(T t);\n" +
+ " }\n" +
+ "}\n" +
+ "interface I<T> {\n" +
+ " String toString(T t);\n" +
"}"
},
"Success");
@@ -229,28 +229,28 @@ public void testBug488663_008() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " String name;\n" +
- " public X(String name) {\n" +
- " this.name = name;\n" +
- " }\n" +
- " <T> void print(T o, I<T> converter) {\n" +
- " System.out.println(converter.toString(o));\n" +
- " }\n" +
- " String name() {\n" +
- " return this.name;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X x = new X(\"Success\");\n" +
- " x.print(x, new I<>() {\n" +
- " public String toString(X x1) {\n" +
- " return x1.name();\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- "}\n" +
- "interface I<T> {\n" +
- " String toString(T t);\n" +
+ "public class X {\n" +
+ " String name;\n" +
+ " public X(String name) {\n" +
+ " this.name = name;\n" +
+ " }\n" +
+ " <T> void print(T o, I<T> converter) {\n" +
+ " System.out.println(converter.toString(o));\n" +
+ " }\n" +
+ " String name() {\n" +
+ " return this.name;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X x = new X(\"Success\");\n" +
+ " x.print(x, new I<>() {\n" +
+ " public String toString(X x1) {\n" +
+ " return x1.name();\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
+ "}\n" +
+ "interface I<T> {\n" +
+ " String toString(T t);\n" +
"}"
},
"Success");
@@ -260,29 +260,29 @@ public void testBug488663_009() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " String name;\n" +
- " public X(String name) {\n" +
- " this.name = name;\n" +
- " }\n" +
- " <T> void print(T o, I<T> converter) {\n" +
- " System.out.println(converter.toString(o));\n" +
- " }\n" +
- " String name() {\n" +
- " return this.name;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X x = new X(\"Success\");\n" +
- " x.print(x, new Z<>() {\n" +
- " public String toString(X x1) {\n" +
- " return x1.name();\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- "}\n" +
- "interface I<T> {\n" +
- " String toString(T t);\n" +
- "}\n" +
+ "public class X {\n" +
+ " String name;\n" +
+ " public X(String name) {\n" +
+ " this.name = name;\n" +
+ " }\n" +
+ " <T> void print(T o, I<T> converter) {\n" +
+ " System.out.println(converter.toString(o));\n" +
+ " }\n" +
+ " String name() {\n" +
+ " return this.name;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X x = new X(\"Success\");\n" +
+ " x.print(x, new Z<>() {\n" +
+ " public String toString(X x1) {\n" +
+ " return x1.name();\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
+ "}\n" +
+ "interface I<T> {\n" +
+ " String toString(T t);\n" +
+ "}\n" +
"abstract class Z<T> implements I<T> {}\n"
},
"Success");
@@ -292,23 +292,23 @@ public void testBug488663_010() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " String name;\n" +
- " public X(String name) {\n" +
- " this.name = name;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " Y<String> y = new Y<>(() -> System.out.println(\"Done\")) {\n" +
- " };\n" +
- " }\n" +
- "}\n" +
- "interface J {\n" +
- " void doSomething();\n" +
- "}\n" +
- "class Y<T> {\n" +
- " public Y(J j) {\n" +
- " j.doSomething();\n" +
- " }\n" +
+ "public class X {\n" +
+ " String name;\n" +
+ " public X(String name) {\n" +
+ " this.name = name;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " Y<String> y = new Y<>(() -> System.out.println(\"Done\")) {\n" +
+ " };\n" +
+ " }\n" +
+ "}\n" +
+ "interface J {\n" +
+ " void doSomething();\n" +
+ "}\n" +
+ "class Y<T> {\n" +
+ " public Y(J j) {\n" +
+ " j.doSomething();\n" +
+ " }\n" +
"}",
},
"Done");
@@ -318,25 +318,25 @@ public void testBug488663_011() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " String name;\n" +
- " public X(String name) {\n" +
- " this.name = name;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " Y<String> y = new Y<>(Y::foo) {\n" +
- " };\n" +
- " }\n" +
- "}\n" +
- "interface J {\n" +
- " void doSomething();\n" +
- "}\n" +
- "class Y<T> {\n" +
- " public Y(J j) {\n" +
- " j.doSomething();\n" +
- " }\n" +
- " static void foo() {\n" +
- " System.out.println(\"Done\");\n" +
+ "public class X {\n" +
+ " String name;\n" +
+ " public X(String name) {\n" +
+ " this.name = name;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " Y<String> y = new Y<>(Y::foo) {\n" +
+ " };\n" +
+ " }\n" +
+ "}\n" +
+ "interface J {\n" +
+ " void doSomething();\n" +
+ "}\n" +
+ "class Y<T> {\n" +
+ " public Y(J j) {\n" +
+ " j.doSomething();\n" +
+ " }\n" +
+ " static void foo() {\n" +
+ " System.out.println(\"Done\");\n" +
" }\n" +
"}",
},
@@ -347,30 +347,30 @@ public void testBug488663_012() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " String name;\n" +
- " public X(String name) {\n" +
- " this.name = name;\n" +
- " }\n" +
- " String name() {\n" +
- " return this.name;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " Y<String> y = new Y<>(\"Done\", new I<>() {\n" +
- " public void doSomething(String s) {\n" +
- " System.out.println(s);\n" +
- " }\n" +
- " }){\n" +
- " };\n" +
- " }\n" +
- "}\n" +
- "interface I<T> {\n" +
- " void doSomething(T t);\n" +
- "}\n" +
- "class Y<T> {\n" +
- " public Y(T t, I<T> i) {\n" +
- " i.doSomething(t);\n" +
- " }\n" +
+ "public class X {\n" +
+ " String name;\n" +
+ " public X(String name) {\n" +
+ " this.name = name;\n" +
+ " }\n" +
+ " String name() {\n" +
+ " return this.name;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " Y<String> y = new Y<>(\"Done\", new I<>() {\n" +
+ " public void doSomething(String s) {\n" +
+ " System.out.println(s);\n" +
+ " }\n" +
+ " }){\n" +
+ " };\n" +
+ " }\n" +
+ "}\n" +
+ "interface I<T> {\n" +
+ " void doSomething(T t);\n" +
+ "}\n" +
+ "class Y<T> {\n" +
+ " public Y(T t, I<T> i) {\n" +
+ " i.doSomething(t);\n" +
+ " }\n" +
"}",
},
"Done");
@@ -382,34 +382,34 @@ public void testBug488663_013() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " String name;\n" +
- " public X(String name) {\n" +
- " this.name = name;\n" +
- " }\n" +
- " String name() {\n" +
- " return this.name;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X x = new X(\"Success\");\n" +
- " I<X> i = new I<X>() {\n" +
- " public String toString(X x1) {\n" +
- " return x1.name();\n" +
- " }\n" +
- " };\n" +
+ "public class X {\n" +
+ " String name;\n" +
+ " public X(String name) {\n" +
+ " this.name = name;\n" +
+ " }\n" +
+ " String name() {\n" +
+ " return this.name;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X x = new X(\"Success\");\n" +
+ " I<X> i = new I<X>() {\n" +
+ " public String toString(X x1) {\n" +
+ " return x1.name();\n" +
+ " }\n" +
+ " };\n" +
" System.out.println(i.toString(x));\n" +
- " }\n" +
- "}\n" +
- "interface I<T> {\n" +
- " String toString(T t);\n" +
+ " }\n" +
+ "}\n" +
+ "interface I<T> {\n" +
+ " String toString(T t);\n" +
"}"
},
"----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " I<X> i = new I<X>() {\n" +
- " ^\n" +
- "Redundant specification of type arguments <X>\n" +
- "----------\n",
+ "1. ERROR in X.java (at line 11)\n" +
+ " I<X> i = new I<X>() {\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <X>\n" +
+ "----------\n",
null, true, options);
}
// All non-private methods of an anonymous class instantiated with '<>' must be treated as being annotated with @override
@@ -417,40 +417,40 @@ public void testBug488663_014() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " String name;\n" +
- " public X(String name) {\n" +
- " this.name = name;\n" +
- " }\n" +
- " <T> void print(T o, I<T> converter) {\n" +
- " System.out.println(converter.toString(o));\n" +
- " }\n" +
- " String name() {\n" +
- " return this.name;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X x = new X(\"asdasfd\");\n" +
- " x.print(x, new Z<>() {\n" +
- " public String toString(String s) {\n" +
- " return s;\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- "}\n" +
- "interface I<T> {\n" +
+ "public class X {\n" +
+ " String name;\n" +
+ " public X(String name) {\n" +
+ " this.name = name;\n" +
+ " }\n" +
+ " <T> void print(T o, I<T> converter) {\n" +
+ " System.out.println(converter.toString(o));\n" +
+ " }\n" +
+ " String name() {\n" +
+ " return this.name;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X x = new X(\"asdasfd\");\n" +
+ " x.print(x, new Z<>() {\n" +
+ " public String toString(String s) {\n" +
+ " return s;\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
+ "}\n" +
+ "interface I<T> {\n" +
" String toString(T t);\n" +
- "}\n" +
+ "}\n" +
"class Z<T> implements I<T> {\n" +
- " public String toString(T t) {\n" +
- " return \"\";\n" +
- " }\n" +
+ " public String toString(T t) {\n" +
+ " return \"\";\n" +
+ " }\n" +
"}",
},
"----------\n" +
- "1. ERROR in X.java (at line 15)\n" +
- " public String toString(String s) {\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The method toString(String) of type new Z<X>(){} must override or implement a supertype method\n" +
+ "1. ERROR in X.java (at line 15)\n" +
+ " public String toString(String s) {\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "The method toString(String) of type new Z<X>(){} must override or implement a supertype method\n" +
"----------\n");
}
// Inaccessible type inferred for anonymous diamond is an error
@@ -458,40 +458,40 @@ public void testBug488663_015() {
this.runNegativeTest(
new String[] {
"Test.java",
- "public class Test<T> {\n" +
+ "public class Test<T> {\n" +
" private static class Inner {" +
- " public Inner(){}\n" +
- " }\n" +
- " <R> void print(I<R> i) {}\n" +
- " public Inner get() {\n" +
- " return new Inner();\n" +
- " }\n" +
+ " public Inner(){}\n" +
+ " }\n" +
+ " <R> void print(I<R> i) {}\n" +
+ " public Inner get() {\n" +
+ " return new Inner();\n" +
+ " }\n" +
"}\n",
"Z.java",
- "class Z<T> implements I<T> {\n" +
- " public Z(T t1) {}\n" +
- " public String toString (T t) {\n" +
- " return t.toString();\n" +
- " }\n" +
+ "class Z<T> implements I<T> {\n" +
+ " public Z(T t1) {}\n" +
+ " public String toString (T t) {\n" +
+ " return t.toString();\n" +
+ " }\n" +
"}",
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Test<String> t = new Test<>();\n" +
- " t.print(new Z<>(t.get()) {\n" +
- " \n" +
- " });\n" +
- " }\n" +
- "}\n" +
- "interface I<T> {\n" +
- " String toString();\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Test<String> t = new Test<>();\n" +
+ " t.print(new Z<>(t.get()) {\n" +
+ " \n" +
+ " });\n" +
+ " }\n" +
+ "}\n" +
+ "interface I<T> {\n" +
+ " String toString();\n" +
"}"
},
"----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " t.print(new Z<>(t.get()) {\n" +
- " ^^^^^^^^^^^^\n" +
- "The type Test$Inner is not visible\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " t.print(new Z<>(t.get()) {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The type Test$Inner is not visible\n" +
"----------\n");
}
// Inaccessible type inferred for anonymous diamond is an error - interface case
@@ -499,35 +499,35 @@ public void testBug488663_016() {
this.runNegativeTest(
new String[] {
"Test.java",
- "public class Test<T> {\n" +
+ "public class Test<T> {\n" +
" private static class Inner {" +
- " public Inner(){}\n" +
- " }\n" +
- " <R extends Inner> void print(I<R> i) {}\n" +
- " public Inner get() {\n" +
- " return new Inner();\n" +
- " }\n" +
+ " public Inner(){}\n" +
+ " }\n" +
+ " <R extends Inner> void print(I<R> i) {}\n" +
+ " public Inner get() {\n" +
+ " return new Inner();\n" +
+ " }\n" +
"}\n",
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Test<String> t = new Test<>();\n" +
- " t.print(new I<>() {\n" +
- " public String toString() {\n" +
- " return \"\";\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- "}\n" +
- "interface I<T> {\n" +
- " String toString();\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Test<String> t = new Test<>();\n" +
+ " t.print(new I<>() {\n" +
+ " public String toString() {\n" +
+ " return \"\";\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
+ "}\n" +
+ "interface I<T> {\n" +
+ " String toString();\n" +
"}"
},
"----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " t.print(new I<>() {\n" +
- " ^^^^^\n" +
- "The type Test$Inner is not visible\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " t.print(new I<>() {\n" +
+ " ^^^^^\n" +
+ "The type Test$Inner is not visible\n" +
"----------\n");
}
// All non-private methods of an anonymous class instantiated with '<>' must be treated as being annotated with @override
@@ -535,38 +535,38 @@ public void testBug517926() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " String name;\n" +
- " public X(String name) {\n" +
- " this.name = name;\n" +
- " }\n" +
- " <T> void print(T o, I<T> converter) {\n" +
- " System.out.println(converter.toString(o));\n" +
- " }\n" +
- " String name() {\n" +
- " return this.name;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X x = new X(\"asdasfd\");\n" +
- " x.print(x, new I<>() {\n" +
+ "public class X {\n" +
+ " String name;\n" +
+ " public X(String name) {\n" +
+ " this.name = name;\n" +
+ " }\n" +
+ " <T> void print(T o, I<T> converter) {\n" +
+ " System.out.println(converter.toString(o));\n" +
+ " }\n" +
+ " String name() {\n" +
+ " return this.name;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X x = new X(\"asdasfd\");\n" +
+ " x.print(x, new I<>() {\n" +
" public String name() {return null;}\n" +
- " public String toString(X xx) {\n" +
- " return xx.toString();\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- "}\n" +
- "interface I<T> {\n" +
+ " public String toString(X xx) {\n" +
+ " return xx.toString();\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
+ "}\n" +
+ "interface I<T> {\n" +
"private String name() {return null;}" +
" String toString(T t);\n" +
"default String getName() {return name();}" +
"}",
},
"----------\n" +
- "1. ERROR in X.java (at line 15)\n" +
- " public String name() {return null;}\n" +
- " ^^^^^^\n" +
- "The method name() of type new I<X>(){} must override or implement a supertype method\n" +
+ "1. ERROR in X.java (at line 15)\n" +
+ " public String name() {return null;}\n" +
+ " ^^^^^^\n" +
+ "The method name() of type new I<X>(){} must override or implement a supertype method\n" +
"----------\n");
}
public void testBug521815a() {
@@ -588,11 +588,11 @@ public void testBug521815a() {
" Inner t;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in a\\Y.java (at line 4)\n" +
- " Inner t;\n" +
- " ^^^^^\n" +
- "The type Inner is ambiguous\n" +
+ "----------\n" +
+ "1. ERROR in a\\Y.java (at line 4)\n" +
+ " Inner t;\n" +
+ " ^^^^^\n" +
+ "The type Inner is ambiguous\n" +
"----------\n");
}
public void testBug521815b() {
@@ -616,56 +616,56 @@ public void testBug521815b() {
"public class Y {;\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in a\\Y.java (at line 2)\n" +
- " import static a.b.X.Inner;\n" +
- " ^^^^^^^^^^^\n" +
- "The import a.b.X.Inner is never used\n" +
+ "----------\n" +
+ "1. WARNING in a\\Y.java (at line 2)\n" +
+ " import static a.b.X.Inner;\n" +
+ " ^^^^^^^^^^^\n" +
+ "The import a.b.X.Inner is never used\n" +
"----------\n");
}
public void testBug533644() {
runConformTest(
new String[] {
"q/JobDetail.java",
- "package q;\n" +
- "import java.io.Serializable;\n" +
+ "package q;\n" +
+ "import java.io.Serializable;\n" +
"public interface JobDetail extends Serializable, Cloneable { }\n",
"q/Scheduler.java",
- "package q;\n" +
- "import java.util.Map;\n" +
- "import java.util.Set;\n" +
- "public interface Scheduler {\n" +
- " void scheduleJobs(Map<JobDetail, Set<? extends Trigger>> triggersAndJobs, boolean replace) throws SchedulerException;\n" +
+ "package q;\n" +
+ "import java.util.Map;\n" +
+ "import java.util.Set;\n" +
+ "public interface Scheduler {\n" +
+ " void scheduleJobs(Map<JobDetail, Set<? extends Trigger>> triggersAndJobs, boolean replace) throws SchedulerException;\n" +
"}\n",
"q/SchedulerException.java",
- "package q;\n" +
- "public class SchedulerException extends Exception {\n" +
- " private static final long serialVersionUID = 174841398690789156L;\n" +
+ "package q;\n" +
+ "public class SchedulerException extends Exception {\n" +
+ " private static final long serialVersionUID = 174841398690789156L;\n" +
"}\n",
"q/Trigger.java",
- "package q;\n" +
- "import java.io.Serializable;\n" +
- "public interface Trigger extends Serializable, Cloneable, Comparable<Trigger> {\n" +
- " public static final long serialVersionUID = -3904243490805975570L;\n" +
+ "package q;\n" +
+ "import java.io.Serializable;\n" +
+ "public interface Trigger extends Serializable, Cloneable, Comparable<Trigger> {\n" +
+ " public static final long serialVersionUID = -3904243490805975570L;\n" +
"}\n"
});
Runner runner = new Runner();
runner.shouldFlushOutputDirectory = false;
runner.testFiles = new String[] {
"ForwardingScheduler.java",
- "import java.util.Map;\n" +
- "import java.util.Set;\n" +
- "\n" +
- "import q.JobDetail;\n" +
- "import q.Scheduler;\n" +
- "import q.SchedulerException;\n" +
- "import q.Trigger;\n" +
- "\n" +
- "public class ForwardingScheduler implements Scheduler {\n" +
- " @Override\n" +
- " public void scheduleJobs(Map<JobDetail, Set<? extends Trigger>> triggersAndJobs, boolean replace)\n" +
- " throws SchedulerException {\n" +
- " }\n" +
+ "import java.util.Map;\n" +
+ "import java.util.Set;\n" +
+ "\n" +
+ "import q.JobDetail;\n" +
+ "import q.Scheduler;\n" +
+ "import q.SchedulerException;\n" +
+ "import q.Trigger;\n" +
+ "\n" +
+ "public class ForwardingScheduler implements Scheduler {\n" +
+ " @Override\n" +
+ " public void scheduleJobs(Map<JobDetail, Set<? extends Trigger>> triggersAndJobs, boolean replace)\n" +
+ " throws SchedulerException {\n" +
+ " }\n" +
"}\n"
};
runner.runConformTest();
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GrammarCoverageTests308.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GrammarCoverageTests308.java
index 585f42d12..708b1a723 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GrammarCoverageTests308.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GrammarCoverageTests308.java
@@ -20,7 +20,7 @@ import junit.framework.Test;
@SuppressWarnings({ "rawtypes" })
public class GrammarCoverageTests308 extends AbstractRegressionTest {
- static {
+ static {
// TESTS_NUMBERS = new int [] { 35 };
// TESTS_NAMES = new String [] { "testnew" };
}
@@ -41,21 +41,21 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
"public class X extends @Marker @SingleMember(0) @Normal(Value = 0) Object {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X extends @Marker @SingleMember(0) @Normal(Value = 0) Object {\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " public class X extends @Marker @SingleMember(0) @Normal(Value = 0) Object {\n" +
- " ^^^^^^^^^^^^\n" +
- "SingleMember cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 1)\n" +
- " public class X extends @Marker @SingleMember(0) @Normal(Value = 0) Object {\n" +
- " ^^^^^^\n" +
- "Normal cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X extends @Marker @SingleMember(0) @Normal(Value = 0) Object {\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 1)\n" +
+ " public class X extends @Marker @SingleMember(0) @Normal(Value = 0) Object {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "SingleMember cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 1)\n" +
+ " public class X extends @Marker @SingleMember(0) @Normal(Value = 0) Object {\n" +
+ " ^^^^^^\n" +
+ "Normal cannot be resolved to a type\n" +
"----------\n");
}
// FieldDeclaration ::= Modifiersopt Type VariableDeclarators ';'
@@ -69,7 +69,7 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
"}\n" +
"@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_PARAMETER)\n" +
"@interface Marker {}\n",
-
+
"java/lang/annotation/ElementType.java",
"package java.lang.annotation;\n"+
"public enum ElementType {\n" +
@@ -85,16 +85,16 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" TYPE_USE\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " @Marker int x;\n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " @Marker int x;\n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// TYPE: MethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
@@ -108,7 +108,7 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
"}\n" +
"@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_PARAMETER)\n" +
"@interface Marker {}\n",
-
+
"java/lang/annotation/ElementType.java",
"package java.lang.annotation;\n"+
"public enum ElementType {\n" +
@@ -124,21 +124,21 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" TYPE_USE\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " @Marker <T> @Marker int x() { return 10; };\n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " @Marker <T> @Marker int x() { return 10; };\n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " @Marker <T> @Marker int x() { return 10; };\n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " @Marker <T> @Marker int x() { return 10; };\n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// TYPE: MethodHeaderName ::= Modifiersopt Type 'Identifier' '('
@@ -152,7 +152,7 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
"}\n" +
"@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_PARAMETER)\n" +
"@interface Marker {}\n",
-
+
"java/lang/annotation/ElementType.java",
"package java.lang.annotation;\n"+
"public enum ElementType {\n" +
@@ -168,16 +168,16 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" TYPE_USE\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " @Marker int x() { return 10; };\n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " @Marker int x() { return 10; };\n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// FormalParameter ::= Modifiersopt Type VariableDeclaratorIdOrThis
@@ -191,7 +191,7 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
"}\n" +
"@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_PARAMETER)\n" +
"@interface Marker {}\n",
-
+
"java/lang/annotation/ElementType.java",
"package java.lang.annotation;\n"+
"public enum ElementType {\n" +
@@ -207,16 +207,16 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" TYPE_USE\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " int x(@Marker int p) { return 10; };\n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " int x(@Marker int p) { return 10; };\n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// FormalParameter ::= Modifiersopt Type PushZeroTypeAnnotations '...' VariableDeclaratorIdOrThis
@@ -230,7 +230,7 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
"}\n" +
"@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_PARAMETER)\n" +
"@interface Marker {}\n",
-
+
"java/lang/annotation/ElementType.java",
"package java.lang.annotation;\n"+
"public enum ElementType {\n" +
@@ -246,16 +246,16 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" TYPE_USE\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " int x(@Marker int ... p) { return 10; };\n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " int x(@Marker int ... p) { return 10; };\n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// FormalParameter ::= Modifiersopt Type @308... TypeAnnotations '...' VariableDeclaratorIdOrThis
@@ -268,21 +268,21 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" Zork z;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " int x(@Marker int [] @Marker ... p) { return 10; };\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " int x(@Marker int [] @Marker ... p) { return 10; };\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " int x(@Marker int [] @Marker ... p) { return 10; };\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " int x(@Marker int [] @Marker ... p) { return 10; };\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// UnionType ::= Type
@@ -301,23 +301,23 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" Zork z;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " } catch (@Marker NullPointerException | @Marker ArrayIndexOutOfBoundsException e) {\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " } catch (@Marker NullPointerException | @Marker ArrayIndexOutOfBoundsException e) {\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " } catch (@Marker NullPointerException | @Marker ArrayIndexOutOfBoundsException e) {\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " } catch (@Marker NullPointerException | @Marker ArrayIndexOutOfBoundsException e) {\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
- }
+ }
// LocalVariableDeclaration ::= Type PushModifiers VariableDeclarators
// LocalVariableDeclaration ::= Modifiers Type PushRealModifiers VariableDeclarators
public void test008() throws Exception {
@@ -335,7 +335,7 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
"}\n" +
"@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_PARAMETER)\n" +
"@interface Marker {}\n",
-
+
"java/lang/annotation/ElementType.java",
"package java.lang.annotation;\n"+
"public enum ElementType {\n" +
@@ -351,26 +351,26 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" TYPE_USE\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " @Marker int p;\n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " final @Marker int q;\n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " @Marker final int r;\n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " @Marker int p;\n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " final @Marker int q;\n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " @Marker final int r;\n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// Resource ::= Type PushModifiers VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializer RestoreDiet ExitVariableWithInitialization
@@ -389,7 +389,7 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
"}\n" +
"@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_PARAMETER)\n" +
"@interface Marker {}\n",
-
+
"java/lang/annotation/ElementType.java",
"package java.lang.annotation;\n"+
"public enum ElementType {\n" +
@@ -405,41 +405,41 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" TYPE_USE\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " try (@Marker Integer p = null; final @Marker Integer q = null; @Marker final Integer r = null) {\n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " try (@Marker Integer p = null; final @Marker Integer q = null; @Marker final Integer r = null) {\n" +
- " ^^^^^^^\n" +
- "The resource type Integer does not implement java.lang.AutoCloseable\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " try (@Marker Integer p = null; final @Marker Integer q = null; @Marker final Integer r = null) {\n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 3)\n" +
- " try (@Marker Integer p = null; final @Marker Integer q = null; @Marker final Integer r = null) {\n" +
- " ^^^^^^^\n" +
- "The resource type Integer does not implement java.lang.AutoCloseable\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 3)\n" +
- " try (@Marker Integer p = null; final @Marker Integer q = null; @Marker final Integer r = null) {\n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 3)\n" +
- " try (@Marker Integer p = null; final @Marker Integer q = null; @Marker final Integer r = null) {\n" +
- " ^^^^^^^\n" +
- "The resource type Integer does not implement java.lang.AutoCloseable\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 7)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " try (@Marker Integer p = null; final @Marker Integer q = null; @Marker final Integer r = null) {\n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " try (@Marker Integer p = null; final @Marker Integer q = null; @Marker final Integer r = null) {\n" +
+ " ^^^^^^^\n" +
+ "The resource type Integer does not implement java.lang.AutoCloseable\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " try (@Marker Integer p = null; final @Marker Integer q = null; @Marker final Integer r = null) {\n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 3)\n" +
+ " try (@Marker Integer p = null; final @Marker Integer q = null; @Marker final Integer r = null) {\n" +
+ " ^^^^^^^\n" +
+ "The resource type Integer does not implement java.lang.AutoCloseable\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 3)\n" +
+ " try (@Marker Integer p = null; final @Marker Integer q = null; @Marker final Integer r = null) {\n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 3)\n" +
+ " try (@Marker Integer p = null; final @Marker Integer q = null; @Marker final Integer r = null) {\n" +
+ " ^^^^^^^\n" +
+ "The resource type Integer does not implement java.lang.AutoCloseable\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 7)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// EnhancedForStatementHeaderInit ::= 'for' '(' Type PushModifiers Identifier Dimsopt
@@ -459,7 +459,7 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
"}\n" +
"@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_PARAMETER)\n" +
"@interface Marker {}\n",
-
+
"java/lang/annotation/ElementType.java",
"package java.lang.annotation;\n"+
"public enum ElementType {\n" +
@@ -475,28 +475,28 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" TYPE_USE\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " for (@Marker int i: new int[3]) {}\n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " for (final @Marker int i: new int[3]) {}\n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " for (@Marker final int i: new int[3]) {}\n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " for (@Marker int i: new int[3]) {}\n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " for (final @Marker int i: new int[3]) {}\n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " for (@Marker final int i: new int[3]) {}\n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
- }
+ }
// AnnotationMethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
// AnnotationMethodHeaderName ::= Modifiersopt Type 'Identifier' '('
public void test011() throws Exception {
@@ -511,10 +511,10 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" @Marker <T> @Marker String value5(); \n" +
" @Marker public <T> @Marker String value6(); \n" +
"}\n" +
-
+
"@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_PARAMETER)\n" +
"@interface Marker {}\n",
-
+
"java/lang/annotation/ElementType.java",
"package java.lang.annotation;\n"+
"public enum ElementType {\n" +
@@ -530,66 +530,66 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" TYPE_USE\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public @Marker String value(); \n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " @Marker String value2(); \n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " @Marker public String value3(); \n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " public @Marker <T> @Marker String value4(); \n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 5)\n" +
- " public @Marker <T> @Marker String value4(); \n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 5)\n" +
- " public @Marker <T> @Marker String value4(); \n" +
- " ^^^^^^^^\n" +
- "Annotation attributes cannot be generic\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 6)\n" +
- " @Marker <T> @Marker String value5(); \n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 6)\n" +
- " @Marker <T> @Marker String value5(); \n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 6)\n" +
- " @Marker <T> @Marker String value5(); \n" +
- " ^^^^^^^^\n" +
- "Annotation attributes cannot be generic\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 7)\n" +
- " @Marker public <T> @Marker String value6(); \n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
- "----------\n" +
- "11. ERROR in X.java (at line 7)\n" +
- " @Marker public <T> @Marker String value6(); \n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "12. ERROR in X.java (at line 7)\n" +
- " @Marker public <T> @Marker String value6(); \n" +
- " ^^^^^^^^\n" +
- "Annotation attributes cannot be generic\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public @Marker String value(); \n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " @Marker String value2(); \n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " @Marker public String value3(); \n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " public @Marker <T> @Marker String value4(); \n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 5)\n" +
+ " public @Marker <T> @Marker String value4(); \n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 5)\n" +
+ " public @Marker <T> @Marker String value4(); \n" +
+ " ^^^^^^^^\n" +
+ "Annotation attributes cannot be generic\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 6)\n" +
+ " @Marker <T> @Marker String value5(); \n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 6)\n" +
+ " @Marker <T> @Marker String value5(); \n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 6)\n" +
+ " @Marker <T> @Marker String value5(); \n" +
+ " ^^^^^^^^\n" +
+ "Annotation attributes cannot be generic\n" +
+ "----------\n" +
+ "10. ERROR in X.java (at line 7)\n" +
+ " @Marker public <T> @Marker String value6(); \n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "11. ERROR in X.java (at line 7)\n" +
+ " @Marker public <T> @Marker String value6(); \n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "12. ERROR in X.java (at line 7)\n" +
+ " @Marker public <T> @Marker String value6(); \n" +
+ " ^^^^^^^^\n" +
+ "Annotation attributes cannot be generic\n" +
"----------\n");
}
// PrimaryNoNewArray ::= PrimitiveType Dims '.' 'class'
@@ -605,26 +605,26 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Object o = @Marker int.class;\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " Object o2 = @Marker int @Marker[] [] @Marker[].class;\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " Object o2 = @Marker int @Marker[] [] @Marker[].class;\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 4)\n" +
- " Object o2 = @Marker int @Marker[] [] @Marker[].class;\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " Object o = @Marker int.class;\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " Object o2 = @Marker int @Marker[] [] @Marker[].class;\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " Object o2 = @Marker int @Marker[] [] @Marker[].class;\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 4)\n" +
+ " Object o2 = @Marker int @Marker[] [] @Marker[].class;\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
// ReferenceExpression ::= PrimitiveType Dims '::' NonWildTypeArgumentsopt IdentifierOrNew
@@ -642,26 +642,26 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " I i = @Marker int @Marker []::<String>clone;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " I i = @Marker int @Marker []::<String>clone;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " I i = @Marker int @Marker []::<String>clone;\n" +
- " ^^^^^^\n" +
- "Unused type arguments for the non generic method clone() of type Object; it should not be parameterized with arguments <String>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " I i = @Marker int @Marker []::<String>clone;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " I i = @Marker int @Marker []::<String>clone;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " I i = @Marker int @Marker []::<String>clone;\n" +
+ " ^^^^^^\n" +
+ "Unused type arguments for the non generic method clone() of type Object; it should not be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// ArrayCreationWithoutArrayInitializer ::= 'new' PrimitiveType DimWithOrWithOutExprs
@@ -678,31 +678,31 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " int i [] = new @Marker int @Marker [4];\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " int i [] = new @Marker int @Marker [4];\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " int j [] = new @Marker int @Marker [] { 10 };\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 4)\n" +
- " int j [] = new @Marker int @Marker [] { 10 };\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " int i [] = new @Marker int @Marker [4];\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " int i [] = new @Marker int @Marker [4];\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " int j [] = new @Marker int @Marker [] { 10 };\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 4)\n" +
+ " int j [] = new @Marker int @Marker [] { 10 };\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 5)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// CastExpression ::= PushLPAREN PrimitiveType Dimsopt PushRPAREN InsideCastExpression UnaryExpression
@@ -718,26 +718,26 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " int i = (@Marker int) 0;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " int j [] = (@Marker int @Marker []) null;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " int j [] = (@Marker int @Marker []) null;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " int i = (@Marker int) 0;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " int j [] = (@Marker int @Marker []) null;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " int j [] = (@Marker int @Marker []) null;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// InstanceofExpression ::= InstanceofExpression 'instanceof' ReferenceType
@@ -752,16 +752,16 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " if (args instanceof @Readonly String) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Incompatible conditional operand types String[] and String\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " if (args instanceof @Readonly String) {\n" +
- " ^^^^^^^^\n" +
- "Readonly cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " if (args instanceof @Readonly String) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Incompatible conditional operand types String[] and String\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " if (args instanceof @Readonly String) {\n" +
+ " ^^^^^^^^\n" +
+ "Readonly cannot be resolved to a type\n" +
"----------\n");
}
// TypeArgument ::= ReferenceType
@@ -774,16 +774,16 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" Zork z;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X extends Y<@Marker Integer, String> {}\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X extends Y<@Marker Integer, String> {}\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// ReferenceType1 ::= ReferenceType '>'
@@ -796,19 +796,19 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" Zork z;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X extends Y<@Marker Integer> {}\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X extends Y<@Marker Integer> {}\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
-
+
// ReferenceType2 ::= ReferenceType '>>'
public void test019() throws Exception {
this.runNegativeTest(
@@ -819,16 +819,16 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" Zork z;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<T extends Object & Comparable<? super @Marker String>> {}\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X<T extends Object & Comparable<? super @Marker String>> {}\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// ReferenceType3 ::= ReferenceType '>>>'
@@ -841,31 +841,31 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" Zork z;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<A extends X<X<X<@Marker String>>>> {}\n" +
- " ^\n" +
- "Bound mismatch: The type X<X<String>> is not a valid substitute for the bounded parameter <A extends X<X<X<String>>>> of the type X<A>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " public class X<A extends X<X<X<@Marker String>>>> {}\n" +
- " ^\n" +
- "Bound mismatch: The type X<String> is not a valid substitute for the bounded parameter <A extends X<X<X<String>>>> of the type X<A>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 1)\n" +
- " public class X<A extends X<X<X<@Marker String>>>> {}\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Bound mismatch: The type String is not a valid substitute for the bounded parameter <A extends X<X<X<String>>>> of the type X<A>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 1)\n" +
- " public class X<A extends X<X<X<@Marker String>>>> {}\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 3)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X<A extends X<X<X<@Marker String>>>> {}\n" +
+ " ^\n" +
+ "Bound mismatch: The type X<X<String>> is not a valid substitute for the bounded parameter <A extends X<X<X<String>>>> of the type X<A>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 1)\n" +
+ " public class X<A extends X<X<X<@Marker String>>>> {}\n" +
+ " ^\n" +
+ "Bound mismatch: The type X<String> is not a valid substitute for the bounded parameter <A extends X<X<X<String>>>> of the type X<A>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 1)\n" +
+ " public class X<A extends X<X<X<@Marker String>>>> {}\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Bound mismatch: The type String is not a valid substitute for the bounded parameter <A extends X<X<X<String>>>> of the type X<A>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 1)\n" +
+ " public class X<A extends X<X<X<@Marker String>>>> {}\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 3)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// WildcardBounds ::= 'extends' ReferenceType
@@ -879,56 +879,56 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" void goo(Map<@Marker ? extends @Marker Object, @Marker ? super @Marker String> m){}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void foo(Map<@Marker ? super @Marker Object, @Marker ? extends @Marker String> m){}\n" +
- " ^^^\n" +
- "Map cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " void foo(Map<@Marker ? super @Marker Object, @Marker ? extends @Marker String> m){}\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 2)\n" +
- " void foo(Map<@Marker ? super @Marker Object, @Marker ? extends @Marker String> m){}\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 2)\n" +
- " void foo(Map<@Marker ? super @Marker Object, @Marker ? extends @Marker String> m){}\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 2)\n" +
- " void foo(Map<@Marker ? super @Marker Object, @Marker ? extends @Marker String> m){}\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 3)\n" +
- " void goo(Map<@Marker ? extends @Marker Object, @Marker ? super @Marker String> m){}\n" +
- " ^^^\n" +
- "Map cannot be resolved to a type\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 3)\n" +
- " void goo(Map<@Marker ? extends @Marker Object, @Marker ? super @Marker String> m){}\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 3)\n" +
- " void goo(Map<@Marker ? extends @Marker Object, @Marker ? super @Marker String> m){}\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 3)\n" +
- " void goo(Map<@Marker ? extends @Marker Object, @Marker ? super @Marker String> m){}\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 3)\n" +
- " void goo(Map<@Marker ? extends @Marker Object, @Marker ? super @Marker String> m){}\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " void foo(Map<@Marker ? super @Marker Object, @Marker ? extends @Marker String> m){}\n" +
+ " ^^^\n" +
+ "Map cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " void foo(Map<@Marker ? super @Marker Object, @Marker ? extends @Marker String> m){}\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 2)\n" +
+ " void foo(Map<@Marker ? super @Marker Object, @Marker ? extends @Marker String> m){}\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 2)\n" +
+ " void foo(Map<@Marker ? super @Marker Object, @Marker ? extends @Marker String> m){}\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 2)\n" +
+ " void foo(Map<@Marker ? super @Marker Object, @Marker ? extends @Marker String> m){}\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 3)\n" +
+ " void goo(Map<@Marker ? extends @Marker Object, @Marker ? super @Marker String> m){}\n" +
+ " ^^^\n" +
+ "Map cannot be resolved to a type\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 3)\n" +
+ " void goo(Map<@Marker ? extends @Marker Object, @Marker ? super @Marker String> m){}\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 3)\n" +
+ " void goo(Map<@Marker ? extends @Marker Object, @Marker ? super @Marker String> m){}\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 3)\n" +
+ " void goo(Map<@Marker ? extends @Marker Object, @Marker ? super @Marker String> m){}\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "10. ERROR in X.java (at line 3)\n" +
+ " void goo(Map<@Marker ? extends @Marker Object, @Marker ? super @Marker String> m){}\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
"----------\n");
}
// TypeParameter ::= TypeParameterHeader 'extends' ReferenceType
@@ -940,36 +940,36 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
"}\n" +
"class Y<T> {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X <@Marker T extends @Marker Y<@Marker ?>, @Marker Q extends @Marker Integer> {\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " public class X <@Marker T extends @Marker Y<@Marker ?>, @Marker Q extends @Marker Integer> {\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 1)\n" +
- " public class X <@Marker T extends @Marker Y<@Marker ?>, @Marker Q extends @Marker Integer> {\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 1)\n" +
- " public class X <@Marker T extends @Marker Y<@Marker ?>, @Marker Q extends @Marker Integer> {\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 1)\n" +
- " public class X <@Marker T extends @Marker Y<@Marker ?>, @Marker Q extends @Marker Integer> {\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The type parameter Q should not be bounded by the final type Integer. Final types cannot be further extended\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 1)\n" +
- " public class X <@Marker T extends @Marker Y<@Marker ?>, @Marker Q extends @Marker Integer> {\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X <@Marker T extends @Marker Y<@Marker ?>, @Marker Q extends @Marker Integer> {\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 1)\n" +
+ " public class X <@Marker T extends @Marker Y<@Marker ?>, @Marker Q extends @Marker Integer> {\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 1)\n" +
+ " public class X <@Marker T extends @Marker Y<@Marker ?>, @Marker Q extends @Marker Integer> {\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 1)\n" +
+ " public class X <@Marker T extends @Marker Y<@Marker ?>, @Marker Q extends @Marker Integer> {\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 1)\n" +
+ " public class X <@Marker T extends @Marker Y<@Marker ?>, @Marker Q extends @Marker Integer> {\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The type parameter Q should not be bounded by the final type Integer. Final types cannot be further extended\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 1)\n" +
+ " public class X <@Marker T extends @Marker Y<@Marker ?>, @Marker Q extends @Marker Integer> {\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
"----------\n");
}
// TypeParameter ::= TypeParameterHeader 'extends' ReferenceType AdditionalBoundList
@@ -992,31 +992,31 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" implements J<T> {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in I.java (at line 5)\n" +
- " class CI<U extends CJ<T, U> & @Marker J<@Marker T>,\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in I.java (at line 5)\n" +
- " class CI<U extends CJ<T, U> & @Marker J<@Marker T>,\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in I.java (at line 6)\n" +
- " T extends CI<U, T> & @Marker I<U>>\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in I.java (at line 9)\n" +
- " class CJ<T extends CI<U, T> & @Marker I<@Marker U>,\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in I.java (at line 9)\n" +
- " class CJ<T extends CI<U, T> & @Marker I<@Marker U>,\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in I.java (at line 5)\n" +
+ " class CI<U extends CJ<T, U> & @Marker J<@Marker T>,\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in I.java (at line 5)\n" +
+ " class CI<U extends CJ<T, U> & @Marker J<@Marker T>,\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in I.java (at line 6)\n" +
+ " T extends CI<U, T> & @Marker I<U>>\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in I.java (at line 9)\n" +
+ " class CJ<T extends CI<U, T> & @Marker I<@Marker U>,\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "5. ERROR in I.java (at line 9)\n" +
+ " class CJ<T extends CI<U, T> & @Marker I<@Marker U>,\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
"----------\n");
}
// InstanceofExpression_NotName ::= Name 'instanceof' ReferenceType
@@ -1034,11 +1034,11 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " if (!(other instanceof @Marker X<?>.Y)) {};\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " if (!(other instanceof @Marker X<?>.Y)) {};\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
"----------\n");
}
// InstanceofExpression_NotName ::= InstanceofExpression_NotName 'instanceof' ReferenceType
@@ -1052,11 +1052,11 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " if (!(this instanceof @Marker X)) {}\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " if (!(this instanceof @Marker X)) {}\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
"----------\n");
}
// ReferenceExpressionTypeArgumentsAndTrunk ::= OnlyTypeArguments '.' ClassOrInterfaceType Dimsopt
@@ -1082,16 +1082,16 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " I i = Y<String>.@Marker Z::foo;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " I i = Y<String>.@Marker Z::foo;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// ArrayCreationWithoutArrayInitializer ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs
@@ -1107,31 +1107,31 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" Zork z;\n" +
" }\n" +
"}\n" },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " X [] x = new @Marker X @Marker [5];\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " X [] x = new @Marker X @Marker [5];\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " X [] x2 = new @Marker X @Marker [] { null };\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 4)\n" +
- " X [] x2 = new @Marker X @Marker [] { null };\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " X [] x = new @Marker X @Marker [5];\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " X [] x = new @Marker X @Marker [5];\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " X [] x2 = new @Marker X @Marker [] { null };\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 4)\n" +
+ " X [] x2 = new @Marker X @Marker [] { null };\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 5)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// CastExpression ::= PushLPAREN Name OnlyTypeArgumentsForCastExpression '.' ClassOrInterfaceType Dimsopt PushRPAREN InsideCastExpressionWithQualifiedGenerics UnaryExpressionNotPlusMinus
@@ -1144,21 +1144,21 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" java.util.Map.Entry [] e = (java.util.Map<String, String>.@Marker Entry []) null;\n" +
" }\n" +
"}\n" },
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " java.util.Map.Entry [] e = (java.util.Map<String, String>.@Marker Entry []) null;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Map.Entry is a raw type. References to generic type Map.Entry<K,V> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " java.util.Map.Entry [] e = (java.util.Map<String, String>.@Marker Entry []) null;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The member type Map.Entry<K,V> cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type Map<String,String>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " java.util.Map.Entry [] e = (java.util.Map<String, String>.@Marker Entry []) null;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " java.util.Map.Entry [] e = (java.util.Map<String, String>.@Marker Entry []) null;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Map.Entry is a raw type. References to generic type Map.Entry<K,V> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " java.util.Map.Entry [] e = (java.util.Map<String, String>.@Marker Entry []) null;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The member type Map.Entry<K,V> cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type Map<String,String>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " java.util.Map.Entry [] e = (java.util.Map<String, String>.@Marker Entry []) null;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
"----------\n");
}
// ReferenceType1 ::= ClassOrInterface '<' TypeArgumentList2
@@ -1172,11 +1172,11 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" void foo(List<? extends @Marker Comparable<T>> p) {} \n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " void foo(List<? extends @Marker Comparable<T>> p) {} \n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " void foo(List<? extends @Marker Comparable<T>> p) {} \n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
"----------\n");
}
// ReferenceType2 ::= ClassOrInterface '<' TypeArgumentList3
@@ -1191,26 +1191,26 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
"class Bar<E extends Base, F extends Foo<E, @Marker Bar<E, F>>> {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " class Foo<U extends Base, V extends Bar<U, @Marker Foo<U, V>>> {\n" +
- " ^^^^^^^^^^^\n" +
- "Bound mismatch: The type Foo<U,V> is not a valid substitute for the bounded parameter <F extends Foo<E,Bar<E,F>>> of the type Bar<E,F>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " class Foo<U extends Base, V extends Bar<U, @Marker Foo<U, V>>> {\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " class Bar<E extends Base, F extends Foo<E, @Marker Bar<E, F>>> {\n" +
- " ^^^^^^^^^^^\n" +
- "Bound mismatch: The type Bar<E,F> is not a valid substitute for the bounded parameter <V extends Bar<U,Foo<U,V>>> of the type Foo<U,V>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " class Bar<E extends Base, F extends Foo<E, @Marker Bar<E, F>>> {\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " class Foo<U extends Base, V extends Bar<U, @Marker Foo<U, V>>> {\n" +
+ " ^^^^^^^^^^^\n" +
+ "Bound mismatch: The type Foo<U,V> is not a valid substitute for the bounded parameter <F extends Foo<E,Bar<E,F>>> of the type Bar<E,F>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " class Foo<U extends Base, V extends Bar<U, @Marker Foo<U, V>>> {\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " class Bar<E extends Base, F extends Foo<E, @Marker Bar<E, F>>> {\n" +
+ " ^^^^^^^^^^^\n" +
+ "Bound mismatch: The type Bar<E,F> is not a valid substitute for the bounded parameter <V extends Bar<U,Foo<U,V>>> of the type Foo<U,V>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " class Bar<E extends Base, F extends Foo<E, @Marker Bar<E, F>>> {\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
"----------\n");
}
// ClassHeaderExtends ::= 'extends' ClassType
@@ -1221,11 +1221,11 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
"public class X extends @Marker Object {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X extends @Marker Object {\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X extends @Marker Object {\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
"----------\n");
}
// ClassInstanceCreationExpression ::= 'new' OnlyTypeArguments ClassType EnterInstanceCreationArgumentList '(' ArgumentListopt ')' UnqualifiedClassBodyopt
@@ -1236,24 +1236,24 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
"X.java",
"public class X {\n" +
" X x = new @Marker X();\n" +
- " X y = new <String> @Marker X();\n" +
+ " X y = new <String> @Marker X();\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " X x = new @Marker X();\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " X y = new <String> @Marker X();\n" +
- " ^^^^^^\n" +
- "Unused type arguments for the non generic constructor X() of type X; it should not be parameterized with arguments <String>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " X y = new <String> @Marker X();\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " X x = new @Marker X();\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " X y = new <String> @Marker X();\n" +
+ " ^^^^^^\n" +
+ "Unused type arguments for the non generic constructor X() of type X; it should not be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " X y = new <String> @Marker X();\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
"----------\n");
}
// ClassInstanceCreationExpression ::= Primary '.' 'new' OnlyTypeArguments ClassType EnterInstanceCreationArgumentList '(' ArgumentListopt ')' QualifiedClassBodyopt
@@ -1269,31 +1269,31 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" Y y2 = new @Marker X().new <String> @Marker Y();\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " Y y1 = new @Marker X().new @Marker Y();\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " Y y1 = new @Marker X().new @Marker Y();\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " Y y2 = new @Marker X().new <String> @Marker Y();\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 5)\n" +
- " Y y2 = new @Marker X().new <String> @Marker Y();\n" +
- " ^^^^^^\n" +
- "Unused type arguments for the non generic constructor X.Y() of type X.Y; it should not be parameterized with arguments <String>\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 5)\n" +
- " Y y2 = new @Marker X().new <String> @Marker Y();\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " Y y1 = new @Marker X().new @Marker Y();\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " Y y1 = new @Marker X().new @Marker Y();\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " Y y2 = new @Marker X().new <String> @Marker Y();\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 5)\n" +
+ " Y y2 = new @Marker X().new <String> @Marker Y();\n" +
+ " ^^^^^^\n" +
+ "Unused type arguments for the non generic constructor X.Y() of type X.Y; it should not be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 5)\n" +
+ " Y y2 = new @Marker X().new <String> @Marker Y();\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
"----------\n");
}
// ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName 'new' ClassType EnterInstanceCreationArgumentList '(' ArgumentListopt ')' QualifiedClassBodyopt
@@ -1310,31 +1310,31 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" Y y2 = @Marker x.new <String> @Marker Y();\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " Y y1 = @Marker x.new @Marker Y();\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " Y y1 = @Marker x.new @Marker Y();\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " Y y2 = @Marker x.new <String> @Marker Y();\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 6)\n" +
- " Y y2 = @Marker x.new <String> @Marker Y();\n" +
- " ^^^^^^\n" +
- "Unused type arguments for the non generic constructor X.Y() of type X.Y; it should not be parameterized with arguments <String>\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 6)\n" +
- " Y y2 = @Marker x.new <String> @Marker Y();\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " Y y1 = @Marker x.new @Marker Y();\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " Y y1 = @Marker x.new @Marker Y();\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " Y y2 = @Marker x.new <String> @Marker Y();\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 6)\n" +
+ " Y y2 = @Marker x.new <String> @Marker Y();\n" +
+ " ^^^^^^\n" +
+ "Unused type arguments for the non generic constructor X.Y() of type X.Y; it should not be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 6)\n" +
+ " Y y2 = @Marker x.new <String> @Marker Y();\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
"----------\n");
}
// MethodHeaderThrowsClause ::= 'throws' ClassTypeList
@@ -1349,16 +1349,16 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" void foo() throws @Marker NullPointerException, @Marker ArrayIndexOutOfBoundsException {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void foo() throws @Marker NullPointerException, @Marker ArrayIndexOutOfBoundsException {}\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " void foo() throws @Marker NullPointerException, @Marker ArrayIndexOutOfBoundsException {}\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " void foo() throws @Marker NullPointerException, @Marker ArrayIndexOutOfBoundsException {}\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " void foo() throws @Marker NullPointerException, @Marker ArrayIndexOutOfBoundsException {}\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
"----------\n");
}
// ClassHeaderImplements ::= 'implements' InterfaceTypeList
@@ -1377,26 +1377,26 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
"public class X implements @Marker K, @Marker L {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " interface K extends @Marker I, @Marker J {}\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " interface K extends @Marker I, @Marker J {}\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " public class X implements @Marker K, @Marker L {\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " public class X implements @Marker K, @Marker L {\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " interface K extends @Marker I, @Marker J {}\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " interface K extends @Marker I, @Marker J {}\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " public class X implements @Marker K, @Marker L {\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " public class X implements @Marker K, @Marker L {\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
"----------\n");
}
// ReferenceExpression ::= Name Dimsopt '::' NonWildTypeArgumentsopt IdentifierOrNew
@@ -1422,41 +1422,41 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " I i = @Marker Y. @Marker Z @Marker [] [] @Marker [] ::foo;\n" +
- " ^^^^^^^\n" +
- "Type annotations are not allowed on type names used to access static members\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " I i = @Marker Y. @Marker Z @Marker [] [] @Marker [] ::foo;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The type Y.Z[][][] does not define foo(int) that is applicable here\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " I i = @Marker Y. @Marker Z @Marker [] [] @Marker [] ::foo;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " I i = @Marker Y. @Marker Z @Marker [] [] @Marker [] ::foo;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 6)\n" +
- " I i = @Marker Y. @Marker Z @Marker [] [] @Marker [] ::foo;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 6)\n" +
- " I i = @Marker Y. @Marker Z @Marker [] [] @Marker [] ::foo;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 8)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " I i = @Marker Y. @Marker Z @Marker [] [] @Marker [] ::foo;\n" +
+ " ^^^^^^^\n" +
+ "Type annotations are not allowed on type names used to access static members\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " I i = @Marker Y. @Marker Z @Marker [] [] @Marker [] ::foo;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The type Y.Z[][][] does not define foo(int) that is applicable here\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " I i = @Marker Y. @Marker Z @Marker [] [] @Marker [] ::foo;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " I i = @Marker Y. @Marker Z @Marker [] [] @Marker [] ::foo;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 6)\n" +
+ " I i = @Marker Y. @Marker Z @Marker [] [] @Marker [] ::foo;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 6)\n" +
+ " I i = @Marker Y. @Marker Z @Marker [] [] @Marker [] ::foo;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 8)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// ReferenceExpression ::= Name BeginTypeArguments ReferenceExpressionTypeArgumentsAndTrunk '::' NonWildTypeArgumentsopt IdentifierOrNew
@@ -1492,31 +1492,31 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " i = @Marker W<@Marker Integer>::<@Marker String> new;\n" +
- " ^\n" +
- "i cannot be resolved to a variable\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " i = @Marker W<@Marker Integer>::<@Marker String> new;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 12)\n" +
- " i = @Marker W<@Marker Integer>::<@Marker String> new;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 12)\n" +
- " i = @Marker W<@Marker Integer>::<@Marker String> new;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 12)\n" +
- " i = @Marker W<@Marker Integer>::<@Marker String> new;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " i = @Marker W<@Marker Integer>::<@Marker String> new;\n" +
+ " ^\n" +
+ "i cannot be resolved to a variable\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 12)\n" +
+ " i = @Marker W<@Marker Integer>::<@Marker String> new;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 12)\n" +
+ " i = @Marker W<@Marker Integer>::<@Marker String> new;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 12)\n" +
+ " i = @Marker W<@Marker Integer>::<@Marker String> new;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 12)\n" +
+ " i = @Marker W<@Marker Integer>::<@Marker String> new;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
"----------\n");
}
// CastExpression ::= PushLPAREN Name PushRPAREN InsideCastExpressionLL1 UnaryExpressionNotPlusMinus
@@ -1534,96 +1534,96 @@ public class GrammarCoverageTests308 extends AbstractRegressionTest {
" Object r = (@Marker java. @Marker util.@Marker Map<@Marker String, @Marker String>.@Marker Entry @Marker []) null;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Object o = (@Marker X) null;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " Object p = (@Marker X @Marker []) null;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " Object p = (@Marker X @Marker []) null;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 4)\n" +
- " Object q = (@Marker java. @Marker util. @Marker List<@Marker String> []) null;\n" +
- " ^^^^^^^\n" +
- "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 4)\n" +
- " Object q = (@Marker java. @Marker util. @Marker List<@Marker String> []) null;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 4)\n" +
- " Object q = (@Marker java. @Marker util. @Marker List<@Marker String> []) null;\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 4)\n" +
- " Object q = (@Marker java. @Marker util. @Marker List<@Marker String> []) null;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 4)\n" +
- " Object q = (@Marker java. @Marker util. @Marker List<@Marker String> []) null;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 5)\n" +
- " Object r = (@Marker java. @Marker util.@Marker Map<@Marker String, @Marker String>.@Marker Entry @Marker []) null;\n" +
- " ^^^^^^^\n" +
- "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 5)\n" +
- " Object r = (@Marker java. @Marker util.@Marker Map<@Marker String, @Marker String>.@Marker Entry @Marker []) null;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The member type Map.Entry<K,V> cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type Map<String,String>\n" +
- "----------\n" +
- "11. ERROR in X.java (at line 5)\n" +
- " Object r = (@Marker java. @Marker util.@Marker Map<@Marker String, @Marker String>.@Marker Entry @Marker []) null;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "12. ERROR in X.java (at line 5)\n" +
- " Object r = (@Marker java. @Marker util.@Marker Map<@Marker String, @Marker String>.@Marker Entry @Marker []) null;\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "13. ERROR in X.java (at line 5)\n" +
- " Object r = (@Marker java. @Marker util.@Marker Map<@Marker String, @Marker String>.@Marker Entry @Marker []) null;\n" +
- " ^^^^^^^\n" +
- "Type annotations are not allowed on type names used to access static members\n" +
- "----------\n" +
- "14. ERROR in X.java (at line 5)\n" +
- " Object r = (@Marker java. @Marker util.@Marker Map<@Marker String, @Marker String>.@Marker Entry @Marker []) null;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "15. ERROR in X.java (at line 5)\n" +
- " Object r = (@Marker java. @Marker util.@Marker Map<@Marker String, @Marker String>.@Marker Entry @Marker []) null;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "16. ERROR in X.java (at line 5)\n" +
- " Object r = (@Marker java. @Marker util.@Marker Map<@Marker String, @Marker String>.@Marker Entry @Marker []) null;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "17. ERROR in X.java (at line 5)\n" +
- " Object r = (@Marker java. @Marker util.@Marker Map<@Marker String, @Marker String>.@Marker Entry @Marker []) null;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "18. ERROR in X.java (at line 5)\n" +
- " Object r = (@Marker java. @Marker util.@Marker Map<@Marker String, @Marker String>.@Marker Entry @Marker []) null;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " Object o = (@Marker X) null;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " Object p = (@Marker X @Marker []) null;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " Object p = (@Marker X @Marker []) null;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 4)\n" +
+ " Object q = (@Marker java. @Marker util. @Marker List<@Marker String> []) null;\n" +
+ " ^^^^^^^\n" +
+ "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 4)\n" +
+ " Object q = (@Marker java. @Marker util. @Marker List<@Marker String> []) null;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 4)\n" +
+ " Object q = (@Marker java. @Marker util. @Marker List<@Marker String> []) null;\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 4)\n" +
+ " Object q = (@Marker java. @Marker util. @Marker List<@Marker String> []) null;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 4)\n" +
+ " Object q = (@Marker java. @Marker util. @Marker List<@Marker String> []) null;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 5)\n" +
+ " Object r = (@Marker java. @Marker util.@Marker Map<@Marker String, @Marker String>.@Marker Entry @Marker []) null;\n" +
+ " ^^^^^^^\n" +
+ "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
+ "----------\n" +
+ "10. ERROR in X.java (at line 5)\n" +
+ " Object r = (@Marker java. @Marker util.@Marker Map<@Marker String, @Marker String>.@Marker Entry @Marker []) null;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The member type Map.Entry<K,V> cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type Map<String,String>\n" +
+ "----------\n" +
+ "11. ERROR in X.java (at line 5)\n" +
+ " Object r = (@Marker java. @Marker util.@Marker Map<@Marker String, @Marker String>.@Marker Entry @Marker []) null;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "12. ERROR in X.java (at line 5)\n" +
+ " Object r = (@Marker java. @Marker util.@Marker Map<@Marker String, @Marker String>.@Marker Entry @Marker []) null;\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "13. ERROR in X.java (at line 5)\n" +
+ " Object r = (@Marker java. @Marker util.@Marker Map<@Marker String, @Marker String>.@Marker Entry @Marker []) null;\n" +
+ " ^^^^^^^\n" +
+ "Type annotations are not allowed on type names used to access static members\n" +
+ "----------\n" +
+ "14. ERROR in X.java (at line 5)\n" +
+ " Object r = (@Marker java. @Marker util.@Marker Map<@Marker String, @Marker String>.@Marker Entry @Marker []) null;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "15. ERROR in X.java (at line 5)\n" +
+ " Object r = (@Marker java. @Marker util.@Marker Map<@Marker String, @Marker String>.@Marker Entry @Marker []) null;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "16. ERROR in X.java (at line 5)\n" +
+ " Object r = (@Marker java. @Marker util.@Marker Map<@Marker String, @Marker String>.@Marker Entry @Marker []) null;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "17. ERROR in X.java (at line 5)\n" +
+ " Object r = (@Marker java. @Marker util.@Marker Map<@Marker String, @Marker String>.@Marker Entry @Marker []) null;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "18. ERROR in X.java (at line 5)\n" +
+ " Object r = (@Marker java. @Marker util.@Marker Map<@Marker String, @Marker String>.@Marker Entry @Marker []) null;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
"----------\n");
}
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InMemoryNameEnvironment9.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InMemoryNameEnvironment9.java
index 8464c3688..99e0833de 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InMemoryNameEnvironment9.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InMemoryNameEnvironment9.java
@@ -25,7 +25,7 @@ import org.eclipse.jdt.internal.compiler.env.INameEnvironment;
import org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer;
public class InMemoryNameEnvironment9 extends InMemoryNameEnvironment implements IModuleAwareNameEnvironment {
-
+
Map<String, IModule> moduleMap = new HashMap<>();
public InMemoryNameEnvironment9(String[] compilationUnits, Map<String, IModule> moduleMap, INameEnvironment[] classLibs) {
@@ -44,13 +44,13 @@ public class InMemoryNameEnvironment9 extends InMemoryNameEnvironment implements
}
return null;
}
-
+
protected <T> T[] collect(Function<IModuleAwareNameEnvironment, T[]> function, Function<Integer,T[]> arraySupplier) {
Set<T> mods = new HashSet<>();
for (int i = 0; i < this.classLibs.length; i++) {
INameEnvironment env = this.classLibs[i];
if (env instanceof IModuleAwareNameEnvironment) {
- T[] someMods = function.apply((IModuleAwareNameEnvironment) env);
+ T[] someMods = function.apply((IModuleAwareNameEnvironment) env);
if (someMods != null) {
for (int j = 0; j < someMods.length; j++)
mods.add(someMods[j]);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InitializationTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InitializationTests.java
index 66feafc4c..ccf8cc0e1 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InitializationTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InitializationTests.java
@@ -40,8 +40,8 @@ public void test318020a() {
this.runConformTest(
new String[] {
"X.java",
- "class X {\n" +
- " public void foo() throws Exception{\n" +
+ "class X {\n" +
+ " public void foo() throws Exception{\n" +
" String temp;\n" +
" Object temp2= new String(\"test\");\n" +
" if(temp2 instanceof String) {\n" +
@@ -62,10 +62,10 @@ public void test318020b() {
this.runConformTest(
new String[] {
"X.java",
- "class X {\n" +
+ "class X {\n" +
" {\n" +
" if (true)\n" +
- " throw new NullPointerException();\n" +
+ " throw new NullPointerException();\n" +
" }\n" +
" public X(){}\n" +
"}"
@@ -97,12 +97,12 @@ public void test318020c() {
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " abc = new X(1);\n" +
- " ^^^\n" +
- "The final local variable abc may already have been assigned\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " abc = new X(1);\n" +
+ " ^^^\n" +
+ "The final local variable abc may already have been assigned\n" +
"----------\n",
null, false, options);
}
@@ -131,11 +131,11 @@ public void test318020d() {
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " boolean comp = X.comparison((abc = new X(2)), (abc = new X(1)).returnA());\n" +
- " ^^^\n" +
- "The final local variable abc may already have been assigned\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " boolean comp = X.comparison((abc = new X(2)), (abc = new X(1)).returnA());\n" +
+ " ^^^\n" +
+ "The final local variable abc may already have been assigned\n" +
"----------\n",
null, false, options);
}
@@ -161,11 +161,11 @@ public void test318020e() {
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " boolean comp = ((abc = new X(2)).returnA() == 1 || (abc = new X(1)).returnA() == 1);\n" +
- " ^^^\n" +
- "The final local variable abc may already have been assigned\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " boolean comp = ((abc = new X(2)).returnA() == 1 || (abc = new X(1)).returnA() == 1);\n" +
+ " ^^^\n" +
+ "The final local variable abc may already have been assigned\n" +
"----------\n",
null, false, options);
}
@@ -193,11 +193,11 @@ public void test318020f() {
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " val = (abc = new X(2)).returnA();\n" +
- " ^^^\n" +
- "The final local variable abc may already have been assigned\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " val = (abc = new X(2)).returnA();\n" +
+ " ^^^\n" +
+ "The final local variable abc may already have been assigned\n" +
"----------\n",
null, false, options);
}
@@ -229,11 +229,11 @@ public void test318020g() {
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 16)\n" +
- " abc = new X(2);\n" +
- " ^^^\n" +
- "The final local variable abc may already have been assigned\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 16)\n" +
+ " abc = new X(2);\n" +
+ " ^^^\n" +
+ "The final local variable abc may already have been assigned\n" +
"----------\n",
null, false, options);
}
@@ -308,11 +308,11 @@ public void test318020j() {
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " abc = new X(abc = 2).returnA();\n" +
- " ^^^\n" +
- "The final local variable abc may already have been assigned\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " abc = new X(abc = 2).returnA();\n" +
+ " ^^^\n" +
+ "The final local variable abc may already have been assigned\n" +
"----------\n",
null, false, options);
}
@@ -338,11 +338,11 @@ public void test318020k() {
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " x = new X(x = 2).returnA(); }\n" +
- " ^\n" +
- "The final field x may already have been assigned\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " x = new X(x = 2).returnA(); }\n" +
+ " ^\n" +
+ "The final field x may already have been assigned\n" +
"----------\n",
null, false, options);
}
@@ -353,51 +353,51 @@ public void test325567() {
this.runNegativeTest(
new String[] {
"X.java",
- "import java.io.IOException;\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " bar(3);\n" +
- " }\n" +
- " public static void bar(int i) {\n" +
- " final String before;\n" +
- " try {\n" +
- " before = foo();\n" +
- " } catch (IOException e) {\n" +
- " // ignore\n" +
- " }\n" +
- " B b = new B(new I() {\n" +
- " public String bar() {\n" +
- " return new String(before);\n" +
- " }\n" +
- " });\n" +
- " try {\n" +
- " b.i.bar();\n" +
- " } catch(Exception e) {\n" +
- " // ignore\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private static String foo() throws IOException {\n" +
- " return null;\n" +
- " }\n" +
- " \n" +
- " static class B {\n" +
- " I i;\n" +
- " B(I i) {\n" +
- " this.i = i;\n" +
- " }\n" +
- " }\n" +
- " static interface I {\n" +
- " String bar();\n" +
- " }\n" +
+ "import java.io.IOException;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " bar(3);\n" +
+ " }\n" +
+ " public static void bar(int i) {\n" +
+ " final String before;\n" +
+ " try {\n" +
+ " before = foo();\n" +
+ " } catch (IOException e) {\n" +
+ " // ignore\n" +
+ " }\n" +
+ " B b = new B(new I() {\n" +
+ " public String bar() {\n" +
+ " return new String(before);\n" +
+ " }\n" +
+ " });\n" +
+ " try {\n" +
+ " b.i.bar();\n" +
+ " } catch(Exception e) {\n" +
+ " // ignore\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " private static String foo() throws IOException {\n" +
+ " return null;\n" +
+ " }\n" +
+ " \n" +
+ " static class B {\n" +
+ " I i;\n" +
+ " B(I i) {\n" +
+ " this.i = i;\n" +
+ " }\n" +
+ " }\n" +
+ " static interface I {\n" +
+ " String bar();\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 16)\n" +
- " return new String(before);\n" +
- " ^^^^^^\n" +
- "The local variable before may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 16)\n" +
+ " return new String(before);\n" +
+ " ^^^^^^\n" +
+ "The local variable before may not have been initialized\n" +
"----------\n",
null, false, options);
}
@@ -453,8 +453,8 @@ public void testBug324178d() {
"Bug324178.java",
"public class Bug324178 {\n" +
" boolean foo(boolean b1) {\n" +
- " Boolean b2;\n" +
- " if (b1 ? (b2 = Boolean.TRUE) : null)\n" +
+ " Boolean b2;\n" +
+ " if (b1 ? (b2 = Boolean.TRUE) : null)\n" +
" return b2;\n" +
" return false;\n" +
" }\n" +
@@ -463,11 +463,11 @@ public void testBug324178d() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Bug324178.java (at line 5)\n" +
- " return b2;\n" +
- " ^^\n" +
- "The local variable b2 may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in Bug324178.java (at line 5)\n" +
+ " return b2;\n" +
+ " ^^\n" +
+ "The local variable b2 may not have been initialized\n" +
"----------\n");
}
// Bug 383690 - [compiler] location of error re uninitialized final field should be aligned
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerClass15Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerClass15Test.java
index af439033b..1864a3541 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerClass15Test.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerClass15Test.java
@@ -40,54 +40,54 @@ protected Map<String, String> getCompilerOptions() {
public void test001() {
this.runNegativeTest(new String[] {
"X.java",
- "class X {\n" +
- " <X> void foo() {\n" +
- " class X {}\n" +
- " }\n" +
+ "class X {\n" +
+ " <X> void foo() {\n" +
+ " class X {}\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " <X> void foo() {\n" +
- " ^\n" +
- "The type parameter X is hiding the type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " class X {}\n" +
- " ^\n" +
- "The nested type X is hiding the type parameter X of the generic method foo() of type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " class X {}\n" +
- " ^\n" +
- "The nested type X cannot hide an enclosing type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " <X> void foo() {\n" +
+ " ^\n" +
+ "The type parameter X is hiding the type X\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " class X {}\n" +
+ " ^\n" +
+ "The nested type X is hiding the type parameter X of the generic method foo() of type X\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " class X {}\n" +
+ " ^\n" +
+ "The nested type X cannot hide an enclosing type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=312989
public void test002() {
this.runNegativeTest(new String[] {
"X.java",
- "class X<X> {\n" +
- " void foo() {\n" +
- " class X {}\n" +
- " }\n" +
+ "class X<X> {\n" +
+ " void foo() {\n" +
+ " class X {}\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. WARNING in X.java (at line 1)\n" +
- " class X<X> {\n" +
- " ^\n" +
- "The type parameter X is hiding the type X<X>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " class X {}\n" +
- " ^\n" +
- "The nested type X is hiding the type parameter X of type X<X>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " class X {}\n" +
- " ^\n" +
- "The nested type X cannot hide an enclosing type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 1)\n" +
+ " class X<X> {\n" +
+ " ^\n" +
+ "The type parameter X is hiding the type X<X>\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " class X {}\n" +
+ " ^\n" +
+ "The nested type X is hiding the type parameter X of type X<X>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " class X {}\n" +
+ " ^\n" +
+ "The nested type X cannot hide an enclosing type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=312989
@@ -98,27 +98,27 @@ public void test003() {
this.runNegativeTest(new String[] {
"Y.java",
"class Y {\n" +
- "class X {}\n" +
- " <X> void foo() {\n" +
- " class X {}\n" +
- " }\n" +
+ "class X {}\n" +
+ " <X> void foo() {\n" +
+ " class X {}\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. WARNING in Y.java (at line 3)\n" +
- " <X> void foo() {\n" +
- " ^\n" +
- "The type parameter X is hiding the type Y.X\n" +
- "----------\n" +
- "2. WARNING in Y.java (at line 4)\n" +
- " class X {}\n" +
- " ^\n" +
- "The nested type X is hiding the type parameter X of the generic method foo() of type Y\n" +
- "----------\n" +
- "3. WARNING in Y.java (at line 4)\n" +
- " class X {}\n" +
- " ^\n" +
- "The type X is never used locally\n" +
+ "----------\n" +
+ "1. WARNING in Y.java (at line 3)\n" +
+ " <X> void foo() {\n" +
+ " ^\n" +
+ "The type parameter X is hiding the type Y.X\n" +
+ "----------\n" +
+ "2. WARNING in Y.java (at line 4)\n" +
+ " class X {}\n" +
+ " ^\n" +
+ "The nested type X is hiding the type parameter X of the generic method foo() of type Y\n" +
+ "----------\n" +
+ "3. WARNING in Y.java (at line 4)\n" +
+ " class X {}\n" +
+ " ^\n" +
+ "The type X is never used locally\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=312989
@@ -126,22 +126,22 @@ public void test004() {
this.runNegativeTest(new String[] {
"Y.java",
"class Y {\n" +
- "class X {}\n" +
- " void foo() {\n" +
- " class X {}\n" +
- " }\n" +
+ "class X {}\n" +
+ " void foo() {\n" +
+ " class X {}\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. WARNING in Y.java (at line 4)\n" +
- " class X {}\n" +
- " ^\n" +
- "The type X is hiding the type Y.X\n" +
- "----------\n" +
- "2. WARNING in Y.java (at line 4)\n" +
- " class X {}\n" +
- " ^\n" +
- "The type X is never used locally\n" +
+ "----------\n" +
+ "1. WARNING in Y.java (at line 4)\n" +
+ " class X {}\n" +
+ " ^\n" +
+ "The type X is hiding the type Y.X\n" +
+ "----------\n" +
+ "2. WARNING in Y.java (at line 4)\n" +
+ " class X {}\n" +
+ " ^\n" +
+ "The type X is never used locally\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=319885
@@ -160,11 +160,11 @@ public void test005() {
" public static class BlackCat extends Cat {}\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in p1\\GreenBox.java (at line 2)\n" +
- " import static p1.BrownBox.*;\n" +
- " ^^^^^^^^^^^\n" +
- "The import p1.BrownBox is never used\n" +
+ "----------\n" +
+ "1. WARNING in p1\\GreenBox.java (at line 2)\n" +
+ " import static p1.BrownBox.*;\n" +
+ " ^^^^^^^^^^^\n" +
+ "The import p1.BrownBox is never used\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=319885
@@ -183,11 +183,11 @@ public void test006() {
" public static class Cat extends Object {}\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in p1\\GreenBox.java (at line 2)\n" +
- " import static p1.BrownBox.*;\n" +
- " ^^^^^^^^^^^\n" +
- "The import p1.BrownBox is never used\n" +
+ "----------\n" +
+ "1. WARNING in p1\\GreenBox.java (at line 2)\n" +
+ " import static p1.BrownBox.*;\n" +
+ " ^^^^^^^^^^^\n" +
+ "The import p1.BrownBox is never used\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=319885
@@ -206,11 +206,11 @@ public void test007() {
" public static class Cat extends java.lang.Object {}\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in p1\\GreenBox.java (at line 2)\n" +
- " import static p1.BrownBox.*;\n" +
- " ^^^^^^^^^^^\n" +
- "The import p1.BrownBox is never used\n" +
+ "----------\n" +
+ "1. WARNING in p1\\GreenBox.java (at line 2)\n" +
+ " import static p1.BrownBox.*;\n" +
+ " ^^^^^^^^^^^\n" +
+ "The import p1.BrownBox is never used\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=319885
@@ -229,17 +229,17 @@ public void test008() {
" public static class Cat extends BlackCat {}\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in p1\\BrownBox.java (at line 4)\n" +
- " public static class BlackCat extends Cat {}\n" +
- " ^^^^^^^^\n" +
- "The hierarchy of the type BlackCat is inconsistent\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in p1\\GreenBox.java (at line 4)\n" +
- " public static class Cat extends BlackCat {}\n" +
- " ^^^^^^^^\n" +
- "Cycle detected: a cycle exists in the type hierarchy between GreenBox.Cat and BrownBox.BlackCat\n" +
+ "----------\n" +
+ "1. ERROR in p1\\BrownBox.java (at line 4)\n" +
+ " public static class BlackCat extends Cat {}\n" +
+ " ^^^^^^^^\n" +
+ "The hierarchy of the type BlackCat is inconsistent\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in p1\\GreenBox.java (at line 4)\n" +
+ " public static class Cat extends BlackCat {}\n" +
+ " ^^^^^^^^\n" +
+ "Cycle detected: a cycle exists in the type hierarchy between GreenBox.Cat and BrownBox.BlackCat\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=319885
@@ -258,17 +258,17 @@ public void test009() {
" public static class BlackCat extends Cat {}\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in p1\\GreenBox.java (at line 4)\n" +
- " public static class Cat extends BlackCat {}\n" +
- " ^^^\n" +
- "The hierarchy of the type Cat is inconsistent\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in p1\\BrownBox.java (at line 4)\n" +
- " public static class BlackCat extends Cat {}\n" +
- " ^^^\n" +
- "Cycle detected: a cycle exists in the type hierarchy between BrownBox.BlackCat and GreenBox.Cat\n" +
+ "----------\n" +
+ "1. ERROR in p1\\GreenBox.java (at line 4)\n" +
+ " public static class Cat extends BlackCat {}\n" +
+ " ^^^\n" +
+ "The hierarchy of the type Cat is inconsistent\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in p1\\BrownBox.java (at line 4)\n" +
+ " public static class BlackCat extends Cat {}\n" +
+ " ^^^\n" +
+ "Cycle detected: a cycle exists in the type hierarchy between BrownBox.BlackCat and GreenBox.Cat\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=319885
@@ -289,17 +289,17 @@ public void test0010() {
" public static class BlackCat extends Cat {}\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in p1\\GreenBox.java (at line 4)\n" +
- " public static class Cat extends BlackCat {}\n" +
- " ^^^\n" +
- "The hierarchy of the type Cat is inconsistent\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in p1\\BrownBox.java (at line 4)\n" +
- " public static class BlackCat extends Cat {}\n" +
- " ^^^\n" +
- "Cat cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in p1\\GreenBox.java (at line 4)\n" +
+ " public static class Cat extends BlackCat {}\n" +
+ " ^^^\n" +
+ "The hierarchy of the type Cat is inconsistent\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in p1\\BrownBox.java (at line 4)\n" +
+ " public static class BlackCat extends Cat {}\n" +
+ " ^^^\n" +
+ "Cat cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=319885
@@ -320,17 +320,17 @@ public void test0011() {
" public static class BlackCat extends Cat {}\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in p1\\GreenBox.java (at line 4)\n" +
- " public static class Cat extends BlackCat {}\n" +
- " ^^^\n" +
- "The hierarchy of the type Cat is inconsistent\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in p1\\BrownBox.java (at line 4)\n" +
- " public static class BlackCat extends Cat {}\n" +
- " ^^^\n" +
- "Cycle detected: a cycle exists in the type hierarchy between BrownBox.BlackCat and SuperInterface.Cat\n" +
+ "----------\n" +
+ "1. ERROR in p1\\GreenBox.java (at line 4)\n" +
+ " public static class Cat extends BlackCat {}\n" +
+ " ^^^\n" +
+ "The hierarchy of the type Cat is inconsistent\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in p1\\BrownBox.java (at line 4)\n" +
+ " public static class BlackCat extends Cat {}\n" +
+ " ^^^\n" +
+ "Cycle detected: a cycle exists in the type hierarchy between BrownBox.BlackCat and SuperInterface.Cat\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=319885
@@ -351,17 +351,17 @@ public void test0012() {
" public static class BlackCat extends GreenBox.Cat {}\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in p1\\GreenBox.java (at line 4)\n" +
- " public static class Cat extends BlackCat {}\n" +
- " ^^^\n" +
- "The hierarchy of the type Cat is inconsistent\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in p1\\BrownBox.java (at line 4)\n" +
- " public static class BlackCat extends GreenBox.Cat {}\n" +
- " ^^^^^^^^^^^^\n" +
- "Cycle detected: a cycle exists in the type hierarchy between BrownBox.BlackCat and SuperInterface.Cat\n" +
+ "----------\n" +
+ "1. ERROR in p1\\GreenBox.java (at line 4)\n" +
+ " public static class Cat extends BlackCat {}\n" +
+ " ^^^\n" +
+ "The hierarchy of the type Cat is inconsistent\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in p1\\BrownBox.java (at line 4)\n" +
+ " public static class BlackCat extends GreenBox.Cat {}\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Cycle detected: a cycle exists in the type hierarchy between BrownBox.BlackCat and SuperInterface.Cat\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=319885
@@ -372,16 +372,16 @@ public void test0013() {
"class X extends Y {}\n" +
"class Y extends X {}\n",
},
- "----------\n" +
- "1. ERROR in cycle\\X.java (at line 2)\n" +
- " class X extends Y {}\n" +
- " ^\n" +
- "The hierarchy of the type X is inconsistent\n" +
- "----------\n" +
- "2. ERROR in cycle\\X.java (at line 3)\n" +
- " class Y extends X {}\n" +
- " ^\n" +
- "Cycle detected: a cycle exists in the type hierarchy between Y and X\n" +
+ "----------\n" +
+ "1. ERROR in cycle\\X.java (at line 2)\n" +
+ " class X extends Y {}\n" +
+ " ^\n" +
+ "The hierarchy of the type X is inconsistent\n" +
+ "----------\n" +
+ "2. ERROR in cycle\\X.java (at line 3)\n" +
+ " class Y extends X {}\n" +
+ " ^\n" +
+ "Cycle detected: a cycle exists in the type hierarchy between Y and X\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=319885
@@ -396,36 +396,36 @@ public void test0014() {
"class B extends C {}\n" +
"class C extends X {}\n"
},
- "----------\n" +
- "1. ERROR in cycle\\X.java (at line 2)\n" +
- " class X extends Y {}\n" +
- " ^\n" +
- "The hierarchy of the type X is inconsistent\n" +
- "----------\n" +
- "2. ERROR in cycle\\X.java (at line 3)\n" +
- " class Y extends Z {}\n" +
- " ^\n" +
- "The hierarchy of the type Y is inconsistent\n" +
- "----------\n" +
- "3. ERROR in cycle\\X.java (at line 4)\n" +
- " class Z extends A {}\n" +
- " ^\n" +
- "The hierarchy of the type Z is inconsistent\n" +
- "----------\n" +
- "4. ERROR in cycle\\X.java (at line 5)\n" +
- " class A extends B {}\n" +
- " ^\n" +
- "The hierarchy of the type A is inconsistent\n" +
- "----------\n" +
- "5. ERROR in cycle\\X.java (at line 6)\n" +
- " class B extends C {}\n" +
- " ^\n" +
- "The hierarchy of the type B is inconsistent\n" +
- "----------\n" +
- "6. ERROR in cycle\\X.java (at line 7)\n" +
- " class C extends X {}\n" +
- " ^\n" +
- "Cycle detected: a cycle exists in the type hierarchy between C and X\n" +
+ "----------\n" +
+ "1. ERROR in cycle\\X.java (at line 2)\n" +
+ " class X extends Y {}\n" +
+ " ^\n" +
+ "The hierarchy of the type X is inconsistent\n" +
+ "----------\n" +
+ "2. ERROR in cycle\\X.java (at line 3)\n" +
+ " class Y extends Z {}\n" +
+ " ^\n" +
+ "The hierarchy of the type Y is inconsistent\n" +
+ "----------\n" +
+ "3. ERROR in cycle\\X.java (at line 4)\n" +
+ " class Z extends A {}\n" +
+ " ^\n" +
+ "The hierarchy of the type Z is inconsistent\n" +
+ "----------\n" +
+ "4. ERROR in cycle\\X.java (at line 5)\n" +
+ " class A extends B {}\n" +
+ " ^\n" +
+ "The hierarchy of the type A is inconsistent\n" +
+ "----------\n" +
+ "5. ERROR in cycle\\X.java (at line 6)\n" +
+ " class B extends C {}\n" +
+ " ^\n" +
+ "The hierarchy of the type B is inconsistent\n" +
+ "----------\n" +
+ "6. ERROR in cycle\\X.java (at line 7)\n" +
+ " class C extends X {}\n" +
+ " ^\n" +
+ "Cycle detected: a cycle exists in the type hierarchy between C and X\n" +
"----------\n");
}
public void testBug520874a() {
@@ -447,17 +447,17 @@ public void testBug520874a() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in cycle\\A.java (at line 2)\n" +
- " class A extends C {\n" +
- " ^\n" +
- "The hierarchy of the type A is inconsistent\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in cycle\\X.java (at line 3)\n" +
- " class C extends B {}\n" +
- " ^\n" +
- "Cycle detected: a cycle exists in the type hierarchy between C and A\n" +
+ "----------\n" +
+ "1. ERROR in cycle\\A.java (at line 2)\n" +
+ " class A extends C {\n" +
+ " ^\n" +
+ "The hierarchy of the type A is inconsistent\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in cycle\\X.java (at line 3)\n" +
+ " class C extends B {}\n" +
+ " ^\n" +
+ "Cycle detected: a cycle exists in the type hierarchy between C and A\n" +
"----------\n");
}
public void testBug520874b() {
@@ -479,17 +479,17 @@ public void testBug520874b() {
" static class B {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in cycle\\X.java (at line 3)\n" +
- " class C extends B {}\n" +
- " ^\n" +
- "The hierarchy of the type C is inconsistent\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in cycle\\A.java (at line 2)\n" +
- " class A extends C {\n" +
- " ^\n" +
- "Cycle detected: a cycle exists in the type hierarchy between A and C\n" +
+ "----------\n" +
+ "1. ERROR in cycle\\X.java (at line 3)\n" +
+ " class C extends B {}\n" +
+ " ^\n" +
+ "The hierarchy of the type C is inconsistent\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in cycle\\A.java (at line 2)\n" +
+ " class A extends C {\n" +
+ " ^\n" +
+ "Cycle detected: a cycle exists in the type hierarchy between A and C\n" +
"----------\n");
}
public void testBug520874c() {
@@ -511,17 +511,17 @@ public void testBug520874c() {
" static interface B {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in cycle\\X.java (at line 3)\n" +
- " class C implements B {}\n" +
- " ^\n" +
- "The hierarchy of the type C is inconsistent\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in cycle\\A.java (at line 2)\n" +
- " class A extends C {\n" +
- " ^\n" +
- "Cycle detected: a cycle exists in the type hierarchy between A and C\n" +
+ "----------\n" +
+ "1. ERROR in cycle\\X.java (at line 3)\n" +
+ " class C implements B {}\n" +
+ " ^\n" +
+ "The hierarchy of the type C is inconsistent\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in cycle\\A.java (at line 2)\n" +
+ " class A extends C {\n" +
+ " ^\n" +
+ "Cycle detected: a cycle exists in the type hierarchy between A and C\n" +
"----------\n");
}
public void testBug520874d() {
@@ -543,17 +543,17 @@ public void testBug520874d() {
" static interface B {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in cycle\\X.java (at line 3)\n" +
- " class C implements B {}\n" +
- " ^\n" +
- "The hierarchy of the type C is inconsistent\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in cycle\\A.java (at line 2)\n" +
- " class A extends C {\n" +
- " ^\n" +
- "Cycle detected: a cycle exists in the type hierarchy between A and C\n" +
+ "----------\n" +
+ "1. ERROR in cycle\\X.java (at line 3)\n" +
+ " class C implements B {}\n" +
+ " ^\n" +
+ "The hierarchy of the type C is inconsistent\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in cycle\\A.java (at line 2)\n" +
+ " class A extends C {\n" +
+ " ^\n" +
+ "Cycle detected: a cycle exists in the type hierarchy between A and C\n" +
"----------\n");
}
public void testBug520874e() {
@@ -574,17 +574,17 @@ public void testBug520874e() {
" static interface B {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in cycle\\X.java (at line 3)\n" +
- " interface C extends B {}\n" +
- " ^\n" +
- "The hierarchy of the type C is inconsistent\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in cycle\\A.java (at line 2)\n" +
- " class A extends C {\n" +
- " ^\n" +
- "Cycle detected: a cycle exists in the type hierarchy between A and C\n" +
+ "----------\n" +
+ "1. ERROR in cycle\\X.java (at line 3)\n" +
+ " interface C extends B {}\n" +
+ " ^\n" +
+ "The hierarchy of the type C is inconsistent\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in cycle\\A.java (at line 2)\n" +
+ " class A extends C {\n" +
+ " ^\n" +
+ "Cycle detected: a cycle exists in the type hierarchy between A and C\n" +
"----------\n");
}
public void testBug520874f() {
@@ -605,17 +605,17 @@ public void testBug520874f() {
" static interface B {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in cycle\\X.java (at line 3)\n" +
- " interface C extends B {}\n" +
- " ^\n" +
- "The hierarchy of the type C is inconsistent\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in cycle\\A.java (at line 2)\n" +
- " class A extends C {\n" +
- " ^\n" +
- "Cycle detected: a cycle exists in the type hierarchy between A and C\n" +
+ "----------\n" +
+ "1. ERROR in cycle\\X.java (at line 3)\n" +
+ " interface C extends B {}\n" +
+ " ^\n" +
+ "The hierarchy of the type C is inconsistent\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in cycle\\A.java (at line 2)\n" +
+ " class A extends C {\n" +
+ " ^\n" +
+ "Cycle detected: a cycle exists in the type hierarchy between A and C\n" +
"----------\n");
}
public void testBug520874g() {
@@ -636,17 +636,17 @@ public void testBug520874g() {
" static interface B {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in cycle\\X.java (at line 3)\n" +
- " interface C extends B {}\n" +
- " ^\n" +
- "The hierarchy of the type C is inconsistent\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in cycle\\A.java (at line 2)\n" +
- " interface A extends C {\n" +
- " ^\n" +
- "Cycle detected: a cycle exists in the type hierarchy between A and C\n" +
+ "----------\n" +
+ "1. ERROR in cycle\\X.java (at line 3)\n" +
+ " interface C extends B {}\n" +
+ " ^\n" +
+ "The hierarchy of the type C is inconsistent\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in cycle\\A.java (at line 2)\n" +
+ " interface A extends C {\n" +
+ " ^\n" +
+ "Cycle detected: a cycle exists in the type hierarchy between A and C\n" +
"----------\n");
}
public void testBug520874h() {
@@ -667,17 +667,17 @@ public void testBug520874h() {
" static interface B {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in cycle\\X.java (at line 3)\n" +
- " interface C extends B {}\n" +
- " ^\n" +
- "The hierarchy of the type C is inconsistent\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in cycle\\A.java (at line 2)\n" +
- " interface A extends C {\n" +
- " ^\n" +
- "Cycle detected: a cycle exists in the type hierarchy between A and C\n" +
+ "----------\n" +
+ "1. ERROR in cycle\\X.java (at line 3)\n" +
+ " interface C extends B {}\n" +
+ " ^\n" +
+ "The hierarchy of the type C is inconsistent\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in cycle\\A.java (at line 2)\n" +
+ " interface A extends C {\n" +
+ " ^\n" +
+ "Cycle detected: a cycle exists in the type hierarchy between A and C\n" +
"----------\n");
}
public void testBug520874i() {
@@ -698,17 +698,17 @@ public void testBug520874i() {
" static interface B {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in cycle\\X.java (at line 3)\n" +
- " interface C extends A {}\n" +
- " ^\n" +
- "The hierarchy of the type C is inconsistent\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in cycle\\A.java (at line 2)\n" +
- " interface A extends C {\n" +
- " ^\n" +
- "Cycle detected: a cycle exists in the type hierarchy between A and C\n" +
+ "----------\n" +
+ "1. ERROR in cycle\\X.java (at line 3)\n" +
+ " interface C extends A {}\n" +
+ " ^\n" +
+ "The hierarchy of the type C is inconsistent\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in cycle\\A.java (at line 2)\n" +
+ " interface A extends C {\n" +
+ " ^\n" +
+ "Cycle detected: a cycle exists in the type hierarchy between A and C\n" +
"----------\n");
}
public void testBug526681() {
@@ -725,17 +725,17 @@ public void testBug526681() {
"import p.A.C;\n" +
"public abstract class B extends C {}"
},
- "----------\n" +
- "1. ERROR in p\\A.java (at line 3)\n" +
- " public class A extends B {\n" +
- " ^\n" +
- "The hierarchy of the type A is inconsistent\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in p\\B.java (at line 3)\n" +
- " public abstract class B extends C {}\n" +
- " ^\n" +
- "Cycle detected: a cycle exists in the type hierarchy between B and A\n" +
+ "----------\n" +
+ "1. ERROR in p\\A.java (at line 3)\n" +
+ " public class A extends B {\n" +
+ " ^\n" +
+ "The hierarchy of the type A is inconsistent\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in p\\B.java (at line 3)\n" +
+ " public abstract class B extends C {}\n" +
+ " ^\n" +
+ "Cycle detected: a cycle exists in the type hierarchy between B and A\n" +
"----------\n");
}
public void testBug527731() {
@@ -743,19 +743,19 @@ public void testBug527731() {
runConformTest(
new String[] {
"OuterClass.java",
- "import java.util.ArrayList;\n" +
- "\n" +
- "public class OuterClass<T> extends ArrayList<OuterClass.InnerTypedClass<T>> {\n" +
- " \n" +
- " public static interface InnerInterface {}\n" +
- " \n" +
- " public static class InnerTypedClass<T> implements InnerInterface {}\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " OuterClass<String> outerClass = new OuterClass<>();\n" +
- " outerClass.add(new InnerTypedClass<>());\n" +
- " System.out.println(outerClass);\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "\n" +
+ "public class OuterClass<T> extends ArrayList<OuterClass.InnerTypedClass<T>> {\n" +
+ " \n" +
+ " public static interface InnerInterface {}\n" +
+ " \n" +
+ " public static class InnerTypedClass<T> implements InnerInterface {}\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " OuterClass<String> outerClass = new OuterClass<>();\n" +
+ " outerClass.add(new InnerTypedClass<>());\n" +
+ " System.out.println(outerClass);\n" +
+ " }\n" +
"}\n"
});
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java
index d86e8828d..cdfcb8b06 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java
@@ -161,7 +161,7 @@ public void test003() {
" super(getRunnable(), new B().toString()); \n" +
" ^^^^^^^\n" +
"No enclosing instance of type A is available due to some intermediate constructor invocation\n" +
- "----------\n";
+ "----------\n";
this.runNegativeTest(
new String[] {
/* A.java */
@@ -1563,7 +1563,7 @@ public void test035() {
" (new D.E(null, null, null, new F(get()) {})).execute(); \n" +
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"No enclosing instance of type D is accessible. Must qualify the allocation with an enclosing instance of type D (e.g. x.new A() where x is an instance of D).\n" +
- "----------\n";
+ "----------\n";
this.runNegativeTest(new String[] {
/* A2.java */
"p1/A2.java",
@@ -3726,13 +3726,13 @@ public void test098() {
" } \n"+
"} \n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " } else { \n" +
- " System.out.println(\"unreachable inner class = \" + new Object() {}.getClass()); \n" +
- " } \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " } else { \n" +
+ " System.out.println(\"unreachable inner class = \" + new Object() {}.getClass()); \n" +
+ " } \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
"first inner class = class X$1\n" +
"Always true\n" +
@@ -4890,7 +4890,7 @@ public void test125() throws Exception {
" Inner classes:\n" +
" [inner class info: #1 X$1Local, outer class info: #0\n" +
" inner name: #44 Local, accessflags: 0 default]\n" +
- (isMinimumCompliant(ClassFileConstants.JDK11) ?
+ (isMinimumCompliant(ClassFileConstants.JDK11) ?
" Enclosing Method: #39 #41 X.foo(Ljava/lang/String;)V\n" +
"\n" +
"Nest Host: #39 X\n" : "");
@@ -6309,7 +6309,7 @@ public void test154() {
public void test155() throws Exception {
this.runConformTest(new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" Object foo() {\n" +
" return new X() {};\n" +
" }\n" +
@@ -6323,35 +6323,35 @@ public void test155() throws Exception {
public void test156() throws Exception {
this.runConformTest(new String[] {
"package1/A.java",//=======================
- "package package1;\n" +
- "abstract class A {\n" +
- " protected final void outerMethod() {\n" +
- " }\n" +
+ "package package1;\n" +
+ "abstract class A {\n" +
+ " protected final void outerMethod() {\n" +
+ " }\n" +
"}\n",
"package1/B.java",//=======================
- "package package1;\n" +
- "public class B extends A {\n" +
- "}\n",
+ "package package1;\n" +
+ "public class B extends A {\n" +
+ "}\n",
"package2/C.java",//=======================
- "package package2;\n" +
- "import package1.B;\n" +
- "public class C extends B {\n" +
- " private final MyInner myInner = new MyInner();\n" +
- " private class MyInner {\n" +
- " public void innerMethod() {\n" +
- " C.this.outerMethod();\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " final C c = new C();\n" +
- " c.myInner.innerMethod();\n" +
- " }\n" +
+ "package package2;\n" +
+ "import package1.B;\n" +
+ "public class C extends B {\n" +
+ " private final MyInner myInner = new MyInner();\n" +
+ " private class MyInner {\n" +
+ " public void innerMethod() {\n" +
+ " C.this.outerMethod();\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " final C c = new C();\n" +
+ " c.myInner.innerMethod();\n" +
+ " }\n" +
"}\n",
},
"");
String expectedOutput =
- " static synthetic void access$0(package2.C arg0);\n" +
- " 0 aload_0 [arg0]\n" +
+ " static synthetic void access$0(package2.C arg0);\n" +
+ " 0 aload_0 [arg0]\n" +
" 1 invokevirtual package2.C.outerMethod() : void";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "package2" + File.separator + "C.class", "C", expectedOutput);
}
@@ -6359,37 +6359,37 @@ public void test156() throws Exception {
public void test157() throws Exception {
this.runConformTest(new String[] {
"package1/A.java",//=======================
- "package package1;\n" +
- "abstract class A {\n" +
- " protected int outerField; {\n" +
- " }\n" +
+ "package package1;\n" +
+ "abstract class A {\n" +
+ " protected int outerField; {\n" +
+ " }\n" +
"}\n",
"package1/B.java",//=======================
- "package package1;\n" +
- "public class B extends A {\n" +
- "}\n",
+ "package package1;\n" +
+ "public class B extends A {\n" +
+ "}\n",
"package2/C.java",//=======================
- "package package2;\n" +
- "import package1.B;\n" +
- "public class C extends B {\n" +
- " private final MyInner myInner = new MyInner();\n" +
- " private class MyInner {\n" +
- " public void innerMethod() {\n" +
- " int j = C.this.outerField;\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " final C c = new C();\n" +
- " c.myInner.innerMethod();\n" +
- " }\n" +
+ "package package2;\n" +
+ "import package1.B;\n" +
+ "public class C extends B {\n" +
+ " private final MyInner myInner = new MyInner();\n" +
+ " private class MyInner {\n" +
+ " public void innerMethod() {\n" +
+ " int j = C.this.outerField;\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " final C c = new C();\n" +
+ " c.myInner.innerMethod();\n" +
+ " }\n" +
"}\n",
},
"");
String expectedOutput =
- " // Method descriptor #33 (Lpackage2/C;)I\n" +
- " // Stack: 1, Locals: 1\n" +
- " static synthetic int access$0(package2.C arg0);\n" +
- " 0 aload_0 [arg0]\n" +
+ " // Method descriptor #33 (Lpackage2/C;)I\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " static synthetic int access$0(package2.C arg0);\n" +
+ " 0 aload_0 [arg0]\n" +
" 1 getfield package2.C.outerField : int";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "package2" + File.separator + "C.class", "C", expectedOutput);
}
@@ -6397,38 +6397,38 @@ public void test157() throws Exception {
public void test158() throws Exception {
this.runConformTest(new String[] {
"package1/A.java",//=======================
- "package package1;\n" +
- "abstract class A {\n" +
- " protected int outerField; {\n" +
- " }\n" +
+ "package package1;\n" +
+ "abstract class A {\n" +
+ " protected int outerField; {\n" +
+ " }\n" +
"}\n",
"package1/B.java",//=======================
- "package package1;\n" +
- "public class B extends A {\n" +
- "}\n",
+ "package package1;\n" +
+ "public class B extends A {\n" +
+ "}\n",
"package2/C.java",//=======================
- "package package2;\n" +
- "import package1.B;\n" +
- "public class C extends B {\n" +
- " private final MyInner myInner = new MyInner();\n" +
- " private class MyInner {\n" +
- " public void innerMethod() {\n" +
- " C.this.outerField = 12;\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " final C c = new C();\n" +
- " c.myInner.innerMethod();\n" +
- " }\n" +
+ "package package2;\n" +
+ "import package1.B;\n" +
+ "public class C extends B {\n" +
+ " private final MyInner myInner = new MyInner();\n" +
+ " private class MyInner {\n" +
+ " public void innerMethod() {\n" +
+ " C.this.outerField = 12;\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " final C c = new C();\n" +
+ " c.myInner.innerMethod();\n" +
+ " }\n" +
"}\n",
},
"");
String expectedOutput =
- " // Method descriptor #33 (Lpackage2/C;I)V\n" +
- " // Stack: 2, Locals: 2\n" +
- " static synthetic void access$0(package2.C arg0, int arg1);\n" +
- " 0 aload_0 [arg0]\n" +
- " 1 iload_1 [arg1]\n" +
+ " // Method descriptor #33 (Lpackage2/C;I)V\n" +
+ " // Stack: 2, Locals: 2\n" +
+ " static synthetic void access$0(package2.C arg0, int arg1);\n" +
+ " 0 aload_0 [arg0]\n" +
+ " 1 iload_1 [arg1]\n" +
" 2 putfield package2.C.outerField : int";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "package2" + File.separator + "C.class", "C", expectedOutput);
@@ -6437,37 +6437,37 @@ public void test158() throws Exception {
public void test159() throws Exception {
this.runConformTest(new String[] {
"package1/A.java",//=======================
- "package package1;\n" +
- "abstract class A {\n" +
- " protected int outerField; {\n" +
- " }\n" +
+ "package package1;\n" +
+ "abstract class A {\n" +
+ " protected int outerField; {\n" +
+ " }\n" +
"}\n",
"package1/B.java",//=======================
- "package package1;\n" +
- "public class B extends A {\n" +
- "}\n",
+ "package package1;\n" +
+ "public class B extends A {\n" +
+ "}\n",
"package2/C.java",//=======================
- "package package2;\n" +
- "import package1.B;\n" +
- "public class C extends B {\n" +
- " private final MyInner myInner = new MyInner();\n" +
- " private class MyInner {\n" +
- " public void innerMethod() {\n" +
- " int j = outerField;\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " final C c = new C();\n" +
- " c.myInner.innerMethod();\n" +
- " }\n" +
+ "package package2;\n" +
+ "import package1.B;\n" +
+ "public class C extends B {\n" +
+ " private final MyInner myInner = new MyInner();\n" +
+ " private class MyInner {\n" +
+ " public void innerMethod() {\n" +
+ " int j = outerField;\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " final C c = new C();\n" +
+ " c.myInner.innerMethod();\n" +
+ " }\n" +
"}\n",
},
"");
String expectedOutput =
- " // Method descriptor #33 (Lpackage2/C;)I\n" +
- " // Stack: 1, Locals: 1\n" +
- " static synthetic int access$0(package2.C arg0);\n" +
- " 0 aload_0 [arg0]\n" +
+ " // Method descriptor #33 (Lpackage2/C;)I\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " static synthetic int access$0(package2.C arg0);\n" +
+ " 0 aload_0 [arg0]\n" +
" 1 getfield package2.C.outerField : int";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "package2" + File.separator + "C.class", "C", expectedOutput);
}
@@ -6475,38 +6475,38 @@ public void test159() throws Exception {
public void test160() throws Exception {
this.runConformTest(new String[] {
"package1/A.java",//=======================
- "package package1;\n" +
- "abstract class A {\n" +
- " protected int outerField; {\n" +
- " }\n" +
+ "package package1;\n" +
+ "abstract class A {\n" +
+ " protected int outerField; {\n" +
+ " }\n" +
"}\n",
"package1/B.java",//=======================
- "package package1;\n" +
- "public class B extends A {\n" +
- "}\n",
+ "package package1;\n" +
+ "public class B extends A {\n" +
+ "}\n",
"package2/C.java",//=======================
- "package package2;\n" +
- "import package1.B;\n" +
- "public class C extends B {\n" +
- " private final MyInner myInner = new MyInner();\n" +
- " private class MyInner {\n" +
- " public void innerMethod() {\n" +
- " outerField = 12;\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " final C c = new C();\n" +
- " c.myInner.innerMethod();\n" +
- " }\n" +
+ "package package2;\n" +
+ "import package1.B;\n" +
+ "public class C extends B {\n" +
+ " private final MyInner myInner = new MyInner();\n" +
+ " private class MyInner {\n" +
+ " public void innerMethod() {\n" +
+ " outerField = 12;\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " final C c = new C();\n" +
+ " c.myInner.innerMethod();\n" +
+ " }\n" +
"}\n",
},
"");
String expectedOutput =
- " // Method descriptor #33 (Lpackage2/C;I)V\n" +
- " // Stack: 2, Locals: 2\n" +
- " static synthetic void access$0(package2.C arg0, int arg1);\n" +
- " 0 aload_0 [arg0]\n" +
- " 1 iload_1 [arg1]\n" +
+ " // Method descriptor #33 (Lpackage2/C;I)V\n" +
+ " // Stack: 2, Locals: 2\n" +
+ " static synthetic void access$0(package2.C arg0, int arg1);\n" +
+ " 0 aload_0 [arg0]\n" +
+ " 1 iload_1 [arg1]\n" +
" 2 putfield package2.C.outerField : int";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "package2" + File.separator + "C.class", "C", expectedOutput);
}
@@ -6514,36 +6514,36 @@ public void test160() throws Exception {
public void test161() throws Exception {
this.runConformTest(new String[] {
"package1/A.java",//=======================
- "package package1;\n" +
- "abstract class A {\n" +
- " static protected int outerField; {\n" +
- " }\n" +
+ "package package1;\n" +
+ "abstract class A {\n" +
+ " static protected int outerField; {\n" +
+ " }\n" +
"}\n",
"package1/B.java",//=======================
- "package package1;\n" +
- "public class B extends A {\n" +
- "}\n",
+ "package package1;\n" +
+ "public class B extends A {\n" +
+ "}\n",
"package2/C.java",//=======================
- "package package2;\n" +
- "import package1.B;\n" +
- "public class C extends B {\n" +
- " private final MyInner myInner = new MyInner();\n" +
- " private class MyInner {\n" +
- " public void innerMethod() {\n" +
- " int j = C.this.outerField;\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " final C c = new C();\n" +
- " c.myInner.innerMethod();\n" +
- " }\n" +
+ "package package2;\n" +
+ "import package1.B;\n" +
+ "public class C extends B {\n" +
+ " private final MyInner myInner = new MyInner();\n" +
+ " private class MyInner {\n" +
+ " public void innerMethod() {\n" +
+ " int j = C.this.outerField;\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " final C c = new C();\n" +
+ " c.myInner.innerMethod();\n" +
+ " }\n" +
"}\n",
},
"");
String expectedOutput =
- " // Method descriptor #33 ()I\n" +
- " // Stack: 1, Locals: 0\n" +
- " static synthetic int access$0();\n" +
+ " // Method descriptor #33 ()I\n" +
+ " // Stack: 1, Locals: 0\n" +
+ " static synthetic int access$0();\n" +
" 0 getstatic package2.C.outerField : int";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "package2" + File.separator + "C.class", "C", expectedOutput);
}
@@ -6551,37 +6551,37 @@ public void test161() throws Exception {
public void test162() throws Exception {
this.runConformTest(new String[] {
"package1/A.java",//=======================
- "package package1;\n" +
- "abstract class A {\n" +
- " static protected int outerField; {\n" +
- " }\n" +
+ "package package1;\n" +
+ "abstract class A {\n" +
+ " static protected int outerField; {\n" +
+ " }\n" +
"}\n",
"package1/B.java",//=======================
- "package package1;\n" +
- "public class B extends A {\n" +
- "}\n",
+ "package package1;\n" +
+ "public class B extends A {\n" +
+ "}\n",
"package2/C.java",//=======================
- "package package2;\n" +
- "import package1.B;\n" +
- "public class C extends B {\n" +
- " private final MyInner myInner = new MyInner();\n" +
- " private class MyInner {\n" +
- " public void innerMethod() {\n" +
- " C.this.outerField = 12;\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " final C c = new C();\n" +
- " c.myInner.innerMethod();\n" +
- " }\n" +
+ "package package2;\n" +
+ "import package1.B;\n" +
+ "public class C extends B {\n" +
+ " private final MyInner myInner = new MyInner();\n" +
+ " private class MyInner {\n" +
+ " public void innerMethod() {\n" +
+ " C.this.outerField = 12;\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " final C c = new C();\n" +
+ " c.myInner.innerMethod();\n" +
+ " }\n" +
"}\n",
},
"");
String expectedOutput =
- " // Method descriptor #33 (I)V\n" +
- " // Stack: 1, Locals: 1\n" +
- " static synthetic void access$0(int arg0);\n" +
- " 0 iload_0 [arg0]\n" +
+ " // Method descriptor #33 (I)V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " static synthetic void access$0(int arg0);\n" +
+ " 0 iload_0 [arg0]\n" +
" 1 putstatic package2.C.outerField : int";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "package2" + File.separator + "C.class", "C", expectedOutput);
@@ -6590,36 +6590,36 @@ public void test162() throws Exception {
public void test163() throws Exception {
this.runConformTest(new String[] {
"package1/A.java",//=======================
- "package package1;\n" +
- "abstract class A {\n" +
- " static protected int outerField; {\n" +
- " }\n" +
+ "package package1;\n" +
+ "abstract class A {\n" +
+ " static protected int outerField; {\n" +
+ " }\n" +
"}\n",
"package1/B.java",//=======================
- "package package1;\n" +
- "public class B extends A {\n" +
- "}\n",
+ "package package1;\n" +
+ "public class B extends A {\n" +
+ "}\n",
"package2/C.java",//=======================
- "package package2;\n" +
- "import package1.B;\n" +
- "public class C extends B {\n" +
- " private final MyInner myInner = new MyInner();\n" +
- " private class MyInner {\n" +
- " public void innerMethod() {\n" +
- " int j = outerField;\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " final C c = new C();\n" +
- " c.myInner.innerMethod();\n" +
- " }\n" +
+ "package package2;\n" +
+ "import package1.B;\n" +
+ "public class C extends B {\n" +
+ " private final MyInner myInner = new MyInner();\n" +
+ " private class MyInner {\n" +
+ " public void innerMethod() {\n" +
+ " int j = outerField;\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " final C c = new C();\n" +
+ " c.myInner.innerMethod();\n" +
+ " }\n" +
"}\n",
},
"");
String expectedOutput =
- " // Method descriptor #33 ()I\n" +
- " // Stack: 1, Locals: 0\n" +
- " static synthetic int access$0();\n" +
+ " // Method descriptor #33 ()I\n" +
+ " // Stack: 1, Locals: 0\n" +
+ " static synthetic int access$0();\n" +
" 0 getstatic package2.C.outerField : int";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "package2" + File.separator + "C.class", "C", expectedOutput);
}
@@ -6627,37 +6627,37 @@ public void test163() throws Exception {
public void test164() throws Exception {
this.runConformTest(new String[] {
"package1/A.java",//=======================
- "package package1;\n" +
- "abstract class A {\n" +
- " static protected int outerField; {\n" +
- " }\n" +
+ "package package1;\n" +
+ "abstract class A {\n" +
+ " static protected int outerField; {\n" +
+ " }\n" +
"}\n",
"package1/B.java",//=======================
- "package package1;\n" +
- "public class B extends A {\n" +
- "}\n",
+ "package package1;\n" +
+ "public class B extends A {\n" +
+ "}\n",
"package2/C.java",//=======================
- "package package2;\n" +
- "import package1.B;\n" +
- "public class C extends B {\n" +
- " private final MyInner myInner = new MyInner();\n" +
- " private class MyInner {\n" +
- " public void innerMethod() {\n" +
- " outerField = 12;\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " final C c = new C();\n" +
- " c.myInner.innerMethod();\n" +
- " }\n" +
+ "package package2;\n" +
+ "import package1.B;\n" +
+ "public class C extends B {\n" +
+ " private final MyInner myInner = new MyInner();\n" +
+ " private class MyInner {\n" +
+ " public void innerMethod() {\n" +
+ " outerField = 12;\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " final C c = new C();\n" +
+ " c.myInner.innerMethod();\n" +
+ " }\n" +
"}\n",
},
"");
String expectedOutput =
- " // Method descriptor #33 (I)V\n" +
- " // Stack: 1, Locals: 1\n" +
- " static synthetic void access$0(int arg0);\n" +
- " 0 iload_0 [arg0]\n" +
+ " // Method descriptor #33 (I)V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " static synthetic void access$0(int arg0);\n" +
+ " 0 iload_0 [arg0]\n" +
" 1 putstatic package2.C.outerField : int";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "package2" + File.separator + "C.class", "C", expectedOutput);
}
@@ -6665,36 +6665,36 @@ public void test164() throws Exception {
public void test165() throws Exception {
this.runConformTest(new String[] {
"package1/A.java",//=======================
- "package package1;\n" +
- "abstract class A {\n" +
- " static protected final void outerMethod() {\n" +
- " }\n" +
+ "package package1;\n" +
+ "abstract class A {\n" +
+ " static protected final void outerMethod() {\n" +
+ " }\n" +
"}\n",
"package1/B.java",//=======================
- "package package1;\n" +
- "public class B extends A {\n" +
- "}\n",
+ "package package1;\n" +
+ "public class B extends A {\n" +
+ "}\n",
"package2/C.java",//=======================
- "package package2;\n" +
- "import package1.B;\n" +
- "public class C extends B {\n" +
- " private final MyInner myInner = new MyInner();\n" +
- " private class MyInner {\n" +
- " public void innerMethod() {\n" +
- " C.this.outerMethod();\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " final C c = new C();\n" +
- " c.myInner.innerMethod();\n" +
- " }\n" +
+ "package package2;\n" +
+ "import package1.B;\n" +
+ "public class C extends B {\n" +
+ " private final MyInner myInner = new MyInner();\n" +
+ " private class MyInner {\n" +
+ " public void innerMethod() {\n" +
+ " C.this.outerMethod();\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " final C c = new C();\n" +
+ " c.myInner.innerMethod();\n" +
+ " }\n" +
"}\n",
},
"");
String expectedOutput =
- " // Method descriptor #8 ()V\n" +
- " // Stack: 0, Locals: 0\n" +
- " static synthetic void access$0();\n" +
+ " // Method descriptor #8 ()V\n" +
+ " // Stack: 0, Locals: 0\n" +
+ " static synthetic void access$0();\n" +
" 0 invokestatic package2.C.outerMethod() : void";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "package2" + File.separator + "C.class", "C", expectedOutput);
}
@@ -6702,22 +6702,22 @@ public void test165() throws Exception {
public void test166() throws Exception {
this.runConformTest(new String[] {
"X.java",//=======================
- "class XSuper {\n" +
- " protected String field = \"[XSuper#field]\";//$NON-NLS-1$\n" +
- "}\n" +
- "public class X extends XSuper {\n" +
- " protected String field = \"[X#field]\";//$NON-NLS-1$\n" +
- " public static void main(String[] args) {\n" +
- " new X().foo();\n" +
- " }\n" +
- " void foo() {\n" +
- " new Object() {\n" +
- " void bar() {\n" +
- " System.out.print(\"X.this.field=\" + X.this.field);\n" +
- " System.out.print(\"X.super.field=\" + X.super.field);\n" +
- " }\n" +
- " }.bar();\n" +
- " }\n" +
+ "class XSuper {\n" +
+ " protected String field = \"[XSuper#field]\";//$NON-NLS-1$\n" +
+ "}\n" +
+ "public class X extends XSuper {\n" +
+ " protected String field = \"[X#field]\";//$NON-NLS-1$\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().foo();\n" +
+ " }\n" +
+ " void foo() {\n" +
+ " new Object() {\n" +
+ " void bar() {\n" +
+ " System.out.print(\"X.this.field=\" + X.this.field);\n" +
+ " System.out.print(\"X.super.field=\" + X.super.field);\n" +
+ " }\n" +
+ " }.bar();\n" +
+ " }\n" +
"}\n",
},
"X.this.field=[X#field]X.super.field=[XSuper#field]");
@@ -6726,22 +6726,22 @@ public void test166() throws Exception {
public void test167() throws Exception {
this.runConformTest(new String[] {
"X.java",//=======================
- "class XSuper {\n" +
- " protected String method() { return \"[XSuper#method()]\"; }//$NON-NLS-1$\n" +
- "}\n" +
- "public class X extends XSuper {\n" +
- " protected String method() { return \"[X#method()]\"; }//$NON-NLS-1$\n" +
- " public static void main(String[] args) {\n" +
- " new X().foo();\n" +
- " }\n" +
- " void foo() {\n" +
- " new Object() {\n" +
- " void bar() {\n" +
- " System.out.print(\"X.this.method()=\" + X.this.method());\n" +
- " System.out.print(\"X.super.method()=\" + X.super.method());\n" +
- " }\n" +
- " }.bar();\n" +
- " }\n" +
+ "class XSuper {\n" +
+ " protected String method() { return \"[XSuper#method()]\"; }//$NON-NLS-1$\n" +
+ "}\n" +
+ "public class X extends XSuper {\n" +
+ " protected String method() { return \"[X#method()]\"; }//$NON-NLS-1$\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().foo();\n" +
+ " }\n" +
+ " void foo() {\n" +
+ " new Object() {\n" +
+ " void bar() {\n" +
+ " System.out.print(\"X.this.method()=\" + X.this.method());\n" +
+ " System.out.print(\"X.super.method()=\" + X.super.method());\n" +
+ " }\n" +
+ " }.bar();\n" +
+ " }\n" +
"}\n",
},
"X.this.method()=[X#method()]X.super.method()=[XSuper#method()]");
@@ -6750,24 +6750,24 @@ public void test167() throws Exception {
public void test168() throws Exception {
this.runConformTest(new String[] {
"X.java",//=======================
- "class XSuper {\n" +
- " protected String field;\n" +
- "}\n" +
- "public class X extends XSuper {\n" +
- " protected String field;\n" +
- " public static void main(String[] args) {\n" +
- " new X().foo();\n" +
- " }\n" +
- " void foo() {\n" +
- " new Object() {\n" +
- " void bar() {\n" +
+ "class XSuper {\n" +
+ " protected String field;\n" +
+ "}\n" +
+ "public class X extends XSuper {\n" +
+ " protected String field;\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().foo();\n" +
+ " }\n" +
+ " void foo() {\n" +
+ " new Object() {\n" +
+ " void bar() {\n" +
" X.this.field = \"[X#field]\";\n" +
" X.super.field = \"[XSuper#field]\";\n" +
- " System.out.print(\"X.this.field=\" + X.this.field);\n" +
- " System.out.print(\"X.super.field=\" + X.super.field);\n" +
- " }\n" +
- " }.bar();\n" +
- " }\n" +
+ " System.out.print(\"X.this.field=\" + X.this.field);\n" +
+ " System.out.print(\"X.super.field=\" + X.super.field);\n" +
+ " }\n" +
+ " }.bar();\n" +
+ " }\n" +
"}\n",
},
"X.this.field=[X#field]X.super.field=[XSuper#field]");
@@ -6776,27 +6776,27 @@ public void test168() throws Exception {
public void test169() throws Exception {
this.runConformTest(new String[] {
"X.java",//=======================
- "import p.XSuper;\n" +
- "public class X extends XSuper {\n" +
- " protected String method() { return \"[X#method()]\"; }//$NON-NLS-1$\n" +
- " public static void main(String[] args) {\n" +
- " new X().foo();\n" +
- " }\n" +
- " void foo() {\n" +
- " new Object () {\n" +
- " void bar() {\n" +
- " System.out.print(\"X.this.method()=\" + X.this.method());\n" +
- " System.out.print(\"X.super.method()=\" + X.super.method());\n" +
- " }\n" +
- " }.bar();\n" +
- " }\n" +
+ "import p.XSuper;\n" +
+ "public class X extends XSuper {\n" +
+ " protected String method() { return \"[X#method()]\"; }//$NON-NLS-1$\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().foo();\n" +
+ " }\n" +
+ " void foo() {\n" +
+ " new Object () {\n" +
+ " void bar() {\n" +
+ " System.out.print(\"X.this.method()=\" + X.this.method());\n" +
+ " System.out.print(\"X.super.method()=\" + X.super.method());\n" +
+ " }\n" +
+ " }.bar();\n" +
+ " }\n" +
"}\n",
"p/XSuper.java",//=======================
- "package p;\n" +
- "class XInternal {\n" +
- " protected String method() { return \"[XInternal#method()]\"; }//$NON-NLS-1$\n" +
- "}\n" +
- "public class XSuper extends XInternal {\n" +
+ "package p;\n" +
+ "class XInternal {\n" +
+ " protected String method() { return \"[XInternal#method()]\"; }//$NON-NLS-1$\n" +
+ "}\n" +
+ "public class XSuper extends XInternal {\n" +
"}\n",
},
"X.this.method()=[X#method()]X.super.method()=[XInternal#method()]");
@@ -6805,18 +6805,18 @@ public void test169() throws Exception {
public void test170() throws Exception {
this.runConformTest(new String[] {
"X.java",//=======================
- "public class X {\n" +
- " class Member {\n" +
- " private String field = \"SUCCESS\";\n" +
- " }\n" +
- " class SubMember extends Member {\n" +
- " void foo() {\n" +
- " System.out.println(super.field);\n" +
- " }\n" +
- " } \n" +
- " public static void main(String argv[]) {\n" +
- " new X().new SubMember().foo(); \n" +
- " }\n" +
+ "public class X {\n" +
+ " class Member {\n" +
+ " private String field = \"SUCCESS\";\n" +
+ " }\n" +
+ " class SubMember extends Member {\n" +
+ " void foo() {\n" +
+ " System.out.println(super.field);\n" +
+ " }\n" +
+ " } \n" +
+ " public static void main(String argv[]) {\n" +
+ " new X().new SubMember().foo(); \n" +
+ " }\n" +
"}\n",
},
"SUCCESS");
@@ -6825,18 +6825,18 @@ public void test170() throws Exception {
public void test171() throws Exception {
this.runConformTest(new String[] {
"X.java",//=======================
- "public class X {\n" +
- " class Member {\n" +
- " private String method() { return \"SUCCESS\"; }\n" +
- " }\n" +
- " class SubMember extends Member {\n" +
- " void foo() {\n" +
- " System.out.println(super.method());\n" +
- " }\n" +
- " } \n" +
- " public static void main(String argv[]) {\n" +
- " new X().new SubMember().foo(); \n" +
- " }\n" +
+ "public class X {\n" +
+ " class Member {\n" +
+ " private String method() { return \"SUCCESS\"; }\n" +
+ " }\n" +
+ " class SubMember extends Member {\n" +
+ " void foo() {\n" +
+ " System.out.println(super.method());\n" +
+ " }\n" +
+ " } \n" +
+ " public static void main(String argv[]) {\n" +
+ " new X().new SubMember().foo(); \n" +
+ " }\n" +
"}\n",
},
"SUCCESS");
@@ -6845,50 +6845,50 @@ public void test171() throws Exception {
public void test172() throws Exception {
String[] files = new String[] {
"X.java",
- "public class X {\n" +
- " void a() {}\n" +
- " private static void a(String s) {}\n" +
- " private void c() {}\n" +
- " private static void c(String s) {}\n" +
- " static class M1 extends X {\n" +
- " public void x() {\n" +
- " a(null);\n" +
- " c(null);\n" +
- " }\n" +
- " }\n" +
- " static class M2 {\n" +
- " public void x() {\n" +
- " a(null);\n" +
- " c(null);\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
+ "public class X {\n" +
+ " void a() {}\n" +
+ " private static void a(String s) {}\n" +
+ " private void c() {}\n" +
+ " private static void c(String s) {}\n" +
+ " static class M1 extends X {\n" +
+ " public void x() {\n" +
+ " a(null);\n" +
+ " c(null);\n" +
+ " }\n" +
+ " }\n" +
+ " static class M2 {\n" +
+ " public void x() {\n" +
+ " a(null);\n" +
+ " c(null);\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
"}\n",
};
if (this.complianceLevel < ClassFileConstants.JDK11) {
this.runNegativeTest(
files,
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " a(null);\n" +
- " ^^^^^^^\n" +
- "Access to enclosing method a(String) from the type X is emulated by a synthetic accessor method\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " c(null);\n" +
- " ^^^^^^^\n" +
- "Access to enclosing method c(String) from the type X is emulated by a synthetic accessor method\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 14)\n" +
- " a(null);\n" +
- " ^^^^^^^\n" +
- "Access to enclosing method a(String) from the type X is emulated by a synthetic accessor method\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 15)\n" +
- " c(null);\n" +
- " ^^^^^^^\n" +
- "Access to enclosing method c(String) from the type X is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " a(null);\n" +
+ " ^^^^^^^\n" +
+ "Access to enclosing method a(String) from the type X is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " c(null);\n" +
+ " ^^^^^^^\n" +
+ "Access to enclosing method c(String) from the type X is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 14)\n" +
+ " a(null);\n" +
+ " ^^^^^^^\n" +
+ "Access to enclosing method a(String) from the type X is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 15)\n" +
+ " c(null);\n" +
+ " ^^^^^^^\n" +
+ "Access to enclosing method c(String) from the type X is emulated by a synthetic accessor method\n" +
"----------\n"
);
} else {
@@ -6900,21 +6900,21 @@ public void test173() throws Exception {
this.runConformTest(
new String[] {
"X.java",//=======================
- "import java.util.ArrayList;\n" +
- "import java.util.Comparator;\n" +
- "import java.util.List;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " final List yourList = new ArrayList();\n" +
- " final List myList = new ArrayList();\n" +
- " new Comparator() {\n" +
- " public int compare(Object o1, Object o2) {\n" +
- " compare(yourList != null ? yourList : myList, yourList);\n" +
- " return 0;\n" +
- " }\n" +
- " };\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.Comparator;\n" +
+ "import java.util.List;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " final List yourList = new ArrayList();\n" +
+ " final List myList = new ArrayList();\n" +
+ " new Comparator() {\n" +
+ " public int compare(Object o1, Object o2) {\n" +
+ " compare(yourList != null ? yourList : myList, yourList);\n" +
+ " return 0;\n" +
+ " }\n" +
+ " };\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " }\n" +
"}",
},
"SUCCESS");
@@ -6924,27 +6924,27 @@ public void test174() throws Exception {
this.runConformTest(
new String[] {
"X.java",//=======================
- "import java.util.Comparator;\n" +
- "public class X {\n" +
+ "import java.util.Comparator;\n" +
+ "public class X {\n" +
" public static class MyList {\n" +
- " int size;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " final MyList yourList = new MyList();\n" +
- " final MyList myList = new MyList();\n" +
- " new Comparator() {\n" +
+ " int size;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " final MyList yourList = new MyList();\n" +
+ " final MyList myList = new MyList();\n" +
+ " new Comparator() {\n" +
" public int compare(Object o1, Object o2) {\n" +
- " return compare((MyList) o1, (MyList) o2);\n" +
- " }\n" +
- " public int compare(MyList o1, MyList o2) {\n" +
- " return foo(yourList != null ? yourList.size : myList.size, yourList.size);\n" +
- " }\n" +
- " private int foo(int i, int j) {\n" +
- " return i - j;\n" +
- " }\n" +
- " };\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
+ " return compare((MyList) o1, (MyList) o2);\n" +
+ " }\n" +
+ " public int compare(MyList o1, MyList o2) {\n" +
+ " return foo(yourList != null ? yourList.size : myList.size, yourList.size);\n" +
+ " }\n" +
+ " private int foo(int i, int j) {\n" +
+ " return i - j;\n" +
+ " }\n" +
+ " };\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " }\n" +
"}",
},
"SUCCESS");
@@ -6954,13 +6954,13 @@ public void test175() throws Exception {
this.runConformTest(
new String[] {
"X.java",//=======================
- "public class X {\n" +
+ "public class X {\n" +
" class Inner extends X {\n" +
- " }\n" +
+ " }\n" +
" public static void main(String[] args) {\n" +
- " new X().new Inner(){};\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
+ " new X().new Inner(){};\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " }\n" +
"}",
},
"SUCCESS");
@@ -6971,13 +6971,13 @@ public void test175() throws Exception {
" String which;\n" +
" X(String s) {\n" +
" this.which = s;\n" +
- " }\n" +
+ " }\n" +
" class Inner extends X {\n" +
" Inner() {\n" +
" super(\"Inner\");\n" +
" System.out.print( X.this.which + \",\" ); // will output 'Enclosing,'\n" +
" }\n" +
- " }\n" +
+ " }\n" +
" void check() {\n" +
" new X(\"Enclosing\").new Inner() {\n" +
" {\n" +
@@ -6986,11 +6986,11 @@ public void test175() throws Exception {
" void f() {\n" +
" System.out.println( X.this.which ); // will output 'Context'\n" +
" }\n" +
- " }.f();\n" +
+ " }.f();\n" +
" }\n" +
" public static void main(String[] args) {\n" +
" new X(\"Context\").check();\n" +
- " }\n" +
+ " }\n" +
"}",
},
"Enclosing,Context,Context");
@@ -7000,43 +7000,43 @@ public void test176() {
this.runConformTest(
new String[] {
"Demo.java",
- "import java.util.ArrayList;\n" +
- "public class Demo {\n" +
- " static class ExprFactoryList extends ArrayList {\n" +
- " class Expr {}\n" +
- " class Expr2 extends Expr {}\n" +
- " }\n" +
- " final static ExprFactoryList arith = new ExprFactoryList() {\n" +
- " {\n" +
- " add(new Object() {public Expr generate() {return new Expr() {};} }); // OK\n" +
- " add(new Object() {public Expr generate() {return new Expr2() {};} }); // Ok\n" +
- " }\n" +
- " };\n" +
- " final static ExprFactoryList statementFactory = new ExprFactoryList() {\n" +
- " class Statement extends Expr {}\n" +
- " void m() {\n" +
- " add(new Object() {\n" +
- " public void generate() {\n" +
- " new Statement(){}; // OK\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- " {\n" +
- " add (new Statement()); // OK\n" +
- " add(new Object() {\n" +
- " public void generate() {\n" +
- " new Statement(); // OK\n" +
- " new Statement(){}; // cannot compile\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- " };\n" +
- " public static void main(String[] args) {\n" +
- " Demo demo = new Demo();\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " \n" +
- "}"
+ "import java.util.ArrayList;\n" +
+ "public class Demo {\n" +
+ " static class ExprFactoryList extends ArrayList {\n" +
+ " class Expr {}\n" +
+ " class Expr2 extends Expr {}\n" +
+ " }\n" +
+ " final static ExprFactoryList arith = new ExprFactoryList() {\n" +
+ " {\n" +
+ " add(new Object() {public Expr generate() {return new Expr() {};} }); // OK\n" +
+ " add(new Object() {public Expr generate() {return new Expr2() {};} }); // Ok\n" +
+ " }\n" +
+ " };\n" +
+ " final static ExprFactoryList statementFactory = new ExprFactoryList() {\n" +
+ " class Statement extends Expr {}\n" +
+ " void m() {\n" +
+ " add(new Object() {\n" +
+ " public void generate() {\n" +
+ " new Statement(){}; // OK\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
+ " {\n" +
+ " add (new Statement()); // OK\n" +
+ " add(new Object() {\n" +
+ " public void generate() {\n" +
+ " new Statement(); // OK\n" +
+ " new Statement(){}; // cannot compile\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
+ " };\n" +
+ " public static void main(String[] args) {\n" +
+ " Demo demo = new Demo();\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " }\n" +
+ " \n" +
+ "}"
},
"SUCCESS");
}
@@ -7045,34 +7045,34 @@ public void testbug484546() {
this.runConformTest(
new String[] {
"inner/test/InnerTest.java",
- "package inner.test;\n" +
- "class Inner029SuperSuper {\n" +
- " public int getValue() {\n" +
- " return 10;\n" +
- " }\n" +
- "}\n" +
- "class Inner029Super extends Inner029SuperSuper {\n" +
- "}\n" +
- "class InnerSuper extends Inner029Super {\n" +
- " public int getValue() {\n" +
- " return 20;\n" +
- " }\n" +
- "}\n" +
- "public class InnerTest extends Inner029Super {\n" +
- " public int result = new Inner().getInner2().test();\n" +
- " class Inner extends InnerSuper {\n" +
- " Inner2 getInner2() {\n" +
- " return new Inner2();\n" +
- " }\n" +
- " class Inner2 {\n" +
- " public int test() {\n" +
- " return InnerTest.super.getValue();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(new InnerTest().result);\n" +
- "}\n" +
+ "package inner.test;\n" +
+ "class Inner029SuperSuper {\n" +
+ " public int getValue() {\n" +
+ " return 10;\n" +
+ " }\n" +
+ "}\n" +
+ "class Inner029Super extends Inner029SuperSuper {\n" +
+ "}\n" +
+ "class InnerSuper extends Inner029Super {\n" +
+ " public int getValue() {\n" +
+ " return 20;\n" +
+ " }\n" +
+ "}\n" +
+ "public class InnerTest extends Inner029Super {\n" +
+ " public int result = new Inner().getInner2().test();\n" +
+ " class Inner extends InnerSuper {\n" +
+ " Inner2 getInner2() {\n" +
+ " return new Inner2();\n" +
+ " }\n" +
+ " class Inner2 {\n" +
+ " public int test() {\n" +
+ " return InnerTest.super.getValue();\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(new InnerTest().result);\n" +
+ "}\n" +
"}\n"
},
"10");
@@ -7081,13 +7081,13 @@ public void testbug484546() {
public void testbug373371() {
String[] sources = new String[] {
"Outer.java",
- "class Outer {\n" +
- " class Inner extends Outer { }\n" +
- " class SubInner extends Inner {\n" +
- " public SubInner() {\n" +
- " // Outer.this.super(); // (1)\n" +
- " }\n" +
- " }\n" +
+ "class Outer {\n" +
+ " class Inner extends Outer { }\n" +
+ " class SubInner extends Inner {\n" +
+ " public SubInner() {\n" +
+ " // Outer.this.super(); // (1)\n" +
+ " }\n" +
+ " }\n" +
"}"
};
if (this.complianceLevel < ClassFileConstants.JDK1_4 || this.complianceLevel > ClassFileConstants.JDK1_6) {
@@ -7107,27 +7107,27 @@ public void testbug373371() {
public void testbug522061() {
String[] sources = new String[] {
"ztest/Foo.java",
- "package ztest;\n" +
- "import java.io.File;\n" +
- "import javax.swing.Action;\n" +
- "public abstract class Foo {\n" +
- " public FilteredFileTree matching(final Action filterConfigAction) {\n" +
- " return new FilteredFileTree() {\n" +
- " //@Override\n" +
- " protected File filter(File set) {\n" +
- " return null;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " public String getDisplayName() {\n" +
- " return null;\n" +
- " }\n" +
- " private abstract class FilteredFileTree extends Foo {\n" +
- " protected abstract File filter(File set);\n" +
- " public String getDisplayName() {\n" +
- " return Foo.this.toString();\n" +
- " }\n" +
- " }\n" +
+ "package ztest;\n" +
+ "import java.io.File;\n" +
+ "import javax.swing.Action;\n" +
+ "public abstract class Foo {\n" +
+ " public FilteredFileTree matching(final Action filterConfigAction) {\n" +
+ " return new FilteredFileTree() {\n" +
+ " //@Override\n" +
+ " protected File filter(File set) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
+ " public String getDisplayName() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " private abstract class FilteredFileTree extends Foo {\n" +
+ " protected abstract File filter(File set);\n" +
+ " public String getDisplayName() {\n" +
+ " return Foo.this.toString();\n" +
+ " }\n" +
+ " }\n" +
"}"
};
if (this.complianceLevel < ClassFileConstants.JDK1_4 || this.complianceLevel > ClassFileConstants.JDK1_6) {
@@ -7135,16 +7135,16 @@ public void testbug522061() {
} else {
this.runNegativeTest(
sources,
- "----------\n" +
- "1. WARNING in ztest\\Foo.java (at line 6)\n" +
- " return new FilteredFileTree() {\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Access to enclosing constructor Foo.FilteredFileTree() is emulated by a synthetic accessor method\n" +
- "----------\n" +
- "2. ERROR in ztest\\Foo.java (at line 6)\n" +
- " return new FilteredFileTree() {\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "No enclosing instance of type Foo is available due to some intermediate constructor invocation\n" +
+ "----------\n" +
+ "1. WARNING in ztest\\Foo.java (at line 6)\n" +
+ " return new FilteredFileTree() {\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Access to enclosing constructor Foo.FilteredFileTree() is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "2. ERROR in ztest\\Foo.java (at line 6)\n" +
+ " return new FilteredFileTree() {\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "No enclosing instance of type Foo is available due to some intermediate constructor invocation\n" +
"----------\n");
}
}
@@ -7152,10 +7152,10 @@ public void testbug522061() {
public void testbug481793() {
String[] sources = new String[] {
"A.java",
- "public class A {\n" +
- " public class B extends A {\n" +
- " public class C extends B {}\n" +
- " }\n" +
+ "public class A {\n" +
+ " public class B extends A {\n" +
+ " public class C extends B {}\n" +
+ " }\n" +
"}"
};
if (this.complianceLevel < ClassFileConstants.JDK1_4 || this.complianceLevel > ClassFileConstants.JDK1_6) {
@@ -7163,11 +7163,11 @@ public void testbug481793() {
} else {
this.runNegativeTest(
sources,
- "----------\n" +
- "1. ERROR in A.java (at line 3)\n" +
- " public class C extends B {}\n" +
- " ^\n" +
- "No enclosing instance of type A is available due to some intermediate constructor invocation\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 3)\n" +
+ " public class C extends B {}\n" +
+ " ^\n" +
+ "No enclosing instance of type A is available due to some intermediate constructor invocation\n" +
"----------\n");
}
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest_1_5.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest_1_5.java
index ccba29102..c27db471e 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest_1_5.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest_1_5.java
@@ -42,8 +42,8 @@ public void test1() throws Exception {
"}"
});
String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #25 java/util/Map$Entry, outer class info: #27 java/util/Map\n" +
+ " Inner classes:\n" +
+ " [inner class info: #25 java/util/Map$Entry, outer class info: #27 java/util/Map\n" +
" inner name: #29 Entry, accessflags: 1545 public abstract static]\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
}
@@ -59,8 +59,8 @@ public void test2() throws Exception {
"}"
});
String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #21 java/util/Map$Entry, outer class info: #23 java/util/Map\n" +
+ " Inner classes:\n" +
+ " [inner class info: #21 java/util/Map$Entry, outer class info: #23 java/util/Map\n" +
" inner name: #25 Entry, accessflags: 1545 public abstract static]\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "p" + File.separator + "X.class", "X", expectedOutput);
}
@@ -68,16 +68,16 @@ public void test2() throws Exception {
public void test3() throws Exception {
this.runConformTest(new String[] {
"X.java",
- "import java.util.Map;\n" +
- "import java.util.List;\n" +
- "public class X {\n" +
- " <U extends List<?>, T extends Map.Entry> X(List<U> lu, T t) {\n" +
- " }\n" +
+ "import java.util.Map;\n" +
+ "import java.util.List;\n" +
+ "public class X {\n" +
+ " <U extends List<?>, T extends Map.Entry> X(List<U> lu, T t) {\n" +
+ " }\n" +
"}"
});
String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #27 java/util/Map$Entry, outer class info: #29 java/util/Map\n" +
+ " Inner classes:\n" +
+ " [inner class info: #27 java/util/Map$Entry, outer class info: #29 java/util/Map\n" +
" inner name: #31 Entry, accessflags: 1545 public abstract static]\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
}
@@ -85,13 +85,13 @@ public void test3() throws Exception {
public void test4() throws Exception {
this.runConformTest(new String[] {
"X.java",
- "import java.util.Map;\n" +
- "import java.util.List;\n" +
+ "import java.util.Map;\n" +
+ "import java.util.List;\n" +
"public class X<T extends Object & Comparable<? super Map.Entry>> {}"
});
String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #21 java/util/Map$Entry, outer class info: #23 java/util/Map\n" +
+ " Inner classes:\n" +
+ " [inner class info: #21 java/util/Map$Entry, outer class info: #23 java/util/Map\n" +
" inner name: #25 Entry, accessflags: 1545 public abstract static]\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
}
@@ -107,8 +107,8 @@ public void test5() throws Exception {
"}"
});
String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #25 java/util/Map$Entry, outer class info: #27 java/util/Map\n" +
+ " Inner classes:\n" +
+ " [inner class info: #25 java/util/Map$Entry, outer class info: #27 java/util/Map\n" +
" inner name: #29 Entry, accessflags: 1545 public abstract static]\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "p" + File.separator + "X.class", "X", expectedOutput);
}
@@ -124,8 +124,8 @@ public void test6() throws Exception {
"}"
});
String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #21 java/util/Map$Entry, outer class info: #23 java/util/Map\n" +
+ " Inner classes:\n" +
+ " [inner class info: #21 java/util/Map$Entry, outer class info: #23 java/util/Map\n" +
" inner name: #25 Entry, accessflags: 1545 public abstract static]\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "p" + File.separator + "X.class", "X", expectedOutput);
}
@@ -140,8 +140,8 @@ public void test7() throws Exception {
"}"
});
String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #21 java/util/Map$Entry, outer class info: #23 java/util/Map\n" +
+ " Inner classes:\n" +
+ " [inner class info: #21 java/util/Map$Entry, outer class info: #23 java/util/Map\n" +
" inner name: #25 Entry, accessflags: 1545 public abstract static]\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "p" + File.separator + "X.class", "X", expectedOutput);
}
@@ -159,10 +159,10 @@ public void test8() throws Exception {
"}"
});
String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #21 java/util/Map$Entry, outer class info: #23 java/util/Map\n" +
- " inner name: #25 Entry, accessflags: 1545 public abstract static],\n" +
- " [inner class info: #26 p/A$B, outer class info: #28 p/A\n" +
+ " Inner classes:\n" +
+ " [inner class info: #21 java/util/Map$Entry, outer class info: #23 java/util/Map\n" +
+ " inner name: #25 Entry, accessflags: 1545 public abstract static],\n" +
+ " [inner class info: #26 p/A$B, outer class info: #28 p/A\n" +
" inner name: #30 B, accessflags: 8 static]\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "p" + File.separator + "X.class", "X", expectedOutput);
}
@@ -181,10 +181,10 @@ public void test9() throws Exception {
"}"
});
String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #25 java/util/Map$Entry, outer class info: #27 java/util/Map\n" +
- " inner name: #29 Entry, accessflags: 1545 public abstract static],\n" +
- " [inner class info: #30 p/A$B, outer class info: #32 p/A\n" +
+ " Inner classes:\n" +
+ " [inner class info: #25 java/util/Map$Entry, outer class info: #27 java/util/Map\n" +
+ " inner name: #29 Entry, accessflags: 1545 public abstract static],\n" +
+ " [inner class info: #30 p/A$B, outer class info: #32 p/A\n" +
" inner name: #34 B, accessflags: 8 static]\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "p" + File.separator + "X.class", "X", expectedOutput);
}
@@ -206,12 +206,12 @@ public void test10() throws Exception {
"}"
});
String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #25 java/util/Map$Entry, outer class info: #27 java/util/Map\n" +
- " inner name: #29 Entry, accessflags: 1545 public abstract static],\n" +
- " [inner class info: #30 p/A$B, outer class info: #32 p/A\n" +
- " inner name: #34 B, accessflags: 1544 abstract static],\n" +
- " [inner class info: #35 p/C$D, outer class info: #37 p/C\n" +
+ " Inner classes:\n" +
+ " [inner class info: #25 java/util/Map$Entry, outer class info: #27 java/util/Map\n" +
+ " inner name: #29 Entry, accessflags: 1545 public abstract static],\n" +
+ " [inner class info: #30 p/A$B, outer class info: #32 p/A\n" +
+ " inner name: #34 B, accessflags: 1544 abstract static],\n" +
+ " [inner class info: #35 p/C$D, outer class info: #37 p/C\n" +
" inner name: #39 D, accessflags: 8 static]\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "p" + File.separator + "X.class", "X", expectedOutput);
}
@@ -241,12 +241,12 @@ public void test11() throws Exception {
"}"
});
String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #35 X$SelfType, outer class info: #1 X\n" +
- " inner name: #37 SelfType, accessflags: 1032 abstract static],\n" +
- " [inner class info: #38 X$SubType, outer class info: #1 X\n" +
- " inner name: #40 SubType, accessflags: 8 static],\n" +
- " [inner class info: #41 X$SuperType, outer class info: #1 X\n" +
+ " Inner classes:\n" +
+ " [inner class info: #35 X$SelfType, outer class info: #1 X\n" +
+ " inner name: #37 SelfType, accessflags: 1032 abstract static],\n" +
+ " [inner class info: #38 X$SubType, outer class info: #1 X\n" +
+ " inner name: #40 SubType, accessflags: 8 static],\n" +
+ " [inner class info: #41 X$SuperType, outer class info: #1 X\n" +
" inner name: #43 SuperType, accessflags: 8 static]\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
}
@@ -262,8 +262,8 @@ public void test12() throws Exception {
"}"
});
String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #21 java/util/Map$Entry, outer class info: #23 java/util/Map\n" +
+ " Inner classes:\n" +
+ " [inner class info: #21 java/util/Map$Entry, outer class info: #23 java/util/Map\n" +
" inner name: #25 Entry, accessflags: 1545 public abstract static]\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "p" + File.separator + "X.class", "X", expectedOutput);
}
@@ -284,10 +284,10 @@ public void test13() throws Exception {
"}"
});
String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #5 p/A$B, outer class info: #19 p/A\n" +
- " inner name: #21 B, accessflags: 1544 abstract static],\n" +
- " [inner class info: #3 p/C$D, outer class info: #22 p/C\n" +
+ " Inner classes:\n" +
+ " [inner class info: #5 p/A$B, outer class info: #19 p/A\n" +
+ " inner name: #21 B, accessflags: 1544 abstract static],\n" +
+ " [inner class info: #3 p/C$D, outer class info: #22 p/C\n" +
" inner name: #24 D, accessflags: 8 static]\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "p" + File.separator + "X.class", "X", expectedOutput);
}
@@ -296,52 +296,52 @@ public void test13() throws Exception {
public void test14() throws Exception {
runConformTest(new String[] {
"LineNumberBug.java",
- "public class LineNumberBug {\n" +
- " class Inner {\n" +
- " public Inner() {\n" +
- " System.out.println(\"Inner()\");\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new LineNumberBug().new Inner();\n" +
- " }\n" +
+ "public class LineNumberBug {\n" +
+ " class Inner {\n" +
+ " public Inner() {\n" +
+ " System.out.println(\"Inner()\");\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new LineNumberBug().new Inner();\n" +
+ " }\n" +
"}\n"
});
String expectedOutput =
- " // Method descriptor #8 (LLineNumberBug;)V\n" +
- " // Stack: 2, Locals: 2\n" +
- " public LineNumberBug$Inner(LineNumberBug arg0);\n" +
- " 0 aload_0 [this]\n" +
- " 1 aload_1 [arg0]\n" +
- " 2 putfield LineNumberBug$Inner.this$0 : LineNumberBug [10]\n" +
- " 5 aload_0 [this]\n" +
- " 6 invokespecial java.lang.Object() [12]\n" +
- " 9 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- " 12 ldc <String \"Inner()\"> [21]\n" +
- " 14 invokevirtual java.io.PrintStream.println(java.lang.String) : void [23]\n" +
- " 17 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
+ " // Method descriptor #8 (LLineNumberBug;)V\n" +
+ " // Stack: 2, Locals: 2\n" +
+ " public LineNumberBug$Inner(LineNumberBug arg0);\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 aload_1 [arg0]\n" +
+ " 2 putfield LineNumberBug$Inner.this$0 : LineNumberBug [10]\n" +
+ " 5 aload_0 [this]\n" +
+ " 6 invokespecial java.lang.Object() [12]\n" +
+ " 9 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
+ " 12 ldc <String \"Inner()\"> [21]\n" +
+ " 14 invokevirtual java.io.PrintStream.println(java.lang.String) : void [23]\n" +
+ " 17 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
" [pc: 9, line: 4]\n" +
" [pc: 17, line: 5]\n";
- checkDisassembledClassFile(OUTPUT_DIR + File.separator + "LineNumberBug$Inner.class", "LineNumberBug$Inner", expectedOutput);
+ checkDisassembledClassFile(OUTPUT_DIR + File.separator + "LineNumberBug$Inner.class", "LineNumberBug$Inner", expectedOutput);
}
public void testBug546362() throws Exception {
runConformTest(new String[] {
"Schema.java",
- "import java.util.HashMap;\n" +
- "\n" +
- "public class Schema {\n" +
- " public Integer[] getElements(HashMap<String, Integer> map) {\n" +
- " return map.entrySet().toArray(new Integer[0]);\n" +
- " }\n" +
- "}\n" +
+ "import java.util.HashMap;\n" +
+ "\n" +
+ "public class Schema {\n" +
+ " public Integer[] getElements(HashMap<String, Integer> map) {\n" +
+ " return map.entrySet().toArray(new Integer[0]);\n" +
+ " }\n" +
+ "}\n" +
""
});
String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #41 java/util/Map$Entry, outer class info: #43 java/util/Map\n" +
- " inner name: #45 Entry, accessflags: 1545 public abstract static]\n" +
+ " Inner classes:\n" +
+ " [inner class info: #41 java/util/Map$Entry, outer class info: #43 java/util/Map\n" +
+ " inner name: #45 Entry, accessflags: 1545 public abstract static]\n" +
"";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "Schema.class", "X", expectedOutput);
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InterfaceMethodsTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InterfaceMethodsTest.java
index dc2e38bc2..d74edfb10 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InterfaceMethodsTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InterfaceMethodsTest.java
@@ -73,10 +73,10 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" public default strictfp void foo4() {}\n" +
" public default strictfp @Annot void foo5() {}\n" +
"}\n",
- },
+ },
"");
}
-
+
// default methods with various modifiers, negative cases
public void testModifiers1a() {
@@ -92,22 +92,22 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" strictfp default void foo3() {}\n" +
" public default strictfp synchronized void foo4() {}\n" +
" public default strictfp synchronized @Annot void foo5() {}\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in I.java (at line 5)\n" +
- " public default synchronized void foo2() { System.exit(0); }\n" +
- " ^^^^^^\n" +
- "Illegal modifier for the interface method foo2; only public,"+ infMod +" abstract, default, static and strictfp are permitted\n" +
- "----------\n" +
- "2. ERROR in I.java (at line 7)\n" +
- " public default strictfp synchronized void foo4() {}\n" +
- " ^^^^^^\n" +
- "Illegal modifier for the interface method foo4; only public,"+ infMod +" abstract, default, static and strictfp are permitted\n" +
- "----------\n" +
- "3. ERROR in I.java (at line 8)\n" +
- " public default strictfp synchronized @Annot void foo5() {}\n" +
- " ^^^^^^\n" +
- "Illegal modifier for the interface method foo5; only public,"+ infMod +" abstract, default, static and strictfp are permitted\n" +
+ "}\n"},
+ "----------\n" +
+ "1. ERROR in I.java (at line 5)\n" +
+ " public default synchronized void foo2() { System.exit(0); }\n" +
+ " ^^^^^^\n" +
+ "Illegal modifier for the interface method foo2; only public,"+ infMod +" abstract, default, static and strictfp are permitted\n" +
+ "----------\n" +
+ "2. ERROR in I.java (at line 7)\n" +
+ " public default strictfp synchronized void foo4() {}\n" +
+ " ^^^^^^\n" +
+ "Illegal modifier for the interface method foo4; only public,"+ infMod +" abstract, default, static and strictfp are permitted\n" +
+ "----------\n" +
+ "3. ERROR in I.java (at line 8)\n" +
+ " public default strictfp synchronized @Annot void foo5() {}\n" +
+ " ^^^^^^\n" +
+ "Illegal modifier for the interface method foo5; only public,"+ infMod +" abstract, default, static and strictfp are permitted\n" +
"----------\n");
}
@@ -133,19 +133,19 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"Syntax error, insert \"Identifier (\" to complete MethodHeaderName\n" +
"----------\n" +
//{ObjectTeams: funny syntax errors, but so what ...
- "2. ERROR in I.java (at line 6)\n" +
- " stritfp default void foo3() {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, insert \")\" to complete MethodSpecLong\n" +
- "----------\n" +
- "3. ERROR in I.java (at line 6)\n" +
- " stritfp default void foo3() {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, insert \"<-\" to complete CallinBindingLeft\n" +
- "----------\n" +
- "4. ERROR in I.java (at line 6)\n" +
- " stritfp default void foo3() {}\n" +
- " ^^^^^^^\n" +
+ "2. ERROR in I.java (at line 6)\n" +
+ " stritfp default void foo3() {}\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, insert \")\" to complete MethodSpecLong\n" +
+ "----------\n" +
+ "3. ERROR in I.java (at line 6)\n" +
+ " stritfp default void foo3() {}\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, insert \"<-\" to complete CallinBindingLeft\n" +
+ "----------\n" +
+ "4. ERROR in I.java (at line 6)\n" +
+ " stritfp default void foo3() {}\n" +
+ " ^^^^^^^\n" +
"Syntax error, insert \"MethodSpecsLong EmptyParameterMappings\" to complete InvalidCallinBinding\n" +
// SH}
"----------\n");
@@ -194,7 +194,7 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"----------\n" +
"6. ERROR in I.java (at line 8)\n" +
" public strictfp synchronized @Annot void foo5();\n" +
- " ^^^^^^\n" +
+ " ^^^^^^\n" +
"Illegal modifier for the interface method foo5; only public,"+ infMod +" abstract, default, static and strictfp are permitted\n" +
"----------\n");
}
@@ -213,36 +213,36 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" static default void foo5() {}\n" +
" default static void foo6() {}\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in I.java (at line 2)\n" +
- " native void foo1();\n" +
- " ^^^^^^\n" +
- "Illegal modifier for the interface method foo1; only public,"+ infMod +" abstract, default, static and strictfp are permitted\n" +
- "----------\n" +
- "2. ERROR in I.java (at line 3)\n" +
- " static void foo2();\n" +
- " ^^^^^^\n" +
- "This method requires a body instead of a semicolon\n" +
- "----------\n" +
- "3. ERROR in I.java (at line 4)\n" +
- " native default void foo3() {}\n" +
- " ^^^^^^\n" +
- "Illegal modifier for the interface method foo3; only public,"+ infMod +" abstract, default, static and strictfp are permitted\n" +
- "----------\n" +
- "4. ERROR in I.java (at line 5)\n" +
- " default native void foo4() {}\n" +
- " ^^^^^^\n" +
- "Illegal modifier for the interface method foo4; only public,"+ infMod +" abstract, default, static and strictfp are permitted\n" +
- "----------\n" +
- "5. ERROR in I.java (at line 6)\n" +
- " static default void foo5() {}\n" +
- " ^^^^^^\n" +
- "Illegal combination of modifiers for the interface method foo5; only one of abstract, default, or static permitted\n" +
- "----------\n" +
- "6. ERROR in I.java (at line 7)\n" +
- " default static void foo6() {}\n" +
- " ^^^^^^\n" +
- "Illegal combination of modifiers for the interface method foo6; only one of abstract, default, or static permitted\n" +
+ "----------\n" +
+ "1. ERROR in I.java (at line 2)\n" +
+ " native void foo1();\n" +
+ " ^^^^^^\n" +
+ "Illegal modifier for the interface method foo1; only public,"+ infMod +" abstract, default, static and strictfp are permitted\n" +
+ "----------\n" +
+ "2. ERROR in I.java (at line 3)\n" +
+ " static void foo2();\n" +
+ " ^^^^^^\n" +
+ "This method requires a body instead of a semicolon\n" +
+ "----------\n" +
+ "3. ERROR in I.java (at line 4)\n" +
+ " native default void foo3() {}\n" +
+ " ^^^^^^\n" +
+ "Illegal modifier for the interface method foo3; only public,"+ infMod +" abstract, default, static and strictfp are permitted\n" +
+ "----------\n" +
+ "4. ERROR in I.java (at line 5)\n" +
+ " default native void foo4() {}\n" +
+ " ^^^^^^\n" +
+ "Illegal modifier for the interface method foo4; only public,"+ infMod +" abstract, default, static and strictfp are permitted\n" +
+ "----------\n" +
+ "5. ERROR in I.java (at line 6)\n" +
+ " static default void foo5() {}\n" +
+ " ^^^^^^\n" +
+ "Illegal combination of modifiers for the interface method foo5; only one of abstract, default, or static permitted\n" +
+ "----------\n" +
+ "6. ERROR in I.java (at line 7)\n" +
+ " default static void foo6() {}\n" +
+ " ^^^^^^\n" +
+ "Illegal combination of modifiers for the interface method foo6; only one of abstract, default, or static permitted\n" +
"----------\n");
}
@@ -259,30 +259,30 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" void foo4() { }\n" + // implicit "abstract" without "default" doesn't allow a body, either
" abstract static default void foo5() {}\n" + // double fault
"}\n"},
- "----------\n" +
- "1. ERROR in I.java (at line 4)\n" +
- " public abstract default void foo2() {}\n" +
- " ^^^^^^\n" +
- "Illegal combination of modifiers for the interface method foo2; only one of abstract, default, or static permitted\n" +
- "----------\n" +
- "2. ERROR in I.java (at line 5)\n" +
- " default abstract void foo3() {}\n" +
- " ^^^^^^\n" +
- "Illegal combination of modifiers for the interface method foo3; only one of abstract, default, or static permitted\n" +
- "----------\n" +
- "3. ERROR in I.java (at line 6)\n" +
- " void foo4() { }\n" +
- " ^^^^^^\n" +
- "Abstract methods do not specify a body\n" +
- "----------\n" +
- "4. ERROR in I.java (at line 7)\n" +
- " abstract static default void foo5() {}\n" +
- " ^^^^^^\n" +
- "Illegal combination of modifiers for the interface method foo5; only one of abstract, default, or static permitted\n" +
+ "----------\n" +
+ "1. ERROR in I.java (at line 4)\n" +
+ " public abstract default void foo2() {}\n" +
+ " ^^^^^^\n" +
+ "Illegal combination of modifiers for the interface method foo2; only one of abstract, default, or static permitted\n" +
+ "----------\n" +
+ "2. ERROR in I.java (at line 5)\n" +
+ " default abstract void foo3() {}\n" +
+ " ^^^^^^\n" +
+ "Illegal combination of modifiers for the interface method foo3; only one of abstract, default, or static permitted\n" +
+ "----------\n" +
+ "3. ERROR in I.java (at line 6)\n" +
+ " void foo4() { }\n" +
+ " ^^^^^^\n" +
+ "Abstract methods do not specify a body\n" +
+ "----------\n" +
+ "4. ERROR in I.java (at line 7)\n" +
+ " abstract static default void foo5() {}\n" +
+ " ^^^^^^\n" +
+ "Illegal combination of modifiers for the interface method foo5; only one of abstract, default, or static permitted\n" +
"----------\n");
}
- // class implements interface with default method.
+ // class implements interface with default method.
// - no need to implement this interface method as it is not abstract
public void testModifiers5() {
runConformTest(
@@ -304,7 +304,7 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
);
}
- // class implements interface with default method.
+ // class implements interface with default method.
// - no need to implement this interface method as it is not abstract, but other abstract method exists
public void testModifiers6() {
runNegativeTest(
@@ -317,11 +317,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"C.java",
"public class C implements I {}\n"
},
- "----------\n" +
- "1. ERROR in C.java (at line 1)\n" +
- " public class C implements I {}\n" +
- " ^\n" +
- "The type C must implement the inherited abstract method I.bar()\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 1)\n" +
+ " public class C implements I {}\n" +
+ " ^\n" +
+ "The type C must implement the inherited abstract method I.bar()\n" +
"----------\n");
}
@@ -362,17 +362,17 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
new String[] {
"I.java",
"public interface I {\n" +
- " public default String toString () { return \"\";}\n" +
+ " public default String toString () { return \"\";}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in I.java (at line 2)\n" +
- " public default String toString () { return \"\";}\n" +
- " ^^^^^^^^^^^\n" +
- "A default method cannot override a method from java.lang.Object \n" +
+ "----------\n" +
+ "1. ERROR in I.java (at line 2)\n" +
+ " public default String toString () { return \"\";}\n" +
+ " ^^^^^^^^^^^\n" +
+ "A default method cannot override a method from java.lang.Object \n" +
"----------\n");
}
-
+
// JLS 9.4.2 - default method cannot override method from Object
// Bug 382355 - [1.8][compiler] Compiler accepts erroneous default method
// when using a type variable this is already reported as a name clash
@@ -381,17 +381,17 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
new String[] {
"I.java",
"public interface I<T> {\n" +
- " public default boolean equals (T other) { return false;}\n" +
+ " public default boolean equals (T other) { return false;}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in I.java (at line 2)\n" +
- " public default boolean equals (T other) { return false;}\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method equals(T) of type I<T> has the same erasure as equals(Object) of type Object but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in I.java (at line 2)\n" +
+ " public default boolean equals (T other) { return false;}\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method equals(T) of type I<T> has the same erasure as equals(Object) of type Object but does not override it\n" +
"----------\n");
}
-
+
// JLS 9.4.2 - default method cannot override method from Object
// Bug 382355 - [1.8][compiler] Compiler accepts erroneous default method
// one error for final method is enough
@@ -401,14 +401,14 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"I.java",
"public interface I<T> {\n" +
" @Override\n" +
- " default public Class<?> getClass() { return null;}\n" +
+ " default public Class<?> getClass() { return null;}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in I.java (at line 3)\n" +
- " default public Class<?> getClass() { return null;}\n" +
- " ^^^^^^^^^^\n" +
- "Cannot override the final method from Object\n" +
+ "----------\n" +
+ "1. ERROR in I.java (at line 3)\n" +
+ " default public Class<?> getClass() { return null;}\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot override the final method from Object\n" +
"----------\n");
}
@@ -431,14 +431,14 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"public interface I3 extends I1, I2 {\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in I3.java (at line 1)\n" +
- " public interface I3 extends I1, I2 {\n" +
- " ^^\n" +
+ "----------\n" +
+ "1. ERROR in I3.java (at line 1)\n" +
+ " public interface I3 extends I1, I2 {\n" +
+ " ^^\n" +
"The default method foo() inherited from I2 conflicts with another method inherited from I1\n" +
"----------\n");
}
-
+
// JLS 9.4.1
// Bug 382347 - [1.8][compiler] Compiler accepts incorrect default method inheritance
// an inherited default methods clashes with another inherited method
@@ -464,10 +464,10 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"public interface I3 extends I1A, I2A {\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in I3.java (at line 1)\n" +
- " public interface I3 extends I1A, I2A {\n" +
- " ^^\n" +
+ "----------\n" +
+ "1. ERROR in I3.java (at line 1)\n" +
+ " public interface I3 extends I1A, I2A {\n" +
+ " ^^\n" +
"The default method foo() inherited from I2 conflicts with another method inherited from I1\n" +
"----------\n");
}
@@ -496,11 +496,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" String foo(List<String> l);\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in I3.java (at line 4)\n" +
- " String foo(List<String> l);\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(List<String>) of type I3 has the same erasure as foo(List) of type I2 but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in I3.java (at line 4)\n" +
+ " String foo(List<String> l);\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method foo(List<String>) of type I3 has the same erasure as foo(List) of type I2 but does not override it\n" +
"----------\n");
}
@@ -528,11 +528,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" String foo(List<String> l);\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in I3.java (at line 4)\n" +
- " String foo(List<String> l);\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(List<String>) of type I3 has the same erasure as foo(List) of type I2 but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in I3.java (at line 4)\n" +
+ " String foo(List<String> l);\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method foo(List<String>) of type I3 has the same erasure as foo(List) of type I2 but does not override it\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=390761
@@ -559,11 +559,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" U getValue();\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=390761
@@ -590,14 +590,14 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" U getValue();\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
-
+
public void testDefaultNonclash3() {
runNegativeTest(
new String[] {
@@ -623,11 +623,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" U getValue();\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=390761
@@ -652,11 +652,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" U getValue();\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
@@ -665,19 +665,19 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
runConformTest(
new String[] {
"X.java",
- "public class X extends G implements I {\n" +
- "}\n" +
- "\n" +
- "interface I {\n" +
- " default int foo (){\n" +
- " return 0;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class G {\n" +
- " public int foo() {\n" +
- " return 0;\n" +
- " }\n" +
+ "public class X extends G implements I {\n" +
+ "}\n" +
+ "\n" +
+ "interface I {\n" +
+ " default int foo (){\n" +
+ " return 0;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class G {\n" +
+ " public int foo() {\n" +
+ " return 0;\n" +
+ " }\n" +
"}\n"
});
}
@@ -747,11 +747,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"public class C implements I1, I2 {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in C.java (at line 1)\n" +
- " public class C implements I1, I2 {\n" +
- " ^\n" +
- "The default method test() inherited from I2 conflicts with another method inherited from I1\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 1)\n" +
+ " public class C implements I1, I2 {\n" +
+ " ^\n" +
+ "The default method test() inherited from I2 conflicts with another method inherited from I1\n" +
"----------\n");
// Note: javac first complains: C is not abstract and does not override abstract method test() in I1
// only when C is marked abstract does the conflict between abstract and default method surface
@@ -775,11 +775,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"public class C implements I2, I1 {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in C.java (at line 1)\n" +
- " public class C implements I2, I1 {\n" +
- " ^\n" +
- "The default method test() inherited from I2 conflicts with another method inherited from I1\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 1)\n" +
+ " public class C implements I2, I1 {\n" +
+ " ^\n" +
+ "The default method test() inherited from I2 conflicts with another method inherited from I1\n" +
"----------\n");
// Note: javac first complains: C is not abstract and does not override abstract method test() in I1
// only when C is marked abstract does the conflict between abstract and default method surface
@@ -803,11 +803,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"public abstract class C implements I2, I1 {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in C.java (at line 1)\n" +
- " public abstract class C implements I2, I1 {\n" +
- " ^\n" +
- "The default method test() inherited from I2 conflicts with another method inherited from I1\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 1)\n" +
+ " public abstract class C implements I2, I1 {\n" +
+ " ^\n" +
+ "The default method test() inherited from I2 conflicts with another method inherited from I1\n" +
"----------\n");
}
@@ -827,11 +827,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"public interface I3 extends I1, I2 {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in I3.java (at line 1)\n" +
- " public interface I3 extends I1, I2 {\n" +
- " ^^\n" +
- "The default method test() inherited from I2 conflicts with another method inherited from I1\n" +
+ "----------\n" +
+ "1. ERROR in I3.java (at line 1)\n" +
+ " public interface I3 extends I1, I2 {\n" +
+ " ^^\n" +
+ "The default method test() inherited from I2 conflicts with another method inherited from I1\n" +
"----------\n");
}
@@ -854,7 +854,7 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"}\n"
});
}
-
+
// JLS 8.1.1.1 abstract Classes
// Default method overrides an abstract method from its super interface - class implements both
// same as above except for order of implements list
@@ -894,11 +894,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"public class C implements I2, I1 {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in C.java (at line 1)\n" +
- " public class C implements I2, I1 {\n" +
- " ^\n" +
- "The type C must implement the inherited abstract method I2.test()\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 1)\n" +
+ " public class C implements I2, I1 {\n" +
+ " ^\n" +
+ "The type C must implement the inherited abstract method I2.test()\n" +
"----------\n");
}
@@ -921,11 +921,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"public class C implements I2, I1 {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in C.java (at line 1)\n" +
- " public class C implements I2, I1 {\n" +
- " ^\n" +
- "The type C must implement the inherited abstract method I2.test()\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 1)\n" +
+ " public class C implements I2, I1 {\n" +
+ " ^\n" +
+ "The type C must implement the inherited abstract method I2.test()\n" +
"----------\n");
}
@@ -945,11 +945,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"public abstract class C2 implements I1, I2 {\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in C2.java (at line 1)\n" +
- " public abstract class C2 implements I1, I2 {\n" +
- " ^^\n" +
- "Duplicate default methods named value1 with the parameters () and () are inherited from the types I2 and I1\n" +
+ "----------\n" +
+ "1. ERROR in C2.java (at line 1)\n" +
+ " public abstract class C2 implements I1, I2 {\n" +
+ " ^^\n" +
+ "Duplicate default methods named value1 with the parameters () and () are inherited from the types I2 and I1\n" +
"----------\n");
}
@@ -978,16 +978,16 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" public Object value1() { return this; } // too week, need a method returning String\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in C3.java (at line 3)\n" +
- " public Object value1() { return this; } // too week, need a method returning String\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with I1.value1()\n" +
- "----------\n" +
- "2. ERROR in C3.java (at line 3)\n" +
- " public Object value1() { return this; } // too week, need a method returning String\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with I2.value1()\n" +
+ "----------\n" +
+ "1. ERROR in C3.java (at line 3)\n" +
+ " public Object value1() { return this; } // too week, need a method returning String\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with I1.value1()\n" +
+ "----------\n" +
+ "2. ERROR in C3.java (at line 3)\n" +
+ " public Object value1() { return this; } // too week, need a method returning String\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with I2.value1()\n" +
"----------\n");
}
@@ -1017,19 +1017,19 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" public Object value1() { return this; } // too week, need a method returning String\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in C3.java (at line 3)\n" +
- " public Object value1() { return this; } // too week, need a method returning String\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with I2.value1()\n" +
- "----------\n" +
- "2. ERROR in C3.java (at line 3)\n" +
- " public Object value1() { return this; } // too week, need a method returning String\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with I1.value1()\n" +
+ "----------\n" +
+ "1. ERROR in C3.java (at line 3)\n" +
+ " public Object value1() { return this; } // too week, need a method returning String\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with I2.value1()\n" +
+ "----------\n" +
+ "2. ERROR in C3.java (at line 3)\n" +
+ " public Object value1() { return this; } // too week, need a method returning String\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with I1.value1()\n" +
"----------\n");
}
-
+
// abstract class method trumps otherwise conflicting default methods: conflict not resolved due to insufficient visibility
public void testAbstract6b() {
runNegativeTest(
@@ -1051,11 +1051,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"public abstract class C2 extends p1.C1 implements I1, I2 {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in C2.java (at line 1)\n" +
- " public abstract class C2 extends p1.C1 implements I1, I2 {\n" +
- " ^^\n" +
- "Duplicate default methods named value1 with the parameters () and () are inherited from the types I2 and I1\n" +
+ "----------\n" +
+ "1. ERROR in C2.java (at line 1)\n" +
+ " public abstract class C2 extends p1.C1 implements I1, I2 {\n" +
+ " ^^\n" +
+ "Duplicate default methods named value1 with the parameters () and () are inherited from the types I2 and I1\n" +
"----------\n");
}
@@ -1080,11 +1080,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" public Object value1() { return this; } // too week, need a method returning String\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in C3.java (at line 3)\n" +
- " public Object value1() { return this; } // too week, need a method returning String\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with I1.value1()\n" +
+ "----------\n" +
+ "1. ERROR in C3.java (at line 3)\n" +
+ " public Object value1() { return this; } // too week, need a method returning String\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with I1.value1()\n" +
"----------\n");
}
@@ -1105,11 +1105,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"public class C2 extends C1 implements I1 {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in C2.java (at line 1)\n" +
- " public class C2 extends C1 implements I1 {\n" +
- " ^^\n" +
- "The type C2 must implement the inherited abstract method C1.value()\n" +
+ "----------\n" +
+ "1. ERROR in C2.java (at line 1)\n" +
+ " public class C2 extends C1 implements I1 {\n" +
+ " ^^\n" +
+ "The type C2 must implement the inherited abstract method C1.value()\n" +
"----------\n");
}
@@ -1122,14 +1122,14 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" default String id() { return \"1\"; }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in I.java (at line 2)\n" +
- " default String id() { return \"1\"; }\n" +
- " ^^^^^^^\n" +
- "Syntax error on token \"default\", @ expected\n" +
+ "----------\n" +
+ "1. ERROR in I.java (at line 2)\n" +
+ " default String id() { return \"1\"; }\n" +
+ " ^^^^^^^\n" +
+ "Syntax error on token \"default\", @ expected\n" +
"----------\n");
}
-
+
// basic situation similar to AmbiguousMethodTest.test009()
public void testSuperCall1() throws Exception {
this.runConformTest(
@@ -1147,12 +1147,12 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
""
);
String expectedOutput =
- " // Method descriptor #14 ()Ljava/util/Spliterator;\n" +
- " // Signature: ()Ljava/util/Spliterator<TE;>;\n" +
- " // Stack: 1, Locals: 1\n" +
- " public java.util.Spliterator spliterator();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.util.List.spliterator() : java.util.Spliterator [17]\n" +
+ " // Method descriptor #14 ()Ljava/util/Spliterator;\n" +
+ " // Signature: ()Ljava/util/Spliterator<TE;>;\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " public java.util.Spliterator spliterator();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.util.List.spliterator() : java.util.Spliterator [17]\n" +
" 4 areturn\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "OrderedSet.class", "OrderedSet", expectedOutput);
}
@@ -1195,26 +1195,26 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" default Spliterator<E> spliterator() { return List.super.spliterator(); }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in T.java (at line 6)\n" +
- " return List.super.stream(); // List is not a direct super interface\n" +
- " ^^^^^^^^^^\n" +
- "Illegal reference to super type List, cannot bypass the more specific direct super type OrderedSet\n" +
- "----------\n" +
- "2. ERROR in T.java (at line 12)\n" +
- " return OrderedSet.super.stream(); // not a super interface of the direct enclosing class\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "No enclosing instance of the type OrderedSet<E> is accessible in scope\n" +
- "----------\n" +
- "3. ERROR in T.java (at line 17)\n" +
- " OrderedSet.super.add(o); // target not a default method\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot directly invoke the abstract method add(E) for the type OrderedSet<E>\n" +
- "----------\n" +
- "4. ERROR in T.java (at line 20)\n" +
- " OrderedSet.super(); // not applicable for super ctor call\n" +
- " ^^^^^^^^^^\n" +
- "Illegal enclosing instance specification for type Object\n" +
+ "----------\n" +
+ "1. ERROR in T.java (at line 6)\n" +
+ " return List.super.stream(); // List is not a direct super interface\n" +
+ " ^^^^^^^^^^\n" +
+ "Illegal reference to super type List, cannot bypass the more specific direct super type OrderedSet\n" +
+ "----------\n" +
+ "2. ERROR in T.java (at line 12)\n" +
+ " return OrderedSet.super.stream(); // not a super interface of the direct enclosing class\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "No enclosing instance of the type OrderedSet<E> is accessible in scope\n" +
+ "----------\n" +
+ "3. ERROR in T.java (at line 17)\n" +
+ " OrderedSet.super.add(o); // target not a default method\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot directly invoke the abstract method add(E) for the type OrderedSet<E>\n" +
+ "----------\n" +
+ "4. ERROR in T.java (at line 20)\n" +
+ " OrderedSet.super(); // not applicable for super ctor call\n" +
+ " ^^^^^^^^^^\n" +
+ "Illegal enclosing instance specification for type Object\n" +
"----------\n"
);
}
@@ -1277,11 +1277,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " I1.super.print(); // illegal attempt to skip I2.print()\n" +
- " ^^^^^^^^\n" +
- "Illegal reference to super type I1, cannot bypass the more specific direct super type I2\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " I1.super.print(); // illegal attempt to skip I2.print()\n" +
+ " ^^^^^^^^\n" +
+ "Illegal reference to super type I1, cannot bypass the more specific direct super type I2\n" +
"----------\n"
);
}
@@ -1310,11 +1310,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"interface I2 extends I1 {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " I1.super.print(); // illegal attempt to skip I2.print()\n" +
- " ^^^^^^^^\n" +
- "Illegal reference to super type I1, cannot bypass the more specific direct super type I2\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " I1.super.print(); // illegal attempt to skip I2.print()\n" +
+ " ^^^^^^^^\n" +
+ "Illegal reference to super type I1, cannot bypass the more specific direct super type I2\n" +
"----------\n"
);
}
@@ -1325,33 +1325,33 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
this.runNegativeTest(
new String[] {
"SuperOverride.java",
- "interface I0 {\n" +
- " default void foo() { System.out.println(\"I0\"); }\n" +
- "}\n" +
- "\n" +
- "interface IA extends I0 {}\n" +
- "\n" +
- "interface IB extends I0 {\n" +
- " @Override default void foo() {\n" +
- " System.out.println(\"IB\");\n" +
- " }\n" +
- "}\n" +
- "interface IX extends IA, IB {\n" +
- " @Override default void foo() {\n" +
- " IA.super.foo(); // illegal attempt to skip IB.foo()\n" +
- " }\n" +
- "}\n" +
- "public class SuperOverride implements IX {\n" +
- " public static void main(String[] args) {\n" +
- " new SuperOverride().foo();\n" +
- " }\n" +
+ "interface I0 {\n" +
+ " default void foo() { System.out.println(\"I0\"); }\n" +
+ "}\n" +
+ "\n" +
+ "interface IA extends I0 {}\n" +
+ "\n" +
+ "interface IB extends I0 {\n" +
+ " @Override default void foo() {\n" +
+ " System.out.println(\"IB\");\n" +
+ " }\n" +
+ "}\n" +
+ "interface IX extends IA, IB {\n" +
+ " @Override default void foo() {\n" +
+ " IA.super.foo(); // illegal attempt to skip IB.foo()\n" +
+ " }\n" +
+ "}\n" +
+ "public class SuperOverride implements IX {\n" +
+ " public static void main(String[] args) {\n" +
+ " new SuperOverride().foo();\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in SuperOverride.java (at line 14)\n" +
- " IA.super.foo(); // illegal attempt to skip IB.foo()\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Illegal reference to super method foo() from type I0, cannot bypass the more specific override from type IB\n" +
+ "----------\n" +
+ "1. ERROR in SuperOverride.java (at line 14)\n" +
+ " IA.super.foo(); // illegal attempt to skip IB.foo()\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Illegal reference to super method foo() from type I0, cannot bypass the more specific override from type IB\n" +
"----------\n"
);
}
@@ -1405,26 +1405,26 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" abstract static void foo4() {}\n" +
"}"
},
- "----------\n" +
- "1. ERROR in I.java (at line 3)\n" +
- " static void foo1();\n" +
- " ^^^^^^\n" +
- "This method requires a body instead of a semicolon\n" +
- "----------\n" +
- "2. ERROR in I.java (at line 4)\n" +
- " public static default void foo2 () {};\n" +
- " ^^^^^^^\n" +
- "Illegal combination of modifiers for the interface method foo2; only one of abstract, default, or static permitted\n" +
- "----------\n" +
- "3. ERROR in I.java (at line 5)\n" +
- " abstract static void foo3();\n" +
- " ^^^^^^\n" +
- "Illegal combination of modifiers for the interface method foo3; only one of abstract, default, or static permitted\n" +
- "----------\n" +
- "4. ERROR in I.java (at line 6)\n" +
- " abstract static void foo4() {}\n" +
- " ^^^^^^\n" +
- "Illegal combination of modifiers for the interface method foo4; only one of abstract, default, or static permitted\n" +
+ "----------\n" +
+ "1. ERROR in I.java (at line 3)\n" +
+ " static void foo1();\n" +
+ " ^^^^^^\n" +
+ "This method requires a body instead of a semicolon\n" +
+ "----------\n" +
+ "2. ERROR in I.java (at line 4)\n" +
+ " public static default void foo2 () {};\n" +
+ " ^^^^^^^\n" +
+ "Illegal combination of modifiers for the interface method foo2; only one of abstract, default, or static permitted\n" +
+ "----------\n" +
+ "3. ERROR in I.java (at line 5)\n" +
+ " abstract static void foo3();\n" +
+ " ^^^^^^\n" +
+ "Illegal combination of modifiers for the interface method foo3; only one of abstract, default, or static permitted\n" +
+ "----------\n" +
+ "4. ERROR in I.java (at line 6)\n" +
+ " abstract static void foo4() {}\n" +
+ " ^^^^^^\n" +
+ "Illegal combination of modifiers for the interface method foo4; only one of abstract, default, or static permitted\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399780
@@ -1448,26 +1448,26 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in I.java (at line 3)\n" +
- " bar();\n" +
- " ^^^\n" +
- "Cannot make a static reference to the non-static method bar() from the type I\n" +
- "----------\n" +
- "2. ERROR in I.java (at line 4)\n" +
- " this.bar();\n" +
- " ^^^^\n" +
- "Cannot use this in a static context\n" +
- "----------\n" +
- "3. ERROR in I.java (at line 7)\n" +
- " this.foo();\n" +
- " ^^^\n" +
+ "----------\n" +
+ "1. ERROR in I.java (at line 3)\n" +
+ " bar();\n" +
+ " ^^^\n" +
+ "Cannot make a static reference to the non-static method bar() from the type I\n" +
+ "----------\n" +
+ "2. ERROR in I.java (at line 4)\n" +
+ " this.bar();\n" +
+ " ^^^^\n" +
+ "Cannot use this in a static context\n" +
+ "----------\n" +
+ "3. ERROR in I.java (at line 7)\n" +
+ " this.foo();\n" +
+ " ^^^\n" +
"This static method of interface I can only be accessed as I.foo\n" +
- "----------\n" +
- "4. ERROR in I.java (at line 12)\n" +
- " super.bar();\n" +
- " ^^^^^\n" +
- "Cannot use super in a static context\n" +
+ "----------\n" +
+ "4. ERROR in I.java (at line 12)\n" +
+ " super.bar();\n" +
+ " ^^^^^\n" +
+ "Cannot use super in a static context\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399780
@@ -1499,29 +1499,29 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"}"
},
"J#foo() invoked\n" +
- "J#foo() invoked\n" +
+ "J#foo() invoked\n" +
"I#foo() invoked");
String expectedOutput =
- " // Method descriptor #17 ([Ljava/lang/String;)V\n" +
- " // Stack: 2, Locals: 2\n" +
- " public static void main(java.lang.String[] args);\n" +
- " 0 new C [1]\n" +
- " 3 dup\n" +
- " 4 invokespecial C() [18]\n" +
- " 7 astore_1 [c]\n" +
- " 8 aload_1 [c]\n" +
- " 9 invokevirtual C.bar() : void [19]\n" +
- " 12 invokestatic J.foo() : void [22]\n" +
- " 15 invokestatic I.foo() : void [25]\n" +
- " 18 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 16]\n" +
- " [pc: 8, line: 17]\n" +
- " [pc: 12, line: 18]\n" +
- " [pc: 15, line: 19]\n" +
- " [pc: 18, line: 20]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 19] local: args index: 0 type: java.lang.String[]\n" +
+ " // Method descriptor #17 ([Ljava/lang/String;)V\n" +
+ " // Stack: 2, Locals: 2\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 new C [1]\n" +
+ " 3 dup\n" +
+ " 4 invokespecial C() [18]\n" +
+ " 7 astore_1 [c]\n" +
+ " 8 aload_1 [c]\n" +
+ " 9 invokevirtual C.bar() : void [19]\n" +
+ " 12 invokestatic J.foo() : void [22]\n" +
+ " 15 invokestatic I.foo() : void [25]\n" +
+ " 18 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 16]\n" +
+ " [pc: 8, line: 17]\n" +
+ " [pc: 12, line: 18]\n" +
+ " [pc: 15, line: 19]\n" +
+ " [pc: 18, line: 20]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 19] local: args index: 0 type: java.lang.String[]\n" +
" [pc: 8, pc: 19] local: c index: 1 type: C\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "C.class", "C", expectedOutput);
}
@@ -1564,56 +1564,56 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
+ " }\n"
+ "}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " bar();\n" +
- " ^^^\n" +
- "The method bar() is undefined for the type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " bar();\n" +
- " ^^^\n" +
- "The method bar() is undefined for the type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " II.bar();\n" +
- " ^^^\n" +
- "The method bar() is undefined for the type II\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " (new X()).bar();\n" +
- " ^^^\n" +
- "The method bar() is undefined for the type X\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 10)\n" +
- " II.bar();\n" +
- " ^^^\n" +
- "The method bar() is undefined for the type II\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 12)\n" +
- " ii.bar();\n" +
- " ^^^\n" +
- "The method bar() is undefined for the type II\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 15)\n" +
- " i.bar();\n" +
- " ^^^\n" +
- "This static method of interface I can only be accessed as I.bar\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 16)\n" +
- " new I() {}.foo();\n" +
- " ^^^\n" +
- "The method foo() is undefined for the type new I(){}\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 21)\n" +
- " bar2();\n" +
- " ^^^^\n" +
- "Cannot make a static reference to the non-static method bar2() from the type I\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 29)\n" +
- " bar();\n" +
- " ^^^\n" +
- "The method bar() is undefined for the type II\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " bar();\n" +
+ " ^^^\n" +
+ "The method bar() is undefined for the type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " bar();\n" +
+ " ^^^\n" +
+ "The method bar() is undefined for the type X\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " II.bar();\n" +
+ " ^^^\n" +
+ "The method bar() is undefined for the type II\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 9)\n" +
+ " (new X()).bar();\n" +
+ " ^^^\n" +
+ "The method bar() is undefined for the type X\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 10)\n" +
+ " II.bar();\n" +
+ " ^^^\n" +
+ "The method bar() is undefined for the type II\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 12)\n" +
+ " ii.bar();\n" +
+ " ^^^\n" +
+ "The method bar() is undefined for the type II\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 15)\n" +
+ " i.bar();\n" +
+ " ^^^\n" +
+ "This static method of interface I can only be accessed as I.bar\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 16)\n" +
+ " new I() {}.foo();\n" +
+ " ^^^\n" +
+ "The method foo() is undefined for the type new I(){}\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 21)\n" +
+ " bar2();\n" +
+ " ^^^^\n" +
+ "Cannot make a static reference to the non-static method bar2() from the type I\n" +
+ "----------\n" +
+ "10. ERROR in X.java (at line 29)\n" +
+ " bar();\n" +
+ " ^^^\n" +
+ "The method bar() is undefined for the type II\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399780
@@ -1642,11 +1642,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" void goo(int x) {} // Error.\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 19)\n" +
- " void goo(int x) {} // Error.\n" +
- " ^^^^^^^^^^\n" +
- "This instance method cannot override the static method from Y\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 19)\n" +
+ " void goo(int x) {} // Error.\n" +
+ " ^^^^^^^^^^\n" +
+ "This instance method cannot override the static method from Y\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399780
@@ -1675,7 +1675,7 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" }\n" +
"}"
},
- "CONSTANT\n" +
+ "CONSTANT\n" +
"LITERAL");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399780
@@ -1690,16 +1690,16 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in C.java (at line 2)\n" +
- " public static T foo(T t) {\n" +
- " ^\n" +
- "Cannot make a static reference to the non-static type T\n" +
- "----------\n" +
- "2. ERROR in C.java (at line 2)\n" +
- " public static T foo(T t) {\n" +
- " ^\n" +
- "Cannot make a static reference to the non-static type T\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 2)\n" +
+ " public static T foo(T t) {\n" +
+ " ^\n" +
+ "Cannot make a static reference to the non-static type T\n" +
+ "----------\n" +
+ "2. ERROR in C.java (at line 2)\n" +
+ " public static T foo(T t) {\n" +
+ " ^\n" +
+ "Cannot make a static reference to the non-static type T\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399780
@@ -1711,11 +1711,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" static String foo() default \"Blah\";\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in C.java (at line 2)\n" +
- " static String foo() default \"Blah\";\n" +
- " ^^^^^\n" +
- "Illegal modifier for the annotation attribute A.foo; only public & abstract are permitted\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 2)\n" +
+ " static String foo() default \"Blah\";\n" +
+ " ^^^^^\n" +
+ "Illegal modifier for the annotation attribute A.foo; only public & abstract are permitted\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399780
@@ -1730,11 +1730,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in C.java (at line 4)\n" +
- " a.foo();\n" +
- " ^^^\n" +
- "This static method of interface A can only be accessed as A.foo\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 4)\n" +
+ " a.foo();\n" +
+ " ^^^\n" +
+ "This static method of interface A can only be accessed as A.foo\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399780
@@ -1750,11 +1750,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in C.java (at line 5)\n" +
- " a.foo(10);\n" +
- " ^^^\n" +
- "This static method of interface A can only be accessed as A.foo\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 5)\n" +
+ " a.foo(10);\n" +
+ " ^^^\n" +
+ "This static method of interface A can only be accessed as A.foo\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399780
@@ -1769,11 +1769,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" static void foo(String s) {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in C.java (at line 5)\n" +
- " static void foo(String s) {}\n" +
- " ^^^^^^^^^^^^^\n" +
- "This static method cannot hide the instance method from A<String>\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 5)\n" +
+ " static void foo(String s) {}\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "This static method cannot hide the instance method from A<String>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399780
@@ -1790,16 +1790,16 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"public class X {\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in C.java (at line 1)\n" +
- " interface A<X> {\n" +
- " ^\n" +
- "The type parameter X is hiding the type X\n" +
- "----------\n" +
- "2. ERROR in C.java (at line 7)\n" +
- " public class X {\n" +
- " ^\n" +
- "The public type X must be defined in its own file\n" +
+ "----------\n" +
+ "1. WARNING in C.java (at line 1)\n" +
+ " interface A<X> {\n" +
+ " ^\n" +
+ "The type parameter X is hiding the type X\n" +
+ "----------\n" +
+ "2. ERROR in C.java (at line 7)\n" +
+ " public class X {\n" +
+ " ^\n" +
+ "The public type X must be defined in its own file\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399780
@@ -1814,16 +1814,16 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in C.java (at line 3)\n" +
- " System.out.println(this);\n" +
- " ^^^^\n" +
- "Cannot use this in a static context\n" +
- "----------\n" +
- "2. ERROR in C.java (at line 4)\n" +
- " System.out.println(super.hashCode());\n" +
- " ^^^^^\n" +
- "Cannot use super in a static context\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 3)\n" +
+ " System.out.println(this);\n" +
+ " ^^^^\n" +
+ "Cannot use this in a static context\n" +
+ "----------\n" +
+ "2. ERROR in C.java (at line 4)\n" +
+ " System.out.println(super.hashCode());\n" +
+ " ^^^^^\n" +
+ "Cannot use super in a static context\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406619, [1.8][compiler] Incorrect suggestion that method can be made static.
@@ -1833,7 +1833,7 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
compilerOptions.put(CompilerOptions.OPTION_ReportMethodCanBePotentiallyStatic, CompilerOptions.ERROR);
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"interface X {\n" +
" default int foo() {\n" +
" return 10;\n" +
@@ -1847,7 +1847,7 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
);
}
- // class implements interface with default method.
+ // class implements interface with default method.
// - witness for NoSuchMethodError in synthetic method (SuperMethodAccess) - turned out to be a JVM bug
public void testSuperAccess01() {
runConformTest(
@@ -1869,7 +1869,7 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
);
}
- // class implements interface with default method.
+ // class implements interface with default method.
// - intermediate public interface
public void testSuperAccess02() {
runConformTest(
@@ -1893,30 +1893,30 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
},
"default");
}
-
+
// https://bugs.eclipse.org/421796 - Bug 421796 - [1.8][compiler] java.lang.AbstractMethodError executing default method code.
public void testSuperAccess03() {
runConformTest(
new String[] {
"X.java",
- "interface I {\n" +
- " void foo(); \n" +
- "}\n" +
- "\n" +
- "interface J extends I {\n" +
- " default void foo() {\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "interface K extends J {\n" +
- "}\n" +
- "\n" +
- "public class X implements K {\n" +
- " public static void main(String argv[]) {\n" +
- " X test = new X();\n" +
- " ((J)test).foo();\n" +
- " test.foo();\n" +
- " }\n" +
+ "interface I {\n" +
+ " void foo(); \n" +
+ "}\n" +
+ "\n" +
+ "interface J extends I {\n" +
+ " default void foo() {\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "interface K extends J {\n" +
+ "}\n" +
+ "\n" +
+ "public class X implements K {\n" +
+ " public static void main(String argv[]) {\n" +
+ " X test = new X();\n" +
+ " ((J)test).foo();\n" +
+ " test.foo();\n" +
+ " }\n" +
"}\n"
});
}
@@ -1939,16 +1939,16 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"}\n" +
"class PurebredCatShopImpl extends CatShopImpl implements PurebredCatShop {}"
},
- "----------\n" +
- "1. ERROR in PurebredCatShopImpl.java (at line 6)\n" +
- " default <V extends Pet> List<? extends Cat> getPets() { return null; }\n" +
- " ^^^^^^^^^\n" +
- "Name clash: The method getPets() of type CatShop has the same erasure as getPets() of type PetShop but does not override it\n" +
- "----------\n" +
- "2. WARNING in PurebredCatShopImpl.java (at line 10)\n" +
- " @Override public List<Pet> getPets() { return null; }\n" +
- " ^^^^\n" +
- "Type safety: The return type List<Pet> for getPets() from the type CatShopImpl needs unchecked conversion to conform to List<? extends Cat> from the type CatShop\n" +
+ "----------\n" +
+ "1. ERROR in PurebredCatShopImpl.java (at line 6)\n" +
+ " default <V extends Pet> List<? extends Cat> getPets() { return null; }\n" +
+ " ^^^^^^^^^\n" +
+ "Name clash: The method getPets() of type CatShop has the same erasure as getPets() of type PetShop but does not override it\n" +
+ "----------\n" +
+ "2. WARNING in PurebredCatShopImpl.java (at line 10)\n" +
+ " @Override public List<Pet> getPets() { return null; }\n" +
+ " ^^^^\n" +
+ "Type safety: The return type List<Pet> for getPets() from the type CatShopImpl needs unchecked conversion to conform to List<? extends Cat> from the type CatShop\n" +
"----------\n"
);
}
@@ -1986,7 +1986,7 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"0000"
);
}
-
+
// modeled after org.eclipse.jdt.core.tests.compiler.regression.AmbiguousMethodTest.test081()
// see https://bugs.eclipse.org/391376 - [1.8] check interaction of default methods with bridge methods and generics
// see https://bugs.eclipse.org/404648 - [1.8][compiler] investigate differences between compilers re AmbiguousMethodTest
@@ -1994,78 +1994,78 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
runConformTest(
new String[] {
"C.java",
- "interface A<ModelType extends D, ValueType> extends\n" +
- " I<ModelType, ValueType> {\n" +
- "\n" +
- " @Override\n" +
- " public default void doSet(ModelType valueGetter) {\n" +
- " this.set((ValueType) valueGetter.getObject());\n" +
- " }\n" +
- "\n" +
- " @Override\n" +
- " public default void set(Object object) {\n" +
- " System.out.println(\"In A.set(Object)\");\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class B implements A<E, CharSequence> {\n" +
- "\n" +
- " public void set(CharSequence string) {\n" +
- " System.out.println(\"In B.set(CharSequence)\");\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "public class C extends B {\n" +
- "\n" +
- " static public void main(String[] args) {\n" +
- " C c = new C();\n" +
- " c.run();\n" +
- " }\n" +
- "\n" +
- " public void run() {\n" +
- " E e = new E<String>(String.class);\n" +
- " this.doSet(e);\n" +
- " }\n" +
- "\n" +
- "}\n" +
- "\n" +
- "class D {\n" +
- " public Object getObject() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class E<Type extends CharSequence> extends D {\n" +
- "\n" +
- " private Class<Type> typeClass;\n" +
- "\n" +
- " public E(Class<Type> typeClass) {\n" +
- " this.typeClass = typeClass;\n" +
- " }\n" +
- "\n" +
- " @Override\n" +
- " public Type getObject() {\n" +
- " try {\n" +
- " return (Type) typeClass.newInstance();\n" +
- " } catch (Exception e) {\n" +
- " throw new RuntimeException(e);\n" +
- " }\n" +
- " }\n" +
- "\n" +
- "}\n" +
- "\n" +
- "interface I<ModelType, ValueType> {\n" +
- "\n" +
- " public void doSet(ModelType model);\n" +
- "\n" +
- " public void set(ValueType value);\n" +
- "\n" +
+ "interface A<ModelType extends D, ValueType> extends\n" +
+ " I<ModelType, ValueType> {\n" +
+ "\n" +
+ " @Override\n" +
+ " public default void doSet(ModelType valueGetter) {\n" +
+ " this.set((ValueType) valueGetter.getObject());\n" +
+ " }\n" +
+ "\n" +
+ " @Override\n" +
+ " public default void set(Object object) {\n" +
+ " System.out.println(\"In A.set(Object)\");\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class B implements A<E, CharSequence> {\n" +
+ "\n" +
+ " public void set(CharSequence string) {\n" +
+ " System.out.println(\"In B.set(CharSequence)\");\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "public class C extends B {\n" +
+ "\n" +
+ " static public void main(String[] args) {\n" +
+ " C c = new C();\n" +
+ " c.run();\n" +
+ " }\n" +
+ "\n" +
+ " public void run() {\n" +
+ " E e = new E<String>(String.class);\n" +
+ " this.doSet(e);\n" +
+ " }\n" +
+ "\n" +
+ "}\n" +
+ "\n" +
+ "class D {\n" +
+ " public Object getObject() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class E<Type extends CharSequence> extends D {\n" +
+ "\n" +
+ " private Class<Type> typeClass;\n" +
+ "\n" +
+ " public E(Class<Type> typeClass) {\n" +
+ " this.typeClass = typeClass;\n" +
+ " }\n" +
+ "\n" +
+ " @Override\n" +
+ " public Type getObject() {\n" +
+ " try {\n" +
+ " return (Type) typeClass.newInstance();\n" +
+ " } catch (Exception e) {\n" +
+ " throw new RuntimeException(e);\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ "}\n" +
+ "\n" +
+ "interface I<ModelType, ValueType> {\n" +
+ "\n" +
+ " public void doSet(ModelType model);\n" +
+ "\n" +
+ " public void set(ValueType value);\n" +
+ "\n" +
"}\n"
},
"In B.set(CharSequence)");
}
-
-
+
+
// modeled after org.eclipse.jdt.core.tests.compiler.regression.AmbiguousMethodTest.test081()
// see https://bugs.eclipse.org/391376 - [1.8] check interaction of default methods with bridge methods and generics
// see https://bugs.eclipse.org/404648 - [1.8][compiler] investigate differences between compilers re AmbiguousMethodTest
@@ -2073,77 +2073,77 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
runConformTest(
new String[] {
"C.java",
- "interface A<ModelType extends D, ValueType> extends\n" +
- " I<ModelType, ValueType> {\n" +
- "\n" +
- " @Override\n" +
- " public default void doSet(ModelType valueGetter) {\n" +
- " this.set((ValueType) valueGetter.getObject());\n" +
- " }\n" +
- "\n" +
- " @Override\n" +
- " public default void set(Object object) {\n" +
- " System.out.println(\"In A.set(Object)\");\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "interface B extends A<E, CharSequence> {\n" +
- "\n" +
- " public default void set(CharSequence string) {\n" +
- " System.out.println(\"In B.set(CharSequence)\");\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "public class C implements B {\n" +
- "\n" +
- " static public void main(String[] args) {\n" +
- " C c = new C();\n" +
- " c.run();\n" +
- " }\n" +
- "\n" +
- " public void run() {\n" +
- " E e = new E<String>(String.class);\n" +
- " this.doSet(e);\n" +
- " }\n" +
- "\n" +
- "}\n" +
- "\n" +
- "class D {\n" +
- " public Object getObject() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class E<Type extends CharSequence> extends D {\n" +
- "\n" +
- " private Class<Type> typeClass;\n" +
- "\n" +
- " public E(Class<Type> typeClass) {\n" +
- " this.typeClass = typeClass;\n" +
- " }\n" +
- "\n" +
- " @Override\n" +
- " public Type getObject() {\n" +
- " try {\n" +
- " return (Type) typeClass.newInstance();\n" +
- " } catch (Exception e) {\n" +
- " throw new RuntimeException(e);\n" +
- " }\n" +
- " }\n" +
- "\n" +
- "}\n" +
- "\n" +
- "interface I<ModelType, ValueType> {\n" +
- "\n" +
- " public void doSet(ModelType model);\n" +
- "\n" +
- " public void set(ValueType value);\n" +
- "\n" +
+ "interface A<ModelType extends D, ValueType> extends\n" +
+ " I<ModelType, ValueType> {\n" +
+ "\n" +
+ " @Override\n" +
+ " public default void doSet(ModelType valueGetter) {\n" +
+ " this.set((ValueType) valueGetter.getObject());\n" +
+ " }\n" +
+ "\n" +
+ " @Override\n" +
+ " public default void set(Object object) {\n" +
+ " System.out.println(\"In A.set(Object)\");\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "interface B extends A<E, CharSequence> {\n" +
+ "\n" +
+ " public default void set(CharSequence string) {\n" +
+ " System.out.println(\"In B.set(CharSequence)\");\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "public class C implements B {\n" +
+ "\n" +
+ " static public void main(String[] args) {\n" +
+ " C c = new C();\n" +
+ " c.run();\n" +
+ " }\n" +
+ "\n" +
+ " public void run() {\n" +
+ " E e = new E<String>(String.class);\n" +
+ " this.doSet(e);\n" +
+ " }\n" +
+ "\n" +
+ "}\n" +
+ "\n" +
+ "class D {\n" +
+ " public Object getObject() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class E<Type extends CharSequence> extends D {\n" +
+ "\n" +
+ " private Class<Type> typeClass;\n" +
+ "\n" +
+ " public E(Class<Type> typeClass) {\n" +
+ " this.typeClass = typeClass;\n" +
+ " }\n" +
+ "\n" +
+ " @Override\n" +
+ " public Type getObject() {\n" +
+ " try {\n" +
+ " return (Type) typeClass.newInstance();\n" +
+ " } catch (Exception e) {\n" +
+ " throw new RuntimeException(e);\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ "}\n" +
+ "\n" +
+ "interface I<ModelType, ValueType> {\n" +
+ "\n" +
+ " public void doSet(ModelType model);\n" +
+ "\n" +
+ " public void set(ValueType value);\n" +
+ "\n" +
"}\n"
},
"In B.set(CharSequence)");
}
-
+
// test for different error messages in modifiers.
public void test400977() {
String infMod = this.complianceLevel >= ClassFileConstants.JDK9 ? " private," : "";
@@ -2153,7 +2153,7 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"public interface I {\n" +
" default abstract void foo();\n" +
" public abstract default strictfp final void bar();" +
- "}\n"},
+ "}\n"},
"----------\n" +
"1. ERROR in I.java (at line 2)\n" +
" default abstract void foo();\n" +
@@ -2192,7 +2192,7 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" return foo();\n" +
" }\n" +
"}\n"
- },
+ },
"");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=421543, [1.8][compiler] Compiler fails to recognize default method being turned into abstract by subtytpe
@@ -2208,17 +2208,17 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"}\n" +
"public class X implements J {\n" +
"}\n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " void foo();\n" +
- " ^^^^^\n" +
- "The method foo() of type J should be tagged with @Override since it actually overrides a superinterface method\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " public class X implements J {\n" +
- " ^\n" +
- "The type X must implement the inherited abstract method J.foo()\n" +
+ },
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " void foo();\n" +
+ " ^^^^^\n" +
+ "The method foo() of type J should be tagged with @Override since it actually overrides a superinterface method\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " public class X implements J {\n" +
+ " ^\n" +
+ "The type X must implement the inherited abstract method J.foo()\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=421543, [1.8][compiler] Compiler fails to recognize default method being turned into abstract by subtytpe
@@ -2234,17 +2234,17 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"}\n" +
"public class X implements J {\n" +
"}\n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " void foo(J t);\n" +
- " ^^^^^^^^\n" +
- "The method foo(J) of type J should be tagged with @Override since it actually overrides a superinterface method\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " public class X implements J {\n" +
- " ^\n" +
- "The type X must implement the inherited abstract method J.foo(J)\n" +
+ },
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " void foo(J t);\n" +
+ " ^^^^^^^^\n" +
+ "The method foo(J) of type J should be tagged with @Override since it actually overrides a superinterface method\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " public class X implements J {\n" +
+ " ^\n" +
+ "The type X must implement the inherited abstract method J.foo(J)\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=421543, [1.8][compiler] Compiler fails to recognize default method being turned into abstract by subtytpe
@@ -2261,7 +2261,7 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"}\n" +
"public class X implements J {\n" +
"}\n"
- },
+ },
"");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=421797, [1.8][compiler] ClassFormatError with default methods & I.super.foo() syntax
@@ -2287,11 +2287,11 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" System.out.println(new T(){}.m(\"Hello\", 1234));\n" +
" }\n" +
"}\n"
- },
+ },
"Hello from I.foo:1522756");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=422731, [1.8] Ambiguous method not reported on overridden default method
+ }
+
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=422731, [1.8] Ambiguous method not reported on overridden default method
public void test422731() throws Exception {
this.runNegativeTest(
new String[] {
@@ -2313,16 +2313,16 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" public void bar(int i, short s) {}\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " x.foo((short)5, (short)10);\n" +
- " ^^^\n" +
- "The method foo(short, int) is ambiguous for the type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " x.bar((short)5, (short)10);\n" +
- " ^^^\n" +
- "The method bar(short, int) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " x.foo((short)5, (short)10);\n" +
+ " ^^^\n" +
+ "The method foo(short, int) is ambiguous for the type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " x.bar((short)5, (short)10);\n" +
+ " ^^^\n" +
+ "The method bar(short, int) is ambiguous for the type X\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425719, [1.8][compiler] Bogus ambiguous call error from compiler
@@ -2348,7 +2348,7 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
},
"class method");
}
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=425718, [1.8] default method changes access privilege of protected overridden method from Object
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=425718, [1.8] default method changes access privilege of protected overridden method from Object
public void test425718() throws Exception {
this.runNegativeTest(
new String[] {
@@ -2363,16 +2363,16 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " I x = new I(){};\n" +
- " ^^^\n" +
- "The inherited method Object.clone() cannot hide the public abstract method in I\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " I x = new I(){};\n" +
- " ^^^\n" +
- "Exception CloneNotSupportedException in throws clause of Object.clone() is not compatible with I.clone()\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " I x = new I(){};\n" +
+ " ^^^\n" +
+ "The inherited method Object.clone() cannot hide the public abstract method in I\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " I x = new I(){};\n" +
+ " ^^^\n" +
+ "Exception CloneNotSupportedException in throws clause of Object.clone() is not compatible with I.clone()\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426318, [1.8][compiler] Bogus name clash error in the presence of default methods and varargs
@@ -2391,16 +2391,16 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"public abstract class X extends Y implements I { \n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " default public <T> void foo(T... x) {};\n" +
- " ^\n" +
- "Type safety: Potential heap pollution via varargs parameter x\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " public abstract <T> void goo(T ... x);\n" +
- " ^\n" +
- "Type safety: Potential heap pollution via varargs parameter x\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " default public <T> void foo(T... x) {};\n" +
+ " ^\n" +
+ "Type safety: Potential heap pollution via varargs parameter x\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " public abstract <T> void goo(T ... x);\n" +
+ " ^\n" +
+ "Type safety: Potential heap pollution via varargs parameter x\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=424914, [1.8][compiler] No error shown for method reference with super enclosed in an interface
@@ -2418,26 +2418,26 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " String b = super.toString();\n" +
- " ^^^^^\n" +
- "Cannot use super in a static context\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " System.out.println((A) super::toString);\n" +
- " ^^^^^\n" +
- "super reference is illegal in interface context\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " super.toString();\n" +
- " ^^^^^\n" +
- "super reference is illegal in interface context\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " Object.super.toString();\n" +
- " ^^^^^^^^^^^^\n" +
- "No enclosing instance of the type Object is accessible in scope\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " String b = super.toString();\n" +
+ " ^^^^^\n" +
+ "Cannot use super in a static context\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " System.out.println((A) super::toString);\n" +
+ " ^^^^^\n" +
+ "super reference is illegal in interface context\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " super.toString();\n" +
+ " ^^^^^\n" +
+ "super reference is illegal in interface context\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " Object.super.toString();\n" +
+ " ^^^^^^^^^^^^\n" +
+ "No enclosing instance of the type Object is accessible in scope\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=424914, [1.8][compiler] No error shown for method reference with super enclosed in an interface
@@ -2463,9 +2463,9 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" }\n" +
"}\n",
},
- "A.foo\n" +
+ "A.foo\n" +
"B.foo");
- }
+ }
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427478, [1.8][compiler] Wrong "Duplicate default methods" error on AbstractDoubleSpliterator
public void test427478() throws Exception { // extracted smaller test case.
this.runConformTest(
@@ -2568,18 +2568,18 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
new String[] {
"Bar.java",
"@FunctionalInterface\n" +
- "public interface Bar extends Overridden {\n" +
- " void foo();\n" +
- " @Override\n" +
- " default void close() {\n" +
- " System.out.println(\"bar\");\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "interface Overridden extends AutoCloseable {\n" +
- " // Works without this overridden method\n" +
- " @Override\n" +
- " void close();\n" +
+ "public interface Bar extends Overridden {\n" +
+ " void foo();\n" +
+ " @Override\n" +
+ " default void close() {\n" +
+ " System.out.println(\"bar\");\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "interface Overridden extends AutoCloseable {\n" +
+ " // Works without this overridden method\n" +
+ " @Override\n" +
+ " void close();\n" +
"}"
},
"");
@@ -2606,10 +2606,10 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
"");
// ensure bridge methods are generated in interfaces.
String expectedOutput =
- " public bridge synthetic java.lang.Object reduce(java.lang.Integer arg0);\n" +
- " 0 aload_0 [this]\n" +
- " 1 aload_1 [arg0]\n" +
- " 2 invokeinterface DoubleInterface.reduce(java.lang.Integer) : java.lang.Double [24] [nargs: 2]\n" +
+ " public bridge synthetic java.lang.Object reduce(java.lang.Integer arg0);\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 aload_1 [arg0]\n" +
+ " 2 invokeinterface DoubleInterface.reduce(java.lang.Integer) : java.lang.Double [24] [nargs: 2]\n" +
" 7 areturn\n";
File f = new File(OUTPUT_DIR + File.separator + "DoubleInterface.class");
@@ -2694,7 +2694,7 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
" }\n" +
"}\n", // =================
},
- "Anonymous class value: 6.0\n" +
+ "Anonymous class value: 6.0\n" +
"Lambda expression value: 6.0");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=437522, [1.8][compiler] Missing compile error in Java 8 mode for Interface.super.field access
@@ -2856,21 +2856,21 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
this.runConformTest(
new String[] {
"FunctionalInterface1.java",
- "@FunctionalInterface\n" +
- "interface FunctionalInterface1 {\n" +
- " void methodWithoutDefault();\n" +
- "}\n" +
- "@FunctionalInterface\n" +
- "interface FunctionalInterface2 extends FunctionalInterface1{}\n" +
- "@FunctionalInterface\n" +
- "interface FunctionalInterface3 extends FunctionalInterface1{}\n" +
- "@FunctionalInterface\n" +
- "interface FunctionalInterface4 extends FunctionalInterface2, FunctionalInterface3{}\n" +
- "@FunctionalInterface\n" +
- "interface RunnableFunctionalInterface extends Runnable, FunctionalInterface4{\n" +
- " default void methodWithoutDefault(){\n" +
- " // implements methodWithoutDefault\n" +
- " }\n" +
+ "@FunctionalInterface\n" +
+ "interface FunctionalInterface1 {\n" +
+ " void methodWithoutDefault();\n" +
+ "}\n" +
+ "@FunctionalInterface\n" +
+ "interface FunctionalInterface2 extends FunctionalInterface1{}\n" +
+ "@FunctionalInterface\n" +
+ "interface FunctionalInterface3 extends FunctionalInterface1{}\n" +
+ "@FunctionalInterface\n" +
+ "interface FunctionalInterface4 extends FunctionalInterface2, FunctionalInterface3{}\n" +
+ "@FunctionalInterface\n" +
+ "interface RunnableFunctionalInterface extends Runnable, FunctionalInterface4{\n" +
+ " default void methodWithoutDefault(){\n" +
+ " // implements methodWithoutDefault\n" +
+ " }\n" +
"}\n"
});
}
@@ -2879,20 +2879,20 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
this.runConformTest(
new String[] {
"FI1.java",
- "interface FI1<T,R> {\n" +
- " R call(T input);\n" +
- "}\n" +
- "interface FI2<U,V> {\n" +
- " V call(U input);\n" +
- "}\n" +
- "@FunctionalInterface\n" +
- "interface FI3<X,Y> extends FI1<X,Y>, FI2<X,Y> {\n" +
- " Y apply(X input);\n" +
- "\n" +
- " @Override\n" +
- " default Y call(X input) {\n" +
- " return apply(input);\n" +
- " }\n" +
+ "interface FI1<T,R> {\n" +
+ " R call(T input);\n" +
+ "}\n" +
+ "interface FI2<U,V> {\n" +
+ " V call(U input);\n" +
+ "}\n" +
+ "@FunctionalInterface\n" +
+ "interface FI3<X,Y> extends FI1<X,Y>, FI2<X,Y> {\n" +
+ " Y apply(X input);\n" +
+ "\n" +
+ " @Override\n" +
+ " default Y call(X input) {\n" +
+ " return apply(input);\n" +
+ " }\n" +
"}"
});
}
@@ -2901,22 +2901,22 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
this.runNegativeTest(
new String[] {
"D.java",
- "interface A {\n" +
+ "interface A {\n" +
" public default void display() {\n" +
- " System.out.println(\"Display from A\");\n" +
- " }\n" +
- "}\n" +
- "interface B extends A {\n" +
+ " System.out.println(\"Display from A\");\n" +
+ " }\n" +
+ "}\n" +
+ "interface B extends A {\n" +
" @Override\n" +
- " public default void display() {\n" +
- " System.out.println(\"Display from B\");\n" +
- " }\n" +
- "}\n" +
- "interface C extends A {\n" +
+ " public default void display() {\n" +
+ " System.out.println(\"Display from B\");\n" +
+ " }\n" +
+ "}\n" +
+ "interface C extends A {\n" +
" @Override\n" +
- " public void display();\n" +
- "}\n" +
- "public interface D extends B, C {\n" +
+ " public void display();\n" +
+ "}\n" +
+ "public interface D extends B, C {\n" +
"}\n"
},
"----------\n" +
@@ -2931,22 +2931,22 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
this.runNegativeTest(
new String[] {
"D.java",
- "interface A {\n" +
- " public default void display() {\n" +
- " System.out.println(\"Display from A\");\n" +
- " }\n" +
- "}\n" +
- "interface B extends A {\n" +
+ "interface A {\n" +
+ " public default void display() {\n" +
+ " System.out.println(\"Display from A\");\n" +
+ " }\n" +
+ "}\n" +
+ "interface B extends A {\n" +
" @Override\n" +
- " public default void display() {\n" +
- " System.out.println(\"Display from B\");\n" +
- " }\n" +
- "}\n" +
- "interface C extends A {\n" +
+ " public default void display() {\n" +
+ " System.out.println(\"Display from B\");\n" +
+ " }\n" +
+ "}\n" +
+ "interface C extends A {\n" +
" @Override\n" +
- " public void display();\n" +
- "}\n" +
- "public interface D extends C, B {\n" +
+ " public void display();\n" +
+ "}\n" +
+ "public interface D extends C, B {\n" +
"}\n"
},
"----------\n" +
@@ -2961,20 +2961,20 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
this.runNegativeTest(
new String[] {
"Z.java",
- "import java.util.*;\n" +
- "interface Z<E> extends X<E>, Y<E> {\n" +
- "}\n" +
- "interface Y<E> extends AB<E> {\n" +
+ "import java.util.*;\n" +
+ "interface Z<E> extends X<E>, Y<E> {\n" +
+ "}\n" +
+ "interface Y<E> extends AB<E> {\n" +
" @Override\n" +
- " default Spliterator<E> spliterator() { return null; };\n" +
- "}\n" +
- "interface X<E> extends AB<E> {\n" +
+ " default Spliterator<E> spliterator() { return null; };\n" +
+ "}\n" +
+ "interface X<E> extends AB<E> {\n" +
" @Override\n" +
- " Spliterator<E> spliterator();\n" +
- "}\n" +
- "interface AB<E> {\n" +
- " default Spliterator<E> spliterator() { return null; }\n" +
- "}\n"
+ " Spliterator<E> spliterator();\n" +
+ "}\n" +
+ "interface AB<E> {\n" +
+ " default Spliterator<E> spliterator() { return null; }\n" +
+ "}\n"
},
"----------\n" +
"1. ERROR in Z.java (at line 2)\n" +
@@ -2988,20 +2988,20 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
this.runNegativeTest(
new String[] {
"Z.java",
- "import java.util.*;\n" +
- "interface Z<E> extends Y<E>, X<E> {\n" +
- "}\n" +
- "interface Y<E> extends AB<E> {\n" +
+ "import java.util.*;\n" +
+ "interface Z<E> extends Y<E>, X<E> {\n" +
+ "}\n" +
+ "interface Y<E> extends AB<E> {\n" +
" @Override\n" +
- " default Spliterator<E> spliterator() { return null; };\n" +
- "}\n" +
- "interface X<E> extends AB<E> {\n" +
+ " default Spliterator<E> spliterator() { return null; };\n" +
+ "}\n" +
+ "interface X<E> extends AB<E> {\n" +
" @Override\n" +
- " Spliterator<E> spliterator();\n" +
- "}\n" +
- "interface AB<E> {\n" +
- " default Spliterator<E> spliterator() { return null; }\n" +
- "}\n"
+ " Spliterator<E> spliterator();\n" +
+ "}\n" +
+ "interface AB<E> {\n" +
+ " default Spliterator<E> spliterator() { return null; }\n" +
+ "}\n"
},
"----------\n" +
"1. ERROR in Z.java (at line 2)\n" +
@@ -3015,19 +3015,19 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
this.runNegativeTest(
new String[] {
"Z.java",
- "import java.util.*;\n" +
- "interface Z<E> extends X<E>, Y<E> {\n" +
- "}\n" +
- "interface Y<E> extends AB<E> {\n" +
+ "import java.util.*;\n" +
+ "interface Z<E> extends X<E>, Y<E> {\n" +
+ "}\n" +
+ "interface Y<E> extends AB<E> {\n" +
" @Override\n" +
- " default Spliterator<E> spliterator() { return null; };\n" +
- "}\n" +
- "interface X<E> {\n" +
- " Spliterator<E> spliterator();\n" +
- "}\n" +
- "interface AB<E> {\n" +
- " default Spliterator<E> spliterator() { return null; }\n" +
- "}\n"
+ " default Spliterator<E> spliterator() { return null; };\n" +
+ "}\n" +
+ "interface X<E> {\n" +
+ " Spliterator<E> spliterator();\n" +
+ "}\n" +
+ "interface AB<E> {\n" +
+ " default Spliterator<E> spliterator() { return null; }\n" +
+ "}\n"
},
"----------\n" +
"1. ERROR in Z.java (at line 2)\n" +
@@ -3041,19 +3041,19 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
this.runNegativeTest(
new String[] {
"Z.java",
- "import java.util.*;\n" +
- "interface Z<E> extends Y<E>, X<E> {\n" +
- "}\n" +
- "interface Y<E> extends AB<E> {\n" +
+ "import java.util.*;\n" +
+ "interface Z<E> extends Y<E>, X<E> {\n" +
+ "}\n" +
+ "interface Y<E> extends AB<E> {\n" +
" @Override\n" +
- " default Spliterator<E> spliterator() { return null; };\n" +
- "}\n" +
- "interface X<E> {\n" +
- " Spliterator<E> spliterator();\n" +
- "}\n" +
- "interface AB<E> {\n" +
- " default Spliterator<E> spliterator() { return null; }\n" +
- "}\n"
+ " default Spliterator<E> spliterator() { return null; };\n" +
+ "}\n" +
+ "interface X<E> {\n" +
+ " Spliterator<E> spliterator();\n" +
+ "}\n" +
+ "interface AB<E> {\n" +
+ " default Spliterator<E> spliterator() { return null; }\n" +
+ "}\n"
},
"----------\n" +
"1. ERROR in Z.java (at line 2)\n" +
@@ -3066,22 +3066,22 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
this.runNegativeTest(
new String[] {
"JavaTest.java",
- "public class JavaTest {\n" +
- " interface A {\n" +
- " default void foo() { }\n" +
- " }\n" +
- " interface B {\n" +
- " void foo();\n" +
- " }\n" +
- " interface C {\n" +
- " void foo();\n" +
- " }\n" +
- " interface D extends A, B {\n" +
- " @Override default void foo() { }\n" +
- " }\n" +
- " class E implements A, B, C, D {\n" +
- " }\n" +
- "}"
+ "public class JavaTest {\n" +
+ " interface A {\n" +
+ " default void foo() { }\n" +
+ " }\n" +
+ " interface B {\n" +
+ " void foo();\n" +
+ " }\n" +
+ " interface C {\n" +
+ " void foo();\n" +
+ " }\n" +
+ " interface D extends A, B {\n" +
+ " @Override default void foo() { }\n" +
+ " }\n" +
+ " class E implements A, B, C, D {\n" +
+ " }\n" +
+ "}"
},
"----------\n" +
"1. ERROR in JavaTest.java (at line 14)\n" +
@@ -3094,22 +3094,22 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
this.runNegativeTest(
new String[] {
"JavaTest.java",
- "public class JavaTest {\n" +
- " interface A {\n" +
- " default void foo() { }\n" +
- " }\n" +
- " interface B {\n" +
- " void foo();\n" +
- " }\n" +
- " interface C {\n" +
- " void foo();\n" +
- " }\n" +
- " interface D extends A, B {\n" +
- " @Override default void foo() { }\n" +
- " }\n" +
- " class E implements B, C, A, D {\n" +
- " }\n" +
- "}"
+ "public class JavaTest {\n" +
+ " interface A {\n" +
+ " default void foo() { }\n" +
+ " }\n" +
+ " interface B {\n" +
+ " void foo();\n" +
+ " }\n" +
+ " interface C {\n" +
+ " void foo();\n" +
+ " }\n" +
+ " interface D extends A, B {\n" +
+ " @Override default void foo() { }\n" +
+ " }\n" +
+ " class E implements B, C, A, D {\n" +
+ " }\n" +
+ "}"
},
"----------\n" +
"1. ERROR in JavaTest.java (at line 14)\n" +
@@ -3123,28 +3123,28 @@ public class InterfaceMethodsTest extends AbstractComparableTest {
runConformTest(
new String[] {
"Test.java",
- "public class Test {\n" +
- " static <V> void m(V v) {\n" +
- "\n" +
- " }\n" +
- "\n" +
- " interface Foo {\n" +
- " @SuppressWarnings(\"unchecked\")\n" +
- " default <U> U f() {\n" +
- " return (U) new Object();\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " static class Bar implements Foo {\n" +
- " @SuppressWarnings(\"unchecked\")\n" +
- " @Override\n" +
- " public Object f() {\n" +
- " m(Foo.super.f());\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " static <V> void m(V v) {\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
+ " interface Foo {\n" +
+ " @SuppressWarnings(\"unchecked\")\n" +
+ " default <U> U f() {\n" +
+ " return (U) new Object();\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " static class Bar implements Foo {\n" +
+ " @SuppressWarnings(\"unchecked\")\n" +
+ " @Override\n" +
+ " public Object f() {\n" +
+ " m(Foo.super.f());\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
"}",
- },
+ },
"");
}
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InterfaceMethodsTest_9.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InterfaceMethodsTest_9.java
index c6da4bca4..b9189f1a1 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InterfaceMethodsTest_9.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InterfaceMethodsTest_9.java
@@ -18,7 +18,7 @@ import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import junit.framework.Test;
-// Bug 488662 - [1.9] Allow private methods in interfaces
+// Bug 488662 - [1.9] Allow private methods in interfaces
@SuppressWarnings({ "rawtypes" })
public class InterfaceMethodsTest_9 extends AbstractComparableTest {
@@ -55,10 +55,10 @@ public class InterfaceMethodsTest_9 extends AbstractComparableTest {
new String[] {
"I.java",
"public interface I {\n" +
- "@SuppressWarnings(\"unused\")\n" +
+ "@SuppressWarnings(\"unused\")\n" +
" private void foo() {}\n" +
"}\n",
- },
+ },
"");
}
// private method legal combination of modifiers - positive test
@@ -67,10 +67,10 @@ public class InterfaceMethodsTest_9 extends AbstractComparableTest {
new String[] {
"I.java",
"public interface I {\n" +
- "@SuppressWarnings(\"unused\")\n" +
+ "@SuppressWarnings(\"unused\")\n" +
" private static void foo() {}\n" +
"}\n",
- },
+ },
"");
}
// private method legal combination of modifiers - positive test
@@ -79,10 +79,10 @@ public class InterfaceMethodsTest_9 extends AbstractComparableTest {
new String[] {
"I.java",
"public interface I {\n" +
- "@SuppressWarnings(\"unused\")\n" +
+ "@SuppressWarnings(\"unused\")\n" +
" private strictfp void foo() {}\n" +
"}\n",
- },
+ },
"");
}
@@ -110,20 +110,20 @@ public class InterfaceMethodsTest_9 extends AbstractComparableTest {
new String[] {
"I.java",
"public interface I {\n" +
- "@SuppressWarnings(\"unused\")\n" +
+ "@SuppressWarnings(\"unused\")\n" +
" private default void foo();\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in I.java (at line 3)\n" +
- " private default void foo();\n" +
- " ^^^^^\n" +
- "Illegal combination of modifiers for the private interface method foo; additionally only one of static and strictfp is permitted\n" +
- "----------\n" +
- "2. ERROR in I.java (at line 3)\n" +
- " private default void foo();\n" +
- " ^^^^^\n" +
- "This method requires a body instead of a semicolon\n" +
+ "----------\n" +
+ "1. ERROR in I.java (at line 3)\n" +
+ " private default void foo();\n" +
+ " ^^^^^\n" +
+ "Illegal combination of modifiers for the private interface method foo; additionally only one of static and strictfp is permitted\n" +
+ "----------\n" +
+ "2. ERROR in I.java (at line 3)\n" +
+ " private default void foo();\n" +
+ " ^^^^^\n" +
+ "This method requires a body instead of a semicolon\n" +
"----------\n");
}
// illegal modifier combination - negative test
@@ -139,7 +139,7 @@ public class InterfaceMethodsTest_9 extends AbstractComparableTest {
"1. ERROR in I.java (at line 2)\n" +
" private abstract void foo();\n" +
" ^^^^^\n" +
- "Illegal combination of modifiers for the private interface method foo; additionally only one of static and strictfp is permitted\n" +
+ "Illegal combination of modifiers for the private interface method foo; additionally only one of static and strictfp is permitted\n" +
"----------\n");
}
@@ -153,15 +153,15 @@ public class InterfaceMethodsTest_9 extends AbstractComparableTest {
"}\n"
},
"----------\n" +
- "1. ERROR in I.java (at line 2)\n" +
- " private synchronized void foo();\n" +
- " ^^^^^\n" +
- "Illegal modifier for the interface method foo; only public, private, abstract, default, static and strictfp are permitted\n" +
- "----------\n" +
- "2. ERROR in I.java (at line 2)\n" +
- " private synchronized void foo();\n" +
- " ^^^^^\n" +
- "This method requires a body instead of a semicolon\n" +
+ "1. ERROR in I.java (at line 2)\n" +
+ " private synchronized void foo();\n" +
+ " ^^^^^\n" +
+ "Illegal modifier for the interface method foo; only public, private, abstract, default, static and strictfp are permitted\n" +
+ "----------\n" +
+ "2. ERROR in I.java (at line 2)\n" +
+ " private synchronized void foo();\n" +
+ " ^^^^^\n" +
+ "This method requires a body instead of a semicolon\n" +
"----------\n");
}
@@ -174,7 +174,7 @@ public class InterfaceMethodsTest_9 extends AbstractComparableTest {
" public default void foo() {}\n"+
"}\n"+
"public class X implements I{\n"+
- "@SuppressWarnings(\"unused\")\n" +
+ "@SuppressWarnings(\"unused\")\n" +
"@Override\n" +
" private void foo() {}\n"+
"}\n"
@@ -183,7 +183,7 @@ public class InterfaceMethodsTest_9 extends AbstractComparableTest {
"1. ERROR in X.java (at line 7)\n" +
" private void foo() {}\n"+
" ^^^^^\n" +
- "Cannot reduce the visibility of the inherited method from I\n" +
+ "Cannot reduce the visibility of the inherited method from I\n" +
"----------\n");
}
@@ -205,7 +205,7 @@ public class InterfaceMethodsTest_9 extends AbstractComparableTest {
" new X().bar();\n"+
" }\n"+
"}\n"
- },
+ },
"");
}
// illegal modifier combination - multiple errors - negative test
@@ -221,7 +221,7 @@ public class InterfaceMethodsTest_9 extends AbstractComparableTest {
"1. ERROR in I.java (at line 2)\n" +
" private public void foo(){}\n" +
" ^^^^^\n" +
- "Illegal combination of modifiers for the private interface method foo; additionally only one of static and strictfp is permitted\n" +
+ "Illegal combination of modifiers for the private interface method foo; additionally only one of static and strictfp is permitted\n" +
"----------\n");
}
// illegal modifier combination - negative test
@@ -233,16 +233,16 @@ public class InterfaceMethodsTest_9 extends AbstractComparableTest {
" private protected void foo();\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in I.java (at line 2)\n" +
- " private protected void foo();\n" +
- " ^^^^^\n" +
- "Illegal modifier for the interface method foo; only public, private, abstract, default, static and strictfp are permitted\n" +
- "----------\n" +
- "2. ERROR in I.java (at line 2)\n" +
- " private protected void foo();\n" +
- " ^^^^^\n" +
- "This method requires a body instead of a semicolon\n" +
+ "----------\n" +
+ "1. ERROR in I.java (at line 2)\n" +
+ " private protected void foo();\n" +
+ " ^^^^^\n" +
+ "Illegal modifier for the interface method foo; only public, private, abstract, default, static and strictfp are permitted\n" +
+ "----------\n" +
+ "2. ERROR in I.java (at line 2)\n" +
+ " private protected void foo();\n" +
+ " ^^^^^\n" +
+ "This method requires a body instead of a semicolon\n" +
"----------\n");
}
// illegal modifier combination - multiple errors - negative test
@@ -254,21 +254,21 @@ public class InterfaceMethodsTest_9 extends AbstractComparableTest {
" private private public default protected void foo();\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in I.java (at line 2)\n" +
- " private private public default protected void foo();\n" +
- " ^^^^^\n" +
- "Duplicate modifier for the method foo in type I\n" +
- "----------\n" +
- "2. ERROR in I.java (at line 2)\n" +
- " private private public default protected void foo();\n" +
- " ^^^^^\n" +
- "Illegal modifier for the interface method foo; only public, private, abstract, default, static and strictfp are permitted\n" +
- "----------\n" +
- "3. ERROR in I.java (at line 2)\n" +
- " private private public default protected void foo();\n" +
- " ^^^^^\n" +
- "This method requires a body instead of a semicolon\n" +
+ "----------\n" +
+ "1. ERROR in I.java (at line 2)\n" +
+ " private private public default protected void foo();\n" +
+ " ^^^^^\n" +
+ "Duplicate modifier for the method foo in type I\n" +
+ "----------\n" +
+ "2. ERROR in I.java (at line 2)\n" +
+ " private private public default protected void foo();\n" +
+ " ^^^^^\n" +
+ "Illegal modifier for the interface method foo; only public, private, abstract, default, static and strictfp are permitted\n" +
+ "----------\n" +
+ "3. ERROR in I.java (at line 2)\n" +
+ " private private public default protected void foo();\n" +
+ " ^^^^^\n" +
+ "This method requires a body instead of a semicolon\n" +
"----------\n");
}
public void testBug517926() {
@@ -280,31 +280,31 @@ public class InterfaceMethodsTest_9 extends AbstractComparableTest {
" default String getName() { return name(null);}\n" +
"}\n",
"A.java",
- "public class A implements I<String> {\n" +
- " @Override\n" +
- " public String name(String s) {\n" +
- " return null;\n" +
- " }\n" +
+ "public class A implements I<String> {\n" +
+ " @Override\n" +
+ " public String name(String s) {\n" +
+ " return null;\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in A.java (at line 3)\n" +
- " public String name(String s) {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method name(String) of type A must override or implement a supertype method\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 3)\n" +
+ " public String name(String s) {\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The method name(String) of type A must override or implement a supertype method\n" +
"----------\n");
}
public void testBug521743() {
runConformTest(
new String[] {
"FI.java",
- "interface FI {\n" +
- " private <T> void foo(Class c){}\n" +
- "}\n" +
- "interface FI2 extends FI {\n" +
- " default <T> void foo(Class<T> c) {}\n" +
+ "interface FI {\n" +
+ " private <T> void foo(Class c){}\n" +
+ "}\n" +
+ "interface FI2 extends FI {\n" +
+ " default <T> void foo(Class<T> c) {}\n" +
"}"
- },
+ },
"");
}
public void testBug520795() {
@@ -313,22 +313,22 @@ public class InterfaceMethodsTest_9 extends AbstractComparableTest {
"I.java",
"public interface I {\n" +
" private static void foo(){};\n" +
- " default void bar() {\n" +
- " foo();\n" +
+ " default void bar() {\n" +
+ " foo();\n" +
" }" +
"}\n",
"X.java",
"public class X {\n" +
- "public static void main(String[] args) {\n" +
- " I.foo();\n" +
+ "public static void main(String[] args) {\n" +
+ " I.foo();\n" +
"}" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " I.foo();\n" +
- " ^^^\n" +
- "The method foo() from the type I is not visible\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " I.foo();\n" +
+ " ^^^\n" +
+ "The method foo() from the type I is not visible\n" +
"----------\n" );
}
public void testBug520795a() {
@@ -338,12 +338,12 @@ public class InterfaceMethodsTest_9 extends AbstractComparableTest {
"public class X {\n" +
"interface I {\n" +
" private static void foo(){};\n" +
- " default void bar() {\n" +
- " foo();\n" +
+ " default void bar() {\n" +
+ " foo();\n" +
" }" +
"}\n" +
- "public static void main(String[] args) {\n" +
- " I.foo();\n" +
+ "public static void main(String[] args) {\n" +
+ " I.foo();\n" +
"}" +
"}\n"
});
@@ -359,15 +359,15 @@ public class InterfaceMethodsTest_9 extends AbstractComparableTest {
"}\n" +
"public static void main(String[] args) {\n" +
" I i = () -> {};\n" +
- " i.foo();\n" +
+ " i.foo();\n" +
"}" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " i.foo();\n" +
- " ^^^\n" +
- "This static method of interface X.I can only be accessed as X.I.foo\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " i.foo();\n" +
+ " ^^^\n" +
+ "This static method of interface X.I can only be accessed as X.I.foo\n" +
"----------\n" );
}
public void testBug520795c() {
@@ -384,34 +384,34 @@ public class InterfaceMethodsTest_9 extends AbstractComparableTest {
"}\n" +
"public static void main(String[] args) {\n" +
" J j = () -> {};\n" +
- " j.goo();\n" +
+ " j.goo();\n" +
"}" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " default void goo(){I.super.foo();};\n" +
- " ^^^\n" +
- "This static method of interface X.I can only be accessed as X.I.foo\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " default void goo(){I.super.foo();};\n" +
+ " ^^^\n" +
+ "This static method of interface X.I can only be accessed as X.I.foo\n" +
"----------\n" );
}
public void testBug518272() {
runConformTest(
new String[] {
"GeneratedAccessorBug.java",
- "public interface GeneratedAccessorBug {\n" +
- " void hello();\n" +
- " private static void foo() {}\n" +
- " public static void bar() {\n" +
- " new GeneratedAccessorBug() {\n" +
- " public void hello() {\n" +
- " foo();\n" +
- " }\n" +
- " }.hello();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " GeneratedAccessorBug.bar();\n" +
- " }\n" +
+ "public interface GeneratedAccessorBug {\n" +
+ " void hello();\n" +
+ " private static void foo() {}\n" +
+ " public static void bar() {\n" +
+ " new GeneratedAccessorBug() {\n" +
+ " public void hello() {\n" +
+ " foo();\n" +
+ " }\n" +
+ " }.hello();\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " GeneratedAccessorBug.bar();\n" +
+ " }\n" +
"}"
});
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP181NestTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP181NestTest.java
index 7783a7711..7d717ccb2 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP181NestTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP181NestTest.java
@@ -129,11 +129,11 @@ public void testBug535851_001() throws Exception {
);
String expectedPartialOutput =
- "Nest Members:\n" +
- " #37 pack1/X$A,\n" +
- " #44 pack1/X$A$B,\n" +
- " #46 pack1/X$A$C,\n" +
- " #40 pack1/X$Y,\n" +
+ "Nest Members:\n" +
+ " #37 pack1/X$A,\n" +
+ " #44 pack1/X$A$B,\n" +
+ " #46 pack1/X$A$C,\n" +
+ " #40 pack1/X$Y,\n" +
" #48 pack1/X$Y$Z\n";
verifyClassFile(expectedPartialOutput, "pack1/X.class", ClassFileBytesDisassembler.SYSTEM);
}
@@ -208,7 +208,7 @@ public void testBug535851_005() throws Exception {
);
String expectedPartialOutput =
- "Nest Members:\n" +
+ "Nest Members:\n" +
" #33 pack1/X$1\n";
verifyClassFile(expectedPartialOutput, "pack1/X.class", ClassFileBytesDisassembler.SYSTEM);
@@ -250,8 +250,8 @@ public void testBug535851_006() throws Exception {
);
String expectedPartialOutput =
- "Nest Members:\n" +
- " #33 pack1/X$1,\n" +
+ "Nest Members:\n" +
+ " #33 pack1/X$1,\n" +
" #48 pack1/X$1$1\n";
verifyClassFile(expectedPartialOutput, "pack1/X.class", ClassFileBytesDisassembler.SYSTEM);
@@ -305,8 +305,8 @@ public void testBug535851_007() throws Exception {
);
String expectedPartialOutput =
- "Nest Members:\n" +
- " #44 pack1/X$1,\n" +
+ "Nest Members:\n" +
+ " #44 pack1/X$1,\n" +
" #77 pack1/X$1$1\n";
verifyClassFile(expectedPartialOutput, "pack1/X.class", ClassFileBytesDisassembler.SYSTEM);
@@ -344,7 +344,7 @@ public void testBug535851_008() throws Exception {
);
String expectedPartialOutput =
- "Nest Members:\n" +
+ "Nest Members:\n" +
" #15 pack1/X$1Y\n";
verifyClassFile(expectedPartialOutput, "pack1/X.class", ClassFileBytesDisassembler.SYSTEM);
@@ -430,7 +430,7 @@ public void testBug535918_001b() throws Exception {
String expectedPartialOutput = "getstatic pack1.X$Y.priv_int";
verifyClassFile(expectedPartialOutput, "pack1/X.class", ClassFileBytesDisassembler.SYSTEM);
- expectedPartialOutput = "Nest Members:\n" +
+ expectedPartialOutput = "Nest Members:\n" +
" #50 pack1/X$Y\n";
verifyClassFile(expectedPartialOutput, "pack1/X.class", ClassFileBytesDisassembler.SYSTEM);
expectedPartialOutput = "Nest Host: #25 pack1/X\n";
@@ -547,14 +547,14 @@ public void testBug535918_003a() throws Exception {
String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM);
String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM);
String XZFile = getClassFileContents("pack1/X$Z.class", ClassFileBytesDisassembler.SYSTEM);
- String partialOutput = "Nest Members:\n" +
- " #55 pack1/X$Y,\n" +
+ String partialOutput = "Nest Members:\n" +
+ " #55 pack1/X$Y,\n" +
" #17 pack1/X$Z";
verifyOutputPositive(XFile, partialOutput);
verifyOutputPositive(XYFile, "Nest Host: #22 pack1/X");
verifyOutputPositive(XZFile, "Nest Host: #26 pack1/X");
verifyOutputPositive(XZFile, "getstatic pack1.X$Y.priv_int");
-
+
verifyOutputNegative(XYFile, "access$");
verifyOutputNegative(XZFile, "invokestatic pack1.X$Y.access$0");
}
@@ -593,8 +593,8 @@ public void testBug535918_003b() throws Exception {
String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM);
String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM);
String XZFile = getClassFileContents("pack1/X$Z.class", ClassFileBytesDisassembler.SYSTEM);
- String partialOutput = "Nest Members:\n" +
- " #55 pack1/X$Y,\n" +
+ String partialOutput = "Nest Members:\n" +
+ " #55 pack1/X$Y,\n" +
" #17 pack1/X$Z";
verifyOutputPositive(XFile, partialOutput);
verifyOutputPositive(XYFile, "Nest Host: #21 pack1/X");
@@ -639,8 +639,8 @@ public void testBug535918_003c() throws Exception {
String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM);
String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM);
String XZFile = getClassFileContents("pack1/X$Z.class", ClassFileBytesDisassembler.SYSTEM);
- String partialOutput = "Nest Members:\n" +
- " #55 pack1/X$Y,\n" +
+ String partialOutput = "Nest Members:\n" +
+ " #55 pack1/X$Y,\n" +
" #17 pack1/X$Z";
verifyOutputPositive(XFile, partialOutput);
verifyOutputPositive(XYFile, "Nest Host: #21 pack1/X");
@@ -685,14 +685,14 @@ public void testBug535918_003d() throws Exception {
String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM);
String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM);
String XZFile = getClassFileContents("pack1/X$Z.class", ClassFileBytesDisassembler.SYSTEM);
- String partialOutput = "Nest Members:\n" +
- " #55 pack1/X$Y,\n" +
+ String partialOutput = "Nest Members:\n" +
+ " #55 pack1/X$Y,\n" +
" #17 pack1/X$Z";
verifyOutputPositive(XFile, partialOutput);
verifyOutputPositive(XYFile, "Nest Host: #22 pack1/X");
verifyOutputPositive(XZFile, "Nest Host: #24 pack1/X");
verifyOutputPositive(XZFile, "getstatic pack1.X$Y.priv_int");
-
+
verifyOutputNegative(XYFile, "access$");
verifyOutputNegative(XZFile, "invokestatic pack1.X$Y.access$0");
}
@@ -732,8 +732,8 @@ public void testBug535918_003e() throws Exception {
String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM);
String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM);
String XZFile = getClassFileContents("pack1/X$Z.class", ClassFileBytesDisassembler.SYSTEM);
- String partialOutput = "Nest Members:\n" +
- " #55 pack1/X$Y,\n" +
+ String partialOutput = "Nest Members:\n" +
+ " #55 pack1/X$Y,\n" +
" #17 pack1/X$Z";
verifyOutputPositive(XFile, partialOutput);
verifyOutputPositive(XYFile, "Nest Host: #21 pack1/X");
@@ -743,7 +743,7 @@ public void testBug535918_003e() throws Exception {
verifyOutputNegative(XYFile, "access$");
verifyOutputNegative(XZFile, "invokestatic pack1.X$Y.access$0");
}
-//sibling and super with super keyword: private instance field of a super-type is accessed from a sub-type
+//sibling and super with super keyword: private instance field of a super-type is accessed from a sub-type
// user keyword super with both super-type and sub-type being nestmates.
public void testBug535918_003f() throws Exception {
Map<String, String> options = getCompilerOptions();
@@ -778,8 +778,8 @@ public void testBug535918_003f() throws Exception {
String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM);
String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM);
String XZFile = getClassFileContents("pack1/X$Z.class", ClassFileBytesDisassembler.SYSTEM);
- String partialOutput = "Nest Members:\n" +
- " #56 pack1/X$Y,\n" +
+ String partialOutput = "Nest Members:\n" +
+ " #56 pack1/X$Y,\n" +
" #16 pack1/X$Z";
verifyOutputPositive(XFile, partialOutput);
verifyOutputPositive(XYFile, "Nest Host: #21 pack1/X");
@@ -819,15 +819,15 @@ public void testBug535918_004a() throws Exception {
String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM);
String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM);
- String partialOutput = "Nest Members:\n" +
+ String partialOutput = "Nest Members:\n" +
" #22 pack1/X$Y\n";
verifyOutputPositive(XFile, partialOutput);
verifyOutputPositive(XYFile, "Nest Host: #17 pack1/X");
verifyOutputPositive(XYFile, "getstatic pack1.X.priv_int");
-
+
verifyOutputNegative(XFile, "access$");
verifyOutputNegative(XFile, "invokestatic pack1.X.access$0()");
-
+
}
//vanilla field access of enclosing type: private instance field of enclosing type accessed in inner type
public void testBug535918_004b() throws Exception {
@@ -859,15 +859,15 @@ public void testBug535918_004b() throws Exception {
String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM);
String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM);
- String partialOutput = "Nest Members:\n" +
+ String partialOutput = "Nest Members:\n" +
" #20 pack1/X$Y\n";
verifyOutputPositive(XFile, partialOutput);
verifyOutputPositive(XYFile, "Nest Host: #22 pack1/X");
verifyOutputPositive(XYFile, "getfield pack1.X.priv_int");
-
+
verifyOutputNegative(XFile, "access$");
verifyOutputNegative(XYFile, "invokestatic pack1.X.access$0()");
-
+
}
//nestmate inner constructor call from outer - no synthetic and appropriate call site params
public void testBug535918_005a() throws Exception {
@@ -906,8 +906,8 @@ public void testBug535918_005a() throws Exception {
String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM);
String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM);
String XYZFile = getClassFileContents("pack1/X$Y$Z.class", ClassFileBytesDisassembler.SYSTEM);
- String partialOutput = "Nest Members:\n" +
- " #38 pack1/X$Y,\n" +
+ String partialOutput = "Nest Members:\n" +
+ " #38 pack1/X$Y,\n" +
" #42 pack1/X$Y$Z";
verifyOutputPositive(XFile, partialOutput);
verifyOutputPositive(XYFile, "Nest Host: #31 pack1/X");
@@ -954,8 +954,8 @@ public void testBug535918_005b() throws Exception {
String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM);
String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM);
String XZFile = getClassFileContents("pack1/X$Z.class", ClassFileBytesDisassembler.SYSTEM);
- String partialOutput = "Nest Members:\n" +
- " #38 pack1/X$Y,\n" +
+ String partialOutput = "Nest Members:\n" +
+ " #38 pack1/X$Y,\n" +
" #41 pack1/X$Z";
verifyOutputPositive(XFile, partialOutput);
verifyOutputPositive(XYFile, "Nest Host: #30 pack1/X");
@@ -1002,8 +1002,8 @@ public void testBug535918_005c() throws Exception {
String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM);
String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM);
String XYZFile = getClassFileContents("pack1/X$Y$Z.class", ClassFileBytesDisassembler.SYSTEM);
- String partialOutput = "Nest Members:\n" +
- " #38 pack1/X$Y,\n" +
+ String partialOutput = "Nest Members:\n" +
+ " #38 pack1/X$Y,\n" +
" #42 pack1/X$Y$Z";
verifyOutputPositive(XFile, partialOutput);
verifyOutputPositive(XYFile, "Nest Host: #24 pack1/X");
@@ -1046,8 +1046,8 @@ public void testBug535918_005d() throws Exception {
String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM);
String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM);
String XZFile = getClassFileContents("pack1/X$Z.class", ClassFileBytesDisassembler.SYSTEM);
- String partialOutput = "Nest Members:\n" +
- " #35 pack1/X$Y,\n" +
+ String partialOutput = "Nest Members:\n" +
+ " #35 pack1/X$Y,\n" +
" #38 pack1/X$Z";
verifyOutputPositive(XFile, partialOutput);
verifyOutputPositive(XYFile, "Nest Host: #22 pack1/X");
@@ -1057,7 +1057,7 @@ public void testBug535918_005d() throws Exception {
verifyOutputNegative(XYFile, "synthetic X$Y");
verifyOutputNegative(XZFile, "invokespecial pack1.X$Y(pack1.X, pack1.X$Y)");
}
-// nestmate super call to private constructor from sibling nestmate which is a subtype
+// nestmate super call to private constructor from sibling nestmate which is a subtype
// super is a parameterized type
public void testBug535918_005e() throws Exception {
Map<String, String> options = getCompilerOptions();
@@ -1094,8 +1094,8 @@ public void testBug535918_005e() throws Exception {
String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM);
String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM);
String XZFile = getClassFileContents("pack1/X$Z.class", ClassFileBytesDisassembler.SYSTEM);
- String partialOutput = "Nest Members:\n" +
- " #35 pack1/X$Y,\n" +
+ String partialOutput = "Nest Members:\n" +
+ " #35 pack1/X$Y,\n" +
" #38 pack1/X$Z";
verifyOutputPositive(XFile, partialOutput);
verifyOutputPositive(XYFile, "Nest Host: #24 pack1/X");
@@ -1105,7 +1105,7 @@ public void testBug535918_005e() throws Exception {
verifyOutputNegative(XYFile, "synthetic pack1.X$Y(pack1.X.Y arg0)");
verifyOutputNegative(XZFile, "2 invokespecial pack1.X$Y(pack1.X$Y)");
}
-//nestmate constructor reference
+//nestmate constructor reference
public void testBug535918_005f() throws Exception {
Map<String, String> options = getCompilerOptions();
options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11);
@@ -1145,7 +1145,7 @@ public void testBug535918_005f() throws Exception {
String XFile = getClassFileContents("X.class", ClassFileBytesDisassembler.SYSTEM);
String X1YFile = getClassFileContents("X$1Y.class", ClassFileBytesDisassembler.SYSTEM);
- String partialOutput = "Nest Members:\n" +
+ String partialOutput = "Nest Members:\n" +
" #8 X$1Y\n";
verifyOutputPositive(XFile, partialOutput);
verifyOutputPositive(X1YFile, "Nest Host: #33 X");
@@ -1374,8 +1374,8 @@ public void testBug535918_0056a() throws Exception {
String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM);
String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM);
String XYZFile = getClassFileContents("pack1/X$Y$Z.class", ClassFileBytesDisassembler.SYSTEM);
- String partialOutput = "Nest Members:\n" +
- " #20 pack1/X$Y,\n" +
+ String partialOutput = "Nest Members:\n" +
+ " #20 pack1/X$Y,\n" +
" #18 pack1/X$Y$Z";
verifyOutputPositive(XFile, partialOutput);
verifyOutputPositive(XYFile, "Nest Host: #3 pack1/X");
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286ReservedWordTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286ReservedWordTest.java
index 4ff3843f5..0a38ba3f9 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286ReservedWordTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286ReservedWordTest.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Jesper Steen Møller - initial API and implementation
*******************************************************************************/
@@ -39,10 +39,10 @@ public JEP286ReservedWordTest(String testName){
public void test0001_class_var_warning() throws IOException {
String classVar =
- " public class var { public int a; };\n";
+ " public class var { public int a; };\n";
String classX =
- "public class X {\n" +
+ "public class X {\n" +
classVar +
" +\n" +
"}\n";
@@ -51,7 +51,7 @@ public void test0001_class_var_warning() throws IOException {
"2. ERROR in X.java (at line 3)\n" +
" +\n" +
" ^\n" +
- "Syntax error on token \"+\", delete this token\n" +
+ "Syntax error on token \"+\", delete this token\n" +
"----------\n";
if (Long.compare(this.complianceLevel, ClassFileConstants.JDK10) >= 0) {
@@ -82,10 +82,10 @@ public void test0001_class_var_warning() throws IOException {
}
public void test0002_interface_var_warning() throws IOException {
String interfaceVar =
- " interface var { };\n";
+ " interface var { };\n";
String classX =
- "public class X {\n" +
+ "public class X {\n" +
interfaceVar +
" +\n" +
"}\n";
@@ -94,7 +94,7 @@ public void test0002_interface_var_warning() throws IOException {
"2. ERROR in X.java (at line 3)\n" +
" +\n" +
" ^\n" +
- "Syntax error on token \"+\", delete this token\n" +
+ "Syntax error on token \"+\", delete this token\n" +
"----------\n";
if (Long.compare(this.complianceLevel, ClassFileConstants.JDK10) >= 0) {
@@ -152,7 +152,7 @@ public void testBug530920a() throws IOException {
" <var extends Number> var getNumber() {\n" +
" return null;\n" +
" }\n" +
- "}"
+ "}"
},
Long.compare(this.complianceLevel, ClassFileConstants.JDK10) >= 0 ?
"----------\n" +
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286Test.java
index 466ee9ce1..995589e9b 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286Test.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286Test.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Jesper Steen Møller - initial API and implementation
*******************************************************************************/
@@ -71,7 +71,7 @@ static {
simpleTypeNames.put("CollectionSuperComparableAny", "Collection<? super Comparable<?>>");
if (isJRE12Plus)
simpleTypeNames.put("IntLongFloat", "java.lang.Number & Comparable<?> & java.lang.constant.Constable & java.lang.constant.ConstantDesc");
- else
+ else
simpleTypeNames.put("IntLongFloat", "java.lang.Number & Comparable<?>");
simpleTypeNames.put("ListTestAndSerializable", "List<? extends Z & java.io.Serializable>");
simpleTypeNames.put("TestAndSerializable", "Z & java.io.Serializable");
@@ -133,9 +133,9 @@ public void test0002_inferred_for() throws IOException {
"X.java",
"public class X {\n" +
" public static void main(String [] args) {\n" +
- " int sum = 0;\n" +
+ " int sum = 0;\n" +
" for(var n = 1; n <= 2; ++n) {\n" +
- " sum += n;\n" +
+ " sum += n;\n" +
" }\n" +
" System.out.println(\"SUCCESS \" + sum);\n" +
" }\n" +
@@ -149,9 +149,9 @@ public void test0003_inferred_enhanced_for() throws IOException {
"X.java",
"public class X {\n" +
" public static void main(String [] args) {\n" +
- " int sum = 0;\n" +
+ " int sum = 0;\n" +
" for(var n : java.util.List.of(1, 2)) {\n" +
- " sum += n;\n" +
+ " sum += n;\n" +
" }\n" +
" System.out.println(\"SUCCESS \" + sum);\n" +
" }\n" +
@@ -164,13 +164,13 @@ public void test0004_try_with_resources() throws IOException {
w.write("SUCCESS!\n");
System.out.println(w.toString());
}
-
+
this.runConformTest(
new String[] {
"X.java",
"public class X {\n" +
" public static void main(String [] args) throws Exception {\n" +
- " try(var w = new java.io.StringWriter()) {\n" +
+ " try(var w = new java.io.StringWriter()) {\n" +
" w.write(\"SUCCESS\\n\");" +
" System.out.println(w.toString());\n" +
" }\n" +
@@ -183,11 +183,11 @@ public void test0005_no_initializer() throws IOException {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] argv) {\n" +
- " var a;\n" +
- " for(var b;;);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] argv) {\n" +
+ " var a;\n" +
+ " for(var b;;);\n" +
+ " }\n" +
"}\n"
},
"----------\n" +
@@ -206,11 +206,11 @@ public void test0006_multiple_declarators() throws IOException {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] argv) {\n" +
- " var a = 1, b = 2;\n" +
- " for(var c = 1, d = 20; c<d; c++);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] argv) {\n" +
+ " var a = 1, b = 2;\n" +
+ " for(var c = 1, d = 20; c<d; c++);\n" +
+ " }\n" +
"}\n"
},
"----------\n" +
@@ -220,7 +220,7 @@ public void test0006_multiple_declarators() throws IOException {
"'var' is not allowed in a compound declaration\n" +
"----------\n" +
"2. ERROR in X.java (at line 4)\n" +
- " for(var c = 1, d = 20; c<d; c++);\n" +
+ " for(var c = 1, d = 20; c<d; c++);\n" +
" ^\n" +
"'var' is not allowed in a compound declaration\n" +
"----------\n");
@@ -229,13 +229,13 @@ public void test0007_var_in_wrong_place() throws IOException {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" private var someField = 0;\n" +
- " public var method() {\n" +
+ " public var method() {\n" +
" return null;\n" +
- " }\n" +
- " public void main(var arg) {\n" +
- " }\n" +
+ " }\n" +
+ " public void main(var arg) {\n" +
+ " }\n" +
"}\n"
},
"----------\n" +
@@ -245,12 +245,12 @@ public void test0007_var_in_wrong_place() throws IOException {
"'var' is not allowed here\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
- " public var method() {\n" +
+ " public var method() {\n" +
" ^^^\n" +
"'var' is not allowed here\n" +
"----------\n" +
"3. ERROR in X.java (at line 6)\n" +
- " public void main(var arg) {\n" +
+ " public void main(var arg) {\n" +
" ^^^\n" +
"'var' is not allowed here\n" +
"----------\n");
@@ -259,10 +259,10 @@ public void test0008_null_initializer() throws IOException {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" public void main(String[] arg) {\n" +
- " var notMuch = null;\n" +
- " }\n" +
+ " var notMuch = null;\n" +
+ " }\n" +
"}\n"
},
"----------\n" +
@@ -276,28 +276,28 @@ public void test0008_void_initializer() throws IOException {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" public void foo() {\n" +
" }\n" +
"\n" +
" public void baz() {\n" +
- " var nothingHere = foo();\n" +
- " }\n" +
+ " var nothingHere = foo();\n" +
+ " }\n" +
"}\n"
},
"----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " var nothingHere = foo();\n" +
- " ^^^^^^^^^^^\n" +
- "Variable initializer is 'void' -- cannot infer variable type\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " var nothingHere = foo();\n" +
+ " ^^^^^^^^^^^\n" +
+ "Variable initializer is 'void' -- cannot infer variable type\n" +
"----------\n");
}
public void test0009_var_as_type_name() throws IOException {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public enum var { V, A, R };\n" +
+ "public class X {\n" +
+ " public enum var { V, A, R };\n" +
"}\n"
},
"----------\n" +
@@ -311,10 +311,10 @@ public void test0010_array_initializer() throws IOException {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" public void main(String [] args) {\n" +
" var myArray = { 1, 2, 3 };\n" +
- " }\n" +
+ " }\n" +
"}\n"
},
"----------\n" +
@@ -328,11 +328,11 @@ public void test0011_array_type() throws IOException {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" public void main(String [] args) {\n" +
" var myArray[] = new int[42];\n" +
" var[] moreArray = new int[1337];\n" +
- " }\n" +
+ " }\n" +
"}\n"
},
"----------\n" +
@@ -348,29 +348,29 @@ public void test0011_array_type() throws IOException {
"----------\n");
}
public void test0012_self_reference() throws IOException {
-
+
// BTW: This will give a VerifyError: int a = ((java.util.concurrent.Callable<Integer>)(() -> true ? 1 : a)).call();
// The cases are tested. a is a simple case, with plain usage in the same scope. b is used in a nested scope.
// c and d are shadowed by the nested definitions.
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" public void main(String [] args) {\n" +
" var a = 42 + a;\n" +
" var b = ((java.util.concurrent.Callable<Integer>)(() -> true ? 1 : b)).call();\n" +
- " var c = new java.util.concurrent.Callable<Integer>() {\n" +
- " public Integer call() {\n" +
- " int c = 42; return c;\n" +
- " }\n" +
+ " var c = new java.util.concurrent.Callable<Integer>() {\n" +
+ " public Integer call() {\n" +
+ " int c = 42; return c;\n" +
+ " }\n" +
" }.call();" +
" var d = new java.util.concurrent.Callable<Integer>() {\n" +
" int d = 42;\n" +
- " public Integer call() {\n" +
- " return d;\n" +
- " }\n" +
+ " public Integer call() {\n" +
+ " return d;\n" +
+ " }\n" +
" }.call();" +
- " }\n" +
+ " }\n" +
"}\n"
},
"----------\n" +
@@ -399,10 +399,10 @@ public void test0013_lambda() throws IOException {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" public void main(String [] args) {\n" +
" var a = (int i) -> 42;\n" +
- " }\n" +
+ " }\n" +
"}\n"
},
"----------\n" +
@@ -416,10 +416,10 @@ public void test0014_method_reference() throws IOException {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" public void main(String [] args) {\n" +
" var a = X::main;\n" +
- " }\n" +
+ " }\n" +
"}\n"
},
"----------\n" +
@@ -430,14 +430,14 @@ public void test0014_method_reference() throws IOException {
"----------\n");
}
public void test0015_complain_over_first_poly_encountered() throws Exception {
-
+
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" public void main(String [] args) {\n" +
" var a = args.length > 1 ? X::main : (int i) -> 42;\n" +
- " }\n" +
+ " }\n" +
"}\n"
},
"----------\n" +
@@ -453,7 +453,7 @@ public void test0016_dont_capture_deep_poly_expressions() throws IOException {
"X.java",
"public class X {\n" +
" public static void main(String [] args) throws Exception {\n" +
- " var z = ((java.util.concurrent.Callable<String>)(() -> \"SUCCESS\"));\n" +
+ " var z = ((java.util.concurrent.Callable<String>)(() -> \"SUCCESS\"));\n" +
" var x = args.length > 1 ? \"FAILURE\" : z.call();\n" +
" System.out.println(x);\n" +
" }\n" +
@@ -470,26 +470,26 @@ public void test0017_simple_variable_types() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "import java.util.List;\n" +
- "\n" +
- "public class X {\n" +
- " void test() {\n" +
- " var i_String = \"\";\n" +
- " for (var i2_String = \"\" ; ; ) { break; }\n" +
- " for (var i2_String : iterableOfString()) { break; }\n" +
- " for (var i2_String : arrayOfString()) { break; }\n" +
- " try (var i2_Bar = new Bar()) { } finally { }\n" +
- " try (var i2_Bar = new Bar(); var i3_Bar = new Bar()) { } finally { }\n" +
- " }\n" +
- "\n" +
- " Iterable<String> iterableOfString() { return null; }\n" +
- " String[] arrayOfString() { return null; }\n" +
- "\n" +
- " static class Bar implements AutoCloseable {\n" +
- " @Override\n" +
- " public void close() { }\n" +
- " }\n" +
- "}\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class X {\n" +
+ " void test() {\n" +
+ " var i_String = \"\";\n" +
+ " for (var i2_String = \"\" ; ; ) { break; }\n" +
+ " for (var i2_String : iterableOfString()) { break; }\n" +
+ " for (var i2_String : arrayOfString()) { break; }\n" +
+ " try (var i2_Bar = new Bar()) { } finally { }\n" +
+ " try (var i2_Bar = new Bar(); var i3_Bar = new Bar()) { } finally { }\n" +
+ " }\n" +
+ "\n" +
+ " Iterable<String> iterableOfString() { return null; }\n" +
+ " String[] arrayOfString() { return null; }\n" +
+ "\n" +
+ " static class Bar implements AutoCloseable {\n" +
+ " @Override\n" +
+ " public void close() { }\n" +
+ " }\n" +
+ "}\n" +
"\n"
},
typeVerifier);
@@ -500,48 +500,48 @@ public void test0018_primitive_variable_types() throws Exception {
this.runConformTest(
new String[] {
"Y.java",
- "class Y {\n" +
- " boolean[] booleanArray = { true };\n" +
- " byte[] byteArray = { 1 };\n" +
- " char[] charArray = { 'c' };\n" +
- " short[] shortArray = { 42 };\n" +
- " int[] intArray = { 42 };\n" +
- " long[] longArray = { 42L };\n" +
- " float[] floatArray = { 0.1f };\n" +
- " double[] doubleArray = { 0.2d };\n" +
- "\n" +
- " void testBuiltins() {\n" +
- " var z_boolean = false;\n" +
- " var b_byte = (byte)0xff;\n" +
- " var c_char = 'c';\n" +
- " var s_short = (short)42;\n" +
- " var i_int = 42;\n" +
- " var l_long = 42L;\n" +
- " var f_float = 0.25f;\n" +
- " var d_double = 0.35d;\n" +
- " }\n" +
- "\n" +
- " void testBuiltinsForEach() {\n" +
- " for (var z_boolean : booleanArray) { System.out.print(\".\"); }\n" +
- " for (var b_byte : byteArray) { System.out.print(\".\"); }\n" +
- " for (var c_char : charArray) { System.out.print(\".\"); }\n" +
- " for (var s_short : shortArray) { System.out.print(\".\"); }\n" +
- " for (var i_int : intArray) { System.out.print(\".\"); }\n" +
- " for (var l_long : longArray) { System.out.print(\".\"); }\n" +
- " for (var f_float : floatArray) { System.out.print(\".\"); }\n" +
- " for (var d_double : doubleArray) { System.out.print(\".\"); }\n" +
- " }\n" +
- " void testBuiltinsArray() {\n" +
- " var z_booleanARRAY = booleanArray;\n" +
- " var b_byteARRAY = byteArray;\n" +
- " var c_charARRAY = charArray;\n" +
- " var s_shortARRAY = shortArray;\n" +
- " var i_intARRAY = intArray;\n" +
- " var l_longARRAY = longArray;\n" +
- " var f_floatARRAY = floatArray;\n" +
- " var d_doubleARRAY = doubleArray;\n" +
- " }\n" +
- "\n" +
+ "class Y {\n" +
+ " boolean[] booleanArray = { true };\n" +
+ " byte[] byteArray = { 1 };\n" +
+ " char[] charArray = { 'c' };\n" +
+ " short[] shortArray = { 42 };\n" +
+ " int[] intArray = { 42 };\n" +
+ " long[] longArray = { 42L };\n" +
+ " float[] floatArray = { 0.1f };\n" +
+ " double[] doubleArray = { 0.2d };\n" +
+ "\n" +
+ " void testBuiltins() {\n" +
+ " var z_boolean = false;\n" +
+ " var b_byte = (byte)0xff;\n" +
+ " var c_char = 'c';\n" +
+ " var s_short = (short)42;\n" +
+ " var i_int = 42;\n" +
+ " var l_long = 42L;\n" +
+ " var f_float = 0.25f;\n" +
+ " var d_double = 0.35d;\n" +
+ " }\n" +
+ "\n" +
+ " void testBuiltinsForEach() {\n" +
+ " for (var z_boolean : booleanArray) { System.out.print(\".\"); }\n" +
+ " for (var b_byte : byteArray) { System.out.print(\".\"); }\n" +
+ " for (var c_char : charArray) { System.out.print(\".\"); }\n" +
+ " for (var s_short : shortArray) { System.out.print(\".\"); }\n" +
+ " for (var i_int : intArray) { System.out.print(\".\"); }\n" +
+ " for (var l_long : longArray) { System.out.print(\".\"); }\n" +
+ " for (var f_float : floatArray) { System.out.print(\".\"); }\n" +
+ " for (var d_double : doubleArray) { System.out.print(\".\"); }\n" +
+ " }\n" +
+ " void testBuiltinsArray() {\n" +
+ " var z_booleanARRAY = booleanArray;\n" +
+ " var b_byteARRAY = byteArray;\n" +
+ " var c_charARRAY = charArray;\n" +
+ " var s_shortARRAY = shortArray;\n" +
+ " var i_intARRAY = intArray;\n" +
+ " var l_longARRAY = longArray;\n" +
+ " var f_floatARRAY = floatArray;\n" +
+ " var d_doubleARRAY = doubleArray;\n" +
+ " }\n" +
+ "\n" +
"}\n"
},
typeVerifier);
@@ -552,106 +552,106 @@ public void test0018_project_variable_types() throws Exception {
this.runConformTest(
new String[] {
"Z.java",
- "import java.util.Collection;\n" +
- "import java.util.List;\n" +
- "import java.io.Serializable;\n" +
- "\n" +
- "class Z {\n" +
- "\n" +
- " void testExtends() {\n" +
- " var l1_CollectionOfExtString = extendsString();\n" +
- " for (var l2_CollectionOfExtString = extendsString() ; ; ) { break; }\n" +
- " for (var l3_CollectionOfExtString : extendsStringArr()) { break; }\n" +
- " for (var l4_CollectionOfExtString : extendsCollectionIterable()) { break; }\n" +
- " for (var l5_String : extendsString()) { break; }\n" +
- " }\n" +
- "\n" +
- " void testExtendsFbound() { \n" +
- " var l1_CollectionExt_ComparableAny = extendsTBound();\n" +
- " for (var l2_CollectionExt_ComparableAny = extendsTBound() ; ; ) { break; }\n" +
- " for (var l3_CollectionExt_ComparableAny : extendsTBoundArray()) { break; }\n" +
- " for (var l3_CollectionExt_ComparableAny : extendsTBoundIter()) { break; }\n" +
- " for (var l4_ComparableAny : extendsTBound()) { break; }\n" +
- " }\n" +
- "\n" +
- " void testSuperTBound() {\n" +
- " var s_CollectionAny = superTBound();\n" +
- " for (var s2_CollectionAny = superTBound() ; ; ) { break; }\n" +
- " for (var s2_CollectionAny : superTBoundArray()) { break; }\n" +
- " for (var s2_CollectionAny : superTBoundIter()) { break; }\n" +
- " for (var s2_Object : superTBound()) { break; }\n" +
- " }\n" +
- "\n" +
- " void testCollectSuper() {\n" +
- " var s_CollectionOfSuperString = superString();\n" +
- " for (var s2_CollectionOfSuperString = superString() ; ; ) { break; }\n" +
- " for (var s2_CollectionOfSuperString : superStringArray()) { break; }\n" +
- " for (var s2_CollectionOfSuperString : superCollectionIterable()) { break; }\n" +
- " for (var s2_Object : superString()) { break; }\n" +
- " }\n" +
- "\n" +
- " void testUnbound() {\n" +
- " var s_CollectionAny = unboundedString();\n" +
- " for (var s2_CollectionAny = unboundedString() ; ; ) { break; }\n" +
- " for (var s2_CollectionAny : unboundedStringArray()) { break; }\n" +
- " for (var s2_CollectionAny : unboundedCollectionIterable()) { break; }\n" +
- " for (var s2_Object : unboundedString()) { break; }\n" +
- " }\n" +
- "\n" +
- " void testTypeOfAnAnonymousClass() {\n" +
- " var o_AnonymousObjectSubclass = new Object() { };\n" +
- " for (var s2_AnonymousObjectSubclass = new Object() { } ; ; ) { break; }\n" +
- " for (var s2_AnonymousObjectSubclass : arrayOf(new Object() { })) { break; }\n" +
- " for (var s2_AnonymousObjectSubclass : listOf(new Object() { })) { break; }\n" +
- " }\n" +
- "\n" +
- " void testTypeOfAnAnonymousInterface() {\n" +
- " var r_AnonymousRunnableSubclass = new Runnable() { public void run() { } };\n" +
- " for (var s2_AnonymousRunnableSubclass = new Runnable() { public void run() { } } ; ; ) { break; }\n" +
- " for (var s2_AnonymousRunnableSubclass : arrayOf(new Runnable() { public void run() { } })) { break; }\n" +
- " for (var s2_AnonymousRunnableSubclass : listOf(new Runnable() { public void run() { } })) { break; }\n" +
- " }\n" +
- "\n" +
- " void testTypeOfIntersectionType() {\n" +
- " var c_IntLongFloat = choose(1, 1L);\n" +
- " for (var s2_IntLongFloat = choose(1, 1L) ; ;) { break; }\n" +
- " for (var s2_IntLongFloat : arrayOf(choose(1, 1L))) { break; }\n" +
- " for (var s2_IntLongFloat : listOf(choose(1, 1L))) { break; }\n" +
- " }\n" +
- "\n" +
- " public void testProjections() {\n" +
- " var inter_ListTestAndSerializable = getIntersections();\n" +
- " var r_TestAndSerializable = inter_ListTestAndSerializable.get(0);\n" +
- " }\n" +
- "\n" +
- " Collection<? extends String> extendsString() { return null; }\n" +
- " Collection<? super String> superString() { return null; }\n" +
- " Collection<?> unboundedString() { return null; }\n" +
- "\n" +
- " Collection<? extends String>[] extendsStringArr() { return null; }\n" +
- " Collection<? super String>[] superStringArray() { return null; }\n" +
- " Collection<?>[] unboundedStringArray() { return null; }\n" +
- "\n" +
- " Iterable<? extends Collection<? extends String>> extendsCollectionIterable() { return null; }\n" +
- " Iterable<? extends Collection<? super String>> superCollectionIterable() { return null; }\n" +
- " Iterable<? extends Collection<?>> unboundedCollectionIterable() { return null; }\n" +
- "\n" +
- " <TBound extends Comparable<TBound>> Collection<? extends TBound> extendsTBound() { return null; }\n" +
- " <TBound extends Comparable<TBound>> Collection<? super TBound> superTBound() { return null; }\n" +
- "\n" +
- " <TBound extends Comparable<TBound>> Collection<? extends TBound>[] extendsTBoundArray() { return null; }\n" +
- " <TBound extends Comparable<TBound>> Collection<? super TBound>[] superTBoundArray() { return null; }\n" +
- "\n" +
- " <TBound extends Comparable<TBound>> Iterable<? extends Collection<? extends TBound>> extendsTBoundIter() { return null; }\n" +
- " <TBound extends Comparable<TBound>> Iterable<? extends Collection<? super TBound>> superTBoundIter() { return null; }\n" +
- "\n" +
- " <TBound> Collection<TBound> listOf(TBound b) { return null; }\n" +
- " <TBound> TBound[] arrayOf(TBound b) { return null; }\n" +
- "\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.List;\n" +
+ "import java.io.Serializable;\n" +
+ "\n" +
+ "class Z {\n" +
+ "\n" +
+ " void testExtends() {\n" +
+ " var l1_CollectionOfExtString = extendsString();\n" +
+ " for (var l2_CollectionOfExtString = extendsString() ; ; ) { break; }\n" +
+ " for (var l3_CollectionOfExtString : extendsStringArr()) { break; }\n" +
+ " for (var l4_CollectionOfExtString : extendsCollectionIterable()) { break; }\n" +
+ " for (var l5_String : extendsString()) { break; }\n" +
+ " }\n" +
+ "\n" +
+ " void testExtendsFbound() { \n" +
+ " var l1_CollectionExt_ComparableAny = extendsTBound();\n" +
+ " for (var l2_CollectionExt_ComparableAny = extendsTBound() ; ; ) { break; }\n" +
+ " for (var l3_CollectionExt_ComparableAny : extendsTBoundArray()) { break; }\n" +
+ " for (var l3_CollectionExt_ComparableAny : extendsTBoundIter()) { break; }\n" +
+ " for (var l4_ComparableAny : extendsTBound()) { break; }\n" +
+ " }\n" +
+ "\n" +
+ " void testSuperTBound() {\n" +
+ " var s_CollectionAny = superTBound();\n" +
+ " for (var s2_CollectionAny = superTBound() ; ; ) { break; }\n" +
+ " for (var s2_CollectionAny : superTBoundArray()) { break; }\n" +
+ " for (var s2_CollectionAny : superTBoundIter()) { break; }\n" +
+ " for (var s2_Object : superTBound()) { break; }\n" +
+ " }\n" +
+ "\n" +
+ " void testCollectSuper() {\n" +
+ " var s_CollectionOfSuperString = superString();\n" +
+ " for (var s2_CollectionOfSuperString = superString() ; ; ) { break; }\n" +
+ " for (var s2_CollectionOfSuperString : superStringArray()) { break; }\n" +
+ " for (var s2_CollectionOfSuperString : superCollectionIterable()) { break; }\n" +
+ " for (var s2_Object : superString()) { break; }\n" +
+ " }\n" +
+ "\n" +
+ " void testUnbound() {\n" +
+ " var s_CollectionAny = unboundedString();\n" +
+ " for (var s2_CollectionAny = unboundedString() ; ; ) { break; }\n" +
+ " for (var s2_CollectionAny : unboundedStringArray()) { break; }\n" +
+ " for (var s2_CollectionAny : unboundedCollectionIterable()) { break; }\n" +
+ " for (var s2_Object : unboundedString()) { break; }\n" +
+ " }\n" +
+ "\n" +
+ " void testTypeOfAnAnonymousClass() {\n" +
+ " var o_AnonymousObjectSubclass = new Object() { };\n" +
+ " for (var s2_AnonymousObjectSubclass = new Object() { } ; ; ) { break; }\n" +
+ " for (var s2_AnonymousObjectSubclass : arrayOf(new Object() { })) { break; }\n" +
+ " for (var s2_AnonymousObjectSubclass : listOf(new Object() { })) { break; }\n" +
+ " }\n" +
+ "\n" +
+ " void testTypeOfAnAnonymousInterface() {\n" +
+ " var r_AnonymousRunnableSubclass = new Runnable() { public void run() { } };\n" +
+ " for (var s2_AnonymousRunnableSubclass = new Runnable() { public void run() { } } ; ; ) { break; }\n" +
+ " for (var s2_AnonymousRunnableSubclass : arrayOf(new Runnable() { public void run() { } })) { break; }\n" +
+ " for (var s2_AnonymousRunnableSubclass : listOf(new Runnable() { public void run() { } })) { break; }\n" +
+ " }\n" +
+ "\n" +
+ " void testTypeOfIntersectionType() {\n" +
+ " var c_IntLongFloat = choose(1, 1L);\n" +
+ " for (var s2_IntLongFloat = choose(1, 1L) ; ;) { break; }\n" +
+ " for (var s2_IntLongFloat : arrayOf(choose(1, 1L))) { break; }\n" +
+ " for (var s2_IntLongFloat : listOf(choose(1, 1L))) { break; }\n" +
+ " }\n" +
+ "\n" +
+ " public void testProjections() {\n" +
+ " var inter_ListTestAndSerializable = getIntersections();\n" +
+ " var r_TestAndSerializable = inter_ListTestAndSerializable.get(0);\n" +
+ " }\n" +
+ "\n" +
+ " Collection<? extends String> extendsString() { return null; }\n" +
+ " Collection<? super String> superString() { return null; }\n" +
+ " Collection<?> unboundedString() { return null; }\n" +
+ "\n" +
+ " Collection<? extends String>[] extendsStringArr() { return null; }\n" +
+ " Collection<? super String>[] superStringArray() { return null; }\n" +
+ " Collection<?>[] unboundedStringArray() { return null; }\n" +
+ "\n" +
+ " Iterable<? extends Collection<? extends String>> extendsCollectionIterable() { return null; }\n" +
+ " Iterable<? extends Collection<? super String>> superCollectionIterable() { return null; }\n" +
+ " Iterable<? extends Collection<?>> unboundedCollectionIterable() { return null; }\n" +
+ "\n" +
+ " <TBound extends Comparable<TBound>> Collection<? extends TBound> extendsTBound() { return null; }\n" +
+ " <TBound extends Comparable<TBound>> Collection<? super TBound> superTBound() { return null; }\n" +
+ "\n" +
+ " <TBound extends Comparable<TBound>> Collection<? extends TBound>[] extendsTBoundArray() { return null; }\n" +
+ " <TBound extends Comparable<TBound>> Collection<? super TBound>[] superTBoundArray() { return null; }\n" +
+ "\n" +
+ " <TBound extends Comparable<TBound>> Iterable<? extends Collection<? extends TBound>> extendsTBoundIter() { return null; }\n" +
+ " <TBound extends Comparable<TBound>> Iterable<? extends Collection<? super TBound>> superTBoundIter() { return null; }\n" +
+ "\n" +
+ " <TBound> Collection<TBound> listOf(TBound b) { return null; }\n" +
+ " <TBound> TBound[] arrayOf(TBound b) { return null; }\n" +
+ "\n" +
" <TBound> TBound choose(TBound b1, TBound b2) { return b1; }\n" +
- " <T extends Z & Serializable> List<? extends T> getIntersections() {\n" +
- " return null;\n" +
- " }\n" +
+ " <T extends Z & Serializable> List<? extends T> getIntersections() {\n" +
+ " return null;\n" +
+ " }\n" +
"}"
},
typeVerifier);
@@ -690,11 +690,11 @@ public void testBug530879() throws IOException {
" for (var v : foo()) { }\n" +
" ^\n" +
"Variable initializer is 'void' -- cannot infer variable type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " for (var v : foo()) { }\n" +
- " ^^^^^\n" +
- "Can only iterate over an array or an instance of java.lang.Iterable\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " for (var v : foo()) { }\n" +
+ " ^^^^^\n" +
+ "Can only iterate over an array or an instance of java.lang.Iterable\n" +
"----------\n");
}
public void testBug530879a() throws IOException {
@@ -712,25 +712,25 @@ public void testBug530879a() throws IOException {
" for (var v : null) { }\n" +
" ^\n" +
"Cannot infer type for local variable initialized to 'null'\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " for (var v : null) { }\n" +
- " ^^^^\n" +
- "Can only iterate over an array or an instance of java.lang.Iterable\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " for (var v : null) { }\n" +
+ " ^^^^\n" +
+ "Can only iterate over an array or an instance of java.lang.Iterable\n" +
"----------\n");
}
public void testBug532349() throws IOException {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void foo(Boolean p) {\n" +
- " Y<? super Boolean> y = new Y<>();\n" +
- " var v = y;\n" +
- " Y<? super Boolean> tmp = v;\n" +
- " }\n" +
- "}\n" +
- "class Y<T extends Boolean> {\n" +
+ "public class X {\n" +
+ " public static void foo(Boolean p) {\n" +
+ " Y<? super Boolean> y = new Y<>();\n" +
+ " var v = y;\n" +
+ " Y<? super Boolean> tmp = v;\n" +
+ " }\n" +
+ "}\n" +
+ "class Y<T extends Boolean> {\n" +
"}"
});
}
@@ -740,15 +740,15 @@ public void testBug532349a() throws IOException {
"X.java",
"import java.util.List;\n" +
"import java.util.ArrayList;\n" +
- "public class X {\n" +
- " public static void foo(Boolean p) {\n" +
- " List<Y<? super Boolean>> l = new ArrayList<>();\n" +
- " var dlv = l;\n" +
- " for (var iv : dlv) {\n" +
- " Y<? super Boolean> id = iv;\n" +
+ "public class X {\n" +
+ " public static void foo(Boolean p) {\n" +
+ " List<Y<? super Boolean>> l = new ArrayList<>();\n" +
+ " var dlv = l;\n" +
+ " for (var iv : dlv) {\n" +
+ " Y<? super Boolean> id = iv;\n" +
" }" +
- " }\n" +
- "}\n" +
+ " }\n" +
+ "}\n" +
"class Y<T extends Boolean> {}"
});
}
@@ -756,16 +756,16 @@ public void testBug532349b() throws IOException {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void foo(Boolean p) {\n" +
- " Y<? super Boolean> y = new Y<>();\n" +
- " try (var v = y) {\n" +
+ "public class X {\n" +
+ " public static void foo(Boolean p) {\n" +
+ " Y<? super Boolean> y = new Y<>();\n" +
+ " try (var v = y) {\n" +
" Y<? super Boolean> tmp = v;\n" +
" } catch (Exception e) { }\n" +
- " }\n" +
- "}\n" +
+ " }\n" +
+ "}\n" +
"class Y<T extends Boolean> implements AutoCloseable {\n" +
- " @Override\n" +
+ " @Override\n" +
" public void close() throws Exception {}\n" +
"}"
});
@@ -774,14 +774,14 @@ public void testBug532351() throws IOException {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void foo(Boolean p) {\n" +
- " Y<? super Number> y = new Y<Number>(); // Javac reports, ECJ accepts\n" +
- " var v = y;\n" +
- " Y<? super Number> tmp = v;\n" +
- " }\n" +
- " class Y<T extends Number> {\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void foo(Boolean p) {\n" +
+ " Y<? super Number> y = new Y<Number>(); // Javac reports, ECJ accepts\n" +
+ " var v = y;\n" +
+ " Y<? super Number> tmp = v;\n" +
+ " }\n" +
+ " class Y<T extends Number> {\n" +
+ " }\n" +
"}"
},
"----------\n" +
@@ -832,36 +832,36 @@ public void testBug531025() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " @AnnM var vm = strings;\n" +
- " ^^^^^\n" +
- "The annotation @AnnM is disallowed for this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " @AnnT var vt = \"\";\n" +
- " ^^^^^\n" +
- "The annotation @AnnT is disallowed for this location\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " for (@AnnT var fvt : strings) {}\n" +
- " ^^^^^\n" +
- "The annotation @AnnT is disallowed for this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " @AnnM var vm = strings;\n" +
+ " ^^^^^\n" +
+ "The annotation @AnnM is disallowed for this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " @AnnT var vt = \"\";\n" +
+ " ^^^^^\n" +
+ "The annotation @AnnT is disallowed for this location\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " for (@AnnT var fvt : strings) {}\n" +
+ " ^^^^^\n" +
+ "The annotation @AnnT is disallowed for this location\n" +
"----------\n");
}
public void testBug532349_001() throws IOException {
this.runConformTest(
new String[] {
"X.java",
- "class X {\n" +
- " public static void foo() {\n" +
- " Y<? extends Number> y = new Y<>();\n" +
- " var v = y.t;\n" +
- " Integer dsbType0 = v;\n" +
- " }\n" +
- "}\n" +
- "class Y<T extends Integer> {\n" +
- " public T t;\n" +
+ "class X {\n" +
+ " public static void foo() {\n" +
+ " Y<? extends Number> y = new Y<>();\n" +
+ " var v = y.t;\n" +
+ " Integer dsbType0 = v;\n" +
+ " }\n" +
+ "}\n" +
+ "class Y<T extends Integer> {\n" +
+ " public T t;\n" +
"}"
});
}
@@ -869,16 +869,16 @@ public void testBug532349_002() throws IOException {
this.runConformTest(
new String[] {
"X.java",
- "class X {\n" +
- " public static void foo() {\n" +
- " Y<? extends I> y = new Y<>();\n" +
- " var v = y.t;\n" +
- " Integer dsbType0 = v;\n" +
- " }\n" +
- "}\n" +
+ "class X {\n" +
+ " public static void foo() {\n" +
+ " Y<? extends I> y = new Y<>();\n" +
+ " var v = y.t;\n" +
+ " Integer dsbType0 = v;\n" +
+ " }\n" +
+ "}\n" +
"interface I { }\n" +
- "class Y<T extends Integer> {\n" +
- " public T t;\n" +
+ "class Y<T extends Integer> {\n" +
+ " public T t;\n" +
"}"
});
}
@@ -886,16 +886,16 @@ public void testBug532349_003() throws IOException {
this.runConformTest(
new String[] {
"X.java",
- "class X {\n" +
- " public static void foo(Y<? extends I> y) {\n" +
- " var v = y.t;\n" +
+ "class X {\n" +
+ " public static void foo(Y<? extends I> y) {\n" +
+ " var v = y.t;\n" +
" Integer dsbType0 = v;\n" +
" I i = v;\n" +
- " }\n" +
- "}\n" +
+ " }\n" +
+ "}\n" +
"interface I { }\n" +
- "class Y<T extends Integer> {\n" +
- " public T t;\n" +
+ "class Y<T extends Integer> {\n" +
+ " public T t;\n" +
"}"
});
}
@@ -904,16 +904,16 @@ public void testBug532349_004() throws IOException {
new String[] {
"X.java",
"import java.io.Serializable;\n" +
- "class X {\n" +
- " public static void foo() {\n" +
- " Y<? extends Integer> y = new Y<>();\n" +
- " var v = y.t;\n" +
+ "class X {\n" +
+ " public static void foo() {\n" +
+ " Y<? extends Integer> y = new Y<>();\n" +
+ " var v = y.t;\n" +
" Integer dsbType0 = v;\n" +
" Serializable s = v;\n" +
- " }\n" +
- "}\n" +
- "class Y<T extends Number&Serializable> {\n" +
- " public T t;\n" +
+ " }\n" +
+ "}\n" +
+ "class Y<T extends Number&Serializable> {\n" +
+ " public T t;\n" +
"}"
});
}
@@ -922,17 +922,17 @@ public void testBug532349_005() throws IOException {
new String[] {
"X.java",
"import java.io.Serializable;\n" +
- "class X {\n" +
- " public static void foo() {\n" +
- " Y<?> y = new Y<>();\n" +
- " var v = y.t;\n" +
+ "class X {\n" +
+ " public static void foo() {\n" +
+ " Y<?> y = new Y<>();\n" +
+ " var v = y.t;\n" +
" I i = v;\n" +
" Serializable s = v;\n" +
- " }\n" +
- "}\n" +
+ " }\n" +
+ "}\n" +
"interface I { }\n" +
- "class Y<T extends I&Serializable> {\n" +
- " public T t;\n" +
+ "class Y<T extends I&Serializable> {\n" +
+ " public T t;\n" +
"}"
});
}
@@ -941,17 +941,17 @@ public void testBug532349_006() throws IOException {
new String[] {
"X.java",
"import java.io.Serializable;\n" +
- "class X {\n" +
- " public static void foo() {\n" +
- " Y<? extends I> y = new Y<>();\n" +
- " var v = y.t;\n" +
+ "class X {\n" +
+ " public static void foo() {\n" +
+ " Y<? extends I> y = new Y<>();\n" +
+ " var v = y.t;\n" +
" I i = v;\n" +
" Serializable s = v;\n" +
- " }\n" +
- "}\n" +
+ " }\n" +
+ "}\n" +
"interface I { }\n" +
- "class Y<T extends Serializable> {\n" +
- " public T t;\n" +
+ "class Y<T extends Serializable> {\n" +
+ " public T t;\n" +
"}",
});
}
@@ -959,20 +959,20 @@ public void testBug532349_007() throws IOException {
this.runConformTest(
new String[] {
"X.java",
- "class X {\n" +
- " public static void foo() {\n" +
- " Z<? extends I> z = new Z<>();\n" +
- " var v = z.t;\n" +
+ "class X {\n" +
+ " public static void foo() {\n" +
+ " Z<? extends I> z = new Z<>();\n" +
+ " var v = z.t;\n" +
" X x = v.t;\n" +
" v.doSomething();\n" +
- " }\n" +
- "}\n" +
+ " }\n" +
+ "}\n" +
"interface I { void doSomething();}\n" +
- "class Z<T extends Y<?>> {\n" +
- " public T t;\n" +
+ "class Z<T extends Y<?>> {\n" +
+ " public T t;\n" +
"}\n" +
- "class Y<T extends X> {\n" +
- " public T t;\n" +
+ "class Y<T extends X> {\n" +
+ " public T t;\n" +
"}",
});
}
@@ -980,21 +980,21 @@ public void testBug532349_008() throws IOException {
this.runConformTest(
new String[] {
"X.java",
- "class X {\n" +
- " public static void foo() {\n" +
- " Z<? extends Y<? extends C>> z = new Z<>();\n" +
- " var v = z.t;\n" +
+ "class X {\n" +
+ " public static void foo() {\n" +
+ " Z<? extends Y<? extends C>> z = new Z<>();\n" +
+ " var v = z.t;\n" +
" C c = v.t;\n" +
" v.doSomething();\n" +
- " }\n" +
- "}\n" +
+ " }\n" +
+ "}\n" +
"interface I { void doSomething();}\n" +
"class C extends X{ }\n" +
- "class Z<T extends I> {\n" +
- " public T t;\n" +
+ "class Z<T extends I> {\n" +
+ " public T t;\n" +
"}\n" +
- "class Y<T extends X> {\n" +
- " public T t;\n" +
+ "class Y<T extends X> {\n" +
+ " public T t;\n" +
"}",
});
}
@@ -1003,25 +1003,25 @@ public void testBug532349_009() throws IOException {
new String[] {
"X.java",
"import java.io.Serializable;\n" +
- "class X {\n" +
- " public static void foo() {\n" +
- " Y<? super J> y = new Y<>();\n" +
- " var v = y.t;\n" +
+ "class X {\n" +
+ " public static void foo() {\n" +
+ " Y<? super J> y = new Y<>();\n" +
+ " var v = y.t;\n" +
" I i = v;\n" +
" Serializable s = v;\n" +
- " }\n" +
- "}\n" +
+ " }\n" +
+ "}\n" +
"interface I { }\n" +
"interface J extends I{}" +
- "class Y<T extends I> {\n" +
- " public T t;\n" +
+ "class Y<T extends I> {\n" +
+ " public T t;\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " Serializable s = v;\n" +
- " ^\n" +
- "Type mismatch: cannot convert from I to Serializable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " Serializable s = v;\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from I to Serializable\n" +
"----------\n");
}
public void testBug532349_010() throws IOException {
@@ -1029,13 +1029,13 @@ public void testBug532349_010() throws IOException {
new String[] {
"X.java",
"import java.io.Serializable;\n" +
- "class X {\n" +
- " public static void foo(C<?> c) {\n" +
- " var v = c.t;\n" +
+ "class X {\n" +
+ " public static void foo(C<?> c) {\n" +
+ " var v = c.t;\n" +
" v = (I&Serializable) new D();\n" +
" v.doSomething();\n" +
- " }\n" +
- "}\n" +
+ " }\n" +
+ "}\n" +
"interface I { void doSomething();}\n" +
"class C<T extends I&Serializable>{ T t;}\n" +
"class D implements I, Serializable { public void doSomething() {} }\n"
@@ -1046,15 +1046,15 @@ public void testBug532349_11() throws IOException {
new String[] {
"X.java",
"class X {\n" +
- " static <R extends D<? extends Y>> W<? extends R> boo() {\n" +
- " return null;\n" +
+ " static <R extends D<? extends Y>> W<? extends R> boo() {\n" +
+ " return null;\n" +
" }\n" +
- " public static void foo() {\n" +
- " var v = boo();\n" +
+ " public static void foo() {\n" +
+ " var v = boo();\n" +
" var var = v.t;\n" +
" Y y = var.r;\n" +
- " }\n" +
- "}\n" +
+ " }\n" +
+ "}\n" +
"class Y extends X { }\n" +
"class D<R extends X>{ R r;}\n" +
"class W<T extends D<?>> { T t; }\n"
@@ -1065,12 +1065,12 @@ public void testBug532349_12() throws IOException {
new String[] {
"X.java",
"class X {\n" +
- " public static void foo(D<?> d) {\n" +
- " var v = d;\n" +
+ " public static void foo(D<?> d) {\n" +
+ " var v = d;\n" +
" D<? extends Y> dy = v;\n" +
" D<? extends X> dx = v;\n" +
- " }\n" +
- "}\n" +
+ " }\n" +
+ "}\n" +
"class Y extends X{ }\n" +
"class D<R extends Y>{ R r;}\n"
});
@@ -1080,12 +1080,12 @@ public void testBug532349_13() throws IOException {
new String[] {
"X.java",
"class X {\n" +
- " public static void foo(D<Y<? extends Integer>> d) {\n" +
- " var v = d.r;\n" +
+ " public static void foo(D<Y<? extends Integer>> d) {\n" +
+ " var v = d.r;\n" +
" Y<? extends Number> yn = v;\n" +
" Y<? extends Integer> yi = v;\n" +
- " }\n" +
- "}\n" +
+ " }\n" +
+ "}\n" +
"class Y<T extends Integer>{ }\n" +
"class D<R extends Y<? extends Number>>{ R r;}\n"
});
@@ -1095,23 +1095,23 @@ public void testBug532349_14() throws IOException {
new String[] {
"X.java",
"class X {\n" +
- " public static void foo(A<? super C> ac) {\n" +
- " C c = new C(100);\n" +
- " var c1 = ac;\n" +
- " A<? super C> a1 = c1;\n" +
+ " public static void foo(A<? super C> ac) {\n" +
+ " C c = new C(100);\n" +
+ " var c1 = ac;\n" +
+ " A<? super C> a1 = c1;\n" +
" A<? super C> a2 = new A<B>(new B());\n" +
" a2 = c1;\n" +
- " }\n" +
- "}\n" +
- "class C<T> extends B{\n" +
- " T t;\n" +
- " C(T t) {\n" +
- " this.t = t;\n" +
- " }\n" +
- "}\n" +
- "class B { }\n" +
- "class A<Q> {\n" +
- " A(Q e) {}\n" +
+ " }\n" +
+ "}\n" +
+ "class C<T> extends B{\n" +
+ " T t;\n" +
+ " C(T t) {\n" +
+ " this.t = t;\n" +
+ " }\n" +
+ "}\n" +
+ "class B { }\n" +
+ "class A<Q> {\n" +
+ " A(Q e) {}\n" +
"}"
});
}
@@ -1120,43 +1120,43 @@ public void testBug532349_15() throws IOException {
new String[] {
"X.java",
"public class X {\n" +
- " public static <T> A<T> m(T t) {\n" +
- " return new A(t);\n" +
- " }\n" +
- " public static <U extends I1<?>> A<? extends U> m2(A<? super U> u) {\n" +
- " return new A(u);\n" +
- " }\n" +
- " public static void main(String argv[]) {\n" +
- " A<?> checkValue1 = new C(10);\n" +
- " var varValue = m2(m(checkValue1));\n" +
- " if(!varValue.t.t.equals(10)) {\n" +
- " System.out.println(\"Error:\");\n" +
- " }\n" +
- " if(varValue.t.methodOnI1() != true) {\n" +
- " System.out.println(\"Error:\");\n" +
- " }\n" +
- " }" +
- "}\n" +
- "class A<E> {\n" +
- " E t;\n" +
- " A(E t) {\n" +
- " this.t = t;\n" +
- " }\n" +
- " A<E> u;\n" +
- " A (A<E> u) {\n" +
- " this(u.t);\n" +
- " this.u = u;\n" +
- " }\n" +
- "}\n" +
- "interface I1<E> {\n" +
- " default boolean methodOnI1() {\n" +
- " return true;\n" +
- " }\n" +
+ " public static <T> A<T> m(T t) {\n" +
+ " return new A(t);\n" +
+ " }\n" +
+ " public static <U extends I1<?>> A<? extends U> m2(A<? super U> u) {\n" +
+ " return new A(u);\n" +
+ " }\n" +
+ " public static void main(String argv[]) {\n" +
+ " A<?> checkValue1 = new C(10);\n" +
+ " var varValue = m2(m(checkValue1));\n" +
+ " if(!varValue.t.t.equals(10)) {\n" +
+ " System.out.println(\"Error:\");\n" +
+ " }\n" +
+ " if(varValue.t.methodOnI1() != true) {\n" +
+ " System.out.println(\"Error:\");\n" +
+ " }\n" +
+ " }" +
+ "}\n" +
+ "class A<E> {\n" +
+ " E t;\n" +
+ " A(E t) {\n" +
+ " this.t = t;\n" +
+ " }\n" +
+ " A<E> u;\n" +
+ " A (A<E> u) {\n" +
+ " this(u.t);\n" +
+ " this.u = u;\n" +
+ " }\n" +
"}\n" +
- "class C<T> extends A implements I1 {\n" +
- " C(T t) {\n" +
- " super(t);\n" +
- " }\n" +
+ "interface I1<E> {\n" +
+ " default boolean methodOnI1() {\n" +
+ " return true;\n" +
+ " }\n" +
+ "}\n" +
+ "class C<T> extends A implements I1 {\n" +
+ " C(T t) {\n" +
+ " super(t);\n" +
+ " }\n" +
"}"
}, "");
}
@@ -1164,75 +1164,75 @@ public void testBug532349_0016() throws IOException {
this.runNegativeTest(
new String[] {
"X.java",
- "class X {\n" +
- " public static void foo() {\n" +
+ "class X {\n" +
+ " public static void foo() {\n" +
" Y<? extends I> yi = new Y<>();\n" +
" var vi = yi.t;\n" +
" Y<Integer> yj = new Y<>();\n" +
- " vi = yj.t;\n" +
- " }\n" +
- "}\n" +
+ " vi = yj.t;\n" +
+ " }\n" +
+ "}\n" +
"interface I { }\n" +
- "class Y<T extends Number> {\n" +
- " public T t;\n" +
+ "class Y<T extends Number> {\n" +
+ " public T t;\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " vi = yj.t;\n" +
- " ^^^^\n" +
- "Type mismatch: cannot convert from Integer to Number & I\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " vi = yj.t;\n" +
+ " ^^^^\n" +
+ "Type mismatch: cannot convert from Integer to Number & I\n" +
"----------\n");
}
public void testBug532349_0017() throws IOException {
this.runNegativeTest(
new String[] {
"X.java",
- "class X {\n" +
- " public static <Q extends Number & I> void foo(Y<? super Q> y) {\n" +
+ "class X {\n" +
+ " public static <Q extends Number & I> void foo(Y<? super Q> y) {\n" +
" var vy = y;\n" +
" Y<Integer> yi = new Y<>();\n" +
- " vy = yi;\n" +
- " }\n" +
- "}\n" +
+ " vy = yi;\n" +
+ " }\n" +
+ "}\n" +
"interface I { }\n" +
- "class Y<T extends Number> {\n" +
- " public T t;\n" +
+ "class Y<T extends Number> {\n" +
+ " public T t;\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " vy = yi;\n" +
- " ^^\n" +
- "Type mismatch: cannot convert from Y<Integer> to Y<? super Q>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " vy = yi;\n" +
+ " ^^\n" +
+ "Type mismatch: cannot convert from Y<Integer> to Y<? super Q>\n" +
"----------\n");
}
public void testBug532920() throws IOException {
this.runNegativeTest(
new String[] {
"X.java",
- "import java.util.Iterator;\n" +
- "public class X {\n" +
- " static void foo(Z<?> ef) { \n" +
- " for (var l : ef.t) {\n" +
- " l = new Object();\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "class I<T> {// implements Iterable<T> {\n" +
- " T t;\n" +
- "}\n" +
+ "import java.util.Iterator;\n" +
+ "public class X {\n" +
+ " static void foo(Z<?> ef) { \n" +
+ " for (var l : ef.t) {\n" +
+ " l = new Object();\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "class I<T> {// implements Iterable<T> {\n" +
+ " T t;\n" +
+ "}\n" +
"class Q {}\n" +
- "class Y extends Q{ }\n" +
- "class Z<T extends Iterable<? super Y>> {\n" +
- " I<T> t;\n" +
+ "class Y extends Q{ }\n" +
+ "class Z<T extends Iterable<? super Y>> {\n" +
+ " I<T> t;\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " for (var l : ef.t) {\n" +
- " ^^^^\n" +
- "Can only iterate over an array or an instance of java.lang.Iterable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " for (var l : ef.t) {\n" +
+ " ^^^^\n" +
+ "Can only iterate over an array or an instance of java.lang.Iterable\n" +
"----------\n");
}
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP323VarLambdaParamsTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP323VarLambdaParamsTest.java
index 1b6fc3064..75c8d1b03 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP323VarLambdaParamsTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP323VarLambdaParamsTest.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -126,26 +126,26 @@ public void testBug534787_negative_001() throws IOException {
" public void apply(Integer k, Integer z);\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " I lam = (var x, y) -> {System.out.println(\"SUCCESS \" + x);};\n" +
- " ^^^\n" +
- "Syntax error on token \"var\", ( expected after this token\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " I lam = (var x, y) -> {System.out.println(\"SUCCESS \" + x);};\n" +
- " ^\n" +
- "Syntax error on token \")\", delete this token\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " I lam = (var x, y) -> {System.out.println(\"SUCCESS \" + x);};\n" +
- " ^\n" +
- "Syntax error, insert \")\" to complete Expression\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 3)\n" +
- " I lam = (var x, y) -> {System.out.println(\"SUCCESS \" + x);};\n" +
- " ^\n" +
- "Syntax error, insert \")\" to complete Expression\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " I lam = (var x, y) -> {System.out.println(\"SUCCESS \" + x);};\n" +
+ " ^^^\n" +
+ "Syntax error on token \"var\", ( expected after this token\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " I lam = (var x, y) -> {System.out.println(\"SUCCESS \" + x);};\n" +
+ " ^\n" +
+ "Syntax error on token \")\", delete this token\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " I lam = (var x, y) -> {System.out.println(\"SUCCESS \" + x);};\n" +
+ " ^\n" +
+ "Syntax error, insert \")\" to complete Expression\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 3)\n" +
+ " I lam = (var x, y) -> {System.out.println(\"SUCCESS \" + x);};\n" +
+ " ^\n" +
+ "Syntax error, insert \")\" to complete Expression\n" +
"----------\n");
}
public void testBug534787_negative_002() throws IOException {
@@ -164,9 +164,9 @@ public void testBug534787_negative_002() throws IOException {
},
"----------\n" +
"1. ERROR in X.java (at line 3)\n" +
- " I lam = (var x, Integer y) -> {System.out.println(\"SUCCESS \" + x);};\n" +
- " ^\n" +
- "\'var\' cannot be mixed with non-var parameters\n" +
+ " I lam = (var x, Integer y) -> {System.out.println(\"SUCCESS \" + x);};\n" +
+ " ^\n" +
+ "\'var\' cannot be mixed with non-var parameters\n" +
"----------\n");
}
public void testBug534787_negative_003() throws IOException {
@@ -185,9 +185,9 @@ public void testBug534787_negative_003() throws IOException {
},
"----------\n" +
"1. ERROR in X.java (at line 3)\n" +
- " I lam = (Integer x, var y) -> {System.out.println(\"SUCCESS \" + x);};\n" +
- " ^\n" +
- "'var' cannot be mixed with non-var parameters\n" +
+ " I lam = (Integer x, var y) -> {System.out.println(\"SUCCESS \" + x);};\n" +
+ " ^\n" +
+ "'var' cannot be mixed with non-var parameters\n" +
"----------\n");
}
public void testBug534787_negative_004() throws IOException {
@@ -206,8 +206,8 @@ public void testBug534787_negative_004() throws IOException {
},
"----------\n" +
"1. ERROR in X.java (at line 3)\n" +
- " I lam = (var x, var y, var...s) -> {System.out.println(\"SUCCESS \" + x);};\n" +
- " ^\n" +
+ " I lam = (var x, var y, var...s) -> {System.out.println(\"SUCCESS \" + x);};\n" +
+ " ^\n" +
"'var' is not allowed as an element type of an array\n" +
"----------\n");
}
@@ -227,13 +227,13 @@ public void testBug534787_negative_005() throws IOException {
},
"----------\n" +
"1. ERROR in X.java (at line 3)\n" +
- " I lam = (var x, Integer y, var...s) -> {System.out.println(\"SUCCESS \" + x);};\n" +
- " ^\n" +
+ " I lam = (var x, Integer y, var...s) -> {System.out.println(\"SUCCESS \" + x);};\n" +
+ " ^\n" +
"'var' cannot be mixed with non-var parameters\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
- " I lam = (var x, Integer y, var...s) -> {System.out.println(\"SUCCESS \" + x);};\n" +
- " ^\n" +
+ " I lam = (var x, Integer y, var...s) -> {System.out.println(\"SUCCESS \" + x);};\n" +
+ " ^\n" +
"'var' is not allowed as an element type of an array\n" +
"----------\n");
}
@@ -251,11 +251,11 @@ public void testBug534787_negative_006() throws IOException {
" public void apply(Integer k);\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " I lam = var x -> {System.out.println(\"SUCCESS \" + x);};\n" +
- " ^\n" +
- "Syntax error on token \"x\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " I lam = var x -> {System.out.println(\"SUCCESS \" + x);};\n" +
+ " ^\n" +
+ "Syntax error on token \"x\", delete this token\n" +
"----------\n");
}
public void testBug536159_01() throws IOException {
@@ -309,11 +309,11 @@ public void testBug536159_04() throws IOException {
+ " public int foo (int i []);\n"
+ "}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " FI x = (var i []) -> 5;\n" +
- " ^\n" +
- "\'var\' is not allowed as an element type of an array\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " FI x = (var i []) -> 5;\n" +
+ " ^\n" +
+ "\'var\' is not allowed as an element type of an array\n" +
"----------\n");
}
public void testBug541532_01() throws IOException {
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR308SpecSnippetTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR308SpecSnippetTests.java
index 2c9cc2a54..07216cf75 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR308SpecSnippetTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR308SpecSnippetTests.java
@@ -55,7 +55,7 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_8);
return defaultOptions;
}
-
+
public void test001() throws Exception {
this.runConformTest(
new String[] {
@@ -77,18 +77,18 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #10 @NonNull(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " #11 @NonEmpty(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(1)]\n" +
- " )\n" +
- " #12 @Readonly(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(1), TYPE_ARGUMENT(0)]\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #10 @NonNull(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " #11 @NonEmpty(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(1)]\n" +
+ " )\n" +
+ " #12 @Readonly(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(1), TYPE_ARGUMENT(0)]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -115,15 +115,15 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #24 @NonNull(\n" +
- " target type = 0x49 METHOD_INVOCATION_TYPE_ARGUMENT\n" +
- " offset = 3\n" +
- " type argument index = 0\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #24 @NonNull(\n" +
+ " target type = 0x49 METHOD_INVOCATION_TYPE_ARGUMENT\n" +
+ " offset = 3\n" +
+ " type argument index = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test003() throws Exception {
this.runConformTest(
new String[] {
@@ -144,29 +144,29 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #10 @Existing(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(0), WILDCARD]\n" +
- " )\n" +
- " \n" +
- " // Method descriptor #12 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [14]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 11]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- " Local variable type table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X<F>\n" +
- "\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #10 @Existing(\n" +
- " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 0 type parameter bound index = 0\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #10 @Existing(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(0), WILDCARD]\n" +
+ " )\n" +
+ " \n" +
+ " // Method descriptor #12 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [14]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 11]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
+ " Local variable type table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X<F>\n" +
+ "\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #10 @Existing(\n" +
+ " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 0 type parameter bound index = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -188,15 +188,15 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #23 @Readonly(\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = 0\n" +
- " )\n" +
- " #23 @Readonly(\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = 0\n" +
- " location = [TYPE_ARGUMENT(0)]\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #23 @Readonly(\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = 0\n" +
+ " )\n" +
+ " #23 @Readonly(\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = 0\n" +
+ " location = [TYPE_ARGUMENT(0)]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -220,10 +220,10 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #19 @Critical(\n" +
- " target type = 0x17 THROWS\n" +
- " throws index = 0\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #19 @Critical(\n" +
+ " target type = 0x17 THROWS\n" +
+ " throws index = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -255,23 +255,23 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #33 @Interned(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 0\n" +
- " )\n" +
- " #34 @NonEmpty(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 6\n" +
- " )\n" +
- " #35 @Readonly(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 6\n" +
- " )\n" +
- " #36 @Tainted(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 12\n" +
- " location = [INNER_TYPE]\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #33 @Interned(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 0\n" +
+ " )\n" +
+ " #34 @NonEmpty(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 6\n" +
+ " )\n" +
+ " #35 @Readonly(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 6\n" +
+ " )\n" +
+ " #36 @Tainted(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 12\n" +
+ " location = [INNER_TYPE]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -300,9 +300,9 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #8 @NonNull(\n" +
- " target type = 0x13 FIELD\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #8 @NonNull(\n" +
+ " target type = 0x13 FIELD\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -335,22 +335,22 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #29 @NonNull(\n" +
- " target type = 0x47 CAST\n" +
- " offset = 1\n" +
- " type argument index = 0\n" +
- " )\n" +
- " #30 @B(\n" +
- " target type = 0x47 CAST\n" +
- " offset = 6\n" +
- " type argument index = 1\n" +
- " )\n" +
- " #31 @A(\n" +
- " target type = 0x47 CAST\n" +
- " offset = 9\n" +
- " type argument index = 0\n" +
- " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #29 @NonNull(\n" +
+ " target type = 0x47 CAST\n" +
+ " offset = 1\n" +
+ " type argument index = 0\n" +
+ " )\n" +
+ " #30 @B(\n" +
+ " target type = 0x47 CAST\n" +
+ " offset = 6\n" +
+ " type argument index = 1\n" +
+ " )\n" +
+ " #31 @A(\n" +
+ " target type = 0x47 CAST\n" +
+ " offset = 9\n" +
+ " type argument index = 0\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -382,10 +382,10 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #23 @NonNull(\n" +
- " target type = 0x43 INSTANCEOF\n" +
- " offset = 1\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #23 @NonNull(\n" +
+ " target type = 0x43 INSTANCEOF\n" +
+ " offset = 1\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -429,24 +429,24 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #36 @Vernal(\n" +
- " target type = 0x46 METHOD_REFERENCE\n" +
- " offset = 0\n" +
- " )\n" +
- " #37 @English(\n" +
- " target type = 0x46 METHOD_REFERENCE\n" +
- " offset = 6\n" +
- " location = [TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " #38 @NonNegative(\n" +
- " target type = 0x4b METHOD_REFERENCE_TYPE_ARGUMENT\n" +
- " offset = 12\n" +
- " type argument index = 0\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #36 @Vernal(\n" +
+ " target type = 0x46 METHOD_REFERENCE\n" +
+ " offset = 0\n" +
+ " )\n" +
+ " #37 @English(\n" +
+ " target type = 0x46 METHOD_REFERENCE\n" +
+ " offset = 6\n" +
+ " location = [TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " #38 @NonNegative(\n" +
+ " target type = 0x4b METHOD_REFERENCE_TYPE_ARGUMENT\n" +
+ " offset = 12\n" +
+ " type argument index = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test011() throws Exception {
this.runConformTest(
new String[] {
@@ -482,103 +482,103 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
// 1: #9(#12=I#14): FIELD, location=[TYPE_ARGUMENT(1)]
// 2: #9(#12=I#18): FIELD, location=[TYPE_ARGUMENT(1), WILDCARD]
String expectedOutput =
- "// Compiled from X.java (version 1.8 : 52.0, super bit)\n" +
- "class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"a\"\n" +
- " constant #6 utf8: \"Ljava/util/List;\"\n" +
- " constant #7 utf8: \"Signature\"\n" +
- " constant #8 utf8: \"Ljava/util/List<+Ljava/lang/Comparable<LX;>;>;\"\n" +
- " constant #9 utf8: \"RuntimeInvisibleTypeAnnotations\"\n" +
- " constant #10 utf8: \"LImmutable;\"\n" +
- " constant #11 utf8: \"b\"\n" +
- " constant #12 utf8: \"c\"\n" +
- " constant #13 utf8: \"value\"\n" +
- " constant #14 integer: 1\n" +
- " constant #15 integer: 2\n" +
- " constant #16 utf8: \"d\"\n" +
- " constant #17 utf8: \"Ljava/util/Map;\"\n" +
- " constant #18 utf8: \"Ljava/util/Map<+Ljava/lang/Comparable<LX;>;+Ljava/io/Serializable;>;\"\n" +
- " constant #19 integer: 3\n" +
- " constant #20 utf8: \"<init>\"\n" +
- " constant #21 utf8: \"()V\"\n" +
- " constant #22 utf8: \"Code\"\n" +
- " constant #23 method_ref: #3.#24 java/lang/Object.<init> ()V\n" +
- " constant #24 name_and_type: #20.#21 <init> ()V\n" +
- " constant #25 utf8: \"LineNumberTable\"\n" +
- " constant #26 utf8: \"LocalVariableTable\"\n" +
- " constant #27 utf8: \"this\"\n" +
- " constant #28 utf8: \"LX;\"\n" +
- " constant #29 utf8: \"SourceFile\"\n" +
- " constant #30 utf8: \"X.java\"\n" +
- " \n" +
- " // Field descriptor #6 Ljava/util/List;\n" +
- " // Signature: Ljava/util/List<+Ljava/lang/Comparable<LX;>;>;\n" +
- " java.util.List a;\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #10 @Immutable(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " \n" +
- " // Field descriptor #6 Ljava/util/List;\n" +
- " // Signature: Ljava/util/List<+Ljava/lang/Comparable<LX;>;>;\n" +
- " java.util.List b;\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #10 @Immutable(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(0), WILDCARD]\n" +
- " )\n" +
- " \n" +
- " // Field descriptor #6 Ljava/util/List;\n" +
- " // Signature: Ljava/util/List<+Ljava/lang/Comparable<LX;>;>;\n" +
- " java.util.List c;\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #10 @Immutable(\n" +
- " #13 value=(int) 1 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " #10 @Immutable(\n" +
- " #13 value=(int) 2 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(0), WILDCARD]\n" +
- " )\n" +
- " \n" +
- " // Field descriptor #17 Ljava/util/Map;\n" +
- " // Signature: Ljava/util/Map<+Ljava/lang/Comparable<LX;>;+Ljava/io/Serializable;>;\n" +
- " java.util.Map d;\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #10 @Immutable(\n" +
- " #13 value=(int) 1 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " #10 @Immutable(\n" +
- " #13 value=(int) 2 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(1)]\n" +
- " )\n" +
- " #10 @Immutable(\n" +
- " #13 value=(int) 3 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(1), WILDCARD]\n" +
- " )\n" +
- " \n" +
- " // Method descriptor #21 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [23]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 7]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
+ "// Compiled from X.java (version 1.8 : 52.0, super bit)\n" +
+ "class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"a\"\n" +
+ " constant #6 utf8: \"Ljava/util/List;\"\n" +
+ " constant #7 utf8: \"Signature\"\n" +
+ " constant #8 utf8: \"Ljava/util/List<+Ljava/lang/Comparable<LX;>;>;\"\n" +
+ " constant #9 utf8: \"RuntimeInvisibleTypeAnnotations\"\n" +
+ " constant #10 utf8: \"LImmutable;\"\n" +
+ " constant #11 utf8: \"b\"\n" +
+ " constant #12 utf8: \"c\"\n" +
+ " constant #13 utf8: \"value\"\n" +
+ " constant #14 integer: 1\n" +
+ " constant #15 integer: 2\n" +
+ " constant #16 utf8: \"d\"\n" +
+ " constant #17 utf8: \"Ljava/util/Map;\"\n" +
+ " constant #18 utf8: \"Ljava/util/Map<+Ljava/lang/Comparable<LX;>;+Ljava/io/Serializable;>;\"\n" +
+ " constant #19 integer: 3\n" +
+ " constant #20 utf8: \"<init>\"\n" +
+ " constant #21 utf8: \"()V\"\n" +
+ " constant #22 utf8: \"Code\"\n" +
+ " constant #23 method_ref: #3.#24 java/lang/Object.<init> ()V\n" +
+ " constant #24 name_and_type: #20.#21 <init> ()V\n" +
+ " constant #25 utf8: \"LineNumberTable\"\n" +
+ " constant #26 utf8: \"LocalVariableTable\"\n" +
+ " constant #27 utf8: \"this\"\n" +
+ " constant #28 utf8: \"LX;\"\n" +
+ " constant #29 utf8: \"SourceFile\"\n" +
+ " constant #30 utf8: \"X.java\"\n" +
+ " \n" +
+ " // Field descriptor #6 Ljava/util/List;\n" +
+ " // Signature: Ljava/util/List<+Ljava/lang/Comparable<LX;>;>;\n" +
+ " java.util.List a;\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #10 @Immutable(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " \n" +
+ " // Field descriptor #6 Ljava/util/List;\n" +
+ " // Signature: Ljava/util/List<+Ljava/lang/Comparable<LX;>;>;\n" +
+ " java.util.List b;\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #10 @Immutable(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(0), WILDCARD]\n" +
+ " )\n" +
+ " \n" +
+ " // Field descriptor #6 Ljava/util/List;\n" +
+ " // Signature: Ljava/util/List<+Ljava/lang/Comparable<LX;>;>;\n" +
+ " java.util.List c;\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #10 @Immutable(\n" +
+ " #13 value=(int) 1 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " #10 @Immutable(\n" +
+ " #13 value=(int) 2 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(0), WILDCARD]\n" +
+ " )\n" +
+ " \n" +
+ " // Field descriptor #17 Ljava/util/Map;\n" +
+ " // Signature: Ljava/util/Map<+Ljava/lang/Comparable<LX;>;+Ljava/io/Serializable;>;\n" +
+ " java.util.Map d;\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #10 @Immutable(\n" +
+ " #13 value=(int) 1 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " #10 @Immutable(\n" +
+ " #13 value=(int) 2 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(1)]\n" +
+ " )\n" +
+ " #10 @Immutable(\n" +
+ " #13 value=(int) 3 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(1), WILDCARD]\n" +
+ " )\n" +
+ " \n" +
+ " // Method descriptor #21 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [23]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 7]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -599,71 +599,71 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " Document[][] docs1;\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #8 @Readonly(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
- " \n" +
- " // Field descriptor #6 [[LDocument;\n" +
- " Document[][] docs2;\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #8 @Readonly(\n" +
- " target type = 0x13 FIELD\n" +
- " )\n" +
- " \n" +
- " // Field descriptor #6 [[LDocument;\n" +
- " Document[][] docs3;\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #8 @Readonly(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " \n" +
- " // Method descriptor #12 ()V\n" +
- " // Stack: 3, Locals: 1\n" +
- " X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [14]\n" +
- " 4 aload_0 [this]\n" +
- " 5 iconst_2\n" +
- " 6 bipush 12\n" +
- " 8 multianewarray Document[][] [16]\n" +
- " 12 putfield X.docs1 : Document[][] [17]\n" +
- " 15 aload_0 [this]\n" +
- " 16 iconst_2\n" +
- " 17 bipush 12\n" +
- " 19 multianewarray Document[][] [16]\n" +
- " 23 putfield X.docs2 : Document[][] [19]\n" +
- " 26 aload_0 [this]\n" +
- " 27 iconst_2\n" +
- " 28 bipush 12\n" +
- " 30 multianewarray Document[][] [16]\n" +
- " 34 putfield X.docs3 : Document[][] [21]\n" +
- " 37 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 6]\n" +
- " [pc: 4, line: 7]\n" +
- " [pc: 15, line: 8]\n" +
- " [pc: 26, line: 9]\n" +
- " [pc: 37, line: 6]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 38] local: this index: 0 type: X\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #8 @Readonly(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 8\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
- " #8 @Readonly(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 19\n" +
- " )\n" +
- " #8 @Readonly(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 30\n" +
- " location = [ARRAY]\n" +
+ " Document[][] docs1;\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #8 @Readonly(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
+ " \n" +
+ " // Field descriptor #6 [[LDocument;\n" +
+ " Document[][] docs2;\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #8 @Readonly(\n" +
+ " target type = 0x13 FIELD\n" +
+ " )\n" +
+ " \n" +
+ " // Field descriptor #6 [[LDocument;\n" +
+ " Document[][] docs3;\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #8 @Readonly(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " \n" +
+ " // Method descriptor #12 ()V\n" +
+ " // Stack: 3, Locals: 1\n" +
+ " X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [14]\n" +
+ " 4 aload_0 [this]\n" +
+ " 5 iconst_2\n" +
+ " 6 bipush 12\n" +
+ " 8 multianewarray Document[][] [16]\n" +
+ " 12 putfield X.docs1 : Document[][] [17]\n" +
+ " 15 aload_0 [this]\n" +
+ " 16 iconst_2\n" +
+ " 17 bipush 12\n" +
+ " 19 multianewarray Document[][] [16]\n" +
+ " 23 putfield X.docs2 : Document[][] [19]\n" +
+ " 26 aload_0 [this]\n" +
+ " 27 iconst_2\n" +
+ " 28 bipush 12\n" +
+ " 30 multianewarray Document[][] [16]\n" +
+ " 34 putfield X.docs3 : Document[][] [21]\n" +
+ " 37 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 6]\n" +
+ " [pc: 4, line: 7]\n" +
+ " [pc: 15, line: 8]\n" +
+ " [pc: 26, line: 9]\n" +
+ " [pc: 37, line: 6]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 38] local: this index: 0 type: X\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #8 @Readonly(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 8\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #8 @Readonly(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 19\n" +
+ " )\n" +
+ " #8 @Readonly(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 30\n" +
+ " location = [ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -686,42 +686,42 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
// RuntimeInvisibleTypeAnnotations:
// 0: #9(): METHOD_RETURN
String expectedOutput =
- "// Compiled from X.java (version 1.8 : 52.0, super bit)\n" +
- "class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"<init>\"\n" +
- " constant #6 utf8: \"()V\"\n" +
- " constant #7 utf8: \"Code\"\n" +
- " constant #8 method_ref: #3.#9 java/lang/Object.<init> ()V\n" +
- " constant #9 name_and_type: #5.#6 <init> ()V\n" +
- " constant #10 utf8: \"LineNumberTable\"\n" +
- " constant #11 utf8: \"LocalVariableTable\"\n" +
- " constant #12 utf8: \"this\"\n" +
- " constant #13 utf8: \"LX;\"\n" +
- " constant #14 utf8: \"RuntimeInvisibleTypeAnnotations\"\n" +
- " constant #15 utf8: \"LImmutable;\"\n" +
- " constant #16 utf8: \"SourceFile\"\n" +
- " constant #17 utf8: \"X.java\"\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [8]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 7]\n" +
- " [pc: 4, line: 8]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #15 @Immutable(\n" +
- " target type = 0x14 METHOD_RETURN\n" +
- " )\n" +
+ "// Compiled from X.java (version 1.8 : 52.0, super bit)\n" +
+ "class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"<init>\"\n" +
+ " constant #6 utf8: \"()V\"\n" +
+ " constant #7 utf8: \"Code\"\n" +
+ " constant #8 method_ref: #3.#9 java/lang/Object.<init> ()V\n" +
+ " constant #9 name_and_type: #5.#6 <init> ()V\n" +
+ " constant #10 utf8: \"LineNumberTable\"\n" +
+ " constant #11 utf8: \"LocalVariableTable\"\n" +
+ " constant #12 utf8: \"this\"\n" +
+ " constant #13 utf8: \"LX;\"\n" +
+ " constant #14 utf8: \"RuntimeInvisibleTypeAnnotations\"\n" +
+ " constant #15 utf8: \"LImmutable;\"\n" +
+ " constant #16 utf8: \"SourceFile\"\n" +
+ " constant #17 utf8: \"X.java\"\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [8]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 7]\n" +
+ " [pc: 4, line: 8]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #15 @Immutable(\n" +
+ " target type = 0x14 METHOD_RETURN\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -752,41 +752,41 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " void foo (X this, X this) {\n" +
- " ^^^^\n" +
- "Only the first formal parameter may be declared explicitly as \'this\'\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " static void foo (X this) {\n" +
- " ^^^^\n" +
- "Explicit \'this\' parameter is allowed only in instance methods of non-anonymous classes and inner class constructors\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 14)\n" +
- " I i = (X this) -> {};\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " void foo (X this, X this) {\n" +
+ " ^^^^\n" +
+ "Only the first formal parameter may be declared explicitly as \'this\'\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 12)\n" +
+ " static void foo (X this) {\n" +
+ " ^^^^\n" +
+ "Explicit \'this\' parameter is allowed only in instance methods of non-anonymous classes and inner class constructors\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 14)\n" +
+ " I i = (X this) -> {};\n" +
" ^^^^^^^^^^^\n" +
- "Lambda expression\'s signature does not match the signature of the functional interface method foo()\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 14)\n" +
- " I i = (X this) -> {};\n" +
- " ^^^^\n" +
- "Lambda expressions cannot declare a this parameter\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 17)\n" +
- " void foo(X this) {}\n" +
- " ^\n" +
- "The declared type of the explicit \'this\' parameter is expected to be Y<T>\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 18)\n" +
- " void foo(Y this, int x) {}\n" +
- " ^\n" +
- "Y is a raw type. References to generic type Y<T> should be parameterized\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 18)\n" +
- " void foo(Y this, int x) {}\n" +
- " ^\n" +
- "The declared type of the explicit \'this\' parameter is expected to be Y<T>\n" +
+ "Lambda expression\'s signature does not match the signature of the functional interface method foo()\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 14)\n" +
+ " I i = (X this) -> {};\n" +
+ " ^^^^\n" +
+ "Lambda expressions cannot declare a this parameter\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 17)\n" +
+ " void foo(X this) {}\n" +
+ " ^\n" +
+ "The declared type of the explicit \'this\' parameter is expected to be Y<T>\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 18)\n" +
+ " void foo(Y this, int x) {}\n" +
+ " ^\n" +
+ "Y is a raw type. References to generic type Y<T> should be parameterized\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 18)\n" +
+ " void foo(Y this, int x) {}\n" +
+ " ^\n" +
+ "The declared type of the explicit \'this\' parameter is expected to be Y<T>\n" +
"----------\n");
}
public void test015() throws Exception {
@@ -812,13 +812,13 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #21 @Immutable(\n" +
- " target type = 0x15 METHOD_RECEIVER\n" +
- " )\n" +
- " #22 @Readonly(\n" +
- " target type = 0x15 METHOD_RECEIVER\n" +
- " location = [INNER_TYPE]\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #21 @Immutable(\n" +
+ " target type = 0x15 METHOD_RECEIVER\n" +
+ " )\n" +
+ " #22 @Readonly(\n" +
+ " target type = 0x15 METHOD_RECEIVER\n" +
+ " location = [INNER_TYPE]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X$Y.class", "Y", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -845,17 +845,17 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #21 @A(\n" +
- " target type = 0x15 METHOD_RECEIVER\n" +
- " )\n" +
- " #22 @B(\n" +
- " target type = 0x15 METHOD_RECEIVER\n" +
- " location = [INNER_TYPE]\n" +
- " )\n" +
- " #23 @C(\n" +
- " target type = 0x15 METHOD_RECEIVER\n" +
- " location = [INNER_TYPE, INNER_TYPE]\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #21 @A(\n" +
+ " target type = 0x15 METHOD_RECEIVER\n" +
+ " )\n" +
+ " #22 @B(\n" +
+ " target type = 0x15 METHOD_RECEIVER\n" +
+ " location = [INNER_TYPE]\n" +
+ " )\n" +
+ " #23 @C(\n" +
+ " target type = 0x15 METHOD_RECEIVER\n" +
+ " location = [INNER_TYPE, INNER_TYPE]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "Outer$Middle$Inner.class", "Inner", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -881,9 +881,9 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #22 @Receiver(\n" +
- " target type = 0x15 METHOD_RECEIVER\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #22 @Receiver(\n" +
+ " target type = 0x15 METHOD_RECEIVER\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X$Y.class", "Y", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -919,10 +919,10 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #21 @Readonly(\n" +
- " target type = 0x0 CLASS_TYPE_PARAMETER\n" +
- " type parameter index = 0\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #21 @Readonly(\n" +
+ " target type = 0x0 CLASS_TYPE_PARAMETER\n" +
+ " type parameter index = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -956,41 +956,41 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import java.util.@NotAllowed Date; // illegal!\n" +
- " ^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " import @IllegalSyntax java.util.Date; // illegal syntax\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 2)\n" +
- " import @IllegalSyntax java.util.Date; // illegal syntax\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The import java.util.Date is never used\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 19)\n" +
- " Object o = @Even int.class; // illegal!\n" +
- " ^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 20)\n" +
- " o = int @NonEmpty [].class; // illegal!\n" +
- " ^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 21)\n" +
- " int x = @IllegalSyntax X.staticField;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 22)\n" +
- " StaticNestedClass snc = (@IllegalSyntax X.StaticNestedClass) null;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Type annotations are not allowed on type names used to access static members\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " import java.util.@NotAllowed Date; // illegal!\n" +
+ " ^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " import @IllegalSyntax java.util.Date; // illegal syntax\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 2)\n" +
+ " import @IllegalSyntax java.util.Date; // illegal syntax\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The import java.util.Date is never used\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 19)\n" +
+ " Object o = @Even int.class; // illegal!\n" +
+ " ^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 20)\n" +
+ " o = int @NonEmpty [].class; // illegal!\n" +
+ " ^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 21)\n" +
+ " int x = @IllegalSyntax X.staticField;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 22)\n" +
+ " StaticNestedClass snc = (@IllegalSyntax X.StaticNestedClass) null;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Type annotations are not allowed on type names used to access static members\n" +
"----------\n");
}
public void test021() throws Exception {
@@ -1032,51 +1032,51 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import java.util.@NotAllowed Date; // illegal!\n" +
- " ^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " import @IllegalSyntax java.util.Date; // illegal syntax\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 2)\n" +
- " import @IllegalSyntax java.util.Date; // illegal syntax\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The import java.util.Date is never used\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 26)\n" +
- " Object o = @Even int.class; // illegal!\n" +
- " ^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 27)\n" +
- " o = int @NonEmpty [].class; // illegal!\n" +
- " ^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 28)\n" +
- " int x = @IllegalSyntax X.staticField;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 29)\n" +
- " StaticNestedClass snc = (@IllegalSyntax X.StaticNestedClass) null;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Type annotations are not allowed on type names used to access static members\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 31)\n" +
- " int x2 = @IllegalSyntax X.super.f;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 32)\n" +
- " I i = @IllegalSyntax X.super::x;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " import java.util.@NotAllowed Date; // illegal!\n" +
+ " ^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " import @IllegalSyntax java.util.Date; // illegal syntax\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 2)\n" +
+ " import @IllegalSyntax java.util.Date; // illegal syntax\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The import java.util.Date is never used\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 26)\n" +
+ " Object o = @Even int.class; // illegal!\n" +
+ " ^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 27)\n" +
+ " o = int @NonEmpty [].class; // illegal!\n" +
+ " ^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 28)\n" +
+ " int x = @IllegalSyntax X.staticField;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 29)\n" +
+ " StaticNestedClass snc = (@IllegalSyntax X.StaticNestedClass) null;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Type annotations are not allowed on type names used to access static members\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 31)\n" +
+ " int x2 = @IllegalSyntax X.super.f;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 32)\n" +
+ " I i = @IllegalSyntax X.super::x;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
public void test022() throws Exception {
@@ -1095,13 +1095,13 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #17 @Readonly(\n" +
- " target type = 0x14 METHOD_RETURN\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " #17 @Readonly(\n" +
- " target type = 0x14 METHOD_RETURN\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #17 @Readonly(\n" +
+ " target type = 0x14 METHOD_RETURN\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " #17 @Readonly(\n" +
+ " target type = 0x14 METHOD_RETURN\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -1121,13 +1121,13 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #13 @Readonly(\n" +
- " target type = 0x14 METHOD_RETURN\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " #13 @Readonly(\n" +
- " target type = 0x14 METHOD_RETURN\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #13 @Readonly(\n" +
+ " target type = 0x14 METHOD_RETURN\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " #13 @Readonly(\n" +
+ " target type = 0x14 METHOD_RETURN\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -1152,14 +1152,14 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #34 @Readonly(\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 0\n" +
- " )\n" +
- " #35 @Critical(\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 1\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #34 @Readonly(\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 0\n" +
+ " )\n" +
+ " #35 @Critical(\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 1\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -1180,16 +1180,16 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #19 @Readonly(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " location = [ARRAY, ARRAY, ARRAY]\n" +
- " )\n" +
- " #20 @Critical(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " location = [ARRAY, ARRAY]\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #19 @Readonly(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " location = [ARRAY, ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #20 @Critical(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " location = [ARRAY, ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -1210,16 +1210,16 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #19 @Readonly(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " location = [ARRAY, ARRAY, ARRAY]\n" +
- " )\n" +
- " #20 @Critical(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " location = [ARRAY, ARRAY]\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #19 @Readonly(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " location = [ARRAY, ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #20 @Critical(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " location = [ARRAY, ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -1237,17 +1237,17 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #8 @NonNull(\n" +
- " target type = 0x13 FIELD\n" +
- " )\n" +
- " \n" +
- " // Field descriptor #10 [Ljava/lang/String;\n" +
- " java.lang.String[] arr2;\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #8 @NonNull(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY]\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #8 @NonNull(\n" +
+ " target type = 0x13 FIELD\n" +
+ " )\n" +
+ " \n" +
+ " // Field descriptor #10 [Ljava/lang/String;\n" +
+ " java.lang.String[] arr2;\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #8 @NonNull(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -1277,81 +1277,81 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
// RuntimeInvisibleTypeAnnotations:
// 0: #9(): FIELD, location=[TYPE_ARGUMENT(0)]
String expectedOutput =
- "// Compiled from X.java (version 1.8 : 52.0, super bit)\n" +
- "// Signature: <T:Ljava/lang/Object;>Ljava/lang/Object;\n" +
- "class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"l\"\n" +
- " constant #6 utf8: \"Ljava/util/List;\"\n" +
- " constant #7 utf8: \"Signature\"\n" +
- " constant #8 utf8: \"Ljava/util/List<*>;\"\n" +
- " constant #9 utf8: \"RuntimeInvisibleTypeAnnotations\"\n" +
- " constant #10 utf8: \"LNonNull;\"\n" +
- " constant #11 utf8: \"<init>\"\n" +
- " constant #12 utf8: \"()V\"\n" +
- " constant #13 utf8: \"Code\"\n" +
- " constant #14 method_ref: #3.#15 java/lang/Object.<init> ()V\n" +
- " constant #15 name_and_type: #11.#12 <init> ()V\n" +
- " constant #16 utf8: \"LineNumberTable\"\n" +
- " constant #17 utf8: \"LocalVariableTable\"\n" +
- " constant #18 utf8: \"this\"\n" +
- " constant #19 utf8: \"LX;\"\n" +
- " constant #20 utf8: \"LocalVariableTypeTable\"\n" +
- " constant #21 utf8: \"LX<TT;>;\"\n" +
- " constant #22 utf8: \"foo\"\n" +
- " constant #23 utf8: \"<K:Ljava/lang/Object;>()V\"\n" +
- " constant #24 utf8: \"SourceFile\"\n" +
- " constant #25 utf8: \"X.java\"\n" +
- " constant #26 utf8: \"<T:Ljava/lang/Object;>Ljava/lang/Object;\"\n" +
- " \n" +
- " // Field descriptor #6 Ljava/util/List;\n" +
- " // Signature: Ljava/util/List<*>;\n" +
- " java.util.List l;\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #10 @NonNull(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " \n" +
- " // Method descriptor #12 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [14]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 6]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- " Local variable type table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X<T>\n" +
- " \n" +
- " // Method descriptor #12 ()V\n" +
- " // Signature: <K:Ljava/lang/Object;>()V\n" +
- " // Stack: 0, Locals: 1\n" +
- " void foo();\n" +
- " 0 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 7]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
- " Local variable type table:\n" +
- " [pc: 0, pc: 1] local: this index: 0 type: X<T>\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #10 @NonNull(\n" +
- " target type = 0x1 METHOD_TYPE_PARAMETER\n" +
- " type parameter index = 0\n" +
- " )\n" +
- "\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #10 @NonNull(\n" +
- " target type = 0x0 CLASS_TYPE_PARAMETER\n" +
- " type parameter index = 0\n" +
- " )\n" +
+ "// Compiled from X.java (version 1.8 : 52.0, super bit)\n" +
+ "// Signature: <T:Ljava/lang/Object;>Ljava/lang/Object;\n" +
+ "class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"l\"\n" +
+ " constant #6 utf8: \"Ljava/util/List;\"\n" +
+ " constant #7 utf8: \"Signature\"\n" +
+ " constant #8 utf8: \"Ljava/util/List<*>;\"\n" +
+ " constant #9 utf8: \"RuntimeInvisibleTypeAnnotations\"\n" +
+ " constant #10 utf8: \"LNonNull;\"\n" +
+ " constant #11 utf8: \"<init>\"\n" +
+ " constant #12 utf8: \"()V\"\n" +
+ " constant #13 utf8: \"Code\"\n" +
+ " constant #14 method_ref: #3.#15 java/lang/Object.<init> ()V\n" +
+ " constant #15 name_and_type: #11.#12 <init> ()V\n" +
+ " constant #16 utf8: \"LineNumberTable\"\n" +
+ " constant #17 utf8: \"LocalVariableTable\"\n" +
+ " constant #18 utf8: \"this\"\n" +
+ " constant #19 utf8: \"LX;\"\n" +
+ " constant #20 utf8: \"LocalVariableTypeTable\"\n" +
+ " constant #21 utf8: \"LX<TT;>;\"\n" +
+ " constant #22 utf8: \"foo\"\n" +
+ " constant #23 utf8: \"<K:Ljava/lang/Object;>()V\"\n" +
+ " constant #24 utf8: \"SourceFile\"\n" +
+ " constant #25 utf8: \"X.java\"\n" +
+ " constant #26 utf8: \"<T:Ljava/lang/Object;>Ljava/lang/Object;\"\n" +
+ " \n" +
+ " // Field descriptor #6 Ljava/util/List;\n" +
+ " // Signature: Ljava/util/List<*>;\n" +
+ " java.util.List l;\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #10 @NonNull(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " \n" +
+ " // Method descriptor #12 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [14]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 6]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
+ " Local variable type table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X<T>\n" +
+ " \n" +
+ " // Method descriptor #12 ()V\n" +
+ " // Signature: <K:Ljava/lang/Object;>()V\n" +
+ " // Stack: 0, Locals: 1\n" +
+ " void foo();\n" +
+ " 0 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 7]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
+ " Local variable type table:\n" +
+ " [pc: 0, pc: 1] local: this index: 0 type: X<T>\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #10 @NonNull(\n" +
+ " target type = 0x1 METHOD_TYPE_PARAMETER\n" +
+ " type parameter index = 0\n" +
+ " )\n" +
+ "\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #10 @NonNull(\n" +
+ " target type = 0x0 CLASS_TYPE_PARAMETER\n" +
+ " type parameter index = 0\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -1390,31 +1390,31 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
"java.lang. @MTAnno Object myMethod12() { } // legal, one type annotation\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " @TAnno java.lang.Object field8; // illegal\n" +
- " ^^^^^^\n" +
- "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 15)\n" +
- " java.lang. @FAnno Object field10; // illegal\n" +
- " ^^^^^^\n" +
- "The annotation @FAnno is disallowed for this location\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 19)\n" +
- " @TAnno void myMethod2() { } // illegal\n" +
- " ^^^^^^\n" +
- "Type annotation is illegal for a method that returns void\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 25)\n" +
- " @TAnno java.lang.Object myMethod8() { } // illegal\n" +
- " ^^^^^^\n" +
- "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 27)\n" +
- " java.lang. @MAnno Object myMethod10() { } // illegal\n" +
- " ^^^^^^\n" +
- "The annotation @MAnno is disallowed for this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " @TAnno java.lang.Object field8; // illegal\n" +
+ " ^^^^^^\n" +
+ "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 15)\n" +
+ " java.lang. @FAnno Object field10; // illegal\n" +
+ " ^^^^^^\n" +
+ "The annotation @FAnno is disallowed for this location\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 19)\n" +
+ " @TAnno void myMethod2() { } // illegal\n" +
+ " ^^^^^^\n" +
+ "Type annotation is illegal for a method that returns void\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 25)\n" +
+ " @TAnno java.lang.Object myMethod8() { } // illegal\n" +
+ " ^^^^^^\n" +
+ "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 27)\n" +
+ " java.lang. @MAnno Object myMethod10() { } // illegal\n" +
+ " ^^^^^^\n" +
+ "The annotation @MAnno is disallowed for this location\n" +
"----------\n");
}
public void test030() throws Exception {
@@ -1434,44 +1434,44 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
// 0: #11() LAnnotation;
// 1: #12() LTypeAnnotation;
String expectedOutput =
- "// Compiled from X.java (version 1.8 : 52.0, super bit)\n" +
- "class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"<init>\"\n" +
- " constant #6 utf8: \"()V\"\n" +
- " constant #7 utf8: \"Code\"\n" +
- " constant #8 method_ref: #3.#9 java/lang/Object.<init> ()V\n" +
- " constant #9 name_and_type: #5.#6 <init> ()V\n" +
- " constant #10 utf8: \"LineNumberTable\"\n" +
- " constant #11 utf8: \"LocalVariableTable\"\n" +
- " constant #12 utf8: \"this\"\n" +
- " constant #13 utf8: \"LX;\"\n" +
- " constant #14 utf8: \"SourceFile\"\n" +
- " constant #15 utf8: \"X.java\"\n" +
- " constant #16 utf8: \"RuntimeInvisibleAnnotations\"\n" +
- " constant #17 utf8: \"LAnnotation;\"\n" +
- " constant #18 utf8: \"LTypeAnnotation;\"\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [8]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 5]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- "\n" +
- " RuntimeInvisibleAnnotations: \n" +
- " #17 @Annotation(\n" +
- " )\n" +
- " #18 @TypeAnnotation(\n" +
- " )\n" +
+ "// Compiled from X.java (version 1.8 : 52.0, super bit)\n" +
+ "class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"<init>\"\n" +
+ " constant #6 utf8: \"()V\"\n" +
+ " constant #7 utf8: \"Code\"\n" +
+ " constant #8 method_ref: #3.#9 java/lang/Object.<init> ()V\n" +
+ " constant #9 name_and_type: #5.#6 <init> ()V\n" +
+ " constant #10 utf8: \"LineNumberTable\"\n" +
+ " constant #11 utf8: \"LocalVariableTable\"\n" +
+ " constant #12 utf8: \"this\"\n" +
+ " constant #13 utf8: \"LX;\"\n" +
+ " constant #14 utf8: \"SourceFile\"\n" +
+ " constant #15 utf8: \"X.java\"\n" +
+ " constant #16 utf8: \"RuntimeInvisibleAnnotations\"\n" +
+ " constant #17 utf8: \"LAnnotation;\"\n" +
+ " constant #18 utf8: \"LTypeAnnotation;\"\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [8]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 5]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
+ "\n" +
+ " RuntimeInvisibleAnnotations: \n" +
+ " #17 @Annotation(\n" +
+ " )\n" +
+ " #18 @TypeAnnotation(\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -1491,44 +1491,44 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- "// Compiled from X.java (version 1.8 : 52.0, super bit)\n" +
- "class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"<init>\"\n" +
- " constant #6 utf8: \"()V\"\n" +
- " constant #7 utf8: \"Code\"\n" +
- " constant #8 method_ref: #3.#9 java/lang/Object.<init> ()V\n" +
- " constant #9 name_and_type: #5.#6 <init> ()V\n" +
- " constant #10 utf8: \"LineNumberTable\"\n" +
- " constant #11 utf8: \"LocalVariableTable\"\n" +
- " constant #12 utf8: \"this\"\n" +
- " constant #13 utf8: \"LX;\"\n" +
- " constant #14 utf8: \"SourceFile\"\n" +
- " constant #15 utf8: \"X.java\"\n" +
- " constant #16 utf8: \"RuntimeVisibleAnnotations\"\n" +
- " constant #17 utf8: \"LAnnotation;\"\n" +
- " constant #18 utf8: \"LTypeAnnotation;\"\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [8]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 7]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- "\n" +
- " RuntimeVisibleAnnotations: \n" +
- " #17 @Annotation(\n" +
- " )\n" +
- " #18 @TypeAnnotation(\n" +
- " )\n" +
+ "// Compiled from X.java (version 1.8 : 52.0, super bit)\n" +
+ "class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"<init>\"\n" +
+ " constant #6 utf8: \"()V\"\n" +
+ " constant #7 utf8: \"Code\"\n" +
+ " constant #8 method_ref: #3.#9 java/lang/Object.<init> ()V\n" +
+ " constant #9 name_and_type: #5.#6 <init> ()V\n" +
+ " constant #10 utf8: \"LineNumberTable\"\n" +
+ " constant #11 utf8: \"LocalVariableTable\"\n" +
+ " constant #12 utf8: \"this\"\n" +
+ " constant #13 utf8: \"LX;\"\n" +
+ " constant #14 utf8: \"SourceFile\"\n" +
+ " constant #15 utf8: \"X.java\"\n" +
+ " constant #16 utf8: \"RuntimeVisibleAnnotations\"\n" +
+ " constant #17 utf8: \"LAnnotation;\"\n" +
+ " constant #18 utf8: \"LTypeAnnotation;\"\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [8]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 7]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
+ "\n" +
+ " RuntimeVisibleAnnotations: \n" +
+ " #17 @Annotation(\n" +
+ " )\n" +
+ " #18 @TypeAnnotation(\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -1547,11 +1547,11 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
"@Annotation @TypeAnnotation class X {\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " @Annotation @TypeAnnotation class X {\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The annotation @TypeAnnotation is disallowed for this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " @Annotation @TypeAnnotation class X {\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The annotation @TypeAnnotation is disallowed for this location\n" +
"----------\n");
}
public void test030c() throws Exception {
@@ -1569,44 +1569,44 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- "// Compiled from X.java (version 1.8 : 52.0, super bit)\n" +
- "class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"<init>\"\n" +
- " constant #6 utf8: \"()V\"\n" +
- " constant #7 utf8: \"Code\"\n" +
- " constant #8 method_ref: #3.#9 java/lang/Object.<init> ()V\n" +
- " constant #9 name_and_type: #5.#6 <init> ()V\n" +
- " constant #10 utf8: \"LineNumberTable\"\n" +
- " constant #11 utf8: \"LocalVariableTable\"\n" +
- " constant #12 utf8: \"this\"\n" +
- " constant #13 utf8: \"LX;\"\n" +
- " constant #14 utf8: \"SourceFile\"\n" +
- " constant #15 utf8: \"X.java\"\n" +
- " constant #16 utf8: \"RuntimeVisibleAnnotations\"\n" +
- " constant #17 utf8: \"LAnnotation;\"\n" +
- " constant #18 utf8: \"LTypeAnnotation;\"\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [8]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 7]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- "\n" +
- " RuntimeVisibleAnnotations: \n" +
- " #17 @Annotation(\n" +
- " )\n" +
- " #18 @TypeAnnotation(\n" +
- " )\n" +
+ "// Compiled from X.java (version 1.8 : 52.0, super bit)\n" +
+ "class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"<init>\"\n" +
+ " constant #6 utf8: \"()V\"\n" +
+ " constant #7 utf8: \"Code\"\n" +
+ " constant #8 method_ref: #3.#9 java/lang/Object.<init> ()V\n" +
+ " constant #9 name_and_type: #5.#6 <init> ()V\n" +
+ " constant #10 utf8: \"LineNumberTable\"\n" +
+ " constant #11 utf8: \"LocalVariableTable\"\n" +
+ " constant #12 utf8: \"this\"\n" +
+ " constant #13 utf8: \"LX;\"\n" +
+ " constant #14 utf8: \"SourceFile\"\n" +
+ " constant #15 utf8: \"X.java\"\n" +
+ " constant #16 utf8: \"RuntimeVisibleAnnotations\"\n" +
+ " constant #17 utf8: \"LAnnotation;\"\n" +
+ " constant #18 utf8: \"LTypeAnnotation;\"\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [8]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 7]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
+ "\n" +
+ " RuntimeVisibleAnnotations: \n" +
+ " #17 @Annotation(\n" +
+ " )\n" +
+ " #18 @TypeAnnotation(\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -1624,26 +1624,26 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [10]\n" +
- " 4 aload_0 [this]\n" +
- " 5 new X [1]\n" +
- " 8 dup\n" +
- " 9 invokespecial X() [12]\n" +
- " 12 putfield X.x : X [13]\n" +
- " 15 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 4]\n" +
- " [pc: 4, line: 5]\n" +
- " [pc: 15, line: 4]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 16] local: this index: 0 type: X\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #19 @NonNull(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 5\n" +
- " )\n" +
+ " X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [10]\n" +
+ " 4 aload_0 [this]\n" +
+ " 5 new X [1]\n" +
+ " 8 dup\n" +
+ " 9 invokespecial X() [12]\n" +
+ " 12 putfield X.x : X [13]\n" +
+ " 15 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 4]\n" +
+ " [pc: 4, line: 5]\n" +
+ " [pc: 15, line: 4]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 16] local: this index: 0 type: X\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #19 @NonNull(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 5\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -1663,24 +1663,24 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " void foo(X x);\n" +
- " 0 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 7]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
- " [pc: 0, pc: 1] local: x index: 1 type: X\n" +
- " RuntimeInvisibleParameterAnnotations: \n" +
- " Number of annotations for parameter 0: 1\n" +
- " #17 @ParameterAnnot(\n" +
- " )\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #20 @NonNull(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " )\n" +
- " #20 @NonNull(\n" +
- " target type = 0x15 METHOD_RECEIVER\n" +
+ " void foo(X x);\n" +
+ " 0 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 7]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 1] local: x index: 1 type: X\n" +
+ " RuntimeInvisibleParameterAnnotations: \n" +
+ " Number of annotations for parameter 0: 1\n" +
+ " #17 @ParameterAnnot(\n" +
+ " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #20 @NonNull(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " )\n" +
+ " #20 @NonNull(\n" +
+ " target type = 0x15 METHOD_RECEIVER\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -1713,100 +1713,100 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
// 1: #11(): NEW, offset=0
// javac is skipping production of the cast so offset is 0. JDT is currently always producing the
// checkcast for an annotated cast so the offset is 7.
-
+
// For the annotations in the initializer {...} the constructors both have:
// RuntimeInvisibleTypeAnnotations:
// 0: #11(): NEW, offset=4
String expectedOutput =
- "// Compiled from X.java (version 1.8 : 52.0, super bit)\n" +
- "class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"<clinit>\"\n" +
- " constant #6 utf8: \"()V\"\n" +
- " constant #7 utf8: \"Code\"\n" +
- " constant #8 method_ref: #3.#9 java/lang/Object.<init> ()V\n" +
- " constant #9 name_and_type: #10.#6 <init> ()V\n" +
- " constant #10 utf8: \"<init>\"\n" +
- " constant #11 utf8: \"LineNumberTable\"\n" +
- " constant #12 utf8: \"LocalVariableTable\"\n" +
- " constant #13 utf8: \"RuntimeInvisibleTypeAnnotations\"\n" +
- " constant #14 utf8: \"LNonNull;\"\n" +
- " constant #15 utf8: \"this\"\n" +
- " constant #16 utf8: \"LX;\"\n" +
- " constant #17 utf8: \"(I)V\"\n" +
- " constant #18 utf8: \"x\"\n" +
- " constant #19 utf8: \"I\"\n" +
- " constant #20 utf8: \"SourceFile\"\n" +
- " constant #21 utf8: \"X.java\"\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 2, Locals: 1\n" +
- " static {};\n" +
- " 0 new java.lang.Object [3]\n" +
- " 3 dup\n" +
- " 4 invokespecial java.lang.Object() [8]\n" +
- " 7 checkcast java.lang.Object [3]\n" +
- " 10 astore_0\n" +
- " 11 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 6]\n" +
- " [pc: 11, line: 7]\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #14 @NonNull(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 0\n" +
- " )\n" +
- " #14 @NonNull(\n" +
- " target type = 0x47 CAST\n" +
- " offset = 7\n" +
- " type argument index = 0\n" +
- " )\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [8]\n" +
- " 4 new java.lang.Object [3]\n" +
- " 7 invokespecial java.lang.Object() [8]\n" +
- " 10 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 11]\n" +
- " [pc: 4, line: 9]\n" +
- " [pc: 10, line: 12]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 11] local: this index: 0 type: X\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #14 @NonNull(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 4\n" +
- " )\n" +
- " \n" +
- " // Method descriptor #17 (I)V\n" +
- " // Stack: 1, Locals: 2\n" +
- " X(int x);\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [8]\n" +
- " 4 new java.lang.Object [3]\n" +
- " 7 invokespecial java.lang.Object() [8]\n" +
- " 10 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 13]\n" +
- " [pc: 4, line: 9]\n" +
- " [pc: 10, line: 14]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 11] local: this index: 0 type: X\n" +
- " [pc: 0, pc: 11] local: x index: 1 type: int\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #14 @NonNull(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 4\n" +
- " )\n" +
+ "// Compiled from X.java (version 1.8 : 52.0, super bit)\n" +
+ "class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"<clinit>\"\n" +
+ " constant #6 utf8: \"()V\"\n" +
+ " constant #7 utf8: \"Code\"\n" +
+ " constant #8 method_ref: #3.#9 java/lang/Object.<init> ()V\n" +
+ " constant #9 name_and_type: #10.#6 <init> ()V\n" +
+ " constant #10 utf8: \"<init>\"\n" +
+ " constant #11 utf8: \"LineNumberTable\"\n" +
+ " constant #12 utf8: \"LocalVariableTable\"\n" +
+ " constant #13 utf8: \"RuntimeInvisibleTypeAnnotations\"\n" +
+ " constant #14 utf8: \"LNonNull;\"\n" +
+ " constant #15 utf8: \"this\"\n" +
+ " constant #16 utf8: \"LX;\"\n" +
+ " constant #17 utf8: \"(I)V\"\n" +
+ " constant #18 utf8: \"x\"\n" +
+ " constant #19 utf8: \"I\"\n" +
+ " constant #20 utf8: \"SourceFile\"\n" +
+ " constant #21 utf8: \"X.java\"\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " static {};\n" +
+ " 0 new java.lang.Object [3]\n" +
+ " 3 dup\n" +
+ " 4 invokespecial java.lang.Object() [8]\n" +
+ " 7 checkcast java.lang.Object [3]\n" +
+ " 10 astore_0\n" +
+ " 11 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 6]\n" +
+ " [pc: 11, line: 7]\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #14 @NonNull(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 0\n" +
+ " )\n" +
+ " #14 @NonNull(\n" +
+ " target type = 0x47 CAST\n" +
+ " offset = 7\n" +
+ " type argument index = 0\n" +
+ " )\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [8]\n" +
+ " 4 new java.lang.Object [3]\n" +
+ " 7 invokespecial java.lang.Object() [8]\n" +
+ " 10 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 11]\n" +
+ " [pc: 4, line: 9]\n" +
+ " [pc: 10, line: 12]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 11] local: this index: 0 type: X\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #14 @NonNull(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 4\n" +
+ " )\n" +
+ " \n" +
+ " // Method descriptor #17 (I)V\n" +
+ " // Stack: 1, Locals: 2\n" +
+ " X(int x);\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [8]\n" +
+ " 4 new java.lang.Object [3]\n" +
+ " 7 invokespecial java.lang.Object() [8]\n" +
+ " 10 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 13]\n" +
+ " [pc: 4, line: 9]\n" +
+ " [pc: 10, line: 14]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 11] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 11] local: x index: 1 type: int\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #14 @NonNull(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 4\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -1823,57 +1823,57 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
"");
// javac b100
// RuntimeInvisibleTypeAnnotations:
- // 0: #13(): CLASS_TYPE_PARAMETER_BOUND, param_index=0, bound_index=1
+ // 0: #13(): CLASS_TYPE_PARAMETER_BOUND, param_index=0, bound_index=1
// bound_index is 1 because the bound is an interface, not a class
String expectedOutput =
- "// Compiled from X.java (version 1.8 : 52.0, super bit)\n" +
- "// Signature: <T::Ljava/lang/Comparable;>Ljava/lang/Object;\n" +
- "class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"<init>\"\n" +
- " constant #6 utf8: \"()V\"\n" +
- " constant #7 utf8: \"Code\"\n" +
- " constant #8 method_ref: #3.#9 java/lang/Object.<init> ()V\n" +
- " constant #9 name_and_type: #5.#6 <init> ()V\n" +
- " constant #10 utf8: \"LineNumberTable\"\n" +
- " constant #11 utf8: \"LocalVariableTable\"\n" +
- " constant #12 utf8: \"this\"\n" +
- " constant #13 utf8: \"LX;\"\n" +
- " constant #14 utf8: \"LocalVariableTypeTable\"\n" +
- " constant #15 utf8: \"LX<TT;>;\"\n" +
- " constant #16 utf8: \"SourceFile\"\n" +
- " constant #17 utf8: \"X.java\"\n" +
- " constant #18 utf8: \"Signature\"\n" +
- " constant #19 utf8: \"<T::Ljava/lang/Comparable;>Ljava/lang/Object;\"\n" +
- " constant #20 utf8: \"RuntimeInvisibleTypeAnnotations\"\n" +
- " constant #21 utf8: \"LNonNull;\"\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [8]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 4]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- " Local variable type table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X<T>\n" +
- "\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #21 @NonNull(\n" +
- " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 0 type parameter bound index = 1\n" +
- " )\n" +
+ "// Compiled from X.java (version 1.8 : 52.0, super bit)\n" +
+ "// Signature: <T::Ljava/lang/Comparable;>Ljava/lang/Object;\n" +
+ "class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"<init>\"\n" +
+ " constant #6 utf8: \"()V\"\n" +
+ " constant #7 utf8: \"Code\"\n" +
+ " constant #8 method_ref: #3.#9 java/lang/Object.<init> ()V\n" +
+ " constant #9 name_and_type: #5.#6 <init> ()V\n" +
+ " constant #10 utf8: \"LineNumberTable\"\n" +
+ " constant #11 utf8: \"LocalVariableTable\"\n" +
+ " constant #12 utf8: \"this\"\n" +
+ " constant #13 utf8: \"LX;\"\n" +
+ " constant #14 utf8: \"LocalVariableTypeTable\"\n" +
+ " constant #15 utf8: \"LX<TT;>;\"\n" +
+ " constant #16 utf8: \"SourceFile\"\n" +
+ " constant #17 utf8: \"X.java\"\n" +
+ " constant #18 utf8: \"Signature\"\n" +
+ " constant #19 utf8: \"<T::Ljava/lang/Comparable;>Ljava/lang/Object;\"\n" +
+ " constant #20 utf8: \"RuntimeInvisibleTypeAnnotations\"\n" +
+ " constant #21 utf8: \"LNonNull;\"\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [8]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 4]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
+ " Local variable type table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X<T>\n" +
+ "\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #21 @NonNull(\n" +
+ " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 0 type parameter bound index = 1\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
// Bug 415543 - Incorrect bound index in RuntimeInvisibleTypeAnnotations attribute
public void test034b() throws Exception {
this.runConformTest(
@@ -1894,168 +1894,168 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- "// Compiled from X.java (version 1.8 : 52.0, super bit)\n" +
- "// Signature: <T::Ljava/lang/Comparable;:Ljava/io/Serializable;>Ljava/lang/Object;\n" +
- "class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"<init>\"\n" +
- " constant #6 utf8: \"()V\"\n" +
- " constant #7 utf8: \"Code\"\n" +
- " constant #8 method_ref: #3.#9 java/lang/Object.<init> ()V\n" +
- " constant #9 name_and_type: #5.#6 <init> ()V\n" +
- " constant #10 utf8: \"LineNumberTable\"\n" +
- " constant #11 utf8: \"LocalVariableTable\"\n" +
- " constant #12 utf8: \"this\"\n" +
- " constant #13 utf8: \"LX;\"\n" +
- " constant #14 utf8: \"LocalVariableTypeTable\"\n" +
- " constant #15 utf8: \"LX<TT;>;\"\n" +
- " constant #16 utf8: \"one\"\n" +
- " constant #17 utf8: \"(Ljava/lang/Comparable;)V\"\n" +
- " constant #18 utf8: \"Signature\"\n" +
- " constant #19 utf8: \"<T::Ljava/lang/Comparable;>(TT;)V\"\n" +
- " constant #20 utf8: \"t\"\n" +
- " constant #21 utf8: \"Ljava/lang/Comparable;\"\n" +
- " constant #22 utf8: \"TT;\"\n" +
- " constant #23 utf8: \"RuntimeInvisibleTypeAnnotations\"\n" +
- " constant #24 utf8: \"LNonNull;\"\n" +
- " constant #25 utf8: \"two\"\n" +
- " constant #26 utf8: \"<T::Ljava/lang/Comparable;:Ljava/io/Serializable;>(TT;)V\"\n" +
- " constant #27 utf8: \"three\"\n" +
- " constant #28 utf8: \"four\"\n" +
- " constant #29 utf8: \"(Ljava/lang/Object;)V\"\n" +
- " constant #30 utf8: \"<T:Ljava/lang/Object;:Ljava/io/Serializable;>(TT;)V\"\n" +
- " constant #31 utf8: \"Ljava/lang/Object;\"\n" +
- " constant #32 utf8: \"five\"\n" +
- " constant #33 utf8: \"<T:Ljava/lang/Object;:Ljava/io/Serializable;:Ljava/lang/Runnable;>(TT;)V\"\n" +
- " constant #34 utf8: \"SourceFile\"\n" +
- " constant #35 utf8: \"X.java\"\n" +
- " constant #36 utf8: \"<T::Ljava/lang/Comparable;:Ljava/io/Serializable;>Ljava/lang/Object;\"\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [8]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 6]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- " Local variable type table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X<T>\n" +
- " \n" +
- " // Method descriptor #17 (Ljava/lang/Comparable;)V\n" +
- " // Signature: <T::Ljava/lang/Comparable;>(TT;)V\n" +
- " // Stack: 0, Locals: 2\n" +
- " void one(java.lang.Comparable t);\n" +
- " 0 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 7]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
- " [pc: 0, pc: 1] local: t index: 1 type: java.lang.Comparable\n" +
- " Local variable type table:\n" +
- " [pc: 0, pc: 1] local: this index: 0 type: X<T>\n" +
- " [pc: 0, pc: 1] local: t index: 1 type: T\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #24 @NonNull(\n" +
- " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 0 type parameter bound index = 1\n" +
- " )\n" +
- " \n" +
- " // Method descriptor #17 (Ljava/lang/Comparable;)V\n" +
- " // Signature: <T::Ljava/lang/Comparable;:Ljava/io/Serializable;>(TT;)V\n" +
- " // Stack: 0, Locals: 2\n" +
- " void two(java.lang.Comparable t);\n" +
- " 0 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 8]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
- " [pc: 0, pc: 1] local: t index: 1 type: java.lang.Comparable\n" +
- " Local variable type table:\n" +
- " [pc: 0, pc: 1] local: this index: 0 type: X<T>\n" +
- " [pc: 0, pc: 1] local: t index: 1 type: T\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #24 @NonNull(\n" +
- " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 0 type parameter bound index = 2\n" +
- " )\n" +
- " \n" +
- " // Method descriptor #17 (Ljava/lang/Comparable;)V\n" +
- " // Signature: <T::Ljava/lang/Comparable;:Ljava/io/Serializable;>(TT;)V\n" +
- " // Stack: 0, Locals: 2\n" +
- " void three(java.lang.Comparable t);\n" +
- " 0 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 9]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
- " [pc: 0, pc: 1] local: t index: 1 type: java.lang.Comparable\n" +
- " Local variable type table:\n" +
- " [pc: 0, pc: 1] local: this index: 0 type: X<T>\n" +
- " [pc: 0, pc: 1] local: t index: 1 type: T\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #24 @NonNull(\n" +
- " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 0 type parameter bound index = 1\n" +
- " )\n" +
- " #24 @NonNull(\n" +
- " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 0 type parameter bound index = 2\n" +
- " )\n" +
- " \n" +
- " // Method descriptor #29 (Ljava/lang/Object;)V\n" +
- " // Signature: <T:Ljava/lang/Object;:Ljava/io/Serializable;>(TT;)V\n" +
- " // Stack: 0, Locals: 2\n" +
- " void four(java.lang.Object t);\n" +
- " 0 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 10]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
- " [pc: 0, pc: 1] local: t index: 1 type: java.lang.Object\n" +
- " Local variable type table:\n" +
- " [pc: 0, pc: 1] local: this index: 0 type: X<T>\n" +
- " [pc: 0, pc: 1] local: t index: 1 type: T\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #24 @NonNull(\n" +
- " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 0 type parameter bound index = 1\n" +
- " )\n" +
- " \n" +
- " // Method descriptor #29 (Ljava/lang/Object;)V\n" +
- " // Signature: <T:Ljava/lang/Object;:Ljava/io/Serializable;:Ljava/lang/Runnable;>(TT;)V\n" +
- " // Stack: 0, Locals: 2\n" +
- " void five(java.lang.Object t);\n" +
- " 0 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 11]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
- " [pc: 0, pc: 1] local: t index: 1 type: java.lang.Object\n" +
- " Local variable type table:\n" +
- " [pc: 0, pc: 1] local: this index: 0 type: X<T>\n" +
- " [pc: 0, pc: 1] local: t index: 1 type: T\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #24 @NonNull(\n" +
- " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 0 type parameter bound index = 1\n" +
- " )\n" +
- " #24 @NonNull(\n" +
- " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 0 type parameter bound index = 2\n" +
- " )\n" +
- "\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #24 @NonNull(\n" +
- " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 0 type parameter bound index = 2\n" +
- " )\n" +
+ "// Compiled from X.java (version 1.8 : 52.0, super bit)\n" +
+ "// Signature: <T::Ljava/lang/Comparable;:Ljava/io/Serializable;>Ljava/lang/Object;\n" +
+ "class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"<init>\"\n" +
+ " constant #6 utf8: \"()V\"\n" +
+ " constant #7 utf8: \"Code\"\n" +
+ " constant #8 method_ref: #3.#9 java/lang/Object.<init> ()V\n" +
+ " constant #9 name_and_type: #5.#6 <init> ()V\n" +
+ " constant #10 utf8: \"LineNumberTable\"\n" +
+ " constant #11 utf8: \"LocalVariableTable\"\n" +
+ " constant #12 utf8: \"this\"\n" +
+ " constant #13 utf8: \"LX;\"\n" +
+ " constant #14 utf8: \"LocalVariableTypeTable\"\n" +
+ " constant #15 utf8: \"LX<TT;>;\"\n" +
+ " constant #16 utf8: \"one\"\n" +
+ " constant #17 utf8: \"(Ljava/lang/Comparable;)V\"\n" +
+ " constant #18 utf8: \"Signature\"\n" +
+ " constant #19 utf8: \"<T::Ljava/lang/Comparable;>(TT;)V\"\n" +
+ " constant #20 utf8: \"t\"\n" +
+ " constant #21 utf8: \"Ljava/lang/Comparable;\"\n" +
+ " constant #22 utf8: \"TT;\"\n" +
+ " constant #23 utf8: \"RuntimeInvisibleTypeAnnotations\"\n" +
+ " constant #24 utf8: \"LNonNull;\"\n" +
+ " constant #25 utf8: \"two\"\n" +
+ " constant #26 utf8: \"<T::Ljava/lang/Comparable;:Ljava/io/Serializable;>(TT;)V\"\n" +
+ " constant #27 utf8: \"three\"\n" +
+ " constant #28 utf8: \"four\"\n" +
+ " constant #29 utf8: \"(Ljava/lang/Object;)V\"\n" +
+ " constant #30 utf8: \"<T:Ljava/lang/Object;:Ljava/io/Serializable;>(TT;)V\"\n" +
+ " constant #31 utf8: \"Ljava/lang/Object;\"\n" +
+ " constant #32 utf8: \"five\"\n" +
+ " constant #33 utf8: \"<T:Ljava/lang/Object;:Ljava/io/Serializable;:Ljava/lang/Runnable;>(TT;)V\"\n" +
+ " constant #34 utf8: \"SourceFile\"\n" +
+ " constant #35 utf8: \"X.java\"\n" +
+ " constant #36 utf8: \"<T::Ljava/lang/Comparable;:Ljava/io/Serializable;>Ljava/lang/Object;\"\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [8]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 6]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
+ " Local variable type table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X<T>\n" +
+ " \n" +
+ " // Method descriptor #17 (Ljava/lang/Comparable;)V\n" +
+ " // Signature: <T::Ljava/lang/Comparable;>(TT;)V\n" +
+ " // Stack: 0, Locals: 2\n" +
+ " void one(java.lang.Comparable t);\n" +
+ " 0 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 7]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 1] local: t index: 1 type: java.lang.Comparable\n" +
+ " Local variable type table:\n" +
+ " [pc: 0, pc: 1] local: this index: 0 type: X<T>\n" +
+ " [pc: 0, pc: 1] local: t index: 1 type: T\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #24 @NonNull(\n" +
+ " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 0 type parameter bound index = 1\n" +
+ " )\n" +
+ " \n" +
+ " // Method descriptor #17 (Ljava/lang/Comparable;)V\n" +
+ " // Signature: <T::Ljava/lang/Comparable;:Ljava/io/Serializable;>(TT;)V\n" +
+ " // Stack: 0, Locals: 2\n" +
+ " void two(java.lang.Comparable t);\n" +
+ " 0 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 8]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 1] local: t index: 1 type: java.lang.Comparable\n" +
+ " Local variable type table:\n" +
+ " [pc: 0, pc: 1] local: this index: 0 type: X<T>\n" +
+ " [pc: 0, pc: 1] local: t index: 1 type: T\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #24 @NonNull(\n" +
+ " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 0 type parameter bound index = 2\n" +
+ " )\n" +
+ " \n" +
+ " // Method descriptor #17 (Ljava/lang/Comparable;)V\n" +
+ " // Signature: <T::Ljava/lang/Comparable;:Ljava/io/Serializable;>(TT;)V\n" +
+ " // Stack: 0, Locals: 2\n" +
+ " void three(java.lang.Comparable t);\n" +
+ " 0 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 9]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 1] local: t index: 1 type: java.lang.Comparable\n" +
+ " Local variable type table:\n" +
+ " [pc: 0, pc: 1] local: this index: 0 type: X<T>\n" +
+ " [pc: 0, pc: 1] local: t index: 1 type: T\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #24 @NonNull(\n" +
+ " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 0 type parameter bound index = 1\n" +
+ " )\n" +
+ " #24 @NonNull(\n" +
+ " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 0 type parameter bound index = 2\n" +
+ " )\n" +
+ " \n" +
+ " // Method descriptor #29 (Ljava/lang/Object;)V\n" +
+ " // Signature: <T:Ljava/lang/Object;:Ljava/io/Serializable;>(TT;)V\n" +
+ " // Stack: 0, Locals: 2\n" +
+ " void four(java.lang.Object t);\n" +
+ " 0 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 10]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 1] local: t index: 1 type: java.lang.Object\n" +
+ " Local variable type table:\n" +
+ " [pc: 0, pc: 1] local: this index: 0 type: X<T>\n" +
+ " [pc: 0, pc: 1] local: t index: 1 type: T\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #24 @NonNull(\n" +
+ " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 0 type parameter bound index = 1\n" +
+ " )\n" +
+ " \n" +
+ " // Method descriptor #29 (Ljava/lang/Object;)V\n" +
+ " // Signature: <T:Ljava/lang/Object;:Ljava/io/Serializable;:Ljava/lang/Runnable;>(TT;)V\n" +
+ " // Stack: 0, Locals: 2\n" +
+ " void five(java.lang.Object t);\n" +
+ " 0 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 11]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 1] local: t index: 1 type: java.lang.Object\n" +
+ " Local variable type table:\n" +
+ " [pc: 0, pc: 1] local: this index: 0 type: X<T>\n" +
+ " [pc: 0, pc: 1] local: t index: 1 type: T\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #24 @NonNull(\n" +
+ " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 0 type parameter bound index = 1\n" +
+ " )\n" +
+ " #24 @NonNull(\n" +
+ " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 0 type parameter bound index = 2\n" +
+ " )\n" +
+ "\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #24 @NonNull(\n" +
+ " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 0 type parameter bound index = 2\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -2076,27 +2076,27 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " void foo();\n" +
- " 0 bipush 10\n" +
- " 2 anewarray X [1]\n" +
- " 5 astore_1 [x]\n" +
- " 6 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- " 9 aload_1 [x]\n" +
- " 10 invokevirtual java.io.PrintStream.println(java.lang.Object) : void [21]\n" +
- " 13 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 7]\n" +
- " [pc: 6, line: 8]\n" +
- " [pc: 13, line: 9]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
- " [pc: 6, pc: 14] local: x index: 1 type: X[]\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #30 @NonNull(\n" +
- " target type = 0x40 LOCAL_VARIABLE\n" +
- " local variable entries:\n" +
- " [pc: 6, pc: 14] index: 1\n" +
- " location = [ARRAY]\n" +
+ " void foo();\n" +
+ " 0 bipush 10\n" +
+ " 2 anewarray X [1]\n" +
+ " 5 astore_1 [x]\n" +
+ " 6 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
+ " 9 aload_1 [x]\n" +
+ " 10 invokevirtual java.io.PrintStream.println(java.lang.Object) : void [21]\n" +
+ " 13 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 7]\n" +
+ " [pc: 6, line: 8]\n" +
+ " [pc: 13, line: 9]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
+ " [pc: 6, pc: 14] local: x index: 1 type: X[]\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #30 @NonNull(\n" +
+ " target type = 0x40 LOCAL_VARIABLE\n" +
+ " local variable entries:\n" +
+ " [pc: 6, pc: 14] index: 1\n" +
+ " location = [ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -2115,20 +2115,20 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " void foo(X x);\n" +
- " 0 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 6]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
- " [pc: 0, pc: 1] local: x index: 1 type: X\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #18 @NonNull(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " )\n" +
- " #18 @NonNull(\n" +
- " target type = 0x15 METHOD_RECEIVER\n" +
+ " void foo(X x);\n" +
+ " 0 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 6]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 1] local: x index: 1 type: X\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #18 @NonNull(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " )\n" +
+ " #18 @NonNull(\n" +
+ " target type = 0x15 METHOD_RECEIVER\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -2148,34 +2148,34 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [10]\n" +
- " 4 aload_0 [this]\n" +
- " 5 bipush 10\n" +
- " 7 anewarray X [1]\n" +
- " 10 putfield X.x : X[] [12]\n" +
- " 13 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 7]\n" +
- " [pc: 4, line: 8]\n" +
- " [pc: 13, line: 7]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #19 @Readonly(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 7\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " #19 @Readonly(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 7\n" +
- " )\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [10]\n" +
+ " 4 aload_0 [this]\n" +
+ " 5 bipush 10\n" +
+ " 7 anewarray X [1]\n" +
+ " 10 putfield X.x : X[] [12]\n" +
+ " 13 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 7]\n" +
+ " [pc: 4, line: 8]\n" +
+ " [pc: 13, line: 7]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #19 @Readonly(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 7\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " #19 @Readonly(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 7\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
- // test anonymous class, the class itself should have class_extends target ?
+ // test anonymous class, the class itself should have class_extends target ?
public void test038() throws Exception {
this.runConformTest(
new String[] {
@@ -2193,26 +2193,26 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [10]\n" +
- " 4 aload_0 [this]\n" +
- " 5 new X$1 [12]\n" +
- " 8 dup\n" +
- " 9 aload_0 [this]\n" +
- " 10 invokespecial X$1(X) [14]\n" +
- " 13 putfield X.x : X [17]\n" +
- " 16 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 7]\n" +
- " [pc: 4, line: 8]\n" +
- " [pc: 16, line: 7]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 17] local: this index: 0 type: X\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #23 @Readonly(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 5\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [10]\n" +
+ " 4 aload_0 [this]\n" +
+ " 5 new X$1 [12]\n" +
+ " 8 dup\n" +
+ " 9 aload_0 [this]\n" +
+ " 10 invokespecial X$1(X) [14]\n" +
+ " 13 putfield X.x : X [17]\n" +
+ " 16 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 7]\n" +
+ " [pc: 4, line: 8]\n" +
+ " [pc: 16, line: 7]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 17] local: this index: 0 type: X\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #23 @Readonly(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 5\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -2234,21 +2234,21 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " void foo(java.util.List l);\n" +
- " 0 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 10]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
- " [pc: 0, pc: 1] local: l index: 1 type: java.util.List\n" +
- " Local variable type table:\n" +
- " [pc: 0, pc: 1] local: l index: 1 type: java.util.List<?>\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #23 @Readonly(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " location = [TYPE_ARGUMENT(0)]\n" +
- " )\n" +
+ " void foo(java.util.List l);\n" +
+ " 0 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 10]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 1] local: l index: 1 type: java.util.List\n" +
+ " Local variable type table:\n" +
+ " [pc: 0, pc: 1] local: l index: 1 type: java.util.List<?>\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #23 @Readonly(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " location = [TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -2272,16 +2272,16 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #27 @Readonly(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 8\n" +
- " location = [INNER_TYPE]\n" +
- " )\n" +
- " #27 @Readonly(\n" +
- " target type = 0x40 LOCAL_VARIABLE\n" +
- " local variable entries:\n" +
- " [pc: 8, pc: 21] index: 1\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #27 @Readonly(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 8\n" +
+ " location = [INNER_TYPE]\n" +
+ " )\n" +
+ " #27 @Readonly(\n" +
+ " target type = 0x40 LOCAL_VARIABLE\n" +
+ " local variable entries:\n" +
+ " [pc: 8, pc: 21] index: 1\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -2307,19 +2307,19 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #21 @A(\n" +
- " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 0 type parameter bound index = 0\n" +
- " )\n" +
- " #22 @B(\n" +
- " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 0 type parameter bound index = 1\n" +
- " )\n" +
- " #23 @C(\n" +
- " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 1 type parameter bound index = 1\n" +
- " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #21 @A(\n" +
+ " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 0 type parameter bound index = 0\n" +
+ " )\n" +
+ " #22 @B(\n" +
+ " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 0 type parameter bound index = 1\n" +
+ " )\n" +
+ " #23 @C(\n" +
+ " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 1 type parameter bound index = 1\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -2357,27 +2357,27 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " java.util.Map f;\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #10 @A(\n" +
- " target type = 0x13 FIELD\n" +
- " )\n" +
- " #11 @B(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " #12 @C(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(0), WILDCARD]\n" +
- " )\n" +
- " #13 @D(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(1)]\n" +
- " )\n" +
- " #14 @E(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(1), TYPE_ARGUMENT(0)]\n" +
- " )\n" +
+ " java.util.Map f;\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #10 @A(\n" +
+ " target type = 0x13 FIELD\n" +
+ " )\n" +
+ " #11 @B(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " #12 @C(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(0), WILDCARD]\n" +
+ " )\n" +
+ " #13 @D(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(1)]\n" +
+ " )\n" +
+ " #14 @E(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(1), TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
" \n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -2418,46 +2418,46 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
// 0: #14(): METHOD_FORMAL_PARAMETER, param_index=0, location=[INNER_TYPE]
// 1: #16(): METHOD_FORMAL_PARAMETER, param_index=0
String expectedOutput =
- " // Method descriptor #15 (Lpkg/Clazz$Inner;)V\n" +
- " public abstract void n1(pkg.Clazz.Inner arg0);\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #17 @pkg.I(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " location = [INNER_TYPE]\n" +
- " )\n" +
- " \n" +
-
- " // Method descriptor #15 (Lpkg/Clazz$Inner;)V\n" +
- " public abstract void n2(pkg.Clazz.Inner arg0);\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #19 @pkg.O(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " )\n" +
- " #17 @pkg.I(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " location = [INNER_TYPE]\n" +
- " )\n" +
- " \n" +
-
- " // Method descriptor #15 (Lpkg/Clazz$Inner;)V\n" +
- " public abstract void n3(pkg.Clazz.Inner arg0);\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #19 @pkg.O(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " )\n" +
- " #17 @pkg.I(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " location = [INNER_TYPE]\n" +
- " )\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #24 pkg/Clazz$Inner, outer class info: #1 pkg/Clazz\n" +
- " inner name: #26 Inner, accessflags: 1 public]\n" +
+ " // Method descriptor #15 (Lpkg/Clazz$Inner;)V\n" +
+ " public abstract void n1(pkg.Clazz.Inner arg0);\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #17 @pkg.I(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " location = [INNER_TYPE]\n" +
+ " )\n" +
+ " \n" +
+
+ " // Method descriptor #15 (Lpkg/Clazz$Inner;)V\n" +
+ " public abstract void n2(pkg.Clazz.Inner arg0);\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #19 @pkg.O(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " )\n" +
+ " #17 @pkg.I(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " location = [INNER_TYPE]\n" +
+ " )\n" +
+ " \n" +
+
+ " // Method descriptor #15 (Lpkg/Clazz$Inner;)V\n" +
+ " public abstract void n3(pkg.Clazz.Inner arg0);\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #19 @pkg.O(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " )\n" +
+ " #17 @pkg.I(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " location = [INNER_TYPE]\n" +
+ " )\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #24 pkg/Clazz$Inner, outer class info: #1 pkg/Clazz\n" +
+ " inner name: #26 Inner, accessflags: 1 public]\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "pkg" + File.separator + "Clazz.class", "pkg.Clazz", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -2490,24 +2490,24 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
"");
String expectedOutput =
- " // Field descriptor #6 [[[Ljava/lang/String;\n" +
- " java.lang.String[][][] f;\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #8 @I(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY, ARRAY]\n" +
- " )\n" +
- " #9 @F(\n" +
- " target type = 0x13 FIELD\n" +
- " )\n" +
- " #10 @G(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " #11 @H(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
+ " // Field descriptor #6 [[[Ljava/lang/String;\n" +
+ " java.lang.String[][][] f;\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #8 @I(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #9 @F(\n" +
+ " target type = 0x13 FIELD\n" +
+ " )\n" +
+ " #10 @G(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " #11 @H(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
" \n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "Z", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -2547,24 +2547,24 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
"");
String expectedOutput =
- " // Field descriptor #6 LO1$O2$O3$Nested;\n" +
- " O1$O2$O3$Nested f;\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #8 @M(\n" +
- " target type = 0x13 FIELD\n" +
- " )\n" +
- " #9 @L(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [INNER_TYPE]\n" +
- " )\n" +
- " #10 @K(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [INNER_TYPE, INNER_TYPE]\n" +
- " )\n" +
- " #11 @J(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [INNER_TYPE, INNER_TYPE, INNER_TYPE]\n" +
- " )\n" +
+ " // Field descriptor #6 LO1$O2$O3$Nested;\n" +
+ " O1$O2$O3$Nested f;\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #8 @M(\n" +
+ " target type = 0x13 FIELD\n" +
+ " )\n" +
+ " #9 @L(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [INNER_TYPE]\n" +
+ " )\n" +
+ " #10 @K(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [INNER_TYPE, INNER_TYPE]\n" +
+ " )\n" +
+ " #11 @J(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [INNER_TYPE, INNER_TYPE, INNER_TYPE]\n" +
+ " )\n" +
" \n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "Z", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -2616,39 +2616,39 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
"");
String expectedOutput =
- " java.util.Map f;\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #10 @A(\n" +
- " target type = 0x13 FIELD\n" +
- " )\n" +
- " #11 @B(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " #12 @F(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(0), TYPE_ARGUMENT(0), ARRAY, ARRAY, ARRAY]\n" +
- " )\n" +
- " #13 @C(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(0), TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " #14 @D(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(0), TYPE_ARGUMENT(0), ARRAY]\n" +
- " )\n" +
- " #15 @E(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(0), TYPE_ARGUMENT(0), ARRAY, ARRAY]\n" +
- " )\n" +
- " #16 @G(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(1)]\n" +
- " )\n" +
- " #17 @H(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(1), TYPE_ARGUMENT(0)]\n" +
- " )\n" +
+ " java.util.Map f;\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #10 @A(\n" +
+ " target type = 0x13 FIELD\n" +
+ " )\n" +
+ " #11 @B(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " #12 @F(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(0), TYPE_ARGUMENT(0), ARRAY, ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #13 @C(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(0), TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " #14 @D(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(0), TYPE_ARGUMENT(0), ARRAY]\n" +
+ " )\n" +
+ " #15 @E(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(0), TYPE_ARGUMENT(0), ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #16 @G(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(1)]\n" +
+ " )\n" +
+ " #17 @H(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(1), TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
" \n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "Z", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -2709,41 +2709,41 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
"");
String expectedOutput =
- " // Field descriptor #6 LO1$O2$O3$Nested;\n" +
- " // Signature: LO1$O2<LS;LT;>.O3.Nested<LU;LV;>;\n" +
- " O1$O2$O3$Nested f;\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #10 @H(\n" +
- " target type = 0x13 FIELD\n" +
- " )\n" +
- " #11 @E(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [INNER_TYPE]\n" +
- " )\n" +
- " #12 @D(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [INNER_TYPE, INNER_TYPE]\n" +
- " )\n" +
- " #13 @A(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [INNER_TYPE, INNER_TYPE, INNER_TYPE]\n" +
- " )\n" +
- " #14 @F(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [INNER_TYPE, TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " #15 @G(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [INNER_TYPE, TYPE_ARGUMENT(1)]\n" +
- " )\n" +
- " #16 @B(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [INNER_TYPE, INNER_TYPE, INNER_TYPE, TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " #17 @C(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [INNER_TYPE, INNER_TYPE, INNER_TYPE, TYPE_ARGUMENT(1)]\n" +
- " )\n" +
+ " // Field descriptor #6 LO1$O2$O3$Nested;\n" +
+ " // Signature: LO1$O2<LS;LT;>.O3.Nested<LU;LV;>;\n" +
+ " O1$O2$O3$Nested f;\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #10 @H(\n" +
+ " target type = 0x13 FIELD\n" +
+ " )\n" +
+ " #11 @E(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [INNER_TYPE]\n" +
+ " )\n" +
+ " #12 @D(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [INNER_TYPE, INNER_TYPE]\n" +
+ " )\n" +
+ " #13 @A(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [INNER_TYPE, INNER_TYPE, INNER_TYPE]\n" +
+ " )\n" +
+ " #14 @F(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [INNER_TYPE, TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " #15 @G(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [INNER_TYPE, TYPE_ARGUMENT(1)]\n" +
+ " )\n" +
+ " #16 @B(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [INNER_TYPE, INNER_TYPE, INNER_TYPE, TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " #17 @C(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [INNER_TYPE, INNER_TYPE, INNER_TYPE, TYPE_ARGUMENT(1)]\n" +
+ " )\n" +
" \n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "Z", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -2792,31 +2792,31 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #21 @Readonly(\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = 0\n" +
- " )\n" +
- " #22 @NonNull(\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = 0\n" +
- " location = [TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " #23 @NonEmpty(\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = 0\n" +
- " location = [TYPE_ARGUMENT(1)]\n" +
- " )\n" +
- " #22 @NonNull(\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = 0\n" +
- " location = [TYPE_ARGUMENT(1), TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " #21 @Readonly(\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = 0\n" +
- " location = [TYPE_ARGUMENT(1), TYPE_ARGUMENT(0)]\n" +
- " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #21 @Readonly(\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = 0\n" +
+ " )\n" +
+ " #22 @NonNull(\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = 0\n" +
+ " location = [TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " #23 @NonEmpty(\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = 0\n" +
+ " location = [TYPE_ARGUMENT(1)]\n" +
+ " )\n" +
+ " #22 @NonNull(\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = 0\n" +
+ " location = [TYPE_ARGUMENT(1), TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " #21 @Readonly(\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = 0\n" +
+ " location = [TYPE_ARGUMENT(1), TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "Z", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -2840,69 +2840,69 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest {
"");
String expectedOutput =
- " // Field descriptor #6 LX$Y;\n" +
- " X$Y xy;\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #8 @B(\n" +
- " #9 value=(int) 1 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " )\n" +
- " #8 @B(\n" +
- " #9 value=(int) 2 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [INNER_TYPE]\n" +
- " )\n" +
- " \n" +
- " // Method descriptor #13 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [15]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 5]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- " \n" +
- " // Method descriptor #22 (LX$Y;)V\n" +
- " // Stack: 1, Locals: 3\n" +
- " void foo(X.Y xy);\n" +
- " 0 aconst_null\n" +
- " 1 astore_2 [local]\n" +
- " 2 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 10]\n" +
- " [pc: 2, line: 11]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 3] local: this index: 0 type: X\n" +
- " [pc: 0, pc: 3] local: xy index: 1 type: X.Y\n" +
- " [pc: 2, pc: 3] local: local index: 2 type: X.Y\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #8 @B(\n" +
- " #9 value=(int) 5 (constant type)\n" +
- " target type = 0x40 LOCAL_VARIABLE\n" +
- " local variable entries:\n" +
- " [pc: 2, pc: 3] index: 2\n" +
- " )\n" +
- " #8 @B(\n" +
- " #9 value=(int) 6 (constant type)\n" +
- " target type = 0x40 LOCAL_VARIABLE\n" +
- " local variable entries:\n" +
- " [pc: 2, pc: 3] index: 2\n" +
- " location = [INNER_TYPE]\n" +
- " )\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #8 @B(\n" +
- " #9 value=(int) 3 (constant type)\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " )\n" +
- " #8 @B(\n" +
- " #9 value=(int) 4 (constant type)\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " location = [INNER_TYPE]\n" +
- " )\n" +
+ " // Field descriptor #6 LX$Y;\n" +
+ " X$Y xy;\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #8 @B(\n" +
+ " #9 value=(int) 1 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " )\n" +
+ " #8 @B(\n" +
+ " #9 value=(int) 2 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [INNER_TYPE]\n" +
+ " )\n" +
+ " \n" +
+ " // Method descriptor #13 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [15]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 5]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
+ " \n" +
+ " // Method descriptor #22 (LX$Y;)V\n" +
+ " // Stack: 1, Locals: 3\n" +
+ " void foo(X.Y xy);\n" +
+ " 0 aconst_null\n" +
+ " 1 astore_2 [local]\n" +
+ " 2 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 10]\n" +
+ " [pc: 2, line: 11]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 3] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 3] local: xy index: 1 type: X.Y\n" +
+ " [pc: 2, pc: 3] local: local index: 2 type: X.Y\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #8 @B(\n" +
+ " #9 value=(int) 5 (constant type)\n" +
+ " target type = 0x40 LOCAL_VARIABLE\n" +
+ " local variable entries:\n" +
+ " [pc: 2, pc: 3] index: 2\n" +
+ " )\n" +
+ " #8 @B(\n" +
+ " #9 value=(int) 6 (constant type)\n" +
+ " target type = 0x40 LOCAL_VARIABLE\n" +
+ " local variable entries:\n" +
+ " [pc: 2, pc: 3] index: 2\n" +
+ " location = [INNER_TYPE]\n" +
+ " )\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #8 @B(\n" +
+ " #9 value=(int) 3 (constant type)\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " )\n" +
+ " #8 @B(\n" +
+ " #9 value=(int) 4 (constant type)\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " location = [INNER_TYPE]\n" +
+ " )\n" +
"\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "Z", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR335ClassFileTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR335ClassFileTest.java
index a5a229461..f5ae24c04 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR335ClassFileTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR335ClassFileTest.java
@@ -89,84 +89,84 @@ public void test001() throws Exception {
);
String expectedOutput =
- "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
- "public class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"referenceExpression\"\n" +
- " constant #6 utf8: \"Ljava/lang/Runnable;\"\n" +
- " constant #7 utf8: \"<init>\"\n" +
- " constant #8 utf8: \"()V\"\n" +
- " constant #9 utf8: \"Code\"\n" +
- " constant #10 method_ref: #3.#11 java/lang/Object.<init> ()V\n" +
- " constant #11 name_and_type: #7.#8 <init> ()V\n" +
- " constant #12 invoke dynamic: #0 #13 run ()Ljava/lang/Runnable;\n" +
- " constant #13 name_and_type: #14.#15 run ()Ljava/lang/Runnable;\n" +
- " constant #14 utf8: \"run\"\n" +
- " constant #15 utf8: \"()Ljava/lang/Runnable;\"\n" +
- " constant #16 field_ref: #1.#17 X.referenceExpression Ljava/lang/Runnable;\n" +
- " constant #17 name_and_type: #5.#6 referenceExpression Ljava/lang/Runnable;\n" +
- " constant #18 utf8: \"LineNumberTable\"\n" +
- " constant #19 utf8: \"LocalVariableTable\"\n" +
- " constant #20 utf8: \"this\"\n" +
- " constant #21 utf8: \"LX;\"\n" +
- " constant #22 utf8: \"SourceFile\"\n" +
- " constant #23 utf8: \"X.java\"\n" +
- " constant #24 utf8: \"BootstrapMethods\"\n" +
- " constant #25 method_ref: #26.#28 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #26 class: #27 java/lang/invoke/LambdaMetafactory\n" +
- " constant #27 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
- " constant #28 name_and_type: #29.#30 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #29 utf8: \"metafactory\"\n" +
- " constant #30 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
- " constant #31 method handle: invokestatic (6) #25 \n" +
- " constant #32 method type: #8 ()V\n" +
- " constant #33 method_ref: #34.#36 java/lang/Thread.yield ()V\n" +
- " constant #34 class: #35 java/lang/Thread\n" +
- " constant #35 utf8: \"java/lang/Thread\"\n" +
- " constant #36 name_and_type: #37.#8 yield ()V\n" +
- " constant #37 utf8: \"yield\"\n" +
- " constant #38 method handle: invokestatic (6) #33 \n" +
- " constant #39 method type: #8 ()V\n" +
- " constant #40 utf8: \"InnerClasses\"\n" +
- " constant #41 class: #42 java/lang/invoke/MethodHandles$Lookup\n" +
- " constant #42 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
- " constant #43 class: #44 java/lang/invoke/MethodHandles\n" +
- " constant #44 utf8: \"java/lang/invoke/MethodHandles\"\n" +
- " constant #45 utf8: \"Lookup\"\n" +
- " \n" +
- " // Field descriptor #6 Ljava/lang/Runnable;\n" +
- " public java.lang.Runnable referenceExpression;\n" +
- " \n" +
- " // Method descriptor #8 ()V\n" +
- " // Stack: 2, Locals: 1\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [10]\n" +
- " 4 aload_0 [this]\n" +
- " 5 invokedynamic 0 run() : java.lang.Runnable [12]\n" +
- " 10 putfield X.referenceExpression : java.lang.Runnable [16]\n" +
- " 13 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
- " [pc: 4, line: 2]\n" +
- " [pc: 13, line: 1]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #41 java/lang/invoke/MethodHandles$Lookup, outer class info: #43 java/lang/invoke/MethodHandles\n" +
- " inner name: #45 Lookup, accessflags: 25 public static final]\n" +
- "Bootstrap methods:\n" +
- " 0 : # 31 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
- "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " Method arguments:\n" +
- " #32 ()V\n" +
- " #38 invokestatic java/lang/Thread.yield:()V\n" +
- " #39 ()V\n" +
+ "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
+ "public class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"referenceExpression\"\n" +
+ " constant #6 utf8: \"Ljava/lang/Runnable;\"\n" +
+ " constant #7 utf8: \"<init>\"\n" +
+ " constant #8 utf8: \"()V\"\n" +
+ " constant #9 utf8: \"Code\"\n" +
+ " constant #10 method_ref: #3.#11 java/lang/Object.<init> ()V\n" +
+ " constant #11 name_and_type: #7.#8 <init> ()V\n" +
+ " constant #12 invoke dynamic: #0 #13 run ()Ljava/lang/Runnable;\n" +
+ " constant #13 name_and_type: #14.#15 run ()Ljava/lang/Runnable;\n" +
+ " constant #14 utf8: \"run\"\n" +
+ " constant #15 utf8: \"()Ljava/lang/Runnable;\"\n" +
+ " constant #16 field_ref: #1.#17 X.referenceExpression Ljava/lang/Runnable;\n" +
+ " constant #17 name_and_type: #5.#6 referenceExpression Ljava/lang/Runnable;\n" +
+ " constant #18 utf8: \"LineNumberTable\"\n" +
+ " constant #19 utf8: \"LocalVariableTable\"\n" +
+ " constant #20 utf8: \"this\"\n" +
+ " constant #21 utf8: \"LX;\"\n" +
+ " constant #22 utf8: \"SourceFile\"\n" +
+ " constant #23 utf8: \"X.java\"\n" +
+ " constant #24 utf8: \"BootstrapMethods\"\n" +
+ " constant #25 method_ref: #26.#28 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #26 class: #27 java/lang/invoke/LambdaMetafactory\n" +
+ " constant #27 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
+ " constant #28 name_and_type: #29.#30 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #29 utf8: \"metafactory\"\n" +
+ " constant #30 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
+ " constant #31 method handle: invokestatic (6) #25 \n" +
+ " constant #32 method type: #8 ()V\n" +
+ " constant #33 method_ref: #34.#36 java/lang/Thread.yield ()V\n" +
+ " constant #34 class: #35 java/lang/Thread\n" +
+ " constant #35 utf8: \"java/lang/Thread\"\n" +
+ " constant #36 name_and_type: #37.#8 yield ()V\n" +
+ " constant #37 utf8: \"yield\"\n" +
+ " constant #38 method handle: invokestatic (6) #33 \n" +
+ " constant #39 method type: #8 ()V\n" +
+ " constant #40 utf8: \"InnerClasses\"\n" +
+ " constant #41 class: #42 java/lang/invoke/MethodHandles$Lookup\n" +
+ " constant #42 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
+ " constant #43 class: #44 java/lang/invoke/MethodHandles\n" +
+ " constant #44 utf8: \"java/lang/invoke/MethodHandles\"\n" +
+ " constant #45 utf8: \"Lookup\"\n" +
+ " \n" +
+ " // Field descriptor #6 Ljava/lang/Runnable;\n" +
+ " public java.lang.Runnable referenceExpression;\n" +
+ " \n" +
+ " // Method descriptor #8 ()V\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [10]\n" +
+ " 4 aload_0 [this]\n" +
+ " 5 invokedynamic 0 run() : java.lang.Runnable [12]\n" +
+ " 10 putfield X.referenceExpression : java.lang.Runnable [16]\n" +
+ " 13 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
+ " [pc: 4, line: 2]\n" +
+ " [pc: 13, line: 1]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #41 java/lang/invoke/MethodHandles$Lookup, outer class info: #43 java/lang/invoke/MethodHandles\n" +
+ " inner name: #45 Lookup, accessflags: 25 public static final]\n" +
+ "Bootstrap methods:\n" +
+ " 0 : # 31 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
+ "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " Method arguments:\n" +
+ " #32 ()V\n" +
+ " #38 invokestatic java/lang/Thread.yield:()V\n" +
+ " #39 ()V\n" +
"}";
verifyClassFile(expectedOutput, "X.class", ClassFileBytesDisassembler.SYSTEM);
@@ -196,85 +196,85 @@ public void test002() throws Exception {
);
String expectedOutput =
- "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
- "public class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"referenceExpression\"\n" +
- " constant #6 utf8: \"LObjectConsumer;\"\n" +
- " constant #7 utf8: \"<init>\"\n" +
- " constant #8 utf8: \"()V\"\n" +
- " constant #9 utf8: \"Code\"\n" +
- " constant #10 method_ref: #3.#11 java/lang/Object.<init> ()V\n" +
- " constant #11 name_and_type: #7.#8 <init> ()V\n" +
- " constant #12 invoke dynamic: #0 #13 consume ()LObjectConsumer;\n" +
- " constant #13 name_and_type: #14.#15 consume ()LObjectConsumer;\n" +
- " constant #14 utf8: \"consume\"\n" +
- " constant #15 utf8: \"()LObjectConsumer;\"\n" +
- " constant #16 field_ref: #1.#17 X.referenceExpression LObjectConsumer;\n" +
- " constant #17 name_and_type: #5.#6 referenceExpression LObjectConsumer;\n" +
- " constant #18 utf8: \"LineNumberTable\"\n" +
- " constant #19 utf8: \"LocalVariableTable\"\n" +
- " constant #20 utf8: \"this\"\n" +
- " constant #21 utf8: \"LX;\"\n" +
- " constant #22 utf8: \"SourceFile\"\n" +
- " constant #23 utf8: \"X.java\"\n" +
- " constant #24 utf8: \"BootstrapMethods\"\n" +
- " constant #25 method_ref: #26.#28 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #26 class: #27 java/lang/invoke/LambdaMetafactory\n" +
- " constant #27 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
- " constant #28 name_and_type: #29.#30 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #29 utf8: \"metafactory\"\n" +
- " constant #30 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
- " constant #31 method handle: invokestatic (6) #25 \n" +
- " constant #32 utf8: \"(Ljava/lang/Object;)V\"\n" +
- " constant #33 method type: #32 (Ljava/lang/Object;)V\n" +
- " constant #34 method_ref: #35.#37 Main.printIt (Ljava/lang/Object;)V\n" +
- " constant #35 class: #36 Main\n" +
- " constant #36 utf8: \"Main\"\n" +
- " constant #37 name_and_type: #38.#32 printIt (Ljava/lang/Object;)V\n" +
- " constant #38 utf8: \"printIt\"\n" +
- " constant #39 method handle: invokestatic (6) #34 \n" +
- " constant #40 method type: #32 (Ljava/lang/Object;)V\n" +
- " constant #41 utf8: \"InnerClasses\"\n" +
- " constant #42 class: #43 java/lang/invoke/MethodHandles$Lookup\n" +
- " constant #43 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
- " constant #44 class: #45 java/lang/invoke/MethodHandles\n" +
- " constant #45 utf8: \"java/lang/invoke/MethodHandles\"\n" +
- " constant #46 utf8: \"Lookup\"\n" +
- " \n" +
- " // Field descriptor #6 LObjectConsumer;\n" +
- " public ObjectConsumer referenceExpression;\n" +
- " \n" +
- " // Method descriptor #8 ()V\n" +
- " // Stack: 2, Locals: 1\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [10]\n" +
- " 4 aload_0 [this]\n" +
- " 5 invokedynamic 0 consume() : ObjectConsumer [12]\n" +
- " 10 putfield X.referenceExpression : ObjectConsumer [16]\n" +
- " 13 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
- " [pc: 4, line: 2]\n" +
- " [pc: 13, line: 1]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #42 java/lang/invoke/MethodHandles$Lookup, outer class info: #44 java/lang/invoke/MethodHandles\n" +
- " inner name: #46 Lookup, accessflags: 25 public static final]\n" +
- "Bootstrap methods:\n" +
- " 0 : # 31 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup" +
- ";Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " Method arguments:\n" +
- " #33 (Ljava/lang/Object;)V\n" +
- " #39 invokestatic Main.printIt:(Ljava/lang/Object;)V\n" +
- " #40 (Ljava/lang/Object;)V\n" +
+ "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
+ "public class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"referenceExpression\"\n" +
+ " constant #6 utf8: \"LObjectConsumer;\"\n" +
+ " constant #7 utf8: \"<init>\"\n" +
+ " constant #8 utf8: \"()V\"\n" +
+ " constant #9 utf8: \"Code\"\n" +
+ " constant #10 method_ref: #3.#11 java/lang/Object.<init> ()V\n" +
+ " constant #11 name_and_type: #7.#8 <init> ()V\n" +
+ " constant #12 invoke dynamic: #0 #13 consume ()LObjectConsumer;\n" +
+ " constant #13 name_and_type: #14.#15 consume ()LObjectConsumer;\n" +
+ " constant #14 utf8: \"consume\"\n" +
+ " constant #15 utf8: \"()LObjectConsumer;\"\n" +
+ " constant #16 field_ref: #1.#17 X.referenceExpression LObjectConsumer;\n" +
+ " constant #17 name_and_type: #5.#6 referenceExpression LObjectConsumer;\n" +
+ " constant #18 utf8: \"LineNumberTable\"\n" +
+ " constant #19 utf8: \"LocalVariableTable\"\n" +
+ " constant #20 utf8: \"this\"\n" +
+ " constant #21 utf8: \"LX;\"\n" +
+ " constant #22 utf8: \"SourceFile\"\n" +
+ " constant #23 utf8: \"X.java\"\n" +
+ " constant #24 utf8: \"BootstrapMethods\"\n" +
+ " constant #25 method_ref: #26.#28 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #26 class: #27 java/lang/invoke/LambdaMetafactory\n" +
+ " constant #27 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
+ " constant #28 name_and_type: #29.#30 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #29 utf8: \"metafactory\"\n" +
+ " constant #30 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
+ " constant #31 method handle: invokestatic (6) #25 \n" +
+ " constant #32 utf8: \"(Ljava/lang/Object;)V\"\n" +
+ " constant #33 method type: #32 (Ljava/lang/Object;)V\n" +
+ " constant #34 method_ref: #35.#37 Main.printIt (Ljava/lang/Object;)V\n" +
+ " constant #35 class: #36 Main\n" +
+ " constant #36 utf8: \"Main\"\n" +
+ " constant #37 name_and_type: #38.#32 printIt (Ljava/lang/Object;)V\n" +
+ " constant #38 utf8: \"printIt\"\n" +
+ " constant #39 method handle: invokestatic (6) #34 \n" +
+ " constant #40 method type: #32 (Ljava/lang/Object;)V\n" +
+ " constant #41 utf8: \"InnerClasses\"\n" +
+ " constant #42 class: #43 java/lang/invoke/MethodHandles$Lookup\n" +
+ " constant #43 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
+ " constant #44 class: #45 java/lang/invoke/MethodHandles\n" +
+ " constant #45 utf8: \"java/lang/invoke/MethodHandles\"\n" +
+ " constant #46 utf8: \"Lookup\"\n" +
+ " \n" +
+ " // Field descriptor #6 LObjectConsumer;\n" +
+ " public ObjectConsumer referenceExpression;\n" +
+ " \n" +
+ " // Method descriptor #8 ()V\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [10]\n" +
+ " 4 aload_0 [this]\n" +
+ " 5 invokedynamic 0 consume() : ObjectConsumer [12]\n" +
+ " 10 putfield X.referenceExpression : ObjectConsumer [16]\n" +
+ " 13 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
+ " [pc: 4, line: 2]\n" +
+ " [pc: 13, line: 1]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #42 java/lang/invoke/MethodHandles$Lookup, outer class info: #44 java/lang/invoke/MethodHandles\n" +
+ " inner name: #46 Lookup, accessflags: 25 public static final]\n" +
+ "Bootstrap methods:\n" +
+ " 0 : # 31 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup" +
+ ";Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " Method arguments:\n" +
+ " #33 (Ljava/lang/Object;)V\n" +
+ " #39 invokestatic Main.printIt:(Ljava/lang/Object;)V\n" +
+ " #40 (Ljava/lang/Object;)V\n" +
"}";
verifyClassFile(expectedOutput, "X.class", ClassFileBytesDisassembler.SYSTEM);
@@ -305,84 +305,84 @@ public void test003() throws Exception {
);
String expectedOutput =
- "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
- "public class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"referenceExpression\"\n" +
- " constant #6 utf8: \"LObjectToString;\"\n" +
- " constant #7 utf8: \"<init>\"\n" +
- " constant #8 utf8: \"()V\"\n" +
- " constant #9 utf8: \"Code\"\n" +
- " constant #10 method_ref: #3.#11 java/lang/Object.<init> ()V\n" +
- " constant #11 name_and_type: #7.#8 <init> ()V\n" +
- " constant #12 invoke dynamic: #0 #13 makeString ()LObjectToString;\n" +
- " constant #13 name_and_type: #14.#15 makeString ()LObjectToString;\n" +
- " constant #14 utf8: \"makeString\"\n" +
- " constant #15 utf8: \"()LObjectToString;\"\n" +
- " constant #16 field_ref: #1.#17 X.referenceExpression LObjectToString;\n" +
- " constant #17 name_and_type: #5.#6 referenceExpression LObjectToString;\n" +
- " constant #18 utf8: \"LineNumberTable\"\n" +
- " constant #19 utf8: \"LocalVariableTable\"\n" +
- " constant #20 utf8: \"this\"\n" +
- " constant #21 utf8: \"LX;\"\n" +
- " constant #22 utf8: \"SourceFile\"\n" +
- " constant #23 utf8: \"X.java\"\n" +
- " constant #24 utf8: \"BootstrapMethods\"\n" +
- " constant #25 method_ref: #26.#28 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #26 class: #27 java/lang/invoke/LambdaMetafactory\n" +
- " constant #27 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
- " constant #28 name_and_type: #29.#30 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #29 utf8: \"metafactory\"\n" +
- " constant #30 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
- " constant #31 method handle: invokestatic (6) #25 \n" +
- " constant #32 utf8: \"(Ljava/lang/Object;)Ljava/lang/String;\"\n" +
- " constant #33 method type: #32 (Ljava/lang/Object;)Ljava/lang/String;\n" +
- " constant #34 method_ref: #3.#35 java/lang/Object.toString ()Ljava/lang/String;\n" +
- " constant #35 name_and_type: #36.#37 toString ()Ljava/lang/String;\n" +
- " constant #36 utf8: \"toString\"\n" +
- " constant #37 utf8: \"()Ljava/lang/String;\"\n" +
- " constant #38 method handle: invokevirtual (5) #34 \n" +
- " constant #39 method type: #32 (Ljava/lang/Object;)Ljava/lang/String;\n" +
- " constant #40 utf8: \"InnerClasses\"\n" +
- " constant #41 class: #42 java/lang/invoke/MethodHandles$Lookup\n" +
- " constant #42 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
- " constant #43 class: #44 java/lang/invoke/MethodHandles\n" +
- " constant #44 utf8: \"java/lang/invoke/MethodHandles\"\n" +
- " constant #45 utf8: \"Lookup\"\n" +
- " \n" +
- " // Field descriptor #6 LObjectToString;\n" +
- " public ObjectToString referenceExpression;\n" +
- " \n" +
- " // Method descriptor #8 ()V\n" +
- " // Stack: 2, Locals: 1\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [10]\n" +
- " 4 aload_0 [this]\n" +
- " 5 invokedynamic 0 makeString() : ObjectToString [12]\n" +
- " 10 putfield X.referenceExpression : ObjectToString [16]\n" +
- " 13 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
- " [pc: 4, line: 2]\n" +
- " [pc: 13, line: 1]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #41 java/lang/invoke/MethodHandles$Lookup, outer class info: #43 java/lang/invoke/MethodHandles\n" +
- " inner name: #45 Lookup, accessflags: 25 public static final]\n" +
- "Bootstrap methods:\n" +
- " 0 : # 31 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
- "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " Method arguments:\n" +
- " #33 (Ljava/lang/Object;)Ljava/lang/String;\n" +
- " #38 java/lang/Object.toString:()Ljava/lang/String;\n" +
- " #39 (Ljava/lang/Object;)Ljava/lang/String;\n" +
+ "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
+ "public class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"referenceExpression\"\n" +
+ " constant #6 utf8: \"LObjectToString;\"\n" +
+ " constant #7 utf8: \"<init>\"\n" +
+ " constant #8 utf8: \"()V\"\n" +
+ " constant #9 utf8: \"Code\"\n" +
+ " constant #10 method_ref: #3.#11 java/lang/Object.<init> ()V\n" +
+ " constant #11 name_and_type: #7.#8 <init> ()V\n" +
+ " constant #12 invoke dynamic: #0 #13 makeString ()LObjectToString;\n" +
+ " constant #13 name_and_type: #14.#15 makeString ()LObjectToString;\n" +
+ " constant #14 utf8: \"makeString\"\n" +
+ " constant #15 utf8: \"()LObjectToString;\"\n" +
+ " constant #16 field_ref: #1.#17 X.referenceExpression LObjectToString;\n" +
+ " constant #17 name_and_type: #5.#6 referenceExpression LObjectToString;\n" +
+ " constant #18 utf8: \"LineNumberTable\"\n" +
+ " constant #19 utf8: \"LocalVariableTable\"\n" +
+ " constant #20 utf8: \"this\"\n" +
+ " constant #21 utf8: \"LX;\"\n" +
+ " constant #22 utf8: \"SourceFile\"\n" +
+ " constant #23 utf8: \"X.java\"\n" +
+ " constant #24 utf8: \"BootstrapMethods\"\n" +
+ " constant #25 method_ref: #26.#28 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #26 class: #27 java/lang/invoke/LambdaMetafactory\n" +
+ " constant #27 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
+ " constant #28 name_and_type: #29.#30 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #29 utf8: \"metafactory\"\n" +
+ " constant #30 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
+ " constant #31 method handle: invokestatic (6) #25 \n" +
+ " constant #32 utf8: \"(Ljava/lang/Object;)Ljava/lang/String;\"\n" +
+ " constant #33 method type: #32 (Ljava/lang/Object;)Ljava/lang/String;\n" +
+ " constant #34 method_ref: #3.#35 java/lang/Object.toString ()Ljava/lang/String;\n" +
+ " constant #35 name_and_type: #36.#37 toString ()Ljava/lang/String;\n" +
+ " constant #36 utf8: \"toString\"\n" +
+ " constant #37 utf8: \"()Ljava/lang/String;\"\n" +
+ " constant #38 method handle: invokevirtual (5) #34 \n" +
+ " constant #39 method type: #32 (Ljava/lang/Object;)Ljava/lang/String;\n" +
+ " constant #40 utf8: \"InnerClasses\"\n" +
+ " constant #41 class: #42 java/lang/invoke/MethodHandles$Lookup\n" +
+ " constant #42 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
+ " constant #43 class: #44 java/lang/invoke/MethodHandles\n" +
+ " constant #44 utf8: \"java/lang/invoke/MethodHandles\"\n" +
+ " constant #45 utf8: \"Lookup\"\n" +
+ " \n" +
+ " // Field descriptor #6 LObjectToString;\n" +
+ " public ObjectToString referenceExpression;\n" +
+ " \n" +
+ " // Method descriptor #8 ()V\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [10]\n" +
+ " 4 aload_0 [this]\n" +
+ " 5 invokedynamic 0 makeString() : ObjectToString [12]\n" +
+ " 10 putfield X.referenceExpression : ObjectToString [16]\n" +
+ " 13 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
+ " [pc: 4, line: 2]\n" +
+ " [pc: 13, line: 1]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #41 java/lang/invoke/MethodHandles$Lookup, outer class info: #43 java/lang/invoke/MethodHandles\n" +
+ " inner name: #45 Lookup, accessflags: 25 public static final]\n" +
+ "Bootstrap methods:\n" +
+ " 0 : # 31 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
+ "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " Method arguments:\n" +
+ " #33 (Ljava/lang/Object;)Ljava/lang/String;\n" +
+ " #38 java/lang/Object.toString:()Ljava/lang/String;\n" +
+ " #39 (Ljava/lang/Object;)Ljava/lang/String;\n" +
"}";
verifyClassFile(expectedOutput, "X.class", ClassFileBytesDisassembler.SYSTEM);
@@ -410,106 +410,106 @@ public void test004() throws Exception {
);
String expectedOutput =
- "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
- "public class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"s\"\n" +
- " constant #6 utf8: \"Ljava/lang/String;\"\n" +
- " constant #7 utf8: \"referenceExpression\"\n" +
- " constant #8 utf8: \"LStringProducer;\"\n" +
- " constant #9 utf8: \"<init>\"\n" +
- " constant #10 utf8: \"()V\"\n" +
- " constant #11 utf8: \"Code\"\n" +
- " constant #12 method_ref: #3.#13 java/lang/Object.<init> ()V\n" +
- " constant #13 name_and_type: #9.#10 <init> ()V\n" +
- " constant #14 string: #15 \"SUCCESS\"\n" +
- " constant #15 utf8: \"SUCCESS\"\n" +
- " constant #16 field_ref: #1.#17 X.s Ljava/lang/String;\n" +
- " constant #17 name_and_type: #5.#6 s Ljava/lang/String;\n" +
- " constant #18 method_ref: #3.#19 java/lang/Object.getClass ()Ljava/lang/Class;\n" +
- " constant #19 name_and_type: #20.#21 getClass ()Ljava/lang/Class;\n" +
- " constant #20 utf8: \"getClass\"\n" +
- " constant #21 utf8: \"()Ljava/lang/Class;\"\n" +
- " constant #22 invoke dynamic: #0 #23 produce (Ljava/lang/String;)LStringProducer;\n" +
- " constant #23 name_and_type: #24.#25 produce (Ljava/lang/String;)LStringProducer;\n" +
- " constant #24 utf8: \"produce\"\n" +
- " constant #25 utf8: \"(Ljava/lang/String;)LStringProducer;\"\n" +
- " constant #26 field_ref: #1.#27 X.referenceExpression LStringProducer;\n" +
- " constant #27 name_and_type: #7.#8 referenceExpression LStringProducer;\n" +
- " constant #28 utf8: \"LineNumberTable\"\n" +
- " constant #29 utf8: \"LocalVariableTable\"\n" +
- " constant #30 utf8: \"this\"\n" +
- " constant #31 utf8: \"LX;\"\n" +
- " constant #32 utf8: \"SourceFile\"\n" +
- " constant #33 utf8: \"X.java\"\n" +
- " constant #34 utf8: \"BootstrapMethods\"\n" +
- " constant #35 method_ref: #36.#38 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #36 class: #37 java/lang/invoke/LambdaMetafactory\n" +
- " constant #37 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
- " constant #38 name_and_type: #39.#40 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #39 utf8: \"metafactory\"\n" +
- " constant #40 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
- " constant #41 method handle: invokestatic (6) #35 \n" +
- " constant #42 utf8: \"()Ljava/lang/String;\"\n" +
- " constant #43 method type: #42 ()Ljava/lang/String;\n" +
- " constant #44 method_ref: #45.#47 java/lang/String.toString ()Ljava/lang/String;\n" +
- " constant #45 class: #46 java/lang/String\n" +
- " constant #46 utf8: \"java/lang/String\"\n" +
- " constant #47 name_and_type: #48.#42 toString ()Ljava/lang/String;\n" +
- " constant #48 utf8: \"toString\"\n" +
- " constant #49 method handle: invokevirtual (5) #44 \n" +
- " constant #50 method type: #42 ()Ljava/lang/String;\n" +
- " constant #51 utf8: \"InnerClasses\"\n" +
- " constant #52 class: #53 java/lang/invoke/MethodHandles$Lookup\n" +
- " constant #53 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
- " constant #54 class: #55 java/lang/invoke/MethodHandles\n" +
- " constant #55 utf8: \"java/lang/invoke/MethodHandles\"\n" +
- " constant #56 utf8: \"Lookup\"\n" +
- " \n" +
- " // Field descriptor #6 Ljava/lang/String;\n" +
- " java.lang.String s;\n" +
- " \n" +
- " // Field descriptor #8 LStringProducer;\n" +
- " public StringProducer referenceExpression;\n" +
- " \n" +
- " // Method descriptor #10 ()V\n" +
- " // Stack: 3, Locals: 1\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [12]\n" +
- " 4 aload_0 [this]\n" +
- " 5 ldc <String \"SUCCESS\"> [14]\n" +
- " 7 putfield X.s : java.lang.String [16]\n" +
- " 10 aload_0 [this]\n" +
- " 11 aload_0 [this]\n" +
- " 12 getfield X.s : java.lang.String [16]\n" +
- " 15 dup\n" +
- " 16 invokevirtual java.lang.Object.getClass() : java.lang.Class [18]\n" +
- " 19 pop\n" +
- " 20 invokedynamic 0 produce(java.lang.String) : StringProducer [22]\n" +
- " 25 putfield X.referenceExpression : StringProducer [26]\n" +
- " 28 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
- " [pc: 4, line: 2]\n" +
- " [pc: 10, line: 3]\n" +
- " [pc: 28, line: 1]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 29] local: this index: 0 type: X\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #52 java/lang/invoke/MethodHandles$Lookup, outer class info: #54 java/lang/invoke/MethodHandles\n" +
- " inner name: #56 Lookup, accessflags: 25 public static final]\n" +
- "Bootstrap methods:\n" +
- " 0 : # 41 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " Method arguments:\n" +
- " #43 ()Ljava/lang/String;\n" +
- " #49 java/lang/String.toString:()Ljava/lang/String;\n" +
- " #50 ()Ljava/lang/String;\n" +
+ "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
+ "public class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"s\"\n" +
+ " constant #6 utf8: \"Ljava/lang/String;\"\n" +
+ " constant #7 utf8: \"referenceExpression\"\n" +
+ " constant #8 utf8: \"LStringProducer;\"\n" +
+ " constant #9 utf8: \"<init>\"\n" +
+ " constant #10 utf8: \"()V\"\n" +
+ " constant #11 utf8: \"Code\"\n" +
+ " constant #12 method_ref: #3.#13 java/lang/Object.<init> ()V\n" +
+ " constant #13 name_and_type: #9.#10 <init> ()V\n" +
+ " constant #14 string: #15 \"SUCCESS\"\n" +
+ " constant #15 utf8: \"SUCCESS\"\n" +
+ " constant #16 field_ref: #1.#17 X.s Ljava/lang/String;\n" +
+ " constant #17 name_and_type: #5.#6 s Ljava/lang/String;\n" +
+ " constant #18 method_ref: #3.#19 java/lang/Object.getClass ()Ljava/lang/Class;\n" +
+ " constant #19 name_and_type: #20.#21 getClass ()Ljava/lang/Class;\n" +
+ " constant #20 utf8: \"getClass\"\n" +
+ " constant #21 utf8: \"()Ljava/lang/Class;\"\n" +
+ " constant #22 invoke dynamic: #0 #23 produce (Ljava/lang/String;)LStringProducer;\n" +
+ " constant #23 name_and_type: #24.#25 produce (Ljava/lang/String;)LStringProducer;\n" +
+ " constant #24 utf8: \"produce\"\n" +
+ " constant #25 utf8: \"(Ljava/lang/String;)LStringProducer;\"\n" +
+ " constant #26 field_ref: #1.#27 X.referenceExpression LStringProducer;\n" +
+ " constant #27 name_and_type: #7.#8 referenceExpression LStringProducer;\n" +
+ " constant #28 utf8: \"LineNumberTable\"\n" +
+ " constant #29 utf8: \"LocalVariableTable\"\n" +
+ " constant #30 utf8: \"this\"\n" +
+ " constant #31 utf8: \"LX;\"\n" +
+ " constant #32 utf8: \"SourceFile\"\n" +
+ " constant #33 utf8: \"X.java\"\n" +
+ " constant #34 utf8: \"BootstrapMethods\"\n" +
+ " constant #35 method_ref: #36.#38 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #36 class: #37 java/lang/invoke/LambdaMetafactory\n" +
+ " constant #37 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
+ " constant #38 name_and_type: #39.#40 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #39 utf8: \"metafactory\"\n" +
+ " constant #40 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
+ " constant #41 method handle: invokestatic (6) #35 \n" +
+ " constant #42 utf8: \"()Ljava/lang/String;\"\n" +
+ " constant #43 method type: #42 ()Ljava/lang/String;\n" +
+ " constant #44 method_ref: #45.#47 java/lang/String.toString ()Ljava/lang/String;\n" +
+ " constant #45 class: #46 java/lang/String\n" +
+ " constant #46 utf8: \"java/lang/String\"\n" +
+ " constant #47 name_and_type: #48.#42 toString ()Ljava/lang/String;\n" +
+ " constant #48 utf8: \"toString\"\n" +
+ " constant #49 method handle: invokevirtual (5) #44 \n" +
+ " constant #50 method type: #42 ()Ljava/lang/String;\n" +
+ " constant #51 utf8: \"InnerClasses\"\n" +
+ " constant #52 class: #53 java/lang/invoke/MethodHandles$Lookup\n" +
+ " constant #53 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
+ " constant #54 class: #55 java/lang/invoke/MethodHandles\n" +
+ " constant #55 utf8: \"java/lang/invoke/MethodHandles\"\n" +
+ " constant #56 utf8: \"Lookup\"\n" +
+ " \n" +
+ " // Field descriptor #6 Ljava/lang/String;\n" +
+ " java.lang.String s;\n" +
+ " \n" +
+ " // Field descriptor #8 LStringProducer;\n" +
+ " public StringProducer referenceExpression;\n" +
+ " \n" +
+ " // Method descriptor #10 ()V\n" +
+ " // Stack: 3, Locals: 1\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [12]\n" +
+ " 4 aload_0 [this]\n" +
+ " 5 ldc <String \"SUCCESS\"> [14]\n" +
+ " 7 putfield X.s : java.lang.String [16]\n" +
+ " 10 aload_0 [this]\n" +
+ " 11 aload_0 [this]\n" +
+ " 12 getfield X.s : java.lang.String [16]\n" +
+ " 15 dup\n" +
+ " 16 invokevirtual java.lang.Object.getClass() : java.lang.Class [18]\n" +
+ " 19 pop\n" +
+ " 20 invokedynamic 0 produce(java.lang.String) : StringProducer [22]\n" +
+ " 25 putfield X.referenceExpression : StringProducer [26]\n" +
+ " 28 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
+ " [pc: 4, line: 2]\n" +
+ " [pc: 10, line: 3]\n" +
+ " [pc: 28, line: 1]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 29] local: this index: 0 type: X\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #52 java/lang/invoke/MethodHandles$Lookup, outer class info: #54 java/lang/invoke/MethodHandles\n" +
+ " inner name: #56 Lookup, accessflags: 25 public static final]\n" +
+ "Bootstrap methods:\n" +
+ " 0 : # 41 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " Method arguments:\n" +
+ " #43 ()Ljava/lang/String;\n" +
+ " #49 java/lang/String.toString:()Ljava/lang/String;\n" +
+ " #50 ()Ljava/lang/String;\n" +
"}";
verifyClassFile(expectedOutput, "X.class", ClassFileBytesDisassembler.SYSTEM);
@@ -538,88 +538,88 @@ public void test005() throws Exception {
},
"SUCCESS"
);
- verifyClassFile("// Compiled from X.java (" + this.versionString + ", super bit)\n" +
- "public class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"allocatorExpression\"\n" +
- " constant #6 utf8: \"LMainProducer;\"\n" +
- " constant #7 utf8: \"<clinit>\"\n" +
- " constant #8 utf8: \"()V\"\n" +
- " constant #9 utf8: \"Code\"\n" +
- " constant #10 invoke dynamic: #0 #11 produce ()LMainProducer;\n" +
- " constant #11 name_and_type: #12.#13 produce ()LMainProducer;\n" +
- " constant #12 utf8: \"produce\"\n" +
- " constant #13 utf8: \"()LMainProducer;\"\n" +
- " constant #14 field_ref: #1.#15 X.allocatorExpression LMainProducer;\n" +
- " constant #15 name_and_type: #5.#6 allocatorExpression LMainProducer;\n" +
- " constant #16 utf8: \"LineNumberTable\"\n" +
- " constant #17 utf8: \"LocalVariableTable\"\n" +
- " constant #18 utf8: \"<init>\"\n" +
- " constant #19 method_ref: #3.#20 java/lang/Object.<init> ()V\n" +
- " constant #20 name_and_type: #18.#8 <init> ()V\n" +
- " constant #21 utf8: \"this\"\n" +
- " constant #22 utf8: \"LX;\"\n" +
- " constant #23 utf8: \"SourceFile\"\n" +
- " constant #24 utf8: \"X.java\"\n" +
- " constant #25 utf8: \"BootstrapMethods\"\n" +
- " constant #26 method_ref: #27.#29 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #27 class: #28 java/lang/invoke/LambdaMetafactory\n" +
- " constant #28 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
- " constant #29 name_and_type: #30.#31 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #30 utf8: \"metafactory\"\n" +
- " constant #31 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
- " constant #32 method handle: invokestatic (6) #26 \n" +
- " constant #33 utf8: \"()LMain;\"\n" +
- " constant #34 method type: #33 ()LMain;\n" +
- " constant #35 method_ref: #36.#20 Main.<init> ()V\n" +
- " constant #36 class: #37 Main\n" +
- " constant #37 utf8: \"Main\"\n" +
- " constant #38 method handle: newinvokespecial (8) #35 \n" +
- " constant #39 method type: #33 ()LMain;\n" +
- " constant #40 utf8: \"InnerClasses\"\n" +
- " constant #41 class: #42 java/lang/invoke/MethodHandles$Lookup\n" +
- " constant #42 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
- " constant #43 class: #44 java/lang/invoke/MethodHandles\n" +
- " constant #44 utf8: \"java/lang/invoke/MethodHandles\"\n" +
- " constant #45 utf8: \"Lookup\"\n" +
- " \n" +
- " // Field descriptor #6 LMainProducer;\n" +
- " public static MainProducer allocatorExpression;\n" +
- " \n" +
- " // Method descriptor #8 ()V\n" +
- " // Stack: 1, Locals: 0\n" +
- " static {};\n" +
- " 0 invokedynamic 0 produce() : MainProducer [10]\n" +
- " 5 putstatic X.allocatorExpression : MainProducer [14]\n" +
- " 8 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 2]\n" +
- " \n" +
- " // Method descriptor #8 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [19]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #41 java/lang/invoke/MethodHandles$Lookup, outer class info: #43 java/lang/invoke/MethodHandles\n" +
- " inner name: #45 Lookup, accessflags: 25 public static final]\n" +
- "Bootstrap methods:\n" +
- " 0 : # 32 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
- "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " Method arguments:\n" +
- " #34 ()LMain;\n" +
- " #38 Main.<init>:()V\n" +
- " #39 ()LMain;\n" +
+ verifyClassFile("// Compiled from X.java (" + this.versionString + ", super bit)\n" +
+ "public class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"allocatorExpression\"\n" +
+ " constant #6 utf8: \"LMainProducer;\"\n" +
+ " constant #7 utf8: \"<clinit>\"\n" +
+ " constant #8 utf8: \"()V\"\n" +
+ " constant #9 utf8: \"Code\"\n" +
+ " constant #10 invoke dynamic: #0 #11 produce ()LMainProducer;\n" +
+ " constant #11 name_and_type: #12.#13 produce ()LMainProducer;\n" +
+ " constant #12 utf8: \"produce\"\n" +
+ " constant #13 utf8: \"()LMainProducer;\"\n" +
+ " constant #14 field_ref: #1.#15 X.allocatorExpression LMainProducer;\n" +
+ " constant #15 name_and_type: #5.#6 allocatorExpression LMainProducer;\n" +
+ " constant #16 utf8: \"LineNumberTable\"\n" +
+ " constant #17 utf8: \"LocalVariableTable\"\n" +
+ " constant #18 utf8: \"<init>\"\n" +
+ " constant #19 method_ref: #3.#20 java/lang/Object.<init> ()V\n" +
+ " constant #20 name_and_type: #18.#8 <init> ()V\n" +
+ " constant #21 utf8: \"this\"\n" +
+ " constant #22 utf8: \"LX;\"\n" +
+ " constant #23 utf8: \"SourceFile\"\n" +
+ " constant #24 utf8: \"X.java\"\n" +
+ " constant #25 utf8: \"BootstrapMethods\"\n" +
+ " constant #26 method_ref: #27.#29 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #27 class: #28 java/lang/invoke/LambdaMetafactory\n" +
+ " constant #28 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
+ " constant #29 name_and_type: #30.#31 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #30 utf8: \"metafactory\"\n" +
+ " constant #31 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
+ " constant #32 method handle: invokestatic (6) #26 \n" +
+ " constant #33 utf8: \"()LMain;\"\n" +
+ " constant #34 method type: #33 ()LMain;\n" +
+ " constant #35 method_ref: #36.#20 Main.<init> ()V\n" +
+ " constant #36 class: #37 Main\n" +
+ " constant #37 utf8: \"Main\"\n" +
+ " constant #38 method handle: newinvokespecial (8) #35 \n" +
+ " constant #39 method type: #33 ()LMain;\n" +
+ " constant #40 utf8: \"InnerClasses\"\n" +
+ " constant #41 class: #42 java/lang/invoke/MethodHandles$Lookup\n" +
+ " constant #42 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
+ " constant #43 class: #44 java/lang/invoke/MethodHandles\n" +
+ " constant #44 utf8: \"java/lang/invoke/MethodHandles\"\n" +
+ " constant #45 utf8: \"Lookup\"\n" +
+ " \n" +
+ " // Field descriptor #6 LMainProducer;\n" +
+ " public static MainProducer allocatorExpression;\n" +
+ " \n" +
+ " // Method descriptor #8 ()V\n" +
+ " // Stack: 1, Locals: 0\n" +
+ " static {};\n" +
+ " 0 invokedynamic 0 produce() : MainProducer [10]\n" +
+ " 5 putstatic X.allocatorExpression : MainProducer [14]\n" +
+ " 8 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 2]\n" +
+ " \n" +
+ " // Method descriptor #8 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [19]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #41 java/lang/invoke/MethodHandles$Lookup, outer class info: #43 java/lang/invoke/MethodHandles\n" +
+ " inner name: #45 Lookup, accessflags: 25 public static final]\n" +
+ "Bootstrap methods:\n" +
+ " 0 : # 32 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
+ "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " Method arguments:\n" +
+ " #34 ()LMain;\n" +
+ " #38 Main.<init>:()V\n" +
+ " #39 ()LMain;\n" +
"}", "X.class", ClassFileBytesDisassembler.SYSTEM);
}
public void test006() throws Exception {
@@ -652,94 +652,94 @@ public void test006() throws Exception {
"SUCCESS"
);
String expected =
- "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
- "public class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"producer\"\n" +
- " constant #6 utf8: \"LFunction2;\"\n" +
- " constant #7 utf8: \"Signature\"\n" +
- " constant #8 utf8: \"LFunction2<LMain;Ljava/lang/String;Ljava/lang/String;>;\"\n" +
- " constant #9 utf8: \"<clinit>\"\n" +
- " constant #10 utf8: \"()V\"\n" +
- " constant #11 utf8: \"Code\"\n" +
- " constant #12 invoke dynamic: #0 #13 apply ()LFunction2;\n" +
- " constant #13 name_and_type: #14.#15 apply ()LFunction2;\n" +
- " constant #14 utf8: \"apply\"\n" +
- " constant #15 utf8: \"()LFunction2;\"\n" +
- " constant #16 field_ref: #1.#17 X.producer LFunction2;\n" +
- " constant #17 name_and_type: #5.#6 producer LFunction2;\n" +
- " constant #18 utf8: \"LineNumberTable\"\n" +
- " constant #19 utf8: \"LocalVariableTable\"\n" +
- " constant #20 utf8: \"<init>\"\n" +
- " constant #21 method_ref: #3.#22 java/lang/Object.<init> ()V\n" +
- " constant #22 name_and_type: #20.#10 <init> ()V\n" +
- " constant #23 utf8: \"this\"\n" +
- " constant #24 utf8: \"LX;\"\n" +
- " constant #25 utf8: \"SourceFile\"\n" +
- " constant #26 utf8: \"X.java\"\n" +
- " constant #27 utf8: \"BootstrapMethods\"\n" +
- " constant #28 method_ref: #29.#31 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #29 class: #30 java/lang/invoke/LambdaMetafactory\n" +
- " constant #30 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
- " constant #31 name_and_type: #32.#33 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #32 utf8: \"metafactory\"\n" +
- " constant #33 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
- " constant #34 method handle: invokestatic (6) #28 \n" +
- " constant #35 utf8: \"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\"\n" +
- " constant #36 method type: #35 (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n" +
- " constant #37 method_ref: #38.#40 Main.<init> (Ljava/lang/String;Ljava/lang/String;)V\n" +
- " constant #38 class: #39 Main\n" +
- " constant #39 utf8: \"Main\"\n" +
- " constant #40 name_and_type: #20.#41 <init> (Ljava/lang/String;Ljava/lang/String;)V\n" +
- " constant #41 utf8: \"(Ljava/lang/String;Ljava/lang/String;)V\"\n" +
- " constant #42 method handle: newinvokespecial (8) #37 \n" +
- " constant #43 utf8: \"(Ljava/lang/String;Ljava/lang/String;)LMain;\"\n" +
- " constant #44 method type: #43 (Ljava/lang/String;Ljava/lang/String;)LMain;\n" +
- " constant #45 utf8: \"InnerClasses\"\n" +
- " constant #46 class: #47 java/lang/invoke/MethodHandles$Lookup\n" +
- " constant #47 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
- " constant #48 class: #49 java/lang/invoke/MethodHandles\n" +
- " constant #49 utf8: \"java/lang/invoke/MethodHandles\"\n" +
- " constant #50 utf8: \"Lookup\"\n" +
- " \n" +
- " // Field descriptor #6 LFunction2;\n" +
- " // Signature: LFunction2<LMain;Ljava/lang/String;Ljava/lang/String;>;\n" +
- " public static Function2 producer;\n" +
- " \n" +
- " // Method descriptor #10 ()V\n" +
- " // Stack: 1, Locals: 0\n" +
- " static {};\n" +
- " 0 invokedynamic 0 apply() : Function2 [12]\n" +
- " 5 putstatic X.producer : Function2 [16]\n" +
- " 8 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 2]\n" +
- " \n" +
- " // Method descriptor #10 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [21]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #46 java/lang/invoke/MethodHandles$Lookup, outer class info: #48 java/lang/invoke/MethodHandles\n" +
- " inner name: #50 Lookup, accessflags: 25 public static final]\n" +
- "Bootstrap methods:\n" +
- " 0 : # 34 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
- "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " Method arguments:\n" +
- " #36 (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n" +
- " #42 Main.<init>:(Ljava/lang/String;Ljava/lang/String;)V\n" +
- " #44 (Ljava/lang/String;Ljava/lang/String;)LMain;\n" +
+ "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
+ "public class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"producer\"\n" +
+ " constant #6 utf8: \"LFunction2;\"\n" +
+ " constant #7 utf8: \"Signature\"\n" +
+ " constant #8 utf8: \"LFunction2<LMain;Ljava/lang/String;Ljava/lang/String;>;\"\n" +
+ " constant #9 utf8: \"<clinit>\"\n" +
+ " constant #10 utf8: \"()V\"\n" +
+ " constant #11 utf8: \"Code\"\n" +
+ " constant #12 invoke dynamic: #0 #13 apply ()LFunction2;\n" +
+ " constant #13 name_and_type: #14.#15 apply ()LFunction2;\n" +
+ " constant #14 utf8: \"apply\"\n" +
+ " constant #15 utf8: \"()LFunction2;\"\n" +
+ " constant #16 field_ref: #1.#17 X.producer LFunction2;\n" +
+ " constant #17 name_and_type: #5.#6 producer LFunction2;\n" +
+ " constant #18 utf8: \"LineNumberTable\"\n" +
+ " constant #19 utf8: \"LocalVariableTable\"\n" +
+ " constant #20 utf8: \"<init>\"\n" +
+ " constant #21 method_ref: #3.#22 java/lang/Object.<init> ()V\n" +
+ " constant #22 name_and_type: #20.#10 <init> ()V\n" +
+ " constant #23 utf8: \"this\"\n" +
+ " constant #24 utf8: \"LX;\"\n" +
+ " constant #25 utf8: \"SourceFile\"\n" +
+ " constant #26 utf8: \"X.java\"\n" +
+ " constant #27 utf8: \"BootstrapMethods\"\n" +
+ " constant #28 method_ref: #29.#31 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #29 class: #30 java/lang/invoke/LambdaMetafactory\n" +
+ " constant #30 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
+ " constant #31 name_and_type: #32.#33 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #32 utf8: \"metafactory\"\n" +
+ " constant #33 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
+ " constant #34 method handle: invokestatic (6) #28 \n" +
+ " constant #35 utf8: \"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\"\n" +
+ " constant #36 method type: #35 (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n" +
+ " constant #37 method_ref: #38.#40 Main.<init> (Ljava/lang/String;Ljava/lang/String;)V\n" +
+ " constant #38 class: #39 Main\n" +
+ " constant #39 utf8: \"Main\"\n" +
+ " constant #40 name_and_type: #20.#41 <init> (Ljava/lang/String;Ljava/lang/String;)V\n" +
+ " constant #41 utf8: \"(Ljava/lang/String;Ljava/lang/String;)V\"\n" +
+ " constant #42 method handle: newinvokespecial (8) #37 \n" +
+ " constant #43 utf8: \"(Ljava/lang/String;Ljava/lang/String;)LMain;\"\n" +
+ " constant #44 method type: #43 (Ljava/lang/String;Ljava/lang/String;)LMain;\n" +
+ " constant #45 utf8: \"InnerClasses\"\n" +
+ " constant #46 class: #47 java/lang/invoke/MethodHandles$Lookup\n" +
+ " constant #47 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
+ " constant #48 class: #49 java/lang/invoke/MethodHandles\n" +
+ " constant #49 utf8: \"java/lang/invoke/MethodHandles\"\n" +
+ " constant #50 utf8: \"Lookup\"\n" +
+ " \n" +
+ " // Field descriptor #6 LFunction2;\n" +
+ " // Signature: LFunction2<LMain;Ljava/lang/String;Ljava/lang/String;>;\n" +
+ " public static Function2 producer;\n" +
+ " \n" +
+ " // Method descriptor #10 ()V\n" +
+ " // Stack: 1, Locals: 0\n" +
+ " static {};\n" +
+ " 0 invokedynamic 0 apply() : Function2 [12]\n" +
+ " 5 putstatic X.producer : Function2 [16]\n" +
+ " 8 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 2]\n" +
+ " \n" +
+ " // Method descriptor #10 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [21]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #46 java/lang/invoke/MethodHandles$Lookup, outer class info: #48 java/lang/invoke/MethodHandles\n" +
+ " inner name: #50 Lookup, accessflags: 25 public static final]\n" +
+ "Bootstrap methods:\n" +
+ " 0 : # 34 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
+ "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " Method arguments:\n" +
+ " #36 (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n" +
+ " #42 Main.<init>:(Ljava/lang/String;Ljava/lang/String;)V\n" +
+ " #44 (Ljava/lang/String;Ljava/lang/String;)LMain;\n" +
"}";
verifyClassFile(expected, "X.class", ClassFileBytesDisassembler.SYSTEM);
}
@@ -763,107 +763,107 @@ public void test007() throws Exception {
);
String expectedOutput =
- "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
- "public class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"referenceExpression\"\n" +
- " constant #6 utf8: \"Ljava/lang/Runnable;\"\n" +
- " constant #7 utf8: \"<init>\"\n" +
- " constant #8 utf8: \"()V\"\n" +
- " constant #9 utf8: \"Code\"\n" +
- " constant #10 method_ref: #3.#11 java/lang/Object.<init> ()V\n" +
- " constant #11 name_and_type: #7.#8 <init> ()V\n" +
- " constant #12 invoke dynamic: #0 #13 run ()Ljava/lang/Runnable;\n" +
- " constant #13 name_and_type: #14.#15 run ()Ljava/lang/Runnable;\n" +
- " constant #14 utf8: \"run\"\n" +
- " constant #15 utf8: \"()Ljava/lang/Runnable;\"\n" +
- " constant #16 field_ref: #1.#17 X.referenceExpression Ljava/lang/Runnable;\n" +
- " constant #17 name_and_type: #5.#6 referenceExpression Ljava/lang/Runnable;\n" +
- " constant #18 utf8: \"LineNumberTable\"\n" +
- " constant #19 utf8: \"LocalVariableTable\"\n" +
- " constant #20 utf8: \"this\"\n" +
- " constant #21 utf8: \"LX;\"\n" +
- " constant #22 utf8: \"lambda$0\"\n" +
- " constant #23 field_ref: #24.#26 java/lang/System.out Ljava/io/PrintStream;\n" +
- " constant #24 class: #25 java/lang/System\n" +
- " constant #25 utf8: \"java/lang/System\"\n" +
- " constant #26 name_and_type: #27.#28 out Ljava/io/PrintStream;\n" +
- " constant #27 utf8: \"out\"\n" +
- " constant #28 utf8: \"Ljava/io/PrintStream;\"\n" +
- " constant #29 string: #30 \"SUCCESS\"\n" +
- " constant #30 utf8: \"SUCCESS\"\n" +
- " constant #31 method_ref: #32.#34 java/io/PrintStream.println (Ljava/lang/String;)V\n" +
- " constant #32 class: #33 java/io/PrintStream\n" +
- " constant #33 utf8: \"java/io/PrintStream\"\n" +
- " constant #34 name_and_type: #35.#36 println (Ljava/lang/String;)V\n" +
- " constant #35 utf8: \"println\"\n" +
- " constant #36 utf8: \"(Ljava/lang/String;)V\"\n" +
- " constant #37 utf8: \"SourceFile\"\n" +
- " constant #38 utf8: \"X.java\"\n" +
- " constant #39 utf8: \"BootstrapMethods\"\n" +
- " constant #40 method_ref: #41.#43 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #41 class: #42 java/lang/invoke/LambdaMetafactory\n" +
- " constant #42 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
- " constant #43 name_and_type: #44.#45 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #44 utf8: \"metafactory\"\n" +
- " constant #45 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
- " constant #46 method handle: invokestatic (6) #40 \n" +
- " constant #47 method type: #8 ()V\n" +
- " constant #48 method_ref: #1.#49 X.lambda$0 ()V\n" +
- " constant #49 name_and_type: #22.#8 lambda$0 ()V\n" +
- " constant #50 method handle: invokestatic (6) #48 \n" +
- " constant #51 method type: #8 ()V\n" +
- " constant #52 utf8: \"InnerClasses\"\n" +
- " constant #53 class: #54 java/lang/invoke/MethodHandles$Lookup\n" +
- " constant #54 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
- " constant #55 class: #56 java/lang/invoke/MethodHandles\n" +
- " constant #56 utf8: \"java/lang/invoke/MethodHandles\"\n" +
- " constant #57 utf8: \"Lookup\"\n" +
- " \n" +
- " // Field descriptor #6 Ljava/lang/Runnable;\n" +
- " public java.lang.Runnable referenceExpression;\n" +
- " \n" +
- " // Method descriptor #8 ()V\n" +
- " // Stack: 2, Locals: 1\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [10]\n" +
- " 4 aload_0 [this]\n" +
- " 5 invokedynamic 0 run() : java.lang.Runnable [12]\n" +
- " 10 putfield X.referenceExpression : java.lang.Runnable [16]\n" +
- " 13 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
- " [pc: 4, line: 2]\n" +
- " [pc: 13, line: 1]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
- " \n" +
- " // Method descriptor #8 ()V\n" +
- " // Stack: 2, Locals: 0\n" +
- " private static synthetic void lambda$0();\n" +
- " 0 getstatic java.lang.System.out : java.io.PrintStream [23]\n" +
- " 3 ldc <String \"SUCCESS\"> [29]\n" +
- " 5 invokevirtual java.io.PrintStream.println(java.lang.String) : void [31]\n" +
- " 8 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 2]\n" +
- " [pc: 8, line: 3]\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #53 java/lang/invoke/MethodHandles$Lookup, outer class info: #55 java/lang/invoke/MethodHandles\n" +
- " inner name: #57 Lookup, accessflags: 25 public static final]\n" +
- "Bootstrap methods:\n" +
- " 0 : # 46 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
- "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " Method arguments:\n" +
- " #47 ()V\n" +
- " #50 invokestatic X.lambda$0:()V\n" +
- " #51 ()V\n" +
+ "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
+ "public class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"referenceExpression\"\n" +
+ " constant #6 utf8: \"Ljava/lang/Runnable;\"\n" +
+ " constant #7 utf8: \"<init>\"\n" +
+ " constant #8 utf8: \"()V\"\n" +
+ " constant #9 utf8: \"Code\"\n" +
+ " constant #10 method_ref: #3.#11 java/lang/Object.<init> ()V\n" +
+ " constant #11 name_and_type: #7.#8 <init> ()V\n" +
+ " constant #12 invoke dynamic: #0 #13 run ()Ljava/lang/Runnable;\n" +
+ " constant #13 name_and_type: #14.#15 run ()Ljava/lang/Runnable;\n" +
+ " constant #14 utf8: \"run\"\n" +
+ " constant #15 utf8: \"()Ljava/lang/Runnable;\"\n" +
+ " constant #16 field_ref: #1.#17 X.referenceExpression Ljava/lang/Runnable;\n" +
+ " constant #17 name_and_type: #5.#6 referenceExpression Ljava/lang/Runnable;\n" +
+ " constant #18 utf8: \"LineNumberTable\"\n" +
+ " constant #19 utf8: \"LocalVariableTable\"\n" +
+ " constant #20 utf8: \"this\"\n" +
+ " constant #21 utf8: \"LX;\"\n" +
+ " constant #22 utf8: \"lambda$0\"\n" +
+ " constant #23 field_ref: #24.#26 java/lang/System.out Ljava/io/PrintStream;\n" +
+ " constant #24 class: #25 java/lang/System\n" +
+ " constant #25 utf8: \"java/lang/System\"\n" +
+ " constant #26 name_and_type: #27.#28 out Ljava/io/PrintStream;\n" +
+ " constant #27 utf8: \"out\"\n" +
+ " constant #28 utf8: \"Ljava/io/PrintStream;\"\n" +
+ " constant #29 string: #30 \"SUCCESS\"\n" +
+ " constant #30 utf8: \"SUCCESS\"\n" +
+ " constant #31 method_ref: #32.#34 java/io/PrintStream.println (Ljava/lang/String;)V\n" +
+ " constant #32 class: #33 java/io/PrintStream\n" +
+ " constant #33 utf8: \"java/io/PrintStream\"\n" +
+ " constant #34 name_and_type: #35.#36 println (Ljava/lang/String;)V\n" +
+ " constant #35 utf8: \"println\"\n" +
+ " constant #36 utf8: \"(Ljava/lang/String;)V\"\n" +
+ " constant #37 utf8: \"SourceFile\"\n" +
+ " constant #38 utf8: \"X.java\"\n" +
+ " constant #39 utf8: \"BootstrapMethods\"\n" +
+ " constant #40 method_ref: #41.#43 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #41 class: #42 java/lang/invoke/LambdaMetafactory\n" +
+ " constant #42 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
+ " constant #43 name_and_type: #44.#45 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #44 utf8: \"metafactory\"\n" +
+ " constant #45 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
+ " constant #46 method handle: invokestatic (6) #40 \n" +
+ " constant #47 method type: #8 ()V\n" +
+ " constant #48 method_ref: #1.#49 X.lambda$0 ()V\n" +
+ " constant #49 name_and_type: #22.#8 lambda$0 ()V\n" +
+ " constant #50 method handle: invokestatic (6) #48 \n" +
+ " constant #51 method type: #8 ()V\n" +
+ " constant #52 utf8: \"InnerClasses\"\n" +
+ " constant #53 class: #54 java/lang/invoke/MethodHandles$Lookup\n" +
+ " constant #54 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
+ " constant #55 class: #56 java/lang/invoke/MethodHandles\n" +
+ " constant #56 utf8: \"java/lang/invoke/MethodHandles\"\n" +
+ " constant #57 utf8: \"Lookup\"\n" +
+ " \n" +
+ " // Field descriptor #6 Ljava/lang/Runnable;\n" +
+ " public java.lang.Runnable referenceExpression;\n" +
+ " \n" +
+ " // Method descriptor #8 ()V\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [10]\n" +
+ " 4 aload_0 [this]\n" +
+ " 5 invokedynamic 0 run() : java.lang.Runnable [12]\n" +
+ " 10 putfield X.referenceExpression : java.lang.Runnable [16]\n" +
+ " 13 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
+ " [pc: 4, line: 2]\n" +
+ " [pc: 13, line: 1]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
+ " \n" +
+ " // Method descriptor #8 ()V\n" +
+ " // Stack: 2, Locals: 0\n" +
+ " private static synthetic void lambda$0();\n" +
+ " 0 getstatic java.lang.System.out : java.io.PrintStream [23]\n" +
+ " 3 ldc <String \"SUCCESS\"> [29]\n" +
+ " 5 invokevirtual java.io.PrintStream.println(java.lang.String) : void [31]\n" +
+ " 8 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 2]\n" +
+ " [pc: 8, line: 3]\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #53 java/lang/invoke/MethodHandles$Lookup, outer class info: #55 java/lang/invoke/MethodHandles\n" +
+ " inner name: #57 Lookup, accessflags: 25 public static final]\n" +
+ "Bootstrap methods:\n" +
+ " 0 : # 46 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
+ "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " Method arguments:\n" +
+ " #47 ()V\n" +
+ " #50 invokestatic X.lambda$0:()V\n" +
+ " #51 ()V\n" +
"}";
verifyClassFile(expectedOutput, "X.class", ClassFileBytesDisassembler.SYSTEM);
@@ -886,108 +886,108 @@ public void test007a() throws Exception {
);
String expectedOutput =
- "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
- "public class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"referenceExpression\"\n" +
- " constant #6 utf8: \"Ljava/lang/Runnable;\"\n" +
- " constant #7 utf8: \"<init>\"\n" +
- " constant #8 utf8: \"()V\"\n" +
- " constant #9 utf8: \"Code\"\n" +
- " constant #10 method_ref: #3.#11 java/lang/Object.<init> ()V\n" +
- " constant #11 name_and_type: #7.#8 <init> ()V\n" +
- " constant #12 invoke dynamic: #0 #13 run ()Ljava/lang/Runnable;\n" +
- " constant #13 name_and_type: #14.#15 run ()Ljava/lang/Runnable;\n" +
- " constant #14 utf8: \"run\"\n" +
- " constant #15 utf8: \"()Ljava/lang/Runnable;\"\n" +
- " constant #16 field_ref: #1.#17 X.referenceExpression Ljava/lang/Runnable;\n" +
- " constant #17 name_and_type: #5.#6 referenceExpression Ljava/lang/Runnable;\n" +
- " constant #18 utf8: \"LineNumberTable\"\n" +
- " constant #19 utf8: \"LocalVariableTable\"\n" +
- " constant #20 utf8: \"this\"\n" +
- " constant #21 utf8: \"LX;\"\n" +
- " constant #22 utf8: \"lambda$0\"\n" +
- " constant #23 field_ref: #24.#26 java/lang/System.out Ljava/io/PrintStream;\n" +
- " constant #24 class: #25 java/lang/System\n" +
- " constant #25 utf8: \"java/lang/System\"\n" +
- " constant #26 name_and_type: #27.#28 out Ljava/io/PrintStream;\n" +
- " constant #27 utf8: \"out\"\n" +
- " constant #28 utf8: \"Ljava/io/PrintStream;\"\n" +
- " constant #29 string: #30 \"SUCCESS\"\n" +
- " constant #30 utf8: \"SUCCESS\"\n" +
- " constant #31 method_ref: #32.#34 java/io/PrintStream.println (Ljava/lang/String;)V\n" +
- " constant #32 class: #33 java/io/PrintStream\n" +
- " constant #33 utf8: \"java/io/PrintStream\"\n" +
- " constant #34 name_and_type: #35.#36 println (Ljava/lang/String;)V\n" +
- " constant #35 utf8: \"println\"\n" +
- " constant #36 utf8: \"(Ljava/lang/String;)V\"\n" +
- " constant #37 utf8: \"SourceFile\"\n" +
- " constant #38 utf8: \"X.java\"\n" +
- " constant #39 utf8: \"BootstrapMethods\"\n" +
- " constant #40 method_ref: #41.#43 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #41 class: #42 java/lang/invoke/LambdaMetafactory\n" +
- " constant #42 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
- " constant #43 name_and_type: #44.#45 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #44 utf8: \"metafactory\"\n" +
- " constant #45 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
- " constant #46 method handle: invokestatic (6) #40 \n" +
- " constant #47 method type: #8 ()V\n" +
- " constant #48 method_ref: #1.#49 X.lambda$0 ()V\n" +
- " constant #49 name_and_type: #22.#8 lambda$0 ()V\n" +
- " constant #50 method handle: invokestatic (6) #48 \n" +
- " constant #51 method type: #8 ()V\n" +
- " constant #52 utf8: \"InnerClasses\"\n" +
- " constant #53 class: #54 java/lang/invoke/MethodHandles$Lookup\n" +
- " constant #54 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
- " constant #55 class: #56 java/lang/invoke/MethodHandles\n" +
- " constant #56 utf8: \"java/lang/invoke/MethodHandles\"\n" +
- " constant #57 utf8: \"Lookup\"\n" +
- " \n" +
- " // Field descriptor #6 Ljava/lang/Runnable;\n" +
- " public java.lang.Runnable referenceExpression;\n" +
- " \n" +
- " // Method descriptor #8 ()V\n" +
- " // Stack: 2, Locals: 1\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [10]\n" +
- " 4 aload_0 [this]\n" +
- " 5 invokedynamic 0 run() : java.lang.Runnable [12]\n" +
- " 10 putfield X.referenceExpression : java.lang.Runnable [16]\n" +
- " 13 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
- " [pc: 4, line: 2]\n" +
- " [pc: 13, line: 1]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
- " \n" +
- " // Method descriptor #8 ()V\n" +
- " // Stack: 2, Locals: 0\n" +
- " private static synthetic void lambda$0();\n" +
- " 0 getstatic java.lang.System.out : java.io.PrintStream [23]\n" +
- " 3 ldc <String \"SUCCESS\"> [29]\n" +
- " 5 invokevirtual java.io.PrintStream.println(java.lang.String) : void [31]\n" +
- " 8 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 2]\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #53 java/lang/invoke/MethodHandles$Lookup, outer class info: #55 java/lang/invoke/MethodHandles\n" +
- " inner name: #57 Lookup, accessflags: 25 public static final]\n" +
- "Bootstrap methods:\n" +
- " 0 : # 46 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
- "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " Method arguments:\n" +
- " #47 ()V\n" +
- " #50 invokestatic X.lambda$0:()V\n" +
- " #51 ()V\n" +
+ "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
+ "public class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"referenceExpression\"\n" +
+ " constant #6 utf8: \"Ljava/lang/Runnable;\"\n" +
+ " constant #7 utf8: \"<init>\"\n" +
+ " constant #8 utf8: \"()V\"\n" +
+ " constant #9 utf8: \"Code\"\n" +
+ " constant #10 method_ref: #3.#11 java/lang/Object.<init> ()V\n" +
+ " constant #11 name_and_type: #7.#8 <init> ()V\n" +
+ " constant #12 invoke dynamic: #0 #13 run ()Ljava/lang/Runnable;\n" +
+ " constant #13 name_and_type: #14.#15 run ()Ljava/lang/Runnable;\n" +
+ " constant #14 utf8: \"run\"\n" +
+ " constant #15 utf8: \"()Ljava/lang/Runnable;\"\n" +
+ " constant #16 field_ref: #1.#17 X.referenceExpression Ljava/lang/Runnable;\n" +
+ " constant #17 name_and_type: #5.#6 referenceExpression Ljava/lang/Runnable;\n" +
+ " constant #18 utf8: \"LineNumberTable\"\n" +
+ " constant #19 utf8: \"LocalVariableTable\"\n" +
+ " constant #20 utf8: \"this\"\n" +
+ " constant #21 utf8: \"LX;\"\n" +
+ " constant #22 utf8: \"lambda$0\"\n" +
+ " constant #23 field_ref: #24.#26 java/lang/System.out Ljava/io/PrintStream;\n" +
+ " constant #24 class: #25 java/lang/System\n" +
+ " constant #25 utf8: \"java/lang/System\"\n" +
+ " constant #26 name_and_type: #27.#28 out Ljava/io/PrintStream;\n" +
+ " constant #27 utf8: \"out\"\n" +
+ " constant #28 utf8: \"Ljava/io/PrintStream;\"\n" +
+ " constant #29 string: #30 \"SUCCESS\"\n" +
+ " constant #30 utf8: \"SUCCESS\"\n" +
+ " constant #31 method_ref: #32.#34 java/io/PrintStream.println (Ljava/lang/String;)V\n" +
+ " constant #32 class: #33 java/io/PrintStream\n" +
+ " constant #33 utf8: \"java/io/PrintStream\"\n" +
+ " constant #34 name_and_type: #35.#36 println (Ljava/lang/String;)V\n" +
+ " constant #35 utf8: \"println\"\n" +
+ " constant #36 utf8: \"(Ljava/lang/String;)V\"\n" +
+ " constant #37 utf8: \"SourceFile\"\n" +
+ " constant #38 utf8: \"X.java\"\n" +
+ " constant #39 utf8: \"BootstrapMethods\"\n" +
+ " constant #40 method_ref: #41.#43 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #41 class: #42 java/lang/invoke/LambdaMetafactory\n" +
+ " constant #42 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
+ " constant #43 name_and_type: #44.#45 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #44 utf8: \"metafactory\"\n" +
+ " constant #45 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
+ " constant #46 method handle: invokestatic (6) #40 \n" +
+ " constant #47 method type: #8 ()V\n" +
+ " constant #48 method_ref: #1.#49 X.lambda$0 ()V\n" +
+ " constant #49 name_and_type: #22.#8 lambda$0 ()V\n" +
+ " constant #50 method handle: invokestatic (6) #48 \n" +
+ " constant #51 method type: #8 ()V\n" +
+ " constant #52 utf8: \"InnerClasses\"\n" +
+ " constant #53 class: #54 java/lang/invoke/MethodHandles$Lookup\n" +
+ " constant #54 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
+ " constant #55 class: #56 java/lang/invoke/MethodHandles\n" +
+ " constant #56 utf8: \"java/lang/invoke/MethodHandles\"\n" +
+ " constant #57 utf8: \"Lookup\"\n" +
+ " \n" +
+ " // Field descriptor #6 Ljava/lang/Runnable;\n" +
+ " public java.lang.Runnable referenceExpression;\n" +
+ " \n" +
+ " // Method descriptor #8 ()V\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [10]\n" +
+ " 4 aload_0 [this]\n" +
+ " 5 invokedynamic 0 run() : java.lang.Runnable [12]\n" +
+ " 10 putfield X.referenceExpression : java.lang.Runnable [16]\n" +
+ " 13 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
+ " [pc: 4, line: 2]\n" +
+ " [pc: 13, line: 1]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
+ " \n" +
+ " // Method descriptor #8 ()V\n" +
+ " // Stack: 2, Locals: 0\n" +
+ " private static synthetic void lambda$0();\n" +
+ " 0 getstatic java.lang.System.out : java.io.PrintStream [23]\n" +
+ " 3 ldc <String \"SUCCESS\"> [29]\n" +
+ " 5 invokevirtual java.io.PrintStream.println(java.lang.String) : void [31]\n" +
+ " 8 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 2]\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #53 java/lang/invoke/MethodHandles$Lookup, outer class info: #55 java/lang/invoke/MethodHandles\n" +
+ " inner name: #57 Lookup, accessflags: 25 public static final]\n" +
+ "Bootstrap methods:\n" +
+ " 0 : # 46 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
+ "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " Method arguments:\n" +
+ " #47 ()V\n" +
+ " #50 invokestatic X.lambda$0:()V\n" +
+ " #51 ()V\n" +
"}";
-
+
verifyClassFile(expectedOutput, "X.class", ClassFileBytesDisassembler.SYSTEM);
}
public void test008() throws Exception {
@@ -1008,97 +1008,97 @@ public void test008() throws Exception {
);
String expectedOutput =
- "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
- "public class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"lambda\"\n" +
- " constant #6 utf8: \"Ljava/util/function/Supplier;\"\n" +
- " constant #7 utf8: \"Signature\"\n" +
- " constant #8 utf8: \"Ljava/util/function/Supplier<Ljava/lang/String;>;\"\n" +
- " constant #9 utf8: \"<init>\"\n" +
- " constant #10 utf8: \"()V\"\n" +
- " constant #11 utf8: \"Code\"\n" +
- " constant #12 method_ref: #3.#13 java/lang/Object.<init> ()V\n" +
- " constant #13 name_and_type: #9.#10 <init> ()V\n" +
- " constant #14 invoke dynamic: #0 #15 get ()Ljava/util/function/Supplier;\n" +
- " constant #15 name_and_type: #16.#17 get ()Ljava/util/function/Supplier;\n" +
- " constant #16 utf8: \"get\"\n" +
- " constant #17 utf8: \"()Ljava/util/function/Supplier;\"\n" +
- " constant #18 field_ref: #1.#19 X.lambda Ljava/util/function/Supplier;\n" +
- " constant #19 name_and_type: #5.#6 lambda Ljava/util/function/Supplier;\n" +
- " constant #20 utf8: \"LineNumberTable\"\n" +
- " constant #21 utf8: \"LocalVariableTable\"\n" +
- " constant #22 utf8: \"this\"\n" +
- " constant #23 utf8: \"LX;\"\n" +
- " constant #24 utf8: \"lambda$0\"\n" +
- " constant #25 utf8: \"()Ljava/lang/String;\"\n" +
- " constant #26 string: #27 \"SUCCESS\"\n" +
- " constant #27 utf8: \"SUCCESS\"\n" +
- " constant #28 utf8: \"SourceFile\"\n" +
- " constant #29 utf8: \"X.java\"\n" +
- " constant #30 utf8: \"BootstrapMethods\"\n" +
- " constant #31 method_ref: #32.#34 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #32 class: #33 java/lang/invoke/LambdaMetafactory\n" +
- " constant #33 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
- " constant #34 name_and_type: #35.#36 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #35 utf8: \"metafactory\"\n" +
- " constant #36 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
- " constant #37 method handle: invokestatic (6) #31 \n" +
- " constant #38 utf8: \"()Ljava/lang/Object;\"\n" +
- " constant #39 method type: #38 ()Ljava/lang/Object;\n" +
- " constant #40 method_ref: #1.#41 X.lambda$0 ()Ljava/lang/String;\n" +
- " constant #41 name_and_type: #24.#25 lambda$0 ()Ljava/lang/String;\n" +
- " constant #42 method handle: invokestatic (6) #40 \n" +
- " constant #43 method type: #25 ()Ljava/lang/String;\n" +
- " constant #44 utf8: \"InnerClasses\"\n" +
- " constant #45 class: #46 java/lang/invoke/MethodHandles$Lookup\n" +
- " constant #46 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
- " constant #47 class: #48 java/lang/invoke/MethodHandles\n" +
- " constant #48 utf8: \"java/lang/invoke/MethodHandles\"\n" +
- " constant #49 utf8: \"Lookup\"\n" +
- " \n" +
- " // Field descriptor #6 Ljava/util/function/Supplier;\n" +
- " // Signature: Ljava/util/function/Supplier<Ljava/lang/String;>;\n" +
- " public java.util.function.Supplier lambda;\n" +
- " \n" +
- " // Method descriptor #10 ()V\n" +
- " // Stack: 2, Locals: 1\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [12]\n" +
- " 4 aload_0 [this]\n" +
- " 5 invokedynamic 0 get() : java.util.function.Supplier [14]\n" +
- " 10 putfield X.lambda : java.util.function.Supplier [18]\n" +
- " 13 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
- " [pc: 4, line: 2]\n" +
- " [pc: 13, line: 1]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
- " \n" +
- " // Method descriptor #25 ()Ljava/lang/String;\n" +
- " // Stack: 1, Locals: 0\n" +
- " private static synthetic java.lang.String lambda$0();\n" +
- " 0 ldc <String \"SUCCESS\"> [26]\n" +
- " 2 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 2]\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #45 java/lang/invoke/MethodHandles$Lookup, outer class info: #47 java/lang/invoke/MethodHandles\n" +
- " inner name: #49 Lookup, accessflags: 25 public static final]\n" +
- "Bootstrap methods:\n" +
- " 0 : # 37 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
- "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " Method arguments:\n" +
- " #39 ()Ljava/lang/Object;\n" +
- " #42 invokestatic X.lambda$0:()Ljava/lang/String;\n" +
- " #43 ()Ljava/lang/String;\n" +
+ "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
+ "public class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"lambda\"\n" +
+ " constant #6 utf8: \"Ljava/util/function/Supplier;\"\n" +
+ " constant #7 utf8: \"Signature\"\n" +
+ " constant #8 utf8: \"Ljava/util/function/Supplier<Ljava/lang/String;>;\"\n" +
+ " constant #9 utf8: \"<init>\"\n" +
+ " constant #10 utf8: \"()V\"\n" +
+ " constant #11 utf8: \"Code\"\n" +
+ " constant #12 method_ref: #3.#13 java/lang/Object.<init> ()V\n" +
+ " constant #13 name_and_type: #9.#10 <init> ()V\n" +
+ " constant #14 invoke dynamic: #0 #15 get ()Ljava/util/function/Supplier;\n" +
+ " constant #15 name_and_type: #16.#17 get ()Ljava/util/function/Supplier;\n" +
+ " constant #16 utf8: \"get\"\n" +
+ " constant #17 utf8: \"()Ljava/util/function/Supplier;\"\n" +
+ " constant #18 field_ref: #1.#19 X.lambda Ljava/util/function/Supplier;\n" +
+ " constant #19 name_and_type: #5.#6 lambda Ljava/util/function/Supplier;\n" +
+ " constant #20 utf8: \"LineNumberTable\"\n" +
+ " constant #21 utf8: \"LocalVariableTable\"\n" +
+ " constant #22 utf8: \"this\"\n" +
+ " constant #23 utf8: \"LX;\"\n" +
+ " constant #24 utf8: \"lambda$0\"\n" +
+ " constant #25 utf8: \"()Ljava/lang/String;\"\n" +
+ " constant #26 string: #27 \"SUCCESS\"\n" +
+ " constant #27 utf8: \"SUCCESS\"\n" +
+ " constant #28 utf8: \"SourceFile\"\n" +
+ " constant #29 utf8: \"X.java\"\n" +
+ " constant #30 utf8: \"BootstrapMethods\"\n" +
+ " constant #31 method_ref: #32.#34 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #32 class: #33 java/lang/invoke/LambdaMetafactory\n" +
+ " constant #33 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
+ " constant #34 name_and_type: #35.#36 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #35 utf8: \"metafactory\"\n" +
+ " constant #36 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
+ " constant #37 method handle: invokestatic (6) #31 \n" +
+ " constant #38 utf8: \"()Ljava/lang/Object;\"\n" +
+ " constant #39 method type: #38 ()Ljava/lang/Object;\n" +
+ " constant #40 method_ref: #1.#41 X.lambda$0 ()Ljava/lang/String;\n" +
+ " constant #41 name_and_type: #24.#25 lambda$0 ()Ljava/lang/String;\n" +
+ " constant #42 method handle: invokestatic (6) #40 \n" +
+ " constant #43 method type: #25 ()Ljava/lang/String;\n" +
+ " constant #44 utf8: \"InnerClasses\"\n" +
+ " constant #45 class: #46 java/lang/invoke/MethodHandles$Lookup\n" +
+ " constant #46 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
+ " constant #47 class: #48 java/lang/invoke/MethodHandles\n" +
+ " constant #48 utf8: \"java/lang/invoke/MethodHandles\"\n" +
+ " constant #49 utf8: \"Lookup\"\n" +
+ " \n" +
+ " // Field descriptor #6 Ljava/util/function/Supplier;\n" +
+ " // Signature: Ljava/util/function/Supplier<Ljava/lang/String;>;\n" +
+ " public java.util.function.Supplier lambda;\n" +
+ " \n" +
+ " // Method descriptor #10 ()V\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [12]\n" +
+ " 4 aload_0 [this]\n" +
+ " 5 invokedynamic 0 get() : java.util.function.Supplier [14]\n" +
+ " 10 putfield X.lambda : java.util.function.Supplier [18]\n" +
+ " 13 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
+ " [pc: 4, line: 2]\n" +
+ " [pc: 13, line: 1]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
+ " \n" +
+ " // Method descriptor #25 ()Ljava/lang/String;\n" +
+ " // Stack: 1, Locals: 0\n" +
+ " private static synthetic java.lang.String lambda$0();\n" +
+ " 0 ldc <String \"SUCCESS\"> [26]\n" +
+ " 2 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 2]\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #45 java/lang/invoke/MethodHandles$Lookup, outer class info: #47 java/lang/invoke/MethodHandles\n" +
+ " inner name: #49 Lookup, accessflags: 25 public static final]\n" +
+ "Bootstrap methods:\n" +
+ " 0 : # 37 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
+ "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " Method arguments:\n" +
+ " #39 ()Ljava/lang/Object;\n" +
+ " #42 invokestatic X.lambda$0:()Ljava/lang/String;\n" +
+ " #43 ()Ljava/lang/String;\n" +
"}"
;
@@ -1127,127 +1127,127 @@ public void test009() throws Exception {
);
String expectedOutput =
- "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
- "public class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"concat\"\n" +
- " constant #6 utf8: \"LFunction2;\"\n" +
- " constant #7 utf8: \"Signature\"\n" +
- " constant #8 utf8: \"LFunction2<Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;>;\"\n" +
- " constant #9 utf8: \"<init>\"\n" +
- " constant #10 utf8: \"()V\"\n" +
- " constant #11 utf8: \"Code\"\n" +
- " constant #12 method_ref: #3.#13 java/lang/Object.<init> ()V\n" +
- " constant #13 name_and_type: #9.#10 <init> ()V\n" +
- " constant #14 invoke dynamic: #0 #15 apply ()LFunction2;\n" +
- " constant #15 name_and_type: #16.#17 apply ()LFunction2;\n" +
- " constant #16 utf8: \"apply\"\n" +
- " constant #17 utf8: \"()LFunction2;\"\n" +
- " constant #18 field_ref: #1.#19 X.concat LFunction2;\n" +
- " constant #19 name_and_type: #5.#6 concat LFunction2;\n" +
- " constant #20 utf8: \"LineNumberTable\"\n" +
- " constant #21 utf8: \"LocalVariableTable\"\n" +
- " constant #22 utf8: \"this\"\n" +
- " constant #23 utf8: \"LX;\"\n" +
- " constant #24 utf8: \"lambda$0\"\n" +
- " constant #25 utf8: \"(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\"\n" +
- " constant #26 class: #27 java/lang/StringBuilder\n" +
- " constant #27 utf8: \"java/lang/StringBuilder\"\n" +
- " constant #28 method_ref: #29.#31 java/lang/String.valueOf (Ljava/lang/Object;)Ljava/lang/String;\n" +
- " constant #29 class: #30 java/lang/String\n" +
- " constant #30 utf8: \"java/lang/String\"\n" +
- " constant #31 name_and_type: #32.#33 valueOf (Ljava/lang/Object;)Ljava/lang/String;\n" +
- " constant #32 utf8: \"valueOf\"\n" +
- " constant #33 utf8: \"(Ljava/lang/Object;)Ljava/lang/String;\"\n" +
- " constant #34 method_ref: #26.#35 java/lang/StringBuilder.<init> (Ljava/lang/String;)V\n" +
- " constant #35 name_and_type: #9.#36 <init> (Ljava/lang/String;)V\n" +
- " constant #36 utf8: \"(Ljava/lang/String;)V\"\n" +
- " constant #37 method_ref: #26.#38 java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;\n" +
- " constant #38 name_and_type: #39.#40 append (Ljava/lang/String;)Ljava/lang/StringBuilder;\n" +
- " constant #39 utf8: \"append\"\n" +
- " constant #40 utf8: \"(Ljava/lang/String;)Ljava/lang/StringBuilder;\"\n" +
- " constant #41 method_ref: #26.#42 java/lang/StringBuilder.toString ()Ljava/lang/String;\n" +
- " constant #42 name_and_type: #43.#44 toString ()Ljava/lang/String;\n" +
- " constant #43 utf8: \"toString\"\n" +
- " constant #44 utf8: \"()Ljava/lang/String;\"\n" +
- " constant #45 utf8: \"s1\"\n" +
- " constant #46 utf8: \"Ljava/lang/String;\"\n" +
- " constant #47 utf8: \"s2\"\n" +
- " constant #48 utf8: \"SourceFile\"\n" +
- " constant #49 utf8: \"X.java\"\n" +
- " constant #50 utf8: \"BootstrapMethods\"\n" +
- " constant #51 method_ref: #52.#54 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #52 class: #53 java/lang/invoke/LambdaMetafactory\n" +
- " constant #53 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
- " constant #54 name_and_type: #55.#56 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #55 utf8: \"metafactory\"\n" +
- " constant #56 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
- " constant #57 method handle: invokestatic (6) #51 \n" +
- " constant #58 utf8: \"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\"\n" +
- " constant #59 method type: #58 (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n" +
- " constant #60 method_ref: #1.#61 X.lambda$0 (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
- " constant #61 name_and_type: #24.#25 lambda$0 (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
- " constant #62 method handle: invokestatic (6) #60 \n" +
- " constant #63 method type: #25 (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
- " constant #64 utf8: \"InnerClasses\"\n" +
- " constant #65 class: #66 java/lang/invoke/MethodHandles$Lookup\n" +
- " constant #66 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
- " constant #67 class: #68 java/lang/invoke/MethodHandles\n" +
- " constant #68 utf8: \"java/lang/invoke/MethodHandles\"\n" +
- " constant #69 utf8: \"Lookup\"\n" +
- " \n" +
- " // Field descriptor #6 LFunction2;\n" +
- " // Signature: LFunction2<Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;>;\n" +
- " public Function2 concat;\n" +
- " \n" +
- " // Method descriptor #10 ()V\n" +
- " // Stack: 2, Locals: 1\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [12]\n" +
- " 4 aload_0 [this]\n" +
- " 5 invokedynamic 0 apply() : Function2 [14]\n" +
- " 10 putfield X.concat : Function2 [18]\n" +
- " 13 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
- " [pc: 4, line: 2]\n" +
- " [pc: 13, line: 1]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
- " \n" +
- " // Method descriptor #25 (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
- " // Stack: 3, Locals: 2\n" +
- " private static synthetic java.lang.String lambda$0(java.lang.String s1, java.lang.String s2);\n" +
- " 0 new java.lang.StringBuilder [26]\n" +
- " 3 dup\n" +
- " 4 aload_0 [s1]\n" +
- " 5 invokestatic java.lang.String.valueOf(java.lang.Object) : java.lang.String [28]\n" +
- " 8 invokespecial java.lang.StringBuilder(java.lang.String) [34]\n" +
- " 11 aload_1 [s2]\n" +
- " 12 invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [37]\n" +
- " 15 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [41]\n" +
- " 18 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 2]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 19] local: s1 index: 0 type: java.lang.String\n" +
- " [pc: 0, pc: 19] local: s2 index: 1 type: java.lang.String\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #65 java/lang/invoke/MethodHandles$Lookup, outer class info: #67 java/lang/invoke/MethodHandles\n" +
- " inner name: #69 Lookup, accessflags: 25 public static final]\n" +
- "Bootstrap methods:\n" +
- " 0 : # 57 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
- "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " Method arguments:\n" +
- " #59 (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n" +
- " #62 invokestatic X.lambda$0:(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
- " #63 (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
+ "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
+ "public class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"concat\"\n" +
+ " constant #6 utf8: \"LFunction2;\"\n" +
+ " constant #7 utf8: \"Signature\"\n" +
+ " constant #8 utf8: \"LFunction2<Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;>;\"\n" +
+ " constant #9 utf8: \"<init>\"\n" +
+ " constant #10 utf8: \"()V\"\n" +
+ " constant #11 utf8: \"Code\"\n" +
+ " constant #12 method_ref: #3.#13 java/lang/Object.<init> ()V\n" +
+ " constant #13 name_and_type: #9.#10 <init> ()V\n" +
+ " constant #14 invoke dynamic: #0 #15 apply ()LFunction2;\n" +
+ " constant #15 name_and_type: #16.#17 apply ()LFunction2;\n" +
+ " constant #16 utf8: \"apply\"\n" +
+ " constant #17 utf8: \"()LFunction2;\"\n" +
+ " constant #18 field_ref: #1.#19 X.concat LFunction2;\n" +
+ " constant #19 name_and_type: #5.#6 concat LFunction2;\n" +
+ " constant #20 utf8: \"LineNumberTable\"\n" +
+ " constant #21 utf8: \"LocalVariableTable\"\n" +
+ " constant #22 utf8: \"this\"\n" +
+ " constant #23 utf8: \"LX;\"\n" +
+ " constant #24 utf8: \"lambda$0\"\n" +
+ " constant #25 utf8: \"(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\"\n" +
+ " constant #26 class: #27 java/lang/StringBuilder\n" +
+ " constant #27 utf8: \"java/lang/StringBuilder\"\n" +
+ " constant #28 method_ref: #29.#31 java/lang/String.valueOf (Ljava/lang/Object;)Ljava/lang/String;\n" +
+ " constant #29 class: #30 java/lang/String\n" +
+ " constant #30 utf8: \"java/lang/String\"\n" +
+ " constant #31 name_and_type: #32.#33 valueOf (Ljava/lang/Object;)Ljava/lang/String;\n" +
+ " constant #32 utf8: \"valueOf\"\n" +
+ " constant #33 utf8: \"(Ljava/lang/Object;)Ljava/lang/String;\"\n" +
+ " constant #34 method_ref: #26.#35 java/lang/StringBuilder.<init> (Ljava/lang/String;)V\n" +
+ " constant #35 name_and_type: #9.#36 <init> (Ljava/lang/String;)V\n" +
+ " constant #36 utf8: \"(Ljava/lang/String;)V\"\n" +
+ " constant #37 method_ref: #26.#38 java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;\n" +
+ " constant #38 name_and_type: #39.#40 append (Ljava/lang/String;)Ljava/lang/StringBuilder;\n" +
+ " constant #39 utf8: \"append\"\n" +
+ " constant #40 utf8: \"(Ljava/lang/String;)Ljava/lang/StringBuilder;\"\n" +
+ " constant #41 method_ref: #26.#42 java/lang/StringBuilder.toString ()Ljava/lang/String;\n" +
+ " constant #42 name_and_type: #43.#44 toString ()Ljava/lang/String;\n" +
+ " constant #43 utf8: \"toString\"\n" +
+ " constant #44 utf8: \"()Ljava/lang/String;\"\n" +
+ " constant #45 utf8: \"s1\"\n" +
+ " constant #46 utf8: \"Ljava/lang/String;\"\n" +
+ " constant #47 utf8: \"s2\"\n" +
+ " constant #48 utf8: \"SourceFile\"\n" +
+ " constant #49 utf8: \"X.java\"\n" +
+ " constant #50 utf8: \"BootstrapMethods\"\n" +
+ " constant #51 method_ref: #52.#54 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #52 class: #53 java/lang/invoke/LambdaMetafactory\n" +
+ " constant #53 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
+ " constant #54 name_and_type: #55.#56 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #55 utf8: \"metafactory\"\n" +
+ " constant #56 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
+ " constant #57 method handle: invokestatic (6) #51 \n" +
+ " constant #58 utf8: \"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\"\n" +
+ " constant #59 method type: #58 (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n" +
+ " constant #60 method_ref: #1.#61 X.lambda$0 (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
+ " constant #61 name_and_type: #24.#25 lambda$0 (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
+ " constant #62 method handle: invokestatic (6) #60 \n" +
+ " constant #63 method type: #25 (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
+ " constant #64 utf8: \"InnerClasses\"\n" +
+ " constant #65 class: #66 java/lang/invoke/MethodHandles$Lookup\n" +
+ " constant #66 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
+ " constant #67 class: #68 java/lang/invoke/MethodHandles\n" +
+ " constant #68 utf8: \"java/lang/invoke/MethodHandles\"\n" +
+ " constant #69 utf8: \"Lookup\"\n" +
+ " \n" +
+ " // Field descriptor #6 LFunction2;\n" +
+ " // Signature: LFunction2<Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;>;\n" +
+ " public Function2 concat;\n" +
+ " \n" +
+ " // Method descriptor #10 ()V\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [12]\n" +
+ " 4 aload_0 [this]\n" +
+ " 5 invokedynamic 0 apply() : Function2 [14]\n" +
+ " 10 putfield X.concat : Function2 [18]\n" +
+ " 13 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
+ " [pc: 4, line: 2]\n" +
+ " [pc: 13, line: 1]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
+ " \n" +
+ " // Method descriptor #25 (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
+ " // Stack: 3, Locals: 2\n" +
+ " private static synthetic java.lang.String lambda$0(java.lang.String s1, java.lang.String s2);\n" +
+ " 0 new java.lang.StringBuilder [26]\n" +
+ " 3 dup\n" +
+ " 4 aload_0 [s1]\n" +
+ " 5 invokestatic java.lang.String.valueOf(java.lang.Object) : java.lang.String [28]\n" +
+ " 8 invokespecial java.lang.StringBuilder(java.lang.String) [34]\n" +
+ " 11 aload_1 [s2]\n" +
+ " 12 invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [37]\n" +
+ " 15 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [41]\n" +
+ " 18 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 2]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 19] local: s1 index: 0 type: java.lang.String\n" +
+ " [pc: 0, pc: 19] local: s2 index: 1 type: java.lang.String\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #65 java/lang/invoke/MethodHandles$Lookup, outer class info: #67 java/lang/invoke/MethodHandles\n" +
+ " inner name: #69 Lookup, accessflags: 25 public static final]\n" +
+ "Bootstrap methods:\n" +
+ " 0 : # 57 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
+ "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " Method arguments:\n" +
+ " #59 (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n" +
+ " #62 invokestatic X.lambda$0:(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
+ " #63 (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
"}";
verifyClassFile(expectedOutput, "X.class", ClassFileBytesDisassembler.SYSTEM);
@@ -1279,142 +1279,142 @@ public void test010() throws Exception {
);
String expectedOutput =
- "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
- "public class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"concat\"\n" +
- " constant #6 utf8: \"LFunction2;\"\n" +
- " constant #7 utf8: \"Signature\"\n" +
- " constant #8 utf8: \"LFunction2<Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;>;\"\n" +
- " constant #9 utf8: \"<init>\"\n" +
- " constant #10 utf8: \"()V\"\n" +
- " constant #11 utf8: \"Code\"\n" +
- " constant #12 method_ref: #3.#13 java/lang/Object.<init> ()V\n" +
- " constant #13 name_and_type: #9.#10 <init> ()V\n" +
- " constant #14 class: #15 java/lang/String\n" +
- " constant #15 utf8: \"java/lang/String\"\n" +
- " constant #16 string: #17 \"S\"\n" +
- " constant #17 utf8: \"S\"\n" +
- " constant #18 method_ref: #14.#19 java/lang/String.<init> (Ljava/lang/String;)V\n" +
- " constant #19 name_and_type: #9.#20 <init> (Ljava/lang/String;)V\n" +
- " constant #20 utf8: \"(Ljava/lang/String;)V\"\n" +
- " constant #21 invoke dynamic: #0 #22 apply (Ljava/lang/String;)LFunction2;\n" +
- " constant #22 name_and_type: #23.#24 apply (Ljava/lang/String;)LFunction2;\n" +
- " constant #23 utf8: \"apply\"\n" +
- " constant #24 utf8: \"(Ljava/lang/String;)LFunction2;\"\n" +
- " constant #25 field_ref: #1.#26 X.concat LFunction2;\n" +
- " constant #26 name_and_type: #5.#6 concat LFunction2;\n" +
- " constant #27 utf8: \"LineNumberTable\"\n" +
- " constant #28 utf8: \"LocalVariableTable\"\n" +
- " constant #29 utf8: \"this\"\n" +
- " constant #30 utf8: \"LX;\"\n" +
- " constant #31 utf8: \"s0\"\n" +
- " constant #32 utf8: \"Ljava/lang/String;\"\n" +
- " constant #33 utf8: \"lambda$0\"\n" +
- " constant #34 utf8: \"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\"\n" +
- " constant #35 class: #36 java/lang/StringBuilder\n" +
- " constant #36 utf8: \"java/lang/StringBuilder\"\n" +
- " constant #37 method_ref: #14.#38 java/lang/String.valueOf (Ljava/lang/Object;)Ljava/lang/String;\n" +
- " constant #38 name_and_type: #39.#40 valueOf (Ljava/lang/Object;)Ljava/lang/String;\n" +
- " constant #39 utf8: \"valueOf\"\n" +
- " constant #40 utf8: \"(Ljava/lang/Object;)Ljava/lang/String;\"\n" +
- " constant #41 method_ref: #35.#19 java/lang/StringBuilder.<init> (Ljava/lang/String;)V\n" +
- " constant #42 method_ref: #35.#43 java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;\n" +
- " constant #43 name_and_type: #44.#45 append (Ljava/lang/String;)Ljava/lang/StringBuilder;\n" +
- " constant #44 utf8: \"append\"\n" +
- " constant #45 utf8: \"(Ljava/lang/String;)Ljava/lang/StringBuilder;\"\n" +
- " constant #46 method_ref: #35.#47 java/lang/StringBuilder.toString ()Ljava/lang/String;\n" +
- " constant #47 name_and_type: #48.#49 toString ()Ljava/lang/String;\n" +
- " constant #48 utf8: \"toString\"\n" +
- " constant #49 utf8: \"()Ljava/lang/String;\"\n" +
- " constant #50 utf8: \"s1\"\n" +
- " constant #51 utf8: \"s2\"\n" +
- " constant #52 utf8: \"SourceFile\"\n" +
- " constant #53 utf8: \"X.java\"\n" +
- " constant #54 utf8: \"BootstrapMethods\"\n" +
- " constant #55 method_ref: #56.#58 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #56 class: #57 java/lang/invoke/LambdaMetafactory\n" +
- " constant #57 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
- " constant #58 name_and_type: #59.#60 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #59 utf8: \"metafactory\"\n" +
- " constant #60 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
- " constant #61 method handle: invokestatic (6) #55 \n" +
- " constant #62 utf8: \"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\"\n" +
- " constant #63 method type: #62 (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n" +
- " constant #64 method_ref: #1.#65 X.lambda$0 (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
- " constant #65 name_and_type: #33.#34 lambda$0 (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
- " constant #66 method handle: invokestatic (6) #64 \n" +
- " constant #67 utf8: \"(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\"\n" +
- " constant #68 method type: #67 (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
- " constant #69 utf8: \"InnerClasses\"\n" +
- " constant #70 class: #71 java/lang/invoke/MethodHandles$Lookup\n" +
- " constant #71 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
- " constant #72 class: #73 java/lang/invoke/MethodHandles\n" +
- " constant #73 utf8: \"java/lang/invoke/MethodHandles\"\n" +
- " constant #74 utf8: \"Lookup\"\n" +
- " \n" +
- " // Field descriptor #6 LFunction2;\n" +
- " // Signature: LFunction2<Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;>;\n" +
- " public Function2 concat;\n" +
- " \n" +
- " // Method descriptor #10 ()V\n" +
- " // Stack: 3, Locals: 2\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [12]\n" +
- " 4 new java.lang.String [14]\n" +
- " 7 dup\n" +
- " 8 ldc <String \"S\"> [16]\n" +
- " 10 invokespecial java.lang.String(java.lang.String) [18]\n" +
- " 13 astore_1 [s0]\n" +
- " 14 aload_0 [this]\n" +
- " 15 aload_1 [s0]\n" +
- " 16 invokedynamic 0 apply(java.lang.String) : Function2 [21]\n" +
- " 21 putfield X.concat : Function2 [25]\n" +
- " 24 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
- " [pc: 4, line: 4]\n" +
- " [pc: 14, line: 5]\n" +
- " [pc: 24, line: 1]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 25] local: this index: 0 type: X\n" +
- " [pc: 14, pc: 24] local: s0 index: 1 type: java.lang.String\n" +
- " \n" +
- " // Method descriptor #34 (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
- " // Stack: 3, Locals: 3\n" +
- " private static synthetic java.lang.String lambda$0(java.lang.String arg0, java.lang.String s1, java.lang.String s2);\n" +
- " 0 new java.lang.StringBuilder [35]\n" +
- " 3 dup\n" +
- " 4 aload_0 [arg0]\n" +
- " 5 invokestatic java.lang.String.valueOf(java.lang.Object) : java.lang.String [37]\n" +
- " 8 invokespecial java.lang.StringBuilder(java.lang.String) [41]\n" +
- " 11 aload_1 [s1]\n" +
- " 12 invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [42]\n" +
- " 15 aload_2 [s2]\n" +
- " 16 invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [42]\n" +
- " 19 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [46]\n" +
- " 22 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 5]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 23] local: s1 index: 1 type: java.lang.String\n" +
- " [pc: 0, pc: 23] local: s2 index: 2 type: java.lang.String\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #70 java/lang/invoke/MethodHandles$Lookup, outer class info: #72 java/lang/invoke/MethodHandles\n" +
- " inner name: #74 Lookup, accessflags: 25 public static final]\n" +
- "Bootstrap methods:\n" +
- " 0 : # 61 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
- "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " Method arguments:\n" +
- " #63 (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n" +
- " #66 invokestatic X.lambda$0:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
- " #68 (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
+ "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
+ "public class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"concat\"\n" +
+ " constant #6 utf8: \"LFunction2;\"\n" +
+ " constant #7 utf8: \"Signature\"\n" +
+ " constant #8 utf8: \"LFunction2<Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;>;\"\n" +
+ " constant #9 utf8: \"<init>\"\n" +
+ " constant #10 utf8: \"()V\"\n" +
+ " constant #11 utf8: \"Code\"\n" +
+ " constant #12 method_ref: #3.#13 java/lang/Object.<init> ()V\n" +
+ " constant #13 name_and_type: #9.#10 <init> ()V\n" +
+ " constant #14 class: #15 java/lang/String\n" +
+ " constant #15 utf8: \"java/lang/String\"\n" +
+ " constant #16 string: #17 \"S\"\n" +
+ " constant #17 utf8: \"S\"\n" +
+ " constant #18 method_ref: #14.#19 java/lang/String.<init> (Ljava/lang/String;)V\n" +
+ " constant #19 name_and_type: #9.#20 <init> (Ljava/lang/String;)V\n" +
+ " constant #20 utf8: \"(Ljava/lang/String;)V\"\n" +
+ " constant #21 invoke dynamic: #0 #22 apply (Ljava/lang/String;)LFunction2;\n" +
+ " constant #22 name_and_type: #23.#24 apply (Ljava/lang/String;)LFunction2;\n" +
+ " constant #23 utf8: \"apply\"\n" +
+ " constant #24 utf8: \"(Ljava/lang/String;)LFunction2;\"\n" +
+ " constant #25 field_ref: #1.#26 X.concat LFunction2;\n" +
+ " constant #26 name_and_type: #5.#6 concat LFunction2;\n" +
+ " constant #27 utf8: \"LineNumberTable\"\n" +
+ " constant #28 utf8: \"LocalVariableTable\"\n" +
+ " constant #29 utf8: \"this\"\n" +
+ " constant #30 utf8: \"LX;\"\n" +
+ " constant #31 utf8: \"s0\"\n" +
+ " constant #32 utf8: \"Ljava/lang/String;\"\n" +
+ " constant #33 utf8: \"lambda$0\"\n" +
+ " constant #34 utf8: \"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\"\n" +
+ " constant #35 class: #36 java/lang/StringBuilder\n" +
+ " constant #36 utf8: \"java/lang/StringBuilder\"\n" +
+ " constant #37 method_ref: #14.#38 java/lang/String.valueOf (Ljava/lang/Object;)Ljava/lang/String;\n" +
+ " constant #38 name_and_type: #39.#40 valueOf (Ljava/lang/Object;)Ljava/lang/String;\n" +
+ " constant #39 utf8: \"valueOf\"\n" +
+ " constant #40 utf8: \"(Ljava/lang/Object;)Ljava/lang/String;\"\n" +
+ " constant #41 method_ref: #35.#19 java/lang/StringBuilder.<init> (Ljava/lang/String;)V\n" +
+ " constant #42 method_ref: #35.#43 java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;\n" +
+ " constant #43 name_and_type: #44.#45 append (Ljava/lang/String;)Ljava/lang/StringBuilder;\n" +
+ " constant #44 utf8: \"append\"\n" +
+ " constant #45 utf8: \"(Ljava/lang/String;)Ljava/lang/StringBuilder;\"\n" +
+ " constant #46 method_ref: #35.#47 java/lang/StringBuilder.toString ()Ljava/lang/String;\n" +
+ " constant #47 name_and_type: #48.#49 toString ()Ljava/lang/String;\n" +
+ " constant #48 utf8: \"toString\"\n" +
+ " constant #49 utf8: \"()Ljava/lang/String;\"\n" +
+ " constant #50 utf8: \"s1\"\n" +
+ " constant #51 utf8: \"s2\"\n" +
+ " constant #52 utf8: \"SourceFile\"\n" +
+ " constant #53 utf8: \"X.java\"\n" +
+ " constant #54 utf8: \"BootstrapMethods\"\n" +
+ " constant #55 method_ref: #56.#58 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #56 class: #57 java/lang/invoke/LambdaMetafactory\n" +
+ " constant #57 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
+ " constant #58 name_and_type: #59.#60 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #59 utf8: \"metafactory\"\n" +
+ " constant #60 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
+ " constant #61 method handle: invokestatic (6) #55 \n" +
+ " constant #62 utf8: \"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\"\n" +
+ " constant #63 method type: #62 (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n" +
+ " constant #64 method_ref: #1.#65 X.lambda$0 (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
+ " constant #65 name_and_type: #33.#34 lambda$0 (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
+ " constant #66 method handle: invokestatic (6) #64 \n" +
+ " constant #67 utf8: \"(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\"\n" +
+ " constant #68 method type: #67 (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
+ " constant #69 utf8: \"InnerClasses\"\n" +
+ " constant #70 class: #71 java/lang/invoke/MethodHandles$Lookup\n" +
+ " constant #71 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
+ " constant #72 class: #73 java/lang/invoke/MethodHandles\n" +
+ " constant #73 utf8: \"java/lang/invoke/MethodHandles\"\n" +
+ " constant #74 utf8: \"Lookup\"\n" +
+ " \n" +
+ " // Field descriptor #6 LFunction2;\n" +
+ " // Signature: LFunction2<Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;>;\n" +
+ " public Function2 concat;\n" +
+ " \n" +
+ " // Method descriptor #10 ()V\n" +
+ " // Stack: 3, Locals: 2\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [12]\n" +
+ " 4 new java.lang.String [14]\n" +
+ " 7 dup\n" +
+ " 8 ldc <String \"S\"> [16]\n" +
+ " 10 invokespecial java.lang.String(java.lang.String) [18]\n" +
+ " 13 astore_1 [s0]\n" +
+ " 14 aload_0 [this]\n" +
+ " 15 aload_1 [s0]\n" +
+ " 16 invokedynamic 0 apply(java.lang.String) : Function2 [21]\n" +
+ " 21 putfield X.concat : Function2 [25]\n" +
+ " 24 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
+ " [pc: 4, line: 4]\n" +
+ " [pc: 14, line: 5]\n" +
+ " [pc: 24, line: 1]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 25] local: this index: 0 type: X\n" +
+ " [pc: 14, pc: 24] local: s0 index: 1 type: java.lang.String\n" +
+ " \n" +
+ " // Method descriptor #34 (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
+ " // Stack: 3, Locals: 3\n" +
+ " private static synthetic java.lang.String lambda$0(java.lang.String arg0, java.lang.String s1, java.lang.String s2);\n" +
+ " 0 new java.lang.StringBuilder [35]\n" +
+ " 3 dup\n" +
+ " 4 aload_0 [arg0]\n" +
+ " 5 invokestatic java.lang.String.valueOf(java.lang.Object) : java.lang.String [37]\n" +
+ " 8 invokespecial java.lang.StringBuilder(java.lang.String) [41]\n" +
+ " 11 aload_1 [s1]\n" +
+ " 12 invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [42]\n" +
+ " 15 aload_2 [s2]\n" +
+ " 16 invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [42]\n" +
+ " 19 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [46]\n" +
+ " 22 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 5]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 23] local: s1 index: 1 type: java.lang.String\n" +
+ " [pc: 0, pc: 23] local: s2 index: 2 type: java.lang.String\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #70 java/lang/invoke/MethodHandles$Lookup, outer class info: #72 java/lang/invoke/MethodHandles\n" +
+ " inner name: #74 Lookup, accessflags: 25 public static final]\n" +
+ "Bootstrap methods:\n" +
+ " 0 : # 61 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
+ "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " Method arguments:\n" +
+ " #63 (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n" +
+ " #66 invokestatic X.lambda$0:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
+ " #68 (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
"}"
;
@@ -1447,142 +1447,142 @@ public void test011() throws Exception {
);
String expectedOutput =
- "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
- "public class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"concat\"\n" +
- " constant #6 utf8: \"LFunction2;\"\n" +
- " constant #7 utf8: \"Signature\"\n" +
- " constant #8 utf8: \"LFunction2<Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;>;\"\n" +
- " constant #9 utf8: \"<init>\"\n" +
- " constant #10 utf8: \"()V\"\n" +
- " constant #11 utf8: \"Code\"\n" +
- " constant #12 method_ref: #3.#13 java/lang/Object.<init> ()V\n" +
- " constant #13 name_and_type: #9.#10 <init> ()V\n" +
- " constant #14 class: #15 java/lang/String\n" +
- " constant #15 utf8: \"java/lang/String\"\n" +
- " constant #16 string: #17 \"S\"\n" +
- " constant #17 utf8: \"S\"\n" +
- " constant #18 method_ref: #14.#19 java/lang/String.<init> (Ljava/lang/String;)V\n" +
- " constant #19 name_and_type: #9.#20 <init> (Ljava/lang/String;)V\n" +
- " constant #20 utf8: \"(Ljava/lang/String;)V\"\n" +
- " constant #21 invoke dynamic: #0 #22 apply (Ljava/lang/String;)LFunction2;\n" +
- " constant #22 name_and_type: #23.#24 apply (Ljava/lang/String;)LFunction2;\n" +
- " constant #23 utf8: \"apply\"\n" +
- " constant #24 utf8: \"(Ljava/lang/String;)LFunction2;\"\n" +
- " constant #25 field_ref: #1.#26 X.concat LFunction2;\n" +
- " constant #26 name_and_type: #5.#6 concat LFunction2;\n" +
- " constant #27 utf8: \"LineNumberTable\"\n" +
- " constant #28 utf8: \"LocalVariableTable\"\n" +
- " constant #29 utf8: \"this\"\n" +
- " constant #30 utf8: \"LX;\"\n" +
- " constant #31 utf8: \"s0\"\n" +
- " constant #32 utf8: \"Ljava/lang/String;\"\n" +
- " constant #33 utf8: \"lambda$0\"\n" +
- " constant #34 utf8: \"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\"\n" +
- " constant #35 class: #36 java/lang/StringBuilder\n" +
- " constant #36 utf8: \"java/lang/StringBuilder\"\n" +
- " constant #37 method_ref: #14.#38 java/lang/String.valueOf (Ljava/lang/Object;)Ljava/lang/String;\n" +
- " constant #38 name_and_type: #39.#40 valueOf (Ljava/lang/Object;)Ljava/lang/String;\n" +
- " constant #39 utf8: \"valueOf\"\n" +
- " constant #40 utf8: \"(Ljava/lang/Object;)Ljava/lang/String;\"\n" +
- " constant #41 method_ref: #35.#19 java/lang/StringBuilder.<init> (Ljava/lang/String;)V\n" +
- " constant #42 method_ref: #35.#43 java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;\n" +
- " constant #43 name_and_type: #44.#45 append (Ljava/lang/String;)Ljava/lang/StringBuilder;\n" +
- " constant #44 utf8: \"append\"\n" +
- " constant #45 utf8: \"(Ljava/lang/String;)Ljava/lang/StringBuilder;\"\n" +
- " constant #46 method_ref: #35.#47 java/lang/StringBuilder.toString ()Ljava/lang/String;\n" +
- " constant #47 name_and_type: #48.#49 toString ()Ljava/lang/String;\n" +
- " constant #48 utf8: \"toString\"\n" +
- " constant #49 utf8: \"()Ljava/lang/String;\"\n" +
- " constant #50 utf8: \"s1\"\n" +
- " constant #51 utf8: \"s2\"\n" +
- " constant #52 utf8: \"SourceFile\"\n" +
- " constant #53 utf8: \"X.java\"\n" +
- " constant #54 utf8: \"BootstrapMethods\"\n" +
- " constant #55 method_ref: #56.#58 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #56 class: #57 java/lang/invoke/LambdaMetafactory\n" +
- " constant #57 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
- " constant #58 name_and_type: #59.#60 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #59 utf8: \"metafactory\"\n" +
- " constant #60 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
- " constant #61 method handle: invokestatic (6) #55 \n" +
- " constant #62 utf8: \"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\"\n" +
- " constant #63 method type: #62 (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n" +
- " constant #64 method_ref: #1.#65 X.lambda$0 (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
- " constant #65 name_and_type: #33.#34 lambda$0 (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
- " constant #66 method handle: invokestatic (6) #64 \n" +
- " constant #67 utf8: \"(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\"\n" +
- " constant #68 method type: #67 (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
- " constant #69 utf8: \"InnerClasses\"\n" +
- " constant #70 class: #71 java/lang/invoke/MethodHandles$Lookup\n" +
- " constant #71 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
- " constant #72 class: #73 java/lang/invoke/MethodHandles\n" +
- " constant #73 utf8: \"java/lang/invoke/MethodHandles\"\n" +
- " constant #74 utf8: \"Lookup\"\n" +
- " \n" +
- " // Field descriptor #6 LFunction2;\n" +
- " // Signature: LFunction2<Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;>;\n" +
- " public Function2 concat;\n" +
- " \n" +
- " // Method descriptor #10 ()V\n" +
- " // Stack: 3, Locals: 2\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [12]\n" +
- " 4 new java.lang.String [14]\n" +
- " 7 dup\n" +
- " 8 ldc <String \"S\"> [16]\n" +
- " 10 invokespecial java.lang.String(java.lang.String) [18]\n" +
- " 13 astore_1 [s0]\n" +
- " 14 aload_0 [this]\n" +
- " 15 aload_1 [s0]\n" +
- " 16 invokedynamic 0 apply(java.lang.String) : Function2 [21]\n" +
- " 21 putfield X.concat : Function2 [25]\n" +
- " 24 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
- " [pc: 4, line: 4]\n" +
- " [pc: 14, line: 5]\n" +
- " [pc: 24, line: 1]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 25] local: this index: 0 type: X\n" +
- " [pc: 14, pc: 24] local: s0 index: 1 type: java.lang.String\n" +
- " \n" +
- " // Method descriptor #34 (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
- " // Stack: 3, Locals: 3\n" +
- " private static synthetic java.lang.String lambda$0(java.lang.String arg0, java.lang.String s1, java.lang.String s2);\n" +
- " 0 new java.lang.StringBuilder [35]\n" +
- " 3 dup\n" +
- " 4 aload_0 [arg0]\n" +
- " 5 invokestatic java.lang.String.valueOf(java.lang.Object) : java.lang.String [37]\n" +
- " 8 invokespecial java.lang.StringBuilder(java.lang.String) [41]\n" +
- " 11 aload_1 [s1]\n" +
- " 12 invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [42]\n" +
- " 15 aload_2 [s2]\n" +
- " 16 invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [42]\n" +
- " 19 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [46]\n" +
- " 22 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 5]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 23] local: s1 index: 1 type: java.lang.String\n" +
- " [pc: 0, pc: 23] local: s2 index: 2 type: java.lang.String\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #70 java/lang/invoke/MethodHandles$Lookup, outer class info: #72 java/lang/invoke/MethodHandles\n" +
- " inner name: #74 Lookup, accessflags: 25 public static final]\n" +
- "Bootstrap methods:\n" +
- " 0 : # 61 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
- "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " Method arguments:\n" +
- " #63 (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n" +
- " #66 invokestatic X.lambda$0:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
- " #68 (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
+ "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
+ "public class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"concat\"\n" +
+ " constant #6 utf8: \"LFunction2;\"\n" +
+ " constant #7 utf8: \"Signature\"\n" +
+ " constant #8 utf8: \"LFunction2<Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;>;\"\n" +
+ " constant #9 utf8: \"<init>\"\n" +
+ " constant #10 utf8: \"()V\"\n" +
+ " constant #11 utf8: \"Code\"\n" +
+ " constant #12 method_ref: #3.#13 java/lang/Object.<init> ()V\n" +
+ " constant #13 name_and_type: #9.#10 <init> ()V\n" +
+ " constant #14 class: #15 java/lang/String\n" +
+ " constant #15 utf8: \"java/lang/String\"\n" +
+ " constant #16 string: #17 \"S\"\n" +
+ " constant #17 utf8: \"S\"\n" +
+ " constant #18 method_ref: #14.#19 java/lang/String.<init> (Ljava/lang/String;)V\n" +
+ " constant #19 name_and_type: #9.#20 <init> (Ljava/lang/String;)V\n" +
+ " constant #20 utf8: \"(Ljava/lang/String;)V\"\n" +
+ " constant #21 invoke dynamic: #0 #22 apply (Ljava/lang/String;)LFunction2;\n" +
+ " constant #22 name_and_type: #23.#24 apply (Ljava/lang/String;)LFunction2;\n" +
+ " constant #23 utf8: \"apply\"\n" +
+ " constant #24 utf8: \"(Ljava/lang/String;)LFunction2;\"\n" +
+ " constant #25 field_ref: #1.#26 X.concat LFunction2;\n" +
+ " constant #26 name_and_type: #5.#6 concat LFunction2;\n" +
+ " constant #27 utf8: \"LineNumberTable\"\n" +
+ " constant #28 utf8: \"LocalVariableTable\"\n" +
+ " constant #29 utf8: \"this\"\n" +
+ " constant #30 utf8: \"LX;\"\n" +
+ " constant #31 utf8: \"s0\"\n" +
+ " constant #32 utf8: \"Ljava/lang/String;\"\n" +
+ " constant #33 utf8: \"lambda$0\"\n" +
+ " constant #34 utf8: \"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\"\n" +
+ " constant #35 class: #36 java/lang/StringBuilder\n" +
+ " constant #36 utf8: \"java/lang/StringBuilder\"\n" +
+ " constant #37 method_ref: #14.#38 java/lang/String.valueOf (Ljava/lang/Object;)Ljava/lang/String;\n" +
+ " constant #38 name_and_type: #39.#40 valueOf (Ljava/lang/Object;)Ljava/lang/String;\n" +
+ " constant #39 utf8: \"valueOf\"\n" +
+ " constant #40 utf8: \"(Ljava/lang/Object;)Ljava/lang/String;\"\n" +
+ " constant #41 method_ref: #35.#19 java/lang/StringBuilder.<init> (Ljava/lang/String;)V\n" +
+ " constant #42 method_ref: #35.#43 java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;\n" +
+ " constant #43 name_and_type: #44.#45 append (Ljava/lang/String;)Ljava/lang/StringBuilder;\n" +
+ " constant #44 utf8: \"append\"\n" +
+ " constant #45 utf8: \"(Ljava/lang/String;)Ljava/lang/StringBuilder;\"\n" +
+ " constant #46 method_ref: #35.#47 java/lang/StringBuilder.toString ()Ljava/lang/String;\n" +
+ " constant #47 name_and_type: #48.#49 toString ()Ljava/lang/String;\n" +
+ " constant #48 utf8: \"toString\"\n" +
+ " constant #49 utf8: \"()Ljava/lang/String;\"\n" +
+ " constant #50 utf8: \"s1\"\n" +
+ " constant #51 utf8: \"s2\"\n" +
+ " constant #52 utf8: \"SourceFile\"\n" +
+ " constant #53 utf8: \"X.java\"\n" +
+ " constant #54 utf8: \"BootstrapMethods\"\n" +
+ " constant #55 method_ref: #56.#58 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #56 class: #57 java/lang/invoke/LambdaMetafactory\n" +
+ " constant #57 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
+ " constant #58 name_and_type: #59.#60 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #59 utf8: \"metafactory\"\n" +
+ " constant #60 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
+ " constant #61 method handle: invokestatic (6) #55 \n" +
+ " constant #62 utf8: \"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\"\n" +
+ " constant #63 method type: #62 (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n" +
+ " constant #64 method_ref: #1.#65 X.lambda$0 (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
+ " constant #65 name_and_type: #33.#34 lambda$0 (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
+ " constant #66 method handle: invokestatic (6) #64 \n" +
+ " constant #67 utf8: \"(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\"\n" +
+ " constant #68 method type: #67 (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
+ " constant #69 utf8: \"InnerClasses\"\n" +
+ " constant #70 class: #71 java/lang/invoke/MethodHandles$Lookup\n" +
+ " constant #71 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
+ " constant #72 class: #73 java/lang/invoke/MethodHandles\n" +
+ " constant #73 utf8: \"java/lang/invoke/MethodHandles\"\n" +
+ " constant #74 utf8: \"Lookup\"\n" +
+ " \n" +
+ " // Field descriptor #6 LFunction2;\n" +
+ " // Signature: LFunction2<Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;>;\n" +
+ " public Function2 concat;\n" +
+ " \n" +
+ " // Method descriptor #10 ()V\n" +
+ " // Stack: 3, Locals: 2\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [12]\n" +
+ " 4 new java.lang.String [14]\n" +
+ " 7 dup\n" +
+ " 8 ldc <String \"S\"> [16]\n" +
+ " 10 invokespecial java.lang.String(java.lang.String) [18]\n" +
+ " 13 astore_1 [s0]\n" +
+ " 14 aload_0 [this]\n" +
+ " 15 aload_1 [s0]\n" +
+ " 16 invokedynamic 0 apply(java.lang.String) : Function2 [21]\n" +
+ " 21 putfield X.concat : Function2 [25]\n" +
+ " 24 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
+ " [pc: 4, line: 4]\n" +
+ " [pc: 14, line: 5]\n" +
+ " [pc: 24, line: 1]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 25] local: this index: 0 type: X\n" +
+ " [pc: 14, pc: 24] local: s0 index: 1 type: java.lang.String\n" +
+ " \n" +
+ " // Method descriptor #34 (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
+ " // Stack: 3, Locals: 3\n" +
+ " private static synthetic java.lang.String lambda$0(java.lang.String arg0, java.lang.String s1, java.lang.String s2);\n" +
+ " 0 new java.lang.StringBuilder [35]\n" +
+ " 3 dup\n" +
+ " 4 aload_0 [arg0]\n" +
+ " 5 invokestatic java.lang.String.valueOf(java.lang.Object) : java.lang.String [37]\n" +
+ " 8 invokespecial java.lang.StringBuilder(java.lang.String) [41]\n" +
+ " 11 aload_1 [s1]\n" +
+ " 12 invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [42]\n" +
+ " 15 aload_2 [s2]\n" +
+ " 16 invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [42]\n" +
+ " 19 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [46]\n" +
+ " 22 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 5]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 23] local: s1 index: 1 type: java.lang.String\n" +
+ " [pc: 0, pc: 23] local: s2 index: 2 type: java.lang.String\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #70 java/lang/invoke/MethodHandles$Lookup, outer class info: #72 java/lang/invoke/MethodHandles\n" +
+ " inner name: #74 Lookup, accessflags: 25 public static final]\n" +
+ "Bootstrap methods:\n" +
+ " 0 : # 61 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
+ "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " Method arguments:\n" +
+ " #63 (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n" +
+ " #66 invokestatic X.lambda$0:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
+ " #68 (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\n" +
"}";
verifyClassFile(expectedOutput, "X.class", ClassFileBytesDisassembler.SYSTEM);
@@ -1615,137 +1615,137 @@ public void test012() throws Exception {
"");
String expectedOutput =
- "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
- "public class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"<init>\"\n" +
- " constant #6 utf8: \"()V\"\n" +
- " constant #7 utf8: \"Code\"\n" +
- " constant #8 method_ref: #3.#9 java/lang/Object.<init> ()V\n" +
- " constant #9 name_and_type: #5.#6 <init> ()V\n" +
- " constant #10 utf8: \"LineNumberTable\"\n" +
- " constant #11 utf8: \"LocalVariableTable\"\n" +
- " constant #12 utf8: \"this\"\n" +
- " constant #13 utf8: \"LX;\"\n" +
- " constant #14 utf8: \"main\"\n" +
- " constant #15 utf8: \"([Ljava/lang/String;)V\"\n" +
- " constant #16 invoke dynamic: #0 #17 doit ([Ljava/lang/String;II)LI;\n" +
- " constant #17 name_and_type: #18.#19 doit ([Ljava/lang/String;II)LI;\n" +
- " constant #18 utf8: \"doit\"\n" +
- " constant #19 utf8: \"([Ljava/lang/String;II)LI;\"\n" +
- " constant #20 utf8: \"args\"\n" +
- " constant #21 utf8: \"[Ljava/lang/String;\"\n" +
- " constant #22 utf8: \"local1\"\n" +
- " constant #23 utf8: \"I\"\n" +
- " constant #24 utf8: \"local2\"\n" +
- " constant #25 utf8: \"i\"\n" +
- " constant #26 utf8: \"LI;\"\n" +
- " constant #27 utf8: \"lambda$0\"\n" +
- " constant #28 utf8: \"([Ljava/lang/String;IILjava/lang/Object;Ljava/lang/Object;)V\"\n" +
- " constant #29 utf8: \"RuntimeVisibleParameterAnnotations\"\n" +
- " constant #30 utf8: \"LAnnotation;\"\n" +
- " constant #31 utf8: \"o\"\n" +
- " constant #32 utf8: \"Ljava/lang/Object;\"\n" +
- " constant #33 utf8: \"p\"\n" +
- " constant #34 utf8: \"SourceFile\"\n" +
- " constant #35 utf8: \"X.java\"\n" +
- " constant #36 utf8: \"BootstrapMethods\"\n" +
- " constant #37 method_ref: #38.#40 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #38 class: #39 java/lang/invoke/LambdaMetafactory\n" +
- " constant #39 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
- " constant #40 name_and_type: #41.#42 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #41 utf8: \"metafactory\"\n" +
- " constant #42 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
- " constant #43 method handle: invokestatic (6) #37 \n" +
- " constant #44 utf8: \"(Ljava/lang/Object;Ljava/lang/Object;)V\"\n" +
- " constant #45 method type: #44 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
- " constant #46 method_ref: #1.#47 X.lambda$0 ([Ljava/lang/String;IILjava/lang/Object;Ljava/lang/Object;)V\n" +
- " constant #47 name_and_type: #27.#28 lambda$0 ([Ljava/lang/String;IILjava/lang/Object;Ljava/lang/Object;)V\n" +
- " constant #48 method handle: invokestatic (6) #46 \n" +
- " constant #49 method type: #44 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
- " constant #50 utf8: \"InnerClasses\"\n" +
- " constant #51 class: #52 java/lang/invoke/MethodHandles$Lookup\n" +
- " constant #52 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
- " constant #53 class: #54 java/lang/invoke/MethodHandles\n" +
- " constant #54 utf8: \"java/lang/invoke/MethodHandles\"\n" +
- " constant #55 utf8: \"Lookup\"\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [8]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 8]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- " \n" +
- " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
- " // Stack: 3, Locals: 4\n" +
- " public static void main(java.lang.String[] args);\n" +
- " 0 iconst_0\n" +
- " 1 istore_1 [local1]\n" +
- " 2 iconst_1\n" +
- " 3 istore_2 [local2]\n" +
- " 4 aload_0 [args]\n" +
- " 5 iload_1 [local1]\n" +
- " 6 iload_2 [local2]\n" +
- " 7 invokedynamic 0 doit(java.lang.String[], int, int) : I [16]\n" +
- " 12 astore_3 [i]\n" +
- " 13 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 10]\n" +
- " [pc: 4, line: 11]\n" +
- " [pc: 13, line: 14]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 14] local: args index: 0 type: java.lang.String[]\n" +
- " [pc: 2, pc: 14] local: local1 index: 1 type: int\n" +
- " [pc: 4, pc: 14] local: local2 index: 2 type: int\n" +
- " [pc: 13, pc: 14] local: i index: 3 type: I\n" +
- " \n" +
- " // Method descriptor #28 ([Ljava/lang/String;IILjava/lang/Object;Ljava/lang/Object;)V\n" +
- " // Stack: 2, Locals: 6\n" +
- " private static synthetic void lambda$0(java.lang.String[] arg0, int arg1, int arg2, java.lang.Object o, java.lang.Object p);\n" +
- " 0 aload_0 [arg0]\n" +
- " 1 arraylength\n" +
- " 2 iload_1 [arg1]\n" +
- " 3 iadd\n" +
- " 4 iload_2 [arg2]\n" +
- " 5 iadd\n" +
- " 6 istore 5\n" +
- " 8 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 12]\n" +
- " [pc: 8, line: 13]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 9] local: o index: 3 type: java.lang.Object\n" +
- " [pc: 0, pc: 9] local: p index: 4 type: java.lang.Object\n" +
- " RuntimeVisibleParameterAnnotations: \n" +
- " Number of annotations for parameter 0: 0\n" +
- " Number of annotations for parameter 1: 0\n" +
- " Number of annotations for parameter 2: 0\n" +
- " Number of annotations for parameter 3: 1\n" +
- " #30 @Annotation(\n" +
- " )\n" +
- " Number of annotations for parameter 4: 1\n" +
- " #30 @Annotation(\n" +
- " )\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #51 java/lang/invoke/MethodHandles$Lookup, outer class info: #53 java/lang/invoke/MethodHandles\n" +
- " inner name: #55 Lookup, accessflags: 25 public static final]\n" +
- "Bootstrap methods:\n" +
- " 0 : # 43 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
- "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " Method arguments:\n" +
- " #45 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
- " #48 invokestatic X.lambda$0:([Ljava/lang/String;IILjava/lang/Object;Ljava/lang/Object;)V\n" +
- " #49 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
+ "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
+ "public class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"<init>\"\n" +
+ " constant #6 utf8: \"()V\"\n" +
+ " constant #7 utf8: \"Code\"\n" +
+ " constant #8 method_ref: #3.#9 java/lang/Object.<init> ()V\n" +
+ " constant #9 name_and_type: #5.#6 <init> ()V\n" +
+ " constant #10 utf8: \"LineNumberTable\"\n" +
+ " constant #11 utf8: \"LocalVariableTable\"\n" +
+ " constant #12 utf8: \"this\"\n" +
+ " constant #13 utf8: \"LX;\"\n" +
+ " constant #14 utf8: \"main\"\n" +
+ " constant #15 utf8: \"([Ljava/lang/String;)V\"\n" +
+ " constant #16 invoke dynamic: #0 #17 doit ([Ljava/lang/String;II)LI;\n" +
+ " constant #17 name_and_type: #18.#19 doit ([Ljava/lang/String;II)LI;\n" +
+ " constant #18 utf8: \"doit\"\n" +
+ " constant #19 utf8: \"([Ljava/lang/String;II)LI;\"\n" +
+ " constant #20 utf8: \"args\"\n" +
+ " constant #21 utf8: \"[Ljava/lang/String;\"\n" +
+ " constant #22 utf8: \"local1\"\n" +
+ " constant #23 utf8: \"I\"\n" +
+ " constant #24 utf8: \"local2\"\n" +
+ " constant #25 utf8: \"i\"\n" +
+ " constant #26 utf8: \"LI;\"\n" +
+ " constant #27 utf8: \"lambda$0\"\n" +
+ " constant #28 utf8: \"([Ljava/lang/String;IILjava/lang/Object;Ljava/lang/Object;)V\"\n" +
+ " constant #29 utf8: \"RuntimeVisibleParameterAnnotations\"\n" +
+ " constant #30 utf8: \"LAnnotation;\"\n" +
+ " constant #31 utf8: \"o\"\n" +
+ " constant #32 utf8: \"Ljava/lang/Object;\"\n" +
+ " constant #33 utf8: \"p\"\n" +
+ " constant #34 utf8: \"SourceFile\"\n" +
+ " constant #35 utf8: \"X.java\"\n" +
+ " constant #36 utf8: \"BootstrapMethods\"\n" +
+ " constant #37 method_ref: #38.#40 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #38 class: #39 java/lang/invoke/LambdaMetafactory\n" +
+ " constant #39 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
+ " constant #40 name_and_type: #41.#42 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #41 utf8: \"metafactory\"\n" +
+ " constant #42 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
+ " constant #43 method handle: invokestatic (6) #37 \n" +
+ " constant #44 utf8: \"(Ljava/lang/Object;Ljava/lang/Object;)V\"\n" +
+ " constant #45 method type: #44 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
+ " constant #46 method_ref: #1.#47 X.lambda$0 ([Ljava/lang/String;IILjava/lang/Object;Ljava/lang/Object;)V\n" +
+ " constant #47 name_and_type: #27.#28 lambda$0 ([Ljava/lang/String;IILjava/lang/Object;Ljava/lang/Object;)V\n" +
+ " constant #48 method handle: invokestatic (6) #46 \n" +
+ " constant #49 method type: #44 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
+ " constant #50 utf8: \"InnerClasses\"\n" +
+ " constant #51 class: #52 java/lang/invoke/MethodHandles$Lookup\n" +
+ " constant #52 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
+ " constant #53 class: #54 java/lang/invoke/MethodHandles\n" +
+ " constant #54 utf8: \"java/lang/invoke/MethodHandles\"\n" +
+ " constant #55 utf8: \"Lookup\"\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [8]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 8]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
+ " \n" +
+ " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
+ " // Stack: 3, Locals: 4\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 iconst_0\n" +
+ " 1 istore_1 [local1]\n" +
+ " 2 iconst_1\n" +
+ " 3 istore_2 [local2]\n" +
+ " 4 aload_0 [args]\n" +
+ " 5 iload_1 [local1]\n" +
+ " 6 iload_2 [local2]\n" +
+ " 7 invokedynamic 0 doit(java.lang.String[], int, int) : I [16]\n" +
+ " 12 astore_3 [i]\n" +
+ " 13 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 10]\n" +
+ " [pc: 4, line: 11]\n" +
+ " [pc: 13, line: 14]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 14] local: args index: 0 type: java.lang.String[]\n" +
+ " [pc: 2, pc: 14] local: local1 index: 1 type: int\n" +
+ " [pc: 4, pc: 14] local: local2 index: 2 type: int\n" +
+ " [pc: 13, pc: 14] local: i index: 3 type: I\n" +
+ " \n" +
+ " // Method descriptor #28 ([Ljava/lang/String;IILjava/lang/Object;Ljava/lang/Object;)V\n" +
+ " // Stack: 2, Locals: 6\n" +
+ " private static synthetic void lambda$0(java.lang.String[] arg0, int arg1, int arg2, java.lang.Object o, java.lang.Object p);\n" +
+ " 0 aload_0 [arg0]\n" +
+ " 1 arraylength\n" +
+ " 2 iload_1 [arg1]\n" +
+ " 3 iadd\n" +
+ " 4 iload_2 [arg2]\n" +
+ " 5 iadd\n" +
+ " 6 istore 5\n" +
+ " 8 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 12]\n" +
+ " [pc: 8, line: 13]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 9] local: o index: 3 type: java.lang.Object\n" +
+ " [pc: 0, pc: 9] local: p index: 4 type: java.lang.Object\n" +
+ " RuntimeVisibleParameterAnnotations: \n" +
+ " Number of annotations for parameter 0: 0\n" +
+ " Number of annotations for parameter 1: 0\n" +
+ " Number of annotations for parameter 2: 0\n" +
+ " Number of annotations for parameter 3: 1\n" +
+ " #30 @Annotation(\n" +
+ " )\n" +
+ " Number of annotations for parameter 4: 1\n" +
+ " #30 @Annotation(\n" +
+ " )\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #51 java/lang/invoke/MethodHandles$Lookup, outer class info: #53 java/lang/invoke/MethodHandles\n" +
+ " inner name: #55 Lookup, accessflags: 25 public static final]\n" +
+ "Bootstrap methods:\n" +
+ " 0 : # 43 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
+ "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " Method arguments:\n" +
+ " #45 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
+ " #48 invokestatic X.lambda$0:([Ljava/lang/String;IILjava/lang/Object;Ljava/lang/Object;)V\n" +
+ " #49 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
"}"
;
@@ -1777,112 +1777,112 @@ public void test013() throws Exception {
"");
String expectedOutput =
- "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
- "public class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"<init>\"\n" +
- " constant #6 utf8: \"()V\"\n" +
- " constant #7 utf8: \"Code\"\n" +
- " constant #8 method_ref: #3.#9 java/lang/Object.<init> ()V\n" +
- " constant #9 name_and_type: #5.#6 <init> ()V\n" +
- " constant #10 utf8: \"LineNumberTable\"\n" +
- " constant #11 utf8: \"LocalVariableTable\"\n" +
- " constant #12 utf8: \"this\"\n" +
- " constant #13 utf8: \"LX;\"\n" +
- " constant #14 utf8: \"main\"\n" +
- " constant #15 utf8: \"([Ljava/lang/String;)V\"\n" +
- " constant #16 invoke dynamic: #0 #17 doit ()LI;\n" +
- " constant #17 name_and_type: #18.#19 doit ()LI;\n" +
- " constant #18 utf8: \"doit\"\n" +
- " constant #19 utf8: \"()LI;\"\n" +
- " constant #20 utf8: \"args\"\n" +
- " constant #21 utf8: \"[Ljava/lang/String;\"\n" +
- " constant #22 utf8: \"i\"\n" +
- " constant #23 utf8: \"LI;\"\n" +
- " constant #24 utf8: \"lambda$0\"\n" +
- " constant #25 utf8: \"(Ljava/lang/Object;Ljava/lang/Object;)V\"\n" +
- " constant #26 utf8: \"RuntimeVisibleParameterAnnotations\"\n" +
- " constant #27 utf8: \"LAnnotation;\"\n" +
- " constant #28 utf8: \"o\"\n" +
- " constant #29 utf8: \"Ljava/lang/Object;\"\n" +
- " constant #30 utf8: \"p\"\n" +
- " constant #31 utf8: \"SourceFile\"\n" +
- " constant #32 utf8: \"X.java\"\n" +
- " constant #33 utf8: \"BootstrapMethods\"\n" +
- " constant #34 method_ref: #35.#37 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #35 class: #36 java/lang/invoke/LambdaMetafactory\n" +
- " constant #36 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
- " constant #37 name_and_type: #38.#39 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #38 utf8: \"metafactory\"\n" +
- " constant #39 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
- " constant #40 method handle: invokestatic (6) #34 \n" +
- " constant #41 method type: #25 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
- " constant #42 method_ref: #1.#43 X.lambda$0 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
- " constant #43 name_and_type: #24.#25 lambda$0 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
- " constant #44 method handle: invokestatic (6) #42 \n" +
- " constant #45 method type: #25 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
- " constant #46 utf8: \"InnerClasses\"\n" +
- " constant #47 class: #48 java/lang/invoke/MethodHandles$Lookup\n" +
- " constant #48 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
- " constant #49 class: #50 java/lang/invoke/MethodHandles\n" +
- " constant #50 utf8: \"java/lang/invoke/MethodHandles\"\n" +
- " constant #51 utf8: \"Lookup\"\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [8]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 8]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- " \n" +
- " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
- " // Stack: 1, Locals: 2\n" +
- " public static void main(java.lang.String[] args);\n" +
- " 0 invokedynamic 0 doit() : I [16]\n" +
- " 5 astore_1 [i]\n" +
- " 6 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 10]\n" +
- " [pc: 6, line: 12]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 7] local: args index: 0 type: java.lang.String[]\n" +
- " [pc: 6, pc: 7] local: i index: 1 type: I\n" +
- " \n" +
- " // Method descriptor #25 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
- " // Stack: 0, Locals: 2\n" +
- " private static synthetic void lambda$0(java.lang.Object o, java.lang.Object p);\n" +
- " 0 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 11]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 1] local: o index: 0 type: java.lang.Object\n" +
- " [pc: 0, pc: 1] local: p index: 1 type: java.lang.Object\n" +
- " RuntimeVisibleParameterAnnotations: \n" +
- " Number of annotations for parameter 0: 1\n" +
- " #27 @Annotation(\n" +
- " )\n" +
- " Number of annotations for parameter 1: 1\n" +
- " #27 @Annotation(\n" +
- " )\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #47 java/lang/invoke/MethodHandles$Lookup, outer class info: #49 java/lang/invoke/MethodHandles\n" +
- " inner name: #51 Lookup, accessflags: 25 public static final]\n" +
- "Bootstrap methods:\n" +
- " 0 : # 40 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
- "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " Method arguments:\n" +
- " #41 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
- " #44 invokestatic X.lambda$0:(Ljava/lang/Object;Ljava/lang/Object;)V\n" +
- " #45 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
+ "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
+ "public class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"<init>\"\n" +
+ " constant #6 utf8: \"()V\"\n" +
+ " constant #7 utf8: \"Code\"\n" +
+ " constant #8 method_ref: #3.#9 java/lang/Object.<init> ()V\n" +
+ " constant #9 name_and_type: #5.#6 <init> ()V\n" +
+ " constant #10 utf8: \"LineNumberTable\"\n" +
+ " constant #11 utf8: \"LocalVariableTable\"\n" +
+ " constant #12 utf8: \"this\"\n" +
+ " constant #13 utf8: \"LX;\"\n" +
+ " constant #14 utf8: \"main\"\n" +
+ " constant #15 utf8: \"([Ljava/lang/String;)V\"\n" +
+ " constant #16 invoke dynamic: #0 #17 doit ()LI;\n" +
+ " constant #17 name_and_type: #18.#19 doit ()LI;\n" +
+ " constant #18 utf8: \"doit\"\n" +
+ " constant #19 utf8: \"()LI;\"\n" +
+ " constant #20 utf8: \"args\"\n" +
+ " constant #21 utf8: \"[Ljava/lang/String;\"\n" +
+ " constant #22 utf8: \"i\"\n" +
+ " constant #23 utf8: \"LI;\"\n" +
+ " constant #24 utf8: \"lambda$0\"\n" +
+ " constant #25 utf8: \"(Ljava/lang/Object;Ljava/lang/Object;)V\"\n" +
+ " constant #26 utf8: \"RuntimeVisibleParameterAnnotations\"\n" +
+ " constant #27 utf8: \"LAnnotation;\"\n" +
+ " constant #28 utf8: \"o\"\n" +
+ " constant #29 utf8: \"Ljava/lang/Object;\"\n" +
+ " constant #30 utf8: \"p\"\n" +
+ " constant #31 utf8: \"SourceFile\"\n" +
+ " constant #32 utf8: \"X.java\"\n" +
+ " constant #33 utf8: \"BootstrapMethods\"\n" +
+ " constant #34 method_ref: #35.#37 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #35 class: #36 java/lang/invoke/LambdaMetafactory\n" +
+ " constant #36 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
+ " constant #37 name_and_type: #38.#39 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #38 utf8: \"metafactory\"\n" +
+ " constant #39 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
+ " constant #40 method handle: invokestatic (6) #34 \n" +
+ " constant #41 method type: #25 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
+ " constant #42 method_ref: #1.#43 X.lambda$0 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
+ " constant #43 name_and_type: #24.#25 lambda$0 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
+ " constant #44 method handle: invokestatic (6) #42 \n" +
+ " constant #45 method type: #25 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
+ " constant #46 utf8: \"InnerClasses\"\n" +
+ " constant #47 class: #48 java/lang/invoke/MethodHandles$Lookup\n" +
+ " constant #48 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
+ " constant #49 class: #50 java/lang/invoke/MethodHandles\n" +
+ " constant #50 utf8: \"java/lang/invoke/MethodHandles\"\n" +
+ " constant #51 utf8: \"Lookup\"\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [8]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 8]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
+ " \n" +
+ " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
+ " // Stack: 1, Locals: 2\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 invokedynamic 0 doit() : I [16]\n" +
+ " 5 astore_1 [i]\n" +
+ " 6 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 10]\n" +
+ " [pc: 6, line: 12]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 7] local: args index: 0 type: java.lang.String[]\n" +
+ " [pc: 6, pc: 7] local: i index: 1 type: I\n" +
+ " \n" +
+ " // Method descriptor #25 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
+ " // Stack: 0, Locals: 2\n" +
+ " private static synthetic void lambda$0(java.lang.Object o, java.lang.Object p);\n" +
+ " 0 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 11]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 1] local: o index: 0 type: java.lang.Object\n" +
+ " [pc: 0, pc: 1] local: p index: 1 type: java.lang.Object\n" +
+ " RuntimeVisibleParameterAnnotations: \n" +
+ " Number of annotations for parameter 0: 1\n" +
+ " #27 @Annotation(\n" +
+ " )\n" +
+ " Number of annotations for parameter 1: 1\n" +
+ " #27 @Annotation(\n" +
+ " )\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #47 java/lang/invoke/MethodHandles$Lookup, outer class info: #49 java/lang/invoke/MethodHandles\n" +
+ " inner name: #51 Lookup, accessflags: 25 public static final]\n" +
+ "Bootstrap methods:\n" +
+ " 0 : # 40 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
+ "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " Method arguments:\n" +
+ " #41 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
+ " #44 invokestatic X.lambda$0:(Ljava/lang/Object;Ljava/lang/Object;)V\n" +
+ " #45 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
"}";
verifyClassFile(expectedOutput, "X.class", ClassFileBytesDisassembler.SYSTEM);
@@ -1916,179 +1916,179 @@ public void test014() throws Exception {
"");
String expectedOutput =
- "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
- "public class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"i\"\n" +
- " constant #6 utf8: \"LI;\"\n" +
- " constant #7 utf8: \"<init>\"\n" +
- " constant #8 utf8: \"()V\"\n" +
- " constant #9 utf8: \"Code\"\n" +
- " constant #10 method_ref: #3.#11 java/lang/Object.<init> ()V\n" +
- " constant #11 name_and_type: #7.#8 <init> ()V\n" +
- " constant #12 invoke dynamic: #0 #13 doit ()LI;\n" +
- " constant #13 name_and_type: #14.#15 doit ()LI;\n" +
- " constant #14 utf8: \"doit\"\n" +
- " constant #15 utf8: \"()LI;\"\n" +
- " constant #16 field_ref: #1.#17 X.i LI;\n" +
- " constant #17 name_and_type: #5.#6 i LI;\n" +
- " constant #18 utf8: \"LineNumberTable\"\n" +
- " constant #19 utf8: \"LocalVariableTable\"\n" +
- " constant #20 utf8: \"this\"\n" +
- " constant #21 utf8: \"LX;\"\n" +
- " constant #22 utf8: \"main\"\n" +
- " constant #23 utf8: \"([Ljava/lang/String;)V\"\n" +
- " constant #24 invoke dynamic: #1 #25 doit ([Ljava/lang/String;II)LI;\n" +
- " constant #25 name_and_type: #14.#26 doit ([Ljava/lang/String;II)LI;\n" +
- " constant #26 utf8: \"([Ljava/lang/String;II)LI;\"\n" +
- " constant #27 utf8: \"args\"\n" +
- " constant #28 utf8: \"[Ljava/lang/String;\"\n" +
- " constant #29 utf8: \"local1\"\n" +
- " constant #30 utf8: \"I\"\n" +
- " constant #31 utf8: \"local2\"\n" +
- " constant #32 utf8: \"lambda$0\"\n" +
- " constant #33 utf8: \"(Ljava/lang/Object;Ljava/lang/Object;)V\"\n" +
- " constant #34 utf8: \"RuntimeVisibleParameterAnnotations\"\n" +
- " constant #35 utf8: \"LAnnotation;\"\n" +
- " constant #36 utf8: \"o\"\n" +
- " constant #37 utf8: \"Ljava/lang/Object;\"\n" +
- " constant #38 utf8: \"p\"\n" +
- " constant #39 utf8: \"lambda$1\"\n" +
- " constant #40 utf8: \"([Ljava/lang/String;IILjava/lang/Object;Ljava/lang/Object;)V\"\n" +
- " constant #41 utf8: \"SourceFile\"\n" +
- " constant #42 utf8: \"X.java\"\n" +
- " constant #43 utf8: \"BootstrapMethods\"\n" +
- " constant #44 method_ref: #45.#47 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #45 class: #46 java/lang/invoke/LambdaMetafactory\n" +
- " constant #46 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
- " constant #47 name_and_type: #48.#49 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #48 utf8: \"metafactory\"\n" +
- " constant #49 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
- " constant #50 method handle: invokestatic (6) #44 \n" +
- " constant #51 method type: #33 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
- " constant #52 method_ref: #1.#53 X.lambda$0 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
- " constant #53 name_and_type: #32.#33 lambda$0 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
- " constant #54 method handle: invokestatic (6) #52 \n" +
- " constant #55 method type: #33 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
- " constant #56 method type: #33 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
- " constant #57 method_ref: #1.#58 X.lambda$1 ([Ljava/lang/String;IILjava/lang/Object;Ljava/lang/Object;)V\n" +
- " constant #58 name_and_type: #39.#40 lambda$1 ([Ljava/lang/String;IILjava/lang/Object;Ljava/lang/Object;)V\n" +
- " constant #59 method handle: invokestatic (6) #57 \n" +
- " constant #60 method type: #33 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
- " constant #61 utf8: \"InnerClasses\"\n" +
- " constant #62 class: #63 java/lang/invoke/MethodHandles$Lookup\n" +
- " constant #63 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
- " constant #64 class: #65 java/lang/invoke/MethodHandles\n" +
- " constant #65 utf8: \"java/lang/invoke/MethodHandles\"\n" +
- " constant #66 utf8: \"Lookup\"\n" +
- " \n" +
- " // Field descriptor #6 LI;\n" +
- " I i;\n" +
- " \n" +
- " // Method descriptor #8 ()V\n" +
- " // Stack: 2, Locals: 1\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [10]\n" +
- " 4 aload_0 [this]\n" +
- " 5 invokedynamic 0 doit() : I [12]\n" +
- " 10 putfield X.i : I [16]\n" +
- " 13 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 8]\n" +
- " [pc: 4, line: 9]\n" +
- " [pc: 13, line: 8]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
- " \n" +
- " // Method descriptor #23 ([Ljava/lang/String;)V\n" +
- " // Stack: 3, Locals: 4\n" +
- " public static void main(java.lang.String[] args);\n" +
- " 0 iconst_0\n" +
- " 1 istore_1 [local1]\n" +
- " 2 iconst_1\n" +
- " 3 istore_2 [local2]\n" +
- " 4 aload_0 [args]\n" +
- " 5 iload_1 [local1]\n" +
- " 6 iload_2 [local2]\n" +
- " 7 invokedynamic 1 doit(java.lang.String[], int, int) : I [24]\n" +
- " 12 astore_3 [i]\n" +
- " 13 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 12]\n" +
- " [pc: 4, line: 13]\n" +
- " [pc: 13, line: 16]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 14] local: args index: 0 type: java.lang.String[]\n" +
- " [pc: 2, pc: 14] local: local1 index: 1 type: int\n" +
- " [pc: 4, pc: 14] local: local2 index: 2 type: int\n" +
- " [pc: 13, pc: 14] local: i index: 3 type: I\n" +
- " \n" +
- " // Method descriptor #33 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
- " // Stack: 0, Locals: 2\n" +
- " private static synthetic void lambda$0(java.lang.Object o, java.lang.Object p);\n" +
- " 0 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 10]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 1] local: o index: 0 type: java.lang.Object\n" +
- " [pc: 0, pc: 1] local: p index: 1 type: java.lang.Object\n" +
- " RuntimeVisibleParameterAnnotations: \n" +
- " Number of annotations for parameter 0: 1\n" +
- " #35 @Annotation(\n" +
- " )\n" +
- " Number of annotations for parameter 1: 1\n" +
- " #35 @Annotation(\n" +
- " )\n" +
- " \n" +
- " // Method descriptor #40 ([Ljava/lang/String;IILjava/lang/Object;Ljava/lang/Object;)V\n" +
- " // Stack: 2, Locals: 6\n" +
- " private static synthetic void lambda$1(java.lang.String[] arg0, int arg1, int arg2, java.lang.Object o, java.lang.Object p);\n" +
- " 0 aload_0 [arg0]\n" +
- " 1 arraylength\n" +
- " 2 iload_1 [arg1]\n" +
- " 3 iadd\n" +
- " 4 iload_2 [arg2]\n" +
- " 5 iadd\n" +
- " 6 istore 5\n" +
- " 8 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 14]\n" +
- " [pc: 8, line: 15]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 9] local: o index: 3 type: java.lang.Object\n" +
- " [pc: 0, pc: 9] local: p index: 4 type: java.lang.Object\n" +
- " RuntimeVisibleParameterAnnotations: \n" +
- " Number of annotations for parameter 0: 0\n" +
- " Number of annotations for parameter 1: 0\n" +
- " Number of annotations for parameter 2: 0\n" +
- " Number of annotations for parameter 3: 1\n" +
- " #35 @Annotation(\n" +
- " )\n" +
- " Number of annotations for parameter 4: 1\n" +
- " #35 @Annotation(\n" +
- " )\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #62 java/lang/invoke/MethodHandles$Lookup, outer class info: #64 java/lang/invoke/MethodHandles\n" +
- " inner name: #66 Lookup, accessflags: 25 public static final]\n" +
- "Bootstrap methods:\n" +
- " 0 : # 50 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;" +
- "Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " Method arguments:\n" +
- " #51 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
- " #54 invokestatic X.lambda$0:(Ljava/lang/Object;Ljava/lang/Object;)V\n" +
- " #55 (Ljava/lang/Object;Ljava/lang/Object;)V,\n" +
- " 1 : # 50 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;" +
- "Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " Method arguments:\n" +
- " #56 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
- " #59 invokestatic X.lambda$1:([Ljava/lang/String;IILjava/lang/Object;Ljava/lang/Object;)V\n" +
- " #60 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
+ "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
+ "public class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"i\"\n" +
+ " constant #6 utf8: \"LI;\"\n" +
+ " constant #7 utf8: \"<init>\"\n" +
+ " constant #8 utf8: \"()V\"\n" +
+ " constant #9 utf8: \"Code\"\n" +
+ " constant #10 method_ref: #3.#11 java/lang/Object.<init> ()V\n" +
+ " constant #11 name_and_type: #7.#8 <init> ()V\n" +
+ " constant #12 invoke dynamic: #0 #13 doit ()LI;\n" +
+ " constant #13 name_and_type: #14.#15 doit ()LI;\n" +
+ " constant #14 utf8: \"doit\"\n" +
+ " constant #15 utf8: \"()LI;\"\n" +
+ " constant #16 field_ref: #1.#17 X.i LI;\n" +
+ " constant #17 name_and_type: #5.#6 i LI;\n" +
+ " constant #18 utf8: \"LineNumberTable\"\n" +
+ " constant #19 utf8: \"LocalVariableTable\"\n" +
+ " constant #20 utf8: \"this\"\n" +
+ " constant #21 utf8: \"LX;\"\n" +
+ " constant #22 utf8: \"main\"\n" +
+ " constant #23 utf8: \"([Ljava/lang/String;)V\"\n" +
+ " constant #24 invoke dynamic: #1 #25 doit ([Ljava/lang/String;II)LI;\n" +
+ " constant #25 name_and_type: #14.#26 doit ([Ljava/lang/String;II)LI;\n" +
+ " constant #26 utf8: \"([Ljava/lang/String;II)LI;\"\n" +
+ " constant #27 utf8: \"args\"\n" +
+ " constant #28 utf8: \"[Ljava/lang/String;\"\n" +
+ " constant #29 utf8: \"local1\"\n" +
+ " constant #30 utf8: \"I\"\n" +
+ " constant #31 utf8: \"local2\"\n" +
+ " constant #32 utf8: \"lambda$0\"\n" +
+ " constant #33 utf8: \"(Ljava/lang/Object;Ljava/lang/Object;)V\"\n" +
+ " constant #34 utf8: \"RuntimeVisibleParameterAnnotations\"\n" +
+ " constant #35 utf8: \"LAnnotation;\"\n" +
+ " constant #36 utf8: \"o\"\n" +
+ " constant #37 utf8: \"Ljava/lang/Object;\"\n" +
+ " constant #38 utf8: \"p\"\n" +
+ " constant #39 utf8: \"lambda$1\"\n" +
+ " constant #40 utf8: \"([Ljava/lang/String;IILjava/lang/Object;Ljava/lang/Object;)V\"\n" +
+ " constant #41 utf8: \"SourceFile\"\n" +
+ " constant #42 utf8: \"X.java\"\n" +
+ " constant #43 utf8: \"BootstrapMethods\"\n" +
+ " constant #44 method_ref: #45.#47 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #45 class: #46 java/lang/invoke/LambdaMetafactory\n" +
+ " constant #46 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
+ " constant #47 name_and_type: #48.#49 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #48 utf8: \"metafactory\"\n" +
+ " constant #49 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
+ " constant #50 method handle: invokestatic (6) #44 \n" +
+ " constant #51 method type: #33 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
+ " constant #52 method_ref: #1.#53 X.lambda$0 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
+ " constant #53 name_and_type: #32.#33 lambda$0 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
+ " constant #54 method handle: invokestatic (6) #52 \n" +
+ " constant #55 method type: #33 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
+ " constant #56 method type: #33 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
+ " constant #57 method_ref: #1.#58 X.lambda$1 ([Ljava/lang/String;IILjava/lang/Object;Ljava/lang/Object;)V\n" +
+ " constant #58 name_and_type: #39.#40 lambda$1 ([Ljava/lang/String;IILjava/lang/Object;Ljava/lang/Object;)V\n" +
+ " constant #59 method handle: invokestatic (6) #57 \n" +
+ " constant #60 method type: #33 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
+ " constant #61 utf8: \"InnerClasses\"\n" +
+ " constant #62 class: #63 java/lang/invoke/MethodHandles$Lookup\n" +
+ " constant #63 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
+ " constant #64 class: #65 java/lang/invoke/MethodHandles\n" +
+ " constant #65 utf8: \"java/lang/invoke/MethodHandles\"\n" +
+ " constant #66 utf8: \"Lookup\"\n" +
+ " \n" +
+ " // Field descriptor #6 LI;\n" +
+ " I i;\n" +
+ " \n" +
+ " // Method descriptor #8 ()V\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [10]\n" +
+ " 4 aload_0 [this]\n" +
+ " 5 invokedynamic 0 doit() : I [12]\n" +
+ " 10 putfield X.i : I [16]\n" +
+ " 13 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 8]\n" +
+ " [pc: 4, line: 9]\n" +
+ " [pc: 13, line: 8]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
+ " \n" +
+ " // Method descriptor #23 ([Ljava/lang/String;)V\n" +
+ " // Stack: 3, Locals: 4\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 iconst_0\n" +
+ " 1 istore_1 [local1]\n" +
+ " 2 iconst_1\n" +
+ " 3 istore_2 [local2]\n" +
+ " 4 aload_0 [args]\n" +
+ " 5 iload_1 [local1]\n" +
+ " 6 iload_2 [local2]\n" +
+ " 7 invokedynamic 1 doit(java.lang.String[], int, int) : I [24]\n" +
+ " 12 astore_3 [i]\n" +
+ " 13 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 12]\n" +
+ " [pc: 4, line: 13]\n" +
+ " [pc: 13, line: 16]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 14] local: args index: 0 type: java.lang.String[]\n" +
+ " [pc: 2, pc: 14] local: local1 index: 1 type: int\n" +
+ " [pc: 4, pc: 14] local: local2 index: 2 type: int\n" +
+ " [pc: 13, pc: 14] local: i index: 3 type: I\n" +
+ " \n" +
+ " // Method descriptor #33 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
+ " // Stack: 0, Locals: 2\n" +
+ " private static synthetic void lambda$0(java.lang.Object o, java.lang.Object p);\n" +
+ " 0 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 10]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 1] local: o index: 0 type: java.lang.Object\n" +
+ " [pc: 0, pc: 1] local: p index: 1 type: java.lang.Object\n" +
+ " RuntimeVisibleParameterAnnotations: \n" +
+ " Number of annotations for parameter 0: 1\n" +
+ " #35 @Annotation(\n" +
+ " )\n" +
+ " Number of annotations for parameter 1: 1\n" +
+ " #35 @Annotation(\n" +
+ " )\n" +
+ " \n" +
+ " // Method descriptor #40 ([Ljava/lang/String;IILjava/lang/Object;Ljava/lang/Object;)V\n" +
+ " // Stack: 2, Locals: 6\n" +
+ " private static synthetic void lambda$1(java.lang.String[] arg0, int arg1, int arg2, java.lang.Object o, java.lang.Object p);\n" +
+ " 0 aload_0 [arg0]\n" +
+ " 1 arraylength\n" +
+ " 2 iload_1 [arg1]\n" +
+ " 3 iadd\n" +
+ " 4 iload_2 [arg2]\n" +
+ " 5 iadd\n" +
+ " 6 istore 5\n" +
+ " 8 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 14]\n" +
+ " [pc: 8, line: 15]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 9] local: o index: 3 type: java.lang.Object\n" +
+ " [pc: 0, pc: 9] local: p index: 4 type: java.lang.Object\n" +
+ " RuntimeVisibleParameterAnnotations: \n" +
+ " Number of annotations for parameter 0: 0\n" +
+ " Number of annotations for parameter 1: 0\n" +
+ " Number of annotations for parameter 2: 0\n" +
+ " Number of annotations for parameter 3: 1\n" +
+ " #35 @Annotation(\n" +
+ " )\n" +
+ " Number of annotations for parameter 4: 1\n" +
+ " #35 @Annotation(\n" +
+ " )\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #62 java/lang/invoke/MethodHandles$Lookup, outer class info: #64 java/lang/invoke/MethodHandles\n" +
+ " inner name: #66 Lookup, accessflags: 25 public static final]\n" +
+ "Bootstrap methods:\n" +
+ " 0 : # 50 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;" +
+ "Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " Method arguments:\n" +
+ " #51 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
+ " #54 invokestatic X.lambda$0:(Ljava/lang/Object;Ljava/lang/Object;)V\n" +
+ " #55 (Ljava/lang/Object;Ljava/lang/Object;)V,\n" +
+ " 1 : # 50 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;" +
+ "Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " Method arguments:\n" +
+ " #56 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
+ " #59 invokestatic X.lambda$1:([Ljava/lang/String;IILjava/lang/Object;Ljava/lang/Object;)V\n" +
+ " #60 (Ljava/lang/Object;Ljava/lang/Object;)V\n" +
"}";
verifyClassFile(expectedOutput, "X.class", ClassFileBytesDisassembler.SYSTEM);
@@ -2110,220 +2110,220 @@ public void test015() throws Exception {
"");
String expectedOutput =
- "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
- "public class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"<init>\"\n" +
- " constant #6 utf8: \"()V\"\n" +
- " constant #7 utf8: \"Code\"\n" +
- " constant #8 method_ref: #3.#9 java/lang/Object.<init> ()V\n" +
- " constant #9 name_and_type: #5.#6 <init> ()V\n" +
- " constant #10 utf8: \"LineNumberTable\"\n" +
- " constant #11 utf8: \"LocalVariableTable\"\n" +
- " constant #12 utf8: \"this\"\n" +
- " constant #13 utf8: \"LX;\"\n" +
- " constant #14 utf8: \"main\"\n" +
- " constant #15 utf8: \"([Ljava/lang/String;)V\"\n" +
- " constant #16 invoke dynamic: #0 #17 foo ()LI;\n" +
- " constant #17 name_and_type: #18.#19 foo ()LI;\n" +
- " constant #18 utf8: \"foo\"\n" +
- " constant #19 utf8: \"()LI;\"\n" +
- " constant #20 utf8: \"args\"\n" +
- " constant #21 utf8: \"[Ljava/lang/String;\"\n" +
- " constant #22 utf8: \"i\"\n" +
- " constant #23 utf8: \"LI;\"\n" +
- " constant #24 utf8: \"lambda$0\"\n" +
- " constant #25 utf8: \"$deserializeLambda$\"\n" +
- " constant #26 utf8: \"(Ljava/lang/invoke/SerializedLambda;)Ljava/lang/Object;\"\n" +
- " constant #27 method_ref: #28.#30 java/lang/invoke/SerializedLambda.getImplMethodName ()Ljava/lang/String;\n" +
- " constant #28 class: #29 java/lang/invoke/SerializedLambda\n" +
- " constant #29 utf8: \"java/lang/invoke/SerializedLambda\"\n" +
- " constant #30 name_and_type: #31.#32 getImplMethodName ()Ljava/lang/String;\n" +
- " constant #31 utf8: \"getImplMethodName\"\n" +
- " constant #32 utf8: \"()Ljava/lang/String;\"\n" +
- " constant #33 method_ref: #34.#36 java/lang/String.hashCode ()I\n" +
- " constant #34 class: #35 java/lang/String\n" +
- " constant #35 utf8: \"java/lang/String\"\n" +
- " constant #36 name_and_type: #37.#38 hashCode ()I\n" +
- " constant #37 utf8: \"hashCode\"\n" +
- " constant #38 utf8: \"()I\"\n" +
- " constant #39 string: #24 \"lambda$0\"\n" +
- " constant #40 method_ref: #34.#41 java/lang/String.equals (Ljava/lang/Object;)Z\n" +
- " constant #41 name_and_type: #42.#43 equals (Ljava/lang/Object;)Z\n" +
- " constant #42 utf8: \"equals\"\n" +
- " constant #43 utf8: \"(Ljava/lang/Object;)Z\"\n" +
- " constant #44 method_ref: #28.#45 java/lang/invoke/SerializedLambda.getImplMethodKind ()I\n" +
- " constant #45 name_and_type: #46.#38 getImplMethodKind ()I\n" +
- " constant #46 utf8: \"getImplMethodKind\"\n" +
- " constant #47 method_ref: #28.#48 java/lang/invoke/SerializedLambda.getFunctionalInterfaceClass ()Ljava/lang/String;\n" +
- " constant #48 name_and_type: #49.#32 getFunctionalInterfaceClass ()Ljava/lang/String;\n" +
- " constant #49 utf8: \"getFunctionalInterfaceClass\"\n" +
- " constant #50 string: #51 \"I\"\n" +
- " constant #51 utf8: \"I\"\n" +
- " constant #52 method_ref: #3.#41 java/lang/Object.equals (Ljava/lang/Object;)Z\n" +
- " constant #53 method_ref: #28.#54 java/lang/invoke/SerializedLambda.getFunctionalInterfaceMethodName ()Ljava/lang/String;\n" +
- " constant #54 name_and_type: #55.#32 getFunctionalInterfaceMethodName ()Ljava/lang/String;\n" +
- " constant #55 utf8: \"getFunctionalInterfaceMethodName\"\n" +
- " constant #56 string: #18 \"foo\"\n" +
- " constant #57 method_ref: #28.#58 java/lang/invoke/SerializedLambda.getFunctionalInterfaceMethodSignature ()Ljava/lang/String;\n" +
- " constant #58 name_and_type: #59.#32 getFunctionalInterfaceMethodSignature ()Ljava/lang/String;\n" +
- " constant #59 utf8: \"getFunctionalInterfaceMethodSignature\"\n" +
- " constant #60 string: #6 \"()V\"\n" +
- " constant #61 method_ref: #28.#62 java/lang/invoke/SerializedLambda.getImplClass ()Ljava/lang/String;\n" +
- " constant #62 name_and_type: #63.#32 getImplClass ()Ljava/lang/String;\n" +
- " constant #63 utf8: \"getImplClass\"\n" +
- " constant #64 string: #2 \"X\"\n" +
- " constant #65 method_ref: #28.#66 java/lang/invoke/SerializedLambda.getImplMethodSignature ()Ljava/lang/String;\n" +
- " constant #66 name_and_type: #67.#32 getImplMethodSignature ()Ljava/lang/String;\n" +
- " constant #67 utf8: \"getImplMethodSignature\"\n" +
- " constant #68 class: #69 java/lang/IllegalArgumentException\n" +
- " constant #69 utf8: \"java/lang/IllegalArgumentException\"\n" +
- " constant #70 string: #71 \"Invalid lambda deserialization\"\n" +
- " constant #71 utf8: \"Invalid lambda deserialization\"\n" +
- " constant #72 method_ref: #68.#73 java/lang/IllegalArgumentException.<init> (Ljava/lang/String;)V\n" +
- " constant #73 name_and_type: #5.#74 <init> (Ljava/lang/String;)V\n" +
- " constant #74 utf8: \"(Ljava/lang/String;)V\"\n" +
- " constant #75 utf8: \"StackMapTable\"\n" +
- " constant #76 utf8: \"SourceFile\"\n" +
- " constant #77 utf8: \"X.java\"\n" +
- " constant #78 utf8: \"BootstrapMethods\"\n" +
- " constant #79 method_ref: #80.#82 java/lang/invoke/LambdaMetafactory.altMetafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;\n" +
- " constant #80 class: #81 java/lang/invoke/LambdaMetafactory\n" +
- " constant #81 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
- " constant #82 name_and_type: #83.#84 altMetafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;\n" +
- " constant #83 utf8: \"altMetafactory\"\n" +
- " constant #84 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;\"\n" +
- " constant #85 method handle: invokestatic (6) #79 \n" +
- " constant #86 method type: #6 ()V\n" +
- " constant #87 method_ref: #1.#88 X.lambda$0 ()V\n" +
- " constant #88 name_and_type: #24.#6 lambda$0 ()V\n" +
- " constant #89 method handle: invokestatic (6) #87 \n" +
- " constant #90 method type: #6 ()V\n" +
- " constant #91 integer: 1\n" +
- " constant #92 utf8: \"InnerClasses\"\n" +
- " constant #93 class: #94 java/lang/invoke/MethodHandles$Lookup\n" +
- " constant #94 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
- " constant #95 class: #96 java/lang/invoke/MethodHandles\n" +
- " constant #96 utf8: \"java/lang/invoke/MethodHandles\"\n" +
- " constant #97 utf8: \"Lookup\"\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [8]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 4]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- " \n" +
- " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
- " // Stack: 1, Locals: 2\n" +
- " public static void main(java.lang.String[] args);\n" +
- " 0 invokedynamic 0 foo() : I [16]\n" +
- " 5 astore_1 [i]\n" +
- " 6 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 6]\n" +
- " [pc: 6, line: 7]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 7] local: args index: 0 type: java.lang.String[]\n" +
- " [pc: 6, pc: 7] local: i index: 1 type: I\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 0, Locals: 0\n" +
- " private static synthetic void lambda$0();\n" +
- " 0 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 6]\n" +
- " \n" +
- " // Method descriptor #26 (Ljava/lang/invoke/SerializedLambda;)Ljava/lang/Object;\n" +
- " // Stack: 3, Locals: 3\n" +
- " private static synthetic java.lang.Object $deserializeLambda$(java.lang.invoke.SerializedLambda arg0);\n" +
- " 0 aload_0 [arg0]\n" +
- " 1 invokevirtual java.lang.invoke.SerializedLambda.getImplMethodName() : java.lang.String [27]\n" +
- " 4 astore_1\n" +
- " 5 iconst_m1\n" +
- " 6 istore_2\n" +
- " 7 aload_1\n" +
- " 8 invokevirtual java.lang.String.hashCode() : int [33]\n" +
- " 11 lookupswitch default: 39\n" +
- " case -1647345005: 28\n" +
- " 28 aload_1\n" +
- " 29 ldc <String \"lambda$0\"> [39]\n" +
- " 31 invokevirtual java.lang.String.equals(java.lang.Object) : boolean [40]\n" +
- " 34 ifeq 39\n" +
- " 37 iconst_0\n" +
- " 38 istore_2\n" +
- " 39 iload_2\n" +
- " 40 lookupswitch default: 135\n" +
- " case 0: 60\n" +
- " 60 aload_0 [arg0]\n" +
- " 61 invokevirtual java.lang.invoke.SerializedLambda.getImplMethodKind() : int [44]\n" +
- " 64 bipush 6\n" +
- " 66 if_icmpne 135\n" +
- " 69 aload_0 [arg0]\n" +
- " 70 invokevirtual java.lang.invoke.SerializedLambda.getFunctionalInterfaceClass() : java.lang.String [47]\n" +
- " 73 ldc <String \"I\"> [50]\n" +
- " 75 invokevirtual java.lang.Object.equals(java.lang.Object) : boolean [52]\n" +
- " 78 ifeq 135\n" +
- " 81 aload_0 [arg0]\n" +
- " 82 invokevirtual java.lang.invoke.SerializedLambda.getFunctionalInterfaceMethodName() : java.lang.String [53]\n" +
- " 85 ldc <String \"foo\"> [56]\n" +
- " 87 invokevirtual java.lang.Object.equals(java.lang.Object) : boolean [52]\n" +
- " 90 ifeq 135\n" +
- " 93 aload_0 [arg0]\n" +
- " 94 invokevirtual java.lang.invoke.SerializedLambda.getFunctionalInterfaceMethodSignature() : java.lang.String [57]\n" +
- " 97 ldc <String \"()V\"> [60]\n" +
- " 99 invokevirtual java.lang.Object.equals(java.lang.Object) : boolean [52]\n" +
- " 102 ifeq 135\n" +
- " 105 aload_0 [arg0]\n" +
- " 106 invokevirtual java.lang.invoke.SerializedLambda.getImplClass() : java.lang.String [61]\n" +
- " 109 ldc <String \"X\"> [64]\n" +
- " 111 invokevirtual java.lang.Object.equals(java.lang.Object) : boolean [52]\n" +
- " 114 ifeq 135\n" +
- " 117 aload_0 [arg0]\n" +
- " 118 invokevirtual java.lang.invoke.SerializedLambda.getImplMethodSignature() : java.lang.String [65]\n" +
- " 121 ldc <String \"()V\"> [60]\n" +
- " 123 invokevirtual java.lang.Object.equals(java.lang.Object) : boolean [52]\n" +
- " 126 ifeq 135\n" +
- " 129 invokedynamic 0 foo() : I [16]\n" +
- " 134 areturn\n" +
- " 135 new java.lang.IllegalArgumentException [68]\n" +
- " 138 dup\n" +
- " 139 ldc <String \"Invalid lambda deserialization\"> [70]\n" +
- " 141 invokespecial java.lang.IllegalArgumentException(java.lang.String) [72]\n" +
- " 144 athrow\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
- " Stack map table: number of frames 4\n" +
- " [pc: 28, append: {java.lang.String, int}]\n" +
- " [pc: 39, same]\n" +
- " [pc: 60, same]\n" +
- " [pc: 135, chop 2 local(s)]\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #93 java/lang/invoke/MethodHandles$Lookup, outer class info: #95 java/lang/invoke/MethodHandles\n" +
- " inner name: #97 Lookup, accessflags: 25 public static final]\n" +
- "Bootstrap methods:\n" +
- " 0 : # 85 invokestatic java/lang/invoke/LambdaMetafactory.altMetafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;\n" +
- " Method arguments:\n" +
- " #86 ()V\n" +
- " #89 invokestatic X.lambda$0:()V\n" +
- " #90 ()V\n" +
- " #91 1\n" +
+ "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
+ "public class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"<init>\"\n" +
+ " constant #6 utf8: \"()V\"\n" +
+ " constant #7 utf8: \"Code\"\n" +
+ " constant #8 method_ref: #3.#9 java/lang/Object.<init> ()V\n" +
+ " constant #9 name_and_type: #5.#6 <init> ()V\n" +
+ " constant #10 utf8: \"LineNumberTable\"\n" +
+ " constant #11 utf8: \"LocalVariableTable\"\n" +
+ " constant #12 utf8: \"this\"\n" +
+ " constant #13 utf8: \"LX;\"\n" +
+ " constant #14 utf8: \"main\"\n" +
+ " constant #15 utf8: \"([Ljava/lang/String;)V\"\n" +
+ " constant #16 invoke dynamic: #0 #17 foo ()LI;\n" +
+ " constant #17 name_and_type: #18.#19 foo ()LI;\n" +
+ " constant #18 utf8: \"foo\"\n" +
+ " constant #19 utf8: \"()LI;\"\n" +
+ " constant #20 utf8: \"args\"\n" +
+ " constant #21 utf8: \"[Ljava/lang/String;\"\n" +
+ " constant #22 utf8: \"i\"\n" +
+ " constant #23 utf8: \"LI;\"\n" +
+ " constant #24 utf8: \"lambda$0\"\n" +
+ " constant #25 utf8: \"$deserializeLambda$\"\n" +
+ " constant #26 utf8: \"(Ljava/lang/invoke/SerializedLambda;)Ljava/lang/Object;\"\n" +
+ " constant #27 method_ref: #28.#30 java/lang/invoke/SerializedLambda.getImplMethodName ()Ljava/lang/String;\n" +
+ " constant #28 class: #29 java/lang/invoke/SerializedLambda\n" +
+ " constant #29 utf8: \"java/lang/invoke/SerializedLambda\"\n" +
+ " constant #30 name_and_type: #31.#32 getImplMethodName ()Ljava/lang/String;\n" +
+ " constant #31 utf8: \"getImplMethodName\"\n" +
+ " constant #32 utf8: \"()Ljava/lang/String;\"\n" +
+ " constant #33 method_ref: #34.#36 java/lang/String.hashCode ()I\n" +
+ " constant #34 class: #35 java/lang/String\n" +
+ " constant #35 utf8: \"java/lang/String\"\n" +
+ " constant #36 name_and_type: #37.#38 hashCode ()I\n" +
+ " constant #37 utf8: \"hashCode\"\n" +
+ " constant #38 utf8: \"()I\"\n" +
+ " constant #39 string: #24 \"lambda$0\"\n" +
+ " constant #40 method_ref: #34.#41 java/lang/String.equals (Ljava/lang/Object;)Z\n" +
+ " constant #41 name_and_type: #42.#43 equals (Ljava/lang/Object;)Z\n" +
+ " constant #42 utf8: \"equals\"\n" +
+ " constant #43 utf8: \"(Ljava/lang/Object;)Z\"\n" +
+ " constant #44 method_ref: #28.#45 java/lang/invoke/SerializedLambda.getImplMethodKind ()I\n" +
+ " constant #45 name_and_type: #46.#38 getImplMethodKind ()I\n" +
+ " constant #46 utf8: \"getImplMethodKind\"\n" +
+ " constant #47 method_ref: #28.#48 java/lang/invoke/SerializedLambda.getFunctionalInterfaceClass ()Ljava/lang/String;\n" +
+ " constant #48 name_and_type: #49.#32 getFunctionalInterfaceClass ()Ljava/lang/String;\n" +
+ " constant #49 utf8: \"getFunctionalInterfaceClass\"\n" +
+ " constant #50 string: #51 \"I\"\n" +
+ " constant #51 utf8: \"I\"\n" +
+ " constant #52 method_ref: #3.#41 java/lang/Object.equals (Ljava/lang/Object;)Z\n" +
+ " constant #53 method_ref: #28.#54 java/lang/invoke/SerializedLambda.getFunctionalInterfaceMethodName ()Ljava/lang/String;\n" +
+ " constant #54 name_and_type: #55.#32 getFunctionalInterfaceMethodName ()Ljava/lang/String;\n" +
+ " constant #55 utf8: \"getFunctionalInterfaceMethodName\"\n" +
+ " constant #56 string: #18 \"foo\"\n" +
+ " constant #57 method_ref: #28.#58 java/lang/invoke/SerializedLambda.getFunctionalInterfaceMethodSignature ()Ljava/lang/String;\n" +
+ " constant #58 name_and_type: #59.#32 getFunctionalInterfaceMethodSignature ()Ljava/lang/String;\n" +
+ " constant #59 utf8: \"getFunctionalInterfaceMethodSignature\"\n" +
+ " constant #60 string: #6 \"()V\"\n" +
+ " constant #61 method_ref: #28.#62 java/lang/invoke/SerializedLambda.getImplClass ()Ljava/lang/String;\n" +
+ " constant #62 name_and_type: #63.#32 getImplClass ()Ljava/lang/String;\n" +
+ " constant #63 utf8: \"getImplClass\"\n" +
+ " constant #64 string: #2 \"X\"\n" +
+ " constant #65 method_ref: #28.#66 java/lang/invoke/SerializedLambda.getImplMethodSignature ()Ljava/lang/String;\n" +
+ " constant #66 name_and_type: #67.#32 getImplMethodSignature ()Ljava/lang/String;\n" +
+ " constant #67 utf8: \"getImplMethodSignature\"\n" +
+ " constant #68 class: #69 java/lang/IllegalArgumentException\n" +
+ " constant #69 utf8: \"java/lang/IllegalArgumentException\"\n" +
+ " constant #70 string: #71 \"Invalid lambda deserialization\"\n" +
+ " constant #71 utf8: \"Invalid lambda deserialization\"\n" +
+ " constant #72 method_ref: #68.#73 java/lang/IllegalArgumentException.<init> (Ljava/lang/String;)V\n" +
+ " constant #73 name_and_type: #5.#74 <init> (Ljava/lang/String;)V\n" +
+ " constant #74 utf8: \"(Ljava/lang/String;)V\"\n" +
+ " constant #75 utf8: \"StackMapTable\"\n" +
+ " constant #76 utf8: \"SourceFile\"\n" +
+ " constant #77 utf8: \"X.java\"\n" +
+ " constant #78 utf8: \"BootstrapMethods\"\n" +
+ " constant #79 method_ref: #80.#82 java/lang/invoke/LambdaMetafactory.altMetafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #80 class: #81 java/lang/invoke/LambdaMetafactory\n" +
+ " constant #81 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
+ " constant #82 name_and_type: #83.#84 altMetafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #83 utf8: \"altMetafactory\"\n" +
+ " constant #84 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;\"\n" +
+ " constant #85 method handle: invokestatic (6) #79 \n" +
+ " constant #86 method type: #6 ()V\n" +
+ " constant #87 method_ref: #1.#88 X.lambda$0 ()V\n" +
+ " constant #88 name_and_type: #24.#6 lambda$0 ()V\n" +
+ " constant #89 method handle: invokestatic (6) #87 \n" +
+ " constant #90 method type: #6 ()V\n" +
+ " constant #91 integer: 1\n" +
+ " constant #92 utf8: \"InnerClasses\"\n" +
+ " constant #93 class: #94 java/lang/invoke/MethodHandles$Lookup\n" +
+ " constant #94 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
+ " constant #95 class: #96 java/lang/invoke/MethodHandles\n" +
+ " constant #96 utf8: \"java/lang/invoke/MethodHandles\"\n" +
+ " constant #97 utf8: \"Lookup\"\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [8]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 4]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
+ " \n" +
+ " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
+ " // Stack: 1, Locals: 2\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 invokedynamic 0 foo() : I [16]\n" +
+ " 5 astore_1 [i]\n" +
+ " 6 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 6]\n" +
+ " [pc: 6, line: 7]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 7] local: args index: 0 type: java.lang.String[]\n" +
+ " [pc: 6, pc: 7] local: i index: 1 type: I\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 0, Locals: 0\n" +
+ " private static synthetic void lambda$0();\n" +
+ " 0 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 6]\n" +
+ " \n" +
+ " // Method descriptor #26 (Ljava/lang/invoke/SerializedLambda;)Ljava/lang/Object;\n" +
+ " // Stack: 3, Locals: 3\n" +
+ " private static synthetic java.lang.Object $deserializeLambda$(java.lang.invoke.SerializedLambda arg0);\n" +
+ " 0 aload_0 [arg0]\n" +
+ " 1 invokevirtual java.lang.invoke.SerializedLambda.getImplMethodName() : java.lang.String [27]\n" +
+ " 4 astore_1\n" +
+ " 5 iconst_m1\n" +
+ " 6 istore_2\n" +
+ " 7 aload_1\n" +
+ " 8 invokevirtual java.lang.String.hashCode() : int [33]\n" +
+ " 11 lookupswitch default: 39\n" +
+ " case -1647345005: 28\n" +
+ " 28 aload_1\n" +
+ " 29 ldc <String \"lambda$0\"> [39]\n" +
+ " 31 invokevirtual java.lang.String.equals(java.lang.Object) : boolean [40]\n" +
+ " 34 ifeq 39\n" +
+ " 37 iconst_0\n" +
+ " 38 istore_2\n" +
+ " 39 iload_2\n" +
+ " 40 lookupswitch default: 135\n" +
+ " case 0: 60\n" +
+ " 60 aload_0 [arg0]\n" +
+ " 61 invokevirtual java.lang.invoke.SerializedLambda.getImplMethodKind() : int [44]\n" +
+ " 64 bipush 6\n" +
+ " 66 if_icmpne 135\n" +
+ " 69 aload_0 [arg0]\n" +
+ " 70 invokevirtual java.lang.invoke.SerializedLambda.getFunctionalInterfaceClass() : java.lang.String [47]\n" +
+ " 73 ldc <String \"I\"> [50]\n" +
+ " 75 invokevirtual java.lang.Object.equals(java.lang.Object) : boolean [52]\n" +
+ " 78 ifeq 135\n" +
+ " 81 aload_0 [arg0]\n" +
+ " 82 invokevirtual java.lang.invoke.SerializedLambda.getFunctionalInterfaceMethodName() : java.lang.String [53]\n" +
+ " 85 ldc <String \"foo\"> [56]\n" +
+ " 87 invokevirtual java.lang.Object.equals(java.lang.Object) : boolean [52]\n" +
+ " 90 ifeq 135\n" +
+ " 93 aload_0 [arg0]\n" +
+ " 94 invokevirtual java.lang.invoke.SerializedLambda.getFunctionalInterfaceMethodSignature() : java.lang.String [57]\n" +
+ " 97 ldc <String \"()V\"> [60]\n" +
+ " 99 invokevirtual java.lang.Object.equals(java.lang.Object) : boolean [52]\n" +
+ " 102 ifeq 135\n" +
+ " 105 aload_0 [arg0]\n" +
+ " 106 invokevirtual java.lang.invoke.SerializedLambda.getImplClass() : java.lang.String [61]\n" +
+ " 109 ldc <String \"X\"> [64]\n" +
+ " 111 invokevirtual java.lang.Object.equals(java.lang.Object) : boolean [52]\n" +
+ " 114 ifeq 135\n" +
+ " 117 aload_0 [arg0]\n" +
+ " 118 invokevirtual java.lang.invoke.SerializedLambda.getImplMethodSignature() : java.lang.String [65]\n" +
+ " 121 ldc <String \"()V\"> [60]\n" +
+ " 123 invokevirtual java.lang.Object.equals(java.lang.Object) : boolean [52]\n" +
+ " 126 ifeq 135\n" +
+ " 129 invokedynamic 0 foo() : I [16]\n" +
+ " 134 areturn\n" +
+ " 135 new java.lang.IllegalArgumentException [68]\n" +
+ " 138 dup\n" +
+ " 139 ldc <String \"Invalid lambda deserialization\"> [70]\n" +
+ " 141 invokespecial java.lang.IllegalArgumentException(java.lang.String) [72]\n" +
+ " 144 athrow\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
+ " Stack map table: number of frames 4\n" +
+ " [pc: 28, append: {java.lang.String, int}]\n" +
+ " [pc: 39, same]\n" +
+ " [pc: 60, same]\n" +
+ " [pc: 135, chop 2 local(s)]\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #93 java/lang/invoke/MethodHandles$Lookup, outer class info: #95 java/lang/invoke/MethodHandles\n" +
+ " inner name: #97 Lookup, accessflags: 25 public static final]\n" +
+ "Bootstrap methods:\n" +
+ " 0 : # 85 invokestatic java/lang/invoke/LambdaMetafactory.altMetafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;\n" +
+ " Method arguments:\n" +
+ " #86 ()V\n" +
+ " #89 invokestatic X.lambda$0:()V\n" +
+ " #90 ()V\n" +
+ " #91 1\n" +
"}";
verifyClassFile(expectedOutput, "X.class", ClassFileBytesDisassembler.SYSTEM);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406392, [1.8][compiler][codegen] Improve identification of lambdas that must capture enclosing instance
public void test016() throws Exception {
- // This test proves that when a lambda body references a type variable of an enclosing method, it can still be emitted as a static method.
+ // This test proves that when a lambda body references a type variable of an enclosing method, it can still be emitted as a static method.
this.runConformTest(
new String[] {
"X.java",
@@ -2351,166 +2351,166 @@ public void test016() throws Exception {
"Lambda");
String nestConstant = "";
- String nestHost = "";
+ String nestHost = "";
CompilerOptions options = new CompilerOptions(getCompilerOptions());
if (options.complianceLevel >= ClassFileConstants.JDK11) {
nestConstant = " constant #77 utf8: \"NestHost\"\n";
- nestHost = "\n" +
+ nestHost = "\n" +
"Nest Host: #53 X\n";
}
String expectedOutput =
- "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
- "class X$1Y {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X$1Y\n" +
- " constant #2 utf8: \"X$1Y\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"this$0\"\n" +
- " constant #6 utf8: \"LX;\"\n" +
- " constant #7 utf8: \"<init>\"\n" +
- " constant #8 utf8: \"(LX;)V\"\n" +
- " constant #9 utf8: \"Code\"\n" +
- " constant #10 field_ref: #1.#11 X$1Y.this$0 LX;\n" +
- " constant #11 name_and_type: #5.#6 this$0 LX;\n" +
- " constant #12 method_ref: #3.#13 java/lang/Object.<init> ()V\n" +
- " constant #13 name_and_type: #7.#14 <init> ()V\n" +
- " constant #14 utf8: \"()V\"\n" +
- " constant #15 utf8: \"LineNumberTable\"\n" +
- " constant #16 utf8: \"LocalVariableTable\"\n" +
- " constant #17 utf8: \"this\"\n" +
- " constant #18 utf8: \"LX$1Y;\"\n" +
- " constant #19 utf8: \"goo\"\n" +
- " constant #20 utf8: \"()Ljava/lang/Object;\"\n" +
- " constant #21 utf8: \"Signature\"\n" +
- " constant #22 utf8: \"()TT;\"\n" +
- " constant #23 invoke dynamic: #0 #24 doit ()LI;\n" +
- " constant #24 name_and_type: #25.#26 doit ()LI;\n" +
- " constant #25 utf8: \"doit\"\n" +
- " constant #26 utf8: \"()LI;\"\n" +
- " constant #27 interface_method_ref: #28.#30 I.doit ()V\n" +
- " constant #28 class: #29 I\n" +
- " constant #29 utf8: \"I\"\n" +
- " constant #30 name_and_type: #25.#14 doit ()V\n" +
- " constant #31 utf8: \"lambda$0\"\n" +
- " constant #32 field_ref: #33.#35 java/lang/System.out Ljava/io/PrintStream;\n" +
- " constant #33 class: #34 java/lang/System\n" +
- " constant #34 utf8: \"java/lang/System\"\n" +
- " constant #35 name_and_type: #36.#37 out Ljava/io/PrintStream;\n" +
- " constant #36 utf8: \"out\"\n" +
- " constant #37 utf8: \"Ljava/io/PrintStream;\"\n" +
- " constant #38 string: #39 \"Lambda\"\n" +
- " constant #39 utf8: \"Lambda\"\n" +
- " constant #40 method_ref: #41.#43 java/io/PrintStream.println (Ljava/lang/String;)V\n" +
- " constant #41 class: #42 java/io/PrintStream\n" +
- " constant #42 utf8: \"java/io/PrintStream\"\n" +
- " constant #43 name_and_type: #44.#45 println (Ljava/lang/String;)V\n" +
- " constant #44 utf8: \"println\"\n" +
- " constant #45 utf8: \"(Ljava/lang/String;)V\"\n" +
- " constant #46 utf8: \"t\"\n" +
- " constant #47 utf8: \"Ljava/lang/Object;\"\n" +
- " constant #48 utf8: \"LocalVariableTypeTable\"\n" +
- " constant #49 utf8: \"TT;\"\n" +
- " constant #50 utf8: \"SourceFile\"\n" +
- " constant #51 utf8: \"X.java\"\n" +
- " constant #52 utf8: \"EnclosingMethod\"\n" +
- " constant #53 class: #54 X\n" +
- " constant #54 utf8: \"X\"\n" +
- " constant #55 name_and_type: #56.#14 foo ()V\n" +
- " constant #56 utf8: \"foo\"\n" +
- " constant #57 utf8: \"BootstrapMethods\"\n" +
- " constant #58 method_ref: #59.#61 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #59 class: #60 java/lang/invoke/LambdaMetafactory\n" +
- " constant #60 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
- " constant #61 name_and_type: #62.#63 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #62 utf8: \"metafactory\"\n" +
- " constant #63 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
- " constant #64 method handle: invokestatic (6) #58 \n" +
- " constant #65 method type: #14 ()V\n" +
- " constant #66 method_ref: #1.#67 X$1Y.lambda$0 ()V\n" +
- " constant #67 name_and_type: #31.#14 lambda$0 ()V\n" +
- " constant #68 method handle: invokestatic (6) #66 \n" +
- " constant #69 method type: #14 ()V\n" +
- " constant #70 utf8: \"InnerClasses\"\n" +
- " constant #71 utf8: \"Y\"\n" +
- " constant #72 class: #73 java/lang/invoke/MethodHandles$Lookup\n" +
- " constant #73 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
- " constant #74 class: #75 java/lang/invoke/MethodHandles\n" +
- " constant #75 utf8: \"java/lang/invoke/MethodHandles\"\n" +
- " constant #76 utf8: \"Lookup\"\n" +
+ "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
+ "class X$1Y {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X$1Y\n" +
+ " constant #2 utf8: \"X$1Y\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"this$0\"\n" +
+ " constant #6 utf8: \"LX;\"\n" +
+ " constant #7 utf8: \"<init>\"\n" +
+ " constant #8 utf8: \"(LX;)V\"\n" +
+ " constant #9 utf8: \"Code\"\n" +
+ " constant #10 field_ref: #1.#11 X$1Y.this$0 LX;\n" +
+ " constant #11 name_and_type: #5.#6 this$0 LX;\n" +
+ " constant #12 method_ref: #3.#13 java/lang/Object.<init> ()V\n" +
+ " constant #13 name_and_type: #7.#14 <init> ()V\n" +
+ " constant #14 utf8: \"()V\"\n" +
+ " constant #15 utf8: \"LineNumberTable\"\n" +
+ " constant #16 utf8: \"LocalVariableTable\"\n" +
+ " constant #17 utf8: \"this\"\n" +
+ " constant #18 utf8: \"LX$1Y;\"\n" +
+ " constant #19 utf8: \"goo\"\n" +
+ " constant #20 utf8: \"()Ljava/lang/Object;\"\n" +
+ " constant #21 utf8: \"Signature\"\n" +
+ " constant #22 utf8: \"()TT;\"\n" +
+ " constant #23 invoke dynamic: #0 #24 doit ()LI;\n" +
+ " constant #24 name_and_type: #25.#26 doit ()LI;\n" +
+ " constant #25 utf8: \"doit\"\n" +
+ " constant #26 utf8: \"()LI;\"\n" +
+ " constant #27 interface_method_ref: #28.#30 I.doit ()V\n" +
+ " constant #28 class: #29 I\n" +
+ " constant #29 utf8: \"I\"\n" +
+ " constant #30 name_and_type: #25.#14 doit ()V\n" +
+ " constant #31 utf8: \"lambda$0\"\n" +
+ " constant #32 field_ref: #33.#35 java/lang/System.out Ljava/io/PrintStream;\n" +
+ " constant #33 class: #34 java/lang/System\n" +
+ " constant #34 utf8: \"java/lang/System\"\n" +
+ " constant #35 name_and_type: #36.#37 out Ljava/io/PrintStream;\n" +
+ " constant #36 utf8: \"out\"\n" +
+ " constant #37 utf8: \"Ljava/io/PrintStream;\"\n" +
+ " constant #38 string: #39 \"Lambda\"\n" +
+ " constant #39 utf8: \"Lambda\"\n" +
+ " constant #40 method_ref: #41.#43 java/io/PrintStream.println (Ljava/lang/String;)V\n" +
+ " constant #41 class: #42 java/io/PrintStream\n" +
+ " constant #42 utf8: \"java/io/PrintStream\"\n" +
+ " constant #43 name_and_type: #44.#45 println (Ljava/lang/String;)V\n" +
+ " constant #44 utf8: \"println\"\n" +
+ " constant #45 utf8: \"(Ljava/lang/String;)V\"\n" +
+ " constant #46 utf8: \"t\"\n" +
+ " constant #47 utf8: \"Ljava/lang/Object;\"\n" +
+ " constant #48 utf8: \"LocalVariableTypeTable\"\n" +
+ " constant #49 utf8: \"TT;\"\n" +
+ " constant #50 utf8: \"SourceFile\"\n" +
+ " constant #51 utf8: \"X.java\"\n" +
+ " constant #52 utf8: \"EnclosingMethod\"\n" +
+ " constant #53 class: #54 X\n" +
+ " constant #54 utf8: \"X\"\n" +
+ " constant #55 name_and_type: #56.#14 foo ()V\n" +
+ " constant #56 utf8: \"foo\"\n" +
+ " constant #57 utf8: \"BootstrapMethods\"\n" +
+ " constant #58 method_ref: #59.#61 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #59 class: #60 java/lang/invoke/LambdaMetafactory\n" +
+ " constant #60 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
+ " constant #61 name_and_type: #62.#63 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #62 utf8: \"metafactory\"\n" +
+ " constant #63 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
+ " constant #64 method handle: invokestatic (6) #58 \n" +
+ " constant #65 method type: #14 ()V\n" +
+ " constant #66 method_ref: #1.#67 X$1Y.lambda$0 ()V\n" +
+ " constant #67 name_and_type: #31.#14 lambda$0 ()V\n" +
+ " constant #68 method handle: invokestatic (6) #66 \n" +
+ " constant #69 method type: #14 ()V\n" +
+ " constant #70 utf8: \"InnerClasses\"\n" +
+ " constant #71 utf8: \"Y\"\n" +
+ " constant #72 class: #73 java/lang/invoke/MethodHandles$Lookup\n" +
+ " constant #73 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
+ " constant #74 class: #75 java/lang/invoke/MethodHandles\n" +
+ " constant #75 utf8: \"java/lang/invoke/MethodHandles\"\n" +
+ " constant #76 utf8: \"Lookup\"\n" +
nestConstant +
- " \n" +
- " // Field descriptor #6 LX;\n" +
- " final synthetic X this$0;\n" +
- " \n" +
- " // Method descriptor #8 (LX;)V\n" +
- " // Stack: 2, Locals: 2\n" +
- " X$1Y(X arg0);\n" +
- " 0 aload_0 [this]\n" +
- " 1 aload_1 [arg0]\n" +
- " 2 putfield X$1Y.this$0 : X [10]\n" +
- " 5 aload_0 [this]\n" +
- " 6 invokespecial java.lang.Object() [12]\n" +
- " 9 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 6]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 10] local: this index: 0 type: new X(){}\n" +
- " \n" +
- " // Method descriptor #20 ()Ljava/lang/Object;\n" +
- " // Signature: ()TT;\n" +
- " // Stack: 1, Locals: 1\n" +
- " java.lang.Object goo();\n" +
- " 0 invokedynamic 0 doit() : I [23]\n" +
- " 5 invokeinterface I.doit() : void [27] [nargs: 1]\n" +
- " 10 aconst_null\n" +
- " 11 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 8]\n" +
- " [pc: 5, line: 11]\n" +
- " [pc: 10, line: 12]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 12] local: this index: 0 type: new X(){}\n" +
- " \n" +
- " // Method descriptor #14 ()V\n" +
- " // Stack: 2, Locals: 1\n" +
- " private static synthetic void lambda$0();\n" +
- " 0 aconst_null\n" +
- " 1 astore_0 [t]\n" +
- " 2 getstatic java.lang.System.out : java.io.PrintStream [32]\n" +
- " 5 ldc <String \"Lambda\"> [38]\n" +
- " 7 invokevirtual java.io.PrintStream.println(java.lang.String) : void [40]\n" +
- " 10 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 9]\n" +
- " [pc: 2, line: 10]\n" +
- " [pc: 10, line: 11]\n" +
- " Local variable table:\n" +
- " [pc: 2, pc: 10] local: t index: 0 type: java.lang.Object\n" +
- " Local variable type table:\n" +
- " [pc: 2, pc: 10] local: t index: 0 type: T\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #1 X$1Y, outer class info: #0\n" +
- " inner name: #71 Y, accessflags: 0 default],\n" +
- " [inner class info: #72 java/lang/invoke/MethodHandles$Lookup, outer class info: #74 java/lang/invoke/MethodHandles\n" +
- " inner name: #76 Lookup, accessflags: 25 public static final]\n" +
+ " \n" +
+ " // Field descriptor #6 LX;\n" +
+ " final synthetic X this$0;\n" +
+ " \n" +
+ " // Method descriptor #8 (LX;)V\n" +
+ " // Stack: 2, Locals: 2\n" +
+ " X$1Y(X arg0);\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 aload_1 [arg0]\n" +
+ " 2 putfield X$1Y.this$0 : X [10]\n" +
+ " 5 aload_0 [this]\n" +
+ " 6 invokespecial java.lang.Object() [12]\n" +
+ " 9 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 6]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 10] local: this index: 0 type: new X(){}\n" +
+ " \n" +
+ " // Method descriptor #20 ()Ljava/lang/Object;\n" +
+ " // Signature: ()TT;\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " java.lang.Object goo();\n" +
+ " 0 invokedynamic 0 doit() : I [23]\n" +
+ " 5 invokeinterface I.doit() : void [27] [nargs: 1]\n" +
+ " 10 aconst_null\n" +
+ " 11 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 8]\n" +
+ " [pc: 5, line: 11]\n" +
+ " [pc: 10, line: 12]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 12] local: this index: 0 type: new X(){}\n" +
+ " \n" +
+ " // Method descriptor #14 ()V\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " private static synthetic void lambda$0();\n" +
+ " 0 aconst_null\n" +
+ " 1 astore_0 [t]\n" +
+ " 2 getstatic java.lang.System.out : java.io.PrintStream [32]\n" +
+ " 5 ldc <String \"Lambda\"> [38]\n" +
+ " 7 invokevirtual java.io.PrintStream.println(java.lang.String) : void [40]\n" +
+ " 10 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 9]\n" +
+ " [pc: 2, line: 10]\n" +
+ " [pc: 10, line: 11]\n" +
+ " Local variable table:\n" +
+ " [pc: 2, pc: 10] local: t index: 0 type: java.lang.Object\n" +
+ " Local variable type table:\n" +
+ " [pc: 2, pc: 10] local: t index: 0 type: T\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #1 X$1Y, outer class info: #0\n" +
+ " inner name: #71 Y, accessflags: 0 default],\n" +
+ " [inner class info: #72 java/lang/invoke/MethodHandles$Lookup, outer class info: #74 java/lang/invoke/MethodHandles\n" +
+ " inner name: #76 Lookup, accessflags: 25 public static final]\n" +
" Enclosing Method: #53 #55 X.foo()V\n" +
nestHost +
- "Bootstrap methods:\n" +
- " 0 : # 64 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
- "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " Method arguments:\n" +
- " #65 ()V\n" +
- " #68 invokestatic X$1Y.lambda$0:()V\n" +
- " #69 ()V\n" +
+ "Bootstrap methods:\n" +
+ " 0 : # 64 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
+ "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " Method arguments:\n" +
+ " #65 ()V\n" +
+ " #68 invokestatic X$1Y.lambda$0:()V\n" +
+ " #69 ()V\n" +
"}";
verifyClassFile(expectedOutput, "X$1Y.class", ClassFileBytesDisassembler.SYSTEM);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406392, [1.8][compiler][codegen] Improve identification of lambdas that must capture enclosing instance
public void test017() throws Exception {
- // This test proves that when a lambda body references a type variable of an enclosing class, it can still be emitted as a static method.
+ // This test proves that when a lambda body references a type variable of an enclosing class, it can still be emitted as a static method.
this.runConformTest(
new String[] {
"X.java",
@@ -2538,159 +2538,159 @@ public void test017() throws Exception {
"Lambda");
String nestConstant = "";
- String nestHost = "";
+ String nestHost = "";
CompilerOptions options = new CompilerOptions(getCompilerOptions());
if (options.complianceLevel >= ClassFileConstants.JDK11) {
nestConstant = " constant #77 utf8: \"NestHost\"\n";
- nestHost = "\n" +
+ nestHost = "\n" +
"Nest Host: #53 X\n";
}
String expectedOutput =
- "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
- "class X$1Y {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X$1Y\n" +
- " constant #2 utf8: \"X$1Y\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"this$0\"\n" +
- " constant #6 utf8: \"LX;\"\n" +
- " constant #7 utf8: \"<init>\"\n" +
- " constant #8 utf8: \"(LX;)V\"\n" +
- " constant #9 utf8: \"Code\"\n" +
- " constant #10 field_ref: #1.#11 X$1Y.this$0 LX;\n" +
- " constant #11 name_and_type: #5.#6 this$0 LX;\n" +
- " constant #12 method_ref: #3.#13 java/lang/Object.<init> ()V\n" +
- " constant #13 name_and_type: #7.#14 <init> ()V\n" +
- " constant #14 utf8: \"()V\"\n" +
- " constant #15 utf8: \"LineNumberTable\"\n" +
- " constant #16 utf8: \"LocalVariableTable\"\n" +
- " constant #17 utf8: \"this\"\n" +
- " constant #18 utf8: \"LX$1Y;\"\n" +
- " constant #19 utf8: \"goo\"\n" +
- " constant #20 utf8: \"()Ljava/lang/Object;\"\n" +
- " constant #21 utf8: \"Signature\"\n" +
- " constant #22 utf8: \"()TT;\"\n" +
- " constant #23 invoke dynamic: #0 #24 doit ()LI;\n" +
- " constant #24 name_and_type: #25.#26 doit ()LI;\n" +
- " constant #25 utf8: \"doit\"\n" +
- " constant #26 utf8: \"()LI;\"\n" +
- " constant #27 interface_method_ref: #28.#30 I.doit ()V\n" +
- " constant #28 class: #29 I\n" +
- " constant #29 utf8: \"I\"\n" +
- " constant #30 name_and_type: #25.#14 doit ()V\n" +
- " constant #31 utf8: \"lambda$0\"\n" +
- " constant #32 field_ref: #33.#35 java/lang/System.out Ljava/io/PrintStream;\n" +
- " constant #33 class: #34 java/lang/System\n" +
- " constant #34 utf8: \"java/lang/System\"\n" +
- " constant #35 name_and_type: #36.#37 out Ljava/io/PrintStream;\n" +
- " constant #36 utf8: \"out\"\n" +
- " constant #37 utf8: \"Ljava/io/PrintStream;\"\n" +
- " constant #38 string: #39 \"Lambda\"\n" +
- " constant #39 utf8: \"Lambda\"\n" +
- " constant #40 method_ref: #41.#43 java/io/PrintStream.println (Ljava/lang/String;)V\n" +
- " constant #41 class: #42 java/io/PrintStream\n" +
- " constant #42 utf8: \"java/io/PrintStream\"\n" +
- " constant #43 name_and_type: #44.#45 println (Ljava/lang/String;)V\n" +
- " constant #44 utf8: \"println\"\n" +
- " constant #45 utf8: \"(Ljava/lang/String;)V\"\n" +
- " constant #46 utf8: \"t\"\n" +
- " constant #47 utf8: \"Ljava/lang/Object;\"\n" +
- " constant #48 utf8: \"LocalVariableTypeTable\"\n" +
- " constant #49 utf8: \"TT;\"\n" +
- " constant #50 utf8: \"SourceFile\"\n" +
- " constant #51 utf8: \"X.java\"\n" +
- " constant #52 utf8: \"EnclosingMethod\"\n" +
- " constant #53 class: #54 X\n" +
- " constant #54 utf8: \"X\"\n" +
- " constant #55 name_and_type: #56.#14 foo ()V\n" +
- " constant #56 utf8: \"foo\"\n" +
- " constant #57 utf8: \"BootstrapMethods\"\n" +
- " constant #58 method_ref: #59.#61 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #59 class: #60 java/lang/invoke/LambdaMetafactory\n" +
- " constant #60 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
- " constant #61 name_and_type: #62.#63 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #62 utf8: \"metafactory\"\n" +
- " constant #63 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
- " constant #64 method handle: invokestatic (6) #58 \n" +
- " constant #65 method type: #14 ()V\n" +
- " constant #66 method_ref: #1.#67 X$1Y.lambda$0 ()V\n" +
- " constant #67 name_and_type: #31.#14 lambda$0 ()V\n" +
- " constant #68 method handle: invokestatic (6) #66 \n" +
- " constant #69 method type: #14 ()V\n" +
- " constant #70 utf8: \"InnerClasses\"\n" +
- " constant #71 utf8: \"Y\"\n" +
- " constant #72 class: #73 java/lang/invoke/MethodHandles$Lookup\n" +
- " constant #73 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
- " constant #74 class: #75 java/lang/invoke/MethodHandles\n" +
- " constant #75 utf8: \"java/lang/invoke/MethodHandles\"\n" +
+ "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
+ "class X$1Y {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X$1Y\n" +
+ " constant #2 utf8: \"X$1Y\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"this$0\"\n" +
+ " constant #6 utf8: \"LX;\"\n" +
+ " constant #7 utf8: \"<init>\"\n" +
+ " constant #8 utf8: \"(LX;)V\"\n" +
+ " constant #9 utf8: \"Code\"\n" +
+ " constant #10 field_ref: #1.#11 X$1Y.this$0 LX;\n" +
+ " constant #11 name_and_type: #5.#6 this$0 LX;\n" +
+ " constant #12 method_ref: #3.#13 java/lang/Object.<init> ()V\n" +
+ " constant #13 name_and_type: #7.#14 <init> ()V\n" +
+ " constant #14 utf8: \"()V\"\n" +
+ " constant #15 utf8: \"LineNumberTable\"\n" +
+ " constant #16 utf8: \"LocalVariableTable\"\n" +
+ " constant #17 utf8: \"this\"\n" +
+ " constant #18 utf8: \"LX$1Y;\"\n" +
+ " constant #19 utf8: \"goo\"\n" +
+ " constant #20 utf8: \"()Ljava/lang/Object;\"\n" +
+ " constant #21 utf8: \"Signature\"\n" +
+ " constant #22 utf8: \"()TT;\"\n" +
+ " constant #23 invoke dynamic: #0 #24 doit ()LI;\n" +
+ " constant #24 name_and_type: #25.#26 doit ()LI;\n" +
+ " constant #25 utf8: \"doit\"\n" +
+ " constant #26 utf8: \"()LI;\"\n" +
+ " constant #27 interface_method_ref: #28.#30 I.doit ()V\n" +
+ " constant #28 class: #29 I\n" +
+ " constant #29 utf8: \"I\"\n" +
+ " constant #30 name_and_type: #25.#14 doit ()V\n" +
+ " constant #31 utf8: \"lambda$0\"\n" +
+ " constant #32 field_ref: #33.#35 java/lang/System.out Ljava/io/PrintStream;\n" +
+ " constant #33 class: #34 java/lang/System\n" +
+ " constant #34 utf8: \"java/lang/System\"\n" +
+ " constant #35 name_and_type: #36.#37 out Ljava/io/PrintStream;\n" +
+ " constant #36 utf8: \"out\"\n" +
+ " constant #37 utf8: \"Ljava/io/PrintStream;\"\n" +
+ " constant #38 string: #39 \"Lambda\"\n" +
+ " constant #39 utf8: \"Lambda\"\n" +
+ " constant #40 method_ref: #41.#43 java/io/PrintStream.println (Ljava/lang/String;)V\n" +
+ " constant #41 class: #42 java/io/PrintStream\n" +
+ " constant #42 utf8: \"java/io/PrintStream\"\n" +
+ " constant #43 name_and_type: #44.#45 println (Ljava/lang/String;)V\n" +
+ " constant #44 utf8: \"println\"\n" +
+ " constant #45 utf8: \"(Ljava/lang/String;)V\"\n" +
+ " constant #46 utf8: \"t\"\n" +
+ " constant #47 utf8: \"Ljava/lang/Object;\"\n" +
+ " constant #48 utf8: \"LocalVariableTypeTable\"\n" +
+ " constant #49 utf8: \"TT;\"\n" +
+ " constant #50 utf8: \"SourceFile\"\n" +
+ " constant #51 utf8: \"X.java\"\n" +
+ " constant #52 utf8: \"EnclosingMethod\"\n" +
+ " constant #53 class: #54 X\n" +
+ " constant #54 utf8: \"X\"\n" +
+ " constant #55 name_and_type: #56.#14 foo ()V\n" +
+ " constant #56 utf8: \"foo\"\n" +
+ " constant #57 utf8: \"BootstrapMethods\"\n" +
+ " constant #58 method_ref: #59.#61 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #59 class: #60 java/lang/invoke/LambdaMetafactory\n" +
+ " constant #60 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
+ " constant #61 name_and_type: #62.#63 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #62 utf8: \"metafactory\"\n" +
+ " constant #63 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
+ " constant #64 method handle: invokestatic (6) #58 \n" +
+ " constant #65 method type: #14 ()V\n" +
+ " constant #66 method_ref: #1.#67 X$1Y.lambda$0 ()V\n" +
+ " constant #67 name_and_type: #31.#14 lambda$0 ()V\n" +
+ " constant #68 method handle: invokestatic (6) #66 \n" +
+ " constant #69 method type: #14 ()V\n" +
+ " constant #70 utf8: \"InnerClasses\"\n" +
+ " constant #71 utf8: \"Y\"\n" +
+ " constant #72 class: #73 java/lang/invoke/MethodHandles$Lookup\n" +
+ " constant #73 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
+ " constant #74 class: #75 java/lang/invoke/MethodHandles\n" +
+ " constant #75 utf8: \"java/lang/invoke/MethodHandles\"\n" +
" constant #76 utf8: \"Lookup\"\n" +
nestConstant +
- " \n" +
- " // Field descriptor #6 LX;\n" +
- " final synthetic X this$0;\n" +
- " \n" +
- " // Method descriptor #8 (LX;)V\n" +
- " // Stack: 2, Locals: 2\n" +
- " X$1Y(X arg0);\n" +
- " 0 aload_0 [this]\n" +
- " 1 aload_1 [arg0]\n" +
- " 2 putfield X$1Y.this$0 : X [10]\n" +
- " 5 aload_0 [this]\n" +
- " 6 invokespecial java.lang.Object() [12]\n" +
- " 9 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 6]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 10] local: this index: 0 type: new X(){}\n" +
- " \n" +
- " // Method descriptor #20 ()Ljava/lang/Object;\n" +
- " // Signature: ()TT;\n" +
- " // Stack: 1, Locals: 1\n" +
- " java.lang.Object goo();\n" +
- " 0 invokedynamic 0 doit() : I [23]\n" +
- " 5 invokeinterface I.doit() : void [27] [nargs: 1]\n" +
- " 10 aconst_null\n" +
- " 11 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 8]\n" +
- " [pc: 5, line: 11]\n" +
- " [pc: 10, line: 12]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 12] local: this index: 0 type: new X(){}\n" +
- " \n" +
- " // Method descriptor #14 ()V\n" +
- " // Stack: 2, Locals: 1\n" +
- " private static synthetic void lambda$0();\n" +
- " 0 aconst_null\n" +
- " 1 astore_0 [t]\n" +
- " 2 getstatic java.lang.System.out : java.io.PrintStream [32]\n" +
- " 5 ldc <String \"Lambda\"> [38]\n" +
- " 7 invokevirtual java.io.PrintStream.println(java.lang.String) : void [40]\n" +
- " 10 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 9]\n" +
- " [pc: 2, line: 10]\n" +
- " [pc: 10, line: 11]\n" +
- " Local variable table:\n" +
- " [pc: 2, pc: 10] local: t index: 0 type: java.lang.Object\n" +
- " Local variable type table:\n" +
- " [pc: 2, pc: 10] local: t index: 0 type: T\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #1 X$1Y, outer class info: #0\n" +
- " inner name: #71 Y, accessflags: 0 default],\n" +
- " [inner class info: #72 java/lang/invoke/MethodHandles$Lookup, outer class info: #74 java/lang/invoke/MethodHandles\n" +
- " inner name: #76 Lookup, accessflags: 25 public static final]\n" +
+ " \n" +
+ " // Field descriptor #6 LX;\n" +
+ " final synthetic X this$0;\n" +
+ " \n" +
+ " // Method descriptor #8 (LX;)V\n" +
+ " // Stack: 2, Locals: 2\n" +
+ " X$1Y(X arg0);\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 aload_1 [arg0]\n" +
+ " 2 putfield X$1Y.this$0 : X [10]\n" +
+ " 5 aload_0 [this]\n" +
+ " 6 invokespecial java.lang.Object() [12]\n" +
+ " 9 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 6]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 10] local: this index: 0 type: new X(){}\n" +
+ " \n" +
+ " // Method descriptor #20 ()Ljava/lang/Object;\n" +
+ " // Signature: ()TT;\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " java.lang.Object goo();\n" +
+ " 0 invokedynamic 0 doit() : I [23]\n" +
+ " 5 invokeinterface I.doit() : void [27] [nargs: 1]\n" +
+ " 10 aconst_null\n" +
+ " 11 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 8]\n" +
+ " [pc: 5, line: 11]\n" +
+ " [pc: 10, line: 12]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 12] local: this index: 0 type: new X(){}\n" +
+ " \n" +
+ " // Method descriptor #14 ()V\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " private static synthetic void lambda$0();\n" +
+ " 0 aconst_null\n" +
+ " 1 astore_0 [t]\n" +
+ " 2 getstatic java.lang.System.out : java.io.PrintStream [32]\n" +
+ " 5 ldc <String \"Lambda\"> [38]\n" +
+ " 7 invokevirtual java.io.PrintStream.println(java.lang.String) : void [40]\n" +
+ " 10 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 9]\n" +
+ " [pc: 2, line: 10]\n" +
+ " [pc: 10, line: 11]\n" +
+ " Local variable table:\n" +
+ " [pc: 2, pc: 10] local: t index: 0 type: java.lang.Object\n" +
+ " Local variable type table:\n" +
+ " [pc: 2, pc: 10] local: t index: 0 type: T\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #1 X$1Y, outer class info: #0\n" +
+ " inner name: #71 Y, accessflags: 0 default],\n" +
+ " [inner class info: #72 java/lang/invoke/MethodHandles$Lookup, outer class info: #74 java/lang/invoke/MethodHandles\n" +
+ " inner name: #76 Lookup, accessflags: 25 public static final]\n" +
" Enclosing Method: #53 #55 X.foo()V\n" +
nestHost +
- "Bootstrap methods:\n" +
- " 0 : # 64 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;" +
- "Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " Method arguments:\n" +
- " #65 ()V\n" +
- " #68 invokestatic X$1Y.lambda$0:()V\n" +
- " #69 ()V\n" +
+ "Bootstrap methods:\n" +
+ " 0 : # 64 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;" +
+ "Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " Method arguments:\n" +
+ " #65 ()V\n" +
+ " #68 invokestatic X$1Y.lambda$0:()V\n" +
+ " #69 ()V\n" +
"}";
verifyClassFile(expectedOutput, "X$1Y.class", ClassFileBytesDisassembler.SYSTEM);
@@ -2717,14 +2717,14 @@ public void test424444() throws Exception {
"Done");
String expectedOutput =
- " // Method descriptor #19 (I)[I\n" +
- " // Stack: 1, Locals: 1\n" +
- " private static synthetic int[] lambda$0(int arg0);\n" +
- " 0 iload_0 [arg0]\n" +
- " 1 newarray int [10]\n" +
- " 3 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
+ " // Method descriptor #19 (I)[I\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " private static synthetic int[] lambda$0(int arg0);\n" +
+ " 0 iload_0 [arg0]\n" +
+ " 1 newarray int [10]\n" +
+ " 3 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
"\n";
verifyClassFile(expectedOutput, "X.class", ClassFileBytesDisassembler.SYSTEM);
@@ -2751,14 +2751,14 @@ public void test424444a() throws Exception {
"Done");
String expectedOutput =
- " // Method descriptor #49 (I)[[I\n" +
- " // Stack: 1, Locals: 1\n" +
- " private static synthetic int[][] lambda$0(int arg0);\n" +
- " 0 iload_0 [arg0]\n" +
- " 1 anewarray int[] [50]\n" +
- " 4 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
+ " // Method descriptor #49 (I)[[I\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " private static synthetic int[][] lambda$0(int arg0);\n" +
+ " 0 iload_0 [arg0]\n" +
+ " 1 anewarray int[] [50]\n" +
+ " 4 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
"\n";
verifyClassFile(expectedOutput, "X.class", ClassFileBytesDisassembler.SYSTEM);
@@ -2785,14 +2785,14 @@ public void test424444b() throws Exception {
"Done");
String expectedOutput =
- " // Method descriptor #49 (I)[Ljava/lang/String;\n" +
- " // Stack: 1, Locals: 1\n" +
- " private static synthetic java.lang.String[] lambda$0(int arg0);\n" +
- " 0 iload_0 [arg0]\n" +
- " 1 anewarray java.lang.String [50]\n" +
- " 4 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
+ " // Method descriptor #49 (I)[Ljava/lang/String;\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " private static synthetic java.lang.String[] lambda$0(int arg0);\n" +
+ " 0 iload_0 [arg0]\n" +
+ " 1 anewarray java.lang.String [50]\n" +
+ " 4 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
"\n";
verifyClassFile(expectedOutput, "X.class", ClassFileBytesDisassembler.SYSTEM);
@@ -2819,14 +2819,14 @@ public void test424444c() throws Exception {
"Done");
String expectedOutput =
- " // Method descriptor #49 (I)[[Ljava/lang/String;\n" +
- " // Stack: 1, Locals: 1\n" +
- " private static synthetic java.lang.String[][] lambda$0(int arg0);\n" +
- " 0 iload_0 [arg0]\n" +
- " 1 anewarray java.lang.String[] [50]\n" +
- " 4 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
+ " // Method descriptor #49 (I)[[Ljava/lang/String;\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " private static synthetic java.lang.String[][] lambda$0(int arg0);\n" +
+ " 0 iload_0 [arg0]\n" +
+ " 1 anewarray java.lang.String[] [50]\n" +
+ " 4 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
"\n";
verifyClassFile(expectedOutput, "X.class", ClassFileBytesDisassembler.SYSTEM);
@@ -2853,19 +2853,19 @@ public void test424444d() throws Exception {
"Done");
String expectedOutput =
- " // Method descriptor #49 (I)[[Ljava/lang/String;\n" +
- " // Stack: 1, Locals: 1\n" +
- " private static synthetic java.lang.String[][] lambda$0(int arg0);\n" +
- " 0 iload_0 [arg0]\n" +
- " 1 anewarray java.lang.String[] [50]\n" +
- " 4 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
+ " // Method descriptor #49 (I)[[Ljava/lang/String;\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " private static synthetic java.lang.String[][] lambda$0(int arg0);\n" +
+ " 0 iload_0 [arg0]\n" +
+ " 1 anewarray java.lang.String[] [50]\n" +
+ " 4 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
"\n";
verifyClassFile(expectedOutput, "X.class", ClassFileBytesDisassembler.SYSTEM);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430015, [1.8] NPE trying to disassemble classfile with lambda method and MethodParameters
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430015, [1.8] NPE trying to disassemble classfile with lambda method and MethodParameters
public void test430015() throws IOException, ClassFormatException {
this.runConformTest(
new String[] {
@@ -2890,21 +2890,21 @@ public void test430015() throws IOException, ClassFormatException {
"}\n"
},
"[int arg0]");
-
+
String expectedOutput =
- " // Method descriptor #78 (I)V\n" +
- " // Stack: 0, Locals: 1\n" +
- " private static synthetic void lambda$0(int i);\n" +
- " 0 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 7]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 1] local: i index: 0 type: int\n" +
+ " // Method descriptor #78 (I)V\n" +
+ " // Stack: 0, Locals: 1\n" +
+ " private static synthetic void lambda$0(int i);\n" +
+ " 0 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 7]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 1] local: i index: 0 type: int\n" +
"\n";
verifyClassFile(expectedOutput, "X.class", ClassFileBytesDisassembler.SYSTEM);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430015, [1.8] NPE trying to disassemble classfile with lambda method and MethodParameters
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430015, [1.8] NPE trying to disassemble classfile with lambda method and MethodParameters
public void test430015a() throws IOException, ClassFormatException {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_MethodParametersAttribute, CompilerOptions.GENERATE);
@@ -2925,21 +2925,21 @@ public void test430015a() throws IOException, ClassFormatException {
},
"",
customOptions);
-
+
String expectedOutput =
- " // Method descriptor #28 (I)V\n" +
- " // Stack: 0, Locals: 1\n" +
- " private static synthetic void lambda$0(int i);\n" +
- " 0 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 7]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 1] local: i index: 0 type: int\n" +
+ " // Method descriptor #28 (I)V\n" +
+ " // Stack: 0, Locals: 1\n" +
+ " private static synthetic void lambda$0(int i);\n" +
+ " 0 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 7]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 1] local: i index: 0 type: int\n" +
"\n";
verifyClassFile(expectedOutput, "X.class", ClassFileBytesDisassembler.SYSTEM);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430035, [1.8][compiler][codegen] Bridge methods are not generated for lambdas/method references
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430035, [1.8][compiler][codegen] Bridge methods are not generated for lambdas/method references
public void test430035() throws IOException, ClassFormatException {
this.runConformTest(
new String[] {
@@ -2964,214 +2964,214 @@ public void test430035() throws IOException, ClassFormatException {
" }\n" +
"}\n"
},
- "m(direct call)\n" +
- "m(bridge method(j))\n" +
+ "m(direct call)\n" +
+ "m(bridge method(j))\n" +
"m(bridge method(i))");
-
+
String expectedOutput =
- "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
- "public class X {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 utf8: \"<init>\"\n" +
- " constant #6 utf8: \"()V\"\n" +
- " constant #7 utf8: \"Code\"\n" +
- " constant #8 method_ref: #3.#9 java/lang/Object.<init> ()V\n" +
- " constant #9 name_and_type: #5.#6 <init> ()V\n" +
- " constant #10 utf8: \"LineNumberTable\"\n" +
- " constant #11 utf8: \"LocalVariableTable\"\n" +
- " constant #12 utf8: \"this\"\n" +
- " constant #13 utf8: \"LX;\"\n" +
- " constant #14 utf8: \"main\"\n" +
- " constant #15 utf8: \"([Ljava/lang/String;)V\"\n" +
- " constant #16 invoke dynamic: #0 #17 foo ()LK;\n" +
- " constant #17 name_and_type: #18.#19 foo ()LK;\n" +
- " constant #18 utf8: \"foo\"\n" +
- " constant #19 utf8: \"()LK;\"\n" +
- " constant #20 string: #21 \"direct\"\n" +
- " constant #21 utf8: \"direct\"\n" +
- " constant #22 string: #23 \" call\"\n" +
- " constant #23 utf8: \" call\"\n" +
- " constant #24 interface_method_ref: #25.#27 K.foo (Ljava/lang/String;Ljava/lang/String;)V\n" +
- " constant #25 class: #26 K\n" +
- " constant #26 utf8: \"K\"\n" +
- " constant #27 name_and_type: #18.#28 foo (Ljava/lang/String;Ljava/lang/String;)V\n" +
- " constant #28 utf8: \"(Ljava/lang/String;Ljava/lang/String;)V\"\n" +
- " constant #29 string: #30 \"bridge\"\n" +
- " constant #30 utf8: \"bridge\"\n" +
- " constant #31 string: #32 \" method(j)\"\n" +
- " constant #32 utf8: \" method(j)\"\n" +
- " constant #33 interface_method_ref: #34.#36 J.foo (Ljava/lang/Object;Ljava/lang/String;)V\n" +
- " constant #34 class: #35 J\n" +
- " constant #35 utf8: \"J\"\n" +
- " constant #36 name_and_type: #18.#37 foo (Ljava/lang/Object;Ljava/lang/String;)V\n" +
- " constant #37 utf8: \"(Ljava/lang/Object;Ljava/lang/String;)V\"\n" +
- " constant #38 string: #39 \" method(i)\"\n" +
- " constant #39 utf8: \" method(i)\"\n" +
- " constant #40 interface_method_ref: #41.#43 I.foo (Ljava/lang/String;Ljava/lang/Object;)V\n" +
- " constant #41 class: #42 I\n" +
- " constant #42 utf8: \"I\"\n" +
- " constant #43 name_and_type: #18.#44 foo (Ljava/lang/String;Ljava/lang/Object;)V\n" +
- " constant #44 utf8: \"(Ljava/lang/String;Ljava/lang/Object;)V\"\n" +
- " constant #45 utf8: \"x\"\n" +
- " constant #46 utf8: \"[Ljava/lang/String;\"\n" +
- " constant #47 utf8: \"k\"\n" +
- " constant #48 utf8: \"LK;\"\n" +
- " constant #49 utf8: \"j\"\n" +
- " constant #50 utf8: \"LJ;\"\n" +
- " constant #51 utf8: \"i\"\n" +
- " constant #52 utf8: \"LI;\"\n" +
- " constant #53 utf8: \"LocalVariableTypeTable\"\n" +
- " constant #54 utf8: \"LJ<Ljava/lang/String;>;\"\n" +
- " constant #55 utf8: \"LI<Ljava/lang/String;>;\"\n" +
- " constant #56 utf8: \"lambda$0\"\n" +
- " constant #57 field_ref: #58.#60 java/lang/System.out Ljava/io/PrintStream;\n" +
- " constant #58 class: #59 java/lang/System\n" +
- " constant #59 utf8: \"java/lang/System\"\n" +
- " constant #60 name_and_type: #61.#62 out Ljava/io/PrintStream;\n" +
- " constant #61 utf8: \"out\"\n" +
- " constant #62 utf8: \"Ljava/io/PrintStream;\"\n" +
- " constant #63 class: #64 java/lang/StringBuilder\n" +
- " constant #64 utf8: \"java/lang/StringBuilder\"\n" +
- " constant #65 string: #66 \"m(\"\n" +
- " constant #66 utf8: \"m(\"\n" +
- " constant #67 method_ref: #63.#68 java/lang/StringBuilder.<init> (Ljava/lang/String;)V\n" +
- " constant #68 name_and_type: #5.#69 <init> (Ljava/lang/String;)V\n" +
- " constant #69 utf8: \"(Ljava/lang/String;)V\"\n" +
- " constant #70 method_ref: #63.#71 java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;\n" +
- " constant #71 name_and_type: #72.#73 append (Ljava/lang/String;)Ljava/lang/StringBuilder;\n" +
- " constant #72 utf8: \"append\"\n" +
- " constant #73 utf8: \"(Ljava/lang/String;)Ljava/lang/StringBuilder;\"\n" +
- " constant #74 method_ref: #63.#75 java/lang/StringBuilder.append (C)Ljava/lang/StringBuilder;\n" +
- " constant #75 name_and_type: #72.#76 append (C)Ljava/lang/StringBuilder;\n" +
- " constant #76 utf8: \"(C)Ljava/lang/StringBuilder;\"\n" +
- " constant #77 method_ref: #63.#78 java/lang/StringBuilder.toString ()Ljava/lang/String;\n" +
- " constant #78 name_and_type: #79.#80 toString ()Ljava/lang/String;\n" +
- " constant #79 utf8: \"toString\"\n" +
- " constant #80 utf8: \"()Ljava/lang/String;\"\n" +
- " constant #81 method_ref: #82.#84 java/io/PrintStream.println (Ljava/lang/String;)V\n" +
- " constant #82 class: #83 java/io/PrintStream\n" +
- " constant #83 utf8: \"java/io/PrintStream\"\n" +
- " constant #84 name_and_type: #85.#69 println (Ljava/lang/String;)V\n" +
- " constant #85 utf8: \"println\"\n" +
- " constant #86 utf8: \"s\"\n" +
- " constant #87 utf8: \"Ljava/lang/String;\"\n" +
- " constant #88 utf8: \"u\"\n" +
- " constant #89 utf8: \"SourceFile\"\n" +
- " constant #90 utf8: \"X.java\"\n" +
- " constant #91 utf8: \"BootstrapMethods\"\n" +
- " constant #92 method_ref: #93.#95 java/lang/invoke/LambdaMetafactory.altMetafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;\n" +
- " constant #93 class: #94 java/lang/invoke/LambdaMetafactory\n" +
- " constant #94 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
- " constant #95 name_and_type: #96.#97 altMetafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;\n" +
- " constant #96 utf8: \"altMetafactory\"\n" +
- " constant #97 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;\"\n" +
- " constant #98 method handle: invokestatic (6) #92 \n" +
- " constant #99 method type: #28 (Ljava/lang/String;Ljava/lang/String;)V\n" +
- " constant #100 method_ref: #1.#101 X.lambda$0 (Ljava/lang/String;Ljava/lang/String;)V\n" +
- " constant #101 name_and_type: #56.#28 lambda$0 (Ljava/lang/String;Ljava/lang/String;)V\n" +
- " constant #102 method handle: invokestatic (6) #100 \n" +
- " constant #103 method type: #28 (Ljava/lang/String;Ljava/lang/String;)V\n" +
+ "// Compiled from X.java (" + this.versionString + ", super bit)\n" +
+ "public class X {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 utf8: \"<init>\"\n" +
+ " constant #6 utf8: \"()V\"\n" +
+ " constant #7 utf8: \"Code\"\n" +
+ " constant #8 method_ref: #3.#9 java/lang/Object.<init> ()V\n" +
+ " constant #9 name_and_type: #5.#6 <init> ()V\n" +
+ " constant #10 utf8: \"LineNumberTable\"\n" +
+ " constant #11 utf8: \"LocalVariableTable\"\n" +
+ " constant #12 utf8: \"this\"\n" +
+ " constant #13 utf8: \"LX;\"\n" +
+ " constant #14 utf8: \"main\"\n" +
+ " constant #15 utf8: \"([Ljava/lang/String;)V\"\n" +
+ " constant #16 invoke dynamic: #0 #17 foo ()LK;\n" +
+ " constant #17 name_and_type: #18.#19 foo ()LK;\n" +
+ " constant #18 utf8: \"foo\"\n" +
+ " constant #19 utf8: \"()LK;\"\n" +
+ " constant #20 string: #21 \"direct\"\n" +
+ " constant #21 utf8: \"direct\"\n" +
+ " constant #22 string: #23 \" call\"\n" +
+ " constant #23 utf8: \" call\"\n" +
+ " constant #24 interface_method_ref: #25.#27 K.foo (Ljava/lang/String;Ljava/lang/String;)V\n" +
+ " constant #25 class: #26 K\n" +
+ " constant #26 utf8: \"K\"\n" +
+ " constant #27 name_and_type: #18.#28 foo (Ljava/lang/String;Ljava/lang/String;)V\n" +
+ " constant #28 utf8: \"(Ljava/lang/String;Ljava/lang/String;)V\"\n" +
+ " constant #29 string: #30 \"bridge\"\n" +
+ " constant #30 utf8: \"bridge\"\n" +
+ " constant #31 string: #32 \" method(j)\"\n" +
+ " constant #32 utf8: \" method(j)\"\n" +
+ " constant #33 interface_method_ref: #34.#36 J.foo (Ljava/lang/Object;Ljava/lang/String;)V\n" +
+ " constant #34 class: #35 J\n" +
+ " constant #35 utf8: \"J\"\n" +
+ " constant #36 name_and_type: #18.#37 foo (Ljava/lang/Object;Ljava/lang/String;)V\n" +
+ " constant #37 utf8: \"(Ljava/lang/Object;Ljava/lang/String;)V\"\n" +
+ " constant #38 string: #39 \" method(i)\"\n" +
+ " constant #39 utf8: \" method(i)\"\n" +
+ " constant #40 interface_method_ref: #41.#43 I.foo (Ljava/lang/String;Ljava/lang/Object;)V\n" +
+ " constant #41 class: #42 I\n" +
+ " constant #42 utf8: \"I\"\n" +
+ " constant #43 name_and_type: #18.#44 foo (Ljava/lang/String;Ljava/lang/Object;)V\n" +
+ " constant #44 utf8: \"(Ljava/lang/String;Ljava/lang/Object;)V\"\n" +
+ " constant #45 utf8: \"x\"\n" +
+ " constant #46 utf8: \"[Ljava/lang/String;\"\n" +
+ " constant #47 utf8: \"k\"\n" +
+ " constant #48 utf8: \"LK;\"\n" +
+ " constant #49 utf8: \"j\"\n" +
+ " constant #50 utf8: \"LJ;\"\n" +
+ " constant #51 utf8: \"i\"\n" +
+ " constant #52 utf8: \"LI;\"\n" +
+ " constant #53 utf8: \"LocalVariableTypeTable\"\n" +
+ " constant #54 utf8: \"LJ<Ljava/lang/String;>;\"\n" +
+ " constant #55 utf8: \"LI<Ljava/lang/String;>;\"\n" +
+ " constant #56 utf8: \"lambda$0\"\n" +
+ " constant #57 field_ref: #58.#60 java/lang/System.out Ljava/io/PrintStream;\n" +
+ " constant #58 class: #59 java/lang/System\n" +
+ " constant #59 utf8: \"java/lang/System\"\n" +
+ " constant #60 name_and_type: #61.#62 out Ljava/io/PrintStream;\n" +
+ " constant #61 utf8: \"out\"\n" +
+ " constant #62 utf8: \"Ljava/io/PrintStream;\"\n" +
+ " constant #63 class: #64 java/lang/StringBuilder\n" +
+ " constant #64 utf8: \"java/lang/StringBuilder\"\n" +
+ " constant #65 string: #66 \"m(\"\n" +
+ " constant #66 utf8: \"m(\"\n" +
+ " constant #67 method_ref: #63.#68 java/lang/StringBuilder.<init> (Ljava/lang/String;)V\n" +
+ " constant #68 name_and_type: #5.#69 <init> (Ljava/lang/String;)V\n" +
+ " constant #69 utf8: \"(Ljava/lang/String;)V\"\n" +
+ " constant #70 method_ref: #63.#71 java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;\n" +
+ " constant #71 name_and_type: #72.#73 append (Ljava/lang/String;)Ljava/lang/StringBuilder;\n" +
+ " constant #72 utf8: \"append\"\n" +
+ " constant #73 utf8: \"(Ljava/lang/String;)Ljava/lang/StringBuilder;\"\n" +
+ " constant #74 method_ref: #63.#75 java/lang/StringBuilder.append (C)Ljava/lang/StringBuilder;\n" +
+ " constant #75 name_and_type: #72.#76 append (C)Ljava/lang/StringBuilder;\n" +
+ " constant #76 utf8: \"(C)Ljava/lang/StringBuilder;\"\n" +
+ " constant #77 method_ref: #63.#78 java/lang/StringBuilder.toString ()Ljava/lang/String;\n" +
+ " constant #78 name_and_type: #79.#80 toString ()Ljava/lang/String;\n" +
+ " constant #79 utf8: \"toString\"\n" +
+ " constant #80 utf8: \"()Ljava/lang/String;\"\n" +
+ " constant #81 method_ref: #82.#84 java/io/PrintStream.println (Ljava/lang/String;)V\n" +
+ " constant #82 class: #83 java/io/PrintStream\n" +
+ " constant #83 utf8: \"java/io/PrintStream\"\n" +
+ " constant #84 name_and_type: #85.#69 println (Ljava/lang/String;)V\n" +
+ " constant #85 utf8: \"println\"\n" +
+ " constant #86 utf8: \"s\"\n" +
+ " constant #87 utf8: \"Ljava/lang/String;\"\n" +
+ " constant #88 utf8: \"u\"\n" +
+ " constant #89 utf8: \"SourceFile\"\n" +
+ " constant #90 utf8: \"X.java\"\n" +
+ " constant #91 utf8: \"BootstrapMethods\"\n" +
+ " constant #92 method_ref: #93.#95 java/lang/invoke/LambdaMetafactory.altMetafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #93 class: #94 java/lang/invoke/LambdaMetafactory\n" +
+ " constant #94 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
+ " constant #95 name_and_type: #96.#97 altMetafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #96 utf8: \"altMetafactory\"\n" +
+ " constant #97 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;\"\n" +
+ " constant #98 method handle: invokestatic (6) #92 \n" +
+ " constant #99 method type: #28 (Ljava/lang/String;Ljava/lang/String;)V\n" +
+ " constant #100 method_ref: #1.#101 X.lambda$0 (Ljava/lang/String;Ljava/lang/String;)V\n" +
+ " constant #101 name_and_type: #56.#28 lambda$0 (Ljava/lang/String;Ljava/lang/String;)V\n" +
+ " constant #102 method handle: invokestatic (6) #100 \n" +
+ " constant #103 method type: #28 (Ljava/lang/String;Ljava/lang/String;)V\n" +
" constant #104 integer: 4\n" + // flag bridge
" constant #105 integer: 2\n" + // two bridges
" constant #106 method type: #44 (Ljava/lang/String;Ljava/lang/Object;)V\n" + // first bridge
" constant #107 method type: #37 (Ljava/lang/Object;Ljava/lang/String;)V\n" + // next bridge.
- " constant #108 utf8: \"InnerClasses\"\n" +
- " constant #109 class: #110 java/lang/invoke/MethodHandles$Lookup\n" +
- " constant #110 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
- " constant #111 class: #112 java/lang/invoke/MethodHandles\n" +
- " constant #112 utf8: \"java/lang/invoke/MethodHandles\"\n" +
- " constant #113 utf8: \"Lookup\"\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [8]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 10]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- " \n" +
- " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
- " // Stack: 3, Locals: 4\n" +
- " public static void main(java.lang.String... x);\n" +
- " 0 invokedynamic 0 foo() : K [16]\n" +
- " 5 astore_1 [k]\n" +
- " 6 aload_1 [k]\n" +
- " 7 ldc <String \"direct\"> [20]\n" +
- " 9 ldc <String \" call\"> [22]\n" +
- " 11 invokeinterface K.foo(java.lang.String, java.lang.String) : void [24] [nargs: 3]\n" +
- " 16 aload_1 [k]\n" +
- " 17 astore_2 [j]\n" +
- " 18 aload_2 [j]\n" +
- " 19 ldc <String \"bridge\"> [29]\n" +
- " 21 ldc <String \" method(j)\"> [31]\n" +
- " 23 invokeinterface J.foo(java.lang.Object, java.lang.String) : void [33] [nargs: 3]\n" +
- " 28 aload_1 [k]\n" +
- " 29 astore_3 [i]\n" +
- " 30 aload_3 [i]\n" +
- " 31 ldc <String \"bridge\"> [29]\n" +
- " 33 ldc <String \" method(i)\"> [38]\n" +
- " 35 invokeinterface I.foo(java.lang.String, java.lang.Object) : void [40] [nargs: 3]\n" +
- " 40 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 12]\n" +
- " [pc: 6, line: 13]\n" +
- " [pc: 16, line: 14]\n" +
- " [pc: 18, line: 15]\n" +
- " [pc: 28, line: 16]\n" +
- " [pc: 30, line: 17]\n" +
- " [pc: 40, line: 18]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 41] local: x index: 0 type: java.lang.String[]\n" +
- " [pc: 6, pc: 41] local: k index: 1 type: K\n" +
- " [pc: 18, pc: 41] local: j index: 2 type: J\n" +
- " [pc: 30, pc: 41] local: i index: 3 type: I\n" +
- " Local variable type table:\n" +
- " [pc: 18, pc: 41] local: j index: 2 type: J<java.lang.String>\n" +
- " [pc: 30, pc: 41] local: i index: 3 type: I<java.lang.String>\n" +
- " \n" +
- " // Method descriptor #28 (Ljava/lang/String;Ljava/lang/String;)V\n" +
- " // Stack: 4, Locals: 2\n" +
- " private static synthetic void lambda$0(java.lang.String s, java.lang.String u);\n" +
- " 0 getstatic java.lang.System.out : java.io.PrintStream [57]\n" +
- " 3 new java.lang.StringBuilder [63]\n" +
- " 6 dup\n" +
- " 7 ldc <String \"m(\"> [65]\n" +
- " 9 invokespecial java.lang.StringBuilder(java.lang.String) [67]\n" +
- " 12 aload_0 [s]\n" +
- " 13 invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [70]\n" +
- " 16 aload_1 [u]\n" +
- " 17 invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [70]\n" +
- " 20 bipush 41\n" +
- " 22 invokevirtual java.lang.StringBuilder.append(char) : java.lang.StringBuilder [74]\n" +
- " 25 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [77]\n" +
- " 28 invokevirtual java.io.PrintStream.println(java.lang.String) : void [81]\n" +
- " 31 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 12]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 32] local: s index: 0 type: java.lang.String\n" +
- " [pc: 0, pc: 32] local: u index: 1 type: java.lang.String\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #109 java/lang/invoke/MethodHandles$Lookup, outer class info: #111 java/lang/invoke/MethodHandles\n" +
- " inner name: #113 Lookup, accessflags: 25 public static final]\n" +
- "Bootstrap methods:\n" +
- " 0 : # 98 invokestatic java/lang/invoke/LambdaMetafactory.altMetafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;\n" +
- " Method arguments:\n" +
- " #99 (Ljava/lang/String;Ljava/lang/String;)V\n" +
- " #102 invokestatic X.lambda$0:(Ljava/lang/String;Ljava/lang/String;)V\n" +
- " #103 (Ljava/lang/String;Ljava/lang/String;)V\n" +
- " #104 4\n" +
- " #105 2\n" +
- " #106 (Ljava/lang/String;Ljava/lang/Object;)V\n" +
- " #107 (Ljava/lang/Object;Ljava/lang/String;)V\n" +
+ " constant #108 utf8: \"InnerClasses\"\n" +
+ " constant #109 class: #110 java/lang/invoke/MethodHandles$Lookup\n" +
+ " constant #110 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
+ " constant #111 class: #112 java/lang/invoke/MethodHandles\n" +
+ " constant #112 utf8: \"java/lang/invoke/MethodHandles\"\n" +
+ " constant #113 utf8: \"Lookup\"\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [8]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 10]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
+ " \n" +
+ " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
+ " // Stack: 3, Locals: 4\n" +
+ " public static void main(java.lang.String... x);\n" +
+ " 0 invokedynamic 0 foo() : K [16]\n" +
+ " 5 astore_1 [k]\n" +
+ " 6 aload_1 [k]\n" +
+ " 7 ldc <String \"direct\"> [20]\n" +
+ " 9 ldc <String \" call\"> [22]\n" +
+ " 11 invokeinterface K.foo(java.lang.String, java.lang.String) : void [24] [nargs: 3]\n" +
+ " 16 aload_1 [k]\n" +
+ " 17 astore_2 [j]\n" +
+ " 18 aload_2 [j]\n" +
+ " 19 ldc <String \"bridge\"> [29]\n" +
+ " 21 ldc <String \" method(j)\"> [31]\n" +
+ " 23 invokeinterface J.foo(java.lang.Object, java.lang.String) : void [33] [nargs: 3]\n" +
+ " 28 aload_1 [k]\n" +
+ " 29 astore_3 [i]\n" +
+ " 30 aload_3 [i]\n" +
+ " 31 ldc <String \"bridge\"> [29]\n" +
+ " 33 ldc <String \" method(i)\"> [38]\n" +
+ " 35 invokeinterface I.foo(java.lang.String, java.lang.Object) : void [40] [nargs: 3]\n" +
+ " 40 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 12]\n" +
+ " [pc: 6, line: 13]\n" +
+ " [pc: 16, line: 14]\n" +
+ " [pc: 18, line: 15]\n" +
+ " [pc: 28, line: 16]\n" +
+ " [pc: 30, line: 17]\n" +
+ " [pc: 40, line: 18]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 41] local: x index: 0 type: java.lang.String[]\n" +
+ " [pc: 6, pc: 41] local: k index: 1 type: K\n" +
+ " [pc: 18, pc: 41] local: j index: 2 type: J\n" +
+ " [pc: 30, pc: 41] local: i index: 3 type: I\n" +
+ " Local variable type table:\n" +
+ " [pc: 18, pc: 41] local: j index: 2 type: J<java.lang.String>\n" +
+ " [pc: 30, pc: 41] local: i index: 3 type: I<java.lang.String>\n" +
+ " \n" +
+ " // Method descriptor #28 (Ljava/lang/String;Ljava/lang/String;)V\n" +
+ " // Stack: 4, Locals: 2\n" +
+ " private static synthetic void lambda$0(java.lang.String s, java.lang.String u);\n" +
+ " 0 getstatic java.lang.System.out : java.io.PrintStream [57]\n" +
+ " 3 new java.lang.StringBuilder [63]\n" +
+ " 6 dup\n" +
+ " 7 ldc <String \"m(\"> [65]\n" +
+ " 9 invokespecial java.lang.StringBuilder(java.lang.String) [67]\n" +
+ " 12 aload_0 [s]\n" +
+ " 13 invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [70]\n" +
+ " 16 aload_1 [u]\n" +
+ " 17 invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [70]\n" +
+ " 20 bipush 41\n" +
+ " 22 invokevirtual java.lang.StringBuilder.append(char) : java.lang.StringBuilder [74]\n" +
+ " 25 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [77]\n" +
+ " 28 invokevirtual java.io.PrintStream.println(java.lang.String) : void [81]\n" +
+ " 31 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 12]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 32] local: s index: 0 type: java.lang.String\n" +
+ " [pc: 0, pc: 32] local: u index: 1 type: java.lang.String\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #109 java/lang/invoke/MethodHandles$Lookup, outer class info: #111 java/lang/invoke/MethodHandles\n" +
+ " inner name: #113 Lookup, accessflags: 25 public static final]\n" +
+ "Bootstrap methods:\n" +
+ " 0 : # 98 invokestatic java/lang/invoke/LambdaMetafactory.altMetafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;\n" +
+ " Method arguments:\n" +
+ " #99 (Ljava/lang/String;Ljava/lang/String;)V\n" +
+ " #102 invokestatic X.lambda$0:(Ljava/lang/String;Ljava/lang/String;)V\n" +
+ " #103 (Ljava/lang/String;Ljava/lang/String;)V\n" +
+ " #104 4\n" +
+ " #105 2\n" +
+ " #106 (Ljava/lang/String;Ljava/lang/Object;)V\n" +
+ " #107 (Ljava/lang/Object;Ljava/lang/String;)V\n" +
"}";
verifyClassFile(expectedOutput, "X.class", ClassFileBytesDisassembler.SYSTEM);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java
index 8ff2565de..fa3ec17d6 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java
@@ -5352,16 +5352,16 @@ public void testBug128954() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " * @see p.A#bar()\n" +
- " ^^^^^\n" +
- "[@cat:javadoc] [@sup:javadoc] Javadoc: The method bar() from the type A is deprecated\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "[@cat:type] Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " * @see p.A#bar()\n" +
+ " ^^^^^\n" +
+ "[@cat:javadoc] [@sup:javadoc] Javadoc: The method bar() from the type A is deprecated\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "[@cat:type] Zork cannot be resolved to a type\n" +
"----------\n",
null,
true,
@@ -5391,16 +5391,16 @@ public void testBug128954a() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " * @see p.A#bar()\n" +
- " ^^^\n" +
- "[@cat:javadoc] [@sup:javadoc] Javadoc: p cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "[@cat:type] Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " * @see p.A#bar()\n" +
+ " ^^^\n" +
+ "[@cat:javadoc] [@sup:javadoc] Javadoc: p cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "[@cat:type] Zork cannot be resolved to a type\n" +
"----------\n",
null,
true,
@@ -6438,99 +6438,99 @@ public void testBug170637() {
runConformTest(
new String[] {
"JavaDocTest.java",
- "public interface JavaDocTest\n" +
- "{\n" +
- " /**\n" +
- " * This is some stupid test...\n" +
- " * \n" +
- " * {@link JavaDocTest}\n" +
- " * \n" +
- " * @param bar1 {@link JavaDocTest}\n" +
- " * @param bar2 {@link JavaDocTest}\n" +
- " * @param bar3 {@link JavaDocTest}\n" +
- " * @param bar4 {@link JavaDocTest}\n" +
- " * @param bar5 {@link JavaDocTest}\n" +
- " * @param bar6 {@link JavaDocTest}\n" +
- " * @param bar7 {@link JavaDocTest}\n" +
- " * @param bar8 {@link JavaDocTest}\n" +
- " * @param bar9 {@link JavaDocTest}\n" +
- " * @param bar10 {@link JavaDocTest}\n" +
- " * @param bar11 {@link JavaDocTest}\n" +
- " * @param bar12 {@link JavaDocTest}\n" +
- " * @param bar13 {@link JavaDocTest}\n" +
- " * \n" +
- " * @return A string!\n" +
- " */\n" +
- " public String foo(String bar1,\n" +
- " String bar2,\n" +
- " String bar3,\n" +
- " String bar4,\n" +
- " String bar5,\n" +
- " String bar6,\n" +
- " String bar7,\n" +
- " String bar8,\n" +
- " String bar9,\n" +
- " String bar10,\n" +
- " String bar11,\n" +
- " String bar12,\n" +
- " String bar13\n" +
- " );\n" +
- "\n" +
- " /**\n" +
- " * This is some more stupid test...\n" +
- " * \n" +
- " * {@link JavaDocTest}\n" +
- " * {@link JavaDocTest}\n" +
- " * {@link JavaDocTest}\n" +
- " * {@link JavaDocTest}\n" +
- " * {@link JavaDocTest}\n" +
- " * {@link JavaDocTest}\n" +
- " * {@link JavaDocTest}\n" +
- " * {@link JavaDocTest}\n" +
- " * {@link JavaDocTest}\n" +
- " * {@link JavaDocTest}\n" +
- " * {@link JavaDocTest}\n" +
- " * {@link JavaDocTest}\n" +
- " * {@link JavaDocTest}\n" +
- " * {@link JavaDocTest}\n" +
- " * {@link JavaDocTest}\n" +
- " * {@link JavaDocTest}\n" +
- " * {@link JavaDocTest}\n" +
- " * {@link JavaDocTest}\n" +
- " * {@link JavaDocTest}\n" +
- " * {@link JavaDocTest}\n" +
- " * {@link JavaDocTest}\n" +
- " * \n" +
- " * @param bar1 \n" +
- " * @param bar2 \n" +
- " * @param bar3 \n" +
- " * @param bar4 \n" +
- " * @param bar5 \n" +
- " * @param bar6 \n" +
- " * @param bar7 \n" +
- " * @param bar8 \n" +
- " * @param bar9 \n" +
- " * @param bar10 \n" +
- " * @param bar11 \n" +
- " * @param bar12 \n" +
- " * @param bar13 \n" +
- " * \n" +
- " * @return A string!\n" +
- " */\n" +
- " public String foo2(String bar1,\n" +
- " String bar2,\n" +
- " String bar3,\n" +
- " String bar4,\n" +
- " String bar5,\n" +
- " String bar6,\n" +
- " String bar7,\n" +
- " String bar8,\n" +
- " String bar9,\n" +
- " String bar10,\n" +
- " String bar11,\n" +
- " String bar12,\n" +
- " String bar13\n" +
- " );\n" +
+ "public interface JavaDocTest\n" +
+ "{\n" +
+ " /**\n" +
+ " * This is some stupid test...\n" +
+ " * \n" +
+ " * {@link JavaDocTest}\n" +
+ " * \n" +
+ " * @param bar1 {@link JavaDocTest}\n" +
+ " * @param bar2 {@link JavaDocTest}\n" +
+ " * @param bar3 {@link JavaDocTest}\n" +
+ " * @param bar4 {@link JavaDocTest}\n" +
+ " * @param bar5 {@link JavaDocTest}\n" +
+ " * @param bar6 {@link JavaDocTest}\n" +
+ " * @param bar7 {@link JavaDocTest}\n" +
+ " * @param bar8 {@link JavaDocTest}\n" +
+ " * @param bar9 {@link JavaDocTest}\n" +
+ " * @param bar10 {@link JavaDocTest}\n" +
+ " * @param bar11 {@link JavaDocTest}\n" +
+ " * @param bar12 {@link JavaDocTest}\n" +
+ " * @param bar13 {@link JavaDocTest}\n" +
+ " * \n" +
+ " * @return A string!\n" +
+ " */\n" +
+ " public String foo(String bar1,\n" +
+ " String bar2,\n" +
+ " String bar3,\n" +
+ " String bar4,\n" +
+ " String bar5,\n" +
+ " String bar6,\n" +
+ " String bar7,\n" +
+ " String bar8,\n" +
+ " String bar9,\n" +
+ " String bar10,\n" +
+ " String bar11,\n" +
+ " String bar12,\n" +
+ " String bar13\n" +
+ " );\n" +
+ "\n" +
+ " /**\n" +
+ " * This is some more stupid test...\n" +
+ " * \n" +
+ " * {@link JavaDocTest}\n" +
+ " * {@link JavaDocTest}\n" +
+ " * {@link JavaDocTest}\n" +
+ " * {@link JavaDocTest}\n" +
+ " * {@link JavaDocTest}\n" +
+ " * {@link JavaDocTest}\n" +
+ " * {@link JavaDocTest}\n" +
+ " * {@link JavaDocTest}\n" +
+ " * {@link JavaDocTest}\n" +
+ " * {@link JavaDocTest}\n" +
+ " * {@link JavaDocTest}\n" +
+ " * {@link JavaDocTest}\n" +
+ " * {@link JavaDocTest}\n" +
+ " * {@link JavaDocTest}\n" +
+ " * {@link JavaDocTest}\n" +
+ " * {@link JavaDocTest}\n" +
+ " * {@link JavaDocTest}\n" +
+ " * {@link JavaDocTest}\n" +
+ " * {@link JavaDocTest}\n" +
+ " * {@link JavaDocTest}\n" +
+ " * {@link JavaDocTest}\n" +
+ " * \n" +
+ " * @param bar1 \n" +
+ " * @param bar2 \n" +
+ " * @param bar3 \n" +
+ " * @param bar4 \n" +
+ " * @param bar5 \n" +
+ " * @param bar6 \n" +
+ " * @param bar7 \n" +
+ " * @param bar8 \n" +
+ " * @param bar9 \n" +
+ " * @param bar10 \n" +
+ " * @param bar11 \n" +
+ " * @param bar12 \n" +
+ " * @param bar13 \n" +
+ " * \n" +
+ " * @return A string!\n" +
+ " */\n" +
+ " public String foo2(String bar1,\n" +
+ " String bar2,\n" +
+ " String bar3,\n" +
+ " String bar4,\n" +
+ " String bar5,\n" +
+ " String bar6,\n" +
+ " String bar7,\n" +
+ " String bar8,\n" +
+ " String bar9,\n" +
+ " String bar10,\n" +
+ " String bar11,\n" +
+ " String bar12,\n" +
+ " String bar13\n" +
+ " );\n" +
"}\n"
}
);
@@ -6694,11 +6694,11 @@ public void testBug170637b() {
};
this.reportMissingJavadocTags = CompilerOptions.ERROR;
runNegativeTest(units,
- "----------\n" +
- "1. ERROR in X.java (at line 70)\n" +
- " String bar31\n" +
- " ^^^^^\n" +
- "Javadoc: Missing tag for parameter bar31\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 70)\n" +
+ " String bar31\n" +
+ " ^^^^^\n" +
+ "Javadoc: Missing tag for parameter bar31\n" +
"----------\n");
}
@@ -7008,7 +7008,7 @@ public void testBug176027h_public() {
" import mainpkg.Outer.*;\n"+
" ^^^^^^^^^^^^^\n"+
"The import mainpkg.Outer is never used\n" +
- "----------\n" +
+ "----------\n" +
"2. ERROR in pkg3\\Invalid3.java (at line 6)\n" +
" * {@link MostInner} -- error/warning \n" +
" ^^^^^^^^^\n" +
@@ -7554,7 +7554,7 @@ public void testBug207765() {
"package pkg;\n" +
"\n" +
"public class X {\n" +
- " /**\n" +
+ " /**\n" +
" * {@link \"http://www.eclipse.org/}\n" +
" * @see \"http://www.eclipse.org/\n" +
" */\n" +
@@ -7563,16 +7563,16 @@ public void testBug207765() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in pkg\\X.java (at line 5)\n" +
- " * {@link \"http://www.eclipse.org/}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n" +
- "2. ERROR in pkg\\X.java (at line 6)\n" +
- " * @see \"http://www.eclipse.org/\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid URL reference. Double quote the reference or use the href syntax\n" +
+ "----------\n" +
+ "1. ERROR in pkg\\X.java (at line 5)\n" +
+ " * {@link \"http://www.eclipse.org/}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid reference\n" +
+ "----------\n" +
+ "2. ERROR in pkg\\X.java (at line 6)\n" +
+ " * @see \"http://www.eclipse.org/\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid URL reference. Double quote the reference or use the href syntax\n" +
"----------\n"
);
}
@@ -7584,38 +7584,38 @@ public void testBug207765() {
public void testBug222900a() {
String[] units = new String[] {
"X.java",
- "/**\n" +
- "* @since\n" +
- "* description\n" +
- "* @author\n" +
- "* description\n" +
- "* @version\n" +
- "* description\n" +
- "*/\n" +
- "public class X {\n" +
- " /**\n" +
- " * @param aParam\n" +
- " * description\n" +
- " * @return\n" +
- " * description\n" +
- " * @since\n" +
- " * description\n" +
- " * @throws NullPointerException\n" +
- " * description\n" +
- " * @exception NullPointerException\n" +
- " * description\n" +
- " * @serial\n" +
- " * description\n" +
- " * @serialData\n" +
- " * description\n" +
- " * @serialField\n" +
- " * description\n" +
- " * @deprecated\n" +
- " * description\n" +
- " */\n" +
- " public String foo(String aParam) {\n" +
- " return new String();\n" +
- " }\n" +
+ "/**\n" +
+ "* @since\n" +
+ "* description\n" +
+ "* @author\n" +
+ "* description\n" +
+ "* @version\n" +
+ "* description\n" +
+ "*/\n" +
+ "public class X {\n" +
+ " /**\n" +
+ " * @param aParam\n" +
+ " * description\n" +
+ " * @return\n" +
+ " * description\n" +
+ " * @since\n" +
+ " * description\n" +
+ " * @throws NullPointerException\n" +
+ " * description\n" +
+ " * @exception NullPointerException\n" +
+ " * description\n" +
+ " * @serial\n" +
+ " * description\n" +
+ " * @serialData\n" +
+ " * description\n" +
+ " * @serialField\n" +
+ " * description\n" +
+ " * @deprecated\n" +
+ " * description\n" +
+ " */\n" +
+ " public String foo(String aParam) {\n" +
+ " return new String();\n" +
+ " }\n" +
"}\n"
};
this.reportMissingJavadocDescription = CompilerOptions.ALL_STANDARD_TAGS;
@@ -7624,13 +7624,13 @@ public void testBug222900a() {
public void testBug222900b() {
String[] units = new String[] {
"X.java",
- "/**\n" +
- " * {@code\n" +
- " * description}\n" +
- " * {@literal\n" +
- " * description}\n" +
- "*/\n" +
- "public class X {\n" +
+ "/**\n" +
+ " * {@code\n" +
+ " * description}\n" +
+ " * {@literal\n" +
+ " * description}\n" +
+ "*/\n" +
+ "public class X {\n" +
"}\n"
};
this.reportMissingJavadocDescription = CompilerOptions.ALL_STANDARD_TAGS;
@@ -7639,29 +7639,29 @@ public void testBug222900b() {
public void testBug222900c() {
String[] units = new String[] {
"X.java",
- "/**\n" +
- " * Test the {@code} missing description\n" +
- " * Test the {@code\n" +
- " * } missing description\n" +
- " * Test the {@code X} with description\n" +
- " * Test the {@code\n" +
- " * public class X} with description\n" +
- "*/\n" +
- "public class X {\n" +
+ "/**\n" +
+ " * Test the {@code} missing description\n" +
+ " * Test the {@code\n" +
+ " * } missing description\n" +
+ " * Test the {@code X} with description\n" +
+ " * Test the {@code\n" +
+ " * public class X} with description\n" +
+ "*/\n" +
+ "public class X {\n" +
"}\n"
};
this.reportMissingJavadocDescription = CompilerOptions.ALL_STANDARD_TAGS;
runNegativeTest(units,
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " * Test the {@code} missing description\n" +
- " ^^^^\n" +
- "Javadoc: Description expected after @code\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " * Test the {@code\n" +
- " ^^^^\n" +
- "Javadoc: Description expected after @code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " * Test the {@code} missing description\n" +
+ " ^^^^\n" +
+ "Javadoc: Description expected after @code\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " * Test the {@code\n" +
+ " ^^^^\n" +
+ "Javadoc: Description expected after @code\n" +
"----------\n"
);
}
@@ -7826,28 +7826,28 @@ public void testBug227730b() {
public void testBug233187a() {
String[] units = new String[] {
"test/a/X.java",
- "package test.a;\n" +
- "\n" +
- "public class X {\n" +
- " public static class Y {\n" +
- " public static class Z { \n" +
- " /**\n" +
- " * The position in the new method signature depends on\n" +
- " * the position in the array passed to\n" +
- " * {@link X.Y#foo(test.a.X.Y.Z[])} OK for javadoc tool\n" +
- " * {@link X.Y#foo(test.a.X.Y.Z)} KO for javadoc tool\n" +
- " * {@link X.Y#foo(no_test.a.X.Y.Z[])} KO for javadoc tool\n" +
- " * {@link X.Y#foo(Y.Z[])} KO for javadoc tool\n" +
- " * {@link test.a.X.Y#foo(Y.Z[])} KO for javadoc tool\n" +
- " */\n" +
- " public int bar() {\n" +
- " return 0;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public void foo(Z[] params) {\n" +
- " }\n" +
- " }\n" +
+ "package test.a;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static class Y {\n" +
+ " public static class Z { \n" +
+ " /**\n" +
+ " * The position in the new method signature depends on\n" +
+ " * the position in the array passed to\n" +
+ " * {@link X.Y#foo(test.a.X.Y.Z[])} OK for javadoc tool\n" +
+ " * {@link X.Y#foo(test.a.X.Y.Z)} KO for javadoc tool\n" +
+ " * {@link X.Y#foo(no_test.a.X.Y.Z[])} KO for javadoc tool\n" +
+ " * {@link X.Y#foo(Y.Z[])} KO for javadoc tool\n" +
+ " * {@link test.a.X.Y#foo(Y.Z[])} KO for javadoc tool\n" +
+ " */\n" +
+ " public int bar() {\n" +
+ " return 0;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public void foo(Z[] params) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
};
runNegativeTest(units,
@@ -7855,26 +7855,26 @@ public void testBug233187a() {
// warning - Tag @link: can't find foo(no_test.a.X.Y.Z[]) in test.a.X.Y
// warning - Tag @link: can't find foo(Y.Z[]) in test.a.X.Y
// warning - Tag @link: can't find foo(Y.Z[]) in test.a.X.Y
- "----------\n" +
- "1. ERROR in test\\a\\X.java (at line 10)\n" +
- " * {@link X.Y#foo(test.a.X.Y.Z)} KO for javadoc tool\n" +
- " ^^^\n" +
- "Javadoc: The method foo(X.Y.Z[]) in the type X.Y is not applicable for the arguments (X.Y.Z)\n" +
- "----------\n" +
- "2. ERROR in test\\a\\X.java (at line 11)\n" +
- " * {@link X.Y#foo(no_test.a.X.Y.Z[])} KO for javadoc tool\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Javadoc: no_test[] cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in test\\a\\X.java (at line 12)\n" +
- " * {@link X.Y#foo(Y.Z[])} KO for javadoc tool\n" +
- " ^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "4. ERROR in test\\a\\X.java (at line 13)\n" +
- " * {@link test.a.X.Y#foo(Y.Z[])} KO for javadoc tool\n" +
- " ^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
+ "----------\n" +
+ "1. ERROR in test\\a\\X.java (at line 10)\n" +
+ " * {@link X.Y#foo(test.a.X.Y.Z)} KO for javadoc tool\n" +
+ " ^^^\n" +
+ "Javadoc: The method foo(X.Y.Z[]) in the type X.Y is not applicable for the arguments (X.Y.Z)\n" +
+ "----------\n" +
+ "2. ERROR in test\\a\\X.java (at line 11)\n" +
+ " * {@link X.Y#foo(no_test.a.X.Y.Z[])} KO for javadoc tool\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Javadoc: no_test[] cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in test\\a\\X.java (at line 12)\n" +
+ " * {@link X.Y#foo(Y.Z[])} KO for javadoc tool\n" +
+ " ^^^\n" +
+ "Javadoc: Invalid member type qualification\n" +
+ "----------\n" +
+ "4. ERROR in test\\a\\X.java (at line 13)\n" +
+ " * {@link test.a.X.Y#foo(Y.Z[])} KO for javadoc tool\n" +
+ " ^^^\n" +
+ "Javadoc: Invalid member type qualification\n" +
"----------\n"
);
}
@@ -7882,54 +7882,54 @@ public void testBug233187b() {
runNegativeTest(
new String[] {
"test/b/X.java",
- "package test.b;\n" +
- "\n" +
- "public class X {\n" +
- " public static class Y {\n" +
- " public static class Z { \n" +
- " /**\n" +
- " * The position in the new method signature depends on\n" +
- " * the position in the array passed to\n" +
+ "package test.b;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static class Y {\n" +
+ " public static class Z { \n" +
+ " /**\n" +
+ " * The position in the new method signature depends on\n" +
+ " * the position in the array passed to\n" +
" * {@link X.Y#foo(test.b.X.Y.Z)} OK for javadoc tool\n" +
" * {@link X.Y#foo(test.b.X.Y.Z[])} KO for javadoc tool\n" +
" * {@link X.Y#foo(no_test.b.X.Y.Z)} KO for javadoc tool\n" +
" * {@link X.Y#foo(Y.Z)} KO for javadoc tool\n" +
" * {@link test.b.X.Y#foo(Y.Z)} KO for javadoc tool\n" +
- " */\n" +
- " public int bar() {\n" +
- " return 0;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public void foo(Z params) {\n" +
- " }\n" +
- " }\n" +
+ " */\n" +
+ " public int bar() {\n" +
+ " return 0;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public void foo(Z params) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
// warning - Tag @link: can't find foo(test.b.X.Y.Z[]) in test.b.X.Y
// warning - Tag @link: can't find foo(no_test.b.X.Y.Z) in test.b.X.Y
// warning - Tag @link: can't find foo(Y.Z) in test.b.X.Y
// warning - Tag @link: can't find foo(Y.Z) in test.b.X.Y
- "----------\n" +
- "1. ERROR in test\\b\\X.java (at line 10)\n" +
- " * {@link X.Y#foo(test.b.X.Y.Z[])} KO for javadoc tool\n" +
- " ^^^\n" +
- "Javadoc: The method foo(X.Y.Z) in the type X.Y is not applicable for the arguments (X.Y.Z[])\n" +
- "----------\n" +
- "2. ERROR in test\\b\\X.java (at line 11)\n" +
- " * {@link X.Y#foo(no_test.b.X.Y.Z)} KO for javadoc tool\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Javadoc: no_test cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in test\\b\\X.java (at line 12)\n" +
- " * {@link X.Y#foo(Y.Z)} KO for javadoc tool\n" +
- " ^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "4. ERROR in test\\b\\X.java (at line 13)\n" +
- " * {@link test.b.X.Y#foo(Y.Z)} KO for javadoc tool\n" +
- " ^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
+ "----------\n" +
+ "1. ERROR in test\\b\\X.java (at line 10)\n" +
+ " * {@link X.Y#foo(test.b.X.Y.Z[])} KO for javadoc tool\n" +
+ " ^^^\n" +
+ "Javadoc: The method foo(X.Y.Z) in the type X.Y is not applicable for the arguments (X.Y.Z[])\n" +
+ "----------\n" +
+ "2. ERROR in test\\b\\X.java (at line 11)\n" +
+ " * {@link X.Y#foo(no_test.b.X.Y.Z)} KO for javadoc tool\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Javadoc: no_test cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in test\\b\\X.java (at line 12)\n" +
+ " * {@link X.Y#foo(Y.Z)} KO for javadoc tool\n" +
+ " ^^^\n" +
+ "Javadoc: Invalid member type qualification\n" +
+ "----------\n" +
+ "4. ERROR in test\\b\\X.java (at line 13)\n" +
+ " * {@link test.b.X.Y#foo(Y.Z)} KO for javadoc tool\n" +
+ " ^^^\n" +
+ "Javadoc: Invalid member type qualification\n" +
"----------\n"
);
}
@@ -7937,16 +7937,16 @@ public void testBug233187c() {
runConformTest(
new String[] {
"test/c/X.java",
- "package test.c;\n" +
- "\n" +
- "public class X {\n" +
- " static class Y { \n" +
- " }\n" +
- " void foo(Y y) {}\n" +
- " /**\n" +
- " * @see #foo(X.Y)\n" +
- " */\n" +
- " void bar() {}\n" +
+ "package test.c;\n" +
+ "\n" +
+ "public class X {\n" +
+ " static class Y { \n" +
+ " }\n" +
+ " void foo(Y y) {}\n" +
+ " /**\n" +
+ " * @see #foo(X.Y)\n" +
+ " */\n" +
+ " void bar() {}\n" +
"}\n"
}
);
@@ -7999,10 +7999,10 @@ public void testBug237937() {
runConformTest(
new String[] {
"Link.java",
- "/**\n" +
- " * @see <a href=\"http://www.eclipse.org/\">http://www.eclipse.org</a>\n" +
- " * @see <a href=\"http://www.eclipse.org/\">//</a>\n" +
- " */\n" +
+ "/**\n" +
+ " * @see <a href=\"http://www.eclipse.org/\">http://www.eclipse.org</a>\n" +
+ " * @see <a href=\"http://www.eclipse.org/\">//</a>\n" +
+ " */\n" +
"public class Link {}\n"
}
);
@@ -8018,32 +8018,32 @@ public void testBug246712() {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- "\n" +
- " /**\n" +
- " * Do something more.\n" +
- " * \n" +
- " * @param monitor The monitor\n" +
- " * @return {@link String X}\n" +
- " */\n" +
- " String foo(Object monitor) {\n" +
- " return \"X\";\n" +
- " }\n" +
+ "public class X {\n" +
+ "\n" +
+ " /**\n" +
+ " * Do something more.\n" +
+ " * \n" +
+ " * @param monitor The monitor\n" +
+ " * @return {@link String X}\n" +
+ " */\n" +
+ " String foo(Object monitor) {\n" +
+ " return \"X\";\n" +
+ " }\n" +
"}\n",
"Y.java",
- "public class Y extends X {\n" +
- "\n" +
- " /**\n" +
- " * Do something more.\n" +
- " * \n" +
- " * {@inheritDoc}\n" +
- " * \n" +
- " * @param monitor {@inheritDoc}\n" +
- " * @return {@link String Y}\n" +
- " */\n" +
- " String foo(Object monitor) {\n" +
- " return \"Y\";\n" +
- " }\n" +
+ "public class Y extends X {\n" +
+ "\n" +
+ " /**\n" +
+ " * Do something more.\n" +
+ " * \n" +
+ " * {@inheritDoc}\n" +
+ " * \n" +
+ " * @param monitor {@inheritDoc}\n" +
+ " * @return {@link String Y}\n" +
+ " */\n" +
+ " String foo(Object monitor) {\n" +
+ " return \"Y\";\n" +
+ " }\n" +
"}\n"
}
);
@@ -8053,26 +8053,26 @@ public void testBug246712b() {
runConformTest(
new String[] {
"X.java",
- "/**\n" +
- " * @author {@link String}\n" +
- " * @since {@link String}\n" +
- " * @version {@link String}\n" +
- " * @deprecated {@link String}\n" +
- "*/\n" +
- "public class X {\n" +
- " /**\n" +
- " * @return {@link String}\n" +
- " * @since {@link String}\n" +
- " * @throws Exception {@link String}\n" +
- " * @exception Exception {@link String}\n" +
- " * @serial {@link String}\n" +
- " * @serialData {@link String}\n" +
- " * @serialField {@link String}\n" +
- " * @deprecated {@link String}\n" +
- " */\n" +
- " public String foo(String aParam) throws Exception {\n" +
- " return new String();\n" +
- " }\n" +
+ "/**\n" +
+ " * @author {@link String}\n" +
+ " * @since {@link String}\n" +
+ " * @version {@link String}\n" +
+ " * @deprecated {@link String}\n" +
+ "*/\n" +
+ "public class X {\n" +
+ " /**\n" +
+ " * @return {@link String}\n" +
+ " * @since {@link String}\n" +
+ " * @throws Exception {@link String}\n" +
+ " * @exception Exception {@link String}\n" +
+ " * @serial {@link String}\n" +
+ " * @serialData {@link String}\n" +
+ " * @serialField {@link String}\n" +
+ " * @deprecated {@link String}\n" +
+ " */\n" +
+ " public String foo(String aParam) throws Exception {\n" +
+ " return new String();\n" +
+ " }\n" +
"}"
}
);
@@ -8083,19 +8083,19 @@ public void testBug246715() {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- "\n" +
- " final static int WAIT_YES = 0;\n" +
- " final static int WAIT_NO = 1;\n" +
- " \n" +
- " /**\n" +
- " * Do something more.\n" +
- " * \n" +
- " * @param waitFlag {@link #WAIT_YES} or {@link #WAIT_NO}\n" +
- " */\n" +
- " String foo(int waitFlag) {\n" +
- " return \"X\";\n" +
- " }\n" +
+ "public class X {\n" +
+ "\n" +
+ " final static int WAIT_YES = 0;\n" +
+ " final static int WAIT_NO = 1;\n" +
+ " \n" +
+ " /**\n" +
+ " * Do something more.\n" +
+ " * \n" +
+ " * @param waitFlag {@link #WAIT_YES} or {@link #WAIT_NO}\n" +
+ " */\n" +
+ " String foo(int waitFlag) {\n" +
+ " return \"X\";\n" +
+ " }\n" +
"}\n"
}
);
@@ -8110,20 +8110,20 @@ public void testBug254825() {
runNegativeTest(
new String[] {
"X.java",
- "class X {\n" +
- " public Object foo(Object o) { \n" +
- " return new Object() {\n" +
- " /** @see #o */\n" +
- " public void x() {}\n" +
- " };\n" +
- " }\n" +
+ "class X {\n" +
+ " public Object foo(Object o) { \n" +
+ " return new Object() {\n" +
+ " /** @see #o */\n" +
+ " public void x() {}\n" +
+ " };\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " /** @see #o */\n" +
- " ^\n" +
- "Javadoc: o cannot be resolved or is not a field\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " /** @see #o */\n" +
+ " ^\n" +
+ "Javadoc: o cannot be resolved or is not a field\n" +
"----------\n"
);
}
@@ -8131,16 +8131,16 @@ public void testBug254825b() {
runNegativeTest(
new String[] {
"X.java",
- "class X {\n" +
- " /** @see #o */\n" +
- " public Object foo(Object o) { return null; }\n" +
+ "class X {\n" +
+ " /** @see #o */\n" +
+ " public Object foo(Object o) { return null; }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " /** @see #o */\n" +
- " ^\n" +
- "Javadoc: o cannot be resolved or is not a field\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " /** @see #o */\n" +
+ " ^\n" +
+ "Javadoc: o cannot be resolved or is not a field\n" +
"----------\n"
);
}
@@ -8165,19 +8165,19 @@ public void testBug258798_1() {
runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- "/**\n" +
- "* @see #X(int)\n" +
- "*/\n" +
- "X(int i) {\n" +
- "}\n" +
+ "public class X {\n" +
+ "/**\n" +
+ "* @see #X(int)\n" +
+ "*/\n" +
+ "X(int i) {\n" +
+ "}\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " X(int i) {\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter i\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " X(int i) {\n" +
+ " ^\n" +
+ "Javadoc: Missing tag for parameter i\n" +
"----------\n"
);
}
@@ -8186,19 +8186,19 @@ public void testBug258798_2a() {
runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- "X(int i) {}\n" +
- "}\n" +
- "class Y extends X {\n" +
- "/** @see X#X(int) */\n" +
- "Y(double d) { super(0); }\n" +
+ "public class X {\n" +
+ "X(int i) {}\n" +
+ "}\n" +
+ "class Y extends X {\n" +
+ "/** @see X#X(int) */\n" +
+ "Y(double d) { super(0); }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " Y(double d) { super(0); }\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter d\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " Y(double d) { super(0); }\n" +
+ " ^\n" +
+ "Javadoc: Missing tag for parameter d\n" +
"----------\n"
);
}
@@ -8208,20 +8208,20 @@ public void testBug258798_2b() {
runNegativeTest(
new String[] {
"X.java",
- "import java.util.*;\n" +
- "public class X<T> {\n" +
- "X(ArrayList<T> alt) {}\n" +
- "}\n" +
- "class Y<U> extends X<U> {\n" +
- "/** @see X#X(ArrayList) */\n" +
- "Y(List<U> lu) { super(null); }\n" +
+ "import java.util.*;\n" +
+ "public class X<T> {\n" +
+ "X(ArrayList<T> alt) {}\n" +
+ "}\n" +
+ "class Y<U> extends X<U> {\n" +
+ "/** @see X#X(ArrayList) */\n" +
+ "Y(List<U> lu) { super(null); }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " Y(List<U> lu) { super(null); }\n" +
- " ^^\n" +
- "Javadoc: Missing tag for parameter lu\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 7)\n" +
+ " Y(List<U> lu) { super(null); }\n" +
+ " ^^\n" +
+ "Javadoc: Missing tag for parameter lu\n" +
"----------\n"
);
}
@@ -8232,20 +8232,20 @@ public void testBug258798_2c() {
runNegativeTest(
new String[] {
"X.java",
- "import java.util.*;\n" +
- "public class X<T> {\n" +
- "X(Object o) {}\n" +
- "}\n" +
- "class Y<U> extends X<U> {\n" +
- "/** @see X#X(Object) */\n" +
- "Y(List<U> lu) { super(lu); }\n" +
+ "import java.util.*;\n" +
+ "public class X<T> {\n" +
+ "X(Object o) {}\n" +
+ "}\n" +
+ "class Y<U> extends X<U> {\n" +
+ "/** @see X#X(Object) */\n" +
+ "Y(List<U> lu) { super(lu); }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " Y(List<U> lu) { super(lu); }\n" +
- " ^^\n" +
- "Javadoc: Missing tag for parameter lu\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 7)\n" +
+ " Y(List<U> lu) { super(lu); }\n" +
+ " ^^\n" +
+ "Javadoc: Missing tag for parameter lu\n" +
"----------\n"
);
}
@@ -8256,13 +8256,13 @@ public void testBug258798_3() {
runConformTest(
new String[] {
"X.java",
- "import java.util.*;\n" +
- "public class X<T> {\n" +
- "X(List<T> lt) {}\n" +
- "}\n" +
- "class Y<U> extends X<U> {\n" +
- "/** @see X#X(List) */\n" +
- "Y(List<U> lu) { super(null); }\n" +
+ "import java.util.*;\n" +
+ "public class X<T> {\n" +
+ "X(List<T> lt) {}\n" +
+ "}\n" +
+ "class Y<U> extends X<U> {\n" +
+ "/** @see X#X(List) */\n" +
+ "Y(List<U> lu) { super(null); }\n" +
"}\n"
}
);
@@ -8289,16 +8289,16 @@ public void testBug247037() {
" void BlahBlah();\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " * {@inheritDoc}\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " * {@inheritDoc}\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " * {@inheritDoc}\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " * {@inheritDoc}\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
);
@@ -8325,16 +8325,16 @@ public void testBug247037b() {
" Y(int x) {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " * {@inheritDoc}\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " * @param x {@inheritDoc}\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " * {@inheritDoc}\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " * @param x {@inheritDoc}\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
);
@@ -8365,34 +8365,34 @@ public void testBug247037c() {
" * @since {@inheritDoc}\n" + // error, cannot be used in @since
" * @author {@inheritDoc}\n" + // error, cannot be used in @author
" * @see {@inheritDoc}\n" + // error, cannot be used in @see
- " * @throws Exception {@inheritDoc}\n" +
- " * @exception Exception {@inheritDoc}\n" +
+ " * @throws Exception {@inheritDoc}\n" +
+ " * @exception Exception {@inheritDoc}\n" +
" */\n" +
" public int m(int blah) throws Exception {\n" +
" return 1;\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 16)\n" +
- " * @since {@inheritDoc}\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 17)\n" +
- " * @author {@inheritDoc}\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 18)\n" +
- " * @see {@inheritDoc}\n" +
- " ^^^\n" +
- "Javadoc: Missing reference\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 18)\n" +
- " * @see {@inheritDoc}\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 16)\n" +
+ " * @since {@inheritDoc}\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 17)\n" +
+ " * @author {@inheritDoc}\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 18)\n" +
+ " * @see {@inheritDoc}\n" +
+ " ^^^\n" +
+ "Javadoc: Missing reference\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 18)\n" +
+ " * @see {@inheritDoc}\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
);
@@ -8419,27 +8419,27 @@ public void testBug247037d() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " * @param blah {@inheritDoc}\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " * @return {@inheritDoc}\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " * @author {@inheritDoc}\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " * @param blah {@inheritDoc}\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " * @return {@inheritDoc}\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " * @author {@inheritDoc}\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
);
}
/**
- * @bug 267833:[javadoc] Custom tags should not be allowed for inline tags
+ * @bug 267833:[javadoc] Custom tags should not be allowed for inline tags
* @test Ensure that a warning is raised when customs tags are used as inline tags
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=267833"
*/
@@ -8457,13 +8457,13 @@ public void testBug267833() {
}
/**
* Additional test for bug 267833
- * @test Ensure that the JavadocTagConstants.JAVADOC_TAG_TYPE array is up to date with the other arrays, such as
+ * @test Ensure that the JavadocTagConstants.JAVADOC_TAG_TYPE array is up to date with the other arrays, such as
* JavadocTagConstants.TAG_NAMES, JavadocTagConstants.INLINE_TAGS and JavadocTagConstants.BLOCK_TAGS
*/
public void testBug267833_2() {
-
+
assertEquals(JavadocTagConstants.TAG_NAMES.length,JavadocTagConstants.JAVADOC_TAG_TYPE.length);
-
+
int tagsLength = JavadocTagConstants.TAG_NAMES.length;
nextTag:for (int index=0; index < tagsLength; index++) {
char[] tagName = JavadocTagConstants.TAG_NAMES[index];
@@ -8492,7 +8492,7 @@ public void testBug267833_2() {
}
/**
* Additional test for bug 267833
- * @test Ensure that a warning is raised when block tags are used as inline tags.
+ * @test Ensure that a warning is raised when block tags are used as inline tags.
*/
public void testBug267833_3() {
runNegativeTest(
@@ -8503,84 +8503,84 @@ public void testBug267833_3() {
"* Description {@see String} , {@return int}, {@since 1.0}, {@param i}, {@throws NullPointerException}\n" +
"* and more {@author jay}, {@category cat}, {@deprecated}, {@exception NullPointerException}, {@version 1.1}\n" +
"* and more {@since 1.0}, {@serial 0L}, {@serialData data}, {@serialField field}\n" +
- "* @param i\n" +
+ "* @param i\n" +
"* @return value\n" +
- "* @throws NullPointerException \n" +
+ "* @throws NullPointerException \n" +
"*/\n" +
- "public int foo(int i) {\n" +
+ "public int foo(int i) {\n" +
" return 0;\n" +
- "}\n" +
+ "}\n" +
"}\n" },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * Description {@see String} , {@return int}, {@since 1.0}, {@param i}, {@throws NullPointerException}\n" +
- " ^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " * Description {@see String} , {@return int}, {@since 1.0}, {@param i}, {@throws NullPointerException}\n" +
- " ^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " * Description {@see String} , {@return int}, {@since 1.0}, {@param i}, {@throws NullPointerException}\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 3)\n" +
- " * Description {@see String} , {@return int}, {@since 1.0}, {@param i}, {@throws NullPointerException}\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 3)\n" +
- " * Description {@see String} , {@return int}, {@since 1.0}, {@param i}, {@throws NullPointerException}\n" +
- " ^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 4)\n" +
- " * and more {@author jay}, {@category cat}, {@deprecated}, {@exception NullPointerException}, {@version 1.1}\n" +
- " ^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 4)\n" +
- " * and more {@author jay}, {@category cat}, {@deprecated}, {@exception NullPointerException}, {@version 1.1}\n" +
- " ^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 4)\n" +
- " * and more {@author jay}, {@category cat}, {@deprecated}, {@exception NullPointerException}, {@version 1.1}\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 4)\n" +
- " * and more {@author jay}, {@category cat}, {@deprecated}, {@exception NullPointerException}, {@version 1.1}\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 4)\n" +
- " * and more {@author jay}, {@category cat}, {@deprecated}, {@exception NullPointerException}, {@version 1.1}\n" +
- " ^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "11. ERROR in X.java (at line 5)\n" +
- " * and more {@since 1.0}, {@serial 0L}, {@serialData data}, {@serialField field}\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "12. ERROR in X.java (at line 5)\n" +
- " * and more {@since 1.0}, {@serial 0L}, {@serialData data}, {@serialField field}\n" +
- " ^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "13. ERROR in X.java (at line 5)\n" +
- " * and more {@since 1.0}, {@serial 0L}, {@serialData data}, {@serialField field}\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "14. ERROR in X.java (at line 5)\n" +
- " * and more {@since 1.0}, {@serial 0L}, {@serialData data}, {@serialField field}\n" +
- " ^^^^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " * Description {@see String} , {@return int}, {@since 1.0}, {@param i}, {@throws NullPointerException}\n" +
+ " ^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " * Description {@see String} , {@return int}, {@since 1.0}, {@param i}, {@throws NullPointerException}\n" +
+ " ^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " * Description {@see String} , {@return int}, {@since 1.0}, {@param i}, {@throws NullPointerException}\n" +
+ " ^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 3)\n" +
+ " * Description {@see String} , {@return int}, {@since 1.0}, {@param i}, {@throws NullPointerException}\n" +
+ " ^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 3)\n" +
+ " * Description {@see String} , {@return int}, {@since 1.0}, {@param i}, {@throws NullPointerException}\n" +
+ " ^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 4)\n" +
+ " * and more {@author jay}, {@category cat}, {@deprecated}, {@exception NullPointerException}, {@version 1.1}\n" +
+ " ^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 4)\n" +
+ " * and more {@author jay}, {@category cat}, {@deprecated}, {@exception NullPointerException}, {@version 1.1}\n" +
+ " ^^^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 4)\n" +
+ " * and more {@author jay}, {@category cat}, {@deprecated}, {@exception NullPointerException}, {@version 1.1}\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 4)\n" +
+ " * and more {@author jay}, {@category cat}, {@deprecated}, {@exception NullPointerException}, {@version 1.1}\n" +
+ " ^^^^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "10. ERROR in X.java (at line 4)\n" +
+ " * and more {@author jay}, {@category cat}, {@deprecated}, {@exception NullPointerException}, {@version 1.1}\n" +
+ " ^^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "11. ERROR in X.java (at line 5)\n" +
+ " * and more {@since 1.0}, {@serial 0L}, {@serialData data}, {@serialField field}\n" +
+ " ^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "12. ERROR in X.java (at line 5)\n" +
+ " * and more {@since 1.0}, {@serial 0L}, {@serialData data}, {@serialField field}\n" +
+ " ^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "13. ERROR in X.java (at line 5)\n" +
+ " * and more {@since 1.0}, {@serial 0L}, {@serialData data}, {@serialField field}\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "14. ERROR in X.java (at line 5)\n" +
+ " * and more {@since 1.0}, {@serial 0L}, {@serialData data}, {@serialField field}\n" +
+ " ^^^^^^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
"----------\n");
}
@@ -8607,11 +8607,11 @@ public void testBug281609a() {
"}\n"
},
// warning - Tag @see: reference not found: PKG
- "----------\n" +
- "1. ERROR in pkg\\X.java (at line 7)\n" +
- " * @see PKG\n" +
- " ^^^\n" +
- "Javadoc: PKG cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in pkg\\X.java (at line 7)\n" +
+ " * @see PKG\n" +
+ " ^^^\n" +
+ "Javadoc: PKG cannot be resolved to a type\n" +
"----------\n"
);
}
@@ -8722,11 +8722,11 @@ public void testBug222188a() {
};
runNegativeTest(units,
// warning - Tag @link: reference not found: Test.Inner
- "----------\n" +
- "1. ERROR in pack2\\X.java (at line 5)\n" +
- " * See also {@link Test.Inner} -- error/warning \n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
+ "----------\n" +
+ "1. ERROR in pack2\\X.java (at line 5)\n" +
+ " * See also {@link Test.Inner} -- error/warning \n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Invalid member type qualification\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
);
@@ -8751,11 +8751,11 @@ public void testBug222188b() {
};
runNegativeTest(units,
// warning - Tag @link: reference not found: Test.Inner
- "----------\n" +
- "1. ERROR in pack2\\X.java (at line 4)\n" +
- " * See also {@link pack.Test.Inners} -- error/warning \n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Javadoc: pack.Test.Inners cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in pack2\\X.java (at line 4)\n" +
+ " * See also {@link pack.Test.Inners} -- error/warning \n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: pack.Test.Inners cannot be resolved to a type\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
);
@@ -8770,9 +8770,9 @@ public void testBug221539a() {
String[] units = new String[] {
"p/Test.java",
"package p;\n" +
- "/**\n" +
- " * {@link Test.Inner} not ok for Javadoc\n" +
- " * {@link Foo.Inner} ok for Javadoc\n" +
+ "/**\n" +
+ " * {@link Test.Inner} not ok for Javadoc\n" +
+ " * {@link Foo.Inner} ok for Javadoc\n" +
" */\n" +
"public class Test extends Foo {\n" +
"}\n"
@@ -8785,11 +8785,11 @@ public void testBug221539a() {
};
runNegativeTest(units,
// warning - Tag @link: reference not found: Test.Inner
- "----------\n" +
- "1. ERROR in p\\Test.java (at line 3)\n" +
- " * {@link Test.Inner} not ok for Javadoc\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
+ "----------\n" +
+ "1. ERROR in p\\Test.java (at line 3)\n" +
+ " * {@link Test.Inner} not ok for Javadoc\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Invalid member type qualification\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
);
@@ -8799,11 +8799,11 @@ public void testBug221539b() {
String[] units = new String[] {
"p1/Test.java",
"package p1;\n" +
- "import p2.Foo;\n" +
- "/**\n" +
- " * {@link Test.Inner} not ok for Javadoc\n" +
- " * {@link Foo.Inner} not ok Javadoc\n" +
- " * {@link p2.Foo.Inner} ok for Javadoc as fully qualified\n" +
+ "import p2.Foo;\n" +
+ "/**\n" +
+ " * {@link Test.Inner} not ok for Javadoc\n" +
+ " * {@link Foo.Inner} not ok Javadoc\n" +
+ " * {@link p2.Foo.Inner} ok for Javadoc as fully qualified\n" +
" */\n" +
"public class Test extends Foo {\n" +
"}\n"
@@ -8817,16 +8817,16 @@ public void testBug221539b() {
runNegativeTest(units,
// warning - Tag @link: reference not found: Test.Inner
// warning - Tag @link: reference not found: Foo.Inner
- "----------\n" +
- "1. ERROR in p1\\Test.java (at line 4)\n" +
- " * {@link Test.Inner} not ok for Javadoc\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "2. ERROR in p1\\Test.java (at line 5)\n" +
- " * {@link Foo.Inner} not ok Javadoc\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
+ "----------\n" +
+ "1. ERROR in p1\\Test.java (at line 4)\n" +
+ " * {@link Test.Inner} not ok for Javadoc\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Invalid member type qualification\n" +
+ "----------\n" +
+ "2. ERROR in p1\\Test.java (at line 5)\n" +
+ " * {@link Foo.Inner} not ok Javadoc\n" +
+ " ^^^^^^^^^\n" +
+ "Javadoc: Invalid member type qualification\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
);
@@ -8839,23 +8839,23 @@ public void testBug221539c() {
new String[] {
"pack/Test.java",
"package pack;\n" +
- "/**\n" +
- " * @see Inner.Level2.Level3\n" +
- " * @see Test.Inner.Level2.Level3\n" +
- " */\n" +
- "public class Test {\n" +
- " public class Inner {\n" +
- " /**\n" +
- " * @see Level3\n" +
- " * @see Level2.Level3\n" +
- " * @see Inner.Level2.Level3\n" +
- " * @see Test.Inner.Level2.Level3\n" +
- " */\n" +
- " public class Level2 {\n" +
- " class Level3 {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "/**\n" +
+ " * @see Inner.Level2.Level3\n" +
+ " * @see Test.Inner.Level2.Level3\n" +
+ " */\n" +
+ "public class Test {\n" +
+ " public class Inner {\n" +
+ " /**\n" +
+ " * @see Level3\n" +
+ " * @see Level2.Level3\n" +
+ " * @see Inner.Level2.Level3\n" +
+ " * @see Test.Inner.Level2.Level3\n" +
+ " */\n" +
+ " public class Level2 {\n" +
+ " class Level3 {\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
}
);
@@ -8877,7 +8877,7 @@ public void testBug382606() {
"class B {\n"+
" B() {}\n"+
"\n"+
- " public void foo(){\n"+
+ " public void foo(){\n"+
" new B();\n"+
" }\n"+
"}\n"
@@ -8911,13 +8911,13 @@ public void testBug206345a() {
this.reportMissingJavadocDescription = CompilerOptions.ALL_STANDARD_TAGS;
runNegativeTest(units,
//warning - Tag @link: reference not found: expected_error
- "----------\n" +
- "1. ERROR in pkg\\X.java (at line 7)\r\n" +
- " * {@link expected_error}\r\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Javadoc: expected_error cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in pkg\\X.java (at line 7)\r\n" +
+ " * {@link expected_error}\r\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Javadoc: expected_error cannot be resolved to a type\n" +
"----------\n");
-}
+}
public void testBug206345b() {
// same for @code tags
String[] units = new String[] {
@@ -8940,13 +8940,13 @@ public void testBug206345b() {
this.reportMissingJavadocDescription = CompilerOptions.ALL_STANDARD_TAGS;
runNegativeTest(units,
// warning - Tag @link: reference not found: expected_error
- "----------\n" +
- "1. ERROR in pkg\\X.java (at line 7)\r\n" +
- " * {@link expected_error}\r\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Javadoc: expected_error cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in pkg\\X.java (at line 7)\r\n" +
+ " * {@link expected_error}\r\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Javadoc: expected_error cannot be resolved to a type\n" +
"----------\n");
-}
+}
public void testBug206345c() {
// verify we still validate other syntax
String[] units = new String[] {
@@ -8971,28 +8971,28 @@ public void testBug206345c() {
// warning - Tag @link: reference not found: raw text: {@link BadLink} is just text
// warning - Tag @link: reference not found: expected_error
//
- "----------\n" +
- "1. ERROR in pkg\\X.java (at line 5)\n" +
- " * This is {@link raw text:\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing closing brace for inline tag\n" +
- "----------\n" +
- "2. ERROR in pkg\\X.java (at line 5)\n" +
- " * This is {@link raw text:\n" +
- " ^^^\n" +
- "Javadoc: raw cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in pkg\\X.java (at line 6)\n" +
- " * {@link BadLink} is just text}\n" +
- " ^^^^^^^\n" +
- "Javadoc: BadLink cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in pkg\\X.java (at line 7)\n" +
- " * {@link expected_error}\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Javadoc: expected_error cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in pkg\\X.java (at line 5)\n" +
+ " * This is {@link raw text:\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Missing closing brace for inline tag\n" +
+ "----------\n" +
+ "2. ERROR in pkg\\X.java (at line 5)\n" +
+ " * This is {@link raw text:\n" +
+ " ^^^\n" +
+ "Javadoc: raw cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in pkg\\X.java (at line 6)\n" +
+ " * {@link BadLink} is just text}\n" +
+ " ^^^^^^^\n" +
+ "Javadoc: BadLink cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in pkg\\X.java (at line 7)\n" +
+ " * {@link expected_error}\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Javadoc: expected_error cannot be resolved to a type\n" +
"----------\n");
-}
+}
public void testBug206345d() {
String[] units = new String[] {
"pkg/X.java",
@@ -9014,13 +9014,13 @@ public void testBug206345d() {
this.reportMissingJavadocDescription = CompilerOptions.ALL_STANDARD_TAGS;
runNegativeTest(units,
// warning - Tag @link: reference not found: expected_error
- "----------\n" +
- "1. ERROR in pkg\\X.java (at line 7)\n" +
- " * {@link expected_error}\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Javadoc: expected_error cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in pkg\\X.java (at line 7)\n" +
+ " * {@link expected_error}\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Javadoc: expected_error cannot be resolved to a type\n" +
"----------\n");
-}
+}
public void testBug206345e() {
String[] units = new String[] {
"pkg/X.java",
@@ -9041,12 +9041,12 @@ public void testBug206345e() {
this.reportMissingJavadocDescription = CompilerOptions.ALL_STANDARD_TAGS;
runNegativeTest(units,
// warning - End Delimiter } missing for possible See Tag in comment string: "This is {@code raw text: {{{{{{@link BadLink}}} is just text}"
- "----------\n" +
- "1. ERROR in pkg\\X.java (at line 5)\r\n" +
- " * This is {@code raw text:\n" +
- " * {{{{{{@link BadLink}}} is just text}\r\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing closing brace for inline tag\n" +
+ "----------\n" +
+ "1. ERROR in pkg\\X.java (at line 5)\r\n" +
+ " * This is {@code raw text:\n" +
+ " * {{{{{{@link BadLink}}} is just text}\r\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Missing closing brace for inline tag\n" +
"----------\n");
}
public void testBug206345f() {
@@ -9069,12 +9069,12 @@ public void testBug206345f() {
this.reportMissingJavadocDescription = CompilerOptions.ALL_STANDARD_TAGS;
runNegativeTest(units,
// warning - End Delimiter } missing for possible See Tag in comment string: "This is {@code raw text: {@link BadLink}"
- "----------\n" +
- "1. ERROR in pkg\\X.java (at line 5)\r\n" +
- " * This is {@code raw text:\n" +
- " * {@link BadLink}\r\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing closing brace for inline tag\n" +
+ "----------\n" +
+ "1. ERROR in pkg\\X.java (at line 5)\r\n" +
+ " * This is {@code raw text:\n" +
+ " * {@link BadLink}\r\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Missing closing brace for inline tag\n" +
"----------\n");
}
public void testBug206345g() {
@@ -9096,11 +9096,11 @@ public void testBug206345g() {
this.reportInvalidJavadoc = CompilerOptions.ERROR;
this.reportMissingJavadocDescription = CompilerOptions.ALL_STANDARD_TAGS;
runNegativeTest(units,
- "----------\n" +
- "1. ERROR in pkg\\X.java (at line 5)\n" +
- " * This is {@code raw text:\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing closing brace for inline tag\n" +
+ "----------\n" +
+ "1. ERROR in pkg\\X.java (at line 5)\n" +
+ " * This is {@code raw text:\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Missing closing brace for inline tag\n" +
"----------\n");
}
public void testBug206345h() {
@@ -9121,11 +9121,11 @@ public void testBug206345h() {
this.reportInvalidJavadoc = CompilerOptions.ERROR;
this.reportMissingJavadocDescription = CompilerOptions.ALL_STANDARD_TAGS;
runNegativeTest(units,
- "----------\n" +
- "1. ERROR in pkg\\X.java (at line 5)\r\n" +
- " * This is {@code raw text:\r\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing closing brace for inline tag\n" +
+ "----------\n" +
+ "1. ERROR in pkg\\X.java (at line 5)\r\n" +
+ " * This is {@code raw text:\r\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Missing closing brace for inline tag\n" +
"----------\n");
}
public void testBug206345i() {
@@ -9145,11 +9145,11 @@ public void testBug206345i() {
this.reportInvalidJavadoc = CompilerOptions.ERROR;
this.reportMissingJavadocDescription = CompilerOptions.ALL_STANDARD_TAGS;
runNegativeTest(units,
- "----------\n" +
- "1. ERROR in pkg\\X.java (at line 5)\r\n" +
- " * This is {@code raw text:\r\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing closing brace for inline tag\n" +
+ "----------\n" +
+ "1. ERROR in pkg\\X.java (at line 5)\r\n" +
+ " * This is {@code raw text:\r\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Missing closing brace for inline tag\n" +
"----------\n");
}
public void testBug206345j() {
@@ -9170,7 +9170,7 @@ public void testBug206345j() {
this.reportInvalidJavadoc = CompilerOptions.ERROR;
this.reportMissingJavadocDescription = CompilerOptions.ALL_STANDARD_TAGS;
runConformReferenceTest(units);
-}
+}
public void testBug206345k() {
String[] units = new String[] {
"pkg/X.java",
@@ -9210,14 +9210,14 @@ public void testBug206345l() {
this.reportMissingJavadocDescription = CompilerOptions.ALL_STANDARD_TAGS;
runNegativeTest(units,
// warning - End Delimiter } missing for possible See Tag in comment string: "This is {@literal raw text: {@link BadLink}"
- "----------\n" +
- "1. ERROR in pkg\\X.java (at line 5)\n" +
- " * This is {@literal raw text:\n" +
- " * {@link BadLink}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing closing brace for inline tag\n" +
+ "----------\n" +
+ "1. ERROR in pkg\\X.java (at line 5)\n" +
+ " * This is {@literal raw text:\n" +
+ " * {@link BadLink}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Missing closing brace for inline tag\n" +
"----------\n");
-}
+}
public void testBug206345m() {
String[] units = new String[] {
"pkg/X.java",
@@ -9237,12 +9237,12 @@ public void testBug206345m() {
this.reportMissingJavadocDescription = CompilerOptions.ALL_STANDARD_TAGS;
runNegativeTest(units,
// warning - End Delimiter } missing for possible See Tag in comment string: "This is {@code raw text: {@link BadLink}"
- "----------\n" +
- "1. ERROR in pkg\\X.java (at line 5)\n" +
- " * This is {@code raw text:\n" +
- " * {@link BadLink}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing closing brace for inline tag\n" +
+ "----------\n" +
+ "1. ERROR in pkg\\X.java (at line 5)\n" +
+ " * This is {@code raw text:\n" +
+ " * {@link BadLink}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Missing closing brace for inline tag\n" +
"----------\n");
}
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest.java
index 4dab409af..5f04d858f 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest.java
@@ -280,50 +280,50 @@ public abstract class JavadocTest extends AbstractRegressionTest {
// The fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=201912 results in these additional
// diagnostics to be generated. Just as we arrange for the ``referencedClasses'' to be compiled
// automatically, we need to include these diagnostics automatically in the expected messages.
- static String expectedDiagnosticsFromReferencedClasses =
- "----------\n" +
- "1. WARNING in test\\AbstractVisibility.java (at line 5)\n" +
- " public int avf_public = avf_private;\n" +
- " ^^^^^^^^^^\n" +
- "The value of the field AbstractVisibility.AvcPrivate.avf_public is not used\n" +
- "----------\n" +
- "2. WARNING in test\\AbstractVisibility.java (at line 10)\n" +
- " public int avm_public() {\n" +
- " ^^^^^^^^^^^^\n" +
- "The method avm_public() from the type AbstractVisibility.AvcPrivate is never used locally\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in test\\Visibility.java (at line 5)\n" +
- " public int vf_public = vf_private;\n" +
- " ^^^^^^^^^\n" +
- "The value of the field Visibility.VcPrivate.vf_public is not used\n" +
- "----------\n" +
- "2. WARNING in test\\Visibility.java (at line 11)\n" +
- " public int vm_public() {\n" +
- " ^^^^^^^^^^^\n" +
- "The method vm_public() from the type Visibility.VcPrivate is never used locally\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in test\\copy\\VisibilityPackage.java (at line 5)\n" +
- " public int vf_public = vf_private;\n" +
- " ^^^^^^^^^\n" +
- "The value of the field VisibilityPackage.VpPrivate.vf_public is not used\n" +
- "----------\n" +
- "2. WARNING in test\\copy\\VisibilityPackage.java (at line 10)\n" +
- " public int vm_public() {\n" +
- " ^^^^^^^^^^^\n" +
- "The method vm_public() from the type VisibilityPackage.VpPrivate is never used locally\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in test\\copy\\VisibilityPublic.java (at line 5)\n" +
- " public int vf_public = vf_private;\n" +
- " ^^^^^^^^^\n" +
- "The value of the field VisibilityPublic.VpPrivate.vf_public is not used\n" +
- "----------\n" +
- "2. WARNING in test\\copy\\VisibilityPublic.java (at line 10)\n" +
- " public int vm_public() {\n" +
- " ^^^^^^^^^^^\n" +
- "The method vm_public() from the type VisibilityPublic.VpPrivate is never used locally\n" +
+ static String expectedDiagnosticsFromReferencedClasses =
+ "----------\n" +
+ "1. WARNING in test\\AbstractVisibility.java (at line 5)\n" +
+ " public int avf_public = avf_private;\n" +
+ " ^^^^^^^^^^\n" +
+ "The value of the field AbstractVisibility.AvcPrivate.avf_public is not used\n" +
+ "----------\n" +
+ "2. WARNING in test\\AbstractVisibility.java (at line 10)\n" +
+ " public int avm_public() {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The method avm_public() from the type AbstractVisibility.AvcPrivate is never used locally\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in test\\Visibility.java (at line 5)\n" +
+ " public int vf_public = vf_private;\n" +
+ " ^^^^^^^^^\n" +
+ "The value of the field Visibility.VcPrivate.vf_public is not used\n" +
+ "----------\n" +
+ "2. WARNING in test\\Visibility.java (at line 11)\n" +
+ " public int vm_public() {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method vm_public() from the type Visibility.VcPrivate is never used locally\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in test\\copy\\VisibilityPackage.java (at line 5)\n" +
+ " public int vf_public = vf_private;\n" +
+ " ^^^^^^^^^\n" +
+ "The value of the field VisibilityPackage.VpPrivate.vf_public is not used\n" +
+ "----------\n" +
+ "2. WARNING in test\\copy\\VisibilityPackage.java (at line 10)\n" +
+ " public int vm_public() {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method vm_public() from the type VisibilityPackage.VpPrivate is never used locally\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in test\\copy\\VisibilityPublic.java (at line 5)\n" +
+ " public int vf_public = vf_private;\n" +
+ " ^^^^^^^^^\n" +
+ "The value of the field VisibilityPublic.VpPrivate.vf_public is not used\n" +
+ "----------\n" +
+ "2. WARNING in test\\copy\\VisibilityPublic.java (at line 10)\n" +
+ " public int vm_public() {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method vm_public() from the type VisibilityPublic.VpPrivate is never used locally\n" +
"----------\n";
/* (non-Javadoc)
* @see junit.framework.TestCase#setUp()
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForClass.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForClass.java
index 058fa36ef..ce0222e5d 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForClass.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForClass.java
@@ -571,7 +571,7 @@ public class JavadocTestForClass extends JavadocTest {
+ " * @see VisibilityPackage#unknown Invalid ref to non existent field of other package non visible class\n"
+ " * @see VisibilityPublic#unknown Invalid ref to non existent field of other package class\n"
+ " * @see VisibilityPublic#vf_private Invalid ref to not visible field of other package class\n"
- + " * @see VisibilityPublic.VpPrivate#unknown Invalid ref to a non visible other package private inner class (non existent field)\n"
+ + " * @see VisibilityPublic.VpPrivate#unknown Invalid ref to a non visible other package private inner class (non existent field)\n"
+ " * @see VisibilityPublic.VpPublic#unknown Invalid ref to non existent field of other package public inner class\n"
+ " * @see VisibilityPublic.VpPublic#vf_private Invalid ref to not visible field of other package public inner class\n"
+ " */\n"
@@ -1007,83 +1007,83 @@ public class JavadocTestForClass extends JavadocTest {
+ " }\n"
+ "}\n" });
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=253750
public void test054() {
if (this.complianceLevel < ClassFileConstants.JDK1_5) {
runNegativeTest(
new String[] {
"X.java",
- "import java.util.Map;\n" +
- "import java.util.Map.Entry;\n" +
- "\n" +
- "/**\n" +
- " * <ul>\n" +
- " * <li> {@link Entry} </li>\n" +
- " * </ul>\n" +
- " */\n" +
- "public interface X extends Map {\n" +
+ "import java.util.Map;\n" +
+ "import java.util.Map.Entry;\n" +
+ "\n" +
+ "/**\n" +
+ " * <ul>\n" +
+ " * <li> {@link Entry} </li>\n" +
+ " * </ul>\n" +
+ " */\n" +
+ "public interface X extends Map {\n" +
" int i = 0;\n" +
"}\n",
},
- "----------\n" +
+ "----------\n" +
"1. WARNING in X.java (at line 2)\n"+
" import java.util.Map.Entry;\n"+
" ^^^^^^^^^^^^^^^^^^^\n"+
"The import java.util.Map.Entry is never used\n"+
"----------\n"+
- "2. ERROR in X.java (at line 6)\n" +
- " * <li> {@link Entry} </li>\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " * <li> {@link Entry} </li>\n" +
+ " ^^^^^\n" +
+ "Javadoc: Invalid member type qualification\n" +
"----------\n");
return;
}
runNegativeTest(
new String[] {
"X.java",
- "import java.util.Map;\n" +
- "import java.util.Map.Entry;\n" +
- "\n" +
- "/**\n" +
- " * <ul>\n" +
- " * <li> {@link Entry} </li>\n" +
- " * </ul>\n" +
- " */\n" +
- "public interface X extends Map {\n" +
+ "import java.util.Map;\n" +
+ "import java.util.Map.Entry;\n" +
+ "\n" +
+ "/**\n" +
+ " * <ul>\n" +
+ " * <li> {@link Entry} </li>\n" +
+ " * </ul>\n" +
+ " */\n" +
+ "public interface X extends Map {\n" +
" int i;\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " int i;\n" +
- " ^\n" +
- "The blank final field i may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " int i;\n" +
+ " ^\n" +
+ "The blank final field i may not have been initialized\n" +
"----------\n");
- }
+ }
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=253750 - variation
public void test055() {
runNegativeTest(
new String[] {
"X.java",
- "import java.util.Map;\n" +
- "\n" +
- "/**\n" +
- " * <ul>\n" +
- " * <li> {@link Entry} </li>\n" +
- " * </ul>\n" +
- " */\n" +
- "public interface X extends Map {\n" +
- " Entry e = null;\n" +
+ "import java.util.Map;\n" +
+ "\n" +
+ "/**\n" +
+ " * <ul>\n" +
+ " * <li> {@link Entry} </li>\n" +
+ " * </ul>\n" +
+ " */\n" +
+ "public interface X extends Map {\n" +
+ " Entry e = null;\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " * <li> {@link Entry} </li>\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " * <li> {@link Entry} </li>\n" +
+ " ^^^^^\n" +
+ "Javadoc: Invalid member type qualification\n" +
"----------\n");
- }
+ }
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=253750
public void test056() {
@@ -1091,51 +1091,51 @@ public class JavadocTestForClass extends JavadocTest {
runNegativeTest(
new String[] {
"X.java",
- "import java.util.Map;\n" +
- "import java.util.Map.Entry;\n" +
- "\n" +
- "/**\n" +
- " * <ul>\n" +
- " * <li> {@link Entry} </li>\n" +
- " * </ul>\n" +
- " */\n" +
- "public interface X extends Map {\n" +
- " Entry e = null;\n" +
+ "import java.util.Map;\n" +
+ "import java.util.Map.Entry;\n" +
+ "\n" +
+ "/**\n" +
+ " * <ul>\n" +
+ " * <li> {@link Entry} </li>\n" +
+ " * </ul>\n" +
+ " */\n" +
+ "public interface X extends Map {\n" +
+ " Entry e = null;\n" +
"}\n",
},
- "----------\n" +
+ "----------\n" +
"1. WARNING in X.java (at line 2)\n"+
" import java.util.Map.Entry;\n"+
" ^^^^^^^^^^^^^^^^^^^\n"+
"The import java.util.Map.Entry is never used\n"+
"----------\n"+
- "2. ERROR in X.java (at line 6)\n" +
- " * <li> {@link Entry} </li>\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " * <li> {@link Entry} </li>\n" +
+ " ^^^^^\n" +
+ "Javadoc: Invalid member type qualification\n" +
"----------\n");
return;
}
runNegativeTest(
new String[] {
"X.java",
- "import java.util.Map;\n" +
- "import java.util.Map.Entry;\n" +
- "\n" +
- "/**\n" +
- " * <ul>\n" +
- " * <li> {@link Entry} </li>\n" +
- " * </ul>\n" +
- " */\n" +
- "public interface X extends Map {\n" +
- " Entry e;\n" +
+ "import java.util.Map;\n" +
+ "import java.util.Map.Entry;\n" +
+ "\n" +
+ "/**\n" +
+ " * <ul>\n" +
+ " * <li> {@link Entry} </li>\n" +
+ " * </ul>\n" +
+ " */\n" +
+ "public interface X extends Map {\n" +
+ " Entry e;\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " Entry e;\n" +
- " ^\n" +
- "The blank final field e may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " Entry e;\n" +
+ " ^\n" +
+ "The blank final field e may not have been initialized\n" +
"----------\n");
- }
+ }
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForConstructor.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForConstructor.java
index bd0f7f111..14edbf175 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForConstructor.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForConstructor.java
@@ -511,7 +511,7 @@ public class JavadocTestForConstructor extends JavadocTest {
+ " * @see VisibilityPackage#unknown Invalid ref to non existent field of other package non visible class\n"
+ " * @see VisibilityPublic#unknown Invalid ref to non existent field of other package class\n"
+ " * @see VisibilityPublic#vf_private Invalid ref to not visible field of other package class\n"
- + " * @see VisibilityPublic.VpPrivate#unknown Invalid ref to a non visible other package private inner class (non existent field)\n"
+ + " * @see VisibilityPublic.VpPrivate#unknown Invalid ref to a non visible other package private inner class (non existent field)\n"
+ " * @see VisibilityPublic.VpPublic#unknown Invalid ref to non existent field of other package public inner class\n"
+ " * @see VisibilityPublic.VpPublic#vf_private Invalid ref to not visible field of other package public inner class\n"
+ " */\n"
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForField.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForField.java
index 62c2a2fc1..f45f396b2 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForField.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForField.java
@@ -1033,12 +1033,12 @@ public class JavadocTestForField extends JavadocTest {
+ " public int x;\n"
+ "}\n" });
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=451418, [1.8][compiler] NPE at ParameterizedGenericMethodBinding.computeCompatibleMethod18
public void test451418() {
if (this.complianceLevel < ClassFileConstants.JDK1_5)
return;
-
+
runNegativeTest(
new String[] {
"X.java",
@@ -1050,11 +1050,11 @@ public class JavadocTestForField extends JavadocTest {
" public int i;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public static <T> FieldSet<T> emptySet() { return null; }\n" +
- " ^^^^^^^^\n" +
- "FieldSet cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public static <T> FieldSet<T> emptySet() { return null; }\n" +
+ " ^^^^^^^^\n" +
+ "FieldSet cannot be resolved to a type\n" +
"----------\n");
}
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForInterface.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForInterface.java
index 1d57c014c..8e878869d 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForInterface.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForInterface.java
@@ -539,7 +539,7 @@ public class JavadocTestForInterface extends JavadocTest {
+ " * @see VisibilityPackage#unknown Invalid ref to non existent field of other package non visible class\n"
+ " * @see VisibilityPublic#unknown Invalid ref to non existent field of other package class\n"
+ " * @see VisibilityPublic#vf_private Invalid ref to not visible field of other package class\n"
- + " * @see VisibilityPublic.VpPrivate#unknown Invalid ref to a non visible other package private inner class (non existent field)\n"
+ + " * @see VisibilityPublic.VpPrivate#unknown Invalid ref to a non visible other package private inner class (non existent field)\n"
+ " * @see VisibilityPublic.VpPublic#unknown Invalid ref to non existent field of other package public inner class\n"
+ " * @see VisibilityPublic.VpPublic#vf_private Invalid ref to not visible field of other package public inner class\n"
+ " */\n"
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForMethod.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForMethod.java
index 5b6690922..5ceac32f9 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForMethod.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForMethod.java
@@ -1984,21 +1984,21 @@ public class JavadocTestForMethod extends JavadocTest {
+ " public void s_foo() {\n"
+ " }\n"
+ "}\n" },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " * @see <a xref=\"http://download.oracle.com/javase/6/docs/technotes/tools/windows/javadoc.html\">Invalid URL link reference</a>\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " * @see <b href=\"http://download.oracle.com/javase/6/docs/technotes/tools/windows/javadoc.html\">Invalid URL link reference</a>\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " * @see <a href=\"http://download.oracle.com/javase/6/docs/technotes/tools/windows/javadoc.html\">Invalid URL link reference</b>\n" +
- " ^^^^\n" +
- "Javadoc: Malformed link reference\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " * @see <a xref=\"http://download.oracle.com/javase/6/docs/technotes/tools/windows/javadoc.html\">Invalid URL link reference</a>\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Malformed link reference\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " * @see <b href=\"http://download.oracle.com/javase/6/docs/technotes/tools/windows/javadoc.html\">Invalid URL link reference</a>\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Malformed link reference\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " * @see <a href=\"http://download.oracle.com/javase/6/docs/technotes/tools/windows/javadoc.html\">Invalid URL link reference</b>\n" +
+ " ^^^^\n" +
+ "Javadoc: Malformed link reference\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForRecord.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForRecord.java
index 844a51b24..b1f521993 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForRecord.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForRecord.java
@@ -99,7 +99,7 @@ public class JavadocTestForRecord extends JavadocTest {
}
/*
* (non-Javadoc)
- *
+ *
* @see junit.framework.TestCase#setUp()
*/
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java
index 9fa8fee15..ab0530f72 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java
@@ -678,18 +678,18 @@ public class JavadocTest_1_3 extends JavadocTest {
" ^\n" +
"Syntax error, insert \"ClassBody\" to complete CompilationUnit\n" +
:giro */
- " ^^^^^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " public class X<T, , V> {}\n" +
- " ^\n" +
- "Syntax error, insert \"Identifier\" to complete TypeParameter\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 7)\n" +
- " public class X<T, , V> {}\n" +
- " ^\n" +
- "Syntax error, insert \"ClassBody\" to complete CompilationUnit\n" +
+ " ^^^^^^^^^^\n" +
+ "Syntax error on tokens, delete these tokens\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 7)\n" +
+ " public class X<T, , V> {}\n" +
+ " ^\n" +
+ "Syntax error, insert \"Identifier\" to complete TypeParameter\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 7)\n" +
+ " public class X<T, , V> {}\n" +
+ " ^\n" +
+ "Syntax error, insert \"ClassBody\" to complete CompilationUnit\n" +
// SH}
"----------\n"
);
@@ -739,24 +739,24 @@ public class JavadocTest_1_3 extends JavadocTest {
" public class X<T, U, V extend Exception> {}\n" +
" ^^^^^^\n" +
"extend cannot be resolved to a type\n" +
- :giro */
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " public class X<T, U, V extend Exception> {}\n" +
- " ^\n" +
- "Syntax error, insert \"Identifier\" to complete TypeParameter\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 7)\n" +
- " public class X<T, U, V extend Exception> {}\n" +
- " ^\n" +
- "V cannot be resolved to a type\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 7)\n" +
- " public class X<T, U, V extend Exception> {}\n" +
- " ^\n" +
- "Syntax error, insert \"ClassBody\" to complete CompilationUnit\n" +
+ :giro */
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error on tokens, delete these tokens\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 7)\n" +
+ " public class X<T, U, V extend Exception> {}\n" +
+ " ^\n" +
+ "Syntax error, insert \"Identifier\" to complete TypeParameter\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 7)\n" +
+ " public class X<T, U, V extend Exception> {}\n" +
+ " ^\n" +
+ "V cannot be resolved to a type\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 7)\n" +
+ " public class X<T, U, V extend Exception> {}\n" +
+ " ^\n" +
+ "Syntax error, insert \"ClassBody\" to complete CompilationUnit\n" +
// SH}
"----------\n"
);
@@ -1330,31 +1330,31 @@ public class JavadocTest_1_3 extends JavadocTest {
" public <T, U, V extends Exceptions> void foo(int val, Object obj) {}\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <T> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @param <V> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " * @param <U> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " public <T, U, V extends Exceptions> void foo(int val, Object obj) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 10)\n" +
- " public <T, U, V extends Exceptions> void foo(int val, Object obj) {}\n" +
- " ^^^^^^^^^^\n" +
- "Exceptions cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " * @param <T> Type parameter 2\n" +
+ " ^^^\n" +
+ "Javadoc: Invalid param tag name\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " * @param <V> Type parameter 2\n" +
+ " ^^^\n" +
+ "Javadoc: Invalid param tag name\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " * @param <U> Type parameter 1\n" +
+ " ^^^\n" +
+ "Javadoc: Invalid param tag name\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 10)\n" +
+ " public <T, U, V extends Exceptions> void foo(int val, Object obj) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 10)\n" +
+ " public <T, U, V extends Exceptions> void foo(int val, Object obj) {}\n" +
+ " ^^^^^^^^^^\n" +
+ "Exceptions cannot be resolved to a type\n" +
"----------\n"
);
}
@@ -1485,21 +1485,21 @@ public class JavadocTest_1_3 extends JavadocTest {
" G(E e) {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " * @see G#G(Object)\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The constructor G(Object) is undefined\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public class X extends G<Exception> {\n" +
- " ^^^^^^^^^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " class G<E extends Exception> {\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " * @see G#G(Object)\n" +
+ " ^^^^^^^^^\n" +
+ "Javadoc: The constructor G(Object) is undefined\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " public class X extends G<Exception> {\n" +
+ " ^^^^^^^^^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " class G<E extends Exception> {\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
"----------\n"
);
}
@@ -1530,31 +1530,31 @@ public class JavadocTest_1_3 extends JavadocTest {
" public void testCompareTo() {}\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public static <T extends Comparable< ? super T>> int compareTo(final Object first, final Object firstPrime, final Class<T> type) throws ClassCastException\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " public static <T extends Comparable< ? super T>> int compareTo(final Object first, final Object firstPrime, final Class<T> type) throws ClassCastException\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " public static <X extends Comparable< ? super X>> int compareTo(final X first, final X firstPrime)\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 6)\n" +
- " public static <X extends Comparable< ? super X>> int compareTo(final X first, final X firstPrime)\n" +
- " ^\n" +
- "The type parameter X is hiding the type X\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 14)\n" +
- " * {@link ComparableUtils#compareTo(Object, Object)}.\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The method compareTo(Object, Object, Class<T>) in the type ComparableUtils is not applicable for the arguments (Object, Object)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public static <T extends Comparable< ? super T>> int compareTo(final Object first, final Object firstPrime, final Class<T> type) throws ClassCastException\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " public static <T extends Comparable< ? super T>> int compareTo(final Object first, final Object firstPrime, final Class<T> type) throws ClassCastException\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " public static <X extends Comparable< ? super X>> int compareTo(final X first, final X firstPrime)\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 6)\n" +
+ " public static <X extends Comparable< ? super X>> int compareTo(final X first, final X firstPrime)\n" +
+ " ^\n" +
+ "The type parameter X is hiding the type X\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 14)\n" +
+ " * {@link ComparableUtils#compareTo(Object, Object)}.\n" +
+ " ^^^^^^^^^\n" +
+ "Javadoc: The method compareTo(Object, Object, Class<T>) in the type ComparableUtils is not applicable for the arguments (Object, Object)\n" +
"----------\n");
}
@@ -1593,41 +1593,41 @@ public class JavadocTest_1_3 extends JavadocTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Test#add(T) \n" +
- " ^^^\n" +
- "Javadoc: The method add(Object) in the type Test is not applicable for the arguments (T)\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see #add(T)\n" +
- " ^^^\n" +
- "Javadoc: The method add(Object) in the type Test is not applicable for the arguments (T)\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 4)\n" +
- " * @see Test#Test(T)\n" +
- " ^^^^^^^\n" +
- "Javadoc: The constructor Test(T) is undefined\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 5)\n" +
- " * @see #Test(T)\n" +
- " ^^^^^^^\n" +
- "Javadoc: The constructor Test(T) is undefined\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 11)\n" +
- " public class Test<T> {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "6. ERROR in Test.java (at line 18)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "7. ERROR in Test.java (at line 18)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 2)\n" +
+ " * @see Test#add(T) \n" +
+ " ^^^\n" +
+ "Javadoc: The method add(Object) in the type Test is not applicable for the arguments (T)\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 3)\n" +
+ " * @see #add(T)\n" +
+ " ^^^\n" +
+ "Javadoc: The method add(Object) in the type Test is not applicable for the arguments (T)\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 4)\n" +
+ " * @see Test#Test(T)\n" +
+ " ^^^^^^^\n" +
+ "Javadoc: The constructor Test(T) is undefined\n" +
+ "----------\n" +
+ "4. ERROR in Test.java (at line 5)\n" +
+ " * @see #Test(T)\n" +
+ " ^^^^^^^\n" +
+ "Javadoc: The constructor Test(T) is undefined\n" +
+ "----------\n" +
+ "5. ERROR in Test.java (at line 11)\n" +
+ " public class Test<T> {\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "6. ERROR in Test.java (at line 18)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "7. ERROR in Test.java (at line 18)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
"----------\n");
}
public void testBug83127b() {
@@ -1661,31 +1661,31 @@ public class JavadocTest_1_3 extends JavadocTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Sub#add(T)\n" +
- " ^^^\n" +
- "Javadoc: The method add(Object) in the type Test is not applicable for the arguments (T)\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Sub#Sub(T)\n" +
- " ^^^^^^\n" +
- "Javadoc: The constructor Sub(T) is undefined\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 11)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 18)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 18)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 2)\n" +
+ " * @see Sub#add(T)\n" +
+ " ^^^\n" +
+ "Javadoc: The method add(Object) in the type Test is not applicable for the arguments (T)\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 3)\n" +
+ " * @see Sub#Sub(T)\n" +
+ " ^^^^^^\n" +
+ "Javadoc: The constructor Sub(T) is undefined\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 11)\n" +
+ " public class Test<T>{\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "4. ERROR in Test.java (at line 18)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "5. ERROR in Test.java (at line 18)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
"----------\n");
}
public void testBug83127c() {
@@ -1716,31 +1716,31 @@ public class JavadocTest_1_3 extends JavadocTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Sub#add(E) \n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Sub#Sub(E)\n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 8)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 2)\n" +
+ " * @see Sub#add(E) \n" +
+ " ^\n" +
+ "Javadoc: E cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 3)\n" +
+ " * @see Sub#Sub(E)\n" +
+ " ^\n" +
+ "Javadoc: E cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 8)\n" +
+ " public class Test<T>{\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "4. ERROR in Test.java (at line 15)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "5. ERROR in Test.java (at line 15)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
"----------\n");
}
public void testBug83127d() {
@@ -1776,37 +1776,37 @@ public class JavadocTest_1_3 extends JavadocTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Unrelated1.java (at line 1)\n" +
- " public class Unrelated1<E extends Number> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Unrelated1#add(E)\n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Unrelated1#Unrelated1(E)\n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 8)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in Unrelated1.java (at line 1)\n" +
+ " public class Unrelated1<E extends Number> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 2)\n" +
+ " * @see Unrelated1#add(E)\n" +
+ " ^\n" +
+ "Javadoc: E cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 3)\n" +
+ " * @see Unrelated1#Unrelated1(E)\n" +
+ " ^\n" +
+ "Javadoc: E cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 8)\n" +
+ " public class Test<T>{\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "4. ERROR in Test.java (at line 15)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "5. ERROR in Test.java (at line 15)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
"----------\n");
}
public void testBug83127e() {
@@ -1842,37 +1842,37 @@ public class JavadocTest_1_3 extends JavadocTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Unrelated1.java (at line 1)\n" +
- " public class Unrelated1<E extends Number> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Unrelated1#add(Object)\n" +
- " ^^^\n" +
- "Javadoc: The method add(Number) in the type Unrelated1 is not applicable for the arguments (Object)\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Unrelated1#Unrelated1(Object)\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The constructor Unrelated1(Object) is undefined\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 9)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in Unrelated1.java (at line 1)\n" +
+ " public class Unrelated1<E extends Number> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 2)\n" +
+ " * @see Unrelated1#add(Object)\n" +
+ " ^^^\n" +
+ "Javadoc: The method add(Number) in the type Unrelated1 is not applicable for the arguments (Object)\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 3)\n" +
+ " * @see Unrelated1#Unrelated1(Object)\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: The constructor Unrelated1(Object) is undefined\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 9)\n" +
+ " public class Test<T>{\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "4. ERROR in Test.java (at line 15)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "5. ERROR in Test.java (at line 15)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
"----------\n");
}
public void testBug83127f() {
@@ -1907,27 +1907,27 @@ public class JavadocTest_1_3 extends JavadocTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Unrelated1.java (at line 1)\n" +
- " public class Unrelated1<E extends Number> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Test.java (at line 8)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 14)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 14)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in Unrelated1.java (at line 1)\n" +
+ " public class Unrelated1<E extends Number> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 8)\n" +
+ " public class Test<T>{\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 14)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 14)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
"----------\n"
);
}
@@ -1965,37 +1965,37 @@ public class JavadocTest_1_3 extends JavadocTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Unrelated1.java (at line 1)\n" +
- " public class Unrelated1<E extends Number> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Unrelated1#add(Integer)\n" +
- " ^^^\n" +
- "Javadoc: The method add(Number) in the type Unrelated1 is not applicable for the arguments (Integer)\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Unrelated1#Unrelated1(Integer)\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The constructor Unrelated1(Integer) is undefined\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 9)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 16)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 16)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in Unrelated1.java (at line 1)\n" +
+ " public class Unrelated1<E extends Number> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 2)\n" +
+ " * @see Unrelated1#add(Integer)\n" +
+ " ^^^\n" +
+ "Javadoc: The method add(Number) in the type Unrelated1 is not applicable for the arguments (Integer)\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 3)\n" +
+ " * @see Unrelated1#Unrelated1(Integer)\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: The constructor Unrelated1(Integer) is undefined\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 9)\n" +
+ " public class Test<T>{\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "4. ERROR in Test.java (at line 16)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "5. ERROR in Test.java (at line 16)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
"----------\n"
);
}
@@ -2033,32 +2033,32 @@ public class JavadocTest_1_3 extends JavadocTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Unrelated2.java (at line 1)\n" +
- " public interface Unrelated2<E> {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Unrelated2#add(T)\n" +
- " ^^^\n" +
- "Javadoc: The method add(Object) in the type Unrelated2 is not applicable for the arguments (T)\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 10)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 17)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 17)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in Unrelated2.java (at line 1)\n" +
+ " public interface Unrelated2<E> {\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 2)\n" +
+ " * @see Unrelated2#add(T)\n" +
+ " ^^^\n" +
+ "Javadoc: The method add(Object) in the type Unrelated2 is not applicable for the arguments (T)\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 10)\n" +
+ " public class Test<T>{\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 17)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "4. ERROR in Test.java (at line 17)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
"----------\n");
}
@@ -2194,11 +2194,11 @@ public class JavadocTest_1_3 extends JavadocTest {
* @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=86769"
*/
public void testBug86769() {
-
+
/* Deleted a completely meaningless test that could only serve as a torture test for the parser.
The test is still run in 1.5+ modes where it makes sense to run it - The test here was a nuisance
failing every time there is some serious grammar change that alters the semi-random behavior in
- Diagnose Parser.
+ Diagnose Parser.
*/
return;
}
@@ -2339,11 +2339,11 @@ public class JavadocTest_1_3 extends JavadocTest {
" * See also {@link Inner}\n" +
" ^^^^^\n" +
"Javadoc: Invalid member type qualification\n" +
- "----------\n" +
"----------\n" +
- "1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" +
- " * @see Test.Inner\n" +
- " ^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" +
+ " * @see Test.Inner\n" +
+ " ^^^^^^^^^^\n" +
"Javadoc: Invalid member type qualification\n" +
"----------\n"
);
@@ -2666,12 +2666,12 @@ public class JavadocTest_1_3 extends JavadocTest {
" * See also {@link Inner}\n" +
" ^^^^^\n" +
"Javadoc: Invalid member type qualification\n" +
- "----------\n" +
"----------\n" +
- "1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" +
- " * @see Test.Inner\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
+ "----------\n" +
+ "1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" +
+ " * @see Test.Inner\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Invalid member type qualification\n" +
"----------\n"
);
}
@@ -2870,51 +2870,51 @@ public class JavadocTest_1_3 extends JavadocTest {
" */\n" +
"class G<T> {}\n"
},
- "----------\n" +
- "1. ERROR in test\\X.java (at line 8)\n" +
- " public <T> G<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "2. ERROR in test\\X.java (at line 8)\n" +
- " public <T> G<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "3. ERROR in test\\X.java (at line 8)\n" +
- " public <T> G<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "4. ERROR in test\\X.java (at line 15)\n" +
- " * @param <T>\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "5. ERROR in test\\X.java (at line 19)\n" +
- " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "6. ERROR in test\\X.java (at line 19)\n" +
- " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "7. ERROR in test\\X.java (at line 19)\n" +
- " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "8. ERROR in test\\X.java (at line 22)\n" +
- " * @param <T>\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "9. ERROR in test\\X.java (at line 24)\n" +
- " class G<T> {}\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in test\\X.java (at line 8)\n" +
+ " public <T> G<T> foo(Class<T> stuffClass) {\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "2. ERROR in test\\X.java (at line 8)\n" +
+ " public <T> G<T> foo(Class<T> stuffClass) {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "3. ERROR in test\\X.java (at line 8)\n" +
+ " public <T> G<T> foo(Class<T> stuffClass) {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "4. ERROR in test\\X.java (at line 15)\n" +
+ " * @param <T>\n" +
+ " ^^^\n" +
+ "Javadoc: Invalid param tag name\n" +
+ "----------\n" +
+ "5. ERROR in test\\X.java (at line 19)\n" +
+ " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "6. ERROR in test\\X.java (at line 19)\n" +
+ " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "7. ERROR in test\\X.java (at line 19)\n" +
+ " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "8. ERROR in test\\X.java (at line 22)\n" +
+ " * @param <T>\n" +
+ " ^^^\n" +
+ "Javadoc: Invalid param tag name\n" +
+ "----------\n" +
+ "9. ERROR in test\\X.java (at line 24)\n" +
+ " class G<T> {}\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
"----------\n");
}
public void testBug95521b() {
@@ -2957,71 +2957,71 @@ public class JavadocTest_1_3 extends JavadocTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in test\\X.java (at line 6)\n" +
- " * @param <T>\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in test\\X.java (at line 9)\n" +
- " public <T> X(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "3. ERROR in test\\X.java (at line 9)\n" +
- " public <T> X(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "4. ERROR in test\\X.java (at line 12)\n" +
- " * @param <T>\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "5. ERROR in test\\X.java (at line 16)\n" +
- " public <T> Class<T> foo(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "6. ERROR in test\\X.java (at line 16)\n" +
- " public <T> Class<T> foo(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "7. ERROR in test\\X.java (at line 16)\n" +
- " public <T> Class<T> foo(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "8. ERROR in test\\X.java (at line 25)\n" +
- " public <T> Y(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "9. ERROR in test\\X.java (at line 25)\n" +
- " public <T> Y(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "10. ERROR in test\\X.java (at line 25)\n" +
- " public <T> Y(Class<T> classT) {\n" +
- " ^^^^^^\n" +
- "Javadoc: Missing tag for parameter classT\n" +
- "----------\n" +
- "11. ERROR in test\\X.java (at line 32)\n" +
- " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "12. ERROR in test\\X.java (at line 32)\n" +
- " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "13. ERROR in test\\X.java (at line 32)\n" +
- " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in test\\X.java (at line 6)\n" +
+ " * @param <T>\n" +
+ " ^^^\n" +
+ "Javadoc: Invalid param tag name\n" +
+ "----------\n" +
+ "2. ERROR in test\\X.java (at line 9)\n" +
+ " public <T> X(Class<T> classT) {\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "3. ERROR in test\\X.java (at line 9)\n" +
+ " public <T> X(Class<T> classT) {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "4. ERROR in test\\X.java (at line 12)\n" +
+ " * @param <T>\n" +
+ " ^^^\n" +
+ "Javadoc: Invalid param tag name\n" +
+ "----------\n" +
+ "5. ERROR in test\\X.java (at line 16)\n" +
+ " public <T> Class<T> foo(Class<T> classT) {\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "6. ERROR in test\\X.java (at line 16)\n" +
+ " public <T> Class<T> foo(Class<T> classT) {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "7. ERROR in test\\X.java (at line 16)\n" +
+ " public <T> Class<T> foo(Class<T> classT) {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "8. ERROR in test\\X.java (at line 25)\n" +
+ " public <T> Y(Class<T> classT) {\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "9. ERROR in test\\X.java (at line 25)\n" +
+ " public <T> Y(Class<T> classT) {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "10. ERROR in test\\X.java (at line 25)\n" +
+ " public <T> Y(Class<T> classT) {\n" +
+ " ^^^^^^\n" +
+ "Javadoc: Missing tag for parameter classT\n" +
+ "----------\n" +
+ "11. ERROR in test\\X.java (at line 32)\n" +
+ " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "12. ERROR in test\\X.java (at line 32)\n" +
+ " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "13. ERROR in test\\X.java (at line 32)\n" +
+ " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
"----------\n");
}
@@ -3082,26 +3082,26 @@ public class JavadocTest_1_3 extends JavadocTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<T, F> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @see T Variable \n" +
- " ^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @see F Variable\n" +
- " ^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " static class Entry<L, R> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X<T, F> {\n" +
+ " ^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " * @see T Variable \n" +
+ " ^\n" +
+ "Javadoc: Invalid reference\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " * @see F Variable\n" +
+ " ^\n" +
+ "Javadoc: Invalid reference\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " static class Entry<L, R> {\n" +
+ " ^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
"----------\n"
);
}
@@ -3158,26 +3158,26 @@ public class JavadocTest_1_3 extends JavadocTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<T, F> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @see T Variable \n" +
- " ^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @see F Variable\n" +
- " ^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " class Entry<L, R> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X<T, F> {\n" +
+ " ^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " * @see T Variable \n" +
+ " ^\n" +
+ "Javadoc: Invalid reference\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " * @see F Variable\n" +
+ " ^\n" +
+ "Javadoc: Invalid reference\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " class Entry<L, R> {\n" +
+ " ^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
"----------\n"
);
}
@@ -3193,11 +3193,11 @@ public class JavadocTest_1_3 extends JavadocTest {
" public T foo();\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public interface X<T> {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " public interface X<T> {\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
"----------\n"
);
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java
index 60879a435..41ddcc9cf 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java
@@ -672,7 +672,7 @@ public class JavadocTest_1_4 extends JavadocTest {
//{ObjectTeams: different position due to different grammar:
/* orig:
" ^^\n" +
-
+
:giro */
" ^^^^^^^^^^\n" +
// SH}
@@ -682,11 +682,11 @@ public class JavadocTest_1_4 extends JavadocTest {
" public class X<T, , V> {}\n" +
" ^\n" +
//{ObjectTeams: one more message:
- "Syntax error, insert \"Identifier\" to complete TypeParameter\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 7)\n" +
- " public class X<T, , V> {}\n" +
- " ^\n" +
+ "Syntax error, insert \"Identifier\" to complete TypeParameter\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 7)\n" +
+ " public class X<T, , V> {}\n" +
+ " ^\n" +
// SH}
"Syntax error, insert \"ClassBody\" to complete CompilationUnit\n" +
"----------\n"
@@ -725,8 +725,8 @@ public class JavadocTest_1_4 extends JavadocTest {
//{ObjectTeams: changed position due to different grammar
/* orig:
" ^^^^^^\n" +
- :giro */
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ :giro */
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
// SH}
"Syntax error on tokens, delete these tokens\n" +
"----------\n" +
@@ -753,10 +753,10 @@ public class JavadocTest_1_4 extends JavadocTest {
// SH}
"----------\n"
//{ObjectTeams: one more message:
- +"7. ERROR in X.java (at line 7)\n" +
- " public class X<T, U, V extend Exception> {}\n" +
- " ^\n" +
- "Syntax error, insert \"ClassBody\" to complete CompilationUnit\n" +
+ +"7. ERROR in X.java (at line 7)\n" +
+ " public class X<T, U, V extend Exception> {}\n" +
+ " ^\n" +
+ "Syntax error, insert \"ClassBody\" to complete CompilationUnit\n" +
"----------\n"
// SH}
);
@@ -1330,31 +1330,31 @@ public class JavadocTest_1_4 extends JavadocTest {
" public <T, U, V extends Exceptions> void foo(int val, Object obj) {}\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <T> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @param <V> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " * @param <U> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " public <T, U, V extends Exceptions> void foo(int val, Object obj) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 10)\n" +
- " public <T, U, V extends Exceptions> void foo(int val, Object obj) {}\n" +
- " ^^^^^^^^^^\n" +
- "Exceptions cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " * @param <T> Type parameter 2\n" +
+ " ^^^\n" +
+ "Javadoc: Invalid param tag name\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " * @param <V> Type parameter 2\n" +
+ " ^^^\n" +
+ "Javadoc: Invalid param tag name\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " * @param <U> Type parameter 1\n" +
+ " ^^^\n" +
+ "Javadoc: Invalid param tag name\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 10)\n" +
+ " public <T, U, V extends Exceptions> void foo(int val, Object obj) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 10)\n" +
+ " public <T, U, V extends Exceptions> void foo(int val, Object obj) {}\n" +
+ " ^^^^^^^^^^\n" +
+ "Exceptions cannot be resolved to a type\n" +
"----------\n"
);
}
@@ -1485,21 +1485,21 @@ public class JavadocTest_1_4 extends JavadocTest {
" G(E e) {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " * @see G#G(Object)\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The constructor G(Object) is undefined\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public class X extends G<Exception> {\n" +
- " ^^^^^^^^^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " class G<E extends Exception> {\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " * @see G#G(Object)\n" +
+ " ^^^^^^^^^\n" +
+ "Javadoc: The constructor G(Object) is undefined\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " public class X extends G<Exception> {\n" +
+ " ^^^^^^^^^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " class G<E extends Exception> {\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
"----------\n");
}
@@ -1529,31 +1529,31 @@ public class JavadocTest_1_4 extends JavadocTest {
" public void testCompareTo() {}\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public static <T extends Comparable< ? super T>> int compareTo(final Object first, final Object firstPrime, final Class<T> type) throws ClassCastException\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " public static <T extends Comparable< ? super T>> int compareTo(final Object first, final Object firstPrime, final Class<T> type) throws ClassCastException\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " public static <X extends Comparable< ? super X>> int compareTo(final X first, final X firstPrime)\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 6)\n" +
- " public static <X extends Comparable< ? super X>> int compareTo(final X first, final X firstPrime)\n" +
- " ^\n" +
- "The type parameter X is hiding the type X\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 14)\n" +
- " * {@link ComparableUtils#compareTo(Object, Object)}.\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The method compareTo(Object, Object, Class<T>) in the type ComparableUtils is not applicable for the arguments (Object, Object)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public static <T extends Comparable< ? super T>> int compareTo(final Object first, final Object firstPrime, final Class<T> type) throws ClassCastException\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " public static <T extends Comparable< ? super T>> int compareTo(final Object first, final Object firstPrime, final Class<T> type) throws ClassCastException\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " public static <X extends Comparable< ? super X>> int compareTo(final X first, final X firstPrime)\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 6)\n" +
+ " public static <X extends Comparable< ? super X>> int compareTo(final X first, final X firstPrime)\n" +
+ " ^\n" +
+ "The type parameter X is hiding the type X\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 14)\n" +
+ " * {@link ComparableUtils#compareTo(Object, Object)}.\n" +
+ " ^^^^^^^^^\n" +
+ "Javadoc: The method compareTo(Object, Object, Class<T>) in the type ComparableUtils is not applicable for the arguments (Object, Object)\n" +
"----------\n");
}
@@ -1592,41 +1592,41 @@ public class JavadocTest_1_4 extends JavadocTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Test#add(T) \n" +
- " ^^^\n" +
- "Javadoc: The method add(Object) in the type Test is not applicable for the arguments (T)\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see #add(T)\n" +
- " ^^^\n" +
- "Javadoc: The method add(Object) in the type Test is not applicable for the arguments (T)\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 4)\n" +
- " * @see Test#Test(T)\n" +
- " ^^^^^^^\n" +
- "Javadoc: The constructor Test(T) is undefined\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 5)\n" +
- " * @see #Test(T)\n" +
- " ^^^^^^^\n" +
- "Javadoc: The constructor Test(T) is undefined\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 11)\n" +
- " public class Test<T> {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "6. ERROR in Test.java (at line 18)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "7. ERROR in Test.java (at line 18)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 2)\n" +
+ " * @see Test#add(T) \n" +
+ " ^^^\n" +
+ "Javadoc: The method add(Object) in the type Test is not applicable for the arguments (T)\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 3)\n" +
+ " * @see #add(T)\n" +
+ " ^^^\n" +
+ "Javadoc: The method add(Object) in the type Test is not applicable for the arguments (T)\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 4)\n" +
+ " * @see Test#Test(T)\n" +
+ " ^^^^^^^\n" +
+ "Javadoc: The constructor Test(T) is undefined\n" +
+ "----------\n" +
+ "4. ERROR in Test.java (at line 5)\n" +
+ " * @see #Test(T)\n" +
+ " ^^^^^^^\n" +
+ "Javadoc: The constructor Test(T) is undefined\n" +
+ "----------\n" +
+ "5. ERROR in Test.java (at line 11)\n" +
+ " public class Test<T> {\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "6. ERROR in Test.java (at line 18)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "7. ERROR in Test.java (at line 18)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
"----------\n");
}
public void testBug83127b() {
@@ -1660,31 +1660,31 @@ public class JavadocTest_1_4 extends JavadocTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Sub#add(T)\n" +
- " ^^^\n" +
- "Javadoc: The method add(Number) in the type Sub is not applicable for the arguments (T)\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Sub#Sub(T)\n" +
- " ^^^^^^\n" +
- "Javadoc: The constructor Sub(T) is undefined\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 11)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 18)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 18)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 2)\n" +
+ " * @see Sub#add(T)\n" +
+ " ^^^\n" +
+ "Javadoc: The method add(Number) in the type Sub is not applicable for the arguments (T)\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 3)\n" +
+ " * @see Sub#Sub(T)\n" +
+ " ^^^^^^\n" +
+ "Javadoc: The constructor Sub(T) is undefined\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 11)\n" +
+ " public class Test<T>{\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "4. ERROR in Test.java (at line 18)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "5. ERROR in Test.java (at line 18)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
"----------\n");
}
public void testBug83127c() {
@@ -1715,31 +1715,31 @@ public class JavadocTest_1_4 extends JavadocTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Sub#add(E) \n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Sub#Sub(E)\n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 8)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 2)\n" +
+ " * @see Sub#add(E) \n" +
+ " ^\n" +
+ "Javadoc: E cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 3)\n" +
+ " * @see Sub#Sub(E)\n" +
+ " ^\n" +
+ "Javadoc: E cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 8)\n" +
+ " public class Test<T>{\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "4. ERROR in Test.java (at line 15)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "5. ERROR in Test.java (at line 15)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
"----------\n");
}
public void testBug83127d() {
@@ -1775,37 +1775,37 @@ public class JavadocTest_1_4 extends JavadocTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Unrelated1.java (at line 1)\n" +
- " public class Unrelated1<E extends Number> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Unrelated1#add(E)\n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Unrelated1#Unrelated1(E)\n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 8)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in Unrelated1.java (at line 1)\n" +
+ " public class Unrelated1<E extends Number> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 2)\n" +
+ " * @see Unrelated1#add(E)\n" +
+ " ^\n" +
+ "Javadoc: E cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 3)\n" +
+ " * @see Unrelated1#Unrelated1(E)\n" +
+ " ^\n" +
+ "Javadoc: E cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 8)\n" +
+ " public class Test<T>{\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "4. ERROR in Test.java (at line 15)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "5. ERROR in Test.java (at line 15)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
"----------\n");
}
public void testBug83127e() {
@@ -1841,37 +1841,37 @@ public class JavadocTest_1_4 extends JavadocTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Unrelated1.java (at line 1)\n" +
- " public class Unrelated1<E extends Number> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Unrelated1#add(Object)\n" +
- " ^^^\n" +
- "Javadoc: The method add(Number) in the type Unrelated1 is not applicable for the arguments (Object)\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Unrelated1#Unrelated1(Object)\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The constructor Unrelated1(Object) is undefined\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 9)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in Unrelated1.java (at line 1)\n" +
+ " public class Unrelated1<E extends Number> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 2)\n" +
+ " * @see Unrelated1#add(Object)\n" +
+ " ^^^\n" +
+ "Javadoc: The method add(Number) in the type Unrelated1 is not applicable for the arguments (Object)\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 3)\n" +
+ " * @see Unrelated1#Unrelated1(Object)\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: The constructor Unrelated1(Object) is undefined\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 9)\n" +
+ " public class Test<T>{\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "4. ERROR in Test.java (at line 15)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "5. ERROR in Test.java (at line 15)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
"----------\n");
}
public void testBug83127f() {
@@ -1906,27 +1906,27 @@ public class JavadocTest_1_4 extends JavadocTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Unrelated1.java (at line 1)\n" +
- " public class Unrelated1<E extends Number> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Test.java (at line 8)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 14)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 14)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in Unrelated1.java (at line 1)\n" +
+ " public class Unrelated1<E extends Number> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 8)\n" +
+ " public class Test<T>{\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 14)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 14)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
"----------\n");
}
public void testBug83127g() {
@@ -1963,37 +1963,37 @@ public class JavadocTest_1_4 extends JavadocTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Unrelated1.java (at line 1)\n" +
- " public class Unrelated1<E extends Number> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Unrelated1#add(Integer)\n" +
- " ^^^\n" +
- "Javadoc: The method add(Number) in the type Unrelated1 is not applicable for the arguments (Integer)\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Unrelated1#Unrelated1(Integer)\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The constructor Unrelated1(Integer) is undefined\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 9)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 16)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 16)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in Unrelated1.java (at line 1)\n" +
+ " public class Unrelated1<E extends Number> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 2)\n" +
+ " * @see Unrelated1#add(Integer)\n" +
+ " ^^^\n" +
+ "Javadoc: The method add(Number) in the type Unrelated1 is not applicable for the arguments (Integer)\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 3)\n" +
+ " * @see Unrelated1#Unrelated1(Integer)\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: The constructor Unrelated1(Integer) is undefined\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 9)\n" +
+ " public class Test<T>{\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "4. ERROR in Test.java (at line 16)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "5. ERROR in Test.java (at line 16)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
"----------\n");
}
public void testBug83127h() {
@@ -2030,32 +2030,32 @@ public class JavadocTest_1_4 extends JavadocTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Unrelated2.java (at line 1)\n" +
- " public interface Unrelated2<E> {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Unrelated2#add(T)\n" +
- " ^^^\n" +
- "Javadoc: The method add(Object) in the type Unrelated2 is not applicable for the arguments (T)\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 10)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 17)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 17)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in Unrelated2.java (at line 1)\n" +
+ " public interface Unrelated2<E> {\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 2)\n" +
+ " * @see Unrelated2#add(T)\n" +
+ " ^^^\n" +
+ "Javadoc: The method add(Object) in the type Unrelated2 is not applicable for the arguments (T)\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 10)\n" +
+ " public class Test<T>{\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 17)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "4. ERROR in Test.java (at line 17)\n" +
+ " class Sub<E extends Number> extends Test<E> {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
"----------\n");
}
@@ -2228,11 +2228,11 @@ public class JavadocTest_1_4 extends JavadocTest {
* @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=86769"
*/
public void testBug86769() {
-
+
/* Deleted a completely meaningless test that could only serve as a torture test for the parser.
The test is still run in 1.5+ modes where it makes sense to run it - The test here was a nuisance
failing every time there is some serious grammar change that alters the semi-random behavior in
- Diagnose Parser.
+ Diagnose Parser.
*/
return;
}
@@ -2301,51 +2301,51 @@ public class JavadocTest_1_4 extends JavadocTest {
" */\n" +
"class G<T> {}\n"
},
- "----------\n" +
- "1. ERROR in test\\X.java (at line 8)\n" +
- " public <T> G<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "2. ERROR in test\\X.java (at line 8)\n" +
- " public <T> G<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "3. ERROR in test\\X.java (at line 8)\n" +
- " public <T> G<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "4. ERROR in test\\X.java (at line 15)\n" +
- " * @param <T>\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "5. ERROR in test\\X.java (at line 19)\n" +
- " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "6. ERROR in test\\X.java (at line 19)\n" +
- " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "7. ERROR in test\\X.java (at line 19)\n" +
- " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "8. ERROR in test\\X.java (at line 22)\n" +
- " * @param <T>\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "9. ERROR in test\\X.java (at line 24)\n" +
- " class G<T> {}\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in test\\X.java (at line 8)\n" +
+ " public <T> G<T> foo(Class<T> stuffClass) {\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "2. ERROR in test\\X.java (at line 8)\n" +
+ " public <T> G<T> foo(Class<T> stuffClass) {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "3. ERROR in test\\X.java (at line 8)\n" +
+ " public <T> G<T> foo(Class<T> stuffClass) {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "4. ERROR in test\\X.java (at line 15)\n" +
+ " * @param <T>\n" +
+ " ^^^\n" +
+ "Javadoc: Invalid param tag name\n" +
+ "----------\n" +
+ "5. ERROR in test\\X.java (at line 19)\n" +
+ " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "6. ERROR in test\\X.java (at line 19)\n" +
+ " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "7. ERROR in test\\X.java (at line 19)\n" +
+ " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "8. ERROR in test\\X.java (at line 22)\n" +
+ " * @param <T>\n" +
+ " ^^^\n" +
+ "Javadoc: Invalid param tag name\n" +
+ "----------\n" +
+ "9. ERROR in test\\X.java (at line 24)\n" +
+ " class G<T> {}\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
"----------\n"
);
}
@@ -2389,71 +2389,71 @@ public class JavadocTest_1_4 extends JavadocTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in test\\X.java (at line 6)\n" +
- " * @param <T>\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in test\\X.java (at line 9)\n" +
- " public <T> X(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "3. ERROR in test\\X.java (at line 9)\n" +
- " public <T> X(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "4. ERROR in test\\X.java (at line 12)\n" +
- " * @param <T>\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "5. ERROR in test\\X.java (at line 16)\n" +
- " public <T> Class<T> foo(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "6. ERROR in test\\X.java (at line 16)\n" +
- " public <T> Class<T> foo(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "7. ERROR in test\\X.java (at line 16)\n" +
- " public <T> Class<T> foo(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "8. ERROR in test\\X.java (at line 25)\n" +
- " public <T> Y(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "9. ERROR in test\\X.java (at line 25)\n" +
- " public <T> Y(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "10. ERROR in test\\X.java (at line 25)\n" +
- " public <T> Y(Class<T> classT) {\n" +
- " ^^^^^^\n" +
- "Javadoc: Missing tag for parameter classT\n" +
- "----------\n" +
- "11. ERROR in test\\X.java (at line 32)\n" +
- " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "12. ERROR in test\\X.java (at line 32)\n" +
- " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "13. ERROR in test\\X.java (at line 32)\n" +
- " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in test\\X.java (at line 6)\n" +
+ " * @param <T>\n" +
+ " ^^^\n" +
+ "Javadoc: Invalid param tag name\n" +
+ "----------\n" +
+ "2. ERROR in test\\X.java (at line 9)\n" +
+ " public <T> X(Class<T> classT) {\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "3. ERROR in test\\X.java (at line 9)\n" +
+ " public <T> X(Class<T> classT) {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "4. ERROR in test\\X.java (at line 12)\n" +
+ " * @param <T>\n" +
+ " ^^^\n" +
+ "Javadoc: Invalid param tag name\n" +
+ "----------\n" +
+ "5. ERROR in test\\X.java (at line 16)\n" +
+ " public <T> Class<T> foo(Class<T> classT) {\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "6. ERROR in test\\X.java (at line 16)\n" +
+ " public <T> Class<T> foo(Class<T> classT) {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "7. ERROR in test\\X.java (at line 16)\n" +
+ " public <T> Class<T> foo(Class<T> classT) {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "8. ERROR in test\\X.java (at line 25)\n" +
+ " public <T> Y(Class<T> classT) {\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "9. ERROR in test\\X.java (at line 25)\n" +
+ " public <T> Y(Class<T> classT) {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "10. ERROR in test\\X.java (at line 25)\n" +
+ " public <T> Y(Class<T> classT) {\n" +
+ " ^^^^^^\n" +
+ "Javadoc: Missing tag for parameter classT\n" +
+ "----------\n" +
+ "11. ERROR in test\\X.java (at line 32)\n" +
+ " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "12. ERROR in test\\X.java (at line 32)\n" +
+ " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "13. ERROR in test\\X.java (at line 32)\n" +
+ " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
+ " ^\n" +
+ "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" +
"----------\n"
);
}
@@ -2559,12 +2559,12 @@ public class JavadocTest_1_4 extends JavadocTest {
" ^^^^^\n" +
"Javadoc: Invalid member type qualification\n" +
"----------\n" +
- "----------\n" +
- "1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" +
- " * @see Test.Inner\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
+ "----------\n" +
+ "1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" +
+ " * @see Test.Inner\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Invalid member type qualification\n" +
+ "----------\n"
);
}
public void testBug96237_Public04() {
@@ -2885,12 +2885,12 @@ public class JavadocTest_1_4 extends JavadocTest {
" * See also {@link Inner}\n" +
" ^^^^^\n" +
"Javadoc: Invalid member type qualification\n" +
- "----------\n" +
"----------\n" +
- "1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" +
- " * @see Test.Inner\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
+ "----------\n" +
+ "1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" +
+ " * @see Test.Inner\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Invalid member type qualification\n" +
"----------\n"
);
}
@@ -3082,26 +3082,26 @@ public class JavadocTest_1_4 extends JavadocTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<T, F> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @see T Variable \n" +
- " ^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @see F Variable\n" +
- " ^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " static class Entry<L, R> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X<T, F> {\n" +
+ " ^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " * @see T Variable \n" +
+ " ^\n" +
+ "Javadoc: Invalid reference\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " * @see F Variable\n" +
+ " ^\n" +
+ "Javadoc: Invalid reference\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " static class Entry<L, R> {\n" +
+ " ^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
"----------\n"
);
}
@@ -3158,26 +3158,26 @@ public class JavadocTest_1_4 extends JavadocTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<T, F> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @see T Variable \n" +
- " ^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @see F Variable\n" +
- " ^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " class Entry<L, R> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X<T, F> {\n" +
+ " ^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " * @see T Variable \n" +
+ " ^\n" +
+ "Javadoc: Invalid reference\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " * @see F Variable\n" +
+ " ^\n" +
+ "Javadoc: Invalid reference\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " class Entry<L, R> {\n" +
+ " ^^^^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
"----------\n"
);
}
@@ -3193,11 +3193,11 @@ public class JavadocTest_1_4 extends JavadocTest {
" public T foo();\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public interface X<T> {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " public interface X<T> {\n" +
+ " ^\n" +
+ "Syntax error, type parameters are only available if source level is 1.5 or greater\n" +
"----------\n"
);
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java
index da29d750e..584a5d7fc 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java
@@ -552,7 +552,7 @@ public class JavadocTest_1_5 extends JavadocTest {
// orig:
" ^^^^^^\n" +
"Syntax error on token \"extend\", extends expected\n" +
-/*
+/*
"----------\n" +
"2. ERROR in X.java (at line 7)\n" +
" public class X<T, U, V extend Exception> {}\n" +
@@ -1705,36 +1705,36 @@ public class JavadocTest_1_5 extends JavadocTest {
" public void foo() {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in pack\\package-info.java (at line 4)\n" +
- " * @see Unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: Unknown cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in pack\\package-info.java (at line 6)\n" +
- " * @see pack.Test#unknown()\n" +
- " ^^^^^^^\n" +
- "Javadoc: The method unknown() is undefined for the type Test\n" +
- "----------\n" +
- "3. ERROR in pack\\package-info.java (at line 8)\n" +
- " * @see pack.Test#unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: unknown cannot be resolved or is not a field\n" +
- "----------\n" +
- "4. ERROR in pack\\package-info.java (at line 9)\n" +
- " * @param unexpected\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "5. ERROR in pack\\package-info.java (at line 10)\n" +
- " * @throws unexpected\n" +
- " ^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "6. ERROR in pack\\package-info.java (at line 11)\n" +
- " * @return unexpected \n" +
- " ^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "1. ERROR in pack\\package-info.java (at line 4)\n" +
+ " * @see Unknown\n" +
+ " ^^^^^^^\n" +
+ "Javadoc: Unknown cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in pack\\package-info.java (at line 6)\n" +
+ " * @see pack.Test#unknown()\n" +
+ " ^^^^^^^\n" +
+ "Javadoc: The method unknown() is undefined for the type Test\n" +
+ "----------\n" +
+ "3. ERROR in pack\\package-info.java (at line 8)\n" +
+ " * @see pack.Test#unknown\n" +
+ " ^^^^^^^\n" +
+ "Javadoc: unknown cannot be resolved or is not a field\n" +
+ "----------\n" +
+ "4. ERROR in pack\\package-info.java (at line 9)\n" +
+ " * @param unexpected\n" +
+ " ^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "5. ERROR in pack\\package-info.java (at line 10)\n" +
+ " * @throws unexpected\n" +
+ " ^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "6. ERROR in pack\\package-info.java (at line 11)\n" +
+ " * @return unexpected \n" +
+ " ^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
);
@@ -2030,12 +2030,12 @@ public class JavadocTest_1_5 extends JavadocTest {
" * See also {@link Inner}\n" +
" ^^^^^\n" +
"Javadoc: Invalid member type qualification\n" +
- "----------\n" +
"----------\n" +
- "1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" +
- " * @see Test.Inner\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
+ "----------\n" +
+ "1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" +
+ " * @see Test.Inner\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Invalid member type qualification\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
);
@@ -2344,12 +2344,12 @@ public class JavadocTest_1_5 extends JavadocTest {
" * See also {@link Inner}\n" +
" ^^^^^\n" +
"Javadoc: Invalid member type qualification\n" +
- "----------\n" +
"----------\n" +
- "1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" +
- " * @see Test.Inner\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
+ "----------\n" +
+ "1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" +
+ " * @see Test.Inner\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Invalid member type qualification\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
);
@@ -3903,25 +3903,25 @@ public class JavadocTest_1_5 extends JavadocTest {
" */\n" +
"package pack;\n"
},
- "----------\n" +
- "1. ERROR in pack\\package-info.java (at line 2)\n" +
- " * {@inheritDoc}\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "2. ERROR in pack\\package-info.java (at line 3)\n" +
- " * @since {@inheritDoc}\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "3. ERROR in pack\\package-info.java (at line 4)\n" +
- " * @blah {@inheritDoc}\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "1. ERROR in pack\\package-info.java (at line 2)\n" +
+ " * {@inheritDoc}\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "2. ERROR in pack\\package-info.java (at line 3)\n" +
+ " * @since {@inheritDoc}\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "3. ERROR in pack\\package-info.java (at line 4)\n" +
+ " * @blah {@inheritDoc}\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
"----------\n"
);
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=247037, verify that we complain about @inheritDoc
// being used in package level javadoc (variation)
public void testBug247037b() {
@@ -3934,26 +3934,26 @@ public class JavadocTest_1_5 extends JavadocTest {
" */\n" +
"package pack;\n"
},
- "----------\n" +
- "1. ERROR in pack\\package-info.java (at line 2)\n" +
- " * @return {@inheritDoc}\n" +
- " ^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "2. ERROR in pack\\package-info.java (at line 2)\n" +
- " * @return {@inheritDoc}\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "3. ERROR in pack\\package-info.java (at line 3)\n" +
- " * @param blah {@inheritDoc}\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "4. ERROR in pack\\package-info.java (at line 3)\n" +
- " * @param blah {@inheritDoc}\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "1. ERROR in pack\\package-info.java (at line 2)\n" +
+ " * @return {@inheritDoc}\n" +
+ " ^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "2. ERROR in pack\\package-info.java (at line 2)\n" +
+ " * @return {@inheritDoc}\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "3. ERROR in pack\\package-info.java (at line 3)\n" +
+ " * @param blah {@inheritDoc}\n" +
+ " ^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "4. ERROR in pack\\package-info.java (at line 3)\n" +
+ " * @param blah {@inheritDoc}\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
"----------\n"
);
}
@@ -4002,48 +4002,48 @@ public class JavadocTest_1_5 extends JavadocTest {
" * @see goo.bar\n" +
" * @see foo.bar.goo\n" +
" */\n" +
- "package foo.bar;\n"
+ "package foo.bar;\n"
},
- "----------\n" +
- "1. ERROR in foo\\bar\\package-info.java (at line 2)\n" +
- " * @see ClassInSamePackage#SOME_FIELD\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n" +
- "2. ERROR in foo\\bar\\package-info.java (at line 4)\n" +
- " * @see ClassInSamePackage#SOME_FIELD\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n" +
- "3. ERROR in foo\\bar\\package-info.java (at line 5)\n" +
- " * @see ClassInSubPackage#foo\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: ClassInSubPackage cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in foo\\bar\\package-info.java (at line 7)\n" +
- " * @see ClassInSubPackage#foo\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: ClassInSubPackage cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in foo\\bar\\package-info.java (at line 8)\n" +
- " * @see ClassInEnclosingPackage\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: ClassInEnclosingPackage cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in foo\\bar\\package-info.java (at line 10)\n" +
- " * @see ClassInEnclosingPackage\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: ClassInEnclosingPackage cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in foo\\bar\\package-info.java (at line 2)\n" +
+ " * @see ClassInSamePackage#SOME_FIELD\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid reference\n" +
+ "----------\n" +
+ "2. ERROR in foo\\bar\\package-info.java (at line 4)\n" +
+ " * @see ClassInSamePackage#SOME_FIELD\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid reference\n" +
+ "----------\n" +
+ "3. ERROR in foo\\bar\\package-info.java (at line 5)\n" +
+ " * @see ClassInSubPackage#foo\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: ClassInSubPackage cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in foo\\bar\\package-info.java (at line 7)\n" +
+ " * @see ClassInSubPackage#foo\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: ClassInSubPackage cannot be resolved to a type\n" +
+ "----------\n" +
+ "5. ERROR in foo\\bar\\package-info.java (at line 8)\n" +
+ " * @see ClassInEnclosingPackage\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: ClassInEnclosingPackage cannot be resolved to a type\n" +
+ "----------\n" +
+ "6. ERROR in foo\\bar\\package-info.java (at line 10)\n" +
+ " * @see ClassInEnclosingPackage\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: ClassInEnclosingPackage cannot be resolved to a type\n" +
"----------\n");
- }
+ }
/**
- * Additional tests for "https://bugs.eclipse.org/bugs/show_bug.cgi?id=286918"
+ * Additional tests for "https://bugs.eclipse.org/bugs/show_bug.cgi?id=286918"
* @test that in a non package-info.java file
* 2. References without qualified names to valid Java elements in the same package are ACCEPTED
* 2. References without qualified names to valid Java elements in other packages are REPORTED
* 3. References with qualified names to valid Java elements are accepted
- */
+ */
public void testBug284333a() {
runNegativeTest(new String[]{
"goo/bar/package-info.java",
@@ -4088,36 +4088,36 @@ public class JavadocTest_1_5 extends JavadocTest {
" public static void foo() {\n" +
" }\n" +
" " +
- " }\n"
+ " }\n"
},
- "----------\n" +
- "1. ERROR in foo\\bar\\NotAPackageInfo.java (at line 9)\n" +
- " * @see ClassInSubPackage#foo\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: ClassInSubPackage cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in foo\\bar\\NotAPackageInfo.java (at line 11)\n" +
- " * @see ClassInSubPackage#foo\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: ClassInSubPackage cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in foo\\bar\\NotAPackageInfo.java (at line 15)\n" +
- " * @see ClassInEnclosingPackage\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: ClassInEnclosingPackage cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in foo\\bar\\NotAPackageInfo.java (at line 17)\n" +
- " * @see ClassInEnclosingPackage\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: ClassInEnclosingPackage cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in foo\\bar\\NotAPackageInfo.java (at line 9)\n" +
+ " * @see ClassInSubPackage#foo\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: ClassInSubPackage cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in foo\\bar\\NotAPackageInfo.java (at line 11)\n" +
+ " * @see ClassInSubPackage#foo\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: ClassInSubPackage cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in foo\\bar\\NotAPackageInfo.java (at line 15)\n" +
+ " * @see ClassInEnclosingPackage\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: ClassInEnclosingPackage cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in foo\\bar\\NotAPackageInfo.java (at line 17)\n" +
+ " * @see ClassInEnclosingPackage\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: ClassInEnclosingPackage cannot be resolved to a type\n" +
"----------\n");
}
/**
- * Additional tests for "https://bugs.eclipse.org/bugs/show_bug.cgi?id=284333"
+ * Additional tests for "https://bugs.eclipse.org/bugs/show_bug.cgi?id=284333"
* @test that in a non package-info.java file
* 2. References without qualified names to imported Java elements in other packages are ACCEPTED
* 3. References with qualified names to valid Java elements are ACCEPTED
- */
+ */
public void testBug284333b() {
runConformTest(new String[] {
"goo/bar/package-info.java",
@@ -4167,7 +4167,7 @@ public class JavadocTest_1_5 extends JavadocTest {
" public static void foo() {\n" +
" }\n" +
" " +
- " }\n"
+ " }\n"
});
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=322581
@@ -4189,15 +4189,15 @@ public class JavadocTest_1_5 extends JavadocTest {
null,
options,
"----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter val\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter obj\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " public <T, U, V> void foo(int val, Object obj) {}\n" +
+ " ^^^\n" +
+ "Javadoc: Missing tag for parameter val\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " public <T, U, V> void foo(int val, Object obj) {}\n" +
+ " ^^^\n" +
+ "Javadoc: Missing tag for parameter obj\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
);
@@ -4223,7 +4223,7 @@ public class JavadocTest_1_5 extends JavadocTest {
" * Returns a {@link ListCallable} that wraps the result from calling <code>callable</code>.\n" +
" * @param callable the {@link Callable} to wrap\n" +
" * @return the wrapper\n" +
- " */\n" +
+ " */\n" +
" public static <T> ListCallable<T> from(final Callable<T> callable) { // don't warn\n" +
" return new ListCallable<T>() {\n" +
" @Override\n" +
@@ -4237,10 +4237,10 @@ public class JavadocTest_1_5 extends JavadocTest {
null,
options,
"----------\n" +
- "1. ERROR in ListCallable.java (at line 7)\n" +
- " public abstract class ListCallable<V> implements Callable<List<V>> { // good warning\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter V\n" +
+ "1. ERROR in ListCallable.java (at line 7)\n" +
+ " public abstract class ListCallable<V> implements Callable<List<V>> { // good warning\n" +
+ " ^\n" +
+ "Javadoc: Missing tag for parameter V\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
);
@@ -4260,18 +4260,18 @@ public class JavadocTest_1_5 extends JavadocTest {
" /**\n" +
" * @param o the given object\n" +
" * @see #foo(p.O[])\n" +
- " */\n" +
+ " */\n" +
" public void foo(Object o) {\n" +
" }\n" +
"}"
},
null,
options,
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " * @see #foo(p.O[])\n" +
- " ^^^\n" +
- "Illegal qualified access from the type parameter p\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " * @see #foo(p.O[])\n" +
+ " ^^^\n" +
+ "Illegal qualified access from the type parameter p\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
);
@@ -4291,18 +4291,18 @@ public class JavadocTest_1_5 extends JavadocTest {
" /**\n" +
" * @param o the given object\n" +
" * @see #foo(O[])\n" +
- " */\n" +
+ " */\n" +
" public void foo(Object o) {\n" +
" }\n" +
"}"
},
null,
options,
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " * @see #foo(O[])\n" +
- " ^\n" +
- "Javadoc: O[] cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " * @see #foo(O[])\n" +
+ " ^\n" +
+ "Javadoc: O[] cannot be resolved to a type\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
);
@@ -4322,18 +4322,18 @@ public class JavadocTest_1_5 extends JavadocTest {
" /**\n" +
" * @param o the given object\n" +
" * @see #foo(test.O[])\n" +
- " */\n" +
+ " */\n" +
" public void foo(Object o) {\n" +
" }\n" +
"}"
},
null,
options,
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " * @see #foo(test.O[])\n" +
- " ^^^^^^\n" +
- "Javadoc: test[] cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " * @see #foo(test.O[])\n" +
+ " ^^^^^^\n" +
+ "Javadoc: test[] cannot be resolved to a type\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
);
@@ -4353,18 +4353,18 @@ public class JavadocTest_1_5 extends JavadocTest {
" /**\n" +
" * @param o the given object\n" +
" * @see #foo(test.O)\n" +
- " */\n" +
+ " */\n" +
" public void foo(Object o) {\n" +
" }\n" +
"}"
},
null,
options,
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " * @see #foo(test.O)\n" +
- " ^^^^^^\n" +
- "Javadoc: test cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " * @see #foo(test.O)\n" +
+ " ^^^^^^\n" +
+ "Javadoc: test cannot be resolved to a type\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Jsr14Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Jsr14Test.java
index 1cbf2e79b..b2708376e 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Jsr14Test.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Jsr14Test.java
@@ -48,34 +48,34 @@ public void test1() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(X.class);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(X.class);\n" +
+ " }\n" +
"}",
},
"class X");
String expectedOutput =
- " // Method descriptor #18 ([Ljava/lang/String;)V\n" +
- " // Stack: 3, Locals: 1\n" +
- " public static void main(java.lang.String[] args);\n" +
- " 0 getstatic java.lang.System.out : java.io.PrintStream [19]\n" +
- " 3 getstatic X.class$0 : java.lang.Class [25]\n" +
- " 6 dup\n" +
- " 7 ifnonnull 35\n" +
- " 10 pop\n" +
- " 11 ldc <String \"X\"> [27]\n" +
- " 13 invokestatic java.lang.Class.forName(java.lang.String) : java.lang.Class [28]\n" +
- " 16 dup\n" +
- " 17 putstatic X.class$0 : java.lang.Class [25]\n" +
- " 20 goto 35\n" +
- " 23 new java.lang.NoClassDefFoundError [34]\n" +
- " 26 dup_x1\n" +
- " 27 swap\n" +
- " 28 invokevirtual java.lang.Throwable.getMessage() : java.lang.String [36]\n" +
- " 31 invokespecial java.lang.NoClassDefFoundError(java.lang.String) [42]\n" +
- " 34 athrow\n" +
- " 35 invokevirtual java.io.PrintStream.println(java.lang.Object) : void [45]\n" +
+ " // Method descriptor #18 ([Ljava/lang/String;)V\n" +
+ " // Stack: 3, Locals: 1\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 getstatic java.lang.System.out : java.io.PrintStream [19]\n" +
+ " 3 getstatic X.class$0 : java.lang.Class [25]\n" +
+ " 6 dup\n" +
+ " 7 ifnonnull 35\n" +
+ " 10 pop\n" +
+ " 11 ldc <String \"X\"> [27]\n" +
+ " 13 invokestatic java.lang.Class.forName(java.lang.String) : java.lang.Class [28]\n" +
+ " 16 dup\n" +
+ " 17 putstatic X.class$0 : java.lang.Class [25]\n" +
+ " 20 goto 35\n" +
+ " 23 new java.lang.NoClassDefFoundError [34]\n" +
+ " 26 dup_x1\n" +
+ " 27 swap\n" +
+ " 28 invokevirtual java.lang.Throwable.getMessage() : java.lang.String [36]\n" +
+ " 31 invokespecial java.lang.NoClassDefFoundError(java.lang.String) [42]\n" +
+ " 34 athrow\n" +
+ " 35 invokevirtual java.io.PrintStream.println(java.lang.Object) : void [45]\n" +
" 38 return\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java
index b11075770..1f430b461 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java
@@ -104,13 +104,13 @@ public void test003() {
" }\n" +
"}\n",
"BiFunction.java",
- "@FunctionalInterface\n" +
- "public interface BiFunction<T, U, R> {\n" +
- " R apply(T t, U u);\n" +
+ "@FunctionalInterface\n" +
+ "public interface BiFunction<T, U, R> {\n" +
+ " R apply(T t, U u);\n" +
"}",
"BinaryOperator.java",
- "@FunctionalInterface\n" +
- "public interface BinaryOperator<T> extends BiFunction<T,T,T> {\n" +
+ "@FunctionalInterface\n" +
+ "public interface BinaryOperator<T> extends BiFunction<T,T,T> {\n" +
"}"
},
"SUCCESS");
@@ -131,25 +131,25 @@ public void test004() {
" }\n" +
"}\n",
"BiFunction.java",
- "@FunctionalInterface\n" +
- "public interface BiFunction<T, U, R> {\n" +
- " R apply(T t, U u);\n" +
+ "@FunctionalInterface\n" +
+ "public interface BiFunction<T, U, R> {\n" +
+ " R apply(T t, U u);\n" +
"}",
"BinaryOperator.java",
- "@FunctionalInterface\n" +
- "public interface BinaryOperator<T> extends BiFunction<T,T,T> {\n" +
+ "@FunctionalInterface\n" +
+ "public interface BinaryOperator<T> extends BiFunction<T,T,T> {\n" +
"}"
},
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " BinaryOperator binOp = (x,y) -> { return x+y; };\n" +
- " ^^^^^^^^^^^^^^\n" +
- "BinaryOperator is a raw type. References to generic type BinaryOperator<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " BinaryOperator binOp = (x,y) -> { return x+y; };\n" +
- " ^^^\n" +
- "The operator + is undefined for the argument type(s) java.lang.Object, java.lang.Object\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " BinaryOperator binOp = (x,y) -> { return x+y; };\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "BinaryOperator is a raw type. References to generic type BinaryOperator<T> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " BinaryOperator binOp = (x,y) -> { return x+y; };\n" +
+ " ^^^\n" +
+ "The operator + is undefined for the argument type(s) java.lang.Object, java.lang.Object\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406175, [1.8][compiler][codegen] Generate code for lambdas with expression body.
@@ -320,44 +320,44 @@ public void test014() {
this.runConformTest(
new String[] {
"X.java",
- "interface I {\n" +
- " void doit();\n" +
- "}\n" +
- "public class X {\n" +
- " public static void nonmain(String[] args) {\n" +
- " int var = 2;\n" +
- " I x2 = () -> {\n" +
- " System.out.println(\"Argc = \" + args.length);\n" +
+ "interface I {\n" +
+ " void doit();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public static void nonmain(String[] args) {\n" +
+ " int var = 2;\n" +
+ " I x2 = () -> {\n" +
+ " System.out.println(\"Argc = \" + args.length);\n" +
" for (int i = 0; i < args.length; i++) {\n" +
" System.out.println(\"Argv[\" + i + \"] = \" + args[i]);\n" +
" }\n" +
" };\n" +
" x2.doit();\n" +
- " var=2;\n" +
+ " var=2;\n" +
" }\n" +
- " public static void main(String[] args) {\n" +
+ " public static void main(String[] args) {\n" +
" nonmain(new String[] {\"Hello! \", \"World!\" });\n" +
" }\n" +
"}" ,
},
- "Argc = 2\n" +
- "Argv[0] = Hello! \n" +
+ "Argc = 2\n" +
+ "Argv[0] = Hello! \n" +
"Argv[1] = World!");
}
public void test015() {
this.runConformTest(
new String[] {
"X.java",
- "interface I {\n" +
- " void doit();\n" +
- "}\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " new java.io.File((String) null).getCanonicalPath();\n" +
- " } catch (NullPointerException | java.io.IOException ioe) {\n" +
- " I x2 = () -> {\n" +
- " System.out.println(ioe.getMessage()); // OK: args is not re-assignment since declaration/first assignment\n" +
+ "interface I {\n" +
+ " void doit();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
+ " new java.io.File((String) null).getCanonicalPath();\n" +
+ " } catch (NullPointerException | java.io.IOException ioe) {\n" +
+ " I x2 = () -> {\n" +
+ " System.out.println(ioe.getMessage()); // OK: args is not re-assignment since declaration/first assignment\n" +
" };\n" +
" x2.doit();\n" +
" };\n"+
@@ -370,20 +370,20 @@ public void test016() {
this.runConformTest(
new String[] {
"X.java",
- "interface I {\n" +
- " void doit();\n" +
- "}\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " java.util.List<String> list = new java.util.ArrayList<>();\n" +
+ "interface I {\n" +
+ " void doit();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " java.util.List<String> list = new java.util.ArrayList<>();\n" +
" list.add(\"SomeString\");\n" +
- " for (String s : list) {\n" +
- " I x2 = () -> {\n" +
- " System.out.println(s); // OK: args is not re-assignment since declaration/first assignment\n" +
- " };\n" +
+ " for (String s : list) {\n" +
+ " I x2 = () -> {\n" +
+ " System.out.println(s); // OK: args is not re-assignment since declaration/first assignment\n" +
+ " };\n" +
" x2.doit();\n" +
- " };\n" +
- " }\n" +
+ " };\n" +
+ " }\n" +
"\n" +
"}\n" ,
},
@@ -432,7 +432,7 @@ public void test018() {
" }\n" +
"}\n",
},
- "631\n" +
+ "631\n" +
"136");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=405071, [1.8][compiler][codegen] Generate code for array constructor references
@@ -454,7 +454,7 @@ public void test019() {
" }\n" +
"}\n",
},
- "631\n" +
+ "631\n" +
"136");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=405071, [1.8][compiler][codegen] Generate code for array constructor references
@@ -476,7 +476,7 @@ public void test020() {
" }\n" +
"}\n",
},
- "631\n" +
+ "631\n" +
"136");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=405071, [1.8][compiler][codegen] Generate code for array constructor references
@@ -498,7 +498,7 @@ public void test021() {
" }\n" +
"}\n",
},
- "631\n" +
+ "631\n" +
"136");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406388, [1.8][compiler][codegen] Runtime evaluation of method reference produces "BootstrapMethodError: call site initialization exception"
@@ -533,7 +533,7 @@ public void test022() {
" }\n" +
"}\n" ,
},
- "OK\n" +
+ "OK\n" +
"OK");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406388, [1.8][compiler][codegen] Runtime evaluation of method reference produces "BootstrapMethodError: call site initialization exception"
@@ -597,7 +597,7 @@ public void test025() {
},
"");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406589, [1.8][compiler][codegen] super call misdispatched
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406589, [1.8][compiler][codegen] super call misdispatched
public void test026() {
this.runConformTest(
new String[] {
@@ -625,11 +625,11 @@ public void test026() {
" }\n" +
"}\n",
},
- "Y.foo(1234,4321)\n" +
- "X.foo(1234,4321)\n" +
+ "Y.foo(1234,4321)\n" +
+ "X.foo(1234,4321)\n" +
"5555");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406589, [1.8][compiler][codegen] super call misdispatched
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406589, [1.8][compiler][codegen] super call misdispatched
public void test027() {
this.runConformTest(
new String[] {
@@ -665,11 +665,11 @@ public void test027() {
" }\n" +
"}\n",
},
- "I.foo(1234,4321)\n" +
- "5555\n" +
+ "I.foo(1234,4321)\n" +
+ "5555\n" +
"Exception");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406584, Bug 406584 - [1.8][compiler][codegen] ClassFormatError: Invalid method signature
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406584, Bug 406584 - [1.8][compiler][codegen] ClassFormatError: Invalid method signature
public void test028() {
this.runConformTest(
new String[] {
@@ -686,10 +686,10 @@ public void test028() {
" }\n" +
"}\n",
},
- "deadbeef\n" +
+ "deadbeef\n" +
"feedface");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406588, [1.8][compiler][codegen] java.lang.invoke.LambdaConversionException: Incorrect number of parameters for static method newinvokespecial
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406588, [1.8][compiler][codegen] java.lang.invoke.LambdaConversionException: Incorrect number of parameters for static method newinvokespecial
public void test029() {
this.runConformTest(
new String[] {
@@ -722,11 +722,11 @@ public void test029() {
" }\n" +
"}\n",
},
- "beeffeed\n" +
- "feedface\n" +
+ "beeffeed\n" +
+ "feedface\n" +
"deadbeef");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406588, [1.8][compiler][codegen] java.lang.invoke.LambdaConversionException: Incorrect number of parameters for static method newinvokespecial
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406588, [1.8][compiler][codegen] java.lang.invoke.LambdaConversionException: Incorrect number of parameters for static method newinvokespecial
public void test030() {
this.runConformTest(
new String[] {
@@ -751,7 +751,7 @@ public void test030() {
},
"class Y");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406588, [1.8][compiler][codegen] java.lang.invoke.LambdaConversionException: Incorrect number of parameters for static method newinvokespecial
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406588, [1.8][compiler][codegen] java.lang.invoke.LambdaConversionException: Incorrect number of parameters for static method newinvokespecial
public void test031() {
this.runConformTest(
new String[] {
@@ -785,7 +785,7 @@ public void test031() {
},
"deadbeef");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406588, [1.8][compiler][codegen] java.lang.invoke.LambdaConversionException: Incorrect number of parameters for static method newinvokespecial
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406588, [1.8][compiler][codegen] java.lang.invoke.LambdaConversionException: Incorrect number of parameters for static method newinvokespecial
public void test032() {
this.runConformTest(
new String[] {
@@ -819,7 +819,7 @@ public void test032() {
},
"deadbeef");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406588, [1.8][compiler][codegen] java.lang.invoke.LambdaConversionException: Incorrect number of parameters for static method newinvokespecial
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406588, [1.8][compiler][codegen] java.lang.invoke.LambdaConversionException: Incorrect number of parameters for static method newinvokespecial
public void test033() {
this.runConformTest(
new String[] {
@@ -856,7 +856,7 @@ public void test033() {
},
"beefface");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406319, [1.8][compiler][codegen] Generate code for enclosing instance capture in lambda methods.
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406319, [1.8][compiler][codegen] Generate code for enclosing instance capture in lambda methods.
public void test034() {
this.runConformTest(
new String[] {
@@ -878,7 +878,7 @@ public void test034() {
},
"5555");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406319, [1.8][compiler][codegen] Generate code for enclosing instance capture in lambda methods.
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406319, [1.8][compiler][codegen] Generate code for enclosing instance capture in lambda methods.
public void test035() {
this.runConformTest(
new String[] {
@@ -905,7 +905,7 @@ public void test035() {
},
"OK");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406319, [1.8][compiler][codegen] Generate code for enclosing instance capture in lambda methods.
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406319, [1.8][compiler][codegen] Generate code for enclosing instance capture in lambda methods.
public void test036() {
this.runConformTest(
new String[] {
@@ -954,7 +954,7 @@ public void test036() {
},
"Lambda code generation with instance and local capture works fine in the eclipse compiler");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406319, [1.8][compiler][codegen] Generate code for enclosing instance capture in lambda methods.
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406319, [1.8][compiler][codegen] Generate code for enclosing instance capture in lambda methods.
public void test037() {
this.runConformTest(
new String[] {
@@ -1116,7 +1116,7 @@ public void test042() {
"\n" +
"}\n",
},
- "X(123456)\n" +
+ "X(123456)\n" +
"Y(987654)");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406773, [1.8][compiler][codegen] "java.lang.IncompatibleClassChangeError" caused by attempted invocation of private constructor
@@ -1163,8 +1163,8 @@ public void test043() {
"\n" +
"}\n",
},
- "X(123456)\n" +
- "Y(987654)\n" +
+ "X(123456)\n" +
+ "Y(987654)\n" +
"Z(456789)");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406773, [1.8][compiler][codegen] "java.lang.IncompatibleClassChangeError" caused by attempted invocation of private constructor
@@ -1214,8 +1214,8 @@ public void test044() {
" }\n" +
"}\n",
},
- "X(123456)\n" +
- "Y(987654)\n" +
+ "X(123456)\n" +
+ "Y(987654)\n" +
"Z(456789)");
}
public void test045() {
@@ -1252,36 +1252,36 @@ public void test045() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " class Y extends X {\n" +
- " ^\n" +
- "The type Y is never used locally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " private Y (int y) {\n" +
- " ^^^^^^^^^\n" +
- "The constructor Y(int) is never used locally\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 10)\n" +
- " Y() {\n" +
- " ^^^\n" +
- "The constructor Y() is never used locally\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 13)\n" +
- " I i = X::new;\n" +
- " ^\n" +
- "The local variable i is hiding a field from type X\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 15)\n" +
- " i = X.Y::new;\n" +
- " ^^^\n" +
- "X.Y cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 27)\n" +
- " new X().new Y().f();\n" +
- " ^\n" +
- "X.Y cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " class Y extends X {\n" +
+ " ^\n" +
+ "The type Y is never used locally\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " private Y (int y) {\n" +
+ " ^^^^^^^^^\n" +
+ "The constructor Y(int) is never used locally\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 10)\n" +
+ " Y() {\n" +
+ " ^^^\n" +
+ "The constructor Y() is never used locally\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 13)\n" +
+ " I i = X::new;\n" +
+ " ^\n" +
+ "The local variable i is hiding a field from type X\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 15)\n" +
+ " i = X.Y::new;\n" +
+ " ^^^\n" +
+ "X.Y cannot be resolved to a type\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 27)\n" +
+ " new X().new Y().f();\n" +
+ " ^\n" +
+ "X.Y cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406760, [1.8][compiler][codegen] "VerifyError: Bad type on operand stack" with qualified super method references
@@ -1319,7 +1319,7 @@ public void test046() {
" }\n" +
"}\n",
},
- "B\'s toString\n" +
+ "B\'s toString\n" +
"X\'s toString");
}
public void test047() {
@@ -1344,10 +1344,10 @@ public void test047() {
" }\n" +
"}\n",
},
- "long = 1234\n" +
- "args length = 0\n" +
- "double = 1234.5678\n" +
- "x = 9876\n" +
+ "long = 1234\n" +
+ "args length = 0\n" +
+ "double = 1234.5678\n" +
+ "x = 9876\n" +
"y = 4321");
}
public void test048() {
@@ -1378,12 +1378,12 @@ public void test048() {
" }\n" +
"}\n",
},
- "long = 1234\n" +
- "args length = 0\n" +
- "double = 1234.5678\n" +
- "x = 9876\n" +
- "y = 4321\n" +
- "Hello !\n" +
+ "long = 1234\n" +
+ "args length = 0\n" +
+ "double = 1234.5678\n" +
+ "x = 9876\n" +
+ "y = 4321\n" +
+ "Hello !\n" +
"World");
}
public void test049() {
@@ -1404,7 +1404,7 @@ public void test049() {
" }\n" +
"}\n",
},
- "Hello\n" +
+ "Hello\n" +
"World!");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406773, [1.8][compiler][codegen] "java.lang.IncompatibleClassChangeError" caused by attempted invocation of private constructor
@@ -1454,14 +1454,14 @@ public void test050() {
" }\n" +
"}\n",
},
- "1246\n" +
- "240\n" +
- "110\n" +
- "11\n" +
- "3\n" +
- "1246\n" +
- "240\n" +
- "110\n" +
+ "1246\n" +
+ "240\n" +
+ "110\n" +
+ "11\n" +
+ "3\n" +
+ "1246\n" +
+ "240\n" +
+ "110\n" +
"11");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406773, [1.8][compiler][codegen] "java.lang.IncompatibleClassChangeError" caused by attempted invocation of private constructor
@@ -1504,14 +1504,14 @@ public void test051() {
" }\n" +
"}"
},
- "A\'s static foo\n" +
+ "A\'s static foo\n" +
"A\'s instance goo");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406773, [1.8][compiler][codegen] "java.lang.IncompatibleClassChangeError" caused by attempted invocation of private constructor
public void test052() {
this.runConformTest(
new String[] {
- "X.java",
+ "X.java",
"interface I {\n" +
" void foo(int x);\n" +
"}\n" +
@@ -1561,8 +1561,8 @@ public void test053() {
" }\n" +
"}\n"
},
- "0 -> A\n" +
- "1 -> B\n" +
+ "0 -> A\n" +
+ "1 -> B\n" +
"2 -> C");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406847, [1.8] lambda code compiles but then produces IncompatibleClassChangeError when run
@@ -1600,7 +1600,7 @@ public void test055() {
" int foo(int x) {\n" +
" return x;\n" +
" }\n" +
- "}\n"
+ "}\n"
},
"");
}
@@ -1624,7 +1624,7 @@ public void test056() {
" int foo(int x) {\n" +
" return x;\n" +
" }\n" +
- "}\n"
+ "}\n"
},
"null");
}
@@ -1686,7 +1686,7 @@ public void test058() {
public void testGenericArrayCreation() {
this.runConformTest(
new String[] {
- "X.java",
+ "X.java",
"interface I {\n" +
" X<?, ?, ?>[] makeArray(int i);\n" +
"}\n" +
@@ -1695,14 +1695,14 @@ public void testGenericArrayCreation() {
" I i = X<?, ?, ?>[]::new; // OK.\n" +
" System.out.println(i.makeArray(1024).length);\n" +
" }\n" +
- "}\n" +
+ "}\n" +
""
},
"1024"
);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=421536, [1.8][compiler] Verify error with small program when preserved unused variables is off.
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=421536, [1.8][compiler] Verify error with small program when preserved unused variables is off.
public void test421536() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
@@ -1720,12 +1720,12 @@ public void test421536() {
" System.out.println(\"OK\");\n" +
" }\n" +
"}\n"
- },
+ },
"OK",
- customOptions);
+ customOptions);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=421536, [1.8][compiler] Verify error with small program when preserved unused variables is off.
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=421536, [1.8][compiler] Verify error with small program when preserved unused variables is off.
public void test421536a() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
@@ -1744,12 +1744,12 @@ public void test421536a() {
" System.out.println(\"OK\");\n" +
" }\n" +
"}\n"
- },
+ },
"OK",
- customOptions);
+ customOptions);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=421607, [1.8][compiler] Verify Error with intersection casts
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=421607, [1.8][compiler] Verify Error with intersection casts
public void test421607() {
runConformTest(
new String[] {
@@ -1767,8 +1767,8 @@ public void test421607() {
" ((C & I) (I) new C()).foo();\n" +
" }\n" +
"}\n"
- },
- "You will get here");
+ },
+ "You will get here");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=421712, [1.8][compiler] java.lang.NoSuchMethodError with lambda expression in interface default method.
@@ -1792,8 +1792,8 @@ public void test421712() {
" x.foo();\n" +
" }\n" +
"}\n"
- },
- "Lambda instantiated");
+ },
+ "Lambda instantiated");
}
@@ -1801,7 +1801,7 @@ public void test421712() {
public void test422515() {
this.runConformTest(
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" public static void main(String[] args) throws InterruptedException {\n" +
" final int[] result = { 0 };\n" +
@@ -1820,7 +1820,7 @@ public void test422515() {
public void test422515a() {
this.runConformTest(
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" public static void main(String[] args) throws InterruptedException {\n" +
" final int[] result= { 0 };\n" +
@@ -1842,7 +1842,7 @@ public void test422515a() {
public void test422800() {
this.runConformTest(
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" private String fField; // must be here; can be used or unused\n" +
" public void foo(Integer arg) {\n" +
@@ -1863,7 +1863,7 @@ public void test422800() {
public void test421927() {
this.runConformTest(
new String[] {
- "X.java",
+ "X.java",
"interface I { \n" +
" int foo();\n" +
"}\n" +
@@ -1949,16 +1949,16 @@ public void testReferenceExpressionInference3b() {
" <V,W extends Number> W bar(V v) { return null; }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " I<X,String> x2s = compose(this::bar, this::i2s);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " I<X,String> x2s = compose(this::bar, this::i2s);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Type mismatch: cannot convert from I<Object,Object> to I<X,String>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " I<X,String> x2s = compose(this::bar, this::i2s);\n" +
- " ^^^^^^^^^\n" +
- "The type X does not define i2s(Object) that is applicable here\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " I<X,String> x2s = compose(this::bar, this::i2s);\n" +
+ " ^^^^^^^^^\n" +
+ "The type X does not define i2s(Object) that is applicable here\n" +
"----------\n");
}
public void testLambdaInference1() {
@@ -2012,20 +2012,20 @@ public void testBug419048_1() {
"import java.util.stream.*;\n" +
"public class X {\n" +
" public void test() {\n" +
- " List<Person> roster = new ArrayList<>();\n" +
- " \n" +
- " Map<String, Person> map = \n" +
- " roster\n" +
- " .stream()\n" +
- " .collect(\n" +
- " Collectors.toMap(\n" +
- " p -> p.getLast(),\n" +
- " p -> p\n" +
+ " List<Person> roster = new ArrayList<>();\n" +
+ " \n" +
+ " Map<String, Person> map = \n" +
+ " roster\n" +
+ " .stream()\n" +
+ " .collect(\n" +
+ " Collectors.toMap(\n" +
+ " p -> p.getLast(),\n" +
+ " p -> p\n" +
" ));\n" +
" }\n" +
"}\n" +
- "class Person {\n" +
- " public String getLast() { return null; }\n" +
+ "class Person {\n" +
+ " public String getLast() { return null; }\n" +
"}\n"
});
}
@@ -2039,20 +2039,20 @@ public void testBug419048_2() {
"import java.util.stream.*;\n" +
"public class X {\n" +
" public void test() {\n" +
- " List<Person> roster = new ArrayList<>();\n" +
- " \n" +
- " Map<String, Person> map = \n" +
- " roster\n" +
- " .stream()\n" +
- " .collect(\n" +
- " Collectors.toMap(\n" +
- " Person::getLast,\n" +
- " Function.identity()\n" +
+ " List<Person> roster = new ArrayList<>();\n" +
+ " \n" +
+ " Map<String, Person> map = \n" +
+ " roster\n" +
+ " .stream()\n" +
+ " .collect(\n" +
+ " Collectors.toMap(\n" +
+ " Person::getLast,\n" +
+ " Function.identity()\n" +
" ));\n" +
" }\n" +
"}\n" +
- "class Person {\n" +
- " public String getLast() { return null; }\n" +
+ "class Person {\n" +
+ " public String getLast() { return null; }\n" +
"}\n"
});
}
@@ -2066,24 +2066,24 @@ public void testBug419048_3() {
"import java.util.stream.*;\n" +
"public class X {\n" +
" public void test() {\n" +
- " List<Person> roster = new ArrayList<>();\n" +
- " \n" +
- " Map<String, Person> map = \n" +
- " roster\n" +
- " .stream()\n" +
- " .collect(\n" +
- " Collectors.toMap(\n" +
- " new Function<Person, String>() {\n" +
- " public String apply(Person p) { \n" +
- " return p.getLast(); \n" +
- " } \n" +
- " },\n" +
- " Function.identity()\n" +
+ " List<Person> roster = new ArrayList<>();\n" +
+ " \n" +
+ " Map<String, Person> map = \n" +
+ " roster\n" +
+ " .stream()\n" +
+ " .collect(\n" +
+ " Collectors.toMap(\n" +
+ " new Function<Person, String>() {\n" +
+ " public String apply(Person p) { \n" +
+ " return p.getLast(); \n" +
+ " } \n" +
+ " },\n" +
+ " Function.identity()\n" +
" ));\n" +
" }\n" +
"}\n" +
- "class Person {\n" +
- " public String getLast() { return null; }\n" +
+ "class Person {\n" +
+ " public String getLast() { return null; }\n" +
"}\n"
});
}
@@ -2137,7 +2137,7 @@ public void test423684() {
" }\n" +
" }\n" +
"}\n",
- "mypackage/MyPublicClass.java",
+ "mypackage/MyPublicClass.java",
"package mypackage;\n" +
"class MyPackagePrivateBaseClass {\n" +
" public void doSomething(String input) {\n" +
@@ -2146,39 +2146,39 @@ public void test423684() {
"}\n" +
"public class MyPublicClass extends MyPackagePrivateBaseClass {\n" +
"}\n"
- },
- "first\n" +
- "second\n" +
- "third\n" +
- "first\n" +
- "second\n" +
+ },
+ "first\n" +
+ "second\n" +
+ "third\n" +
+ "first\n" +
+ "second\n" +
"third");
}
public void testBug424742() {
runNegativeTest(
new String[] {
"TestInlineLambdaArray.java",
- "package two.test;\n" +
- "\n" +
- "class TestInlineLambdaArray {\n" +
- " TestInlineLambdaArray h = new TestInlineLambdaArray(x -> x++); // [9]\n" +
- " public TestInlineLambda(FI fi) {}\n" +
- "}\n" +
- "\n" +
- "interface FI {\n" +
- " void foo();\n" +
+ "package two.test;\n" +
+ "\n" +
+ "class TestInlineLambdaArray {\n" +
+ " TestInlineLambdaArray h = new TestInlineLambdaArray(x -> x++); // [9]\n" +
+ " public TestInlineLambda(FI fi) {}\n" +
+ "}\n" +
+ "\n" +
+ "interface FI {\n" +
+ " void foo();\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in TestInlineLambdaArray.java (at line 4)\n" +
- " TestInlineLambdaArray h = new TestInlineLambdaArray(x -> x++); // [9]\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The constructor TestInlineLambdaArray((<no type> x) -> {}) is undefined\n" +
- "----------\n" +
- "2. ERROR in TestInlineLambdaArray.java (at line 5)\n" +
- " public TestInlineLambda(FI fi) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Return type for the method is missing\n" +
+ "----------\n" +
+ "1. ERROR in TestInlineLambdaArray.java (at line 4)\n" +
+ " TestInlineLambdaArray h = new TestInlineLambdaArray(x -> x++); // [9]\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The constructor TestInlineLambdaArray((<no type> x) -> {}) is undefined\n" +
+ "----------\n" +
+ "2. ERROR in TestInlineLambdaArray.java (at line 5)\n" +
+ " public TestInlineLambda(FI fi) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Return type for the method is missing\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=424589, [1.8][compiler] NPE in TypeSystem.getUnannotatedType
@@ -2200,16 +2200,16 @@ public void test424589() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " Set<Z> x = foo(Set::new);\n" +
- " ^\n" +
- "Z cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " Set<Z> x = foo(Set::new);\n" +
- " ^^^\n" +
- "Cannot instantiate the type Set\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " Set<Z> x = foo(Set::new);\n" +
+ " ^\n" +
+ "Z cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " Set<Z> x = foo(Set::new);\n" +
+ " ^^^\n" +
+ "Cannot instantiate the type Set\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425152, [1.8] [compiler] NPE in LambdaExpression.analyzeCode
@@ -2244,11 +2244,11 @@ public void test425512() throws Exception {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " int [] a = (int [] & Cloneable & Serializable) new int[5];\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Arrays are not allowed in intersection cast operator\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " int [] a = (int [] & Cloneable & Serializable) new int[5];\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Arrays are not allowed in intersection cast operator\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=424628, [1.8][compiler] Multiple method references to inherited method throws LambdaConversionException
@@ -2277,7 +2277,7 @@ public void test424628() throws Exception {
},
"123\n123");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425712, [1.8][compiler] Valid program rejected by the compiler.
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425712, [1.8][compiler] Valid program rejected by the compiler.
public void test425712() throws Exception {
this.runConformTest(
new String[] {
@@ -2297,7 +2297,7 @@ public void test425712() throws Exception {
},
"OK");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426074, [1.8][compiler] 18.5.2 Functional interface parameterization inference problem with intersection types.
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426074, [1.8][compiler] 18.5.2 Functional interface parameterization inference problem with intersection types.
public void test426074() throws Exception {
this.runConformTest(
new String[] {
@@ -2317,7 +2317,7 @@ public void test426074() throws Exception {
},
"main");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426411, [1.8][compiler] NoSuchMethodError at runtime due to emission order of casts in intersection casts
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426411, [1.8][compiler] NoSuchMethodError at runtime due to emission order of casts in intersection casts
public void test426411() throws Exception {
this.runConformTest(
new String[] {
@@ -2331,7 +2331,7 @@ public void test426411() throws Exception {
},
"");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426411, [1.8][compiler] NoSuchMethodError at runtime due to emission order of casts in intersection casts
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426411, [1.8][compiler] NoSuchMethodError at runtime due to emission order of casts in intersection casts
public void test426411b() throws Exception {
this.runConformTest(
new String[] {
@@ -2346,7 +2346,7 @@ public void test426411b() throws Exception {
},
"");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426411, [1.8][compiler] NoSuchMethodError at runtime due to emission order of casts in intersection casts
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426411, [1.8][compiler] NoSuchMethodError at runtime due to emission order of casts in intersection casts
public void test426411c() throws Exception {
this.runConformTest(
new String[] {
@@ -2360,7 +2360,7 @@ public void test426411c() throws Exception {
},
"");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426411, [1.8][compiler] NoSuchMethodError at runtime due to emission order of casts in intersection casts
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426411, [1.8][compiler] NoSuchMethodError at runtime due to emission order of casts in intersection casts
public void test426411d() throws Exception {
this.runConformTest(
new String[] {
@@ -2375,7 +2375,7 @@ public void test426411d() throws Exception {
},
"");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426411, [1.8][compiler] NoSuchMethodError at runtime due to emission order of casts in intersection casts
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426411, [1.8][compiler] NoSuchMethodError at runtime due to emission order of casts in intersection casts
public void test426411e() throws Exception {
this.runConformTest(
new String[] {
@@ -2394,7 +2394,7 @@ public void test426411e() throws Exception {
},
"99");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426411, [1.8][compiler] NoSuchMethodError at runtime due to emission order of casts in intersection casts
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426411, [1.8][compiler] NoSuchMethodError at runtime due to emission order of casts in intersection casts
public void test426411f() throws Exception {
this.runConformTest(
new String[] {
@@ -2413,7 +2413,7 @@ public void test426411f() throws Exception {
},
"99");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426086, [1.8] LambdaConversionException when method reference to an inherited method is invoked from sub class
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426086, [1.8] LambdaConversionException when method reference to an inherited method is invoked from sub class
public void test426086() throws Exception {
this.runConformTest(
new String[] {
@@ -2440,7 +2440,7 @@ public void test426086() throws Exception {
},
"9");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426086, [1.8] LambdaConversionException when method reference to an inherited method is invoked from sub class
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426086, [1.8] LambdaConversionException when method reference to an inherited method is invoked from sub class
public void test426086a() throws Exception {
this.runConformTest(
new String[] {
@@ -2477,7 +2477,7 @@ public void test406744a() {
" void foo(Integer a1, Integer a2, String a3);\n" +
"}\n" +
"class Y {\n" +
- " static void m(Number a1, Object... rest) {\n" +
+ " static void m(Number a1, Object... rest) {\n" +
" System.out.println(a1);\n" +
" print(rest);\n" +
" }\n" +
@@ -2506,7 +2506,7 @@ public void test406744b() {
" int foo(Integer a1, Integer a2, String a3);\n" +
"}\n" +
"class Y {\n" +
- " static int m(Number a1, Object... rest) {\n" +
+ " static int m(Number a1, Object... rest) {\n" +
" System.out.println(a1);\n" +
" print(rest);\n" +
" return 1;\n" +
@@ -2536,11 +2536,11 @@ public void test406744c() {
" void foo(Integer a1, Integer a2, String a3);\n" +
"}\n" +
"class Y {\n" +
- " Y(Number a1, Object... rest) {\n" +
+ " Y(Number a1, Object... rest) {\n" +
" System.out.println(a1);\n" +
" print(rest);\n" +
" }\n" +
- " static void m(Number a1, Object... rest) {\n" +
+ " static void m(Number a1, Object... rest) {\n" +
" System.out.println(a1);\n" +
" print(rest);\n" +
" }\n" +
@@ -2569,7 +2569,7 @@ public void test406744d() {
" void foo(int a1, Integer a2, String a3);\n" +
"}\n" +
"interface Y {\n" +
- " static void m(float a1, Object... rest) {\n" +
+ " static void m(float a1, Object... rest) {\n" +
" System.out.println(a1);\n" +
" print(rest);\n" +
" }\n" +
@@ -2630,7 +2630,7 @@ public void test406744f() {
" void foo(Integer a1, Integer a2, String a3);\n" +
"}\n" +
"class Y {\n" +
- " void m(Number a1, Object... rest) {\n" +
+ " void m(Number a1, Object... rest) {\n" +
" System.out.println(a1);\n" +
" print(rest);\n" +
" }\n" +
@@ -2647,7 +2647,7 @@ public void test406744f() {
" public static void main(String [] args) {\n" +
" new X().foo();\n" +
" }\n" +
- " void foo() {\n" +
+ " void foo() {\n" +
" I i = super::m;\n" +
" i.foo(10, 20, \"10, 20\");\n" +
" }\n" +
@@ -2672,7 +2672,7 @@ public void test406744g() {
" }\n" +
"}\n" +
"public class X extends Y {\n" +
- " private void m(Number a1, Object... rest) {\n" +
+ " private void m(Number a1, Object... rest) {\n" +
" System.out.println(a1);\n" +
" print(rest);\n" +
" }\n" +
@@ -2683,7 +2683,7 @@ public void test406744g() {
" public static void main(String [] args) {\n" +
" new X().foo();\n" +
" }\n" +
- " void foo() {\n" +
+ " void foo() {\n" +
" I i = this::m;\n" +
" i.foo(10, 20, \"10, 20\");\n" +
" }\n" +
@@ -2702,7 +2702,7 @@ public void test406744h() {
" void foo(int [] ia);\n" +
"}\n" +
"class Y {\n" +
- " void m(Object... rest) {\n" +
+ " void m(Object... rest) {\n" +
" System.out.println(\"Hello \" + rest.length);\n" +
" }\n" +
" static void print (Object [] o) {\n" +
@@ -2714,7 +2714,7 @@ public void test406744h() {
" public static void main(String [] args) {\n" +
" new X().foo();\n" +
" }\n" +
- " void foo() {\n" +
+ " void foo() {\n" +
" I i = super::m;\n" +
" i.foo(new int [0]);\n" +
" }\n" +
@@ -2734,7 +2734,7 @@ public void test406744i() {
" void foo(int [] ia);\n" +
"}\n" +
"class Y {\n" +
- " void m(Object... rest) {\n" +
+ " void m(Object... rest) {\n" +
" System.out.println(\"Hello \" + rest.length);\n" +
" }\n" +
" static void print (Object [] o) {\n" +
@@ -2746,7 +2746,7 @@ public void test406744i() {
" public static void main(String [] args) {\n" +
" new X().foo();\n" +
" }\n" +
- " void foo() {\n" +
+ " void foo() {\n" +
" I i = super::m;\n" +
" i.foo(new int [0]);\n" +
" I1 i1 = super::m;\n" +
@@ -2766,11 +2766,11 @@ public void test406744j() {
" void foo(int [] ia);\n" +
"}\n" +
"class Y {\n" +
- " void m(Object... rest) {\n" +
+ " void m(Object... rest) {\n" +
" I i = this::n;\n" +
" i.foo(new int [0]);\n" +
" }\n" +
- " void n(Object... rest) {\n" +
+ " void n(Object... rest) {\n" +
" System.out.println(\"Hello \" + rest.length);\n" +
" }\n" +
" static void print (Object [] o) {\n" +
@@ -2782,7 +2782,7 @@ public void test406744j() {
" public static void main(String [] args) {\n" +
" new X().foo();\n" +
" }\n" +
- " void foo() {\n" +
+ " void foo() {\n" +
" I i = super::m;\n" +
" i.foo(new int [0]);\n" +
" }\n" +
@@ -2799,7 +2799,7 @@ public void test406744k() {
" void foo(int [] ia);\n" +
"}\n" +
"class Y {\n" +
- " static void m(Object... rest) {\n" +
+ " static void m(Object... rest) {\n" +
" System.out.println(\"Hello \" + rest.length);\n" +
" }\n" +
" static void print (Object [] o) {\n" +
@@ -2812,7 +2812,7 @@ public void test406744k() {
" public static void main(String [] args) {\n" +
" new X().foo();\n" +
" }\n" +
- " void foo() {\n" +
+ " void foo() {\n" +
" I i = Y::m;\n" +
" i.foo(new int [0]);\n" +
" i = Y1::m;\n" +
@@ -3035,7 +3035,7 @@ public void test406744t() {
" }\n" +
"}\n",
},
- "Hello\n" +
+ "Hello\n" +
"Y::Y"
);
}
@@ -3062,7 +3062,7 @@ public void test406744u() {
" }\n" +
"}\n",
},
- "Hello\n" +
+ "Hello\n" +
"Y::Y"
);
}
@@ -3089,7 +3089,7 @@ public void test406744v() {
" }\n" +
"}\n",
},
- "X::X\n" +
+ "X::X\n" +
"X::X"
);
}
@@ -3118,7 +3118,7 @@ public void test406744w() {
" new B().new Y().g();\n" +
" }\n" +
"}\n",
- "p1/A.java",
+ "p1/A.java",
"package p1;\n" +
"import p2.*;\n" +
"public class A {\n" +
@@ -3130,7 +3130,7 @@ public void test406744w() {
" }\n" +
"}\n"
},
- "A\'s static foo\n" +
+ "A\'s static foo\n" +
"A\'s instance goo"
);
}
@@ -3465,7 +3465,7 @@ public void test429112() {
" }\n" +
"}\n"
},
- "class [[[Ljava.lang.String;\n" +
+ "class [[[Ljava.lang.String;\n" +
"10");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429112, [1.8][compiler] Exception when compiling Serializable array constructor reference
@@ -3486,7 +3486,7 @@ public void test429112a() {
" }\n" +
"}\n"
},
- "class [[[Ljava.util.function.IntFunction;\n" +
+ "class [[[Ljava.util.function.IntFunction;\n" +
"10");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429112, [1.8][compiler] Exception when compiling Serializable array constructor reference
@@ -3507,7 +3507,7 @@ public void test429112b() {
" }\n" +
"}\n"
},
- "class [Ljava.util.function.IntFunction;\n" +
+ "class [Ljava.util.function.IntFunction;\n" +
"10");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429112, [1.8][compiler] Exception when compiling Serializable array constructor reference
@@ -3528,7 +3528,7 @@ public void test429112c() {
" }\n" +
"}\n"
},
- "class [Ljava.lang.String;\n" +
+ "class [Ljava.lang.String;\n" +
"10");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428857, [1.8] Method reference to instance method of generic class incorrectly gives raw type warning
@@ -3620,7 +3620,7 @@ public void test428857c() {
"[a, b]",
customOptions);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429763, [1.8][compiler] Incompatible type specified for lambda expression's parameter
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429763, [1.8][compiler] Incompatible type specified for lambda expression's parameter
public void test429763() {
this.runConformTest(
new String[] {
@@ -3643,7 +3643,7 @@ public void test429763() {
},
"NPE");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429763, [1.8][compiler] Incompatible type specified for lambda expression's parameter
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429763, [1.8][compiler] Incompatible type specified for lambda expression's parameter
public void test429763a() {
this.runConformTest(
new String[] {
@@ -3735,7 +3735,7 @@ public void test429969() {
},
"done");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430015, [1.8] NPE trying to disassemble classfile with lambda method and MethodParameters
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430015, [1.8] NPE trying to disassemble classfile with lambda method and MethodParameters
public void test430015() {
this.runConformTest(
new String[] {
@@ -3761,7 +3761,7 @@ public void test430015() {
},
"[int arg0]");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430040, [1.8] [compiler] Type Type mismatch: cannot convert from Junk13.ExpressionHelper<Object> to Junk13.ExpressionHelper<Object>
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430040, [1.8] [compiler] Type Type mismatch: cannot convert from Junk13.ExpressionHelper<Object> to Junk13.ExpressionHelper<Object>
public void test430040() {
this.runConformTest(
new String[] {
@@ -3794,7 +3794,7 @@ public void test430040() {
},
"OK");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430043, [1.8][compiler] Cannot infer type arguments for Junk14<>
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430043, [1.8][compiler] Cannot infer type arguments for Junk14<>
public void test430043() {
this.runConformTest(
new String[] {
@@ -3830,7 +3830,7 @@ public void test430043() {
},
"OK");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430035, [1.8][compiler][codegen] Bridge methods are not generated for lambdas/method references
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430035, [1.8][compiler][codegen] Bridge methods are not generated for lambdas/method references
public void test430035() {
this.runConformTest(
new String[] {
@@ -3848,15 +3848,15 @@ public void test430035() {
" }\n" +
"}\n"
},
- "m(direct call)\n" +
+ "m(direct call)\n" +
"m(bridge method)");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430035, [1.8][compiler][codegen] Bridge methods are not generated for lambdas/method references
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430035, [1.8][compiler][codegen] Bridge methods are not generated for lambdas/method references
public void test430035a() { // test reference expressions requiring bridges.
this.runConformTest(
new String[] {
"X.java",
- "import java.util.function.Consumer;\n" +
+ "import java.util.function.Consumer;\n" +
"public class X {\n" +
" interface StringConsumer extends Consumer<String> {\n" +
" void accept(String t);\n" +
@@ -3870,10 +3870,10 @@ public void test430035a() { // test reference expressions requiring bridges.
" }\n" +
"}\n"
},
- "m(direct call)\n" +
+ "m(direct call)\n" +
"m(bridge method)");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430035, [1.8][compiler][codegen] Bridge methods are not generated for lambdas/method references
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430035, [1.8][compiler][codegen] Bridge methods are not generated for lambdas/method references
public void test430035b() {
this.runConformTest(
new String[] {
@@ -3901,7 +3901,7 @@ public void test430035b() {
"m(bridge method)\n" +
"m(bridge method)");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430035, [1.8][compiler][codegen] Bridge methods are not generated for lambdas/method references
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430035, [1.8][compiler][codegen] Bridge methods are not generated for lambdas/method references
public void test430035c() {
this.runConformTest(
new String[] {
@@ -3926,11 +3926,11 @@ public void test430035c() {
" }\n" +
"}\n"
},
- "m(direct call)\n" +
- "m(bridge method(j))\n" +
+ "m(direct call)\n" +
+ "m(bridge method(j))\n" +
"m(bridge method(i))");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430035, [1.8][compiler][codegen] Bridge methods are not generated for lambdas/method references
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430035, [1.8][compiler][codegen] Bridge methods are not generated for lambdas/method references
public void test430035d() { // 8b131 complains of ambiguity.
this.runConformTest(
false,
@@ -3956,11 +3956,11 @@ public void test430035d() { // 8b131 complains of ambiguity.
" }\n" +
"}\n"
},
- "m(direct call)\n" +
- "m(bridge method(j))\n" +
+ "m(direct call)\n" +
+ "m(bridge method(j))\n" +
"m(bridge method(i))");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430035, [1.8][compiler][codegen] Bridge methods are not generated for lambdas/method references
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430035, [1.8][compiler][codegen] Bridge methods are not generated for lambdas/method references
public void test430035e() { // 8b131 complains of ambiguity in call.
this.runConformTest(
false,
@@ -3986,11 +3986,11 @@ public void test430035e() { // 8b131 complains of ambiguity in call.
" }\n" +
"}\n"
},
- "direct call\n" +
- "bridge method(j)\n" +
+ "direct call\n" +
+ "bridge method(j)\n" +
"bridge method(i)");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430035, [1.8][compiler][codegen] Bridge methods are not generated for lambdas/method references
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430035, [1.8][compiler][codegen] Bridge methods are not generated for lambdas/method references
public void test430035f() { // ensure co-variant return emits a bridge request.
this.runConformTest(
new String[] {
@@ -4014,8 +4014,8 @@ public void test430035f() { // ensure co-variant return emits a bridge request.
" }\n" +
"}\n"
},
- "direct call\n" +
- "bridge method(j)\n" +
+ "direct call\n" +
+ "bridge method(j)\n" +
"bridge method(i)");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430241, [1.8][compiler] Raw return type results in incorrect covariant return bridge request to LambdaMetaFactory
@@ -4203,7 +4203,7 @@ public void test432682() throws Exception {
},
"true");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=432520, compiler "duplicate method" bug with lamdas and generic interfaces
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=432520, compiler "duplicate method" bug with lamdas and generic interfaces
public void test432520() throws Exception {
this.runConformTest(
new String[] {
@@ -4224,7 +4224,7 @@ public void test432520() throws Exception {
},
"");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=432625, [1.8] VerifyError with lambdas and wildcards
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=432625, [1.8] VerifyError with lambdas and wildcards
public void test432625() throws Exception {
this.runConformTest(
new String[] {
@@ -4265,16 +4265,16 @@ public void test430766() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 17)\n" +
- " persons.sort(Comparator.comparing(Comparator.nullsLast(Person::getEmail)));\n" +
- " ^^^^^^^^^\n" +
- "The method nullsLast(Comparator<? super T>) in the type Comparator is not applicable for the arguments (Person::getEmail)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 17)\n" +
- " persons.sort(Comparator.comparing(Comparator.nullsLast(Person::getEmail)));\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type X.Person does not define getEmail(T, T) that is applicable here\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 17)\n" +
+ " persons.sort(Comparator.comparing(Comparator.nullsLast(Person::getEmail)));\n" +
+ " ^^^^^^^^^\n" +
+ "The method nullsLast(Comparator<? super T>) in the type Comparator is not applicable for the arguments (Person::getEmail)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 17)\n" +
+ " persons.sort(Comparator.comparing(Comparator.nullsLast(Person::getEmail)));\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type X.Person does not define getEmail(T, T) that is applicable here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430766, [1.8] Internal compiler error.
@@ -4307,16 +4307,16 @@ public void test430766a() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 21)\n" +
- " persons.sort(Comparator.comparing(Comparator.nullsLast(Person::<Runnable>isRunnable)));\n" +
- " ^^^^^^^^^\n" +
- "The method nullsLast(Comparator<? super T>) in the type Comparator is not applicable for the arguments (Person::<Runnable>isRunnable)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 21)\n" +
- " persons.sort(Comparator.comparing(Comparator.nullsLast(Person::<Runnable>isRunnable)));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The type X.Person does not define isRunnable(T, T) that is applicable here\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 21)\n" +
+ " persons.sort(Comparator.comparing(Comparator.nullsLast(Person::<Runnable>isRunnable)));\n" +
+ " ^^^^^^^^^\n" +
+ "The method nullsLast(Comparator<? super T>) in the type Comparator is not applicable for the arguments (Person::<Runnable>isRunnable)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 21)\n" +
+ " persons.sort(Comparator.comparing(Comparator.nullsLast(Person::<Runnable>isRunnable)));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The type X.Person does not define isRunnable(T, T) that is applicable here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=431190, [1.8] VerifyError when using a method reference
@@ -4347,20 +4347,20 @@ public void test431514() {
this.runConformTest(
new String[] {
"X.java",
- "class X {\n" +
- " void fun1(int x) {\n" +
- " class Local {\n" +
- " FI test= () -> {\n" +
- " try {\n" +
+ "class X {\n" +
+ " void fun1(int x) {\n" +
+ " class Local {\n" +
+ " FI test= () -> {\n" +
+ " try {\n" +
" } catch (Exception e) {\n" +
" int x;\n" +
- " };\n" +
- " };\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "interface FI {\n" +
- " void foo();\n" +
+ " };\n" +
+ " };\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "interface FI {\n" +
+ " void foo();\n" +
"}"
});
}
@@ -4369,21 +4369,21 @@ public void test431514a() {
this.runConformTest(
new String[] {
"X.java",
- "class X {\n" +
- " void fun1(int x) {\n" +
- " class Local {\n" +
- " class L1 { }\n" +
- " int y;\n" +
- " FI test= () -> {\n" +
- " class L1 { } \n" +
- " int y; \n" +
- " };\n" +
- " }\n" +
- " }\n" +
- " \n" +
- "}\n" +
- "interface FI {\n" +
- " void foo();\n" +
+ "class X {\n" +
+ " void fun1(int x) {\n" +
+ " class Local {\n" +
+ " class L1 { }\n" +
+ " int y;\n" +
+ " FI test= () -> {\n" +
+ " class L1 { } \n" +
+ " int y; \n" +
+ " };\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ "}\n" +
+ "interface FI {\n" +
+ " void foo();\n" +
"}"
});
}
@@ -4391,19 +4391,19 @@ public void test431514a() {
public void test432531() {
this.runConformTest(
new String[] {
- "Y.java",
- "import java.util.function.Supplier;\n" +
- "class E {\n" +
- " E(Supplier<Object> factory) { }\n" +
- "}\n" +
- "public class Y extends E {\n" +
- " Y() {\n" +
- " super(() -> new Object() {\n" +
- " });\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new Y();\n" +
- " }\n" +
+ "Y.java",
+ "import java.util.function.Supplier;\n" +
+ "class E {\n" +
+ " E(Supplier<Object> factory) { }\n" +
+ "}\n" +
+ "public class Y extends E {\n" +
+ " Y() {\n" +
+ " super(() -> new Object() {\n" +
+ " });\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new Y();\n" +
+ " }\n" +
"}"
});
}
@@ -4411,27 +4411,27 @@ public void test432531() {
public void test434297() {
this.runConformTest(
new String[] {
- "X.java",
- "import java.util.ArrayList;\n" +
- "import java.util.Collection;\n" +
- "import java.util.Collections;\n" +
- "import java.util.Comparator;\n" +
- "import java.util.List;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public void bla() {\n" +
- " boolean b = Boolean.TRUE.booleanValue();\n" +
- " List<String> c1 = new ArrayList<>();\n" +
- " Collections.sort(c1, b ? null : new Bar(new ArrayList<>(),Comparator.nullsLast((a,e) -> {return 0;})));\n" +
- " }\n" +
- " private static class Bar implements Comparator<String>{\n" +
- " public <T> Bar(Collection<T> col, Comparator<T> comp) { }\n" +
- " @Override\n" +
- " public int compare(String o1, String o2) {\n" +
- " return 0;\n" +
- " }\n" +
- " }\n" +
+ "X.java",
+ "import java.util.ArrayList;\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.Collections;\n" +
+ "import java.util.Comparator;\n" +
+ "import java.util.List;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
+ " public void bla() {\n" +
+ " boolean b = Boolean.TRUE.booleanValue();\n" +
+ " List<String> c1 = new ArrayList<>();\n" +
+ " Collections.sort(c1, b ? null : new Bar(new ArrayList<>(),Comparator.nullsLast((a,e) -> {return 0;})));\n" +
+ " }\n" +
+ " private static class Bar implements Comparator<String>{\n" +
+ " public <T> Bar(Collection<T> col, Comparator<T> comp) { }\n" +
+ " @Override\n" +
+ " public int compare(String o1, String o2) {\n" +
+ " return 0;\n" +
+ " }\n" +
+ " }\n" +
"}"
});
}
@@ -4440,35 +4440,35 @@ public void test436542() throws Exception {
this.runConformTest(
new String[] {
"Utility.java",
- "import java.util.Collection;\n" +
- "import java.util.List;\n" +
- "import java.util.function.Function;\n" +
- "import java.util.stream.Collectors;\n" +
- "public class Utility {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"Success\");\n" +
- " }\n" +
- " public static <T, R> List<R> mapList(Collection<T> original, Function<T, R> func) {\n" +
- " return original.stream().map(func).collect(Collectors.toList());\n" +
- " }\n" +
- " public static <S, T> void bindMap(List<T> dest, ObservableList<S> src, Function<S, T> func) {\n" +
- " dest.addAll(mapList(src, func));\n" +
- " src.addListener((ListChangeListener<S>) changes -> {\n" +
- " for (int i = changes.getFrom(); i < changes.getTo(); i++)\n" +
- " dest.set(i, func.apply(src.get(i)));\n" +
- " });\n" +
- " }\n" +
- " public interface ObservableList<E> extends List<E> {\n" +
- " public void addListener(ListChangeListener<? super E> listener);\n" +
- " }\n" +
- " @FunctionalInterface\n" +
- " public interface ListChangeListener<E> {\n" +
- " public abstract static class Change<E> {\n" +
- " public abstract int getFrom();\n" +
- " public abstract int getTo();\n" +
- " }\n" +
- " public void onChanged(Change<? extends E> c);\n" +
- " }\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.List;\n" +
+ "import java.util.function.Function;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "public class Utility {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"Success\");\n" +
+ " }\n" +
+ " public static <T, R> List<R> mapList(Collection<T> original, Function<T, R> func) {\n" +
+ " return original.stream().map(func).collect(Collectors.toList());\n" +
+ " }\n" +
+ " public static <S, T> void bindMap(List<T> dest, ObservableList<S> src, Function<S, T> func) {\n" +
+ " dest.addAll(mapList(src, func));\n" +
+ " src.addListener((ListChangeListener<S>) changes -> {\n" +
+ " for (int i = changes.getFrom(); i < changes.getTo(); i++)\n" +
+ " dest.set(i, func.apply(src.get(i)));\n" +
+ " });\n" +
+ " }\n" +
+ " public interface ObservableList<E> extends List<E> {\n" +
+ " public void addListener(ListChangeListener<? super E> listener);\n" +
+ " }\n" +
+ " @FunctionalInterface\n" +
+ " public interface ListChangeListener<E> {\n" +
+ " public abstract static class Change<E> {\n" +
+ " public abstract int getFrom();\n" +
+ " public abstract int getTo();\n" +
+ " }\n" +
+ " public void onChanged(Change<? extends E> c);\n" +
+ " }\n" +
"}",
},
"Success",
@@ -4495,7 +4495,7 @@ public void test436542() throws Exception {
public void test439515() {
this.runConformTest(
new String[] {
- "X.java",
+ "X.java",
"interface Fun<T, R> {\n" +
" R apply(T arg);\n" +
"}\n" +
@@ -4522,7 +4522,7 @@ public void test439515() {
public void test439515a() {
this.runConformTest(
new String[] {
- "X.java",
+ "X.java",
"interface Fun<T, R> {\n" +
" R apply(T arg);\n" +
"}\n" +
@@ -4548,26 +4548,26 @@ public void test439515a() {
public void test438534() {
this.runConformTest(
new String[] {
- "ByteCodeTest.java",
- "import java.lang.reflect.Method;\n" +
- "import java.security.AccessController;\n" +
- "import java.security.PrivilegedAction;\n" +
- "import java.util.Collections;\n" +
- "import java.util.Comparator;\n" +
- "public class ByteCodeTest {\n" +
- " public static class BrokenByteCode {\n" +
- " public void hello() {\n" +
- " Collections.sort(Collections.<String> emptyList(), Comparator.comparing((String data) -> data.length()));\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " for (Method method : AccessController.doPrivileged((PrivilegedAction<Method[]>) () -> BrokenByteCode.class.getDeclaredMethods())) {\n" +
- " method.getGenericExceptionTypes();\n" +
- " method.getGenericParameterTypes();\n" +
- " method.getGenericReturnType();\n" +
- " }\n" +
+ "ByteCodeTest.java",
+ "import java.lang.reflect.Method;\n" +
+ "import java.security.AccessController;\n" +
+ "import java.security.PrivilegedAction;\n" +
+ "import java.util.Collections;\n" +
+ "import java.util.Comparator;\n" +
+ "public class ByteCodeTest {\n" +
+ " public static class BrokenByteCode {\n" +
+ " public void hello() {\n" +
+ " Collections.sort(Collections.<String> emptyList(), Comparator.comparing((String data) -> data.length()));\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " for (Method method : AccessController.doPrivileged((PrivilegedAction<Method[]>) () -> BrokenByteCode.class.getDeclaredMethods())) {\n" +
+ " method.getGenericExceptionTypes();\n" +
+ " method.getGenericParameterTypes();\n" +
+ " method.getGenericReturnType();\n" +
+ " }\n" +
" System.out.println(\"SUCCESS\");\n" +
- " }\n" +
+ " }\n" +
"}\n"
},
"SUCCESS");
@@ -4577,16 +4577,16 @@ public void test440152() {
this.runConformTest(
new String[] {
"Foo.java",
- "import java.util.function.Function;\n" +
- "interface Foo {void alpha(Bar pBar);}\n" +
- "class Bar {Object bravo() {return null;}}\n" +
- "class Test {\n" +
- " Test(Function pFunction) {\n" +
- " class Baz {public Baz(Object pObj) {pFunction.apply(pObj);}}\n" +
- " delta(pBar -> charlie(new Baz(pBar.bravo())));\n" +
- " }\n" +
- " void charlie(Object pRemovals) {}\n" +
- " void delta(Foo pListener) {}\n" +
+ "import java.util.function.Function;\n" +
+ "interface Foo {void alpha(Bar pBar);}\n" +
+ "class Bar {Object bravo() {return null;}}\n" +
+ "class Test {\n" +
+ " Test(Function pFunction) {\n" +
+ " class Baz {public Baz(Object pObj) {pFunction.apply(pObj);}}\n" +
+ " delta(pBar -> charlie(new Baz(pBar.bravo())));\n" +
+ " }\n" +
+ " void charlie(Object pRemovals) {}\n" +
+ " void delta(Foo pListener) {}\n" +
"}"
});
}
@@ -4595,25 +4595,25 @@ public void test440152a() {
this.runConformTest(
new String[] {
"Foo.java",
- "import java.util.function.Function;\n" +
- "interface Foo {void alpha(Bar pBar);}\n" +
- "class Bar {Object bravo() {return null;}}\n" +
- "class Test {\n" +
- " Test(Function pFunction) {\n" +
- " class Baz {\n" +
- " public Baz(Object pObj) {\n" +
- " }\n" +
- " class NestedBaz extends Baz {\n" +
- " NestedBaz(Object pObj) {\n" +
- " super(pObj);\n" +
- " pFunction.apply(pObj);\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " delta(pBar -> charlie(new Baz(pBar).new NestedBaz(pBar.bravo())));\n" +
- " }\n" +
- " void charlie(Object pRemovals) {}\n" +
- " void delta(Foo pListener) {}\n" +
+ "import java.util.function.Function;\n" +
+ "interface Foo {void alpha(Bar pBar);}\n" +
+ "class Bar {Object bravo() {return null;}}\n" +
+ "class Test {\n" +
+ " Test(Function pFunction) {\n" +
+ " class Baz {\n" +
+ " public Baz(Object pObj) {\n" +
+ " }\n" +
+ " class NestedBaz extends Baz {\n" +
+ " NestedBaz(Object pObj) {\n" +
+ " super(pObj);\n" +
+ " pFunction.apply(pObj);\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " delta(pBar -> charlie(new Baz(pBar).new NestedBaz(pBar.bravo())));\n" +
+ " }\n" +
+ " void charlie(Object pRemovals) {}\n" +
+ " void delta(Foo pListener) {}\n" +
"}\n"
});
}
@@ -4639,7 +4639,7 @@ public void test432110() {
" System.out.println(\"OK\");\n" +
" }\n" +
"}\n",
- },
+ },
"OK");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=441929, [1.8][compiler] @SuppressWarnings("unchecked") not accepted on local variable
@@ -4666,7 +4666,7 @@ public void test441929() {
" });\n" +
" }\n" +
"}\n",
- },
+ },
"");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=437781, [1.8][compiler] Eclipse accepts code rejected by javac because of ambiguous method reference
@@ -4689,16 +4689,16 @@ public void test437781() {
" } \n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " new X().visit( System.out::println );\n" +
- " ^^^^^\n" +
- "The method visit(Function<Integer,Boolean>) is ambiguous for the type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " new X().visit( System.out::println );\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The type of println(Object) from the type PrintStream is void, this is incompatible with the descriptor\'s return type: Boolean\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " new X().visit( System.out::println );\n" +
+ " ^^^^^\n" +
+ "The method visit(Function<Integer,Boolean>) is ambiguous for the type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " new X().visit( System.out::println );\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The type of println(Object) from the type PrintStream is void, this is incompatible with the descriptor\'s return type: Boolean\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=443889, [1.8][compiler] Lambdas get compiled to duplicate methods
@@ -4736,11 +4736,11 @@ public void test443889() {
" }\n" +
"}\n"
},
- "BEFORE\n" +
- "DISP: Salomon 42\n" +
+ "BEFORE\n" +
+ "DISP: Salomon 42\n" +
"AFTER");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=441907, [1.8][compiler] Eclipse 4.4.x compiler generics bugs with streams and lambdas
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=441907, [1.8][compiler] Eclipse 4.4.x compiler generics bugs with streams and lambdas
public void test441907() {
this.runConformTest(
new String[] {
@@ -4770,7 +4770,7 @@ public void test441907() {
},
"");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=444773, [1.8][compiler] NullPointerException in LambdaExpression.analyseCode
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=444773, [1.8][compiler] NullPointerException in LambdaExpression.analyseCode
public void test444773() {
this.runConformTest(
new String[] {
@@ -4798,7 +4798,7 @@ public void test444773() {
},
"");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=444772, [1.8][compiler] NullPointerException in ReferenceExpression.shouldGenerateImplicitLambda
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=444772, [1.8][compiler] NullPointerException in ReferenceExpression.shouldGenerateImplicitLambda
public void test444772() {
this.runConformTest(
new String[] {
@@ -4903,7 +4903,7 @@ public void test444785() {
},
"");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=447119, [1.8][compiler] method references lost generic type information (4.4 -> 4.4.1 regression)
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=447119, [1.8][compiler] method references lost generic type information (4.4 -> 4.4.1 regression)
public void test447119() {
Runner runner = new Runner();
runner.testFiles =
@@ -4933,7 +4933,7 @@ public void test447119() {
"- interface java.util.List lambda$main$0([interface java.util.List])";
runner.runConformTest();
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=447119, [1.8][compiler] method references lost generic type information (4.4 -> 4.4.1 regression)
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=447119, [1.8][compiler] method references lost generic type information (4.4 -> 4.4.1 regression)
public void test447119a() {
this.runConformTest(
new String[] {
@@ -4958,7 +4958,7 @@ public void test447119a() {
},
"");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=447119, [1.8][compiler] method references lost generic type information (4.4 -> 4.4.1 regression)
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=447119, [1.8][compiler] method references lost generic type information (4.4 -> 4.4.1 regression)
public void test447119b() {
Runner runner = new Runner();
runner.testFiles =
@@ -4990,7 +4990,7 @@ public void test447119b() {
"- interface java.util.List lambda$main$7796d039$1([interface java.util.List])";
runner.runConformTest();
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=447119, [1.8][compiler] method references lost generic type information (4.4 -> 4.4.1 regression)
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=447119, [1.8][compiler] method references lost generic type information (4.4 -> 4.4.1 regression)
public void test447119c() {
this.runConformTest(
new String[] {
@@ -5017,7 +5017,7 @@ public void test447119c() {
},
"- java.util.List<java.lang.String> foo([java.util.List<java.lang.String>])");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=447119, [1.8][compiler] method references lost generic type information (4.4 -> 4.4.1 regression)
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=447119, [1.8][compiler] method references lost generic type information (4.4 -> 4.4.1 regression)
public void test447119d() {
this.runConformTest(
new String[] {
@@ -5056,17 +5056,17 @@ public void test447119d() {
" }\n" +
"}\n"
},
- "Lambda binds to: X.noop\n" +
- "Methods (with generics):\n" +
+ "Lambda binds to: X.noop\n" +
+ "Methods (with generics):\n" +
"[- java.util.List<java.lang.String> noop(java.util.List<java.lang.String>)]",
null,
true,
- (isJRE9Plus
- ? new String[] { "--add-opens", "java.base/java.io=ALL-UNNAMED" }
+ (isJRE9Plus
+ ? new String[] { "--add-opens", "java.base/java.io=ALL-UNNAMED" }
: new String [] { "-Ddummy" }) // Not sure, unless we force the VM to not be reused by passing dummy vm argument, the generated program aborts midway through its execution.
);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=447119, [1.8][compiler] method references lost generic type information (4.4 -> 4.4.1 regression)
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=447119, [1.8][compiler] method references lost generic type information (4.4 -> 4.4.1 regression)
public void test447119e() {
this.runConformTest(
new String[] {
@@ -5095,7 +5095,7 @@ public void test447119e() {
public void test432605() {
this.runConformTest(
new String[] {
- "X.java",
+ "X.java",
"import java.util.ArrayList;\n" +
"import java.util.HashMap;\n" +
"import java.util.function.Function;\n" +
@@ -5152,7 +5152,7 @@ public void test432605() {
public void testreduced432605() {
this.runConformTest(
new String[] {
- "X.java",
+ "X.java",
"import java.util.ArrayList;\n" +
"import java.util.HashMap;\n" +
"import java.util.function.Function;\n" +
@@ -5192,7 +5192,7 @@ public void test448802() throws Exception {
},
"true");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449063, [1.8][compiler] Bring back generic signatures for Lambda Expressions
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449063, [1.8][compiler] Bring back generic signatures for Lambda Expressions
public void test449063() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_LambdaGenericSignature, CompilerOptions.GENERATE);
@@ -5200,30 +5200,30 @@ public void test449063() {
false,
new String[] {
"Test.java",
- "import java.io.Serializable;\n" +
- "import java.lang.invoke.SerializedLambda;\n" +
- "import java.lang.reflect.Method;\n" +
- "import java.lang.reflect.Type;\n" +
- "public class Test {\n" +
- " public static interface Map<IN, OUT> {\n" +
- " public OUT map(IN in);\n" +
- " }\n" +
- " public static class Tuple<T1, T2> {\n" +
- " private T1 field1;\n" +
- " private T2 field2;\n" +
- " }\n" +
- " public static void main(String[] strings) throws Exception {\n" +
- " Map<Tuple<String, Double>, Tuple<Integer, String>> map = (in) -> new Tuple<>();\n" +
- " for(Method m : Test.class.getDeclaredMethods()) {\n" +
- " // Use the type information stored in signature\n" +
+ "import java.io.Serializable;\n" +
+ "import java.lang.invoke.SerializedLambda;\n" +
+ "import java.lang.reflect.Method;\n" +
+ "import java.lang.reflect.Type;\n" +
+ "public class Test {\n" +
+ " public static interface Map<IN, OUT> {\n" +
+ " public OUT map(IN in);\n" +
+ " }\n" +
+ " public static class Tuple<T1, T2> {\n" +
+ " private T1 field1;\n" +
+ " private T2 field2;\n" +
+ " }\n" +
+ " public static void main(String[] strings) throws Exception {\n" +
+ " Map<Tuple<String, Double>, Tuple<Integer, String>> map = (in) -> new Tuple<>();\n" +
+ " for(Method m : Test.class.getDeclaredMethods()) {\n" +
+ " // Use the type information stored in signature\n" +
" if (m.getName().contains(\"lambda\")) {\n" +
- " System.out.println(m.getGenericReturnType());\n" +
- " for (Type t : m.getGenericParameterTypes()) {\n" +
- " System.out.println(t);\n" +
+ " System.out.println(m.getGenericReturnType());\n" +
+ " for (Type t : m.getGenericParameterTypes()) {\n" +
+ " System.out.println(t);\n" +
" }\n" +
" }\n" +
" }\n" +
- " }\n" +
+ " }\n" +
"}"
},
null,
@@ -5237,7 +5237,7 @@ public void test449063() {
null,
EclipseJustification.EclipseBug449063);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449063, [1.8][compiler] Bring back generic signatures for Lambda Expressions
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449063, [1.8][compiler] Bring back generic signatures for Lambda Expressions
public void test449063a() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_LambdaGenericSignature, CompilerOptions.GENERATE);
@@ -5245,61 +5245,61 @@ public void test449063a() {
false,
new String[] {
"Test.java",
- "import java.io.Serializable;\n" +
- "import java.lang.invoke.SerializedLambda;\n" +
- "import java.lang.reflect.Method;\n" +
- "import java.lang.reflect.Type;\n" +
- "public class Test {\n" +
- " public static interface Map<IN, OUT> extends Serializable {\n" +
- " public OUT map(IN in);\n" +
- " }\n" +
- " public static class Tuple<T1, T2> {\n" +
- " private T1 field1;\n" +
- " private T2 field2;\n" +
- " }\n" +
- " public static void main(String[] strings) throws Exception {\n" +
- " Map<Tuple<String, Double>, Tuple<Integer, String>> map = (in) -> new Tuple<>();\n" +
- " SerializedLambda sl = getSerializedLambda(map); \n" +
- " Method m = getLambdaMethod(sl);\n" +
- " // Use the type information stored in signature\n" +
- " System.out.println(m.getGenericReturnType());\n" +
- " for (Type t : m.getGenericParameterTypes()) {\n" +
- " System.out.println(t);\n" +
- " }\n" +
- " }\n" +
- " public static Method getLambdaMethod(SerializedLambda lambda) throws Exception {\n" +
- " String implClassName = lambda.getImplClass().replace(\'/\', \'.\');\n" +
- " Class<?> implClass = Class.forName(implClassName);\n" +
- " String lambdaName = lambda.getImplMethodName();\n" +
- " for (Method m : implClass.getDeclaredMethods()) {\n" +
- " if (m.getName().equals(lambdaName)) {\n" +
- " return m;\n" +
- " }\n" +
- " }\n" +
- " throw new Exception(\"Lambda Method not found\");\n" +
- " }\n" +
- " public static SerializedLambda getSerializedLambda(Object function) throws Exception {\n" +
- " if (function == null || !(function instanceof java.io.Serializable)) {\n" +
- " throw new IllegalArgumentException();\n" +
- " }\n" +
- " for (Class<?> clazz = function.getClass(); clazz != null; clazz = clazz.getSuperclass()) {\n" +
- " try {\n" +
- " Method replaceMethod = clazz.getDeclaredMethod(\"writeReplace\");\n" +
- " replaceMethod.setAccessible(true);\n" +
- " Object serializedForm = replaceMethod.invoke(function);\n" +
- " if (serializedForm instanceof SerializedLambda) {\n" +
- " return (SerializedLambda) serializedForm;\n" +
- " }\n" +
- " }\n" +
- " catch (NoSuchMethodError e) {\n" +
- " // fall through the loop and try the next class\n" +
- " }\n" +
- " catch (Throwable t) {\n" +
- " throw new RuntimeException(\"Error while extracting serialized lambda\", t);\n" +
- " }\n" +
- " }\n" +
- " throw new Exception(\"writeReplace method not found\");\n" +
- " }\n" +
+ "import java.io.Serializable;\n" +
+ "import java.lang.invoke.SerializedLambda;\n" +
+ "import java.lang.reflect.Method;\n" +
+ "import java.lang.reflect.Type;\n" +
+ "public class Test {\n" +
+ " public static interface Map<IN, OUT> extends Serializable {\n" +
+ " public OUT map(IN in);\n" +
+ " }\n" +
+ " public static class Tuple<T1, T2> {\n" +
+ " private T1 field1;\n" +
+ " private T2 field2;\n" +
+ " }\n" +
+ " public static void main(String[] strings) throws Exception {\n" +
+ " Map<Tuple<String, Double>, Tuple<Integer, String>> map = (in) -> new Tuple<>();\n" +
+ " SerializedLambda sl = getSerializedLambda(map); \n" +
+ " Method m = getLambdaMethod(sl);\n" +
+ " // Use the type information stored in signature\n" +
+ " System.out.println(m.getGenericReturnType());\n" +
+ " for (Type t : m.getGenericParameterTypes()) {\n" +
+ " System.out.println(t);\n" +
+ " }\n" +
+ " }\n" +
+ " public static Method getLambdaMethod(SerializedLambda lambda) throws Exception {\n" +
+ " String implClassName = lambda.getImplClass().replace(\'/\', \'.\');\n" +
+ " Class<?> implClass = Class.forName(implClassName);\n" +
+ " String lambdaName = lambda.getImplMethodName();\n" +
+ " for (Method m : implClass.getDeclaredMethods()) {\n" +
+ " if (m.getName().equals(lambdaName)) {\n" +
+ " return m;\n" +
+ " }\n" +
+ " }\n" +
+ " throw new Exception(\"Lambda Method not found\");\n" +
+ " }\n" +
+ " public static SerializedLambda getSerializedLambda(Object function) throws Exception {\n" +
+ " if (function == null || !(function instanceof java.io.Serializable)) {\n" +
+ " throw new IllegalArgumentException();\n" +
+ " }\n" +
+ " for (Class<?> clazz = function.getClass(); clazz != null; clazz = clazz.getSuperclass()) {\n" +
+ " try {\n" +
+ " Method replaceMethod = clazz.getDeclaredMethod(\"writeReplace\");\n" +
+ " replaceMethod.setAccessible(true);\n" +
+ " Object serializedForm = replaceMethod.invoke(function);\n" +
+ " if (serializedForm instanceof SerializedLambda) {\n" +
+ " return (SerializedLambda) serializedForm;\n" +
+ " }\n" +
+ " }\n" +
+ " catch (NoSuchMethodError e) {\n" +
+ " // fall through the loop and try the next class\n" +
+ " }\n" +
+ " catch (Throwable t) {\n" +
+ " throw new RuntimeException(\"Error while extracting serialized lambda\", t);\n" +
+ " }\n" +
+ " }\n" +
+ " throw new Exception(\"writeReplace method not found\");\n" +
+ " }\n" +
"}"
},
null,
@@ -5313,211 +5313,211 @@ public void test449063a() {
null,
EclipseJustification.EclipseBug449063);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449063, [1.8][compiler] Bring back generic signatures for Lambda Expressions
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449063, [1.8][compiler] Bring back generic signatures for Lambda Expressions
public void test449063b() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_LambdaGenericSignature, CompilerOptions.DO_NOT_GENERATE);
this.runConformTest(
new String[] {
"Test.java",
- "import java.io.Serializable;\n" +
- "import java.lang.invoke.SerializedLambda;\n" +
- "import java.lang.reflect.Method;\n" +
- "import java.lang.reflect.Type;\n" +
- "public class Test {\n" +
- " public static interface Map<IN, OUT> {\n" +
- " public OUT map(IN in);\n" +
- " }\n" +
- " public static class Tuple<T1, T2> {\n" +
- " private T1 field1;\n" +
- " private T2 field2;\n" +
- " }\n" +
- " public static void main(String[] strings) throws Exception {\n" +
- " Map<Tuple<String, Double>, Tuple<Integer, String>> map = (in) -> new Tuple<>();\n" +
- " for(Method m : Test.class.getDeclaredMethods()) {\n" +
- " // Use the type information stored in signature\n" +
+ "import java.io.Serializable;\n" +
+ "import java.lang.invoke.SerializedLambda;\n" +
+ "import java.lang.reflect.Method;\n" +
+ "import java.lang.reflect.Type;\n" +
+ "public class Test {\n" +
+ " public static interface Map<IN, OUT> {\n" +
+ " public OUT map(IN in);\n" +
+ " }\n" +
+ " public static class Tuple<T1, T2> {\n" +
+ " private T1 field1;\n" +
+ " private T2 field2;\n" +
+ " }\n" +
+ " public static void main(String[] strings) throws Exception {\n" +
+ " Map<Tuple<String, Double>, Tuple<Integer, String>> map = (in) -> new Tuple<>();\n" +
+ " for(Method m : Test.class.getDeclaredMethods()) {\n" +
+ " // Use the type information stored in signature\n" +
" if (m.getName().contains(\"lambda\")) {\n" +
- " System.out.println(m.getGenericReturnType());\n" +
- " for (Type t : m.getGenericParameterTypes()) {\n" +
- " System.out.println(t);\n" +
+ " System.out.println(m.getGenericReturnType());\n" +
+ " for (Type t : m.getGenericParameterTypes()) {\n" +
+ " System.out.println(t);\n" +
" }\n" +
" }\n" +
" }\n" +
- " }\n" +
+ " }\n" +
"}"
},
"class Test$Tuple\n" +
"class Test$Tuple",
customOptions);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449063, [1.8][compiler] Bring back generic signatures for Lambda Expressions
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449063, [1.8][compiler] Bring back generic signatures for Lambda Expressions
public void test449063c() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_LambdaGenericSignature, CompilerOptions.DO_NOT_GENERATE);
this.runConformTest(
new String[] {
"Test.java",
- "import java.io.Serializable;\n" +
- "import java.lang.invoke.SerializedLambda;\n" +
- "import java.lang.reflect.Method;\n" +
- "import java.lang.reflect.Type;\n" +
- "public class Test {\n" +
- " public static interface Map<IN, OUT> extends Serializable {\n" +
- " public OUT map(IN in);\n" +
- " }\n" +
- " public static class Tuple<T1, T2> {\n" +
- " private T1 field1;\n" +
- " private T2 field2;\n" +
- " }\n" +
- " public static void main(String[] strings) throws Exception {\n" +
- " Map<Tuple<String, Double>, Tuple<Integer, String>> map = (in) -> new Tuple<>();\n" +
- " SerializedLambda sl = getSerializedLambda(map); \n" +
- " Method m = getLambdaMethod(sl);\n" +
- " // Use the type information stored in signature\n" +
- " System.out.println(m.getGenericReturnType());\n" +
- " for (Type t : m.getGenericParameterTypes()) {\n" +
- " System.out.println(t);\n" +
- " }\n" +
- " }\n" +
- " public static Method getLambdaMethod(SerializedLambda lambda) throws Exception {\n" +
- " String implClassName = lambda.getImplClass().replace(\'/\', \'.\');\n" +
- " Class<?> implClass = Class.forName(implClassName);\n" +
- " String lambdaName = lambda.getImplMethodName();\n" +
- " for (Method m : implClass.getDeclaredMethods()) {\n" +
- " if (m.getName().equals(lambdaName)) {\n" +
- " return m;\n" +
- " }\n" +
- " }\n" +
- " throw new Exception(\"Lambda Method not found\");\n" +
- " }\n" +
- " public static SerializedLambda getSerializedLambda(Object function) throws Exception {\n" +
- " if (function == null || !(function instanceof java.io.Serializable)) {\n" +
- " throw new IllegalArgumentException();\n" +
- " }\n" +
- " for (Class<?> clazz = function.getClass(); clazz != null; clazz = clazz.getSuperclass()) {\n" +
- " try {\n" +
- " Method replaceMethod = clazz.getDeclaredMethod(\"writeReplace\");\n" +
- " replaceMethod.setAccessible(true);\n" +
- " Object serializedForm = replaceMethod.invoke(function);\n" +
- " if (serializedForm instanceof SerializedLambda) {\n" +
- " return (SerializedLambda) serializedForm;\n" +
- " }\n" +
- " }\n" +
- " catch (NoSuchMethodError e) {\n" +
- " // fall through the loop and try the next class\n" +
- " }\n" +
- " catch (Throwable t) {\n" +
- " throw new RuntimeException(\"Error while extracting serialized lambda\", t);\n" +
- " }\n" +
- " }\n" +
- " throw new Exception(\"writeReplace method not found\");\n" +
- " }\n" +
+ "import java.io.Serializable;\n" +
+ "import java.lang.invoke.SerializedLambda;\n" +
+ "import java.lang.reflect.Method;\n" +
+ "import java.lang.reflect.Type;\n" +
+ "public class Test {\n" +
+ " public static interface Map<IN, OUT> extends Serializable {\n" +
+ " public OUT map(IN in);\n" +
+ " }\n" +
+ " public static class Tuple<T1, T2> {\n" +
+ " private T1 field1;\n" +
+ " private T2 field2;\n" +
+ " }\n" +
+ " public static void main(String[] strings) throws Exception {\n" +
+ " Map<Tuple<String, Double>, Tuple<Integer, String>> map = (in) -> new Tuple<>();\n" +
+ " SerializedLambda sl = getSerializedLambda(map); \n" +
+ " Method m = getLambdaMethod(sl);\n" +
+ " // Use the type information stored in signature\n" +
+ " System.out.println(m.getGenericReturnType());\n" +
+ " for (Type t : m.getGenericParameterTypes()) {\n" +
+ " System.out.println(t);\n" +
+ " }\n" +
+ " }\n" +
+ " public static Method getLambdaMethod(SerializedLambda lambda) throws Exception {\n" +
+ " String implClassName = lambda.getImplClass().replace(\'/\', \'.\');\n" +
+ " Class<?> implClass = Class.forName(implClassName);\n" +
+ " String lambdaName = lambda.getImplMethodName();\n" +
+ " for (Method m : implClass.getDeclaredMethods()) {\n" +
+ " if (m.getName().equals(lambdaName)) {\n" +
+ " return m;\n" +
+ " }\n" +
+ " }\n" +
+ " throw new Exception(\"Lambda Method not found\");\n" +
+ " }\n" +
+ " public static SerializedLambda getSerializedLambda(Object function) throws Exception {\n" +
+ " if (function == null || !(function instanceof java.io.Serializable)) {\n" +
+ " throw new IllegalArgumentException();\n" +
+ " }\n" +
+ " for (Class<?> clazz = function.getClass(); clazz != null; clazz = clazz.getSuperclass()) {\n" +
+ " try {\n" +
+ " Method replaceMethod = clazz.getDeclaredMethod(\"writeReplace\");\n" +
+ " replaceMethod.setAccessible(true);\n" +
+ " Object serializedForm = replaceMethod.invoke(function);\n" +
+ " if (serializedForm instanceof SerializedLambda) {\n" +
+ " return (SerializedLambda) serializedForm;\n" +
+ " }\n" +
+ " }\n" +
+ " catch (NoSuchMethodError e) {\n" +
+ " // fall through the loop and try the next class\n" +
+ " }\n" +
+ " catch (Throwable t) {\n" +
+ " throw new RuntimeException(\"Error while extracting serialized lambda\", t);\n" +
+ " }\n" +
+ " }\n" +
+ " throw new Exception(\"writeReplace method not found\");\n" +
+ " }\n" +
"}"
},
"class Test$Tuple\n" +
"class Test$Tuple",
customOptions);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449063, [1.8][compiler] Bring back generic signatures for Lambda Expressions
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449063, [1.8][compiler] Bring back generic signatures for Lambda Expressions
public void test449063d() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_LambdaGenericSignature, CompilerOptions.GENERATE);
this.runConformTest(
new String[] {
"Test.java",
- "import java.io.Serializable;\n" +
- "import java.lang.invoke.SerializedLambda;\n" +
- "import java.lang.reflect.Method;\n" +
- "import java.lang.reflect.Type;\n" +
- "public class Test {\n" +
- " public static interface Map<IN, OUT> {\n" +
- " public OUT map(IN in);\n" +
- " }\n" +
+ "import java.io.Serializable;\n" +
+ "import java.lang.invoke.SerializedLambda;\n" +
+ "import java.lang.reflect.Method;\n" +
+ "import java.lang.reflect.Type;\n" +
+ "public class Test {\n" +
+ " public static interface Map<IN, OUT> {\n" +
+ " public OUT map(IN in);\n" +
+ " }\n" +
" public static Tuple<Integer, String> noop(Tuple<String, Double> t){return null;}\n" +
- " public static class Tuple<T1, T2> {\n" +
- " private T1 field1;\n" +
- " private T2 field2;\n" +
- " }\n" +
- " public static void main(String[] strings) throws Exception {\n" +
- " Map<Tuple<String, Double>, Tuple<Integer, String>> map = Test::noop;\n" +
- " for(Method m : Test.class.getDeclaredMethods()) {\n" +
- " // Use the type information stored in signature\n" +
+ " public static class Tuple<T1, T2> {\n" +
+ " private T1 field1;\n" +
+ " private T2 field2;\n" +
+ " }\n" +
+ " public static void main(String[] strings) throws Exception {\n" +
+ " Map<Tuple<String, Double>, Tuple<Integer, String>> map = Test::noop;\n" +
+ " for(Method m : Test.class.getDeclaredMethods()) {\n" +
+ " // Use the type information stored in signature\n" +
" if (m.getName().contains(\"lambda\")) {\n" +
- " System.out.println(m.getGenericReturnType());\n" +
- " for (Type t : m.getGenericParameterTypes()) {\n" +
- " System.out.println(t);\n" +
+ " System.out.println(m.getGenericReturnType());\n" +
+ " for (Type t : m.getGenericParameterTypes()) {\n" +
+ " System.out.println(t);\n" +
" }\n" +
" }\n" +
" }\n" +
- " }\n" +
+ " }\n" +
"}"
},
"",
customOptions);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449063, [1.8][compiler] Bring back generic signatures for Lambda Expressions
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449063, [1.8][compiler] Bring back generic signatures for Lambda Expressions
public void test449063e() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_LambdaGenericSignature, CompilerOptions.DO_NOT_GENERATE);
this.runConformTest(
new String[] {
"Test.java",
- "import java.io.Serializable;\n" +
- "import java.lang.invoke.SerializedLambda;\n" +
- "import java.lang.reflect.Method;\n" +
- "import java.lang.reflect.Type;\n" +
- "public class Test {\n" +
- " public static interface Map<IN, OUT> extends Serializable {\n" +
- " public OUT map(IN in);\n" +
- " }\n" +
+ "import java.io.Serializable;\n" +
+ "import java.lang.invoke.SerializedLambda;\n" +
+ "import java.lang.reflect.Method;\n" +
+ "import java.lang.reflect.Type;\n" +
+ "public class Test {\n" +
+ " public static interface Map<IN, OUT> extends Serializable {\n" +
+ " public OUT map(IN in);\n" +
+ " }\n" +
" public static Tuple<Integer, String> noop(Tuple<String, Double> t){return null;}\n" +
- " public static class Tuple<T1, T2> {\n" +
- " private T1 field1;\n" +
- " private T2 field2;\n" +
- " }\n" +
- " public static void main(String[] strings) throws Exception {\n" +
- " Map<Tuple<String, Double>, Tuple<Integer, String>> map = Test::noop;\n" +
- " SerializedLambda sl = getSerializedLambda(map); \n" +
- " Method m = getLambdaMethod(sl);\n" +
- " // Use the type information stored in signature\n" +
- " System.out.println(m.getGenericReturnType());\n" +
- " for (Type t : m.getGenericParameterTypes()) {\n" +
- " System.out.println(t);\n" +
- " }\n" +
- " }\n" +
- " public static Method getLambdaMethod(SerializedLambda lambda) throws Exception {\n" +
- " String implClassName = lambda.getImplClass().replace(\'/\', \'.\');\n" +
- " Class<?> implClass = Class.forName(implClassName);\n" +
- " String lambdaName = lambda.getImplMethodName();\n" +
- " for (Method m : implClass.getDeclaredMethods()) {\n" +
- " if (m.getName().equals(lambdaName)) {\n" +
- " return m;\n" +
- " }\n" +
- " }\n" +
- " throw new Exception(\"Lambda Method not found\");\n" +
- " }\n" +
- " public static SerializedLambda getSerializedLambda(Object function) throws Exception {\n" +
- " if (function == null || !(function instanceof java.io.Serializable)) {\n" +
- " throw new IllegalArgumentException();\n" +
- " }\n" +
- " for (Class<?> clazz = function.getClass(); clazz != null; clazz = clazz.getSuperclass()) {\n" +
- " try {\n" +
- " Method replaceMethod = clazz.getDeclaredMethod(\"writeReplace\");\n" +
- " replaceMethod.setAccessible(true);\n" +
- " Object serializedForm = replaceMethod.invoke(function);\n" +
- " if (serializedForm instanceof SerializedLambda) {\n" +
- " return (SerializedLambda) serializedForm;\n" +
- " }\n" +
- " }\n" +
- " catch (NoSuchMethodError e) {\n" +
- " // fall through the loop and try the next class\n" +
- " }\n" +
- " catch (Throwable t) {\n" +
- " throw new RuntimeException(\"Error while extracting serialized lambda\", t);\n" +
- " }\n" +
- " }\n" +
- " throw new Exception(\"writeReplace method not found\");\n" +
- " }\n" +
+ " public static class Tuple<T1, T2> {\n" +
+ " private T1 field1;\n" +
+ " private T2 field2;\n" +
+ " }\n" +
+ " public static void main(String[] strings) throws Exception {\n" +
+ " Map<Tuple<String, Double>, Tuple<Integer, String>> map = Test::noop;\n" +
+ " SerializedLambda sl = getSerializedLambda(map); \n" +
+ " Method m = getLambdaMethod(sl);\n" +
+ " // Use the type information stored in signature\n" +
+ " System.out.println(m.getGenericReturnType());\n" +
+ " for (Type t : m.getGenericParameterTypes()) {\n" +
+ " System.out.println(t);\n" +
+ " }\n" +
+ " }\n" +
+ " public static Method getLambdaMethod(SerializedLambda lambda) throws Exception {\n" +
+ " String implClassName = lambda.getImplClass().replace(\'/\', \'.\');\n" +
+ " Class<?> implClass = Class.forName(implClassName);\n" +
+ " String lambdaName = lambda.getImplMethodName();\n" +
+ " for (Method m : implClass.getDeclaredMethods()) {\n" +
+ " if (m.getName().equals(lambdaName)) {\n" +
+ " return m;\n" +
+ " }\n" +
+ " }\n" +
+ " throw new Exception(\"Lambda Method not found\");\n" +
+ " }\n" +
+ " public static SerializedLambda getSerializedLambda(Object function) throws Exception {\n" +
+ " if (function == null || !(function instanceof java.io.Serializable)) {\n" +
+ " throw new IllegalArgumentException();\n" +
+ " }\n" +
+ " for (Class<?> clazz = function.getClass(); clazz != null; clazz = clazz.getSuperclass()) {\n" +
+ " try {\n" +
+ " Method replaceMethod = clazz.getDeclaredMethod(\"writeReplace\");\n" +
+ " replaceMethod.setAccessible(true);\n" +
+ " Object serializedForm = replaceMethod.invoke(function);\n" +
+ " if (serializedForm instanceof SerializedLambda) {\n" +
+ " return (SerializedLambda) serializedForm;\n" +
+ " }\n" +
+ " }\n" +
+ " catch (NoSuchMethodError e) {\n" +
+ " // fall through the loop and try the next class\n" +
+ " }\n" +
+ " catch (Throwable t) {\n" +
+ " throw new RuntimeException(\"Error while extracting serialized lambda\", t);\n" +
+ " }\n" +
+ " }\n" +
+ " throw new Exception(\"writeReplace method not found\");\n" +
+ " }\n" +
"}"
},
(reflectNestedClassUseDollar
@@ -5527,37 +5527,37 @@ public void test449063e() {
"Test.Test$Tuple<java.lang.String, java.lang.Double>"),
customOptions);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449063, [1.8][compiler] Bring back generic signatures for Lambda Expressions
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449063, [1.8][compiler] Bring back generic signatures for Lambda Expressions
public void test449063f() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_LambdaGenericSignature, CompilerOptions.GENERATE);
this.runConformTest(
new String[] {
"Test.java",
- "import java.io.Serializable;\n" +
- "import java.lang.reflect.Method;\n" +
- "import java.lang.reflect.Type;\n" +
- "public class Test implements Serializable{\n" +
- " public static interface Map<IN, OUT> {\n" +
- " public OUT map(IN in);\n" +
- " }\n" +
+ "import java.io.Serializable;\n" +
+ "import java.lang.reflect.Method;\n" +
+ "import java.lang.reflect.Type;\n" +
+ "public class Test implements Serializable{\n" +
+ " public static interface Map<IN, OUT> {\n" +
+ " public OUT map(IN in);\n" +
+ " }\n" +
" public static Tuple<Integer, String> noop(Tuple<String, Double> t){return null;}\n" +
- " public static class Tuple<T1, T2> {\n" +
- " private T1 field1;\n" +
- " private T2 field2;\n" +
- " }\n" +
- " public static void main(String[] strings) throws Exception {\n" +
- " Map<Tuple<String, Double>, Tuple<Integer, String>> map = Test::noop;\n" +
- " for(Method m : Test.class.getDeclaredMethods()) {\n" +
- " // Use the type information stored in signature\n" +
+ " public static class Tuple<T1, T2> {\n" +
+ " private T1 field1;\n" +
+ " private T2 field2;\n" +
+ " }\n" +
+ " public static void main(String[] strings) throws Exception {\n" +
+ " Map<Tuple<String, Double>, Tuple<Integer, String>> map = Test::noop;\n" +
+ " for(Method m : Test.class.getDeclaredMethods()) {\n" +
+ " // Use the type information stored in signature\n" +
" if (m.getName().contains(\"lambda\")) {\n" +
- " System.out.println(m.getGenericReturnType());\n" +
- " for (Type t : m.getGenericParameterTypes()) {\n" +
- " System.out.println(t);\n" +
+ " System.out.println(m.getGenericReturnType());\n" +
+ " for (Type t : m.getGenericParameterTypes()) {\n" +
+ " System.out.println(t);\n" +
" }\n" +
" }\n" +
" }\n" +
- " }\n" +
+ " }\n" +
"}"
},
"",
@@ -5692,20 +5692,20 @@ public void test467825() {
this.runConformTest(
new String[] {
"Main.java",
- "import java.util.function.Function;\n" +
- "public class Main {\n" +
- " public Function<String, String> f(int x) {\n" +
- " class A {\n" +
- " void g() {\n" +
- " System.out.println(x);\n" +
- " }\n" +
- " }\n" +
- " return s -> {\n" +
- " A a = new A();\n" +
- " return s;\n" +
- " };\n" +
- " }\n" +
- "}\n"
+ "import java.util.function.Function;\n" +
+ "public class Main {\n" +
+ " public Function<String, String> f(int x) {\n" +
+ " class A {\n" +
+ " void g() {\n" +
+ " System.out.println(x);\n" +
+ " }\n" +
+ " }\n" +
+ " return s -> {\n" +
+ " A a = new A();\n" +
+ " return s;\n" +
+ " };\n" +
+ " }\n" +
+ "}\n"
});
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=467825 Missing code implementation in the compiler
@@ -5713,27 +5713,27 @@ public void test467825a() {
this.runConformTest(
new String[] {
"Test.java",
- "import java.util.function.Function;\n" +
- "interface Foo {void alpha(Bar pBar);}\n" +
- "class Bar {Object bravo() {return null;}}\n" +
- "class Test {\n" +
- " Foo foo(Function pFunction) {\n" +
- " class Baz {\n" +
- " public Baz(Object pObj) {\n" +
- " }\n" +
- " class NestedBaz extends Baz {\n" +
- " NestedBaz(Object pObj) {\n" +
- " super(pObj);\n" +
- " pFunction.apply(pObj);\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " return pBar -> {\n" +
- " Object o = new Baz(pBar).new NestedBaz(pBar.bravo());\n" +
- " };\n" +
- " }\n" +
- " void charlie(Object pRemovals) {}\n" +
- " void delta(Foo pListener) {}\n" +
+ "import java.util.function.Function;\n" +
+ "interface Foo {void alpha(Bar pBar);}\n" +
+ "class Bar {Object bravo() {return null;}}\n" +
+ "class Test {\n" +
+ " Foo foo(Function pFunction) {\n" +
+ " class Baz {\n" +
+ " public Baz(Object pObj) {\n" +
+ " }\n" +
+ " class NestedBaz extends Baz {\n" +
+ " NestedBaz(Object pObj) {\n" +
+ " super(pObj);\n" +
+ " pFunction.apply(pObj);\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " return pBar -> {\n" +
+ " Object o = new Baz(pBar).new NestedBaz(pBar.bravo());\n" +
+ " };\n" +
+ " }\n" +
+ " void charlie(Object pRemovals) {}\n" +
+ " void delta(Foo pListener) {}\n" +
"}\n"
});
}
@@ -5744,25 +5744,25 @@ public void test461004() {
JavacHasABug.JavacBugFixed_901,
new String[] {
"Ice.java",
- "import java.util.function.BiPredicate;\n" +
- "import java.util.function.Function;\n" +
- "class Ice {\n" +
- " static <T> BiPredicate<T, T> create(BiPredicate<? super T, ? super T> fn) {\n" +
- " return null;\n" +
- " }\n" +
- " static <T, K> BiPredicate<T, T> create(Function<? super T, ? super K> map) {\n" +
- " return null;\n" +
- " }\n" +
- " void someMethod(BiPredicate<String, String> b) {}\n" +
- " void method() {\n" +
- " BiPredicate<String, String> eq = String::equalsIgnoreCase;\n" +
- " // these all compile:\n" +
- " BiPredicate<String, String> ok1 = create( eq );\n" +
- " BiPredicate<String, String> ok2 = create( (a, b) -> true );\n" +
- " BiPredicate<String, String> ok3 = create( String::valueOf );\n" +
- " // this causes an internal compiler error, ArrayIndexOutOfBoundsException: 1\n" +
- " someMethod(create( String::equalsIgnoreCase ));\n" +
- " }\n" +
+ "import java.util.function.BiPredicate;\n" +
+ "import java.util.function.Function;\n" +
+ "class Ice {\n" +
+ " static <T> BiPredicate<T, T> create(BiPredicate<? super T, ? super T> fn) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " static <T, K> BiPredicate<T, T> create(Function<? super T, ? super K> map) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " void someMethod(BiPredicate<String, String> b) {}\n" +
+ " void method() {\n" +
+ " BiPredicate<String, String> eq = String::equalsIgnoreCase;\n" +
+ " // these all compile:\n" +
+ " BiPredicate<String, String> ok1 = create( eq );\n" +
+ " BiPredicate<String, String> ok2 = create( (a, b) -> true );\n" +
+ " BiPredicate<String, String> ok3 = create( String::valueOf );\n" +
+ " // this causes an internal compiler error, ArrayIndexOutOfBoundsException: 1\n" +
+ " someMethod(create( String::equalsIgnoreCase ));\n" +
+ " }\n" +
"}\n"
}, null);
}
@@ -5771,33 +5771,33 @@ public void test478533() {
this.runConformTest(
new String[] {
"test/BugDemonstrator.java",
- "package test;\n" +
- "import test.subpackage.B;\n" +
- "public class BugDemonstrator {\n" +
- " public static void main(String[] args) {\n" +
- " // OK\n" +
- " invoke(new B() {\n" +
- " public String invoke(Integer input) {\n" +
- " return null;\n" +
- " }\n" +
- " });\n" +
- " // ERROR\n" +
- " invoke((Integer i) -> { // Error is here: The type A<Object,Integer> from the descriptor computed for the target context is not visible here.\n" +
- " return null;\n" +
- " });\n" +
- " }\n" +
- " private static String invoke(B b) {\n" +
- " return b.invoke(1);\n" +
- " }\n" +
+ "package test;\n" +
+ "import test.subpackage.B;\n" +
+ "public class BugDemonstrator {\n" +
+ " public static void main(String[] args) {\n" +
+ " // OK\n" +
+ " invoke(new B() {\n" +
+ " public String invoke(Integer input) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " });\n" +
+ " // ERROR\n" +
+ " invoke((Integer i) -> { // Error is here: The type A<Object,Integer> from the descriptor computed for the target context is not visible here.\n" +
+ " return null;\n" +
+ " });\n" +
+ " }\n" +
+ " private static String invoke(B b) {\n" +
+ " return b.invoke(1);\n" +
+ " }\n" +
"}\n",
"test/subpackage/A.java",
- "package test.subpackage;\n" +
- "interface A<I> {\n" +
- " String invoke(I input);\n" +
+ "package test.subpackage;\n" +
+ "interface A<I> {\n" +
+ " String invoke(I input);\n" +
"}\n",
"test/subpackage/B.java",
- "package test.subpackage;\n" +
- "public interface B extends A<Integer> {}\n"
+ "package test.subpackage;\n" +
+ "public interface B extends A<Integer> {}\n"
});
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=478533 [compiler][1.8][lambda] check visibility of target context is broken
@@ -5805,30 +5805,30 @@ public void test478533a() {
this.runNegativeTest(
new String[] {
"test/BugDemonstrator.java",
- "package test;\n" +
- "import test.subpackage.C;\n" +
- "public class BugDemonstrator {\n" +
- " public static void main(String[] args) {\n" +
- " C c = new C();\n" +
- " c.invoke((Integer i) -> { \n" +
- " return null;\n" +
- " }, 2);\n" +
- " }\n" +
+ "package test;\n" +
+ "import test.subpackage.C;\n" +
+ "public class BugDemonstrator {\n" +
+ " public static void main(String[] args) {\n" +
+ " C c = new C();\n" +
+ " c.invoke((Integer i) -> { \n" +
+ " return null;\n" +
+ " }, 2);\n" +
+ " }\n" +
"}\n",
"test/subpackage/A.java",
- "package test.subpackage;\n" +
- "public interface A<I> {\n" +
- " String invoke(I input);\n" +
+ "package test.subpackage;\n" +
+ "public interface A<I> {\n" +
+ " String invoke(I input);\n" +
"}\n",
"test/subpackage/B.java",
- "package test.subpackage;\n" +
+ "package test.subpackage;\n" +
"interface B extends A<Integer> {}\n" ,
"test/subpackage/C.java",
- "package test.subpackage;\n" +
- "public class C {\n" +
- " public String invoke(B b, Integer input) {\n" +
- " return b.invoke(input);\n" +
- " }\n" +
+ "package test.subpackage;\n" +
+ "public class C {\n" +
+ " public String invoke(B b, Integer input) {\n" +
+ " return b.invoke(input);\n" +
+ " }\n" +
"}\n"
},
"----------\n" +
@@ -5843,25 +5843,25 @@ public void test477263() {
this.runConformTest(
new String[] {
"Test.java",
- "import java.util.function.Function;\n" +
- "public interface Test<T> {\n" +
- " static <K> void test(Function<?, ? extends K> function) {\n" +
- " class Outer {\n" +
- " Outer(K k) {}\n" +
- " class Inner {\n" +
- " public Inner(K k) {}\n" +
- " private void method(K k) {\n" +
- " System.out.println(function.apply(null));\n" +
- " Function<K, Inner> f = Inner::new;\n" +
- " Function<K, Outer> f2 = Outer::new;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " new Outer(null).new Inner(null).method(null);\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " Test.test((k) -> \"Success\");\n" +
- " }\n" +
+ "import java.util.function.Function;\n" +
+ "public interface Test<T> {\n" +
+ " static <K> void test(Function<?, ? extends K> function) {\n" +
+ " class Outer {\n" +
+ " Outer(K k) {}\n" +
+ " class Inner {\n" +
+ " public Inner(K k) {}\n" +
+ " private void method(K k) {\n" +
+ " System.out.println(function.apply(null));\n" +
+ " Function<K, Inner> f = Inner::new;\n" +
+ " Function<K, Outer> f2 = Outer::new;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " new Outer(null).new Inner(null).method(null);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " Test.test((k) -> \"Success\");\n" +
+ " }\n" +
"}"
},
"Success");
@@ -5873,34 +5873,34 @@ public void test477263a() {
JavacHasABug.JavacBug8144673,
new String[] {
"X.java",
- "interface I {\n" +
- " X makeX(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " int local = 10;\n" +
- " class Y extends X {\n" +
- " class Z extends X {\n" +
- " private Z(int z) {\n" +
- " }\n" +
- " private Z() {}\n" +
- " }\n" +
- " private Y(int y) {\n" +
- " System.out.println(y);\n" +
- " }\n" +
- " Y() {\n" +
- " }\n" +
- " }\n" +
- " I i = Y :: new;\n" +
- " i.makeX(local);\n" +
- " }\n" +
- " private X(int x) {\n" +
- " }\n" +
- " X() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new X().foo();\n" +
- " }\n" +
+ "interface I {\n" +
+ " X makeX(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " void foo() {\n" +
+ " int local = 10;\n" +
+ " class Y extends X {\n" +
+ " class Z extends X {\n" +
+ " private Z(int z) {\n" +
+ " }\n" +
+ " private Z() {}\n" +
+ " }\n" +
+ " private Y(int y) {\n" +
+ " System.out.println(y);\n" +
+ " }\n" +
+ " Y() {\n" +
+ " }\n" +
+ " }\n" +
+ " I i = Y :: new;\n" +
+ " i.makeX(local);\n" +
+ " }\n" +
+ " private X(int x) {\n" +
+ " }\n" +
+ " X() {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().foo();\n" +
+ " }\n" +
"}"
},
"10");
@@ -5910,39 +5910,39 @@ public void test477263b() {
this.runConformTest(
new String[] {
"X.java",
- "interface I {\n" +
- " X makeX(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " int local = 10;\n" +
- " class Y extends X {\n" +
- " class Z extends X {\n" +
- " private Z(int z) {\n" +
- " System.out.println(local);\n" +
- " }\n" +
- " void f(int in) {\n" +
- " I i2 = Z::new;\n" +
- " i2.makeX(in);\n" +
- " }\n" +
- " private Z() {}\n" +
- " }\n" +
- " private Y(int y) {\n" +
- " System.out.println(\"Y\");\n" +
- " }\n" +
- " Y() {\n" +
- " }\n" +
- " }\n" +
- " new Y().new Z().f(0);\n" +
- " }\n" +
- " private X(int x) {\n" +
- " System.out.println(x);\n" +
- " }\n" +
- " X() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new X().foo();\n" +
- " }\n" +
+ "interface I {\n" +
+ " X makeX(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " void foo() {\n" +
+ " int local = 10;\n" +
+ " class Y extends X {\n" +
+ " class Z extends X {\n" +
+ " private Z(int z) {\n" +
+ " System.out.println(local);\n" +
+ " }\n" +
+ " void f(int in) {\n" +
+ " I i2 = Z::new;\n" +
+ " i2.makeX(in);\n" +
+ " }\n" +
+ " private Z() {}\n" +
+ " }\n" +
+ " private Y(int y) {\n" +
+ " System.out.println(\"Y\");\n" +
+ " }\n" +
+ " Y() {\n" +
+ " }\n" +
+ " }\n" +
+ " new Y().new Z().f(0);\n" +
+ " }\n" +
+ " private X(int x) {\n" +
+ " System.out.println(x);\n" +
+ " }\n" +
+ " X() {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().foo();\n" +
+ " }\n" +
"}"
},
"10");
@@ -5951,48 +5951,48 @@ public void testBug487586() {
runNegativeTest(
new String[] {
"X.java",
- "\n" +
- "interface Calculator {\n" +
- " public int calculate(int a, int b);\n" +
- "}\n" +
- "\n" +
- "interface Sumator {\n" +
- " public int test();\n" +
- "\n" +
- " public int test3(int a, int b);\n" +
- "}\n" +
- "\n" +
- "// intersection of both types\n" +
- "interface Both extends Sumator, Calculator {\n" +
- "\n" +
- "}\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Calculator test = (Calculator & Sumator) (a, b) -> a + b;\n" +
- " System.out.println(test.calculate(2, 3));\n" +
- "\n" +
- " Sumator sumator = (Calculator & Sumator) (a, b) -> a + b; // does compile, but throws an Exception\n" +
- " sumator.test();\n" +
- "\n" +
- " Both both = (Both) (a, b) -> a + b; // does not compile\n" +
- " }\n" +
+ "\n" +
+ "interface Calculator {\n" +
+ " public int calculate(int a, int b);\n" +
+ "}\n" +
+ "\n" +
+ "interface Sumator {\n" +
+ " public int test();\n" +
+ "\n" +
+ " public int test3(int a, int b);\n" +
+ "}\n" +
+ "\n" +
+ "// intersection of both types\n" +
+ "interface Both extends Sumator, Calculator {\n" +
+ "\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Calculator test = (Calculator & Sumator) (a, b) -> a + b;\n" +
+ " System.out.println(test.calculate(2, 3));\n" +
+ "\n" +
+ " Sumator sumator = (Calculator & Sumator) (a, b) -> a + b; // does compile, but throws an Exception\n" +
+ " sumator.test();\n" +
+ "\n" +
+ " Both both = (Both) (a, b) -> a + b; // does not compile\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 18)\n" +
- " Calculator test = (Calculator & Sumator) (a, b) -> a + b;\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 21)\n" +
- " Sumator sumator = (Calculator & Sumator) (a, b) -> a + b; // does compile, but throws an Exception\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 24)\n" +
- " Both both = (Both) (a, b) -> a + b; // does not compile\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 18)\n" +
+ " Calculator test = (Calculator & Sumator) (a, b) -> a + b;\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 21)\n" +
+ " Sumator sumator = (Calculator & Sumator) (a, b) -> a + b; // does compile, but throws an Exception\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 24)\n" +
+ " Both both = (Both) (a, b) -> a + b; // does not compile\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=452587 Java 8: Method references to the same method do not share BootstrapMethod
@@ -6000,15 +6000,15 @@ public void testBug452587() {
this.runConformTest(
new String[] {
"Test.java",
- " public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " Runnable m = Test::m;\n" +
- " Runnable n = Test::m;\n" +
- " Runnable o = Test::m;\n" +
- " Runnable p = Test::m;\n" +
- " Runnable q = Test::m;\n" +
- " }\n" +
- " public static void m() {}\n" +
+ " public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " Runnable m = Test::m;\n" +
+ " Runnable n = Test::m;\n" +
+ " Runnable o = Test::m;\n" +
+ " Runnable p = Test::m;\n" +
+ " Runnable q = Test::m;\n" +
+ " }\n" +
+ " public static void m() {}\n" +
" }\n"
});
IClassFileReader classFileReader = ToolFactory.createDefaultClassFileReader(OUTPUT_DIR + File.separator + "Test.class", IClassFileReader.ALL);
@@ -6029,31 +6029,31 @@ public void testBug485529() {
this.runConformTest(
new String[] {
"X.java",
- "interface I {\n" +
- " X makeX(int x);\n" +
- "}\n" +
- "public class X {\n" +
- " class Y extends X {\n" +
- " class Z extends X {\n" +
- " private Z(int z) {\n" +
- " }\n" +
- " private Z() {}\n" +
- " }\n" +
- " private Y(int y) {\n" +
- " }\n" +
- " Y() {\n" +
- " }\n" +
- " }\n" +
- " I i = Y :: new;\n" +
- " private X(int x) {\n" +
- " }\n" +
- " \n" +
- " X() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new X();\n" +
- " \n" +
- " }\n" +
+ "interface I {\n" +
+ " X makeX(int x);\n" +
+ "}\n" +
+ "public class X {\n" +
+ " class Y extends X {\n" +
+ " class Z extends X {\n" +
+ " private Z(int z) {\n" +
+ " }\n" +
+ " private Z() {}\n" +
+ " }\n" +
+ " private Y(int y) {\n" +
+ " }\n" +
+ " Y() {\n" +
+ " }\n" +
+ " }\n" +
+ " I i = Y :: new;\n" +
+ " private X(int x) {\n" +
+ " }\n" +
+ " \n" +
+ " X() {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new X();\n" +
+ " \n" +
+ " }\n" +
"}"
},
"");
@@ -6063,50 +6063,50 @@ public void testBug479284() {
runNegativeTest(
new String[] {
"BadInferenceMars451.java",
- "package bug.report;\n" +
- "import java.util.ArrayList;\n" +
- "import java.util.Arrays;\n" +
- "import java.util.List;\n" +
- "import java.util.Map;\n" +
- "import java.util.function.BinaryOperator;\n" +
- "import java.util.function.Function;\n" +
- "import java.util.stream.Collectors;\n" +
- "/**\n" +
- " * Problem is valid on Version: Mars.1 Release (4.5.1) Build id: 20150924-1200\n" +
- " */\n" +
- "public class BadInferenceMars451 {\n" +
- " public static Map<Object, List<X>> BadInferenceMars451Casus1() {\n" +
- " List<X> stuff = new ArrayList<>();\n" +
- " return stuff.stream().collect(Collectors.toMap(Function.identity(), t -> Arrays.asList(t), BadInferenceMars451::sum));\n" +
- " }\n" +
- " public static Map<Object, List<X>> BadInferenceMars451Casus1Fixed1() {\n" +
- " List<X> stuff = new ArrayList<>();\n" +
- " return stuff.stream().collect(Collectors.toMap(Function.identity(), t -> Arrays.asList(t), (BinaryOperator<List<X>>) BadInferenceMars451::sum));\n" +
- " }\n" +
- " public static Map<Object, List<X>> BadInferenceMars451Casus1Fixed2() {\n" +
- " List<X> stuff = new ArrayList<>();\n" +
- " return stuff.stream().collect(Collectors.toMap(Function.identity(), t -> Arrays.<X> asList(t), BadInferenceMars451::sum));\n" +
- " }\n" +
- " /* \n" +
- " * Uncomment this to see eclipse crash at build\n" +
- " * this doesnt work but it should not crash the ide\n" +
- " */ \n" +
- " public static Map<Object, List<X>> BadInferenceMars451Casus1Crash() {\n" +
- " List<X> stuff = new ArrayList<>();\n" +
- " return stuff.stream().collect(Collectors.toMap(Function.identity(), t -> Arrays.asList(t), BadInferenceMars451<X>::sum));\n" +
- " }\n" +
- " public static <T> List<T> sum(List<T> l1, List<T> l2) {\n" +
- " return null;\n" +
- " }\n" +
- " public static class X {\n" +
- " }\n" +
+ "package bug.report;\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.Arrays;\n" +
+ "import java.util.List;\n" +
+ "import java.util.Map;\n" +
+ "import java.util.function.BinaryOperator;\n" +
+ "import java.util.function.Function;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "/**\n" +
+ " * Problem is valid on Version: Mars.1 Release (4.5.1) Build id: 20150924-1200\n" +
+ " */\n" +
+ "public class BadInferenceMars451 {\n" +
+ " public static Map<Object, List<X>> BadInferenceMars451Casus1() {\n" +
+ " List<X> stuff = new ArrayList<>();\n" +
+ " return stuff.stream().collect(Collectors.toMap(Function.identity(), t -> Arrays.asList(t), BadInferenceMars451::sum));\n" +
+ " }\n" +
+ " public static Map<Object, List<X>> BadInferenceMars451Casus1Fixed1() {\n" +
+ " List<X> stuff = new ArrayList<>();\n" +
+ " return stuff.stream().collect(Collectors.toMap(Function.identity(), t -> Arrays.asList(t), (BinaryOperator<List<X>>) BadInferenceMars451::sum));\n" +
+ " }\n" +
+ " public static Map<Object, List<X>> BadInferenceMars451Casus1Fixed2() {\n" +
+ " List<X> stuff = new ArrayList<>();\n" +
+ " return stuff.stream().collect(Collectors.toMap(Function.identity(), t -> Arrays.<X> asList(t), BadInferenceMars451::sum));\n" +
+ " }\n" +
+ " /* \n" +
+ " * Uncomment this to see eclipse crash at build\n" +
+ " * this doesnt work but it should not crash the ide\n" +
+ " */ \n" +
+ " public static Map<Object, List<X>> BadInferenceMars451Casus1Crash() {\n" +
+ " List<X> stuff = new ArrayList<>();\n" +
+ " return stuff.stream().collect(Collectors.toMap(Function.identity(), t -> Arrays.asList(t), BadInferenceMars451<X>::sum));\n" +
+ " }\n" +
+ " public static <T> List<T> sum(List<T> l1, List<T> l2) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public static class X {\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in BadInferenceMars451.java (at line 31)\n" +
- " return stuff.stream().collect(Collectors.toMap(Function.identity(), t -> Arrays.asList(t), BadInferenceMars451<X>::sum));\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The type BadInferenceMars451 is not generic; it cannot be parameterized with arguments <BadInferenceMars451.X>\n" +
+ "----------\n" +
+ "1. ERROR in BadInferenceMars451.java (at line 31)\n" +
+ " return stuff.stream().collect(Collectors.toMap(Function.identity(), t -> Arrays.asList(t), BadInferenceMars451<X>::sum));\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The type BadInferenceMars451 is not generic; it cannot be parameterized with arguments <BadInferenceMars451.X>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=491139 Lambda that redefines a default method with generics
@@ -6114,23 +6114,23 @@ public void testBug491139() {
this.runConformTest(
new String[] {
"Test.java",
- "public class Test {\n" +
- " interface Foo<T> {\n" +
- " default String bar(String s) {\n" +
- " return (\"default : \" + s);\n" +
- " }\n" +
- " String bar(T t);\n" +
- " }\n" +
- " public String testLambdaRedefiningADefault() {\n" +
- " Foo<String> foo =\n" +
- " (t) -> {\n" +
- " return \"lambda : \" + t;\n" +
- " };\n" +
- " return (((Foo)foo).bar(\"String\"));\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(new Test().testLambdaRedefiningADefault());\n" +
- " }\n" +
+ "public class Test {\n" +
+ " interface Foo<T> {\n" +
+ " default String bar(String s) {\n" +
+ " return (\"default : \" + s);\n" +
+ " }\n" +
+ " String bar(T t);\n" +
+ " }\n" +
+ " public String testLambdaRedefiningADefault() {\n" +
+ " Foo<String> foo =\n" +
+ " (t) -> {\n" +
+ " return \"lambda : \" + t;\n" +
+ " };\n" +
+ " return (((Foo)foo).bar(\"String\"));\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(new Test().testLambdaRedefiningADefault());\n" +
+ " }\n" +
"}\n"
},
"lambda : String");
@@ -6140,24 +6140,24 @@ public void test489631() {
this.runConformTest(
new String[] {
"Test.java",
- "import java.util.ArrayList;\n" +
+ "import java.util.ArrayList;\n" +
"import java.util.List;\n" +
- "interface I { int getLength(); }\n" +
- "public class Test {\n" +
- " public void test() {\n" +
- " class A<T> {\n" +
- " List<T> l;\n" +
- " public A(List<T> l) {\n" +
- " this.l = l;\n" +
- " }\n" +
- " }\n" +
- " List<Integer> list = new ArrayList<>();\n" +
- " I i = () -> new A<>(list).l.size();\n" +
- " System.out.println(i.getLength());\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new Test().test();\n" +
- " }\n" +
+ "interface I { int getLength(); }\n" +
+ "public class Test {\n" +
+ " public void test() {\n" +
+ " class A<T> {\n" +
+ " List<T> l;\n" +
+ " public A(List<T> l) {\n" +
+ " this.l = l;\n" +
+ " }\n" +
+ " }\n" +
+ " List<Integer> list = new ArrayList<>();\n" +
+ " I i = () -> new A<>(list).l.size();\n" +
+ " System.out.println(i.getLength());\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new Test().test();\n" +
+ " }\n" +
"}"
},
"0");
@@ -6167,31 +6167,31 @@ public void test489631a() {
this.runConformTest(
new String[] {
"Test.java",
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "interface I { int getLength(); }\n" +
- "public class Test {\n" +
- " public void test() {\n" +
- " class A<T> {\n" +
- " List<T> l;\n" +
- " public A(List<T> l) {\n" +
- " this.l = l;\n" +
- " }\n" +
- " class B {\n" +
- " List<Integer> iL;\n" +
- " public B(List<Integer> l) {\n" +
- " // super(l);\n" +
- " this.iL = l;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " List<Integer> list = new ArrayList<>();\n" +
- " I i = () -> new A<>(list).new B(list).iL.size();\n" +
- " System.out.println(i.getLength());\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new Test().test();\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "interface I { int getLength(); }\n" +
+ "public class Test {\n" +
+ " public void test() {\n" +
+ " class A<T> {\n" +
+ " List<T> l;\n" +
+ " public A(List<T> l) {\n" +
+ " this.l = l;\n" +
+ " }\n" +
+ " class B {\n" +
+ " List<Integer> iL;\n" +
+ " public B(List<Integer> l) {\n" +
+ " // super(l);\n" +
+ " this.iL = l;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " List<Integer> list = new ArrayList<>();\n" +
+ " I i = () -> new A<>(list).new B(list).iL.size();\n" +
+ " System.out.println(i.getLength());\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new Test().test();\n" +
+ " }\n" +
"}"
},
"0");
@@ -6202,16 +6202,16 @@ public void test476859() {
runner.testFiles =
new String[] {
"Test.java",
- "import java.lang.reflect.Method;\n" +
- "import java.util.function.Function;\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " final Function<Void,Method> f = __ -> {\n" +
- " class Dummy{}\n" +
- " return new Dummy(){}.getClass().getEnclosingMethod();\n" +
- " };\n" +
- " System.out.println(f.apply(null));\n" +
- " }\n" +
+ "import java.lang.reflect.Method;\n" +
+ "import java.util.function.Function;\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " final Function<Void,Method> f = __ -> {\n" +
+ " class Dummy{}\n" +
+ " return new Dummy(){}.getClass().getEnclosingMethod();\n" +
+ " };\n" +
+ " System.out.println(f.apply(null));\n" +
+ " }\n" +
"}"
};
runner.expectedOutputString =
@@ -6226,27 +6226,27 @@ public void test476859a() {
runner.testFiles =
new String[] {
"Test.java",
- "import java.lang.reflect.Method;\n" +
- "import java.util.function.Function;\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " \n" +
- " final Function<Void,Method> f = __ -> {\n" +
- " class Dummy{}\n" +
- " return new Dummy(){}.getClass().getEnclosingMethod();\n" +
- " };\n" +
- " System.out.println(f.apply(null));\n" +
- " new AnotherClass().foo();\n" +
- " }\n" +
- "}\n" +
- "class AnotherClass {\n" +
- " void foo() {\n" +
- " final Function<Void,Method> f = __ -> {\n" +
- " class Dummy{}\n" +
- " return new Dummy(){}.getClass().getEnclosingMethod();\n" +
- " };\n" +
- " System.out.println(f.apply(null));\n" +
- " }\n" +
+ "import java.lang.reflect.Method;\n" +
+ "import java.util.function.Function;\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " \n" +
+ " final Function<Void,Method> f = __ -> {\n" +
+ " class Dummy{}\n" +
+ " return new Dummy(){}.getClass().getEnclosingMethod();\n" +
+ " };\n" +
+ " System.out.println(f.apply(null));\n" +
+ " new AnotherClass().foo();\n" +
+ " }\n" +
+ "}\n" +
+ "class AnotherClass {\n" +
+ " void foo() {\n" +
+ " final Function<Void,Method> f = __ -> {\n" +
+ " class Dummy{}\n" +
+ " return new Dummy(){}.getClass().getEnclosingMethod();\n" +
+ " };\n" +
+ " System.out.println(f.apply(null));\n" +
+ " }\n" +
"}\n"
};
runner.expectedOutputString =
@@ -6288,35 +6288,35 @@ public void test500374() {
this.runConformTest(
new String[] {
"client/Client.java",
- "package client;\n" +
- "import lib.Sub;\n" +
- "public class Client {\n" +
- " public static void main(String[] args) throws Throwable {\n" +
- " Sub s1 = new Sub();\n" +
- " doSomething(() -> s1.m());\n" +
- " doSomething(s1::m);\n" +
- " }\n" +
- " interface Aaa {\n" +
- " Object f() throws Throwable;\n" +
- " }\n" +
- " public static void doSomething(Aaa a) throws Throwable {\n" +
- " System.out.println(\"Done\");\n" +
- " }\n" +
+ "package client;\n" +
+ "import lib.Sub;\n" +
+ "public class Client {\n" +
+ " public static void main(String[] args) throws Throwable {\n" +
+ " Sub s1 = new Sub();\n" +
+ " doSomething(() -> s1.m());\n" +
+ " doSomething(s1::m);\n" +
+ " }\n" +
+ " interface Aaa {\n" +
+ " Object f() throws Throwable;\n" +
+ " }\n" +
+ " public static void doSomething(Aaa a) throws Throwable {\n" +
+ " System.out.println(\"Done\");\n" +
+ " }\n" +
"}\n",
"lib/Sub.java",
- "package lib;\n" +
+ "package lib;\n" +
"public class Sub extends Base<Sub> {}",
"lib/Base.java",
- "package lib;\n" +
- "class Base<T> {\n" +
- " public T m() {\n" +
- " System.out.println(\"m\");\n" +
- " return thisInstance();\n" +
- " }\n" +
- " @SuppressWarnings(\"unchecked\")\n" +
- " T thisInstance() {\n" +
- " return (T) this;\n" +
- " }\n" +
+ "package lib;\n" +
+ "class Base<T> {\n" +
+ " public T m() {\n" +
+ " System.out.println(\"m\");\n" +
+ " return thisInstance();\n" +
+ " }\n" +
+ " @SuppressWarnings(\"unchecked\")\n" +
+ " T thisInstance() {\n" +
+ " return (T) this;\n" +
+ " }\n" +
"}"
},
"Done\n" +
@@ -6327,37 +6327,37 @@ public void test500374a() {
this.runConformTest(
new String[] {
"client/Client.java",
- "package client;\n" +
- "import java.lang.invoke.MethodHandle;\n" +
- "import java.lang.invoke.MethodHandles;\n" +
- "import java.lang.invoke.MethodType;\n" +
- "import lib.Sub;\n" +
- "public class Client {\n" +
- " public static void main(String[] args) throws Throwable {\n" +
- " MethodHandle mh = MethodHandles.lookup().findVirtual(Sub.class, \"m\", MethodType.methodType(Object.class));\n" +
- " doSomething(mh::invoke);\n" +
- " }\n" +
- " interface Aaa {\n" +
- " Object f() throws Throwable;\n" +
- " }\n" +
- " public static void doSomething(Aaa a) throws Throwable {\n" +
- " System.out.println(\"Done\");\n" +
- " }\n" +
+ "package client;\n" +
+ "import java.lang.invoke.MethodHandle;\n" +
+ "import java.lang.invoke.MethodHandles;\n" +
+ "import java.lang.invoke.MethodType;\n" +
+ "import lib.Sub;\n" +
+ "public class Client {\n" +
+ " public static void main(String[] args) throws Throwable {\n" +
+ " MethodHandle mh = MethodHandles.lookup().findVirtual(Sub.class, \"m\", MethodType.methodType(Object.class));\n" +
+ " doSomething(mh::invoke);\n" +
+ " }\n" +
+ " interface Aaa {\n" +
+ " Object f() throws Throwable;\n" +
+ " }\n" +
+ " public static void doSomething(Aaa a) throws Throwable {\n" +
+ " System.out.println(\"Done\");\n" +
+ " }\n" +
"}\n",
"lib/Sub.java",
- "package lib;\n" +
+ "package lib;\n" +
"public class Sub extends Base<Sub> {}",
"lib/Base.java",
- "package lib;\n" +
- "class Base<T> {\n" +
- " public T m() {\n" +
- " System.out.println(\"m\");\n" +
- " return thisInstance();\n" +
- " }\n" +
- " @SuppressWarnings(\"unchecked\")\n" +
- " T thisInstance() {\n" +
- " return (T) this;\n" +
- " }\n" +
+ "package lib;\n" +
+ "class Base<T> {\n" +
+ " public T m() {\n" +
+ " System.out.println(\"m\");\n" +
+ " return thisInstance();\n" +
+ " }\n" +
+ " @SuppressWarnings(\"unchecked\")\n" +
+ " T thisInstance() {\n" +
+ " return (T) this;\n" +
+ " }\n" +
"}"
},
"Done");
@@ -6390,27 +6390,27 @@ public void testBug502871() {
" }\n" +
"}\n" +
"",
- },
- "----------\n" +
- "1. WARNING in test\\GryoMapper.java (at line 11)\n" +
- " public void addCustom(Generic c) {\n" +
- " ^^^^^^^\n" +
- "Generic is a raw type. References to generic type Generic<A> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in test\\GryoMapper.java (at line 12)\n" +
- " addOrOverrideRegistration(() -> GryoTypeReg.of(c));\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation of(Generic) of the generic method of(Generic<E>) of type GryoMapper.GryoTypeReg\n" +
- "----------\n" +
- "3. WARNING in test\\GryoMapper.java (at line 12)\n" +
- " addOrOverrideRegistration(() -> GryoTypeReg.of(c));\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type GryoMapper.GryoTypeReg needs unchecked conversion to conform to GryoMapper.GryoTypeReg<Object>\n" +
- "----------\n" +
- "4. WARNING in test\\GryoMapper.java (at line 12)\n" +
- " addOrOverrideRegistration(() -> GryoTypeReg.of(c));\n" +
- " ^\n" +
- "Type safety: The expression of type Generic needs unchecked conversion to conform to Generic<Object>\n" +
+ },
+ "----------\n" +
+ "1. WARNING in test\\GryoMapper.java (at line 11)\n" +
+ " public void addCustom(Generic c) {\n" +
+ " ^^^^^^^\n" +
+ "Generic is a raw type. References to generic type Generic<A> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in test\\GryoMapper.java (at line 12)\n" +
+ " addOrOverrideRegistration(() -> GryoTypeReg.of(c));\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation of(Generic) of the generic method of(Generic<E>) of type GryoMapper.GryoTypeReg\n" +
+ "----------\n" +
+ "3. WARNING in test\\GryoMapper.java (at line 12)\n" +
+ " addOrOverrideRegistration(() -> GryoTypeReg.of(c));\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type GryoMapper.GryoTypeReg needs unchecked conversion to conform to GryoMapper.GryoTypeReg<Object>\n" +
+ "----------\n" +
+ "4. WARNING in test\\GryoMapper.java (at line 12)\n" +
+ " addOrOverrideRegistration(() -> GryoTypeReg.of(c));\n" +
+ " ^\n" +
+ "Type safety: The expression of type Generic needs unchecked conversion to conform to Generic<Object>\n" +
"----------\n"
);
}
@@ -6419,30 +6419,30 @@ public void testBUg490469() {
this.runConformTest(
new String[] {
"AbstractClientProxy.java",
- "import java.util.function.Supplier;\n" +
- "public abstract class AbstractClientProxy {\n" +
- " protected <T> T getRemoteObject(String url, Class<T> responseType, Object... urlVariables) {\n" +
- " return handleException(this.bindGet(REST::getForObject, url, responseType, urlVariables));\n" +
- " }\n" +
- " private <T> T handleException(Supplier<T> s){\n" +
- " T t = null;\n" +
- " try{\n" +
- " t= s.get();\n" +
- " }catch(Exception e){\n" +
- " }\n" +
- " return t;\n" +
- " }\n" +
- " private <T> Supplier<T> bindGet(GetFunc fn, String url, Class<T> responseType, Object... uriVariables) {\n" +
- " return () -> fn.invoke(url, responseType, uriVariables);\n" +
- " }\n" +
- "}\n" +
- "class REST {\n" +
- " static <T> T getForObject(String url, Class<T> respType, Object... vars) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "interface GetFunc {\n" +
- " <T> T invoke(String url, Class<T> responseType, Object... uriVariables);\n" +
+ "import java.util.function.Supplier;\n" +
+ "public abstract class AbstractClientProxy {\n" +
+ " protected <T> T getRemoteObject(String url, Class<T> responseType, Object... urlVariables) {\n" +
+ " return handleException(this.bindGet(REST::getForObject, url, responseType, urlVariables));\n" +
+ " }\n" +
+ " private <T> T handleException(Supplier<T> s){\n" +
+ " T t = null;\n" +
+ " try{\n" +
+ " t= s.get();\n" +
+ " }catch(Exception e){\n" +
+ " }\n" +
+ " return t;\n" +
+ " }\n" +
+ " private <T> Supplier<T> bindGet(GetFunc fn, String url, Class<T> responseType, Object... uriVariables) {\n" +
+ " return () -> fn.invoke(url, responseType, uriVariables);\n" +
+ " }\n" +
+ "}\n" +
+ "class REST {\n" +
+ " static <T> T getForObject(String url, Class<T> respType, Object... vars) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "interface GetFunc {\n" +
+ " <T> T invoke(String url, Class<T> responseType, Object... uriVariables);\n" +
"}\n"
});
}
@@ -6452,19 +6452,19 @@ public void test509804() {
runner.testFiles =
new String[] {
"Test.java",
- "import java.lang.reflect.Method;\n" +
- "import java.util.function.Supplier;\n" +
- "public enum Test {\n" +
- " A(Object::new),\n" +
- " B(() -> new Object(){}),\n" +
- " ;\n" +
- " private final Supplier<Object> s;\n" +
- " Test(Supplier<Object> e){\n" +
- " this.s = e;\n" +
- " }\n" +
- " public static void main(String[] args) throws NoSuchMethodException, SecurityException {\n" +
- " System.out.println(B.s.get().getClass().getEnclosingMethod());\n" +
- " }\n" +
+ "import java.lang.reflect.Method;\n" +
+ "import java.util.function.Supplier;\n" +
+ "public enum Test {\n" +
+ " A(Object::new),\n" +
+ " B(() -> new Object(){}),\n" +
+ " ;\n" +
+ " private final Supplier<Object> s;\n" +
+ " Test(Supplier<Object> e){\n" +
+ " this.s = e;\n" +
+ " }\n" +
+ " public static void main(String[] args) throws NoSuchMethodException, SecurityException {\n" +
+ " System.out.println(B.s.get().getClass().getEnclosingMethod());\n" +
+ " }\n" +
"}\n"
};
runner.expectedOutputString =
@@ -6477,21 +6477,21 @@ public void testBug514105() {
runConformTest(
new String[] {
"FunctionalInterfaceBug.java",
- "import java.util.function.Function;\n" +
- "import java.util.function.UnaryOperator;\n" +
- "\n" +
- "@FunctionalInterface\n" +
- "interface BaseFunction<S, T> extends Function<S, T> {\n" +
- "\n" +
- " T foo(final S s);\n" +
- "\n" +
- " default T apply(final S s) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "@FunctionalInterface\n" +
- "interface SubFunction<T> extends UnaryOperator<T>, BaseFunction<T, T> {\n" +
+ "import java.util.function.Function;\n" +
+ "import java.util.function.UnaryOperator;\n" +
+ "\n" +
+ "@FunctionalInterface\n" +
+ "interface BaseFunction<S, T> extends Function<S, T> {\n" +
+ "\n" +
+ " T foo(final S s);\n" +
+ "\n" +
+ " default T apply(final S s) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "@FunctionalInterface\n" +
+ "interface SubFunction<T> extends UnaryOperator<T>, BaseFunction<T, T> {\n" +
"}\n" +
"public class FunctionalInterfaceBug {}\n"
});
@@ -6530,34 +6530,34 @@ public void testBug517299() {
runConformTest(
new String[] {
"example/FooTest.java",
- "package example;\n" +
- "import java.util.function.Consumer;\n" +
- "import foo.Foo;\n" +
- "public class FooTest {\n" +
- " public void test() {\n" +
- " Foo.Bar foo = new Foo.Bar();\n" +
- " foo.print(\"direct\");\n" +
- " invoke(foo::print, \"methodReference\");\n" +
- " }\n" +
- " private static void invoke(Consumer<String> method, String name) {\n" +
- " method.accept(name);\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new FooTest().test();\n" +
- " }\n" +
+ "package example;\n" +
+ "import java.util.function.Consumer;\n" +
+ "import foo.Foo;\n" +
+ "public class FooTest {\n" +
+ " public void test() {\n" +
+ " Foo.Bar foo = new Foo.Bar();\n" +
+ " foo.print(\"direct\");\n" +
+ " invoke(foo::print, \"methodReference\");\n" +
+ " }\n" +
+ " private static void invoke(Consumer<String> method, String name) {\n" +
+ " method.accept(name);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new FooTest().test();\n" +
+ " }\n" +
"}",
"foo/Foo.java",
- "package foo;\n" +
- "public abstract class Foo {\n" +
- " public static class Bar extends Baz {}\n" +
- " static class Baz {\n" +
- " public final void print(String name) {\n" +
- " System.out.println(\"Baz.print called - \"+name);\n" +
- " }\n" +
- " }\n" +
+ "package foo;\n" +
+ "public abstract class Foo {\n" +
+ " public static class Bar extends Baz {}\n" +
+ " static class Baz {\n" +
+ " public final void print(String name) {\n" +
+ " System.out.println(\"Baz.print called - \"+name);\n" +
+ " }\n" +
+ " }\n" +
"}"
},
- "Baz.print called - direct\n" +
+ "Baz.print called - direct\n" +
"Baz.print called - methodReference"
);
}
@@ -6565,23 +6565,23 @@ public void testBug521808() {
runConformTest(
new String[] {
"Z.java",
- "interface FI1 {\n" +
- " Object m(Integer... s);\n" +
- "}\n" +
- "interface FI2<T> {\n" +
- " Object m(T... arg);\n" +
- "}\n" +
- "public class Z {\n" +
- " static Object m(FI1 fi, Integer v1, Integer v2) {\n" +
- " return fi.m(v1, v2);\n" +
- " }\n" +
- " static <V extends Integer> Object m(FI2<V> fi, V v1, V v2) {\n" +
- " return null;\n" +
- " }\n" +
- " public static void main(String argv[]) {\n" +
- " Object obj = m((FI1) (Integer... is) -> is[0] + is[1], 3, 4);\n" +
- " obj = m((Integer... is) -> is[0] + is[1], 3, 4); // Javac compiles, ECJ won't\n" +
- " }\n" +
+ "interface FI1 {\n" +
+ " Object m(Integer... s);\n" +
+ "}\n" +
+ "interface FI2<T> {\n" +
+ " Object m(T... arg);\n" +
+ "}\n" +
+ "public class Z {\n" +
+ " static Object m(FI1 fi, Integer v1, Integer v2) {\n" +
+ " return fi.m(v1, v2);\n" +
+ " }\n" +
+ " static <V extends Integer> Object m(FI2<V> fi, V v1, V v2) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public static void main(String argv[]) {\n" +
+ " Object obj = m((FI1) (Integer... is) -> is[0] + is[1], 3, 4);\n" +
+ " obj = m((Integer... is) -> is[0] + is[1], 3, 4); // Javac compiles, ECJ won't\n" +
+ " }\n" +
"}",
}
);
@@ -6590,14 +6590,14 @@ public void testBug522469() {
runConformTest(
new String[] {
"X.java",
- "public class X<R> {\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " I<?> i = (X<?> x) -> \"\";\n" +
- " }\n" +
- "}\n" +
- "interface I<T> {\n" +
- " String m(X<? extends T> x);\n" +
+ "public class X<R> {\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " I<?> i = (X<?> x) -> \"\";\n" +
+ " }\n" +
+ "}\n" +
+ "interface I<T> {\n" +
+ " String m(X<? extends T> x);\n" +
"}\n"
}
);
@@ -6606,20 +6606,20 @@ public void testBug517951() {
runConformTest(
new String[] {
"Minimal.java",
- "public class Minimal {\n" +
- " public void iCrash() {\n" +
- " try {\n" +
- " System.out.println(\"Body can't be empty\");\n" +
- " } finally {\n" +
- " consumes(sneaky()::withVarargs);\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new Minimal().iCrash();\n" +
- " }\n" +
- " private Minimal sneaky() { return this; }\n" +
- " private void withVarargs(String... test) {}\n" +
- " private void consumes(Runnable r) {}\n" +
+ "public class Minimal {\n" +
+ " public void iCrash() {\n" +
+ " try {\n" +
+ " System.out.println(\"Body can't be empty\");\n" +
+ " } finally {\n" +
+ " consumes(sneaky()::withVarargs);\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new Minimal().iCrash();\n" +
+ " }\n" +
+ " private Minimal sneaky() { return this; }\n" +
+ " private void withVarargs(String... test) {}\n" +
+ " private void consumes(Runnable r) {}\n" +
"}"
},
"Body can't be empty"
@@ -6629,22 +6629,22 @@ public void testBug517951a() {
runConformTest(
new String[] {
"Snippet.java",
- "import java.nio.file.Files;\n" +
- "import java.nio.file.Paths;\n" +
- "import java.util.function.Consumer;\n" +
- "public class Snippet {\n" +
- " void postError( String fmt, Object ... args ) {\n" +
- " }\n" +
- " public boolean test(Consumer<String> postError ) {\n" +
- " return false;\n" +
- " }\n" +
- " void func() {\n" +
- " try( java.io.InputStream istr = Files.newInputStream( Paths.get( \"\" ) )){\n" +
- " } catch( Exception e ) {\n" +
- " } finally {\n" +
- " test( this::postError);\n" +
- " }\n" +
- " }\n" +
+ "import java.nio.file.Files;\n" +
+ "import java.nio.file.Paths;\n" +
+ "import java.util.function.Consumer;\n" +
+ "public class Snippet {\n" +
+ " void postError( String fmt, Object ... args ) {\n" +
+ " }\n" +
+ " public boolean test(Consumer<String> postError ) {\n" +
+ " return false;\n" +
+ " }\n" +
+ " void func() {\n" +
+ " try( java.io.InputStream istr = Files.newInputStream( Paths.get( \"\" ) )){\n" +
+ " } catch( Exception e ) {\n" +
+ " } finally {\n" +
+ " test( this::postError);\n" +
+ " }\n" +
+ " }\n" +
"}"
}
);
@@ -6653,28 +6653,28 @@ public void testBug517951b() {
runConformTest(
new String[] {
"Element.java",
- "public class Element\n" +
- "{\n" +
- " Operation operation = new Operation(Element::new);\n" +
- " public Element(Integer matrix)\n" +
- " {\n" +
- " //...\n" +
- " }\n" +
- " public Element(Operation... operation)\n" +
- " {\n" +
- " //...\n" +
- " }\n" +
- "}\n" +
- "class Operation\n" +
- "{\n" +
- " public Operation(Factory factory)\n" +
- " {\n" +
- " //...\n" +
- " }\n" +
- "}\n" +
- "interface Factory\n" +
- "{\n" +
- " Element create(Operation... operations);\n" +
+ "public class Element\n" +
+ "{\n" +
+ " Operation operation = new Operation(Element::new);\n" +
+ " public Element(Integer matrix)\n" +
+ " {\n" +
+ " //...\n" +
+ " }\n" +
+ " public Element(Operation... operation)\n" +
+ " {\n" +
+ " //...\n" +
+ " }\n" +
+ "}\n" +
+ "class Operation\n" +
+ "{\n" +
+ " public Operation(Factory factory)\n" +
+ " {\n" +
+ " //...\n" +
+ " }\n" +
+ "}\n" +
+ "interface Factory\n" +
+ "{\n" +
+ " Element create(Operation... operations);\n" +
"}"
}
);
@@ -6683,30 +6683,30 @@ public void testBug517951c() {
runConformTest(
new String[] {
"npetest/NpeTest.java",
- "package npetest;\n" +
- "public class NpeTest {\n" +
- " public NpeTestScheduler scheduler;\n" +
- " private void doIt(Object... params) {\n" +
- " try {\n" +
- " System.out.println(\"Done\");\n" +
- " }\n" +
- " finally {\n" +
- " scheduler.schedule(this::doIt);\n" +
- " }\n" +
- " }\n" +
+ "package npetest;\n" +
+ "public class NpeTest {\n" +
+ " public NpeTestScheduler scheduler;\n" +
+ " private void doIt(Object... params) {\n" +
+ " try {\n" +
+ " System.out.println(\"Done\");\n" +
+ " }\n" +
+ " finally {\n" +
+ " scheduler.schedule(this::doIt);\n" +
+ " }\n" +
+ " }\n" +
"}",
"npetest/NpeTestIf.java",
- "package npetest;\n" +
- "@FunctionalInterface\n" +
- "public interface NpeTestIf {\n" +
- " void doSomething(Object... params);\n" +
+ "package npetest;\n" +
+ "@FunctionalInterface\n" +
+ "public interface NpeTestIf {\n" +
+ " void doSomething(Object... params);\n" +
"}",
"npetest/NpeTestScheduler.java",
- "package npetest;\n" +
- "public class NpeTestScheduler {\n" +
- " public void schedule(NpeTestIf what) {\n" +
- " what.doSomething();\n" +
- " }\n" +
+ "package npetest;\n" +
+ "public class NpeTestScheduler {\n" +
+ " public void schedule(NpeTestIf what) {\n" +
+ " what.doSomething();\n" +
+ " }\n" +
"}"
}
);
@@ -6716,38 +6716,38 @@ public void testBug521818() {
runner.testFiles =
new String[] {
"test/Main.java",
- "package test;\n" +
- "class C {}\n" +
- "class D {\n" +
+ "package test;\n" +
+ "class C {}\n" +
+ "class D {\n" +
" <T extends C & Runnable> D(int i, T t) {" +
" System.out.println(\"D\");\n" +
- "}\n" +
- "}\n" +
- "interface Goo {\n" +
- " <T extends C & Runnable> String m(T p);\n" +
- "}\n" +
- "class A {\n" +
+ "}\n" +
+ "}\n" +
+ "interface Goo {\n" +
+ " <T extends C & Runnable> String m(T p);\n" +
+ "}\n" +
+ "class A {\n" +
" public static <K extends Runnable> String bar(K a) {\n" +
" System.out.println(\"Bar\");\n" +
- " return null;\n" +
- " }\n" +
+ " return null;\n" +
+ " }\n" +
" public static <K extends Runnable> D baz(int i, K a) {\n" +
" System.out.println(\"Baz\");\n" +
- " return null;\n" +
- " }\n"+
- "}\n" +
- "interface Foo<Z extends C & Runnable> {\n" +
- " D get(int i, Z z);\n" +
- "}\n" +
- "public class Main {\n" +
- " public static void main(String[] args) {\n" +
- " Foo<? extends C> h = A::baz;\n" +
- " h.get(0, null);\n" +
- " Foo<? extends C> h2 = D::new;\n" +
- " h2.get(0, null);\n" +
- " Goo g = A::bar;\n" +
- " g.m(null);\n" +
- " } \n" +
+ " return null;\n" +
+ " }\n"+
+ "}\n" +
+ "interface Foo<Z extends C & Runnable> {\n" +
+ " D get(int i, Z z);\n" +
+ "}\n" +
+ "public class Main {\n" +
+ " public static void main(String[] args) {\n" +
+ " Foo<? extends C> h = A::baz;\n" +
+ " h.get(0, null);\n" +
+ " Foo<? extends C> h2 = D::new;\n" +
+ " h2.get(0, null);\n" +
+ " Goo g = A::bar;\n" +
+ " g.m(null);\n" +
+ " } \n" +
"}"
};
runner.expectedOutputString =
@@ -6762,62 +6762,62 @@ public void testBug522469a() {
runNegativeTest(
new String[] {
"X.java",
- "import java.util.List;\n" +
- "public class X<R> {\n" +
- " public static void main(String[] args) {\n" +
- " I<?> i = (X<?> x) -> \"\";\n" +
- " J<?, Y> j = (C<?, Y> y) -> \"\";\n" +
- " J<?, Y> j2 = (C<? extends Object, Y> y) -> \"\";\n" +
- " J<? extends Object, Y> j3 = (C<?, Y> y) -> \"\";\n" +
- " J<? extends Object, Y> j4 = (C<? extends Object, Y> y) -> \"\";\n" +
- " J<?, Y> j5 = (C<?, Z> y) -> \"\";\n" +
- " K<? extends List<?>> k = (D<? extends List<?>> d) -> \"\";\n" +
- " }\n" +
- "}\n" +
- "class C<T, U> {}\n" +
- "class D<T extends List<T>> {}\n" +
- "class Z {}\n" +
- "class Y extends Z {}\n" +
- "interface I<T> {\n" +
- " String m(X<? extends T> x);\n" +
- "}\n" +
- "interface J<R, S extends Z> {\n" +
- " String m(C<? extends R, S> ya);\n" +
- "}\n" +
- "interface K<R extends List<R>> {\n" +
- " String m(D<? extends R> d);\n" +
+ "import java.util.List;\n" +
+ "public class X<R> {\n" +
+ " public static void main(String[] args) {\n" +
+ " I<?> i = (X<?> x) -> \"\";\n" +
+ " J<?, Y> j = (C<?, Y> y) -> \"\";\n" +
+ " J<?, Y> j2 = (C<? extends Object, Y> y) -> \"\";\n" +
+ " J<? extends Object, Y> j3 = (C<?, Y> y) -> \"\";\n" +
+ " J<? extends Object, Y> j4 = (C<? extends Object, Y> y) -> \"\";\n" +
+ " J<?, Y> j5 = (C<?, Z> y) -> \"\";\n" +
+ " K<? extends List<?>> k = (D<? extends List<?>> d) -> \"\";\n" +
+ " }\n" +
+ "}\n" +
+ "class C<T, U> {}\n" +
+ "class D<T extends List<T>> {}\n" +
+ "class Z {}\n" +
+ "class Y extends Z {}\n" +
+ "interface I<T> {\n" +
+ " String m(X<? extends T> x);\n" +
+ "}\n" +
+ "interface J<R, S extends Z> {\n" +
+ " String m(C<? extends R, S> ya);\n" +
+ "}\n" +
+ "interface K<R extends List<R>> {\n" +
+ " String m(D<? extends R> d);\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " J<?, Y> j5 = (C<?, Z> y) -> \"\";\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " J<?, Y> j5 = (C<?, Z> y) -> \"\";\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
"Type mismatch: cannot convert from J<Object,Z> to J<?,Y>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " K<? extends List<?>> k = (D<? extends List<?>> d) -> \"\";\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The target type of this expression is not a well formed parameterized type due to bound(s) mismatch\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " K<? extends List<?>> k = (D<? extends List<?>> d) -> \"\";\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The target type of this expression is not a well formed parameterized type due to bound(s) mismatch\n" +
"----------\n");
}
public void testBug522469b() {
runNegativeTest(
new String[] {
"X.java",
- "class C<T> {}\n" +
- "public class X {\n" +
- " interface I<T> {\n" +
- " void foo(C<? super Long> l);\n" +
- " }\n" +
- " public static void run() {\n" +
- " I<String> i = (C<? super Number> l) -> {};\n" +
- " }\n" +
+ "class C<T> {}\n" +
+ "public class X {\n" +
+ " interface I<T> {\n" +
+ " void foo(C<? super Long> l);\n" +
+ " }\n" +
+ " public static void run() {\n" +
+ " I<String> i = (C<? super Number> l) -> {};\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
" I<String> i = (C<? super Number> l) -> {};\n" +
- " ^\n" +
+ " ^\n" +
"Lambda expression's parameter l is expected to be of type C<? super Long>\n" +
"----------\n");
}
@@ -6825,25 +6825,25 @@ public void testBug529199() {
runConformTest(
new String[] {
"p2/Test.java",
- "package p2;\n" +
- "public class Test {\n" +
- " public static void main(String... args) {\n" +
- " p1.B.m(); // ok\n" +
- " Runnable r = p1.B::m; r.run(); // runtime error\n" +
- " }\n" +
+ "package p2;\n" +
+ "public class Test {\n" +
+ " public static void main(String... args) {\n" +
+ " p1.B.m(); // ok\n" +
+ " Runnable r = p1.B::m; r.run(); // runtime error\n" +
+ " }\n" +
"}",
"p1/A.java",
- "package p1;\n" +
- "class A {\n" +
- " public static void m() { System.out.println(\"A.m\"); }\n" +
+ "package p1;\n" +
+ "class A {\n" +
+ " public static void m() { System.out.println(\"A.m\"); }\n" +
"}\n",
"p1/B.java",
- "package p1;\n" +
- "public class B extends A {\n" +
+ "package p1;\n" +
+ "public class B extends A {\n" +
"}\n"
},
"A.m\n" +
- "A.m"
+ "A.m"
);
}
public void testBug553885a() {
@@ -6953,19 +6953,19 @@ public void testBug521182() {
runConformTest(
new String[] {
"MethodRef.java",
- "import java.util.function.Supplier;\n" +
- "public class MethodRef {\n" +
- " public static void m(Supplier<?> s) {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
+ "import java.util.function.Supplier;\n" +
+ "public class MethodRef {\n" +
+ " public static void m(Supplier<?> s) {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
" Object ref = null;\n" +
" try {\n" +
" m(ref::toString);\n" +
- " System.out.println(\"A NPE should have been thrown !!!!!\");\n" +
+ " System.out.println(\"A NPE should have been thrown !!!!!\");\n" +
" } catch (NullPointerException e) {\n" +
" System.out.println(\"Success\");\n" +
" }\n" +
- " }\n" +
+ " }\n" +
"}"
},
"Success");
@@ -6974,20 +6974,20 @@ public void testBug521182a() {
runConformTest(
new String[] {
"MethodRef.java",
- "import java.util.function.Supplier;\n" +
+ "import java.util.function.Supplier;\n" +
"public class MethodRef {\n" +
" Object field = null;\n" +
- " public static void m(Supplier<?> s) {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
+ " public static void m(Supplier<?> s) {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
" try {\n" +
" MethodRef ref = new MethodRef();\n" +
" m(ref.field::toString);\n" +
- " System.out.println(\"A NPE should have been thrown !!!!!\");\n" +
+ " System.out.println(\"A NPE should have been thrown !!!!!\");\n" +
" } catch (NullPointerException e) {\n" +
" System.out.println(\"Success\");\n" +
" }\n" +
- " }\n" +
+ " }\n" +
"}"
},
"Success");
@@ -6996,21 +6996,21 @@ public void testBug521182b() {
runConformTest(
new String[] {
"MethodRef.java",
- "import java.util.function.Supplier;\n" +
+ "import java.util.function.Supplier;\n" +
"public class MethodRef {\n" +
- " public static void m(Supplier<?> s) {\n" +
- " }\n" +
+ " public static void m(Supplier<?> s) {\n" +
+ " }\n" +
" public static Object get() {\n" +
" return null;\n" +
" }\n" +
- " public static void main(String[] args) {\n" +
+ " public static void main(String[] args) {\n" +
" try {\n" +
" m(get()::toString);\n" +
- " System.out.println(\"A NPE should have been thrown !!!!!\");\n" +
+ " System.out.println(\"A NPE should have been thrown !!!!!\");\n" +
" } catch (NullPointerException e) {\n" +
" System.out.println(\"Success\");\n" +
" }\n" +
- " }\n" +
+ " }\n" +
"}"
},
"Success");
@@ -7021,23 +7021,23 @@ public void testBug516833() {
this.runConformTest(
new String[] {
"ParameterTest.java",
- "import java.lang.reflect.Method;\n" +
- "import java.lang.reflect.Parameter;\n" +
- "import java.util.Arrays;\n" +
- "import java.util.List;\n" +
- "public class ParameterTest {\n" +
- " void foo(String s, List<String> s1) {\n" +
- " s1.stream().filter(p -> p.equals(s));\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " for (Method m : ParameterTest.class.getDeclaredMethods()) {\n" +
- " if (m.getName().contains(\"lambda\")) {\n" +
- " Parameter[] params = m.getParameters();\n" +
- " System.out.println(Arrays.asList(params));\n" +
- " }\n" +
- " \n" +
- " }\n" +
- " }\n" +
+ "import java.lang.reflect.Method;\n" +
+ "import java.lang.reflect.Parameter;\n" +
+ "import java.util.Arrays;\n" +
+ "import java.util.List;\n" +
+ "public class ParameterTest {\n" +
+ " void foo(String s, List<String> s1) {\n" +
+ " s1.stream().filter(p -> p.equals(s));\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " for (Method m : ParameterTest.class.getDeclaredMethods()) {\n" +
+ " if (m.getName().contains(\"lambda\")) {\n" +
+ " Parameter[] params = m.getParameters();\n" +
+ " System.out.println(Arrays.asList(params));\n" +
+ " }\n" +
+ " \n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
"[java.lang.String arg0, java.lang.String arg1]", options);
@@ -7070,7 +7070,7 @@ public void testBug531093comment1() {
" }\n" +
"}\n" +
"",
- },
+ },
""
);
}
@@ -7102,7 +7102,7 @@ public void testBug531093() {
" }\n" +
"}\n" +
"",
- },
+ },
""
);
}
@@ -7110,67 +7110,67 @@ public void testBug540520() {
Runner runner = new Runner();
runner.testFiles = new String[] {
"Run.java",
- "import java.util.ArrayList;\n" +
- "import java.util.HashMap;\n" +
- "import java.util.List;\n" +
- "import java.util.Map;\n" +
- "import java.util.stream.Collectors;\n" +
- "\n" +
- "public class Run {\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " \n" +
- " List<TypeDeptCount> list = new ArrayList<>();\n" +
- " for(int i=0;i<10;i++) {\n" +
- " TypeDeptCount ty = new TypeDeptCount();\n" +
- " ty.setCykbbm(\"10\"+i);\n" +
- " ty.setCount(i);\n" +
- " }\n" +
- " List<Map<String, Object>> datas = list.stream().collect(Collectors.groupingBy(TypeDeptCount::getType))\n" +
- " .entrySet().stream().map(item -> item.getValue().stream().reduce(new HashMap<String, Object>() {\n" +
- " private static final long serialVersionUID = 1L;\n" +
- " {\n" +
- " put(\"count\", 0);\n" +
- " put(\"type\", item.getKey());\n" +
- " }\n" +
- " }, (data1, val) -> {\n" +
- " data1.put(val.getCykbbm(), val.getCount());\n" +
- " data1.put(\"count\", (Integer) data1.get(\"count\") + val.getCount());\n" +
- " return data1;\n" +
- " }, (data1, data2) -> {\n" +
- " data2.put(\"count\", (Integer) data1.get(\"count\") + (Integer) data2.get(\"count\"));\n" +
- " data1.putAll(data2);\n" +
- " return data1;\n" +
- " })).sorted((item1, item2) -> (Integer) item2.get(\"count\") - (Integer) item1.get(\"count\"))\n" +
- " .collect(Collectors.toList());\n" +
- " System.out.println(datas);\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.HashMap;\n" +
+ "import java.util.List;\n" +
+ "import java.util.Map;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "\n" +
+ "public class Run {\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " \n" +
+ " List<TypeDeptCount> list = new ArrayList<>();\n" +
+ " for(int i=0;i<10;i++) {\n" +
+ " TypeDeptCount ty = new TypeDeptCount();\n" +
+ " ty.setCykbbm(\"10\"+i);\n" +
+ " ty.setCount(i);\n" +
+ " }\n" +
+ " List<Map<String, Object>> datas = list.stream().collect(Collectors.groupingBy(TypeDeptCount::getType))\n" +
+ " .entrySet().stream().map(item -> item.getValue().stream().reduce(new HashMap<String, Object>() {\n" +
+ " private static final long serialVersionUID = 1L;\n" +
+ " {\n" +
+ " put(\"count\", 0);\n" +
+ " put(\"type\", item.getKey());\n" +
+ " }\n" +
+ " }, (data1, val) -> {\n" +
+ " data1.put(val.getCykbbm(), val.getCount());\n" +
+ " data1.put(\"count\", (Integer) data1.get(\"count\") + val.getCount());\n" +
+ " return data1;\n" +
+ " }, (data1, data2) -> {\n" +
+ " data2.put(\"count\", (Integer) data1.get(\"count\") + (Integer) data2.get(\"count\"));\n" +
+ " data1.putAll(data2);\n" +
+ " return data1;\n" +
+ " })).sorted((item1, item2) -> (Integer) item2.get(\"count\") - (Integer) item1.get(\"count\"))\n" +
+ " .collect(Collectors.toList());\n" +
+ " System.out.println(datas);\n" +
+ " }\n" +
"}\n",
"TypeDeptCount.java",
- "public class TypeDeptCount {\n" +
- "\n" +
- " private String type;\n" +
- " private String cykbbm;\n" +
- " private Integer count;\n" +
- " \n" +
- " public String getType() {\n" +
- " return type;\n" +
- " }\n" +
- " public void setType(String type) {\n" +
- " this.type = type;\n" +
- " }\n" +
- " public String getCykbbm() {\n" +
- " return cykbbm;\n" +
- " }\n" +
- " public void setCykbbm(String cykbbm) {\n" +
- " this.cykbbm = cykbbm;\n" +
- " }\n" +
- " public Integer getCount() {\n" +
- " return count;\n" +
- " }\n" +
- " public void setCount(Integer count) {\n" +
- " this.count = count;\n" +
- " }\n" +
+ "public class TypeDeptCount {\n" +
+ "\n" +
+ " private String type;\n" +
+ " private String cykbbm;\n" +
+ " private Integer count;\n" +
+ " \n" +
+ " public String getType() {\n" +
+ " return type;\n" +
+ " }\n" +
+ " public void setType(String type) {\n" +
+ " this.type = type;\n" +
+ " }\n" +
+ " public String getCykbbm() {\n" +
+ " return cykbbm;\n" +
+ " }\n" +
+ " public void setCykbbm(String cykbbm) {\n" +
+ " this.cykbbm = cykbbm;\n" +
+ " }\n" +
+ " public Integer getCount() {\n" +
+ " return count;\n" +
+ " }\n" +
+ " public void setCount(Integer count) {\n" +
+ " this.count = count;\n" +
+ " }\n" +
"}\n"
};
runner.runConformTest();
@@ -7179,27 +7179,27 @@ public void testBug540631() {
Runner runner = new Runner();
runner.testFiles = new String[] {
"EclipseCompileBug.java",
- "public enum EclipseCompileBug {\n" +
- " /*\n" +
- " * Next line fails with these errors in Eclipse, works with javac:\n" +
- " * <li>Test cannot be resolved to a type\n" +
- " * <li>Cannot reference a field before it is defined\n" +
- " */\n" +
- " Test(Test::new);\n" +
- "\n" +
- " @FunctionalInterface\n" +
- " public interface IConstructor<T extends Object> {\n" +
- " T apply();\n" +
- " }\n" +
- "\n" +
- " private final IConstructor<?> constructor;\n" +
- " private EclipseCompileBug (IConstructor<?> newObj) {\n" +
- " constructor = newObj;\n" +
- " }\n" +
- " \n" +
- " public static class Test {\n" +
- " \n" +
- " }\n" +
+ "public enum EclipseCompileBug {\n" +
+ " /*\n" +
+ " * Next line fails with these errors in Eclipse, works with javac:\n" +
+ " * <li>Test cannot be resolved to a type\n" +
+ " * <li>Cannot reference a field before it is defined\n" +
+ " */\n" +
+ " Test(Test::new);\n" +
+ "\n" +
+ " @FunctionalInterface\n" +
+ " public interface IConstructor<T extends Object> {\n" +
+ " T apply();\n" +
+ " }\n" +
+ "\n" +
+ " private final IConstructor<?> constructor;\n" +
+ " private EclipseCompileBug (IConstructor<?> newObj) {\n" +
+ " constructor = newObj;\n" +
+ " }\n" +
+ " \n" +
+ " public static class Test {\n" +
+ " \n" +
+ " }\n" +
"}\n"
};
runner.runConformTest();
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaRegressionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaRegressionTest.java
index b13e295c3..a336738f3 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaRegressionTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaRegressionTest.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Stephan Herrmann - Contribution for
@@ -34,7 +34,7 @@ public LambdaRegressionTest(String name) {
public static Test suite() {
return buildMinimalComplianceTestSuite(testClass(), F_1_8);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=446317, java.lang.VerifyError: Bad type on operand stack with Lambdas and/or inner classes
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=446317, java.lang.VerifyError: Bad type on operand stack with Lambdas and/or inner classes
public void test001() {
this.runConformTest(
new String[] {
@@ -69,7 +69,7 @@ public void test001() {
"miep"
);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=446317, java.lang.VerifyError: Bad type on operand stack with Lambdas and/or inner classes
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=446317, java.lang.VerifyError: Bad type on operand stack with Lambdas and/or inner classes
public void test002() {
this.runNegativeTest(
false,
@@ -98,15 +98,15 @@ public void test002() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 17)\n" +
- " super(s -> System.out.println(text));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot refer to \'this\' nor \'super\' while explicitly invoking a constructor\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 17)\n" +
+ " super(s -> System.out.println(text));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot refer to \'this\' nor \'super\' while explicitly invoking a constructor\n" +
"----------\n"
);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=446317, java.lang.VerifyError: Bad type on operand stack with Lambdas and/or inner classes
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=446317, java.lang.VerifyError: Bad type on operand stack with Lambdas and/or inner classes
public void test003() {
this.runNegativeTest(
new String[] {
@@ -141,25 +141,25 @@ public void test004() {
false,
JavacHasABug.JavacThrowsAnException,
new String[] {
- "Y.java",
- "import java.util.function.Supplier;\n" +
- "class E {\n" +
- " E(Supplier<Object> factory) { }\n" +
- "}\n" +
- "public class Y extends E {\n" +
- " Y() {\n" +
- " super( () -> {\n" +
- " class Z extends E {\n" +
- " Z() {\n" +
- " super(() -> new Object());\n" +
- " }\n" +
- " }\n" +
- " return null;\n" +
- " });\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new Y();\n" +
- " }\n" +
+ "Y.java",
+ "import java.util.function.Supplier;\n" +
+ "class E {\n" +
+ " E(Supplier<Object> factory) { }\n" +
+ "}\n" +
+ "public class Y extends E {\n" +
+ " Y() {\n" +
+ " super( () -> {\n" +
+ " class Z extends E {\n" +
+ " Z() {\n" +
+ " super(() -> new Object());\n" +
+ " }\n" +
+ " }\n" +
+ " return null;\n" +
+ " });\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new Y();\n" +
+ " }\n" +
"}"
},
null);
@@ -168,7 +168,7 @@ public void test004() {
public void test448724() {
this.runConformTest(
new String[] {
- "X.java",
+ "X.java",
"import java.util.concurrent.Callable;\n" +
"public class X {\n" +
" public void mismatchRunnableCallable() throws Exception {\n" +
@@ -201,16 +201,16 @@ public void test448724() {
" }\n" +
"}\n"
},
- "case1: Runnable\n" +
- "case1: Runnable\n" +
- "case2: Runnable\n" +
+ "case1: Runnable\n" +
+ "case1: Runnable\n" +
+ "case2: Runnable\n" +
"case2: Runnable");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=447767, [1.8][compiler] Spurious method not applicable error due to interaction between overload resolution and type inference
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=447767, [1.8][compiler] Spurious method not applicable error due to interaction between overload resolution and type inference
public void test447767() {
this.runConformTest(
new String[] {
- "X.java",
+ "X.java",
"interface I<T, U, V> {\n" +
" T goo(U u, V v);\n" +
"}\n" +
@@ -233,11 +233,11 @@ public void test447767() {
},
"Right!");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=447767, [1.8][compiler] Spurious method not applicable error due to interaction between overload resolution and type inference
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=447767, [1.8][compiler] Spurious method not applicable error due to interaction between overload resolution and type inference
public void test447767a() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"interface I<T, U, V> {\n" +
" T goo(U u, V v);\n" +
"}\n" +
@@ -253,18 +253,18 @@ public void test447767a() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " String s = goo(foo(\"String\", \"String\", (u, v) -> v));\n" +
- " ^\n" +
- "Type mismatch: cannot convert from Object to String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " String s = goo(foo(\"String\", \"String\", (u, v) -> v));\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from Object to String\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=447767, [1.8][compiler] Spurious method not applicable error due to interaction between overload resolution and type inference
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=447767, [1.8][compiler] Spurious method not applicable error due to interaction between overload resolution and type inference
public void test447767b() {
this.runConformTest(
new String[] {
- "X.java",
+ "X.java",
"interface I<T, U, V> {\n" +
" T goo(U u, V v);\n" +
"}\n" +
@@ -286,11 +286,11 @@ public void test447767b() {
},
"Right!");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=447767, [1.8][compiler] Spurious method not applicable error due to interaction between overload resolution and type inference
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=447767, [1.8][compiler] Spurious method not applicable error due to interaction between overload resolution and type inference
public void test447767c() {
this.runConformTest(
new String[] {
- "X.java",
+ "X.java",
"interface I<T, U, V> {\n" +
" T goo(U u, V v);\n" +
"}\n" +
@@ -316,11 +316,11 @@ public void test447767c() {
},
"Right!");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=447767, [1.8][compiler] Spurious method not applicable error due to interaction between overload resolution and type inference
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=447767, [1.8][compiler] Spurious method not applicable error due to interaction between overload resolution and type inference
public void test447767d() {
this.runConformTest(
new String[] {
- "X.java",
+ "X.java",
"interface I<T, U, V> {\n" +
" T goo(U u, V v);\n" +
"}\n" +
@@ -346,11 +346,11 @@ public void test447767d() {
},
"Right!");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449410, [1.8][compiler] Eclipse java compiler does not detect a bad return type in lambda expression
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449410, [1.8][compiler] Eclipse java compiler does not detect a bad return type in lambda expression
public void test449410() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"import java.util.Collections;\n" +
"public class X {\n" +
" public static void main(String[] args) {\n" +
@@ -367,24 +367,24 @@ public void test449410() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " .forEach(entry -> test() ? bad() : returnType());\n" +
- " ^^^^^^^\n" +
- "The method forEach(Consumer<? super Map.Entry<Object,Object>>) in the type Iterable<Map.Entry<Object,Object>> is not applicable for the arguments ((<no type> entry) -> {})\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " .forEach(entry -> test() ? bad() : returnType());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " .forEach(entry -> test() ? bad() : returnType());\n" +
+ " ^^^^^^^\n" +
+ "The method forEach(Consumer<? super Map.Entry<Object,Object>>) in the type Iterable<Map.Entry<Object,Object>> is not applicable for the arguments ((<no type> entry) -> {})\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " .forEach(entry -> test() ? bad() : returnType());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Invalid expression as statement\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449824, [1.8] Difference in behaviour with method references and lambdas
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449824, [1.8] Difference in behaviour with method references and lambdas
// Captures present behavior - may not be correct.
public void test449824() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" public static void main(String[] args) {\n" +
" Concrete<Target> fl = new Concrete<Target>();\n" +
@@ -416,23 +416,23 @@ public void test449824() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " fl.call(each -> each.doSomething()); // fails\n" +
- " ^^^^\n" +
- "The method call(X.RightHand<? super X.Target>) is ambiguous for the type X.Concrete<X.Target>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " fl.call(Target::doSomething); // succeeds in Eclipse 4.5M3 and 4.4.1\n" +
- " ^^^^\n" +
- "The method call(X.RightHand<? super X.Target>) is ambiguous for the type X.Concrete<X.Target>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " fl.call(each -> each.doSomething()); // fails\n" +
+ " ^^^^\n" +
+ "The method call(X.RightHand<? super X.Target>) is ambiguous for the type X.Concrete<X.Target>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " fl.call(Target::doSomething); // succeeds in Eclipse 4.5M3 and 4.4.1\n" +
+ " ^^^^\n" +
+ "The method call(X.RightHand<? super X.Target>) is ambiguous for the type X.Concrete<X.Target>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=448954, [1.8][compiler] Suspect error: "The method foo(String, String, X::goo) is undefined for the type X"
public void test448954() {
this.runConformTest(
new String[] {
- "X.java",
+ "X.java",
"interface I<T, U, V> {\n" +
" T goo(U u, V v);\n" +
"}\n" +
@@ -465,7 +465,7 @@ public void test448954() {
public void test450380() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"import java.util.ArrayList;\n" +
"import java.util.function.IntFunction;\n" +
"public class X {\n" +
@@ -474,18 +474,18 @@ public void test450380() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " return System::new;\n" +
- " ^^^^^^^^^^^\n" +
- "The type System does not define System(int) that is applicable here\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " return System::new;\n" +
+ " ^^^^^^^^^^^\n" +
+ "The type System does not define System(int) that is applicable here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=450604, [1.8] CCE at InferenceContext18.getParameter line 1377
public void test450604() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"import java.io.IOException;\n" +
"import java.util.List;\n" +
"import java.util.function.Function;\n" +
@@ -503,7 +503,7 @@ public void test450604() {
public void test450604a() {
this.runConformTest(
new String[] {
- "X.java",
+ "X.java",
"import java.util.List;\n" +
"public class X {\n" +
" public static <T> List<T> of() { return null; }\n" +
@@ -514,11 +514,11 @@ public void test450604a() {
"}\n"
});
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=451677, [1.8][compiler] missing type inference
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=451677, [1.8][compiler] missing type inference
public void _test451677() {
this.runConformTest(
new String[] {
- "X.java",
+ "X.java",
"import java.util.ArrayList;\n" +
"import java.util.function.Function;\n" +
"public class X {\n" +
@@ -539,20 +539,20 @@ public void _test451677() {
public void testBug451840() {
runNegativeTest(new String [] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " X test = new X();\n" +
- " MySupplier<X> s = test::new; // incorrect\n" +
- " }\n" +
- " public interface MySupplier<T> {\n" +
- " T create();\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " X test = new X();\n" +
+ " MySupplier<X> s = test::new; // incorrect\n" +
+ " }\n" +
+ " public interface MySupplier<T> {\n" +
+ " T create();\n" +
+ " }\n" +
"}"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " MySupplier<X> s = test::new; // incorrect\n" +
- " ^^^^\n" +
- "test cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " MySupplier<X> s = test::new; // incorrect\n" +
+ " ^^^^\n" +
+ "test cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=448556
@@ -560,19 +560,19 @@ public void testBug451840() {
public void testBug4448556() {
this.runConformTest(new String [] {
"X.java",
- "import java.io.Serializable;\n" +
- "import java.util.Arrays;\n" +
- "import java.util.List;\n" +
- "public class X {\n" +
- " private static final List<Integer> INTEGERS = Arrays.asList(1, 2, 3, 4);\n" +
- " public static void main(String[] args) {\n" +
- " for (int i = 0; i < INTEGERS.size(); i++) {\n" +
- " MyPredicate<Integer> predicate = INTEGERS.get(i)::equals;\n" +
- " }\n" +
- " } \n" +
- " public interface MyPredicate<T> extends Serializable {\n" +
- " boolean accept(T each);\n" +
- " }\n" +
+ "import java.io.Serializable;\n" +
+ "import java.util.Arrays;\n" +
+ "import java.util.List;\n" +
+ "public class X {\n" +
+ " private static final List<Integer> INTEGERS = Arrays.asList(1, 2, 3, 4);\n" +
+ " public static void main(String[] args) {\n" +
+ " for (int i = 0; i < INTEGERS.size(); i++) {\n" +
+ " MyPredicate<Integer> predicate = INTEGERS.get(i)::equals;\n" +
+ " }\n" +
+ " } \n" +
+ " public interface MyPredicate<T> extends Serializable {\n" +
+ " boolean accept(T each);\n" +
+ " }\n" +
"}"
},
"");
@@ -582,23 +582,23 @@ public void testBug4448556() {
public void testBug4448556a() {
this.runConformTest(new String [] {
"X.java",
- "import java.io.Serializable;\n" +
- "import java.util.Arrays;\n" +
- "import java.util.List;\n" +
- "public class X {\n" +
- " int value = 0; \n" +
- " private static final List<Integer> INTEGERS = Arrays.asList(1, 2, 3, 4);\n" +
- " public Integer next() {\n" +
- " return new Integer(++value);\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X t = new X();\n" +
- " MyPredicate<Integer> predicate = t.next()::equals;\n" +
- " System.out.println(\"Value \" + t.value + \" accept \" + predicate.accept(t.value));\n" +
- " }\n" +
- " public interface MyPredicate<T> extends Serializable {\n" +
- " boolean accept(T each);\n" +
- " }\n" +
+ "import java.io.Serializable;\n" +
+ "import java.util.Arrays;\n" +
+ "import java.util.List;\n" +
+ "public class X {\n" +
+ " int value = 0; \n" +
+ " private static final List<Integer> INTEGERS = Arrays.asList(1, 2, 3, 4);\n" +
+ " public Integer next() {\n" +
+ " return new Integer(++value);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X t = new X();\n" +
+ " MyPredicate<Integer> predicate = t.next()::equals;\n" +
+ " System.out.println(\"Value \" + t.value + \" accept \" + predicate.accept(t.value));\n" +
+ " }\n" +
+ " public interface MyPredicate<T> extends Serializable {\n" +
+ " boolean accept(T each);\n" +
+ " }\n" +
"}"
},
"Value 1 accept true");
@@ -608,18 +608,18 @@ public void testBug4448556a() {
public void testBug453687() {
this.runConformTest(new String [] {
"X.java",
- "import static java.util.stream.Collectors.groupingBy;\n" +
- "import static java.util.stream.Collectors.mapping;\n" +
- "import static java.util.stream.Collectors.toSet;\n" +
- "import java.util.Locale;\n" +
- "import java.util.Map;\n" +
- "import java.util.Set;\n" +
- "import java.util.stream.Stream;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Map<String, Set<String>> countryLanguagesMap = Stream.of(Locale.getAvailableLocales()).collect(\n" +
- " groupingBy(Locale::getDisplayCountry, mapping(Locale::getDisplayLanguage, toSet())));\n" +
- " }\n" +
+ "import static java.util.stream.Collectors.groupingBy;\n" +
+ "import static java.util.stream.Collectors.mapping;\n" +
+ "import static java.util.stream.Collectors.toSet;\n" +
+ "import java.util.Locale;\n" +
+ "import java.util.Map;\n" +
+ "import java.util.Set;\n" +
+ "import java.util.stream.Stream;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Map<String, Set<String>> countryLanguagesMap = Stream.of(Locale.getAvailableLocales()).collect(\n" +
+ " groupingBy(Locale::getDisplayCountry, mapping(Locale::getDisplayLanguage, toSet())));\n" +
+ " }\n" +
"} "
},
"");
@@ -629,60 +629,60 @@ public void testBug453687() {
public void testBug456481() {
this.runConformTest(new String [] {
"Test.java",
- "public class Test {\n" +
- " interface Constructor {\n" +
- " MyTest execute();\n" +
- " }\n" +
- " interface ArrayConstructor {\n" +
- " MyTest[] execute(int no);\n" +
- " }\n" +
- " interface ParameterizedConstructor {\n" +
- " MyParameterizedTest<String> execute();\n" +
- " }\n" +
- " class MyTest {\n" +
- " MyTest() { System.out.println(\"Constructor executed\"); }\n" +
- " }\n" +
- " class MyParameterizedTest<T> {\n" +
- " MyParameterizedTest() {\n" +
- " System.out.println(\"Parameterized Constructor executed\");\n" +
- " }\n" +
- " }\n" +
- " public Constructor getConstructor() {\n" +
- " return getConstructor(() -> { return MyTest::new; });\n" +
- " }\n" +
- " public MyTest[] getArray(int no) {\n" +
- " return new MyTest[no];\n" +
- " }\n" +
- " ArrayConstructor getArrayConstructor() {\n" +
- " return getArrayConstructor(() -> {return MyTest[]::new;});\n" +
- " }\n" +
- " ParameterizedConstructor getParameterizedConstructor() {\n" +
- " return getParameterizedConstructor(() -> {return MyParameterizedTest<String>::new;});\n" +
- " }\n" +
- " ArrayConstructor getArrayConstructor(ArrayWrapper w) {\n" +
- " return w.unwrap();\n" +
- " }\n" +
- " public static void main(String argv[]) {\n" +
- " Test t = new Test();\n" +
- " MyTest mytest = t.getConstructor().execute();\n" +
+ "public class Test {\n" +
+ " interface Constructor {\n" +
+ " MyTest execute();\n" +
+ " }\n" +
+ " interface ArrayConstructor {\n" +
+ " MyTest[] execute(int no);\n" +
+ " }\n" +
+ " interface ParameterizedConstructor {\n" +
+ " MyParameterizedTest<String> execute();\n" +
+ " }\n" +
+ " class MyTest {\n" +
+ " MyTest() { System.out.println(\"Constructor executed\"); }\n" +
+ " }\n" +
+ " class MyParameterizedTest<T> {\n" +
+ " MyParameterizedTest() {\n" +
+ " System.out.println(\"Parameterized Constructor executed\");\n" +
+ " }\n" +
+ " }\n" +
+ " public Constructor getConstructor() {\n" +
+ " return getConstructor(() -> { return MyTest::new; });\n" +
+ " }\n" +
+ " public MyTest[] getArray(int no) {\n" +
+ " return new MyTest[no];\n" +
+ " }\n" +
+ " ArrayConstructor getArrayConstructor() {\n" +
+ " return getArrayConstructor(() -> {return MyTest[]::new;});\n" +
+ " }\n" +
+ " ParameterizedConstructor getParameterizedConstructor() {\n" +
+ " return getParameterizedConstructor(() -> {return MyParameterizedTest<String>::new;});\n" +
+ " }\n" +
+ " ArrayConstructor getArrayConstructor(ArrayWrapper w) {\n" +
+ " return w.unwrap();\n" +
+ " }\n" +
+ " public static void main(String argv[]) {\n" +
+ " Test t = new Test();\n" +
+ " MyTest mytest = t.getConstructor().execute();\n" +
" MyTest[] array = t.getArrayConstructor().execute(2);\n" +
" MyParameterizedTest<String> pt = t.getParameterizedConstructor().execute();\n" +
- " }\n" +
- " ParameterizedConstructor getParameterizedConstructor(PTWrapper ptw) {\n" +
- " return ptw.unwrap();\n" +
- " }\n" +
- " Constructor getConstructor(Wrapper arg) {\n" +
- " return arg.unwrap();\n" +
- " }\n" +
- " interface PTWrapper {\n" +
- " ParameterizedConstructor unwrap();\n" +
- " }\n" +
- " interface ArrayWrapper {\n" +
- " ArrayConstructor unwrap();\n" +
- " }\n" +
- " interface Wrapper {\n" +
- " Constructor unwrap();\n" +
- " }\n" +
+ " }\n" +
+ " ParameterizedConstructor getParameterizedConstructor(PTWrapper ptw) {\n" +
+ " return ptw.unwrap();\n" +
+ " }\n" +
+ " Constructor getConstructor(Wrapper arg) {\n" +
+ " return arg.unwrap();\n" +
+ " }\n" +
+ " interface PTWrapper {\n" +
+ " ParameterizedConstructor unwrap();\n" +
+ " }\n" +
+ " interface ArrayWrapper {\n" +
+ " ArrayConstructor unwrap();\n" +
+ " }\n" +
+ " interface Wrapper {\n" +
+ " Constructor unwrap();\n" +
+ " }\n" +
"}"
},
"Constructor executed\n" +
@@ -708,192 +708,192 @@ public void testBug457007() {
public void testBug446691_comment5() {
runConformTest(new String [] {
"Test.java",
- "import java.util.*;\n" +
- "\n" +
- "public class Test {\n" +
- " protected final Integer myInt;\n" +
- "\n" +
- " public Test() {\n" +
- " myInt = Integer.valueOf(0);\n" +
- " try {\n" +
- " Optional.empty().orElseThrow(() -> new IllegalArgumentException(myInt.toString()));\n" +
- " } catch (IllegalArgumentException e) {\n" +
- " throw new RuntimeException();\n" +
- " }\n" +
- " return;\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " protected final Integer myInt;\n" +
+ "\n" +
+ " public Test() {\n" +
+ " myInt = Integer.valueOf(0);\n" +
+ " try {\n" +
+ " Optional.empty().orElseThrow(() -> new IllegalArgumentException(myInt.toString()));\n" +
+ " } catch (IllegalArgumentException e) {\n" +
+ " throw new RuntimeException();\n" +
+ " }\n" +
+ " return;\n" +
+ " }\n" +
"}\n"
});
}
public void testBug446691_comment8() {
runConformTest(new String [] {
"Boom.java",
- "public class Boom {\n" +
- " private final String field;\n" +
- " public Boom(String arg) {\n" +
- " this.field = arg;\n" +
- " try {\n" +
- " java.util.function.Supplier<String> supplier = () -> field;\n" +
- " } catch (Exception e) {\n" +
- " \n" +
- " }\n" +
- " }\n" +
+ "public class Boom {\n" +
+ " private final String field;\n" +
+ " public Boom(String arg) {\n" +
+ " this.field = arg;\n" +
+ " try {\n" +
+ " java.util.function.Supplier<String> supplier = () -> field;\n" +
+ " } catch (Exception e) {\n" +
+ " \n" +
+ " }\n" +
+ " }\n" +
"}\n"
});
}
public void testBug446691_comment14() {
runNegativeTest(new String [] {
"test/Main.java",
- "package test;\n" +
- "\n" +
- "import java.util.logging.Logger;\n" +
- "\n" +
- "public class Main {\n" +
- "\n" +
- " private static final Logger LOG = Logger.getLogger(\"test\");\n" +
- " private final static String value;\n" +
- "\n" +
- " static {\n" +
- " try {\n" +
- " LOG.info(() -> String.format(\"Value is: %s\", value));\n" +
- " } catch (final Exception ex) {\n" +
- " throw new ExceptionInInitializerError(ex);\n" +
- " }\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "import java.util.logging.Logger;\n" +
+ "\n" +
+ "public class Main {\n" +
+ "\n" +
+ " private static final Logger LOG = Logger.getLogger(\"test\");\n" +
+ " private final static String value;\n" +
+ "\n" +
+ " static {\n" +
+ " try {\n" +
+ " LOG.info(() -> String.format(\"Value is: %s\", value));\n" +
+ " } catch (final Exception ex) {\n" +
+ " throw new ExceptionInInitializerError(ex);\n" +
+ " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in test\\Main.java (at line 8)\n" +
- " private final static String value;\n" +
- " ^^^^^\n" +
- "The blank final field value may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in test\\Main.java (at line 12)\n" +
- " LOG.info(() -> String.format(\"Value is: %s\", value));\n" +
- " ^^^^^\n" +
- "The blank final field value may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in test\\Main.java (at line 8)\n" +
+ " private final static String value;\n" +
+ " ^^^^^\n" +
+ "The blank final field value may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in test\\Main.java (at line 12)\n" +
+ " LOG.info(() -> String.format(\"Value is: %s\", value));\n" +
+ " ^^^^^\n" +
+ "The blank final field value may not have been initialized\n" +
"----------\n");
}
// error in lambda even if field is assigned later
public void testBug446691_comment14b() {
runNegativeTest(new String [] {
"test/Main.java",
- "package test;\n" +
- "\n" +
- "import java.util.logging.Logger;\n" +
- "\n" +
- "public class Main {\n" +
- "\n" +
- " private static final Logger LOG = Logger.getLogger(\"test\");\n" +
- " private final static String value;\n" +
- "\n" +
- " static {\n" +
- " try {\n" +
- " LOG.info(() -> String.format(\"Value is: %s\", value));\n" +
- " } catch (final Exception ex) {\n" +
- " throw new ExceptionInInitializerError(ex);\n" +
+ "package test;\n" +
+ "\n" +
+ "import java.util.logging.Logger;\n" +
+ "\n" +
+ "public class Main {\n" +
+ "\n" +
+ " private static final Logger LOG = Logger.getLogger(\"test\");\n" +
+ " private final static String value;\n" +
+ "\n" +
+ " static {\n" +
+ " try {\n" +
+ " LOG.info(() -> String.format(\"Value is: %s\", value));\n" +
+ " } catch (final Exception ex) {\n" +
+ " throw new ExceptionInInitializerError(ex);\n" +
" }\n" +
- " value = \"\";" +
- " }\n" +
+ " value = \"\";" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in test\\Main.java (at line 12)\n" +
- " LOG.info(() -> String.format(\"Value is: %s\", value));\n" +
- " ^^^^^\n" +
- "The blank final field value may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in test\\Main.java (at line 12)\n" +
+ " LOG.info(() -> String.format(\"Value is: %s\", value));\n" +
+ " ^^^^^\n" +
+ "The blank final field value may not have been initialized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=463526
-// Parenthesis are incorrectly allowed in lambda when LambdaBody is an expression statement
+// Parenthesis are incorrectly allowed in lambda when LambdaBody is an expression statement
public void testBug463526() {
runNegativeTest(new String [] {
"Test.java",
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " Receiver r = new Receiver();\n" +
- " r.accept((l) -> (doItOnTheClass(new Object())));\n" +
- " }\n" +
- " public static void doItOnTheClass(Object o) {\n" +
- " System.out.println(\"done it\");\n" +
- " }\n" +
- " public static class Receiver {\n" +
- " public void accept(Listener l) {\n" +
- " l.doIt(new Object());\n" +
- " }\n" +
- " }\n" +
- " public static interface Listener {\n" +
- " public void doIt(Object o);\n" +
- " }\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " Receiver r = new Receiver();\n" +
+ " r.accept((l) -> (doItOnTheClass(new Object())));\n" +
+ " }\n" +
+ " public static void doItOnTheClass(Object o) {\n" +
+ " System.out.println(\"done it\");\n" +
+ " }\n" +
+ " public static class Receiver {\n" +
+ " public void accept(Listener l) {\n" +
+ " l.doIt(new Object());\n" +
+ " }\n" +
+ " }\n" +
+ " public static interface Listener {\n" +
+ " public void doIt(Object o);\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 4)\n" +
- " r.accept((l) -> (doItOnTheClass(new Object())));\n" +
- " ^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 4)\n" +
+ " r.accept((l) -> (doItOnTheClass(new Object())));\n" +
+ " ^^^^^^\n" +
"The method accept(Test.Listener) in the type Test.Receiver is not applicable for the arguments ((<no type> l) -> {})\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 4)\n" +
- " r.accept((l) -> (doItOnTheClass(new Object())));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 4)\n" +
+ " r.accept((l) -> (doItOnTheClass(new Object())));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Invalid expression as statement\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=463526
-// Parenthesis are incorrectly allowed in lambda when LambdaBody is an expression statement
+// Parenthesis are incorrectly allowed in lambda when LambdaBody is an expression statement
public void testBug463526b() {
runNegativeTest(new String [] {
"Test.java",
- "import java.util.function.Consumer;\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " Receiver r = new Receiver();\n" +
- " r.process((o) -> (new Object()));\n" +
- " }\n" +
- " public static class Receiver {\n" +
- " public void process(Consumer<Object> p) {\n" +
- " }\n" +
- " }\n" +
+ "import java.util.function.Consumer;\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " Receiver r = new Receiver();\n" +
+ " r.process((o) -> (new Object()));\n" +
+ " }\n" +
+ " public static class Receiver {\n" +
+ " public void process(Consumer<Object> p) {\n" +
+ " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 5)\n" +
- " r.process((o) -> (new Object()));\n" +
- " ^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 5)\n" +
+ " r.process((o) -> (new Object()));\n" +
+ " ^^^^^^^\n" +
"The method process(Consumer<Object>) in the type Test.Receiver is not applicable for the arguments ((<no type> o) -> {})\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 5)\n" +
- " r.process((o) -> (new Object()));\n" +
- " ^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 5)\n" +
+ " r.process((o) -> (new Object()));\n" +
+ " ^^^^^^^^^^^^^^\n" +
"Void methods cannot return a value\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=463526
-// Parenthesis are incorrectly allowed in lambda when LambdaBody is an expression statement
+// Parenthesis are incorrectly allowed in lambda when LambdaBody is an expression statement
public void testBug463526c() {
runNegativeTest(new String [] {
"Test.java",
- "import java.util.function.Consumer;\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " Receiver r = new Receiver();\n" +
- " r.assign((o) -> (o = new Object()));\n" +
- " }\n" +
- " public static class Receiver {\n" +
- " public void assign(Consumer<Object> a) {\n" +
- " }\n" +
- " }\n" +
+ "import java.util.function.Consumer;\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " Receiver r = new Receiver();\n" +
+ " r.assign((o) -> (o = new Object()));\n" +
+ " }\n" +
+ " public static class Receiver {\n" +
+ " public void assign(Consumer<Object> a) {\n" +
+ " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 5)\n" +
- " r.assign((o) -> (o = new Object()));\n" +
- " ^^^^^^\n" +
- "The method assign(Consumer<Object>) in the type Test.Receiver is not applicable for the arguments ((<no type> o) -> {})\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 5)\n" +
- " r.assign((o) -> (o = new Object()));\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 5)\n" +
+ " r.assign((o) -> (o = new Object()));\n" +
+ " ^^^^^^\n" +
+ "The method assign(Consumer<Object>) in the type Test.Receiver is not applicable for the arguments ((<no type> o) -> {})\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 5)\n" +
+ " r.assign((o) -> (o = new Object()));\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
"Void methods cannot return a value\n" +
"----------\n");
}
@@ -909,11 +909,11 @@ public void testBug464408() {
" list.stream().toArray(List<String>[]::new);\n" +
" }" +
"}"
- }, "----------\n" +
- "1. ERROR in test\\X.java (at line 6)\n" +
- " list.stream().toArray(List<String>[]::new);\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot create a generic array of List<String>\n" +
+ }, "----------\n" +
+ "1. ERROR in test\\X.java (at line 6)\n" +
+ " list.stream().toArray(List<String>[]::new);\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot create a generic array of List<String>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=465900
@@ -921,20 +921,20 @@ public void testBug464408() {
public void testBug465900() {
this.runConformTest(new String [] {
"X.java",
- "import java.io.Serializable;\n" +
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "import java.util.function.Supplier;\n" +
- "public class X {\n" +
- " private static final long serialVersionUID = 1L;\n" +
- " protected void x() {\n" +
- " String str = \"groep.koppeling.\" + (\"\".isEmpty() ? \"toevoegen\" : \"bewerken\");\n" +
- " List<String> bean = new ArrayList<>();\n" +
- " test(bean.get(0)::isEmpty);\n" +
- " }\n" +
- " private void test(SerializableSupplier<Boolean> test) {}\n" +
- "}\n" +
- "@FunctionalInterface\n" +
+ "import java.io.Serializable;\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "import java.util.function.Supplier;\n" +
+ "public class X {\n" +
+ " private static final long serialVersionUID = 1L;\n" +
+ " protected void x() {\n" +
+ " String str = \"groep.koppeling.\" + (\"\".isEmpty() ? \"toevoegen\" : \"bewerken\");\n" +
+ " List<String> bean = new ArrayList<>();\n" +
+ " test(bean.get(0)::isEmpty);\n" +
+ " }\n" +
+ " private void test(SerializableSupplier<Boolean> test) {}\n" +
+ "}\n" +
+ "@FunctionalInterface\n" +
"interface SerializableSupplier<T> extends Supplier<T>, Serializable {}\n"
},
"");
@@ -944,29 +944,29 @@ public void testBug465900() {
public void testBug477888() {
runNegativeTest(new String [] {
"Test.java",
- "import java.io.IOException;\n" +
- "import java.nio.file.Files;\n" +
- "import java.nio.file.Paths;\n" +
- "import java.util.function.Consumer;\n" +
- "public class Test {\n" +
- " public static void main(String[] args) throws IOException {\n" +
- " Files.lines(Paths.get(args[0])).filter(x -> {return !x.startsWith(\".\");}).forEach(printMe());\n" +
- " }\n" +
- " private static Consumer<String> printMe() {\n" +
- " return x -> x.isEmpty() ? System.out.println() : System.out.println(getIndex() + \" \" + x); // error must be reported here!\n" +
- " }\n" +
- " static int idx;\n" +
- "\n" +
- " private static int getIndex() {\n" +
- " return ++idx;\n" +
- " }\n" +
+ "import java.io.IOException;\n" +
+ "import java.nio.file.Files;\n" +
+ "import java.nio.file.Paths;\n" +
+ "import java.util.function.Consumer;\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) throws IOException {\n" +
+ " Files.lines(Paths.get(args[0])).filter(x -> {return !x.startsWith(\".\");}).forEach(printMe());\n" +
+ " }\n" +
+ " private static Consumer<String> printMe() {\n" +
+ " return x -> x.isEmpty() ? System.out.println() : System.out.println(getIndex() + \" \" + x); // error must be reported here!\n" +
+ " }\n" +
+ " static int idx;\n" +
+ "\n" +
+ " private static int getIndex() {\n" +
+ " return ++idx;\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 10)\n" +
- " return x -> x.isEmpty() ? System.out.println() : System.out.println(getIndex() + \" \" + x); // error must be reported here!\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Invalid expression as statement\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 10)\n" +
+ " return x -> x.isEmpty() ? System.out.println() : System.out.println(getIndex() + \" \" + x); // error must be reported here!\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Invalid expression as statement\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=472648
@@ -977,48 +977,48 @@ public void testBug472648() {
JavacHasABug.JavacBugFixed_901,
new String [] {
"Test.java",
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "import java.util.function.Consumer;\n" +
- "public class Test {\n" +
- " public static void main(String argv[]) {\n" +
- " new Test();\n" +
- " }\n" +
- " public Test() {\n" +
- " List<Number> numList = new ArrayList<>();\n" +
- " numList.add(1);\n" +
- " numList.add(1.5);\n" +
- " numList.add(2);\n" +
- " numList.add(2.5);\n" +
- " forEachValueOfType(numList, Integer.class, (Integer i) -> (System.out.println(Integer.toString(i))));\n" +
- " }\n" +
- " private <T> void forEachValueOfType(List<?> list, Class<T> type, Consumer<T> action) {\n" +
- " \n" +
- " for (Object o : list) {\n" +
- " if (type.isAssignableFrom(o.getClass())) {\n" +
- " @SuppressWarnings(\"unchecked\")\n" +
- " T convertedObject = (T) o;\n" +
- " action.accept(convertedObject);\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "import java.util.function.Consumer;\n" +
+ "public class Test {\n" +
+ " public static void main(String argv[]) {\n" +
+ " new Test();\n" +
+ " }\n" +
+ " public Test() {\n" +
+ " List<Number> numList = new ArrayList<>();\n" +
+ " numList.add(1);\n" +
+ " numList.add(1.5);\n" +
+ " numList.add(2);\n" +
+ " numList.add(2.5);\n" +
+ " forEachValueOfType(numList, Integer.class, (Integer i) -> (System.out.println(Integer.toString(i))));\n" +
+ " }\n" +
+ " private <T> void forEachValueOfType(List<?> list, Class<T> type, Consumer<T> action) {\n" +
+ " \n" +
+ " for (Object o : list) {\n" +
+ " if (type.isAssignableFrom(o.getClass())) {\n" +
+ " @SuppressWarnings(\"unchecked\")\n" +
+ " T convertedObject = (T) o;\n" +
+ " action.accept(convertedObject);\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 14)\n" +
- " forEachValueOfType(numList, Integer.class, (Integer i) -> (System.out.println(Integer.toString(i))));\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 14)\n" +
+ " forEachValueOfType(numList, Integer.class, (Integer i) -> (System.out.println(Integer.toString(i))));\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
"The method forEachValueOfType(List<?>, Class<T>, Consumer<T>) in the type Test is not applicable for the arguments (List<Number>, Class<Integer>, (Integer i) -> {})\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 14)\n" +
- " forEachValueOfType(numList, Integer.class, (Integer i) -> (System.out.println(Integer.toString(i))));\n" +
- " ^^^^^^^\n" +
- "Incompatible type specified for lambda expression's parameter i\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 14)\n" +
- " forEachValueOfType(numList, Integer.class, (Integer i) -> (System.out.println(Integer.toString(i))));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Invalid expression as statement\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 14)\n" +
+ " forEachValueOfType(numList, Integer.class, (Integer i) -> (System.out.println(Integer.toString(i))));\n" +
+ " ^^^^^^^\n" +
+ "Incompatible type specified for lambda expression's parameter i\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 14)\n" +
+ " forEachValueOfType(numList, Integer.class, (Integer i) -> (System.out.println(Integer.toString(i))));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Invalid expression as statement\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=473432
@@ -1026,41 +1026,41 @@ public void testBug472648() {
public void testBug473432() {
this.runConformTest(new String [] {
"Tester.java",
- "import java.util.function.Function;\n" +
- "public class Tester {\n" +
- " private static class ValueWrapper<O> {\n" +
- " private O val_;\n" +
- " public ValueWrapper(O val) {\n" +
- " val_ = val;\n" +
- " }\n" +
- " public <R> R mapOrElse(Function<O, R> func, R defaultValue) {\n" +
- " if(val_ != null) {\n" +
- " return func.apply(val_);\n" +
- " }\n" +
- " return defaultValue;\n" +
- " }\n" +
- " }\n" +
- " private static void handleObject(Object object) {\n" +
- " System.out.println(\"Handled: \" + object);\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " ValueWrapper<String> wrapper = new ValueWrapper<>(\"value\");\n" +
- " boolean skipMethod = false;\n" +
- " // works on both JDT 3.9.2 and 3.11.0\n" +
- " Boolean result = skipMethod ? true : wrapper.mapOrElse(v -> false, null);\n" +
- " System.out.println(result);\n" +
- " wrapper = new ValueWrapper<>(null);\n" +
- " // works on JDT 3.9.2\n" +
- " handleObject(skipMethod ?\n" +
- " true :\n" +
- " wrapper.mapOrElse(v -> false, null));\n" +
- " wrapper = new ValueWrapper<>(null);\n" +
- " // works on neither version\n" +
- " result = skipMethod ?\n" +
- " true :\n" +
- " wrapper.mapOrElse(v -> false, null);\n" +
- " System.out.println(result);\n" +
- " }\n" +
+ "import java.util.function.Function;\n" +
+ "public class Tester {\n" +
+ " private static class ValueWrapper<O> {\n" +
+ " private O val_;\n" +
+ " public ValueWrapper(O val) {\n" +
+ " val_ = val;\n" +
+ " }\n" +
+ " public <R> R mapOrElse(Function<O, R> func, R defaultValue) {\n" +
+ " if(val_ != null) {\n" +
+ " return func.apply(val_);\n" +
+ " }\n" +
+ " return defaultValue;\n" +
+ " }\n" +
+ " }\n" +
+ " private static void handleObject(Object object) {\n" +
+ " System.out.println(\"Handled: \" + object);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " ValueWrapper<String> wrapper = new ValueWrapper<>(\"value\");\n" +
+ " boolean skipMethod = false;\n" +
+ " // works on both JDT 3.9.2 and 3.11.0\n" +
+ " Boolean result = skipMethod ? true : wrapper.mapOrElse(v -> false, null);\n" +
+ " System.out.println(result);\n" +
+ " wrapper = new ValueWrapper<>(null);\n" +
+ " // works on JDT 3.9.2\n" +
+ " handleObject(skipMethod ?\n" +
+ " true :\n" +
+ " wrapper.mapOrElse(v -> false, null));\n" +
+ " wrapper = new ValueWrapper<>(null);\n" +
+ " // works on neither version\n" +
+ " result = skipMethod ?\n" +
+ " true :\n" +
+ " wrapper.mapOrElse(v -> false, null);\n" +
+ " System.out.println(result);\n" +
+ " }\n" +
"}\n"
},
"false\n" +
@@ -1071,27 +1071,27 @@ public void testBug473432() {
public void testBug511676() {
this.runConformTest(new String [] {
"A.java",
- "import java.util.function.Function;\n" +
- "public class A {\n" +
- " interface C<T> { }\n" +
- " interface O<T> {\n" +
- " Object r(C<T> s);\n" +
- " }\n" +
- " static <T, R> O<R> m(O<T> source, Function<T, O<R>> mapper) {\n" +
- " return o -> {\n" +
- " class D {\n" +
- " class E {\n" +
- " }\n" +
- " E e = new E();\n" +
- " }\n" +
- " D d = new D();\n" +
- " return d.e;\n" +
- " };\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " m(null, null);\n" +
+ "import java.util.function.Function;\n" +
+ "public class A {\n" +
+ " interface C<T> { }\n" +
+ " interface O<T> {\n" +
+ " Object r(C<T> s);\n" +
+ " }\n" +
+ " static <T, R> O<R> m(O<T> source, Function<T, O<R>> mapper) {\n" +
+ " return o -> {\n" +
+ " class D {\n" +
+ " class E {\n" +
+ " }\n" +
+ " E e = new E();\n" +
+ " }\n" +
+ " D d = new D();\n" +
+ " return d.e;\n" +
+ " };\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " m(null, null);\n" +
" System.out.println(\" Done\");\n" +
- " }\n" +
+ " }\n" +
"}\n"
},
"Done");
@@ -1100,24 +1100,24 @@ public void testBug511676() {
public void testBug511676a() {
this.runConformTest(new String [] {
"A.java",
- "public class A {\n" +
- " interface C<T> { }\n" +
- " interface O<T> {\n" +
- " Object r(C<T> s);\n" +
- " }\n" +
- " static O<Object> def = o -> {\n" +
- " class D {\n" +
- " class E {\n" +
- " }\n" +
- " E e = new E();\n" +
- " }\n" +
- " D d = new D();\n" +
- " return d.e;\n" +
- " };\n" +
- " public static void main(String[] args) {\n" +
+ "public class A {\n" +
+ " interface C<T> { }\n" +
+ " interface O<T> {\n" +
+ " Object r(C<T> s);\n" +
+ " }\n" +
+ " static O<Object> def = o -> {\n" +
+ " class D {\n" +
+ " class E {\n" +
+ " }\n" +
+ " E e = new E();\n" +
+ " }\n" +
+ " D d = new D();\n" +
+ " return d.e;\n" +
+ " };\n" +
+ " public static void main(String[] args) {\n" +
" O<Object> o = A.def;\n" +
" System.out.println(\" Done\");\n" +
- " }\n" +
+ " }\n" +
"}\n"
},
"Done");
@@ -1127,36 +1127,36 @@ public void testBug543778() {
runner.testFiles =
new String[] {
"Sandbox.java",
- "import java.util.function.Supplier;\n" +
- "\n" +
- "public class Sandbox {\n" +
- "\n" +
- " <R extends Object> R get(Supplier<@NonNull R> impl) {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " Object getter() {\n" +
- " return get(() -> new Object() {\n" +
- "\n" +
- " @Override\n" +
- " public String toString() {\n" +
- " return super.toString();\n" +
- " }\n" +
- "\n" +
- " });\n" +
- " }\n" +
- "\n" +
+ "import java.util.function.Supplier;\n" +
+ "\n" +
+ "public class Sandbox {\n" +
+ "\n" +
+ " <R extends Object> R get(Supplier<@NonNull R> impl) {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " Object getter() {\n" +
+ " return get(() -> new Object() {\n" +
+ "\n" +
+ " @Override\n" +
+ " public String toString() {\n" +
+ " return super.toString();\n" +
+ " }\n" +
+ "\n" +
+ " });\n" +
+ " }\n" +
+ "\n" +
"}\n",
"NonNull.java",
- "import java.lang.annotation.ElementType;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
- "import java.lang.annotation.Target;\n" +
- "\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@Target({ ElementType.TYPE_USE })\n" +
- "public @interface NonNull {\n" +
- " // marker annotation with no members\n" +
+ "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ ElementType.TYPE_USE })\n" +
+ "public @interface NonNull {\n" +
+ " // marker annotation with no members\n" +
"}\n",
};
runner.customOptions = getCompilerOptions();
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaShapeTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaShapeTests.java
index 7f9e4e28e..c892bd5e2 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaShapeTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaShapeTests.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -32,92 +32,92 @@ public void test001() {
this.runConformTest(
new String[] {
"X.java",
- "interface VoidI {\n" +
- " void foo(String s);\n" +
- "}\n" +
- "class Test {\n" +
- " public String gooVoid(VoidI i){return \"\";}\n" +
- "}\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Test test = new Test();\n" +
- " test.gooVoid((x) -> {\n" +
- " if (false) {\n" +
- " x += \"a\";\n" +
- " }\n" +
- " });\n" +
- " test.gooVoid((x) -> {\n" +
- " if (true);\n" +
- " });\n" +
- " test.gooVoid((x) -> {\n" +
- " if (true) {\n" +
- " x += \"a\";\n" +
- " }\n" +
- " });\n" +
- " test.gooVoid((x) -> {\n" +
+ "interface VoidI {\n" +
+ " void foo(String s);\n" +
+ "}\n" +
+ "class Test {\n" +
+ " public String gooVoid(VoidI i){return \"\";}\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Test test = new Test();\n" +
+ " test.gooVoid((x) -> {\n" +
+ " if (false) {\n" +
+ " x += \"a\";\n" +
+ " }\n" +
+ " });\n" +
+ " test.gooVoid((x) -> {\n" +
+ " if (true);\n" +
+ " });\n" +
+ " test.gooVoid((x) -> {\n" +
+ " if (true) {\n" +
+ " x += \"a\";\n" +
+ " }\n" +
+ " });\n" +
+ " test.gooVoid((x) -> {\n" +
" final boolean val = true;\n" +
- " if (val) {\n" +
- " x += \"a\";\n" +
- " }\n" +
- " });\n" +
- " test.gooVoid((x) -> {\n" +
+ " if (val) {\n" +
+ " x += \"a\";\n" +
+ " }\n" +
+ " });\n" +
+ " test.gooVoid((x) -> {\n" +
" final boolean val = true;\n" +
- " if (val);\n" +
- " });\n" +
- " test.gooVoid((x) -> {\n" +
+ " if (val);\n" +
+ " });\n" +
+ " test.gooVoid((x) -> {\n" +
" final boolean val = false;\n" +
- " if (val) {\n" +
- " x += \"a\";\n" +
- " }\n" +
- " });\n" +
- " test.gooVoid((x) -> {\n" +
- " if (x != null) {\n" +
- " x += \"a\";\n" +
- " }\n" +
- " });\n" +
- " test.gooVoid((x) -> {\n" +
+ " if (val) {\n" +
+ " x += \"a\";\n" +
+ " }\n" +
+ " });\n" +
+ " test.gooVoid((x) -> {\n" +
+ " if (x != null) {\n" +
+ " x += \"a\";\n" +
+ " }\n" +
+ " });\n" +
+ " test.gooVoid((x) -> {\n" +
" final boolean val = true;\n" +
- " if (x != null);\n" +
- " });\n" +
- " test.gooVoid((x) -> {\n" +
- " if (false) {\n" +
- " x += \"a\";\n" +
- " } else {\n" +
- " x += \"b\";\n" +
- " }\n" +
- " });\n" +
- " test.gooVoid((x) -> {\n" +
- " if (false) {\n" +
- " x += \"a\";\n" +
- " } else;\n" +
- " });\n" +
- " test.gooVoid((x) -> {\n" +
+ " if (x != null);\n" +
+ " });\n" +
+ " test.gooVoid((x) -> {\n" +
+ " if (false) {\n" +
+ " x += \"a\";\n" +
+ " } else {\n" +
+ " x += \"b\";\n" +
+ " }\n" +
+ " });\n" +
+ " test.gooVoid((x) -> {\n" +
+ " if (false) {\n" +
+ " x += \"a\";\n" +
+ " } else;\n" +
+ " });\n" +
+ " test.gooVoid((x) -> {\n" +
" final boolean val = false;\n" +
- " if (val) {\n" +
- " x += \"a\";\n" +
- " } else {\n" +
- " x += \"b\";\n" +
- " }\n" +
- " });\n" +
- " test.gooVoid((x) -> {\n" +
+ " if (val) {\n" +
+ " x += \"a\";\n" +
+ " } else {\n" +
+ " x += \"b\";\n" +
+ " }\n" +
+ " });\n" +
+ " test.gooVoid((x) -> {\n" +
" final boolean val = false;\n" +
- " if (val) {\n" +
- " x += \"a\";\n" +
- " } else;\n" +
- " });\n" +
- " test.gooVoid((x) -> {\n" +
- " if (x != null) {\n" +
- " x += \"a\";\n" +
- " } else {\n" +
- " x += \"b\";\n" +
- " }\n" +
- " });\n" +
- " test.gooVoid((x) -> {\n" +
- " if (x != null) {\n" +
- " x += \"a\";\n" +
- " } else;\n" +
- " });\n" +
- " }\n" +
+ " if (val) {\n" +
+ " x += \"a\";\n" +
+ " } else;\n" +
+ " });\n" +
+ " test.gooVoid((x) -> {\n" +
+ " if (x != null) {\n" +
+ " x += \"a\";\n" +
+ " } else {\n" +
+ " x += \"b\";\n" +
+ " }\n" +
+ " });\n" +
+ " test.gooVoid((x) -> {\n" +
+ " if (x != null) {\n" +
+ " x += \"a\";\n" +
+ " } else;\n" +
+ " });\n" +
+ " }\n" +
"}\n",
});
}
@@ -125,38 +125,38 @@ public void test002() {
this.runConformTest(
new String[] {
"X.java",
- "interface I {\n" +
- " String foo(int x); \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test() {\n" +
- " final boolean FALSE = false;\n" +
- " goo((x) -> {\n" +
- " if(true) return \"\";\n" +
- " else return null;\n" +
- " });\n" +
- " goo((x) -> {\n" +
- " if(false) return \"\";\n" +
- " else return null;\n" +
- " });\n" +
- " goo((x) -> {\n" +
- " if(x > 0) return \"\";\n" +
- " else return null;\n" +
- " });\n" +
- " goo((x) -> {\n" +
- " if(FALSE) return \"\";\n" +
- " else return null;\n" +
- " });\n" +
- " goo((x) -> {\n" +
- " if(!FALSE) return \"\";\n" +
- " else return null;\n" +
- " });\n" +
- " goo((x) -> {\n" +
- " if(!FALSE) return \"\";\n" +
- " else return null;\n" +
- " });\n" +
- " }\n" +
+ "interface I {\n" +
+ " String foo(int x); \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test() {\n" +
+ " final boolean FALSE = false;\n" +
+ " goo((x) -> {\n" +
+ " if(true) return \"\";\n" +
+ " else return null;\n" +
+ " });\n" +
+ " goo((x) -> {\n" +
+ " if(false) return \"\";\n" +
+ " else return null;\n" +
+ " });\n" +
+ " goo((x) -> {\n" +
+ " if(x > 0) return \"\";\n" +
+ " else return null;\n" +
+ " });\n" +
+ " goo((x) -> {\n" +
+ " if(FALSE) return \"\";\n" +
+ " else return null;\n" +
+ " });\n" +
+ " goo((x) -> {\n" +
+ " if(!FALSE) return \"\";\n" +
+ " else return null;\n" +
+ " });\n" +
+ " goo((x) -> {\n" +
+ " if(!FALSE) return \"\";\n" +
+ " else return null;\n" +
+ " });\n" +
+ " }\n" +
"}\n"
});
}
@@ -164,512 +164,512 @@ public void test003() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface VoidI {\n" +
- " void foo(String s);\n" +
- "}\n" +
- "class Test {\n" +
- " public String gooVoid(VoidI i){return \"\";}\n" +
- "}\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Test test = new Test();\n" +
- " test.gooVoid((x) -> {\n" +
- " if (true) {\n" +
- " return 0;\n" +
- " }\n" +
- " });\n" +
- " }\n" +
+ "interface VoidI {\n" +
+ " void foo(String s);\n" +
+ "}\n" +
+ "class Test {\n" +
+ " public String gooVoid(VoidI i){return \"\";}\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Test test = new Test();\n" +
+ " test.gooVoid((x) -> {\n" +
+ " if (true) {\n" +
+ " return 0;\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " test.gooVoid((x) -> {\n" +
- " ^^^^^^^\n" +
- "The method gooVoid(VoidI) in the type Test is not applicable for the arguments ((<no type> x) -> {})\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " return 0;\n" +
- " ^^^^^^^^^\n" +
- "Void methods cannot return a value\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " test.gooVoid((x) -> {\n" +
+ " ^^^^^^^\n" +
+ "The method gooVoid(VoidI) in the type Test is not applicable for the arguments ((<no type> x) -> {})\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 12)\n" +
+ " return 0;\n" +
+ " ^^^^^^^^^\n" +
+ "Void methods cannot return a value\n" +
"----------\n");
}
public void test004() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface VoidI {\n" +
- " void foo(String s);\n" +
- "}\n" +
- "class Test {\n" +
- " public String gooVoid(VoidI i){return \"\";}\n" +
- "}\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Test test = new Test();\n" +
- " test.gooVoid((x) -> {\n" +
- " final boolean val = true;\n" +
- " if (val) {\n" +
- " return x;\n" +
- " }\n" +
- " });\n" +
- " }\n" +
+ "interface VoidI {\n" +
+ " void foo(String s);\n" +
+ "}\n" +
+ "class Test {\n" +
+ " public String gooVoid(VoidI i){return \"\";}\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Test test = new Test();\n" +
+ " test.gooVoid((x) -> {\n" +
+ " final boolean val = true;\n" +
+ " if (val) {\n" +
+ " return x;\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " test.gooVoid((x) -> {\n" +
- " ^^^^^^^\n" +
- "The method gooVoid(VoidI) in the type Test is not applicable for the arguments ((<no type> x) -> {})\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " return x;\n" +
- " ^^^^^^^^^\n" +
- "Void methods cannot return a value\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " test.gooVoid((x) -> {\n" +
+ " ^^^^^^^\n" +
+ "The method gooVoid(VoidI) in the type Test is not applicable for the arguments ((<no type> x) -> {})\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 13)\n" +
+ " return x;\n" +
+ " ^^^^^^^^^\n" +
+ "Void methods cannot return a value\n" +
"----------\n");
}
public void test005() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface VoidI {\n" +
- " void foo(String s);\n" +
- "}\n" +
- "class Test {\n" +
- " public String gooVoid(VoidI i){return \"\";}\n" +
- "}\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Test test = new Test();\n" +
- " test.gooVoid((x) -> {\n" +
- " if (x != null) {\n" +
- " return 0;\n" +
- " }\n" +
- " });\n" +
- " }\n" +
+ "interface VoidI {\n" +
+ " void foo(String s);\n" +
+ "}\n" +
+ "class Test {\n" +
+ " public String gooVoid(VoidI i){return \"\";}\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Test test = new Test();\n" +
+ " test.gooVoid((x) -> {\n" +
+ " if (x != null) {\n" +
+ " return 0;\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " test.gooVoid((x) -> {\n" +
- " ^^^^^^^\n" +
- "The method gooVoid(VoidI) in the type Test is not applicable for the arguments ((<no type> x) -> {})\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " return 0;\n" +
- " ^^^^^^^^^\n" +
- "Void methods cannot return a value\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " test.gooVoid((x) -> {\n" +
+ " ^^^^^^^\n" +
+ "The method gooVoid(VoidI) in the type Test is not applicable for the arguments ((<no type> x) -> {})\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 12)\n" +
+ " return 0;\n" +
+ " ^^^^^^^^^\n" +
+ "Void methods cannot return a value\n" +
"----------\n");
}
public void test006() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface VoidI {\n" +
- " void foo(String s);\n" +
- "}\n" +
- "class Test {\n" +
- " public String gooVoid(VoidI i){return \"\";}\n" +
- "}\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Test test = new Test();\n" +
- " test.gooVoid((x) -> {\n" +
- " if (false) {\n" +
- " x += \"a\";\n" +
- " } else {\n" +
- " return 0;\n" +
- " }\n" +
- " });\n" +
- " }\n" +
+ "interface VoidI {\n" +
+ " void foo(String s);\n" +
+ "}\n" +
+ "class Test {\n" +
+ " public String gooVoid(VoidI i){return \"\";}\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Test test = new Test();\n" +
+ " test.gooVoid((x) -> {\n" +
+ " if (false) {\n" +
+ " x += \"a\";\n" +
+ " } else {\n" +
+ " return 0;\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " test.gooVoid((x) -> {\n" +
- " ^^^^^^^\n" +
- "The method gooVoid(VoidI) in the type Test is not applicable for the arguments ((<no type> x) -> {})\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " return 0;\n" +
- " ^^^^^^^^^\n" +
- "Void methods cannot return a value\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " test.gooVoid((x) -> {\n" +
+ " ^^^^^^^\n" +
+ "The method gooVoid(VoidI) in the type Test is not applicable for the arguments ((<no type> x) -> {})\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " return 0;\n" +
+ " ^^^^^^^^^\n" +
+ "Void methods cannot return a value\n" +
"----------\n");
}
public void test007() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface VoidI {\n" +
- " void foo(String s);\n" +
- "}\n" +
- "class Test {\n" +
- " public String gooVoid(VoidI i){return \"\";}\n" +
- "}\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Test test = new Test();\n" +
- " test.gooVoid((x) -> {\n" +
- " final boolean val = false;\n" +
- " if (val) {\n" +
- " x += \"a\";\n" +
- " } else {\n" +
- " return 0;\n" +
- " }\n" +
- " });\n" +
- " }\n" +
+ "interface VoidI {\n" +
+ " void foo(String s);\n" +
+ "}\n" +
+ "class Test {\n" +
+ " public String gooVoid(VoidI i){return \"\";}\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Test test = new Test();\n" +
+ " test.gooVoid((x) -> {\n" +
+ " final boolean val = false;\n" +
+ " if (val) {\n" +
+ " x += \"a\";\n" +
+ " } else {\n" +
+ " return 0;\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " test.gooVoid((x) -> {\n" +
- " ^^^^^^^\n" +
- "The method gooVoid(VoidI) in the type Test is not applicable for the arguments ((<no type> x) -> {})\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 15)\n" +
- " return 0;\n" +
- " ^^^^^^^^^\n" +
- "Void methods cannot return a value\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " test.gooVoid((x) -> {\n" +
+ " ^^^^^^^\n" +
+ "The method gooVoid(VoidI) in the type Test is not applicable for the arguments ((<no type> x) -> {})\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 15)\n" +
+ " return 0;\n" +
+ " ^^^^^^^^^\n" +
+ "Void methods cannot return a value\n" +
"----------\n");
}
public void test008() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface VoidI {\n" +
- " void foo(String s);\n" +
- "}\n" +
- "class Test {\n" +
- " public String gooVoid(VoidI i){return \"\";}\n" +
- "}\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Test test = new Test();\n" +
- " test.gooVoid((x) -> {\n" +
- " if (x != null) {\n" +
- " x += \"a\";\n" +
- " } else {\n" +
- " return 0;\n" +
- " }\n" +
- " });\n" +
- " }\n" +
+ "interface VoidI {\n" +
+ " void foo(String s);\n" +
+ "}\n" +
+ "class Test {\n" +
+ " public String gooVoid(VoidI i){return \"\";}\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Test test = new Test();\n" +
+ " test.gooVoid((x) -> {\n" +
+ " if (x != null) {\n" +
+ " x += \"a\";\n" +
+ " } else {\n" +
+ " return 0;\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " test.gooVoid((x) -> {\n" +
- " ^^^^^^^\n" +
- "The method gooVoid(VoidI) in the type Test is not applicable for the arguments ((<no type> x) -> {})\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " return 0;\n" +
- " ^^^^^^^^^\n" +
- "Void methods cannot return a value\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " test.gooVoid((x) -> {\n" +
+ " ^^^^^^^\n" +
+ "The method gooVoid(VoidI) in the type Test is not applicable for the arguments ((<no type> x) -> {})\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " return 0;\n" +
+ " ^^^^^^^^^\n" +
+ "Void methods cannot return a value\n" +
"----------\n");
}
public void test009() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " String foo(int x); \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test() {\n" +
- " final boolean FALSE = false;\n" +
- " goo((x) -> {\n" +
- " if(FALSE) return \"\";\n" +
- " });\n" +
- " }\n" +
+ "interface I {\n" +
+ " String foo(int x); \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test() {\n" +
+ " final boolean FALSE = false;\n" +
+ " goo((x) -> {\n" +
+ " if(FALSE) return \"\";\n" +
+ " });\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
"----------\n");
}
public void test010() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " String foo(int x); \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test() {\n" +
- " goo((x) -> {\n" +
- " if(true);\n" +
- " else return \"\";\n" +
- " });\n" +
- " }\n" +
+ "interface I {\n" +
+ " String foo(int x); \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test() {\n" +
+ " goo((x) -> {\n" +
+ " if(true);\n" +
+ " else return \"\";\n" +
+ " });\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " else return \"\";\n" +
- " ^^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " else return \"\";\n" +
+ " ^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n");
}
public void test011() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " String foo(int x); \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test() {\n" +
- " goo((x) -> {\n" +
- " if(false) return null;\n" +
- " else;\n" +
- " });\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " if(false) return null;\n" +
- " ^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 9)\n" +
- " else;\n" +
- " ^\n" +
- "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
+ "interface I {\n" +
+ " String foo(int x); \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test() {\n" +
+ " goo((x) -> {\n" +
+ " if(false) return null;\n" +
+ " else;\n" +
+ " });\n" +
+ " }\n" +
+ "}\n"
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " if(false) return null;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 9)\n" +
+ " else;\n" +
+ " ^\n" +
+ "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
"----------\n");
}
public void test012() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " String foo(int x); \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test() {\n" +
- " goo((x) -> {\n" +
- " if(x > 0) return \"\";\n" +
- " else;\n" +
- " });\n" +
- " }\n" +
+ "interface I {\n" +
+ " String foo(int x); \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test() {\n" +
+ " goo((x) -> {\n" +
+ " if(x > 0) return \"\";\n" +
+ " else;\n" +
+ " });\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " else;\n" +
- " ^\n" +
- "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " else;\n" +
+ " ^\n" +
+ "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
"----------\n");
}
public void test013() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " String foo(int x); \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test() {\n" +
- " goo((x) -> {\n" +
- " if(x > 0);\n" +
- " else return \"\";\n" +
- " });\n" +
- " }\n" +
+ "interface I {\n" +
+ " String foo(int x); \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test() {\n" +
+ " goo((x) -> {\n" +
+ " if(x > 0);\n" +
+ " else return \"\";\n" +
+ " });\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
"----------\n");
}
public void test014() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " String foo(int x); \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test() {\n" +
- " goo((x) -> {\n" +
- " if(x < 0) return null;\n" +
- " });\n" +
- " }\n" +
+ "interface I {\n" +
+ " String foo(int x); \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test() {\n" +
+ " goo((x) -> {\n" +
+ " if(x < 0) return null;\n" +
+ " });\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
"----------\n");
}
public void test015() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " String foo(int x); \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test() {\n" +
- " final boolean FALSE = false;\n" +
- " goo((x) -> {\n" +
- " if(!FALSE) return \"\";\n" +
- " });\n" +
- " }\n" +
+ "interface I {\n" +
+ " String foo(int x); \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test() {\n" +
+ " final boolean FALSE = false;\n" +
+ " goo((x) -> {\n" +
+ " if(!FALSE) return \"\";\n" +
+ " });\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
"----------\n");
}
public void test016() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " String foo(int x) throws Exception;\n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test() {\n" +
- " final boolean FALSE = false;\n" +
- " goo((x) -> {while (FALSE) throw new Exception();});\n" +
- " }\n" +
+ "interface I {\n" +
+ " String foo(int x) throws Exception;\n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test() {\n" +
+ " final boolean FALSE = false;\n" +
+ " goo((x) -> {while (FALSE) throw new Exception();});\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " goo((x) -> {while (FALSE) throw new Exception();});\n" +
- " ^^^^^^\n" +
- "This lambda expression must return a result of type String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " goo((x) -> {while (FALSE) throw new Exception();});\n" +
+ " ^^^^^^\n" +
+ "This lambda expression must return a result of type String\n" +
"----------\n");
}
public void test017() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " String foo(int x) throws Exception;\n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test() {\n" +
- " goo((x) -> {while (false) return \"\";});\n" +
- " }\n" +
+ "interface I {\n" +
+ " String foo(int x) throws Exception;\n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test() {\n" +
+ " goo((x) -> {while (false) return \"\";});\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {while (false) return \"\";});\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {while (false) return \"\";});\n" +
- " ^^^^^^^^^^\n" +
- "Unreachable code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {while (false) return \"\";});\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {while (false) return \"\";});\n" +
+ " ^^^^^^^^^^\n" +
+ "Unreachable code\n" +
"----------\n");
}
public void test018() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " String foo(int x) throws Exception;\n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test() {\n" +
- " goo((x) -> {while (x > 0) {\n" +
- " if(x > 0) {return \"\";} else {break;}\n" +
- " }});\n" +
- " }\n" +
+ "interface I {\n" +
+ " String foo(int x) throws Exception;\n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test() {\n" +
+ " goo((x) -> {while (x > 0) {\n" +
+ " if(x > 0) {return \"\";} else {break;}\n" +
+ " }});\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {while (x > 0) {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " if(x > 0) {return \"\";} else {break;}\n" +
- " ^^^^^^^^\n" +
- "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {while (x > 0) {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " if(x > 0) {return \"\";} else {break;}\n" +
+ " ^^^^^^^^\n" +
+ "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
"----------\n");
}
public void test019() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " String foo(int x) throws Exception;\n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test() {\n" +
- " goo((x) -> {while (x > 0) {\n" +
- " if(x > 0) {return \"\";}\n" +
- " }});\n" +
- " }\n" +
+ "interface I {\n" +
+ " String foo(int x) throws Exception;\n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test() {\n" +
+ " goo((x) -> {while (x > 0) {\n" +
+ " if(x > 0) {return \"\";}\n" +
+ " }});\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {while (x > 0) {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {while (x > 0) {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
"----------\n");
}
public void test020() {
this.runConformTest(
new String[] {
"X.java",
- "interface I {\n" +
- " String foo(int x) throws Exception;\n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test() {\n" +
- " final boolean TRUE = true;\n" +
- " goo((x) -> {while (TRUE) {\n" +
- " if(x > 0) {System.out.println();}\n" +
- " }});\n" +
- " goo((x) -> {while (true) {\n" +
- " if(x > 0) {System.out.println();}\n" +
- " }});\n" +
- " }\n" +
+ "interface I {\n" +
+ " String foo(int x) throws Exception;\n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test() {\n" +
+ " final boolean TRUE = true;\n" +
+ " goo((x) -> {while (TRUE) {\n" +
+ " if(x > 0) {System.out.println();}\n" +
+ " }});\n" +
+ " goo((x) -> {while (true) {\n" +
+ " if(x > 0) {System.out.println();}\n" +
+ " }});\n" +
+ " }\n" +
"}\n"
});
}
@@ -677,80 +677,80 @@ public void test021() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " String foo(int x) throws Exception;\n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test() {\n" +
- " goo((x) -> {\n" +
- " int i = 100;\n" +
- " outer: while(x > 0) {\n" +
- " inner: while(i > 0) {\n" +
- " if(--i > 50) {\n" +
- " return \"\";\n" +
- " }\n" +
- " if(i > 90) {\n" +
- " break outer;\n" +
- " }\n" +
- " return \"\";\n" +
- " }\n" +
- " }});\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " inner: while(i > 0) {\n" +
- " ^^^^^\n" +
- "The label inner is never explicitly referenced\n" +
+ "interface I {\n" +
+ " String foo(int x) throws Exception;\n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test() {\n" +
+ " goo((x) -> {\n" +
+ " int i = 100;\n" +
+ " outer: while(x > 0) {\n" +
+ " inner: while(i > 0) {\n" +
+ " if(--i > 50) {\n" +
+ " return \"\";\n" +
+ " }\n" +
+ " if(i > 90) {\n" +
+ " break outer;\n" +
+ " }\n" +
+ " return \"\";\n" +
+ " }\n" +
+ " }});\n" +
+ " }\n" +
+ "}\n"
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " inner: while(i > 0) {\n" +
+ " ^^^^^\n" +
+ "The label inner is never explicitly referenced\n" +
"----------\n");
}
public void test022() {
this.runConformTest(
new String[] {
"X.java",
- "interface I {\n" +
- " void foo(String s) throws Exception;\n" +
- "}\n" +
- "public class X {\n" +
- " void zoo(I i) {}\n" +
- " void test() {\n" +
- " final boolean FALSE = false;\n" +
- " final boolean TRUE = true;\n" +
- " zoo((x) -> {while (TRUE) throw new Exception();});\n" +
- " zoo((x) -> {while (!FALSE) return ;});\n" +
- " zoo((x) -> {while (x.length() > 0) {\n" +
- " if(x.length() > 0) {return ;} else {break;}\n" +
- " }});\n" +
- " zoo((x) -> {while (x.length() > 0) {\n" +
- " if(x.length() > 0) {return ;}\n" +
- " }});\n" +
- " zoo((x) -> {while (true) {\n" +
- " if(x.length() > 0) {System.out.println();}\n" +
- " }});\n" +
- " zoo((x) -> {while (TRUE) {\n" +
- " if(x.length() > 0) {System.out.println();}\n" +
- " }});\n" +
- " zoo((x) -> {\n" +
- " int i = 100;\n" +
- " outer: while(x.length() > 0) {\n" +
- " inner: while(i > 0) {\n" +
- " if(--i > 50) {\n" +
- " break inner ;\n" +
- " }\n" +
- " if(i > 90) {\n" +
- " break outer;\n" +
- " }\n" +
- " return ;\n" +
- " }\n" +
- " }});\n" +
- " }\n" +
+ "interface I {\n" +
+ " void foo(String s) throws Exception;\n" +
+ "}\n" +
+ "public class X {\n" +
+ " void zoo(I i) {}\n" +
+ " void test() {\n" +
+ " final boolean FALSE = false;\n" +
+ " final boolean TRUE = true;\n" +
+ " zoo((x) -> {while (TRUE) throw new Exception();});\n" +
+ " zoo((x) -> {while (!FALSE) return ;});\n" +
+ " zoo((x) -> {while (x.length() > 0) {\n" +
+ " if(x.length() > 0) {return ;} else {break;}\n" +
+ " }});\n" +
+ " zoo((x) -> {while (x.length() > 0) {\n" +
+ " if(x.length() > 0) {return ;}\n" +
+ " }});\n" +
+ " zoo((x) -> {while (true) {\n" +
+ " if(x.length() > 0) {System.out.println();}\n" +
+ " }});\n" +
+ " zoo((x) -> {while (TRUE) {\n" +
+ " if(x.length() > 0) {System.out.println();}\n" +
+ " }});\n" +
+ " zoo((x) -> {\n" +
+ " int i = 100;\n" +
+ " outer: while(x.length() > 0) {\n" +
+ " inner: while(i > 0) {\n" +
+ " if(--i > 50) {\n" +
+ " break inner ;\n" +
+ " }\n" +
+ " if(i > 90) {\n" +
+ " break outer;\n" +
+ " }\n" +
+ " return ;\n" +
+ " }\n" +
+ " }});\n" +
+ " }\n" +
"}\n"
});
}
@@ -758,23 +758,23 @@ public void test023() {
this.runConformTest(
new String[] {
"X.java",
- "interface I {\n" +
- " String foo(int x) throws Exception;\n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test() {\n" +
- " final boolean FALSE = false;\n" +
- " final boolean TRUE = true;\n" +
- " goo((x) -> {do {throw new Exception();}while (FALSE);});\n" +
- " goo((x) -> {do { return \"\";}while (false);});\n" +
- " goo((x) -> {do {\n" +
- " if(x > 0) {System.out.println();}\n" +
- " }while (true);});\n" +
- " goo((x) -> {do {\n" +
- " if(x > 0) {System.out.println();}\n" +
- " }while (TRUE);});\n" +
- " }\n" +
+ "interface I {\n" +
+ " String foo(int x) throws Exception;\n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test() {\n" +
+ " final boolean FALSE = false;\n" +
+ " final boolean TRUE = true;\n" +
+ " goo((x) -> {do {throw new Exception();}while (FALSE);});\n" +
+ " goo((x) -> {do { return \"\";}while (false);});\n" +
+ " goo((x) -> {do {\n" +
+ " if(x > 0) {System.out.println();}\n" +
+ " }while (true);});\n" +
+ " goo((x) -> {do {\n" +
+ " if(x > 0) {System.out.println();}\n" +
+ " }while (TRUE);});\n" +
+ " }\n" +
"}\n"
});
}
@@ -782,129 +782,129 @@ public void test024() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " String foo(int x) throws Exception;\n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test() {\n" +
- " goo((x) -> {do {\n" +
- " if(x > 0) {return \"\";} else {break;}\n" +
- " }while (x > 0);});\n" +
- " }\n" +
+ "interface I {\n" +
+ " String foo(int x) throws Exception;\n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test() {\n" +
+ " goo((x) -> {do {\n" +
+ " if(x > 0) {return \"\";} else {break;}\n" +
+ " }while (x > 0);});\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {do {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " if(x > 0) {return \"\";} else {break;}\n" +
- " ^^^^^^^^\n" +
- "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {do {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " if(x > 0) {return \"\";} else {break;}\n" +
+ " ^^^^^^^^\n" +
+ "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
"----------\n");
}
public void test025() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " String foo(int x) throws Exception;\n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test() {\n" +
- " goo((x) -> {do {\n" +
- " if(x > 0) {return \"\";}\n" +
- " }while (x > 0);});\n" +
- " }\n" +
+ "interface I {\n" +
+ " String foo(int x) throws Exception;\n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test() {\n" +
+ " goo((x) -> {do {\n" +
+ " if(x > 0) {return \"\";}\n" +
+ " }while (x > 0);});\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {do {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {do {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
"----------\n");
}
public void test026() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " String foo(int x) throws Exception;\n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test() {\n" +
- " goo((x) -> {\n" +
- " int i = 100;\n" +
- " outer: do {\n" +
- " inner: do {\n" +
- " if(--i > 50) {\n" +
- " return \"\";\n" +
- " }\n" +
- " if(i > 90) {\n" +
- " break outer;\n" +
- " }\n" +
- " return \"\";\n" +
- " }while(i > 0);\n" +
- " }while(x > 0);});\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " inner: do {\n" +
- " ^^^^^\n" +
- "The label inner is never explicitly referenced\n" +
+ "interface I {\n" +
+ " String foo(int x) throws Exception;\n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test() {\n" +
+ " goo((x) -> {\n" +
+ " int i = 100;\n" +
+ " outer: do {\n" +
+ " inner: do {\n" +
+ " if(--i > 50) {\n" +
+ " return \"\";\n" +
+ " }\n" +
+ " if(i > 90) {\n" +
+ " break outer;\n" +
+ " }\n" +
+ " return \"\";\n" +
+ " }while(i > 0);\n" +
+ " }while(x > 0);});\n" +
+ " }\n" +
+ "}\n"
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " inner: do {\n" +
+ " ^^^^^\n" +
+ "The label inner is never explicitly referenced\n" +
"----------\n");
}
public void test027() {
this.runConformTest(
new String[] {
"X.java",
- "interface I {\n" +
- " void foo(String s) throws Exception;\n" +
- "}\n" +
- "public class X {\n" +
- " void zoo(I i) {}\n" +
- " void test() {\n" +
- " zoo((x) -> {do {\n" +
- " if(x.length() > 0) {System.out.println();}\n" +
- " }while (true);});\n" +
- " zoo((x) -> {do {throw new Exception();}while (false);});\n" +
- " zoo((x) -> {do { return ;}while (false);});\n" +
- " zoo((x) -> {do { continue ;}while (true);});\n" +
- " zoo((x) -> {do {\n" +
- " if(x.length() > 0) {return ;} else {break;}\n" +
- " }while (x.length() > 0);\n" +
- " });\n" +
- " zoo((x) -> {do {\n" +
- " if(x.length() > 0) {return ;}\n" +
- " }while (x.length() > 0);\n" +
- " });\n" +
- " zoo((x) -> {\n" +
- " int i = 100;\n" +
- " outer: do {\n" +
- " inner: do {\n" +
- " if(--i > 50) {\n" +
- " break inner ;\n" +
- " }\n" +
- " if(i > 90) {\n" +
- " break outer;\n" +
- " }\n" +
- " return ;\n" +
- " }while(i > 0);\n" +
- " }while(x.length() > 0);});\n" +
- " }\n" +
+ "interface I {\n" +
+ " void foo(String s) throws Exception;\n" +
+ "}\n" +
+ "public class X {\n" +
+ " void zoo(I i) {}\n" +
+ " void test() {\n" +
+ " zoo((x) -> {do {\n" +
+ " if(x.length() > 0) {System.out.println();}\n" +
+ " }while (true);});\n" +
+ " zoo((x) -> {do {throw new Exception();}while (false);});\n" +
+ " zoo((x) -> {do { return ;}while (false);});\n" +
+ " zoo((x) -> {do { continue ;}while (true);});\n" +
+ " zoo((x) -> {do {\n" +
+ " if(x.length() > 0) {return ;} else {break;}\n" +
+ " }while (x.length() > 0);\n" +
+ " });\n" +
+ " zoo((x) -> {do {\n" +
+ " if(x.length() > 0) {return ;}\n" +
+ " }while (x.length() > 0);\n" +
+ " });\n" +
+ " zoo((x) -> {\n" +
+ " int i = 100;\n" +
+ " outer: do {\n" +
+ " inner: do {\n" +
+ " if(--i > 50) {\n" +
+ " break inner ;\n" +
+ " }\n" +
+ " if(i > 90) {\n" +
+ " break outer;\n" +
+ " }\n" +
+ " return ;\n" +
+ " }while(i > 0);\n" +
+ " }while(x.length() > 0);});\n" +
+ " }\n" +
"}\n"
});
}
@@ -912,48 +912,48 @@ public void test028() {
this.runConformTest(
new String[] {
"X.java",
- "interface I { \n" +
- " String foo(int x) throws Exception; \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test() {\n" +
- " final boolean FALSE = false; \n" +
- " final boolean TRUE = true; \n" +
- " goo((x) -> {\n" +
- " for(;TRUE;){\n" +
- " }});\n" +
- " goo((x) -> {\n" +
- " for(int i = 0;i < 100; i+= 10){\n" +
- " switch(i) {\n" +
- " case 90: {\n" +
- " System.out.println();\n" +
- " break;\n" +
- " }\n" +
- " case 80: {\n" +
- " if(x > 10) return null;\n" +
- " break;\n" +
- " }\n" +
- " default:\n" +
- " return \"\";\n" +
- " }\n" +
- " }\n" +
- " return \"\";\n" +
- " });\n" +
- " \n" +
- " goo((x) -> {\n" +
- " for(;TRUE;){\n" +
- " if(x < 100) return \"\";\n" +
- " else return null;\n" +
- " }});\n" +
- " goo((x) -> {\n" +
- " for(;x > 0;){\n" +
- " if(x < 100) return \"\";\n" +
- " else return null;\n" +
- " }\n" +
- " return null;\n" +
- " });\n" +
- " }\n" +
+ "interface I { \n" +
+ " String foo(int x) throws Exception; \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test() {\n" +
+ " final boolean FALSE = false; \n" +
+ " final boolean TRUE = true; \n" +
+ " goo((x) -> {\n" +
+ " for(;TRUE;){\n" +
+ " }});\n" +
+ " goo((x) -> {\n" +
+ " for(int i = 0;i < 100; i+= 10){\n" +
+ " switch(i) {\n" +
+ " case 90: {\n" +
+ " System.out.println();\n" +
+ " break;\n" +
+ " }\n" +
+ " case 80: {\n" +
+ " if(x > 10) return null;\n" +
+ " break;\n" +
+ " }\n" +
+ " default:\n" +
+ " return \"\";\n" +
+ " }\n" +
+ " }\n" +
+ " return \"\";\n" +
+ " });\n" +
+ " \n" +
+ " goo((x) -> {\n" +
+ " for(;TRUE;){\n" +
+ " if(x < 100) return \"\";\n" +
+ " else return null;\n" +
+ " }});\n" +
+ " goo((x) -> {\n" +
+ " for(;x > 0;){\n" +
+ " if(x < 100) return \"\";\n" +
+ " else return null;\n" +
+ " }\n" +
+ " return null;\n" +
+ " });\n" +
+ " }\n" +
"}\n"
});
}
@@ -961,171 +961,171 @@ public void test029() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I { \n" +
- " String foo(int x) throws Exception; \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test() {\n" +
- " final boolean FALSE = false; \n" +
- " goo((x) -> {\n" +
- " for(;FALSE;){\n" +
- " }});\n" +
- " }\n" +
+ "interface I { \n" +
+ " String foo(int x) throws Exception; \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test() {\n" +
+ " final boolean FALSE = false; \n" +
+ " goo((x) -> {\n" +
+ " for(;FALSE;){\n" +
+ " }});\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This lambda expression must return a result of type String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This lambda expression must return a result of type String\n" +
"----------\n");
}
public void test030() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I { \n" +
- " String foo(int x) throws Exception; \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test() {\n" +
- " goo((x) -> {\n" +
- " for(;x > 0;){\n" +
- " if(x < 100) return \"\";\n" +
- " else return null;\n" +
- " }});\n" +
- " }\n" +
+ "interface I { \n" +
+ " String foo(int x) throws Exception; \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test() {\n" +
+ " goo((x) -> {\n" +
+ " for(;x > 0;){\n" +
+ " if(x < 100) return \"\";\n" +
+ " else return null;\n" +
+ " }});\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " else return null;\n" +
- " ^^^^^^^^^^^^\n" +
- "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " else return null;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
"----------\n");
}
public void test031() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I { \n" +
- " String foo(int x) throws Exception; \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test() {\n" +
- " goo((x) -> {\n" +
- " for(int i = 0;i < 100; i+= 10){\n" +
- " switch(i) {\n" +
- " case 90: {\n" +
- " System.out.println();\n" +
- " break;\n" +
- " }\n" +
- " case 80: {\n" +
- " if(x > 10) return null;\n" +
- " break;\n" +
- " }\n" +
- " default:\n" +
- " return \"\";\n" +
- " }\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
+ "interface I { \n" +
+ " String foo(int x) throws Exception; \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test() {\n" +
+ " goo((x) -> {\n" +
+ " for(int i = 0;i < 100; i+= 10){\n" +
+ " switch(i) {\n" +
+ " case 90: {\n" +
+ " System.out.println();\n" +
+ " break;\n" +
+ " }\n" +
+ " case 80: {\n" +
+ " if(x > 10) return null;\n" +
+ " break;\n" +
+ " }\n" +
+ " default:\n" +
+ " return \"\";\n" +
+ " }\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
+ "}\n"
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
"----------\n");
}
public void test032() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I { \n" +
- " String foo(int x) throws Exception; \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test() {\n" +
- " goo((x) -> {\n" +
- " outer: for(int i = 0;i < 100; i+= 10){\n" +
- " inner : for(int j = x; j > 0; j--) {\n" +
- " switch(i) {\n" +
- " case 90: {\n" +
- " System.out.println();\n" +
- " break inner;\n" +
- " }\n" +
- " case 80: {\n" +
- " if(x > 10) return null;\n" +
- " break outer;\n" +
- " }\n" +
- " default:\n" +
- " return \"\";\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " }\n" +
- " });\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " inner : for(int j = x; j > 0; j--) {\n" +
- " ^^^\n" +
- "Dead code\n" +
+ "interface I { \n" +
+ " String foo(int x) throws Exception; \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test() {\n" +
+ " goo((x) -> {\n" +
+ " outer: for(int i = 0;i < 100; i+= 10){\n" +
+ " inner : for(int j = x; j > 0; j--) {\n" +
+ " switch(i) {\n" +
+ " case 90: {\n" +
+ " System.out.println();\n" +
+ " break inner;\n" +
+ " }\n" +
+ " case 80: {\n" +
+ " if(x > 10) return null;\n" +
+ " break outer;\n" +
+ " }\n" +
+ " default:\n" +
+ " return \"\";\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
+ "}\n"
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " inner : for(int j = x; j > 0; j--) {\n" +
+ " ^^^\n" +
+ "Dead code\n" +
"----------\n");
}
public void test033() {
this.runConformTest(
new String[] {
"X.java",
- "interface I { \n" +
- " String foo(int x) throws Exception; \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test(String[] strs) {\n" +
- " goo((x) -> {\n" +
- " for(String str : strs){\n" +
- " if(str.length() > 0) {\n" +
- " return \"yes\";\n" +
- " } else {\n" +
- " return \"no\";\n" +
- " }\n" +
- " }\n" +
- " return null;\n" +
- " });\n" +
- " goo((x) -> {\n" +
- " for(String str : strs){\n" +
- " return \"no\";\n" +
- " }\n" +
- " return \"\";\n" +
- " });\n" +
- " \n" +
- " goo((x) -> {\n" +
- " for(String str : strs){\n" +
- " if(str.length() > 0) break;\n" +
- " System.out.println();\n" +
- " }\n" +
- " return \"\";\n" +
- " });\n" +
- " }\n" +
+ "interface I { \n" +
+ " String foo(int x) throws Exception; \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test(String[] strs) {\n" +
+ " goo((x) -> {\n" +
+ " for(String str : strs){\n" +
+ " if(str.length() > 0) {\n" +
+ " return \"yes\";\n" +
+ " } else {\n" +
+ " return \"no\";\n" +
+ " }\n" +
+ " }\n" +
+ " return null;\n" +
+ " });\n" +
+ " goo((x) -> {\n" +
+ " for(String str : strs){\n" +
+ " return \"no\";\n" +
+ " }\n" +
+ " return \"\";\n" +
+ " });\n" +
+ " \n" +
+ " goo((x) -> {\n" +
+ " for(String str : strs){\n" +
+ " if(str.length() > 0) break;\n" +
+ " System.out.println();\n" +
+ " }\n" +
+ " return \"\";\n" +
+ " });\n" +
+ " }\n" +
"}\n"
});
}
@@ -1133,174 +1133,174 @@ public void test034() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I { \n" +
- " String foo(int x) throws Exception; \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test(String[] strs) {\n" +
- " goo((x) -> {\n" +
- " for(String str : strs){\n" +
- " if(str.length() > 0) {\n" +
- " return \"yes\";\n" +
- " } else {\n" +
- " return \"no\";\n" +
- " }\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 11)\n" +
- " } else {\n" +
- " return \"no\";\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
+ "interface I { \n" +
+ " String foo(int x) throws Exception; \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test(String[] strs) {\n" +
+ " goo((x) -> {\n" +
+ " for(String str : strs){\n" +
+ " if(str.length() > 0) {\n" +
+ " return \"yes\";\n" +
+ " } else {\n" +
+ " return \"no\";\n" +
+ " }\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
+ "}\n"
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 11)\n" +
+ " } else {\n" +
+ " return \"no\";\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
"----------\n");
}
public void test035() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I { \n" +
- " String foo(int x) throws Exception; \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test(String[] strs) {\n" +
- " goo((x) -> {\n" +
- " for(String str : strs){\n" +
- " return \"no\";\n" +
- " }\n" +
- " });\n" +
- " }\n" +
+ "interface I { \n" +
+ " String foo(int x) throws Exception; \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test(String[] strs) {\n" +
+ " goo((x) -> {\n" +
+ " for(String str : strs){\n" +
+ " return \"no\";\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
"----------\n");
}
public void test036() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I { \n" +
- " String foo(int x) throws Exception; \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test(String[] strs) {\n" +
- " goo((x) -> {\n" +
- " for(String str : strs){\n" +
- " switch(str.length()) {\n" +
- " case 9: {\n" +
- " System.out.println();\n" +
- " return \"nine\";\n" +
- " }\n" +
- " case 1: {\n" +
- " if(x > 10) return null;\n" +
- " return \"one\";\n" +
- " }\n" +
- " default:\n" +
- " return \"\";\n" +
- " }\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
+ "interface I { \n" +
+ " String foo(int x) throws Exception; \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test(String[] strs) {\n" +
+ " goo((x) -> {\n" +
+ " for(String str : strs){\n" +
+ " switch(str.length()) {\n" +
+ " case 9: {\n" +
+ " System.out.println();\n" +
+ " return \"nine\";\n" +
+ " }\n" +
+ " case 1: {\n" +
+ " if(x > 10) return null;\n" +
+ " return \"one\";\n" +
+ " }\n" +
+ " default:\n" +
+ " return \"\";\n" +
+ " }\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
+ "}\n"
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
"----------\n");
}
public void test037() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I { \n" +
- " String foo(int x) throws Exception; \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test(String[] strs) {\n" +
- " goo((x) -> {\n" +
- " outer: for(String str : strs){\n" +
- " inner : for(int j = x; j > 0; j--) {\n" +
- " switch(str.length()) {\n" +
- " case 9: {\n" +
- " System.out.println();\n" +
- " break inner;\n" +
- " }\n" +
- " case 8: {\n" +
- " if(x > 10) return null;\n" +
- " break outer;\n" +
- " }\n" +
- " default:\n" +
- " return \"\";\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " inner : for(int j = x; j > 0; j--) {\n" +
- " ^^^\n" +
- "Dead code\n" +
+ "interface I { \n" +
+ " String foo(int x) throws Exception; \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test(String[] strs) {\n" +
+ " goo((x) -> {\n" +
+ " outer: for(String str : strs){\n" +
+ " inner : for(int j = x; j > 0; j--) {\n" +
+ " switch(str.length()) {\n" +
+ " case 9: {\n" +
+ " System.out.println();\n" +
+ " break inner;\n" +
+ " }\n" +
+ " case 8: {\n" +
+ " if(x > 10) return null;\n" +
+ " break outer;\n" +
+ " }\n" +
+ " default:\n" +
+ " return \"\";\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
+ "}\n"
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " inner : for(int j = x; j > 0; j--) {\n" +
+ " ^^^\n" +
+ "Dead code\n" +
"----------\n");
}
public void test038() {
this.runConformTest(
new String[] {
"X.java",
- "interface I { \n" +
- " String foo(int x) throws Exception; \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test(String[] strs) {\n" +
- " goo((x) -> {\n" +
- " switch(x) {\n" +
- " case 0 : if(x > 10) return \">10\";\n" +
- " case 1: return \"1\";\n" +
- " default: return \"-1\";\n" +
- " }\n" +
- " });\n" +
- " goo((x) -> {\n" +
- " String str = \"\";\n" +
- " switch(x) {\n" +
- " case 0 : if(x > 10) break; else {str = \"0\"; break;}\n" +
- " case 1: str = \"1\";break;\n" +
- " default: break;\n" +
- " }\n" +
- " return str;\n" +
- " });\n" +
- " goo((x) -> {\n" +
- " String str = \"\";\n" +
- " switch(x){}\n" +
- " return str;\n" +
- " });\n" +
- " }\n" +
+ "interface I { \n" +
+ " String foo(int x) throws Exception; \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test(String[] strs) {\n" +
+ " goo((x) -> {\n" +
+ " switch(x) {\n" +
+ " case 0 : if(x > 10) return \">10\";\n" +
+ " case 1: return \"1\";\n" +
+ " default: return \"-1\";\n" +
+ " }\n" +
+ " });\n" +
+ " goo((x) -> {\n" +
+ " String str = \"\";\n" +
+ " switch(x) {\n" +
+ " case 0 : if(x > 10) break; else {str = \"0\"; break;}\n" +
+ " case 1: str = \"1\";break;\n" +
+ " default: break;\n" +
+ " }\n" +
+ " return str;\n" +
+ " });\n" +
+ " goo((x) -> {\n" +
+ " String str = \"\";\n" +
+ " switch(x){}\n" +
+ " return str;\n" +
+ " });\n" +
+ " }\n" +
"}\n"
});
}
@@ -1308,92 +1308,92 @@ public void test039() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I { \n" +
- " String foo(int x) throws Exception; \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test(String[] strs) {\n" +
- " goo((x) -> {\n" +
- " switch(x) {\n" +
- " case 0 : if(x > 10) return \">10\";\n" +
- " case 1: return \"1\";\n" +
- " }\n" +
- " });\n" +
- " }\n" +
+ "interface I { \n" +
+ " String foo(int x) throws Exception; \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test(String[] strs) {\n" +
+ " goo((x) -> {\n" +
+ " switch(x) {\n" +
+ " case 0 : if(x > 10) return \">10\";\n" +
+ " case 1: return \"1\";\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
"----------\n");
}
public void test040() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I { \n" +
- " String foo(int x) throws Exception; \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test(String[] strs) {\n" +
- " goo((x) -> {\n" +
- " String str = \"\";\n" +
- " switch(x) {\n" +
- " case 0 : if(x > 10) break; else {str = \"0\"; break;}\n" +
- " case 1: str = \"1\";break;\n" +
- " default: break;\n" +
- " }\n" +
+ "interface I { \n" +
+ " String foo(int x) throws Exception; \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test(String[] strs) {\n" +
+ " goo((x) -> {\n" +
+ " String str = \"\";\n" +
+ " switch(x) {\n" +
+ " case 0 : if(x > 10) break; else {str = \"0\"; break;}\n" +
+ " case 1: str = \"1\";break;\n" +
+ " default: break;\n" +
+ " }\n" +
" });\n" +
- " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments ((<no type> x) -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments ((<no type> x) -> {})\n" +
"----------\n");
}
public void test041() {
this.runConformTest(
new String[] {
"X.java",
- "interface I { \n" +
- " String foo(int x) throws Exception; \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test(String[] strs) {\n" +
- " goo((x) -> {\n" +
- " try {\n" +
- " return \"\";\n" +
- " } finally {\n" +
- " \n" +
- " }\n" +
- " });\n" +
- " goo((x) -> {\n" +
- " try {\n" +
- " throw new Exception();\n" +
- " } finally {\n" +
- " }\n" +
- " });\n" +
- " goo((x) -> {\n" +
- " try {\n" +
- " if(x > 0) \n" +
- " throw new RuntimeException();\n" +
- " } catch (NullPointerException e) {return null;} \n" +
- " catch(ClassCastException c) {\n" +
- " }\n" +
- " finally {\n" +
- " return \"\";\n" +
- " }\n" +
- " });\n" +
- " \n" +
- " }\n" +
+ "interface I { \n" +
+ " String foo(int x) throws Exception; \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test(String[] strs) {\n" +
+ " goo((x) -> {\n" +
+ " try {\n" +
+ " return \"\";\n" +
+ " } finally {\n" +
+ " \n" +
+ " }\n" +
+ " });\n" +
+ " goo((x) -> {\n" +
+ " try {\n" +
+ " throw new Exception();\n" +
+ " } finally {\n" +
+ " }\n" +
+ " });\n" +
+ " goo((x) -> {\n" +
+ " try {\n" +
+ " if(x > 0) \n" +
+ " throw new RuntimeException();\n" +
+ " } catch (NullPointerException e) {return null;} \n" +
+ " catch(ClassCastException c) {\n" +
+ " }\n" +
+ " finally {\n" +
+ " return \"\";\n" +
+ " }\n" +
+ " });\n" +
+ " \n" +
+ " }\n" +
"}\n"
});
}
@@ -1401,161 +1401,161 @@ public void test042() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I { \n" +
- " String foo(int x) throws Exception; \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test(String[] strs) {\n" +
- " goo((x) -> {\n" +
- " try {\n" +
- " if(x > 0) {\n" +
- " return \"\";\n" +
- " }\n" +
- " } finally {}\n" +
- " });\n" +
- " }\n" +
+ "interface I { \n" +
+ " String foo(int x) throws Exception; \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test(String[] strs) {\n" +
+ " goo((x) -> {\n" +
+ " try {\n" +
+ " if(x > 0) {\n" +
+ " return \"\";\n" +
+ " }\n" +
+ " } finally {}\n" +
+ " });\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
"----------\n");
}
public void test043() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I { \n" +
- " String foo(int x) throws Exception; \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test(String[] strs) {\n" +
- " goo((x) -> {\n" +
- " try {\n" +
- " return \"\";\n" +
- " }catch (Exception e) {}\n" +
- " finally {\n" +
- " \n" +
- " }\n" +
- " });\n" +
- " }\n" +
+ "interface I { \n" +
+ " String foo(int x) throws Exception; \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test(String[] strs) {\n" +
+ " goo((x) -> {\n" +
+ " try {\n" +
+ " return \"\";\n" +
+ " }catch (Exception e) {}\n" +
+ " finally {\n" +
+ " \n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
"----------\n");
}
public void test044() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I { \n" +
- " String foo(int x) throws Exception; \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test(String[] strs) {\n" +
- " goo((x) -> {\n" +
- " try {\n" +
- " //if(x > 0) \n" +
- " throw new RuntimeException();\n" +
- " } catch (NullPointerException e) {return null;} \n" +
- " catch(ClassCastException c) {\n" +
- " }\n" +
- " });\n" +
- " goo((x) -> {\n" +
- " try {\n" +
- " if(x > 0) \n" +
- " throw new RuntimeException();\n" +
- " } catch (NullPointerException e) {return null;} \n" +
- " catch(ClassCastException c) {\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 15)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
+ "interface I { \n" +
+ " String foo(int x) throws Exception; \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test(String[] strs) {\n" +
+ " goo((x) -> {\n" +
+ " try {\n" +
+ " //if(x > 0) \n" +
+ " throw new RuntimeException();\n" +
+ " } catch (NullPointerException e) {return null;} \n" +
+ " catch(ClassCastException c) {\n" +
+ " }\n" +
+ " });\n" +
+ " goo((x) -> {\n" +
+ " try {\n" +
+ " if(x > 0) \n" +
+ " throw new RuntimeException();\n" +
+ " } catch (NullPointerException e) {return null;} \n" +
+ " catch(ClassCastException c) {\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
+ "}\n"
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 15)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
"----------\n");
}
public void test045() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I { \n" +
- " String foo(int x) throws Exception; \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test(String[] strs) {\n" +
- " goo((x) -> {\n" +
- " try {\n" +
- " if(x > 0) \n" +
- " throw new RuntimeException();\n" +
- " } catch (NullPointerException e) {return null;} \n" +
- " catch(ClassCastException c) {\n" +
- " }\n" +
- " });\n" +
- " }\n" +
+ "interface I { \n" +
+ " String foo(int x) throws Exception; \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test(String[] strs) {\n" +
+ " goo((x) -> {\n" +
+ " try {\n" +
+ " if(x > 0) \n" +
+ " throw new RuntimeException();\n" +
+ " } catch (NullPointerException e) {return null;} \n" +
+ " catch(ClassCastException c) {\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
"----------\n");
}
public void test046() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I { \n" +
- " String foo(int x) throws Exception; \n" +
- "}\n" +
- "public class X {\n" +
- " void goo(I i) {}\n" +
- " void test(String[] strs) {\n" +
- " goo((x) -> {\n" +
- " if (true) {\n" +
- " try {\n" +
- " if(x > 0)\n" +
- " throw new Exception();\n" +
- " } finally {\n" +
- " return \"\";\n" +
- " }\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo((x) -> {\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 12)\n" +
- " } finally {\n" +
- " return \"\";\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "finally block does not complete normally\n" +
+ "interface I { \n" +
+ " String foo(int x) throws Exception; \n" +
+ "}\n" +
+ "public class X {\n" +
+ " void goo(I i) {}\n" +
+ " void test(String[] strs) {\n" +
+ " goo((x) -> {\n" +
+ " if (true) {\n" +
+ " try {\n" +
+ " if(x > 0)\n" +
+ " throw new Exception();\n" +
+ " } finally {\n" +
+ " return \"\";\n" +
+ " }\n" +
+ " }\n" +
+ " });\n" +
+ " }\n" +
+ "}\n"
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo((x) -> {\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 12)\n" +
+ " } finally {\n" +
+ " return \"\";\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "finally block does not complete normally\n" +
"----------\n");
}
public void testSwitch() {
@@ -1622,11 +1622,11 @@ public void testSwitch2() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testSwitch3() {
@@ -1658,11 +1658,11 @@ public void testSwitch3() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testSwitch4() {
@@ -1695,11 +1695,11 @@ public void testSwitch4() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testSwitch5() {
@@ -1724,11 +1724,11 @@ public void testSwitch5() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testSwitch6() {
@@ -1752,11 +1752,11 @@ public void testSwitch6() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testWhileThis() {
@@ -1781,11 +1781,11 @@ public void testWhileThis() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testWhile2() {
@@ -1858,11 +1858,11 @@ public void testWhile4() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testDo() {
@@ -1958,11 +1958,11 @@ public void testDo4() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testDo5() {
@@ -1985,11 +1985,11 @@ public void testDo5() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testDo6() {
@@ -2012,11 +2012,11 @@ public void testDo6() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testDo7() {
@@ -2039,11 +2039,11 @@ public void testDo7() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testDo8() {
@@ -2120,11 +2120,11 @@ public void testDo10() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testDo11() {
@@ -2153,11 +2153,11 @@ public void testDo11() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testDo12() {
@@ -2186,11 +2186,11 @@ public void testDo12() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testDo13() {
@@ -2250,11 +2250,11 @@ public void testDo14() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testDo15() {
@@ -2278,11 +2278,11 @@ public void testDo15() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testDo16() {
@@ -2306,11 +2306,11 @@ public void testDo16() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testDo17() {
@@ -2335,11 +2335,11 @@ public void testDo17() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testDo18() {
@@ -2636,11 +2636,11 @@ public void testForeach() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testForeach2() {
@@ -2681,11 +2681,11 @@ public void testForeach2() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testForeach3() {
@@ -2726,11 +2726,11 @@ public void testForeach3() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testForeach4() {
@@ -2755,11 +2755,11 @@ public void testForeach4() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testIf() {
@@ -2782,11 +2782,11 @@ public void testIf() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testIf2() {
@@ -2809,11 +2809,11 @@ public void testIf2() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testIf3() {
@@ -2861,11 +2861,11 @@ public void testCFor() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testCFor2() {
@@ -2934,11 +2934,11 @@ public void testTry2() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testTry3() {
@@ -2962,11 +2962,11 @@ public void testTry3() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testTry4() {
@@ -3010,7 +3010,7 @@ public void testWhileTrue() {
" }\n" +
" });\n" +
" }\n" +
- "}\n"
+ "}\n"
},
"goo(I)");
}
@@ -3034,7 +3034,7 @@ public void testWhileTrue2() {
" }\n" +
" });\n" +
" }\n" +
- "}\n"
+ "}\n"
},
"goo(I)");
}
@@ -3056,13 +3056,13 @@ public void testWhileTrue3() {
" }\n" +
" });\n" +
" }\n" +
- "}\n"
+ "}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " goo(() -> {\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " goo(() -> {\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void testLabeledStatement() {
@@ -3092,7 +3092,7 @@ public void testLabeledStatement() {
" }\n" +
" });\n" +
" }\n" +
- "}\n"
+ "}\n"
},
"J");
}
@@ -3124,7 +3124,7 @@ public void testLabeledStatement2() {
" }\n" +
" });\n" +
" }\n" +
- "}\n"
+ "}\n"
},
"J");
}
@@ -3156,7 +3156,7 @@ public void testLabeledStatement3() {
" }\n" +
" });\n" +
" }\n" +
- "}\n"
+ "}\n"
},
"J");
}
@@ -3188,7 +3188,7 @@ public void testLabeledStatement4() {
" }\n" +
" });\n" +
" }\n" +
- "}\n"
+ "}\n"
},
"J");
}
@@ -3220,7 +3220,7 @@ public void testLabeledStatement5() {
" }\n" +
" });\n" +
" }\n" +
- "}\n"
+ "}\n"
},
"I");
}
@@ -3229,17 +3229,17 @@ public void testBug470232_While() {
this.runConformTest(
new String[] {
"While.java",
- "import java.util.function.Consumer;\n" +
- "class While {\n" +
- " void m() {\n" +
- " t(Long.class, value -> {\n" +
- " int x = 1;\n" +
- " while (--x >= 0)\n" +
- " ;\n" +
- " });\n" +
- " }\n" +
- " <T> void t(Class<T> clazz, Consumer<T> object) {\n" +
- " }\n" +
+ "import java.util.function.Consumer;\n" +
+ "class While {\n" +
+ " void m() {\n" +
+ " t(Long.class, value -> {\n" +
+ " int x = 1;\n" +
+ " while (--x >= 0)\n" +
+ " ;\n" +
+ " });\n" +
+ " }\n" +
+ " <T> void t(Class<T> clazz, Consumer<T> object) {\n" +
+ " }\n" +
"}\n"
});
}
@@ -3248,17 +3248,17 @@ public void testBug470232_Do() {
this.runConformTest(
new String[] {
"While.java",
- "import java.util.function.Consumer;\n" +
- "class While {\n" +
- " void m() {\n" +
- " t(Long.class, value -> {\n" +
- " int x = 1;\n" +
- " do {\n" +
- " }while (--x >= 0);\n" +
- " });\n" +
- " }\n" +
- " <T> void t(Class<T> clazz, Consumer<T> object) {\n" +
- " }\n" +
+ "import java.util.function.Consumer;\n" +
+ "class While {\n" +
+ " void m() {\n" +
+ " t(Long.class, value -> {\n" +
+ " int x = 1;\n" +
+ " do {\n" +
+ " }while (--x >= 0);\n" +
+ " });\n" +
+ " }\n" +
+ " <T> void t(Class<T> clazz, Consumer<T> object) {\n" +
+ " }\n" +
"}\n"
});
}
@@ -3267,17 +3267,17 @@ public void testBug470232_For() {
this.runConformTest(
new String[] {
"While.java",
- "import java.util.function.Consumer;\n" +
- "class While {\n" +
- " void m() {\n" +
- " t(Long.class, value -> {\n" +
- " int x = 1;\n" +
- " for(;--x >= 0;)\n" +
- " ;\n" +
- " });\n" +
- " }\n" +
- " <T> void t(Class<T> clazz, Consumer<T> object) {\n" +
- " }\n" +
+ "import java.util.function.Consumer;\n" +
+ "class While {\n" +
+ " void m() {\n" +
+ " t(Long.class, value -> {\n" +
+ " int x = 1;\n" +
+ " for(;--x >= 0;)\n" +
+ " ;\n" +
+ " });\n" +
+ " }\n" +
+ " <T> void t(Class<T> clazz, Consumer<T> object) {\n" +
+ " }\n" +
"}\n"
});
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LineNumberAttributeTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LineNumberAttributeTest.java
index 07ae72095..cd34e50b5 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LineNumberAttributeTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LineNumberAttributeTest.java
@@ -238,31 +238,31 @@ public void testBug509027() throws Exception {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " // Method descriptor #8 ()V\n" +
- " // Stack: 5, Locals: 1\n" +
- " public Test();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [10]\n" +
- " 4 aload_0 [this]\n" +
- " 5 iconst_2\n" +
- " 6 newarray int [10]\n" +
- " 8 dup\n" +
- " 9 iconst_0\n" +
- " 10 iconst_1\n" +
- " 11 iastore\n" +
- " 12 dup\n" +
- " 13 iconst_1\n" +
- " 14 iconst_2\n" +
- " 15 iastore\n" +
- " 16 putfield linenumber.Test.f : int[] [12]\n" +
- " 19 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
- " [pc: 4, line: 4]\n" +
- " [pc: 14, line: 5]\n" +
- " [pc: 19, line: 3]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 20] local: this index: 0 type: linenumber.Test\n";
+ " // Method descriptor #8 ()V\n" +
+ " // Stack: 5, Locals: 1\n" +
+ " public Test();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [10]\n" +
+ " 4 aload_0 [this]\n" +
+ " 5 iconst_2\n" +
+ " 6 newarray int [10]\n" +
+ " 8 dup\n" +
+ " 9 iconst_0\n" +
+ " 10 iconst_1\n" +
+ " 11 iastore\n" +
+ " 12 dup\n" +
+ " 13 iconst_1\n" +
+ " 14 iconst_2\n" +
+ " 15 iastore\n" +
+ " 16 putfield linenumber.Test.f : int[] [12]\n" +
+ " 19 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
+ " [pc: 4, line: 4]\n" +
+ " [pc: 14, line: 5]\n" +
+ " [pc: 19, line: 3]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 20] local: this index: 0 type: linenumber.Test\n";
int index = actualOutput.indexOf(expectedOutput);
if (index == -1 || expectedOutput.length() == 0) {
System.out.println(Util.displayString(actualOutput, 2));
@@ -276,11 +276,11 @@ public void testBug520714() throws Exception {
runConformTest(
new String[] {
"TestAnon.java",
- "public class TestAnon {\n" +
- " void f1() {\n" +
- " new Object() {\n" +
- " };\n" +
- " }\n" +
+ "public class TestAnon {\n" +
+ " void f1() {\n" +
+ " new Object() {\n" +
+ " };\n" +
+ " }\n" +
"}"
}
);
@@ -294,11 +294,11 @@ public void testBug520714() throws Exception {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " 9 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
- " Local variable table:\n" +
- "";
+ " 9 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
+ " Local variable table:\n" +
+ "";
int index = actualOutput.indexOf(expectedOutput);
if (index == -1 || expectedOutput.length() == 0) {
System.out.println(Util.displayString(actualOutput, 2));
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LocalVariableTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LocalVariableTest.java
index 5f7992e80..8306d6b89 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LocalVariableTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LocalVariableTest.java
@@ -870,52 +870,52 @@ public void testBug537033() {
runNegativeTest(
new String[] {
"ShowBug.java",
- "import java.util.concurrent.Callable;\n" +
- "\n" +
- "public class ShowBug {\n" +
- " private static abstract class X {\n" +
- " abstract void x(int val);\n" +
- " }\n" +
- "\n" +
- " public ShowBug() {\n" +
- " final X x = new X() {\n" +
- " void x(int val) {\n" +
- " if (val > 0) {\n" +
- " // (1) The local variable x may not have been initialized\n" +
- " x.x(val - 1);\n" +
- " }\n" +
- " }\n" +
- " };\n" +
- "\n" +
- " new Callable<Void>() {\n" +
- " public Void call() {\n" +
- " // (2) Missing code implementation in the compiler\n" +
- " x.x(10); \n" +
- " return null;\n" +
- " }\n" +
- " }.call();\n" +
- " }\n" +
+ "import java.util.concurrent.Callable;\n" +
+ "\n" +
+ "public class ShowBug {\n" +
+ " private static abstract class X {\n" +
+ " abstract void x(int val);\n" +
+ " }\n" +
+ "\n" +
+ " public ShowBug() {\n" +
+ " final X x = new X() {\n" +
+ " void x(int val) {\n" +
+ " if (val > 0) {\n" +
+ " // (1) The local variable x may not have been initialized\n" +
+ " x.x(val - 1);\n" +
+ " }\n" +
+ " }\n" +
+ " };\n" +
+ "\n" +
+ " new Callable<Void>() {\n" +
+ " public Void call() {\n" +
+ " // (2) Missing code implementation in the compiler\n" +
+ " x.x(10); \n" +
+ " return null;\n" +
+ " }\n" +
+ " }.call();\n" +
+ " }\n" +
"}\n"
},
this.complianceLevel < ClassFileConstants.JDK11
?
- "----------\n" +
- "1. WARNING in ShowBug.java (at line 9)\n" +
- " final X x = new X() {\n" +
- " ^^^\n" +
- "Access to enclosing constructor ShowBug.X() is emulated by a synthetic accessor method\n" +
- "----------\n" +
- "2. ERROR in ShowBug.java (at line 13)\n" +
- " x.x(val - 1);\n" +
- " ^\n" +
- "The local variable x may not have been initialized\n" +
+ "----------\n" +
+ "1. WARNING in ShowBug.java (at line 9)\n" +
+ " final X x = new X() {\n" +
+ " ^^^\n" +
+ "Access to enclosing constructor ShowBug.X() is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "2. ERROR in ShowBug.java (at line 13)\n" +
+ " x.x(val - 1);\n" +
+ " ^\n" +
+ "The local variable x may not have been initialized\n" +
"----------\n"
:
- "----------\n" +
- "1. ERROR in ShowBug.java (at line 13)\n" +
- " x.x(val - 1);\n" +
- " ^\n" +
- "The local variable x may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in ShowBug.java (at line 13)\n" +
+ " x.x(val - 1);\n" +
+ " ^\n" +
+ "The local variable x may not have been initialized\n" +
"----------\n");
}
public static Class testClass() {
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java
index 40e78f640..77cbd9763 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java
@@ -455,15 +455,15 @@ public void test013() {
"}"
},
"----------\n" +
- "1. ERROR in p1\\A.java (at line 9)\n" +
- " public class aClass implements B, B.C { \n" +
- " ^^^^^^\n" +
- "The type A.aClass must implement the inherited abstract method A.B.C.anotherMethod(int)\n" +
- "----------\n" +
- "2. ERROR in p1\\A.java (at line 11)\n" +
- " public void anotherMethod(int A) {}; \n" +
- " ^^^^\n" +
- "Syntax error on token \"void\", record expected\n" +
+ "1. ERROR in p1\\A.java (at line 9)\n" +
+ " public class aClass implements B, B.C { \n" +
+ " ^^^^^^\n" +
+ "The type A.aClass must implement the inherited abstract method A.B.C.anotherMethod(int)\n" +
+ "----------\n" +
+ "2. ERROR in p1\\A.java (at line 11)\n" +
+ " public void anotherMethod(int A) {}; \n" +
+ " ^^^^\n" +
+ "Syntax error on token \"void\", record expected\n" +
"----------\n"
);
}
@@ -2910,19 +2910,19 @@ public void _test087() {
this.runNegativeTest(
new String[] {
"X.java", // =================
- "import java.util.*;\n" +
- "/**\n" +
- " * @see Private - Private is not visible here\n" +
- " */\n" +
- "public abstract class X implements X.Private, Secondary.SecondaryPrivate {\n" +
- " /**\n" +
- " * @see Private - Private is visible here\n" +
- " */\n" +
- " private static interface Private {}\n" +
- " Private field;\n" +
- "}\n" +
- "class Secondary {\n" +
- " private static interface SecondaryPrivate {}\n" +
+ "import java.util.*;\n" +
+ "/**\n" +
+ " * @see Private - Private is not visible here\n" +
+ " */\n" +
+ "public abstract class X implements X.Private, Secondary.SecondaryPrivate {\n" +
+ " /**\n" +
+ " * @see Private - Private is visible here\n" +
+ " */\n" +
+ " private static interface Private {}\n" +
+ " Private field;\n" +
+ "}\n" +
+ "class Secondary {\n" +
+ " private static interface SecondaryPrivate {}\n" +
"}\n", // =================
},
"done");
@@ -2931,18 +2931,18 @@ public void test088() {
this.runNegativeTest(
new String[] {
"java/lang/Object.java", //===================
- "package java.lang;\n" +
- "public class Object {\n" +
- " public Object() {\n" +
- " super();\n" +
- " }\n" +
+ "package java.lang;\n" +
+ "public class Object {\n" +
+ " public Object() {\n" +
+ " super();\n" +
+ " }\n" +
"}\n", // =================
},
- "----------\n" +
- "1. ERROR in java\\lang\\Object.java (at line 4)\n" +
- " super();\n" +
- " ^^^^^^^^\n" +
- "super cannot be used in java.lang.Object\n" +
+ "----------\n" +
+ "1. ERROR in java\\lang\\Object.java (at line 4)\n" +
+ " super();\n" +
+ " ^^^^^^^^\n" +
+ "super cannot be used in java.lang.Object\n" +
"----------\n");
}
@@ -2950,19 +2950,19 @@ public void test089() {
this.runNegativeTest(
new String[] {
"X.java", //===================
- "public class X {\n" +
- " static class Member implements X {\n" +
- " Member () {\n" +
- " super();\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " static class Member implements X {\n" +
+ " Member () {\n" +
+ " super();\n" +
+ " }\n" +
+ " }\n" +
"}\n", // =================
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " static class Member implements X {\n" +
- " ^\n" +
- "The type X cannot be a superinterface of Member; a superinterface must be an interface\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " static class Member implements X {\n" +
+ " ^\n" +
+ "The type X cannot be a superinterface of Member; a superinterface must be an interface\n" +
"----------\n");
}
@@ -2971,27 +2971,27 @@ public void test090() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public synchronized int f;\n" +
- " public synchronized X() {}\n" +
- " public volatile void foo() {}\n" +
+ "public class X {\n" +
+ " public synchronized int f;\n" +
+ " public synchronized X() {}\n" +
+ " public volatile void foo() {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public synchronized int f;\n" +
- " ^\n" +
- "Illegal modifier for the field f; only public, protected, private, static, final, transient & volatile are permitted\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " public synchronized X() {}\n" +
- " ^^^\n" +
- "Illegal modifier for the constructor in type X; only public, protected & private are permitted\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " public volatile void foo() {}\n" +
- " ^^^^^\n" +
- "Illegal modifier for the method foo; only public, protected, private, abstract, static, final, synchronized, native & strictfp are permitted\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public synchronized int f;\n" +
+ " ^\n" +
+ "Illegal modifier for the field f; only public, protected, private, static, final, transient & volatile are permitted\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " public synchronized X() {}\n" +
+ " ^^^\n" +
+ "Illegal modifier for the constructor in type X; only public, protected & private are permitted\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " public volatile void foo() {}\n" +
+ " ^^^^^\n" +
+ "Illegal modifier for the method foo; only public, protected, private, abstract, static, final, synchronized, native & strictfp are permitted\n" +
"----------\n"
);
}
@@ -3000,24 +3000,24 @@ public void test091() {
this.runNegativeTest(
new String[] {
"foo/Test.java",//------------------------------
- "package foo;\n" +
- "public class Test {\n" +
+ "package foo;\n" +
+ "public class Test {\n" +
" public class M1 {\n" +
" public class M2 {}\n" +
" }\n" +
"}\n",
"bar/Test2.java",//------------------------------
- "package bar;\n" +
- "import foo.Test;\n" +
- "import Test.M1.M2;\n" +
- "public class Test2 {\n" +
+ "package bar;\n" +
+ "import foo.Test;\n" +
+ "import Test.M1.M2;\n" +
+ "public class Test2 {\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in bar\\Test2.java (at line 3)\n" +
- " import Test.M1.M2;\n" +
- " ^^^^\n" +
- "The import Test cannot be resolved\n" +
+ "----------\n" +
+ "1. ERROR in bar\\Test2.java (at line 3)\n" +
+ " import Test.M1.M2;\n" +
+ " ^^^^\n" +
+ "The import Test cannot be resolved\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=250211 - variation
@@ -3025,24 +3025,24 @@ public void test092() {
this.runNegativeTest(
new String[] {
"foo/Test.java",//------------------------------
- "package foo;\n" +
- "public class Test {\n" +
+ "package foo;\n" +
+ "public class Test {\n" +
" public class M1 {\n" +
" public class M2 {}\n" +
" }\n" +
"}\n",
"bar/Test2.java",//------------------------------
- "package bar;\n" +
- "import foo.*;\n" +
- "import Test.M1.M2;\n" +
- "public class Test2 {\n" +
+ "package bar;\n" +
+ "import foo.*;\n" +
+ "import Test.M1.M2;\n" +
+ "public class Test2 {\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in bar\\Test2.java (at line 3)\n" +
- " import Test.M1.M2;\n" +
- " ^^^^\n" +
- "The import Test cannot be resolved\n" +
+ "----------\n" +
+ "1. ERROR in bar\\Test2.java (at line 3)\n" +
+ " import Test.M1.M2;\n" +
+ " ^^^^\n" +
+ "The import Test cannot be resolved\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=250211 - variation
@@ -3050,66 +3050,66 @@ public void test093() {
this.runNegativeTest(
new String[] {
"foo/Test.java",//------------------------------
- "package foo;\n" +
- "public class Test {\n" +
+ "package foo;\n" +
+ "public class Test {\n" +
" public class M1 {\n" +
" public class foo {}\n" +
" }\n" +
"}\n",
"bar/Test2.java",//------------------------------
- "package bar;\n" +
- "import foo.Test;\n" +
- "import Test.M1.foo;\n" +
- "public class Test2 {\n" +
+ "package bar;\n" +
+ "import foo.Test;\n" +
+ "import Test.M1.foo;\n" +
+ "public class Test2 {\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in bar\\Test2.java (at line 3)\n" +
- " import Test.M1.foo;\n" +
- " ^^^^\n" +
- "The import Test cannot be resolved\n" +
+ "----------\n" +
+ "1. ERROR in bar\\Test2.java (at line 3)\n" +
+ " import Test.M1.foo;\n" +
+ " ^^^^\n" +
+ "The import Test cannot be resolved\n" +
"----------\n");
-}
+}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=250211 - variation
public void test094() {
this.runConformTest(
new String[] {
"foo/Test.java",//------------------------------
- "package foo;\n" +
- "public class Test {\n" +
+ "package foo;\n" +
+ "public class Test {\n" +
" public class M1 {\n" +
" public class foo {}\n" +
" }\n" +
"}\n",
"bar/Test2.java",//------------------------------
- "package bar;\n" +
- "import foo.Test.M1.foo;\n" +
- "public class Test2 {\n" +
+ "package bar;\n" +
+ "import foo.Test.M1.foo;\n" +
+ "public class Test2 {\n" +
"}\n",
},
"");
-}
+}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=277965
public void test095() {
this.runNegativeTest(
new String[] {
"p1/B.java",
- "package p1;\n" +
+ "package p1;\n" +
"protected class B1 {}",
"X.java", // =================
"public class X extends p1.B1 {}",
},
- "----------\n" +
- "1. ERROR in p1\\B.java (at line 2)\n" +
- " protected class B1 {}\n" +
- " ^^\n" +
- "Illegal modifier for the class B1; only public, abstract & final are permitted\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X extends p1.B1 {}\n" +
- " ^^^^^\n" +
- "The type p1.B1 is not visible\n" +
+ "----------\n" +
+ "1. ERROR in p1\\B.java (at line 2)\n" +
+ " protected class B1 {}\n" +
+ " ^^\n" +
+ "Illegal modifier for the class B1; only public, abstract & final are permitted\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X extends p1.B1 {}\n" +
+ " ^^^^^\n" +
+ "The type p1.B1 is not visible\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id= 317212
@@ -3137,53 +3137,53 @@ public void test096() {
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in p1\\C.java (at line 5)\n" +
- " B.m().new M();\n" +
- " ^^^^^\n" +
- "The type p0.A is not visible\n" +
+ "----------\n" +
+ "1. ERROR in p1\\C.java (at line 5)\n" +
+ " B.m().new M();\n" +
+ " ^^^^^\n" +
+ "The type p0.A is not visible\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id= 317212
public void test097() {
String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ?
- "----------\n" +
- "1. WARNING in B.java (at line 6)\n" +
- " public class M {\n" +
- " ^\n" +
- "The type B.A.M is never used locally\n" +
- "----------\n" +
- "2. WARNING in B.java (at line 7)\n" +
- " public M() {}\n" +
- " ^^^\n" +
- "The constructor B.A.M() is never used locally\n" +
- "----------\n" +
- "3. ERROR in B.java (at line 13)\n" +
- " B.m().new M();\n" +
- " ^^^^^\n" +
- "The type B$A is not visible\n" +
+ "----------\n" +
+ "1. WARNING in B.java (at line 6)\n" +
+ " public class M {\n" +
+ " ^\n" +
+ "The type B.A.M is never used locally\n" +
+ "----------\n" +
+ "2. WARNING in B.java (at line 7)\n" +
+ " public M() {}\n" +
+ " ^^^\n" +
+ "The constructor B.A.M() is never used locally\n" +
+ "----------\n" +
+ "3. ERROR in B.java (at line 13)\n" +
+ " B.m().new M();\n" +
+ " ^^^^^\n" +
+ "The type B$A is not visible\n" +
"----------\n"
:
- "----------\n" +
- "1. WARNING in B.java (at line 3)\n" +
- " return new B().new A();\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Access to enclosing constructor B.A() is emulated by a synthetic accessor method\n" +
- "----------\n" +
- "2. WARNING in B.java (at line 6)\n" +
- " public class M {\n" +
- " ^\n" +
- "The type B.A.M is never used locally\n" +
- "----------\n" +
- "3. WARNING in B.java (at line 7)\n" +
- " public M() {}\n" +
- " ^^^\n" +
- "The constructor B.A.M() is never used locally\n" +
- "----------\n" +
- "4. ERROR in B.java (at line 13)\n" +
- " B.m().new M();\n" +
- " ^^^^^\n" +
- "The type B$A is not visible\n" +
+ "----------\n" +
+ "1. WARNING in B.java (at line 3)\n" +
+ " return new B().new A();\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Access to enclosing constructor B.A() is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "2. WARNING in B.java (at line 6)\n" +
+ " public class M {\n" +
+ " ^\n" +
+ "The type B.A.M is never used locally\n" +
+ "----------\n" +
+ "3. WARNING in B.java (at line 7)\n" +
+ " public M() {}\n" +
+ " ^^^\n" +
+ "The constructor B.A.M() is never used locally\n" +
+ "----------\n" +
+ "4. ERROR in B.java (at line 13)\n" +
+ " B.m().new M();\n" +
+ " ^^^^^\n" +
+ "The type B$A is not visible\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -3215,12 +3215,12 @@ public void test098() {
" public final static class B {\n" +
" public final static String length = \"very long\";\n" +
" }\n" +
- " private int [] B = new int[5];\n" +
+ " private int [] B = new int[5];\n" +
"}\n" +
"public class B {\n" +
" public static void main(String[] args) {\n" +
" System.out.println(A.B.length);\n" +
- " }\n" +
+ " }\n" +
"}\n",
},
"very long");
@@ -3234,19 +3234,19 @@ public void test099() {
" public final static class B {\n" +
" public final static String length = \"very long\";\n" +
" }\n" +
- " public int [] B = new int[5];\n" +
+ " public int [] B = new int[5];\n" +
"}\n" +
"public class B {\n" +
" public static void main(String[] args) {\n" +
" System.out.println(A.B.length);\n" +
- " }\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in B.java (at line 9)\n" +
- " System.out.println(A.B.length);\n" +
- " ^^^^^^^^^^\n" +
- "Cannot make a static reference to the non-static field A.B\n" +
+ "----------\n" +
+ "1. ERROR in B.java (at line 9)\n" +
+ " System.out.println(A.B.length);\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot make a static reference to the non-static field A.B\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=317858
@@ -3258,12 +3258,12 @@ public void test100() {
" public final class B {\n" +
" public final String length = \"very long\";\n" +
" }\n" +
- " public static int [] B = new int[5];\n" +
+ " public static int [] B = new int[5];\n" +
"}\n" +
"public class B {\n" +
" public static void main(String[] args) {\n" +
" System.out.println(A.B.length);\n" +
- " }\n" +
+ " }\n" +
"}\n",
},
"5");
@@ -3277,34 +3277,34 @@ public void test101() {
" private final class B {\n" +
" public final String length = \"very long\";\n" +
" }\n" +
- " private int [] B = new int[5];\n" +
+ " private int [] B = new int[5];\n" +
"}\n" +
"public class B {\n" +
" public static void main(String[] args) {\n" +
" System.out.println(A.B.length);\n" +
- " }\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in B.java (at line 2)\n" +
- " private final class B {\n" +
- " ^\n" +
- "The type A.B is never used locally\n" +
- "----------\n" +
- "2. WARNING in B.java (at line 3)\n" +
- " public final String length = \"very long\";\n" +
- " ^^^^^^\n" +
- "The value of the field A.B.length is not used\n" +
- "----------\n" +
- "3. WARNING in B.java (at line 5)\n" +
- " private int [] B = new int[5];\n" +
- " ^\n" +
- "The value of the field A.B is not used\n" +
- "----------\n" +
- "4. ERROR in B.java (at line 9)\n" +
- " System.out.println(A.B.length);\n" +
- " ^\n" +
- "The field A.B is not visible\n" +
+ "----------\n" +
+ "1. WARNING in B.java (at line 2)\n" +
+ " private final class B {\n" +
+ " ^\n" +
+ "The type A.B is never used locally\n" +
+ "----------\n" +
+ "2. WARNING in B.java (at line 3)\n" +
+ " public final String length = \"very long\";\n" +
+ " ^^^^^^\n" +
+ "The value of the field A.B.length is not used\n" +
+ "----------\n" +
+ "3. WARNING in B.java (at line 5)\n" +
+ " private int [] B = new int[5];\n" +
+ " ^\n" +
+ "The value of the field A.B is not used\n" +
+ "----------\n" +
+ "4. ERROR in B.java (at line 9)\n" +
+ " System.out.println(A.B.length);\n" +
+ " ^\n" +
+ "The field A.B is not visible\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=317858
@@ -3316,29 +3316,29 @@ public void test102() {
" public final class B {\n" +
" private final String length = \"very long\";\n" +
" }\n" +
- " private int [] B = new int[5];\n" +
+ " private int [] B = new int[5];\n" +
"}\n" +
"public class B {\n" +
" public static void main(String[] args) {\n" +
" System.out.println(A.B.length);\n" +
- " }\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in B.java (at line 3)\n" +
- " private final String length = \"very long\";\n" +
- " ^^^^^^\n" +
- "The value of the field A.B.length is not used\n" +
- "----------\n" +
- "2. WARNING in B.java (at line 5)\n" +
- " private int [] B = new int[5];\n" +
- " ^\n" +
- "The value of the field A.B is not used\n" +
- "----------\n" +
- "3. ERROR in B.java (at line 9)\n" +
- " System.out.println(A.B.length);\n" +
- " ^^^^^^\n" +
- "The field A.B.length is not visible\n" +
+ "----------\n" +
+ "1. WARNING in B.java (at line 3)\n" +
+ " private final String length = \"very long\";\n" +
+ " ^^^^^^\n" +
+ "The value of the field A.B.length is not used\n" +
+ "----------\n" +
+ "2. WARNING in B.java (at line 5)\n" +
+ " private int [] B = new int[5];\n" +
+ " ^\n" +
+ "The value of the field A.B is not used\n" +
+ "----------\n" +
+ "3. ERROR in B.java (at line 9)\n" +
+ " System.out.println(A.B.length);\n" +
+ " ^^^^^^\n" +
+ "The field A.B.length is not visible\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=316956
@@ -3347,63 +3347,63 @@ public void test103() {
CompilerOptions compOptions = new CompilerOptions(options);
if (compOptions.complianceLevel < ClassFileConstants.JDK1_4) return;
String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ?
- "----------\n" +
- "1. WARNING in A.java (at line 2)\n" +
- " private int x;\n" +
- " ^\n" +
- "The value of the field A.x is not used\n" +
- "----------\n" +
- "2. WARNING in A.java (at line 4)\n" +
- " private int x;\n" +
- " ^\n" +
- "The value of the field A.B.x is not used\n" +
- "----------\n" +
- "3. WARNING in A.java (at line 5)\n" +
- " private C c = new C() {\n" +
- " ^\n" +
- "The value of the field A.B.c is not used\n" +
- "----------\n" +
- "4. WARNING in A.java (at line 6)\n" +
- " void foo() {\n" +
- " ^^^^^\n" +
- "The method foo() from the type new A.C(){} is never used locally\n" +
- "----------\n" +
- "5. WARNING in A.java (at line 12)\n" +
- " private int x;\n" +
- " ^\n" +
- "The value of the field A.C.x is not used\n" +
+ "----------\n" +
+ "1. WARNING in A.java (at line 2)\n" +
+ " private int x;\n" +
+ " ^\n" +
+ "The value of the field A.x is not used\n" +
+ "----------\n" +
+ "2. WARNING in A.java (at line 4)\n" +
+ " private int x;\n" +
+ " ^\n" +
+ "The value of the field A.B.x is not used\n" +
+ "----------\n" +
+ "3. WARNING in A.java (at line 5)\n" +
+ " private C c = new C() {\n" +
+ " ^\n" +
+ "The value of the field A.B.c is not used\n" +
+ "----------\n" +
+ "4. WARNING in A.java (at line 6)\n" +
+ " void foo() {\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type new A.C(){} is never used locally\n" +
+ "----------\n" +
+ "5. WARNING in A.java (at line 12)\n" +
+ " private int x;\n" +
+ " ^\n" +
+ "The value of the field A.C.x is not used\n" +
"----------\n"
:
- "----------\n" +
- "1. WARNING in A.java (at line 2)\n" +
- " private int x;\n" +
- " ^\n" +
- "The value of the field A.x is not used\n" +
- "----------\n" +
- "2. WARNING in A.java (at line 4)\n" +
- " private int x;\n" +
- " ^\n" +
- "The value of the field A.B.x is not used\n" +
- "----------\n" +
- "3. WARNING in A.java (at line 5)\n" +
- " private C c = new C() {\n" +
- " ^\n" +
- "The value of the field A.B.c is not used\n" +
- "----------\n" +
- "4. WARNING in A.java (at line 6)\n" +
- " void foo() {\n" +
- " ^^^^^\n" +
- "The method foo() from the type new A.C(){} is never used locally\n" +
- "----------\n" +
- "5. WARNING in A.java (at line 7)\n" +
- " x = 3;\n" +
- " ^\n" +
- "Write access to enclosing field A.B.x is emulated by a synthetic accessor method\n" +
- "----------\n" +
- "6. WARNING in A.java (at line 12)\n" +
- " private int x;\n" +
- " ^\n" +
- "The value of the field A.C.x is not used\n" +
+ "----------\n" +
+ "1. WARNING in A.java (at line 2)\n" +
+ " private int x;\n" +
+ " ^\n" +
+ "The value of the field A.x is not used\n" +
+ "----------\n" +
+ "2. WARNING in A.java (at line 4)\n" +
+ " private int x;\n" +
+ " ^\n" +
+ "The value of the field A.B.x is not used\n" +
+ "----------\n" +
+ "3. WARNING in A.java (at line 5)\n" +
+ " private C c = new C() {\n" +
+ " ^\n" +
+ "The value of the field A.B.c is not used\n" +
+ "----------\n" +
+ "4. WARNING in A.java (at line 6)\n" +
+ " void foo() {\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type new A.C(){} is never used locally\n" +
+ "----------\n" +
+ "5. WARNING in A.java (at line 7)\n" +
+ " x = 3;\n" +
+ " ^\n" +
+ "Write access to enclosing field A.B.x is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "6. WARNING in A.java (at line 12)\n" +
+ " private int x;\n" +
+ " ^\n" +
+ "The value of the field A.C.x is not used\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -3450,26 +3450,26 @@ public void test104() {
" }\n",
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in A.java (at line 2)\n" +
- " private int x;\n" +
- " ^\n" +
- "The value of the field A.x is not used\n" +
- "----------\n" +
- "2. WARNING in A.java (at line 4)\n" +
- " private int x;\n" +
- " ^\n" +
- "The value of the field A.B.x is not used\n" +
- "----------\n" +
- "3. WARNING in A.java (at line 5)\n" +
- " private C c = new C() {\n" +
- " ^\n" +
- "The value of the field A.B.c is not used\n" +
- "----------\n" +
- "4. WARNING in A.java (at line 6)\n" +
- " void foo() {\n" +
- " ^^^^^\n" +
- "The method foo() from the type new A.C(){} is never used locally\n" +
+ "----------\n" +
+ "1. WARNING in A.java (at line 2)\n" +
+ " private int x;\n" +
+ " ^\n" +
+ "The value of the field A.x is not used\n" +
+ "----------\n" +
+ "2. WARNING in A.java (at line 4)\n" +
+ " private int x;\n" +
+ " ^\n" +
+ "The value of the field A.B.x is not used\n" +
+ "----------\n" +
+ "3. WARNING in A.java (at line 5)\n" +
+ " private C c = new C() {\n" +
+ " ^\n" +
+ "The value of the field A.B.c is not used\n" +
+ "----------\n" +
+ "4. WARNING in A.java (at line 6)\n" +
+ " void foo() {\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type new A.C(){} is never used locally\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings;
runner.runWarningTest();
@@ -3480,55 +3480,55 @@ public void test105() {
CompilerOptions compOptions = new CompilerOptions(options);
if (compOptions.complianceLevel < ClassFileConstants.JDK1_4) return;
String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ?
- "----------\n" +
- "1. WARNING in A.java (at line 2)\n" +
- " private int x;\n" +
- " ^\n" +
- "The value of the field A.x is not used\n" +
- "----------\n" +
- "2. WARNING in A.java (at line 3)\n" +
- " private C c = new C() {\n" +
- " ^\n" +
- "The value of the field A.c is not used\n" +
- "----------\n" +
- "3. WARNING in A.java (at line 4)\n" +
- " void foo() {\n" +
- " ^^^^^\n" +
- "The method foo() from the type new A.C(){} is never used locally\n" +
- "----------\n" +
- "4. WARNING in A.java (at line 9)\n" +
- " private int x;\n" +
- " ^\n" +
- "The value of the field A.C.x is not used\n" +
+ "----------\n" +
+ "1. WARNING in A.java (at line 2)\n" +
+ " private int x;\n" +
+ " ^\n" +
+ "The value of the field A.x is not used\n" +
+ "----------\n" +
+ "2. WARNING in A.java (at line 3)\n" +
+ " private C c = new C() {\n" +
+ " ^\n" +
+ "The value of the field A.c is not used\n" +
+ "----------\n" +
+ "3. WARNING in A.java (at line 4)\n" +
+ " void foo() {\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type new A.C(){} is never used locally\n" +
+ "----------\n" +
+ "4. WARNING in A.java (at line 9)\n" +
+ " private int x;\n" +
+ " ^\n" +
+ "The value of the field A.C.x is not used\n" +
"----------\n"
:
"----------\n" +
- "1. WARNING in A.java (at line 2)\n" +
- " private int x;\n" +
- " ^\n" +
- "The value of the field A.x is not used\n" +
- "----------\n" +
- "2. WARNING in A.java (at line 3)\n" +
- " private C c = new C() {\n" +
- " ^\n" +
- "The value of the field A.c is not used\n" +
- "----------\n" +
- "3. WARNING in A.java (at line 4)\n" +
- " void foo() {\n" +
- " ^^^^^\n" +
- "The method foo() from the type new A.C(){} is never used locally\n" +
- "----------\n" +
- "4. WARNING in A.java (at line 5)\n" +
- " x = 3;\n" +
- " ^\n" +
- "Write access to enclosing field A.x is emulated by a synthetic accessor method\n" +
- "----------\n" +
- "5. WARNING in A.java (at line 9)\n" +
- " private int x;\n" +
- " ^\n" +
- "The value of the field A.C.x is not used\n" +
+ "1. WARNING in A.java (at line 2)\n" +
+ " private int x;\n" +
+ " ^\n" +
+ "The value of the field A.x is not used\n" +
+ "----------\n" +
+ "2. WARNING in A.java (at line 3)\n" +
+ " private C c = new C() {\n" +
+ " ^\n" +
+ "The value of the field A.c is not used\n" +
+ "----------\n" +
+ "3. WARNING in A.java (at line 4)\n" +
+ " void foo() {\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type new A.C(){} is never used locally\n" +
+ "----------\n" +
+ "4. WARNING in A.java (at line 5)\n" +
+ " x = 3;\n" +
+ " ^\n" +
+ "Write access to enclosing field A.x is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "5. WARNING in A.java (at line 9)\n" +
+ " private int x;\n" +
+ " ^\n" +
+ "The value of the field A.C.x is not used\n" +
"----------\n";
-
+
this.runNegativeTest(
new String[] {
"A.java",//------------------------------
@@ -3566,16 +3566,16 @@ public void test106() {
"}\n",
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " private static List<Object> foo1(Set<Object> set) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The method foo1(Set<Object>) from the type X is never used locally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " private static <T> List<T> foo3(Set<T> set) {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The method foo3(Set<T>) from the type X is never used locally\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " private static List<Object> foo1(Set<Object> set) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The method foo1(Set<Object>) from the type X is never used locally\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " private static <T> List<T> foo3(Set<T> set) {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The method foo3(Set<T>) from the type X is never used locally\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings;
runner.runWarningTest();
@@ -3588,27 +3588,27 @@ public void testBug537828() {
this.runConformTest(
new String[] {
"FieldBug.java",//------------------------------
- "class A {\n" +
- " Object obj = \"A.obj\";\n" +
- "}\n" +
- "\n" +
- "class B {\n" +
- " private Object obj = \"B.obj\";\n" +
- " public Object getObj() {return obj;}\n" +
- "}\n" +
- "\n" +
- "public class FieldBug {\n" +
- " Object obj = \"FieldBug.obj\";\n" +
- "\n" +
- " static class AA extends A {\n" +
- " class BB extends B {\n" +
- " Object n = obj;\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(new AA().new BB().n);\n" +
- " }\n" +
+ "class A {\n" +
+ " Object obj = \"A.obj\";\n" +
+ "}\n" +
+ "\n" +
+ "class B {\n" +
+ " private Object obj = \"B.obj\";\n" +
+ " public Object getObj() {return obj;}\n" +
+ "}\n" +
+ "\n" +
+ "public class FieldBug {\n" +
+ " Object obj = \"FieldBug.obj\";\n" +
+ "\n" +
+ " static class AA extends A {\n" +
+ " class BB extends B {\n" +
+ " Object n = obj;\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(new AA().new BB().n);\n" +
+ " }\n" +
"}",
},
"A.obj");
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodHandleTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodHandleTest.java
index 45c6d0b79..8787aa153 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodHandleTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodHandleTest.java
@@ -34,7 +34,7 @@ public class MethodHandleTest extends AbstractRegressionTest {
public static Class testClass() {
return MethodHandleTest.class;
}
-
+
static {
// TESTS_NAMES = new String [] { "test009" };
}
@@ -43,57 +43,57 @@ public class MethodHandleTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "import java.lang.invoke.MethodHandle;\n" +
- "import java.lang.invoke.MethodHandles;\n" +
- "import java.lang.invoke.MethodType;\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) throws Throwable {\n" +
- " MethodHandles.Lookup lookup = MethodHandles.lookup();\n" +
- "\n" +
- " MethodType mt = MethodType.methodType(String.class, String.class, char.class);\n" +
- " MethodHandle mh = lookup.findStatic(X.class, \"append\", mt);\n" +
- " String s = (String) mh.invokeExact(\"follo\",'w');\n" +
- " System.out.println(s);\n" +
- "\n" +
- " mt = MethodType.methodType(int.class, Object[].class);\n" +
- " mh = lookup.findVirtual(X.class, \"arrayLength\", mt);\n" +
- " int i = (int) mh.invokeExact(new X(), new Object[] {1, 'A', \"foo\"});\n" +
- " System.out.println(i);\n" +
- "\n" +
- " mt = MethodType.methodType(void.class, String.class);\n" +
- " mh = lookup.findStatic(X.class, \"hello\", mt);\n" +
- " mh.invokeExact(\"world\");\n" +
- "\n" +
- " mt = MethodType.methodType(Object.class, String.class, int.class);\n" +
- " mh = lookup.findVirtual(X.class, \"foo\", mt);\n" +
+ "import java.lang.invoke.MethodHandle;\n" +
+ "import java.lang.invoke.MethodHandles;\n" +
+ "import java.lang.invoke.MethodType;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) throws Throwable {\n" +
+ " MethodHandles.Lookup lookup = MethodHandles.lookup();\n" +
+ "\n" +
+ " MethodType mt = MethodType.methodType(String.class, String.class, char.class);\n" +
+ " MethodHandle mh = lookup.findStatic(X.class, \"append\", mt);\n" +
+ " String s = (String) mh.invokeExact(\"follo\",'w');\n" +
+ " System.out.println(s);\n" +
+ "\n" +
+ " mt = MethodType.methodType(int.class, Object[].class);\n" +
+ " mh = lookup.findVirtual(X.class, \"arrayLength\", mt);\n" +
+ " int i = (int) mh.invokeExact(new X(), new Object[] {1, 'A', \"foo\"});\n" +
+ " System.out.println(i);\n" +
+ "\n" +
+ " mt = MethodType.methodType(void.class, String.class);\n" +
+ " mh = lookup.findStatic(X.class, \"hello\", mt);\n" +
+ " mh.invokeExact(\"world\");\n" +
+ "\n" +
+ " mt = MethodType.methodType(Object.class, String.class, int.class);\n" +
+ " mh = lookup.findVirtual(X.class, \"foo\", mt);\n" +
" Object o = mh.invoke(new X(), (Object)\"foo:\", i);\n" +
"\n" +
- " mt = MethodType.methodType(void.class);\n" +
- " mh = lookup.findStatic(X.class, \"bar\", mt);\n" +
- " mh.invokeExact();\n" +
+ " mt = MethodType.methodType(void.class);\n" +
+ " mh = lookup.findStatic(X.class, \"bar\", mt);\n" +
+ " mh.invokeExact();\n" +
+ " }\n" +
+ " public static void bar() {\n" +
+ " System.out.println(\"bar\");\n" +
+ " }\n" +
+ " public Object foo(String s, int i) {\n" +
+ " System.out.println(s + i);\n" +
+ " return s + i;\n" +
" }\n" +
- " public static void bar() {\n" +
- " System.out.println(\"bar\");\n" +
+ " public static String append(String s, char c) {\n" +
+ " return s + c;\n" +
" }\n" +
- " public Object foo(String s, int i) {\n" +
- " System.out.println(s + i);\n" +
- " return s + i;\n" +
+ " public int arrayLength(Object[] array) {\n" +
+ " return array.length;\n" +
" }\n" +
- " public static String append(String s, char c) {\n" +
- " return s + c;\n" +
+ " public static void hello(String name) {\n" +
+ " System.out.println(\"Hello, \"+ name);\n" +
" }\n" +
- " public int arrayLength(Object[] array) {\n" +
- " return array.length;\n" +
- " }\n" +
- " public static void hello(String name) {\n" +
- " System.out.println(\"Hello, \"+ name);\n" +
- " }\n" +
"}"
},
- "follow\n" +
- "3\n" +
- "Hello, world\n" +
+ "follow\n" +
+ "3\n" +
+ "Hello, world\n" +
"foo:3\n" +
"bar");
}
@@ -101,28 +101,28 @@ public class MethodHandleTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "import java.lang.invoke.MethodHandle;\n" +
- "import java.lang.invoke.MethodHandles;\n" +
- "import java.lang.invoke.MethodType;\n" +
- "import java.lang.invoke.WrongMethodTypeException;\n" +
- "\n" +
- "public class X {\n" +
- " public static void foo() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " MethodHandle handle = MethodHandles.lookup().findStatic(X.class, \"foo\", MethodType.methodType(void.class));\n" +
- " try {\n" +
- " handle.invoke(null);\n" +
- " } catch (WrongMethodTypeException ok) {\n" +
- " System.out.println(\"This is ok\");\n" +
- " } catch (Throwable e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " } catch (Throwable e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ "import java.lang.invoke.MethodHandle;\n" +
+ "import java.lang.invoke.MethodHandles;\n" +
+ "import java.lang.invoke.MethodType;\n" +
+ "import java.lang.invoke.WrongMethodTypeException;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void foo() {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
+ " MethodHandle handle = MethodHandles.lookup().findStatic(X.class, \"foo\", MethodType.methodType(void.class));\n" +
+ " try {\n" +
+ " handle.invoke(null);\n" +
+ " } catch (WrongMethodTypeException ok) {\n" +
+ " System.out.println(\"This is ok\");\n" +
+ " } catch (Throwable e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " } catch (Throwable e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}"
},
"This is ok");
@@ -131,27 +131,27 @@ public class MethodHandleTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "import java.lang.invoke.MethodHandle;\n" +
- "import java.lang.invoke.MethodHandles;\n" +
- "import java.lang.invoke.MethodType;\n" +
- "import java.lang.invoke.WrongMethodTypeException;\n" +
- "\n" +
- "public class X {\n" +
- " public static <T> T foo(T param){\n" +
- " return null;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " MethodHandle handle = MethodHandles.lookup().findStatic(X.class, \"foo\", MethodType.methodType(Object.class, Object.class));\n" +
- " try {\n" +
- " handle.invoke(null);\n" +
- " } catch (Throwable e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " } catch (Throwable e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ "import java.lang.invoke.MethodHandle;\n" +
+ "import java.lang.invoke.MethodHandles;\n" +
+ "import java.lang.invoke.MethodType;\n" +
+ "import java.lang.invoke.WrongMethodTypeException;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static <T> T foo(T param){\n" +
+ " return null;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
+ " MethodHandle handle = MethodHandles.lookup().findStatic(X.class, \"foo\", MethodType.methodType(Object.class, Object.class));\n" +
+ " try {\n" +
+ " handle.invoke(null);\n" +
+ " } catch (Throwable e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " } catch (Throwable e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}"
},
"");
@@ -160,27 +160,27 @@ public class MethodHandleTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "import java.lang.invoke.MethodHandle;\n" +
- "import java.lang.invoke.MethodHandles;\n" +
- "import java.lang.invoke.MethodType;\n" +
- "import java.lang.invoke.WrongMethodTypeException;\n" +
- "\n" +
- "public class X {\n" +
- " public static <T> T foo(T param){\n" +
- " return null;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " MethodHandle handle = MethodHandles.lookup().findStatic(X.class, \"foo\", MethodType.methodType(Object.class, Object.class));\n" +
- " try {\n" +
- " handle.invoke(new Object());\n" +
- " } catch (Throwable e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " } catch (Throwable e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ "import java.lang.invoke.MethodHandle;\n" +
+ "import java.lang.invoke.MethodHandles;\n" +
+ "import java.lang.invoke.MethodType;\n" +
+ "import java.lang.invoke.WrongMethodTypeException;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static <T> T foo(T param){\n" +
+ " return null;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
+ " MethodHandle handle = MethodHandles.lookup().findStatic(X.class, \"foo\", MethodType.methodType(Object.class, Object.class));\n" +
+ " try {\n" +
+ " handle.invoke(new Object());\n" +
+ " } catch (Throwable e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " } catch (Throwable e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}"
},
"");
@@ -189,27 +189,27 @@ public class MethodHandleTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "import java.lang.invoke.MethodHandle;\n" +
- "import java.lang.invoke.MethodHandles;\n" +
- "import java.lang.invoke.MethodType;\n" +
- "import java.lang.invoke.WrongMethodTypeException;\n" +
- "\n" +
- "public class X {\n" +
- " public static <T> T foo(T param){\n" +
- " return null;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " MethodHandle handle = MethodHandles.lookup().findStatic(X.class, \"foo\", MethodType.methodType(Object.class, Object.class));\n" +
- " try {\n" +
- " Object o = handle.invoke(new Object());\n" +
- " } catch (Throwable e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " } catch (Throwable e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ "import java.lang.invoke.MethodHandle;\n" +
+ "import java.lang.invoke.MethodHandles;\n" +
+ "import java.lang.invoke.MethodType;\n" +
+ "import java.lang.invoke.WrongMethodTypeException;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static <T> T foo(T param){\n" +
+ " return null;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
+ " MethodHandle handle = MethodHandles.lookup().findStatic(X.class, \"foo\", MethodType.methodType(Object.class, Object.class));\n" +
+ " try {\n" +
+ " Object o = handle.invoke(new Object());\n" +
+ " } catch (Throwable e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " } catch (Throwable e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}"
},
"");
@@ -218,58 +218,58 @@ public class MethodHandleTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "import java.lang.invoke.MethodHandle;\n" +
- "import java.lang.invoke.MethodHandles;\n" +
- "import java.lang.invoke.MethodType;\n" +
- "import java.lang.invoke.WrongMethodTypeException;\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) throws Throwable {\n" +
- " MethodHandles.Lookup lookup = MethodHandles.lookup();\n" +
- "\n" +
- " MethodType mt = MethodType.methodType(String.class, String.class, char.class);\n" +
- " MethodHandle mh = lookup.findStatic(X.class, \"append\", mt);\n" +
- " String s = (String) mh.invokeExact(\"follo\",'w');\n" +
- " System.out.println(s);\n" +
- " MethodType mt2 = MethodType.methodType(String.class, String.class, char.class);\n" +
- " MethodHandle mh2 = lookup.findStatic(X.class, \"append\", mt2);\n" +
- " try {\n" +
- " mh2.invokeExact(\"follo\",'w');\n" +
- " } catch(WrongMethodTypeException e) {\n" +
- " System.out.println(\"Expected exception\");\n" +
- " }\n" +
+ "import java.lang.invoke.MethodHandle;\n" +
+ "import java.lang.invoke.MethodHandles;\n" +
+ "import java.lang.invoke.MethodType;\n" +
+ "import java.lang.invoke.WrongMethodTypeException;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) throws Throwable {\n" +
+ " MethodHandles.Lookup lookup = MethodHandles.lookup();\n" +
+ "\n" +
+ " MethodType mt = MethodType.methodType(String.class, String.class, char.class);\n" +
+ " MethodHandle mh = lookup.findStatic(X.class, \"append\", mt);\n" +
+ " String s = (String) mh.invokeExact(\"follo\",'w');\n" +
+ " System.out.println(s);\n" +
+ " MethodType mt2 = MethodType.methodType(String.class, String.class, char.class);\n" +
+ " MethodHandle mh2 = lookup.findStatic(X.class, \"append\", mt2);\n" +
+ " try {\n" +
+ " mh2.invokeExact(\"follo\",'w');\n" +
+ " } catch(WrongMethodTypeException e) {\n" +
+ " System.out.println(\"Expected exception\");\n" +
+ " }\n" +
" }\n" +
- " public static String append(String s, char c) {\n" +
- " return s + c;\n" +
+ " public static String append(String s, char c) {\n" +
+ " return s + c;\n" +
" }\n" +
"}"
},
- "follow\n" +
+ "follow\n" +
"Expected exception");
}
public void test007() {
this.runConformTest(
new String[] {
"X.java",
- "import static java.lang.invoke.MethodHandles.lookup;\n" +
- "import static java.lang.invoke.MethodType.methodType;\n" +
- "import java.lang.invoke.MethodHandle;\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) throws Throwable {\n" +
- " MethodHandle fooMH = lookup().findStatic(X.class, \"foo\", methodType(String.class));\n" +
- " String s = (String) fooMH.invokeExact();\n" +
- " System.out.println(s);\n" +
- " fooMH.asType(methodType(void.class)).invokeExact();\n" +
- " }\n" +
- " public static String foo() {\n" +
- " System.out.println(\"Inside foo\");\n" +
- " return \"foo\";\n" +
- " }\n" +
+ "import static java.lang.invoke.MethodHandles.lookup;\n" +
+ "import static java.lang.invoke.MethodType.methodType;\n" +
+ "import java.lang.invoke.MethodHandle;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) throws Throwable {\n" +
+ " MethodHandle fooMH = lookup().findStatic(X.class, \"foo\", methodType(String.class));\n" +
+ " String s = (String) fooMH.invokeExact();\n" +
+ " System.out.println(s);\n" +
+ " fooMH.asType(methodType(void.class)).invokeExact();\n" +
+ " }\n" +
+ " public static String foo() {\n" +
+ " System.out.println(\"Inside foo\");\n" +
+ " return \"foo\";\n" +
+ " }\n" +
"}"
},
- "Inside foo\n" +
- "foo\n" +
+ "Inside foo\n" +
+ "foo\n" +
"Inside foo");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=386259, wrong unnecessary cast warning.
@@ -300,10 +300,10 @@ public class MethodHandleTest extends AbstractRegressionTest {
customOptions /* custom options */,
// compiler results
"----------\n" + /* expected compiler log */
- "1. ERROR in X.java (at line 11)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n",
// javac options
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
@@ -335,16 +335,16 @@ public class MethodHandleTest extends AbstractRegressionTest {
null /* no class libraries */,
customOptions /* custom options */,
// compiler results
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " Object actual = (Object) mh.invoke(str);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from Object to Object\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " Object actual = (Object) mh.invoke(str);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unnecessary cast from Object to Object\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n",
// javac options
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
@@ -354,41 +354,41 @@ public class MethodHandleTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "import java.lang.invoke.MethodHandle;\n" +
- "import java.lang.invoke.MethodHandles;\n" +
- "import java.lang.reflect.Method;\n" +
- "\n" +
- "public class X {\n" +
- " public static void test1(Integer i){\n" +
- " System.out.println(\"test1:\" + i);\n" +
- " }\n" +
- " public static void test2(int i){\n" +
- " System.out.println(\"test2:\" + i);\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) throws Throwable{\n" +
- " Method m1 = X.class.getMethod(\"test1\", Integer.class);\n" +
- " Method m2 = X.class.getMethod(\"test2\", int.class);\n" +
- "\n" +
- " MethodHandle test1Handle = MethodHandles.lookup().unreflect(m1);\n" +
- " MethodHandle test2Handle = MethodHandles.lookup().unreflect(m2);\n" +
- " \n" +
- " Integer arg_Integer = 1;\n" +
- " int arg_int = 1;\n" +
- " \n" +
- " // results in a java.lang.VerifyError - but should work without error\n" +
- " test1Handle.invokeExact(Integer.class.cast(arg_int));\n" +
- " \n" +
- " // The following line also results in a java.lang.VerifyError, but should actually throw a ClassCastException\n" +
- " try {\n" +
- " test2Handle.invokeExact(int.class.cast(arg_Integer)); \n" +
- " } catch(ClassCastException e) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " }\n" +
+ "import java.lang.invoke.MethodHandle;\n" +
+ "import java.lang.invoke.MethodHandles;\n" +
+ "import java.lang.reflect.Method;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void test1(Integer i){\n" +
+ " System.out.println(\"test1:\" + i);\n" +
+ " }\n" +
+ " public static void test2(int i){\n" +
+ " System.out.println(\"test2:\" + i);\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) throws Throwable{\n" +
+ " Method m1 = X.class.getMethod(\"test1\", Integer.class);\n" +
+ " Method m2 = X.class.getMethod(\"test2\", int.class);\n" +
+ "\n" +
+ " MethodHandle test1Handle = MethodHandles.lookup().unreflect(m1);\n" +
+ " MethodHandle test2Handle = MethodHandles.lookup().unreflect(m2);\n" +
+ " \n" +
+ " Integer arg_Integer = 1;\n" +
+ " int arg_int = 1;\n" +
+ " \n" +
+ " // results in a java.lang.VerifyError - but should work without error\n" +
+ " test1Handle.invokeExact(Integer.class.cast(arg_int));\n" +
+ " \n" +
+ " // The following line also results in a java.lang.VerifyError, but should actually throw a ClassCastException\n" +
+ " try {\n" +
+ " test2Handle.invokeExact(int.class.cast(arg_Integer)); \n" +
+ " } catch(ClassCastException e) {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " }\n" +
+ " }\n" +
"}"
},
- "test1:1\n" +
+ "test1:1\n" +
"SUCCESS");
}
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodParametersAttributeTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodParametersAttributeTest.java
index a6af85455..4e2610c62 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodParametersAttributeTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodParametersAttributeTest.java
@@ -57,40 +57,40 @@ public class MethodParametersAttributeTest extends AbstractRegressionTest {
public static Test suite() {
return buildMinimalComplianceTestSuite(testClass(), F_1_8);
}
-
+
String originalSource =
- "import java.util.concurrent.Callable;\n" +
- "\n" +
- "public class ParameterNames {\n" +
- " \n" +
- " public void someMethod(int simple, final double complex) {\n" +
- " }\n" +
- " \n" +
- " public Callable<String> makeInnerWithCapture(final String finalMessage, String mutableMessage) {\n" +
- " return new Callable<String>() {\n" +
- " public String call() throws Exception {\n" +
- " return finalMessage;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "\n" +
- " public int localMath(final String finalMessage, String mutableMessage) {\n" +
- " int capturedB = 42;\n" +
- " \n" +
- " class Local {\n" +
- " int fieldA;\n" +
- " Local(int a) {\n" +
- " this.fieldA = a;\n" +
- " }\n" +
- " int calculate(final int parameterC) {\n" +
- " return this.fieldA + capturedB + parameterC;\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " return new Local(2).calculate(3);\n" +
- " }\n" +
- "\n" +
- "}\n" +
+ "import java.util.concurrent.Callable;\n" +
+ "\n" +
+ "public class ParameterNames {\n" +
+ " \n" +
+ " public void someMethod(int simple, final double complex) {\n" +
+ " }\n" +
+ " \n" +
+ " public Callable<String> makeInnerWithCapture(final String finalMessage, String mutableMessage) {\n" +
+ " return new Callable<String>() {\n" +
+ " public String call() throws Exception {\n" +
+ " return finalMessage;\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
+ "\n" +
+ " public int localMath(final String finalMessage, String mutableMessage) {\n" +
+ " int capturedB = 42;\n" +
+ " \n" +
+ " class Local {\n" +
+ " int fieldA;\n" +
+ " Local(int a) {\n" +
+ " this.fieldA = a;\n" +
+ " }\n" +
+ " int calculate(final int parameterC) {\n" +
+ " return this.fieldA + capturedB + parameterC;\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " return new Local(2).calculate(3);\n" +
+ " }\n" +
+ "\n" +
+ "}\n" +
"";
public void test001() throws Exception {
@@ -105,70 +105,70 @@ public class MethodParametersAttributeTest extends AbstractRegressionTest {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- "// Compiled from ParameterNames.java (version 1.8 : 52.0, super bit)\n" +
- "public class ParameterNames {\n" +
- " \n" +
- " // Method descriptor #12 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " public ParameterNames();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [1]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
- " \n" +
- " // Method descriptor #16 (ID)V\n" +
- " // Stack: 0, Locals: 4\n" +
- " public void someMethod(int simple, double complex);\n" +
- " 0 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 6]\n" +
- " Method Parameters:\n" +
- " simple\n" +
- " final complex\n" +
- " \n" +
- " // Method descriptor #21 (Ljava/lang/String;Ljava/lang/String;)Ljava/util/concurrent/Callable;\n" +
- " // Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/util/concurrent/Callable<Ljava/lang/String;>;\n" +
- " // Stack: 4, Locals: 3\n" +
- " public java.util.concurrent.Callable makeInnerWithCapture(java.lang.String finalMessage, java.lang.String mutableMessage);\n" +
- " 0 new ParameterNames$1 [2]\n" +
- " 3 dup\n" +
- " 4 aload_0 [this]\n" +
- " 5 aload_1 [finalMessage]\n" +
- " 6 invokespecial ParameterNames$1(ParameterNames, java.lang.String) [3]\n" +
- " 9 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 9]\n" +
- " Method Parameters:\n" +
- " final finalMessage\n" +
- " mutableMessage\n" +
- " \n" +
- " // Method descriptor #27 (Ljava/lang/String;Ljava/lang/String;)I\n" +
- " // Stack: 5, Locals: 4\n" +
- " public int localMath(java.lang.String finalMessage, java.lang.String mutableMessage);\n" +
- " 0 bipush 42\n" +
- " 2 istore_3\n" +
- " 3 new ParameterNames$1Local [4]\n" +
- " 6 dup\n" +
- " 7 aload_0 [this]\n" +
- " 8 iconst_2\n" +
- " 9 iload_3\n" +
- " 10 invokespecial ParameterNames$1Local(ParameterNames, int, int) [5]\n" +
- " 13 iconst_3\n" +
- " 14 invokevirtual ParameterNames$1Local.calculate(int) : int [6]\n" +
- " 17 ireturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 17]\n" +
- " [pc: 3, line: 29]\n" +
- " Method Parameters:\n" +
- " final finalMessage\n" +
- " mutableMessage\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #4 ParameterNames$1Local, outer class info: #0\n" +
- " inner name: #9 Local, accessflags: 0 default],\n" +
- " [inner class info: #2 ParameterNames$1, outer class info: #0\n" +
- " inner name: #0, accessflags: 0 default]\n" +
+ "// Compiled from ParameterNames.java (version 1.8 : 52.0, super bit)\n" +
+ "public class ParameterNames {\n" +
+ " \n" +
+ " // Method descriptor #12 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " public ParameterNames();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [1]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
+ " \n" +
+ " // Method descriptor #16 (ID)V\n" +
+ " // Stack: 0, Locals: 4\n" +
+ " public void someMethod(int simple, double complex);\n" +
+ " 0 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 6]\n" +
+ " Method Parameters:\n" +
+ " simple\n" +
+ " final complex\n" +
+ " \n" +
+ " // Method descriptor #21 (Ljava/lang/String;Ljava/lang/String;)Ljava/util/concurrent/Callable;\n" +
+ " // Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/util/concurrent/Callable<Ljava/lang/String;>;\n" +
+ " // Stack: 4, Locals: 3\n" +
+ " public java.util.concurrent.Callable makeInnerWithCapture(java.lang.String finalMessage, java.lang.String mutableMessage);\n" +
+ " 0 new ParameterNames$1 [2]\n" +
+ " 3 dup\n" +
+ " 4 aload_0 [this]\n" +
+ " 5 aload_1 [finalMessage]\n" +
+ " 6 invokespecial ParameterNames$1(ParameterNames, java.lang.String) [3]\n" +
+ " 9 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 9]\n" +
+ " Method Parameters:\n" +
+ " final finalMessage\n" +
+ " mutableMessage\n" +
+ " \n" +
+ " // Method descriptor #27 (Ljava/lang/String;Ljava/lang/String;)I\n" +
+ " // Stack: 5, Locals: 4\n" +
+ " public int localMath(java.lang.String finalMessage, java.lang.String mutableMessage);\n" +
+ " 0 bipush 42\n" +
+ " 2 istore_3\n" +
+ " 3 new ParameterNames$1Local [4]\n" +
+ " 6 dup\n" +
+ " 7 aload_0 [this]\n" +
+ " 8 iconst_2\n" +
+ " 9 iload_3\n" +
+ " 10 invokespecial ParameterNames$1Local(ParameterNames, int, int) [5]\n" +
+ " 13 iconst_3\n" +
+ " 14 invokevirtual ParameterNames$1Local.calculate(int) : int [6]\n" +
+ " 17 ireturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 17]\n" +
+ " [pc: 3, line: 29]\n" +
+ " Method Parameters:\n" +
+ " final finalMessage\n" +
+ " mutableMessage\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #4 ParameterNames$1Local, outer class info: #0\n" +
+ " inner name: #9 Local, accessflags: 0 default],\n" +
+ " [inner class info: #2 ParameterNames$1, outer class info: #0\n" +
+ " inner name: #0, accessflags: 0 default]\n" +
"}";
@@ -186,56 +186,56 @@ public class MethodParametersAttributeTest extends AbstractRegressionTest {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- "// Compiled from ParameterNames.java (version 1.8 : 52.0, super bit)\n" +
- "// Signature: Ljava/lang/Object;Ljava/util/concurrent/Callable<Ljava/lang/String;>;\n" +
- "class ParameterNames$1 implements java.util.concurrent.Callable {\n" +
- " \n" +
- " // Field descriptor #9 Ljava/lang/String;\n" +
- " final synthetic java.lang.String val$finalMessage;\n" +
- " \n" +
- " // Field descriptor #11 LParameterNames;\n" +
- " final synthetic ParameterNames this$0;\n" +
- " \n" +
- " // Method descriptor #13 (LParameterNames;Ljava/lang/String;)V\n" +
- " // Stack: 2, Locals: 3\n" +
- " ParameterNames$1(ParameterNames this$0, java.lang.String val$finalMessage);\n" +
- " 0 aload_0 [this]\n" +
- " 1 aload_1 [this$0]\n" +
- " 2 putfield ParameterNames$1.this$0 : ParameterNames [1]\n" +
- " 5 aload_0 [this]\n" +
- " 6 aload_2 [val$finalMessage]\n" +
- " 7 putfield ParameterNames$1.val$finalMessage : java.lang.String [2]\n" +
- " 10 aload_0 [this]\n" +
- " 11 invokespecial java.lang.Object() [3]\n" +
- " 14 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 9]\n" +
- " Method Parameters:\n" +
- " final mandated this$0\n" +
- " final synthetic val$finalMessage\n" +
- " \n" +
- " // Method descriptor #18 ()Ljava/lang/String;\n" +
- " // Stack: 1, Locals: 1\n" +
- " public java.lang.String call() throws java.lang.Exception;\n" +
- " 0 aload_0 [this]\n" +
- " 1 getfield ParameterNames$1.val$finalMessage : java.lang.String [2]\n" +
- " 4 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 11]\n" +
- " \n" +
- " // Method descriptor #21 ()Ljava/lang/Object;\n" +
- " // Stack: 1, Locals: 1\n" +
- " public bridge synthetic java.lang.Object call() throws java.lang.Exception;\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokevirtual ParameterNames$1.call() : java.lang.String [4]\n" +
- " 4 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 9]\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #5 ParameterNames$1, outer class info: #0\n" +
- " inner name: #0, accessflags: 0 default]\n" +
- " Enclosing Method: #27 #28 ParameterNames.makeInnerWithCapture(Ljava/lang/String;Ljava/lang/String;)Ljava/util/concurrent/Callable;\n" +
+ "// Compiled from ParameterNames.java (version 1.8 : 52.0, super bit)\n" +
+ "// Signature: Ljava/lang/Object;Ljava/util/concurrent/Callable<Ljava/lang/String;>;\n" +
+ "class ParameterNames$1 implements java.util.concurrent.Callable {\n" +
+ " \n" +
+ " // Field descriptor #9 Ljava/lang/String;\n" +
+ " final synthetic java.lang.String val$finalMessage;\n" +
+ " \n" +
+ " // Field descriptor #11 LParameterNames;\n" +
+ " final synthetic ParameterNames this$0;\n" +
+ " \n" +
+ " // Method descriptor #13 (LParameterNames;Ljava/lang/String;)V\n" +
+ " // Stack: 2, Locals: 3\n" +
+ " ParameterNames$1(ParameterNames this$0, java.lang.String val$finalMessage);\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 aload_1 [this$0]\n" +
+ " 2 putfield ParameterNames$1.this$0 : ParameterNames [1]\n" +
+ " 5 aload_0 [this]\n" +
+ " 6 aload_2 [val$finalMessage]\n" +
+ " 7 putfield ParameterNames$1.val$finalMessage : java.lang.String [2]\n" +
+ " 10 aload_0 [this]\n" +
+ " 11 invokespecial java.lang.Object() [3]\n" +
+ " 14 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 9]\n" +
+ " Method Parameters:\n" +
+ " final mandated this$0\n" +
+ " final synthetic val$finalMessage\n" +
+ " \n" +
+ " // Method descriptor #18 ()Ljava/lang/String;\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " public java.lang.String call() throws java.lang.Exception;\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 getfield ParameterNames$1.val$finalMessage : java.lang.String [2]\n" +
+ " 4 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 11]\n" +
+ " \n" +
+ " // Method descriptor #21 ()Ljava/lang/Object;\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " public bridge synthetic java.lang.Object call() throws java.lang.Exception;\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokevirtual ParameterNames$1.call() : java.lang.String [4]\n" +
+ " 4 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 9]\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #5 ParameterNames$1, outer class info: #0\n" +
+ " inner name: #0, accessflags: 0 default]\n" +
+ " Enclosing Method: #27 #28 ParameterNames.makeInnerWithCapture(Ljava/lang/String;Ljava/lang/String;)Ljava/util/concurrent/Callable;\n" +
"}";
assertSubstring(actualOutput, expectedOutput);
@@ -253,63 +253,63 @@ public class MethodParametersAttributeTest extends AbstractRegressionTest {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- "// Compiled from ParameterNames.java (version 1.8 : 52.0, super bit)\n" +
- "class ParameterNames$1Local {\n" +
- " \n" +
- " // Field descriptor #8 I\n" +
- " int fieldA;\n" +
- " \n" +
- " // Field descriptor #8 I\n" +
- " final synthetic int val$capturedB;\n" +
- " \n" +
- " // Field descriptor #11 LParameterNames;\n" +
- " final synthetic ParameterNames this$0;\n" +
- " \n" +
- " // Method descriptor #13 (LParameterNames;II)V\n" +
- " // Signature: (I)V\n" +
- " // Stack: 2, Locals: 4\n" +
- " ParameterNames$1Local(ParameterNames this$0, int val$capturedB, int a);\n" +
- " 0 aload_0 [this]\n" +
- " 1 aload_1 [this$0]\n" +
- " 2 putfield ParameterNames$1Local.this$0 : ParameterNames [1]\n" +
- " 5 aload_0 [this]\n" +
- " 6 iload_3 [a]\n" +
- " 7 putfield ParameterNames$1Local.val$capturedB : int [2]\n" +
- " 10 aload_0 [this]\n" +
- " 11 invokespecial java.lang.Object() [3]\n" +
- " 14 aload_0 [this]\n" +
- " 15 iload_2 [val$capturedB]\n" +
- " 16 putfield ParameterNames$1Local.fieldA : int [4]\n" +
- " 19 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 21]\n" +
- " [pc: 14, line: 22]\n" +
- " [pc: 19, line: 23]\n" +
- " Method Parameters:\n" +
- " final mandated this$0\n" +
- " final synthetic val$capturedB\n" +
- " a\n" +
- " \n" +
- " // Method descriptor #21 (I)I\n" +
- " // Stack: 2, Locals: 2\n" +
- " int calculate(int parameterC);\n" +
- " 0 aload_0 [this]\n" +
- " 1 getfield ParameterNames$1Local.fieldA : int [4]\n" +
- " 4 aload_0 [this]\n" +
- " 5 getfield ParameterNames$1Local.val$capturedB : int [2]\n" +
- " 8 iadd\n" +
- " 9 iload_1 [parameterC]\n" +
- " 10 iadd\n" +
- " 11 ireturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 25]\n" +
- " Method Parameters:\n" +
- " final parameterC\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #5 ParameterNames$1Local, outer class info: #0\n" +
- " inner name: #33 Local, accessflags: 0 default]\n" +
- " Enclosing Method: #26 #27 ParameterNames.localMath(Ljava/lang/String;Ljava/lang/String;)I\n" +
+ "// Compiled from ParameterNames.java (version 1.8 : 52.0, super bit)\n" +
+ "class ParameterNames$1Local {\n" +
+ " \n" +
+ " // Field descriptor #8 I\n" +
+ " int fieldA;\n" +
+ " \n" +
+ " // Field descriptor #8 I\n" +
+ " final synthetic int val$capturedB;\n" +
+ " \n" +
+ " // Field descriptor #11 LParameterNames;\n" +
+ " final synthetic ParameterNames this$0;\n" +
+ " \n" +
+ " // Method descriptor #13 (LParameterNames;II)V\n" +
+ " // Signature: (I)V\n" +
+ " // Stack: 2, Locals: 4\n" +
+ " ParameterNames$1Local(ParameterNames this$0, int val$capturedB, int a);\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 aload_1 [this$0]\n" +
+ " 2 putfield ParameterNames$1Local.this$0 : ParameterNames [1]\n" +
+ " 5 aload_0 [this]\n" +
+ " 6 iload_3 [a]\n" +
+ " 7 putfield ParameterNames$1Local.val$capturedB : int [2]\n" +
+ " 10 aload_0 [this]\n" +
+ " 11 invokespecial java.lang.Object() [3]\n" +
+ " 14 aload_0 [this]\n" +
+ " 15 iload_2 [val$capturedB]\n" +
+ " 16 putfield ParameterNames$1Local.fieldA : int [4]\n" +
+ " 19 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 21]\n" +
+ " [pc: 14, line: 22]\n" +
+ " [pc: 19, line: 23]\n" +
+ " Method Parameters:\n" +
+ " final mandated this$0\n" +
+ " final synthetic val$capturedB\n" +
+ " a\n" +
+ " \n" +
+ " // Method descriptor #21 (I)I\n" +
+ " // Stack: 2, Locals: 2\n" +
+ " int calculate(int parameterC);\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 getfield ParameterNames$1Local.fieldA : int [4]\n" +
+ " 4 aload_0 [this]\n" +
+ " 5 getfield ParameterNames$1Local.val$capturedB : int [2]\n" +
+ " 8 iadd\n" +
+ " 9 iload_1 [parameterC]\n" +
+ " 10 iadd\n" +
+ " 11 ireturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 25]\n" +
+ " Method Parameters:\n" +
+ " final parameterC\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #5 ParameterNames$1Local, outer class info: #0\n" +
+ " inner name: #33 Local, accessflags: 0 default]\n" +
+ " Enclosing Method: #26 #27 ParameterNames.localMath(Ljava/lang/String;Ljava/lang/String;)I\n" +
"}";
assertSubstring(actualOutput, expectedOutput);
@@ -319,7 +319,7 @@ public class MethodParametersAttributeTest extends AbstractRegressionTest {
// Test the results of the ClassFileReader
String path = this.getCompilerTestsPluginDirectoryPath() + File.separator + "workspace" + File.separator + "ParameterNames.class";
-
+
org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader classFileReader = ClassFileReader.read(path);
IBinaryMethod[] methodInfos = classFileReader.getMethods();
assertNotNull("No method infos", methodInfos);
@@ -332,7 +332,7 @@ public class MethodParametersAttributeTest extends AbstractRegressionTest {
public void test005() throws Exception {
// Test the results of the ClassFileReader where some of the paramers are synthetic and/or mandated
String path = this.getCompilerTestsPluginDirectoryPath() + File.separator + "workspace" + File.separator + "ParameterNames$1Local.class";
-
+
org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader classFileReader = ClassFileReader.read(path);
IBinaryMethod[] methodInfos = classFileReader.getMethods();
assertNotNull("No method infos", methodInfos);
@@ -343,7 +343,7 @@ public class MethodParametersAttributeTest extends AbstractRegressionTest {
}
public void test006() throws Exception {
// Test that the code generator can emit the names, so the ClassFileReader may read them back
-
+
this.runParameterNameTest(
"X.java",
"public class X {\n" +
@@ -374,7 +374,7 @@ public class MethodParametersAttributeTest extends AbstractRegressionTest {
public void test007() throws Exception {
// Test that the code generator can emit the names, so the disassembler may read them back (same source as was compiled with javac)
-
+
this.runParameterNameTest(
"ParameterNames.java",
this.originalSource);
@@ -391,75 +391,75 @@ public class MethodParametersAttributeTest extends AbstractRegressionTest {
String nestMembers = "";
CompilerOptions options = new CompilerOptions(getCompilerOptions());
if (options.complianceLevel >= ClassFileConstants.JDK11) {
- nestMembers = "\n" +
- "Nest Members:\n" +
- " #20 ParameterNames$1,\n" +
+ nestMembers = "\n" +
+ "Nest Members:\n" +
+ " #20 ParameterNames$1,\n" +
" #29 ParameterNames$1Local\n";
}
String expectedOutput =
- "// Compiled from ParameterNames.java (" + this.versionString + ", super bit)\n" +
- "public class ParameterNames {\n" +
- " \n" +
- " // Method descriptor #6 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " public ParameterNames();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [8]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
- " \n" +
- " // Method descriptor #12 (ID)V\n" +
- " // Stack: 0, Locals: 4\n" +
- " public void someMethod(int simple, double complex);\n" +
- " 0 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 6]\n" +
- " Method Parameters:\n" +
- " simple\n" +
- " final complex\n" +
- " \n" +
- " // Method descriptor #17 (Ljava/lang/String;Ljava/lang/String;)Ljava/util/concurrent/Callable;\n" +
- " // Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/util/concurrent/Callable<Ljava/lang/String;>;\n" +
- " // Stack: 4, Locals: 3\n" +
- " public java.util.concurrent.Callable makeInnerWithCapture(java.lang.String finalMessage, java.lang.String mutableMessage);\n" +
- " 0 new ParameterNames$1 [20]\n" +
- " 3 dup\n" +
- " 4 aload_0 [this]\n" +
- " 5 aload_1 [finalMessage]\n" +
- " 6 invokespecial ParameterNames$1(ParameterNames, java.lang.String) [22]\n" +
- " 9 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 9]\n" +
- " Method Parameters:\n" +
- " final finalMessage\n" +
- " mutableMessage\n" +
- " \n" +
- " // Method descriptor #28 (Ljava/lang/String;Ljava/lang/String;)I\n" +
- " // Stack: 5, Locals: 4\n" +
- " public int localMath(java.lang.String finalMessage, java.lang.String mutableMessage);\n" +
- " 0 bipush 42\n" +
- " 2 istore_3\n" +
- " 3 new ParameterNames$1Local [29]\n" +
- " 6 dup\n" +
- " 7 aload_0 [this]\n" +
- " 8 iconst_2\n" +
- " 9 iload_3\n" +
- " 10 invokespecial ParameterNames$1Local(ParameterNames, int, int) [31]\n" +
- " 13 iconst_3\n" +
- " 14 invokevirtual ParameterNames$1Local.calculate(int) : int [34]\n" +
- " 17 ireturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 17]\n" +
- " [pc: 3, line: 29]\n" +
- " Method Parameters:\n" +
- " final finalMessage\n" +
- " mutableMessage\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #20 ParameterNames$1, outer class info: #0\n" +
- " inner name: #0, accessflags: 0 default],\n" +
- " [inner class info: #29 ParameterNames$1Local, outer class info: #0\n" +
+ "// Compiled from ParameterNames.java (" + this.versionString + ", super bit)\n" +
+ "public class ParameterNames {\n" +
+ " \n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " public ParameterNames();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [8]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
+ " \n" +
+ " // Method descriptor #12 (ID)V\n" +
+ " // Stack: 0, Locals: 4\n" +
+ " public void someMethod(int simple, double complex);\n" +
+ " 0 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 6]\n" +
+ " Method Parameters:\n" +
+ " simple\n" +
+ " final complex\n" +
+ " \n" +
+ " // Method descriptor #17 (Ljava/lang/String;Ljava/lang/String;)Ljava/util/concurrent/Callable;\n" +
+ " // Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/util/concurrent/Callable<Ljava/lang/String;>;\n" +
+ " // Stack: 4, Locals: 3\n" +
+ " public java.util.concurrent.Callable makeInnerWithCapture(java.lang.String finalMessage, java.lang.String mutableMessage);\n" +
+ " 0 new ParameterNames$1 [20]\n" +
+ " 3 dup\n" +
+ " 4 aload_0 [this]\n" +
+ " 5 aload_1 [finalMessage]\n" +
+ " 6 invokespecial ParameterNames$1(ParameterNames, java.lang.String) [22]\n" +
+ " 9 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 9]\n" +
+ " Method Parameters:\n" +
+ " final finalMessage\n" +
+ " mutableMessage\n" +
+ " \n" +
+ " // Method descriptor #28 (Ljava/lang/String;Ljava/lang/String;)I\n" +
+ " // Stack: 5, Locals: 4\n" +
+ " public int localMath(java.lang.String finalMessage, java.lang.String mutableMessage);\n" +
+ " 0 bipush 42\n" +
+ " 2 istore_3\n" +
+ " 3 new ParameterNames$1Local [29]\n" +
+ " 6 dup\n" +
+ " 7 aload_0 [this]\n" +
+ " 8 iconst_2\n" +
+ " 9 iload_3\n" +
+ " 10 invokespecial ParameterNames$1Local(ParameterNames, int, int) [31]\n" +
+ " 13 iconst_3\n" +
+ " 14 invokevirtual ParameterNames$1Local.calculate(int) : int [34]\n" +
+ " 17 ireturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 17]\n" +
+ " [pc: 3, line: 29]\n" +
+ " Method Parameters:\n" +
+ " final finalMessage\n" +
+ " mutableMessage\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #20 ParameterNames$1, outer class info: #0\n" +
+ " inner name: #0, accessflags: 0 default],\n" +
+ " [inner class info: #29 ParameterNames$1Local, outer class info: #0\n" +
" inner name: #41 Local, accessflags: 0 default]\n" +
nestMembers +
"}";
@@ -469,7 +469,7 @@ public class MethodParametersAttributeTest extends AbstractRegressionTest {
public void test008() throws Exception {
// Test that the code generator can emit synthetic and mandated names, just to match javac as closely as possibly
-
+
this.runParameterNameTest(
"ParameterNames.java",
this.originalSource);
@@ -490,55 +490,55 @@ public class MethodParametersAttributeTest extends AbstractRegressionTest {
"Nest Host: #36 ParameterNames\n";
}
String expectedOutput =
- "// Compiled from ParameterNames.java (" + this.versionString + ", super bit)\n" +
- "// Signature: Ljava/lang/Object;Ljava/util/concurrent/Callable<Ljava/lang/String;>;\n" +
- "class ParameterNames$1 implements java.util.concurrent.Callable {\n" +
- " \n" +
- " // Field descriptor #8 LParameterNames;\n" +
- " final synthetic ParameterNames this$0;\n" +
- " \n" +
- " // Field descriptor #10 Ljava/lang/String;\n" +
- " private final synthetic java.lang.String val$finalMessage;\n" +
- " \n" +
- " // Method descriptor #12 (LParameterNames;Ljava/lang/String;)V\n" +
- " // Stack: 2, Locals: 3\n" +
- " ParameterNames$1(ParameterNames this$0, java.lang.String val$finalMessage);\n" +
- " 0 aload_0 [this]\n" +
- " 1 aload_1 [this$0]\n" +
- " 2 putfield ParameterNames$1.this$0 : ParameterNames [14]\n" +
- " 5 aload_0 [this]\n" +
- " 6 aload_2 [val$finalMessage]\n" +
- " 7 putfield ParameterNames$1.val$finalMessage : java.lang.String [16]\n" +
- " 10 aload_0 [this]\n" +
- " 11 invokespecial java.lang.Object() [18]\n" +
- " 14 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 9]\n" +
- " Method Parameters:\n" +
- " final mandated this$0\n" +
- " final synthetic val$finalMessage\n" +
- " \n" +
- " // Method descriptor #24 ()Ljava/lang/String;\n" +
- " // Stack: 1, Locals: 1\n" +
- " public java.lang.String call() throws java.lang.Exception;\n" +
- " 0 aload_0 [this]\n" +
- " 1 getfield ParameterNames$1.val$finalMessage : java.lang.String [16]\n" +
- " 4 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 11]\n" +
- " \n" +
- " // Method descriptor #28 ()Ljava/lang/Object;\n" +
- " // Stack: 1, Locals: 1\n" +
- " public bridge synthetic java.lang.Object call() throws java.lang.Exception;\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokevirtual ParameterNames$1.call() : java.lang.String [29]\n" +
- " 4 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
- "\n" +
- " Inner classes:\n" +
- " [inner class info: #1 ParameterNames$1, outer class info: #0\n" +
- " inner name: #0, accessflags: 0 default]\n" +
+ "// Compiled from ParameterNames.java (" + this.versionString + ", super bit)\n" +
+ "// Signature: Ljava/lang/Object;Ljava/util/concurrent/Callable<Ljava/lang/String;>;\n" +
+ "class ParameterNames$1 implements java.util.concurrent.Callable {\n" +
+ " \n" +
+ " // Field descriptor #8 LParameterNames;\n" +
+ " final synthetic ParameterNames this$0;\n" +
+ " \n" +
+ " // Field descriptor #10 Ljava/lang/String;\n" +
+ " private final synthetic java.lang.String val$finalMessage;\n" +
+ " \n" +
+ " // Method descriptor #12 (LParameterNames;Ljava/lang/String;)V\n" +
+ " // Stack: 2, Locals: 3\n" +
+ " ParameterNames$1(ParameterNames this$0, java.lang.String val$finalMessage);\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 aload_1 [this$0]\n" +
+ " 2 putfield ParameterNames$1.this$0 : ParameterNames [14]\n" +
+ " 5 aload_0 [this]\n" +
+ " 6 aload_2 [val$finalMessage]\n" +
+ " 7 putfield ParameterNames$1.val$finalMessage : java.lang.String [16]\n" +
+ " 10 aload_0 [this]\n" +
+ " 11 invokespecial java.lang.Object() [18]\n" +
+ " 14 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 9]\n" +
+ " Method Parameters:\n" +
+ " final mandated this$0\n" +
+ " final synthetic val$finalMessage\n" +
+ " \n" +
+ " // Method descriptor #24 ()Ljava/lang/String;\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " public java.lang.String call() throws java.lang.Exception;\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 getfield ParameterNames$1.val$finalMessage : java.lang.String [16]\n" +
+ " 4 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 11]\n" +
+ " \n" +
+ " // Method descriptor #28 ()Ljava/lang/Object;\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " public bridge synthetic java.lang.Object call() throws java.lang.Exception;\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokevirtual ParameterNames$1.call() : java.lang.String [29]\n" +
+ " 4 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
+ "\n" +
+ " Inner classes:\n" +
+ " [inner class info: #1 ParameterNames$1, outer class info: #0\n" +
+ " inner name: #0, accessflags: 0 default]\n" +
" Enclosing Method: #36 #38 ParameterNames.makeInnerWithCapture(Ljava/lang/String;Ljava/lang/String;)Ljava/util/concurrent/Callable;\n" +
nestHost +
"}" ;
@@ -548,16 +548,16 @@ public class MethodParametersAttributeTest extends AbstractRegressionTest {
public void test009() throws Exception {
// Test that the code generator can emit synthetic and mandated names, just to match javac as closely as possibly
-
+
this.runParameterNameTest(
"FancyEnum.java",
- "\n" +
- "public enum FancyEnum {\n" +
- " ONE(1), TWO(2);\n" +
- " \n" +
- " private FancyEnum(final int v) { this.var = v; }\n" +
- " int var;\n" +
- "}\n" +
+ "\n" +
+ "public enum FancyEnum {\n" +
+ " ONE(1), TWO(2);\n" +
+ " \n" +
+ " private FancyEnum(final int v) { this.var = v; }\n" +
+ " int var;\n" +
+ "}\n" +
"");
ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
@@ -570,115 +570,115 @@ public class MethodParametersAttributeTest extends AbstractRegressionTest {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- "// Compiled from FancyEnum.java (" + this.versionString + ", super bit)\n" +
- "// Signature: Ljava/lang/Enum<LFancyEnum;>;\n" +
- "public final enum FancyEnum {\n" +
- " \n" +
- " // Field descriptor #6 LFancyEnum;\n" +
- " public static final enum FancyEnum ONE;\n" +
- " \n" +
- " // Field descriptor #6 LFancyEnum;\n" +
- " public static final enum FancyEnum TWO;\n" +
- " \n" +
- " // Field descriptor #9 I\n" +
- " int var;\n" +
- " \n" +
- " // Field descriptor #11 [LFancyEnum;\n" +
- " private static final synthetic FancyEnum[] ENUM$VALUES;\n" +
- " \n" +
- " // Method descriptor #13 ()V\n" +
- " // Stack: 5, Locals: 0\n" +
- " static {};\n" +
- " 0 new FancyEnum [1]\n" +
- " 3 dup\n" +
- " 4 ldc <String \"ONE\"> [15]\n" +
- " 6 iconst_0\n" +
- " 7 iconst_1\n" +
- " 8 invokespecial FancyEnum(java.lang.String, int, int) [16]\n" +
- " 11 putstatic FancyEnum.ONE : FancyEnum [20]\n" +
- " 14 new FancyEnum [1]\n" +
- " 17 dup\n" +
- " 18 ldc <String \"TWO\"> [22]\n" +
- " 20 iconst_1\n" +
- " 21 iconst_2\n" +
- " 22 invokespecial FancyEnum(java.lang.String, int, int) [16]\n" +
- " 25 putstatic FancyEnum.TWO : FancyEnum [23]\n" +
- " 28 iconst_2\n" +
- " 29 anewarray FancyEnum [1]\n" +
- " 32 dup\n" +
- " 33 iconst_0\n" +
- " 34 getstatic FancyEnum.ONE : FancyEnum [20]\n" +
- " 37 aastore\n" +
- " 38 dup\n" +
- " 39 iconst_1\n" +
- " 40 getstatic FancyEnum.TWO : FancyEnum [23]\n" +
- " 43 aastore\n" +
- " 44 putstatic FancyEnum.ENUM$VALUES : FancyEnum[] [25]\n" +
- " 47 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
- " [pc: 28, line: 2]\n" +
- " \n" +
- " // Method descriptor #19 (Ljava/lang/String;II)V\n" +
- " // Stack: 3, Locals: 4\n" +
- " private FancyEnum(java.lang.String $enum$name, int $enum$ordinal, int v);\n" +
- " 0 aload_0 [this]\n" +
- " 1 aload_1 [$enum$name]\n" +
- " 2 iload_2 [$enum$ordinal]\n" +
- " 3 invokespecial java.lang.Enum(java.lang.String, int) [28]\n" +
- " 6 aload_0 [this]\n" +
- " 7 iload_3 [v]\n" +
- " 8 putfield FancyEnum.var : int [31]\n" +
- " 11 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 5]\n" +
- " Method Parameters:\n" +
- " synthetic $enum$name\n" +
- " synthetic $enum$ordinal\n" +
- " final v\n" +
- " \n" +
- " // Method descriptor #38 ()[LFancyEnum;\n" +
- " // Stack: 5, Locals: 3\n" +
- " public static FancyEnum[] values();\n" +
- " 0 getstatic FancyEnum.ENUM$VALUES : FancyEnum[] [25]\n" +
- " 3 dup\n" +
- " 4 astore_0\n" +
- " 5 iconst_0\n" +
- " 6 aload_0\n" +
- " 7 arraylength\n" +
- " 8 dup\n" +
- " 9 istore_1\n" +
- " 10 anewarray FancyEnum [1]\n" +
- " 13 dup\n" +
- " 14 astore_2\n" +
- " 15 iconst_0\n" +
- " 16 iload_1\n" +
- " 17 invokestatic java.lang.System.arraycopy(java.lang.Object, int, java.lang.Object, int, int) : void [39]\n" +
- " 20 aload_2\n" +
- " 21 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
- " \n" +
- " // Method descriptor #46 (Ljava/lang/String;)LFancyEnum;\n" +
- " // Stack: 2, Locals: 1\n" +
- " public static FancyEnum valueOf(java.lang.String name);\n" +
- " 0 ldc <Class FancyEnum> [1]\n" +
- " 2 aload_0 [name]\n" +
- " 3 invokestatic java.lang.Enum.valueOf(java.lang.Class, java.lang.String) : java.lang.Enum [47]\n" +
- " 6 checkcast FancyEnum [1]\n" +
- " 9 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
- " Method Parameters:\n" +
- " mandated name\n" +
+ "// Compiled from FancyEnum.java (" + this.versionString + ", super bit)\n" +
+ "// Signature: Ljava/lang/Enum<LFancyEnum;>;\n" +
+ "public final enum FancyEnum {\n" +
+ " \n" +
+ " // Field descriptor #6 LFancyEnum;\n" +
+ " public static final enum FancyEnum ONE;\n" +
+ " \n" +
+ " // Field descriptor #6 LFancyEnum;\n" +
+ " public static final enum FancyEnum TWO;\n" +
+ " \n" +
+ " // Field descriptor #9 I\n" +
+ " int var;\n" +
+ " \n" +
+ " // Field descriptor #11 [LFancyEnum;\n" +
+ " private static final synthetic FancyEnum[] ENUM$VALUES;\n" +
+ " \n" +
+ " // Method descriptor #13 ()V\n" +
+ " // Stack: 5, Locals: 0\n" +
+ " static {};\n" +
+ " 0 new FancyEnum [1]\n" +
+ " 3 dup\n" +
+ " 4 ldc <String \"ONE\"> [15]\n" +
+ " 6 iconst_0\n" +
+ " 7 iconst_1\n" +
+ " 8 invokespecial FancyEnum(java.lang.String, int, int) [16]\n" +
+ " 11 putstatic FancyEnum.ONE : FancyEnum [20]\n" +
+ " 14 new FancyEnum [1]\n" +
+ " 17 dup\n" +
+ " 18 ldc <String \"TWO\"> [22]\n" +
+ " 20 iconst_1\n" +
+ " 21 iconst_2\n" +
+ " 22 invokespecial FancyEnum(java.lang.String, int, int) [16]\n" +
+ " 25 putstatic FancyEnum.TWO : FancyEnum [23]\n" +
+ " 28 iconst_2\n" +
+ " 29 anewarray FancyEnum [1]\n" +
+ " 32 dup\n" +
+ " 33 iconst_0\n" +
+ " 34 getstatic FancyEnum.ONE : FancyEnum [20]\n" +
+ " 37 aastore\n" +
+ " 38 dup\n" +
+ " 39 iconst_1\n" +
+ " 40 getstatic FancyEnum.TWO : FancyEnum [23]\n" +
+ " 43 aastore\n" +
+ " 44 putstatic FancyEnum.ENUM$VALUES : FancyEnum[] [25]\n" +
+ " 47 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
+ " [pc: 28, line: 2]\n" +
+ " \n" +
+ " // Method descriptor #19 (Ljava/lang/String;II)V\n" +
+ " // Stack: 3, Locals: 4\n" +
+ " private FancyEnum(java.lang.String $enum$name, int $enum$ordinal, int v);\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 aload_1 [$enum$name]\n" +
+ " 2 iload_2 [$enum$ordinal]\n" +
+ " 3 invokespecial java.lang.Enum(java.lang.String, int) [28]\n" +
+ " 6 aload_0 [this]\n" +
+ " 7 iload_3 [v]\n" +
+ " 8 putfield FancyEnum.var : int [31]\n" +
+ " 11 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 5]\n" +
+ " Method Parameters:\n" +
+ " synthetic $enum$name\n" +
+ " synthetic $enum$ordinal\n" +
+ " final v\n" +
+ " \n" +
+ " // Method descriptor #38 ()[LFancyEnum;\n" +
+ " // Stack: 5, Locals: 3\n" +
+ " public static FancyEnum[] values();\n" +
+ " 0 getstatic FancyEnum.ENUM$VALUES : FancyEnum[] [25]\n" +
+ " 3 dup\n" +
+ " 4 astore_0\n" +
+ " 5 iconst_0\n" +
+ " 6 aload_0\n" +
+ " 7 arraylength\n" +
+ " 8 dup\n" +
+ " 9 istore_1\n" +
+ " 10 anewarray FancyEnum [1]\n" +
+ " 13 dup\n" +
+ " 14 astore_2\n" +
+ " 15 iconst_0\n" +
+ " 16 iload_1\n" +
+ " 17 invokestatic java.lang.System.arraycopy(java.lang.Object, int, java.lang.Object, int, int) : void [39]\n" +
+ " 20 aload_2\n" +
+ " 21 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
+ " \n" +
+ " // Method descriptor #46 (Ljava/lang/String;)LFancyEnum;\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " public static FancyEnum valueOf(java.lang.String name);\n" +
+ " 0 ldc <Class FancyEnum> [1]\n" +
+ " 2 aload_0 [name]\n" +
+ " 3 invokestatic java.lang.Enum.valueOf(java.lang.Class, java.lang.String) : java.lang.Enum [47]\n" +
+ " 6 checkcast FancyEnum [1]\n" +
+ " 9 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
+ " Method Parameters:\n" +
+ " mandated name\n" +
"}";
assertSubstring(actualOutput, expectedOutput);
}
-
+
public void test010() throws Exception {
// Test that the non private inner class gets a mandated enclosing instance parameter.
-
+
this.runParameterNameTest(
"X.java",
"public class X {\n" +
@@ -696,25 +696,25 @@ public class MethodParametersAttributeTest extends AbstractRegressionTest {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " X$Y(X this$0);\n" +
- " 0 aload_0 [this]\n" +
- " 1 aload_1 [this$0]\n" +
- " 2 putfield X$Y.this$0 : X [10]\n" +
- " 5 aload_0 [this]\n" +
- " 6 invokespecial java.lang.Object() [12]\n" +
- " 9 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 2]\n" +
- " Method Parameters:\n" +
- " final mandated this$0\n" +
+ " X$Y(X this$0);\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 aload_1 [this$0]\n" +
+ " 2 putfield X$Y.this$0 : X [10]\n" +
+ " 5 aload_0 [this]\n" +
+ " 6 invokespecial java.lang.Object() [12]\n" +
+ " 9 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 2]\n" +
+ " Method Parameters:\n" +
+ " final mandated this$0\n" +
"\n";
assertSubstring(actualOutput, expectedOutput);
}
-
+
public void test011() throws Exception {
// Test that a private inner class does not get a mandated enclosing instance parameter.
-
+
this.runParameterNameTest(
"X.java",
"public class X {\n" +
@@ -732,24 +732,24 @@ public class MethodParametersAttributeTest extends AbstractRegressionTest {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " private X$Y(X this$0);\n" +
- " 0 aload_0 [this]\n" +
- " 1 aload_1 [this$0]\n" +
- " 2 putfield X$Y.this$0 : X [10]\n" +
- " 5 aload_0 [this]\n" +
- " 6 invokespecial java.lang.Object() [12]\n" +
- " 9 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 2]\n" +
- " Method Parameters:\n" +
- " final synthetic this$0\n" +
+ " private X$Y(X this$0);\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 aload_1 [this$0]\n" +
+ " 2 putfield X$Y.this$0 : X [10]\n" +
+ " 5 aload_0 [this]\n" +
+ " 6 invokespecial java.lang.Object() [12]\n" +
+ " 9 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 2]\n" +
+ " Method Parameters:\n" +
+ " final synthetic this$0\n" +
"\n";
assertSubstring(actualOutput, expectedOutput);
}
-
+
public void test012() throws Exception {
-
+
this.runParameterNameTest(
"X.java",
"public class X {\n" +
@@ -760,7 +760,7 @@ public class MethodParametersAttributeTest extends AbstractRegressionTest {
"}\n" +
"class Y {\n" +
" class Z {}\n" +
- "}\n"
+ "}\n"
);
ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
@@ -773,33 +773,33 @@ public class MethodParametersAttributeTest extends AbstractRegressionTest {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " X$1(X this$0, Y this$1);\n" +
- " 0 aload_0 [this]\n" +
- " 1 aload_1 [this$0]\n" +
- " 2 putfield X$1.this$0 : X [10]\n" +
- " 5 aload_0 [this]\n" +
- " 6 aload_2 [this$1]\n" +
- " 7 invokespecial Y$Z(Y) [12]\n" +
- " 10 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
- " Method Parameters:\n" +
- " final synthetic this$0\n" +
- " final mandated this$1\n" +
+ " X$1(X this$0, Y this$1);\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 aload_1 [this$0]\n" +
+ " 2 putfield X$1.this$0 : X [10]\n" +
+ " 5 aload_0 [this]\n" +
+ " 6 aload_2 [this$1]\n" +
+ " 7 invokespecial Y$Z(Y) [12]\n" +
+ " 10 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
+ " Method Parameters:\n" +
+ " final synthetic this$0\n" +
+ " final mandated this$1\n" +
"\n";
assertSubstring(actualOutput, expectedOutput);
}
-
+
public void test013() throws Exception {
// Test that synthesized enum constructor arguments show up as synthetic
-
+
this.runParameterNameTest(
"FancyEnum.java",
- "\n" +
- "public enum FancyEnum {\n" +
- " ONE, TWO;\n" +
- "}\n" +
+ "\n" +
+ "public enum FancyEnum {\n" +
+ " ONE, TWO;\n" +
+ "}\n" +
"");
ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
@@ -812,31 +812,31 @@ public class MethodParametersAttributeTest extends AbstractRegressionTest {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " private FancyEnum(java.lang.String $enum$name, int $enum$ordinal);\n" +
- " 0 aload_0 [this]\n" +
- " 1 aload_1 [$enum$name]\n" +
- " 2 iload_2 [$enum$ordinal]\n" +
- " 3 invokespecial java.lang.Enum(java.lang.String, int) [26]\n" +
- " 6 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 2]\n" +
- " Method Parameters:\n" +
- " synthetic $enum$name\n" +
- " synthetic $enum$ordinal\n" +
+ " private FancyEnum(java.lang.String $enum$name, int $enum$ordinal);\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 aload_1 [$enum$name]\n" +
+ " 2 iload_2 [$enum$ordinal]\n" +
+ " 3 invokespecial java.lang.Enum(java.lang.String, int) [26]\n" +
+ " 6 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 2]\n" +
+ " Method Parameters:\n" +
+ " synthetic $enum$name\n" +
+ " synthetic $enum$ordinal\n" +
" \n";
assertSubstring(actualOutput, expectedOutput);
}
-
+
public void test014() throws Exception {
// Test that the name argument of enum valueOf shows up as mandated
-
+
this.runParameterNameTest(
"FancyEnum.java",
- "\n" +
- "public enum FancyEnum {\n" +
- " ONE, TWO;\n" +
- "}\n" +
+ "\n" +
+ "public enum FancyEnum {\n" +
+ " ONE, TWO;\n" +
+ "}\n" +
"");
ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
@@ -849,29 +849,29 @@ public class MethodParametersAttributeTest extends AbstractRegressionTest {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " public static FancyEnum valueOf(java.lang.String name);\n" +
- " 0 ldc <Class FancyEnum> [1]\n" +
- " 2 aload_0 [name]\n" +
- " 3 invokestatic java.lang.Enum.valueOf(java.lang.Class, java.lang.String) : java.lang.Enum [40]\n" +
- " 6 checkcast FancyEnum [1]\n" +
- " 9 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
- " Method Parameters:\n" +
+ " public static FancyEnum valueOf(java.lang.String name);\n" +
+ " 0 ldc <Class FancyEnum> [1]\n" +
+ " 2 aload_0 [name]\n" +
+ " 3 invokestatic java.lang.Enum.valueOf(java.lang.Class, java.lang.String) : java.lang.Enum [40]\n" +
+ " 6 checkcast FancyEnum [1]\n" +
+ " 9 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
+ " Method Parameters:\n" +
" mandated name\n";
assertSubstring(actualOutput, expectedOutput);
}
public void test015() throws Exception {
// Test that the name argument of enum valueOf shows up as mandated
-
+
this.runParameterNameTest(
"InnerLocalClassTest.java",
- "public class InnerLocalClassTest {\n" +
- " void test() {\n" +
- " class Local { }\n" +
- " new Local() { };\n" +
- " } \n" +
+ "public class InnerLocalClassTest {\n" +
+ " void test() {\n" +
+ " class Local { }\n" +
+ " new Local() { };\n" +
+ " } \n" +
"}\n");
ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
@@ -884,35 +884,35 @@ public class MethodParametersAttributeTest extends AbstractRegressionTest {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " InnerLocalClassTest$1(InnerLocalClassTest this$0, InnerLocalClassTest this$1);\n" +
- " 0 aload_0 [this]\n" +
- " 1 aload_2 [this$1]\n" +
- " 2 putfield InnerLocalClassTest$1.this$0 : InnerLocalClassTest [10]\n" +
- " 5 aload_0 [this]\n" +
- " 6 aload_1 [this$0]\n" +
- " 7 invokespecial InnerLocalClassTest$1Local(InnerLocalClassTest) [12]\n" +
- " 10 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 4]\n" +
- " Method Parameters:\n" +
- " final synthetic this$0\n" +
+ " InnerLocalClassTest$1(InnerLocalClassTest this$0, InnerLocalClassTest this$1);\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 aload_2 [this$1]\n" +
+ " 2 putfield InnerLocalClassTest$1.this$0 : InnerLocalClassTest [10]\n" +
+ " 5 aload_0 [this]\n" +
+ " 6 aload_1 [this$0]\n" +
+ " 7 invokespecial InnerLocalClassTest$1Local(InnerLocalClassTest) [12]\n" +
+ " 10 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 4]\n" +
+ " Method Parameters:\n" +
+ " final synthetic this$0\n" +
" final synthetic this$1\n";
assertSubstring(actualOutput, expectedOutput);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=476528
public void test016() throws Exception {
// Test that the name argument of enum valueOf shows up as mandated
-
+
this.runParameterNameTest(
"Foo.java",
- "public enum Foo {\n" +
+ "public enum Foo {\n" +
" BAR;\n" +
- " public static Foo valueOf(int intParameter) {\n" +
+ " public static Foo valueOf(int intParameter) {\n" +
" return BAR;\n" +
- " }\n" +
- " public static Foo valueOf2(int intParameter) {\n" +
+ " }\n" +
+ " public static Foo valueOf2(int intParameter) {\n" +
" return BAR;\n" +
- " } \n" +
+ " } \n" +
"}\n");
ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
@@ -925,37 +925,37 @@ public class MethodParametersAttributeTest extends AbstractRegressionTest {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " // Stack: 1, Locals: 1\n" +
- " public static Foo valueOf(int intParameter);\n" +
- " 0 getstatic Foo.BAR : Foo [17]\n" +
- " 3 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 4]\n" +
- " Method Parameters:\n" +
- " intParameter\n" +
- " \n" +
- " // Method descriptor #27 (I)LFoo;\n" +
- " // Stack: 1, Locals: 1\n" +
- " public static Foo valueOf2(int intParameter);\n" +
- " 0 getstatic Foo.BAR : Foo [17]\n" +
- " 3 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 7]\n" +
- " Method Parameters:\n" +
- " intParameter\n";
+ " // Stack: 1, Locals: 1\n" +
+ " public static Foo valueOf(int intParameter);\n" +
+ " 0 getstatic Foo.BAR : Foo [17]\n" +
+ " 3 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 4]\n" +
+ " Method Parameters:\n" +
+ " intParameter\n" +
+ " \n" +
+ " // Method descriptor #27 (I)LFoo;\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " public static Foo valueOf2(int intParameter);\n" +
+ " 0 getstatic Foo.BAR : Foo [17]\n" +
+ " 3 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 7]\n" +
+ " Method Parameters:\n" +
+ " intParameter\n";
assertSubstring(actualOutput, expectedOutput);
// Test that synthetic method gets the right parameter names
expectedOutput =
- " public static Foo valueOf(java.lang.String name);\n" +
- " 0 ldc <Class Foo> [1]\n" +
- " 2 aload_0 [name]\n" +
- " 3 invokestatic java.lang.Enum.valueOf(java.lang.Class, java.lang.String) : java.lang.Enum [39]\n" +
- " 6 checkcast Foo [1]\n" +
- " 9 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
- " Method Parameters:\n" +
- " mandated name\n";
+ " public static Foo valueOf(java.lang.String name);\n" +
+ " 0 ldc <Class Foo> [1]\n" +
+ " 2 aload_0 [name]\n" +
+ " 3 invokestatic java.lang.Enum.valueOf(java.lang.Class, java.lang.String) : java.lang.Enum [39]\n" +
+ " 6 checkcast Foo [1]\n" +
+ " 9 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
+ " Method Parameters:\n" +
+ " mandated name\n";
assertSubstring(actualOutput, expectedOutput);
}
@@ -965,7 +965,7 @@ public class MethodParametersAttributeTest extends AbstractRegressionTest {
compilerOptions.put(CompilerOptions.OPTION_MethodParametersAttribute, CompilerOptions.GENERATE);
this.runConformTest(
new String[] {
- fileName,
+ fileName,
body
},
compilerOptions /* custom options */
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java
index 35554d816..f5e22fa4f 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java
@@ -1826,7 +1826,7 @@ public class MethodVerifyTest extends AbstractComparableTest {
this.runConformTest(
new String[] {
"X.java",
- "import java.util.*;\n" +
+ "import java.util.*;\n" +
"public class X extends java.util.AbstractMap {\n" +
" public java.util.Set entrySet() { return null; }\n" +
"}\n"
@@ -2064,16 +2064,16 @@ public class MethodVerifyTest extends AbstractComparableTest {
"class Y<T extends I&J> {}\n" +
"class Z<T extends J&I> {}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " public class X<T extends A&I> {}\n" +
- " ^\n" +
- "The return types are incompatible for the inherited methods I.foo(), A.foo()\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " interface J extends I { Object foo(); }\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with I.foo()\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " public class X<T extends A&I> {}\n" +
+ " ^\n" +
+ "The return types are incompatible for the inherited methods I.foo(), A.foo()\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " interface J extends I { Object foo(); }\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with I.foo()\n" +
"----------\n"
// foo() in A cannot implement foo() in I; attempting to use incompatible return type
);
@@ -2369,11 +2369,11 @@ public class MethodVerifyTest extends AbstractComparableTest {
"interface Equivalent<T> { boolean equalTo(T other); }\n" +
"interface EqualityComparable<T> { boolean equalTo(T other); }\n"
},
- "----------\n" +
- "1. ERROR in Y.java (at line 1)\n" +
- " abstract class Y implements Equivalent<String>, EqualityComparable<Integer> {\n" +
- " ^\n" +
- "Name clash: The method equalTo(T) of type EqualityComparable<T> has the same erasure as equalTo(T) of type Equivalent<T> but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in Y.java (at line 1)\n" +
+ " abstract class Y implements Equivalent<String>, EqualityComparable<Integer> {\n" +
+ " ^\n" +
+ "Name clash: The method equalTo(T) of type EqualityComparable<T> has the same erasure as equalTo(T) of type Equivalent<T> but does not override it\n" +
"----------\n");
}
}
@@ -2401,21 +2401,21 @@ public class MethodVerifyTest extends AbstractComparableTest {
"Name clash: The method equalTo(Object) of type Y has the same erasure as equalTo(T) of type Equivalent<T> but does not override it\n" +
"----------\n" :
// name clash: equalTo(java.lang.Object) in Y and equalTo(T) in Equivalent<java.lang.String> have the same erasure, yet neither overrides the other
- "----------\n" +
- "1. ERROR in Y.java (at line 1)\n" +
- " abstract class Y implements Equivalent<String>, EqualityComparable<Integer> {\n" +
- " ^\n" +
- "Name clash: The method equalTo(T) of type EqualityComparable<T> has the same erasure as equalTo(T) of type Equivalent<T> but does not override it\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 2)\n" +
- " public abstract boolean equalTo(Object other);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method equalTo(Object) of type Y has the same erasure as equalTo(T) of type EqualityComparable<T> but does not override it\n" +
- "----------\n" +
- "3. ERROR in Y.java (at line 2)\n" +
- " public abstract boolean equalTo(Object other);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method equalTo(Object) of type Y has the same erasure as equalTo(T) of type Equivalent<T> but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in Y.java (at line 1)\n" +
+ " abstract class Y implements Equivalent<String>, EqualityComparable<Integer> {\n" +
+ " ^\n" +
+ "Name clash: The method equalTo(T) of type EqualityComparable<T> has the same erasure as equalTo(T) of type Equivalent<T> but does not override it\n" +
+ "----------\n" +
+ "2. ERROR in Y.java (at line 2)\n" +
+ " public abstract boolean equalTo(Object other);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method equalTo(Object) of type Y has the same erasure as equalTo(T) of type EqualityComparable<T> but does not override it\n" +
+ "----------\n" +
+ "3. ERROR in Y.java (at line 2)\n" +
+ " public abstract boolean equalTo(Object other);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method equalTo(Object) of type Y has the same erasure as equalTo(T) of type Equivalent<T> but does not override it\n" +
"----------\n"
);
}
@@ -2479,58 +2479,58 @@ public class MethodVerifyTest extends AbstractComparableTest {
"interface K extends I { void foo(A<String> a); }\n" +
"class A<T> {}"
},
- this.complianceLevel < ClassFileConstants.JDK1_7 ?
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " class YYY implements J, I { public void foo(A a) {} }\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " class XXX implements I, J { public void foo(A a) {} }\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " class ZZZ implements K { public void foo(A a) {} }\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 7)\n" +
- " interface I { void foo(A a); }\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 9)\n" +
- " interface K extends I { void foo(A<String> a); }\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(A<String>) of type K has the same erasure as foo(A) of type I but does not override it\n" +
- "----------\n" :
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " class YYY implements J, I { public void foo(A a) {} }\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " class XXX implements I, J { public void foo(A a) {} }\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " class ZZZ implements K { public void foo(A a) {} }\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 7)\n" +
- " interface I { void foo(A a); }\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 9)\n" +
- " interface K extends I { void foo(A<String> a); }\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(A<String>) of type K has the same erasure as foo(A) of type I but does not override it\n" +
+ this.complianceLevel < ClassFileConstants.JDK1_7 ?
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " class YYY implements J, I { public void foo(A a) {} }\n" +
+ " ^\n" +
+ "A is a raw type. References to generic type A<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " class XXX implements I, J { public void foo(A a) {} }\n" +
+ " ^\n" +
+ "A is a raw type. References to generic type A<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " class ZZZ implements K { public void foo(A a) {} }\n" +
+ " ^\n" +
+ "A is a raw type. References to generic type A<T> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 7)\n" +
+ " interface I { void foo(A a); }\n" +
+ " ^\n" +
+ "A is a raw type. References to generic type A<T> should be parameterized\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 9)\n" +
+ " interface K extends I { void foo(A<String> a); }\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method foo(A<String>) of type K has the same erasure as foo(A) of type I but does not override it\n" +
+ "----------\n" :
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " class YYY implements J, I { public void foo(A a) {} }\n" +
+ " ^\n" +
+ "A is a raw type. References to generic type A<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " class XXX implements I, J { public void foo(A a) {} }\n" +
+ " ^\n" +
+ "A is a raw type. References to generic type A<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " class ZZZ implements K { public void foo(A a) {} }\n" +
+ " ^\n" +
+ "A is a raw type. References to generic type A<T> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 7)\n" +
+ " interface I { void foo(A a); }\n" +
+ " ^\n" +
+ "A is a raw type. References to generic type A<T> should be parameterized\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 9)\n" +
+ " interface K extends I { void foo(A<String> a); }\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method foo(A<String>) of type K has the same erasure as foo(A) of type I but does not override it\n" +
"----------\n");
}
public void test037a() { // test inheritance scenarios
@@ -2569,46 +2569,46 @@ public class MethodVerifyTest extends AbstractComparableTest {
"interface K extends I { void foo(A<String> a); }\n" +
"class A<T> {}"
},
- "----------\n" +
- "1. ERROR in XX.java (at line 1)\n" +
- " public class XX implements I, J { public void foo(A<String> a) {} }\n" +
- " ^^\n" +
- "The type XX must implement the inherited abstract method I.foo(A)\n" +
- "----------\n" +
- "2. ERROR in XX.java (at line 1)\n" +
- " public class XX implements I, J { public void foo(A<String> a) {} }\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(A<String>) of type XX has the same erasure as foo(A) of type I but does not override it\n" +
- "----------\n" +
- "3. ERROR in XX.java (at line 2)\n" +
- " class YY implements J, I { public void foo(A<String> a) {} }\n" +
- " ^^\n" +
- "The type YY must implement the inherited abstract method I.foo(A)\n" +
- "----------\n" +
- "4. ERROR in XX.java (at line 2)\n" +
- " class YY implements J, I { public void foo(A<String> a) {} }\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(A<String>) of type YY has the same erasure as foo(A) of type I but does not override it\n" +
- "----------\n" +
- "5. ERROR in XX.java (at line 3)\n" +
- " class ZZ implements K { public void foo(A<String> a) {} }\n" +
- " ^^\n" +
- "The type ZZ must implement the inherited abstract method I.foo(A)\n" +
- "----------\n" +
- "6. ERROR in XX.java (at line 3)\n" +
- " class ZZ implements K { public void foo(A<String> a) {} }\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(A<String>) of type ZZ has the same erasure as foo(A) of type I but does not override it\n" +
- "----------\n" +
- "7. WARNING in XX.java (at line 4)\n" +
- " interface I { void foo(A a); }\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n" +
- "8. ERROR in XX.java (at line 6)\n" +
- " interface K extends I { void foo(A<String> a); }\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(A<String>) of type K has the same erasure as foo(A) of type I but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in XX.java (at line 1)\n" +
+ " public class XX implements I, J { public void foo(A<String> a) {} }\n" +
+ " ^^\n" +
+ "The type XX must implement the inherited abstract method I.foo(A)\n" +
+ "----------\n" +
+ "2. ERROR in XX.java (at line 1)\n" +
+ " public class XX implements I, J { public void foo(A<String> a) {} }\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method foo(A<String>) of type XX has the same erasure as foo(A) of type I but does not override it\n" +
+ "----------\n" +
+ "3. ERROR in XX.java (at line 2)\n" +
+ " class YY implements J, I { public void foo(A<String> a) {} }\n" +
+ " ^^\n" +
+ "The type YY must implement the inherited abstract method I.foo(A)\n" +
+ "----------\n" +
+ "4. ERROR in XX.java (at line 2)\n" +
+ " class YY implements J, I { public void foo(A<String> a) {} }\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method foo(A<String>) of type YY has the same erasure as foo(A) of type I but does not override it\n" +
+ "----------\n" +
+ "5. ERROR in XX.java (at line 3)\n" +
+ " class ZZ implements K { public void foo(A<String> a) {} }\n" +
+ " ^^\n" +
+ "The type ZZ must implement the inherited abstract method I.foo(A)\n" +
+ "----------\n" +
+ "6. ERROR in XX.java (at line 3)\n" +
+ " class ZZ implements K { public void foo(A<String> a) {} }\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method foo(A<String>) of type ZZ has the same erasure as foo(A) of type I but does not override it\n" +
+ "----------\n" +
+ "7. WARNING in XX.java (at line 4)\n" +
+ " interface I { void foo(A a); }\n" +
+ " ^\n" +
+ "A is a raw type. References to generic type A<T> should be parameterized\n" +
+ "----------\n" +
+ "8. ERROR in XX.java (at line 6)\n" +
+ " interface K extends I { void foo(A<String> a); }\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method foo(A<String>) of type K has the same erasure as foo(A) of type I but does not override it\n" +
"----------\n"
);
}
@@ -3122,60 +3122,60 @@ public class MethodVerifyTest extends AbstractComparableTest {
"}\n"
},
this.complianceLevel < ClassFileConstants.JDK1_7 ?
- "----------\n" +
- "1. WARNING in p\\X.java (at line 6)\n" +
- " public X() { foo(data.l); }\n" +
- " ^^^^^^^^^^^\n" +
- "Type safety: A generic array of List<Object> is created for a varargs parameter\n" +
- "----------\n" +
- "2. WARNING in p\\X.java (at line 6)\n" +
- " public X() { foo(data.l); }\n" +
- " ^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation foo(List) of the generic method foo(List<T>...) of type Z\n" +
- "----------\n" +
- "3. WARNING in p\\X.java (at line 6)\n" +
- " public X() { foo(data.l); }\n" +
- " ^^^^^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in p\\Y.java (at line 4)\n" +
- " List l = null;\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in p\\X.java (at line 6)\n" +
+ " public X() { foo(data.l); }\n" +
+ " ^^^^^^^^^^^\n" +
+ "Type safety: A generic array of List<Object> is created for a varargs parameter\n" +
+ "----------\n" +
+ "2. WARNING in p\\X.java (at line 6)\n" +
+ " public X() { foo(data.l); }\n" +
+ " ^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation foo(List) of the generic method foo(List<T>...) of type Z\n" +
+ "----------\n" +
+ "3. WARNING in p\\X.java (at line 6)\n" +
+ " public X() { foo(data.l); }\n" +
+ " ^^^^^^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in p\\Y.java (at line 4)\n" +
+ " List l = null;\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
"----------\n" :
- "----------\n" +
- "1. WARNING in p\\X.java (at line 6)\n" +
- " public X() { foo(data.l); }\n" +
- " ^^^^^^^^^^^\n" +
- "Type safety: A generic array of List<Object> is created for a varargs parameter\n" +
- "----------\n" +
- "2. WARNING in p\\X.java (at line 6)\n" +
- " public X() { foo(data.l); }\n" +
- " ^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation foo(List) of the generic method foo(List<T>...) of type Z\n" +
- "----------\n" +
- "3. WARNING in p\\X.java (at line 6)\n" +
- " public X() { foo(data.l); }\n" +
- " ^^^^^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in p\\Y.java (at line 4)\n" +
- " List l = null;\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in p\\Y.java (at line 5)\n" +
- " public static <T> void foo(T... e) {}\n" +
- " ^\n" +
- "Type safety: Potential heap pollution via varargs parameter e\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in p\\Z.java (at line 4)\n" +
- " public static <T> void foo(List<T>... e) {}\n" +
- " ^\n" +
- "Type safety: Potential heap pollution via varargs parameter e\n" +
+ "----------\n" +
+ "1. WARNING in p\\X.java (at line 6)\n" +
+ " public X() { foo(data.l); }\n" +
+ " ^^^^^^^^^^^\n" +
+ "Type safety: A generic array of List<Object> is created for a varargs parameter\n" +
+ "----------\n" +
+ "2. WARNING in p\\X.java (at line 6)\n" +
+ " public X() { foo(data.l); }\n" +
+ " ^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation foo(List) of the generic method foo(List<T>...) of type Z\n" +
+ "----------\n" +
+ "3. WARNING in p\\X.java (at line 6)\n" +
+ " public X() { foo(data.l); }\n" +
+ " ^^^^^^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in p\\Y.java (at line 4)\n" +
+ " List l = null;\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in p\\Y.java (at line 5)\n" +
+ " public static <T> void foo(T... e) {}\n" +
+ " ^\n" +
+ "Type safety: Potential heap pollution via varargs parameter e\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in p\\Z.java (at line 4)\n" +
+ " public static <T> void foo(List<T>... e) {}\n" +
+ " ^\n" +
+ "Type safety: Potential heap pollution via varargs parameter e\n" +
"----------\n"
// unchecked conversion warnings
);
@@ -3201,59 +3201,59 @@ public class MethodVerifyTest extends AbstractComparableTest {
"}\n"
},
this.complianceLevel < ClassFileConstants.JDK1_7 ?
- "----------\n" +
- "1. WARNING in p\\X.java (at line 5)\n" +
- " public X() { foo(data.l); }\n" +
- " ^^^^^^^^^^^\n" +
- "Type safety: A generic array of List<Object> is created for a varargs parameter\n" +
- "----------\n" +
- "2. WARNING in p\\X.java (at line 5)\n" +
- " public X() { foo(data.l); }\n" +
- " ^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation foo(List) of the generic method foo(List<T>...) of type Y\n" +
- "----------\n" +
- "3. WARNING in p\\X.java (at line 5)\n" +
- " public X() { foo(data.l); }\n" +
- " ^^^^^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in p\\Y.java (at line 4)\n" +
- " List l = null;\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in p\\X.java (at line 5)\n" +
+ " public X() { foo(data.l); }\n" +
+ " ^^^^^^^^^^^\n" +
+ "Type safety: A generic array of List<Object> is created for a varargs parameter\n" +
+ "----------\n" +
+ "2. WARNING in p\\X.java (at line 5)\n" +
+ " public X() { foo(data.l); }\n" +
+ " ^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation foo(List) of the generic method foo(List<T>...) of type Y\n" +
+ "----------\n" +
+ "3. WARNING in p\\X.java (at line 5)\n" +
+ " public X() { foo(data.l); }\n" +
+ " ^^^^^^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in p\\Y.java (at line 4)\n" +
+ " List l = null;\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
"----------\n" :
- "----------\n" +
- "1. WARNING in p\\X.java (at line 5)\n" +
- " public X() { foo(data.l); }\n" +
- " ^^^^^^^^^^^\n" +
- "Type safety: A generic array of List<Object> is created for a varargs parameter\n" +
- "----------\n" +
- "2. WARNING in p\\X.java (at line 5)\n" +
- " public X() { foo(data.l); }\n" +
- " ^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation foo(List) of the generic method foo(List<T>...) of type Y\n" +
- "----------\n" +
- "3. WARNING in p\\X.java (at line 5)\n" +
- " public X() { foo(data.l); }\n" +
- " ^^^^^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in p\\Y.java (at line 4)\n" +
- " List l = null;\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in p\\Y.java (at line 5)\n" +
- " public static <T> void foo(T... e) {}\n" +
- " ^\n" +
- "Type safety: Potential heap pollution via varargs parameter e\n" +
- "----------\n" +
- "3. WARNING in p\\Y.java (at line 6)\n" +
- " public static <T> void foo(List<T>... e) {}\n" +
- " ^\n" +
- "Type safety: Potential heap pollution via varargs parameter e\n" +
+ "----------\n" +
+ "1. WARNING in p\\X.java (at line 5)\n" +
+ " public X() { foo(data.l); }\n" +
+ " ^^^^^^^^^^^\n" +
+ "Type safety: A generic array of List<Object> is created for a varargs parameter\n" +
+ "----------\n" +
+ "2. WARNING in p\\X.java (at line 5)\n" +
+ " public X() { foo(data.l); }\n" +
+ " ^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation foo(List) of the generic method foo(List<T>...) of type Y\n" +
+ "----------\n" +
+ "3. WARNING in p\\X.java (at line 5)\n" +
+ " public X() { foo(data.l); }\n" +
+ " ^^^^^^\n" +
+ "Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in p\\Y.java (at line 4)\n" +
+ " List l = null;\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in p\\Y.java (at line 5)\n" +
+ " public static <T> void foo(T... e) {}\n" +
+ " ^\n" +
+ "Type safety: Potential heap pollution via varargs parameter e\n" +
+ "----------\n" +
+ "3. WARNING in p\\Y.java (at line 6)\n" +
+ " public static <T> void foo(List<T>... e) {}\n" +
+ " ^\n" +
+ "Type safety: Potential heap pollution via varargs parameter e\n" +
"----------\n"
// unchecked conversion warnings
);
@@ -3431,27 +3431,27 @@ public class MethodVerifyTest extends AbstractComparableTest {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900
public void test048() {
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X1.java (at line 2)\n" +
- " public class X1 extends LinkedHashMap<String, String> {\n" +
- " ^^\n" +
- "The serializable class X1 does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. WARNING in X1.java (at line 3)\n" +
- " public Object putAll(Map<String,String> a) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method putAll(Map<String,String>) of type X1 has the same erasure as putAll(Map<? extends K,? extends V>) of type HashMap<K,V> but does not override it\n" +
+ "----------\n" +
+ "1. WARNING in X1.java (at line 2)\n" +
+ " public class X1 extends LinkedHashMap<String, String> {\n" +
+ " ^^\n" +
+ "The serializable class X1 does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. WARNING in X1.java (at line 3)\n" +
+ " public Object putAll(Map<String,String> a) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method putAll(Map<String,String>) of type X1 has the same erasure as putAll(Map<? extends K,? extends V>) of type HashMap<K,V> but does not override it\n" +
"----------\n":
- "----------\n" +
- "1. WARNING in X1.java (at line 2)\n" +
- " public class X1 extends LinkedHashMap<String, String> {\n" +
- " ^^\n" +
- "The serializable class X1 does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. ERROR in X1.java (at line 3)\n" +
- " public Object putAll(Map<String,String> a) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method putAll(Map<String,String>) of type X1 has the same erasure as putAll(Map<? extends K,? extends V>) of type HashMap<K,V> but does not override it\n" +
+ "----------\n" +
+ "1. WARNING in X1.java (at line 2)\n" +
+ " public class X1 extends LinkedHashMap<String, String> {\n" +
+ " ^^\n" +
+ "The serializable class X1 does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. ERROR in X1.java (at line 3)\n" +
+ " public Object putAll(Map<String,String> a) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method putAll(Map<String,String>) of type X1 has the same erasure as putAll(Map<? extends K,? extends V>) of type HashMap<K,V> but does not override it\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -3476,17 +3476,17 @@ X.java:4: name clash: putAll(Map<String,String>) in X1 and putAll(Map<? extends
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900
public void test048a() {
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X2.java (at line 2)\n" +
- " public Object foo(I<String> z) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(I<String>) of type X2 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" +
- "----------\n":
- "----------\n" +
- "1. ERROR in X2.java (at line 2)\n" +
- " public Object foo(I<String> z) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(I<String>) of type X2 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" +
+ "----------\n" +
+ "1. WARNING in X2.java (at line 2)\n" +
+ " public Object foo(I<String> z) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method foo(I<String>) of type X2 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" +
+ "----------\n":
+ "----------\n" +
+ "1. ERROR in X2.java (at line 2)\n" +
+ " public Object foo(I<String> z) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method foo(I<String>) of type X2 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -3546,17 +3546,17 @@ X.java:2: name clash: foo(I<String>) in X3 and foo(I<? extends T>) in Y have the
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900
public void test048c() {
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X4.java (at line 2)\n" +
- " public String foo(I<String> z) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(I<String>) of type X4 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" +
+ "----------\n" +
+ "1. WARNING in X4.java (at line 2)\n" +
+ " public String foo(I<String> z) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method foo(I<String>) of type X4 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X4.java (at line 2)\n" +
- " public String foo(I<String> z) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(I<String>) of type X4 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in X4.java (at line 2)\n" +
+ " public String foo(I<String> z) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method foo(I<String>) of type X4 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -3585,17 +3585,17 @@ X.java:2: name clash: foo(I<String>) in X4 and foo(I<? extends T>) in Y have the
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900
public void test048d() {
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X5.java (at line 2)\n" +
- " public Object foo(I<String> z) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(I<String>) of type X5 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" +
+ "----------\n" +
+ "1. WARNING in X5.java (at line 2)\n" +
+ " public Object foo(I<String> z) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method foo(I<String>) of type X5 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X5.java (at line 2)\n" +
- " public Object foo(I<String> z) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(I<String>) of type X5 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in X5.java (at line 2)\n" +
+ " public Object foo(I<String> z) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method foo(I<String>) of type X5 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -3625,17 +3625,17 @@ X.java:2: name clash: foo(I<String>) in X5 and foo(I<? extends T>) in Y have the
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900
public void test048e() {
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X6.java (at line 2)\n" +
- " public void foo(I<String> z) {}\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(I<String>) of type X6 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" +
+ "----------\n" +
+ "1. WARNING in X6.java (at line 2)\n" +
+ " public void foo(I<String> z) {}\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method foo(I<String>) of type X6 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X6.java (at line 2)\n" +
- " public void foo(I<String> z) {}\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(I<String>) of type X6 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in X6.java (at line 2)\n" +
+ " public void foo(I<String> z) {}\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method foo(I<String>) of type X6 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -3664,17 +3664,17 @@ X.java:2: name clash: foo(I<String>) in X6 and foo(I<? extends T>) in Y have the
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900
public void test048f() {
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X7.java (at line 2)\n" +
- " public String foo(I<String> z) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(I<String>) of type X7 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" +
+ "----------\n" +
+ "1. WARNING in X7.java (at line 2)\n" +
+ " public String foo(I<String> z) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method foo(I<String>) of type X7 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X7.java (at line 2)\n" +
- " public String foo(I<String> z) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(I<String>) of type X7 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in X7.java (at line 2)\n" +
+ " public String foo(I<String> z) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method foo(I<String>) of type X7 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -3793,42 +3793,42 @@ X.java:2: name clash: foo(I<String>) in X8 and foo(I<? extends T>) in Y have the
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=94754
public void test050() {
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " public static <S extends A> S foo() { System.out.print(\"A\"); return null; }\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " public static <N extends B> N foo() { System.out.print(\"B\"); return null; }\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type X\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 7)\n" +
- " new X().<B>foo();\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The static method foo() from the type X should be accessed in a static way\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " public static <S extends A> S foo() { System.out.print(\"A\"); return null; }\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " public static <N extends B> N foo() { System.out.print(\"B\"); return null; }\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 7)\n" +
+ " new X().<B>foo();\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The static method foo() from the type X should be accessed in a static way\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public static <S extends A> S foo() { System.out.print(\"A\"); return null; }\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " public static <N extends B> N foo() { System.out.print(\"B\"); return null; }\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " X.<B>foo();\n" +
- " ^^^\n" +
- "Bound mismatch: The generic method foo() of type X is not applicable for the arguments (). The inferred type B is not a valid substitute for the bounded parameter <S extends A>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " new X().<B>foo();\n" +
- " ^^^\n" +
- "Bound mismatch: The generic method foo() of type X is not applicable for the arguments (). The inferred type B is not a valid substitute for the bounded parameter <S extends A>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public static <S extends A> S foo() { System.out.print(\"A\"); return null; }\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " public static <N extends B> N foo() { System.out.print(\"B\"); return null; }\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " X.<B>foo();\n" +
+ " ^^^\n" +
+ "Bound mismatch: The generic method foo() of type X is not applicable for the arguments (). The inferred type B is not a valid substitute for the bounded parameter <S extends A>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " new X().<B>foo();\n" +
+ " ^^^\n" +
+ "Bound mismatch: The generic method foo() of type X is not applicable for the arguments (). The inferred type B is not a valid substitute for the bounded parameter <S extends A>\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -3870,37 +3870,37 @@ X.java:7: method foo in class X cannot be applied to given types
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=94754
public void test050a() {
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " public static <S extends A> void foo() { System.out.print(\"A\"); }\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " public static <N extends B> N foo() { System.out.print(\"B\"); return null; }\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " X.foo();\n" +
- " ^^^\n" +
- "The method foo() is ambiguous for the type X\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " foo();\n" +
- " ^^^\n" +
- "The method foo() is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " public static <S extends A> void foo() { System.out.print(\"A\"); }\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " public static <N extends B> N foo() { System.out.print(\"B\"); return null; }\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " X.foo();\n" +
+ " ^^^\n" +
+ "The method foo() is ambiguous for the type X\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " foo();\n" +
+ " ^^^\n" +
+ "The method foo() is ambiguous for the type X\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public static <S extends A> void foo() { System.out.print(\"A\"); }\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " public static <N extends B> N foo() { System.out.print(\"B\"); return null; }\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public static <S extends A> void foo() { System.out.print(\"A\"); }\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " public static <N extends B> N foo() { System.out.print(\"B\"); return null; }\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -3932,87 +3932,87 @@ X.java:3: name clash: <N>foo() and <S>foo() have the same erasure
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 - variation
public void test050b() {
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Y foo(Object o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C1\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " Z foo(Object o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C1\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 7)\n" +
- " <T extends Y> T foo(Object o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C2\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 8)\n" +
- " <T extends Z> T foo(Object o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C2\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 11)\n" +
- " A<Y> foo(Object o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C3\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 12)\n" +
- " A<Z> foo(Object o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C3\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 15)\n" +
- " Y foo(Object o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C4\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 16)\n" +
- " <T extends Z> T foo(Object o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C4\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " Y foo(Object o) { return null; } // duplicate\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C1\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " Z foo(Object o) { return null; } // duplicate\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C1\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 7)\n" +
+ " <T extends Y> T foo(Object o) { return null; } // duplicate\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C2\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 8)\n" +
+ " <T extends Z> T foo(Object o) { return null; } // duplicate\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C2\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 11)\n" +
+ " A<Y> foo(Object o) { return null; } // duplicate\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C3\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 12)\n" +
+ " A<Z> foo(Object o) { return null; } // duplicate\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C3\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 15)\n" +
+ " Y foo(Object o) { return null; } // duplicate\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C4\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 16)\n" +
+ " <T extends Z> T foo(Object o) { return null; } // duplicate\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C4\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Y foo(Object o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C1\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " Z foo(Object o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C1\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " <T extends Y> T foo(Object o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C2\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " <T extends Z> T foo(Object o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C2\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 11)\n" +
- " A<Y> foo(Object o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C3\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 12)\n" +
- " A<Z> foo(Object o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C3\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 15)\n" +
- " Y foo(Object o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C4\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 16)\n" +
- " <T extends Z> T foo(Object o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C4\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " Y foo(Object o) { return null; } // duplicate\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C1\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " Z foo(Object o) { return null; } // duplicate\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C1\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " <T extends Y> T foo(Object o) { return null; } // duplicate\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C2\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " <T extends Z> T foo(Object o) { return null; } // duplicate\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C2\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 11)\n" +
+ " A<Y> foo(Object o) { return null; } // duplicate\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C3\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 12)\n" +
+ " A<Z> foo(Object o) { return null; } // duplicate\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C3\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 15)\n" +
+ " Y foo(Object o) { return null; } // duplicate\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C4\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 16)\n" +
+ " <T extends Z> T foo(Object o) { return null; } // duplicate\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C4\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -4063,46 +4063,46 @@ X.java:16: foo(Object) is already defined in X.C4
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 - variation
public void test050c() {
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " A<Y> foo(A<Y> o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " A<Y> foo(A<Y> o) { return null; } // duplicate\n" +
+ " ^^^^^^^^^^^\n" +
"Erasure of method foo(A<Y>) is the same as another method in type X.C5\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " A<Z> foo(A<Z> o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " A<Z> foo(A<Z> o) { return null; } // duplicate\n" +
+ " ^^^^^^^^^^^\n" +
"Erasure of method foo(A<Z>) is the same as another method in type X.C5\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 7)\n" +
- " <T extends Y> T foo(A<Y> o) { return null; } // ok\n" +
- " ^^^^^^^^^^^\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 7)\n" +
+ " <T extends Y> T foo(A<Y> o) { return null; } // ok\n" +
+ " ^^^^^^^^^^^\n" +
"Erasure of method foo(A<Y>) is the same as another method in type X.C6\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 8)\n" +
- " <T extends Z> T foo(A<Z> o) { return null; } // ok\n" +
- " ^^^^^^^^^^^\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 8)\n" +
+ " <T extends Z> T foo(A<Z> o) { return null; } // ok\n" +
+ " ^^^^^^^^^^^\n" +
"Erasure of method foo(A<Z>) is the same as another method in type X.C6\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " A<Y> foo(A<Y> o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " A<Y> foo(A<Y> o) { return null; } // duplicate\n" +
+ " ^^^^^^^^^^^\n" +
"Erasure of method foo(A<Y>) is the same as another method in type X.C5\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " A<Z> foo(A<Z> o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " A<Z> foo(A<Z> o) { return null; } // duplicate\n" +
+ " ^^^^^^^^^^^\n" +
"Erasure of method foo(A<Z>) is the same as another method in type X.C5\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " <T extends Y> T foo(A<Y> o) { return null; } // ok\n" +
- " ^^^^^^^^^^^\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " <T extends Y> T foo(A<Y> o) { return null; } // ok\n" +
+ " ^^^^^^^^^^^\n" +
"Erasure of method foo(A<Y>) is the same as another method in type X.C6\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " <T extends Z> T foo(A<Z> o) { return null; } // ok\n" +
- " ^^^^^^^^^^^\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " <T extends Z> T foo(A<Z> o) { return null; } // ok\n" +
+ " ^^^^^^^^^^^\n" +
"Erasure of method foo(A<Z>) is the same as another method in type X.C6\n" +
"----------\n";
this.runNegativeTest(
@@ -4140,27 +4140,27 @@ X.java:8: name clash: <T#1>foo(A<Z>) and <T#2>foo(A<Y>) have the same erasure
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 - variation
public void test050d() {
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " <T extends Y, U> T foo(Object o) { return null; } // ok\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C7\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " <T extends Z> T foo(Object o) { return null; } // ok\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C7\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " <T extends Y, U> T foo(Object o) { return null; } // ok\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C7\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " <T extends Z> T foo(Object o) { return null; } // ok\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C7\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " <T extends Y, U> T foo(Object o) { return null; } // ok\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C7\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " <T extends Z> T foo(Object o) { return null; } // ok\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C7\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " <T extends Y, U> T foo(Object o) { return null; } // ok\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C7\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " <T extends Z> T foo(Object o) { return null; } // ok\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate method foo(Object) in type X.C7\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -4192,66 +4192,66 @@ X.java:4: name clash: <T#1>foo(Object) and <T#2,U>foo(Object) have the same eras
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423
public void test050e() {
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " <N extends B> N a(A<String> s) { return null; }\n" +
- " ^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " <N extends B> N a(A<String> s) { return null; }\n" +
+ " ^^^^^^^^^^^^^^\n" +
"Erasure of method a(A<String>) is the same as another method in type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " <N> Object a(A<Number> n) { return null; }\n" +
- " ^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " <N> Object a(A<Number> n) { return null; }\n" +
+ " ^^^^^^^^^^^^^^\n" +
"Erasure of method a(A<Number>) is the same as another method in type X\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 4)\n" +
- " <N extends B> void b(A<String> s) {}\n" +
- " ^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 4)\n" +
+ " <N extends B> void b(A<String> s) {}\n" +
+ " ^^^^^^^^^^^^^^\n" +
"Erasure of method b(A<String>) is the same as another method in type X\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 5)\n" +
- " <N extends B> B b(A<Number> n) { return null; }\n" +
- " ^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 5)\n" +
+ " <N extends B> B b(A<Number> n) { return null; }\n" +
+ " ^^^^^^^^^^^^^^\n" +
"Erasure of method b(A<Number>) is the same as another method in type X\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 6)\n" +
- " void c(A<String> s) {}\n" +
- " ^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 6)\n" +
+ " void c(A<String> s) {}\n" +
+ " ^^^^^^^^^^^^^^\n" +
"Erasure of method c(A<String>) is the same as another method in type X\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 7)\n" +
- " B c(A<Number> n) { return null; }\n" +
- " ^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 7)\n" +
+ " B c(A<Number> n) { return null; }\n" +
+ " ^^^^^^^^^^^^^^\n" +
"Erasure of method c(A<Number>) is the same as another method in type X\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " <N extends B> N a(A<String> s) { return null; }\n" +
- " ^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " <N extends B> N a(A<String> s) { return null; }\n" +
+ " ^^^^^^^^^^^^^^\n" +
"Erasure of method a(A<String>) is the same as another method in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " <N> Object a(A<Number> n) { return null; }\n" +
- " ^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " <N> Object a(A<Number> n) { return null; }\n" +
+ " ^^^^^^^^^^^^^^\n" +
"Erasure of method a(A<Number>) is the same as another method in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " <N extends B> void b(A<String> s) {}\n" +
- " ^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " <N extends B> void b(A<String> s) {}\n" +
+ " ^^^^^^^^^^^^^^\n" +
"Erasure of method b(A<String>) is the same as another method in type X\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " <N extends B> B b(A<Number> n) { return null; }\n" +
- " ^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " <N extends B> B b(A<Number> n) { return null; }\n" +
+ " ^^^^^^^^^^^^^^\n" +
"Erasure of method b(A<Number>) is the same as another method in type X\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 6)\n" +
- " void c(A<String> s) {}\n" +
- " ^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 6)\n" +
+ " void c(A<String> s) {}\n" +
+ " ^^^^^^^^^^^^^^\n" +
"Erasure of method c(A<String>) is the same as another method in type X\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 7)\n" +
- " B c(A<Number> n) { return null; }\n" +
- " ^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 7)\n" +
+ " B c(A<Number> n) { return null; }\n" +
+ " ^^^^^^^^^^^^^^\n" +
"Erasure of method c(A<Number>) is the same as another method in type X\n" +
"----------\n";
this.runNegativeTest(
@@ -4392,46 +4392,46 @@ X.java:3: name clash: c(A<Number>) and c(A<String>) have the same erasure
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423
public void test050i() {
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " <N extends B> N a(A<Number> s) { return null; }\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method a(A<Number>) in type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " <N> Object a(A<Number> n) { return null; }\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method a(A<Number>) in type X\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 4)\n" +
- " <N extends B> N b(A<Number> s) { return null; }\n" +
- " ^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " <N extends B> N a(A<Number> s) { return null; }\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Duplicate method a(A<Number>) in type X\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " <N> Object a(A<Number> n) { return null; }\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Duplicate method a(A<Number>) in type X\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 4)\n" +
+ " <N extends B> N b(A<Number> s) { return null; }\n" +
+ " ^^^^^^^^^^^^^^\n" +
"Erasure of method b(A<Number>) is the same as another method in type X\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 5)\n" +
- " <N> Object b(A<String> n) { return null; }\n" +
- " ^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 5)\n" +
+ " <N> Object b(A<String> n) { return null; }\n" +
+ " ^^^^^^^^^^^^^^\n" +
"Erasure of method b(A<String>) is the same as another method in type X\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " <N extends B> N a(A<Number> s) { return null; }\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method a(A<Number>) in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " <N> Object a(A<Number> n) { return null; }\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method a(A<Number>) in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " <N extends B> N b(A<Number> s) { return null; }\n" +
- " ^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " <N extends B> N a(A<Number> s) { return null; }\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Duplicate method a(A<Number>) in type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " <N> Object a(A<Number> n) { return null; }\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Duplicate method a(A<Number>) in type X\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " <N extends B> N b(A<Number> s) { return null; }\n" +
+ " ^^^^^^^^^^^^^^\n" +
"Erasure of method b(A<Number>) is the same as another method in type X\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " <N> Object b(A<String> n) { return null; }\n" +
- " ^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " <N> Object b(A<String> n) { return null; }\n" +
+ " ^^^^^^^^^^^^^^\n" +
"Erasure of method b(A<String>) is the same as another method in type X\n" +
"----------\n";
this.runNegativeTest(
@@ -4580,31 +4580,31 @@ X.java:5: <N>b(A<Number>) is already defined in X
"class A<T> {}\n" +
"class B {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void a(A<Number> s) {}\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method a(A<Number>) in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " B a(A<Number> n) { return null; }\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method a(A<Number>) in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " Object b(A<Number> s) {}\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method b(A<Number>) in type X\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 4)\n" +
- " Object b(A<Number> s) {}\n" +
- " ^^^^^^^^^^^^^^\n" +
- "This method must return a result of type Object\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 5)\n" +
- " B b(A<Number> n) { return null; }\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method b(A<Number>) in type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " void a(A<Number> s) {}\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Duplicate method a(A<Number>) in type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " B a(A<Number> n) { return null; }\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Duplicate method a(A<Number>) in type X\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " Object b(A<Number> s) {}\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Duplicate method b(A<Number>) in type X\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 4)\n" +
+ " Object b(A<Number> s) {}\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "This method must return a result of type Object\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 5)\n" +
+ " B b(A<Number> n) { return null; }\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Duplicate method b(A<Number>) in type X\n" +
"----------\n"
);
/* javac 7
@@ -4679,26 +4679,26 @@ X.java:3: name clash: foo(A<Integer>) and foo(A<String>) have the same erasure
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=89470
public void test051b() {
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " void foo(A<String> a) {}\n" +
- " ^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " void foo(A<String> a) {}\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
"Erasure of method foo(A<String>) is the same as another method in type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " Object foo(A<Integer> a) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " Object foo(A<Integer> a) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
"Erasure of method foo(A<Integer>) is the same as another method in type X\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void foo(A<String> a) {}\n" +
- " ^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " void foo(A<String> a) {}\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
"Erasure of method foo(A<String>) is the same as another method in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " Object foo(A<Integer> a) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " Object foo(A<Integer> a) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
"Erasure of method foo(A<Integer>) is the same as another method in type X\n" +
"----------\n";
this.runNegativeTest(
@@ -4863,87 +4863,87 @@ X.java:3: a(Object) is already defined in X
// more duplicate tests, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=94897
public void test054a() {
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " <T1, T2> String aaa(X x) { return null; }\n" +
- " ^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " <T1, T2> String aaa(X x) { return null; }\n" +
+ " ^^^^^^^^\n" +
"Erasure of method aaa(X) is the same as another method in type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " <T extends X> T aaa(T x) { return null; }\n" +
- " ^^^^^^^^\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " <T extends X> T aaa(T x) { return null; }\n" +
+ " ^^^^^^^^\n" +
"Erasure of method aaa(T) is the same as another method in type X\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 4)\n" +
- " <T> String aa(X x) { return null; }\n" +
- " ^^^^^^^\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 4)\n" +
+ " <T> String aa(X x) { return null; }\n" +
+ " ^^^^^^^\n" +
"Erasure of method aa(X) is the same as another method in type X\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 5)\n" +
- " <T extends X> T aa(T x) { return null; }\n" +
- " ^^^^^^^\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 5)\n" +
+ " <T extends X> T aa(T x) { return null; }\n" +
+ " ^^^^^^^\n" +
"Erasure of method aa(T) is the same as another method in type X\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 6)\n" +
- " String a(X x) { return null; }\n" +
- " ^^^^^^\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 6)\n" +
+ " String a(X x) { return null; }\n" +
+ " ^^^^^^\n" +
"Erasure of method a(X) is the same as another method in type X\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 7)\n" +
- " <T extends X> T a(T x) { return null; }\n" +
- " ^^^^^^\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 7)\n" +
+ " <T extends X> T a(T x) { return null; }\n" +
+ " ^^^^^^\n" +
"Erasure of method a(T) is the same as another method in type X\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 8)\n" +
- " <T> String z(X x) { return null; }\n" +
- " ^^^^^^\n" +
- "Duplicate method z(X) in type X\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 9)\n" +
- " <T, S> Object z(X x) { return null; }\n" +
- " ^^^^^^\n" +
- "Duplicate method z(X) in type X\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 8)\n" +
+ " <T> String z(X x) { return null; }\n" +
+ " ^^^^^^\n" +
+ "Duplicate method z(X) in type X\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 9)\n" +
+ " <T, S> Object z(X x) { return null; }\n" +
+ " ^^^^^^\n" +
+ "Duplicate method z(X) in type X\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " <T1, T2> String aaa(X x) { return null; }\n" +
- " ^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " <T1, T2> String aaa(X x) { return null; }\n" +
+ " ^^^^^^^^\n" +
"Erasure of method aaa(X) is the same as another method in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " <T extends X> T aaa(T x) { return null; }\n" +
- " ^^^^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " <T extends X> T aaa(T x) { return null; }\n" +
+ " ^^^^^^^^\n" +
"Erasure of method aaa(T) is the same as another method in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " <T> String aa(X x) { return null; }\n" +
- " ^^^^^^^\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " <T> String aa(X x) { return null; }\n" +
+ " ^^^^^^^\n" +
"Erasure of method aa(X) is the same as another method in type X\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " <T extends X> T aa(T x) { return null; }\n" +
- " ^^^^^^^\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " <T extends X> T aa(T x) { return null; }\n" +
+ " ^^^^^^^\n" +
"Erasure of method aa(T) is the same as another method in type X\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 6)\n" +
- " String a(X x) { return null; }\n" +
- " ^^^^^^\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 6)\n" +
+ " String a(X x) { return null; }\n" +
+ " ^^^^^^\n" +
"Erasure of method a(X) is the same as another method in type X\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 7)\n" +
- " <T extends X> T a(T x) { return null; }\n" +
- " ^^^^^^\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 7)\n" +
+ " <T extends X> T a(T x) { return null; }\n" +
+ " ^^^^^^\n" +
"Erasure of method a(T) is the same as another method in type X\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 8)\n" +
- " <T> String z(X x) { return null; }\n" +
- " ^^^^^^\n" +
- "Duplicate method z(X) in type X\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 9)\n" +
- " <T, S> Object z(X x) { return null; }\n" +
- " ^^^^^^\n" +
- "Duplicate method z(X) in type X\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 8)\n" +
+ " <T> String z(X x) { return null; }\n" +
+ " ^^^^^^\n" +
+ "Duplicate method z(X) in type X\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 9)\n" +
+ " <T, S> Object z(X x) { return null; }\n" +
+ " ^^^^^^\n" +
+ "Duplicate method z(X) in type X\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -4991,27 +4991,27 @@ X.java:9: name clash: <T#1,S>z(X) and <T#3>z(X) have the same erasure
// more duplicate tests, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=94897
public void test054b() {
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " Object foo(X<T> t) { return null; }\n" +
- " ^^^^^^^^^^^\n" +
- "Duplicate method foo(X<T>) in type X<T>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " <S> String foo(X<T> s) { return null; }\n" +
- " ^^^^^^^^^^^\n" +
- "Duplicate method foo(X<T>) in type X<T>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " Object foo(X<T> t) { return null; }\n" +
+ " ^^^^^^^^^^^\n" +
+ "Duplicate method foo(X<T>) in type X<T>\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " <S> String foo(X<T> s) { return null; }\n" +
+ " ^^^^^^^^^^^\n" +
+ "Duplicate method foo(X<T>) in type X<T>\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Object foo(X<T> t) { return null; }\n" +
- " ^^^^^^^^^^^\n" +
- "Duplicate method foo(X<T>) in type X<T>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " <S> String foo(X<T> s) { return null; }\n" +
- " ^^^^^^^^^^^\n" +
- "Duplicate method foo(X<T>) in type X<T>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " Object foo(X<T> t) { return null; }\n" +
+ " ^^^^^^^^^^^\n" +
+ "Duplicate method foo(X<T>) in type X<T>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " <S> String foo(X<T> s) { return null; }\n" +
+ " ^^^^^^^^^^^\n" +
+ "Duplicate method foo(X<T>) in type X<T>\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -5067,46 +5067,46 @@ X.java:3: <T1>dupT() is already defined in X
// more duplicate tests, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=94897
public void test054d() {
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " <T> T a(A<T> t) {return null;}\n" +
- " ^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " <T> T a(A<T> t) {return null;}\n" +
+ " ^^^^^^^^^\n" +
"Erasure of method a(A<T>) is the same as another method in type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " <T> String a(A<Object> o) {return null;}\n" +
- " ^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " <T> String a(A<Object> o) {return null;}\n" +
+ " ^^^^^^^^^^^^^^\n" +
"Erasure of method a(A<Object>) is the same as another method in type X\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 4)\n" +
- " <T> T aa(A<T> t) {return null;}\n" +
- " ^^^^^^^^^^\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 4)\n" +
+ " <T> T aa(A<T> t) {return null;}\n" +
+ " ^^^^^^^^^^\n" +
"Erasure of method aa(A<T>) is the same as another method in type X\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 5)\n" +
- " String aa(A<Object> o) {return null;}\n" +
- " ^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 5)\n" +
+ " String aa(A<Object> o) {return null;}\n" +
+ " ^^^^^^^^^^^^^^^\n" +
"Erasure of method aa(A<Object>) is the same as another method in type X\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " <T> T a(A<T> t) {return null;}\n" +
- " ^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " <T> T a(A<T> t) {return null;}\n" +
+ " ^^^^^^^^^\n" +
"Erasure of method a(A<T>) is the same as another method in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " <T> String a(A<Object> o) {return null;}\n" +
- " ^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " <T> String a(A<Object> o) {return null;}\n" +
+ " ^^^^^^^^^^^^^^\n" +
"Erasure of method a(A<Object>) is the same as another method in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " <T> T aa(A<T> t) {return null;}\n" +
- " ^^^^^^^^^^\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " <T> T aa(A<T> t) {return null;}\n" +
+ " ^^^^^^^^^^\n" +
"Erasure of method aa(A<T>) is the same as another method in type X\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " String aa(A<Object> o) {return null;}\n" +
- " ^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " String aa(A<Object> o) {return null;}\n" +
+ " ^^^^^^^^^^^^^^^\n" +
"Erasure of method aa(A<Object>) is the same as another method in type X\n" +
"----------\n";
this.runNegativeTest(
@@ -5245,56 +5245,56 @@ X.java:5: name clash: aa(A<Object>) and <T>aa(A<T>) have the same erasure
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=94898
public void test058a() {
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " new X<Object>().foo(\"X\");\n" +
- " ^^^\n" +
- "The method foo(String) is ambiguous for the type X<Object>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " new X<Object>().foo2(\"X\");\n" +
- " ^^^^\n" +
- "The method foo2(String) is ambiguous for the type X<Object>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " <T> T foo(T t) {return null;}\n" +
- " ^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " new X<Object>().foo(\"X\");\n" +
+ " ^^^\n" +
+ "The method foo(String) is ambiguous for the type X<Object>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " new X<Object>().foo2(\"X\");\n" +
+ " ^^^^\n" +
+ "The method foo2(String) is ambiguous for the type X<Object>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " <T> T foo(T t) {return null;}\n" +
+ " ^^^^^^^^\n" +
"Erasure of method foo(T) is the same as another method in type X<A>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 7)\n" +
- " void foo(A a) {}\n" +
- " ^^^^^^^^\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 7)\n" +
+ " void foo(A a) {}\n" +
+ " ^^^^^^^^\n" +
"Erasure of method foo(A) is the same as another method in type X<A>\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 8)\n" +
- " <T> T foo2(T t) {return null;}\n" +
- " ^^^^^^^^^\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 8)\n" +
+ " <T> T foo2(T t) {return null;}\n" +
+ " ^^^^^^^^^\n" +
"Erasure of method foo2(T) is the same as another method in type X<A>\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 9)\n" +
- " <T> void foo2(A a) {}\n" +
- " ^^^^^^^^^\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 9)\n" +
+ " <T> void foo2(A a) {}\n" +
+ " ^^^^^^^^^\n" +
"Erasure of method foo2(A) is the same as another method in type X<A>\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " <T> T foo(T t) {return null;}\n" +
- " ^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " <T> T foo(T t) {return null;}\n" +
+ " ^^^^^^^^\n" +
"Erasure of method foo(T) is the same as another method in type X<A>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " void foo(A a) {}\n" +
- " ^^^^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " void foo(A a) {}\n" +
+ " ^^^^^^^^\n" +
"Erasure of method foo(A) is the same as another method in type X<A>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " <T> T foo2(T t) {return null;}\n" +
- " ^^^^^^^^^\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " <T> T foo2(T t) {return null;}\n" +
+ " ^^^^^^^^^\n" +
"Erasure of method foo2(T) is the same as another method in type X<A>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " <T> void foo2(A a) {}\n" +
- " ^^^^^^^^^\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 9)\n" +
+ " <T> void foo2(A a) {}\n" +
+ " ^^^^^^^^^\n" +
"Erasure of method foo2(A) is the same as another method in type X<A>\n" +
"----------\n";
this.runNegativeTest(
@@ -5333,47 +5333,47 @@ X.java:9: name clash: <T#1>foo2(A) and <T#3>foo2(T#3) have the same erasure
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=94898
public void test058b() {
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " new X<Object>().foo(\"X\");\n" +
- " ^^^\n" +
- "The method foo(String) is ambiguous for the type X<Object>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " new X<Object>().foo2(\"X\");\n" +
- " ^^^^\n" +
- "The method foo2(String) is ambiguous for the type X<Object>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " <T> T foo(T t) {return null;}\n" +
- " ^^^^^^^^\n" +
- "Name clash: The method foo(T) of type X<A> has the same erasure as foo(A) of type Y<A> but does not override it\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 7)\n" +
- " <T> T foo2(T t) {return null;}\n" +
- " ^^^^^^^^^\n" +
- "Name clash: The method foo2(T) of type X<A> has the same erasure as foo2(A) of type Y<A> but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " new X<Object>().foo(\"X\");\n" +
+ " ^^^\n" +
+ "The method foo(String) is ambiguous for the type X<Object>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " new X<Object>().foo2(\"X\");\n" +
+ " ^^^^\n" +
+ "The method foo2(String) is ambiguous for the type X<Object>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " <T> T foo(T t) {return null;}\n" +
+ " ^^^^^^^^\n" +
+ "Name clash: The method foo(T) of type X<A> has the same erasure as foo(A) of type Y<A> but does not override it\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 7)\n" +
+ " <T> T foo2(T t) {return null;}\n" +
+ " ^^^^^^^^^\n" +
+ "Name clash: The method foo2(T) of type X<A> has the same erasure as foo2(A) of type Y<A> but does not override it\n" +
"----------\n":
"----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " new X<Object>().foo(\"X\");\n" +
- " ^^^\n" +
- "The method foo(String) is ambiguous for the type X<Object>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " new X<Object>().foo2(\"X\");\n" +
- " ^^^^\n" +
- "The method foo2(String) is ambiguous for the type X<Object>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " <T> T foo(T t) {return null;}\n" +
- " ^^^^^^^^\n" +
- "Name clash: The method foo(T) of type X<A> has the same erasure as foo(A) of type Y<A> but does not override it\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " <T> T foo2(T t) {return null;}\n" +
- " ^^^^^^^^^\n" +
- "Name clash: The method foo2(T) of type X<A> has the same erasure as foo2(A) of type Y<A> but does not override it\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " new X<Object>().foo(\"X\");\n" +
+ " ^^^\n" +
+ "The method foo(String) is ambiguous for the type X<Object>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " new X<Object>().foo2(\"X\");\n" +
+ " ^^^^\n" +
+ "The method foo2(String) is ambiguous for the type X<Object>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " <T> T foo(T t) {return null;}\n" +
+ " ^^^^^^^^\n" +
+ "Name clash: The method foo(T) of type X<A> has the same erasure as foo(A) of type Y<A> but does not override it\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " <T> T foo2(T t) {return null;}\n" +
+ " ^^^^^^^^^\n" +
+ "Name clash: The method foo2(T) of type X<A> has the same erasure as foo2(A) of type Y<A> but does not override it\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -6563,36 +6563,36 @@ X.java:7: name clash: <T#1>foo2(T#1) in X and <T#2>foo2(A) in Y have the same er
" ^^^^^^^^^^\n" +
"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
"----------\n":
- "----------\n" +
- "1. WARNING in Parent.java (at line 3)\n" +
- " static void staticCase1(Collection c) {}\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in Parent.java (at line 5)\n" +
- " void instanceCase1(Collection c) {}\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in Parent.java (at line 9)\n" +
- " static void staticCase1(Collection<String> c) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method staticCase1(Collection<String>) of type Child has the same erasure as staticCase1(Collection) of type Parent but does not hide it\n" +
- "----------\n" +
- "4. WARNING in Parent.java (at line 10)\n" +
- " static void staticCase2(Collection c) {}\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "5. ERROR in Parent.java (at line 11)\n" +
- " void instanceCase1(Collection<String> c) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method instanceCase1(Collection<String>) of type Child has the same erasure as instanceCase1(Collection) of type Parent but does not override it\n" +
- "----------\n" +
- "6. WARNING in Parent.java (at line 12)\n" +
- " @Override void instanceCase2(Collection c) {}\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in Parent.java (at line 3)\n" +
+ " static void staticCase1(Collection c) {}\n" +
+ " ^^^^^^^^^^\n" +
+ "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in Parent.java (at line 5)\n" +
+ " void instanceCase1(Collection c) {}\n" +
+ " ^^^^^^^^^^\n" +
+ "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
+ "----------\n" +
+ "3. ERROR in Parent.java (at line 9)\n" +
+ " static void staticCase1(Collection<String> c) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method staticCase1(Collection<String>) of type Child has the same erasure as staticCase1(Collection) of type Parent but does not hide it\n" +
+ "----------\n" +
+ "4. WARNING in Parent.java (at line 10)\n" +
+ " static void staticCase2(Collection c) {}\n" +
+ " ^^^^^^^^^^\n" +
+ "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
+ "----------\n" +
+ "5. ERROR in Parent.java (at line 11)\n" +
+ " void instanceCase1(Collection<String> c) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method instanceCase1(Collection<String>) of type Child has the same erasure as instanceCase1(Collection) of type Parent but does not override it\n" +
+ "----------\n" +
+ "6. WARNING in Parent.java (at line 12)\n" +
+ " @Override void instanceCase2(Collection c) {}\n" +
+ " ^^^^^^^^^^\n" +
+ "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
"----------\n"
// @Override is an error for instanceCase1
// name clash: instanceCase1(Collection<String>) in Child and instanceCase1(Collection) in Parent have the same erasure, yet neither overrides the other
@@ -7393,47 +7393,47 @@ public void test100() {
// name conflict
public void test101() {
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " Integer getX(List<Integer> l) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " Integer getX(List<Integer> l) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method getX(List<Integer>) is the same as another method in type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " String getX(List<String> l) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " String getX(List<String> l) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method getX(List<String>) is the same as another method in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " Integer getX(List<Integer> l) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate method getX(List<Integer>) in type Y\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 14)\n" +
- " String getX(List<Integer> l) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate method getX(List<Integer>) in type Y\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " Integer getX(List<Integer> l) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate method getX(List<Integer>) in type Y\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 14)\n" +
+ " String getX(List<Integer> l) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate method getX(List<Integer>) in type Y\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Integer getX(List<Integer> l) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " Integer getX(List<Integer> l) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method getX(List<Integer>) is the same as another method in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " String getX(List<String> l) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " String getX(List<String> l) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method getX(List<String>) is the same as another method in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " Integer getX(List<Integer> l) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate method getX(List<Integer>) in type Y\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 14)\n" +
- " String getX(List<Integer> l) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate method getX(List<Integer>) in type Y\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " Integer getX(List<Integer> l) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate method getX(List<Integer>) in type Y\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 14)\n" +
+ " String getX(List<Integer> l) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate method getX(List<Integer>) in type Y\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -8510,26 +8510,26 @@ public void test120() {
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=202830
public void test120a() {
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in Bar.java (at line 2)\n" +
- " int getThing(V v) { return 1; }\n" +
- " ^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in Bar.java (at line 2)\n" +
+ " int getThing(V v) { return 1; }\n" +
+ " ^^^^^^^^^^^^^\n" +
"Erasure of method getThing(V) is the same as another method in type Foo<V,E>\n" +
- "----------\n" +
- "2. WARNING in Bar.java (at line 3)\n" +
- " boolean getThing(E e) { return true; }\n" +
- " ^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. WARNING in Bar.java (at line 3)\n" +
+ " boolean getThing(E e) { return true; }\n" +
+ " ^^^^^^^^^^^^^\n" +
"Erasure of method getThing(E) is the same as another method in type Foo<V,E>\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in Bar.java (at line 2)\n" +
- " int getThing(V v) { return 1; }\n" +
- " ^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in Bar.java (at line 2)\n" +
+ " int getThing(V v) { return 1; }\n" +
+ " ^^^^^^^^^^^^^\n" +
"Erasure of method getThing(V) is the same as another method in type Foo<V,E>\n" +
- "----------\n" +
- "2. ERROR in Bar.java (at line 3)\n" +
- " boolean getThing(E e) { return true; }\n" +
- " ^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in Bar.java (at line 3)\n" +
+ " boolean getThing(E e) { return true; }\n" +
+ " ^^^^^^^^^^^^^\n" +
"Erasure of method getThing(E) is the same as another method in type Foo<V,E>\n" +
"----------\n";
this.runNegativeTest(
@@ -9089,7 +9089,7 @@ public void test138() {
"1. WARNING in X.java (at line 6)\n" +
" A<XX> foo(Number n);\n" +
" ^\n" +
- "Type safety: The return type A<XX> for foo(Number) from the type J needs unchecked conversion to conform to A<Exception&Cloneable> from the type I\n" +
+ "Type safety: The return type A<XX> for foo(Number) from the type J needs unchecked conversion to conform to A<Exception&Cloneable> from the type I\n" +
"----------\n"
);
}
@@ -9245,16 +9245,16 @@ public void test144() {
"}\n" +
"class PurebredCatShopImpl extends CatShopImpl implements PurebredCatShop {}"
},
- "----------\n" +
- "1. ERROR in PurebredCatShopImpl.java (at line 6)\n" +
- " <V extends Pet> List<? extends Cat> getPets();\n" +
- " ^^^^^^^^^\n" +
- "Name clash: The method getPets() of type CatShop has the same erasure as getPets() of type PetShop but does not override it\n" +
- "----------\n" +
- "2. WARNING in PurebredCatShopImpl.java (at line 10)\n" +
- " public List<Pet> getPets() { return null; }\n" +
- " ^^^^\n" +
- "Type safety: The return type List<Pet> for getPets() from the type CatShopImpl needs unchecked conversion to conform to List<? extends Cat> from the type CatShop\n" +
+ "----------\n" +
+ "1. ERROR in PurebredCatShopImpl.java (at line 6)\n" +
+ " <V extends Pet> List<? extends Cat> getPets();\n" +
+ " ^^^^^^^^^\n" +
+ "Name clash: The method getPets() of type CatShop has the same erasure as getPets() of type PetShop but does not override it\n" +
+ "----------\n" +
+ "2. WARNING in PurebredCatShopImpl.java (at line 10)\n" +
+ " public List<Pet> getPets() { return null; }\n" +
+ " ^^^^\n" +
+ "Type safety: The return type List<Pet> for getPets() from the type CatShopImpl needs unchecked conversion to conform to List<? extends Cat> from the type CatShop\n" +
"----------\n"
);
}
@@ -9409,78 +9409,78 @@ public void test149() {
"class Y<T> {}"
},
this.complianceLevel < ClassFileConstants.JDK1_7 ?
- "----------\n" +
- "1. ERROR in B.java (at line 2)\n" +
- " static void a(X x) {}\n" +
- " ^^^^^^\n" +
- "This static method cannot hide the instance method from A\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in B2.java (at line 2)\n" +
- " static void b(Y<Integer> y) {}\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "This static method cannot hide the instance method from A\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in C.java (at line 3)\n" +
- " void b(Y<String> y) {}\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Name clash: The method b(Y<String>) of type C has the same erasure as b(Y<Integer>) of type A but does not override it\n" +
- "----------\n" +
- "2. ERROR in C.java (at line 4)\n" +
- " void c(X x) {}\n" +
- " ^^^^^^\n" +
- "This instance method cannot override the static method from A\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in C2.java (at line 3)\n" +
- " void d(Y<Integer> y) {}\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "This instance method cannot override the static method from A\n" +
+ "----------\n" +
+ "1. ERROR in B.java (at line 2)\n" +
+ " static void a(X x) {}\n" +
+ " ^^^^^^\n" +
+ "This static method cannot hide the instance method from A\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in B2.java (at line 2)\n" +
+ " static void b(Y<Integer> y) {}\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "This static method cannot hide the instance method from A\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 3)\n" +
+ " void b(Y<String> y) {}\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Name clash: The method b(Y<String>) of type C has the same erasure as b(Y<Integer>) of type A but does not override it\n" +
+ "----------\n" +
+ "2. ERROR in C.java (at line 4)\n" +
+ " void c(X x) {}\n" +
+ " ^^^^^^\n" +
+ "This instance method cannot override the static method from A\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in C2.java (at line 3)\n" +
+ " void d(Y<Integer> y) {}\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "This instance method cannot override the static method from A\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in B.java (at line 2)\n" +
- " static void a(X x) {}\n" +
- " ^^^^^^\n" +
- "This static method cannot hide the instance method from A\n" +
- "----------\n" +
- "2. ERROR in B.java (at line 3)\n" +
- " static void b(Y<String> y) {}\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Name clash: The method b(Y<String>) of type B has the same erasure as b(Y<Integer>) of type A but does not hide it\n" +
- "----------\n" +
- "3. ERROR in B.java (at line 5)\n" +
- " static void d(Y<String> y) {}\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Name clash: The method d(Y<String>) of type B has the same erasure as d(Y<Integer>) of type A but does not hide it\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in B2.java (at line 2)\n" +
- " static void b(Y<Integer> y) {}\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "This static method cannot hide the instance method from A\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in C.java (at line 3)\n" +
- " void b(Y<String> y) {}\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Name clash: The method b(Y<String>) of type C has the same erasure as b(Y<Integer>) of type A but does not override it\n" +
- "----------\n" +
- "2. ERROR in C.java (at line 4)\n" +
- " void c(X x) {}\n" +
- " ^^^^^^\n" +
- "This instance method cannot override the static method from A\n" +
- "----------\n" +
- "3. ERROR in C.java (at line 5)\n" +
- " void d(Y<String> y) {}\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Name clash: The method d(Y<String>) of type C has the same erasure as d(Y<Integer>) of type A but does not hide it\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in C2.java (at line 3)\n" +
- " void d(Y<Integer> y) {}\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "This instance method cannot override the static method from A\n" +
+ "----------\n" +
+ "1. ERROR in B.java (at line 2)\n" +
+ " static void a(X x) {}\n" +
+ " ^^^^^^\n" +
+ "This static method cannot hide the instance method from A\n" +
+ "----------\n" +
+ "2. ERROR in B.java (at line 3)\n" +
+ " static void b(Y<String> y) {}\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Name clash: The method b(Y<String>) of type B has the same erasure as b(Y<Integer>) of type A but does not hide it\n" +
+ "----------\n" +
+ "3. ERROR in B.java (at line 5)\n" +
+ " static void d(Y<String> y) {}\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Name clash: The method d(Y<String>) of type B has the same erasure as d(Y<Integer>) of type A but does not hide it\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in B2.java (at line 2)\n" +
+ " static void b(Y<Integer> y) {}\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "This static method cannot hide the instance method from A\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 3)\n" +
+ " void b(Y<String> y) {}\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Name clash: The method b(Y<String>) of type C has the same erasure as b(Y<Integer>) of type A but does not override it\n" +
+ "----------\n" +
+ "2. ERROR in C.java (at line 4)\n" +
+ " void c(X x) {}\n" +
+ " ^^^^^^\n" +
+ "This instance method cannot override the static method from A\n" +
+ "----------\n" +
+ "3. ERROR in C.java (at line 5)\n" +
+ " void d(Y<String> y) {}\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Name clash: The method d(Y<String>) of type C has the same erasure as d(Y<Integer>) of type A but does not hide it\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in C2.java (at line 3)\n" +
+ " void d(Y<Integer> y) {}\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "This instance method cannot override the static method from A\n" +
"----------\n"
);
}
@@ -9875,21 +9875,21 @@ public void test159() {
"abstract class Y extends X {}\n" +
"class Z extends X {}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 15)\n" +
- " public abstract class X extends Root implements AFoo, BFoo {}\n" +
- " ^\n" +
- "The return types are incompatible for the inherited methods AFoo.bar(), BFoo.bar()\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 16)\n" +
- " abstract class Y extends X {}\n" +
- " ^\n" +
- "The return types are incompatible for the inherited methods AFoo.bar(), BFoo.bar()\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 17)\n" +
- " class Z extends X {}\n" +
- " ^\n" +
- "The type Z must implement the inherited abstract method BFoo.bar()\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 15)\n" +
+ " public abstract class X extends Root implements AFoo, BFoo {}\n" +
+ " ^\n" +
+ "The return types are incompatible for the inherited methods AFoo.bar(), BFoo.bar()\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 16)\n" +
+ " abstract class Y extends X {}\n" +
+ " ^\n" +
+ "The return types are incompatible for the inherited methods AFoo.bar(), BFoo.bar()\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 17)\n" +
+ " class Z extends X {}\n" +
+ " ^\n" +
+ "The type Z must implement the inherited abstract method BFoo.bar()\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=208010
@@ -10027,11 +10027,11 @@ public void test166() {
" public void foo(String item) {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " class X extends A implements I<String> {}\n" +
- " ^\n" +
- "Name clash: The method foo(Object) of type A has the same erasure as foo(T) of type I<T> but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " class X extends A implements I<String> {}\n" +
+ " ^\n" +
+ "Name clash: The method foo(Object) of type A has the same erasure as foo(T) of type I<T> but does not override it\n" +
"----------\n"
);
}
@@ -10064,40 +10064,40 @@ public void test168() {
" <V> M<V> bar() { return null; }\n" +
"}"
},
- "----------\n" +
- "1. WARNING in X.java (at line 1)\n" +
- " class X<T> extends Y {\n" +
- " ^\n" +
- "Y is a raw type. References to generic type Y<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " @Override <V> void foo(M m) { }\n" +
- " ^^^^^^^^\n" +
- "Name clash: The method foo(Y.M) of type X<T> has the same erasure as foo(Y.M) of type Y but does not override it\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 2)\n" +
- " @Override <V> void foo(M m) { }\n" +
- " ^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 1)\n" +
+ " class X<T> extends Y {\n" +
+ " ^\n" +
+ "Y is a raw type. References to generic type Y<T> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " @Override <V> void foo(M m) { }\n" +
+ " ^^^^^^^^\n" +
+ "Name clash: The method foo(Y.M) of type X<T> has the same erasure as foo(Y.M) of type Y but does not override it\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 2)\n" +
+ " @Override <V> void foo(M m) { }\n" +
+ " ^^^^^^^^\n" +
mustOverrideMessage("foo(Y.M)", "X<T>") +
- "----------\n" +
- "4. WARNING in X.java (at line 2)\n" +
- " @Override <V> void foo(M m) { }\n" +
- " ^\n" +
- "Y.M is a raw type. References to generic type Y<T>.M<V> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 3)\n" +
- " @Override <V> M bar() { return null; }\n" +
- " ^\n" +
- "Y.M is a raw type. References to generic type Y<T>.M<V> should be parameterized\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 3)\n" +
- " @Override <V> M bar() { return null; }\n" +
- " ^^^^^\n" +
- "Name clash: The method bar() of type X<T> has the same erasure as bar() of type Y but does not override it\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 3)\n" +
- " @Override <V> M bar() { return null; }\n" +
- " ^^^^^\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 2)\n" +
+ " @Override <V> void foo(M m) { }\n" +
+ " ^\n" +
+ "Y.M is a raw type. References to generic type Y<T>.M<V> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 3)\n" +
+ " @Override <V> M bar() { return null; }\n" +
+ " ^\n" +
+ "Y.M is a raw type. References to generic type Y<T>.M<V> should be parameterized\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 3)\n" +
+ " @Override <V> M bar() { return null; }\n" +
+ " ^^^^^\n" +
+ "Name clash: The method bar() of type X<T> has the same erasure as bar() of type Y but does not override it\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 3)\n" +
+ " @Override <V> M bar() { return null; }\n" +
+ " ^^^^^\n" +
mustOverrideMessage("bar()", "X<T>") +
"----------\n"
);
@@ -10120,16 +10120,16 @@ public void test169() {
},
null,
null,
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " public R foo(A a, I i) { return null; }\n" +
- " ^\n" +
- "R is a raw type. References to generic type R<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " public R foo(A a, I i) { return null; }\n" +
- " ^\n" +
- "X.I is a raw type. References to generic type X.I<S> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " public R foo(A a, I i) { return null; }\n" +
+ " ^\n" +
+ "R is a raw type. References to generic type R<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " public R foo(A a, I i) { return null; }\n" +
+ " ^\n" +
+ "X.I is a raw type. References to generic type X.I<S> should be parameterized\n" +
"----------\n",
Excuse.EclipseHasSomeMoreWarnings
);
@@ -10152,16 +10152,16 @@ public void test169a() {
},
null,
null,
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public R foo(X<String>.B b, I i) { return null; }\n" +
- " ^\n" +
- "R is a raw type. References to generic type R<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " public R foo(X<String>.B b, I i) { return null; }\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<S> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public R foo(X<String>.B b, I i) { return null; }\n" +
+ " ^\n" +
+ "R is a raw type. References to generic type R<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " public R foo(X<String>.B b, I i) { return null; }\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<S> should be parameterized\n" +
"----------\n",
Excuse.EclipseHasSomeMoreWarnings
);
@@ -10197,7 +10197,7 @@ public void test171() {
false,
new String[] {
"X.java",
- "public enum X {\n" +
+ "public enum X {\n" +
" FOO { @Override void foo() { super.foo(); } };\n"+
" synchronized void foo() { }\n"+
"}"
@@ -10221,7 +10221,7 @@ public void test172() {
false,
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" void bar() { new X() { @Override void foo() {} }; }\n"+
" synchronized void foo() { }\n"+
"}"
@@ -10272,11 +10272,11 @@ public void test174() {
"interface I { String m(); }\n" +
"interface J { Object m(); }\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " class X extends Y implements I { }\n" +
- " ^\n" +
- "The type X must implement the inherited abstract method I.m() to override Y.m()\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " class X extends Y implements I { }\n" +
+ " ^\n" +
+ "The type X must implement the inherited abstract method I.m() to override Y.m()\n" +
"----------\n"
);
}
@@ -10295,11 +10295,11 @@ public void test175() {
},
null,
options,
- "----------\n" +
- "1. WARNING in A.java (at line 1)\n" +
- " class A {\n" +
- " ^\n" +
- "The type A should also implement hashCode() since it overrides Object.equals()\n" +
+ "----------\n" +
+ "1. WARNING in A.java (at line 1)\n" +
+ " class A {\n" +
+ " ^\n" +
+ "The type A should also implement hashCode() since it overrides Object.equals()\n" +
"----------\n",
Excuse.EclipseHasSomeMoreWarnings);
}
@@ -10334,57 +10334,57 @@ public void test176() {
public void test177() {
if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_6) { // see test187()
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " class A extends LinkedHashMap {\n" +
- " ^\n" +
- "The serializable class A does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " class A extends LinkedHashMap {\n" +
- " ^^^^^^^^^^^^^\n" +
- "LinkedHashMap is a raw type. References to generic type LinkedHashMap<K,V> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 4)\n" +
- " public A foo(Collection c) { return this; }\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 6)\n" +
- " class X extends A implements I {\n" +
- " ^\n" +
- "The serializable class X does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 7)\n" +
- " @Override public X foo(Collection<?> c) { return this; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(Collection<?>) of type X has the same erasure as foo(Collection) of type A but does not override it\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " class A extends LinkedHashMap {\n" +
+ " ^\n" +
+ "The serializable class A does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " class A extends LinkedHashMap {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "LinkedHashMap is a raw type. References to generic type LinkedHashMap<K,V> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 4)\n" +
+ " public A foo(Collection c) { return this; }\n" +
+ " ^^^^^^^^^^\n" +
+ "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 6)\n" +
+ " class X extends A implements I {\n" +
+ " ^\n" +
+ "The serializable class X does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 7)\n" +
+ " @Override public X foo(Collection<?> c) { return this; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method foo(Collection<?>) of type X has the same erasure as foo(Collection) of type A but does not override it\n" +
"----------\n":
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " class A extends LinkedHashMap {\n" +
- " ^\n" +
- "The serializable class A does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " class A extends LinkedHashMap {\n" +
- " ^^^^^^^^^^^^^\n" +
- "LinkedHashMap is a raw type. References to generic type LinkedHashMap<K,V> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 4)\n" +
- " public A foo(Collection c) { return this; }\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 6)\n" +
- " class X extends A implements I {\n" +
- " ^\n" +
- "The serializable class X does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " @Override public X foo(Collection<?> c) { return this; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(Collection<?>) of type X has the same erasure as foo(Collection) of type A but does not override it\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " class A extends LinkedHashMap {\n" +
+ " ^\n" +
+ "The serializable class A does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " class A extends LinkedHashMap {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "LinkedHashMap is a raw type. References to generic type LinkedHashMap<K,V> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 4)\n" +
+ " public A foo(Collection c) { return this; }\n" +
+ " ^^^^^^^^^^\n" +
+ "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 6)\n" +
+ " class X extends A implements I {\n" +
+ " ^\n" +
+ "The serializable class X does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 7)\n" +
+ " @Override public X foo(Collection<?> c) { return this; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method foo(Collection<?>) of type X has the same erasure as foo(Collection) of type A but does not override it\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -10413,36 +10413,36 @@ public void test177() {
" @Override public X foo(Collection<?> c) { return this; }\n" +
"}"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " class A extends LinkedHashMap {\n" +
- " ^\n" +
- "The serializable class A does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " class A extends LinkedHashMap {\n" +
- " ^^^^^^^^^^^^^\n" +
- "LinkedHashMap is a raw type. References to generic type LinkedHashMap<K,V> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 4)\n" +
- " public A foo(Collection c) { return this; }\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 6)\n" +
- " class X extends A implements I {\n" +
- " ^\n" +
- "The serializable class X does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " @Override public X foo(Collection<?> c) { return this; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(Collection<?>) of type X has the same erasure as foo(Collection) of type A but does not override it\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 7)\n" +
- " @Override public X foo(Collection<?> c) { return this; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "The method foo(Collection<?>) of type X must override a superclass method\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " class A extends LinkedHashMap {\n" +
+ " ^\n" +
+ "The serializable class A does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " class A extends LinkedHashMap {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "LinkedHashMap is a raw type. References to generic type LinkedHashMap<K,V> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 4)\n" +
+ " public A foo(Collection c) { return this; }\n" +
+ " ^^^^^^^^^^\n" +
+ "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 6)\n" +
+ " class X extends A implements I {\n" +
+ " ^\n" +
+ "The serializable class X does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 7)\n" +
+ " @Override public X foo(Collection<?> c) { return this; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method foo(Collection<?>) of type X has the same erasure as foo(Collection) of type A but does not override it\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 7)\n" +
+ " @Override public X foo(Collection<?> c) { return this; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "The method foo(Collection<?>) of type X must override a superclass method\n" +
"----------\n"
);
}
@@ -10468,37 +10468,37 @@ public void test179() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface Adaptable {\n" +
- " public Object getAdapter(Class clazz); \n" +
- "}\n" +
- "\n" +
- "public class X implements Adaptable {\n" +
- " @Override\n" +
- " public Object getAdapter(Class<?> clazz) {\n" +
- " return null;\n" +
- " }\n" +
+ "interface Adaptable {\n" +
+ " public Object getAdapter(Class clazz); \n" +
+ "}\n" +
+ "\n" +
+ "public class X implements Adaptable {\n" +
+ " @Override\n" +
+ " public Object getAdapter(Class<?> clazz) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " public Object getAdapter(Class clazz); \n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public class X implements Adaptable {\n" +
- " ^\n" +
- "The type X must implement the inherited abstract method Adaptable.getAdapter(Class)\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " public Object getAdapter(Class<?> clazz) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method getAdapter(Class<?>) of type X has the same erasure as getAdapter(Class) of type Adaptable but does not override it\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " public Object getAdapter(Class<?> clazz) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- mustOverrideMessage("getAdapter(Class<?>)", "X") +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " public Object getAdapter(Class clazz); \n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " public class X implements Adaptable {\n" +
+ " ^\n" +
+ "The type X must implement the inherited abstract method Adaptable.getAdapter(Class)\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " public Object getAdapter(Class<?> clazz) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method getAdapter(Class<?>) of type X has the same erasure as getAdapter(Class) of type Adaptable but does not override it\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " public Object getAdapter(Class<?> clazz) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ mustOverrideMessage("getAdapter(Class<?>)", "X") +
"----------\n"
);
}
@@ -10518,26 +10518,26 @@ public void test180() {
" void test() { foo(); }\n" + // no secondary error
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " foo() { return null; }\n" +
- " ^^^^^\n" +
- "Return type for the method is missing\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " foo() { return null; }\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " @Override String foo() { return null; }\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type X\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " Number foo() { return null; }\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " foo() { return null; }\n" +
+ " ^^^^^\n" +
+ "Return type for the method is missing\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " foo() { return null; }\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " @Override String foo() { return null; }\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " Number foo() { return null; }\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
"----------\n"
);
}
@@ -10570,63 +10570,63 @@ public void test181() {
"B2.java",
"class B2 extends A2 implements I {}"
},
- "----------\n" +
- "1. ERROR in I.java (at line 13)\n" +
- " class A2 {\n" +
- " ^^\n" +
- "The type A2 must be an abstract class to define abstract methods\n" +
- "----------\n" +
- "2. ERROR in I.java (at line 14)\n" +
- " public abstract Object m();\n" +
- " ^^^\n" +
- "The abstract method m in type A2 can only be defined by an abstract class\n" +
- "----------\n" +
- "3. ERROR in I.java (at line 15)\n" +
- " public abstract String n();\n" +
- " ^^^\n" +
- "The abstract method n in type A2 can only be defined by an abstract class\n" +
- "----------\n" +
- "4. ERROR in I.java (at line 16)\n" +
- " abstract Object o();\n" +
- " ^^^\n" +
- "The abstract method o in type A2 can only be defined by an abstract class\n" +
- "----------\n" +
- "5. ERROR in I.java (at line 17)\n" +
- " abstract String p();\n" +
- " ^^^\n" +
- "The abstract method p in type A2 can only be defined by an abstract class\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in B.java (at line 1)\n" +
- " class B extends A implements I {}\n" +
- " ^\n" +
- "The type B must implement the inherited abstract method A.p()\n" +
- "----------\n" +
- "2. ERROR in B.java (at line 1)\n" +
- " class B extends A implements I {}\n" +
- " ^\n" +
- "The type B must implement the inherited abstract method I.o() to override A.o()\n" +
- "----------\n" +
- "3. ERROR in B.java (at line 1)\n" +
- " class B extends A implements I {}\n" +
- " ^\n" +
- "The type B must implement the inherited abstract method A.n()\n" +
- "----------\n" +
- "4. ERROR in B.java (at line 1)\n" +
- " class B extends A implements I {}\n" +
- " ^\n" +
- "The type B must implement the inherited abstract method I.m() to override A.m()\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in B2.java (at line 1)\n" +
- " class B2 extends A2 implements I {}\n" +
- " ^^\n" +
- "The type B2 must implement the inherited abstract method I.o() to override A2.o()\n" +
- "----------\n" +
- "2. ERROR in B2.java (at line 1)\n" +
- " class B2 extends A2 implements I {}\n" +
- " ^^\n" +
- "The type B2 must implement the inherited abstract method I.m() to override A2.m()\n" +
+ "----------\n" +
+ "1. ERROR in I.java (at line 13)\n" +
+ " class A2 {\n" +
+ " ^^\n" +
+ "The type A2 must be an abstract class to define abstract methods\n" +
+ "----------\n" +
+ "2. ERROR in I.java (at line 14)\n" +
+ " public abstract Object m();\n" +
+ " ^^^\n" +
+ "The abstract method m in type A2 can only be defined by an abstract class\n" +
+ "----------\n" +
+ "3. ERROR in I.java (at line 15)\n" +
+ " public abstract String n();\n" +
+ " ^^^\n" +
+ "The abstract method n in type A2 can only be defined by an abstract class\n" +
+ "----------\n" +
+ "4. ERROR in I.java (at line 16)\n" +
+ " abstract Object o();\n" +
+ " ^^^\n" +
+ "The abstract method o in type A2 can only be defined by an abstract class\n" +
+ "----------\n" +
+ "5. ERROR in I.java (at line 17)\n" +
+ " abstract String p();\n" +
+ " ^^^\n" +
+ "The abstract method p in type A2 can only be defined by an abstract class\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in B.java (at line 1)\n" +
+ " class B extends A implements I {}\n" +
+ " ^\n" +
+ "The type B must implement the inherited abstract method A.p()\n" +
+ "----------\n" +
+ "2. ERROR in B.java (at line 1)\n" +
+ " class B extends A implements I {}\n" +
+ " ^\n" +
+ "The type B must implement the inherited abstract method I.o() to override A.o()\n" +
+ "----------\n" +
+ "3. ERROR in B.java (at line 1)\n" +
+ " class B extends A implements I {}\n" +
+ " ^\n" +
+ "The type B must implement the inherited abstract method A.n()\n" +
+ "----------\n" +
+ "4. ERROR in B.java (at line 1)\n" +
+ " class B extends A implements I {}\n" +
+ " ^\n" +
+ "The type B must implement the inherited abstract method I.m() to override A.m()\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in B2.java (at line 1)\n" +
+ " class B2 extends A2 implements I {}\n" +
+ " ^^\n" +
+ "The type B2 must implement the inherited abstract method I.o() to override A2.o()\n" +
+ "----------\n" +
+ "2. ERROR in B2.java (at line 1)\n" +
+ " class B2 extends A2 implements I {}\n" +
+ " ^^\n" +
+ "The type B2 must implement the inherited abstract method I.m() to override A2.m()\n" +
"----------\n",
null,
true,
@@ -10642,37 +10642,37 @@ public void test181() {
"B2.java",
"class B2 extends A2 implements I {}"
},
- "----------\n" +
- "1. ERROR in B.java (at line 1)\n" +
- " class B extends A implements I {}\n" +
- " ^\n" +
- "The type B must implement the inherited abstract method A.p()\n" +
- "----------\n" +
- "2. ERROR in B.java (at line 1)\n" +
- " class B extends A implements I {}\n" +
- " ^\n" +
- "The type B must implement the inherited abstract method I.o() to override A.o()\n" +
- "----------\n" +
- "3. ERROR in B.java (at line 1)\n" +
- " class B extends A implements I {}\n" +
- " ^\n" +
- "The type B must implement the inherited abstract method A.n()\n" +
- "----------\n" +
- "4. ERROR in B.java (at line 1)\n" +
- " class B extends A implements I {}\n" +
- " ^\n" +
- "The type B must implement the inherited abstract method I.m() to override A.m()\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in B2.java (at line 1)\n" +
- " class B2 extends A2 implements I {}\n" +
- " ^^\n" +
- "The type B2 must implement the inherited abstract method I.o() to override A2.o()\n" +
- "----------\n" +
- "2. ERROR in B2.java (at line 1)\n" +
- " class B2 extends A2 implements I {}\n" +
- " ^^\n" +
- "The type B2 must implement the inherited abstract method I.m() to override A2.m()\n" +
+ "----------\n" +
+ "1. ERROR in B.java (at line 1)\n" +
+ " class B extends A implements I {}\n" +
+ " ^\n" +
+ "The type B must implement the inherited abstract method A.p()\n" +
+ "----------\n" +
+ "2. ERROR in B.java (at line 1)\n" +
+ " class B extends A implements I {}\n" +
+ " ^\n" +
+ "The type B must implement the inherited abstract method I.o() to override A.o()\n" +
+ "----------\n" +
+ "3. ERROR in B.java (at line 1)\n" +
+ " class B extends A implements I {}\n" +
+ " ^\n" +
+ "The type B must implement the inherited abstract method A.n()\n" +
+ "----------\n" +
+ "4. ERROR in B.java (at line 1)\n" +
+ " class B extends A implements I {}\n" +
+ " ^\n" +
+ "The type B must implement the inherited abstract method I.m() to override A.m()\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in B2.java (at line 1)\n" +
+ " class B2 extends A2 implements I {}\n" +
+ " ^^\n" +
+ "The type B2 must implement the inherited abstract method I.o() to override A2.o()\n" +
+ "----------\n" +
+ "2. ERROR in B2.java (at line 1)\n" +
+ " class B2 extends A2 implements I {}\n" +
+ " ^^\n" +
+ "The type B2 must implement the inherited abstract method I.m() to override A2.m()\n" +
"----------\n",
null,
false
@@ -10701,17 +10701,17 @@ public void test182() {
"B2.java",
"class B2 extends A2 implements I {}"
},
- "----------\n" +
- "1. ERROR in B.java (at line 1)\n" +
- " class B extends A implements I {}\n" +
- " ^\n" +
- "The type B must implement the inherited abstract method I.m() to override A.m()\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in B2.java (at line 1)\n" +
- " class B2 extends A2 implements I {}\n" +
- " ^^\n" +
- "The type B2 must implement the inherited abstract method I.m() to override A2.m()\n" +
+ "----------\n" +
+ "1. ERROR in B.java (at line 1)\n" +
+ " class B extends A implements I {}\n" +
+ " ^\n" +
+ "The type B must implement the inherited abstract method I.m() to override A.m()\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in B2.java (at line 1)\n" +
+ " class B2 extends A2 implements I {}\n" +
+ " ^^\n" +
+ "The type B2 must implement the inherited abstract method I.m() to override A2.m()\n" +
"----------\n"
);
this.runNegativeTest(
@@ -10721,17 +10721,17 @@ public void test182() {
"B2.java",
"class B2 extends A2 implements I {}"
},
- "----------\n" +
- "1. ERROR in B.java (at line 1)\n" +
- " class B extends A implements I {}\n" +
- " ^\n" +
- "The type B must implement the inherited abstract method I.m() to override A.m()\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in B2.java (at line 1)\n" +
- " class B2 extends A2 implements I {}\n" +
- " ^^\n" +
- "The type B2 must implement the inherited abstract method I.m() to override A2.m()\n" +
+ "----------\n" +
+ "1. ERROR in B.java (at line 1)\n" +
+ " class B extends A implements I {}\n" +
+ " ^\n" +
+ "The type B must implement the inherited abstract method I.m() to override A.m()\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in B2.java (at line 1)\n" +
+ " class B2 extends A2 implements I {}\n" +
+ " ^^\n" +
+ "The type B2 must implement the inherited abstract method I.m() to override A2.m()\n" +
"----------\n",
null,
false
@@ -10758,26 +10758,26 @@ public void test183() {
"class C {}\n" +
"class G<T2> {}"
},
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " @Override void a(G g) {}\n" +
- " ^\n" +
- "G is a raw type. References to generic type G<T2> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " @Override void c(G g) {}\n" +
- " ^\n" +
- "G is a raw type. References to generic type G<T2> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " @Override <T extends C, S extends G<C>> void d(S gc) {}\n" +
- " ^^^^^^^\n" +
- "Name clash: The method d(S) of type X has the same erasure as d(S) of type XX but does not override it\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 11)\n" +
- " @Override <T extends C, S extends G<C>> void d(S gc) {}\n" +
- " ^^^^^^^\n" +
- mustOverrideMessage("d(S)", "X") +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " @Override void a(G g) {}\n" +
+ " ^\n" +
+ "G is a raw type. References to generic type G<T2> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " @Override void c(G g) {}\n" +
+ " ^\n" +
+ "G is a raw type. References to generic type G<T2> should be parameterized\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " @Override <T extends C, S extends G<C>> void d(S gc) {}\n" +
+ " ^^^^^^^\n" +
+ "Name clash: The method d(S) of type X has the same erasure as d(S) of type XX but does not override it\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 11)\n" +
+ " @Override <T extends C, S extends G<C>> void d(S gc) {}\n" +
+ " ^^^^^^^\n" +
+ mustOverrideMessage("d(S)", "X") +
"----------\n"
);
}
@@ -10816,46 +10816,46 @@ public void test184() {
" @Override <T extends M> V n(Class<T> c) { return null; }\n" +
"}"
},
- "----------\n" +
- "1. WARNING in A.java (at line 6)\n" +
- " <T extends Integer> T z() { return null; }\n" +
- " ^^^^^^^\n" +
- "The type parameter T should not be bounded by the final type Integer. Final types cannot be further extended\n" +
- "----------\n" +
- "2. WARNING in A.java (at line 9)\n" +
- " @Override A a() { return null; }\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<U> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in A.java (at line 9)\n" +
- " @Override A a() { return null; }\n" +
- " ^\n" +
- "Type safety: The return type A for a() from the type B needs unchecked conversion to conform to T from the type A<U>\n" +
- "----------\n" +
- "4. WARNING in A.java (at line 11)\n" +
- " @Override Integer x() { return 1; }\n" +
- " ^^^^^^^\n" +
- "Type safety: The return type Integer for x() from the type B needs unchecked conversion to conform to T from the type A<U>\n" +
- "----------\n" +
- "5. WARNING in A.java (at line 12)\n" +
- " @Override Integer y() { return 1; }\n" +
- " ^^^^^^^\n" +
- "Type safety: The return type Integer for y() from the type B needs unchecked conversion to conform to T from the type A<U>\n" +
- "----------\n" +
- "6. WARNING in A.java (at line 13)\n" +
- " @Override Integer z() { return 1; }\n" +
- " ^^^^^^^\n" +
- "Type safety: The return type Integer for z() from the type B needs unchecked conversion to conform to T from the type A<U>\n" +
- "----------\n" +
- "7. WARNING in A.java (at line 15)\n" +
- " class C extends A {\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<U> should be parameterized\n" +
- "----------\n" +
- "8. WARNING in A.java (at line 16)\n" +
- " @Override A a() { return null; }\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<U> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in A.java (at line 6)\n" +
+ " <T extends Integer> T z() { return null; }\n" +
+ " ^^^^^^^\n" +
+ "The type parameter T should not be bounded by the final type Integer. Final types cannot be further extended\n" +
+ "----------\n" +
+ "2. WARNING in A.java (at line 9)\n" +
+ " @Override A a() { return null; }\n" +
+ " ^\n" +
+ "A is a raw type. References to generic type A<U> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in A.java (at line 9)\n" +
+ " @Override A a() { return null; }\n" +
+ " ^\n" +
+ "Type safety: The return type A for a() from the type B needs unchecked conversion to conform to T from the type A<U>\n" +
+ "----------\n" +
+ "4. WARNING in A.java (at line 11)\n" +
+ " @Override Integer x() { return 1; }\n" +
+ " ^^^^^^^\n" +
+ "Type safety: The return type Integer for x() from the type B needs unchecked conversion to conform to T from the type A<U>\n" +
+ "----------\n" +
+ "5. WARNING in A.java (at line 12)\n" +
+ " @Override Integer y() { return 1; }\n" +
+ " ^^^^^^^\n" +
+ "Type safety: The return type Integer for y() from the type B needs unchecked conversion to conform to T from the type A<U>\n" +
+ "----------\n" +
+ "6. WARNING in A.java (at line 13)\n" +
+ " @Override Integer z() { return 1; }\n" +
+ " ^^^^^^^\n" +
+ "Type safety: The return type Integer for z() from the type B needs unchecked conversion to conform to T from the type A<U>\n" +
+ "----------\n" +
+ "7. WARNING in A.java (at line 15)\n" +
+ " class C extends A {\n" +
+ " ^\n" +
+ "A is a raw type. References to generic type A<U> should be parameterized\n" +
+ "----------\n" +
+ "8. WARNING in A.java (at line 16)\n" +
+ " @Override A a() { return null; }\n" +
+ " ^\n" +
+ "A is a raw type. References to generic type A<U> should be parameterized\n" +
"----------\n"
);
}
@@ -10868,11 +10868,11 @@ public void test185() {
"interface J { J hello(); }\n" +
"class A implements I, J {}"
},
- "----------\n" +
- "1. ERROR in A.java (at line 3)\n" +
- " class A implements I, J {}\n" +
- " ^\n" +
- "The type A must implement the inherited abstract method J.hello()\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 3)\n" +
+ " class A implements I, J {}\n" +
+ " ^\n" +
+ "The type A must implement the inherited abstract method J.hello()\n" +
"----------\n"
);
}
@@ -10893,17 +10893,17 @@ public void test186() {
},
null,
null,
- "----------\n" +
- "1. WARNING in p2\\B.java (at line 2)\n" +
- " public class B extends p1.A { void m() {} }\n" +
- " ^^^\n" +
- "The method B.m() does not override the inherited method from A since it is private to a different package\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in p1\\C.java (at line 2)\n" +
- " public class C extends p2.B { @Override void m() {} }\n" +
- " ^^^\n" +
- "The method C.m() does not override the inherited method from B since it is private to a different package\n" +
+ "----------\n" +
+ "1. WARNING in p2\\B.java (at line 2)\n" +
+ " public class B extends p1.A { void m() {} }\n" +
+ " ^^^\n" +
+ "The method B.m() does not override the inherited method from A since it is private to a different package\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in p1\\C.java (at line 2)\n" +
+ " public class C extends p2.B { @Override void m() {} }\n" +
+ " ^^^\n" +
+ "The method C.m() does not override the inherited method from B since it is private to a different package\n" +
"----------\n",
Excuse.EclipseHasSomeMoreWarnings
);
@@ -10912,36 +10912,36 @@ public void test186() {
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=?
public void test187() {
String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6 )?
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " double f(List<Integer> l) {return 0;}\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method f(List<Integer>) of type Y has the same erasure as f(List<String>) of type X but does not override it\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 13)\n" +
- " int f(List<String> l) {return 0;}\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " double f(List<Integer> l) {return 0;}\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method f(List<Integer>) of type Y has the same erasure as f(List<String>) of type X but does not override it\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 13)\n" +
+ " int f(List<String> l) {return 0;}\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
"Erasure of method f(List<String>) is the same as another method in type XX\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 14)\n" +
- " double f(List<Integer> l) {return 0;}\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 14)\n" +
+ " double f(List<Integer> l) {return 0;}\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method f(List<Integer>) is the same as another method in type XX\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " double f(List<Integer> l) {return 0;}\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method f(List<Integer>) of type Y has the same erasure as f(List<String>) of type X but does not override it\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " int f(List<String> l) {return 0;}\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " double f(List<Integer> l) {return 0;}\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method f(List<Integer>) of type Y has the same erasure as f(List<String>) of type X but does not override it\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 13)\n" +
+ " int f(List<String> l) {return 0;}\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
"Erasure of method f(List<String>) is the same as another method in type XX\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 14)\n" +
- " double f(List<Integer> l) {return 0;}\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 14)\n" +
+ " double f(List<Integer> l) {return 0;}\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method f(List<Integer>) is the same as another method in type XX\n" +
"----------\n";
this.runNegativeTest(
@@ -10980,11 +10980,11 @@ public void test188() {
},
null,
null,
- "----------\n" +
- "1. WARNING in Y.java (at line 5)\n" +
- " class Z extends Y {}\n" +
- " ^\n" +
- "Y is a raw type. References to generic type Y<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in Y.java (at line 5)\n" +
+ " class Z extends Y {}\n" +
+ " ^\n" +
+ "Y is a raw type. References to generic type Y<T> should be parameterized\n" +
"----------\n",
Excuse.EclipseHasSomeMoreWarnings
);
@@ -10994,26 +10994,26 @@ public void test189() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface Interface {\n" +
- " void foo() throws CloneNotSupportedException, InterruptedException;\n" +
- "}\n" +
- "abstract class AbstractClass1 {\n" +
- " public abstract void foo() throws ClassNotFoundException, CloneNotSupportedException;\n" +
- "}\n" +
- "abstract class AbstractClass2 extends AbstractClass1 implements Interface {\n" +
- " void bar() {\n" +
- " try {\n" +
- " foo();\n" +
- " } catch (CloneNotSupportedException e) {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class X extends AbstractClass2 {\n" +
- " @Override\n" +
- " public void foo() throws CloneNotSupportedException {\n" +
- " }\n" +
- "}\n" +
+ "interface Interface {\n" +
+ " void foo() throws CloneNotSupportedException, InterruptedException;\n" +
+ "}\n" +
+ "abstract class AbstractClass1 {\n" +
+ " public abstract void foo() throws ClassNotFoundException, CloneNotSupportedException;\n" +
+ "}\n" +
+ "abstract class AbstractClass2 extends AbstractClass1 implements Interface {\n" +
+ " void bar() {\n" +
+ " try {\n" +
+ " foo();\n" +
+ " } catch (CloneNotSupportedException e) {\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class X extends AbstractClass2 {\n" +
+ " @Override\n" +
+ " public void foo() throws CloneNotSupportedException {\n" +
+ " }\n" +
+ "}\n" +
"class Y extends AbstractClass2 {\n" +
" @Override public void foo() throws ClassNotFoundException, CloneNotSupportedException {}\n" +
"}\n" +
@@ -11024,26 +11024,26 @@ public void test189() {
" @Override public void foo() throws ClassNotFoundException, CloneNotSupportedException, InterruptedException {}\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 22)\n" +
- " @Override public void foo() throws ClassNotFoundException, CloneNotSupportedException {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Exception ClassNotFoundException is not compatible with throws clause in Interface.foo()\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 25)\n" +
- " @Override public void foo() throws CloneNotSupportedException, InterruptedException {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Exception InterruptedException is not compatible with throws clause in AbstractClass1.foo()\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 28)\n" +
- " @Override public void foo() throws ClassNotFoundException, CloneNotSupportedException, InterruptedException {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Exception ClassNotFoundException is not compatible with throws clause in Interface.foo()\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 28)\n" +
- " @Override public void foo() throws ClassNotFoundException, CloneNotSupportedException, InterruptedException {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Exception InterruptedException is not compatible with throws clause in AbstractClass1.foo()\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 22)\n" +
+ " @Override public void foo() throws ClassNotFoundException, CloneNotSupportedException {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Exception ClassNotFoundException is not compatible with throws clause in Interface.foo()\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 25)\n" +
+ " @Override public void foo() throws CloneNotSupportedException, InterruptedException {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Exception InterruptedException is not compatible with throws clause in AbstractClass1.foo()\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 28)\n" +
+ " @Override public void foo() throws ClassNotFoundException, CloneNotSupportedException, InterruptedException {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Exception ClassNotFoundException is not compatible with throws clause in Interface.foo()\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 28)\n" +
+ " @Override public void foo() throws ClassNotFoundException, CloneNotSupportedException, InterruptedException {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Exception InterruptedException is not compatible with throws clause in AbstractClass1.foo()\n" +
"----------\n"
);
}
@@ -11052,32 +11052,32 @@ public void test190() {
this.runNegativeTest(
new String[] {
"p1/A.java",
- "package p1;\n" +
- "public class A {\n" +
- " void foo() {}\n" +
+ "package p1;\n" +
+ "public class A {\n" +
+ " void foo() {}\n" +
"}",
"p1/B.java",
- "package p1;\n" +
- "public class B extends p2.C {\n" +
- " @Override public int foo() { return 0; }\n" +
+ "package p1;\n" +
+ "public class B extends p2.C {\n" +
+ " @Override public int foo() { return 0; }\n" +
"}",
"p2/C.java",
- "package p2;\n" +
- "public class C extends p1.A {\n" +
- " public int foo() { return 1; }\n" +
+ "package p2;\n" +
+ "public class C extends p1.A {\n" +
+ " public int foo() { return 1; }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in p1\\B.java (at line 3)\n" +
- " @Override public int foo() { return 0; }\n" +
- " ^^^\n" +
- "The return type is incompatible with A.foo()\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in p2\\C.java (at line 3)\n" +
- " public int foo() { return 1; }\n" +
- " ^^^^^\n" +
- "The method C.foo() does not override the inherited method from A since it is private to a different package\n" +
+ "----------\n" +
+ "1. ERROR in p1\\B.java (at line 3)\n" +
+ " @Override public int foo() { return 0; }\n" +
+ " ^^^\n" +
+ "The return type is incompatible with A.foo()\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in p2\\C.java (at line 3)\n" +
+ " public int foo() { return 1; }\n" +
+ " ^^^^^\n" +
+ "The method C.foo() does not override the inherited method from A since it is private to a different package\n" +
"----------\n"
);
}
@@ -11086,26 +11086,26 @@ public void test191() {
this.runNegativeTest(
new String[] {
"p1/A.java",
- "package p1;\n" +
- "public class A {\n" +
- " static void foo() {}\n" +
+ "package p1;\n" +
+ "public class A {\n" +
+ " static void foo() {}\n" +
"}",
"p1/B.java",
- "package p1;\n" +
- "public class B extends p2.C {\n" +
- " public static int foo() { return 0; }\n" +
+ "package p1;\n" +
+ "public class B extends p2.C {\n" +
+ " public static int foo() { return 0; }\n" +
"}",
"p2/C.java",
- "package p2;\n" +
- "public class C extends p1.A {\n" +
- " public static int foo() { return 1; }\n" +
+ "package p2;\n" +
+ "public class C extends p1.A {\n" +
+ " public static int foo() { return 1; }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in p1\\B.java (at line 3)\n" +
- " public static int foo() { return 0; }\n" +
- " ^^^\n" +
- "The return type is incompatible with A.foo()\n" +
+ "----------\n" +
+ "1. ERROR in p1\\B.java (at line 3)\n" +
+ " public static int foo() { return 0; }\n" +
+ " ^^^\n" +
+ "The return type is incompatible with A.foo()\n" +
"----------\n"
);
}
@@ -11114,26 +11114,26 @@ public void test192() {
this.runNegativeTest(
new String[] {
"p1/A.java",
- "package p1;\n" +
- "public class A {\n" +
- " void foo() {}\n" +
+ "package p1;\n" +
+ "public class A {\n" +
+ " void foo() {}\n" +
"}",
"p1/B.java",
- "package p1;\n" +
- "public class B extends p2.C {\n" +
- " public static int foo() { return 0; }\n" +
+ "package p1;\n" +
+ "public class B extends p2.C {\n" +
+ " public static int foo() { return 0; }\n" +
"}",
"p2/C.java",
- "package p2;\n" +
- "public class C extends p1.A {\n" +
- " public static int foo() { return 1; }\n" +
+ "package p2;\n" +
+ "public class C extends p1.A {\n" +
+ " public static int foo() { return 1; }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in p1\\B.java (at line 3)\n" +
- " public static int foo() { return 0; }\n" +
- " ^^^^^\n" +
- "This static method cannot hide the instance method from A\n" +
+ "----------\n" +
+ "1. ERROR in p1\\B.java (at line 3)\n" +
+ " public static int foo() { return 0; }\n" +
+ " ^^^^^\n" +
+ "This static method cannot hide the instance method from A\n" +
"----------\n"
);
}
@@ -11142,31 +11142,31 @@ public void test193() {
this.runNegativeTest(
new String[] {
"p1/A.java",
- "package p1;\n" +
- "public class A {\n" +
- " void foo() {}\n" +
+ "package p1;\n" +
+ "public class A {\n" +
+ " void foo() {}\n" +
"}",
"p1/B.java",
- "package p1;\n" +
- "public class B extends p2.C {\n" +
- " @Override public int foo() { return 0; }\n" +
+ "package p1;\n" +
+ "public class B extends p2.C {\n" +
+ " @Override public int foo() { return 0; }\n" +
"}",
"p2/C.java",
- "package p2;\n" +
- "public class C extends p1.A {\n" +
- " public static int foo() { return 1; }\n" +
+ "package p2;\n" +
+ "public class C extends p1.A {\n" +
+ " public static int foo() { return 1; }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in p1\\B.java (at line 3)\n" +
- " @Override public int foo() { return 0; }\n" +
- " ^^^\n" +
- "The return type is incompatible with A.foo()\n" +
- "----------\n" +
- "2. ERROR in p1\\B.java (at line 3)\n" +
- " @Override public int foo() { return 0; }\n" +
- " ^^^^^\n" +
- "This instance method cannot override the static method from C\n" +
+ "----------\n" +
+ "1. ERROR in p1\\B.java (at line 3)\n" +
+ " @Override public int foo() { return 0; }\n" +
+ " ^^^\n" +
+ "The return type is incompatible with A.foo()\n" +
+ "----------\n" +
+ "2. ERROR in p1\\B.java (at line 3)\n" +
+ " @Override public int foo() { return 0; }\n" +
+ " ^^^^^\n" +
+ "This instance method cannot override the static method from C\n" +
"----------\n"
);
}
@@ -11175,31 +11175,31 @@ public void test194() {
this.runNegativeTest(
new String[] {
"p1/A.java",
- "package p1;\n" +
- "public class A {\n" +
- " static void foo() {}\n" +
+ "package p1;\n" +
+ "public class A {\n" +
+ " static void foo() {}\n" +
"}",
"p1/B.java",
- "package p1;\n" +
- "public class B extends p2.C {\n" +
- " public int foo() { return 0; }\n" +
+ "package p1;\n" +
+ "public class B extends p2.C {\n" +
+ " public int foo() { return 0; }\n" +
"}",
"p2/C.java",
- "package p2;\n" +
- "public class C extends p1.A {\n" +
- " public static int foo() { return 1; }\n" +
+ "package p2;\n" +
+ "public class C extends p1.A {\n" +
+ " public static int foo() { return 1; }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in p1\\B.java (at line 3)\n" +
- " public int foo() { return 0; }\n" +
- " ^^^^^\n" +
- "This instance method cannot override the static method from A\n" +
- "----------\n" +
- "2. ERROR in p1\\B.java (at line 3)\n" +
- " public int foo() { return 0; }\n" +
- " ^^^^^\n" +
- "This instance method cannot override the static method from C\n" +
+ "----------\n" +
+ "1. ERROR in p1\\B.java (at line 3)\n" +
+ " public int foo() { return 0; }\n" +
+ " ^^^^^\n" +
+ "This instance method cannot override the static method from A\n" +
+ "----------\n" +
+ "2. ERROR in p1\\B.java (at line 3)\n" +
+ " public int foo() { return 0; }\n" +
+ " ^^^^^\n" +
+ "This instance method cannot override the static method from C\n" +
"----------\n"
);
}
@@ -11208,26 +11208,26 @@ public void test195() {
this.runNegativeTest(
new String[] {
"p1/A.java",
- "package p1;\n" +
- "public class A {\n" +
- " static void foo() {}\n" +
+ "package p1;\n" +
+ "public class A {\n" +
+ " static void foo() {}\n" +
"}",
"p1/B.java",
- "package p1;\n" +
- "public class B extends p2.C {\n" +
- " @Override public int foo() { return 0; }\n" +
+ "package p1;\n" +
+ "public class B extends p2.C {\n" +
+ " @Override public int foo() { return 0; }\n" +
"}",
"p2/C.java",
- "package p2;\n" +
- "public class C extends p1.A {\n" +
- " public int foo() { return 1; }\n" +
+ "package p2;\n" +
+ "public class C extends p1.A {\n" +
+ " public int foo() { return 1; }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in p1\\B.java (at line 3)\n" +
- " @Override public int foo() { return 0; }\n" +
- " ^^^^^\n" +
- "This instance method cannot override the static method from A\n" +
+ "----------\n" +
+ "1. ERROR in p1\\B.java (at line 3)\n" +
+ " @Override public int foo() { return 0; }\n" +
+ " ^^^^^\n" +
+ "This instance method cannot override the static method from A\n" +
"----------\n"
);
}
@@ -11236,31 +11236,31 @@ public void test196() {
this.runNegativeTest(
new String[] {
"p1/A.java",
- "package p1;\n" +
- "public class A {\n" +
- " static void foo() {}\n" +
+ "package p1;\n" +
+ "public class A {\n" +
+ " static void foo() {}\n" +
"}",
"p1/B.java",
- "package p1;\n" +
- "public class B extends p2.C {\n" +
- " public static int foo() { return 0; }\n" +
+ "package p1;\n" +
+ "public class B extends p2.C {\n" +
+ " public static int foo() { return 0; }\n" +
"}",
"p2/C.java",
- "package p2;\n" +
- "public class C extends p1.A {\n" +
- " public int foo() { return 1; }\n" +
+ "package p2;\n" +
+ "public class C extends p1.A {\n" +
+ " public int foo() { return 1; }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in p1\\B.java (at line 3)\n" +
- " public static int foo() { return 0; }\n" +
- " ^^^\n" +
- "The return type is incompatible with A.foo()\n" +
- "----------\n" +
- "2. ERROR in p1\\B.java (at line 3)\n" +
- " public static int foo() { return 0; }\n" +
- " ^^^^^\n" +
- "This static method cannot hide the instance method from C\n" +
+ "----------\n" +
+ "1. ERROR in p1\\B.java (at line 3)\n" +
+ " public static int foo() { return 0; }\n" +
+ " ^^^\n" +
+ "The return type is incompatible with A.foo()\n" +
+ "----------\n" +
+ "2. ERROR in p1\\B.java (at line 3)\n" +
+ " public static int foo() { return 0; }\n" +
+ " ^^^^^\n" +
+ "This static method cannot hide the instance method from C\n" +
"----------\n"
);
}
@@ -11269,37 +11269,37 @@ public void test197() {
this.runNegativeTest(
new String[] {
"p1/A.java",
- "package p1;\n" +
- "public class A {\n" +
- " void foo() {}\n" +
+ "package p1;\n" +
+ "public class A {\n" +
+ " void foo() {}\n" +
"}",
"p1/B.java",
- "package p1;\n" +
- "public class B extends p2.C {\n" +
- " public static int foo() { return 0; }\n" +
+ "package p1;\n" +
+ "public class B extends p2.C {\n" +
+ " public static int foo() { return 0; }\n" +
"}",
"p2/C.java",
- "package p2;\n" +
- "public class C extends p1.A {\n" +
- " public int foo() { return 1; }\n" +
+ "package p2;\n" +
+ "public class C extends p1.A {\n" +
+ " public int foo() { return 1; }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in p1\\B.java (at line 3)\n" +
- " public static int foo() { return 0; }\n" +
- " ^^^^^\n" +
- "This static method cannot hide the instance method from A\n" +
- "----------\n" +
- "2. ERROR in p1\\B.java (at line 3)\n" +
- " public static int foo() { return 0; }\n" +
- " ^^^^^\n" +
- "This static method cannot hide the instance method from C\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in p2\\C.java (at line 3)\n" +
- " public int foo() { return 1; }\n" +
- " ^^^^^\n" +
- "The method C.foo() does not override the inherited method from A since it is private to a different package\n" +
+ "----------\n" +
+ "1. ERROR in p1\\B.java (at line 3)\n" +
+ " public static int foo() { return 0; }\n" +
+ " ^^^^^\n" +
+ "This static method cannot hide the instance method from A\n" +
+ "----------\n" +
+ "2. ERROR in p1\\B.java (at line 3)\n" +
+ " public static int foo() { return 0; }\n" +
+ " ^^^^^\n" +
+ "This static method cannot hide the instance method from C\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in p2\\C.java (at line 3)\n" +
+ " public int foo() { return 1; }\n" +
+ " ^^^^^\n" +
+ "The method C.foo() does not override the inherited method from A since it is private to a different package\n" +
"----------\n"
);
}
@@ -11310,50 +11310,50 @@ public void test198() {
this.runConformTest(
new String[] {
"MyAnnotation.java",
- "@interface MyAnnotation {\n" +
- " MyEnum value();\n" +
+ "@interface MyAnnotation {\n" +
+ " MyEnum value();\n" +
"}",
"MyClass.java",
- "public class MyClass implements MyInterface {\n" +
- " @Override public void foo() {}\n" +
+ "public class MyClass implements MyInterface {\n" +
+ " @Override public void foo() {}\n" +
"}",
"MyEnum.java",
- "enum MyEnum implements Runnable {\n" +
- " G {\n" +
- " @Override public void methodA() {\n" +
- " new Runnable() {\n" +
- " @Override public void run() {}\n" +
- " };\n" +
- " }\n" +
- " },\n" +
- " D {\n" +
- " @Override public void methodA() {}\n" +
- " },\n" +
- " A {\n" +
- " @Override public void methodA() {}\n" +
- " @Override public void methodB() {}\n" +
- " },\n" +
- " B {\n" +
- " @Override public void methodA() {}\n" +
- " },\n" +
- " C {\n" +
- " @Override public void methodA() {}\n" +
- " @Override public void methodB() {}\n" +
- " },\n" +
- " E {\n" +
- " @Override public void methodA() {}\n" +
- " },\n" +
- " F {\n" +
- " @Override public void methodA() {}\n" +
- " };\n" +
- " private MyEnum() {}\n" +
- " public void methodA() {}\n" +
- " public void methodB() {}\n" +
- " @Override public void run() {}\n" +
+ "enum MyEnum implements Runnable {\n" +
+ " G {\n" +
+ " @Override public void methodA() {\n" +
+ " new Runnable() {\n" +
+ " @Override public void run() {}\n" +
+ " };\n" +
+ " }\n" +
+ " },\n" +
+ " D {\n" +
+ " @Override public void methodA() {}\n" +
+ " },\n" +
+ " A {\n" +
+ " @Override public void methodA() {}\n" +
+ " @Override public void methodB() {}\n" +
+ " },\n" +
+ " B {\n" +
+ " @Override public void methodA() {}\n" +
+ " },\n" +
+ " C {\n" +
+ " @Override public void methodA() {}\n" +
+ " @Override public void methodB() {}\n" +
+ " },\n" +
+ " E {\n" +
+ " @Override public void methodA() {}\n" +
+ " },\n" +
+ " F {\n" +
+ " @Override public void methodA() {}\n" +
+ " };\n" +
+ " private MyEnum() {}\n" +
+ " public void methodA() {}\n" +
+ " public void methodB() {}\n" +
+ " @Override public void run() {}\n" +
"}",
"MyInterface.java",
- "interface MyInterface {\n" +
- " @MyAnnotation(MyEnum.D) public void foo();\n" +
+ "interface MyInterface {\n" +
+ " @MyAnnotation(MyEnum.D) public void foo();\n" +
"}"
},
""
@@ -11364,9 +11364,9 @@ public void test199() {
this.runConformTest(
new String[] {
"Bar.java",
- "public interface Bar {\n" +
- " void addError(String message, Object... arguments);\n" +
- " void addError(Throwable t);\n" +
+ "public interface Bar {\n" +
+ " void addError(String message, Object... arguments);\n" +
+ " void addError(Throwable t);\n" +
"}",
},
""
@@ -11375,10 +11375,10 @@ public void test199() {
false,
new String[] {
"Foo.java",
- "public class Foo {\n" +
- " void bar(Bar bar) {\n" +
- " bar.addError(\"g\");\n" +
- " }\n" +
+ "public class Foo {\n" +
+ " void bar(Bar bar) {\n" +
+ " bar.addError(\"g\");\n" +
+ " }\n" +
"}"
},
"",
@@ -11390,20 +11390,20 @@ public void test199() {
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=285088
public void test200() {
String errorMessage =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " int foo(Collection bar) { return 0; }\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " int foo(Collection bar) { return 0; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method foo(Collection) is the same as another method in type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " int foo(Collection bar) { return 0; }\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " double foo(Collection<String> bar) {return 0; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " int foo(Collection bar) { return 0; }\n" +
+ " ^^^^^^^^^^\n" +
+ "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " double foo(Collection<String> bar) {return 0; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method foo(Collection<String>) is the same as another method in type X\n" +
"----------\n";
this.runNegativeTest(
@@ -11484,7 +11484,7 @@ public void test204() {
new String[] {
"OverrideBug.java",
"import java.util.List;\n" +
- "interface Map<K, V> {\n" +
+ "interface Map<K, V> {\n" +
" public V put(K key, V value);\n" +
"}\n" +
"public class OverrideBug<K, V> implements Map<K, List<V>> {\n" +
@@ -11505,7 +11505,7 @@ public void test204a() {
new String[] {
"OverrideBug.java",
"import java.util.List;\n" +
- "interface Map<K, V> {\n" +
+ "interface Map<K, V> {\n" +
" public V put(K key, V value);\n" +
"}\n" +
"public class OverrideBug<K, V> implements Map<K, List<V>> {\n" +
@@ -11517,11 +11517,11 @@ public void test204a() {
"}\n" +
"}"
},
- "----------\n" +
- "1. ERROR in OverrideBug.java (at line 9)\n" +
- " public V put(final K arg0, final V arg1) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method put(K, V) of type OverrideBug<K,V> has the same erasure as put(K, V) of type Map<K,V> but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in OverrideBug.java (at line 9)\n" +
+ " public V put(final K arg0, final V arg1) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method put(K, V) of type OverrideBug<K,V> has the same erasure as put(K, V) of type Map<K,V> but does not override it\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=298362
@@ -11628,32 +11628,32 @@ public void test208() {
this.runConformTest(
new String[] {
"Test.java",
- "import java.lang.annotation.Annotation;\n"+
- "import java.lang.annotation.Retention;\n"+
- "import java.lang.annotation.RetentionPolicy;\n"+
- "import java.lang.reflect.Method;\n"+
- "\n"+
- "public class Test extends Super {\n"+
- " public static void main(String[] args) {\n"+
- " try {\n"+
+ "import java.lang.annotation.Annotation;\n"+
+ "import java.lang.annotation.Retention;\n"+
+ "import java.lang.annotation.RetentionPolicy;\n"+
+ "import java.lang.reflect.Method;\n"+
+ "\n"+
+ "public class Test extends Super {\n"+
+ " public static void main(String[] args) {\n"+
+ " try {\n"+
" Method m = Test.class.getMethod(\"setFoo\", String.class);\n"+
- " Annotation a = m.getAnnotation(Anno.class);\n"+
- " System.out.println(\"Annotation was \" + (a == null ? \"not \" : \"\") +\n"+
- "\"found\");\n"+
- " } catch (Exception e) {\n"+
- " e.printStackTrace();\n"+
- " }\n"+
- " }\n"+
- "}\n"+
- "\n"+
- "class Super {\n"+
- " @Anno\n"+
- " public void setFoo(String foo) {}\n"+
- "}\n"+
- "\n"+
- "@Retention(RetentionPolicy.RUNTIME)\n"+
- "@interface Anno {\n"+
- "\n"+
+ " Annotation a = m.getAnnotation(Anno.class);\n"+
+ " System.out.println(\"Annotation was \" + (a == null ? \"not \" : \"\") +\n"+
+ "\"found\");\n"+
+ " } catch (Exception e) {\n"+
+ " e.printStackTrace();\n"+
+ " }\n"+
+ " }\n"+
+ "}\n"+
+ "\n"+
+ "class Super {\n"+
+ " @Anno\n"+
+ " public void setFoo(String foo) {}\n"+
+ "}\n"+
+ "\n"+
+ "@Retention(RetentionPolicy.RUNTIME)\n"+
+ "@interface Anno {\n"+
+ "\n"+
"}\n"
},
"Annotation was found");
@@ -11665,33 +11665,33 @@ public void test208a() {
this.runConformTest(
new String[] {
"Test.java",
- "import java.lang.annotation.Annotation;\n"+
- "import java.lang.annotation.Retention;\n"+
- "import java.lang.annotation.RetentionPolicy;\n"+
- "import java.lang.reflect.Method;\n"+
- "\n"+
+ "import java.lang.annotation.Annotation;\n"+
+ "import java.lang.annotation.Retention;\n"+
+ "import java.lang.annotation.RetentionPolicy;\n"+
+ "import java.lang.reflect.Method;\n"+
+ "\n"+
"public class Test extends Super {\n"+
" public void setFoo() {}\n" +
- " public static void main(String[] args) {\n"+
- " try {\n"+
+ " public static void main(String[] args) {\n"+
+ " try {\n"+
" Method m = Test.class.getMethod(\"setFoo\", String.class);\n"+
- " Annotation a = m.getAnnotation(Anno.class);\n"+
- " System.out.println(\"Annotation was \" + (a == null ? \"not \" : \"\") +\n"+
- "\"found\");\n"+
- " } catch (Exception e) {\n"+
- " e.printStackTrace();\n"+
- " }\n"+
- " }\n"+
- "}\n"+
- "\n"+
- "class Super {\n"+
- " @Anno\n"+
- " public void setFoo(String foo) {}\n"+
- "}\n"+
- "\n"+
- "@Retention(RetentionPolicy.RUNTIME)\n"+
- "@interface Anno {\n"+
- "\n"+
+ " Annotation a = m.getAnnotation(Anno.class);\n"+
+ " System.out.println(\"Annotation was \" + (a == null ? \"not \" : \"\") +\n"+
+ "\"found\");\n"+
+ " } catch (Exception e) {\n"+
+ " e.printStackTrace();\n"+
+ " }\n"+
+ " }\n"+
+ "}\n"+
+ "\n"+
+ "class Super {\n"+
+ " @Anno\n"+
+ " public void setFoo(String foo) {}\n"+
+ "}\n"+
+ "\n"+
+ "@Retention(RetentionPolicy.RUNTIME)\n"+
+ "@interface Anno {\n"+
+ "\n"+
"}\n"
},
"Annotation was found");
@@ -11721,11 +11721,11 @@ public void test209() {
"}\n"
},
- "----------\n" +
- "1. ERROR in Concrete.java (at line 1)\n" +
- " class Bar extends Zork {}\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in Concrete.java (at line 1)\n" +
+ " class Bar extends Zork {}\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=321548
@@ -11746,11 +11746,11 @@ public void test210() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in ErasureTest.java (at line 7)\n" +
- " public class ErasureTest extends Zork implements Interface1<String>, Interface2<Double> {\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in ErasureTest.java (at line 7)\n" +
+ " public class ErasureTest extends Zork implements Interface1<String>, Interface2<Double> {\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=83162
@@ -11775,11 +11775,11 @@ public void test211() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in SomeClass.java (at line 9)\n" +
- " public class SomeClass implements Equivalent<String>, EqualityComparable<Integer> {\n" +
- " ^^^^^^^^^\n" +
- "Name clash: The method equalTo(T) of type EqualityComparable<T> has the same erasure as equalTo(T) of type Equivalent<T> but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in SomeClass.java (at line 9)\n" +
+ " public class SomeClass implements Equivalent<String>, EqualityComparable<Integer> {\n" +
+ " ^^^^^^^^^\n" +
+ "Name clash: The method equalTo(T) of type EqualityComparable<T> has the same erasure as equalTo(T) of type Equivalent<T> but does not override it\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=323693
@@ -11801,14 +11801,14 @@ public void test212() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Derived.java (at line 9)\n" +
- " public class Derived extends Base<String> implements Interface<Integer> {\n" +
- " ^^^^^^^\n" +
- "Name clash: The method foo(T) of type Interface<T> has the same erasure as foo(T) of type Base<T> but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in Derived.java (at line 9)\n" +
+ " public class Derived extends Base<String> implements Interface<Integer> {\n" +
+ " ^^^^^^^\n" +
+ "Name clash: The method foo(T) of type Interface<T> has the same erasure as foo(T) of type Base<T> but does not override it\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=324850
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=324850
public void test213() {
Map compilerOptions15 = getCompilerOptions();
compilerOptions15.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
@@ -11817,17 +11817,17 @@ public void test213() {
this.runConformTest(
new String[] {
"Y.java",
- "public abstract class Y implements I<Y> {\n" +
- " public final Y foo(Object o, J<Y> j) {\n" +
- " return null;\n" +
- " }\n" +
- " public final void bar(Object o, J<Y> j, Y y) {\n" +
- " }\n" +
+ "public abstract class Y implements I<Y> {\n" +
+ " public final Y foo(Object o, J<Y> j) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public final void bar(Object o, J<Y> j, Y y) {\n" +
+ " }\n" +
"}",
"I.java",
- "public interface I<S> {\n" +
- " public S foo(Object o, J<S> j);\n" +
- " public void bar(Object o, J<S> j, S s);\n" +
+ "public interface I<S> {\n" +
+ " public S foo(Object o, J<S> j);\n" +
+ " public void bar(Object o, J<S> j, S s);\n" +
"}",
"J.java",
"public interface J<S> {}"
@@ -11838,7 +11838,7 @@ public void test213() {
null,
compilerOptions15,
null);
-
+
Map compilerOptions14 = getCompilerOptions();
compilerOptions14.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_2);
compilerOptions14.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4);
@@ -11846,10 +11846,10 @@ public void test213() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public Object foo() {\n" +
- " return new Y() {};\n" +
- " }\n" +
+ "public class X {\n" +
+ " public Object foo() {\n" +
+ " return new Y() {};\n" +
+ " }\n" +
"}"
},
"",
@@ -11859,7 +11859,7 @@ public void test213() {
compilerOptions14,
null);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=324850
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=324850
public void test213a() {
Map compilerOptions15 = getCompilerOptions();
compilerOptions15.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
@@ -11868,17 +11868,17 @@ public void test213a() {
this.runConformTest(
new String[] {
"Y.java",
- "public abstract class Y implements I<Y> {\n" +
- " public final Y foo(Object o, J<Y, I<Y>> j) {\n" +
- " return null;\n" +
- " }\n" +
- " public final void bar(Object o, J<Y, String> j, Y y) {\n" +
- " }\n" +
+ "public abstract class Y implements I<Y> {\n" +
+ " public final Y foo(Object o, J<Y, I<Y>> j) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public final void bar(Object o, J<Y, String> j, Y y) {\n" +
+ " }\n" +
"}",
"I.java",
- "public interface I<S> {\n" +
- " public S foo(Object o, J<S, I<S>> j);\n" +
- " public void bar(Object o, J<S, String> j, S s);\n" +
+ "public interface I<S> {\n" +
+ " public S foo(Object o, J<S, I<S>> j);\n" +
+ " public void bar(Object o, J<S, String> j, S s);\n" +
"}",
"J.java",
"public interface J<S, T> {}"
@@ -11889,7 +11889,7 @@ public void test213a() {
null,
compilerOptions15,
null);
-
+
Map compilerOptions14 = getCompilerOptions();
compilerOptions14.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_2);
compilerOptions14.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4);
@@ -11897,10 +11897,10 @@ public void test213a() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public Object foo() {\n" +
- " return new Y() {};\n" +
- " }\n" +
+ "public class X {\n" +
+ " public Object foo() {\n" +
+ " return new Y() {};\n" +
+ " }\n" +
"}"
},
"",
@@ -12047,7 +12047,7 @@ public void test326354() {
""
);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=328827
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=328827
public void test328827() {
Map compilerOptions15 = getCompilerOptions();
compilerOptions15.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
@@ -12057,10 +12057,10 @@ public void test328827() {
new String[] {
"Map.java",
"public interface Map<K,V> {}\n",
-
+
"EventProperties.java",
"public class EventProperties implements Map<String, Object> {}\n",
-
+
"Event.java",
"public class Event {\n" +
" public Event(Map<String, ?> properties) {}\n" +
@@ -12072,7 +12072,7 @@ public void test328827() {
null,
compilerOptions15,
null);
-
+
Map compilerOptions14 = getCompilerOptions();
compilerOptions14.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_2);
compilerOptions14.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4);
@@ -12081,11 +12081,11 @@ public void test328827() {
new String[] {
"Map.java",
"public interface Map {}\n",
-
+
"X.java",
"public class X {\n" +
" public void start() {\n" +
- " Event event = new Event(new EventProperties());\n" +
+ " Event event = new Event(new EventProperties());\n" +
" }\n" +
"}"
},
@@ -12096,7 +12096,7 @@ public void test328827() {
compilerOptions14,
null);
}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=329584
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=329584
public void test329584() {
Map compilerOptions15 = getCompilerOptions();
compilerOptions15.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, CompilerOptions.VERSION_1_5);
@@ -12117,7 +12117,7 @@ public void test329584() {
null,
compilerOptions15,
null);
-
+
Map compilerOptions14 = getCompilerOptions();
compilerOptions14.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_2);
compilerOptions14.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4);
@@ -12138,7 +12138,7 @@ public void test329584() {
compilerOptions14,
null);
}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=329588
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=329588
public void test329588() {
Map compilerOptions15 = getCompilerOptions();
compilerOptions15.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, CompilerOptions.VERSION_1_5);
@@ -12161,7 +12161,7 @@ public void test329588() {
null,
compilerOptions15,
null);
-
+
Map compilerOptions14 = getCompilerOptions();
compilerOptions14.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_2);
compilerOptions14.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4);
@@ -12172,8 +12172,8 @@ public void test329588() {
"X.java",
"public class X {\n" +
" public void foo(A a) {\n" +
- " O o = (O) a.foo();\n" +
- " System.out.println(o);\n" +
+ " O o = (O) a.foo();\n" +
+ " System.out.println(o);\n" +
" }\n" +
"}",
"O.java",
@@ -12186,7 +12186,7 @@ public void test329588() {
compilerOptions14,
null);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=330445
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=330445
public void test330445() {
Map compilerOptions15 = getCompilerOptions();
compilerOptions15.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, CompilerOptions.VERSION_1_5);
@@ -12195,10 +12195,10 @@ public void test330445() {
this.runConformTest(
new String[] {
"Y.java",
- "import java.util.Map;\n" +
- "public class Y {\n" +
- " static void foo(Map<String, String> map) {\n" +
- " }\n" +
+ "import java.util.Map;\n" +
+ "public class Y {\n" +
+ " static void foo(Map<String, String> map) {\n" +
+ " }\n" +
"}",
},
"",
@@ -12207,7 +12207,7 @@ public void test330445() {
null,
compilerOptions15,
null);
-
+
Map compilerOptions14 = getCompilerOptions();
compilerOptions14.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_2);
compilerOptions14.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4);
@@ -12216,11 +12216,11 @@ public void test330445() {
this.runConformTest(
new String[] {
"X.java",
- "import java.util.Properties;\n" +
- "public class X {\n" +
- " static void bar(Object[] args) {\n" +
- " Y.foo(new Properties());\n" +
- " }\n" +
+ "import java.util.Properties;\n" +
+ "public class X {\n" +
+ " static void bar(Object[] args) {\n" +
+ " Y.foo(new Properties());\n" +
+ " }\n" +
"}",
},
"",
@@ -12230,7 +12230,7 @@ public void test330445() {
compilerOptions14,
null);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=330435
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=330435
public void test330435() {
Map compilerOptions15 = getCompilerOptions();
compilerOptions15.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, CompilerOptions.VERSION_1_5);
@@ -12240,13 +12240,13 @@ public void test330435() {
new String[] {
"A.java",
"public class A {\n" +
- " public static <T> B<T> asList(T... tab) {\n" +
- " return null;\n" +
+ " public static <T> B<T> asList(T... tab) {\n" +
+ " return null;\n" +
" }\n" +
"}",
"B.java",
"public interface B<V> {\n" +
- " <T> T[] toArray(T[] tab);\n" +
+ " <T> T[] toArray(T[] tab);\n" +
"}\n",
},
"",
@@ -12255,7 +12255,7 @@ public void test330435() {
null,
compilerOptions15,
null);
-
+
Map compilerOptions14 = getCompilerOptions();
compilerOptions14.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_2);
compilerOptions14.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4);
@@ -12264,24 +12264,24 @@ public void test330435() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " String[] foo(Object[] args) {\n" +
- " String[] a = A.asList(args).toArray(new String[0]);\n" +
- " return a;\n" +
- " }\n" +
+ "public class X {\n" +
+ " String[] foo(Object[] args) {\n" +
+ " String[] a = A.asList(args).toArray(new String[0]);\n" +
+ " return a;\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " String[] a = A.asList(args).toArray(new String[0]);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Object[] to String[]\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " String[] a = A.asList(args).toArray(new String[0]);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Object[] to String[]\n" +
"----------\n",
null,
false,
compilerOptions14);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=330264
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=330264
public void test330264() {
Map compilerOptions15 = getCompilerOptions();
compilerOptions15.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, CompilerOptions.VERSION_1_5);
@@ -12302,7 +12302,7 @@ public void test330264() {
null,
compilerOptions15,
null);
-
+
Map compilerOptions14 = getCompilerOptions();
compilerOptions14.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_2);
compilerOptions14.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4);
@@ -12317,11 +12317,11 @@ public void test330264() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in Activator.java (at line 3)\n" +
- " Runnable r = context.getService(ref);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Object to Runnable\n" +
+ "----------\n" +
+ "1. ERROR in Activator.java (at line 3)\n" +
+ " Runnable r = context.getService(ref);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Object to Runnable\n" +
"----------\n",
null,
false,
@@ -12336,27 +12336,27 @@ public void test331446() {
this.runConformTest(
new String[] {
"Test.java",
- "import java.util.Comparator;\n" +
- "import java.util.List;\n" +
- "\n" +
- "public class Test {\n" +
- " public static <T> void assertEquals(String message,\n" +
- " Comparator<T> comparator, List<T> expected, List<T> actual) {\n" +
- " if (expected.size() != actual.size()) {\n" +
- " //failNotEquals(message, expected, actual);\n" +
- " }\n" +
- " for (int i = 0, l = expected.size(); i < l; i++) {\n" +
- " assertEquals(message, comparator, expected.get(i), actual.get(i));\n" +
- " }\n" +
- " }\n" +
- " public static <T> void assertEquals(String message,\n" +
- " Comparator<T> comparator, T expected, T actual) {\n" +
- " if (comparator.compare(expected, actual) == 0) {\n" +
- " return;\n" +
- " }\n" +
- " //failNotEquals(message, expected, actual);\n" +
- " }\n" +
- "}\n" +
+ "import java.util.Comparator;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " public static <T> void assertEquals(String message,\n" +
+ " Comparator<T> comparator, List<T> expected, List<T> actual) {\n" +
+ " if (expected.size() != actual.size()) {\n" +
+ " //failNotEquals(message, expected, actual);\n" +
+ " }\n" +
+ " for (int i = 0, l = expected.size(); i < l; i++) {\n" +
+ " assertEquals(message, comparator, expected.get(i), actual.get(i));\n" +
+ " }\n" +
+ " }\n" +
+ " public static <T> void assertEquals(String message,\n" +
+ " Comparator<T> comparator, T expected, T actual) {\n" +
+ " if (comparator.compare(expected, actual) == 0) {\n" +
+ " return;\n" +
+ " }\n" +
+ " //failNotEquals(message, expected, actual);\n" +
+ " }\n" +
+ "}\n" +
""
},
"",
@@ -12374,20 +12374,20 @@ public void test331446() {
this.runConformTest(
new String[] {
"X.java",
- "import java.util.ArrayList;\n" +
- "import java.util.Comparator;\n" +
- "\n" +
- "public class X {\n" +
- " public static void testAmbiguity() {\n" +
- " Comparator comparator = new Comparator() {\n" +
- " \n" +
- " public int compare(Object o1, Object o2) {\n" +
- " return 0;\n" +
- " }\n" +
- " };\n" +
- " Test.assertEquals(\"Test\", comparator, new ArrayList(), new ArrayList());\n" +
- " }\n" +
- "}\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.Comparator;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void testAmbiguity() {\n" +
+ " Comparator comparator = new Comparator() {\n" +
+ " \n" +
+ " public int compare(Object o1, Object o2) {\n" +
+ " return 0;\n" +
+ " }\n" +
+ " };\n" +
+ " Test.assertEquals(\"Test\", comparator, new ArrayList(), new ArrayList());\n" +
+ " }\n" +
+ "}\n" +
"",
},
"",
@@ -12406,27 +12406,27 @@ public void test331446a() {
this.runConformTest(
new String[] {
"Test.java",
- "import java.util.Comparator;\n" +
- "import java.util.List;\n" +
- "\n" +
- "public class Test {\n" +
- " public static void assertEquals(String message,\n" +
- " Comparator comparator, List expected, List actual) {\n" +
- " if (expected.size() != actual.size()) {\n" +
- " //failNotEquals(message, expected, actual);\n" +
- " }\n" +
- " for (int i = 0, l = expected.size(); i < l; i++) {\n" +
- " assertEquals(message, comparator, expected.get(i), actual.get(i));\n" +
- " }\n" +
- " }\n" +
- " public static void assertEquals(String message,\n" +
- " Comparator comparator, Object expected, Object actual) {\n" +
- " if (comparator.compare(expected, actual) == 0) {\n" +
- " return;\n" +
- " }\n" +
- " //failNotEquals(message, expected, actual);\n" +
- " }\n" +
- "}\n" +
+ "import java.util.Comparator;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " public static void assertEquals(String message,\n" +
+ " Comparator comparator, List expected, List actual) {\n" +
+ " if (expected.size() != actual.size()) {\n" +
+ " //failNotEquals(message, expected, actual);\n" +
+ " }\n" +
+ " for (int i = 0, l = expected.size(); i < l; i++) {\n" +
+ " assertEquals(message, comparator, expected.get(i), actual.get(i));\n" +
+ " }\n" +
+ " }\n" +
+ " public static void assertEquals(String message,\n" +
+ " Comparator comparator, Object expected, Object actual) {\n" +
+ " if (comparator.compare(expected, actual) == 0) {\n" +
+ " return;\n" +
+ " }\n" +
+ " //failNotEquals(message, expected, actual);\n" +
+ " }\n" +
+ "}\n" +
""
},
"",
@@ -12444,20 +12444,20 @@ public void test331446a() {
this.runConformTest(
new String[] {
"X.java",
- "import java.util.ArrayList;\n" +
- "import java.util.Comparator;\n" +
- "\n" +
- "public class X {\n" +
- " public static void testAmbiguity() {\n" +
- " Comparator comparator = new Comparator() {\n" +
- " \n" +
- " public int compare(Object o1, Object o2) {\n" +
- " return 0;\n" +
- " }\n" +
- " };\n" +
- " Test.assertEquals(\"Test\", comparator, new ArrayList(), new ArrayList());\n" +
- " }\n" +
- "}\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.Comparator;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void testAmbiguity() {\n" +
+ " Comparator comparator = new Comparator() {\n" +
+ " \n" +
+ " public int compare(Object o1, Object o2) {\n" +
+ " return 0;\n" +
+ " }\n" +
+ " };\n" +
+ " Test.assertEquals(\"Test\", comparator, new ArrayList(), new ArrayList());\n" +
+ " }\n" +
+ "}\n" +
"",
},
"",
@@ -12618,15 +12618,15 @@ public void test1415Mix() {
"public class Concrete extends Abstract {\n" +
"}",
},
- "----------\n" +
- "1. ERROR in Concrete.java (at line 1)\n" +
- " public class Concrete extends Abstract {\n" +
- " ^^^^^^^^\n" +
- "The type Concrete must implement the inherited abstract method Generic<String>.foo(String)\n" +
+ "----------\n" +
+ "1. ERROR in Concrete.java (at line 1)\n" +
+ " public class Concrete extends Abstract {\n" +
+ " ^^^^^^^^\n" +
+ "The type Concrete must implement the inherited abstract method Generic<String>.foo(String)\n" +
"----------\n",
null,
false,
- compilerOptions14);
+ compilerOptions14);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=331446
public void test1415Mix2() {
@@ -12767,10 +12767,10 @@ public void test339447() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X implements Cloneable {\n" +
- " public synchronized X clone() {\n" +
- " return this;\n" +
- " }\n" +
+ "public class X implements Cloneable {\n" +
+ " public synchronized X clone() {\n" +
+ " return this;\n" +
+ " }\n" +
"}", // =================
},
"");
@@ -12810,11 +12810,11 @@ public void test322740() throws Exception {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " public class X extends Base implements EqualityComparable<String> {\n" +
- " ^\n" +
- "Name clash: The method equalTo(T) of type EqualityComparable<T> has the same erasure as equalTo(Object) of type Base but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " public class X extends Base implements EqualityComparable<String> {\n" +
+ " ^\n" +
+ "Name clash: The method equalTo(T) of type EqualityComparable<T> has the same erasure as equalTo(Object) of type Base but does not override it\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=334306
@@ -12830,11 +12830,11 @@ public void test334306() throws Exception {
" void foo(X<Integer> p);\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " void foo(X<Integer> p);\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(X<Integer>) of type J has the same erasure as foo(X<Number>) of type I but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " void foo(X<Integer> p);\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method foo(X<Integer>) of type J has the same erasure as foo(X<Number>) of type I but does not override it\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=342819
@@ -12859,11 +12859,11 @@ public void test342819() throws Exception {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in TwoWayDTOAdapter.java (at line 2)\n" +
- " public A convert(B b);\n" +
- " ^^^^^^^^^^^^\n" +
- "Name clash: The method convert(B) of type TwoWayDTOAdapter<A,B> has the same erasure as convert(A) of type DTOAdapter<A,B> but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in TwoWayDTOAdapter.java (at line 2)\n" +
+ " public A convert(B b);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Name clash: The method convert(B) of type TwoWayDTOAdapter<A,B> has the same erasure as convert(A) of type DTOAdapter<A,B> but does not override it\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=346029
@@ -12883,16 +12883,16 @@ public void test346029() throws Exception {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " public class X extends B<String> {\n" +
- " ^\n" +
- "Duplicate methods named f with the parameters (T) and (String) are inherited from the types B<String> and A<String>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " x.f(\"\");\n" +
- " ^\n" +
- "The method f(String) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " public class X extends B<String> {\n" +
+ " ^\n" +
+ "Duplicate methods named f with the parameters (T) and (String) are inherited from the types B<String> and A<String>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " x.f(\"\");\n" +
+ " ^\n" +
+ "The method f(String) is ambiguous for the type X\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=346029
@@ -12912,11 +12912,11 @@ public void test346029b() throws Exception {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=346029
@@ -12938,11 +12938,11 @@ public void test346029c() throws Exception {
},
null,
null,
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " public void f(String t) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method f(String) of type X should be tagged with @Override since it actually overrides a superclass method\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " public void f(String t) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method f(String) of type X should be tagged with @Override since it actually overrides a superclass method\n" +
"----------\n",
Excuse.EclipseHasSomeMoreWarnings);
}
@@ -12965,11 +12965,11 @@ public void test346029d() throws Exception {
},
null,
null,
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " public void f(String t) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method f(String) of type X should be tagged with @Override since it actually overrides a superclass method\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " public void f(String t) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method f(String) of type X should be tagged with @Override since it actually overrides a superclass method\n" +
"----------\n",
Excuse.EclipseHasSomeMoreWarnings);
}
@@ -12992,11 +12992,11 @@ public void test346029e() throws Exception {
},
null,
null,
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " void f(String s) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method f(String) of type X should be tagged with @Override since it actually overrides a superclass method\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " void f(String s) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method f(String) of type X should be tagged with @Override since it actually overrides a superclass method\n" +
"----------\n",
Excuse.EclipseHasSomeMoreWarnings);
}
@@ -13017,16 +13017,16 @@ public void test346029f() throws Exception {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " void f(String s) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method f(String) of type X should be tagged with @Override since it actually overrides a superclass method\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " super.f(s);\n" +
- " ^\n" +
- "The method f(String) is ambiguous for the type B<String>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " void f(String s) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method f(String) of type X should be tagged with @Override since it actually overrides a superclass method\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " super.f(s);\n" +
+ " ^\n" +
+ "The method f(String) is ambiguous for the type B<String>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=353089
@@ -13070,46 +13070,46 @@ public void test353089b() throws Exception {
" public void d(Zork z);\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " void c(List i, List<String> j);\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " public void a(List<String> i, List j);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method a(List<String>, List) of type X has the same erasure as a(List<String>, List<String>) of type I but does not override it\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 8)\n" +
- " public void a(List<String> i, List j);\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 9)\n" +
- " public void b(List i, List j);\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 9)\n" +
- " public void b(List i, List j);\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 10)\n" +
- " public void c(List i, List j);\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 10)\n" +
- " public void c(List i, List j);\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 11)\n" +
- " public void d(Zork z);\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " void c(List i, List<String> j);\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " public void a(List<String> i, List j);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method a(List<String>, List) of type X has the same erasure as a(List<String>, List<String>) of type I but does not override it\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 8)\n" +
+ " public void a(List<String> i, List j);\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 9)\n" +
+ " public void b(List i, List j);\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 9)\n" +
+ " public void b(List i, List j);\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 10)\n" +
+ " public void c(List i, List j);\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 10)\n" +
+ " public void c(List i, List j);\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 11)\n" +
+ " public void d(Zork z);\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=353089
@@ -13125,72 +13125,72 @@ public void test353089c() throws Exception {
" public void doTest(Integer i, List<String> iList, List iList2);\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " public void doTest(Integer i, List<String> iList, List iList2);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method doTest(Integer, List<String>, List) of type Impl has the same erasure as doTest(Integer, List<String>, List<String>) of type IFtest but does not override it\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " public void doTest(Integer i, List<String> iList, List iList2);\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " public void doTest(Integer i, List<String> iList, List iList2);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method doTest(Integer, List<String>, List) of type Impl has the same erasure as doTest(Integer, List<String>, List<String>) of type IFtest but does not override it\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " public void doTest(Integer i, List<String> iList, List iList2);\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=317719
public void testBug317719() throws Exception {
String output = this.complianceLevel == ClassFileConstants.JDK1_6 ?
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " public <T extends List> T foo() { return null; }\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " public <T extends List> T foo() { return null; }\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type X\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 5)\n" +
- " public <T extends Set> T foo() { return null; }\n" +
- " ^^^\n" +
- "Set is a raw type. References to generic type Set<E> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 5)\n" +
- " public <T extends Set> T foo() { return null; }\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type X\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 6)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " public <T extends List> T foo() { return null; }\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " public <T extends List> T foo() { return null; }\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 5)\n" +
+ " public <T extends Set> T foo() { return null; }\n" +
+ " ^^^\n" +
+ "Set is a raw type. References to generic type Set<E> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 5)\n" +
+ " public <T extends Set> T foo() { return null; }\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 6)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n":
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " public <T extends List> T foo() { return null; }\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " public <T extends List> T foo() { return null; }\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type X\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 5)\n" +
- " public <T extends Set> T foo() { return null; }\n" +
- " ^^^\n" +
- "Set is a raw type. References to generic type Set<E> should be parameterized\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " public <T extends Set> T foo() { return null; }\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type X\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 6)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " public <T extends List> T foo() { return null; }\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " public <T extends List> T foo() { return null; }\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 5)\n" +
+ " public <T extends Set> T foo() { return null; }\n" +
+ " ^^^\n" +
+ "Set is a raw type. References to generic type Set<E> should be parameterized\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " public <T extends Set> T foo() { return null; }\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 6)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -13208,37 +13208,37 @@ public void testBug317719() throws Exception {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=317719
public void testBug317719a() throws Exception {
String output = this.complianceLevel == ClassFileConstants.JDK1_6 ?
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " public Integer same(List<Integer> a) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " public Integer same(List<Integer> a) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method same(List<Integer>) is the same as another method in type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " public String same(List<String> b) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " public String same(List<String> b) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method same(List<String>) is the same as another method in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public Integer same(List<Integer> a) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " public Integer same(List<Integer> a) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method same(List<Integer>) is the same as another method in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public String same(List<String> b) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " public String same(List<String> b) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method same(List<String>) is the same as another method in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -13256,37 +13256,37 @@ public void testBug317719a() throws Exception {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=317719
public void testBug317719b() throws Exception {
String output = this.complianceLevel == ClassFileConstants.JDK1_6 ?
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public static String doIt(final List<String> arg) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public static String doIt(final List<String> arg) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method doIt(List<String>) is the same as another method in type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " public static CharSequence doIt(final List<CharSequence> arg) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " public static CharSequence doIt(final List<CharSequence> arg) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method doIt(List<CharSequence>) is the same as another method in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " public static String doIt(final List<String> arg) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " public static String doIt(final List<String> arg) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method doIt(List<String>) is the same as another method in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " public static CharSequence doIt(final List<CharSequence> arg) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " public static CharSequence doIt(final List<CharSequence> arg) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method doIt(List<CharSequence>) is the same as another method in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -13303,47 +13303,47 @@ public void testBug317719b() throws Exception {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=317719
public void testBug317719c() throws Exception {
String output = this.complianceLevel == ClassFileConstants.JDK1_6 ?
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " protected static <T extends String> T same(Collection<? extends T> p_col) { return null; }\n" +
- " ^^^^^^\n" +
- "The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " protected static <T extends String> T same(Collection<? extends T> p_col) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " protected static <T extends String> T same(Collection<? extends T> p_col) { return null; }\n" +
+ " ^^^^^^\n" +
+ "The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " protected static <T extends String> T same(Collection<? extends T> p_col) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method same(Collection<? extends T>) is the same as another method in type X\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 4)\n" +
- " protected static <T extends Number> T same(Collection<? extends T> p_col) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 4)\n" +
+ " protected static <T extends Number> T same(Collection<? extends T> p_col) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method same(Collection<? extends T>) is the same as another method in type X\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n":
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " protected static <T extends String> T same(Collection<? extends T> p_col) { return null; }\n" +
- " ^^^^^^\n" +
- "The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " protected static <T extends String> T same(Collection<? extends T> p_col) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " protected static <T extends String> T same(Collection<? extends T> p_col) { return null; }\n" +
+ " ^^^^^^\n" +
+ "The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " protected static <T extends String> T same(Collection<? extends T> p_col) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method same(Collection<? extends T>) is the same as another method in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " protected static <T extends Number> T same(Collection<? extends T> p_col) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " protected static <T extends Number> T same(Collection<? extends T> p_col) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method same(Collection<? extends T>) is the same as another method in type X\n" +
"----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -13360,37 +13360,37 @@ public void testBug317719c() throws Exception {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=317719
public void testBug317719d() throws Exception {
String output = this.complianceLevel == ClassFileConstants.JDK1_6 ?
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public static boolean foo(List<String> x) { return true; }\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public static boolean foo(List<String> x) { return true; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method foo(List<String>) is the same as another method in type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " public static int foo(List<Integer> x) { return 2; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " public static int foo(List<Integer> x) { return 2; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method foo(List<Integer>) is the same as another method in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " public static boolean foo(List<String> x) { return true; }\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " public static boolean foo(List<String> x) { return true; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method foo(List<String>) is the same as another method in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " public static int foo(List<Integer> x) { return 2; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " public static int foo(List<Integer> x) { return 2; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method foo(List<Integer>) is the same as another method in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -13407,37 +13407,37 @@ public void testBug317719d() throws Exception {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=317719
public void testBug317719e() throws Exception {
String output = this.complianceLevel == ClassFileConstants.JDK1_6 ?
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public String getFirst (ArrayList<String> ss) { return ss.get(0); }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public String getFirst (ArrayList<String> ss) { return ss.get(0); }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method getFirst(ArrayList<String>) is the same as another method in type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " public Integer getFirst (ArrayList<Integer> ss) { return ss.get(0); }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " public Integer getFirst (ArrayList<Integer> ss) { return ss.get(0); }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method getFirst(ArrayList<Integer>) is the same as another method in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " public String getFirst (ArrayList<String> ss) { return ss.get(0); }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " public String getFirst (ArrayList<String> ss) { return ss.get(0); }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method getFirst(ArrayList<String>) is the same as another method in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " public Integer getFirst (ArrayList<Integer> ss) { return ss.get(0); }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " public Integer getFirst (ArrayList<Integer> ss) { return ss.get(0); }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method getFirst(ArrayList<Integer>) is the same as another method in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -13454,47 +13454,47 @@ public void testBug317719e() throws Exception {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=317719
public void testBug317719f() throws Exception {
String output = this.complianceLevel == ClassFileConstants.JDK1_6 ?
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public static <R extends Object> X<R> forAccountSet(List list) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public static <R extends Object> X<R> forAccountSet(List list) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method forAccountSet(List) is the same as another method in type X<Z>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " public static <R extends Object> X<R> forAccountSet(List list) { return null; }\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 4)\n" +
- " public static <R extends Object> ChildX<R> forAccountSet(List<R> list) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " public static <R extends Object> X<R> forAccountSet(List list) { return null; }\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 4)\n" +
+ " public static <R extends Object> ChildX<R> forAccountSet(List<R> list) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method forAccountSet(List<R>) is the same as another method in type X<Z>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " public static <R extends Object> X<R> forAccountSet(List list) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " public static <R extends Object> X<R> forAccountSet(List list) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method forAccountSet(List) is the same as another method in type X<Z>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " public static <R extends Object> X<R> forAccountSet(List list) { return null; }\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " public static <R extends Object> ChildX<R> forAccountSet(List<R> list) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " public static <R extends Object> X<R> forAccountSet(List list) { return null; }\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " public static <R extends Object> ChildX<R> forAccountSet(List<R> list) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method forAccountSet(List<R>) is the same as another method in type X<Z>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -13512,57 +13512,57 @@ public void testBug317719f() throws Exception {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=317719
public void testBug317719g() throws Exception {
String output = this.complianceLevel == ClassFileConstants.JDK1_6 ?
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public static int[] doIt(Collection<int[]> col) { return new int[1]; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public static int[] doIt(Collection<int[]> col) { return new int[1]; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method doIt(Collection<int[]>) is the same as another method in type X<Z>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " public static int[][] doIt(Collection<int[][]> col) { return new int[0][0]; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " public static int[][] doIt(Collection<int[][]> col) { return new int[0][0]; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method doIt(Collection<int[][]>) is the same as another method in type X<Z>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 5)\n" +
- " public int[] doIt2(Collection<int[]> col) { return new int[0]; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 5)\n" +
+ " public int[] doIt2(Collection<int[]> col) { return new int[0]; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method doIt2(Collection<int[]>) is the same as another method in type X<Z>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 6)\n" +
- " public int[][] doIt2(Collection<int[][]> col) { return new int[0][0]; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 6)\n" +
+ " public int[][] doIt2(Collection<int[][]> col) { return new int[0][0]; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method doIt2(Collection<int[][]>) is the same as another method in type X<Z>\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 7)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n":
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " public static int[] doIt(Collection<int[]> col) { return new int[1]; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " public static int[] doIt(Collection<int[]> col) { return new int[1]; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method doIt(Collection<int[]>) is the same as another method in type X<Z>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " public static int[][] doIt(Collection<int[][]> col) { return new int[0][0]; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " public static int[][] doIt(Collection<int[][]> col) { return new int[0][0]; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method doIt(Collection<int[][]>) is the same as another method in type X<Z>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " public int[] doIt2(Collection<int[]> col) { return new int[0]; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " public int[] doIt2(Collection<int[]> col) { return new int[0]; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method doIt2(Collection<int[]>) is the same as another method in type X<Z>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " public int[][] doIt2(Collection<int[][]> col) { return new int[0][0]; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " public int[][] doIt2(Collection<int[][]> col) { return new int[0][0]; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method doIt2(Collection<int[][]>) is the same as another method in type X<Z>\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 7)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -13582,47 +13582,47 @@ public void testBug317719g() throws Exception {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=317719
public void testBug317719h() throws Exception {
String output = this.complianceLevel == ClassFileConstants.JDK1_6 ?
- "----------\n" +
- "1. WARNING in Test.java (at line 3)\n" +
- " public class Test<Key, Value> extends HashMap<Key, Collection<Value>> {\n" +
- " ^^^^\n" +
- "The serializable class Test does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. WARNING in Test.java (at line 4)\n" +
- " public Collection<Value> put(Key k, Value v) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method put(Key, Value) of type Test<Key,Value> has the same erasure as put(K, V) of type HashMap<K,V> but does not override it\n" +
- "----------\n" +
- "3. WARNING in Test.java (at line 5)\n" +
- " public Collection<Value> get(Key k) { return null; }\n" +
- " ^^^^^^^^^^\n" +
- "Name clash: The method get(Key) of type Test<Key,Value> has the same erasure as get(Object) of type HashMap<K,V> but does not override it\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 6)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in Test.java (at line 3)\n" +
+ " public class Test<Key, Value> extends HashMap<Key, Collection<Value>> {\n" +
+ " ^^^^\n" +
+ "The serializable class Test does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. WARNING in Test.java (at line 4)\n" +
+ " public Collection<Value> put(Key k, Value v) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method put(Key, Value) of type Test<Key,Value> has the same erasure as put(K, V) of type HashMap<K,V> but does not override it\n" +
+ "----------\n" +
+ "3. WARNING in Test.java (at line 5)\n" +
+ " public Collection<Value> get(Key k) { return null; }\n" +
+ " ^^^^^^^^^^\n" +
+ "Name clash: The method get(Key) of type Test<Key,Value> has the same erasure as get(Object) of type HashMap<K,V> but does not override it\n" +
+ "----------\n" +
+ "4. ERROR in Test.java (at line 6)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n":
- "----------\n" +
- "1. WARNING in Test.java (at line 3)\n" +
- " public class Test<Key, Value> extends HashMap<Key, Collection<Value>> {\n" +
- " ^^^^\n" +
- "The serializable class Test does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 4)\n" +
- " public Collection<Value> put(Key k, Value v) { return null; }\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method put(Key, Value) of type Test<Key,Value> has the same erasure as put(K, V) of type HashMap<K,V> but does not override it\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 5)\n" +
- " public Collection<Value> get(Key k) { return null; }\n" +
- " ^^^^^^^^^^\n" +
- "Name clash: The method get(Key) of type Test<Key,Value> has the same erasure as get(Object) of type HashMap<K,V> but does not override it\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 6)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in Test.java (at line 3)\n" +
+ " public class Test<Key, Value> extends HashMap<Key, Collection<Value>> {\n" +
+ " ^^^^\n" +
+ "The serializable class Test does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 4)\n" +
+ " public Collection<Value> put(Key k, Value v) { return null; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method put(Key, Value) of type Test<Key,Value> has the same erasure as put(K, V) of type HashMap<K,V> but does not override it\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 5)\n" +
+ " public Collection<Value> get(Key k) { return null; }\n" +
+ " ^^^^^^^^^^\n" +
+ "Name clash: The method get(Key) of type Test<Key,Value> has the same erasure as get(Object) of type HashMap<K,V> but does not override it\n" +
+ "----------\n" +
+ "4. ERROR in Test.java (at line 6)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -13650,41 +13650,41 @@ public void test345949a() throws Exception {
" public static void foo(A<Integer> p) {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Sub.java (at line 6)\n" +
- " public static void foo(A<Integer> p) {}\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(A<Integer>) of type Sub has the same erasure as foo(A<Number>) of type Super but does not hide it\n" +
+ "----------\n" +
+ "1. ERROR in Sub.java (at line 6)\n" +
+ " public static void foo(A<Integer> p) {}\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method foo(A<Integer>) of type Sub has the same erasure as foo(A<Number>) of type Super but does not hide it\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=355838
public void testBug355838() throws Exception {
- String output =
- "----------\n" +
- "1. ERROR in ErasureBug.java (at line 4)\n" +
- " public String output(List<String> integers) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ String output =
+ "----------\n" +
+ "1. ERROR in ErasureBug.java (at line 4)\n" +
+ " public String output(List<String> integers) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method output(List<String>) is the same as another method in type ErasureBug\n" +
- "----------\n" +
- "2. ERROR in ErasureBug.java (at line 7)\n" +
- " public String output(List doubles) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in ErasureBug.java (at line 7)\n" +
+ " public String output(List doubles) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
"Erasure of method output(List) is the same as another method in type ErasureBug\n" +
- "----------\n" +
- "3. WARNING in ErasureBug.java (at line 7)\n" +
- " public String output(List doubles) {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in ErasureBug.java (at line 10)\n" +
- " public static void main(String[] args) { new ErasureBug().output(new ArrayList()); }\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type ArrayList needs unchecked conversion to conform to List<String>\n" +
- "----------\n" +
- "5. WARNING in ErasureBug.java (at line 10)\n" +
- " public static void main(String[] args) { new ErasureBug().output(new ArrayList()); }\n" +
- " ^^^^^^^^^\n" +
- "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in ErasureBug.java (at line 7)\n" +
+ " public String output(List doubles) {\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in ErasureBug.java (at line 10)\n" +
+ " public static void main(String[] args) { new ErasureBug().output(new ArrayList()); }\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type ArrayList needs unchecked conversion to conform to List<String>\n" +
+ "----------\n" +
+ "5. WARNING in ErasureBug.java (at line 10)\n" +
+ " public static void main(String[] args) { new ErasureBug().output(new ArrayList()); }\n" +
+ " ^^^^^^^^^\n" +
+ "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -13711,32 +13711,32 @@ public void test288658() {
new String[] {
"pkg/Test.java",
"package pkg;\n" +
- "import java.lang.annotation.Annotation;\n"+
- "import java.lang.annotation.Retention;\n"+
- "import java.lang.annotation.RetentionPolicy;\n"+
- "import java.lang.reflect.Method;\n"+
- "\n"+
- "public class Test extends Super {\n"+
- " public static void main(String[] args) {\n"+
- " try {\n"+
+ "import java.lang.annotation.Annotation;\n"+
+ "import java.lang.annotation.Retention;\n"+
+ "import java.lang.annotation.RetentionPolicy;\n"+
+ "import java.lang.reflect.Method;\n"+
+ "\n"+
+ "public class Test extends Super {\n"+
+ " public static void main(String[] args) {\n"+
+ " try {\n"+
" Method m = Test.class.getMethod(\"setFoo\", String.class);\n"+
- " Annotation a = m.getAnnotation(Anno.class);\n"+
- " System.out.println(\"Annotation was \" + (a == null ? \"not \" : \"\") +\n"+
- "\"found\");\n"+
- " } catch (Exception e) {\n"+
- " e.printStackTrace();\n"+
- " }\n"+
- " }\n"+
- "}\n"+
- "\n"+
- "class Super {\n"+
- " @Anno\n"+
- " public void setFoo(String foo) {}\n"+
- "}\n"+
- "\n"+
- "@Retention(RetentionPolicy.RUNTIME)\n"+
- "@interface Anno {\n"+
- "\n"+
+ " Annotation a = m.getAnnotation(Anno.class);\n"+
+ " System.out.println(\"Annotation was \" + (a == null ? \"not \" : \"\") +\n"+
+ "\"found\");\n"+
+ " } catch (Exception e) {\n"+
+ " e.printStackTrace();\n"+
+ " }\n"+
+ " }\n"+
+ "}\n"+
+ "\n"+
+ "class Super {\n"+
+ " @Anno\n"+
+ " public void setFoo(String foo) {}\n"+
+ "}\n"+
+ "\n"+
+ "@Retention(RetentionPolicy.RUNTIME)\n"+
+ "@interface Anno {\n"+
+ "\n"+
"}\n"
},
"Annotation was found");
@@ -13749,33 +13749,33 @@ public void test288658a() {
new String[] {
"pkg/Test.java",
"package pkg;\n" +
- "import java.lang.annotation.Annotation;\n"+
- "import java.lang.annotation.Retention;\n"+
- "import java.lang.annotation.RetentionPolicy;\n"+
- "import java.lang.reflect.Method;\n"+
- "\n"+
+ "import java.lang.annotation.Annotation;\n"+
+ "import java.lang.annotation.Retention;\n"+
+ "import java.lang.annotation.RetentionPolicy;\n"+
+ "import java.lang.reflect.Method;\n"+
+ "\n"+
"public class Test extends Super {\n"+
" public void setFoo() {}\n" +
- " public static void main(String[] args) {\n"+
- " try {\n"+
+ " public static void main(String[] args) {\n"+
+ " try {\n"+
" Method m = Test.class.getMethod(\"setFoo\", String.class);\n"+
- " Annotation a = m.getAnnotation(Anno.class);\n"+
- " System.out.println(\"Annotation was \" + (a == null ? \"not \" : \"\") +\n"+
- "\"found\");\n"+
- " } catch (Exception e) {\n"+
- " e.printStackTrace();\n"+
- " }\n"+
- " }\n"+
- "}\n"+
- "\n"+
- "class Super {\n"+
- " @Anno\n"+
- " public void setFoo(String foo) {}\n"+
- "}\n"+
- "\n"+
- "@Retention(RetentionPolicy.RUNTIME)\n"+
- "@interface Anno {\n"+
- "\n"+
+ " Annotation a = m.getAnnotation(Anno.class);\n"+
+ " System.out.println(\"Annotation was \" + (a == null ? \"not \" : \"\") +\n"+
+ "\"found\");\n"+
+ " } catch (Exception e) {\n"+
+ " e.printStackTrace();\n"+
+ " }\n"+
+ " }\n"+
+ "}\n"+
+ "\n"+
+ "class Super {\n"+
+ " @Anno\n"+
+ " public void setFoo(String foo) {}\n"+
+ "}\n"+
+ "\n"+
+ "@Retention(RetentionPolicy.RUNTIME)\n"+
+ "@interface Anno {\n"+
+ "\n"+
"}\n"
},
"Annotation was found");
@@ -13798,22 +13798,22 @@ public void test354229() {
"}\n"
},
this.complianceLevel <= ClassFileConstants.JDK1_6 ?
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " interface C extends A, B { \n" +
- " ^\n" +
- "Name clash: The method get(List<Integer>) of type B has the same erasure as get(List<String>) of type A but does not override it\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " interface C extends A, B { \n" +
+ " ^\n" +
+ "Name clash: The method get(List<Integer>) of type B has the same erasure as get(List<String>) of type A but does not override it\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=354229
@@ -13833,16 +13833,16 @@ public void test354229b() {
" Zork z;\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " int get(List l); // name clash error here\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " int get(List l); // name clash error here\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=354229
@@ -13863,23 +13863,23 @@ public void test354229c() {
"}\n"
},
- this.complianceLevel < ClassFileConstants.JDK1_7 ?
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " interface E extends X, Y {\n" +
- " ^\n" +
- "Name clash: The method e(Action<S>) of type Y has the same erasure as e(Action<T>) of type X but does not override it\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ this.complianceLevel < ClassFileConstants.JDK1_7 ?
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
+ "----------\n" :
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " interface E extends X, Y {\n" +
+ " ^\n" +
+ "Name clash: The method e(Action<S>) of type Y has the same erasure as e(Action<T>) of type X but does not override it\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=354229
@@ -13894,15 +13894,15 @@ public void test354229d() {
"class Action<T> {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " <T> T e(Action<T> p);\n" +
- " ^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " <T> T e(Action<T> p);\n" +
+ " ^^^^^^^^^^^^^^\n" +
"Erasure of method e(Action<T>) is the same as another method in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " <S, T> S e(Action<S> t);\n" +
- " ^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " <S, T> S e(Action<S> t);\n" +
+ " ^^^^^^^^^^^^^^\n" +
"Erasure of method e(Action<S>) is the same as another method in type X\n" +
"----------\n");
}
@@ -13922,21 +13922,21 @@ public void testBug384580() {
" \n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " interface Z extends X, Y {} \n" +
- " ^\n" +
- "Y is a raw type. References to generic type Y<K> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " class Foo implements Z {\n" +
- " ^^^\n" +
- "The type Foo must implement the inherited abstract method Y.m()\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " public <T> List<T> m() {\n" +
- " ^^^\n" +
- "Name clash: The method m() of type Foo has the same erasure as m() of type Y but does not override it\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " interface Z extends X, Y {} \n" +
+ " ^\n" +
+ "Y is a raw type. References to generic type Y<K> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " class Foo implements Z {\n" +
+ " ^^^\n" +
+ "The type Foo must implement the inherited abstract method Y.m()\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " public <T> List<T> m() {\n" +
+ " ^^^\n" +
+ "Name clash: The method m() of type Foo has the same erasure as m() of type Y but does not override it\n" +
"----------\n");
}
// https://bugs.eclipse.org/406928 - computation of inherited methods seems damaged (affecting @Overrides)
@@ -13972,47 +13972,47 @@ public void testBug410325() {
runConformTest(
new String[] {
"Main.java",
- "public class Main {\n" +
- " public static void main(String[] args) {\n" +
- " F3 f3 = new F3();\n" +
- " SubSub sub = new SubSub();\n" +
- " sub.foo(f3);\n" +
- "\n" +
- " Sub<F3> sub2 = sub;\n" +
- " Base<F3> base = sub;\n" +
- " sub2.foo(f3);\n" +
- " base.foo(f3);\n" +
- "\n" +
- " F2 f2 = new F2();\n" +
- " sub2.foo(f2);\n" +
- " }\n" +
- "\n" +
- " public static class F1 {\n" +
- " }\n" +
- "\n" +
- " public static class F2 extends F1 {\n" +
- " }\n" +
- "\n" +
- " public static class F3 extends F2 {\n" +
- " public void bar() {\n" +
- " System.out.println(\"bar in F3\");\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static abstract class Base<T extends F1> {\n" +
- " public abstract void foo(T bar);\n" +
- " }\n" +
- "\n" +
- " public static abstract class Sub<T extends F2> extends Base<T> {\n" +
- " @Override\n" +
- " public void foo(F2 bar) {\n" +
- " System.out.println(getClass().getSimpleName() + \": F2 + \"\n" +
- " + bar.getClass().getSimpleName());\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static class SubSub extends Sub<F3> {\n" +
- " }\n" +
+ "public class Main {\n" +
+ " public static void main(String[] args) {\n" +
+ " F3 f3 = new F3();\n" +
+ " SubSub sub = new SubSub();\n" +
+ " sub.foo(f3);\n" +
+ "\n" +
+ " Sub<F3> sub2 = sub;\n" +
+ " Base<F3> base = sub;\n" +
+ " sub2.foo(f3);\n" +
+ " base.foo(f3);\n" +
+ "\n" +
+ " F2 f2 = new F2();\n" +
+ " sub2.foo(f2);\n" +
+ " }\n" +
+ "\n" +
+ " public static class F1 {\n" +
+ " }\n" +
+ "\n" +
+ " public static class F2 extends F1 {\n" +
+ " }\n" +
+ "\n" +
+ " public static class F3 extends F2 {\n" +
+ " public void bar() {\n" +
+ " System.out.println(\"bar in F3\");\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public static abstract class Base<T extends F1> {\n" +
+ " public abstract void foo(T bar);\n" +
+ " }\n" +
+ "\n" +
+ " public static abstract class Sub<T extends F2> extends Base<T> {\n" +
+ " @Override\n" +
+ " public void foo(F2 bar) {\n" +
+ " System.out.println(getClass().getSimpleName() + \": F2 + \"\n" +
+ " + bar.getClass().getSimpleName());\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public static class SubSub extends Sub<F3> {\n" +
+ " }\n" +
"}"
});
}
@@ -14022,18 +14022,18 @@ public void testBug411811() {
runConformTest(
new String[] {
"FaultyType.java",
- " class ParamType {}\n" +
- "\n" +
- " abstract class AbstractType<T extends ParamType> {\n" +
- " public abstract void foo(T t);\n" +
- " }\n" +
- "\n" +
- " abstract class SubAbstractType<T extends ParamType> extends AbstractType<T> {\n" +
- " @Override public void foo(ParamType t) {}\n" +
- " }\n" +
- "\n" +
- " class SubParamType extends ParamType {}\n" +
- " \n" +
+ " class ParamType {}\n" +
+ "\n" +
+ " abstract class AbstractType<T extends ParamType> {\n" +
+ " public abstract void foo(T t);\n" +
+ " }\n" +
+ "\n" +
+ " abstract class SubAbstractType<T extends ParamType> extends AbstractType<T> {\n" +
+ " @Override public void foo(ParamType t) {}\n" +
+ " }\n" +
+ "\n" +
+ " class SubParamType extends ParamType {}\n" +
+ " \n" +
"public class FaultyType extends SubAbstractType<SubParamType> {}"
});
}
@@ -14043,17 +14043,17 @@ public void testBug415600() {
runConformTest(
new String[] {
"A.java",
- "import java.io.Reader;\n" +
- "import java.io.StringReader;\n" +
- "\n" +
- "public abstract class A<E extends Reader> {\n" +
- " protected abstract void create(E element);\n" +
- "}\n" +
- "\n" +
- "abstract class B<T extends Reader> extends A<T> {\n" +
- " public void create(Reader element) { }\n" +
- "}\n" +
- "\n" +
+ "import java.io.Reader;\n" +
+ "import java.io.StringReader;\n" +
+ "\n" +
+ "public abstract class A<E extends Reader> {\n" +
+ " protected abstract void create(E element);\n" +
+ "}\n" +
+ "\n" +
+ "abstract class B<T extends Reader> extends A<T> {\n" +
+ " public void create(Reader element) { }\n" +
+ "}\n" +
+ "\n" +
"class C extends B<StringReader> { }\n"
});
}
@@ -14085,23 +14085,23 @@ public void testBug426546() {
runConformTest(
new String[] {
"C.java",
- "class A {\n" +
- " A getMe() { return null; }\n" +
- "}\n" +
- "class B extends A {\n" +
- " B getMe() { return null; }\n" +
- "}\n" +
- "public class C extends B {\n" +
+ "class A {\n" +
+ " A getMe() { return null; }\n" +
+ "}\n" +
+ "class B extends A {\n" +
+ " B getMe() { return null; }\n" +
+ "}\n" +
+ "public class C extends B {\n" +
" C getMe() { return this; }\n" +
- " public String toString() { return \"C\"; }\n" +
- " public static void main(String[] args) {\n" +
- " C c = new C();\n" +
- " System.out.print(c.getMe());\n" +
- " B b = c;\n" +
- " System.out.print(b.getMe());\n" +
- " A a = c;\n" +
- " System.out.print(a.getMe()); \n" +
- " }\n" +
+ " public String toString() { return \"C\"; }\n" +
+ " public static void main(String[] args) {\n" +
+ " C c = new C();\n" +
+ " System.out.print(c.getMe());\n" +
+ " B b = c;\n" +
+ " System.out.print(b.getMe());\n" +
+ " A a = c;\n" +
+ " System.out.print(a.getMe()); \n" +
+ " }\n" +
"}\n"
},
"CCC");
@@ -14111,19 +14111,19 @@ public void testBug438812() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.util.Collection;\n" +
- "import java.util.List;\n" +
- "\n" +
- "public interface A {\n" +
- " Iterable getIterable();\n" +
- "}\n" +
- "\n" +
- "class B implements A {\n" +
- " public Collection getIterable() { return null; }\n" +
- "}\n" +
- "\n" +
- "class C extends B {\n" +
- " public List getIterable() { return null; }\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public interface A {\n" +
+ " Iterable getIterable();\n" +
+ "}\n" +
+ "\n" +
+ "class B implements A {\n" +
+ " public Collection getIterable() { return null; }\n" +
+ "}\n" +
+ "\n" +
+ "class C extends B {\n" +
+ " public List getIterable() { return null; }\n" +
"}",
},
"");
@@ -14146,20 +14146,20 @@ public void testBug469454() throws Exception {
this.runConformTest(
new String[] {
"TestClass.java",
- "public class TestClass {\n" +
- " public static class A {\n" +
- " public static A method() {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- " public static class B extends A {\n" +
- " public static B method() {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(B.class.getDeclaredMethods().length);\n" +
- " }\n" +
+ "public class TestClass {\n" +
+ " public static class A {\n" +
+ " public static A method() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ " public static class B extends A {\n" +
+ " public static B method() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(B.class.getDeclaredMethods().length);\n" +
+ " }\n" +
"}\n",
},
"1");
@@ -14169,28 +14169,28 @@ public void testBug469454a() throws Exception {
this.runNegativeTest(
new String[] {
"TestClass.java",
- "public class TestClass {\n" +
- " public static class A {\n" +
- " public final A method() {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- " public static class B extends A {\n" +
- " @Override\n" +
- " public B method() {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(B.class.getDeclaredMethods().length);\n" +
- " }\n" +
+ "public class TestClass {\n" +
+ " public static class A {\n" +
+ " public final A method() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ " public static class B extends A {\n" +
+ " @Override\n" +
+ " public B method() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(B.class.getDeclaredMethods().length);\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in TestClass.java (at line 9)\n" +
- " public B method() {\n" +
- " ^^^^^^^^\n" +
- "Cannot override the final method from TestClass.A\n" +
+ "----------\n" +
+ "1. ERROR in TestClass.java (at line 9)\n" +
+ " public B method() {\n" +
+ " ^^^^^^^^\n" +
+ "Cannot override the final method from TestClass.A\n" +
"----------\n",
null,
true,
@@ -14217,19 +14217,19 @@ public void testBug438812a() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.util.Collection;\n" +
- "import java.util.List;\n" +
- "\n" +
- "public abstract class A {\n" +
- " abstract Iterable getIterable();\n" +
- "}\n" +
- "\n" +
- "class B extends A {\n" +
- " public Collection getIterable() { return null; }\n" +
- "}\n" +
- "\n" +
- "class C extends B {\n" +
- " public List getIterable() { return null; }\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public abstract class A {\n" +
+ " abstract Iterable getIterable();\n" +
+ "}\n" +
+ "\n" +
+ "class B extends A {\n" +
+ " public Collection getIterable() { return null; }\n" +
+ "}\n" +
+ "\n" +
+ "class C extends B {\n" +
+ " public List getIterable() { return null; }\n" +
"}",
},
"");
@@ -14253,26 +14253,26 @@ public void testBug461529() throws Exception {
this.runConformTest(
new String[] {
"foo/IBarable.java",
- "package foo;\n" +
- "public interface IBarable<T extends IBarable<T>> {\n" +
- " default IBar<T> createBar() {\n" +
- " throw new UnsupportedOperationException();\n" +
- " }\n" +
+ "package foo;\n" +
+ "public interface IBarable<T extends IBarable<T>> {\n" +
+ " default IBar<T> createBar() {\n" +
+ " throw new UnsupportedOperationException();\n" +
+ " }\n" +
"}\n",
"foo/IBar.java",
- "package foo;\n" +
- "public interface IBar<T extends IBarable<T>> {\n" +
- " T bar();\n" +
+ "package foo;\n" +
+ "public interface IBar<T extends IBarable<T>> {\n" +
+ " T bar();\n" +
"}\n",
"foo/Foo.java",
- "package foo;\n" +
- "public abstract class Foo implements IBarable<Foo> {\n" +
- " public abstract static class Builder implements IBar<Foo> {}\n" +
- " @Override\n" +
- " public abstract Builder createBar();\n" +
+ "package foo;\n" +
+ "public abstract class Foo implements IBarable<Foo> {\n" +
+ " public abstract static class Builder implements IBar<Foo> {}\n" +
+ " @Override\n" +
+ " public abstract Builder createBar();\n" +
"}\n",
"foo/ChildFoo.java",
- "package foo;\n" +
+ "package foo;\n" +
"public abstract class ChildFoo extends Foo {}\n"
});
}
@@ -14283,25 +14283,25 @@ public void testBug467776_regression() {
runConformTest(
new String[] {
"ITeam.java",
- "public interface ITeam {\n" +
- " <T> T getRole(Object o, Class<T> clazz);\n" +
+ "public interface ITeam {\n" +
+ " <T> T getRole(Object o, Class<T> clazz);\n" +
"}\n",
"Team.java",
- "public class Team implements ITeam {\n" +
- "\n" +
- " @Override\n" +
- " public <T> T getRole(Object o, Class<T> clazz) {\n" +
- " return null;\n" +
- " }\n" +
+ "public class Team implements ITeam {\n" +
+ "\n" +
+ " @Override\n" +
+ " public <T> T getRole(Object o, Class<T> clazz) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n",
"MyTeam.java",
- "public class MyTeam extends Team {\n" +
- " @Override\n" +
- " public <T> T getRole(Object o, Class<T> clazz) {\n" +
- " return super.getRole(o, clazz);\n" +
- " }\n" +
+ "public class MyTeam extends Team {\n" +
+ " @Override\n" +
+ " public <T> T getRole(Object o, Class<T> clazz) {\n" +
+ " return super.getRole(o, clazz);\n" +
+ " }\n" +
"}\n"
-
+
},
compilerOptions);
}
@@ -14309,29 +14309,29 @@ public void testBug500673() {
runNegativeTest(
new String[] {
"mfi.java",
- "interface mfi {\n" +
- " public transient void a(Throwable throwable);\n" +
+ "interface mfi {\n" +
+ " public transient void a(Throwable throwable);\n" +
"}\n",
"mfa.java",
- "final class mfa implements mfi {\n" +
+ "final class mfa implements mfi {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in mfi.java (at line 2)\n" +
- " public transient void a(Throwable throwable);\n" +
+ "----------\n" +
+ "1. ERROR in mfi.java (at line 2)\n" +
+ " public transient void a(Throwable throwable);\n" +
" ^^^^^^^^^^^^^^^^^^^^^^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8
? "Illegal modifier for the interface method a; only public & abstract are permitted\n"
- : this.complianceLevel < ClassFileConstants.JDK9 ?
+ : this.complianceLevel < ClassFileConstants.JDK9 ?
"Illegal modifier for the interface method a; only public, abstract, default, static and strictfp are permitted\n" :
"Illegal modifier for the interface method a; only public, private, abstract, default, static and strictfp are permitted\n"
) +
- "----------\n" +
- "----------\n" +
- "1. ERROR in mfa.java (at line 1)\n" +
- " final class mfa implements mfi {\n" +
- " ^^^\n" +
- "The type mfa must implement the inherited abstract method mfi.a(Throwable)\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in mfa.java (at line 1)\n" +
+ " final class mfa implements mfi {\n" +
+ " ^^^\n" +
+ "The type mfa must implement the inherited abstract method mfi.a(Throwable)\n" +
"----------\n");
}
public void testBug506653() {
@@ -14339,36 +14339,36 @@ public void testBug506653() {
false, // flushOutputDirectory
new String[] {
"A.java",
- " public class A {\n" +
- " public class B {\n" +
- " <E extends Object, F extends E> E bar(F x) {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
+ " public class A {\n" +
+ " public class B {\n" +
+ " <E extends Object, F extends E> E bar(F x) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
" public class C extends B {\n" +
- " @Override\n" +
- " public String bar(Object x) {\n" +
- " return \"Oops\";\n" +
- " }\n" +
- " }\n" +
- " public static void main(String... args) {\n" +
- " new A().test();\n" +
- " }\n" +
- " void test() {\n" +
+ " @Override\n" +
+ " public String bar(Object x) {\n" +
+ " return \"Oops\";\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String... args) {\n" +
+ " new A().test();\n" +
+ " }\n" +
+ " void test() {\n" +
" B b = new C();\n" +
- " try {\n" +
+ " try {\n" +
" Integer i = b.bar(1);\n" +
" } catch (ClassCastException cce) {\n" +
" System.out.print(\"cce\");\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
" }\n"
},
- "----------\n" +
- "1. WARNING in A.java (at line 9)\n" +
- " public String bar(Object x) {\n" +
- " ^^^^^^\n" +
- "Type safety: The return type String for bar(Object) from the type A.C needs unchecked conversion to conform to E from the type A.B\n" +
+ "----------\n" +
+ "1. WARNING in A.java (at line 9)\n" +
+ " public String bar(Object x) {\n" +
+ " ^^^^^^\n" +
+ "Type safety: The return type String for bar(Object) from the type A.C needs unchecked conversion to conform to E from the type A.B\n" +
"----------\n",
"cce",
"",
@@ -14378,15 +14378,15 @@ public void testBug536593() {
runConformTest(
new String[] {
"AbstractComp.java",
- "public abstract class AbstractComp {\n" +
- " protected abstract boolean isReadOnly();\n" +
+ "public abstract class AbstractComp {\n" +
+ " protected abstract boolean isReadOnly();\n" +
"}\n",
"HasValue.java",
- "public interface HasValue<T> {\n" +
- " boolean isReadOnly();\n" +
+ "public interface HasValue<T> {\n" +
+ " boolean isReadOnly();\n" +
"}\n",
"Factory.java",
- "public class Factory<T, F extends AbstractComp & HasValue<T>> {\n" +
+ "public class Factory<T, F extends AbstractComp & HasValue<T>> {\n" +
"}\n"
});
}
@@ -14394,88 +14394,88 @@ public void testBug536978_comment2() {
runNegativeTest(
new String[] {
"SimpleDemo.java",
- "abstract interface AbstractResult {\n" +
- " public abstract int test();\n" +
- "}\n" +
- "\n" +
- "abstract class AbstractDemo<Request extends AbstractResult, Response extends AbstractResult> {\n" +
- " protected abstract Response test(Request request);\n" +
+ "abstract interface AbstractResult {\n" +
+ " public abstract int test();\n" +
+ "}\n" +
+ "\n" +
+ "abstract class AbstractDemo<Request extends AbstractResult, Response extends AbstractResult> {\n" +
+ " protected abstract Response test(Request request);\n" +
"}\n" +
"\n" +
"interface SimpleResult extends AbstractResult {};\n" +
- "\n" +
- "class Result1 implements SimpleResult {\n" +
- " public int test() { return 1; }\n" +
- "}\n" +
- "class OtherResult implements AbstractResult {\n" +
- " public int test() { return 2; }\n" +
- "}\n" +
- "\n" +
- "public class SimpleDemo<Request extends AbstractResult, Response extends AbstractResult> \n" +
- "extends AbstractDemo<Request, Response> {\n" +
- "\n" +
- " @Override\n" +
- " protected SimpleResult test(AbstractResult request) {\n" +
- " return new Result1();\n" +
- " }\n" +
- " \n" +
- " public static void main(String... args) {\n" +
- " AbstractDemo<OtherResult,OtherResult> demo = new SimpleDemo<OtherResult,OtherResult>();\n" +
- " OtherResult result = demo.test(new OtherResult());\n" +
- " }\n" +
- "\n" +
+ "\n" +
+ "class Result1 implements SimpleResult {\n" +
+ " public int test() { return 1; }\n" +
+ "}\n" +
+ "class OtherResult implements AbstractResult {\n" +
+ " public int test() { return 2; }\n" +
+ "}\n" +
+ "\n" +
+ "public class SimpleDemo<Request extends AbstractResult, Response extends AbstractResult> \n" +
+ "extends AbstractDemo<Request, Response> {\n" +
+ "\n" +
+ " @Override\n" +
+ " protected SimpleResult test(AbstractResult request) {\n" +
+ " return new Result1();\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String... args) {\n" +
+ " AbstractDemo<OtherResult,OtherResult> demo = new SimpleDemo<OtherResult,OtherResult>();\n" +
+ " OtherResult result = demo.test(new OtherResult());\n" +
+ " }\n" +
+ "\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in SimpleDemo.java (at line 22)\n" +
- " protected SimpleResult test(AbstractResult request) {\n" +
- " ^^^^^^^^^^^^\n" +
- "The return type is incompatible with AbstractDemo<Request,Response>.test(Request)\n" +
+ "----------\n" +
+ "1. ERROR in SimpleDemo.java (at line 22)\n" +
+ " protected SimpleResult test(AbstractResult request) {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The return type is incompatible with AbstractDemo<Request,Response>.test(Request)\n" +
"----------\n");
}
public void testBug536978_comment5() {
- String errMsg = isJRE11Plus
+ String errMsg = isJRE11Plus
? "class Result1 cannot be cast to class OtherResult (Result1 and OtherResult are in unnamed module of loader"
: "Result1 cannot be cast to OtherResult";
runConformTest(
new String[] {
"SimpleDemo.java",
- "\n" +
- "abstract interface AbstractResult {\n" +
- " public abstract int test();\n" +
- "}\n" +
- "\n" +
- "abstract class AbstractDemo<Request extends AbstractResult, Response extends AbstractResult> {\n" +
- " protected abstract Response test(Request request);\n" +
- "\n" +
- "}\n" +
- "\n" +
- "class Result1 implements AbstractResult {\n" +
- " public int test() {\n" +
- " return 1;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class OtherResult implements AbstractResult {\n" +
- " public int test() {\n" +
- " return 2;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "public class SimpleDemo<Request extends AbstractResult, Response extends AbstractResult> extends AbstractDemo<Request, Response> {\n" +
- " @Override @SuppressWarnings(\"unchecked\")\n" +
- " protected AbstractResult test(AbstractResult request) {\n" +
- " return new Result1();\n" +
- " }\n" +
- "\n" +
- " public static void main(String... args) {\n" +
+ "\n" +
+ "abstract interface AbstractResult {\n" +
+ " public abstract int test();\n" +
+ "}\n" +
+ "\n" +
+ "abstract class AbstractDemo<Request extends AbstractResult, Response extends AbstractResult> {\n" +
+ " protected abstract Response test(Request request);\n" +
+ "\n" +
+ "}\n" +
+ "\n" +
+ "class Result1 implements AbstractResult {\n" +
+ " public int test() {\n" +
+ " return 1;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class OtherResult implements AbstractResult {\n" +
+ " public int test() {\n" +
+ " return 2;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "public class SimpleDemo<Request extends AbstractResult, Response extends AbstractResult> extends AbstractDemo<Request, Response> {\n" +
+ " @Override @SuppressWarnings(\"unchecked\")\n" +
+ " protected AbstractResult test(AbstractResult request) {\n" +
+ " return new Result1();\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String... args) {\n" +
" AbstractDemo<OtherResult, OtherResult> demo = new SimpleDemo<OtherResult, OtherResult>();\n" +
- " try {\n" +
+ " try {\n" +
" OtherResult result = demo.test(new OtherResult());\n" +
" } catch (ClassCastException e) {\n" +
" System.out.println(e.getMessage());\n" + // omit the stack trace for test robustness
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
errMsg);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleAttributeTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleAttributeTests.java
index 95f24040f..ea630d2ba 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleAttributeTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleAttributeTests.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -117,7 +117,7 @@ public class ModuleAttributeTests extends AbstractRegressionTest9 {
"public class X11 {}\n",
"pack2/X21.java",
"package pack2;\n" +
- "public class X21 {}\n",
+ "public class X21 {}\n",
};
IModuleAttribute module = getModuleAttribute(contents);
assertEquals("Wrong Module Name", "first", new String(module.getModuleName()));
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java
index 203c1eb88..9c58f4366 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java
@@ -90,7 +90,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
return;
}
}
-
+
class Runner extends AbstractRegressionTest.Runner {
StringBuffer commandLine = new StringBuffer();
String outputDir = OUTPUT_DIR + File.separator + "javac";
@@ -323,9 +323,9 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
}
return buf.toString();
}
-
+
private void walkOutFiles(final String outputLocation, final Set<String> fileNames, boolean add) {
- if (!(new File(outputLocation)).exists())
+ if (!(new File(outputLocation)).exists())
return;
try {
Files.walkFileTree(FileSystems.getDefault().getPath(outputLocation), new SimpleFileVisitor<Path>() {
@@ -386,12 +386,12 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
" -9 \"" + OUTPUT_DIR + File.separator + "module-info.java\" "
+ "\"" + OUTPUT_DIR + File.separator + "p/X.java\"",
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 4)\n" +
- " java.sql.Connection con = null;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The type java.sql.Connection is not accessible\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 4)\n" +
+ " java.sql.Connection con = null;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The type java.sql.Connection is not accessible\n" +
+ "----------\n" +
"1 problem (1 error)\n",
true,
"package java.sql" /* match for javac error */);
@@ -488,19 +488,19 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.base;\n" +
" requires java.sql;\n" +
" requires java.desktop;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
" java.sql.Connection con;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
"package q;\n" +
"public class Y {\n" +
" java.awt.Image image;\n" +
@@ -521,13 +521,13 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.base;\n" +
" requires transitive java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
" public static java.sql.Connection getConnection() {\n" +
@@ -535,17 +535,17 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
" }\n" +
"}");
moduleLoc = directory + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.two { \n" +
" requires java.base;\n" +
" requires mod.one;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
"package q;\n" +
"public class Y {\n" +
" java.sql.Connection con = p.X.getConnection();\n" +
"}");
-
+
StringBuffer buffer = new StringBuffer();
buffer.append("-d " + OUTPUT_DIR + File.separator + out )
.append(" -9 ")
@@ -553,15 +553,15 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(Util.getJavaClassLibsAsString())
.append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.two/q/Y.java (at line 3)\n" +
- " java.sql.Connection con = p.X.getConnection();\n" +
- " ^^^\n" +
- "The type p.X is not accessible\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.two/q/Y.java (at line 3)\n" +
+ " java.sql.Connection con = p.X.getConnection();\n" +
+ " ^^^\n" +
+ "The type p.X is not accessible\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false,
"p.X");
@@ -572,14 +572,14 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p;\n" +
" requires mod.two;\n" +
" requires transitive java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"import q.Y;\n" +
"public class X {\n" +
@@ -588,12 +588,12 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
" }\n" +
"}");
moduleLoc = directory + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.two { \n" +
" exports q;\n" +
" requires java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
"package q;\n" +
"public class Y {\n" +
" public static java.sql.Connection con = null;\n" +
@@ -609,7 +609,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(" --module-source-path " + "\"" + directory + "\"");
runConformModuleTest(files,
- buffer,
+ buffer,
"",
"",
false);
@@ -620,14 +620,14 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p.q;\n" +
" requires java.base;\n" +
" requires transitive java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "q", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "q", "X.java",
"package p.q;\n" +
"public class X {\n" +
" public static java.sql.Connection getConnection() {\n" +
@@ -635,17 +635,17 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
" }\n" +
"}");
moduleLoc = directory + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.two { \n" +
" requires java.base;\n" +
" requires mod.one;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "q" + File.separator + "r", "Y.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "q" + File.separator + "r", "Y.java",
"package q.r;\n" +
"public class Y {\n" +
" java.sql.Connection con = p.q.X.getConnection();\n" +
"}");
-
+
String systemDirectory = OUTPUT_DIR+File.separator+"system";
writeFile(systemDirectory, "readme.txt", "Not a valid system");
@@ -658,8 +658,8 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runNegativeModuleTest(files,
- buffer,
+ runNegativeModuleTest(files,
+ buffer,
"",
"invalid location for system libraries: ---OUTPUT_DIR_PLACEHOLDER---/system\n",
false,
@@ -671,14 +671,14 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p;\n" +
" requires java.base;\n" +
" requires transitive java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
" public static java.sql.Connection getConnection() {\n" +
@@ -686,12 +686,12 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
" }\n" +
"}");
moduleLoc = directory + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.two { \n" +
" requires java.base;\n" +
" requires mod.one;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
"package q;\n" +
"public class Y {\n" +
" java.sql.Connection con = p.X.getConnection();\n" +
@@ -702,14 +702,14 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(" -9 ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runConformModuleTest(files,
+ runConformModuleTest(files,
buffer,
"",
"",
false);
}
private void createUnnamedLibrary(String unnamedLoc, String unnamedBin) {
- writeFile(unnamedLoc + File.separator + "s" + File.separator + "t", "Tester.java",
+ writeFile(unnamedLoc + File.separator + "s" + File.separator + "t", "Tester.java",
"package s.t;\n" +
"public class Tester {\n" +
"}");
@@ -723,22 +723,22 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(" -sourcepath \"" + unnamedLoc + "\" ")
.append(unnamedLoc + File.separator + "s" + File.separator + "t" + File.separator + "Tester.java");
- runConformTest(new String[]{},
- buffer.toString(),
+ runConformTest(new String[]{},
+ buffer.toString(),
"",
"",
false);
}
private void createReusableModules(String srcDir, String outDir, File modDir) {
String moduleLoc = srcDir + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p;\n" +
" requires java.base;\n" +
" requires transitive java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
" public static java.sql.Connection getConnection() {\n" +
@@ -746,7 +746,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
" }\n" +
"}");
// This one is not exported (i.e. internal to this module)
- writeFileCollecting(files, moduleLoc + File.separator + "p1", "X1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p1", "X1.java",
"package p1;\n" +
"public class X1 {\n" +
" public static java.sql.Connection getConnection() {\n" +
@@ -755,13 +755,13 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
"}");
moduleLoc = srcDir + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.two { \n" +
" exports q;\n" +
" requires java.base;\n" +
" requires mod.one;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
"package q;\n" +
"public class Y {\n" +
" java.sql.Connection con = p.X.getConnection();\n" +
@@ -777,15 +777,15 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
for (String fileName : files)
buffer.append(" \"").append(fileName).append("\"");
- runConformTest(new String[]{},
- buffer.toString(),
+ runConformTest(new String[]{},
+ buffer.toString(),
"",
"",
false);
String fileName = modDir + File.separator + "mod.one.jar";
try {
- Util.zip(new File(outDir + File.separator + "mod.one"),
+ Util.zip(new File(outDir + File.separator + "mod.one"),
fileName);
} catch (IOException e) {
e.printStackTrace();
@@ -811,13 +811,13 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
File modDir = new File(OUTPUT_DIR + File.separator + "mod");
createReusableModules(srcDir, outDir, modDir);
String moduleLoc = srcDir + File.separator + "mod.three";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.three { \n" +
" requires mod.one;\n" +
" requires mod.two;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "r", "Z.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "r", "Z.java",
"package r;\n" +
"public class Z extends Object {\n" +
" p.X x = null;\n" +
@@ -833,8 +833,8 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append("\" ")
.append(" --module-source-path " + "\"" + srcDir + "\"");
- runConformModuleTest(files,
- buffer,
+ runConformModuleTest(files,
+ buffer,
"",
"",
false, outDir);
@@ -868,13 +868,13 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
File modDir = new File(OUTPUT_DIR + File.separator + "mod");
createReusableModules(srcDir, outDir, modDir);
String moduleLoc = srcDir + File.separator + "mod.three";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.three { \n" +
" requires mod.one;\n" +
" requires mod.two;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "r", "Z.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "r", "Z.java",
"package r;\n" +
"public class Z extends Object {\n" +
"}");
@@ -892,17 +892,17 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
runNegativeModuleTest(files,
buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/module-info.java (at line 2)\n" +
- " requires mod.one;\n" +
- " ^^^^^^^\n" +
- "mod.one cannot be resolved to a module\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/module-info.java (at line 3)\n" +
- " requires mod.two;\n" +
- " ^^^^^^^\n" +
- "mod.two cannot be resolved to a module\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/module-info.java (at line 2)\n" +
+ " requires mod.one;\n" +
+ " ^^^^^^^\n" +
+ "mod.one cannot be resolved to a module\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/module-info.java (at line 3)\n" +
+ " requires mod.two;\n" +
+ " ^^^^^^^\n" +
+ "mod.two cannot be resolved to a module\n" +
+ "----------\n" +
"2 problems (2 errors)\n",
false,
"module");
@@ -917,8 +917,8 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
File modDir = new File(OUTPUT_DIR + File.separator + "mod");
createReusableModules(srcDir, outDir, modDir);
String moduleLoc = srcDir + File.separator + "mod.three";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc + File.separator + "p", "Z.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "Z.java",
"package r;\n" +
"public class Z extends Object {\n" +
" p.X x = null;\n" +
@@ -934,7 +934,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(modDir + File.separator + "mod.two").append(File.pathSeparator)
.append("\" ");
runConformModuleTest(files,
- buffer,
+ buffer,
"",
"",
false,
@@ -1001,13 +1001,13 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.base;\n" +
" requires transitive java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
" public static java.sql.Connection getConnection() {\n" +
@@ -1015,12 +1015,12 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
" }\n" +
"}");
moduleLoc = directory + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.two { \n" +
" requires java.base;\n" +
" requires mod.one;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
"package q;\n" +
"public class Y {\n" +
" java.sql.Connection con = p.X.getConnection();\n" +
@@ -1047,13 +1047,13 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.base;\n" +
" requires transitive java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
" public static java.sql.Connection getConnection() {\n" +
@@ -1061,12 +1061,12 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
" }\n" +
"}");
moduleLoc = directory + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.two { \n" +
" requires java.base;\n" +
" requires java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
"package q;\n" +
"public class Y {\n" +
" java.sql.Connection con = p.X.getConnection();\n" +
@@ -1101,13 +1101,13 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.base;\n" +
" requires transitive java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
" public static java.sql.Connection getConnection() {\n" +
@@ -1115,11 +1115,11 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
" }\n" +
"}");
moduleLoc = directory + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.two { \n" +
" requires java.base;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
"package q;\n" +
"public class Y {\n" +
" java.sql.Connection con = p.X.getConnection();\n" +
@@ -1135,7 +1135,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(" --add-exports mod.one/p=mod.two")
.append(" --add-reads mod.two=mod.one");
- runConformModuleTest(files,
+ runConformModuleTest(files,
buffer,
"",
"",
@@ -1147,13 +1147,13 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.base;\n" +
" requires transitive java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
" public static java.sql.Connection getConnection() {\n" +
@@ -1161,11 +1161,11 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
" }\n" +
"}");
moduleLoc = directory + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.two { \n" +
" requires java.base;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
"package q;\n" +
"public class Y {\n" +
" java.sql.Connection con = p.X.getConnection();\n" +
@@ -1181,15 +1181,15 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(" --add-exports mod.one/p=mod.three")
.append(" --add-reads mod.two=mod.one");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.two/q/Y.java (at line 3)\n" +
- " java.sql.Connection con = p.X.getConnection();\n" +
- " ^^^\n" +
- "The type p.X is not accessible\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.two/q/Y.java (at line 3)\n" +
+ " java.sql.Connection con = p.X.getConnection();\n" +
+ " ^^^\n" +
+ "The type p.X is not accessible\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false,
"visible",
@@ -1201,13 +1201,13 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.base;\n" +
" requires transitive java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
" public static java.sql.Connection getConnection() {\n" +
@@ -1215,21 +1215,21 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
" }\n" +
"}");
moduleLoc = directory + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.two { \n" +
" requires java.base;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
"package q;\n" +
"public class Y {\n" +
" java.sql.Connection con = p.X.getConnection();\n" +
"}");
moduleLoc = directory + File.separator + "mod.three";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.three { \n" +
" requires java.base;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "r", "Z.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "r", "Z.java",
"package r;\n" +
"public class Z {\n" +
" java.sql.Connection con = p.X.getConnection();\n" +
@@ -1247,7 +1247,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(" --add-reads mod.two=mod.one")
.append(" --add-reads mod.three=mod.one");
- runConformModuleTest(files,
+ runConformModuleTest(files,
buffer,
"",
"",
@@ -1263,7 +1263,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- runner.createFile(moduleLoc + File.separator + "p", "X.java",
+ runner.createFile(moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public abstract class X extends com.sun.security.ntlm.Server {\n" +
" //public X() {}\n" +
@@ -1297,12 +1297,12 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
createUnnamedLibrary(unnamedLoc, unnamedBin);
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one {\n" +
" exports p.q;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "q", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "q", "X.java",
"package p.q;\n" +
"public abstract class X {\n" +
" s.t.Tester t;\n" +
@@ -1318,8 +1318,8 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(" --module-source-path \"" + directory + File.separator + "mod" + "\" ")
.append(" --add-reads mod.one=ALL-UNNAMED ");
- runConformModuleTest(files,
- buffer,
+ runConformModuleTest(files,
+ buffer,
"",
"",
false,
@@ -1339,13 +1339,13 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
createUnnamedLibrary(unnamedLoc, unnamedBin);
- List<String> files = new ArrayList<>();
+ List<String> files = new ArrayList<>();
String moduleLoc = directory + File.separator + "mod.one";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one {\n" +
" exports p.q;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "q", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "q", "X.java",
"package p.q;\n" +
"import s.*;\n" +
"import s.t.*;\n" +
@@ -1362,15 +1362,15 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(" --module-source-path \"" + directory + "\" ")
.append(" --add-reads mod.one=ALL-UNNAMED ");
- runNegativeModuleTest(files,
- buffer,
+ runNegativeModuleTest(files,
+ buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/q/X.java (at line 2)\n" +
- " import s.*;\n" +
- " ^\n" +
- "The package s is not accessible\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/q/X.java (at line 2)\n" +
+ " import s.*;\n" +
+ " ^\n" +
+ "The package s is not accessible\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false,
"package s",
@@ -1386,8 +1386,8 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public abstract class X extends com.sun.security.ntlm.Server {\n" +
" //public X() {}\n" +
@@ -1404,20 +1404,20 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append("\" ")
.append(" -sourcepath " + "\"" + moduleLoc + "\" ");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/X.java (at line 2)\n" +
- " public abstract class X extends com.sun.security.ntlm.Server {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The type com.sun.security.ntlm.Server is not accessible\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/X.java (at line 4)\n" +
- " public X(String arg0, String arg1) throws com.sun.security.ntlm.NTLMException {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The type com.sun.security.ntlm.NTLMException is not accessible\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/X.java (at line 2)\n" +
+ " public abstract class X extends com.sun.security.ntlm.Server {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The type com.sun.security.ntlm.Server is not accessible\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/X.java (at line 4)\n" +
+ " public X(String arg0, String arg1) throws com.sun.security.ntlm.NTLMException {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The type com.sun.security.ntlm.NTLMException is not accessible\n" +
+ "----------\n" +
"2 problems (2 errors)\n",
false,
"package com.sun.security.ntlm");
@@ -1446,13 +1446,13 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.base;\n" +
" requires transitive java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
" public static java.sql.Connection getConnection() {\n" +
@@ -1469,7 +1469,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(" --module-source-path " + "\"" + directory + "\"")
.append(" --add-exports mod.one=mod.two,mod.three");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
"incorrectly formatted option: --add-exports mod.one=mod.two,mod.three\n",
@@ -1482,13 +1482,13 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.base;\n" +
" requires transitive java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
" public static java.sql.Connection getConnection() {\n" +
@@ -1505,7 +1505,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(" --module-source-path " + "\"" + directory + "\"")
.append(" --add-reads mod.one/mod.two");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
"incorrectly formatted option: --add-reads mod.one/mod.two\n",
@@ -1518,13 +1518,13 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.base;\n" +
" requires transitive java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
" public static java.sql.Connection getConnection() {\n" +
@@ -1542,7 +1542,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(" --add-exports mod.one/p=mod.three")
.append(" --add-exports mod.one/p=mod.three");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
"can specify a package in a module only once with --add-export\n",
@@ -1555,8 +1555,8 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.base;\n" +
" requires transitive java.sql;\n" +
@@ -1571,7 +1571,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append("\"" + moduleLoc + File.separator + "module-info.java\" ")
.append(" -extdirs " + OUTPUT_DIR + File.separator + "src");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
"option -extdirs not supported at compliance level 9 and above\n",
@@ -1584,8 +1584,8 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.base;\n" +
" requires transitive java.sql;\n" +
@@ -1600,7 +1600,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(" \"" + moduleLoc + File.separator + "module-info.java\" ")
.append(" -bootclasspath " + OUTPUT_DIR + File.separator + "src");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
"option -bootclasspath not supported at compliance level 9 and above\n",
@@ -1613,8 +1613,8 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.base;\n" +
" requires transitive java.sql;\n" +
@@ -1629,7 +1629,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append("\"" + moduleLoc + File.separator + "module-info.java\" ")
.append(" -endorseddirs " + OUTPUT_DIR + File.separator + "src");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
"option -endorseddirs not supported at compliance level 9 and above\n",
@@ -1644,7 +1644,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
runner.createFile(
- moduleLoc, "module-info.java",
+ moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.base;\n" +
" requires transitive java.sql;\n" +
@@ -1667,13 +1667,13 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
File modDir = new File(OUTPUT_DIR + File.separator + "mod");
createReusableModules(srcDir, outDir, modDir);
String moduleLoc = srcDir + File.separator + "mod.three";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.three { \n" +
" requires mod.one;\n" +
" requires mod.two;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "r", "Z.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "r", "Z.java",
"package r;\n" +
"public class Z extends Object {\n" +
" p.X x = null;\n" +
@@ -1692,12 +1692,12 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
runNegativeModuleTest(files,
buffer,
"",
- "----------\n" +
+ "----------\n" +
"1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/r/Z.java (at line 4)\n"+
- " p1.X1 x1 = null;\n" +
- " ^^^^^\n" +
- "The type p1.X1 is not accessible\n" +
- "----------\n" +
+ " p1.X1 x1 = null;\n" +
+ " ^^^^^\n" +
+ "The type p1.X1 is not accessible\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false,
"visible",
@@ -1710,12 +1710,12 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.base;\n" +
" requires java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
" public static java.sql.Connection getConnection() {\n" +
@@ -1723,11 +1723,11 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
" }\n" +
"}");
moduleLoc = directory + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.two { \n" +
" requires java.base;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
"package q;\n" +
"public class Y {\n" +
" java.sql.Connection con = p.X.getConnection();\n" +
@@ -1743,7 +1743,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(" --add-exports mod.one/p=mod.two,mod.three")
.append(" --add-reads mod.two=mod.one");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
"----------\n" +
@@ -1768,13 +1768,13 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.base;\n" +
" requires java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
" public static java.sql.Connection getConnection() {\n" +
@@ -1782,11 +1782,11 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
" }\n" +
"}");
moduleLoc = directory + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.two { \n" +
" requires java.base;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
"package q;\n" +
"import java.sql.*;\n" +
"public class Y {\n" +
@@ -1804,7 +1804,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(" --add-exports mod.one/p=mod.two,mod.three")
.append(" --add-reads mod.two=mod.one");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
"----------\n"+
@@ -1829,13 +1829,13 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.base;\n" +
" requires java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
" static java.sql.Connection getConnection() {\n" +
@@ -1843,11 +1843,11 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
" }\n" +
"}");
moduleLoc = directory + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.two { \n" +
" requires java.base;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "q", "Y.java",
"package q;\n" +
"import java.sql.Connection;\n" +
"public class Y {\n" +
@@ -1864,7 +1864,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(" --add-exports mod.one/p=mod.two,mod.three")
.append(" --add-reads mod.two=mod.one");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
"----------\n"+
@@ -1889,8 +1889,8 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.base;\n" +
"}");
@@ -1909,7 +1909,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runConformModuleTest(files,
+ runConformModuleTest(files,
buffer,
"",
"",
@@ -1941,13 +1941,13 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.base;\n" +
" requires java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X extends a.A {\n" +
"}");
@@ -1959,15 +1959,15 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(Util.getJavaClassLibsAsString())
.append(LIB_DIR).append(File.separator).append("lib1.jar").append(File.pathSeparator).append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/X.java (at line 2)\n" +
- " public class X extends a.A {\n" +
- " ^^^\n" +
- "The type a.A is not accessible\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/X.java (at line 2)\n" +
+ " public class X extends a.A {\n" +
+ " ^^^\n" +
+ "The type a.A is not accessible\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false,
"package a does not exist");
@@ -1998,13 +1998,13 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.base;\n" +
" requires java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X extends a.A {\n" +
"}");
@@ -2017,15 +2017,15 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append("-p \"")
.append(LIB_DIR).append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/X.java (at line 2)\n" +
- " public class X extends a.A {\n" +
- " ^^^\n" +
- "The type a.A is not accessible\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/X.java (at line 2)\n" +
+ " public class X extends a.A {\n" +
+ " ^^^\n" +
+ "The type a.A is not accessible\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false,
"does not read");
@@ -2056,14 +2056,14 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.base;\n" +
" requires java.sql;\n" +
" requires lib1;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X extends a.A {\n" +
"}");
@@ -2077,7 +2077,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(LIB_DIR).append("\" ")
.append(" -warn:-module ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runConformModuleTest(files,
+ runConformModuleTest(files,
buffer,
"",
"",
@@ -2088,36 +2088,36 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
Util.flushDirectoryContent(outputDirectory);
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
-
+
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports pm;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "impl", "Other.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "impl", "Other.java",
"package impl;\n" +
"public class Other {\n" +
- " public void privateMethod() {}" +
+ " public void privateMethod() {}" +
"}\n");
- writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
"package pm;\n" +
- "import impl.Other;\n" +
- "public class C1 extends Other {\n" +
+ "import impl.Other;\n" +
+ "public class C1 extends Other {\n" +
"}\n");
moduleLoc = directory + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.two { \n" +
" requires mod.one;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "po", "Client.java",
- "package po;\n" +
- "import pm.C1;\n" +
- "public class Client {\n" +
- " void test1(C1 one) {\n" +
- " one.privateMethod(); // ecj: The method privateMethod() is undefined for the type C1\n" +
- " }\n" +
+ writeFileCollecting(files, moduleLoc + File.separator + "po", "Client.java",
+ "package po;\n" +
+ "import pm.C1;\n" +
+ "public class Client {\n" +
+ " void test1(C1 one) {\n" +
+ " one.privateMethod(); // ecj: The method privateMethod() is undefined for the type C1\n" +
+ " }\n" +
"}\n");
StringBuffer buffer = new StringBuffer();
@@ -2128,7 +2128,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runConformModuleTest(files,
+ runConformModuleTest(files,
buffer,
"",
"",
@@ -2140,40 +2140,40 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
Util.flushDirectoryContent(outputDirectory);
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
-
+
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports pm;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "impl", "Other.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "impl", "Other.java",
"package impl;\n" +
"public class Other {\n" +
"}\n");
- writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
"package pm;\n" +
- "import impl.Other;\n" +
+ "import impl.Other;\n" +
"public class C1 extends Other {\n" +
- " public void m1(Other o) {}\n" +
+ " public void m1(Other o) {}\n" +
"}\n");
moduleLoc = directory + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.two { \n" +
" requires mod.one;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "impl", "Other.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "impl", "Other.java",
"package impl;\n" +
"public class Other {\n" +
"}\n");
- writeFileCollecting(files, moduleLoc + File.separator + "po", "Client.java",
- "package po;\n" +
- "import pm.C1;\n" +
- "public class Client {\n" +
- " void test1(C1 one) {\n" +
- " one.m1(one);\n" +
- " }\n" +
+ writeFileCollecting(files, moduleLoc + File.separator + "po", "Client.java",
+ "package po;\n" +
+ "import pm.C1;\n" +
+ "public class Client {\n" +
+ " void test1(C1 one) {\n" +
+ " one.m1(one);\n" +
+ " }\n" +
"}\n");
StringBuffer buffer = new StringBuffer();
@@ -2184,15 +2184,15 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runConformModuleTest(files,
+ runConformModuleTest(files,
buffer,
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/pm/C1.java (at line 4)\n" +
- " public void m1(Other o) {}\n" +
- " ^^^^^\n" +
- "The type Other is not exported from this module\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/pm/C1.java (at line 4)\n" +
+ " public void m1(Other o) {}\n" +
+ " ^^^^^\n" +
+ "The type Other is not exported from this module\n" +
+ "----------\n" +
"1 problem (1 warning)\n",
false);
}
@@ -2206,49 +2206,49 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
Util.flushDirectoryContent(outputDirectory);
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
-
+
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports pm;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "impl", "SomeImpl.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "impl", "SomeImpl.java",
"package impl;\n" +
"public class SomeImpl {\n" +
"}\n");
- writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
"package pm;\n" +
- "import impl.SomeImpl;\n" +
+ "import impl.SomeImpl;\n" +
"public class C1 {\n" +
- " public void m1(SomeImpl o) {}\n" +
+ " public void m1(SomeImpl o) {}\n" +
"}\n");
- writeFileCollecting(files, moduleLoc + File.separator + "pm", "Other.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pm", "Other.java",
"package pm;\n" +
- "import impl.SomeImpl;\n" +
+ "import impl.SomeImpl;\n" +
"public class Other extends SomeImpl {\n" +
"}\n");
moduleLoc = directory + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.two { \n" +
" requires mod.one;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "impl", "SomeImpl.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "impl", "SomeImpl.java",
"package impl;\n" +
"public class SomeImpl {\n" + // pseudo-conflict to same named, but inaccessible class from mod.one
"}\n");
- writeFileCollecting(files, moduleLoc + File.separator + "po", "Client.java",
- "package po;\n" +
- "import pm.C1;\n" +
+ writeFileCollecting(files, moduleLoc + File.separator + "po", "Client.java",
+ "package po;\n" +
+ "import pm.C1;\n" +
"import pm.Other;\n" +
- "import impl.SomeImpl;\n" +
- "public class Client {\n" +
+ "import impl.SomeImpl;\n" +
+ "public class Client {\n" +
" void test1(C1 one) {\n" +
- " SomeImpl impl = new SomeImpl();\n" + // our own version
- " one.m1(impl);\n" + // incompatible to what's required
+ " SomeImpl impl = new SomeImpl();\n" + // our own version
+ " one.m1(impl);\n" + // incompatible to what's required
" one.m1(new Other());\n" + // OK
- " }\n" +
+ " }\n" +
"}\n");
StringBuffer buffer = new StringBuffer();
@@ -2260,10 +2260,10 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(" -info:+exports")
.append(" --module-source-path " + "\"" + directory + "\"");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
- "----------\n" +
+ "----------\n" +
"1. INFO in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/pm/C1.java (at line 4)\n" +
" public void m1(SomeImpl o) {}\n" +
" ^^^^^^^^\n" +
@@ -2271,10 +2271,10 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
"----------\n" +
"----------\n" +
"2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.two/po/Client.java (at line 8)\n" +
- " one.m1(impl);\n" +
- " ^^\n" +
- "The method m1(impl.SomeImpl) in the type C1 is not applicable for the arguments (impl.SomeImpl)\n" +
- "----------\n" +
+ " one.m1(impl);\n" +
+ " ^^\n" +
+ "The method m1(impl.SomeImpl) in the type C1 is not applicable for the arguments (impl.SomeImpl)\n" +
+ "----------\n" +
"2 problems (1 error, 0 warnings, 1 info)\n",
false,
"incompatible",
@@ -2290,54 +2290,54 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.x";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.x { \n" +
" exports pm;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1x.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1x.java",
"package pm;\n" +
"public class C1x {\n" +
"}\n");
-
+
moduleLoc = directory + File.separator + "mod.y";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.y { \n" +
" requires transitive mod.x;\n" +
"}");
-
+
moduleLoc = directory + File.separator + "mod.one";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports pm;\n" +
" exports p2;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
"package pm;\n" +
"public class C1 {\n" +
"}\n");
- writeFileCollecting(files, moduleLoc + File.separator + "p2", "C2.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p2", "C2.java",
"package p2;\n" +
"public class C2 {\n" +
"}\n");
moduleLoc = directory + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.two { \n" +
" exports pm;\n" +
" exports p2.sub;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pm", "C3.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pm", "C3.java",
"package pm;\n" +
"public class C3 {\n" +
"}\n");
- writeFileCollecting(files, moduleLoc + File.separator + "p2" + File.separator + "sub", "C4.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p2" + File.separator + "sub", "C4.java",
"package p2.sub;\n" +
"public class C4 {\n" +
"}\n");
moduleLoc = directory + File.separator + "mod.three";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.three { \n" +
" requires mod.one;\n" +
" requires mod.two;\n" +
@@ -2352,25 +2352,25 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/module-info.java (at line 2)\n" +
- " requires mod.one;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The package pm is accessible from more than one module: mod.one, mod.two, mod.x\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/module-info.java (at line 3)\n" +
- " requires mod.two;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The package pm is accessible from more than one module: mod.one, mod.two, mod.x\n" +
- "----------\n" +
- "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/module-info.java (at line 4)\n" +
- " requires transitive mod.y;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The package pm is accessible from more than one module: mod.one, mod.two, mod.x\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/module-info.java (at line 2)\n" +
+ " requires mod.one;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The package pm is accessible from more than one module: mod.one, mod.two, mod.x\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/module-info.java (at line 3)\n" +
+ " requires mod.two;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The package pm is accessible from more than one module: mod.one, mod.two, mod.x\n" +
+ "----------\n" +
+ "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/module-info.java (at line 4)\n" +
+ " requires transitive mod.y;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The package pm is accessible from more than one module: mod.one, mod.two, mod.x\n" +
+ "----------\n" +
"3 problems (3 errors)\n",
false,
"reads package pm");
@@ -2381,51 +2381,51 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
Util.flushDirectoryContent(outputDirectory);
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
-
+
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports pm;\n" +
" exports p2;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
"package pm;\n" +
"public class C1 {\n" +
"}\n");
- writeFileCollecting(files, moduleLoc + File.separator + "p2", "C2.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p2", "C2.java",
"package p2;\n" +
"public class C2 {\n" +
"}\n");
moduleLoc = directory + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.two { \n" +
" exports pm;\n" +
" exports p2.sub;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pm", "C3.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pm", "C3.java",
"package pm;\n" +
"public class C3 {\n" +
"}\n");
- writeFileCollecting(files, moduleLoc + File.separator + "p2" + File.separator + "sub", "C4.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p2" + File.separator + "sub", "C4.java",
"package p2.sub;\n" +
"public class C4 {\n" +
"}\n");
moduleLoc = directory + File.separator + "mod.three";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.three { \n" +
" requires mod.one;\n" +
" requires mod.two;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "po", "Client.java",
- "package po;\n" +
+ writeFileCollecting(files, moduleLoc + File.separator + "po", "Client.java",
+ "package po;\n" +
"import pm.*;\n" +
"import pm.C3;\n" +
"import p2.C2;\n" +
- "public class Client {\n" +
- " void test1(C1 one) {\n" +
+ "public class Client {\n" +
+ " void test1(C1 one) {\n" +
" }\n" +
" pm.C1 f1;\n" +
" p2.sub.C4 f4;\n" + // no conflict mod.one/p2 <-> mod.two/p2.sub
@@ -2439,36 +2439,36 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/module-info.java (at line 2)\n" +
- " requires mod.one;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The package pm is accessible from more than one module: mod.one, mod.two\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/module-info.java (at line 3)\n" +
- " requires mod.two;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The package pm is accessible from more than one module: mod.one, mod.two\n" +
- "----------\n" +
- "----------\n" +
- "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/po/Client.java (at line 2)\n" +
- " import pm.*;\n" +
- " ^^\n" +
- "The package pm is accessible from more than one module: mod.one, mod.two\n" +
- "----------\n" +
- "4. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/po/Client.java (at line 3)\n" +
- " import pm.C3;\n" +
- " ^^\n" +
- "The package pm is accessible from more than one module: mod.one, mod.two\n" +
- "----------\n" +
- "5. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/po/Client.java (at line 8)\n" +
- " pm.C1 f1;\n" +
- " ^^\n" +
- "The package pm is accessible from more than one module: mod.one, mod.two\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/module-info.java (at line 2)\n" +
+ " requires mod.one;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The package pm is accessible from more than one module: mod.one, mod.two\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/module-info.java (at line 3)\n" +
+ " requires mod.two;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The package pm is accessible from more than one module: mod.one, mod.two\n" +
+ "----------\n" +
+ "----------\n" +
+ "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/po/Client.java (at line 2)\n" +
+ " import pm.*;\n" +
+ " ^^\n" +
+ "The package pm is accessible from more than one module: mod.one, mod.two\n" +
+ "----------\n" +
+ "4. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/po/Client.java (at line 3)\n" +
+ " import pm.C3;\n" +
+ " ^^\n" +
+ "The package pm is accessible from more than one module: mod.one, mod.two\n" +
+ "----------\n" +
+ "5. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/po/Client.java (at line 8)\n" +
+ " pm.C1 f1;\n" +
+ " ^^\n" +
+ "The package pm is accessible from more than one module: mod.one, mod.two\n" +
+ "----------\n" +
"5 problems (5 errors)\n",
false,
"reads package pm");
@@ -2480,23 +2480,23 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
- List<String> files = new ArrayList<>();
+ List<String> files = new ArrayList<>();
String moduleLoc = directory + File.separator + "mod.one";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports pm;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
"package pm;\n" +
"public class C1 {\n" +
"}\n");
moduleLoc = directory + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.two { \n" +
" requires mod.one;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pm", "C3.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pm", "C3.java",
"package pm;\n" +
"public class C3 {\n" +
"}\n");
@@ -2510,14 +2510,14 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(" --module-source-path " + "\"" + directory + "\"");
runNegativeModuleTest(files,
- buffer,
+ buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.two/pm/C3.java (at line 1)\n" +
- " package pm;\n" +
- " ^^\n" +
- "The package pm conflicts with a package accessible from another module: mod.one\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.two/pm/C3.java (at line 1)\n" +
+ " package pm;\n" +
+ " ^^\n" +
+ "The package pm conflicts with a package accessible from another module: mod.one\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false,
"",
@@ -2531,22 +2531,22 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
File srcDir = new File(directory);
String moduleLoc = directory + File.separator + "mod.x";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.x { \n" +
" exports pm;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
"package pm;\n" +
"public class C1 {\n" +
"}\n");
moduleLoc = directory + File.separator + "mod.y";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.y { \n" +
" exports pm;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
"package pm;\n" +
"public class C1 {\n" +
"}\n");
@@ -2559,14 +2559,14 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runConformModuleTest(files,
+ runConformModuleTest(files,
buffer,
"",
"",
false);
Util.flushDirectoryContent(srcDir);
files.clear();
- writeFileCollecting(files, directory + File.separator + "p", "X.java",
+ writeFileCollecting(files, directory + File.separator + "p", "X.java",
"public class X extends pm.C1 { \n" +
"}");
buffer = new StringBuffer();
@@ -2576,21 +2576,21 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(Util.getJavaClassLibsAsString())
.append("\" ")
.append(" --module-path " + "\"" + OUTPUT_DIR + File.separator + out + "\"");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 1)\n" +
- " public class X extends pm.C1 { \n" +
- " ^^\n" +
- "The package pm is accessible from more than one module: mod.x, mod.y\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 1)\n" +
+ " public class X extends pm.C1 { \n" +
+ " ^^\n" +
+ "The package pm is accessible from more than one module: mod.x, mod.y\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false,
"package conflict");
}
/**
- * currently disabled because ECJ allows unnamed modules to read from other modules from
+ * currently disabled because ECJ allows unnamed modules to read from other modules from
* module-path even if they are not part of root modules.
*/
public void _testPackageConflict4a() {
@@ -2601,12 +2601,12 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
File srcDir = new File(directory);
String moduleLoc = directory + File.separator + "mod.x";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.x { \n" +
" exports pm;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
"package pm;\n" +
"public class C1 {\n" +
"}\n");
@@ -2619,14 +2619,14 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runConformModuleTest(files,
+ runConformModuleTest(files,
buffer,
"",
"",
false);
Util.flushDirectoryContent(srcDir);
files.clear();
- writeFileCollecting(files, directory + File.separator + "p", "X.java",
+ writeFileCollecting(files, directory + File.separator + "p", "X.java",
"public class X extends pm.C1 { \n" +
"}");
buffer = new StringBuffer();
@@ -2636,15 +2636,15 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(Util.getJavaClassLibsAsString())
.append("\" ")
.append(" --module-path " + "\"" + OUTPUT_DIR + File.separator + out + "\"");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 1)\n" +
- " public class X extends pm.C1 { \n" +
- " ^^\n" +
- "pm cannot be resolved to a type\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 1)\n" +
+ " public class X extends pm.C1 { \n" +
+ " ^^\n" +
+ "pm cannot be resolved to a type\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false,
"package conflict");
@@ -2657,22 +2657,22 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
File srcDir = new File(directory);
String moduleLoc = directory + File.separator + "mod.x";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.x { \n" +
" exports pm;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
"package pm;\n" +
"public class C1 {\n" +
"}\n");
moduleLoc = directory + File.separator + "mod.y";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.y { \n" +
" exports pm;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
"package pm;\n" +
"public class C1 {\n" +
"}\n");
@@ -2685,14 +2685,14 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runConformModuleTest(files,
+ runConformModuleTest(files,
buffer,
"",
"",
false);
Util.flushDirectoryContent(srcDir);
files.clear();
- writeFileCollecting(files, directory + File.separator + "p", "X.java",
+ writeFileCollecting(files, directory + File.separator + "p", "X.java",
"public class X extends pm.C1 { \n" +
"}");
buffer = new StringBuffer();
@@ -2703,7 +2703,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append("\" ")
.append(" --module-path " + "\"" + OUTPUT_DIR + File.separator + out + "\"")
.append(" --add-modules mod.x,mod.y");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
"The package pm is accessible from more than one module: mod.y, mod.x\n",
@@ -2717,7 +2717,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append("\" ")
.append(" --module-path " + "\"" + OUTPUT_DIR + File.separator + out + "\"")
.append(" --add-modules mod.x,mod.z");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
"invalid module name: mod.z\n",
@@ -2732,22 +2732,22 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
File srcDir = new File(directory);
String moduleLoc = directory + File.separator + "mod.x";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.x { \n" +
" exports pm;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
"package pm;\n" +
"public class C1 {\n" +
"}\n");
moduleLoc = directory + File.separator + "mod.y";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.y { \n" +
" exports pm;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
"package pm;\n" +
"public class C1 {\n" +
"}\n");
@@ -2760,14 +2760,14 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runConformModuleTest(files,
+ runConformModuleTest(files,
buffer,
"",
"",
false);
Util.flushDirectoryContent(srcDir);
files.clear();
- writeFileCollecting(files, directory + File.separator + "p", "X.java",
+ writeFileCollecting(files, directory + File.separator + "p", "X.java",
"public class X extends pm.C1 { \n" +
"}");
buffer = new StringBuffer();
@@ -2778,15 +2778,15 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append("\" ")
.append(" --module-path " + "\"" + OUTPUT_DIR + File.separator + out + "\"")
.append(" --add-modules mod.x,");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 1)\n" +
- " public class X extends pm.C1 { \n" +
- " ^^\n" +
- "The package pm is accessible from more than one module: mod.x, mod.y\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 1)\n" +
+ " public class X extends pm.C1 { \n" +
+ " ^^\n" +
+ "The package pm is accessible from more than one module: mod.x, mod.y\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false,
"package conflict");
@@ -2799,22 +2799,22 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
File srcDir = new File(directory);
String moduleLoc = directory + File.separator + "mod.x";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.x { \n" +
" exports pm;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
"package pm;\n" +
"public class C1 {\n" +
"}\n");
moduleLoc = directory + File.separator + "mod.y";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.y { \n" +
" exports pm;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
"package pm;\n" +
"public class C1 {\n" +
"}\n");
@@ -2827,14 +2827,14 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runConformModuleTest(files,
+ runConformModuleTest(files,
buffer,
"",
"",
false);
Util.flushDirectoryContent(srcDir);
files.clear();
- writeFileCollecting(files, directory + File.separator + "p", "X.java",
+ writeFileCollecting(files, directory + File.separator + "p", "X.java",
"public class X { \n" +
"}");
buffer = new StringBuffer();
@@ -2845,7 +2845,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append("\" ")
.append(" --module-path " + "\"" + OUTPUT_DIR + File.separator + out + "\"")
.append(" --add-modules mod.x,mod.y");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
"The package pm is accessible from more than one module: mod.y, mod.x\n",
@@ -2857,36 +2857,36 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
Util.flushDirectoryContent(outputDirectory);
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
-
+
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p1" + File.separator + "p2", "t3.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p1" + File.separator + "p2", "t3.java",
"package p1.p2;\n" +
"public class t3 {\n" +
"}\n");
moduleLoc = directory + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.two { \n" +
" exports p1.p2.t3;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p1" + File.separator + "p2" + File.separator + "t3", "t4.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p1" + File.separator + "p2" + File.separator + "t3", "t4.java",
"package p1.p2.t3;\n" +
"public class t4 {\n" +
"}\n");
moduleLoc = directory + File.separator + "mod.three";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.three { \n" +
" requires mod.one;\n" +
" requires mod.two;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "po", "Client.java",
- "package po;\n" +
- "public class Client {\n" +
+ writeFileCollecting(files, moduleLoc + File.separator + "po", "Client.java",
+ "package po;\n" +
+ "public class Client {\n" +
" p1.p2.t3.t4 f;\n" + // no conflict mod.one/p1.p2.t3 <-> mod.two/p1.p2.t3
"}\n");
@@ -2898,7 +2898,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runConformModuleTest(files,
+ runConformModuleTest(files,
buffer,
"",
"",
@@ -2910,12 +2910,12 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
Util.flushDirectoryContent(outputDirectory);
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
-
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, directory + File.separator + "test", "Test.java",
- "package test;\n" +
- "\n" +
- "public class Test implements org.eclipse.SomeInterface {\n" +
+
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, directory + File.separator + "test", "Test.java",
+ "package test;\n" +
+ "\n" +
+ "public class Test implements org.eclipse.SomeInterface {\n" +
"}\n");
StringBuffer buffer = new StringBuffer();
@@ -2925,7 +2925,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(Util.getJavaClassLibsAsString())
.append("\" ");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
"----------\n" +
@@ -2945,8 +2945,8 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod" + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one {\n" +
" exports p.q;\n" +
"}");
@@ -2961,8 +2961,8 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(" --module-source-path \"" + directory + File.separator + "mod" + "\" ")
.append(" --add-reads mod.one=ALL-UNNAMED ");
- runNegativeModuleTest(files,
- buffer,
+ runNegativeModuleTest(files,
+ buffer,
"",
"cannot specify both -source-path and --module-source-path\n",
false,
@@ -2980,11 +2980,11 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String moduleLoc = directory + File.separator + "mod.one";
List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p.exp;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "exp", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "exp", "C1.java",
"package p.exp;\n" +
"import p.priv.*;\n" +
"class C0 {\n" +
@@ -2999,7 +2999,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
" public p.priv.C2 test5() { return null; }\n" +
"}\n");
- writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "priv", "C2.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "priv", "C2.java",
"package p.priv;\n" +
"public class C2 {\n" +
"}\n");
@@ -3015,27 +3015,27 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
runNegativeModuleTest(files, buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/exp/C1.java (at line 7)\n" +
- " public C2 f;\n" +
- " ^^\n" +
- "The type C2 is not exported from this module\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/exp/C1.java (at line 8)\n" +
- " public void test1(C0 c) {}\n" +
- " ^^\n" +
- "The type C0 is not accessible to clients that require this module\n" +
- "----------\n" +
- "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/exp/C1.java (at line 9)\n" +
- " public void test2(C2 c) {}\n" +
- " ^^\n" +
- "The type C2 is not exported from this module\n" +
- "----------\n" +
- "4. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/exp/C1.java (at line 12)\n" +
- " public p.priv.C2 test5() { return null; }\n" +
- " ^^^^^^^^^\n" +
- "The type C2 is not exported from this module\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/exp/C1.java (at line 7)\n" +
+ " public C2 f;\n" +
+ " ^^\n" +
+ "The type C2 is not exported from this module\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/exp/C1.java (at line 8)\n" +
+ " public void test1(C0 c) {}\n" +
+ " ^^\n" +
+ "The type C0 is not accessible to clients that require this module\n" +
+ "----------\n" +
+ "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/exp/C1.java (at line 9)\n" +
+ " public void test2(C2 c) {}\n" +
+ " ^^\n" +
+ "The type C2 is not exported from this module\n" +
+ "----------\n" +
+ "4. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/exp/C1.java (at line 12)\n" +
+ " public p.priv.C2 test5() { return null; }\n" +
+ " ^^^^^^^^^\n" +
+ "The type C2 is not exported from this module\n" +
+ "----------\n" +
"4 problems (4 errors)\n",
false,
"is not exported");
@@ -3050,11 +3050,11 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String moduleLoc = directory + File.separator + "mod.one";
List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p.exp;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "exp", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "exp", "C1.java",
"package p.exp;\n" +
"import java.util.*;\n" +
"class C0 {\n" +
@@ -3076,17 +3076,17 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
runNegativeModuleTest(files, buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/exp/C1.java (at line 7)\n" +
- " public List<C0> f1;\n" +
- " ^^\n" +
- "The type C0 is not accessible to clients that require this module\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/exp/C1.java (at line 8)\n" +
- " public C0[] f2;\n" +
- " ^^\n" +
- "The type C0 is not accessible to clients that require this module\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/exp/C1.java (at line 7)\n" +
+ " public List<C0> f1;\n" +
+ " ^^\n" +
+ "The type C0 is not accessible to clients that require this module\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/exp/C1.java (at line 8)\n" +
+ " public C0[] f2;\n" +
+ " ^^\n" +
+ "The type C0 is not accessible to clients that require this module\n" +
+ "----------\n" +
"2 problems (2 errors)\n",
false,
"not accessible to clients");
@@ -3101,11 +3101,11 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String moduleLoc = directory + File.separator + "mod.one";
List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p.exp;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "exp", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "exp", "C1.java",
"package p.exp;\n" +
"import java.util.*;\n" +
"class C0 {\n" +
@@ -3128,12 +3128,12 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(" --module-source-path " + "\"" + directory + "\"");
runConformModuleTest(files,
- buffer,
+ buffer,
"",
"",
false);
}
-
+
// details: nested types
public void testAPILeakDetection4() {
File outputDirectory = new File(OUTPUT_DIR);
@@ -3143,11 +3143,11 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String moduleLoc = directory + File.separator + "mod.one";
List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p.exp;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "exp", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "exp", "C1.java",
"package p.exp;\n" +
"public class C1 {\n" +
" static class C3 {\n" +
@@ -3168,17 +3168,17 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
runNegativeModuleTest(files, buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/exp/C1.java (at line 6)\n" +
- " public C3 f1;\n" +
- " ^^\n" +
- "The type C1.C3 is not accessible to clients that require this module\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/exp/C1.java (at line 7)\n" +
- " public C3.C4 f2;\n" +
- " ^^^^^\n" +
- "The type C1.C3.C4 is not accessible to clients that require this module\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/exp/C1.java (at line 6)\n" +
+ " public C3 f1;\n" +
+ " ^^\n" +
+ "The type C1.C3 is not accessible to clients that require this module\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/exp/C1.java (at line 7)\n" +
+ " public C3.C4 f2;\n" +
+ " ^^^^^\n" +
+ "The type C1.C3.C4 is not accessible to clients that require this module\n" +
+ "----------\n" +
"2 problems (2 errors)\n",
false,
"one is not accessible to clients");
@@ -3193,33 +3193,33 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String moduleLoc = directory + File.separator + "mod.one";
List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p.exp1;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "exp1", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "exp1", "C1.java",
"package p.exp1;\n" +
"public class C1 {\n" +
"}\n");
moduleLoc = directory + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.two { \n" +
" exports p.exp2;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "exp2", "C2.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "exp2", "C2.java",
"package p.exp2;\n" +
"public class C2 {\n" +
"}\n");
moduleLoc = directory + File.separator + "mod.three";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.three { \n" +
" requires mod.one; // missing transitive\n" +
" requires transitive mod.two;\n" +
- " exports p.exp3;\n" +
+ " exports p.exp3;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "exp3", "C3.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "exp3", "C3.java",
"package p.exp3;\n" +
"public class C3 {\n" +
" public void m1(p.exp1.C1 arg) {}\n" +
@@ -3237,12 +3237,12 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
runNegativeModuleTest(files, buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/p/exp3/C3.java (at line 3)\n" +
- " public void m1(p.exp1.C1 arg) {}\n" +
- " ^^^^^^^^^\n" +
- "The type C1 from module mod.one may not be accessible to clients due to missing \'requires transitive\'\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/p/exp3/C3.java (at line 3)\n" +
+ " public void m1(p.exp1.C1 arg) {}\n" +
+ " ^^^^^^^^^\n" +
+ "The type C1 from module mod.one may not be accessible to clients due to missing \'requires transitive\'\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false,
"is not indirectly exported");
@@ -3257,11 +3257,11 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String moduleLoc = directory + File.separator + "mod.one";
List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p.exp;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "exp", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "exp", "C1.java",
"package p.exp;\n" +
"import java.lang.annotation.*;\n" +
"@Target(ElementType.TYPE_USE)\n" +
@@ -3284,17 +3284,17 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
runNegativeModuleTest(files, buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/exp/C1.java (at line 8)\n" +
- " public @ANN C0 f3;\n" +
- " ^^\n" +
- "The type C0 is not accessible to clients that require this module\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/exp/C1.java (at line 9)\n" +
- " public @ANN String test(@ANN String arg, @ANN C0 c) { return \"\"; }\n" +
- " ^^\n" +
- "The type C0 is not accessible to clients that require this module\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/exp/C1.java (at line 8)\n" +
+ " public @ANN C0 f3;\n" +
+ " ^^\n" +
+ "The type C0 is not accessible to clients that require this module\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/exp/C1.java (at line 9)\n" +
+ " public @ANN String test(@ANN String arg, @ANN C0 c) { return \"\"; }\n" +
+ " ^^\n" +
+ "The type C0 is not accessible to clients that require this module\n" +
+ "----------\n" +
"2 problems (2 errors)\n",
false,
"is not accessible to clients");
@@ -3309,11 +3309,11 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String moduleLoc = directory + File.separator + "mod.one";
List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p.exp;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "exp", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "exp", "C1.java",
"package p.exp;\n" +
"public enum C1 {\n" +
" X, Y, Z;\n" +
@@ -3342,7 +3342,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String projLoc = directory + File.separator + "Proj";
List<String> files = new ArrayList<>();
- writeFileCollecting(files, projLoc + File.separator + "p" + File.separator + "exp", "C1.java",
+ writeFileCollecting(files, projLoc + File.separator + "p" + File.separator + "exp", "C1.java",
"package p.exp;\n" +
"import java.util.*;\n" +
"public class C1 {\n" +
@@ -3369,7 +3369,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
File modDir = new File(OUTPUT_DIR + File.separator + "mod");
createReusableModules(srcDir, outDir, modDir);
String moduleLoc = srcDir + File.separator + "mod.three";
- List<String> files = new ArrayList<>();
+ List<String> files = new ArrayList<>();
writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.three { \n" +
" requires mod.one;\n" +
@@ -3400,8 +3400,8 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
File modDir = new File(OUTPUT_DIR + File.separator + "mod");
createReusableModules(srcDir, outDir, modDir);
String moduleLoc = srcDir + File.separator + "mod.three";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.three { \n" +
" requires mod.one;\n" +
" requires mod.two;\n" +
@@ -3431,8 +3431,8 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
File modDir = new File(OUTPUT_DIR + File.separator + "mod");
createReusableModules(srcDir, outDir, modDir);
String moduleLoc = srcDir + File.separator + "mod.three";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.three { \n" +
" requires mod.one;\n" +
" requires mod.two;\n" +
@@ -3461,12 +3461,12 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.base;\n" +
"}");
- writeFileCollecting(files, moduleLoc, "X.java",
+ writeFileCollecting(files, moduleLoc, "X.java",
"public class X {\n" +
"}");
@@ -3478,15 +3478,15 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/X.java (at line 1)\n" +
- " public class X {\n" +
- " ^\n" +
- "Must declare a named package because this compilation unit is associated to the named module \'mod.one\'\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/X.java (at line 1)\n" +
+ " public class X {\n" +
+ " ^\n" +
+ "Must declare a named package because this compilation unit is associated to the named module \'mod.one\'\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false,
"unnamed package is not allowed in named modules",
@@ -3503,16 +3503,16 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
};
String jarPath = OUTPUT_DIR + File.separator + "lib-x.jar";
Util.createJar(sources, jarPath, "1.8");
-
+
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires lib.x;\n" + // lib.x is derived from lib-x.jar
"}");
- writeFileCollecting(files, moduleLoc+File.separator+"q", "X.java",
+ writeFileCollecting(files, moduleLoc+File.separator+"q", "X.java",
"package q;\n" +
"public class X {\n" +
" p.a.X f;\n" +
@@ -3527,15 +3527,15 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
.append(" -info:+module ")
.append(" --module-path " + "\"" + jarPath + "\"");
- runConformModuleTest(files,
+ runConformModuleTest(files,
buffer,
"",
- "----------\n" +
- "1. INFO in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 2)\n" +
- " requires lib.x;\n" +
- " ^^^^^\n" +
- "Name of automatic module \'lib.x\' is unstable, it is derived from the module\'s file name.\n" +
- "----------\n" +
+ "----------\n" +
+ "1. INFO in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 2)\n" +
+ " requires lib.x;\n" +
+ " ^^^^^\n" +
+ "Name of automatic module \'lib.x\' is unstable, it is derived from the module\'s file name.\n" +
+ "----------\n" +
"1 problem (1 info)\n",
false,
OUTPUT_DIR + File.separator + out);
@@ -3547,8 +3547,8 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
File modDir = new File(OUTPUT_DIR + File.separator + "mod");
createReusableModules(srcDir, outDir, modDir);
String moduleLoc = srcDir + File.separator + "mod.three";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod._3_ { \n" +
" requires mod.one;\n" +
" requires mod.two;\n" +
@@ -3572,7 +3572,7 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
"does not match expected name");
}
/*
- * Disabled because the parser seem to take the module path as mod and not mod.e
+ * Disabled because the parser seem to take the module path as mod and not mod.e
*/
public void _testBug521458b() {
Util.flushDirectoryContent(new File(OUTPUT_DIR));
@@ -3581,8 +3581,8 @@ public class ModuleCompilationTests extends AbstractBatchCompilerTest {
File modDir = new File(OUTPUT_DIR + File.separator + "mod");
createReusableModules(srcDir, outDir, modDir);
String moduleLoc = srcDir + File.separator + "mod.three";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.3 { \n" +
" requires mod.one;\n" +
" requires mod.two;\n" +
@@ -3611,12 +3611,12 @@ public void testBug521362_emptyFile() {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p1;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p1", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p1", "X.java",
"");
StringBuffer buffer = new StringBuffer();
@@ -3627,14 +3627,14 @@ public void testBug521362_emptyFile() {
.append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 2)\n" +
- " exports p1;\n" +
- " ^^\n" +
- "The package p1 does not exist or is empty\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 2)\n" +
+ " exports p1;\n" +
+ " ^^\n" +
+ "The package p1 does not exist or is empty\n" +
"----------\n" +
"1 problem (1 error)\n",
false,
@@ -3647,12 +3647,12 @@ public void testBug521362_emptyFile() {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p1;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p1", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p1", "X.java",
"package q;\n");
StringBuffer buffer = new StringBuffer();
@@ -3663,15 +3663,15 @@ public void testBug521362_emptyFile() {
.append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 2)\n" +
- " exports p1;\n" +
- " ^^\n" +
- "The package p1 does not exist or is empty\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 2)\n" +
+ " exports p1;\n" +
+ " ^^\n" +
+ "The package p1 does not exist or is empty\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false,
"package is empty",
@@ -3683,18 +3683,18 @@ public void testBug521362_emptyFile() {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p1;\n" +
" exports p2;\n" +
" exports p3;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p1", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p1", "X.java",
"package q;\n");
- writeFileCollecting(files, moduleLoc + File.separator + "p2", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p2", "X.java",
"package q2;\n");
- writeFileCollecting(files, moduleLoc + File.separator + "p3", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p3", "X.java",
"package p3;\n");
StringBuffer buffer = new StringBuffer();
buffer.append("-d " + OUTPUT_DIR + File.separator + out )
@@ -3704,20 +3704,20 @@ public void testBug521362_emptyFile() {
.append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 2)\n" +
- " exports p1;\n" +
- " ^^\n" +
- "The package p1 does not exist or is empty\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 3)\n" +
- " exports p2;\n" +
- " ^^\n" +
- "The package p2 does not exist or is empty\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 2)\n" +
+ " exports p1;\n" +
+ " ^^\n" +
+ "The package p1 does not exist or is empty\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 3)\n" +
+ " exports p2;\n" +
+ " ^^\n" +
+ "The package p2 does not exist or is empty\n" +
+ "----------\n" +
"2 problems (2 errors)\n",
false,
"package is empty",
@@ -3729,18 +3729,18 @@ public void testBug521362_emptyFile() {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p1;\n" +
" exports p2;\n" +
" exports p3.p4.p5;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p1", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p1", "X.java",
"package q;\n");
- writeFileCollecting(files, moduleLoc + File.separator + "p2", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p2", "X.java",
"package q2;\n");
- writeFileCollecting(files, moduleLoc + File.separator + "p3" + File.separator + "p4" + File.separator + "p5", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p3" + File.separator + "p4" + File.separator + "p5", "X.java",
"package p3.p4.p5;\n");
StringBuffer buffer = new StringBuffer();
buffer.append("-d " + OUTPUT_DIR + File.separator + out )
@@ -3750,20 +3750,20 @@ public void testBug521362_emptyFile() {
.append("\" ")
.append(" --module-source-path " + "\"" + directory + "\"");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 2)\n" +
- " exports p1;\n" +
- " ^^\n" +
- "The package p1 does not exist or is empty\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 3)\n" +
- " exports p2;\n" +
- " ^^\n" +
- "The package p2 does not exist or is empty\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 2)\n" +
+ " exports p1;\n" +
+ " ^^\n" +
+ "The package p1 does not exist or is empty\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 3)\n" +
+ " exports p2;\n" +
+ " ^^\n" +
+ "The package p2 does not exist or is empty\n" +
+ "----------\n" +
"2 problems (2 errors)\n",
false,
"package is empty",
@@ -3780,8 +3780,8 @@ public void testBug521362_emptyFile() {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.sql;\n" +
"}");
@@ -3813,8 +3813,8 @@ public void testBug521362_emptyFile() {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.sql;\n" +
"}");
@@ -3825,30 +3825,30 @@ public void testBug521362_emptyFile() {
.append(Util.getJavaClassLibsAsString())
.append("\" ");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 1)\n" +
- " module mod.one { \n" +
- " ^^^^^^\n" +
- "Syntax error on token \"module\", package expected\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 1)\n" +
- " module mod.one { \n" +
- " ^^^^^^^^^^^^^^\n" +
- "Syntax error on token(s), misplaced construct(s)\n" +
- "----------\n" +
- "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 2)\n" +
- " requires java.sql;\n" +
- " ^\n" +
- "Syntax error on token \".\", , expected\n" +
- "----------\n" +
- "4. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 3)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 1)\n" +
+ " module mod.one { \n" +
+ " ^^^^^^\n" +
+ "Syntax error on token \"module\", package expected\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 1)\n" +
+ " module mod.one { \n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Syntax error on token(s), misplaced construct(s)\n" +
+ "----------\n" +
+ "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 2)\n" +
+ " requires java.sql;\n" +
+ " ^\n" +
+ "Syntax error on token \".\", , expected\n" +
+ "----------\n" +
+ "4. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 3)\n" +
+ " }\n" +
+ " ^\n" +
+ "Syntax error on token \"}\", delete this token\n" +
+ "----------\n" +
"4 problems (4 errors)\n",
false,
"modules are not supported");
@@ -3860,15 +3860,15 @@ public void testBug521362_emptyFile() {
String directory = OUTPUT_DIR + File.separator + "src";
File srcDir = new File(directory);
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc,
- "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc,
+ "module-info.java",
"module mod.one { \n" +
" exports x.y.z;\n" +
" exports a.b.c;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "x" + File.separator + "y" + File.separator + "z",
- "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "x" + File.separator + "y" + File.separator + "z",
+ "X.java",
"package x.y.z;\n");
writeFileCollecting(files, moduleLoc + File.separator + "a" + File.separator + "b" + File.separator + "c",
"A.java",
@@ -3876,13 +3876,13 @@ public void testBug521362_emptyFile() {
"public class A {}");
moduleLoc = directory + File.separator + "mod.one.a";
- writeFileCollecting(files, moduleLoc,
- "module-info.java",
+ writeFileCollecting(files, moduleLoc,
+ "module-info.java",
"module mod.one.a { \n" +
" exports x.y.z;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "x" + File.separator + "y" + File.separator + "z",
- "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "x" + File.separator + "y" + File.separator + "z",
+ "X.java",
"package x.y.z;\n" +
"public class X {}\n");
StringBuffer buffer = new StringBuffer();
@@ -3894,16 +3894,16 @@ public void testBug521362_emptyFile() {
.append(" --module-source-path " + "\"" + directory + "\" ");
runConformModuleTest(files,
- buffer,
- "",
- "",
+ buffer,
+ "",
+ "",
false);
Util.flushDirectoryContent(srcDir);
files.clear();
moduleLoc = directory + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc,
- "module-info.java",
+ writeFileCollecting(files, moduleLoc,
+ "module-info.java",
"module mod.two { \n" +
" requires mod.one;\n" +
" requires mod.one.a;\n" +
@@ -3924,20 +3924,20 @@ public void testBug521362_emptyFile() {
.append("\" ")
.append(" --module-path " + "\"" + OUTPUT_DIR + File.separator + out + "\" ")
.append(" --module-source-path " + "\"" + directory + "\" ");
- runNegativeModuleTest(files,
+ runNegativeModuleTest(files,
buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.two/module-info.java (at line 2)\n" +
- " requires mod.one;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The package x.y.z is accessible from more than one module: mod.one, mod.one.a\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.two/module-info.java (at line 3)\n" +
- " requires mod.one.a;\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The package x.y.z is accessible from more than one module: mod.one, mod.one.a\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.two/module-info.java (at line 2)\n" +
+ " requires mod.one;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The package x.y.z is accessible from more than one module: mod.one, mod.one.a\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.two/module-info.java (at line 3)\n" +
+ " requires mod.one.a;\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "The package x.y.z is accessible from more than one module: mod.one, mod.one.a\n" +
+ "----------\n" +
"2 problems (2 errors)\n",
false,
"module mod.two reads package x.y.z from both mod.one and mod.one.a");
@@ -4065,12 +4065,12 @@ public void testBug521362_emptyFile() {
"\"" + OUTPUT_DIR + File.separator + "X.java\""
+ " --release 7 -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
- " public java.util.stream.Stream<String> emptyStream() {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "java.util.stream cannot be resolved to a type\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
+ " public java.util.stream.Stream<String> emptyStream() {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "java.util.stream cannot be resolved to a type\n" +
+ "----------\n" +
"1 problem (1 error)\n",
true);
}
@@ -4092,12 +4092,12 @@ public void testBug521362_emptyFile() {
"\"" + OUTPUT_DIR + File.separator + "X.java\""
+ " --release 7 -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 6)\n" +
- " I i = (x, y) -> {\n" +
- " ^^^^^^^^^\n" +
- "Lambda expressions are allowed only at source level 1.8 or above\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 6)\n" +
+ " I i = (x, y) -> {\n" +
+ " ^^^^^^^^^\n" +
+ "Lambda expressions are allowed only at source level 1.8 or above\n" +
+ "----------\n" +
"1 problem (1 error)\n",
true);
}
@@ -4106,34 +4106,34 @@ public void testBug521362_emptyFile() {
this.runNegativeTest(
new String[] {
"X.java",
- "import java.io.*;\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " System.out.println();\n" +
- " Reader r = new FileReader(args[0]);\n" +
- " r.read();\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
+ " System.out.println();\n" +
+ " Reader r = new FileReader(args[0]);\n" +
+ " r.read();\n" +
" } catch(IOException | FileNotFoundException e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}",
},
"\"" + OUTPUT_DIR + File.separator + "X.java\""
+ " --release 6 -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 9)\n" +
- " } catch(IOException | FileNotFoundException e) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Multi-catch parameters are not allowed for source level below 1.7\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 9)\n" +
- " } catch(IOException | FileNotFoundException e) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The exception FileNotFoundException is already caught by the alternative IOException\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 9)\n" +
+ " } catch(IOException | FileNotFoundException e) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Multi-catch parameters are not allowed for source level below 1.7\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 9)\n" +
+ " } catch(IOException | FileNotFoundException e) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The exception FileNotFoundException is already caught by the alternative IOException\n" +
+ "----------\n" +
"2 problems (2 errors)\n",
true);
}
@@ -4141,9 +4141,9 @@ public void testBug521362_emptyFile() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
"}",
},
"\"" + OUTPUT_DIR + File.separator + "X.java\"" +
@@ -4158,16 +4158,16 @@ public void testBug521362_emptyFile() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
"}",
},
"\"" + OUTPUT_DIR + File.separator + "X.java\"" +
" --system \"" + javaHome + "\"" +
" --release 6 -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
+ "----------\n" +
"option --system not supported below compliance level 9",
true);
}
@@ -4193,14 +4193,14 @@ public void testBug521362_emptyFile() {
}
public void testReleaseOption13a() {
Runner runner = new Runner();
- runner.createFile(
+ runner.createFile(
OUTPUT_DIR +File.separator+"p", "X.java",
"package p;\n" +
"public class X {\n" +
" public static void main(String[] args) {\n" +
" }\n" +
"}");
- runner.createFile(
+ runner.createFile(
OUTPUT_DIR, "module-info.java",
"module mod.one { \n" +
" requires java.base;\n" +
@@ -4218,18 +4218,18 @@ public void testBug521362_emptyFile() {
},
" --release 8 \"" + OUTPUT_DIR + File.separator + "module-info.java\" ",
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/module-info.java (at line 1)\n" +
- " module mod.one { \n" +
- " ^^^^^^\n" +
- "Syntax error on token \"module\", package expected\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/module-info.java (at line 1)\n" +
- " module mod.one { \n" +
- "}\n" +
- " ^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/module-info.java (at line 1)\n" +
+ " module mod.one { \n" +
+ " ^^^^^^\n" +
+ "Syntax error on token \"module\", package expected\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/module-info.java (at line 1)\n" +
+ " module mod.one { \n" +
+ "}\n" +
+ " ^^^^\n" +
+ "Syntax error on tokens, delete these tokens\n" +
+ "----------\n" +
"2 problems (2 errors)\n",
true,
/*not tested with javac*/"");
@@ -4246,9 +4246,9 @@ public void testBug521362_emptyFile() {
fooDir, "X.java",
"package foo;\n" +
"public class X { \n" +
- " public Module getModule(String name) {\n" +
+ " public Module getModule(String name) {\n" +
" return null;\n" +
- " }\n" +
+ " }\n" +
"}");
runner.commandLine.append(" --release 8 ");
runner.runConformModuleTest();
@@ -4264,20 +4264,20 @@ public void testBug521362_emptyFile() {
"package bar;\n" +
"import foo.*;\n" +
"public class X { \n" +
- " public Module getModule(String name) {\n" +
+ " public Module getModule(String name) {\n" +
" return null;\n" +
- " }\n" +
+ " }\n" +
"}"
},
" -source 9 \"" + OUTPUT_DIR + File.separator + "foo" + File.separator + "Module.java\" " +
"\"" + OUTPUT_DIR + File.separator + "bar" + File.separator + "X.java\" ",
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/bar/X.java (at line 4)\n" +
- " public Module getModule(String name) {\n" +
- " ^^^^^^\n" +
- "The type Module is ambiguous\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/bar/X.java (at line 4)\n" +
+ " public Module getModule(String name) {\n" +
+ " ^^^^^^\n" +
+ "The type Module is ambiguous\n" +
+ "----------\n" +
"1 problem (1 error)\n",
true,
/*not tested with javac*/"");
@@ -4291,9 +4291,9 @@ public void testBug521362_emptyFile() {
"foo/X.java",
"package foo;\n" +
"public class X { \n" +
- " public Module getModule(String name) {\n" +
+ " public Module getModule(String name) {\n" +
" return null;\n" +
- " }\n" +
+ " }\n" +
"}"
},
" --release 60 \"" + OUTPUT_DIR + File.separator + "foo" + File.separator + "Module.java\" " +
@@ -4338,23 +4338,23 @@ public void testBug521362_emptyFile() {
this.runNegativeTest(
new String[] {
"X.java",
- "import java.io.*;\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " String str = Integer.toUnsignedString(1, 1);\n" +
- " }\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " String str = Integer.toUnsignedString(1, 1);\n" +
+ " }\n" +
"}",
},
"\"" + OUTPUT_DIR + File.separator + "X.java\""
+ " --release 7 -d \"" + OUTPUT_DIR + "\"",
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 5)\n" +
- " String str = Integer.toUnsignedString(1, 1);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The method toUnsignedString(int, int) is undefined for the type Integer\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 5)\n" +
+ " String str = Integer.toUnsignedString(1, 1);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The method toUnsignedString(int, int) is undefined for the type Integer\n" +
+ "----------\n" +
"1 problem (1 error)\n",
true);
}
@@ -4363,10 +4363,10 @@ public void testBug521362_emptyFile() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Integer.toUnsignedString(1, 1);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Integer.toUnsignedString(1, 1);\n" +
+ " }\n" +
"}",
},
"\"" + OUTPUT_DIR + File.separator + "X.java\""
@@ -4395,12 +4395,12 @@ public void testBug521362_emptyFile() {
" --release 10 \"" + OUTPUT_DIR + File.separator + "module-info.java\" "
+ "\"" + OUTPUT_DIR + File.separator + "p/X.java\"",
"",
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/module-info.java (at line 3)\n" +
- " requires java.xml.ws.annotation;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The module java.xml.ws.annotation has been deprecated since version 9 and marked for removal\n" +
- "----------\n" +
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/module-info.java (at line 3)\n" +
+ " requires java.xml.ws.annotation;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The module java.xml.ws.annotation has been deprecated since version 9 and marked for removal\n" +
+ "----------\n" +
"1 problem (1 warning)\n",
true);
}
@@ -4455,13 +4455,13 @@ public void testBug521362_emptyFile() {
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.x";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.x { \n" +
" exports pm;\n" +
" requires java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
"package pm;\n" +
"public class C1 {\n" +
"}\n");
@@ -4477,12 +4477,12 @@ public void testBug521362_emptyFile() {
.append(" --module-source-path " + "\"" + directory + "\"");
runNegativeModuleTest(files, buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.x/module-info.java (at line 3)\n" +
- " requires java.sql;\n" +
- " ^^^^^^^^\n" +
- "java.sql cannot be resolved to a module\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.x/module-info.java (at line 3)\n" +
+ " requires java.sql;\n" +
+ " ^^^^^^^^\n" +
+ "java.sql cannot be resolved to a module\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false,
"module not found");
@@ -4494,14 +4494,14 @@ public void testBug521362_emptyFile() {
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.x";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.x { \n" +
" exports pm;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
"package pm;\n" +
- "import java.sql.Connection;\n" +
+ "import java.sql.Connection;\n" +
"public class C1 {\n" +
"}\n");
@@ -4516,12 +4516,12 @@ public void testBug521362_emptyFile() {
.append(" --module-source-path " + "\"" + directory + "\"");
runNegativeModuleTest(files, buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.x/pm/C1.java (at line 2)\n" +
- " import java.sql.Connection;\n" +
- " ^^^^^^^^\n" +
- "The import java.sql cannot be resolved\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.x/pm/C1.java (at line 2)\n" +
+ " import java.sql.Connection;\n" +
+ " ^^^^^^^^\n" +
+ "The import java.sql cannot be resolved\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false,
"is not visible");
@@ -4533,12 +4533,12 @@ public void testBug521362_emptyFile() {
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.x";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.x { \n" +
" exports pm;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pm", "C1.java",
"package pm;\n" +
"public class C1 {\n" +
"}\n");
@@ -4564,8 +4564,8 @@ public void testBug521362_emptyFile() {
File modDir = new File(OUTPUT_DIR + File.separator + "mod");
createReusableModules(srcDir, outDir, modDir);
String moduleLoc = srcDir + File.separator + "mod.three";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.three { \n" +
" requires mod.one;\n" +
" requires mod.two;\n" +
@@ -4593,8 +4593,8 @@ public void testBug521362_emptyFile() {
File modDir = new File(OUTPUT_DIR + File.separator + "mod");
createReusableModules(srcDir, outDir, modDir);
String moduleLoc = srcDir + File.separator + "mod.three";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.three { \n" +
" requires mod.one;\n" +
" requires mod.two;\n" +
@@ -4612,12 +4612,12 @@ public void testBug521362_emptyFile() {
.append(" --module-source-path " + "\"" + srcDir + "\" ");
runNegativeModuleTest(files, buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/module-info.java (at line 3)\n" +
- " requires mod.two;\n" +
- " ^^^^^^^\n" +
- "mod.two cannot be resolved to a module\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/module-info.java (at line 3)\n" +
+ " requires mod.two;\n" +
+ " ^^^^^^^\n" +
+ "mod.two cannot be resolved to a module\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false,
"");
@@ -4628,18 +4628,18 @@ public void testBug521362_emptyFile() {
String srcDir = OUTPUT_DIR + File.separator + "src";
String moduleLoc = srcDir + File.separator + "test";
Runner runner = new Runner();
- runner.createFile(moduleLoc, "module-info.java",
+ runner.createFile(moduleLoc, "module-info.java",
"module test {}");
- runner.createFile(moduleLoc + File.separator + "test", "Thing.java",
+ runner.createFile(moduleLoc + File.separator + "test", "Thing.java",
"package test;\n" +
- "import java.util.Comparator;\n" +
- "import java.util.Iterator;\n" +
- "public abstract class Thing implements Iterator<Object> {\n" +
- " void breaking() {\n" +
- " remove(); // allowed (good)\n" +
- " Iterator.super.remove(); // not 1.7-compliant (must be an error)\n" +
- " Comparator.naturalOrder(); // not 1.7-compliant (bad error message)\n" +
- " }\n" +
+ "import java.util.Comparator;\n" +
+ "import java.util.Iterator;\n" +
+ "public abstract class Thing implements Iterator<Object> {\n" +
+ " void breaking() {\n" +
+ " remove(); // allowed (good)\n" +
+ " Iterator.super.remove(); // not 1.7-compliant (must be an error)\n" +
+ " Comparator.naturalOrder(); // not 1.7-compliant (bad error message)\n" +
+ " }\n" +
"}\n");
runner.commandLine.append("-d " + outDir )
@@ -4660,12 +4660,12 @@ public void testBug521362_emptyFile() {
"",
"",
true);
- String expectedOutput = "// Compiled from module-info.java (version 9 : 53.0, no super bit)\n" +
- " module mymodule {\n" +
- " // Version: \n" +
- "\n" +
- " requires java.base;\n" +
- "\n" +
+ String expectedOutput = "// Compiled from module-info.java (version 9 : 53.0, no super bit)\n" +
+ " module mymodule {\n" +
+ " // Version: \n" +
+ "\n" +
+ " requires java.base;\n" +
+ "\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "module-info.class", "module-info", expectedOutput);
}
@@ -4675,12 +4675,12 @@ public void testBug521362_emptyFile() {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports pack1;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pack1", "X11.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pack1", "X11.java",
"package pack1;\n" +
"public class X11 {\n" +
"}");
@@ -4692,18 +4692,18 @@ public void testBug521362_emptyFile() {
.append("\" ");
runConformModuleTest(files,
- buffer,
+ buffer,
"",
"",
false);
- String expectedOutput = "// Compiled from module-info.java (version 9 : 53.0, no super bit)\n" +
- " module mod.one {\n" +
- " // Version: \n" +
- "\n" +
- " requires java.base;\n" +
- "\n" +
- " exports pack1;\n" +
- "\n" +
+ String expectedOutput = "// Compiled from module-info.java (version 9 : 53.0, no super bit)\n" +
+ " module mod.one {\n" +
+ " // Version: \n" +
+ "\n" +
+ " requires java.base;\n" +
+ "\n" +
+ " exports pack1;\n" +
+ "\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + out + File.separator + "module-info.class", "module-info", expectedOutput);
}
@@ -4713,8 +4713,8 @@ public void testBug521362_emptyFile() {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports pack1;\n" +
" exports pack2 to second;\n" +
@@ -4724,27 +4724,27 @@ public void testBug521362_emptyFile() {
" provides pack1.I11 with pack1.X11;\n" +
" requires transitive java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pack1", "I11.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pack1", "I11.java",
"package pack1;\n" +
"public interface I11 {\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pack1", "X11.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pack1", "X11.java",
"package pack1;\n" +
"public class X11 implements I11{\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pack2", "X21.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pack2", "X21.java",
"package pack2;\n" +
"public class X21 {\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pack3", "X31.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pack3", "X31.java",
"package pack3;\n" +
"public class X31 {\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pack4", "X41.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pack4", "X41.java",
"package pack4;\n" +
"public class X41 {\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "pack5", "X51.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "pack5", "X51.java",
"package pack5;\n" +
"public class X51 {\n" +
"}");
@@ -4756,27 +4756,27 @@ public void testBug521362_emptyFile() {
.append("\" ");
files.forEach(name -> buffer.append(" \"" + name + "\""));
runConformTest(new String[0],
- buffer.toString(),
+ buffer.toString(),
"",
"",
false);
- String expectedOutput = "// Compiled from module-info.java (version 9 : 53.0, no super bit)\n" +
- " module mod.one {\n" +
- " // Version: \n" +
- "\n" +
- " requires transitive java.sql;\n" +
- " requires java.base;\n" +
- "\n" +
- " exports pack1;\n" +
- " exports pack2 to second;\n" +
- "\n" +
- " opens pack3;\n" +
- " opens pack4 to third;\n" +
- "\n" +
- " uses pack5.X51\n" +
- "\n" +
- " provides pack1.I11 with pack1.X11;\n" +
- "\n" +
+ String expectedOutput = "// Compiled from module-info.java (version 9 : 53.0, no super bit)\n" +
+ " module mod.one {\n" +
+ " // Version: \n" +
+ "\n" +
+ " requires transitive java.sql;\n" +
+ " requires java.base;\n" +
+ "\n" +
+ " exports pack1;\n" +
+ " exports pack2 to second;\n" +
+ "\n" +
+ " opens pack3;\n" +
+ " opens pack4 to third;\n" +
+ "\n" +
+ " uses pack5.X51\n" +
+ "\n" +
+ " provides pack1.I11 with pack1.X11;\n" +
+ "\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + out + File.separator + "module-info.class", "module-info", expectedOutput);
}
@@ -4786,27 +4786,27 @@ public void testBug521362_emptyFile() {
String srcDir = OUTPUT_DIR + File.separator + "src";
String moduleLoc = srcDir + File.separator + "test";
Runner runner = new Runner();
- runner.createFile(moduleLoc, "module-info.java",
+ runner.createFile(moduleLoc, "module-info.java",
"module test {\n" +
" requires org.astro;\n" +
"}");
- runner.createFile(moduleLoc + File.separator + "p", "Test.java",
+ runner.createFile(moduleLoc + File.separator + "p", "Test.java",
"package p;\n" +
- "import org.astro.World;\n" +
+ "import org.astro.World;\n" +
"public class Test {\n" +
" World w = null;\n" +
"}");
moduleLoc = srcDir + File.separator + "org.astro";
- runner.createFile(moduleLoc, "module-info.java",
+ runner.createFile(moduleLoc, "module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
"}");
- runner.createFile(moduleLoc + File.separator + "org" + File.separator + "astro", "World.java",
+ runner.createFile(moduleLoc + File.separator + "org" + File.separator + "astro", "World.java",
"package org.astro;\n" +
- "public interface World {\n" +
- " public static String name() {\n" +
- " return \"\";\n" +
- " }\n" +
+ "public interface World {\n" +
+ " public static String name() {\n" +
+ " return \"\";\n" +
+ " }\n" +
"}");
runner.commandLine.append("-d " + outDir )
.append(" -source 9 ")
@@ -4821,28 +4821,28 @@ public void testBug521362_emptyFile() {
String moduleLoc = srcDir + File.separator + "test";
Runner runner = new Runner();
// not adding some files to the command line
- writeFile(moduleLoc, "module-info.java",
+ writeFile(moduleLoc, "module-info.java",
"module test {\n" +
" requires org.astro;\n" +
"}");
// the only file added:
- runner.createFile(moduleLoc + File.separator + "p", "Test.java",
+ runner.createFile(moduleLoc + File.separator + "p", "Test.java",
"package p;\n" +
- "import org.astro.World;\n" +
+ "import org.astro.World;\n" +
"public class Test {\n" +
" World w = null;\n" +
"}");
moduleLoc = srcDir + File.separator + "org.astro";
- writeFile(moduleLoc, "module-info.java",
+ writeFile(moduleLoc, "module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
"}");
- writeFile(moduleLoc + File.separator + "org" + File.separator + "astro", "World.java",
+ writeFile(moduleLoc + File.separator + "org" + File.separator + "astro", "World.java",
"package org.astro;\n" +
- "public interface World {\n" +
- " public static String name() {\n" +
- " return \"\";\n" +
- " }\n" +
+ "public interface World {\n" +
+ " public static String name() {\n" +
+ " return \"\";\n" +
+ " }\n" +
"}");
runner.commandLine.append("-d " + outDir )
.append(" -source 9 ")
@@ -4856,28 +4856,28 @@ public void testBug521362_emptyFile() {
String srcDir = OUTPUT_DIR + File.separator + "src";
String moduleLoc = srcDir + File.separator + "test";
Runner runner = new Runner();
- runner.createFile(moduleLoc, "module-info.java",
+ runner.createFile(moduleLoc, "module-info.java",
"module test {\n" +
" requires org.astro;\n" +
"}");
- runner.createFile(moduleLoc + File.separator + "p", "Test.java",
+ runner.createFile(moduleLoc + File.separator + "p", "Test.java",
"package p;\n" +
- "import org.astro.World;\n" +
+ "import org.astro.World;\n" +
"public class Test {\n" +
" World w = null;\n" +
"}");
moduleLoc = srcDir + File.separator + "org.astro";
// not adding this file to the command line (intentional?):
- writeFile(moduleLoc, "module-info.java",
+ writeFile(moduleLoc, "module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
"}");
- runner.createFile(moduleLoc + File.separator + "org" + File.separator + "astro", "World.java",
+ runner.createFile(moduleLoc + File.separator + "org" + File.separator + "astro", "World.java",
"package org.astro;\n" +
- "public interface World {\n" +
- " public static String name() {\n" +
- " return \"\";\n" +
- " }\n" +
+ "public interface World {\n" +
+ " public static String name() {\n" +
+ " return \"\";\n" +
+ " }\n" +
"}");
runner.commandLine.append("-d " + outDir )
.append(" -source 9 ")
@@ -4890,25 +4890,25 @@ public void testBug521362_emptyFile() {
String outDir = OUTPUT_DIR + File.separator + "bin";
String srcDir = OUTPUT_DIR + File.separator + "src";
String moduleLoc = srcDir + File.separator + "test";
- List<String> files = new ArrayList<>();
+ List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc + File.separator + "p", "Test.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "Test.java",
"package p;\n" +
- "import org.astro.World;\n" +
+ "import org.astro.World;\n" +
"public class Test {\n" +
" World w = null;\n" +
"}");
moduleLoc = srcDir + File.separator + "org.astro";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "org" + File.separator + "astro", "World.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "org" + File.separator + "astro", "World.java",
"package org.astro;\n" +
- "public interface World {\n" +
- " public static String name() {\n" +
- " return \"\";\n" +
- " }\n" +
+ "public interface World {\n" +
+ " public static String name() {\n" +
+ " return \"\";\n" +
+ " }\n" +
"}");
StringBuffer buffer = new StringBuffer();
buffer.append("-d " + outDir )
@@ -4916,7 +4916,7 @@ public void testBug521362_emptyFile() {
.append(" --module-source-path " + "\"" + srcDir + "\" ");
runNegativeModuleTest(files, buffer,
"",
- "\'---OUTPUT_DIR_PLACEHOLDER---/src/test/p/Test.java\' does not belong to a module on the module source path\n",
+ "\'---OUTPUT_DIR_PLACEHOLDER---/src/test/p/Test.java\' does not belong to a module on the module source path\n",
false,
"not in a module on the module source path");
}
@@ -4925,25 +4925,25 @@ public void testBug521362_emptyFile() {
String outDir = OUTPUT_DIR + File.separator + "bin";
String srcDir = OUTPUT_DIR + File.separator + "src";
String moduleLoc = srcDir + File.separator + "test";
- List<String> files = new ArrayList<>();
+ List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc + File.separator + "p", "Test.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "Test.java",
"package p;\n" +
- "import org.astro.World;\n" +
+ "import org.astro.World;\n" +
"public class Test {\n" +
" World w = null;\n" +
"}");
moduleLoc = srcDir + File.separator + "org.astro";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "org" + File.separator + "astro", "World.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "org" + File.separator + "astro", "World.java",
"package org.astro;\n" +
- "public interface World {\n" +
- " public static String name() {\n" +
- " return \"\";\n" +
- " }\n" +
+ "public interface World {\n" +
+ " public static String name() {\n" +
+ " return \"\";\n" +
+ " }\n" +
"}");
StringBuffer buffer = new StringBuffer();
buffer.append("-d " + outDir )
@@ -4953,7 +4953,7 @@ public void testBug521362_emptyFile() {
.append(srcDir + File.separator + "test" + File.separator + "p" + File.separator + "Test.java");
runNegativeModuleTest(Collections.emptyList(), buffer,
"",
- "\'---OUTPUT_DIR_PLACEHOLDER---/src/test/p/Test.java\' does not belong to a module on the module source path\n",
+ "\'---OUTPUT_DIR_PLACEHOLDER---/src/test/p/Test.java\' does not belong to a module on the module source path\n",
false,
"not in a module on the module source path");
}
@@ -4962,25 +4962,25 @@ public void testBug521362_emptyFile() {
String outDir = OUTPUT_DIR + File.separator + "bin";
String srcDir = OUTPUT_DIR + File.separator + "src";
String moduleLoc = srcDir + File.separator + "test";
- List<String> files = new ArrayList<>();
+ List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc + File.separator + "p", "Test.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "Test.java",
"package p;\n" +
- "import org.astro.World;\n" +
+ "import org.astro.World;\n" +
"public class Test {\n" +
" World w = null;\n" +
"}");
moduleLoc = srcDir + File.separator + "org.astro";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module org.astro {\n" +
" exports org.astro;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "org" + File.separator + "astro", "World.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "org" + File.separator + "astro", "World.java",
"package org.astro;\n" +
- "public interface World {\n" +
- " public static String name() {\n" +
- " return \"\";\n" +
- " }\n" +
+ "public interface World {\n" +
+ " public static String name() {\n" +
+ " return \"\";\n" +
+ " }\n" +
"}");
StringBuffer buffer = new StringBuffer();
buffer.append("-d " + outDir )
@@ -4991,7 +4991,7 @@ public void testBug521362_emptyFile() {
.append(srcDir + File.separator + "test" + File.separator + "p" + File.separator + "Test.java");
runNegativeModuleTest(Collections.emptyList(), buffer,
"",
- "\'---OUTPUT_DIR_PLACEHOLDER---/src/test/p/Test.java\' does not belong to a module on the module source path\n",
+ "\'---OUTPUT_DIR_PLACEHOLDER---/src/test/p/Test.java\' does not belong to a module on the module source path\n",
false,
"not in a module on the module source path");
}
@@ -5003,22 +5003,22 @@ public void testBug521362_emptyFile() {
File srcDir = new File(directory);
String moduleLoc = directory + File.separator + "mod.x";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.x { \n" +
" exports px;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "px", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "px", "C1.java",
"package px;\n" +
"public class C1 {\n" +
"}\n");
moduleLoc = directory + File.separator + "mod.y";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.y { \n" +
" exports py;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "py", "C1.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "py", "C1.java",
"package py;\n" +
"public class C1 {\n" +
"}\n");
@@ -5032,19 +5032,19 @@ public void testBug521362_emptyFile() {
.append(" --module-source-path " + "\"" + directory + "\"");
for (String fileName : files)
buffer.append(" \"").append(fileName).append("\"");
- runConformTest(new String[0],
+ runConformTest(new String[0],
buffer.toString(),
"",
"",
false);
Util.flushDirectoryContent(srcDir);
files.clear();
- writeFileCollecting(files, directory, "module-info.java",
+ writeFileCollecting(files, directory, "module-info.java",
"module test { \n" +
" requires mod.x;\n" +
" requires mod.y;\n" +
"}");
- writeFileCollecting(files, directory + File.separator + "p", "X.java",
+ writeFileCollecting(files, directory + File.separator + "p", "X.java",
"package p;\n" +
"public class X extends px.C1 { \n" +
" py.C1 c = null;\n" +
@@ -5056,7 +5056,7 @@ public void testBug521362_emptyFile() {
.append(Util.getJavaClassLibsAsString())
.append("\" ")
.append(" --module-path " + "\"" + OUTPUT_DIR + File.separator + out + File.separator + "mod.x" + File.pathSeparator + OUTPUT_DIR + File.separator + out + File.separator + "mod.y" + "\"");
- runConformModuleTest(files,
+ runConformModuleTest(files,
buffer,
"",
"",
@@ -5073,12 +5073,12 @@ public void testBug521362_emptyFile() {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" requires java.sql;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "Test.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "Test.java",
"package p;\n" +
"public class Test {\n" +
" java.sql.Connection conn = null;\n" +
@@ -5107,14 +5107,14 @@ public void testBug521362_emptyFile() {
new String[] {
"p/X.java",
"package p;\n" +
- "import java.lang.annotation.*;\n" +
+ "import java.lang.annotation.*;\n" +
"@Target(ElementType.MODULE)\n" +
"public @interface X {\n" +
- " ElementType value();\n" +
+ " ElementType value();\n" +
"}",
"module-info.java",
- "import java.lang.annotation.*;\n" +
- "@p.X(ElementType.MODULE)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@p.X(ElementType.MODULE)\n" +
"module mod.one { \n" +
"}"
},
@@ -5130,16 +5130,16 @@ public void testBug521362_emptyFile() {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "q", "Test.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "q", "Test.java",
"/*nothing in it */");
StringBuffer buffer = new StringBuffer();
@@ -5166,16 +5166,16 @@ public void testBug521362_emptyFile() {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "q", "Test.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "q", "Test.java",
"package p.q;");
StringBuffer buffer = new StringBuffer();
@@ -5202,16 +5202,16 @@ public void testBug521362_emptyFile() {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "q", "Test.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "q", "Test.java",
"package p.q;\n"
+ "class Test {}");
@@ -5239,16 +5239,16 @@ public void testBug521362_emptyFile() {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "q", "Test.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "q", "Test.java",
"class Test {}");
StringBuffer buffer = new StringBuffer();
@@ -5266,12 +5266,12 @@ public void testBug521362_emptyFile() {
new String[0],
buffer.toString(),
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/q/Test.java (at line 1)\n" +
- " class Test {}\n" +
- " ^\n" +
- "Must declare a named package because this compilation unit is associated to the named module \'mod.one\'\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/q/Test.java (at line 1)\n" +
+ " class Test {}\n" +
+ " ^\n" +
+ "Must declare a named package because this compilation unit is associated to the named module \'mod.one\'\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false,
"unnamed package is not allowed in named modules");
@@ -5282,16 +5282,16 @@ public void testBug521362_emptyFile() {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "q", "Test.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p" + File.separator + "q", "Test.java",
"import java.lang.*;");
StringBuffer buffer = new StringBuffer();
@@ -5310,12 +5310,12 @@ public void testBug521362_emptyFile() {
new String[0],
buffer.toString(),
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/q/Test.java (at line 1)\n" +
- " import java.lang.*;\n" +
- " ^\n" +
- "Must declare a named package because this compilation unit is associated to the named module \'mod.one\'\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p/q/Test.java (at line 1)\n" +
+ " import java.lang.*;\n" +
+ " ^\n" +
+ "Must declare a named package because this compilation unit is associated to the named module \'mod.one\'\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false,
"unnamed package is not allowed in named modules");
@@ -5326,12 +5326,12 @@ public void testBug521362_emptyFile() {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
"}");
@@ -5369,12 +5369,12 @@ public void testBug521362_emptyFile() {
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java",
"package p;\n" +
"public class X {\n" +
"}");
@@ -5390,7 +5390,7 @@ public void testBug521362_emptyFile() {
.append(" --module-source-path " + "\"" + directory + "\" ")
.append(" --module-version fourtyseven.11 ");
if (isJRE9Plus) {
- runNegativeModuleTest(files, buffer, "", "fourtyseven.11: Version string does not start with a number\n", false, "bad value");
+ runNegativeModuleTest(files, buffer, "", "fourtyseven.11: Version string does not start with a number\n", false, "bad value");
} else {
runConformModuleTest(files, buffer, "Could not invoke method java.lang.module.ModuleDescriptor.Version.parse(), cannot validate module version.\n", "", false);
}
@@ -5400,25 +5400,25 @@ public void testBug521362_emptyFile() {
Util.flushDirectoryContent(outputDirectory);
String out = "bin";
String directory = OUTPUT_DIR + File.separator + "src";
-
+
String moduleLoc = directory + File.separator + "mod.one";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.one { \n" +
" exports p1.p2;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p1" + File.separator + "p2", "t3.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p1" + File.separator + "p2", "t3.java",
"package p1.p2;\n" +
"public class t3 {\n" +
"}\n");
moduleLoc = directory + File.separator + "mod.two";
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.two { \n" +
" exports p1.p2.t3;\n" +
" requires mod.one;\n" +
"}");
- writeFileCollecting(files, moduleLoc + File.separator + "p1" + File.separator + "p2" + File.separator + "t3", "t4.java",
+ writeFileCollecting(files, moduleLoc + File.separator + "p1" + File.separator + "p2" + File.separator + "t3", "t4.java",
"package p1.p2.t3;\n" +
"public class t4 {\n" +
"}\n");
@@ -5435,12 +5435,12 @@ public void testBug521362_emptyFile() {
files,
buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.two/p1/p2/t3/t4.java (at line 1)\n" +
- " package p1.p2.t3;\n" +
- " ^^^^^^^^\n" +
- "The package p1.p2.t3 collides with a type\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.two/p1/p2/t3/t4.java (at line 1)\n" +
+ " package p1.p2.t3;\n" +
+ " ^^^^^^^^\n" +
+ "The package p1.p2.t3 collides with a type\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false,
"package p1.p2.t3 clashes with class of same name");
@@ -5452,8 +5452,8 @@ public void testBug521362_emptyFile() {
File modDir = new File(OUTPUT_DIR + File.separator + "mod");
createReusableModules(srcDir, outDir, modDir);
String moduleLoc = srcDir + File.separator + "mod.three";
- List<String> files = new ArrayList<>();
- writeFileCollecting(files, moduleLoc, "module-info.java",
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
"module mod.three { \n" +
" exports pkg.invalid;\n" +
"}");
@@ -5469,12 +5469,12 @@ public void testBug521362_emptyFile() {
.append(" --module-source-path " + "\"" + srcDir + "\" ");
runNegativeModuleTest(files, buffer,
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/module-info.java (at line 2)\n" +
- " exports pkg.invalid;\n" +
- " ^^^^^^^^^^^\n" +
- "The package pkg.invalid does not exist or is empty\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.three/module-info.java (at line 2)\n" +
+ " exports pkg.invalid;\n" +
+ " ^^^^^^^^^^^\n" +
+ "The package pkg.invalid does not exist or is empty\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false,
"");
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MultiReleaseJarTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MultiReleaseJarTests.java
index fa0dbd44f..2b6588a48 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MultiReleaseJarTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MultiReleaseJarTests.java
@@ -23,7 +23,7 @@ public class MultiReleaseJarTests extends AbstractBatchCompilerTest {
SourceVersion valueOf = SourceVersion.valueOf("RELEASE_10");
if (valueOf != null) this.isJRE10 = true;
} catch(Exception e) {
-
+
}
}
@@ -41,24 +41,24 @@ public class MultiReleaseJarTests extends AbstractBatchCompilerTest {
runNegativeTest(
new String[] {
"src/X.java",
- "import a.b.c.MultiVersion1.Inner;\n" +
- "import p.q.r.MultiVersion2.Inner;\n" +
- "public class X {\n" +
+ "import a.b.c.MultiVersion1.Inner;\n" +
+ "import p.q.r.MultiVersion2.Inner;\n" +
+ "public class X {\n" +
"}\n"},
"\"" + OUTPUT_DIR + File.separator + "src/X.java\"" +
" -classpath " + path + " --release 8 ",
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/X.java (at line 1)\n" +
- " import a.b.c.MultiVersion1.Inner;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The import a.b.c.MultiVersion1.Inner cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/X.java (at line 2)\n" +
- " import p.q.r.MultiVersion2.Inner;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The import p.q.r.MultiVersion2.Inner cannot be resolved\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/X.java (at line 1)\n" +
+ " import a.b.c.MultiVersion1.Inner;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The import a.b.c.MultiVersion1.Inner cannot be resolved\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/X.java (at line 2)\n" +
+ " import p.q.r.MultiVersion2.Inner;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The import p.q.r.MultiVersion2.Inner cannot be resolved\n" +
+ "----------\n" +
"2 problems (2 errors)\n",
false
);
@@ -70,19 +70,19 @@ public class MultiReleaseJarTests extends AbstractBatchCompilerTest {
runNegativeTest(
new String[] {
"src/X.java",
- "import a.b.c.MultiVersion1.Inner;\n" +
- "import p.q.r.MultiVersion2.Inner;\n" +
- "public class X {\n" +
+ "import a.b.c.MultiVersion1.Inner;\n" +
+ "import p.q.r.MultiVersion2.Inner;\n" +
+ "public class X {\n" +
"}\n"},
"\"" + OUTPUT_DIR + File.separator + "src/X.java\"" +
" -classpath " + path + " --release 9 ",
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/X.java (at line 1)\n" +
- " import a.b.c.MultiVersion1.Inner;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The type a.b.c.MultiVersion1.Inner is not visible\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/X.java (at line 1)\n" +
+ " import a.b.c.MultiVersion1.Inner;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The type a.b.c.MultiVersion1.Inner is not visible\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false
);
@@ -94,7 +94,7 @@ public class MultiReleaseJarTests extends AbstractBatchCompilerTest {
runConformTest(
new String[] {
"src/X.java",
- "import p.q.r.MultiVersion3.Inner;\n" +
+ "import p.q.r.MultiVersion3.Inner;\n" +
"public class X {\n" +
" Inner i = null;\n" +
" p.q.r.MultiVersion2.Inner i2 = null;\n" +
@@ -113,7 +113,7 @@ public class MultiReleaseJarTests extends AbstractBatchCompilerTest {
runNegativeTest(
new String[] {
"src/X.java",
- "import p.q.r.MultiVersion3.Inner;\n" +
+ "import p.q.r.MultiVersion3.Inner;\n" +
"import p.q.r.MultiVersion2.Inner;\n" +
"public class X {\n" +
" Inner i = null;\n" +
@@ -121,12 +121,12 @@ public class MultiReleaseJarTests extends AbstractBatchCompilerTest {
"\"" + OUTPUT_DIR + File.separator + "src/X.java\"" +
" -classpath " + path + " --release 9 ",
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/X.java (at line 2)\n" +
- " import p.q.r.MultiVersion2.Inner;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The import p.q.r.MultiVersion2.Inner collides with another import statement\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/X.java (at line 2)\n" +
+ " import p.q.r.MultiVersion2.Inner;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The import p.q.r.MultiVersion2.Inner collides with another import statement\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false
);
@@ -167,12 +167,12 @@ public class MultiReleaseJarTests extends AbstractBatchCompilerTest {
" \"" + OUTPUT_DIR + File.separator + "src" + File.separator + "MyModule" + File.separator + "p" + File.separator + "X.java\" " +
" --module-path " + path + " --release 9 ",
"",
- "----------\n" +
- "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/MyModule/p/X.java (at line 3)\n" +
- " java.sql.Connection con = null;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The type java.sql.Connection is not accessible\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/MyModule/p/X.java (at line 3)\n" +
+ " java.sql.Connection con = null;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The type java.sql.Connection is not accessible\n" +
+ "----------\n" +
"1 problem (1 error)\n",
false
);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java
index 4cf5e61f5..70e3934f2 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java
@@ -81,16 +81,16 @@ public void test001() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " I i = () -> {\n" +
- " ^^^^^\n" +
- "Lambda expression\'s signature does not match the signature of the functional interface method foo(int, int)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " i++;\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from I to int\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " I i = () -> {\n" +
+ " ^^^^^\n" +
+ "Lambda expression\'s signature does not match the signature of the functional interface method foo(int, int)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " i++;\n" +
+ " ^^^\n" +
+ "Type mismatch: cannot convert from I to int\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382841, ClassCastException while compiling lambda
@@ -111,11 +111,11 @@ public void test002() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " i++;\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from I to int\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " i++;\n" +
+ " ^^^\n" +
+ "Type mismatch: cannot convert from I to int\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382841, ClassCastException while compiling lambda
@@ -136,11 +136,11 @@ public void test003() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " i++;\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from I to int\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " i++;\n" +
+ " ^^^\n" +
+ "Type mismatch: cannot convert from I to int\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383046, syntax error reported incorrectly on syntactically valid lambda expression
@@ -156,16 +156,16 @@ public void test004() {
" int x\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " IX i = () -> 42;\n" +
- " ^^\n" +
- "Void methods cannot return a value\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " int x\n" +
- " ^\n" +
- "Syntax error, insert \";\" to complete FieldDeclaration\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " IX i = () -> 42;\n" +
+ " ^^\n" +
+ "Void methods cannot return a value\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " int x\n" +
+ " ^\n" +
+ "Syntax error, insert \";\" to complete FieldDeclaration\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383085 super::identifier not accepted.
@@ -181,11 +181,11 @@ public void test005() {
" Zork z;\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383046, syntax error reported incorrectly on *syntactically* valid reference expression
@@ -208,26 +208,26 @@ public void test006() {
" int x\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " IX i = Outer<One, Two>.Inner<Three, Four>.Deeper<Five, Six<String>>.Leaf::<Blah, Blah>method;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The member type Outer.Inner<T3,T4> cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type Outer<One,Two>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " IX i = Outer<One, Two>.Inner<Three, Four>.Deeper<Five, Six<String>>.Leaf::<Blah, Blah>method;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Outer.Inner.Deeper cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 12)\n" +
- " IX i = Outer<One, Two>.Inner<Three, Four>.Deeper<Five, Six<String>>.Leaf::<Blah, Blah>method;\n" +
- " ^^^\n" +
- "Six cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 13)\n" +
- " int x\n" +
- " ^\n" +
- "Syntax error, insert \";\" to complete FieldDeclaration\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " IX i = Outer<One, Two>.Inner<Three, Four>.Deeper<Five, Six<String>>.Leaf::<Blah, Blah>method;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The member type Outer.Inner<T3,T4> cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type Outer<One,Two>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 12)\n" +
+ " IX i = Outer<One, Two>.Inner<Three, Four>.Deeper<Five, Six<String>>.Leaf::<Blah, Blah>method;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Outer.Inner.Deeper cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 12)\n" +
+ " IX i = Outer<One, Two>.Inner<Three, Four>.Deeper<Five, Six<String>>.Leaf::<Blah, Blah>method;\n" +
+ " ^^^\n" +
+ "Six cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 13)\n" +
+ " int x\n" +
+ " ^\n" +
+ "Syntax error, insert \";\" to complete FieldDeclaration\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383096, NullPointerException with a wrong lambda code snippet
@@ -244,11 +244,11 @@ public void _test007() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " int\n" +
- " ^^^\n" +
- "Syntax error on token \"int\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " int\n" +
+ " ^^^\n" +
+ "Syntax error on token \"int\", delete this token\n" +
"----------\n" /* expected compiler log */,
true /* perform statement recovery */);
}
@@ -266,11 +266,11 @@ public void test008() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " I i = (X this) -> 10; \n" +
- " ^^^^\n" +
- "Lambda expressions cannot declare a this parameter\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " I i = (X this) -> 10; \n" +
+ " ^^^^\n" +
+ "Lambda expressions cannot declare a this parameter\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383949, Explicit this parameter illegal in lambda expressions
@@ -289,21 +289,21 @@ public void test009() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " ActionListener al = (public xyz) -> System.out.println(xyz); \n" +
- " ^^^\n" +
- "Syntax error, modifiers and annotations are not allowed for the lambda parameter xyz as its type is elided\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " I f = (abstract final s, @Nullable t) -> System.out.println(s + t); \n" +
- " ^\n" +
- "Syntax error, modifiers and annotations are not allowed for the lambda parameter s as its type is elided\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " I f = (abstract final s, @Nullable t) -> System.out.println(s + t); \n" +
- " ^\n" +
- "Syntax error, modifiers and annotations are not allowed for the lambda parameter t as its type is elided\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " ActionListener al = (public xyz) -> System.out.println(xyz); \n" +
+ " ^^^\n" +
+ "Syntax error, modifiers and annotations are not allowed for the lambda parameter xyz as its type is elided\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " I f = (abstract final s, @Nullable t) -> System.out.println(s + t); \n" +
+ " ^\n" +
+ "Syntax error, modifiers and annotations are not allowed for the lambda parameter s as its type is elided\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " I f = (abstract final s, @Nullable t) -> System.out.println(s + t); \n" +
+ " ^\n" +
+ "Syntax error, modifiers and annotations are not allowed for the lambda parameter t as its type is elided\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=381121, [] should be accepted in reference expressions.
@@ -322,16 +322,16 @@ public void test010() {
" Zork z;\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382701, [1.8][compiler] Implement semantic analysis of Lambda expressions & Reference expressions.
public void test011() {
- // This test checks that common semantic checks are indeed
+ // This test checks that common semantic checks are indeed
this.runNegativeTest(
new String[] {
"X.java",
@@ -342,7 +342,7 @@ public void test011() {
" I i = (int [] ia) -> {\n" +
" Zork z;\n" + // Error: No such type
" unknown = 0;\n;" + // Error: No such variable
- " int a = 42 + ia;\n" + // Error: int + int[] is wrong
+ " int a = 42 + ia;\n" + // Error: int + int[] is wrong
" return ia.clone();\n" +
" };\n" +
" static void staticLambda() {\n" +
@@ -361,47 +361,47 @@ public void test011() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " unknown = 0;\n" +
- " ^^^^^^^\n" +
- "unknown cannot be resolved to a variable\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " ; int a = 42 + ia;\n" +
- " ^^^^^^^\n" +
- "The operator + is undefined for the argument type(s) int, int[]\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 12)\n" +
- " I i = (int [] ia) -> this;\n" +
- " ^^^^\n" +
- "Cannot use this in a static context\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 16)\n" +
- " int b = 42 + array;\n" +
- " ^^^^^^^^^^\n" +
- "The operator + is undefined for the argument type(s) int, int[]\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 18)\n" +
- " return;\n" +
- " ^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " unknown = 0;\n" +
+ " ^^^^^^^\n" +
+ "unknown cannot be resolved to a variable\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " ; int a = 42 + ia;\n" +
+ " ^^^^^^^\n" +
+ "The operator + is undefined for the argument type(s) int, int[]\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 12)\n" +
+ " I i = (int [] ia) -> this;\n" +
+ " ^^^^\n" +
+ "Cannot use this in a static context\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 16)\n" +
+ " int b = 42 + array;\n" +
+ " ^^^^^^^^^^\n" +
+ "The operator + is undefined for the argument type(s) int, int[]\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 18)\n" +
+ " return;\n" +
+ " ^^^^^^^\n" +
"This method must return a result of type Object\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 20)\n" +
- " Runnable r = () -> { return 42; };\n" +
- " ^^^^^^^^^^\n" +
- "Void methods cannot return a value\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 20)\n" +
+ " Runnable r = () -> { return 42; };\n" +
+ " ^^^^^^^^^^\n" +
+ "Void methods cannot return a value\n" +
"----------\n"
);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384600, [1.8] 'this' should not be allowed in lambda expressions in contexts that don't allow it
public void test012() {
- // This test checks that common semantic checks are indeed
+ // This test checks that common semantic checks are indeed
this.runNegativeTest(
new String[] {
"X.java",
@@ -422,21 +422,21 @@ public void test012() {
" }\n" +
"}\n" ,
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " System.out.println(this);\n" +
- " ^^^^\n" +
- "Cannot use this in a static context\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " System.out.println(this);\n" +
- " ^^^^\n" +
- "Cannot use this in a static context\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " System.out.println(this);\n" +
- " ^^^^\n" +
- "Cannot use this in a static context\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " System.out.println(this);\n" +
+ " ^^^^\n" +
+ "Cannot use this in a static context\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " System.out.println(this);\n" +
+ " ^^^^\n" +
+ "Cannot use this in a static context\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " System.out.println(this);\n" +
+ " ^^^^\n" +
+ "Cannot use this in a static context\n" +
"----------\n"
);
}
@@ -462,11 +462,11 @@ public void test013() {
" }\n" +
"}\n" ,
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " void foo(Zork z) {\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " void foo(Zork z) {\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n"
);
}
@@ -484,31 +484,31 @@ public void test014() {
"@interface Marker {\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " I i = (final @Marker int x, @Undefined static strictfp public Object o, static volatile int p) -> x;\n" +
- " ^^^^^^^^^\n" +
- "Undefined cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " I i = (final @Marker int x, @Undefined static strictfp public Object o, static volatile int p) -> x;\n" +
- " ^^^^^^\n" +
- "Lambda expression\'s parameter o is expected to be of type int\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " I i = (final @Marker int x, @Undefined static strictfp public Object o, static volatile int p) -> x;\n" +
- " ^\n" +
- "Illegal modifier for parameter o; only final is permitted\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " I i = (final @Marker int x, @Undefined static strictfp public Object o, static volatile int p) -> x;\n" +
- " ^\n" +
- "Illegal modifier for parameter p; only final is permitted\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 5)\n" +
- " I i = (final @Marker int x, @Undefined static strictfp public Object o, static volatile int p) -> x;\n" +
- " ^\n" +
- "Void methods cannot return a value\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " I i = (final @Marker int x, @Undefined static strictfp public Object o, static volatile int p) -> x;\n" +
+ " ^^^^^^^^^\n" +
+ "Undefined cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " I i = (final @Marker int x, @Undefined static strictfp public Object o, static volatile int p) -> x;\n" +
+ " ^^^^^^\n" +
+ "Lambda expression\'s parameter o is expected to be of type int\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " I i = (final @Marker int x, @Undefined static strictfp public Object o, static volatile int p) -> x;\n" +
+ " ^\n" +
+ "Illegal modifier for parameter o; only final is permitted\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " I i = (final @Marker int x, @Undefined static strictfp public Object o, static volatile int p) -> x;\n" +
+ " ^\n" +
+ "Illegal modifier for parameter p; only final is permitted\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 5)\n" +
+ " I i = (final @Marker int x, @Undefined static strictfp public Object o, static volatile int p) -> x;\n" +
+ " ^\n" +
+ "Void methods cannot return a value\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399534, [1.8][compiler] Lambda parameters must be checked for compatibility with the single abstract method of the functional interface.
@@ -540,56 +540,56 @@ public void test015() {
" K k6 = l -> {};\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " I i1 = (String y) -> {};\n" +
- " ^^^^^^\n" +
- "Lambda expression\'s parameter y is expected to be of type int\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " I i4 = (int x, String y) -> {};\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Lambda expression\'s signature does not match the signature of the functional interface method run(int)\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 12)\n" +
- " J j1 = () -> {};\n" +
- " ^^^^^\n" +
- "Lambda expression\'s signature does not match the signature of the functional interface method run(int, String)\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 14)\n" +
- " J j3 = (String x, int s) -> {};\n" +
- " ^^^^^^\n" +
- "Lambda expression\'s parameter x is expected to be of type int\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 14)\n" +
- " J j3 = (String x, int s) -> {};\n" +
- " ^^^\n" +
- "Lambda expression\'s parameter s is expected to be of type String\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 16)\n" +
- " J j5 = x -> {};\n" +
- " ^^^^\n" +
- "Lambda expression\'s signature does not match the signature of the functional interface method run(int, String)\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 17)\n" +
- " K k1 = (Collection l) -> {};\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 17)\n" +
- " K k1 = (Collection l) -> {};\n" +
- " ^^^^^^^^^^\n" +
- "Lambda expression\'s parameter l is expected to be of type Collection<String>\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 18)\n" +
- " K k2 = (Collection <Integer> l) -> {};\n" +
- " ^^^^^^^^^^\n" +
- "Lambda expression\'s parameter l is expected to be of type Collection<String>\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 20)\n" +
- " K k4 = (List <String> l) -> {};\n" +
- " ^^^^\n" +
- "Lambda expression\'s parameter l is expected to be of type Collection<String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " I i1 = (String y) -> {};\n" +
+ " ^^^^^^\n" +
+ "Lambda expression\'s parameter y is expected to be of type int\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " I i4 = (int x, String y) -> {};\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Lambda expression\'s signature does not match the signature of the functional interface method run(int)\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 12)\n" +
+ " J j1 = () -> {};\n" +
+ " ^^^^^\n" +
+ "Lambda expression\'s signature does not match the signature of the functional interface method run(int, String)\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 14)\n" +
+ " J j3 = (String x, int s) -> {};\n" +
+ " ^^^^^^\n" +
+ "Lambda expression\'s parameter x is expected to be of type int\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 14)\n" +
+ " J j3 = (String x, int s) -> {};\n" +
+ " ^^^\n" +
+ "Lambda expression\'s parameter s is expected to be of type String\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 16)\n" +
+ " J j5 = x -> {};\n" +
+ " ^^^^\n" +
+ "Lambda expression\'s signature does not match the signature of the functional interface method run(int, String)\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 17)\n" +
+ " K k1 = (Collection l) -> {};\n" +
+ " ^^^^^^^^^^\n" +
+ "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 17)\n" +
+ " K k1 = (Collection l) -> {};\n" +
+ " ^^^^^^^^^^\n" +
+ "Lambda expression\'s parameter l is expected to be of type Collection<String>\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 18)\n" +
+ " K k2 = (Collection <Integer> l) -> {};\n" +
+ " ^^^^^^^^^^\n" +
+ "Lambda expression\'s parameter l is expected to be of type Collection<String>\n" +
+ "----------\n" +
+ "10. ERROR in X.java (at line 20)\n" +
+ " K k4 = (List <String> l) -> {};\n" +
+ " ^^^^\n" +
+ "Lambda expression\'s parameter l is expected to be of type Collection<String>\n" +
"----------\n");
}
// Bug 398734 - [1.8][compiler] Lambda expression type or return type should be checked against the target functional interface method's result type
@@ -610,15 +610,15 @@ public void test016() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " I i1 = () -> 42;\n" +
- " ^^\n" +
- "Type mismatch: cannot convert from int to String\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " I i3 = () -> { return 42; };\n" +
- " ^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " I i1 = () -> 42;\n" +
+ " ^^\n" +
+ "Type mismatch: cannot convert from int to String\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " I i3 = () -> { return 42; };\n" +
+ " ^^\n" +
"Type mismatch: cannot convert from int to String\n" +
"----------\n");
}
@@ -640,16 +640,16 @@ public void test017() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " I i2 = () -> \"Hello\";\n" +
- " ^^^^^^^\n" +
- "Type mismatch: cannot convert from String to Integer\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " I i4 = () -> { return \"Hello\"; };\n" +
- " ^^^^^^^\n" +
- "Type mismatch: cannot convert from String to Integer\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " I i2 = () -> \"Hello\";\n" +
+ " ^^^^^^^\n" +
+ "Type mismatch: cannot convert from String to Integer\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " I i4 = () -> { return \"Hello\"; };\n" +
+ " ^^^^^^^\n" +
+ "Type mismatch: cannot convert from String to Integer\n" +
"----------\n");
}
// Bug 398734 - [1.8][compiler] Lambda expression type or return type should be checked against the target functional interface method's result type
@@ -672,27 +672,27 @@ public void test018() {
" I i5 = () -> { return new P(); };\n" +
" }\n" +
"}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " I i1 = () -> 42;\n" +
- " ^^\n" +
- "Type mismatch: cannot convert from int to I\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " I i2 = () -> \"Hello\";\n" +
- " ^^^^^^^\n" +
- "Type mismatch: cannot convert from String to I\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " I i3 = () -> { return 42; };\n" +
- " ^^\n" +
- "Type mismatch: cannot convert from int to I\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 12)\n" +
- " I i4 = () -> { return \"Hello\"; };\n" +
- " ^^^^^^^\n" +
- "Type mismatch: cannot convert from String to I\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " I i1 = () -> 42;\n" +
+ " ^^\n" +
+ "Type mismatch: cannot convert from int to I\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " I i2 = () -> \"Hello\";\n" +
+ " ^^^^^^^\n" +
+ "Type mismatch: cannot convert from String to I\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " I i3 = () -> { return 42; };\n" +
+ " ^^\n" +
+ "Type mismatch: cannot convert from int to I\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 12)\n" +
+ " I i4 = () -> { return \"Hello\"; };\n" +
+ " ^^^^^^^\n" +
+ "Type mismatch: cannot convert from String to I\n" +
"----------\n");
}
// Bug 398734 - [1.8][compiler] Lambda expression type or return type should be checked against the target functional interface method's result type
@@ -709,17 +709,17 @@ public void test019() {
" I i4 = () -> System.out.println();\n" +
" I i5 = () -> { System.out.println(); };\n" +
"}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " I i1 = () -> 42;\n" +
- " ^^\n" +
- "Void methods cannot return a value\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " I i3 = () -> { return 42; };\n" +
- " ^^^^^^^^^^\n" +
- "Void methods cannot return a value\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " I i1 = () -> 42;\n" +
+ " ^^\n" +
+ "Void methods cannot return a value\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " I i3 = () -> { return 42; };\n" +
+ " ^^^^^^^^^^\n" +
+ "Void methods cannot return a value\n" +
"----------\n");
}
// Bug 398734 - [1.8][compiler] Lambda expression type or return type should be checked against the target functional interface method's result type
@@ -733,12 +733,12 @@ public void test020() {
"public class X {\n" +
" I i5 = (x) -> { if (x == 0) throw new NullPointerException(); };\n" +
"}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " I i5 = (x) -> { if (x == 0) throw new NullPointerException(); };\n" +
- " ^^^^^^\n" +
- "This method must return a result of type int\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " I i5 = (x) -> { if (x == 0) throw new NullPointerException(); };\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type int\n" +
"----------\n");
}
// Bug 398734 - [1.8][compiler] Lambda expression type or return type should be checked against the target functional interface method's result type
@@ -753,12 +753,12 @@ public void test021() {
" I i5 = (x) -> { if (x == 0) throw new NullPointerException(); throw new NullPointerException(); };\n" +
" Zork z;\n" +
"}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// Bug 398734 - [1.8][compiler] Lambda expression type or return type should be checked against the target functional interface method's result type
@@ -776,12 +776,12 @@ public void test022() {
" I I = () -> () -> 10;\n" +
" Zork z;\n" +
"}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// Bug 398734 - [1.8][compiler] Lambda expression type or return type should be checked against the target functional interface method's result type
@@ -801,17 +801,17 @@ public void test023() {
" I i3 = () -> () -> 10;\n" +
" I i4 = () -> { return () -> 10; };\n" +
"}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " I i1 = () -> 10;\n" +
- " ^^\n" +
- "Type mismatch: cannot convert from int to J\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " I i2 = () -> { return 10; };\n" +
- " ^^\n" +
- "Type mismatch: cannot convert from int to J\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " I i1 = () -> 10;\n" +
+ " ^^\n" +
+ "Type mismatch: cannot convert from int to J\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " I i2 = () -> { return 10; };\n" +
+ " ^^\n" +
+ "Type mismatch: cannot convert from int to J\n" +
"----------\n");
}
// Bug 398734 - [1.8][compiler] Lambda expression type or return type should be checked against the target functional interface method's result type
@@ -830,12 +830,12 @@ public void test024() {
" return 42;\n" +
" }\n" +
"}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " Object foo(Zork z) {\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " Object foo(Zork z) {\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=398734 - [1.8][compiler] Lambda expression type or return type should be checked against the target functional interface method's result type
@@ -843,20 +843,20 @@ public void test025() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\r\n" +
- " String foo();\r\n" +
- "}\r\n" +
- "public class X {\r\n" +
- " public static void main(String[] args) {\r\n" +
- " I i = () -> 42;\r\n" +
- " I i2 = () -> \"Hello, Lambda\";\r\n" +
- " }\r\n" +
+ "interface I {\r\n" +
+ " String foo();\r\n" +
+ "}\r\n" +
+ "public class X {\r\n" +
+ " public static void main(String[] args) {\r\n" +
+ " I i = () -> 42;\r\n" +
+ " I i2 = () -> \"Hello, Lambda\";\r\n" +
+ " }\r\n" +
"}"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " I i = () -> 42;\n" +
- " ^^\n" +
- "Type mismatch: cannot convert from int to String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " I i = () -> 42;\n" +
+ " ^^\n" +
+ "Type mismatch: cannot convert from int to String\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=398734 - [1.8][compiler] Lambda expression type or return type should be checked against the target functional interface method's result type
@@ -864,24 +864,24 @@ public void test026() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\r\n" +
- " String foo();\r\n" +
- "}\r\n" +
- "public class X {\r\n" +
- " public static void main(String[] args) {\r\n" +
+ "interface I {\r\n" +
+ " String foo();\r\n" +
+ "}\r\n" +
+ "public class X {\r\n" +
+ " public static void main(String[] args) {\r\n" +
" I i = () -> {\r\n" +
" return 42;\r\n" +
- " };\r\n" +
+ " };\r\n" +
" I i2 = () -> {\r\n" +
" return \"Hello, Lambda as a block!\";\r\n" +
- " };\r\n" +
- " }\r\n" +
+ " };\r\n" +
+ " }\r\n" +
"}"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " return 42;\n" +
- " ^^\n" +
- "Type mismatch: cannot convert from int to String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " return 42;\n" +
+ " ^^\n" +
+ "Type mismatch: cannot convert from int to String\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=398734 - [1.8][compiler] Lambda expression type or return type should be checked against the target functional interface method's result type
@@ -889,51 +889,51 @@ public void test027() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\r\n" +
- " int baz();\r\n" +
- "}\r\n" +
- "public class X {\r\n" +
- " public static void main(String[] args) {\n" +
- " I i1 = () -> {\n" +
- " System.out.println(\"No return\");\n" +
- " }; // Error: Lambda block should return value\n" +
- " I i2 = () -> {\n" +
- " if (Math.random() < 0.5) return 42;\n" +
- " }; // Error: Lambda block doesn't always return a value\n" +
- " I i3 = () -> {\n" +
- " return 42;\n" +
- " System.out.println(\"Dead!\");\n" +
- " }; // Error: Lambda block has dead code\n" +
- " }\n" +
- " public static I doesFlowInfoEscape() {\n" +
- " I i1 = () -> {\n" +
- " return 42;\n" +
- " };\n" +
- " return i1; // Must not complain about unreachable code!\n" +
- " }\n" +
- " public static I areExpresionsCheckedForReturns() {\n" +
- " I i1 = () -> 42; // Must not complain about missing return!\n" +
- " return i1;\n" +
- " }\n" +
+ "interface I {\r\n" +
+ " int baz();\r\n" +
+ "}\r\n" +
+ "public class X {\r\n" +
+ " public static void main(String[] args) {\n" +
+ " I i1 = () -> {\n" +
+ " System.out.println(\"No return\");\n" +
+ " }; // Error: Lambda block should return value\n" +
+ " I i2 = () -> {\n" +
+ " if (Math.random() < 0.5) return 42;\n" +
+ " }; // Error: Lambda block doesn't always return a value\n" +
+ " I i3 = () -> {\n" +
+ " return 42;\n" +
+ " System.out.println(\"Dead!\");\n" +
+ " }; // Error: Lambda block has dead code\n" +
+ " }\n" +
+ " public static I doesFlowInfoEscape() {\n" +
+ " I i1 = () -> {\n" +
+ " return 42;\n" +
+ " };\n" +
+ " return i1; // Must not complain about unreachable code!\n" +
+ " }\n" +
+ " public static I areExpresionsCheckedForReturns() {\n" +
+ " I i1 = () -> 42; // Must not complain about missing return!\n" +
+ " return i1;\n" +
+ " }\n" +
"}"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " I i1 = () -> {\n" +
- " ^^^^^\n" +
- "This method must return a result of type int\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " I i2 = () -> {\n" +
- " ^^^^^\n" +
- "This method must return a result of type int\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 14)\n" +
- " System.out.println(\"Dead!\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unreachable code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " I i1 = () -> {\n" +
+ " ^^^^^\n" +
+ "This method must return a result of type int\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " I i2 = () -> {\n" +
+ " ^^^^^\n" +
+ "This method must return a result of type int\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 14)\n" +
+ " System.out.println(\"Dead!\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unreachable code\n" +
"----------\n");
}
-// Bug 399979 - [1.8][compiler] Statement expressions should be allowed in non-block lambda body when return type is void (edit)
+// Bug 399979 - [1.8][compiler] Statement expressions should be allowed in non-block lambda body when return type is void (edit)
public void test028() {
this.runNegativeTest(
new String[] {
@@ -958,16 +958,16 @@ public void test028() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " I i7 = () -> 0;\n" +
- " ^\n" +
- "Void methods cannot return a value\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " I i = () -> 1 + data++;\n" +
- " ^^^^^^^^^^\n" +
- "Void methods cannot return a value\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " I i7 = () -> 0;\n" +
+ " ^\n" +
+ "Void methods cannot return a value\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " I i = () -> 1 + data++;\n" +
+ " ^^^^^^^^^^\n" +
+ "Void methods cannot return a value\n" +
"----------\n");
}
// Bug 384600 - [1.8] 'this' should not be allowed in lambda/Reference expressions in contexts that don't allow it
@@ -1001,26 +1001,26 @@ public void test029() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " I i1 = this::zoo;\n" +
- " ^^^^\n" +
- "Cannot use this in a static context\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " I i2 = super::boo;\n" +
- " ^^^^^\n" +
- "Cannot use super in a static context\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " I i3 = () -> super.zoo();\n" +
- " ^^^^^\n" +
- "Cannot use super in a static context\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " I i4 = () -> this.boo();\n" +
- " ^^^^\n" +
- "Cannot use this in a static context\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " I i1 = this::zoo;\n" +
+ " ^^^^\n" +
+ "Cannot use this in a static context\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " I i2 = super::boo;\n" +
+ " ^^^^^\n" +
+ "Cannot use super in a static context\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " I i3 = () -> super.zoo();\n" +
+ " ^^^^^\n" +
+ "Cannot use super in a static context\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 9)\n" +
+ " I i4 = () -> this.boo();\n" +
+ " ^^^^\n" +
+ "Cannot use this in a static context\n" +
"----------\n");
}
// Bug 382713 - [1.8][compiler] Compiler should reject lambda expressions when target type is not a functional interface
@@ -1039,16 +1039,16 @@ public void test030() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " X x = () -> 10;\n" +
- " ^^^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " I i = () -> 10;\n" +
- " ^^^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " X x = () -> 10;\n" +
+ " ^^^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " I i = () -> 10;\n" +
+ " ^^^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
"----------\n");
}
// Bug 398267 - [1.8][compiler] Variables in the body of the lambda expression should be valid
@@ -1070,31 +1070,31 @@ public void test031() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " p = 10;\n" +
- " ^\n" +
- "p cannot be resolved to a variable\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " Zork z = this.blank;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " Zork z = this.blank;\n" +
- " ^^^^^\n" +
- "blank cannot be resolved or is not a field\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " super.foo();\n" +
- " ^^^\n" +
- "The method foo() is undefined for the type Object\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 10)\n" +
- " goo();\n" +
- " ^^^\n" +
- "The method goo() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " p = 10;\n" +
+ " ^\n" +
+ "p cannot be resolved to a variable\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " Zork z = this.blank;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " Zork z = this.blank;\n" +
+ " ^^^^^\n" +
+ "blank cannot be resolved or is not a field\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 9)\n" +
+ " super.foo();\n" +
+ " ^^^\n" +
+ "The method foo() is undefined for the type Object\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 10)\n" +
+ " goo();\n" +
+ " ^^^\n" +
+ "The method goo() is undefined for the type X\n" +
"----------\n");
}
// Bug 399537 - [1.8][compiler] Exceptions thrown from lambda body must match specification per function descriptor
@@ -1102,27 +1102,27 @@ public void test032() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface IA {\r\n" +
- " void snazz();\r\n" +
- "}\r\n" +
- "interface IB {\r\n" +
- " void baz() throws java.io.IOException;\r\n" +
- "}\r\n" +
- "public class X {\r\n" +
- " public static void main(String[] args) {\n" +
- " IA i1 = () -> {\n" +
- " throw new java.io.EOFException(); // Error: not declared\n" +
- " };\n" +
- " IB i2 = () -> {\n" +
- " throw new java.io.EOFException(); // Fine: IOException is declared\n" +
- " }; // No error, it's all good\n" +
- " }\n" +
+ "interface IA {\r\n" +
+ " void snazz();\r\n" +
+ "}\r\n" +
+ "interface IB {\r\n" +
+ " void baz() throws java.io.IOException;\r\n" +
+ "}\r\n" +
+ "public class X {\r\n" +
+ " public static void main(String[] args) {\n" +
+ " IA i1 = () -> {\n" +
+ " throw new java.io.EOFException(); // Error: not declared\n" +
+ " };\n" +
+ " IB i2 = () -> {\n" +
+ " throw new java.io.EOFException(); // Fine: IOException is declared\n" +
+ " }; // No error, it's all good\n" +
+ " }\n" +
"}"},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " throw new java.io.EOFException(); // Error: not declared\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type EOFException\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " throw new java.io.EOFException(); // Error: not declared\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type EOFException\n" +
"----------\n");
}
// Bug 399537 - [1.8][compiler] Exceptions thrown from lambda body must match specification per function descriptor
@@ -1130,27 +1130,27 @@ public void test033() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface IA {\r\n" +
- " void snazz();\r\n" +
- "}\r\n" +
- "interface IB {\r\n" +
- " void baz() throws java.io.IOException;\r\n" +
- "}\r\n" +
- "public class X {\r\n" +
- " public static void main(String[] args) {\n" +
- " IA i1 = () -> {\n" +
- " throw new java.io.EOFException(); // Error: not declared\n" +
- " };\n" +
- " IB i2 = () -> {\n" +
- " throw new java.io.EOFException(); // Fine: IOException is declared\n" +
- " }; // No error, it's all good\n" +
- " }\n" +
+ "interface IA {\r\n" +
+ " void snazz();\r\n" +
+ "}\r\n" +
+ "interface IB {\r\n" +
+ " void baz() throws java.io.IOException;\r\n" +
+ "}\r\n" +
+ "public class X {\r\n" +
+ " public static void main(String[] args) {\n" +
+ " IA i1 = () -> {\n" +
+ " throw new java.io.EOFException(); // Error: not declared\n" +
+ " };\n" +
+ " IB i2 = () -> {\n" +
+ " throw new java.io.EOFException(); // Fine: IOException is declared\n" +
+ " }; // No error, it's all good\n" +
+ " }\n" +
"}"},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " throw new java.io.EOFException(); // Error: not declared\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type EOFException\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " throw new java.io.EOFException(); // Error: not declared\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type EOFException\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=398734 - [1.8][compiler] Lambda expression type or return type should be checked against the target functional interface method's result type
@@ -1158,22 +1158,22 @@ public void test034() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\r\n" +
- " int foo(int x, int y);\r\n" +
- "}\r\n" +
- "public class X {\r\n" +
- " public static void main(String[] args) {\r\n" +
- " int x = 2;\r\n" +
- " I i = (a, b) -> {\r\n" +
- " return 42.0 + a + args.length; // Type mismatch: cannot convert from double to int\r\n" +
- " };\r\n" +
- " }\r\n" +
+ "interface I {\r\n" +
+ " int foo(int x, int y);\r\n" +
+ "}\r\n" +
+ "public class X {\r\n" +
+ " public static void main(String[] args) {\r\n" +
+ " int x = 2;\r\n" +
+ " I i = (a, b) -> {\r\n" +
+ " return 42.0 + a + args.length; // Type mismatch: cannot convert from double to int\r\n" +
+ " };\r\n" +
+ " }\r\n" +
"}"},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " return 42.0 + a + args.length; // Type mismatch: cannot convert from double to int\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from double to int\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " return 42.0 + a + args.length; // Type mismatch: cannot convert from double to int\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from double to int\n" +
"----------\n");
}
@@ -1191,11 +1191,11 @@ public void test035() {
" Zork z;\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
@@ -1204,32 +1204,32 @@ public void test036() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\r\n" +
- " void foo(int x, int y);\r\n" +
- "}\r\n" +
- "public class X {\r\n" +
- " public static void main(String[] args) {\r\n" +
- " int x, y;\r\n" +
- " I i = (x, y) -> { // Error: x,y being redeclared\r\n" +
- " int args = 10; // Error args is being redeclared\r\n" +
- " };\r\n" +
- " }\r\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " I i = (x, y) -> { // Error: x,y being redeclared\n" +
- " ^\n" +
- "Lambda expression\'s parameter x cannot redeclare another local variable defined in an enclosing scope. \n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " I i = (x, y) -> { // Error: x,y being redeclared\n" +
- " ^\n" +
- "Lambda expression\'s parameter y cannot redeclare another local variable defined in an enclosing scope. \n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " int args = 10; // Error args is being redeclared\n" +
- " ^^^^\n" +
- "Lambda expression\'s local variable args cannot redeclare another local variable defined in an enclosing scope. \n" +
+ "interface I {\r\n" +
+ " void foo(int x, int y);\r\n" +
+ "}\r\n" +
+ "public class X {\r\n" +
+ " public static void main(String[] args) {\r\n" +
+ " int x, y;\r\n" +
+ " I i = (x, y) -> { // Error: x,y being redeclared\r\n" +
+ " int args = 10; // Error args is being redeclared\r\n" +
+ " };\r\n" +
+ " }\r\n" +
+ "}"},
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " I i = (x, y) -> { // Error: x,y being redeclared\n" +
+ " ^\n" +
+ "Lambda expression\'s parameter x cannot redeclare another local variable defined in an enclosing scope. \n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " I i = (x, y) -> { // Error: x,y being redeclared\n" +
+ " ^\n" +
+ "Lambda expression\'s parameter y cannot redeclare another local variable defined in an enclosing scope. \n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " int args = 10; // Error args is being redeclared\n" +
+ " ^^^^\n" +
+ "Lambda expression\'s local variable args cannot redeclare another local variable defined in an enclosing scope. \n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382702 - [1.8][compiler] Lambda expressions should be rejected in disallowed contexts
@@ -1237,10 +1237,10 @@ public void test037() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\r\n" +
- " int foo1(String x);\r\n" +
- "}\r\n" +
- "public class X {\r\n" +
+ "interface I {\r\n" +
+ " int foo1(String x);\r\n" +
+ "}\r\n" +
+ "public class X {\r\n" +
" public static void main(String[] args) {\r\n" +
" System.out.println(\"Lambda in illegal context: \" + (() -> \"Illegal Lambda\"));\r\n" +
" System.out.println(\"Method Reference in illegal context: \" + System::exit);\r\n" +
@@ -1251,36 +1251,36 @@ public void test037() {
// " I sam4 = (I)(String::length); // OK\r\n" +
" int x = (x) -> 10;\n" +
" X x2 = (x) -> 10;\n" +
- " }\r\n" +
+ " }\r\n" +
"}"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " System.out.println(\"Lambda in illegal context: \" + (() -> \"Illegal Lambda\"));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " System.out.println(\"Method Reference in illegal context: \" + System::exit);\n" +
- " ^^^^^^^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " System.out.println(\"Constructor Reference in illegal context: \" + String::new);\n" +
- " ^^^^^^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " int x = (x) -> 10;\n" +
- " ^^^^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 11)\n" +
- " X x2 = (x) -> 10;\n" +
- " ^^^^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " System.out.println(\"Lambda in illegal context: \" + (() -> \"Illegal Lambda\"));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " System.out.println(\"Method Reference in illegal context: \" + System::exit);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " System.out.println(\"Constructor Reference in illegal context: \" + String::new);\n" +
+ " ^^^^^^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 10)\n" +
+ " int x = (x) -> 10;\n" +
+ " ^^^^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 11)\n" +
+ " X x2 = (x) -> 10;\n" +
+ " ^^^^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399537 - [1.8][compiler] Exceptions thrown from lambda body must match specification per function descriptor
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399537 - [1.8][compiler] Exceptions thrown from lambda body must match specification per function descriptor
public void test038() {
this.runNegativeTest(
new String[] {
@@ -1305,19 +1305,19 @@ public void test038() {
" };\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " throw new IOException();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type IOException\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 16)\n" +
- " throw new ClassNotFoundException(); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type ClassNotFoundException\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " throw new IOException();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type IOException\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 16)\n" +
+ " throw new ClassNotFoundException(); \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type ClassNotFoundException\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399537 - [1.8][compiler] Exceptions thrown from lambda body must match specification per function descriptor
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399537 - [1.8][compiler] Exceptions thrown from lambda body must match specification per function descriptor
public void test039() {
this.runNegativeTest(
new String[] {
@@ -1363,54 +1363,54 @@ public void test039() {
" };\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 11)\n" +
- " List foo(List<String> arg) throws EOFException, SQLException, TimeoutException;\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 14)\n" +
- " List foo(List arg) throws Exception;\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 14)\n" +
- " List foo(List arg) throws Exception;\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 23)\n" +
- " case 1: throw new IOException();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type IOException\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 24)\n" +
- " case 2: throw new SQLException();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type SQLException\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 26)\n" +
- " case 4: throw new TimeoutException();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type TimeoutException\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 33)\n" +
- " case 1: throw new IOException();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type IOException\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 34)\n" +
- " case 2: throw new SQLException();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type SQLException\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 36)\n" +
- " case 4: throw new TimeoutException();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type TimeoutException\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 11)\n" +
+ " List foo(List<String> arg) throws EOFException, SQLException, TimeoutException;\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 14)\n" +
+ " List foo(List arg) throws Exception;\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 14)\n" +
+ " List foo(List arg) throws Exception;\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 23)\n" +
+ " case 1: throw new IOException();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type IOException\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 24)\n" +
+ " case 2: throw new SQLException();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type SQLException\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 26)\n" +
+ " case 4: throw new TimeoutException();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type TimeoutException\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 33)\n" +
+ " case 1: throw new IOException();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type IOException\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 34)\n" +
+ " case 2: throw new SQLException();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type SQLException\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 36)\n" +
+ " case 4: throw new TimeoutException();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type TimeoutException\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399537 - [1.8][compiler] Exceptions thrown from lambda body must match specification per function descriptor
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399537 - [1.8][compiler] Exceptions thrown from lambda body must match specification per function descriptor
public void test040() {
this.runNegativeTest(
new String[] {
@@ -1429,14 +1429,14 @@ public void test040() {
" };\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " G g1 = () -> {\n" +
- " ^^^^^\n" +
- "Illegal lambda expression: Method m of type J is generic \n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " G g1 = () -> {\n" +
+ " ^^^^^\n" +
+ "Illegal lambda expression: Method m of type J is generic \n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399537 - [1.8][compiler] Exceptions thrown from lambda body must match specification per function descriptor
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399537 - [1.8][compiler] Exceptions thrown from lambda body must match specification per function descriptor
public void test041() {
this.runNegativeTest(
new String[] {
@@ -1468,24 +1468,24 @@ public void test041() {
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " G g = (x) -> { // Elided type is inferred from descriptor to be F\n" +
- " ^^^^^^\n" +
- "Illegal lambda expression: Method m of type G2 is generic \n" +
- "----------\n" +
- "2. ERROR in X.java (at line 20)\n" +
- " g1.m(new IOException());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type IOException\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 23)\n" +
- " g2.m(new SQLException());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type Exception\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " G g = (x) -> { // Elided type is inferred from descriptor to be F\n" +
+ " ^^^^^^\n" +
+ "Illegal lambda expression: Method m of type G2 is generic \n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 20)\n" +
+ " g1.m(new IOException());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type IOException\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 23)\n" +
+ " g2.m(new SQLException());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type Exception\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399537 - [1.8][compiler] Exceptions thrown from lambda body must match specification per function descriptor
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399537 - [1.8][compiler] Exceptions thrown from lambda body must match specification per function descriptor
public void test042() {
this.runNegativeTest(
new String[] {
@@ -1508,24 +1508,24 @@ public void test042() {
" };\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " G g1 = (F x) -> {\n" +
- " ^^^^^^^^\n" +
- "Illegal lambda expression: Method m of type G2 is generic \n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " G g1 = (F x) -> {\n" +
- " ^\n" +
- "F cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 14)\n" +
- " G g2 = (IOException x) -> {\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Illegal lambda expression: Method m of type G2 is generic \n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " G g1 = (F x) -> {\n" +
+ " ^^^^^^^^\n" +
+ "Illegal lambda expression: Method m of type G2 is generic \n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " G g1 = (F x) -> {\n" +
+ " ^\n" +
+ "F cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 14)\n" +
+ " G g2 = (IOException x) -> {\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Illegal lambda expression: Method m of type G2 is generic \n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399224 - [1.8][compiler][internal] Implement TypeBinding.getSingleAbstractMethod
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399224 - [1.8][compiler][internal] Implement TypeBinding.getSingleAbstractMethod
public void test043() {
Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnusedWarningToken, CompilerOptions.ERROR);
@@ -1591,67 +1591,67 @@ public void test043() {
" Y y = (p0) -> {};\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 17)\n" +
- " interface P extends N, O {}\n" +
- " ^\n" +
- "Name clash: The method foo(List, Class<?>) of type O has the same erasure as foo(List<String>, Class) of type N but does not override it\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 20)\n" +
- " interface S extends Q, R {}\n" +
- " ^\n" +
- "The return types are incompatible for the inherited methods Q.foo(), R.foo()\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 23)\n" +
- " interface V<P, Q> extends T<P>, U<Q> {}\n" +
- " ^\n" +
- "Name clash: The method foo(P) of type U<P> has the same erasure as foo(P) of type T<P> but does not override it\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 29)\n" +
- " B b = () -> {};\n" +
- " ^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 32)\n" +
- " E e = () -> {};\n" +
- " ^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 40)\n" +
- " M m = (p0) -> {};\n" +
- " ^^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 43)\n" +
- " P p = (p0, q0) -> {};\n" +
- " ^^^^^^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 46)\n" +
- " S s = () -> {};\n" +
- " ^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 49)\n" +
- " V<?,?> v = (p0) -> {};\n" +
- " ^^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 50)\n" +
- " W<?,?> w = (p0) -> {};\n" +
- " ^^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
- "----------\n" +
- "11. ERROR in X.java (at line 51)\n" +
- " X x = (p0) -> {};\n" +
- " ^^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 17)\n" +
+ " interface P extends N, O {}\n" +
+ " ^\n" +
+ "Name clash: The method foo(List, Class<?>) of type O has the same erasure as foo(List<String>, Class) of type N but does not override it\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 20)\n" +
+ " interface S extends Q, R {}\n" +
+ " ^\n" +
+ "The return types are incompatible for the inherited methods Q.foo(), R.foo()\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 23)\n" +
+ " interface V<P, Q> extends T<P>, U<Q> {}\n" +
+ " ^\n" +
+ "Name clash: The method foo(P) of type U<P> has the same erasure as foo(P) of type T<P> but does not override it\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 29)\n" +
+ " B b = () -> {};\n" +
+ " ^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 32)\n" +
+ " E e = () -> {};\n" +
+ " ^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 40)\n" +
+ " M m = (p0) -> {};\n" +
+ " ^^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 43)\n" +
+ " P p = (p0, q0) -> {};\n" +
+ " ^^^^^^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 46)\n" +
+ " S s = () -> {};\n" +
+ " ^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 49)\n" +
+ " V<?,?> v = (p0) -> {};\n" +
+ " ^^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "10. ERROR in X.java (at line 50)\n" +
+ " W<?,?> w = (p0) -> {};\n" +
+ " ^^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "11. ERROR in X.java (at line 51)\n" +
+ " X x = (p0) -> {};\n" +
+ " ^^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
"----------\n",
null,
false,
options);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399224 - [1.8][compiler][internal] Implement TypeBinding.getSingleAbstractMethod
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399224 - [1.8][compiler][internal] Implement TypeBinding.getSingleAbstractMethod
public void test044() {
Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnusedWarningToken, CompilerOptions.ERROR);
@@ -1677,36 +1677,36 @@ public void test044() {
" E e = (p) -> { return null;};\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " interface E extends A, C {}\n" +
- " ^\n" +
- "Name clash: The method foo(List<T>) of type C has the same erasure as foo(List<T>) of type A but does not override it\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " A a = (p) -> { return null;};\n" +
- " ^^^^^^\n" +
- "Illegal lambda expression: Method foo of type A is generic \n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " B b = (p) -> { return null;};\n" +
- " ^^^^^^\n" +
- "Illegal lambda expression: Method foo of type B is generic \n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " C c = (p) -> { return null;};\n" +
- " ^^^^^^\n" +
- "Illegal lambda expression: Method foo of type C is generic \n" +
- "----------\n" +
- "5. ERROR in X.java (at line 11)\n" +
- " D d = (p) -> { return null;};\n" +
- " ^^^^^^\n" +
- "Illegal lambda expression: Method foo of type B is generic \n" +
- "----------\n" +
- "6. ERROR in X.java (at line 12)\n" +
- " E e = (p) -> { return null;};\n" +
- " ^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " interface E extends A, C {}\n" +
+ " ^\n" +
+ "Name clash: The method foo(List<T>) of type C has the same erasure as foo(List<T>) of type A but does not override it\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " A a = (p) -> { return null;};\n" +
+ " ^^^^^^\n" +
+ "Illegal lambda expression: Method foo of type A is generic \n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 9)\n" +
+ " B b = (p) -> { return null;};\n" +
+ " ^^^^^^\n" +
+ "Illegal lambda expression: Method foo of type B is generic \n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 10)\n" +
+ " C c = (p) -> { return null;};\n" +
+ " ^^^^^^\n" +
+ "Illegal lambda expression: Method foo of type C is generic \n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 11)\n" +
+ " D d = (p) -> { return null;};\n" +
+ " ^^^^^^\n" +
+ "Illegal lambda expression: Method foo of type B is generic \n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 12)\n" +
+ " E e = (p) -> { return null;};\n" +
+ " ^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
"----------\n",
null,
false,
@@ -1725,16 +1725,16 @@ public void test045() {
" Functional<String,Integer> f = () -> { };\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " interface Functional<S,T> extends I, J<S>, K<T> {}\n" +
- " ^^^^^^^^^^\n" +
- "The return types are incompatible for the inherited methods I.m(), J<S>.m(), K<T>.m()\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " Functional<String,Integer> f = () -> { };\n" +
- " ^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " interface Functional<S,T> extends I, J<S>, K<T> {}\n" +
+ " ^^^^^^^^^^\n" +
+ "The return types are incompatible for the inherited methods I.m(), J<S>.m(), K<T>.m()\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " Functional<String,Integer> f = () -> { };\n" +
+ " ^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
"----------\n");
}
public void test046() {
@@ -1746,11 +1746,11 @@ public void test046() {
"interface B { void f(List<Integer> li); }\n" +
"interface C extends A,B {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " interface C extends A,B {}\n" +
- " ^\n" +
- "Name clash: The method f(List<Integer>) of type B has the same erasure as f(List<String>) of type A but does not override it\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " interface C extends A,B {}\n" +
+ " ^\n" +
+ "Name clash: The method f(List<Integer>) of type B has the same erasure as f(List<String>) of type A but does not override it\n" +
"----------\n");
}
@@ -1760,27 +1760,27 @@ public void test047() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " void doit();\n" +
- "}\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " int var = 2;\n" +
- " I x = new I() {\n" +
- " public void doit() {\n" +
- " System.out.println(args); // OK: args is not re-assignment since declaration/first assignment\n" +
- " System.out.println(var); // Error: var is not effectively final\n" +
- " }\n" +
- " };\n" +
- " var=2;\n" +
- " }\n" +
+ "interface I {\n" +
+ " void doit();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " int var = 2;\n" +
+ " I x = new I() {\n" +
+ " public void doit() {\n" +
+ " System.out.println(args); // OK: args is not re-assignment since declaration/first assignment\n" +
+ " System.out.println(var); // Error: var is not effectively final\n" +
+ " }\n" +
+ " };\n" +
+ " var=2;\n" +
+ " }\n" +
"}" ,
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " System.out.println(var); // Error: var is not effectively final\n" +
- " ^^^\n" +
- "Local variable var defined in an enclosing scope must be final or effectively final\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " System.out.println(var); // Error: var is not effectively final\n" +
+ " ^^^\n" +
+ "Local variable var defined in an enclosing scope must be final or effectively final\n" +
"----------\n"
);
}
@@ -1790,24 +1790,24 @@ public void test048() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " void doit();\n" +
- "}\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " int var = 2;\n" +
- " I x2 = () -> {\n" +
- " System.out.println(var); // Error: var is not effectively final\n" +
- " };\n" +
- " var=2;\n" +
- " }\n" +
+ "interface I {\n" +
+ " void doit();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " int var = 2;\n" +
+ " I x2 = () -> {\n" +
+ " System.out.println(var); // Error: var is not effectively final\n" +
+ " };\n" +
+ " var=2;\n" +
+ " }\n" +
"}" ,
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " System.out.println(var); // Error: var is not effectively final\n" +
- " ^^^\n" +
- "Local variable var defined in an enclosing scope must be final or effectively final\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " System.out.println(var); // Error: var is not effectively final\n" +
+ " ^^^\n" +
+ "Local variable var defined in an enclosing scope must be final or effectively final\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382721, [1.8][compiler] Effectively final variables needs special treatment
@@ -1816,17 +1816,17 @@ public void test049() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " void doit();\n" +
- "}\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " int var = 2;\n" +
- " I x2 = () -> {\n" +
- " System.out.println(args); // OK: args is not re-assignment since declaration/first assignment\n" +
- " };\n" +
- " var=2;\n" +
- " }\n" +
+ "interface I {\n" +
+ " void doit();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " int var = 2;\n" +
+ " I x2 = () -> {\n" +
+ " System.out.println(args); // OK: args is not re-assignment since declaration/first assignment\n" +
+ " };\n" +
+ " var=2;\n" +
+ " }\n" +
"}" ,
},
"");
@@ -1837,17 +1837,17 @@ public void test050() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " void doit();\n" +
- "}\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " new java.io.File(\"dweep\").getCanonicalPath();\n" +
- " } catch (java.io.IOException ioe) {\n" +
- " I x2 = () -> {\n" +
- " System.out.println(ioe.getMessage()); // OK: args is not re-assignment since declaration/first assignment\n" +
- " };\n" +
+ "interface I {\n" +
+ " void doit();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
+ " new java.io.File(\"dweep\").getCanonicalPath();\n" +
+ " } catch (java.io.IOException ioe) {\n" +
+ " I x2 = () -> {\n" +
+ " System.out.println(ioe.getMessage()); // OK: args is not re-assignment since declaration/first assignment\n" +
+ " };\n" +
" };\n"+
" }\n" +
"}\n"
@@ -1860,18 +1860,18 @@ public void test051() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " void doit();\n" +
- "}\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " java.util.List<String> list = new java.util.ArrayList<>();\n" +
- " for (String s : list) {\n" +
- " I x2 = () -> {\n" +
- " System.out.println(s); // OK: args is not re-assignment since declaration/first assignment\n" +
- " };\n" +
- " };\n" +
- " }\n" +
+ "interface I {\n" +
+ " void doit();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " java.util.List<String> list = new java.util.ArrayList<>();\n" +
+ " for (String s : list) {\n" +
+ " I x2 = () -> {\n" +
+ " System.out.println(s); // OK: args is not re-assignment since declaration/first assignment\n" +
+ " };\n" +
+ " };\n" +
+ " }\n" +
"\n" +
"}\n" ,
},
@@ -1883,27 +1883,27 @@ public void test052() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " void doit();\n" +
- "}\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " java.util.List<String> list = new java.util.ArrayList<>();\n" +
- " for (String s2 : list) {\n" +
- " s2 = \"Nice!\";\n" +
- " I x2 = () -> {\n" +
- " System.out.println(s2); // Error: var is not effectively final\n" +
- " };\n" +
- " };\n" +
- " }\n" +
+ "interface I {\n" +
+ " void doit();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " java.util.List<String> list = new java.util.ArrayList<>();\n" +
+ " for (String s2 : list) {\n" +
+ " s2 = \"Nice!\";\n" +
+ " I x2 = () -> {\n" +
+ " System.out.println(s2); // Error: var is not effectively final\n" +
+ " };\n" +
+ " };\n" +
+ " }\n" +
"\n" +
"}\n" ,
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " System.out.println(s2); // Error: var is not effectively final\n" +
- " ^^\n" +
- "Local variable s2 defined in an enclosing scope must be final or effectively final\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " System.out.println(s2); // Error: var is not effectively final\n" +
+ " ^^\n" +
+ "Local variable s2 defined in an enclosing scope must be final or effectively final\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382721, [1.8][compiler] Effectively final variables needs special treatment
@@ -1912,18 +1912,18 @@ public void test053() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " void doit();\n" +
- "}\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " try {\n" +
+ "interface I {\n" +
+ " void doit();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " void foo() {\n" +
+ " try {\n" +
" System.out.println(\"try\");\n" +
- " } catch (NullPointerException | ArrayIndexOutOfBoundsException e) {\n" +
- " I i = () -> {\n" +
- " System.out.println(e);\n" +
- " };\n" +
- " }\n" +
+ " } catch (NullPointerException | ArrayIndexOutOfBoundsException e) {\n" +
+ " I i = () -> {\n" +
+ " System.out.println(e);\n" +
+ " };\n" +
+ " }\n" +
" }\n" +
"}\n" ,
},
@@ -1935,30 +1935,30 @@ public void test054() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " void doit();\n" +
- "}\n" +
- "public class X {\n" +
- " void foo2(String[] args) {\n" +
- " int var;\n" +
- " if (args != null)\n" +
- " var = args.length;\n" +
- " else\n" +
- " var = 2;\n" +
- " I x = new I() {\n" +
- " public void doit() {\n" +
+ "interface I {\n" +
+ " void doit();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " void foo2(String[] args) {\n" +
+ " int var;\n" +
+ " if (args != null)\n" +
+ " var = args.length;\n" +
+ " else\n" +
+ " var = 2;\n" +
+ " I x = new I() {\n" +
+ " public void doit() {\n" +
" System.out.println(var);\n" + // no error here.
" args = null;\n" + // error here.
- " }\n" +
- " };\n" +
+ " }\n" +
+ " };\n" +
" }\n" +
"}\n" ,
- },
- "----------\n" +
- "1. ERROR in X.java (at line 14)\n" +
- " args = null;\n" +
- " ^^^^\n" +
- "Local variable args defined in an enclosing scope must be final or effectively final\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 14)\n" +
+ " args = null;\n" +
+ " ^^^^\n" +
+ "Local variable args defined in an enclosing scope must be final or effectively final\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382721, [1.8][compiler] Effectively final variables needs special treatment
@@ -1967,22 +1967,22 @@ public void test055() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " void doit();\n" +
- "}\n" +
- "public class X {\n" +
- " void foo(final int x) {\n" +
- " I i = () -> {\n" +
- " x = 10;\n" +
- " };\n" +
+ "interface I {\n" +
+ " void doit();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " void foo(final int x) {\n" +
+ " I i = () -> {\n" +
+ " x = 10;\n" +
+ " };\n" +
" }\n" +
"}\n" ,
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " x = 10;\n" +
- " ^\n" +
- "The final local variable x cannot be assigned. It must be blank and not using a compound assignment\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " x = 10;\n" +
+ " ^\n" +
+ "The final local variable x cannot be assigned. It must be blank and not using a compound assignment\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382721, [1.8][compiler] Effectively final variables needs special treatment
@@ -1991,22 +1991,22 @@ public void test056() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " void doit();\n" +
- "}\n" +
- "public class X {\n" +
- " void foo(final int x) {\n" +
- " X i = new X() {\n" +
- " { x = 10; }\n" +
- " };\n" +
+ "interface I {\n" +
+ " void doit();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " void foo(final int x) {\n" +
+ " X i = new X() {\n" +
+ " { x = 10; }\n" +
+ " };\n" +
" }\n" +
"}\n" ,
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " { x = 10; }\n" +
- " ^\n" +
- "The final local variable x cannot be assigned, since it is defined in an enclosing type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " { x = 10; }\n" +
+ " ^\n" +
+ "The final local variable x cannot be assigned, since it is defined in an enclosing type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382721, [1.8][compiler] Effectively final variables needs special treatment
@@ -2015,22 +2015,22 @@ public void test057() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " void doit();\n" +
- "}\n" +
- "public class X {\n" +
- " void foo(int x) {\n" +
- " I i = () -> {\n" +
- " x = 10;\n" +
- " };\n" +
+ "interface I {\n" +
+ " void doit();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " void foo(int x) {\n" +
+ " I i = () -> {\n" +
+ " x = 10;\n" +
+ " };\n" +
" }\n" +
"}\n" ,
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " x = 10;\n" +
- " ^\n" +
- "Local variable x defined in an enclosing scope must be final or effectively final\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " x = 10;\n" +
+ " ^\n" +
+ "Local variable x defined in an enclosing scope must be final or effectively final\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382721, [1.8][compiler] Effectively final variables needs special treatment
@@ -2039,22 +2039,22 @@ public void test058() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " void doit();\n" +
- "}\n" +
- "public class X {\n" +
- " void foo(int x) {\n" +
- " X i = new X() {\n" +
- " { x = 10; }\n" +
- " };\n" +
+ "interface I {\n" +
+ " void doit();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " void foo(int x) {\n" +
+ " X i = new X() {\n" +
+ " { x = 10; }\n" +
+ " };\n" +
" }\n" +
"}\n" ,
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " { x = 10; }\n" +
- " ^\n" +
- "Local variable x defined in an enclosing scope must be final or effectively final\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " { x = 10; }\n" +
+ " ^\n" +
+ "Local variable x defined in an enclosing scope must be final or effectively final\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382721, [1.8][compiler] Effectively final variables needs special treatment
@@ -2107,28 +2107,28 @@ public void test061() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " void doit();\n" +
- "}\n" +
- "public class X {\n" +
- " void foo2(String[] args) {\n" +
- " int var;\n" +
- " if (args != null)\n" +
- " var = args.length;\n" +
- " else\n" +
- " var = 2;\n" +
- " I x = () -> {\n" +
+ "interface I {\n" +
+ " void doit();\n" +
+ "}\n" +
+ "public class X {\n" +
+ " void foo2(String[] args) {\n" +
+ " int var;\n" +
+ " if (args != null)\n" +
+ " var = args.length;\n" +
+ " else\n" +
+ " var = 2;\n" +
+ " I x = () -> {\n" +
" System.out.println(var);\n" + // no error here.
" args = null;\n" + // error here.
- " };\n" +
+ " };\n" +
" }\n" +
"}\n" ,
- },
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " args = null;\n" +
- " ^^^^\n" +
- "Local variable args defined in an enclosing scope must be final or effectively final\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " args = null;\n" +
+ " ^^^^\n" +
+ "Local variable args defined in an enclosing scope must be final or effectively final\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382721, [1.8][compiler] Effectively final variables needs special treatment
@@ -2184,18 +2184,18 @@ public void test063() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " throw e;\n" +
- " ^^^^^^^^\n" +
- "Unhandled exception type Exception\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 14)\n" +
- " else {\n" +
- " e = null;\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " throw e;\n" +
+ " ^^^^^^^^\n" +
+ "Unhandled exception type Exception\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 14)\n" +
+ " else {\n" +
+ " e = null;\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382721, [1.8][compiler] Effectively final variables needs special treatment
@@ -2241,11 +2241,11 @@ public void test065() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " System.out.println(x++);\n" +
- " ^\n" +
- "Local variable x defined in an enclosing scope must be final or effectively final\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " System.out.println(x++);\n" +
+ " ^\n" +
+ "Local variable x defined in an enclosing scope must be final or effectively final\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382721, [1.8][compiler] Effectively final variables needs special treatment
@@ -2269,18 +2269,18 @@ public void test066() {
" }\n" +
"}\n" ,
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " throw e;\n" +
- " ^^^^^^^^\n" +
- "Unhandled exception type Exception\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " } else {\n" +
- " e = null;\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " throw e;\n" +
+ " ^^^^^^^^\n" +
+ "Unhandled exception type Exception\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " } else {\n" +
+ " e = null;\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382721, [1.8][compiler] Effectively final variables needs special treatment
@@ -2304,16 +2304,16 @@ public void test067() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " void foo(int p) {\n" +
- " ^\n" +
- "The parameter p is hiding a field from type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " x.p = i++;\n" +
- " ^\n" +
- "Local variable i defined in an enclosing scope must be final or effectively final\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " void foo(int p) {\n" +
+ " ^\n" +
+ "The parameter p is hiding a field from type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " x.p = i++;\n" +
+ " ^\n" +
+ "Local variable i defined in an enclosing scope must be final or effectively final\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382721, [1.8][compiler] Effectively final variables needs special treatment
@@ -2337,16 +2337,16 @@ public void test068() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " void foo(int p) {\n" +
- " ^\n" +
- "The parameter p is hiding a field from type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " x.p = i;\n" +
- " ^\n" +
- "Local variable x defined in an enclosing scope must be final or effectively final\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " void foo(int p) {\n" +
+ " ^\n" +
+ "The parameter p is hiding a field from type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " x.p = i;\n" +
+ " ^\n" +
+ "Local variable x defined in an enclosing scope must be final or effectively final\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -2370,11 +2370,11 @@ public void test069() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " I i = (int f1) -> {\n" +
- " ^^\n" +
- "The parameter f1 is hiding a field from type X\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " I i = (int f1) -> {\n" +
+ " ^^\n" +
+ "The parameter f1 is hiding a field from type X\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -2393,11 +2393,11 @@ public void test070() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " I i = (int x) -> {\n" +
- " ^\n" +
- "Lambda expression\'s parameter x cannot redeclare another local variable defined in an enclosing scope. \n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " I i = (int x) -> {\n" +
+ " ^\n" +
+ "Lambda expression\'s parameter x cannot redeclare another local variable defined in an enclosing scope. \n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -2417,11 +2417,11 @@ public void test071() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " I i = (int l) -> {\n" +
- " ^\n" +
- "Lambda expression\'s parameter l cannot redeclare another local variable defined in an enclosing scope. \n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " I i = (int l) -> {\n" +
+ " ^\n" +
+ "Lambda expression\'s parameter l cannot redeclare another local variable defined in an enclosing scope. \n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -2441,11 +2441,11 @@ public void test072() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " I i = (int p, int p) -> {\n" +
- " ^\n" +
- "Duplicate parameter p\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " I i = (int p, int p) -> {\n" +
+ " ^\n" +
+ "Duplicate parameter p\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -2468,11 +2468,11 @@ public void test073() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " int f;\n" +
- " ^\n" +
- "The local variable f is hiding a field from type X\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " int f;\n" +
+ " ^\n" +
+ "The local variable f is hiding a field from type X\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -2493,11 +2493,11 @@ public void test074() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " int a;\n" +
- " ^\n" +
- "Lambda expression\'s local variable a cannot redeclare another local variable defined in an enclosing scope. \n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " int a;\n" +
+ " ^\n" +
+ "Lambda expression\'s local variable a cannot redeclare another local variable defined in an enclosing scope. \n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -2519,11 +2519,11 @@ public void test075() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " int loc;\n" +
- " ^^^\n" +
- "Lambda expression\'s local variable loc cannot redeclare another local variable defined in an enclosing scope. \n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " int loc;\n" +
+ " ^^^\n" +
+ "Lambda expression\'s local variable loc cannot redeclare another local variable defined in an enclosing scope. \n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -2545,11 +2545,11 @@ public void test076() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " int p;\n" +
- " ^\n" +
- "Duplicate local variable p\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " int p;\n" +
+ " ^\n" +
+ "Duplicate local variable p\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -2571,11 +2571,11 @@ public void test077() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " int self, self;\n" +
- " ^^^^\n" +
- "Duplicate local variable self\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " int self, self;\n" +
+ " ^^^^\n" +
+ "Duplicate local variable self\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -2599,11 +2599,11 @@ public void test078() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " I i2 = (int f, int p0) -> {};\n" +
- " ^\n" +
- "The parameter f is hiding a field from type X\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " I i2 = (int f, int p0) -> {};\n" +
+ " ^\n" +
+ "The parameter f is hiding a field from type X\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -2625,16 +2625,16 @@ public void test079() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " I i2 = (int f, int outerp) -> {};\n" +
- " ^\n" +
- "The parameter f is hiding a field from type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " I i2 = (int f, int outerp) -> {};\n" +
- " ^^^^^^\n" +
- "Lambda expression\'s parameter outerp cannot redeclare another local variable defined in an enclosing scope. \n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " I i2 = (int f, int outerp) -> {};\n" +
+ " ^\n" +
+ "The parameter f is hiding a field from type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " I i2 = (int f, int outerp) -> {};\n" +
+ " ^^^^^^\n" +
+ "Lambda expression\'s parameter outerp cannot redeclare another local variable defined in an enclosing scope. \n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -2656,16 +2656,16 @@ public void test080() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " I i2 = (int locouter, int outerp) -> {};\n" +
- " ^^^^^^^^\n" +
- "Lambda expression\'s parameter locouter cannot redeclare another local variable defined in an enclosing scope. \n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " I i2 = (int locouter, int outerp) -> {};\n" +
- " ^^^^^^\n" +
- "Lambda expression\'s parameter outerp cannot redeclare another local variable defined in an enclosing scope. \n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " I i2 = (int locouter, int outerp) -> {};\n" +
+ " ^^^^^^^^\n" +
+ "Lambda expression\'s parameter locouter cannot redeclare another local variable defined in an enclosing scope. \n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " I i2 = (int locouter, int outerp) -> {};\n" +
+ " ^^^^^^\n" +
+ "Lambda expression\'s parameter outerp cannot redeclare another local variable defined in an enclosing scope. \n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -2687,16 +2687,16 @@ public void test081() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " I i2 = (int p, int q) -> {};\n" +
- " ^\n" +
- "Lambda expression\'s parameter p cannot redeclare another local variable defined in an enclosing scope. \n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " I i2 = (int p, int q) -> {};\n" +
- " ^\n" +
- "Lambda expression\'s parameter q cannot redeclare another local variable defined in an enclosing scope. \n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " I i2 = (int p, int q) -> {};\n" +
+ " ^\n" +
+ "Lambda expression\'s parameter p cannot redeclare another local variable defined in an enclosing scope. \n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " I i2 = (int p, int q) -> {};\n" +
+ " ^\n" +
+ "Lambda expression\'s parameter q cannot redeclare another local variable defined in an enclosing scope. \n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -2719,16 +2719,16 @@ public void test082() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " I i2 = (int lamlocal, int q) -> {};\n" +
- " ^^^^^^^^\n" +
- "Lambda expression\'s parameter lamlocal cannot redeclare another local variable defined in an enclosing scope. \n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " I i2 = (int lamlocal, int q) -> {};\n" +
- " ^\n" +
- "Lambda expression\'s parameter q cannot redeclare another local variable defined in an enclosing scope. \n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " I i2 = (int lamlocal, int q) -> {};\n" +
+ " ^^^^^^^^\n" +
+ "Lambda expression\'s parameter lamlocal cannot redeclare another local variable defined in an enclosing scope. \n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " I i2 = (int lamlocal, int q) -> {};\n" +
+ " ^\n" +
+ "Lambda expression\'s parameter q cannot redeclare another local variable defined in an enclosing scope. \n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -2751,21 +2751,21 @@ public void test083() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " I i2 = (int lamlocal, int q) -> {int f;};\n" +
- " ^^^^^^^^\n" +
- "Lambda expression\'s parameter lamlocal cannot redeclare another local variable defined in an enclosing scope. \n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " I i2 = (int lamlocal, int q) -> {int f;};\n" +
- " ^\n" +
- "Lambda expression\'s parameter q cannot redeclare another local variable defined in an enclosing scope. \n" +
- "----------\n" +
- "3. WARNING in X.java (at line 10)\n" +
- " I i2 = (int lamlocal, int q) -> {int f;};\n" +
- " ^\n" +
- "The local variable f is hiding a field from type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " I i2 = (int lamlocal, int q) -> {int f;};\n" +
+ " ^^^^^^^^\n" +
+ "Lambda expression\'s parameter lamlocal cannot redeclare another local variable defined in an enclosing scope. \n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " I i2 = (int lamlocal, int q) -> {int f;};\n" +
+ " ^\n" +
+ "Lambda expression\'s parameter q cannot redeclare another local variable defined in an enclosing scope. \n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 10)\n" +
+ " I i2 = (int lamlocal, int q) -> {int f;};\n" +
+ " ^\n" +
+ "The local variable f is hiding a field from type X\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -2788,21 +2788,21 @@ public void test084() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " I i2 = (int lamlocal, int q) -> {int locouter;};\n" +
- " ^^^^^^^^\n" +
- "Lambda expression\'s parameter lamlocal cannot redeclare another local variable defined in an enclosing scope. \n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " I i2 = (int lamlocal, int q) -> {int locouter;};\n" +
- " ^\n" +
- "Lambda expression\'s parameter q cannot redeclare another local variable defined in an enclosing scope. \n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " I i2 = (int lamlocal, int q) -> {int locouter;};\n" +
- " ^^^^^^^^\n" +
- "Lambda expression\'s local variable locouter cannot redeclare another local variable defined in an enclosing scope. \n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " I i2 = (int lamlocal, int q) -> {int locouter;};\n" +
+ " ^^^^^^^^\n" +
+ "Lambda expression\'s parameter lamlocal cannot redeclare another local variable defined in an enclosing scope. \n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " I i2 = (int lamlocal, int q) -> {int locouter;};\n" +
+ " ^\n" +
+ "Lambda expression\'s parameter q cannot redeclare another local variable defined in an enclosing scope. \n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 10)\n" +
+ " I i2 = (int lamlocal, int q) -> {int locouter;};\n" +
+ " ^^^^^^^^\n" +
+ "Lambda expression\'s local variable locouter cannot redeclare another local variable defined in an enclosing scope. \n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -2825,21 +2825,21 @@ public void test085() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " I i2 = (int j, int q) -> {int p, lamlocal;};\n" +
- " ^\n" +
- "Lambda expression\'s parameter q cannot redeclare another local variable defined in an enclosing scope. \n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " I i2 = (int j, int q) -> {int p, lamlocal;};\n" +
- " ^\n" +
- "Lambda expression\'s local variable p cannot redeclare another local variable defined in an enclosing scope. \n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " I i2 = (int j, int q) -> {int p, lamlocal;};\n" +
- " ^^^^^^^^\n" +
- "Lambda expression\'s local variable lamlocal cannot redeclare another local variable defined in an enclosing scope. \n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " I i2 = (int j, int q) -> {int p, lamlocal;};\n" +
+ " ^\n" +
+ "Lambda expression\'s parameter q cannot redeclare another local variable defined in an enclosing scope. \n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " I i2 = (int j, int q) -> {int p, lamlocal;};\n" +
+ " ^\n" +
+ "Lambda expression\'s local variable p cannot redeclare another local variable defined in an enclosing scope. \n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 10)\n" +
+ " I i2 = (int j, int q) -> {int p, lamlocal;};\n" +
+ " ^^^^^^^^\n" +
+ "Lambda expression\'s local variable lamlocal cannot redeclare another local variable defined in an enclosing scope. \n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -2862,16 +2862,16 @@ public void test086() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " I i2 = (int x1, int x2) -> {int x1, x2;};\n" +
- " ^^\n" +
- "Duplicate local variable x1\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " I i2 = (int x1, int x2) -> {int x1, x2;};\n" +
- " ^^\n" +
- "Duplicate local variable x2\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " I i2 = (int x1, int x2) -> {int x1, x2;};\n" +
+ " ^^\n" +
+ "Duplicate local variable x1\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " I i2 = (int x1, int x2) -> {int x1, x2;};\n" +
+ " ^^\n" +
+ "Duplicate local variable x2\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -2894,16 +2894,16 @@ public void test087() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " class X { void foo(int f) {} }\n" +
- " ^\n" +
- "The nested type X cannot hide an enclosing type\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " class X { void foo(int f) {} }\n" +
- " ^\n" +
- "The parameter f is hiding a field from type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " class X { void foo(int f) {} }\n" +
+ " ^\n" +
+ "The nested type X cannot hide an enclosing type\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " class X { void foo(int f) {} }\n" +
+ " ^\n" +
+ "The parameter f is hiding a field from type X\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -2927,11 +2927,11 @@ public void test088() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " I i2 = new I() { public void foo(int f, int p0) {};\n" +
- " ^\n" +
- "The parameter f is hiding a field from type X\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " I i2 = new I() { public void foo(int f, int p0) {};\n" +
+ " ^\n" +
+ "The parameter f is hiding a field from type X\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -2955,16 +2955,16 @@ public void test089() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " I i2 = new I() { public void foo(int f, int outerp) {}};\n" +
- " ^\n" +
- "The parameter f is hiding a field from type X\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " I i2 = new I() { public void foo(int f, int outerp) {}};\n" +
- " ^^^^^^\n" +
- "The parameter outerp is hiding another local variable defined in an enclosing scope\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " I i2 = new I() { public void foo(int f, int outerp) {}};\n" +
+ " ^\n" +
+ "The parameter f is hiding a field from type X\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " I i2 = new I() { public void foo(int f, int outerp) {}};\n" +
+ " ^^^^^^\n" +
+ "The parameter outerp is hiding another local variable defined in an enclosing scope\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -2988,16 +2988,16 @@ public void test090() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " I i2 = new I() { public void foo(int locouter, int outerp) {}};\n" +
- " ^^^^^^^^\n" +
- "The parameter locouter is hiding another local variable defined in an enclosing scope\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " I i2 = new I() { public void foo(int locouter, int outerp) {}};\n" +
- " ^^^^^^\n" +
- "The parameter outerp is hiding another local variable defined in an enclosing scope\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " I i2 = new I() { public void foo(int locouter, int outerp) {}};\n" +
+ " ^^^^^^^^\n" +
+ "The parameter locouter is hiding another local variable defined in an enclosing scope\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " I i2 = new I() { public void foo(int locouter, int outerp) {}};\n" +
+ " ^^^^^^\n" +
+ "The parameter outerp is hiding another local variable defined in an enclosing scope\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -3021,16 +3021,16 @@ public void test091() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " I i2 = new I() { public void foo (int p, int q) {}};\n" +
- " ^\n" +
- "The parameter p is hiding another local variable defined in an enclosing scope\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " I i2 = new I() { public void foo (int p, int q) {}};\n" +
- " ^\n" +
- "The parameter q is hiding another local variable defined in an enclosing scope\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " I i2 = new I() { public void foo (int p, int q) {}};\n" +
+ " ^\n" +
+ "The parameter p is hiding another local variable defined in an enclosing scope\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " I i2 = new I() { public void foo (int p, int q) {}};\n" +
+ " ^\n" +
+ "The parameter q is hiding another local variable defined in an enclosing scope\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -3055,16 +3055,16 @@ public void test092() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 10)\n" +
- " I i2 = new I() { public void foo (int lamlocal, int q) {} };\n" +
- " ^^^^^^^^\n" +
- "The parameter lamlocal is hiding another local variable defined in an enclosing scope\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " I i2 = new I() { public void foo (int lamlocal, int q) {} };\n" +
- " ^\n" +
- "The parameter q is hiding another local variable defined in an enclosing scope\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 10)\n" +
+ " I i2 = new I() { public void foo (int lamlocal, int q) {} };\n" +
+ " ^^^^^^^^\n" +
+ "The parameter lamlocal is hiding another local variable defined in an enclosing scope\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " I i2 = new I() { public void foo (int lamlocal, int q) {} };\n" +
+ " ^\n" +
+ "The parameter q is hiding another local variable defined in an enclosing scope\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -3089,21 +3089,21 @@ public void test093() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 10)\n" +
- " I i2 = new I() { public void foo (int lamlocal, int q) {int f;}};\n" +
- " ^^^^^^^^\n" +
- "The parameter lamlocal is hiding another local variable defined in an enclosing scope\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " I i2 = new I() { public void foo (int lamlocal, int q) {int f;}};\n" +
- " ^\n" +
- "The parameter q is hiding another local variable defined in an enclosing scope\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 10)\n" +
- " I i2 = new I() { public void foo (int lamlocal, int q) {int f;}};\n" +
- " ^\n" +
- "The local variable f is hiding a field from type X\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 10)\n" +
+ " I i2 = new I() { public void foo (int lamlocal, int q) {int f;}};\n" +
+ " ^^^^^^^^\n" +
+ "The parameter lamlocal is hiding another local variable defined in an enclosing scope\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " I i2 = new I() { public void foo (int lamlocal, int q) {int f;}};\n" +
+ " ^\n" +
+ "The parameter q is hiding another local variable defined in an enclosing scope\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 10)\n" +
+ " I i2 = new I() { public void foo (int lamlocal, int q) {int f;}};\n" +
+ " ^\n" +
+ "The local variable f is hiding a field from type X\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -3128,21 +3128,21 @@ public void test094() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 10)\n" +
- " I i2 = new I() { public void foo(int lamlocal, int q) {int locouter;}};\n" +
- " ^^^^^^^^\n" +
- "The parameter lamlocal is hiding another local variable defined in an enclosing scope\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " I i2 = new I() { public void foo(int lamlocal, int q) {int locouter;}};\n" +
- " ^\n" +
- "The parameter q is hiding another local variable defined in an enclosing scope\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 10)\n" +
- " I i2 = new I() { public void foo(int lamlocal, int q) {int locouter;}};\n" +
- " ^^^^^^^^\n" +
- "The local variable locouter is hiding another local variable defined in an enclosing scope\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 10)\n" +
+ " I i2 = new I() { public void foo(int lamlocal, int q) {int locouter;}};\n" +
+ " ^^^^^^^^\n" +
+ "The parameter lamlocal is hiding another local variable defined in an enclosing scope\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " I i2 = new I() { public void foo(int lamlocal, int q) {int locouter;}};\n" +
+ " ^\n" +
+ "The parameter q is hiding another local variable defined in an enclosing scope\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 10)\n" +
+ " I i2 = new I() { public void foo(int lamlocal, int q) {int locouter;}};\n" +
+ " ^^^^^^^^\n" +
+ "The local variable locouter is hiding another local variable defined in an enclosing scope\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -3167,21 +3167,21 @@ public void test095() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 10)\n" +
- " I i2 = new I() { public void foo(int j, int q) {int p, lamlocal;}};\n" +
- " ^\n" +
- "The parameter q is hiding another local variable defined in an enclosing scope\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " I i2 = new I() { public void foo(int j, int q) {int p, lamlocal;}};\n" +
- " ^\n" +
- "The local variable p is hiding another local variable defined in an enclosing scope\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 10)\n" +
- " I i2 = new I() { public void foo(int j, int q) {int p, lamlocal;}};\n" +
- " ^^^^^^^^\n" +
- "The local variable lamlocal is hiding another local variable defined in an enclosing scope\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 10)\n" +
+ " I i2 = new I() { public void foo(int j, int q) {int p, lamlocal;}};\n" +
+ " ^\n" +
+ "The parameter q is hiding another local variable defined in an enclosing scope\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " I i2 = new I() { public void foo(int j, int q) {int p, lamlocal;}};\n" +
+ " ^\n" +
+ "The local variable p is hiding another local variable defined in an enclosing scope\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 10)\n" +
+ " I i2 = new I() { public void foo(int j, int q) {int p, lamlocal;}};\n" +
+ " ^^^^^^^^\n" +
+ "The local variable lamlocal is hiding another local variable defined in an enclosing scope\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727, [1.8][compiler] Lambda expression parameters and locals cannot shadow variables from context
@@ -3204,16 +3204,16 @@ public void test096() {
" } \n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " I i2 = new I() { public void foo(int x1, int x2) {int x1, x2;}};\n" +
- " ^^\n" +
- "Duplicate local variable x1\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " I i2 = new I() { public void foo(int x1, int x2) {int x1, x2;}};\n" +
- " ^^\n" +
- "Duplicate local variable x2\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " I i2 = new I() { public void foo(int x1, int x2) {int x1, x2;}};\n" +
+ " ^^\n" +
+ "Duplicate local variable x1\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " I i2 = new I() { public void foo(int x1, int x2) {int x1, x2;}};\n" +
+ " ^^\n" +
+ "Duplicate local variable x2\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384687 [1.8] Wildcard type arguments should be rejected for lambda and reference expressions
@@ -3221,22 +3221,22 @@ public void test097() {
this.runNegativeTest(
new String[] {
"X.java",
- "class Action<K> {\r\n" +
- " static <T1> int fooMethod(Object x) { return 0; }\r\n" +
- "}\r\n" +
- "interface I {\r\n" +
- " int foo(Object x);\r\n" +
- "}\r\n" +
- "public class X {\r\n" +
- " public static void main(String[] args) {\r\n" +
+ "class Action<K> {\r\n" +
+ " static <T1> int fooMethod(Object x) { return 0; }\r\n" +
+ "}\r\n" +
+ "interface I {\r\n" +
+ " int foo(Object x);\r\n" +
+ "}\r\n" +
+ "public class X {\r\n" +
+ " public static void main(String[] args) {\r\n" +
" I functional = Action::<?>fooMethod;\r\n" + // no raw type warning here, Action:: is really Action<>::
- " }\r\n" +
+ " }\r\n" +
"}"},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " I functional = Action::<?>fooMethod;\n" +
- " ^\n" +
- "Wildcard is not allowed at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " I functional = Action::<?>fooMethod;\n" +
+ " ^\n" +
+ "Wildcard is not allowed at this location\n" +
"----------\n");
}
@@ -3245,24 +3245,24 @@ public void test098() {
this.runNegativeTest(
new String[] {
"X.java",
- "class Action<K> {\r\n" +
- " int foo(Object x, Object y, Object z) { return 0; }\r\n" +
- "}\r\n" +
- "interface I {\r\n" +
- " void foo(Object x);\r\n" +
- "}\r\n" +
- "public class X {\r\n" +
- " public static void main(String[] args) {\r\n" +
- " Action<Object> exp = new Action<Object>();\r\n" +
- " int x,y,z;\r\n" +
- " I len6 = foo->exp.<?>method(x, y, z);\r\n" +
- " }\r\n" +
+ "class Action<K> {\r\n" +
+ " int foo(Object x, Object y, Object z) { return 0; }\r\n" +
+ "}\r\n" +
+ "interface I {\r\n" +
+ " void foo(Object x);\r\n" +
+ "}\r\n" +
+ "public class X {\r\n" +
+ " public static void main(String[] args) {\r\n" +
+ " Action<Object> exp = new Action<Object>();\r\n" +
+ " int x,y,z;\r\n" +
+ " I len6 = foo->exp.<?>method(x, y, z);\r\n" +
+ " }\r\n" +
"}"},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " I len6 = foo->exp.<?>method(x, y, z);\n" +
- " ^\n" +
- "Wildcard is not allowed at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " I len6 = foo->exp.<?>method(x, y, z);\n" +
+ " ^\n" +
+ "Wildcard is not allowed at this location\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399770: [1.8][compiler] Implement support for @FunctionalInterface
@@ -3298,31 +3298,31 @@ public void test_bug399770_2() {
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in YYY.java (at line 3)\n" +
- " interface DERIVED extends BASE {void run1();}@FunctionalInterface public class YYY {\n" +
- " ^^^^^^^\n" +
- "Invalid \'@FunctionalInterface\' annotation; DERIVED is not a functional interface\n" +
- "----------\n" +
- "2. ERROR in YYY.java (at line 3)\n" +
- " interface DERIVED extends BASE {void run1();}@FunctionalInterface public class YYY {\n" +
- " ^^^\n" +
- "Invalid \'@FunctionalInterface\' annotation; YYY is not a functional interface\n" +
- "----------\n" +
- "3. ERROR in YYY.java (at line 4)\n" +
- " @FunctionalInterface int x; @FunctionalInterface public static void main(String[] args) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "The annotation @FunctionalInterface is disallowed for this location\n" +
- "----------\n" +
- "4. ERROR in YYY.java (at line 4)\n" +
- " @FunctionalInterface int x; @FunctionalInterface public static void main(String[] args) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "The annotation @FunctionalInterface is disallowed for this location\n" +
- "----------\n" +
- "5. ERROR in YYY.java (at line 5)\n" +
- " @FunctionalInterface int y; System.out.println(\"Hello\"); }\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "The annotation @FunctionalInterface is disallowed for this location\n" +
+ "----------\n" +
+ "1. ERROR in YYY.java (at line 3)\n" +
+ " interface DERIVED extends BASE {void run1();}@FunctionalInterface public class YYY {\n" +
+ " ^^^^^^^\n" +
+ "Invalid \'@FunctionalInterface\' annotation; DERIVED is not a functional interface\n" +
+ "----------\n" +
+ "2. ERROR in YYY.java (at line 3)\n" +
+ " interface DERIVED extends BASE {void run1();}@FunctionalInterface public class YYY {\n" +
+ " ^^^\n" +
+ "Invalid \'@FunctionalInterface\' annotation; YYY is not a functional interface\n" +
+ "----------\n" +
+ "3. ERROR in YYY.java (at line 4)\n" +
+ " @FunctionalInterface int x; @FunctionalInterface public static void main(String[] args) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "The annotation @FunctionalInterface is disallowed for this location\n" +
+ "----------\n" +
+ "4. ERROR in YYY.java (at line 4)\n" +
+ " @FunctionalInterface int x; @FunctionalInterface public static void main(String[] args) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "The annotation @FunctionalInterface is disallowed for this location\n" +
+ "----------\n" +
+ "5. ERROR in YYY.java (at line 5)\n" +
+ " @FunctionalInterface int y; System.out.println(\"Hello\"); }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "The annotation @FunctionalInterface is disallowed for this location\n" +
"----------\n"
);
}
@@ -3337,23 +3337,23 @@ public void test400745() {
"}\n" +
"public class X {\n" +
" public void foo() {\n" +
- " class Y {};\n" +
+ " class Y {};\n" +
" I i = () -> {\n" +
" class Y{} ;\n" +
" };\n" +
- " }\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " class Y{} ;\n" +
- " ^\n" +
- "Duplicate nested type Y\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " class Y{} ;\n" +
+ " ^\n" +
+ "Duplicate nested type Y\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=400745, [1.8][compiler] Compiler incorrectly allows shadowing of local class names.
public void test400745a() {
- // local type hiding scenario
+ // local type hiding scenario
this.runNegativeTest(
false /* skipJavac */,
JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings,
@@ -3380,51 +3380,51 @@ public void test400745a() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " private void foo() {\n" +
- " ^^^^^\n" +
- "The method foo() from the type X is never used locally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " class Y {}\n" +
- " ^\n" +
- "The type Y is never used locally\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 8)\n" +
- " private void foo() {\n" +
- " ^^^^^\n" +
- "The method foo() from the type new X(){} is never used locally\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 9)\n" +
- " class Y {};\n" +
- " ^\n" +
- "The type Y is hiding the type Y\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 9)\n" +
- " class Y {};\n" +
- " ^\n" +
- "The type Y is never used locally\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 13)\n" +
- " class LX {\n" +
- " ^^\n" +
- "The type LX is never used locally\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 14)\n" +
- " void foo() {\n" +
- " ^^^^^\n" +
- "The method foo() from the type LX is never used locally\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 15)\n" +
- " class Y {};\n" +
- " ^\n" +
- "The type Y is hiding the type Y\n" +
- "----------\n" +
- "9. WARNING in X.java (at line 15)\n" +
- " class Y {};\n" +
- " ^\n" +
- "The type Y is never used locally\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " private void foo() {\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X is never used locally\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " class Y {}\n" +
+ " ^\n" +
+ "The type Y is never used locally\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 8)\n" +
+ " private void foo() {\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type new X(){} is never used locally\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 9)\n" +
+ " class Y {};\n" +
+ " ^\n" +
+ "The type Y is hiding the type Y\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 9)\n" +
+ " class Y {};\n" +
+ " ^\n" +
+ "The type Y is never used locally\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 13)\n" +
+ " class LX {\n" +
+ " ^^\n" +
+ "The type LX is never used locally\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 14)\n" +
+ " void foo() {\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type LX is never used locally\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 15)\n" +
+ " class Y {};\n" +
+ " ^\n" +
+ "The type Y is hiding the type Y\n" +
+ "----------\n" +
+ "9. WARNING in X.java (at line 15)\n" +
+ " class Y {};\n" +
+ " ^\n" +
+ "The type Y is never used locally\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=400556, [1.8][compiler] Visibility checks are missing for lambda/reference expressions
@@ -3451,32 +3451,32 @@ public void test400556() {
" I i = (p) -> { return null; };\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in p\\I.java (at line 12)\n" +
- " class ExceptionType extends Exception {\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " I i = (p) -> { return null; };\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<P> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " I i = (p) -> { return null; };\n" +
- " ^^^^^^\n" +
- "The type ReturnType from the descriptor computed for the target context is not visible here. \n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " I i = (p) -> { return null; };\n" +
- " ^^^^^^\n" +
- "The type ParameterType from the descriptor computed for the target context is not visible here. \n" +
- "----------\n" +
- "4. ERROR in X.java (at line 3)\n" +
- " I i = (p) -> { return null; };\n" +
- " ^^^^^^\n" +
- "The type ExceptionType from the descriptor computed for the target context is not visible here. \n" +
+ "----------\n" +
+ "1. WARNING in p\\I.java (at line 12)\n" +
+ " class ExceptionType extends Exception {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " I i = (p) -> { return null; };\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<P> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " I i = (p) -> { return null; };\n" +
+ " ^^^^^^\n" +
+ "The type ReturnType from the descriptor computed for the target context is not visible here. \n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " I i = (p) -> { return null; };\n" +
+ " ^^^^^^\n" +
+ "The type ParameterType from the descriptor computed for the target context is not visible here. \n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 3)\n" +
+ " I i = (p) -> { return null; };\n" +
+ " ^^^^^^\n" +
+ "The type ExceptionType from the descriptor computed for the target context is not visible here. \n" +
"----------\n");
}
@@ -3506,22 +3506,22 @@ public void test400556a() {
" I i = (p) -> { return null; };\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in p\\ExceptionType.java (at line 2)\n" +
- " public class ExceptionType extends Exception {\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " I i = (p) -> { return null; };\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<P> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " I i = (p) -> { return null; };\n" +
- " ^^^^^^\n" +
- "The type ParameterType from the descriptor computed for the target context is not visible here. \n" +
+ "----------\n" +
+ "1. WARNING in p\\ExceptionType.java (at line 2)\n" +
+ " public class ExceptionType extends Exception {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " I i = (p) -> { return null; };\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<P> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " I i = (p) -> { return null; };\n" +
+ " ^^^^^^\n" +
+ "The type ParameterType from the descriptor computed for the target context is not visible here. \n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=400556, [1.8][compiler] Visibility checks are missing for lambda/reference expressions
@@ -3549,27 +3549,27 @@ public void test400556b() {
" I i = (p) -> { return null; };\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in p\\I.java (at line 13)\n" +
- " class ExceptionType extends Exception {\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " I i = (p) -> { return null; };\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<P> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " I i = (p) -> { return null; };\n" +
- " ^^^^^^\n" +
- "The type ReturnType from the descriptor computed for the target context is not visible here. \n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " I i = (p) -> { return null; };\n" +
- " ^^^^^^\n" +
- "The type ExceptionType from the descriptor computed for the target context is not visible here. \n" +
+ "----------\n" +
+ "1. WARNING in p\\I.java (at line 13)\n" +
+ " class ExceptionType extends Exception {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " I i = (p) -> { return null; };\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<P> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " I i = (p) -> { return null; };\n" +
+ " ^^^^^^\n" +
+ "The type ReturnType from the descriptor computed for the target context is not visible here. \n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " I i = (p) -> { return null; };\n" +
+ " ^^^^^^\n" +
+ "The type ExceptionType from the descriptor computed for the target context is not visible here. \n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=400556, [1.8][compiler] Visibility checks are missing for lambda/reference expressions
@@ -3594,27 +3594,27 @@ public void test400556c() {
" I<?, ?, ?> i = (p) -> { return null; };\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in p\\I.java (at line 10)\n" +
- " class ExceptionType extends Exception {\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " I<?, ?, ?> i = (p) -> { return null; };\n" +
- " ^^^^^^\n" +
- "The type ReturnType from the descriptor computed for the target context is not visible here. \n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " I<?, ?, ?> i = (p) -> { return null; };\n" +
- " ^^^^^^\n" +
- "The type ParameterType from the descriptor computed for the target context is not visible here. \n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " I<?, ?, ?> i = (p) -> { return null; };\n" +
- " ^^^^^^\n" +
- "The type ExceptionType from the descriptor computed for the target context is not visible here. \n" +
+ "----------\n" +
+ "1. WARNING in p\\I.java (at line 10)\n" +
+ " class ExceptionType extends Exception {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " I<?, ?, ?> i = (p) -> { return null; };\n" +
+ " ^^^^^^\n" +
+ "The type ReturnType from the descriptor computed for the target context is not visible here. \n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " I<?, ?, ?> i = (p) -> { return null; };\n" +
+ " ^^^^^^\n" +
+ "The type ParameterType from the descriptor computed for the target context is not visible here. \n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " I<?, ?, ?> i = (p) -> { return null; };\n" +
+ " ^^^^^^\n" +
+ "The type ExceptionType from the descriptor computed for the target context is not visible here. \n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=400556, [1.8][compiler] Visibility checks are missing for lambda/reference expressions
@@ -3645,11 +3645,11 @@ public void test400556d() {
" I<?, ?, ?> i = (p) -> { return null; };\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in p\\ExceptionType.java (at line 2)\n" +
- " public class ExceptionType extends Exception {\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. WARNING in p\\ExceptionType.java (at line 2)\n" +
+ " public class ExceptionType extends Exception {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=400556, [1.8][compiler] Visibility checks are missing for lambda/reference expressions
@@ -3680,17 +3680,17 @@ public void test400556e() {
" I<?, ?, ?> i = (String p) -> { return null; };\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in p\\ExceptionType.java (at line 2)\n" +
- " public class ExceptionType extends Exception {\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " I<?, ?, ?> i = (String p) -> { return null; };\n" +
- " ^^^^^^\n" +
- "Lambda expression\'s parameter p is expected to be of type List<? extends List<ParameterType>>[]\n" +
+ "----------\n" +
+ "1. WARNING in p\\ExceptionType.java (at line 2)\n" +
+ " public class ExceptionType extends Exception {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " I<?, ?, ?> i = (String p) -> { return null; };\n" +
+ " ^^^^^^\n" +
+ "Lambda expression\'s parameter p is expected to be of type List<? extends List<ParameterType>>[]\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=400556, [1.8][compiler] Visibility checks are missing for lambda/reference expressions
@@ -3721,17 +3721,17 @@ public void test400556f() {
" I<? extends p.ParameterType, ? extends p.ExceptionType, ? extends p.ReturnType> i = (String p) -> { return null; };\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in p\\ExceptionType.java (at line 2)\n" +
- " public class ExceptionType extends Exception {\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " I<? extends p.ParameterType, ? extends p.ExceptionType, ? extends p.ReturnType> i = (String p) -> { return null; };\n" +
- " ^^^^^^\n" +
- "Lambda expression\'s parameter p is expected to be of type List<? extends List<ParameterType>>[]\n" +
+ "----------\n" +
+ "1. WARNING in p\\ExceptionType.java (at line 2)\n" +
+ " public class ExceptionType extends Exception {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " I<? extends p.ParameterType, ? extends p.ExceptionType, ? extends p.ReturnType> i = (String p) -> { return null; };\n" +
+ " ^^^^^^\n" +
+ "Lambda expression\'s parameter p is expected to be of type List<? extends List<ParameterType>>[]\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=400556, [1.8][compiler] Visibility checks are missing for lambda/reference expressions
@@ -3765,22 +3765,22 @@ public void test400556g() {
" I<P, T, R> i = (String p) -> { return null; };\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in p\\ExceptionType.java (at line 2)\n" +
- " public class ExceptionType extends Exception {\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " class T extends p.ExceptionType {}\n" +
- " ^\n" +
- "The serializable class T does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " I<P, T, R> i = (String p) -> { return null; };\n" +
- " ^^^^^^\n" +
- "Lambda expression\'s parameter p is expected to be of type List<? extends List<P>>[]\n" +
+ "----------\n" +
+ "1. WARNING in p\\ExceptionType.java (at line 2)\n" +
+ " public class ExceptionType extends Exception {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " class T extends p.ExceptionType {}\n" +
+ " ^\n" +
+ "The serializable class T does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " I<P, T, R> i = (String p) -> { return null; };\n" +
+ " ^^^^^^\n" +
+ "Lambda expression\'s parameter p is expected to be of type List<? extends List<P>>[]\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=400556, [1.8][compiler] Visibility checks are missing for lambda/reference expressions
@@ -3814,37 +3814,37 @@ public void test400556h() {
" I<T, R, P> i = (String p) -> { return null; };\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in p\\ExceptionType.java (at line 2)\n" +
- " public class ExceptionType extends Exception {\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " class T extends p.ExceptionType {}\n" +
- " ^\n" +
- "The serializable class T does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " I<T, R, P> i = (String p) -> { return null; };\n" +
- " ^\n" +
- "Bound mismatch: The type T is not a valid substitute for the bounded parameter <P extends ParameterType> of the type I<P,T,R>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " I<T, R, P> i = (String p) -> { return null; };\n" +
- " ^\n" +
- "Bound mismatch: The type R is not a valid substitute for the bounded parameter <T extends ExceptionType> of the type I<P,T,R>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " I<T, R, P> i = (String p) -> { return null; };\n" +
- " ^\n" +
- "Bound mismatch: The type P is not a valid substitute for the bounded parameter <R extends ReturnType> of the type I<P,T,R>\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 6)\n" +
- " I<T, R, P> i = (String p) -> { return null; };\n" +
- " ^^^^^^^^^^^^^\n" +
- "The target type of this expression is not a well formed parameterized type due to bound(s) mismatch\n" +
+ "----------\n" +
+ "1. WARNING in p\\ExceptionType.java (at line 2)\n" +
+ " public class ExceptionType extends Exception {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " class T extends p.ExceptionType {}\n" +
+ " ^\n" +
+ "The serializable class T does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " I<T, R, P> i = (String p) -> { return null; };\n" +
+ " ^\n" +
+ "Bound mismatch: The type T is not a valid substitute for the bounded parameter <P extends ParameterType> of the type I<P,T,R>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " I<T, R, P> i = (String p) -> { return null; };\n" +
+ " ^\n" +
+ "Bound mismatch: The type R is not a valid substitute for the bounded parameter <T extends ExceptionType> of the type I<P,T,R>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " I<T, R, P> i = (String p) -> { return null; };\n" +
+ " ^\n" +
+ "Bound mismatch: The type P is not a valid substitute for the bounded parameter <R extends ReturnType> of the type I<P,T,R>\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 6)\n" +
+ " I<T, R, P> i = (String p) -> { return null; };\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The target type of this expression is not a well formed parameterized type due to bound(s) mismatch\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=400556, [1.8][compiler] Visibility checks are missing for lambda/reference expressions
@@ -3878,22 +3878,22 @@ public void test400556i() {
" I<? super P, ? super T, ? super R> i = (String p) -> { return null; };\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in p\\ExceptionType.java (at line 2)\n" +
- " public class ExceptionType extends Exception {\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " class T extends p.ExceptionType {}\n" +
- " ^\n" +
- "The serializable class T does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " I<? super P, ? super T, ? super R> i = (String p) -> { return null; };\n" +
- " ^^^^^^\n" +
- "Lambda expression\'s parameter p is expected to be of type List<? extends List<P>>[]\n" +
+ "----------\n" +
+ "1. WARNING in p\\ExceptionType.java (at line 2)\n" +
+ " public class ExceptionType extends Exception {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " class T extends p.ExceptionType {}\n" +
+ " ^\n" +
+ "The serializable class T does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " I<? super P, ? super T, ? super R> i = (String p) -> { return null; };\n" +
+ " ^^^^^^\n" +
+ "Lambda expression\'s parameter p is expected to be of type List<? extends List<P>>[]\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=400556, [1.8][compiler] Visibility checks are missing for lambda/reference expressions
@@ -3927,28 +3927,28 @@ public void test400556j() {
" I<?, ?, ?> i = (String p) -> { return null; };\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in p\\I.java (at line 4)\n" +
- " R doit(List<? extends List<P>>[] p) throws T;\n" +
- " ^\n" +
- "No exception of type T can be thrown; an exception type must be a subclass of Throwable\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in p\\ExceptionType.java (at line 2)\n" +
- " public class ExceptionType extends Exception {\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " class T extends p.ExceptionType {}\n" +
- " ^\n" +
- "The serializable class T does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " I<?, ?, ?> i = (String p) -> { return null; };\n" +
- " ^^^^^^^^^^^^^\n" +
- "The target type of this expression is not a well formed parameterized type due to bound(s) mismatch\n" +
+ "----------\n" +
+ "1. ERROR in p\\I.java (at line 4)\n" +
+ " R doit(List<? extends List<P>>[] p) throws T;\n" +
+ " ^\n" +
+ "No exception of type T can be thrown; an exception type must be a subclass of Throwable\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in p\\ExceptionType.java (at line 2)\n" +
+ " public class ExceptionType extends Exception {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " class T extends p.ExceptionType {}\n" +
+ " ^\n" +
+ "The serializable class T does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " I<?, ?, ?> i = (String p) -> { return null; };\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The target type of this expression is not a well formed parameterized type due to bound(s) mismatch\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=400556, [1.8][compiler] Visibility checks are missing for lambda/reference expressions
@@ -3979,22 +3979,22 @@ public void test400556k() {
" I i = (String p) -> { return null; };\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in p\\ExceptionType.java (at line 2)\n" +
- " public class ExceptionType extends Exception {\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " I i = (String p) -> { return null; };\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<P,T,R> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " I i = (String p) -> { return null; };\n" +
- " ^^^^^^\n" +
- "Lambda expression\'s parameter p is expected to be of type List[]\n" +
+ "----------\n" +
+ "1. WARNING in p\\ExceptionType.java (at line 2)\n" +
+ " public class ExceptionType extends Exception {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class ExceptionType does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " I i = (String p) -> { return null; };\n" +
+ " ^\n" +
+ "I is a raw type. References to generic type I<P,T,R> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " I i = (String p) -> { return null; };\n" +
+ " ^^^^^^\n" +
+ "Lambda expression\'s parameter p is expected to be of type List[]\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4010,11 +4010,11 @@ public void test384750() {
" I i = x::zoo;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " I i = x::zoo;\n" +
- " ^\n" +
- "Cannot invoke zoo(int, String) on the primitive type int\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " I i = x::zoo;\n" +
+ " ^\n" +
+ "Cannot invoke zoo(int, String) on the primitive type int\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4030,11 +4030,11 @@ public void test384750a() {
" I i = I::new;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " I i = I::new;\n" +
- " ^\n" +
- "Cannot instantiate the type I\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " I i = I::new;\n" +
+ " ^\n" +
+ "Cannot instantiate the type I\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4050,11 +4050,11 @@ public void test384750b() {
" I i = X::new;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " I i = X::new;\n" +
- " ^\n" +
- "Cannot instantiate the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " I i = X::new;\n" +
+ " ^\n" +
+ "Cannot instantiate the type X\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4071,11 +4071,11 @@ public void test384750c() {
"}\n" +
"enum E {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " I i = E::new;\n" +
- " ^\n" +
- "Cannot instantiate the type E\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " I i = E::new;\n" +
+ " ^\n" +
+ "Cannot instantiate the type E\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4091,11 +4091,11 @@ public void test384750d() {
" I i = X<? extends String>::new;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " I i = X<? extends String>::new;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot instantiate the type X<? extends String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " I i = X<? extends String>::new;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot instantiate the type X<? extends String>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4111,11 +4111,11 @@ public void test384750e() {
" I i = T::new;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " I i = T::new;\n" +
- " ^\n" +
- "Cannot instantiate the type T\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " I i = T::new;\n" +
+ " ^\n" +
+ "Cannot instantiate the type T\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4132,11 +4132,11 @@ public void test384750f() {
"}\n" +
"@interface Annot {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " I i = Annot::new;\n" +
- " ^^^^^\n" +
- "Cannot instantiate the type Annot\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " I i = Annot::new;\n" +
+ " ^^^^^\n" +
+ "Cannot instantiate the type Annot\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4155,11 +4155,11 @@ public void test384750g() {
" X<?> foo(int x, String p) { return null; }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " I i = this::foo;\n" +
- " ^^^^\n" +
- "Cannot use this in a static context\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " I i = this::foo;\n" +
+ " ^^^^\n" +
+ "Cannot use this in a static context\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4195,11 +4195,11 @@ public void test384750i() {
" X<?> foo(int x, String p) { return null; }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " I i = super::foo;\n" +
- " ^^^^^\n" +
- "Cannot use super in a static context\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " I i = super::foo;\n" +
+ " ^^^^^\n" +
+ "Cannot use super in a static context\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4219,11 +4219,11 @@ public void test384750j() {
" X<?> foo(int x, String p) { return null; }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " I i = super::foo;\n" +
- " ^^^^^^^^^^\n" +
- "Access to enclosing method foo(int, String) from the type Y is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " I i = super::foo;\n" +
+ " ^^^^^^^^^^\n" +
+ "Access to enclosing method foo(int, String) from the type Y is emulated by a synthetic accessor method\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4241,13 +4241,13 @@ public void test384750k() {
" static class N {\n" +
" I i = X.super::zoo;\n" +
" }\n" +
- "}\n"
+ "}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " I i = X.super::zoo;\n" +
- " ^^^^^^^\n" +
- "No enclosing instance of the type X is accessible in scope\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " I i = X.super::zoo;\n" +
+ " ^^^^^^^\n" +
+ "No enclosing instance of the type X is accessible in scope\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4267,13 +4267,13 @@ public void test384750l() {
" class N {\n" +
" I i = X.super::zoo;\n" +
" }\n" +
- "}\n"
+ "}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " I i = X.super::zoo;\n" +
- " ^^^^^^^^^^^^\n" +
- "Access to enclosing method zoo() from the type Z is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " I i = X.super::zoo;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Access to enclosing method zoo() from the type Z is emulated by a synthetic accessor method\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4300,26 +4300,26 @@ public void test384750m() {
" J j4 = List<Integer>::size;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " I i3 = ArrayList<Integer>::new;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The constructed object of type ArrayList<Integer> is incompatible with the descriptor\'s return type: List<String>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " I i4 = List<String>::new;\n" +
- " ^^^^^^^^^^^^\n" +
- "Cannot instantiate the type List<String>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 14)\n" +
- " J j1 = String::length;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The type String does not define length(ArrayList<String>) that is applicable here\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 17)\n" +
- " J j4 = List<Integer>::size;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The type List<Integer> does not define size(ArrayList<String>) that is applicable here\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " I i3 = ArrayList<Integer>::new;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The constructed object of type ArrayList<Integer> is incompatible with the descriptor\'s return type: List<String>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 13)\n" +
+ " I i4 = List<String>::new;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Cannot instantiate the type List<String>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 14)\n" +
+ " J j1 = String::length;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The type String does not define length(ArrayList<String>) that is applicable here\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 17)\n" +
+ " J j4 = List<Integer>::size;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The type List<Integer> does not define size(ArrayList<String>) that is applicable here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4338,16 +4338,16 @@ public void test384750n() {
" I i3 = ArrayList<String>::new;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " I i1 = ArrayList<String>[]::new;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot create a generic array of ArrayList<String>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " I i2 = List<String>[]::new;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot create a generic array of List<String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " I i1 = ArrayList<String>[]::new;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot create a generic array of ArrayList<String>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " I i2 = List<String>[]::new;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot create a generic array of List<String>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4400,31 +4400,31 @@ public void test384750o() {
" R r = ArrayList[][][]::new;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 34)\n" +
- " I i = List[]::new;\n" +
- " ^^^^^^^^^^^\n" +
- "Incompatible parameter list for array constructor. Expected (int), but found ()\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 35)\n" +
- " J j = ArrayList[]::new;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Incompatible parameter list for array constructor. Expected (int), but found (long)\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 36)\n" +
- " K k = ArrayList[]::new;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Incompatible parameter list for array constructor. Expected (int), but found (String, long)\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 42)\n" +
- " Q q = ArrayList[]::new;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Incompatible parameter list for array constructor. Expected (int), but found (Float)\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 43)\n" +
- " R r = ArrayList[][][]::new;\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Constructed array ArrayList[][][] cannot be assigned to List<String>[] as required in the interface descriptor \n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 34)\n" +
+ " I i = List[]::new;\n" +
+ " ^^^^^^^^^^^\n" +
+ "Incompatible parameter list for array constructor. Expected (int), but found ()\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 35)\n" +
+ " J j = ArrayList[]::new;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Incompatible parameter list for array constructor. Expected (int), but found (long)\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 36)\n" +
+ " K k = ArrayList[]::new;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Incompatible parameter list for array constructor. Expected (int), but found (String, long)\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 42)\n" +
+ " Q q = ArrayList[]::new;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Incompatible parameter list for array constructor. Expected (int), but found (Float)\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 43)\n" +
+ " R r = ArrayList[][][]::new;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Constructed array ArrayList[][][] cannot be assigned to List<String>[] as required in the interface descriptor \n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4446,21 +4446,21 @@ public void test384750p() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " I i1 = x::foo;\n" +
- " ^^^^^^\n" +
- "The method foo() from the type X<String> should be accessed in a static way \n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " I i2 = X<String>::foo;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method foo() from the type X<String> should be accessed in a static way \n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " I i3 = X::foo;\n" +
- " ^^^^^^\n" +
- "The type of foo() from the type X is void, this is incompatible with the descriptor\'s return type: List<String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " I i1 = x::foo;\n" +
+ " ^^^^^^\n" +
+ "The method foo() from the type X<String> should be accessed in a static way \n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " I i2 = X<String>::foo;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The method foo() from the type X<String> should be accessed in a static way \n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " I i3 = X::foo;\n" +
+ " ^^^^^^\n" +
+ "The type of foo() from the type X is void, this is incompatible with the descriptor\'s return type: List<String>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4482,21 +4482,21 @@ public void test384750q() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " I i1 = x::foo;\n" +
- " ^^^^^^\n" +
- "The type of foo() from the type X<String> is void, this is incompatible with the descriptor\'s return type: List<String>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " I i2 = X<String>::foo;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Cannot make a static reference to the non-static method foo() from the type X<String>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " I i3 = X::foo;\n" +
- " ^^^^^^\n" +
- "Cannot make a static reference to the non-static method foo() from the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " I i1 = x::foo;\n" +
+ " ^^^^^^\n" +
+ "The type of foo() from the type X<String> is void, this is incompatible with the descriptor\'s return type: List<String>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " I i2 = X<String>::foo;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Cannot make a static reference to the non-static method foo() from the type X<String>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " I i3 = X::foo;\n" +
+ " ^^^^^^\n" +
+ "Cannot make a static reference to the non-static method foo() from the type X\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4516,11 +4516,11 @@ public void test384750r() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " I i1 = X::foo;\n" +
- " ^^^^^^\n" +
- "The type of foo() from the type X<String> is void, this is incompatible with the descriptor\'s return type: List<String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " I i1 = X::foo;\n" +
+ " ^^^^^^\n" +
+ "The type of foo() from the type X<String> is void, this is incompatible with the descriptor\'s return type: List<String>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4540,11 +4540,11 @@ public void test384750s() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " I i1 = X<String>::foo;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The type of foo() from the type X<String> is void, this is incompatible with the descriptor\'s return type: List<String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " I i1 = X<String>::foo;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The type of foo() from the type X<String> is void, this is incompatible with the descriptor\'s return type: List<String>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4564,11 +4564,11 @@ public void test384750t() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " I i1 = X<String>::foo;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method foo() from the type X<String> should be accessed in a static way \n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " I i1 = X<String>::foo;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The method foo() from the type X<String> should be accessed in a static way \n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4588,11 +4588,11 @@ public void test384750u() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " I i1 = X::foo;\n" +
- " ^^^^^^\n" +
- "The type X does not define foo(X<String>, int) that is applicable here\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " I i1 = X::foo;\n" +
+ " ^^^^^^\n" +
+ "The type X does not define foo(X<String>, int) that is applicable here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4613,11 +4613,11 @@ public void test384750v() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " I i1 = X::foo;\n" +
- " ^^^^^^\n" +
- "Ambiguous method reference: both foo(int) and foo(X<String>, int) from the type X<String> are eligible\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " I i1 = X::foo;\n" +
+ " ^^^^^^\n" +
+ "Ambiguous method reference: both foo(int) and foo(X<String>, int) from the type X<String> are eligible\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4654,21 +4654,21 @@ public void test384750w() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 23)\n" +
- " J j = X<Integer>::new;\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The constructed object of type X<Integer> is incompatible with the descriptor\'s return type: X<String>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 24)\n" +
- " K k = X::new;\n" +
- " ^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 26)\n" +
- " M m = X<String>::new;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The type X<String> does not define X(String) that is applicable here\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 23)\n" +
+ " J j = X<Integer>::new;\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The constructed object of type X<Integer> is incompatible with the descriptor\'s return type: X<String>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 24)\n" +
+ " K k = X::new;\n" +
+ " ^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 26)\n" +
+ " M m = X<String>::new;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The type X<String> does not define X(String) that is applicable here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4678,7 +4678,7 @@ public void test384750x() {
"X.java",
"import java.util.List;\n" +
"import java.io.IOException;\n" +
- "import java.io.FileNotFoundException;\n" +
+ "import java.io.FileNotFoundException;\n" +
"interface I {\n" +
" X<String> doit(int x);\n" +
"}\n" +
@@ -4701,26 +4701,26 @@ public void test384750x() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 19)\n" +
- " I i = X::new;\n" +
- " ^^^^^^\n" +
- "Unhandled exception type IOException\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 19)\n" +
- " I i = X::new;\n" +
- " ^^^^^^\n" +
- "Unhandled exception type FileNotFoundException\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 20)\n" +
- " J j = X<Integer>::new;\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The constructed object of type X<Integer> is incompatible with the descriptor\'s return type: X<String>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 21)\n" +
- " K k = X::new;\n" +
- " ^^^^^^\n" +
- "Unhandled exception type IOException\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 19)\n" +
+ " I i = X::new;\n" +
+ " ^^^^^^\n" +
+ "Unhandled exception type IOException\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 19)\n" +
+ " I i = X::new;\n" +
+ " ^^^^^^\n" +
+ "Unhandled exception type FileNotFoundException\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 20)\n" +
+ " J j = X<Integer>::new;\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The constructed object of type X<Integer> is incompatible with the descriptor\'s return type: X<String>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 21)\n" +
+ " K k = X::new;\n" +
+ " ^^^^^^\n" +
+ "Unhandled exception type IOException\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4740,11 +4740,11 @@ public void test384750y() {
" I i = super::foo;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " I i = super::foo;\n" +
- " ^^^^^^^^^^\n" +
- "Cannot directly invoke the abstract method foo() for the type Y\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " I i = super::foo;\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot directly invoke the abstract method foo() for the type Y\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4766,11 +4766,11 @@ public void test384750z() {
" I i = X::foo;\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " I i = X::foo;\n" +
- " ^^^^^^\n" +
- "The static method foo() from the type Y should be accessed directly \n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " I i = X::foo;\n" +
+ " ^^^^^^\n" +
+ "The static method foo() from the type Y should be accessed directly \n" +
"----------\n",
null, false, customOptions);
}
@@ -4787,21 +4787,21 @@ public void test384750z1() {
"class X extends Y {\n" +
" I i = X::foo;\n" +
"}\n",
- "Y.java",
+ "Y.java",
"@Deprecated class Y {\n" +
" @Deprecated static void foo() {}\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " class X extends Y {\n" +
- " ^\n" +
- "The type Y is deprecated\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " I i = X::foo;\n" +
- " ^^^^^^\n" +
- "The method foo() from the type Y is deprecated\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " class X extends Y {\n" +
+ " ^\n" +
+ "The type Y is deprecated\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " I i = X::foo;\n" +
+ " ^^^^^^\n" +
+ "The method foo() from the type Y is deprecated\n" +
"----------\n",
null, false, customOptions);
}
@@ -4818,26 +4818,26 @@ public void test384750z2() {
"class X extends Y {\n" +
" I i = X::<String>foo;\n" +
"}\n",
- "Y.java",
+ "Y.java",
"@Deprecated class Y {\n" +
" @Deprecated static void foo() {}\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " class X extends Y {\n" +
- " ^\n" +
- "The type Y is deprecated\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " I i = X::<String>foo;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method foo() from the type Y is deprecated\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 5)\n" +
- " I i = X::<String>foo;\n" +
- " ^^^^^^\n" +
- "Unused type arguments for the non generic method foo() of type Y; it should not be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " class X extends Y {\n" +
+ " ^\n" +
+ "The type Y is deprecated\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " I i = X::<String>foo;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The method foo() from the type Y is deprecated\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 5)\n" +
+ " I i = X::<String>foo;\n" +
+ " ^^^^^^\n" +
+ "Unused type arguments for the non generic method foo() of type Y; it should not be parameterized with arguments <String>\n" +
"----------\n",
null, false, customOptions);
}
@@ -4870,11 +4870,11 @@ public void test384750z4() {
" I i = new X()::foo;\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " I i = new X()::foo;\n" +
- " ^^^^^^^^^^^^\n" +
- "The type of foo() from the type X is void, this is incompatible with the descriptor\'s return type: List<String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " I i = new X()::foo;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The type of foo() from the type X is void, this is incompatible with the descriptor\'s return type: List<String>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4892,11 +4892,11 @@ public void test384750z5() {
" I i = new X()::foo;\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " I i = new X()::foo;\n" +
- " ^^^^^^^^^^^^\n" +
- "The type of foo() from the type X is ArrayList<Integer>, this is incompatible with the descriptor\'s return type: List<String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " I i = new X()::foo;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The type of foo() from the type X is ArrayList<Integer>, this is incompatible with the descriptor\'s return type: List<String>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4935,11 +4935,11 @@ this.runNegativeTest(
" I i = X::foo;\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " List<String> doit(X x, int y);\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " List<String> doit(X x, int y);\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=384750, [1.8] Compiler should reject invalid method reference expressions
@@ -4970,21 +4970,21 @@ this.runNegativeTest(
" I i = X::foo;\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " Zork foo() {\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " I i = X::foo;\n" +
- " ^^^^^^\n" +
- "The method foo() from the type X refers to the missing type Zork\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " I i = X::foo;\n" +
- " ^^^^^^\n" +
- "The type of foo() from the type X is Zork, this is incompatible with the descriptor\'s return type: int[]\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " Zork foo() {\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " I i = X::foo;\n" +
+ " ^^^^^^\n" +
+ "The method foo() from the type X refers to the missing type Zork\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " I i = X::foo;\n" +
+ " ^^^^^^\n" +
+ "The type of foo() from the type X is Zork, this is incompatible with the descriptor\'s return type: int[]\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401610, [1.8][compiler] Allow lambda/reference expressions in non-overloaded method invocation contexts
@@ -5037,8 +5037,8 @@ this.runConformTest(
" }\n" +
"}\n",
},
- "foo(I)\n" +
- "foo(J)\n" +
+ "foo(I)\n" +
+ "foo(J)\n" +
"foo(K)");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401610, [1.8][compiler] Allow lambda/reference expressions in non-overloaded method invocation contexts
@@ -5069,16 +5069,16 @@ this.runNegativeTest(
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 20)\n" +
- " new X().foo((s)->{});\n" +
- " ^^^\n" +
- "The method foo(I) in the type X is not applicable for the arguments ((<no type> s) -> {})\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 20)\n" +
- " new X().foo((s)->{});\n" +
- " ^^^^^\n" +
- "Lambda expression\'s signature does not match the signature of the functional interface method foo()\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 20)\n" +
+ " new X().foo((s)->{});\n" +
+ " ^^^\n" +
+ "The method foo(I) in the type X is not applicable for the arguments ((<no type> s) -> {})\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 20)\n" +
+ " new X().foo((s)->{});\n" +
+ " ^^^^^\n" +
+ "Lambda expression\'s signature does not match the signature of the functional interface method foo()\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401610, [1.8][compiler] Allow lambda/reference expressions in non-overloaded method invocation contexts
@@ -5111,46 +5111,46 @@ this.runNegativeTest(
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 15)\n" +
- " new X().foo(()->{ return \"\";});\n" +
- " ^^^\n" +
- "The method foo(I) in the type X is not applicable for the arguments (() -> {})\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 15)\n" +
- " new X().foo(()->{ return \"\";});\n" +
- " ^^^^^^^^^^\n" +
- "Void methods cannot return a value\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 16)\n" +
- " new X().foo(()-> 10);\n" +
- " ^^^\n" +
- "The method foo(I) in the type X is not applicable for the arguments (() -> {})\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 16)\n" +
- " new X().foo(()-> 10);\n" +
- " ^^\n" +
- "Void methods cannot return a value\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 17)\n" +
- " new X().foo((s)->{});\n" +
- " ^^^\n" +
- "The method foo(I) in the type X is not applicable for the arguments ((<no type> s) -> {})\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 17)\n" +
- " new X().foo((s)->{});\n" +
- " ^^^^^\n" +
- "Lambda expression\'s signature does not match the signature of the functional interface method foo()\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 18)\n" +
- " new X().foo((s)->{ return;});\n" +
- " ^^^\n" +
- "The method foo(I) in the type X is not applicable for the arguments ((<no type> s) -> {})\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 18)\n" +
- " new X().foo((s)->{ return;});\n" +
- " ^^^^^\n" +
- "Lambda expression\'s signature does not match the signature of the functional interface method foo()\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 15)\n" +
+ " new X().foo(()->{ return \"\";});\n" +
+ " ^^^\n" +
+ "The method foo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 15)\n" +
+ " new X().foo(()->{ return \"\";});\n" +
+ " ^^^^^^^^^^\n" +
+ "Void methods cannot return a value\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 16)\n" +
+ " new X().foo(()-> 10);\n" +
+ " ^^^\n" +
+ "The method foo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 16)\n" +
+ " new X().foo(()-> 10);\n" +
+ " ^^\n" +
+ "Void methods cannot return a value\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 17)\n" +
+ " new X().foo((s)->{});\n" +
+ " ^^^\n" +
+ "The method foo(I) in the type X is not applicable for the arguments ((<no type> s) -> {})\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 17)\n" +
+ " new X().foo((s)->{});\n" +
+ " ^^^^^\n" +
+ "Lambda expression\'s signature does not match the signature of the functional interface method foo()\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 18)\n" +
+ " new X().foo((s)->{ return;});\n" +
+ " ^^^\n" +
+ "The method foo(I) in the type X is not applicable for the arguments ((<no type> s) -> {})\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 18)\n" +
+ " new X().foo((s)->{ return;});\n" +
+ " ^^^^^\n" +
+ "Lambda expression\'s signature does not match the signature of the functional interface method foo()\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401610, [1.8][compiler] Allow lambda/reference expressions in non-overloaded method invocation contexts
@@ -5180,26 +5180,26 @@ this.runNegativeTest(
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 1)\n" +
- " interface I<T extends String> {\n" +
- " ^^^^^^\n" +
- "The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " <T> T foo(I<T> it) { return null; }\n" +
- " ^\n" +
- "Bound mismatch: The type T is not a valid substitute for the bounded parameter <T extends String> of the type I<T>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " new X().foo(()->{});\n" +
- " ^^^\n" +
- "The method foo(I<Object>) in the type X is not applicable for the arguments (() -> {})\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " new X().foo(()->{});\n" +
- " ^^^^\n" +
- "The target type of this expression is not a well formed parameterized type due to bound(s) mismatch\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 1)\n" +
+ " interface I<T extends String> {\n" +
+ " ^^^^^^\n" +
+ "The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " <T> T foo(I<T> it) { return null; }\n" +
+ " ^\n" +
+ "Bound mismatch: The type T is not a valid substitute for the bounded parameter <T extends String> of the type I<T>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " new X().foo(()->{});\n" +
+ " ^^^\n" +
+ "The method foo(I<Object>) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " new X().foo(()->{});\n" +
+ " ^^^^\n" +
+ "The target type of this expression is not a well formed parameterized type due to bound(s) mismatch\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=401610, [1.8][compiler] Allow lambda/reference expressions in non-overloaded method invocation contexts
@@ -5220,16 +5220,16 @@ this.runNegativeTest(
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 1)\n" +
- " interface I<T extends String> {\n" +
- " ^^^^^^\n" +
- "The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " <T extends String> T foo(I<T> it) { return null; }\n" +
- " ^^^^^^\n" +
- "The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 1)\n" +
+ " interface I<T extends String> {\n" +
+ " ^^^^^^\n" +
+ "The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " <T extends String> T foo(I<T> it) { return null; }\n" +
+ " ^^^^^^\n" +
+ "The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401610, [1.8][compiler] Allow lambda/reference expressions in non-overloaded method invocation contexts
@@ -5289,16 +5289,16 @@ this.runNegativeTest(
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " new X().foo(()->{ return 10; });\n" +
- " ^^^\n" +
- "The method foo(I) in the type X is not applicable for the arguments (() -> {})\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " new X().foo(()->{ return 10; });\n" +
- " ^^^^^^^^^^\n" +
- "Void methods cannot return a value\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " new X().foo(()->{ return 10; });\n" +
+ " ^^^\n" +
+ "The method foo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " new X().foo(()->{ return 10; });\n" +
+ " ^^^^^^^^^^\n" +
+ "Void methods cannot return a value\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401610, [1.8][compiler] Allow lambda/reference expressions in non-overloaded method invocation contexts
@@ -5315,7 +5315,7 @@ this.runConformTest(
"public class X {\n" +
" void foo(I it) { System.out.println(\"foo(I)\");}\n" +
" void foo(J it) { System.out.println(\"foo(J)\");}\n" +
-
+
" public static void main(String[] args) {\n" +
" new X().foo((String s)->{});\n" +
" }\n" +
@@ -5337,22 +5337,22 @@ this.runNegativeTest(
"public class X {\n" +
" void foo(I it) { System.out.println(\"foo(I)\");}\n" +
" void foo(J it) { System.out.println(\"foo(J)\");}\n" +
-
+
" public static void main(String[] args) {\n" +
" new X().foo((Object o)->{});\n" +
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " new X().foo((Object o)->{});\n" +
- " ^^^\n" +
- "The method foo(I) in the type X is not applicable for the arguments ((Object o) -> {})\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " new X().foo((Object o)->{});\n" +
- " ^^^^^^\n" +
- "Lambda expression\'s parameter o is expected to be of type int\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " new X().foo((Object o)->{});\n" +
+ " ^^^\n" +
+ "The method foo(I) in the type X is not applicable for the arguments ((Object o) -> {})\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " new X().foo((Object o)->{});\n" +
+ " ^^^^^^\n" +
+ "Lambda expression\'s parameter o is expected to be of type int\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401789, [1.8][compiler] Enable support for method/constructor references in non-overloaded method calls.
@@ -5394,11 +5394,11 @@ this.runNegativeTest(
" Zork z;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 31)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 31)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401789, [1.8][compiler] Enable support for method/constructor references in non-overloaded method calls.
@@ -5440,71 +5440,71 @@ this.runNegativeTest(
" Zork z;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " this(X::goo);\n" +
- " ^^^^^^^^^^^^^\n" +
- "The constructor X.Y(X::goo) is undefined\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " this(X::goo);\n" +
- " ^^^^^^\n" +
- "The type of goo() from the type X is int, this is incompatible with the descriptor\'s return type: String\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 14)\n" +
- " this((x) -> { return 10;});\n" +
- " ^^\n" +
- "Type mismatch: cannot convert from int to String\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 18)\n" +
- " foo(X::goo);\n" +
- " ^^^\n" +
- "The method foo(I) in the type X is not applicable for the arguments (X::goo)\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 18)\n" +
- " foo(X::goo);\n" +
- " ^^^^^^\n" +
- "The type of goo() from the type X is int, this is incompatible with the descriptor\'s return type: String\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 19)\n" +
- " new X((x)->{ return 10;});\n" +
- " ^^\n" +
- "Type mismatch: cannot convert from int to String\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 20)\n" +
- " new X((x)->{ return 10;}).new Y((x) -> { return 0;});\n" +
- " ^^\n" +
- "Type mismatch: cannot convert from int to String\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 20)\n" +
- " new X((x)->{ return 10;}).new Y((x) -> { return 0;});\n" +
- " ^\n" +
- "Type mismatch: cannot convert from int to String\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 21)\n" +
- " new X((x)->{ return 10;}) {};\n" +
- " ^^\n" +
- "Type mismatch: cannot convert from int to String\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 26)\n" +
- " super(X::goo);\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The constructor X(X::goo) is undefined\n" +
- "----------\n" +
- "11. ERROR in X.java (at line 26)\n" +
- " super(X::goo);\n" +
- " ^^^^^^\n" +
- "The type of goo() from the type X is int, this is incompatible with the descriptor\'s return type: String\n" +
- "----------\n" +
- "12. ERROR in X.java (at line 29)\n" +
- " super (x -> 10);\n" +
- " ^^\n" +
- "Type mismatch: cannot convert from int to String\n" +
- "----------\n" +
- "13. ERROR in X.java (at line 31)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " this(X::goo);\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The constructor X.Y(X::goo) is undefined\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " this(X::goo);\n" +
+ " ^^^^^^\n" +
+ "The type of goo() from the type X is int, this is incompatible with the descriptor\'s return type: String\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 14)\n" +
+ " this((x) -> { return 10;});\n" +
+ " ^^\n" +
+ "Type mismatch: cannot convert from int to String\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 18)\n" +
+ " foo(X::goo);\n" +
+ " ^^^\n" +
+ "The method foo(I) in the type X is not applicable for the arguments (X::goo)\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 18)\n" +
+ " foo(X::goo);\n" +
+ " ^^^^^^\n" +
+ "The type of goo() from the type X is int, this is incompatible with the descriptor\'s return type: String\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 19)\n" +
+ " new X((x)->{ return 10;});\n" +
+ " ^^\n" +
+ "Type mismatch: cannot convert from int to String\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 20)\n" +
+ " new X((x)->{ return 10;}).new Y((x) -> { return 0;});\n" +
+ " ^^\n" +
+ "Type mismatch: cannot convert from int to String\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 20)\n" +
+ " new X((x)->{ return 10;}).new Y((x) -> { return 0;});\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from int to String\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 21)\n" +
+ " new X((x)->{ return 10;}) {};\n" +
+ " ^^\n" +
+ "Type mismatch: cannot convert from int to String\n" +
+ "----------\n" +
+ "10. ERROR in X.java (at line 26)\n" +
+ " super(X::goo);\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The constructor X(X::goo) is undefined\n" +
+ "----------\n" +
+ "11. ERROR in X.java (at line 26)\n" +
+ " super(X::goo);\n" +
+ " ^^^^^^\n" +
+ "The type of goo() from the type X is int, this is incompatible with the descriptor\'s return type: String\n" +
+ "----------\n" +
+ "12. ERROR in X.java (at line 29)\n" +
+ " super (x -> 10);\n" +
+ " ^^\n" +
+ "Type mismatch: cannot convert from int to String\n" +
+ "----------\n" +
+ "13. ERROR in X.java (at line 31)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401845, [1.8][compiler] Bad interaction between varargs and lambas/references
@@ -5524,11 +5524,11 @@ public void test401845() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public class X extends Zork {\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " public class X extends Zork {\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401845, [1.8][compiler] Bad interaction between varargs and lambas/references
@@ -5548,26 +5548,26 @@ public void test401845a() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " foo(X::goo);\n" +
- " ^^^\n" +
- "The method foo(I[]...) in the type X is not applicable for the arguments (X::goo)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " foo(X::goo);\n" +
- " ^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " foo((x)-> {return 10;});\n" +
- " ^^^\n" +
- "The method foo(I[]...) in the type X is not applicable for the arguments ((<no type> x) -> {})\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " foo((x)-> {return 10;});\n" +
- " ^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " foo(X::goo);\n" +
+ " ^^^\n" +
+ "The method foo(I[]...) in the type X is not applicable for the arguments (X::goo)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " foo(X::goo);\n" +
+ " ^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 9)\n" +
+ " foo((x)-> {return 10;});\n" +
+ " ^^^\n" +
+ "The method foo(I[]...) in the type X is not applicable for the arguments ((<no type> x) -> {})\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 9)\n" +
+ " foo((x)-> {return 10;});\n" +
+ " ^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401845, [1.8][compiler] Bad interaction between varargs and lambas/references
@@ -5587,11 +5587,11 @@ public void test401845b() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public class X extends Zork {\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " public class X extends Zork {\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401845, [1.8][compiler] Bad interaction between varargs and lambas/references
@@ -5614,11 +5614,11 @@ public void test401845c() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public class X extends Zork {\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " public class X extends Zork {\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401845, [1.8][compiler] Bad interaction between varargs and lambas/references
@@ -5640,11 +5640,11 @@ public void test401845d() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public class X extends Zork {\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " public class X extends Zork {\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401845, [1.8][compiler] Bad interaction between varargs and lambas/references
@@ -5667,11 +5667,11 @@ public void test401845e() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public class X extends Zork {\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " public class X extends Zork {\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401847, [1.8][compiler] Polyconditionals not accepted in method invocation contexts.
@@ -5693,16 +5693,16 @@ public void test401847() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " foo(true ? X::goo : X::goo);\n" +
- " ^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " foo(true ? x-> 1 : x->0);\n" +
- " ^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " foo(true ? X::goo : X::goo);\n" +
+ " ^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " foo(true ? x-> 1 : x->0);\n" +
+ " ^^^^\n" +
+ "Dead code\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401847, [1.8][compiler] Polyconditionals not accepted in method invocation contexts.
@@ -5722,31 +5722,31 @@ public void test401847a() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " foo(true ? X::goo : X::goo);\n" +
- " ^^^\n" +
- "The method foo(I...) in the type X is not applicable for the arguments ((true ? X::goo : X::goo))\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " foo(true ? X::goo : X::goo);\n" +
- " ^^^^^^\n" +
- "The type of goo() from the type X is int, this is incompatible with the descriptor\'s return type: String\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " foo(true ? X::goo : X::goo);\n" +
- " ^^^^^^\n" +
- "The type of goo() from the type X is int, this is incompatible with the descriptor\'s return type: String\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " foo(true ? x-> 1 : x->0);\n" +
- " ^\n" +
- "Type mismatch: cannot convert from int to String\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 9)\n" +
- " foo(true ? x-> 1 : x->0);\n" +
- " ^\n" +
- "Type mismatch: cannot convert from int to String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " foo(true ? X::goo : X::goo);\n" +
+ " ^^^\n" +
+ "The method foo(I...) in the type X is not applicable for the arguments ((true ? X::goo : X::goo))\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " foo(true ? X::goo : X::goo);\n" +
+ " ^^^^^^\n" +
+ "The type of goo() from the type X is int, this is incompatible with the descriptor\'s return type: String\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " foo(true ? X::goo : X::goo);\n" +
+ " ^^^^^^\n" +
+ "The type of goo() from the type X is int, this is incompatible with the descriptor\'s return type: String\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 9)\n" +
+ " foo(true ? x-> 1 : x->0);\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from int to String\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 9)\n" +
+ " foo(true ? x-> 1 : x->0);\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from int to String\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401939, [1.8][compiler] Incorrect shape analysis leads to method resolution failure .
@@ -5766,11 +5766,11 @@ public void test401939() {
" foo(()->{ throw new RuntimeException(); });\n" +
" }\n" +
"}\n", },
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " void foo(I i) {}\n" +
- " ^\n" +
- "The parameter i is hiding a field from type X\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " void foo(I i) {}\n" +
+ " ^\n" +
+ "The parameter i is hiding a field from type X\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401939, [1.8][compiler] Incorrect shape analysis leads to method resolution failure .
@@ -5788,16 +5788,16 @@ public void test401939a() {
" foo(()->{ if (1 == 2) throw new RuntimeException(); });\n" +
" }\n" +
"}\n", },
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " void foo(I i) {}\n" +
- " ^\n" +
- "The parameter i is hiding a field from type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " foo(()->{ if (1 == 2) throw new RuntimeException(); });\n" +
- " ^^^\n" +
- "The method foo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " void foo(I i) {}\n" +
+ " ^\n" +
+ "The parameter i is hiding a field from type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " foo(()->{ if (1 == 2) throw new RuntimeException(); });\n" +
+ " ^^^\n" +
+ "The method foo(I) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401939, [1.8][compiler] Incorrect shape analysis leads to method resolution failure .
@@ -5829,26 +5829,26 @@ public void test401939b() {
" goo((x) -> { while (BLANK) throw new Exception(); });\n" +
" }\n" +
"}\n", },
- "----------\n" +
- "1. ERROR in X.java (at line 14)\n" +
- " goo((x) -> { while (FALSE) throw new Exception(); });\n" +
- " ^^^^^^\n" +
- "This lambda expression must return a result of type String\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 17)\n" +
- " goo((x) -> { while (POI) throw new Exception(); });\n" +
- " ^^^^^^\n" +
- "This lambda expression must return a result of type String\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 19)\n" +
- " goo((x) -> { if (TRUE) throw new Exception(); });\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments ((<no type> x) -> {})\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 22)\n" +
- " goo((x) -> { while (BLANK) throw new Exception(); });\n" +
- " ^^^^^^\n" +
- "This lambda expression must return a result of type String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 14)\n" +
+ " goo((x) -> { while (FALSE) throw new Exception(); });\n" +
+ " ^^^^^^\n" +
+ "This lambda expression must return a result of type String\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 17)\n" +
+ " goo((x) -> { while (POI) throw new Exception(); });\n" +
+ " ^^^^^^\n" +
+ "This lambda expression must return a result of type String\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 19)\n" +
+ " goo((x) -> { if (TRUE) throw new Exception(); });\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments ((<no type> x) -> {})\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 22)\n" +
+ " goo((x) -> { while (BLANK) throw new Exception(); });\n" +
+ " ^^^^^^\n" +
+ "This lambda expression must return a result of type String\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401939, [1.8][compiler] Incorrect shape analysis leads to method resolution failure .
@@ -5867,16 +5867,16 @@ public void test401939c() {
" goo((x) -> {});\n" +
" }\n" +
"}\n", },
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " goo((x) -> { if (x) return null; });\n" +
- " ^\n" +
- "Type mismatch: cannot convert from String to boolean\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " goo((x) -> {});\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments ((<no type> x) -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " goo((x) -> { if (x) return null; });\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from String to boolean\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " goo((x) -> {});\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments ((<no type> x) -> {})\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401939, [1.8][compiler] Incorrect shape analysis leads to method resolution failure .
@@ -5894,11 +5894,11 @@ public void test401939ca() {
" goo((x) -> {});\n" +
" }\n" +
"}\n", },
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " goo((x) -> {});\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments ((<no type> x) -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " goo((x) -> {});\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments ((<no type> x) -> {})\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401939, [1.8][compiler] Incorrect shape analysis leads to method resolution failure .
@@ -5916,11 +5916,11 @@ public void test401939d() {
" goo((x) -> { if (x) return null; });\n" +
" }\n" +
"}\n", },
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " goo((x) -> { if (x) return null; });\n" +
- " ^^^^^^\n" +
- "This method must return a result of type String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " goo((x) -> { if (x) return null; });\n" +
+ " ^^^^^^\n" +
+ "This method must return a result of type String\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401939, [1.8][compiler] Incorrect shape analysis leads to method resolution failure .
@@ -5938,16 +5938,16 @@ public void test401939e() {
" goo((x) -> { return null; });\n" +
" }\n" +
"}\n", },
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " goo((x) -> { return null; });\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments ((<no type> x) -> {})\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " goo((x) -> { return null; });\n" +
- " ^^^^^^^^^^^^\n" +
- "Void methods cannot return a value\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " goo((x) -> { return null; });\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments ((<no type> x) -> {})\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " goo((x) -> { return null; });\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Void methods cannot return a value\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401939, [1.8][compiler] Incorrect shape analysis leads to method resolution failure .
@@ -5986,16 +5986,16 @@ public void test402219() {
" }\n" +
" Zork z;\n" +
"}\n", },
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " new X().goo((p1, p2) -> p1 = p1 + p2);\n" +
- " ^^^\n" +
- "The method goo(I) is ambiguous for the type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " new X().goo((p1, p2) -> p1 = p1 + p2);\n" +
+ " ^^^\n" +
+ "The method goo(I) is ambiguous for the type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 13)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=402219, [1.8][compiler] Compile time errors in lambda during hypothetical type check should render candidate method inapplicable.
@@ -6020,11 +6020,11 @@ public void test402219a() {
" new X().goo((p1, p2) -> {});\n" +
" }\n" +
"}\n", },
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " new X().goo((p1, p2) -> {});\n" +
- " ^^\n" +
- "Empty block should be documented\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " new X().goo((p1, p2) -> {});\n" +
+ " ^^\n" +
+ "Empty block should be documented\n" +
"----------\n",
null,
false,
@@ -6049,19 +6049,19 @@ public void test402219b() {
" }\n" +
" Zork z;\n" +
"}\n", },
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " new X().goo((p1, p2) -> p1 + p2);\n" +
- " ^^^\n" +
- "The method goo(I) is ambiguous for the type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " new X().goo((p1, p2) -> p1 + p2);\n" +
+ " ^^^\n" +
+ "The method goo(I) is ambiguous for the type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 13)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=402259, [1.8][compiler] NPE during overload resolution when there are syntax errors.
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=402259, [1.8][compiler] NPE during overload resolution when there are syntax errors.
public void test402259() {
this.runNegativeTest(
new String[] {
@@ -6078,14 +6078,14 @@ public void test402259() {
" new X().foo(() -> { return () -> { return}; });\n" +
" }\n" +
"}\n", },
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " new X().foo(() -> { return () -> { return}; });\n" +
- " ^^^^^^\n" +
- "Syntax error, insert \";\" to complete BlockStatements\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " new X().foo(() -> { return () -> { return}; });\n" +
+ " ^^^^^^\n" +
+ "Syntax error, insert \";\" to complete BlockStatements\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=402261, [1.8][compiler] Shape analysis confused by returns from inner classes..
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=402261, [1.8][compiler] Shape analysis confused by returns from inner classes..
public void test402261() {
this.runNegativeTest(
new String[] {
@@ -6102,16 +6102,16 @@ public void test402261() {
" new X().foo(() -> { class local { void foo() { return; }} return () -> { return;}; });\n" +
" }\n" +
" Zork z;\n" +
- "}\n",
+ "}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=402261, [1.8][compiler] Shape analysis confused by returns from inner classes..
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=402261, [1.8][compiler] Shape analysis confused by returns from inner classes..
public void test402261a() {
this.runNegativeTest(
new String[] {
@@ -6128,16 +6128,16 @@ public void test402261a() {
" new X().foo(() -> { J j = () -> { return; }; return () -> { return;}; });\n" +
" }\n" +
" Zork z;\n" +
- "}\n",
+ "}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=402261, [1.8][compiler] Shape analysis confused by returns from inner classes..
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=402261, [1.8][compiler] Shape analysis confused by returns from inner classes..
public void test402261b() {
this.runNegativeTest(
new String[] {
@@ -6154,16 +6154,16 @@ public void test402261b() {
" new X().foo(() -> { J j = new J() { public void foo() { return; } }; return () -> { return;}; });\n" +
" }\n" +
" Zork z;\n" +
- "}\n",
+ "}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=402261, [1.8][compiler] Shape analysis confused by returns from inner classes..
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=402261, [1.8][compiler] Shape analysis confused by returns from inner classes..
public void test402261c() {
this.runNegativeTest(
new String[] {
@@ -6180,13 +6180,13 @@ public void test402261c() {
" new X().foo(() -> { return new J() { public void foo() { return; } }; });\n" +
" }\n" +
" Zork z;\n" +
- "}\n",
+ "}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401769, [1.8][compiler] Explore solutions with better performance characteristics than LambdaExpression#copy()
@@ -6207,13 +6207,13 @@ public void test401769() {
" {\n" +
" g(() -> f++);\n" +
" }\n" +
- "}\n",
+ "}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " g(() -> f++);\n" +
- " ^\n" +
- "The method g(I) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " g(() -> f++);\n" +
+ " ^\n" +
+ "The method g(I) is ambiguous for the type X\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=402609, [1.8][compiler] AIOOB exception with a program using method references.
@@ -6240,13 +6240,13 @@ public void test402609() {
" public static void main(String[] args) {\n" +
" f(super::foo);\n" +
" }\n" +
- "}\n",
+ "}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 18)\n" +
- " f(super::foo);\n" +
- " ^^^^^\n" +
- "Cannot use super in a static context\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 18)\n" +
+ " f(super::foo);\n" +
+ " ^^^^^\n" +
+ "Cannot use super in a static context\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=402609, [1.8][compiler] AIOOB exception with a program using method references.
@@ -6273,18 +6273,18 @@ public void test402609a() {
" f(super::foo);\n" +
" I i = super::foo;\n" +
" }\n" +
- "}\n",
+ "}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 17)\n" +
- " f(super::foo);\n" +
- " ^^^^^^^^^^\n" +
- "Cannot directly invoke the abstract method foo() for the type Y\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 18)\n" +
- " I i = super::foo;\n" +
- " ^^^^^^^^^^\n" +
- "Cannot directly invoke the abstract method foo() for the type Y\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 17)\n" +
+ " f(super::foo);\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot directly invoke the abstract method foo() for the type Y\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 18)\n" +
+ " I i = super::foo;\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot directly invoke the abstract method foo() for the type Y\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=402609, [1.8][compiler] AIOOB exception with a program using method references.
@@ -6311,18 +6311,18 @@ public void test402609b() {
" public void zoo(String[] args) {\n" +
" f(super::foo);\n" +
" }\n" +
- "}\n",
+ "}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 18)\n" +
- " f(super::foo);\n" +
- " ^\n" +
- "The method f(I) is ambiguous for the type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 18)\n" +
- " f(super::foo);\n" +
- " ^^^^^^^^^^\n" +
- "Cannot directly invoke the abstract method foo() for the type Y\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 18)\n" +
+ " f(super::foo);\n" +
+ " ^\n" +
+ "The method f(I) is ambiguous for the type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 18)\n" +
+ " f(super::foo);\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot directly invoke the abstract method foo() for the type Y\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=402609, [1.8][compiler] AIOOB exception with a program using method references.
@@ -6349,13 +6349,13 @@ public void test402609c() {
" public void main(String[] args) {\n" +
" f(super::foo);\n" +
" }\n" +
- "}\n",
+ "}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 18)\n" +
- " f(super::foo);\n" +
- " ^\n" +
- "The method f(I) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 18)\n" +
+ " f(super::foo);\n" +
+ " ^\n" +
+ "The method f(I) is ambiguous for the type X\n" +
"----------\n");
}
@@ -6391,11 +6391,11 @@ public void testSuperReference01() {
"interface I2 extends I1 {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " doOutput(I1.super::print); // illegal attempt to skip I2.print()\n" +
- " ^^^^^^^^\n" +
- "Illegal reference to super type I1, cannot bypass the more specific direct super type I2\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " doOutput(I1.super::print); // illegal attempt to skip I2.print()\n" +
+ " ^^^^^^^^\n" +
+ "Illegal reference to super type I1, cannot bypass the more specific direct super type I2\n" +
"----------\n"
);
}
@@ -6406,17 +6406,17 @@ public void testSuperReference02() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I0 {\n" +
- " default void print() { System.out.println(\"I0\"); }\n" +
- "}\n" +
- "\n" +
- "interface IA extends I0 {}\n" +
- "\n" +
- "interface IB extends I0 {\n" +
- " @Override default void print() {\n" +
- " System.out.println(\"IB\");\n" +
- " }\n" +
- "}\n" +
+ "interface I0 {\n" +
+ " default void print() { System.out.println(\"I0\"); }\n" +
+ "}\n" +
+ "\n" +
+ "interface IA extends I0 {}\n" +
+ "\n" +
+ "interface IB extends I0 {\n" +
+ " @Override default void print() {\n" +
+ " System.out.println(\"IB\");\n" +
+ " }\n" +
+ "}\n" +
"public class X implements IA, IB {\n" +
" @Override\n" +
" public void print() {\n" +
@@ -6436,11 +6436,11 @@ public void testSuperReference02() {
" void print();\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 17)\n" +
- " doOutput(IA.super::print); // illegal attempt to skip IB.print()\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Illegal reference to super method print() from type I0, cannot bypass the more specific override from type IB\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 17)\n" +
+ " doOutput(IA.super::print); // illegal attempt to skip IB.print()\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Illegal reference to super method print() from type I0, cannot bypass the more specific override from type IB\n" +
"----------\n"
);
}
@@ -6449,41 +6449,41 @@ public void testSuperReference03() {
this.runNegativeTest(
new String[] {
"XY.java",
- "interface J {\n" +
- " void foo(int x);\n" +
- "}\n" +
- "class XX {\n" +
- " public void foo(int x) {}\n" +
- "}\n" +
- "class Y extends XX {\n" +
- " static class Z {\n" +
- " public static void foo(int x) {\n" +
- " System.out.print(x);\n" +
- " }\n" +
- " }\n" +
- " public void foo(int x) {\n" +
- " System.out.print(x);\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "public class XY extends XX {\n" +
- " @SuppressWarnings(\"unused\")\n" +
- " public void bar(String [] args) {\n" +
- " Y y = new Y();\n" +
- " J jj = y :: foo;\n" +
- " J jx = y.super :: foo;\n" +
- " }\n" +
- " public static void main (String [] args) {}\n" +
+ "interface J {\n" +
+ " void foo(int x);\n" +
+ "}\n" +
+ "class XX {\n" +
+ " public void foo(int x) {}\n" +
+ "}\n" +
+ "class Y extends XX {\n" +
+ " static class Z {\n" +
+ " public static void foo(int x) {\n" +
+ " System.out.print(x);\n" +
+ " }\n" +
+ " }\n" +
+ " public void foo(int x) {\n" +
+ " System.out.print(x);\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "public class XY extends XX {\n" +
+ " @SuppressWarnings(\"unused\")\n" +
+ " public void bar(String [] args) {\n" +
+ " Y y = new Y();\n" +
+ " J jj = y :: foo;\n" +
+ " J jx = y.super :: foo;\n" +
+ " }\n" +
+ " public static void main (String [] args) {}\n" +
"}"
},
- "----------\n" +
- "1. ERROR in XY.java (at line 23)\n" +
- " J jx = y.super :: foo;\n" +
- " ^\n" +
- "y cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in XY.java (at line 23)\n" +
+ " J jx = y.super :: foo;\n" +
+ " ^\n" +
+ "y cannot be resolved to a type\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406614, [1.8][compiler] Missing and incorrect errors for lambda in explicit constructor call.
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406614, [1.8][compiler] Missing and incorrect errors for lambda in explicit constructor call.
public void test406614() {
this.runNegativeTest(
new String[] {
@@ -6512,44 +6512,44 @@ public void test406614() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " this(() -> this.f);\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The constructor X(() -> {}) is undefined\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " this(() -> this.f);\n" +
- " ^^^^\n" +
- "Cannot refer to \'this\' nor \'super\' while explicitly invoking a constructor\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 12)\n" +
- " this(() -> this.g());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The constructor X(() -> {}) is undefined\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 12)\n" +
- " this(() -> this.g());\n" +
- " ^^^^\n" +
- "Cannot refer to \'this\' nor \'super\' while explicitly invoking a constructor\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 15)\n" +
- " this(() -> f);\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The constructor X(() -> {}) is undefined\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 15)\n" +
- " this(() -> f);\n" +
- " ^\n" +
- "Cannot refer to an instance field f while explicitly invoking a constructor\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 18)\n" +
- " this(() -> g());\n" +
- " ^\n" +
- "Cannot refer to an instance method while explicitly invoking a constructor\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " this(() -> this.f);\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The constructor X(() -> {}) is undefined\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " this(() -> this.f);\n" +
+ " ^^^^\n" +
+ "Cannot refer to \'this\' nor \'super\' while explicitly invoking a constructor\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 12)\n" +
+ " this(() -> this.g());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The constructor X(() -> {}) is undefined\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 12)\n" +
+ " this(() -> this.g());\n" +
+ " ^^^^\n" +
+ "Cannot refer to \'this\' nor \'super\' while explicitly invoking a constructor\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 15)\n" +
+ " this(() -> f);\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The constructor X(() -> {}) is undefined\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 15)\n" +
+ " this(() -> f);\n" +
+ " ^\n" +
+ "Cannot refer to an instance field f while explicitly invoking a constructor\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 18)\n" +
+ " this(() -> g());\n" +
+ " ^\n" +
+ "Cannot refer to an instance method while explicitly invoking a constructor\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406588, [1.8][compiler][codegen] java.lang.invoke.LambdaConversionException: Incorrect number of parameters for static method newinvokespecial
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406588, [1.8][compiler][codegen] java.lang.invoke.LambdaConversionException: Incorrect number of parameters for static method newinvokespecial
public void test406588() {
this.runNegativeTest(
false /* skipJavac */,
@@ -6575,14 +6575,14 @@ public void test406588() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " this(Z::new);\n" +
- " ^^^^^^\n" +
- "No enclosing instance of the type X.Y is accessible in scope\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " this(Z::new);\n" +
+ " ^^^^^^\n" +
+ "No enclosing instance of the type X.Y is accessible in scope\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406586, [1.8][compiler] Missing error about unavailable enclosing instance
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406586, [1.8][compiler] Missing error about unavailable enclosing instance
public void test406586() {
this.runNegativeTest(
new String[] {
@@ -6598,14 +6598,14 @@ public void test406586() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " I i = Y::new;\n" +
- " ^^^^^^\n" +
- "No enclosing instance of the type X is accessible in scope\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " I i = Y::new;\n" +
+ " ^^^^^^\n" +
+ "No enclosing instance of the type X is accessible in scope\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401989, [1.8][compiler] hook lambda expressions into "can be static" analysis
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401989, [1.8][compiler] hook lambda expressions into "can be static" analysis
public void test401989() {
Map compilerOptions = getCompilerOptions();
compilerOptions.put(CompilerOptions.OPTION_ReportMethodCanBeStatic, CompilerOptions.ERROR);
@@ -6614,7 +6614,7 @@ public void test401989() {
false /* skipJavac */,
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError,
new String[] {
- "X.java",
+ "X.java",
"interface I {\n" +
" void make();\n" +
"}\n" +
@@ -6629,11 +6629,11 @@ public void test401989() {
" public void call() { test().make(); testCanBeStatic().make();}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " private I testCanBeStatic() {\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The method testCanBeStatic() from the type X can be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " private I testCanBeStatic() {\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The method testCanBeStatic() from the type X can be declared as static\n" +
"----------\n",
null /* no extra class libraries */,
true /* flush output directory */,
@@ -6646,29 +6646,29 @@ public void test406773() {
compilerOptions.put(CompilerOptions.OPTION_ReportMethodCanBeStatic, CompilerOptions.ERROR);
compilerOptions.put(CompilerOptions.OPTION_ReportMethodCanBePotentiallyStatic, CompilerOptions.ERROR);
String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ?
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " void foo() {\n" +
- " ^^^^^\n" +
- "The method foo() from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " void foo() {\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X can potentially be declared as static\n" +
"----------\n"
:
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " void foo() {\n" +
- " ^^^^^\n" +
- "The method foo() from the type X can potentially be declared as static\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " I i = X::new;\n" +
- " ^^^^^^\n" +
- "Access to enclosing constructor X(int) is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " void foo() {\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " I i = X::new;\n" +
+ " ^^^^^^\n" +
+ "Access to enclosing constructor X(int) is emulated by a synthetic accessor method\n" +
"----------\n";
this.runNegativeTest(
false,
JavacTestOptions.SKIP, /* skip, because we are using custom error settings here */
new String[] {
- "X.java",
+ "X.java",
"interface I {\n" +
" X makeX(int x);\n" +
"}\n" +
@@ -6867,16 +6867,16 @@ public void test410114() throws IOException {
JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings,
new String[]{"Y.java",
source},
- "----------\n" +
- "1. WARNING in Y.java (at line 10)\n" +
- " I i = Y<String>.Z<Integer>::<String> new;\n" +
- " ^^^^^^\n" +
- "Unused type arguments for the non generic constructor Y<String>.Z<Integer>(Y<String>) of type Y<String>.Z<Integer>; it should not be parameterized with arguments <String>\n" +
- "----------\n" +
- "2. WARNING in Y.java (at line 14)\n" +
- " i = Y.Z:: new;\n" +
- " ^^^^^^^^^\n" +
- "Type safety: The constructor Y.Z(Y) belongs to the raw type Y.Z. References to generic type Y<T>.Z<K> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in Y.java (at line 10)\n" +
+ " I i = Y<String>.Z<Integer>::<String> new;\n" +
+ " ^^^^^^\n" +
+ "Unused type arguments for the non generic constructor Y<String>.Z<Integer>(Y<String>) of type Y<String>.Z<Integer>; it should not be parameterized with arguments <String>\n" +
+ "----------\n" +
+ "2. WARNING in Y.java (at line 14)\n" +
+ " i = Y.Z:: new;\n" +
+ " ^^^^^^^^^\n" +
+ "Type safety: The constructor Y.Z(Y) belongs to the raw type Y.Z. References to generic type Y<T>.Z<K> should be parameterized\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=412453,
@@ -6902,16 +6902,16 @@ public void test412453() {
"}\n" +
"\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " final Optional<Integer> min = empty.minBy((a, b) -> a - b);\n" +
- " ^^^^^\n" +
- "The method minBy(Function<Integer,C>) in the type Y<Integer> is not applicable for the arguments ((<no type> a, <no type> b) -> {})\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " final Optional<Integer> min = empty.minBy((a, b) -> a - b);\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Lambda expression\'s signature does not match the signature of the functional interface method apply(Integer)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " final Optional<Integer> min = empty.minBy((a, b) -> a - b);\n" +
+ " ^^^^^\n" +
+ "The method minBy(Function<Integer,C>) in the type Y<Integer> is not applicable for the arguments ((<no type> a, <no type> b) -> {})\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 13)\n" +
+ " final Optional<Integer> min = empty.minBy((a, b) -> a - b);\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Lambda expression\'s signature does not match the signature of the functional interface method apply(Integer)\n" +
"----------\n",
null /* no extra class libraries */,
true /* flush output directory */,
@@ -6940,11 +6940,11 @@ public void test412284a() {
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " i.foo();\n" +
- " ^\n" +
- "The local variable i may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " i.foo();\n" +
+ " ^\n" +
+ "The local variable i may not have been initialized\n" +
"----------\n",
null /* no extra class libraries */,
true /* flush output directory */,
@@ -6957,7 +6957,7 @@ public void test412284b() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I { void foo();}\n" +
+ "interface I { void foo();}\n" +
"class X { \n" +
" final int t;\n" +
" X(){\n" +
@@ -6972,21 +6972,21 @@ public void test412284b() {
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " X(){\n" +
- " ^^^\n" +
- "The blank final field t may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " t = 3;\n" +
- " ^\n" +
- "The final field X.t cannot be assigned\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " t = 4;\n" +
- " ^\n" +
- "The final field X.t cannot be assigned\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " X(){\n" +
+ " ^^^\n" +
+ "The blank final field t may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " t = 3;\n" +
+ " ^\n" +
+ "The final field X.t cannot be assigned\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 9)\n" +
+ " t = 4;\n" +
+ " ^\n" +
+ "The final field X.t cannot be assigned\n" +
"----------\n",
null /* no extra class libraries */,
true /* flush output directory */,
@@ -6999,7 +6999,7 @@ public void test412284c() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I { void foo();}\n" +
+ "interface I { void foo();}\n" +
"class X { \n" +
" final int t;\n" +
" X(){\n" +
@@ -7013,31 +7013,31 @@ public void test412284c() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " X(){\n" +
- " ^^^\n" +
- "The blank final field t may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " t += 3;\n" +
- " ^\n" +
- "The blank final field t may not have been initialized\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " t += 3;\n" +
- " ^\n" +
- "The final field X.t cannot be assigned\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " t += 4;\n" +
- " ^\n" +
- "The blank final field t may not have been initialized\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 9)\n" +
- " t += 4;\n" +
- " ^\n" +
- "The final field X.t cannot be assigned\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " X(){\n" +
+ " ^^^\n" +
+ "The blank final field t may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " t += 3;\n" +
+ " ^\n" +
+ "The blank final field t may not have been initialized\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " t += 3;\n" +
+ " ^\n" +
+ "The final field X.t cannot be assigned\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 9)\n" +
+ " t += 4;\n" +
+ " ^\n" +
+ "The blank final field t may not have been initialized\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 9)\n" +
+ " t += 4;\n" +
+ " ^\n" +
+ "The final field X.t cannot be assigned\n" +
"----------\n",
null /* no extra class libraries */,
true /* flush output directory */,
@@ -7063,20 +7063,20 @@ public void test412650() {
},
"----------\n" +
// this is reported because the lambda has errors and thus is not marked as valueCompatible:
- "1. ERROR in X.java (at line 7)\n" +
- " foo(() -> foo(X::getInt));\n" +
- " ^^^\n" +
- "The method foo(I) in the type X is not applicable for the arguments (() -> {})\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " foo(() -> foo(X::getInt));\n" +
- " ^^^\n" +
- "The method foo(I) in the type X is not applicable for the arguments (X::getInt)\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " foo(() -> foo(X::getInt));\n" +
- " ^^^^^^^^^\n" +
- "The type of getInt() from the type X is Integer, this is incompatible with the descriptor\'s return type: String\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " foo(() -> foo(X::getInt));\n" +
+ " ^^^\n" +
+ "The method foo(I) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " foo(() -> foo(X::getInt));\n" +
+ " ^^^\n" +
+ "The method foo(I) in the type X is not applicable for the arguments (X::getInt)\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " foo(() -> foo(X::getInt));\n" +
+ " ^^^^^^^^^\n" +
+ "The type of getInt() from the type X is Integer, this is incompatible with the descriptor\'s return type: String\n" +
"----------\n",
null /* no extra class libraries */,
true /* flush output directory */,
@@ -7089,8 +7089,8 @@ public void test409544() {
this.runNegativeTest(
new String[] {
"Sample.java",
- "public class Sample{\n" +
- " interface Int { void setInt(int[] i); }\n" +
+ "public class Sample{\n" +
+ " interface Int { void setInt(int[] i); }\n" +
" public static void main(String[] args) {\n" +
" int j;\n" +
" Int int1 = (int... i) -> {\n" +
@@ -7099,7 +7099,7 @@ public void test409544() {
" }\n" +
"}\n"
},
- "----------\n" +
+ "----------\n" +
"1. ERROR in Sample.java (at line 6)\n" +
" j=10;\n" +
" ^\n" +
@@ -7132,16 +7132,16 @@ public void test409544b() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 10)\n" +
- " public void setInt(int[] i) {\n" +
- " ^\n" +
- "The parameter i is hiding another local variable defined in an enclosing scope\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " j = 10;\n" +
- " ^\n" +
- "Local variable j defined in an enclosing scope must be final or effectively final\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 10)\n" +
+ " public void setInt(int[] i) {\n" +
+ " ^\n" +
+ "The parameter i is hiding another local variable defined in an enclosing scope\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " j = 10;\n" +
+ " ^\n" +
+ "Local variable j defined in an enclosing scope must be final or effectively final\n" +
"----------\n",
null /* no extra class libraries */,
true /* flush output directory */,
@@ -7154,8 +7154,8 @@ public void test415844a() {
this.runNegativeTest(
new String[] {
"Sample.java",
- "public class Sample{\n" +
- " interface Int { void setInt(int i); }\n" +
+ "public class Sample{\n" +
+ " interface Int { void setInt(int i); }\n" +
" public static void main(String[] args) {\n" +
" final int j;\n" +
" Int int1 = (int i) -> {\n" +
@@ -7164,7 +7164,7 @@ public void test415844a() {
" }\n" +
"}\n"
},
- "----------\n" +
+ "----------\n" +
"1. ERROR in Sample.java (at line 6)\n" +
" j=10;\n" +
" ^\n" +
@@ -7196,16 +7196,16 @@ public void test415844b() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " public void setInt(int[] i) {\n" +
- " ^\n" +
- "The parameter i is hiding another local variable defined in an enclosing scope\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " j = 10;\n" +
- " ^\n" +
- "The final local variable j cannot be assigned, since it is defined in an enclosing type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " public void setInt(int[] i) {\n" +
+ " ^\n" +
+ "The parameter i is hiding another local variable defined in an enclosing scope\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " j = 10;\n" +
+ " ^\n" +
+ "The final local variable j cannot be assigned, since it is defined in an enclosing type\n" +
"----------\n",
null /* no extra class libraries */,
true /* flush output directory */,
@@ -7216,29 +7216,29 @@ public void test415844b() {
public void test404657_final() {
this.runNegativeTest(
new String[] {
- "X.java",
- "public class X {\n" +
- " void executeLater(Runnable r) { /* ... */\n" +
- " }\n" +
- " public int testFinally() {\n" +
- " int n;\n" +
- " try {\n" +
- " n = 42;\n" +
- " executeLater(() -> System.out.println(n)); // Error: n is not effectively final\n" +
- " } finally {\n" +
- " n = 23;\n" +
- " }\n" +
- " return n;\n" +
- " }\n" +
- "\n" +
- "}\n" +
+ "X.java",
+ "public class X {\n" +
+ " void executeLater(Runnable r) { /* ... */\n" +
+ " }\n" +
+ " public int testFinally() {\n" +
+ " int n;\n" +
+ " try {\n" +
+ " n = 42;\n" +
+ " executeLater(() -> System.out.println(n)); // Error: n is not effectively final\n" +
+ " } finally {\n" +
+ " n = 23;\n" +
+ " }\n" +
+ " return n;\n" +
+ " }\n" +
+ "\n" +
+ "}\n" +
""
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " executeLater(() -> System.out.println(n)); // Error: n is not effectively final\n" +
- " ^\n" +
- "Local variable n defined in an enclosing scope must be final or effectively final\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " executeLater(() -> System.out.println(n)); // Error: n is not effectively final\n" +
+ " ^\n" +
+ "Local variable n defined in an enclosing scope must be final or effectively final\n" +
"----------\n"
);
}
@@ -7246,26 +7246,26 @@ public void test404657_final() {
public void test404657_loop() {
this.runNegativeTest(
new String[] {
- "X.java",
- "public class X {\n" +
- " void executeLater(Runnable r) { /* ... */\n" +
- " }\n" +
- " public void testLoop() {\n" +
- " int n;\n" +
- " for (int i = 0; i < 3; i++) {\n" +
- " n = i;\n" +
- " executeLater(() -> System.out.println(n)); // Error: n is not effectively final\n" +
- " }\n" +
- " }\n" +
- "\n" +
- "}\n" +
+ "X.java",
+ "public class X {\n" +
+ " void executeLater(Runnable r) { /* ... */\n" +
+ " }\n" +
+ " public void testLoop() {\n" +
+ " int n;\n" +
+ " for (int i = 0; i < 3; i++) {\n" +
+ " n = i;\n" +
+ " executeLater(() -> System.out.println(n)); // Error: n is not effectively final\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ "}\n" +
""
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " executeLater(() -> System.out.println(n)); // Error: n is not effectively final\n" +
- " ^\n" +
- "Local variable n defined in an enclosing scope must be final or effectively final\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " executeLater(() -> System.out.println(n)); // Error: n is not effectively final\n" +
+ " ^\n" +
+ "Local variable n defined in an enclosing scope must be final or effectively final\n" +
"----------\n"
);
}
@@ -7273,7 +7273,7 @@ public void test404657_loop() {
public void testExplicitTypeArgument() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"interface I {\n" +
" void sam(X t, Integer s);\n" +
"}\n" +
@@ -7284,14 +7284,14 @@ public void testExplicitTypeArgument() {
" i = X::function;\n" +
" i = X::<Integer>function;\n" +
" }\n" +
- "}\n" +
+ "}\n" +
""
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " I i = X::<String>function;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The type X does not define function(X, Integer) that is applicable here\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " I i = X::<String>function;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The type X does not define function(X, Integer) that is applicable here\n" +
"----------\n"
);
}
@@ -7299,7 +7299,7 @@ public void testExplicitTypeArgument() {
public void testGenericArrayCreation() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"interface I {\n" +
" X<?, ?, ?>[] makeArray(int i);\n" +
"}\n" +
@@ -7311,28 +7311,28 @@ public void testGenericArrayCreation() {
" a = new X<String, Integer, ?>[10]; // ! OK\n" +
" System.out.println(i.makeArray(1024).length);\n" +
" }\n" +
- "}\n" +
+ "}\n" +
""
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " i = X<String, Integer, ?>[]::new; // ! OK\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot create a generic array of X<String,Integer,?>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " a = new X<String, Integer, ?>[10]; // ! OK\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot create a generic array of X<String,Integer,?>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " i = X<String, Integer, ?>[]::new; // ! OK\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot create a generic array of X<String,Integer,?>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " a = new X<String, Integer, ?>[10]; // ! OK\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot create a generic array of X<String,Integer,?>\n" +
"----------\n"
);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=420598, [1.8][compiler] Incorrect error about intersection cast type not being a functional interface.
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=420598, [1.8][compiler] Incorrect error about intersection cast type not being a functional interface.
public void testIntersectionCast() {
this.runConformTest(
new String[] {
- "X.java",
+ "X.java",
"import java.io.Serializable;\n" +
"interface I {\n" +
" void foo();\n" +
@@ -7363,7 +7363,7 @@ public void testUnderScoreParameter() {
String level = this.complianceLevel >= ClassFileConstants.JDK9 ? "ERROR" : "WARNING";
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"interface F {\n" +
" void foo(int x);\n" +
"}\n" +
@@ -7375,21 +7375,21 @@ public void testUnderScoreParameter() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " F f = (int _) -> {\n" +
- " ^\n" +
- "\'_\' should not be used as an identifier, since it is a reserved keyword from source level 1.8 on\n" +
- "----------\n" +
- "2. "+ level +" in X.java (at line 8)\n" +
- " F f2 = _ -> {};\n" +
- " ^\n" +
- "\'_\' should not be used as an identifier, since it is a reserved keyword from source level 1.8 on\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " F f2 = _ -> {};\n" +
- " ^\n" +
- "\'_\' should not be used as an identifier, since it is a reserved keyword from source level 1.8 on\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " F f = (int _) -> {\n" +
+ " ^\n" +
+ "\'_\' should not be used as an identifier, since it is a reserved keyword from source level 1.8 on\n" +
+ "----------\n" +
+ "2. "+ level +" in X.java (at line 8)\n" +
+ " F f2 = _ -> {};\n" +
+ " ^\n" +
+ "\'_\' should not be used as an identifier, since it is a reserved keyword from source level 1.8 on\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " F f2 = _ -> {};\n" +
+ " ^\n" +
+ "\'_\' should not be used as an identifier, since it is a reserved keyword from source level 1.8 on\n" +
"----------\n"
);
}
@@ -7397,7 +7397,7 @@ public void testUnderScoreParameter() {
public void test383096() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"interface I {}\n" +
"class XI {\n" +
" void foo() {\n" +
@@ -7406,21 +7406,21 @@ public void test383096() {
" } \n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " I t2 = () -> 42;\n" +
- " ^^^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " } \n" +
- " ^\n" +
- "Syntax error, insert \";\" to complete BlockStatements\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " I t2 = () -> 42;\n" +
+ " ^^^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " } \n" +
+ " ^\n" +
+ "Syntax error, insert \";\" to complete BlockStatements\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " }\n" +
+ " ^\n" +
+ "Syntax error, insert \"}\" to complete ClassBody\n" +
"----------\n",
true // statement recovery.
);
@@ -7429,7 +7429,7 @@ public void test383096() {
public void test422516() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" public static void main(String[] args) throws InterruptedException {\n" +
" final int[] result= { 0 };\n" +
@@ -7443,11 +7443,11 @@ public void test422516() {
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " sysoresult[0]= 42;\n" +
- " ^^^^^^^^^^\n" +
- "sysoresult cannot be resolved to a variable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " sysoresult[0]= 42;\n" +
+ " ^^^^^^^^^^\n" +
+ "sysoresult cannot be resolved to a variable\n" +
"----------\n",
true // statement recovery.
);
@@ -7456,7 +7456,7 @@ public void test422516() {
public void test422516a() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" public static void main(String[] args) throws InterruptedException {\n" +
" final int[] result= { 0 };\n" +
@@ -7470,11 +7470,11 @@ public void test422516a() {
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " System.out.printlnresult[0]= 42;\n" +
- " ^^^^^^^^^^^^^\n" +
- "printlnresult cannot be resolved or is not a field\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " System.out.printlnresult[0]= 42;\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "printlnresult cannot be resolved or is not a field\n" +
"----------\n"
);
}
@@ -7482,7 +7482,7 @@ public void test422516a() {
public void test422489() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"interface I {\n" +
" void foo(String [] x, String y);\n" +
"}\n" +
@@ -7499,11 +7499,11 @@ public void test422489() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " goo((x, y) -> { x[0] += 1; });\n" +
- " ^^^\n" +
- "The method goo(I) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " goo((x, y) -> { x[0] += 1; });\n" +
+ " ^^^\n" +
+ "The method goo(I) is ambiguous for the type X\n" +
"----------\n"
);
}
@@ -7511,7 +7511,7 @@ public void test422489() {
public void test422489a() { // interfaces and methods order changed, triggers NPE.
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"interface J {\n" +
" void foo(int x, int y);\n" +
"}\n" +
@@ -7528,16 +7528,16 @@ public void test422489a() { // interfaces and methods order changed, triggers NP
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " goo((x, y) -> { x[0] += 1; });\n" +
- " ^^^\n" +
- "The method goo(J) is ambiguous for the type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " goo((x, y) -> { x[0] += 1; });\n" +
- " ^^^^\n" +
- "The type of the expression must be an array type but it resolved to int\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " goo((x, y) -> { x[0] += 1; });\n" +
+ " ^^^\n" +
+ "The method goo(J) is ambiguous for the type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 13)\n" +
+ " goo((x, y) -> { x[0] += 1; });\n" +
+ " ^^^^\n" +
+ "The type of the expression must be an array type but it resolved to int\n" +
"----------\n"
);
}
@@ -7548,7 +7548,7 @@ public void test422489b() { // interfaces and methods order changed, triggers NP
false /* skipJavac */,
JavacTestOptions.Excuse.JavacHasWarningsEclipseNotConfigured,
new String[] {
- "X.java",
+ "X.java",
"interface I {\n" +
" String foo(String [] x, String y);\n" +
"}\n" +
@@ -7572,7 +7572,7 @@ public void test422489b() { // interfaces and methods order changed, triggers NP
public void test422489c() { // interfaces and methods order changed, triggers NPE.
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"interface I {\n" +
" String foo(String [] x, String y);\n" +
"}\n" +
@@ -7589,16 +7589,16 @@ public void test422489c() { // interfaces and methods order changed, triggers NP
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " goo((x, y) -> x[0] += 1);\n" +
- " ^^^\n" +
- "The method goo(J) is ambiguous for the type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " goo((x, y) -> x[0] += 1);\n" +
- " ^^^^\n" +
- "The type of the expression must be an array type but it resolved to int\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " goo((x, y) -> x[0] += 1);\n" +
+ " ^^^\n" +
+ "The method goo(J) is ambiguous for the type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 13)\n" +
+ " goo((x, y) -> x[0] += 1);\n" +
+ " ^^^^\n" +
+ "The type of the expression must be an array type but it resolved to int\n" +
"----------\n"
);
}
@@ -7607,7 +7607,7 @@ public void test422489c() { // interfaces and methods order changed, triggers NP
public void test422489d() { // interfaces and methods order changed, triggers NPE.
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"interface I {\n" +
" String foo(String x, String y);\n" +
"}\n" +
@@ -7624,16 +7624,16 @@ public void test422489d() { // interfaces and methods order changed, triggers NP
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " goo((x, y) -> x[0] += 1);\n" +
- " ^^^\n" +
- "The method goo(J) is ambiguous for the type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " goo((x, y) -> x[0] += 1);\n" +
- " ^^^^\n" +
- "The type of the expression must be an array type but it resolved to int\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " goo((x, y) -> x[0] += 1);\n" +
+ " ^^^\n" +
+ "The method goo(J) is ambiguous for the type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 13)\n" +
+ " goo((x, y) -> x[0] += 1);\n" +
+ " ^^^^\n" +
+ "The type of the expression must be an array type but it resolved to int\n" +
"----------\n"
);
}
@@ -7642,7 +7642,7 @@ public void test422489d() { // interfaces and methods order changed, triggers NP
public void test422801() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" public void foo(Random arg) {\n" +
" new Thread(() -> {\n" +
@@ -7651,11 +7651,11 @@ public void test422801() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public void foo(Random arg) {\n" +
- " ^^^^^^\n" +
- "Random cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public void foo(Random arg) {\n" +
+ " ^^^^^^\n" +
+ "Random cannot be resolved to a type\n" +
"----------\n"
);
}
@@ -7663,7 +7663,7 @@ public void test422801() {
public void test422801a() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" Random arg;\n" +
" public void foo() {\n" +
@@ -7673,16 +7673,16 @@ public void test422801a() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Random arg;\n" +
- " ^^^^^^\n" +
- "Random cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " arg.intValue();\n" +
- " ^^^\n" +
- "Random cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " Random arg;\n" +
+ " ^^^^^^\n" +
+ "Random cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " arg.intValue();\n" +
+ " ^^^\n" +
+ "Random cannot be resolved to a type\n" +
"----------\n"
);
}
@@ -7690,7 +7690,7 @@ public void test422801a() {
public void test405134a() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"interface Foo { \n" +
" int run1(int s1, int s2);\n" +
" static int x2 = 0;\n" +
@@ -7704,21 +7704,21 @@ public void test405134a() {
" static Foo1 f1 = af1 -> (a1,b1) -> {int uniqueName = 4; return uniqueName};\n" + // missing semicolon triggers an NPE
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " static Foo1 f1 = af1 -> (a1,b1) -> {int uniqueName = 4; return uniqueName};\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \";\" to complete FieldDeclaration\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 12)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete InterfaceBody\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " static Foo1 f1 = af1 -> (a1,b1) -> {int uniqueName = 4; return uniqueName};\n" +
+ " ^\n" +
+ "Syntax error on token \"}\", delete this token\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 12)\n" +
+ " }\n" +
+ " ^\n" +
+ "Syntax error, insert \";\" to complete FieldDeclaration\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 12)\n" +
+ " }\n" +
+ " ^\n" +
+ "Syntax error, insert \"}\" to complete InterfaceBody\n" +
"----------\n",
true);
}
@@ -7726,7 +7726,7 @@ public void test405134a() {
public void test421927() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"interface I { \n" +
" int foo();\n" +
"}\n" +
@@ -7743,7 +7743,7 @@ public void test421927a() {
false,
Excuse.EclipseHasSomeMoreWarnings,
new String[] {
- "X.java",
+ "X.java",
"interface I { \n" +
" int foo();\n" +
"}\n" +
@@ -7759,11 +7759,11 @@ public void test421927a() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 11)\n" +
- " I goo(I i) {\n" +
- " ^\n" +
- "The parameter i is hiding a field from type X\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 11)\n" +
+ " I goo(I i) {\n" +
+ " ^\n" +
+ "The parameter i is hiding a field from type X\n" +
"----------\n",
true);
}
@@ -7771,8 +7771,8 @@ public void test421927a() {
public void test423429() {
this.runNegativeTest(
new String[] {
- "X.java",
- "interface I {\n" +
+ "X.java",
+ "interface I {\n" +
" J foo(String x, String y);\n" +
"}\n" +
"interface J {\n" +
@@ -7790,18 +7790,18 @@ public void test423429() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 14)\n" +
- " return (xyz, pqr) -> first.length();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 14)\n" +
+ " return (xyz, pqr) -> first.length();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=423129, [1.8][compiler] Hook up lambda expressions into statement recovery
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=423129, [1.8][compiler] Hook up lambda expressions into statement recovery
public void test423129() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"interface I {\n" +
" String foo(Integer x);\n" +
"}\n" +
@@ -7819,23 +7819,23 @@ public void test423129() {
"}\n"
},
"----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " return xyz.\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from Integer to String\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " return xyz.\n" +
- " ^\n" +
- "Syntax error on token \".\", ; expected\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " return xyz.\n" +
+ " ^^^\n" +
+ "Type mismatch: cannot convert from Integer to String\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 12)\n" +
+ " return xyz.\n" +
+ " ^\n" +
+ "Syntax error on token \".\", ; expected\n" +
"----------\n",
true);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=423129, [1.8][compiler] Hook up lambda expressions into statement recovery
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=423129, [1.8][compiler] Hook up lambda expressions into statement recovery
public void test423129b() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"import java.util.ArrayList;\n" +
"import java.util.Arrays;\n" +
"import java.util.Collections;\n" +
@@ -7849,11 +7849,11 @@ public void test423129b() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " }\n" +
+ " ^\n" +
+ "Syntax error on token \"}\", delete this token\n" +
"----------\n",
true);
}
@@ -7861,11 +7861,11 @@ public void test423129b() {
public void test423129c() {
this.runConformTest(
new String[] {
- "X.java",
+ "X.java",
"import java.util.ArrayList;\n" +
"import java.util.List;\n" +
"import java.util.Arrays;\n" +
- "class MySorter { static <T> void sort(List<T> l, MyComparator<T> comp) { } }\n" +
+ "class MySorter { static <T> void sort(List<T> l, MyComparator<T> comp) { } }\n" +
"interface MyComparator<T> { byte compare(T t1, T t2); }\n" +
"public class X {\n" +
" int compareTo(X x) { return 0; }\n" +
@@ -7880,7 +7880,7 @@ public void test423129c() {
public void test424400() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"public class X<T> implements MyComparable<T>{\n" +
" public static void main(String argv[]) {\n" +
" int result = ((Comparable<Integer> & MyComparable) new X()).compareTo(1);\n" +
@@ -7891,28 +7891,28 @@ public void test424400() {
"}\n" +
"interface MyComparable<T> extends Comparable<T> {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " int result = ((Comparable<Integer> & MyComparable) new X()).compareTo(1);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The interface Comparable cannot be implemented more than once with different arguments: Comparable<Integer> and Comparable\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " int result = ((Comparable<Integer> & MyComparable) new X()).compareTo(1);\n" +
- " ^^^^^^^^^^^^\n" +
- "MyComparable is a raw type. References to generic type MyComparable<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 3)\n" +
- " int result = ((Comparable<Integer> & MyComparable) new X()).compareTo(1);\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " int result = ((Comparable<Integer> & MyComparable) new X()).compareTo(1);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The interface Comparable cannot be implemented more than once with different arguments: Comparable<Integer> and Comparable\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " int result = ((Comparable<Integer> & MyComparable) new X()).compareTo(1);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "MyComparable is a raw type. References to generic type MyComparable<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 3)\n" +
+ " int result = ((Comparable<Integer> & MyComparable) new X()).compareTo(1);\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=424400, [1.8] Interfaces in the same hierarchy are allowed in an intersection cast with different type argument
public void _test424400() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"public class X<T> implements MyComparable<T> {\n" +
" public static void main(String argv[]) {\n" +
" int result = ((Comparable<Integer> & MyComparable) new X()).compareTo(1);\n" +
@@ -7925,21 +7925,21 @@ public void _test424400() {
" public int compareTo(T value);\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " int result = ((Comparable<Integer> & MyComparable) new X()).compareTo(1);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The interface Comparable cannot be implemented more than once with different arguments: Comparable and Comparable<Integer>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " int result = ((Comparable<Integer> & MyComparable) new X()).compareTo(1);\n" +
- " ^^^^^^^^^^^^\n" +
- "MyComparable is a raw type. References to generic type MyComparable<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 3)\n" +
- " int result = ((Comparable<Integer> & MyComparable) new X()).compareTo(1);\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " int result = ((Comparable<Integer> & MyComparable) new X()).compareTo(1);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The interface Comparable cannot be implemented more than once with different arguments: Comparable and Comparable<Integer>\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " int result = ((Comparable<Integer> & MyComparable) new X()).compareTo(1);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "MyComparable is a raw type. References to generic type MyComparable<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 3)\n" +
+ " int result = ((Comparable<Integer> & MyComparable) new X()).compareTo(1);\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=424444, [1.8] VerifyError when constructor reference used with array
@@ -7961,11 +7961,11 @@ public void test424444() throws Exception {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " Functional<Integer []> contr = int[]::new;\n" +
- " ^^^^^^^^^^\n" +
- "Constructed array int[] cannot be assigned to Integer[] as required in the interface descriptor \n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " Functional<Integer []> contr = int[]::new;\n" +
+ " ^^^^^^^^^^\n" +
+ "Constructed array int[] cannot be assigned to Integer[] as required in the interface descriptor \n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425512, [1.8][compiler] Arrays should be allowed in intersection casts
@@ -7982,11 +7982,11 @@ public void test425512() throws Exception {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " int [] a = (int [] & IJK) null;\n" +
- " ^^^^^^\n" +
- "Arrays are not allowed in intersection cast operator\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " int [] a = (int [] & IJK) null;\n" +
+ " ^^^^^^\n" +
+ "Arrays are not allowed in intersection cast operator\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425512, [1.8][compiler] Arrays should be allowed in intersection casts
@@ -8004,11 +8004,11 @@ public void test425512a() throws Exception {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " int [] a = (int [] & Serializable & IJK) null;\n" +
- " ^^^^^^\n" +
- "Arrays are not allowed in intersection cast operator\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " int [] a = (int [] & Serializable & IJK) null;\n" +
+ " ^^^^^^\n" +
+ "Arrays are not allowed in intersection cast operator\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425512, [1.8][compiler] Arrays should be allowed in intersection casts
@@ -8026,11 +8026,11 @@ public void test425512b() throws Exception {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " int [] a = (int [] & IJK & Serializable) null;\n" +
- " ^^^^^^\n" +
- "Arrays are not allowed in intersection cast operator\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " int [] a = (int [] & IJK & Serializable) null;\n" +
+ " ^^^^^^\n" +
+ "Arrays are not allowed in intersection cast operator\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425512, [1.8][compiler] Arrays should be allowed in intersection casts
@@ -8048,11 +8048,11 @@ public void test425512c() throws Exception {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " int [] a = (IJK & Serializable & int []) null;\n" +
- " ^^^^^^\n" +
- "The type int[] is not an interface; it cannot be specified as a bounded parameter\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " int [] a = (IJK & Serializable & int []) null;\n" +
+ " ^^^^^^\n" +
+ "The type int[] is not an interface; it cannot be specified as a bounded parameter\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425512, [1.8][compiler] Arrays should be allowed in intersection casts
@@ -8070,16 +8070,16 @@ public void test425512cd() throws Exception {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " I i = (int [] & I) (i) -> {};\n" +
- " ^^^^^^\n" +
- "Arrays are not allowed in intersection cast operator\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " I i = (int [] & I) (i) -> {};\n" +
- " ^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " I i = (int [] & I) (i) -> {};\n" +
+ " ^^^^^^\n" +
+ "Arrays are not allowed in intersection cast operator\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " I i = (int [] & I) (i) -> {};\n" +
+ " ^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425512, [1.8][compiler] Arrays should be allowed in intersection casts
@@ -8097,16 +8097,16 @@ public void test425512ce() throws Exception {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " I i = (int [] & Serializable) (i) -> {};\n" +
- " ^^^^^^\n" +
- "Arrays are not allowed in intersection cast operator\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " I i = (int [] & Serializable) (i) -> {};\n" +
- " ^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " I i = (int [] & Serializable) (i) -> {};\n" +
+ " ^^^^^^\n" +
+ "Arrays are not allowed in intersection cast operator\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " I i = (int [] & Serializable) (i) -> {};\n" +
+ " ^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425621, [1.8][compiler] Missing error for raw type in constructor reference with explicit type arguments
@@ -8124,16 +8124,16 @@ public void test425621() throws Exception {
" I i = Y::<X>new;\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " Y<Y> foo();\n" +
- " ^\n" +
- "Y is a raw type. References to generic type Y<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " I i = Y::<X>new;\n" +
- " ^\n" +
- "Explicit type arguments cannot be specified in raw constructor reference expression\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " Y<Y> foo();\n" +
+ " ^\n" +
+ "Y is a raw type. References to generic type Y<T> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " I i = Y::<X>new;\n" +
+ " ^\n" +
+ "Explicit type arguments cannot be specified in raw constructor reference expression\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=423803, [1.8][compiler] No error shown for ambiguous reference to the method
@@ -8162,16 +8162,16 @@ public void test423803() throws Exception {
" long foo(long x);\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " bar(x -> x++); // [1]\n" +
- " ^^^\n" +
- "The method bar(FI) is ambiguous for the type C2\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " void bar(FI fi) { }\n" +
- " ^^\n" +
- "The parameter fi is hiding a field from type C2\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " bar(x -> x++); // [1]\n" +
+ " ^^^\n" +
+ "The method bar(FI) is ambiguous for the type C2\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " void bar(FI fi) { }\n" +
+ " ^^\n" +
+ "The parameter fi is hiding a field from type C2\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=423803, [1.8][compiler] No error shown for ambiguous reference to the method
@@ -8195,14 +8195,14 @@ public void test423803b() throws Exception {
" long foo(long x);\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " bar(x -> x++); // [1]\n" +
- " ^^^\n" +
- "The method bar(I) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " bar(x -> x++); // [1]\n" +
+ " ^^^\n" +
+ "The method bar(I) is ambiguous for the type X\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425712, [1.8][compiler] Valid program rejected by the compiler.
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425712, [1.8][compiler] Valid program rejected by the compiler.
public void test425712() throws Exception {
this.runNegativeTest(
new String[] {
@@ -8221,14 +8221,14 @@ public void test425712() throws Exception {
" char foo();\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " bar( () -> (char) 0); // [1]\n" +
- " ^^^\n" +
- "The method bar(FC) is ambiguous for the type C2\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " bar( () -> (char) 0); // [1]\n" +
+ " ^^^\n" +
+ "The method bar(FC) is ambiguous for the type C2\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=421926, [1.8][compiler] Compiler tolerates illegal forward reference from lambda in initializer
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=421926, [1.8][compiler] Compiler tolerates illegal forward reference from lambda in initializer
public void test421926() throws Exception {
this.runNegativeTest(
new String[] {
@@ -8243,24 +8243,24 @@ public void test421926() throws Exception {
" public static final I fk = x -> fj;\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " public static final int f = f;\n" +
- " ^\n" +
- "Cannot reference a field before it is defined\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " public static final I fi = x -> fi;\n" +
- " ^^\n" +
- "Cannot reference a field before it is defined\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " public static final I fj = x -> fk;\n" +
- " ^^\n" +
- "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " public static final int f = f;\n" +
+ " ^\n" +
+ "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " public static final I fi = x -> fi;\n" +
+ " ^^\n" +
+ "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " public static final I fj = x -> fk;\n" +
+ " ^^\n" +
+ "Cannot reference a field before it is defined\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=421926, [1.8][compiler] Compiler tolerates illegal forward reference from lambda in initializer
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=421926, [1.8][compiler] Compiler tolerates illegal forward reference from lambda in initializer
public void test421926b() throws Exception {
this.runNegativeTest(
new String[] {
@@ -8273,14 +8273,14 @@ public void test421926b() throws Exception {
" static int x1 = 2;\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " static int f = ((I) (int x5, int x2) -> x1).run(10, 20);\n" +
- " ^^\n" +
- "Cannot reference a field before it is defined\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " static int f = ((I) (int x5, int x2) -> x1).run(10, 20);\n" +
+ " ^^\n" +
+ "Cannot reference a field before it is defined\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=421926, [1.8][compiler] Compiler tolerates illegal forward reference from lambda in initializer
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=421926, [1.8][compiler] Compiler tolerates illegal forward reference from lambda in initializer
public void test421926c() throws Exception {
this.runNegativeTest(
new String[] {
@@ -8307,52 +8307,52 @@ public void test426206() throws Exception {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " Comparator<? extends String> c = true ? (Integer i, Integer j) -> { return 0; } : (Long i, Long j) -> { return 1; };\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Comparator<Integer> to Comparator<? extends String>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " Comparator<? extends String> c = true ? (Integer i, Integer j) -> { return 0; } : (Long i, Long j) -> { return 1; };\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Comparator<Long> to Comparator<? extends String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " Comparator<? extends String> c = true ? (Integer i, Integer j) -> { return 0; } : (Long i, Long j) -> { return 1; };\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Comparator<Integer> to Comparator<? extends String>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " Comparator<? extends String> c = true ? (Integer i, Integer j) -> { return 0; } : (Long i, Long j) -> { return 1; };\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Comparator<Long> to Comparator<? extends String>\n" +
"----------\n");
}
public void testBug426563() {
runNegativeTest(
new String[] {
"X.java",
- "interface I<U, V extends J<U>> { \n" +
- " void foo(U u, V v); \n" +
- "}\n" +
- "\n" +
- "interface J<T> {}\n" +
- "\n" +
- "public class X {\n" +
- "\n" +
- " public void bar(FI<?, ?> fi) {}\n" +
- "\n" +
- " public static void main(String args[]) {\n" +
- " new X().bar((p, q) -> {}); \n" +
- " }\n" +
+ "interface I<U, V extends J<U>> { \n" +
+ " void foo(U u, V v); \n" +
+ "}\n" +
+ "\n" +
+ "interface J<T> {}\n" +
+ "\n" +
+ "public class X {\n" +
+ "\n" +
+ " public void bar(FI<?, ?> fi) {}\n" +
+ "\n" +
+ " public static void main(String args[]) {\n" +
+ " new X().bar((p, q) -> {}); \n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " public void bar(FI<?, ?> fi) {}\n" +
- " ^^\n" +
- "FI cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " new X().bar((p, q) -> {}); \n" +
- " ^^^\n" +
- "The method bar(FI<?,?>) from the type X refers to the missing type FI\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 12)\n" +
- " new X().bar((p, q) -> {}); \n" +
- " ^^^^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " public void bar(FI<?, ?> fi) {}\n" +
+ " ^^\n" +
+ "FI cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 12)\n" +
+ " new X().bar((p, q) -> {}); \n" +
+ " ^^^\n" +
+ "The method bar(FI<?,?>) from the type X refers to the missing type FI\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 12)\n" +
+ " new X().bar((p, q) -> {}); \n" +
+ " ^^^^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426965, [1.8] Eclipse rejects valid type conversion in lambda
@@ -8386,16 +8386,16 @@ public void test427207() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " I i = (I) ((args == null) ? ()->{} : ()-> {});\n" +
- " ^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " I i = (I) ((args == null) ? ()->{} : ()-> {});\n" +
- " ^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " I i = (I) ((args == null) ? ()->{} : ()-> {});\n" +
+ " ^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " I i = (I) ((args == null) ? ()->{} : ()-> {});\n" +
+ " ^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425278, [1.8][compiler] Suspect error: The target type of this expression is not a well formed parameterized type due to bound(s) mismatch
@@ -8415,14 +8415,14 @@ public void test425278() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " I<Object, ? extends X<Object>> f = (p) -> p;\n" +
- " ^^^^^^^^\n" +
- "The target type of this expression is not a well formed parameterized type due to bound(s) mismatch\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " I<Object, ? extends X<Object>> f = (p) -> p;\n" +
+ " ^^^^^^^^\n" +
+ "The target type of this expression is not a well formed parameterized type due to bound(s) mismatch\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427265, - [1.8][compiler] Type inference with anonymous classes
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427265, - [1.8][compiler] Type inference with anonymous classes
public void test427265() {
runNegativeTest(
new String[] {
@@ -8466,26 +8466,26 @@ public void test427749() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " I i = Y<String>.Z<Integer>::<String> new;\n" +
- " ^\n" +
- "Y cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " i.foo(new Y<String>());\n" +
- " ^\n" +
- "Y cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 19)\n" +
- " Y<String> y = new Y<String>();\n" +
- " ^\n" +
- "Y cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 19)\n" +
- " Y<String> y = new Y<String>();\n" +
- " ^\n" +
- "Y cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " I i = Y<String>.Z<Integer>::<String> new;\n" +
+ " ^\n" +
+ "Y cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " i.foo(new Y<String>());\n" +
+ " ^\n" +
+ "Y cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 19)\n" +
+ " Y<String> y = new Y<String>();\n" +
+ " ^\n" +
+ "Y cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 19)\n" +
+ " Y<String> y = new Y<String>();\n" +
+ " ^\n" +
+ "Y cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428300, - [1.8] Map.computeIfAbsent fails with array value types
@@ -8572,31 +8572,31 @@ public void test428177() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 19)\n" +
- " Stream<String> stream2 = entries.map(toName).distinct(); // ERROR\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Stream<capture#7-of ? extends String> to Stream<String>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 20)\n" +
- " withoutWildcard(entries.map(toName).distinct()); // ERROR\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The method withoutWildcard(Stream<String>) in the type InsistentCapture is not applicable for the arguments (Stream<capture#9-of ? extends String>)\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 21)\n" +
- " withoutWildcard(stream); // ERROR\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The method withoutWildcard(Stream<String>) in the type InsistentCapture is not applicable for the arguments (Stream<capture#10-of ? extends String>)\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 36)\n" +
- " if(\"1\" == \"\") { return stream.collect(Collectors.toList()).stream(); // ERROR\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Stream<capture#25-of ? extends String> to Stream<String>\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 38)\n" +
- " return stream.collect(Collectors.toList()); // NO ERROR\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from List<capture#28-of ? extends String> to Stream<String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 19)\n" +
+ " Stream<String> stream2 = entries.map(toName).distinct(); // ERROR\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Stream<capture#7-of ? extends String> to Stream<String>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 20)\n" +
+ " withoutWildcard(entries.map(toName).distinct()); // ERROR\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The method withoutWildcard(Stream<String>) in the type InsistentCapture is not applicable for the arguments (Stream<capture#9-of ? extends String>)\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 21)\n" +
+ " withoutWildcard(stream); // ERROR\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The method withoutWildcard(Stream<String>) in the type InsistentCapture is not applicable for the arguments (Stream<capture#10-of ? extends String>)\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 36)\n" +
+ " if(\"1\" == \"\") { return stream.collect(Collectors.toList()).stream(); // ERROR\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Stream<capture#25-of ? extends String> to Stream<String>\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 38)\n" +
+ " return stream.collect(Collectors.toList()); // NO ERROR\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from List<capture#28-of ? extends String> to Stream<String>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428795, - [1.8]Internal compiler error: java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.ast.MessageSend.analyseCode
@@ -8616,11 +8616,11 @@ public void test428795() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " System.out.println( name.get().toUpperCase() )\n" +
- " ^^^\n" +
- "The method get() is undefined for the type String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " System.out.println( name.get().toUpperCase() )\n" +
+ " ^^^\n" +
+ "The method get() is undefined for the type String\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428857, - [1.8] Method reference to instance method of generic class incorrectly gives raw type warning
@@ -8641,11 +8641,11 @@ public void test428857() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " Function<List<String>, String> func = ArrayList::toString;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The type ArrayList does not define toString(List<String>) that is applicable here\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " Function<List<String>, String> func = ArrayList::toString;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The type ArrayList does not define toString(List<String>) that is applicable here\n" +
"----------\n", null, false, customOptions);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428857, - [1.8] Method reference to instance method of generic class incorrectly gives raw type warning
@@ -8666,16 +8666,16 @@ public void test428857a() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " System.out.println(func.apply(Arrays.asList(\"a\", \"b\")));\n" +
- " ^^^^^\n" +
- "The method apply(ArrayList<String>) in the type Function<ArrayList<String>,String> is not applicable for the arguments (List<String>)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " System.out.println(func.apply(Arrays.asList(\"a\", \"b\")));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from List<String> to ArrayList<String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " System.out.println(func.apply(Arrays.asList(\"a\", \"b\")));\n" +
+ " ^^^^^\n" +
+ "The method apply(ArrayList<String>) in the type Function<ArrayList<String>,String> is not applicable for the arguments (List<String>)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " System.out.println(func.apply(Arrays.asList(\"a\", \"b\")));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from List<String> to ArrayList<String>\n" +
"----------\n", null, false, customOptions);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428857, - [1.8] Method reference to instance method of generic class incorrectly gives raw type warning
@@ -8696,16 +8696,16 @@ public void test428857b() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " System.out.println(func.apply(Arrays.asList(\"a\", \"b\")));\n" +
- " ^^^^^\n" +
- "The method apply(ArrayList<String>) in the type Function<ArrayList<String>,String> is not applicable for the arguments (List<String>)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " System.out.println(func.apply(Arrays.asList(\"a\", \"b\")));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from List<String> to ArrayList<String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " System.out.println(func.apply(Arrays.asList(\"a\", \"b\")));\n" +
+ " ^^^^^\n" +
+ "The method apply(ArrayList<String>) in the type Function<ArrayList<String>,String> is not applicable for the arguments (List<String>)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " System.out.println(func.apply(Arrays.asList(\"a\", \"b\")));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from List<String> to ArrayList<String>\n" +
"----------\n", null, false, customOptions);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428857, - [1.8] Method reference to instance method of generic class incorrectly gives raw type warning
@@ -8731,16 +8731,16 @@ public void test428857c() {
" Zork z;\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " class Vector<E> extends ArrayList<E> {}\n" +
- " ^^^^^^\n" +
- "The serializable class Vector does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " class Vector<E> extends ArrayList<E> {}\n" +
+ " ^^^^^^\n" +
+ "The serializable class Vector does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n", null, false, customOptions);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428857, - [1.8] Method reference to instance method of generic class incorrectly gives raw type warning
@@ -8766,16 +8766,16 @@ public void test428857d() {
" Zork z;\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " class Vector<E> extends ArrayList<E> {}\n" +
- " ^^^^^^\n" +
- "The serializable class Vector does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " class Vector<E> extends ArrayList<E> {}\n" +
+ " ^^^^^^\n" +
+ "The serializable class Vector does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n", null, false, customOptions);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428857, - [1.8] Method reference to instance method of generic class incorrectly gives raw type warning
@@ -8801,21 +8801,21 @@ public void test428857e() {
" Zork z;\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " class Vector<E> extends ArrayList<E> {}\n" +
- " ^^^^^^\n" +
- "The serializable class Vector does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " I i = ArrayList::new;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The constructed object of type ArrayList is incompatible with the descriptor\'s return type: Vector<String>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 14)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " class Vector<E> extends ArrayList<E> {}\n" +
+ " ^^^^^^\n" +
+ "The serializable class Vector does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " I i = ArrayList::new;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The constructed object of type ArrayList is incompatible with the descriptor\'s return type: Vector<String>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 14)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n", null, false, customOptions);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428857, - [1.8] Method reference to instance method of generic class incorrectly gives raw type warning
@@ -8841,16 +8841,16 @@ public void test428857f() {
" Zork z;\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " class Vector<E> extends ArrayList<E> {}\n" +
- " ^^^^^^\n" +
- "The serializable class Vector does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " class Vector<E> extends ArrayList<E> {}\n" +
+ " ^^^^^^\n" +
+ "The serializable class Vector does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n", null, false, customOptions);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428857, - [1.8] Method reference to instance method of generic class incorrectly gives raw type warning
@@ -8871,16 +8871,16 @@ public void test428857g() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " System.out.println(func.apply(Arrays.asList(\"a\", \"b\")));\n" +
- " ^^^^^\n" +
- "The method apply(capture#1-of ? extends ArrayList<String>) in the type Function<capture#1-of ? extends ArrayList<String>,String> is not applicable for the arguments (List<String>)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " System.out.println(func.apply(Arrays.asList(\"a\", \"b\")));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from List<String> to capture#1-of ? extends ArrayList<String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " System.out.println(func.apply(Arrays.asList(\"a\", \"b\")));\n" +
+ " ^^^^^\n" +
+ "The method apply(capture#1-of ? extends ArrayList<String>) in the type Function<capture#1-of ? extends ArrayList<String>,String> is not applicable for the arguments (List<String>)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " System.out.println(func.apply(Arrays.asList(\"a\", \"b\")));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from List<String> to capture#1-of ? extends ArrayList<String>\n" +
"----------\n", null, false, customOptions);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429833, - [1.8][compiler] Missing types cause NPE in lambda analysis.
@@ -8895,16 +8895,16 @@ public void test429833() {
" };\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " interface I1 { int foo(Strin i); }\n" +
- " ^^^^^\n" +
- "Strin cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " I1 i = (a) -> { \n" +
- " ^^^^^^\n" +
- "This lambda expression refers to the missing type Strin\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " interface I1 { int foo(Strin i); }\n" +
+ " ^^^^^\n" +
+ "Strin cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " I1 i = (a) -> { \n" +
+ " ^^^^^^\n" +
+ "This lambda expression refers to the missing type Strin\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429934, - [1.8][search] for references to type of lambda with 'this' parameter throws AIIOBE/NPE
@@ -8919,46 +8919,46 @@ public void test429934() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Function<String, String> f1= (String s, Function this) -> s;\n" +
- " ^^^^^^^^\n" +
- "Function cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " Function<String, String> f1= (String s, Function this) -> s;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " Function<String, String> f1= (String s, Function this) -> s;\n" +
- " ^^^^^^^^\n" +
- "Function cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 3)\n" +
- " Function<String, String> f1= (String s, Function this) -> s;\n" +
- " ^^^^\n" +
- "Lambda expressions cannot declare a this parameter\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 4)\n" +
- " Function<String, String> f2= (Function this, String s) -> s;\n" +
- " ^^^^^^^^\n" +
- "Function cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 4)\n" +
- " Function<String, String> f2= (Function this, String s) -> s;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 4)\n" +
- " Function<String, String> f2= (Function this, String s) -> s;\n" +
- " ^^^^^^^^\n" +
- "Function cannot be resolved to a type\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 4)\n" +
- " Function<String, String> f2= (Function this, String s) -> s;\n" +
- " ^^^^\n" +
- "Lambda expressions cannot declare a this parameter\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " Function<String, String> f1= (String s, Function this) -> s;\n" +
+ " ^^^^^^^^\n" +
+ "Function cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " Function<String, String> f1= (String s, Function this) -> s;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " Function<String, String> f1= (String s, Function this) -> s;\n" +
+ " ^^^^^^^^\n" +
+ "Function cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 3)\n" +
+ " Function<String, String> f1= (String s, Function this) -> s;\n" +
+ " ^^^^\n" +
+ "Lambda expressions cannot declare a this parameter\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 4)\n" +
+ " Function<String, String> f2= (Function this, String s) -> s;\n" +
+ " ^^^^^^^^\n" +
+ "Function cannot be resolved to a type\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 4)\n" +
+ " Function<String, String> f2= (Function this, String s) -> s;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The target type of this expression must be a functional interface\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 4)\n" +
+ " Function<String, String> f2= (Function this, String s) -> s;\n" +
+ " ^^^^^^^^\n" +
+ "Function cannot be resolved to a type\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 4)\n" +
+ " Function<String, String> f2= (Function this, String s) -> s;\n" +
+ " ^^^^\n" +
+ "Lambda expressions cannot declare a this parameter\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429969, [1.8][compiler] Possible RuntimeException in Lambda tangles ECJ
@@ -8985,16 +8985,16 @@ public void test429969() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " import java.util.Optional;\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The import java.util.Optional is never used\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " require(s1 != null || s2 != null, \"both strings are null\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type IOException\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " import java.util.Optional;\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "The import java.util.Optional is never used\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " require(s1 != null || s2 != null, \"both strings are null\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type IOException\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429969, [1.8][compiler] Possible RuntimeException in Lambda tangles ECJ
@@ -9014,11 +9014,11 @@ public void test429969a() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " I i = X::goo;\n" +
- " ^^^^^^\n" +
- "Unhandled exception type Exception\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " I i = X::goo;\n" +
+ " ^^^^^^\n" +
+ "Unhandled exception type Exception\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=430310, [1.8][compiler] Functional interface incorrectly rejected as not being.
@@ -9038,11 +9038,11 @@ public void test430310() {
"interface F2<T1, R> extends Func1<T1, R> {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " interface F2<T1, R> extends Func1<T1, R> {\n" +
- " ^^\n" +
- "Invalid \'@FunctionalInterface\' annotation; F2<T1,R> is not a functional interface\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " interface F2<T1, R> extends Func1<T1, R> {\n" +
+ " ^^\n" +
+ "Invalid \'@FunctionalInterface\' annotation; F2<T1,R> is not a functional interface\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=424154, [1.8][compiler] PolyTypeBinding must not render the full lambda body in error messages
@@ -9064,15 +9064,15 @@ public void test424154a() throws Exception {
" ^^^^^^^^\n" +
"The method removeIf(Predicate<? super Process>) in the type Collection<Process> is not applicable for the arguments ((int x) -> {})\n" +
"----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " list.removeIf((int x) -> \"\");\n" +
- " ^^^\n" +
- "Lambda expression\'s parameter x is expected to be of type Process\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " list.removeIf((int x) -> \"\");\n" +
- " ^^\n" +
- "Type mismatch: cannot convert from String to boolean\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " list.removeIf((int x) -> \"\");\n" +
+ " ^^^\n" +
+ "Lambda expression\'s parameter x is expected to be of type Process\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " list.removeIf((int x) -> \"\");\n" +
+ " ^^\n" +
+ "Type mismatch: cannot convert from String to boolean\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=424154, [1.8][compiler] PolyTypeBinding must not render the full lambda body in error messages
@@ -9124,18 +9124,18 @@ public void test431514() {
this.runNegativeTest(
new String[] {
"X.java",
- "import java.util.function.Supplier;\n" +
- "public class X {\n" +
- " public void foo() {\n" +
- " class Z {\n" +
- " public Supplier<Object> get() {\n" +
- " return () -> {\n" +
- " class Z { }\n" +
- " return new Z();\n" +
- " };\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "import java.util.function.Supplier;\n" +
+ "public class X {\n" +
+ " public void foo() {\n" +
+ " class Z {\n" +
+ " public Supplier<Object> get() {\n" +
+ " return () -> {\n" +
+ " class Z { }\n" +
+ " return new Z();\n" +
+ " };\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}"
},
"----------\n" +
@@ -9145,7 +9145,7 @@ public void test431514() {
"The nested type Z cannot hide an enclosing type\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=439707 [1.8][compiler] Lambda can be passed illegally to invisible method argument
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=439707 [1.8][compiler] Lambda can be passed illegally to invisible method argument
public void test439707() {
this.runNegativeTest(
new String[] {
@@ -9164,14 +9164,14 @@ public void test439707() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " T2.run(() -> {});\n" +
- " ^^^^^\n" +
- "The type T2.InvisibleInterface from the descriptor computed for the target context is not visible here. \n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " T2.run(() -> {});\n" +
+ " ^^^^^\n" +
+ "The type T2.InvisibleInterface from the descriptor computed for the target context is not visible here. \n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=442983, [1.8] NPE in Scope.findDefaultAbstractMethod
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=442983, [1.8] NPE in Scope.findDefaultAbstractMethod
public void test442983() {
this.runNegativeTest(
new String[] {
@@ -9188,16 +9188,16 @@ public void test442983() {
"}\n"
},
// Note: new message aligns better with javac 8u20.
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " Function<CL<Integer>, String> v5 = CL::method1;\n" +
- " ^^^^^^^^^^^\n" +
- "Cannot make a static reference to the non-static method method1(CL) from the type CL\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " v5 = t -> t.method1(); \n" +
- " ^^^^^^^\n" +
- "The method method1(CL<Integer>) in the type CL<Integer> is not applicable for the arguments ()\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " Function<CL<Integer>, String> v5 = CL::method1;\n" +
+ " ^^^^^^^^^^^\n" +
+ "Cannot make a static reference to the non-static method method1(CL) from the type CL\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " v5 = t -> t.method1(); \n" +
+ " ^^^^^^^\n" +
+ "The method method1(CL<Integer>) in the type CL<Integer> is not applicable for the arguments ()\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=438945, [1.8] NullPointerException InferenceContext18.checkExpression in java 8 with generics, primitives, and overloading
@@ -9250,11 +9250,11 @@ public void test440643() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " private final Accumalator<E> function;\n" +
- " ^^^^^^^^\n" +
- "The value of the field Binding<E>.function is not used\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " private final Accumalator<E> function;\n" +
+ " ^^^^^^^^\n" +
+ "The value of the field Binding<E>.function is not used\n" +
"----------\n",
null,
false,
@@ -9285,11 +9285,11 @@ public void test440643a() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 15)\n" +
- " Fun<X, Integer> f1 = X::size;\n" +
- " ^^^^^^^\n" +
- "Cannot make a static reference to the non-static method size(X) from the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 15)\n" +
+ " Fun<X, Integer> f1 = X::size;\n" +
+ " ^^^^^^^\n" +
+ "Cannot make a static reference to the non-static method size(X) from the type X\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=440643, Eclipse compiler doesn't like method references with overloaded varargs method
@@ -9314,11 +9314,11 @@ public void test440643b() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " Fun<X, Integer> f1 = X::size;\n" +
- " ^^^^^^^\n" +
- "Ambiguous method reference: both size() and size(Object) from the type X are eligible\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " Fun<X, Integer> f1 = X::size;\n" +
+ " ^^^^^^^\n" +
+ "Ambiguous method reference: both size() and size(Object) from the type X are eligible\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=435397, [1.8][compiler] Ambiguous method while using Lambdas
@@ -9363,11 +9363,11 @@ public void test435397() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 33)\n" +
- " new M1().module((c) -> new M2());\n" +
- " ^^^^^^\n" +
- "The method module(M) is ambiguous for the type M1\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 33)\n" +
+ " new M1().module((c) -> new M2());\n" +
+ " ^^^^^^\n" +
+ "The method module(M) is ambiguous for the type M1\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=433458, [1.8][compiler] Eclipse accepts lambda expression with potentially uninitialized arguments
@@ -9383,26 +9383,26 @@ public void test433458() {
" X() {mComparator1 = Comparator.naturalOrder();}\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " final Comparator mComparator1;\n" +
- " ^^^^^^^^^^\n" +
- "Comparator is a raw type. References to generic type Comparator<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " Comparator mComparator2 = (pObj1, pObj2) -> mComparator1.compare(pObj1, pObj2);\n" +
- " ^^^^^^^^^^\n" +
- "Comparator is a raw type. References to generic type Comparator<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 4)\n" +
- " Comparator mComparator2 = (pObj1, pObj2) -> mComparator1.compare(pObj1, pObj2);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method compare(Object, Object) belongs to the raw type Comparator. References to generic type Comparator<T> should be parameterized\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 4)\n" +
- " Comparator mComparator2 = (pObj1, pObj2) -> mComparator1.compare(pObj1, pObj2);\n" +
- " ^^^^^^^^^^^^\n" +
- "The blank final field mComparator1 may not have been initialized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " final Comparator mComparator1;\n" +
+ " ^^^^^^^^^^\n" +
+ "Comparator is a raw type. References to generic type Comparator<T> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " Comparator mComparator2 = (pObj1, pObj2) -> mComparator1.compare(pObj1, pObj2);\n" +
+ " ^^^^^^^^^^\n" +
+ "Comparator is a raw type. References to generic type Comparator<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 4)\n" +
+ " Comparator mComparator2 = (pObj1, pObj2) -> mComparator1.compare(pObj1, pObj2);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: The method compare(Object, Object) belongs to the raw type Comparator. References to generic type Comparator<T> should be parameterized\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 4)\n" +
+ " Comparator mComparator2 = (pObj1, pObj2) -> mComparator1.compare(pObj1, pObj2);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The blank final field mComparator1 may not have been initialized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=433458, [1.8][compiler] Eclipse accepts lambda expression with potentially uninitialized arguments
@@ -9422,63 +9422,63 @@ public void test433458a() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " X() {\n" +
- " ^^^\n" +
- "The blank final field x may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " x = 20;\n" +
- " ^\n" +
- "The final field X.x cannot be assigned\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " X() {\n" +
+ " ^^^\n" +
+ "The blank final field x may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " x = 20;\n" +
+ " ^\n" +
+ "The final field X.x cannot be assigned\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=433588, [1.8][compiler] ECJ compiles an ambiguous call in the presence of an unrelated unused method.
public void test433588() {
String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ?
- "----------\n" +
- "1. WARNING in X.java (at line 15)\n" +
- " public final @SafeVarargs void forEachOrdered(Consumer<? super T> action, Consumer<? super T>... actions) throws E {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The method forEachOrdered(Consumer<? super T>, Consumer<? super T>...) from the type X.AbstractStream<T,E,STREAM,SELF,CONSUMER> is never used locally\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 29)\n" +
- " lines1.forEachOrdered(s -> Files.isHidden(Paths.get(s)));\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 30)\n" +
- " lines1.forEachOrdered(s -> System.out.println(s));\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 15)\n" +
+ " public final @SafeVarargs void forEachOrdered(Consumer<? super T> action, Consumer<? super T>... actions) throws E {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The method forEachOrdered(Consumer<? super T>, Consumer<? super T>...) from the type X.AbstractStream<T,E,STREAM,SELF,CONSUMER> is never used locally\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 29)\n" +
+ " lines1.forEachOrdered(s -> Files.isHidden(Paths.get(s)));\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 30)\n" +
+ " lines1.forEachOrdered(s -> System.out.println(s));\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" +
"----------\n"
:
- "----------\n" +
- "1. WARNING in X.java (at line 15)\n" +
- " public final @SafeVarargs void forEachOrdered(Consumer<? super T> action, Consumer<? super T>... actions) throws E {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The method forEachOrdered(Consumer<? super T>, Consumer<? super T>...) from the type X.AbstractStream<T,E,STREAM,SELF,CONSUMER> is never used locally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 17)\n" +
- " private static class UnStream<T> extends AbstractStream<T, RuntimeException, Stream<T>, UnStream<T>, Consumer<? super T>> {}\n" +
- " ^^^^^^^^\n" +
- "Access to enclosing constructor X.AbstractStream<T,E,STREAM,SELF,CONSUMER>() is emulated by a synthetic accessor method\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 18)\n" +
- " private static class IOStream<T> extends AbstractStream<T, IOException, Stream<T>, IOStream<T>, IOConsumer<? super T>> {}\n" +
- " ^^^^^^^^\n" +
- "Access to enclosing constructor X.AbstractStream<T,E,STREAM,SELF,CONSUMER>() is emulated by a synthetic accessor method\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 29)\n" +
- " lines1.forEachOrdered(s -> Files.isHidden(Paths.get(s)));\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 30)\n" +
- " lines1.forEachOrdered(s -> System.out.println(s));\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 15)\n" +
+ " public final @SafeVarargs void forEachOrdered(Consumer<? super T> action, Consumer<? super T>... actions) throws E {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The method forEachOrdered(Consumer<? super T>, Consumer<? super T>...) from the type X.AbstractStream<T,E,STREAM,SELF,CONSUMER> is never used locally\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 17)\n" +
+ " private static class UnStream<T> extends AbstractStream<T, RuntimeException, Stream<T>, UnStream<T>, Consumer<? super T>> {}\n" +
+ " ^^^^^^^^\n" +
+ "Access to enclosing constructor X.AbstractStream<T,E,STREAM,SELF,CONSUMER>() is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 18)\n" +
+ " private static class IOStream<T> extends AbstractStream<T, IOException, Stream<T>, IOStream<T>, IOConsumer<? super T>> {}\n" +
+ " ^^^^^^^^\n" +
+ "Access to enclosing constructor X.AbstractStream<T,E,STREAM,SELF,CONSUMER>() is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 29)\n" +
+ " lines1.forEachOrdered(s -> Files.isHidden(Paths.get(s)));\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 30)\n" +
+ " lines1.forEachOrdered(s -> System.out.println(s));\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -9524,38 +9524,38 @@ public void test433588() {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=433588, [1.8][compiler] ECJ compiles an ambiguous call in the presence of an unrelated unused method.
public void test433588a() {
String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ?
- "----------\n" +
- "1. ERROR in X.java (at line 29)\n" +
- " lines1.forEachOrdered(s -> Files.isHidden(Paths.get(s)));\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 30)\n" +
- " lines1.forEachOrdered(s -> System.out.println(s));\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 29)\n" +
+ " lines1.forEachOrdered(s -> Files.isHidden(Paths.get(s)));\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 30)\n" +
+ " lines1.forEachOrdered(s -> System.out.println(s));\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" +
"----------\n"
:
- "----------\n" +
- "1. WARNING in X.java (at line 17)\n" +
- " private static class UnStream<T> extends AbstractStream<T, RuntimeException, Stream<T>, UnStream<T>, Consumer<? super T>> {}\n" +
- " ^^^^^^^^\n" +
- "Access to enclosing constructor X.AbstractStream<T,E,STREAM,SELF,CONSUMER>() is emulated by a synthetic accessor method\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 18)\n" +
- " private static class IOStream<T> extends AbstractStream<T, IOException, Stream<T>, IOStream<T>, IOConsumer<? super T>> {}\n" +
- " ^^^^^^^^\n" +
- "Access to enclosing constructor X.AbstractStream<T,E,STREAM,SELF,CONSUMER>() is emulated by a synthetic accessor method\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 29)\n" +
- " lines1.forEachOrdered(s -> Files.isHidden(Paths.get(s)));\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 30)\n" +
- " lines1.forEachOrdered(s -> System.out.println(s));\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 17)\n" +
+ " private static class UnStream<T> extends AbstractStream<T, RuntimeException, Stream<T>, UnStream<T>, Consumer<? super T>> {}\n" +
+ " ^^^^^^^^\n" +
+ "Access to enclosing constructor X.AbstractStream<T,E,STREAM,SELF,CONSUMER>() is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 18)\n" +
+ " private static class IOStream<T> extends AbstractStream<T, IOException, Stream<T>, IOStream<T>, IOConsumer<? super T>> {}\n" +
+ " ^^^^^^^^\n" +
+ "Access to enclosing constructor X.AbstractStream<T,E,STREAM,SELF,CONSUMER>() is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 29)\n" +
+ " lines1.forEachOrdered(s -> Files.isHidden(Paths.get(s)));\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 30)\n" +
+ " lines1.forEachOrdered(s -> System.out.println(s));\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -9628,50 +9628,50 @@ public void test433735() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " super( () -> {\n" +
- " ^^^^^\n" +
- "Cannot refer to \'this\' nor \'super\' while explicitly invoking a constructor\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " super( () -> {\n" +
+ " ^^^^^\n" +
+ "Cannot refer to \'this\' nor \'super\' while explicitly invoking a constructor\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=432531 [1.8] VerifyError with anonymous subclass inside of lambda expression in the superclass constructor call
public void test432531a() {
this.runNegativeTest(
new String[] {
- "Y.java",
- "import java.util.function.Supplier;\n" +
- "class E {\n" +
- " E(Supplier<Object> factory) { }\n" +
- "}\n" +
- "public class Y extends E {\n" +
- " Y() {\n" +
- " super( () -> {\n" +
- " class Z extends E {\n" +
- " Z() {\n" +
- " super(() -> new Object());\n" +
- " }\n" +
- " }\n" +
- " return new Z();\n" +
- " });\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new Y();\n" +
- " }\n" +
+ "Y.java",
+ "import java.util.function.Supplier;\n" +
+ "class E {\n" +
+ " E(Supplier<Object> factory) { }\n" +
+ "}\n" +
+ "public class Y extends E {\n" +
+ " Y() {\n" +
+ " super( () -> {\n" +
+ " class Z extends E {\n" +
+ " Z() {\n" +
+ " super(() -> new Object());\n" +
+ " }\n" +
+ " }\n" +
+ " return new Z();\n" +
+ " });\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new Y();\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in Y.java (at line 7)\n" +
- " super( () -> {\n" +
- " ^^^^^\n" +
- "Cannot refer to \'this\' nor \'super\' while explicitly invoking a constructor\n" +
+ "----------\n" +
+ "1. ERROR in Y.java (at line 7)\n" +
+ " super( () -> {\n" +
+ " ^^^^^\n" +
+ "Cannot refer to \'this\' nor \'super\' while explicitly invoking a constructor\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=432605, [1.8] Incorrect error "The type ArrayList<T> does not define add(ArrayList<T>, Object) that is applicable here"
public void _test432605() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"import java.util.ArrayList;\n" +
"import java.util.HashMap;\n" +
"import java.util.function.Function;\n" +
@@ -9722,36 +9722,36 @@ public void _test432605() {
"}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Y.java (at line 7)\n" +
- " super( () -> {\n" +
- " ^^^^^\n" +
- "No enclosing instance of type Y is available due to some intermediate constructor invocation\n" +
+ "----------\n" +
+ "1. ERROR in Y.java (at line 7)\n" +
+ " super( () -> {\n" +
+ " ^^^^^\n" +
+ "No enclosing instance of type Y is available due to some intermediate constructor invocation\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=444665, Internal compiler error: java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.invalidMethod
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=444665, Internal compiler error: java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.invalidMethod
public void test444665() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" static void foo(java.util.Map<Long, Long> map) {\n" +
" java.util.function.Consumer<int[]> c = array -> map.compute(array.get(0), (k, v) -> null);\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " java.util.function.Consumer<int[]> c = array -> map.compute(array.get(0), (k, v) -> null);\n" +
- " ^^^^^^^^^^^^\n" +
- "Cannot invoke get(int) on the array type int[]\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " java.util.function.Consumer<int[]> c = array -> map.compute(array.get(0), (k, v) -> null);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Cannot invoke get(int) on the array type int[]\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=442446, [1.8][compiler] compiler unable to infer lambda's generic argument types
public void test442446() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"import java.util.Collection;\n" +
"import java.util.Map;\n" +
"import java.util.function.Function;\n" +
@@ -9767,7 +9767,7 @@ public void test442446() {
" );\n" +
" }\n" +
" X(Map<Object,Integer> pMap) {}\n" +
- "}\n"
+ "}\n"
},
"");
}
@@ -9777,7 +9777,7 @@ public void test432759() {
false /* skipJavac */,
JavacTestOptions.Excuse.JavacDoesNotCompileCorrectSource,
new String[] {
- "X.java",
+ "X.java",
"import java.util.function.BinaryOperator;\n" +
"import java.util.function.Consumer;\n" +
"\n" +
@@ -9812,7 +9812,7 @@ public void test432759() {
" // ECJ no error, javac no error\n" +
" // ECJ no error, javac no error\n" +
" }\n" +
- "}\n"
+ "}\n"
},
"");
}
@@ -9820,7 +9820,7 @@ public void test432759() {
public void test437444() {
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"import java.util.ArrayList;\n" +
"import java.util.List;\n" +
"import java.util.stream.Collectors;\n" +
@@ -9838,18 +9838,18 @@ public void test437444() {
" }\n" +
"}\n" +
"class Person {\n" +
- "}\n"
+ "}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " Map<String, Person> map = \n" +
- " ^^^\n" +
- "Map cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " Function.identity() \n" +
- " ^^^^^^^^\n" +
- "Function cannot be resolved\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " Map<String, Person> map = \n" +
+ " ^^^\n" +
+ "Map cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 13)\n" +
+ " Function.identity() \n" +
+ " ^^^^^^^^\n" +
+ "Function cannot be resolved\n" +
"----------\n");
}
// test ground target type with wildcards left in non parameter positions.
@@ -9869,12 +9869,12 @@ public void testGroundTargetTypeWithWithWildcards() {
" return m((X x1, X x2) -> { return new Y(); });\n" +
" }\n" +
"}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " return m((X x1, X x2) -> { return new Y(); });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from I<X,X,? extends C> to I<? extends A,? extends B,? extends C>\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " return m((X x1, X x2) -> { return new Y(); });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from I<X,X,? extends C> to I<? extends A,? extends B,? extends C>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=474522, [1.8][compiler] ecj doesn't handle captured final fields correctly in lambdas
@@ -9882,95 +9882,95 @@ public void test474522() {
this.runNegativeTest(
new String[] {
"Bug.java",
- "import java.awt.event.ActionEvent;\n" +
- "import java.awt.event.ActionListener;\n" +
- "public class Bug {\n" +
- " final String s;\n" +
- " public Bug() {\n" +
- " this.s = \"\";\n" +
- " }\n" +
- " private final ActionListener listener1 = new ActionListener() {\n" +
- " @Override public void actionPerformed(ActionEvent e) {\n" +
- " System.out.println(s);\n" +
- " }\n" +
- " };\n" +
- " private final ActionListener listener2 = e -> System.out.println(s);\n" +
+ "import java.awt.event.ActionEvent;\n" +
+ "import java.awt.event.ActionListener;\n" +
+ "public class Bug {\n" +
+ " final String s;\n" +
+ " public Bug() {\n" +
+ " this.s = \"\";\n" +
+ " }\n" +
+ " private final ActionListener listener1 = new ActionListener() {\n" +
+ " @Override public void actionPerformed(ActionEvent e) {\n" +
+ " System.out.println(s);\n" +
+ " }\n" +
+ " };\n" +
+ " private final ActionListener listener2 = e -> System.out.println(s);\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in Bug.java (at line 8)\n" +
- " private final ActionListener listener1 = new ActionListener() {\n" +
- " ^^^^^^^^^\n" +
- "The value of the field Bug.listener1 is not used\n" +
- "----------\n" +
- "2. WARNING in Bug.java (at line 13)\n" +
- " private final ActionListener listener2 = e -> System.out.println(s);\n" +
- " ^^^^^^^^^\n" +
- "The value of the field Bug.listener2 is not used\n" +
- "----------\n" +
- "3. ERROR in Bug.java (at line 13)\n" +
- " private final ActionListener listener2 = e -> System.out.println(s);\n" +
- " ^\n" +
- "The blank final field s may not have been initialized\n" +
+ "----------\n" +
+ "1. WARNING in Bug.java (at line 8)\n" +
+ " private final ActionListener listener1 = new ActionListener() {\n" +
+ " ^^^^^^^^^\n" +
+ "The value of the field Bug.listener1 is not used\n" +
+ "----------\n" +
+ "2. WARNING in Bug.java (at line 13)\n" +
+ " private final ActionListener listener2 = e -> System.out.println(s);\n" +
+ " ^^^^^^^^^\n" +
+ "The value of the field Bug.listener2 is not used\n" +
+ "----------\n" +
+ "3. ERROR in Bug.java (at line 13)\n" +
+ " private final ActionListener listener2 = e -> System.out.println(s);\n" +
+ " ^\n" +
+ "The blank final field s may not have been initialized\n" +
"----------\n");
}
public void testBug487390() {
runNegativeTest(
new String[] {
"X.java",
- "interface ConsumeN {\n" +
- " void consume(String.. strings); // syntax error here\n" +
- "}\n" +
- "public class X {\n" +
- "\n" +
- " void consu(ConsumeN c) { }\n" +
- " void test() {\n" +
- " consu((String... s) -> System.out.print(s.length));\n" +
- " }\n" +
+ "interface ConsumeN {\n" +
+ " void consume(String.. strings); // syntax error here\n" +
+ "}\n" +
+ "public class X {\n" +
+ "\n" +
+ " void consu(ConsumeN c) { }\n" +
+ " void test() {\n" +
+ " consu((String... s) -> System.out.print(s.length));\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void consume(String.. strings); // syntax error here\n" +
- " ^\n" +
- "Syntax error on token \".\", Identifier expected\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " consu((String... s) -> System.out.print(s.length));\n" +
- " ^^^^^\n" +
- "The method consu(ConsumeN) in the type X is not applicable for the arguments ((String... s) -> {})\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " consu((String... s) -> System.out.print(s.length));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Lambda expression\'s signature does not match the signature of the functional interface method consume()\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " void consume(String.. strings); // syntax error here\n" +
+ " ^\n" +
+ "Syntax error on token \".\", Identifier expected\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " consu((String... s) -> System.out.print(s.length));\n" +
+ " ^^^^^\n" +
+ "The method consu(ConsumeN) in the type X is not applicable for the arguments ((String... s) -> {})\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " consu((String... s) -> System.out.print(s.length));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Lambda expression\'s signature does not match the signature of the functional interface method consume()\n" +
"----------\n");
}
public void testBug487390b() {
runNegativeTest(
new String[] {
"X.java",
- "interface ConsumeN {\n" +
- " void consume();\n" +
- "}\n" +
- "public class X {\n" +
- "\n" +
- " void consu(ConsumeN c) { }\n" +
- " void test() {\n" +
- " consu((String... s) -> System.out.print(s.length));\n" +
- " }\n" +
+ "interface ConsumeN {\n" +
+ " void consume();\n" +
+ "}\n" +
+ "public class X {\n" +
+ "\n" +
+ " void consu(ConsumeN c) { }\n" +
+ " void test() {\n" +
+ " consu((String... s) -> System.out.print(s.length));\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " consu((String... s) -> System.out.print(s.length));\n" +
- " ^^^^^\n" +
- "The method consu(ConsumeN) in the type X is not applicable for the arguments ((String... s) -> {})\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " consu((String... s) -> System.out.print(s.length));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Lambda expression\'s signature does not match the signature of the functional interface method consume()\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " consu((String... s) -> System.out.print(s.length));\n" +
+ " ^^^^^\n" +
+ "The method consu(ConsumeN) in the type X is not applicable for the arguments ((String... s) -> {})\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " consu((String... s) -> System.out.print(s.length));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Lambda expression\'s signature does not match the signature of the functional interface method consume()\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=458332, [1.8][compiler] only 409 method references/lambda expressions per class possible
@@ -9980,95 +9980,95 @@ public void testBug458332() {
null,
new String[] {
"Test.java",
- "import java.io.Serializable;\n" +
- "import java.util.function.Consumer;\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(Data.part1().length);\n" +
- " System.out.println(Data.part2().length);\n" +
- " }\n" +
- " @FunctionalInterface\n" +
- " private static interface MethodRef extends Consumer<String[]>, Serializable {}\n" +
- " private static class Data {\n" +
- " static MethodRef[] part1() {\n" +
- " return new MethodRef[] {\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " };\n" +
- " }\n" +
- " static MethodRef[] part2() {\n" +
- " return new MethodRef[] {\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
- " };\n" +
- " }\n" +
- " }\n" +
+ "import java.io.Serializable;\n" +
+ "import java.util.function.Consumer;\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(Data.part1().length);\n" +
+ " System.out.println(Data.part2().length);\n" +
+ " }\n" +
+ " @FunctionalInterface\n" +
+ " private static interface MethodRef extends Consumer<String[]>, Serializable {}\n" +
+ " private static class Data {\n" +
+ " static MethodRef[] part1() {\n" +
+ " return new MethodRef[] {\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " };\n" +
+ " }\n" +
+ " static MethodRef[] part2() {\n" +
+ " return new MethodRef[] {\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main, Test::main,\n" +
+ " };\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
"450\n" +
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeTypeAnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeTypeAnnotationTest.java
index 8c0d6d47b..4ea739dd7 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeTypeAnnotationTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeTypeAnnotationTest.java
@@ -24,7 +24,7 @@ import junit.framework.Test;
@SuppressWarnings({ "unchecked", "rawtypes" })
public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
- static {
+ static {
// TESTS_NUMBERS = new int [] { 35 };
// TESTS_NAMES = new String [] { "test0390882b" };
}
@@ -43,11 +43,11 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"X.java",
"public class X extends @Marker2 Object {}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X extends @Marker2 Object {}\n" +
- " ^^^^^^^\n" +
- "Marker2 cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X extends @Marker2 Object {}\n" +
+ " ^^^^^^^\n" +
+ "Marker2 cannot be resolved to a type\n" +
"----------\n");
}
public void test002() throws Exception {
@@ -59,11 +59,11 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" private static final long serialVersionUID = 1L;\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public class X implements @Marker2 Serializable {\n" +
- " ^^^^^^^\n" +
- "Marker2 cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public class X implements @Marker2 Serializable {\n" +
+ " ^^^^^^^\n" +
+ "Marker2 cannot be resolved to a type\n" +
"----------\n");
}
public void test003() throws Exception {
@@ -72,11 +72,11 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"X.java",
"public class X extends @Marker Object {}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X extends @Marker Object {}\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X extends @Marker Object {}\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
"----------\n");
}
public void test004() throws Exception {
@@ -85,11 +85,11 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"X.java",
"public class X<@Marker T> {}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<@Marker T> {}\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X<@Marker T> {}\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
"----------\n");
}
public void test005() throws Exception {
@@ -98,11 +98,11 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"X.java",
"public class X<@Marker T> {}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<@Marker T> {}\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X<@Marker T> {}\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
"----------\n");
}
public void test006() throws Exception {
@@ -111,24 +111,24 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"Y.java",
"class Y {}\n",
"X.java",
- "public class X extends @A(id=\"Hello, World!\") @B @C('(') Y {\n" +
+ "public class X extends @A(id=\"Hello, World!\") @B @C('(') Y {\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X extends @A(id=\"Hello, World!\") @B @C(\'(\') Y {\n" +
- " ^\n" +
- "A cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " public class X extends @A(id=\"Hello, World!\") @B @C(\'(\') Y {\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 1)\n" +
- " public class X extends @A(id=\"Hello, World!\") @B @C(\'(\') Y {\n" +
- " ^\n" +
- "C cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X extends @A(id=\"Hello, World!\") @B @C(\'(\') Y {\n" +
+ " ^\n" +
+ "A cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 1)\n" +
+ " public class X extends @A(id=\"Hello, World!\") @B @C(\'(\') Y {\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 1)\n" +
+ " public class X extends @A(id=\"Hello, World!\") @B @C(\'(\') Y {\n" +
+ " ^\n" +
+ "C cannot be resolved to a type\n" +
"----------\n");
}
public void test007() throws Exception {
@@ -141,21 +141,21 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"X.java",
"public class X implements @A(id=\"Hello, World!\") I, @B @C('(') J {}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X implements @A(id=\"Hello, World!\") I, @B @C(\'(\') J {}\n" +
- " ^\n" +
- "A cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " public class X implements @A(id=\"Hello, World!\") I, @B @C(\'(\') J {}\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 1)\n" +
- " public class X implements @A(id=\"Hello, World!\") I, @B @C(\'(\') J {}\n" +
- " ^\n" +
- "C cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X implements @A(id=\"Hello, World!\") I, @B @C(\'(\') J {}\n" +
+ " ^\n" +
+ "A cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 1)\n" +
+ " public class X implements @A(id=\"Hello, World!\") I, @B @C(\'(\') J {}\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 1)\n" +
+ " public class X implements @A(id=\"Hello, World!\") I, @B @C(\'(\') J {}\n" +
+ " ^\n" +
+ "C cannot be resolved to a type\n" +
"----------\n");
}
public void test010() throws Exception {
@@ -164,24 +164,24 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"Y.java",
"class Y<T> {}\n",
"X.java",
- "public class X extends @A(\"Hello, World!\") Y<@B @C('(') String> {\n" +
+ "public class X extends @A(\"Hello, World!\") Y<@B @C('(') String> {\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X extends @A(\"Hello, World!\") Y<@B @C(\'(\') String> {\n" +
- " ^\n" +
- "A cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " public class X extends @A(\"Hello, World!\") Y<@B @C(\'(\') String> {\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 1)\n" +
- " public class X extends @A(\"Hello, World!\") Y<@B @C(\'(\') String> {\n" +
- " ^\n" +
- "C cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X extends @A(\"Hello, World!\") Y<@B @C(\'(\') String> {\n" +
+ " ^\n" +
+ "A cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 1)\n" +
+ " public class X extends @A(\"Hello, World!\") Y<@B @C(\'(\') String> {\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 1)\n" +
+ " public class X extends @A(\"Hello, World!\") Y<@B @C(\'(\') String> {\n" +
+ " ^\n" +
+ "C cannot be resolved to a type\n" +
"----------\n");
}
public void test011() throws Exception {
@@ -194,21 +194,21 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"X.java",
"public class X implements I<@A(\"Hello, World!\") String>, @B J<@C('(') Integer> {}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X implements I<@A(\"Hello, World!\") String>, @B J<@C(\'(\') Integer> {}\n" +
- " ^\n" +
- "A cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " public class X implements I<@A(\"Hello, World!\") String>, @B J<@C(\'(\') Integer> {}\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 1)\n" +
- " public class X implements I<@A(\"Hello, World!\") String>, @B J<@C(\'(\') Integer> {}\n" +
- " ^\n" +
- "C cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X implements I<@A(\"Hello, World!\") String>, @B J<@C(\'(\') Integer> {}\n" +
+ " ^\n" +
+ "A cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 1)\n" +
+ " public class X implements I<@A(\"Hello, World!\") String>, @B J<@C(\'(\') Integer> {}\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 1)\n" +
+ " public class X implements I<@A(\"Hello, World!\") String>, @B J<@C(\'(\') Integer> {}\n" +
+ " ^\n" +
+ "C cannot be resolved to a type\n" +
"----------\n");
}
// throws
@@ -232,21 +232,21 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" void foo() throws @A(\"Hello, World!\") E, E1, @B @C('(') E2 {}\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void foo() throws @A(\"Hello, World!\") E, E1, @B @C(\'(\') E2 {}\n" +
- " ^\n" +
- "A cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " void foo() throws @A(\"Hello, World!\") E, E1, @B @C(\'(\') E2 {}\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 2)\n" +
- " void foo() throws @A(\"Hello, World!\") E, E1, @B @C(\'(\') E2 {}\n" +
- " ^\n" +
- "C cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " void foo() throws @A(\"Hello, World!\") E, E1, @B @C(\'(\') E2 {}\n" +
+ " ^\n" +
+ "A cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " void foo() throws @A(\"Hello, World!\") E, E1, @B @C(\'(\') E2 {}\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 2)\n" +
+ " void foo() throws @A(\"Hello, World!\") E, E1, @B @C(\'(\') E2 {}\n" +
+ " ^\n" +
+ "C cannot be resolved to a type\n" +
"----------\n");
}
// method receiver
@@ -254,15 +254,15 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " void foo(@B(3) X this) {}\n" +
+ "public class X {\n" +
+ " void foo(@B(3) X this) {}\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void foo(@B(3) X this) {}\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " void foo(@B(3) X this) {}\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
"----------\n");
}
// method return type
@@ -270,17 +270,17 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" @B(3) int foo() {\n" +
" return 1;\n" +
- " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " @B(3) int foo() {\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " @B(3) int foo() {\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
"----------\n");
}
// field type
@@ -288,15 +288,15 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" @B(3) int field;\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " @B(3) int field;\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " @B(3) int field;\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
"----------\n");
}
// method parameter
@@ -304,17 +304,17 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" int foo(@B(3) String s) {\n" +
" return s.length();\n" +
- " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " int foo(@B(3) String s) {\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " int foo(@B(3) String s) {\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
"----------\n");
}
// method parameter generic or array
@@ -322,17 +322,17 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" int foo(String @B(3) [] s) {\n" +
" return s.length;\n" +
- " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " int foo(String @B(3) [] s) {\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " int foo(String @B(3) [] s) {\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
"----------\n");
}
// field type generic or array
@@ -340,15 +340,15 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" int @B(3) [] field;\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " int @B(3) [] field;\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " int @B(3) [] field;\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
"----------\n");
}
// class type parameter
@@ -358,16 +358,16 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"X.java",
"public class X<@A @B(3) T> {}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<@A @B(3) T> {}\n" +
- " ^\n" +
- "A cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " public class X<@A @B(3) T> {}\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X<@A @B(3) T> {}\n" +
+ " ^\n" +
+ "A cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 1)\n" +
+ " public class X<@A @B(3) T> {}\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
"----------\n");
}
// method type parameter
@@ -375,20 +375,20 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " <@A @B(3) T> void foo(T t) {}\n" +
+ "public class X {\n" +
+ " <@A @B(3) T> void foo(T t) {}\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " <@A @B(3) T> void foo(T t) {}\n" +
- " ^\n" +
- "A cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " <@A @B(3) T> void foo(T t) {}\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " <@A @B(3) T> void foo(T t) {}\n" +
+ " ^\n" +
+ "A cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " <@A @B(3) T> void foo(T t) {}\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
"----------\n");
}
// class type parameter bound
@@ -400,16 +400,16 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"X.java",
"public class X<T extends @A Z & @B(3) Cloneable> {}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<T extends @A Z & @B(3) Cloneable> {}\n" +
- " ^\n" +
- "A cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " public class X<T extends @A Z & @B(3) Cloneable> {}\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X<T extends @A Z & @B(3) Cloneable> {}\n" +
+ " ^\n" +
+ "A cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 1)\n" +
+ " public class X<T extends @A Z & @B(3) Cloneable> {}\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
"----------\n");
}
// class type parameter bound generic or array
@@ -421,26 +421,26 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"X.java",
"public class X<T extends Y<@A String @C[][]@B[]> & @B(3) Cloneable> {}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<T extends Y<@A String @C[][]@B[]> & @B(3) Cloneable> {}\n" +
- " ^\n" +
- "A cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " public class X<T extends Y<@A String @C[][]@B[]> & @B(3) Cloneable> {}\n" +
- " ^\n" +
- "C cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 1)\n" +
- " public class X<T extends Y<@A String @C[][]@B[]> & @B(3) Cloneable> {}\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 1)\n" +
- " public class X<T extends Y<@A String @C[][]@B[]> & @B(3) Cloneable> {}\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X<T extends Y<@A String @C[][]@B[]> & @B(3) Cloneable> {}\n" +
+ " ^\n" +
+ "A cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 1)\n" +
+ " public class X<T extends Y<@A String @C[][]@B[]> & @B(3) Cloneable> {}\n" +
+ " ^\n" +
+ "C cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 1)\n" +
+ " public class X<T extends Y<@A String @C[][]@B[]> & @B(3) Cloneable> {}\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 1)\n" +
+ " public class X<T extends Y<@A String @C[][]@B[]> & @B(3) Cloneable> {}\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
"----------\n");
}
// method type parameter bound
@@ -454,16 +454,16 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" <T extends @A Z & @B(3) Cloneable> void foo(T t) {}\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " <T extends @A Z & @B(3) Cloneable> void foo(T t) {}\n" +
- " ^\n" +
- "A cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " <T extends @A Z & @B(3) Cloneable> void foo(T t) {}\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " <T extends @A Z & @B(3) Cloneable> void foo(T t) {}\n" +
+ " ^\n" +
+ "A cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " <T extends @A Z & @B(3) Cloneable> void foo(T t) {}\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
"----------\n");
}
// class type parameter bound generic or array
@@ -479,26 +479,26 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" <T extends Y<@A Z @C[][]@B[]> & @B(3) Cloneable> void foo(T t) {}\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " <T extends Y<@A Z @C[][]@B[]> & @B(3) Cloneable> void foo(T t) {}\n" +
- " ^\n" +
- "A cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " <T extends Y<@A Z @C[][]@B[]> & @B(3) Cloneable> void foo(T t) {}\n" +
- " ^\n" +
- "C cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 2)\n" +
- " <T extends Y<@A Z @C[][]@B[]> & @B(3) Cloneable> void foo(T t) {}\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 2)\n" +
- " <T extends Y<@A Z @C[][]@B[]> & @B(3) Cloneable> void foo(T t) {}\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " <T extends Y<@A Z @C[][]@B[]> & @B(3) Cloneable> void foo(T t) {}\n" +
+ " ^\n" +
+ "A cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " <T extends Y<@A Z @C[][]@B[]> & @B(3) Cloneable> void foo(T t) {}\n" +
+ " ^\n" +
+ "C cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 2)\n" +
+ " <T extends Y<@A Z @C[][]@B[]> & @B(3) Cloneable> void foo(T t) {}\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 2)\n" +
+ " <T extends Y<@A Z @C[][]@B[]> & @B(3) Cloneable> void foo(T t) {}\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
"----------\n");
}
// local variable + generic or array
@@ -506,36 +506,36 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " @C int i;\n" +
- " @A String [] @B(3)[] tab = new String[][] {};\n" +
- " if (tab != null) {\n" +
- " i = 0;\n" +
- " System.out.println(i + tab.length);\n" +
- " } else {\n" +
- " System.out.println(tab.length);\n" +
- " }\n" +
- " i = 4;\n" +
- " System.out.println(-i + tab.length);\n" +
- " }\n" +
+ "public class X {\n" +
+ " void foo(String s) {\n" +
+ " @C int i;\n" +
+ " @A String [] @B(3)[] tab = new String[][] {};\n" +
+ " if (tab != null) {\n" +
+ " i = 0;\n" +
+ " System.out.println(i + tab.length);\n" +
+ " } else {\n" +
+ " System.out.println(tab.length);\n" +
+ " }\n" +
+ " i = 4;\n" +
+ " System.out.println(-i + tab.length);\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " @C int i;\n" +
- " ^\n" +
- "C cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " @A String [] @B(3)[] tab = new String[][] {};\n" +
- " ^\n" +
- "A cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " @A String [] @B(3)[] tab = new String[][] {};\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " @C int i;\n" +
+ " ^\n" +
+ "C cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " @A String [] @B(3)[] tab = new String[][] {};\n" +
+ " ^\n" +
+ "A cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " @A String [] @B(3)[] tab = new String[][] {};\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
"----------\n");
}
// type argument constructor call
@@ -543,25 +543,25 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " <T> X(T t) {\n" +
- " }\n" +
- " public Object foo() {\n" +
- " X x = new <@A @B(1) String>X(null);\n" +
- " return x;\n" +
- " }\n" +
+ "public class X {\n" +
+ " <T> X(T t) {\n" +
+ " }\n" +
+ " public Object foo() {\n" +
+ " X x = new <@A @B(1) String>X(null);\n" +
+ " return x;\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " X x = new <@A @B(1) String>X(null);\n" +
- " ^\n" +
- "A cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " X x = new <@A @B(1) String>X(null);\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " X x = new <@A @B(1) String>X(null);\n" +
+ " ^\n" +
+ "A cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " X x = new <@A @B(1) String>X(null);\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
"----------\n");
}
// type argument constructor call generic or array
@@ -569,25 +569,25 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " <T> X(T t) {\n" +
- " }\n" +
- " public Object foo() {\n" +
- " X x = new <@A @B(1) String>X(null);\n" +
- " return x;\n" +
- " }\n" +
+ "public class X {\n" +
+ " <T> X(T t) {\n" +
+ " }\n" +
+ " public Object foo() {\n" +
+ " X x = new <@A @B(1) String>X(null);\n" +
+ " return x;\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " X x = new <@A @B(1) String>X(null);\n" +
- " ^\n" +
- "A cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " X x = new <@A @B(1) String>X(null);\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " X x = new <@A @B(1) String>X(null);\n" +
+ " ^\n" +
+ "A cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " X x = new <@A @B(1) String>X(null);\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
"----------\n");
}
// type argument method call and generic or array
@@ -605,21 +605,21 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " System.out.println(X.<@A @B(1) String[], @C(\'-\') X>foo(new String[]{\"SUCCESS\"}, null)[0]);\n" +
- " ^\n" +
- "A cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " System.out.println(X.<@A @B(1) String[], @C(\'-\') X>foo(new String[]{\"SUCCESS\"}, null)[0]);\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " System.out.println(X.<@A @B(1) String[], @C(\'-\') X>foo(new String[]{\"SUCCESS\"}, null)[0]);\n" +
- " ^\n" +
- "C cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " System.out.println(X.<@A @B(1) String[], @C(\'-\') X>foo(new String[]{\"SUCCESS\"}, null)[0]);\n" +
+ " ^\n" +
+ "A cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " System.out.println(X.<@A @B(1) String[], @C(\'-\') X>foo(new String[]{\"SUCCESS\"}, null)[0]);\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " System.out.println(X.<@A @B(1) String[], @C(\'-\') X>foo(new String[]{\"SUCCESS\"}, null)[0]);\n" +
+ " ^\n" +
+ "C cannot be resolved to a type\n" +
"----------\n");
}
public void test029() throws Exception {
@@ -628,11 +628,11 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"X.java",
"public class X extends @Marker2 Object {}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X extends @Marker2 Object {}\n" +
- " ^^^^^^^\n" +
- "Marker2 cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X extends @Marker2 Object {}\n" +
+ " ^^^^^^^\n" +
+ "Marker2 cannot be resolved to a type\n" +
"----------\n");
}
public void test030() throws Exception {
@@ -644,20 +644,20 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" private static final long serialVersionUID = 1L;\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public class X implements @Marker2 Serializable {\n" +
- " ^^^^^^^\n" +
- "Marker2 cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public class X implements @Marker2 Serializable {\n" +
+ " ^^^^^^^\n" +
+ "Marker2 cannot be resolved to a type\n" +
"----------\n");
}
public void test031() throws Exception {
this.runNegativeTest(
new String[] {
"Marker.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "@Target(TYPE)\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "@Target(TYPE)\n" +
"@interface Marker {}",
"X.java",
"public class X<@Marker T> {}",
@@ -677,11 +677,11 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" TYPE_USE\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<@Marker T> {}\n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X<@Marker T> {}\n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
"----------\n");
}
public void test032() throws Exception {
@@ -715,82 +715,82 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"X.java",
"import java.util.Map;\n" +
"import java.util.List;\n" +
- "public class X {\n" +
- " @H String @E[] @F[] @G[] field;\n" +
- " @A Map<@B String, @C List<@D Object>> field2;\n" +
- " @A Map<@B String, @H String @E[] @F[] @G[]> field3;\n" +
+ "public class X {\n" +
+ " @H String @E[] @F[] @G[] field;\n" +
+ " @A Map<@B String, @C List<@D Object>> field2;\n" +
+ " @A Map<@B String, @H String @E[] @F[] @G[]> field3;\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " @H String @E[] @F[] @G[] field;\n" +
- " ^\n" +
- "H cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " @H String @E[] @F[] @G[] field;\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " @H String @E[] @F[] @G[] field;\n" +
- " ^\n" +
- "F cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 4)\n" +
- " @H String @E[] @F[] @G[] field;\n" +
- " ^\n" +
- "G cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 5)\n" +
- " @A Map<@B String, @C List<@D Object>> field2;\n" +
- " ^\n" +
- "A cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 5)\n" +
- " @A Map<@B String, @C List<@D Object>> field2;\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 5)\n" +
- " @A Map<@B String, @C List<@D Object>> field2;\n" +
- " ^\n" +
- "C cannot be resolved to a type\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 5)\n" +
- " @A Map<@B String, @C List<@D Object>> field2;\n" +
- " ^\n" +
- "D cannot be resolved to a type\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 6)\n" +
- " @A Map<@B String, @H String @E[] @F[] @G[]> field3;\n" +
- " ^\n" +
- "A cannot be resolved to a type\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 6)\n" +
- " @A Map<@B String, @H String @E[] @F[] @G[]> field3;\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
- "----------\n" +
- "11. ERROR in X.java (at line 6)\n" +
- " @A Map<@B String, @H String @E[] @F[] @G[]> field3;\n" +
- " ^\n" +
- "H cannot be resolved to a type\n" +
- "----------\n" +
- "12. ERROR in X.java (at line 6)\n" +
- " @A Map<@B String, @H String @E[] @F[] @G[]> field3;\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "13. ERROR in X.java (at line 6)\n" +
- " @A Map<@B String, @H String @E[] @F[] @G[]> field3;\n" +
- " ^\n" +
- "F cannot be resolved to a type\n" +
- "----------\n" +
- "14. ERROR in X.java (at line 6)\n" +
- " @A Map<@B String, @H String @E[] @F[] @G[]> field3;\n" +
- " ^\n" +
- "G cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " @H String @E[] @F[] @G[] field;\n" +
+ " ^\n" +
+ "H cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " @H String @E[] @F[] @G[] field;\n" +
+ " ^\n" +
+ "E cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " @H String @E[] @F[] @G[] field;\n" +
+ " ^\n" +
+ "F cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 4)\n" +
+ " @H String @E[] @F[] @G[] field;\n" +
+ " ^\n" +
+ "G cannot be resolved to a type\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 5)\n" +
+ " @A Map<@B String, @C List<@D Object>> field2;\n" +
+ " ^\n" +
+ "A cannot be resolved to a type\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 5)\n" +
+ " @A Map<@B String, @C List<@D Object>> field2;\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 5)\n" +
+ " @A Map<@B String, @C List<@D Object>> field2;\n" +
+ " ^\n" +
+ "C cannot be resolved to a type\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 5)\n" +
+ " @A Map<@B String, @C List<@D Object>> field2;\n" +
+ " ^\n" +
+ "D cannot be resolved to a type\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 6)\n" +
+ " @A Map<@B String, @H String @E[] @F[] @G[]> field3;\n" +
+ " ^\n" +
+ "A cannot be resolved to a type\n" +
+ "----------\n" +
+ "10. ERROR in X.java (at line 6)\n" +
+ " @A Map<@B String, @H String @E[] @F[] @G[]> field3;\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "11. ERROR in X.java (at line 6)\n" +
+ " @A Map<@B String, @H String @E[] @F[] @G[]> field3;\n" +
+ " ^\n" +
+ "H cannot be resolved to a type\n" +
+ "----------\n" +
+ "12. ERROR in X.java (at line 6)\n" +
+ " @A Map<@B String, @H String @E[] @F[] @G[]> field3;\n" +
+ " ^\n" +
+ "E cannot be resolved to a type\n" +
+ "----------\n" +
+ "13. ERROR in X.java (at line 6)\n" +
+ " @A Map<@B String, @H String @E[] @F[] @G[]> field3;\n" +
+ " ^\n" +
+ "F cannot be resolved to a type\n" +
+ "----------\n" +
+ "14. ERROR in X.java (at line 6)\n" +
+ " @A Map<@B String, @H String @E[] @F[] @G[]> field3;\n" +
+ " ^\n" +
+ "G cannot be resolved to a type\n" +
"----------\n");
}
// check locations
@@ -800,30 +800,30 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"X.java",
"import java.util.Map;\n" +
"import java.util.List;\n" +
- "public class X {\n" +
- " @H java.lang.String @E[] @F[] @G[] field;\n" +
+ "public class X {\n" +
+ " @H java.lang.String @E[] @F[] @G[] field;\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " @H java.lang.String @E[] @F[] @G[] field;\n" +
- " ^\n" +
- "H cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " @H java.lang.String @E[] @F[] @G[] field;\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " @H java.lang.String @E[] @F[] @G[] field;\n" +
- " ^\n" +
- "F cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 4)\n" +
- " @H java.lang.String @E[] @F[] @G[] field;\n" +
- " ^\n" +
- "G cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " @H java.lang.String @E[] @F[] @G[] field;\n" +
+ " ^\n" +
+ "H cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " @H java.lang.String @E[] @F[] @G[] field;\n" +
+ " ^\n" +
+ "E cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " @H java.lang.String @E[] @F[] @G[] field;\n" +
+ " ^\n" +
+ "F cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 4)\n" +
+ " @H java.lang.String @E[] @F[] @G[] field;\n" +
+ " ^\n" +
+ "G cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383884 -- Compiler tolerates illegal dimension annotation in class literal expressions
@@ -844,36 +844,36 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"@interface NonEmpty {\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(int @NonEmpty [] [] @NonEmpty @Empty [] [] @NonEmpty[].class); // illegal!\n" +
- " ^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " System.out.println(int @NonEmpty [] [] @NonEmpty @Empty [] [] @NonEmpty[].class); // illegal!\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " System.out.println(int @NonEmpty [] [] @NonEmpty @Empty [] [] @NonEmpty[].class); // illegal!\n" +
- " ^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 4)\n" +
- " System.out.println(X @NonEmpty [] [] @NonEmpty @Empty [] [] @NonEmpty[].class); // illegal!\n" +
- " ^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 4)\n" +
- " System.out.println(X @NonEmpty [] [] @NonEmpty @Empty [] [] @NonEmpty[].class); // illegal!\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 4)\n" +
- " System.out.println(X @NonEmpty [] [] @NonEmpty @Empty [] [] @NonEmpty[].class); // illegal!\n" +
- " ^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(int @NonEmpty [] [] @NonEmpty @Empty [] [] @NonEmpty[].class); // illegal!\n" +
+ " ^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " System.out.println(int @NonEmpty [] [] @NonEmpty @Empty [] [] @NonEmpty[].class); // illegal!\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " System.out.println(int @NonEmpty [] [] @NonEmpty @Empty [] [] @NonEmpty[].class); // illegal!\n" +
+ " ^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 4)\n" +
+ " System.out.println(X @NonEmpty [] [] @NonEmpty @Empty [] [] @NonEmpty[].class); // illegal!\n" +
+ " ^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 4)\n" +
+ " System.out.println(X @NonEmpty [] [] @NonEmpty @Empty [] [] @NonEmpty[].class); // illegal!\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 4)\n" +
+ " System.out.println(X @NonEmpty [] [] @NonEmpty @Empty [] [] @NonEmpty[].class); // illegal!\n" +
+ " ^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
public void test037() {
@@ -897,23 +897,23 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
this.runNegativeTest(
new String[] {
"X.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "@Target({PACKAGE, TYPE, METHOD, FIELD, CONSTRUCTOR, PARAMETER, LOCAL_VARIABLE})\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "@Target({PACKAGE, TYPE, METHOD, FIELD, CONSTRUCTOR, PARAMETER, LOCAL_VARIABLE})\n" +
"@interface Marker {}\n" +
"public class X<@Marker T> extends @Marker Object{ // 3: Complain \n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " public class X<@Marker T> extends @Marker Object{ // 3: Complain \n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public class X<@Marker T> extends @Marker Object{ // 3: Complain \n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " public class X<@Marker T> extends @Marker Object{ // 3: Complain \n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " public class X<@Marker T> extends @Marker Object{ // 3: Complain \n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
"----------\n");
}
// JSR 308: "It is not permitted to annotate the type name in an import statement."
@@ -923,17 +923,17 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"X.java",
"import @Marker java.lang.String; // Compilation error \n" +
"public class X { \n" +
- "}\n" +
+ "}\n" +
"@interface Marker {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import @Marker java.lang.String; // Compilation error \n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " import @Marker java.lang.String; // Compilation error \n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
- // Test that type name can't be left out in a cast expression with an annotations
+ // Test that type name can't be left out in a cast expression with an annotations
public void test040() {
this.runNegativeTest(
new String[] {
@@ -942,18 +942,18 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" public void foo(Object myObject) {\n" +
" String myString = (@NonNull) myObject;" +
" }\n" +
- "}\n" +
+ "}\n" +
"@interface NonNull {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " String myString = (@NonNull) myObject; }\n" +
- " ^\n" +
- "Syntax error on token \"@\", delete this token\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " String myString = (@NonNull) myObject; }\n" +
+ " ^\n" +
+ "Syntax error on token \"@\", delete this token\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=385111
- // [1.8][compiler] Compiler fails to flag undefined annotation type.
+ // [1.8][compiler] Compiler fails to flag undefined annotation type.
public void test0385111() {
this.runNegativeTest(
new String[] {
@@ -967,20 +967,20 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " List<String> l = new @MissingTypeNotIgnored ArrayList<String>();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "MissingTypeNotIgnored cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " List<String> l1 = new @MissingTypeIgnored ArrayList<>();\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "MissingTypeIgnored cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " List<String> l = new @MissingTypeNotIgnored ArrayList<String>();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "MissingTypeNotIgnored cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " List<String> l1 = new @MissingTypeIgnored ArrayList<>();\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "MissingTypeIgnored cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=385111
- // Test to exercise assorted cleanup along with bug fix.
+ // Test to exercise assorted cleanup along with bug fix.
public void test0385111a() {
this.runNegativeTest(
new String[] {
@@ -993,36 +993,36 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " try (@Annot X x = null; @Annot X x2 = null) {\n" +
- " ^^^^^\n" +
- "Annot cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " try (@Annot X x = null; @Annot X x2 = null) {\n" +
- " ^\n" +
- "The resource type X does not implement java.lang.AutoCloseable\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " try (@Annot X x = null; @Annot X x2 = null) {\n" +
- " ^^^^^\n" +
- "Annot cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 3)\n" +
- " try (@Annot X x = null; @Annot X x2 = null) {\n" +
- " ^\n" +
- "The resource type X does not implement java.lang.AutoCloseable\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 4)\n" +
- " } catch (@Annot NullPointerException | @Annot UnsupportedOperationException e) {\n" +
- " ^^^^^\n" +
- "Annot cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 4)\n" +
- " } catch (@Annot NullPointerException | @Annot UnsupportedOperationException e) {\n" +
- " ^^^^^\n" +
- "Annot cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " try (@Annot X x = null; @Annot X x2 = null) {\n" +
+ " ^^^^^\n" +
+ "Annot cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " try (@Annot X x = null; @Annot X x2 = null) {\n" +
+ " ^\n" +
+ "The resource type X does not implement java.lang.AutoCloseable\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " try (@Annot X x = null; @Annot X x2 = null) {\n" +
+ " ^^^^^\n" +
+ "Annot cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 3)\n" +
+ " try (@Annot X x = null; @Annot X x2 = null) {\n" +
+ " ^\n" +
+ "The resource type X does not implement java.lang.AutoCloseable\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 4)\n" +
+ " } catch (@Annot NullPointerException | @Annot UnsupportedOperationException e) {\n" +
+ " ^^^^^\n" +
+ "Annot cannot be resolved to a type\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 4)\n" +
+ " } catch (@Annot NullPointerException | @Annot UnsupportedOperationException e) {\n" +
+ " ^^^^^\n" +
+ "Annot cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383913
@@ -1039,26 +1039,26 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public void foo(Object obj, X this) {}\n" +
- " ^^^^\n" +
- "Only the first formal parameter may be declared explicitly as 'this'\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " public void foo(Object obj1, X this, Object obj2) {}\n" +
- " ^^^^\n" +
- "Only the first formal parameter may be declared explicitly as 'this'\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " public void foo(Object obj, Object obj2, Object obj3, X this) {}\n" +
- " ^^^^\n" +
- "Only the first formal parameter may be declared explicitly as 'this'\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " Y(Object obj, Y Y.this){}\n" +
- " ^^^^\n" +
- "Only the first formal parameter may be declared explicitly as 'this'\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public void foo(Object obj, X this) {}\n" +
+ " ^^^^\n" +
+ "Only the first formal parameter may be declared explicitly as 'this'\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " public void foo(Object obj1, X this, Object obj2) {}\n" +
+ " ^^^^\n" +
+ "Only the first formal parameter may be declared explicitly as 'this'\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " public void foo(Object obj, Object obj2, Object obj3, X this) {}\n" +
+ " ^^^^\n" +
+ "Only the first formal parameter may be declared explicitly as 'this'\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " Y(Object obj, Y Y.this){}\n" +
+ " ^^^^\n" +
+ "Only the first formal parameter may be declared explicitly as 'this'\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383913
@@ -1081,76 +1081,76 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" }\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in Outer.java (at line 2)\n" +
- " Outer(Outer Outer.this) {}\n" +
- " ^^^^\n" +
- "Explicit 'this' parameter is allowed only in instance methods of non-anonymous classes and inner class constructors\n" +
- "----------\n" +
- "2. ERROR in Outer.java (at line 3)\n" +
- " Outer(Outer this, int i) {}\n" +
- " ^^^^\n" +
- "Explicit 'this' parameter is allowed only in instance methods of non-anonymous classes and inner class constructors\n" +
- "----------\n" +
- "3. WARNING in Outer.java (at line 6)\n" +
- " InnerMost(Outer.Inner this) {}\n" +
- " ^^^^^^^^^^^\n" +
- "Outer.Inner is a raw type. References to generic type Outer.Inner<K,V> should be parameterized\n" +
- "----------\n" +
- "4. ERROR in Outer.java (at line 6)\n" +
- " InnerMost(Outer.Inner this) {}\n" +
- " ^^^^^^^^^^^\n" +
- "The declared type of the explicit 'this' parameter is expected to be Outer.Inner<K,V>\n" +
- "----------\n" +
- "5. ERROR in Outer.java (at line 6)\n" +
- " InnerMost(Outer.Inner this) {}\n" +
- " ^^^^\n" +
- "The explicit 'this' parameter is expected to be qualified with Inner\n" +
- "----------\n" +
- "6. WARNING in Outer.java (at line 7)\n" +
- " InnerMost(Outer.Inner Outer.Inner.this, int i, float f) {}\n" +
- " ^^^^^^^^^^^\n" +
- "Outer.Inner is a raw type. References to generic type Outer.Inner<K,V> should be parameterized\n" +
- "----------\n" +
- "7. ERROR in Outer.java (at line 7)\n" +
- " InnerMost(Outer.Inner Outer.Inner.this, int i, float f) {}\n" +
- " ^^^^^^^^^^^\n" +
- "The declared type of the explicit 'this' parameter is expected to be Outer.Inner<K,V>\n" +
- "----------\n" +
- "8. ERROR in Outer.java (at line 7)\n" +
- " InnerMost(Outer.Inner Outer.Inner.this, int i, float f) {}\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The explicit 'this' parameter is expected to be qualified with Inner\n" +
- "----------\n" +
- "9. ERROR in Outer.java (at line 8)\n" +
- " InnerMost(Outer Outer.this, float f) {}\n" +
- " ^^^^^\n" +
- "The declared type of the explicit 'this' parameter is expected to be Outer.Inner<K,V>\n" +
- "----------\n" +
- "10. ERROR in Outer.java (at line 8)\n" +
- " InnerMost(Outer Outer.this, float f) {}\n" +
- " ^^^^^^^^^^\n" +
- "The explicit 'this' parameter is expected to be qualified with Inner\n" +
- "----------\n" +
- "11. ERROR in Outer.java (at line 9)\n" +
- " InnerMost(Outer.Inner<K,V>.InnerMost<T> Outer.Inner.InnerMost.this, Object obj) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The declared type of the explicit 'this' parameter is expected to be Outer.Inner<K,V>\n" +
- "----------\n" +
- "12. ERROR in Outer.java (at line 9)\n" +
- " InnerMost(Outer.Inner<K,V>.InnerMost<T> Outer.Inner.InnerMost.this, Object obj) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The explicit 'this' parameter is expected to be qualified with Inner\n" +
- "----------\n" +
- "13. ERROR in Outer.java (at line 10)\n" +
- " InnerMost(Inner<K,V> Outer.Inner.InnerMost.this, int i) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The explicit 'this' parameter is expected to be qualified with Inner\n" +
- "----------\n" +
- "14. ERROR in Outer.java (at line 11)\n" +
- " InnerMost(Outer.Inner<K, V> this, float f, int i) {}\n" +
- " ^^^^\n" +
- "The explicit 'this' parameter is expected to be qualified with Inner\n" +
+ "----------\n" +
+ "1. ERROR in Outer.java (at line 2)\n" +
+ " Outer(Outer Outer.this) {}\n" +
+ " ^^^^\n" +
+ "Explicit 'this' parameter is allowed only in instance methods of non-anonymous classes and inner class constructors\n" +
+ "----------\n" +
+ "2. ERROR in Outer.java (at line 3)\n" +
+ " Outer(Outer this, int i) {}\n" +
+ " ^^^^\n" +
+ "Explicit 'this' parameter is allowed only in instance methods of non-anonymous classes and inner class constructors\n" +
+ "----------\n" +
+ "3. WARNING in Outer.java (at line 6)\n" +
+ " InnerMost(Outer.Inner this) {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "Outer.Inner is a raw type. References to generic type Outer.Inner<K,V> should be parameterized\n" +
+ "----------\n" +
+ "4. ERROR in Outer.java (at line 6)\n" +
+ " InnerMost(Outer.Inner this) {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "The declared type of the explicit 'this' parameter is expected to be Outer.Inner<K,V>\n" +
+ "----------\n" +
+ "5. ERROR in Outer.java (at line 6)\n" +
+ " InnerMost(Outer.Inner this) {}\n" +
+ " ^^^^\n" +
+ "The explicit 'this' parameter is expected to be qualified with Inner\n" +
+ "----------\n" +
+ "6. WARNING in Outer.java (at line 7)\n" +
+ " InnerMost(Outer.Inner Outer.Inner.this, int i, float f) {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "Outer.Inner is a raw type. References to generic type Outer.Inner<K,V> should be parameterized\n" +
+ "----------\n" +
+ "7. ERROR in Outer.java (at line 7)\n" +
+ " InnerMost(Outer.Inner Outer.Inner.this, int i, float f) {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "The declared type of the explicit 'this' parameter is expected to be Outer.Inner<K,V>\n" +
+ "----------\n" +
+ "8. ERROR in Outer.java (at line 7)\n" +
+ " InnerMost(Outer.Inner Outer.Inner.this, int i, float f) {}\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The explicit 'this' parameter is expected to be qualified with Inner\n" +
+ "----------\n" +
+ "9. ERROR in Outer.java (at line 8)\n" +
+ " InnerMost(Outer Outer.this, float f) {}\n" +
+ " ^^^^^\n" +
+ "The declared type of the explicit 'this' parameter is expected to be Outer.Inner<K,V>\n" +
+ "----------\n" +
+ "10. ERROR in Outer.java (at line 8)\n" +
+ " InnerMost(Outer Outer.this, float f) {}\n" +
+ " ^^^^^^^^^^\n" +
+ "The explicit 'this' parameter is expected to be qualified with Inner\n" +
+ "----------\n" +
+ "11. ERROR in Outer.java (at line 9)\n" +
+ " InnerMost(Outer.Inner<K,V>.InnerMost<T> Outer.Inner.InnerMost.this, Object obj) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The declared type of the explicit 'this' parameter is expected to be Outer.Inner<K,V>\n" +
+ "----------\n" +
+ "12. ERROR in Outer.java (at line 9)\n" +
+ " InnerMost(Outer.Inner<K,V>.InnerMost<T> Outer.Inner.InnerMost.this, Object obj) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The explicit 'this' parameter is expected to be qualified with Inner\n" +
+ "----------\n" +
+ "13. ERROR in Outer.java (at line 10)\n" +
+ " InnerMost(Inner<K,V> Outer.Inner.InnerMost.this, int i) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The explicit 'this' parameter is expected to be qualified with Inner\n" +
+ "----------\n" +
+ "14. ERROR in Outer.java (at line 11)\n" +
+ " InnerMost(Outer.Inner<K, V> this, float f, int i) {}\n" +
+ " ^^^^\n" +
+ "The explicit 'this' parameter is expected to be qualified with Inner\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383913
@@ -1172,51 +1172,51 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" }\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in Outer.java (at line 4)\n" +
- " public void foo(Outer Outer.this) {}\n" +
- " ^^^^^\n" +
- "The declared type of the explicit 'this' parameter is expected to be Outer.Inner<K,V>.InnerMost<T>\n" +
- "----------\n" +
- "2. ERROR in Outer.java (at line 4)\n" +
- " public void foo(Outer Outer.this) {}\n" +
- " ^^^^^^^^^^\n" +
- "The explicit 'this' parameter for a method cannot have a qualifying name\n" +
- "----------\n" +
- "3. ERROR in Outer.java (at line 5)\n" +
- " public void foo(Inner<K,V> Inner.this, int i) {}\n" +
- " ^^^^^\n" +
- "The declared type of the explicit 'this' parameter is expected to be Outer.Inner<K,V>.InnerMost<T>\n" +
- "----------\n" +
- "4. ERROR in Outer.java (at line 5)\n" +
- " public void foo(Inner<K,V> Inner.this, int i) {}\n" +
- " ^^^^^^^^^^\n" +
- "The explicit 'this' parameter for a method cannot have a qualifying name\n" +
- "----------\n" +
- "5. WARNING in Outer.java (at line 6)\n" +
- " public void foo(InnerMost this, int i, int j) {}\n" +
- " ^^^^^^^^^\n" +
- "Outer.Inner.InnerMost is a raw type. References to generic type Outer.Inner<K,V>.InnerMost<T> should be parameterized\n" +
- "----------\n" +
- "6. ERROR in Outer.java (at line 6)\n" +
- " public void foo(InnerMost this, int i, int j) {}\n" +
- " ^^^^^^^^^\n" +
- "The declared type of the explicit 'this' parameter is expected to be Outer.Inner<K,V>.InnerMost<T>\n" +
- "----------\n" +
- "7. ERROR in Outer.java (at line 7)\n" +
- " public void foo(Inner.InnerMost<T> this, Object obj) {}\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The member type Outer.Inner.InnerMost<T> must be qualified with a parameterized type, since it is not static\n" +
- "----------\n" +
- "8. ERROR in Outer.java (at line 7)\n" +
- " public void foo(Inner.InnerMost<T> this, Object obj) {}\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The declared type of the explicit 'this' parameter is expected to be Outer.Inner<K,V>.InnerMost<T>\n" +
"----------\n" +
- "9. ERROR in Outer.java (at line 11)\n" +
- " public void foo(InnerMost<T> Outer.Inner.InnerMost.this, int i, float f) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The explicit 'this' parameter for a method cannot have a qualifying name\n" +
+ "1. ERROR in Outer.java (at line 4)\n" +
+ " public void foo(Outer Outer.this) {}\n" +
+ " ^^^^^\n" +
+ "The declared type of the explicit 'this' parameter is expected to be Outer.Inner<K,V>.InnerMost<T>\n" +
+ "----------\n" +
+ "2. ERROR in Outer.java (at line 4)\n" +
+ " public void foo(Outer Outer.this) {}\n" +
+ " ^^^^^^^^^^\n" +
+ "The explicit 'this' parameter for a method cannot have a qualifying name\n" +
+ "----------\n" +
+ "3. ERROR in Outer.java (at line 5)\n" +
+ " public void foo(Inner<K,V> Inner.this, int i) {}\n" +
+ " ^^^^^\n" +
+ "The declared type of the explicit 'this' parameter is expected to be Outer.Inner<K,V>.InnerMost<T>\n" +
+ "----------\n" +
+ "4. ERROR in Outer.java (at line 5)\n" +
+ " public void foo(Inner<K,V> Inner.this, int i) {}\n" +
+ " ^^^^^^^^^^\n" +
+ "The explicit 'this' parameter for a method cannot have a qualifying name\n" +
+ "----------\n" +
+ "5. WARNING in Outer.java (at line 6)\n" +
+ " public void foo(InnerMost this, int i, int j) {}\n" +
+ " ^^^^^^^^^\n" +
+ "Outer.Inner.InnerMost is a raw type. References to generic type Outer.Inner<K,V>.InnerMost<T> should be parameterized\n" +
+ "----------\n" +
+ "6. ERROR in Outer.java (at line 6)\n" +
+ " public void foo(InnerMost this, int i, int j) {}\n" +
+ " ^^^^^^^^^\n" +
+ "The declared type of the explicit 'this' parameter is expected to be Outer.Inner<K,V>.InnerMost<T>\n" +
+ "----------\n" +
+ "7. ERROR in Outer.java (at line 7)\n" +
+ " public void foo(Inner.InnerMost<T> this, Object obj) {}\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The member type Outer.Inner.InnerMost<T> must be qualified with a parameterized type, since it is not static\n" +
+ "----------\n" +
+ "8. ERROR in Outer.java (at line 7)\n" +
+ " public void foo(Inner.InnerMost<T> this, Object obj) {}\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The declared type of the explicit 'this' parameter is expected to be Outer.Inner<K,V>.InnerMost<T>\n" +
+ "----------\n" +
+ "9. ERROR in Outer.java (at line 11)\n" +
+ " public void foo(InnerMost<T> Outer.Inner.InnerMost.this, int i, float f) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The explicit 'this' parameter for a method cannot have a qualifying name\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383913
@@ -1224,8 +1224,8 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
this.runNegativeTest(
new String[] {
"Outer.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
"public class Outer {\n" +
" class Inner<K,V> {\n" +
" public Inner(@Missing Outer Outer.this) {}\n" +
@@ -1252,7 +1252,7 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"interface AnonymousInner {\n" +
" public void foobar(AnonymousInner this);\n" +
"}\n" +
- "@Target(TYPE_USE)\n" +
+ "@Target(TYPE_USE)\n" +
"@interface Marker {}",
"java/lang/annotation/ElementType.java",
@@ -1270,41 +1270,41 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" TYPE_USE\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Outer.java (at line 5)\n" +
- " public Inner(@Missing Outer Outer.this) {}\n" +
- " ^^^^^^^\n" +
- "Missing cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in Outer.java (at line 9)\n" +
- " public void foobar(AnonymousInner this) {}\n" +
- " ^^^^\n" +
- "Explicit \'this\' parameter is allowed only in instance methods of non-anonymous classes and inner class constructors\n" +
- "----------\n" +
- "3. ERROR in Outer.java (at line 15)\n" +
- " public int hashCode(Outer.Local this) { return 0; }\n" +
- " ^^^^^^^^^^^\n" +
- "Outer.Local cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in Outer.java (at line 21)\n" +
- " public StaticNested(@Marker Outer.StaticNested Outer.StaticNested.this) {}\n" +
- " ^^^^^^^\n" +
- "Type annotations are not allowed on type names used to access static members\n" +
- "----------\n" +
- "5. ERROR in Outer.java (at line 21)\n" +
- " public StaticNested(@Marker Outer.StaticNested Outer.StaticNested.this) {}\n" +
- " ^^^^\n" +
- "Explicit \'this\' parameter is allowed only in instance methods of non-anonymous classes and inner class constructors\n" +
- "----------\n" +
- "6. ERROR in Outer.java (at line 23)\n" +
- " public static void foo(@Marker Outer this) {}\n" +
- " ^^^^\n" +
- "Explicit \'this\' parameter is allowed only in instance methods of non-anonymous classes and inner class constructors\n" +
- "----------\n" +
- "7. ERROR in Outer.java (at line 24)\n" +
- " public void foo(@Missing Outer this, int i) {}\n" +
- " ^^^^^^^\n" +
- "Missing cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in Outer.java (at line 5)\n" +
+ " public Inner(@Missing Outer Outer.this) {}\n" +
+ " ^^^^^^^\n" +
+ "Missing cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in Outer.java (at line 9)\n" +
+ " public void foobar(AnonymousInner this) {}\n" +
+ " ^^^^\n" +
+ "Explicit \'this\' parameter is allowed only in instance methods of non-anonymous classes and inner class constructors\n" +
+ "----------\n" +
+ "3. ERROR in Outer.java (at line 15)\n" +
+ " public int hashCode(Outer.Local this) { return 0; }\n" +
+ " ^^^^^^^^^^^\n" +
+ "Outer.Local cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in Outer.java (at line 21)\n" +
+ " public StaticNested(@Marker Outer.StaticNested Outer.StaticNested.this) {}\n" +
+ " ^^^^^^^\n" +
+ "Type annotations are not allowed on type names used to access static members\n" +
+ "----------\n" +
+ "5. ERROR in Outer.java (at line 21)\n" +
+ " public StaticNested(@Marker Outer.StaticNested Outer.StaticNested.this) {}\n" +
+ " ^^^^\n" +
+ "Explicit \'this\' parameter is allowed only in instance methods of non-anonymous classes and inner class constructors\n" +
+ "----------\n" +
+ "6. ERROR in Outer.java (at line 23)\n" +
+ " public static void foo(@Marker Outer this) {}\n" +
+ " ^^^^\n" +
+ "Explicit \'this\' parameter is allowed only in instance methods of non-anonymous classes and inner class constructors\n" +
+ "----------\n" +
+ "7. ERROR in Outer.java (at line 24)\n" +
+ " public void foo(@Missing Outer this, int i) {}\n" +
+ " ^^^^^^^\n" +
+ "Missing cannot be resolved to a type\n" +
"----------\n");
}
public void test0383908() {
@@ -1319,17 +1319,17 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" public static void main(String[] args) {\n" +
" new Y().foo();\n" +
" }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void foo(X this) {}\n" +
- " ^^^^^^^^^^^\n" +
- "Duplicate method foo() in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " void foo() {}\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type X\n" +
+ "}"},
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " void foo(X this) {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " void foo() {}\n" +
+ " ^^^^^\n" +
+ "Duplicate method foo() in type X\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383596 -- reject annotations on nested package names.
@@ -1340,22 +1340,22 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"package p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
"public class X {\n" +
"}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " package p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " package p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 1)\n" +
- " package p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " package p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 1)\n" +
+ " package p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 1)\n" +
+ " package p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383596 -- reject annotations on nested package names.
@@ -1366,27 +1366,27 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"@Marker package p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
"public class X {\n" +
"}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " @Marker package p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
- " ^^^^^^^\n" +
- "Package annotations must be in file package-info.java\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " @Marker package p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 1)\n" +
- " @Marker package p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 1)\n" +
- " @Marker package p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " @Marker package p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
+ " ^^^^^^^\n" +
+ "Package annotations must be in file package-info.java\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 1)\n" +
+ " @Marker package p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 1)\n" +
+ " @Marker package p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 1)\n" +
+ " @Marker package p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383596 -- reject annotations on nested import names.
@@ -1397,27 +1397,27 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"import p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
"public class X {\n" +
"}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
- " ^\n" +
- "The import p cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " import p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 1)\n" +
- " import p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 1)\n" +
- " import p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " import p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
+ " ^\n" +
+ "The import p cannot be resolved\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 1)\n" +
+ " import p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 1)\n" +
+ " import p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 1)\n" +
+ " import p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z. z2;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383596 -- reject annotations on nested import names.
@@ -1428,27 +1428,27 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"import p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.*;\n" +
"public class X {\n" +
"}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.*;\n" +
- " ^\n" +
- "The import p cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " import p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.*;\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 1)\n" +
- " import p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.*;\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 1)\n" +
- " import p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.*;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " import p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.*;\n" +
+ " ^\n" +
+ "The import p cannot be resolved\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 1)\n" +
+ " import p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.*;\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 1)\n" +
+ " import p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.*;\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 1)\n" +
+ " import p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.*;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383596 -- reject annotations on nested static import names.
@@ -1459,27 +1459,27 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"import static p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.z2;\n" +
"public class X {\n" +
"}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import static p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.z2;\n" +
- " ^\n" +
- "The import p cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " import static p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.z2;\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 1)\n" +
- " import static p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.z2;\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 1)\n" +
- " import static p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.z2;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " import static p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.z2;\n" +
+ " ^\n" +
+ "The import p cannot be resolved\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 1)\n" +
+ " import static p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.z2;\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 1)\n" +
+ " import static p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.z2;\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 1)\n" +
+ " import static p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.z2;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383596 -- reject annotations on nested static import names.
@@ -1490,32 +1490,32 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"import static p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.*;\n" +
"public class X {\n" +
"}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import static p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.*;\n" +
- " ^\n" +
- "The import p cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " import static p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.*;\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 1)\n" +
- " import static p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.*;\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 1)\n" +
- " import static p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.*;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " import static p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.*;\n" +
+ " ^\n" +
+ "The import p cannot be resolved\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 1)\n" +
+ " import static p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.*;\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 1)\n" +
+ " import static p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.*;\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 1)\n" +
+ " import static p. @Marker q.x. @Marker @Marker y. @Marker @Marker @Marker z.*;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383596 -- reject annotations on Qualified name in explicit this.
// Much water has flown under the bridge. The grammar itself does not allow annotations in qualified name in explicit this.
- // We now use the production UnannotatableName instead of plain Name.
+ // We now use the production UnannotatableName instead of plain Name.
public void test043() throws Exception {
this.runNegativeTest(
new String[] {
@@ -1528,12 +1528,12 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" }\n" +
" }\n" +
"}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " Z(X. @Marker Y Y.this) {\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " Z(X. @Marker Y Y.this) {\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383596 -- reject annotations on Qualified name in explicit constructor call -- super form
@@ -1551,22 +1551,22 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" }\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " X.@Marker x. @Marker @Marker @Marker x.super();\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " X.@Marker x. @Marker @Marker @Marker x.super();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 7)\n" +
- " X.@Marker x. @Marker @Marker @Marker x.super();\n" +
- " ^\n" +
- "The static field X.x should be accessed in a static way\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " X.@Marker x. @Marker @Marker @Marker x.super();\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " X.@Marker x. @Marker @Marker @Marker x.super();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 7)\n" +
+ " X.@Marker x. @Marker @Marker @Marker x.super();\n" +
+ " ^\n" +
+ "The static field X.x should be accessed in a static way\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383596 -- reject annotations on Qualified name in explicit constructor call, super form with explicit type arguments
@@ -1584,27 +1584,27 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" }\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " X.@Marker x. @Marker @Marker @Marker x.<String>super();\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " X.@Marker x. @Marker @Marker @Marker x.<String>super();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 7)\n" +
- " X.@Marker x. @Marker @Marker @Marker x.<String>super();\n" +
- " ^\n" +
- "The static field X.x should be accessed in a static way\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 7)\n" +
- " X.@Marker x. @Marker @Marker @Marker x.<String>super();\n" +
- " ^^^^^^\n" +
- "Unused type arguments for the non generic constructor X.InnerBar() of type X.InnerBar; it should not be parameterized with arguments <String>\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " X.@Marker x. @Marker @Marker @Marker x.<String>super();\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " X.@Marker x. @Marker @Marker @Marker x.<String>super();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 7)\n" +
+ " X.@Marker x. @Marker @Marker @Marker x.<String>super();\n" +
+ " ^\n" +
+ "The static field X.x should be accessed in a static way\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 7)\n" +
+ " X.@Marker x. @Marker @Marker @Marker x.<String>super();\n" +
+ " ^^^^^^\n" +
+ "Unused type arguments for the non generic constructor X.InnerBar() of type X.InnerBar; it should not be parameterized with arguments <String>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383596 -- reject annotations on Qualified name in explicit constructor call - this form
@@ -1627,22 +1627,22 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" }\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " X. @Marker bar.this();\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Illegal enclosing instance specification for type X.Bar.SubInnerBar\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " X. @Marker bar.this();\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Cannot make a static reference to the non-static field X.bar\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " X. @Marker bar.this();\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " X. @Marker bar.this();\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Illegal enclosing instance specification for type X.Bar.SubInnerBar\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " X. @Marker bar.this();\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Cannot make a static reference to the non-static field X.bar\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " X. @Marker bar.this();\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383596 -- reject annotations on Qualified name in explicit constructor call, this form with explicit type arguments
@@ -1665,27 +1665,27 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" }\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " X.@Marker bar.<String>this();\n" +
- " ^^^^^^^^^^^^^\n" +
- "Illegal enclosing instance specification for type X.Bar.SubInnerBar\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " X.@Marker bar.<String>this();\n" +
- " ^^^^^^^^^^^^^\n" +
- "Cannot make a static reference to the non-static field X.bar\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " X.@Marker bar.<String>this();\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 11)\n" +
- " X.@Marker bar.<String>this();\n" +
- " ^^^^^^\n" +
- "Unused type arguments for the non generic constructor X.Bar.SubInnerBar() of type X.Bar.SubInnerBar; it should not be parameterized with arguments <String>\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " X.@Marker bar.<String>this();\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Illegal enclosing instance specification for type X.Bar.SubInnerBar\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " X.@Marker bar.<String>this();\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Cannot make a static reference to the non-static field X.bar\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " X.@Marker bar.<String>this();\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 11)\n" +
+ " X.@Marker bar.<String>this();\n" +
+ " ^^^^^^\n" +
+ "Unused type arguments for the non generic constructor X.Bar.SubInnerBar() of type X.Bar.SubInnerBar; it should not be parameterized with arguments <String>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383596 -- reject annotations on Qualified name in PrimaryNoNewArray
@@ -1699,12 +1699,12 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" System.out.println((x. @Marker bar));\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " System.out.println((x. @Marker bar));\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " System.out.println((x. @Marker bar));\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383596 -- reject annotations in qualified this.
@@ -1721,11 +1721,11 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" }\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " Object o = X.@Marker Y.this; \n" +
- " ^^^^^^^\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " Object o = X.@Marker Y.this; \n" +
+ " ^^^^^^^\n" +
"Syntax error, type annotations are illegal here\n" +
"----------\n");
}
@@ -1741,12 +1741,12 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" }\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " X. @Marker Y.super.hashCode();\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " X. @Marker Y.super.hashCode();\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383596 -- reject annotations in Name.class
@@ -1761,12 +1761,12 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" }\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " Class<?> c = X. @Marker @Illegal Y.class;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " Class<?> c = X. @Marker @Illegal Y.class;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383596 -- reject annotations in Name [].class.
@@ -1781,17 +1781,17 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" }\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " Class<?> c = X. @Marker @Another Y @YetMore [].class;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " Class<?> c = X. @Marker @Another Y @YetMore [].class;\n" +
- " ^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " Class<?> c = X. @Marker @Another Y @YetMore [].class;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " Class<?> c = X. @Marker @Another Y @YetMore [].class;\n" +
+ " ^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383596 -- reject annotations in binary expressions with qualified names.
@@ -1826,122 +1826,122 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" x = (X.@Marker fb ? 10 : 10);\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " x = (X.@Marker x * 10);\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " x = (X.@Marker x / 10);\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " x = (X.@Marker x % 10);\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " x = (X.@Marker x + 10);\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 9)\n" +
- " x = (X.@Marker x - 10);\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 10)\n" +
- " x = (X.@Marker x << 10);\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 11)\n" +
- " x = (X.@Marker x >> 10);\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 12)\n" +
- " x = (X.@Marker x >>> 10);\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 13)\n" +
- " b = (X.@Marker x < 10);\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 14)\n" +
- " b = (X.@Marker x > 10);\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "11. ERROR in X.java (at line 15)\n" +
- " b = (X.@Marker x <= 10);\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "12. ERROR in X.java (at line 16)\n" +
- " b = (X.@Marker x >= 10);\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "13. ERROR in X.java (at line 17)\n" +
- " b = (X.@Marker x instanceof Object);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Incompatible conditional operand types int and Object\n" +
- "----------\n" +
- "14. ERROR in X.java (at line 17)\n" +
- " b = (X.@Marker x instanceof Object);\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "15. ERROR in X.java (at line 18)\n" +
- " b = (X.@Marker x == 10);\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "16. ERROR in X.java (at line 19)\n" +
- " b = (X.@Marker x != 10);\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "17. ERROR in X.java (at line 20)\n" +
- " x = (X.@Marker x & 10);\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "18. ERROR in X.java (at line 21)\n" +
- " x = (X.@Marker x ^ 10);\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "19. ERROR in X.java (at line 22)\n" +
- " x = (X.@Marker x | 10);\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "20. ERROR in X.java (at line 23)\n" +
- " fb = (X.@Marker fb && true);\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "21. ERROR in X.java (at line 24)\n" +
- " fb = (X.@Marker fb || true);\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "22. ERROR in X.java (at line 25)\n" +
- " x = (X.@Marker fb ? 10 : 10);\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " x = (X.@Marker x * 10);\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " x = (X.@Marker x / 10);\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " x = (X.@Marker x % 10);\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " x = (X.@Marker x + 10);\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 9)\n" +
+ " x = (X.@Marker x - 10);\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 10)\n" +
+ " x = (X.@Marker x << 10);\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 11)\n" +
+ " x = (X.@Marker x >> 10);\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 12)\n" +
+ " x = (X.@Marker x >>> 10);\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 13)\n" +
+ " b = (X.@Marker x < 10);\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "10. ERROR in X.java (at line 14)\n" +
+ " b = (X.@Marker x > 10);\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "11. ERROR in X.java (at line 15)\n" +
+ " b = (X.@Marker x <= 10);\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "12. ERROR in X.java (at line 16)\n" +
+ " b = (X.@Marker x >= 10);\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "13. ERROR in X.java (at line 17)\n" +
+ " b = (X.@Marker x instanceof Object);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Incompatible conditional operand types int and Object\n" +
+ "----------\n" +
+ "14. ERROR in X.java (at line 17)\n" +
+ " b = (X.@Marker x instanceof Object);\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "15. ERROR in X.java (at line 18)\n" +
+ " b = (X.@Marker x == 10);\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "16. ERROR in X.java (at line 19)\n" +
+ " b = (X.@Marker x != 10);\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "17. ERROR in X.java (at line 20)\n" +
+ " x = (X.@Marker x & 10);\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "18. ERROR in X.java (at line 21)\n" +
+ " x = (X.@Marker x ^ 10);\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "19. ERROR in X.java (at line 22)\n" +
+ " x = (X.@Marker x | 10);\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "20. ERROR in X.java (at line 23)\n" +
+ " fb = (X.@Marker fb && true);\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "21. ERROR in X.java (at line 24)\n" +
+ " fb = (X.@Marker fb || true);\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "22. ERROR in X.java (at line 25)\n" +
+ " x = (X.@Marker fb ? 10 : 10);\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
/* https://bugs.eclipse.org/bugs/show_bug.cgi?id=383596 -- reject annotations in annotations with qualified names.
This test is disabled. Now the grammar itself forbids annotations in the said place by using the production
- AnnotationName ::= '@' UnannotatableName. We don't want to add tests that will be fragile and unstable due to
+ AnnotationName ::= '@' UnannotatableName. We don't want to add tests that will be fragile and unstable due to
syntax. If a construct is provably not parsed at the grammar level, that ought to be good enough.
*/
public void test054() throws Exception {
@@ -1958,12 +1958,12 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"public class X {\n" +
" final static String s = \"\";\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " @Annot(bar = X. @Marker s)\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " @Annot(bar = X. @Marker s)\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383596 -- reject annotations in qualified names that are postfix expressions.
@@ -1977,12 +1977,12 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" return X.@Marker x;\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " return X.@Marker x;\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " return X.@Marker x;\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383596 -- reject annotations in qualified names used in array access.
@@ -1996,12 +1996,12 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" return X.@Marker x[0];\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " return X.@Marker x[0];\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " return X.@Marker x[0];\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383596 -- reject annotations in qualified name with type arguments used in method invocation.
@@ -2015,17 +2015,17 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" return X.@Marker x.<String> foo();\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " return X.@Marker x.<String> foo();\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " return X.@Marker x.<String> foo();\n" +
- " ^^^^^^\n" +
- "Unused type arguments for the non generic method foo() of type X; it should not be parameterized with arguments <String>\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " return X.@Marker x.<String> foo();\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " return X.@Marker x.<String> foo();\n" +
+ " ^^^^^^\n" +
+ "Unused type arguments for the non generic method foo() of type X; it should not be parameterized with arguments <String>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383596 -- reject annotations in qualified name used in method invocation.
@@ -2039,17 +2039,17 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" return X.@Marker x. @Blah foo();\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " return X.@Marker x. @Blah foo();\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " return X.@Marker x. @Blah foo();\n" +
- " ^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " return X.@Marker x. @Blah foo();\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " return X.@Marker x. @Blah foo();\n" +
+ " ^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383596 -- reject annotations in qualified name used in class instance creation
@@ -2067,12 +2067,12 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" }\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " Z z = X. @Marker y.new Z();\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " Z z = X. @Marker y.new Z();\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383596 -- reject annotations in qualified name used in class instance creation
@@ -2086,12 +2086,12 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" return (X.@Marker x);\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " return (X.@Marker x);\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " return (X.@Marker x);\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
public void test062() throws Exception {
@@ -2106,7 +2106,7 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"}\n" +
"@interface Marker {\n" +
"}\n"
- },
+ },
"");
}
public void test063() throws Exception {
@@ -2118,12 +2118,12 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"}\n" +
"@interface Marker {\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Object o = @Marker int.class;\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " Object o = @Marker int.class;\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
public void test064() throws Exception {
@@ -2135,17 +2135,17 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"}\n" +
"@interface Marker {\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " <T> @Marker String foo();\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " <T> @Marker String foo();\n" +
- " ^^^^^\n" +
- "Annotation attributes cannot be generic\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " <T> @Marker String foo();\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " <T> @Marker String foo();\n" +
+ " ^^^^^\n" +
+ "Annotation attributes cannot be generic\n" +
"----------\n");
}
public void test065() throws Exception {
@@ -2158,7 +2158,7 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"}\n" +
"@interface Marker {\n" +
"}\n"
- },
+ },
"");
}
public void test066() throws Exception {
@@ -2170,13 +2170,13 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"}\n" +
"@interface Marker {\n" +
"}\n"
- },
+ },
// one error removed after https://bugs.openjdk.java.net/browse/JDK-8231435
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Object o = new X().new <String> @Marker X();\n" +
- " ^^^^^^^^^\n" +
- "X.X cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " Object o = new X().new <String> @Marker X();\n" +
+ " ^^^^^^^^^\n" +
+ "X.X cannot be resolved to a type\n" +
"----------\n");
}
public void test067() throws Exception {
@@ -2188,12 +2188,12 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"}\n" +
"@interface Marker {\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Object o = x.new <String> @Marker X() {};\n" +
- " ^\n" +
- "x cannot be resolved to a variable\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " Object o = x.new <String> @Marker X() {};\n" +
+ " ^\n" +
+ "x cannot be resolved to a variable\n" +
"----------\n");
}
public void test068() throws Exception {
@@ -2206,7 +2206,7 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"}\n" +
"@interface Marker {\n" +
"}\n"
- },
+ },
"");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=385293
@@ -2215,24 +2215,24 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
new String[] {
"X.java",
"class X<final T> {\n" +
- " Object o = (Object) (public X<final String>) null;\n" +
+ " Object o = (Object) (public X<final String>) null;\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " class X<final T> {\n" +
- " ^^^^^\n" +
- "Syntax error on token \"final\", delete this token\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " Object o = (Object) (public X<final String>) null;\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"public\", delete this token\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 2)\n" +
- " Object o = (Object) (public X<final String>) null;\n" +
- " ^^^^^\n" +
- "Syntax error on token \"final\", delete this token\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " class X<final T> {\n" +
+ " ^^^^^\n" +
+ "Syntax error on token \"final\", delete this token\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " Object o = (Object) (public X<final String>) null;\n" +
+ " ^^^^^^\n" +
+ "Syntax error on token \"public\", delete this token\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 2)\n" +
+ " Object o = (Object) (public X<final String>) null;\n" +
+ " ^^^^^\n" +
+ "Syntax error on token \"final\", delete this token\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=388085
@@ -2249,26 +2249,26 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"class Two<S> {}\n" +
"class Three<T> {}\n" +
"class Four<U, V> {}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " final One<@Marker ? extends Two<@Marker ? super Three<? extends Four<@Marker ? super String, @Marker ? extends Object>>>> one = null; one = null;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " final One<@Marker ? extends Two<@Marker ? super Three<? extends Four<@Marker ? super String, @Marker ? extends Object>>>> one = null; one = null;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " final One<@Marker ? extends Two<@Marker ? super Three<? extends Four<@Marker ? super String, @Marker ? extends Object>>>> one = null; one = null;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 3)\n" +
- " final One<@Marker ? extends Two<@Marker ? super Three<? extends Four<@Marker ? super String, @Marker ? extends Object>>>> one = null; one = null;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " final One<@Marker ? extends Two<@Marker ? super Three<? extends Four<@Marker ? super String, @Marker ? extends Object>>>> one = null; one = null;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " final One<@Marker ? extends Two<@Marker ? super Three<? extends Four<@Marker ? super String, @Marker ? extends Object>>>> one = null; one = null;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " final One<@Marker ? extends Two<@Marker ? super Three<? extends Four<@Marker ? super String, @Marker ? extends Object>>>> one = null; one = null;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 3)\n" +
+ " final One<@Marker ? extends Two<@Marker ? super Three<? extends Four<@Marker ? super String, @Marker ? extends Object>>>> one = null; one = null;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
"----------\n");
}
public void test0388085a() {
@@ -2286,11 +2286,11 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"class Four<U, V> {}\n" +
"@interface Marker {}"},
// some errors no longer raised since https://bugs.openjdk.java.net/browse/JDK-8231435
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " final One<@Marker ? extends Two<@Marker ? super Three<? extends Four<@Marker ? super String, @Marker ? extends Object>>>> one = null; one = null;\n" +
- " ^^^\n" +
- "The final local variable one cannot be assigned. It must be blank and not using a compound assignment\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " final One<@Marker ? extends Two<@Marker ? super Three<? extends Four<@Marker ? super String, @Marker ? extends Object>>>> one = null; one = null;\n" +
+ " ^^^\n" +
+ "The final local variable one cannot be assigned. It must be blank and not using a compound assignment\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=390882
@@ -2326,26 +2326,26 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" TYPE_USE\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " Object o1 = (@Marker java.lang.Integer) null; // 1. Right.\n" +
- " ^^^^^^^\n" +
- "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " Object o2 = (java. @Marker lang.Integer) null; // 2. Wrong.\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " public void foo(java. @Marker lang.Integer arg) {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " public void foobar(@Marker java.lang.Integer arg) {}\n" +
- " ^^^^^^^\n" +
- "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " Object o1 = (@Marker java.lang.Integer) null; // 1. Right.\n" +
+ " ^^^^^^^\n" +
+ "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " Object o2 = (java. @Marker lang.Integer) null; // 2. Wrong.\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " public void foo(java. @Marker lang.Integer arg) {}\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 9)\n" +
+ " public void foobar(@Marker java.lang.Integer arg) {}\n" +
+ " ^^^^^^^\n" +
+ "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
"----------\n");
}
public void test0390882a() {
@@ -2379,16 +2379,16 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" TYPE_USE\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " Object o1 = (java. @Marker @Annot lang.Integer) null; // 1. Wrong.\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " Object o3 = (java.@lang lang) null; // 3. Wrong.\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "java.lang cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " Object o1 = (java. @Marker @Annot lang.Integer) null; // 1. Wrong.\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " Object o3 = (java.@lang lang) null; // 3. Wrong.\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "java.lang cannot be resolved to a type\n" +
"----------\n");
}
public void test0390882b() {
@@ -2424,31 +2424,31 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" TYPE_USE\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " Object o1 = (@Marker @Annot java.util.List<String>) null; // 1. Wrong.\n" +
- " ^^^^^^^\n" +
- "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " Object o1 = (@Marker @Annot java.util.List<String>) null; // 1. Wrong.\n" +
- " ^^^^^^\n" +
- "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " Object o2 = (java. @Marker @Annot lang.Integer[]) null; // 2. Wrong.\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " Object o3 = (@Marker @Annot java.util.List<String>[]) null; // 3. Wrong.\n" +
- " ^^^^^^^\n" +
- "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 6)\n" +
- " Object o3 = (@Marker @Annot java.util.List<String>[]) null; // 3. Wrong.\n" +
- " ^^^^^^\n" +
- "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " Object o1 = (@Marker @Annot java.util.List<String>) null; // 1. Wrong.\n" +
+ " ^^^^^^^\n" +
+ "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " Object o1 = (@Marker @Annot java.util.List<String>) null; // 1. Wrong.\n" +
+ " ^^^^^^\n" +
+ "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " Object o2 = (java. @Marker @Annot lang.Integer[]) null; // 2. Wrong.\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " Object o3 = (@Marker @Annot java.util.List<String>[]) null; // 3. Wrong.\n" +
+ " ^^^^^^^\n" +
+ "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 6)\n" +
+ " Object o3 = (@Marker @Annot java.util.List<String>[]) null; // 3. Wrong.\n" +
+ " ^^^^^^\n" +
+ "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=385137
@@ -2456,8 +2456,8 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
this.runNegativeTest(
new String[]{ "A.java",
"package p;" +
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
"public class A<T> { \n" +
" static class B<T> {" +
" static class C<K, V> {" +
@@ -2468,9 +2468,9 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" Object o2 = (@Marker p.@Marker A.@Marker B.@Marker C) null;\n" +
" }\n" +
"}\n" +
- "@Target(TYPE_USE)\n" +
+ "@Target(TYPE_USE)\n" +
"@interface Marker {}\n" +
- "@Target(TYPE_USE)\n" +
+ "@Target(TYPE_USE)\n" +
"@interface Annot {}\n",
"java/lang/annotation/ElementType.java",
@@ -2487,49 +2487,49 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" TYPE_PARAMETER,\n" +
" TYPE_USE\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in A.java (at line 6)\n" +
- " Object o = (@Marker @Annot A.@Marker B.@Marker C) null;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Type annotations are not allowed on type names used to access static members\n" +
- "----------\n" +
- "2. WARNING in A.java (at line 6)\n" +
- " Object o = (@Marker @Annot A.@Marker B.@Marker C) null;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "A.B.C is a raw type. References to generic type A.B.C<K,V> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in A.java (at line 6)\n" +
- " Object o = (@Marker @Annot A.@Marker B.@Marker C) null;\n" +
- " ^^^^^^^\n" +
- "Type annotations are not allowed on type names used to access static members\n" +
- "----------\n" +
- "4. ERROR in A.java (at line 7)\n" +
- " Object o2 = (@Marker p.@Marker A.@Marker B.@Marker C) null;\n" +
- " ^^^^^^^\n" +
- "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
- "----------\n" +
- "5. WARNING in A.java (at line 7)\n" +
- " Object o2 = (@Marker p.@Marker A.@Marker B.@Marker C) null;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "A.B.C is a raw type. References to generic type A.B.C<K,V> should be parameterized\n" +
- "----------\n" +
- "6. ERROR in A.java (at line 7)\n" +
- " Object o2 = (@Marker p.@Marker A.@Marker B.@Marker C) null;\n" +
- " ^^^^^^^\n" +
- "Type annotations are not allowed on type names used to access static members\n" +
- "----------\n" +
- "7. ERROR in A.java (at line 7)\n" +
- " Object o2 = (@Marker p.@Marker A.@Marker B.@Marker C) null;\n" +
- " ^^^^^^^\n" +
- "Type annotations are not allowed on type names used to access static members\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 6)\n" +
+ " Object o = (@Marker @Annot A.@Marker B.@Marker C) null;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Type annotations are not allowed on type names used to access static members\n" +
+ "----------\n" +
+ "2. WARNING in A.java (at line 6)\n" +
+ " Object o = (@Marker @Annot A.@Marker B.@Marker C) null;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "A.B.C is a raw type. References to generic type A.B.C<K,V> should be parameterized\n" +
+ "----------\n" +
+ "3. ERROR in A.java (at line 6)\n" +
+ " Object o = (@Marker @Annot A.@Marker B.@Marker C) null;\n" +
+ " ^^^^^^^\n" +
+ "Type annotations are not allowed on type names used to access static members\n" +
+ "----------\n" +
+ "4. ERROR in A.java (at line 7)\n" +
+ " Object o2 = (@Marker p.@Marker A.@Marker B.@Marker C) null;\n" +
+ " ^^^^^^^\n" +
+ "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
+ "----------\n" +
+ "5. WARNING in A.java (at line 7)\n" +
+ " Object o2 = (@Marker p.@Marker A.@Marker B.@Marker C) null;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "A.B.C is a raw type. References to generic type A.B.C<K,V> should be parameterized\n" +
+ "----------\n" +
+ "6. ERROR in A.java (at line 7)\n" +
+ " Object o2 = (@Marker p.@Marker A.@Marker B.@Marker C) null;\n" +
+ " ^^^^^^^\n" +
+ "Type annotations are not allowed on type names used to access static members\n" +
+ "----------\n" +
+ "7. ERROR in A.java (at line 7)\n" +
+ " Object o2 = (@Marker p.@Marker A.@Marker B.@Marker C) null;\n" +
+ " ^^^^^^^\n" +
+ "Type annotations are not allowed on type names used to access static members\n" +
"----------\n");
}
public void test0385137a() {
this.runNegativeTest(
new String[]{"A.java",
"package p;" +
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
"public class A { \n" +
" static class B<T> {" +
" static class C<K, V> {" +
@@ -2541,9 +2541,9 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" Object o5 = (@Marker @Annot A.B<String>[]) null;\n" +
" }\n" +
"}\n" +
- "@Target(TYPE_USE)\n" +
+ "@Target(TYPE_USE)\n" +
"@interface Marker {}\n" +
- "@Target(TYPE_USE)\n" +
+ "@Target(TYPE_USE)\n" +
"@interface Annot {}\n",
"java/lang/annotation/ElementType.java",
@@ -2561,36 +2561,36 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" TYPE_USE\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in A.java (at line 6)\n" +
- " Object o1 = (@Marker p.@Marker A.@Marker B.@Marker C[]) null;\n" +
- " ^^^^^^^\n" +
- "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 6)\n" +
- " Object o1 = (@Marker p.@Marker A.@Marker B.@Marker C[]) null;\n" +
- " ^^^^^^^\n" +
- "Type annotations are not allowed on type names used to access static members\n" +
- "----------\n" +
- "3. ERROR in A.java (at line 6)\n" +
- " Object o1 = (@Marker p.@Marker A.@Marker B.@Marker C[]) null;\n" +
- " ^^^^^^^\n" +
- "Type annotations are not allowed on type names used to access static members\n" +
- "----------\n" +
- "4. ERROR in A.java (at line 7)\n" +
- " Object o2 = (@Marker @Annot A.@Annot B.C<Integer, String>) null;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Type annotations are not allowed on type names used to access static members\n" +
- "----------\n" +
- "5. ERROR in A.java (at line 7)\n" +
- " Object o2 = (@Marker @Annot A.@Annot B.C<Integer, String>) null;\n" +
- " ^^^^^^\n" +
- "Type annotations are not allowed on type names used to access static members\n" +
- "----------\n" +
- "6. ERROR in A.java (at line 8)\n" +
- " Object o5 = (@Marker @Annot A.B<String>[]) null;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Type annotations are not allowed on type names used to access static members\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 6)\n" +
+ " Object o1 = (@Marker p.@Marker A.@Marker B.@Marker C[]) null;\n" +
+ " ^^^^^^^\n" +
+ "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
+ "----------\n" +
+ "2. ERROR in A.java (at line 6)\n" +
+ " Object o1 = (@Marker p.@Marker A.@Marker B.@Marker C[]) null;\n" +
+ " ^^^^^^^\n" +
+ "Type annotations are not allowed on type names used to access static members\n" +
+ "----------\n" +
+ "3. ERROR in A.java (at line 6)\n" +
+ " Object o1 = (@Marker p.@Marker A.@Marker B.@Marker C[]) null;\n" +
+ " ^^^^^^^\n" +
+ "Type annotations are not allowed on type names used to access static members\n" +
+ "----------\n" +
+ "4. ERROR in A.java (at line 7)\n" +
+ " Object o2 = (@Marker @Annot A.@Annot B.C<Integer, String>) null;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Type annotations are not allowed on type names used to access static members\n" +
+ "----------\n" +
+ "5. ERROR in A.java (at line 7)\n" +
+ " Object o2 = (@Marker @Annot A.@Annot B.C<Integer, String>) null;\n" +
+ " ^^^^^^\n" +
+ "Type annotations are not allowed on type names used to access static members\n" +
+ "----------\n" +
+ "6. ERROR in A.java (at line 8)\n" +
+ " Object o5 = (@Marker @Annot A.B<String>[]) null;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Type annotations are not allowed on type names used to access static members\n" +
"----------\n");
}
public void testBug391196() {
@@ -2609,9 +2609,9 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" @Marker\n" +
" interface Inter {}\n" +
"@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
- "@interface Marker {}\n" +
+ "@interface Marker {}\n" +
"@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
- "@interface Marker2 {}\n" +
+ "@interface Marker2 {}\n" +
"}\n",
"java/lang/annotation/ElementType.java",
"package java.lang.annotation;\n" +
@@ -2628,11 +2628,11 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" TYPE_USE\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in p\\Bug391196.java (at line 6)\n" +
- " @Unresolved X() {}\n" +
- " ^^^^^^^^^^\n" +
- "Unresolved cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in p\\Bug391196.java (at line 6)\n" +
+ " @Unresolved X() {}\n" +
+ " ^^^^^^^^^^\n" +
+ "Unresolved cannot be resolved to a type\n" +
"----------\n");
}
public void testBug391315() {
@@ -2667,11 +2667,11 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" TYPE_USE\n" +
"}\n"},
// one error removed after https://bugs.openjdk.java.net/browse/JDK-8231435
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " X<@Marker ?> l;\n" +
- " ^^^^^^^\n" +
- "The annotation @Marker is disallowed for this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " X<@Marker ?> l;\n" +
+ " ^^^^^^^\n" +
+ "The annotation @Marker is disallowed for this location\n" +
"----------\n");
}
public void testBug391315a() {
@@ -2704,16 +2704,16 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" TYPE_PARAMETER,\n" +
" TYPE_USE\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " @Marker2 T t;\n" +
- " ^^^^^^^^\n" +
- "The annotation @Marker2 is disallowed for this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " T t2 = (@Marker2 T) null;\n" +
- " ^^^^^^^^\n" +
- "The annotation @Marker2 is disallowed for this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " @Marker2 T t;\n" +
+ " ^^^^^^^^\n" +
+ "The annotation @Marker2 is disallowed for this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " T t2 = (@Marker2 T) null;\n" +
+ " ^^^^^^^^\n" +
+ "The annotation @Marker2 is disallowed for this location\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=391500
@@ -2729,26 +2729,26 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" Z z3 = new @Marker Z(){};\n" +
" };\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " Z z1 = new @Marker X().new @Marker Y().new @Marker Z();\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " Z z1 = new @Marker X().new @Marker Y().new @Marker Z();\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " Z z1 = new @Marker X().new @Marker Y().new @Marker Z();\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " Z z3 = new @Marker Z(){};\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " Z z1 = new @Marker X().new @Marker Y().new @Marker Z();\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " Z z1 = new @Marker X().new @Marker Y().new @Marker Z();\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " Z z1 = new @Marker X().new @Marker Y().new @Marker Z();\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " Z z3 = new @Marker Z(){};\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
"----------\n");
}
public void testBug391464() {
@@ -2764,28 +2764,28 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" if (o == null) return;\n" +
" }" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Object o = (X @Marker []) null;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " o = (java.lang.String @Marker []) null;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " o = (X<String> @Marker []) null;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " o = (java.util.List<String> @Marker []) null;\n" +
- " ^^^^^^\n" +
- "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " Object o = (X @Marker []) null;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " o = (java.lang.String @Marker []) null;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " o = (X<String> @Marker []) null;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " o = (java.util.List<String> @Marker []) null;\n" +
+ " ^^^^^^\n" +
+ "Marker cannot be resolved to a type\n" +
"----------\n");
- }
+ }
public void testBug391464_2() {
this.runNegativeTest(
new String[]{
@@ -2799,7 +2799,7 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
"@interface M {\n" +
"}\n",
-
+
"java/lang/annotation/ElementType.java",
"package java.lang.annotation;\n" +
"public enum ElementType {\n" +
@@ -2815,11 +2815,11 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" TYPE_USE\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " @M X.@M Y.@Unreported Z z = null;\n" +
- " ^^^^^^^^^^\n" +
- "Unreported cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " @M X.@M Y.@Unreported Z z = null;\n" +
+ " ^^^^^^^^^^\n" +
+ "Unreported cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=391108
@@ -2852,16 +2852,16 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" TYPE_USE\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " @Marker @Marker2 @Marker3 public void foo() {}\n" +
- " ^^^^^^^\n" +
- "Type annotation is illegal for a method that returns void\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " @Marker @Marker2 @Marker3 void foo2() {}\n" +
- " ^^^^^^^\n" +
- "Type annotation is illegal for a method that returns void\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " @Marker @Marker2 @Marker3 public void foo() {}\n" +
+ " ^^^^^^^\n" +
+ "Type annotation is illegal for a method that returns void\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " @Marker @Marker2 @Marker3 void foo2() {}\n" +
+ " ^^^^^^^\n" +
+ "Type annotation is illegal for a method that returns void\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=392119
@@ -2883,11 +2883,11 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"@interface Marker8 {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n",
null,
true, // flush output
@@ -2896,14 +2896,14 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
false,
false);
String expectedOutput =
- " RuntimeInvisibleAnnotations: \n" +
- " #24 @Marker78(\n" +
- " )\n" +
- " #25 @Marker8(\n" +
- " )\n" +
- " #26 @Marker7(\n" +
- " )\n" +
- " Attribute: MissingTypes Length: 4\n" +
+ " RuntimeInvisibleAnnotations: \n" +
+ " #24 @Marker78(\n" +
+ " )\n" +
+ " #25 @Marker8(\n" +
+ " )\n" +
+ " #26 @Marker7(\n" +
+ " )\n" +
+ " Attribute: MissingTypes Length: 4\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -2929,11 +2929,11 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"@interface Marker8 {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n",
null,
true, // flush output
@@ -2942,14 +2942,14 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
false,
false);
String expectedOutput =
- " RuntimeInvisibleAnnotations: \n" +
- " #24 @Marker78(\n" +
- " )\n" +
- " #25 @Marker8(\n" +
- " )\n" +
- " #26 @Marker7(\n" +
- " )\n" +
- " Attribute: MissingTypes Length: 4\n" +
+ " RuntimeInvisibleAnnotations: \n" +
+ " #24 @Marker78(\n" +
+ " )\n" +
+ " #25 @Marker8(\n" +
+ " )\n" +
+ " #26 @Marker7(\n" +
+ " )\n" +
+ " Attribute: MissingTypes Length: 4\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -2975,11 +2975,11 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"@interface Marker8 {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n",
null,
true, // flush output
@@ -2988,12 +2988,12 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
false,
false);
String expectedOutput =
- " RuntimeVisibleAnnotations: \n" +
- " #24 @Marker78(\n" +
- " )\n" +
- " #25 @Marker8(\n" +
- " )\n" +
- " #26 @Marker7(\n" +
+ " RuntimeVisibleAnnotations: \n" +
+ " #24 @Marker78(\n" +
+ " )\n" +
+ " #25 @Marker8(\n" +
+ " )\n" +
+ " #26 @Marker7(\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -3029,17 +3029,17 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" TYPE_USE\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public void foo(@Marker @Marker2 X this) {}\n" +
- " ^^^^^^^^\n" +
- "The annotation @Marker2 is disallowed for this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " Y(@Marker @Marker2 X X.this) {}\n" +
- " ^^^^^^^^\n" +
- "The annotation @Marker2 is disallowed for this location\n" +
- "----------\n");
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " public void foo(@Marker @Marker2 X this) {}\n" +
+ " ^^^^^^^^\n" +
+ "The annotation @Marker2 is disallowed for this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " Y(@Marker @Marker2 X X.this) {}\n" +
+ " ^^^^^^^^\n" +
+ "The annotation @Marker2 is disallowed for this location\n" +
+ "----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399453
public void testBug399453() {
@@ -3057,7 +3057,7 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" return 2;\n" +
" }\n" +
" public static int bar2(int k) {\n" +
- " return k;\n" +
+ " return k;\n" +
" }\n" +
"}\n" +
"@Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
@@ -3065,17 +3065,17 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"@Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
"@interface Marker2 {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " int @Marker [][][] i = new @Marker2 int @Marker @Marker2 [2] @Marker @Marker2 [@Marker bar()] @Marker @Marker2 [];\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " int @Marker [][][] j = new @Marker2 int @Marker @Marker2 [2] @Marker @Marker2 [@Marker X.bar2(2)] @Marker @Marker2 [];\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n");
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " int @Marker [][][] i = new @Marker2 int @Marker @Marker2 [2] @Marker @Marker2 [@Marker bar()] @Marker @Marker2 [];\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " int @Marker [][][] j = new @Marker2 int @Marker @Marker2 [2] @Marker @Marker2 [@Marker X.bar2(2)] @Marker @Marker2 [];\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399453
public void testBug391894() {
@@ -3098,27 +3098,27 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"@Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
"@interface Marker2 {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " int @Marker [][][] i = new @Marker2 int @Marker @Marker2 [2] @Marker @Marker2 [@Marker bar()] ;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from int[][] to int[][][]\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " int @Marker [][][] i = new @Marker2 int @Marker @Marker2 [2] @Marker @Marker2 [@Marker bar()] ;\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " int @Marker [] j = new @Marker2 int @Marker @Marker2 [2] @Marker @Marker2 [@Marker bar()] ;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from int[][] to int[]\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " int @Marker [] j = new @Marker2 int @Marker @Marker2 [2] @Marker @Marker2 [@Marker bar()] ;\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n");
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " int @Marker [][][] i = new @Marker2 int @Marker @Marker2 [2] @Marker @Marker2 [@Marker bar()] ;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from int[][] to int[][][]\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " int @Marker [][][] i = new @Marker2 int @Marker @Marker2 [2] @Marker @Marker2 [@Marker bar()] ;\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " int @Marker [] j = new @Marker2 int @Marker @Marker2 [2] @Marker @Marker2 [@Marker bar()] ;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from int[][] to int[]\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " int @Marker [] j = new @Marker2 int @Marker @Marker2 [2] @Marker @Marker2 [@Marker bar()] ;\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=402618, [1.8][compiler] Compiler fails to resolve type annotations on method/constructor references
public void test402618() {
@@ -3136,27 +3136,27 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " I i = @Readonly List<@English String>::<@NonNegative Integer>size;\n" +
- " ^^^^^^^^\n" +
- "Readonly cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " I i = @Readonly List<@English String>::<@NonNegative Integer>size;\n" +
- " ^^^^^^^\n" +
- "English cannot be resolved to a type\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 8)\n" +
- " I i = @Readonly List<@English String>::<@NonNegative Integer>size;\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Unused type arguments for the non generic method size() of type List<String>; it should not be parameterized with arguments <Integer>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " I i = @Readonly List<@English String>::<@NonNegative Integer>size;\n" +
- " ^^^^^^^^^^^\n" +
- "NonNegative cannot be resolved to a type\n" +
- "----------\n");
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " I i = @Readonly List<@English String>::<@NonNegative Integer>size;\n" +
+ " ^^^^^^^^\n" +
+ "Readonly cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " I i = @Readonly List<@English String>::<@NonNegative Integer>size;\n" +
+ " ^^^^^^^\n" +
+ "English cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 8)\n" +
+ " I i = @Readonly List<@English String>::<@NonNegative Integer>size;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unused type arguments for the non generic method size() of type List<String>; it should not be parameterized with arguments <Integer>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " I i = @Readonly List<@English String>::<@NonNegative Integer>size;\n" +
+ " ^^^^^^^^^^^\n" +
+ "NonNegative cannot be resolved to a type\n" +
+ "----------\n");
}
public void testBug403132() {
this.runNegativeTest(
@@ -3170,32 +3170,32 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" }\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public Z (@A X.@B Y Y.this, String str) {}\n" +
- " ^\n" +
- "A cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " public Z (@A X.@B Y Y.this, String str) {}\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " public void foo (@A X.@B Y.@C Z this, String str) {}\n" +
- " ^\n" +
- "A cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " public void foo (@A X.@B Y.@C Z this, String str) {}\n" +
- " ^\n" +
- "B cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 5)\n" +
- " public void foo (@A X.@B Y.@C Z this, String str) {}\n" +
- " ^\n" +
- "C cannot be resolved to a type\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " public Z (@A X.@B Y Y.this, String str) {}\n" +
+ " ^\n" +
+ "A cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " public Z (@A X.@B Y Y.this, String str) {}\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " public void foo (@A X.@B Y.@C Z this, String str) {}\n" +
+ " ^\n" +
+ "A cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " public void foo (@A X.@B Y.@C Z this, String str) {}\n" +
+ " ^\n" +
+ "B cannot be resolved to a type\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 5)\n" +
+ " public void foo (@A X.@B Y.@C Z this, String str) {}\n" +
+ " ^\n" +
+ "C cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=403410
@@ -3214,26 +3214,26 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" public void foo(final @A Y this) {}\n" +
" public void foo(static @A Y this, int i) {}\n" +
"}\n}"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " public Y (final @A X X.this) {}\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, modifiers are not allowed here\n" +
"----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " public Y (static @A X X.this, int i) {}\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, modifiers are not allowed here\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " public void foo(final @A Y this) {}\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Syntax error, modifiers are not allowed here\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " public void foo(static @A Y this, int i) {}\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, modifiers are not allowed here\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " public Y (final @A X X.this) {}\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, modifiers are not allowed here\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " public Y (static @A X X.this, int i) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, modifiers are not allowed here\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 9)\n" +
+ " public void foo(final @A Y this) {}\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Syntax error, modifiers are not allowed here\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 10)\n" +
+ " public void foo(static @A Y this, int i) {}\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Syntax error, modifiers are not allowed here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=403581, [1.8][compiler] Compile error on varargs annotations.
@@ -3249,11 +3249,11 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"@interface Marker {\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " void foo(List<String> @Marker ... ls) {}\n" +
- " ^^\n" +
- "Type safety: Potential heap pollution via varargs parameter ls\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " void foo(List<String> @Marker ... ls) {}\n" +
+ " ^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter ls\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=392671, [1.8][recovery] NPE with a method with explicit this and a following incomplete parameter
@@ -3265,21 +3265,21 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" public void foobar(X this, int, int k) {} // NPE!\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " class X {\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " public void foobar(X this, int, int k) {} // NPE!\n" +
- " ^^^\n" +
- "Syntax error, insert \"... VariableDeclaratorId\" to complete FormalParameter\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " class X {\n" +
+ " ^\n" +
+ "Syntax error, insert \"}\" to complete ClassBody\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " public void foobar(X this, int, int k) {} // NPE!\n" +
+ " ^^^\n" +
+ "Syntax error, insert \"... VariableDeclaratorId\" to complete FormalParameter\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " }\n" +
+ " ^\n" +
+ "Syntax error on token \"}\", delete this token\n" +
"----------\n");
}
// [1.8][compiler] Missing expected error for incorrect placement of type annotation (https://bugs.eclipse.org/bugs/show_bug.cgi?id=406587)
@@ -3313,61 +3313,61 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" int value() default -1;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in p\\X.java (at line 6)\n" +
- " @A @B p.X.Y field4;\n" +
- " ^^\n" +
- "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
- "----------\n" +
- "2. ERROR in p\\X.java (at line 7)\n" +
- " @B(1) @A(1) java.lang.@A(1) @B(1) String field2;\n" +
- " ^^\n" +
- "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
- "----------\n" +
- "3. ERROR in p\\X.java (at line 7)\n" +
- " @B(1) @A(1) java.lang.@A(1) @B(1) String field2;\n" +
- " ^^\n" +
- "The annotation @A is disallowed for this location\n" +
- "----------\n" +
- "4. ERROR in p\\X.java (at line 8)\n" +
- " public @B(1) @A(1) java.lang. @A(1) @B(1) String foo(@A(1) @B(1) java.lang. @A(1) @B(1) String str1) {\n" +
- " ^^\n" +
- "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
- "----------\n" +
- "5. ERROR in p\\X.java (at line 8)\n" +
- " public @B(1) @A(1) java.lang. @A(1) @B(1) String foo(@A(1) @B(1) java.lang. @A(1) @B(1) String str1) {\n" +
- " ^^\n" +
- "The annotation @A is disallowed for this location\n" +
- "----------\n" +
- "6. ERROR in p\\X.java (at line 8)\n" +
- " public @B(1) @A(1) java.lang. @A(1) @B(1) String foo(@A(1) @B(1) java.lang. @A(1) @B(1) String str1) {\n" +
- " ^^\n" +
- "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
- "----------\n" +
- "7. ERROR in p\\X.java (at line 8)\n" +
- " public @B(1) @A(1) java.lang. @A(1) @B(1) String foo(@A(1) @B(1) java.lang. @A(1) @B(1) String str1) {\n" +
- " ^^\n" +
- "The annotation @A is disallowed for this location\n" +
- "----------\n" +
- "8. ERROR in p\\X.java (at line 10)\n" +
- " @A(1) @B(1) java.lang. @B(1) @A(1) String local2;\n" +
- " ^^\n" +
- "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
- "----------\n" +
- "9. ERROR in p\\X.java (at line 10)\n" +
- " @A(1) @B(1) java.lang. @B(1) @A(1) String local2;\n" +
- " ^^\n" +
- "The annotation @A is disallowed for this location\n" +
- "----------\n" +
- "10. ERROR in p\\X.java (at line 12)\n" +
- " @B @A p.X.Y local4;\n" +
- " ^^\n" +
- "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
- "----------\n" +
- "11. ERROR in p\\X.java (at line 13)\n" +
- " @B @A p.q.X local5;\n" +
- " ^^^\n" +
- "p.q cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in p\\X.java (at line 6)\n" +
+ " @A @B p.X.Y field4;\n" +
+ " ^^\n" +
+ "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
+ "----------\n" +
+ "2. ERROR in p\\X.java (at line 7)\n" +
+ " @B(1) @A(1) java.lang.@A(1) @B(1) String field2;\n" +
+ " ^^\n" +
+ "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
+ "----------\n" +
+ "3. ERROR in p\\X.java (at line 7)\n" +
+ " @B(1) @A(1) java.lang.@A(1) @B(1) String field2;\n" +
+ " ^^\n" +
+ "The annotation @A is disallowed for this location\n" +
+ "----------\n" +
+ "4. ERROR in p\\X.java (at line 8)\n" +
+ " public @B(1) @A(1) java.lang. @A(1) @B(1) String foo(@A(1) @B(1) java.lang. @A(1) @B(1) String str1) {\n" +
+ " ^^\n" +
+ "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
+ "----------\n" +
+ "5. ERROR in p\\X.java (at line 8)\n" +
+ " public @B(1) @A(1) java.lang. @A(1) @B(1) String foo(@A(1) @B(1) java.lang. @A(1) @B(1) String str1) {\n" +
+ " ^^\n" +
+ "The annotation @A is disallowed for this location\n" +
+ "----------\n" +
+ "6. ERROR in p\\X.java (at line 8)\n" +
+ " public @B(1) @A(1) java.lang. @A(1) @B(1) String foo(@A(1) @B(1) java.lang. @A(1) @B(1) String str1) {\n" +
+ " ^^\n" +
+ "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
+ "----------\n" +
+ "7. ERROR in p\\X.java (at line 8)\n" +
+ " public @B(1) @A(1) java.lang. @A(1) @B(1) String foo(@A(1) @B(1) java.lang. @A(1) @B(1) String str1) {\n" +
+ " ^^\n" +
+ "The annotation @A is disallowed for this location\n" +
+ "----------\n" +
+ "8. ERROR in p\\X.java (at line 10)\n" +
+ " @A(1) @B(1) java.lang. @B(1) @A(1) String local2;\n" +
+ " ^^\n" +
+ "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
+ "----------\n" +
+ "9. ERROR in p\\X.java (at line 10)\n" +
+ " @A(1) @B(1) java.lang. @B(1) @A(1) String local2;\n" +
+ " ^^\n" +
+ "The annotation @A is disallowed for this location\n" +
+ "----------\n" +
+ "10. ERROR in p\\X.java (at line 12)\n" +
+ " @B @A p.X.Y local4;\n" +
+ " ^^\n" +
+ "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
+ "----------\n" +
+ "11. ERROR in p\\X.java (at line 13)\n" +
+ " @B @A p.q.X local5;\n" +
+ " ^^^\n" +
+ "p.q cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=417076, Eclipse compiler rejects multiple annotations for varargs.
@@ -3392,11 +3392,11 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " public @A String foo(int @B @C @D ... args) {\n" +
- " ^\n" +
- "D cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " public @A String foo(int @B @C @D ... args) {\n" +
+ " ^\n" +
+ "D cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=417076, Eclipse compiler rejects multiple annotations for varargs.
@@ -3423,11 +3423,11 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 16)\n" +
- " public @A String goo(int @B @C @A ... args) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "This method must return a result of type String\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 16)\n" +
+ " public @A String goo(int @B @C @A ... args) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "This method must return a result of type String\n" +
"----------\n");
}
// [1.8][compiler] Illegal type annotations not rejected (https://bugs.eclipse.org/bugs/show_bug.cgi?id=415308)
@@ -3840,121 +3840,121 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"class UnmodifiableList<T> implements\n" +
"@Readonly List<@Readonly T> { }\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " class UnmodifiableList<T> implements\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.addAll(int, Collection<? extends T>)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " class UnmodifiableList<T> implements\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.addAll(Collection<? extends T>)\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " class UnmodifiableList<T> implements\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.lastIndexOf(Object)\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " class UnmodifiableList<T> implements\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.subList(int, int)\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " class UnmodifiableList<T> implements\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.contains(Object)\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 7)\n" +
- " class UnmodifiableList<T> implements\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.get(int)\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 7)\n" +
- " class UnmodifiableList<T> implements\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.retainAll(Collection<?>)\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 7)\n" +
- " class UnmodifiableList<T> implements\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.clear()\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 7)\n" +
- " class UnmodifiableList<T> implements\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.indexOf(Object)\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 7)\n" +
- " class UnmodifiableList<T> implements\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.toArray(T[])\n" +
- "----------\n" +
- "11. ERROR in X.java (at line 7)\n" +
- " class UnmodifiableList<T> implements\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.toArray()\n" +
- "----------\n" +
- "12. ERROR in X.java (at line 7)\n" +
- " class UnmodifiableList<T> implements\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.isEmpty()\n" +
- "----------\n" +
- "13. ERROR in X.java (at line 7)\n" +
- " class UnmodifiableList<T> implements\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.listIterator(int)\n" +
- "----------\n" +
- "14. ERROR in X.java (at line 7)\n" +
- " class UnmodifiableList<T> implements\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.listIterator()\n" +
- "----------\n" +
- "15. ERROR in X.java (at line 7)\n" +
- " class UnmodifiableList<T> implements\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.add(int, T)\n" +
- "----------\n" +
- "16. ERROR in X.java (at line 7)\n" +
- " class UnmodifiableList<T> implements\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.add(T)\n" +
- "----------\n" +
- "17. ERROR in X.java (at line 7)\n" +
- " class UnmodifiableList<T> implements\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.set(int, T)\n" +
- "----------\n" +
- "18. ERROR in X.java (at line 7)\n" +
- " class UnmodifiableList<T> implements\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.size()\n" +
- "----------\n" +
- "19. ERROR in X.java (at line 7)\n" +
- " class UnmodifiableList<T> implements\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.containsAll(Collection<?>)\n" +
- "----------\n" +
- "20. ERROR in X.java (at line 7)\n" +
- " class UnmodifiableList<T> implements\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.remove(int)\n" +
- "----------\n" +
- "21. ERROR in X.java (at line 7)\n" +
- " class UnmodifiableList<T> implements\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.remove(Object)\n" +
- "----------\n" +
- "22. ERROR in X.java (at line 7)\n" +
- " class UnmodifiableList<T> implements\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.removeAll(Collection<?>)\n" +
- "----------\n" +
- "23. ERROR in X.java (at line 7)\n" +
- " class UnmodifiableList<T> implements\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.iterator()\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " class UnmodifiableList<T> implements\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.addAll(int, Collection<? extends T>)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " class UnmodifiableList<T> implements\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.addAll(Collection<? extends T>)\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " class UnmodifiableList<T> implements\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.lastIndexOf(Object)\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " class UnmodifiableList<T> implements\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.subList(int, int)\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 7)\n" +
+ " class UnmodifiableList<T> implements\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.contains(Object)\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 7)\n" +
+ " class UnmodifiableList<T> implements\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.get(int)\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 7)\n" +
+ " class UnmodifiableList<T> implements\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.retainAll(Collection<?>)\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 7)\n" +
+ " class UnmodifiableList<T> implements\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.clear()\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 7)\n" +
+ " class UnmodifiableList<T> implements\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.indexOf(Object)\n" +
+ "----------\n" +
+ "10. ERROR in X.java (at line 7)\n" +
+ " class UnmodifiableList<T> implements\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.toArray(T[])\n" +
+ "----------\n" +
+ "11. ERROR in X.java (at line 7)\n" +
+ " class UnmodifiableList<T> implements\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.toArray()\n" +
+ "----------\n" +
+ "12. ERROR in X.java (at line 7)\n" +
+ " class UnmodifiableList<T> implements\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.isEmpty()\n" +
+ "----------\n" +
+ "13. ERROR in X.java (at line 7)\n" +
+ " class UnmodifiableList<T> implements\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.listIterator(int)\n" +
+ "----------\n" +
+ "14. ERROR in X.java (at line 7)\n" +
+ " class UnmodifiableList<T> implements\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.listIterator()\n" +
+ "----------\n" +
+ "15. ERROR in X.java (at line 7)\n" +
+ " class UnmodifiableList<T> implements\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.add(int, T)\n" +
+ "----------\n" +
+ "16. ERROR in X.java (at line 7)\n" +
+ " class UnmodifiableList<T> implements\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.add(T)\n" +
+ "----------\n" +
+ "17. ERROR in X.java (at line 7)\n" +
+ " class UnmodifiableList<T> implements\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.set(int, T)\n" +
+ "----------\n" +
+ "18. ERROR in X.java (at line 7)\n" +
+ " class UnmodifiableList<T> implements\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.size()\n" +
+ "----------\n" +
+ "19. ERROR in X.java (at line 7)\n" +
+ " class UnmodifiableList<T> implements\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.containsAll(Collection<?>)\n" +
+ "----------\n" +
+ "20. ERROR in X.java (at line 7)\n" +
+ " class UnmodifiableList<T> implements\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.remove(int)\n" +
+ "----------\n" +
+ "21. ERROR in X.java (at line 7)\n" +
+ " class UnmodifiableList<T> implements\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.remove(Object)\n" +
+ "----------\n" +
+ "22. ERROR in X.java (at line 7)\n" +
+ " class UnmodifiableList<T> implements\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.removeAll(Collection<?>)\n" +
+ "----------\n" +
+ "23. ERROR in X.java (at line 7)\n" +
+ " class UnmodifiableList<T> implements\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type UnmodifiableList<T> must implement the inherited abstract method List<T>.iterator()\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=418041, NPE during AST creation.
@@ -3967,16 +3967,16 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X <@Marker T extends @Marker Y<@Marker ?>, @Marker Q extends @Marker Integer> {\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X <@Marker T extends @Marker Y<@Marker ?>, @Marker Q extends @Marker Integer> {\n" +
" ^\n" +
- "Y cannot be resolved to a type\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 1)\n" +
- " public class X <@Marker T extends @Marker Y<@Marker ?>, @Marker Q extends @Marker Integer> {\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The type parameter Q should not be bounded by the final type Integer. Final types cannot be further extended\n" +
+ "Y cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 1)\n" +
+ " public class X <@Marker T extends @Marker Y<@Marker ?>, @Marker Q extends @Marker Integer> {\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The type parameter Q should not be bounded by the final type Integer. Final types cannot be further extended\n" +
"----------\n");
}
public void testWildcardCapture() {
@@ -4008,23 +4008,23 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" p1.add(p2.get(0));\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 18)\n" +
- " lx1.add(lx2.get(0));\n" +
- " ^^^\n" +
- "The method add(capture#3-of ? extends X) in the type List<capture#3-of ? extends X> is not applicable for the arguments (capture#4-of ? extends X)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 19)\n" +
- " lx1.add(lx1.get(0));\n" +
- " ^^^\n" +
- "The method add(capture#5-of ? extends X) in the type List<capture#5-of ? extends X> is not applicable for the arguments (capture#6-of ? extends X)\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 20)\n" +
- " getAdd(lx1, lx2);\n" +
- " ^^^^^^\n" +
- "The method getAdd(List<P>, List<P>) in the type X is not applicable for the arguments (List<capture#7-of ? extends X>, List<capture#8-of ? extends X>)\n" +
- "----------\n");
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 18)\n" +
+ " lx1.add(lx2.get(0));\n" +
+ " ^^^\n" +
+ "The method add(capture#3-of ? extends X) in the type List<capture#3-of ? extends X> is not applicable for the arguments (capture#4-of ? extends X)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 19)\n" +
+ " lx1.add(lx1.get(0));\n" +
+ " ^^^\n" +
+ "The method add(capture#5-of ? extends X) in the type List<capture#5-of ? extends X> is not applicable for the arguments (capture#6-of ? extends X)\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 20)\n" +
+ " getAdd(lx1, lx2);\n" +
+ " ^^^^^^\n" +
+ "The method getAdd(List<P>, List<P>) in the type X is not applicable for the arguments (List<capture#7-of ? extends X>, List<capture#8-of ? extends X>)\n" +
+ "----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=414038, [1.8][compiler] CCE in resolveAnnotations
public void testBug414038() {
@@ -4037,14 +4037,14 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
"public class X extends @NonNull() Object { \n" +
" public static int i = 0; \n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " @interface NonNull { int[].class value() default 0;}\n" +
- " ^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n");
- }
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " @interface NonNull { int[].class value() default 0;}\n" +
+ " ^^^^^^\n" +
+ "Syntax error on tokens, delete these tokens\n" +
+ "----------\n");
+ }
public void testGenericConstructor() {
runNegativeTest(
new String[] {
@@ -4062,13 +4062,13 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" @T <P> X(X x) {\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " <P> @T X() {\n" +
- " ^\n" +
- "Syntax error on token \"@\", delete this token\n" +
- "----------\n");
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " <P> @T X() {\n" +
+ " ^\n" +
+ "Syntax error on token \"@\", delete this token\n" +
+ "----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=419833, [1.8] NPE in CompilationUnitProblemFinder and ASTNode
public void test419833() {
@@ -4089,15 +4089,15 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" return 0;\n" +
" } \n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " public class X extends @T S implements @T {\n" +
- " ^\n" +
- "Syntax error on token \"@\", delete this token\n" +
- "----------\n");
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=420038, [1.8][compiler] Tolerate type annotations on array dimensions of class literals for now for compatibility.
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " public class X extends @T S implements @T {\n" +
+ " ^\n" +
+ "Syntax error on token \"@\", delete this token\n" +
+ "----------\n");
+ }
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=420038, [1.8][compiler] Tolerate type annotations on array dimensions of class literals for now for compatibility.
public void test420038() {
runNegativeTest(
new String[] {
@@ -4112,15 +4112,15 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" Class<?> c = int @T [].class; \n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " Class<?> c = int @T [].class; \n" +
- " ^^\n" +
- "Syntax error, type annotations are illegal here\n" +
- "----------\n");
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=420284, [1.8][compiler] IllegalStateException from TypeSystem.cacheDerivedType
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " Class<?> c = int @T [].class; \n" +
+ " ^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
+ "----------\n");
+ }
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=420284, [1.8][compiler] IllegalStateException from TypeSystem.cacheDerivedType
public void test420284() {
runNegativeTest(
new String[] {
@@ -4133,14 +4133,14 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" List<@NonNull Integer> l;\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " List<@NonNull Integer> l;\n" +
- " ^^^^^^^\n" +
- "NonNull cannot be resolved to a type\n" +
- "----------\n");
- }
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " List<@NonNull Integer> l;\n" +
+ " ^^^^^^^\n" +
+ "NonNull cannot be resolved to a type\n" +
+ "----------\n");
+ }
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=391521, [1.8][compiler] Error highlighting is not accurate for type references with type annotations
public void test391521() {
runNegativeTest(
@@ -4213,7 +4213,7 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
public void test414038() {
runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"import java.lang.annotation.*;\n" +
"@Target(ElementType.TYPE_USE)\n" +
"@interface NonNull { int[].class value() default 0;}\n" +
@@ -4221,11 +4221,11 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
" public static int i = 0; \n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " @interface NonNull { int[].class value() default 0;}\n" +
- " ^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " @interface NonNull { int[].class value() default 0;}\n" +
+ " ^^^^^^\n" +
+ "Syntax error on tokens, delete these tokens\n" +
"----------\n",
true);
}
@@ -4253,23 +4253,23 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
new String[] {
"test/X.java",
"package test;\n" +
- "import java.lang.annotation.ElementType;\n" +
- "import java.lang.annotation.Target;\n" +
- "\n" +
- "public class X {\n" +
- " test.@A Outer<>.@A Inner<> i;\n" +
+ "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "\n" +
+ "public class X {\n" +
+ " test.@A Outer<>.@A Inner<> i;\n" +
"}\n" +
"class Outer<T> {\n" +
" class Inner {}\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface A {}\n"
},
- "----------\n" +
- "1. ERROR in test\\X.java (at line 6)\n" +
- " test.@A Outer<>.@A Inner<> i;\n" +
- " ^^^^^^^^^^^^^\n" +
- "Incorrect number of arguments for type Outer<T>; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "1. ERROR in test\\X.java (at line 6)\n" +
+ " test.@A Outer<>.@A Inner<> i;\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Incorrect number of arguments for type Outer<T>; it cannot be parameterized with arguments <>\n" +
"----------\n",
null,
true,
@@ -4283,23 +4283,23 @@ public class NegativeTypeAnnotationTest extends AbstractRegressionTest {
new String[] {
"test/X.java",
"package test;\n" +
- "import java.lang.annotation.ElementType;\n" +
- "import java.lang.annotation.Target;\n" +
- "\n" +
- "public class X {\n" +
- " test.@A Outer<Object>.@A Inner<> i;\n" +
+ "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "\n" +
+ "public class X {\n" +
+ " test.@A Outer<Object>.@A Inner<> i;\n" +
"}\n" +
"class Outer<T> {\n" +
" class Inner {}\n" +
"}\n" +
- "@Target(ElementType.TYPE_USE)\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
"@interface A {}\n"
},
- "----------\n" +
- "1. ERROR in test\\X.java (at line 6)\n" +
- " test.@A Outer<Object>.@A Inner<> i;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The type Outer<Object>.Inner is not generic; it cannot be parameterized with arguments <>\n" +
+ "----------\n" +
+ "1. ERROR in test\\X.java (at line 6)\n" +
+ " test.@A Outer<Object>.@A Inner<> i;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The type Outer<Object>.Inner is not generic; it cannot be parameterized with arguments <>\n" +
"----------\n",
null,
true,
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NonFatalErrorTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NonFatalErrorTest.java
index a230a2942..d1e8602c9 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NonFatalErrorTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NonFatalErrorTest.java
@@ -237,26 +237,26 @@ public class NonFatalErrorTest extends AbstractRegressionTest {
null /* no class libraries */,
customOptions /* custom options */,
// compiler results
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " { }\n" +
- " ^^^^^^^\n" +
- "Empty block should be documented\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " static { }\n" +
- " ^^^^\n" +
- "Empty block should be documented\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " X(int a) {}\n" +
- " ^^\n" +
- "Empty block should be documented\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " public void foo() {}\n" +
- " ^^\n" +
- "Empty block should be documented\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " { }\n" +
+ " ^^^^^^^\n" +
+ "Empty block should be documented\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " static { }\n" +
+ " ^^^^\n" +
+ "Empty block should be documented\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " X(int a) {}\n" +
+ " ^^\n" +
+ "Empty block should be documented\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " public void foo() {}\n" +
+ " ^^\n" +
+ "Empty block should be documented\n" +
"----------\n",
// runtime results
"SUCCESS" /* expected output string */,
@@ -320,11 +320,11 @@ public class NonFatalErrorTest extends AbstractRegressionTest {
},
null, // libs
options,
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import com.bogus.Missing;\n" +
- " ^^^^^^^^^\n" +
- "The import com.bogus cannot be resolved\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " import com.bogus.Missing;\n" +
+ " ^^^^^^^^^\n" +
+ "The import com.bogus cannot be resolved\n" +
"----------\n",
"OK",
"",
@@ -363,14 +363,14 @@ public class NonFatalErrorTest extends AbstractRegressionTest {
},
null, // libs
options,
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import com.bogus.Missing;\n" +
- " ^^^^^^^^^\n" +
- "The import com.bogus cannot be resolved\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " import com.bogus.Missing;\n" +
+ " ^^^^^^^^^\n" +
+ "The import com.bogus cannot be resolved\n" +
"----------\n",
"",
- "Unresolved compilation problem: \n" +
+ "Unresolved compilation problem: \n" +
" The import com.bogus cannot be resolved",
JavacTestOptions.SKIP);
} finally {
@@ -406,11 +406,11 @@ public class NonFatalErrorTest extends AbstractRegressionTest {
},
null, // libs
options,
- "----------\n" +
- "1. ERROR in p\\z\\X.java (at line 1)\n" +
- " package p.z;\n" +
- " ^^^\n" +
- "The package p.z collides with a type\n" +
+ "----------\n" +
+ "1. ERROR in p\\z\\X.java (at line 1)\n" +
+ " package p.z;\n" +
+ " ^^^\n" +
+ "The package p.z collides with a type\n" +
"----------\n",
"java.lang.ClassNotFoundException", // cannot generate code in presence of the above error
"",
@@ -458,21 +458,21 @@ public class NonFatalErrorTest extends AbstractRegressionTest {
},
null, // libs
options,
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import java.util;\n" +
- " ^^^^^^^^^\n" +
- "Only a type can be imported. java.util resolves to a package\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " import p.Z;\n" +
- " ^^^\n" +
- "The import p.Z conflicts with a type defined in the same file\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " import p2.Y;\n" +
- " ^^^^\n" +
- "The import p2.Y collides with another import statement\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " import java.util;\n" +
+ " ^^^^^^^^^\n" +
+ "Only a type can be imported. java.util resolves to a package\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " import p.Z;\n" +
+ " ^^^\n" +
+ "The import p.Z conflicts with a type defined in the same file\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " import p2.Y;\n" +
+ " ^^^^\n" +
+ "The import p2.Y collides with another import statement\n" +
"----------\n",
"OK",
"",
@@ -516,16 +516,16 @@ public class NonFatalErrorTest extends AbstractRegressionTest {
},
null, // libs
options,
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import static p1.Y;\n" +
- " ^^^^\n" +
- "The static import p1.Y must be a field or member type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " import static p1.Y.f;\n" +
- " ^^^^^^\n" +
- "The field Y.p1.Y.f is not visible\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " import static p1.Y;\n" +
+ " ^^^^\n" +
+ "The static import p1.Y must be a field or member type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " import static p1.Y.f;\n" +
+ " ^^^^^^\n" +
+ "The field Y.p1.Y.f is not visible\n" +
"----------\n",
"OK",
"",
@@ -536,11 +536,11 @@ public class NonFatalErrorTest extends AbstractRegressionTest {
runConformTest(
new String[] {
"Test.java",
- "import java.lang.Character.Subset;\n" +
- "import static java.lang.Character.Subset;\n" +
- "\n" +
- "public class Test {\n" +
- " Subset s = null;\n" +
+ "import java.lang.Character.Subset;\n" +
+ "import static java.lang.Character.Subset;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " Subset s = null;\n" +
"}\n"
});
}
@@ -549,11 +549,11 @@ public class NonFatalErrorTest extends AbstractRegressionTest {
runConformTest(
new String[] {
"Test.java",
- "import static java.awt.geom.Line2D.Double;\n" +
- "import static java.awt.geom.Line2D.Double;\n" +
- "\n" +
- "public class Test {\n" +
- " Double d = null;\n" +
+ "import static java.awt.geom.Line2D.Double;\n" +
+ "import static java.awt.geom.Line2D.Double;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " Double d = null;\n" +
"}\n"
});
}
@@ -564,27 +564,27 @@ public class NonFatalErrorTest extends AbstractRegressionTest {
"Test.java",
// JLS doesn't really allow this duplication, but also javac defers the error to the use site, see:
// https://bugs.openjdk.java.net/browse/JDK-8133619?focusedCommentId=14133759&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14133759
- "import static java.awt.geom.Line2D.Double;\n" +
- "import static java.awt.geom.Point2D.Double;\n" +
- "\n" +
+ "import static java.awt.geom.Line2D.Double;\n" +
+ "import static java.awt.geom.Point2D.Double;\n" +
+ "\n" +
"public class Test {\n" +
- " Double d = null;\n" +
+ " Double d = null;\n" +
"}\n"
},
(this.complianceLevel < ClassFileConstants.JDK1_8
?
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " import static java.awt.geom.Point2D.Double;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The import java.awt.geom.Point2D.Double collides with another import statement\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 2)\n" +
+ " import static java.awt.geom.Point2D.Double;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The import java.awt.geom.Point2D.Double collides with another import statement\n" +
"----------\n"
:
- "----------\n" +
- "1. ERROR in Test.java (at line 5)\n" +
- " Double d = null;\n" +
- " ^^^^^^\n" +
- "The type Double is ambiguous\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 5)\n" +
+ " Double d = null;\n" +
+ " ^^^^^^\n" +
+ "The type Double is ambiguous\n" +
"----------\n"));
}
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationBatchCompilerTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationBatchCompilerTest.java
index f40a8aa44..f1aa48c90 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationBatchCompilerTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationBatchCompilerTest.java
@@ -927,24 +927,24 @@ public class NullAnnotationBatchCompilerTest extends AbstractBatchCompilerTest {
Util.createFile(annots_java_lang + File.separator + "Object.eea",
TEST_440687_OBJECT_EEA_CONTENT);
- runTest440687("-annotationpath CLASSPATH -classpath \"" + annots_dir2 + "\"",
- File.pathSeparator + annots_dir1, // extra source path
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/test1/Test1.java (at line 9)\n" +
- " Test1 v = map.get(key);\n" +
- " ^^^^^^^^^^^^\n" +
- "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'@NonNull Map<@NonNull String,@NonNull Test1>\'. Type \'Map<K,V>\' doesn\'t seem to be designed with null type annotations in mind\n" +
- "----------\n" +
- "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/test1/Test1.java (at line 11)\n" +
- " throw new RuntimeException(); // should not be reported as dead code, although V is a \'@NonNull Test1\'\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/test1/Test1.java (at line 13)\n" +
- " public boolean equals(@NonNull Object other) { return false; }\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Illegal redefinition of parameter other, inherited method from Object declares this parameter as @Nullable\n" +
- "----------\n" +
+ runTest440687("-annotationpath CLASSPATH -classpath \"" + annots_dir2 + "\"",
+ File.pathSeparator + annots_dir1, // extra source path
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/test1/Test1.java (at line 9)\n" +
+ " Test1 v = map.get(key);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'@NonNull Map<@NonNull String,@NonNull Test1>\'. Type \'Map<K,V>\' doesn\'t seem to be designed with null type annotations in mind\n" +
+ "----------\n" +
+ "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/test1/Test1.java (at line 11)\n" +
+ " throw new RuntimeException(); // should not be reported as dead code, although V is a \'@NonNull Test1\'\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/test1/Test1.java (at line 13)\n" +
+ " public boolean equals(@NonNull Object other) { return false; }\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Illegal redefinition of parameter other, inherited method from Object declares this parameter as @Nullable\n" +
+ "----------\n" +
"3 problems (3 warnings)\n",
true);
}
@@ -964,24 +964,24 @@ public class NullAnnotationBatchCompilerTest extends AbstractBatchCompilerTest {
Util.zip(new File(annots_dir2), zipName);
Util.delete(annots_dir2);
- runTest440687("-annotationpath CLASSPATH -classpath \"" + zipName + "\"",
- File.pathSeparator + annots_dir1, // extra source path
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/test1/Test1.java (at line 9)\n" +
- " Test1 v = map.get(key);\n" +
- " ^^^^^^^^^^^^\n" +
- "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'@NonNull Map<@NonNull String,@NonNull Test1>\'. Type \'Map<K,V>\' doesn\'t seem to be designed with null type annotations in mind\n" +
- "----------\n" +
- "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/test1/Test1.java (at line 11)\n" +
- " throw new RuntimeException(); // should not be reported as dead code, although V is a \'@NonNull Test1\'\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/test1/Test1.java (at line 13)\n" +
- " public boolean equals(@NonNull Object other) { return false; }\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Illegal redefinition of parameter other, inherited method from Object declares this parameter as @Nullable\n" +
- "----------\n" +
+ runTest440687("-annotationpath CLASSPATH -classpath \"" + zipName + "\"",
+ File.pathSeparator + annots_dir1, // extra source path
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/test1/Test1.java (at line 9)\n" +
+ " Test1 v = map.get(key);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'@NonNull Map<@NonNull String,@NonNull Test1>\'. Type \'Map<K,V>\' doesn\'t seem to be designed with null type annotations in mind\n" +
+ "----------\n" +
+ "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/test1/Test1.java (at line 11)\n" +
+ " throw new RuntimeException(); // should not be reported as dead code, although V is a \'@NonNull Test1\'\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/test1/Test1.java (at line 13)\n" +
+ " public boolean equals(@NonNull Object other) { return false; }\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Illegal redefinition of parameter other, inherited method from Object declares this parameter as @Nullable\n" +
+ "----------\n" +
"3 problems (3 warnings)\n",
true);
}
@@ -1001,24 +1001,24 @@ public class NullAnnotationBatchCompilerTest extends AbstractBatchCompilerTest {
Util.zip(new File(annots_dir2), zipName);
Util.delete(annots_dir2);
- runTest440687("-annotationpath \"" + zipName + "\"",
- File.pathSeparator + annots_dir1, // extra source path
- "----------\n" +
- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/test1/Test1.java (at line 9)\n" +
- " Test1 v = map.get(key);\n" +
- " ^^^^^^^^^^^^\n" +
- "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'@NonNull Map<@NonNull String,@NonNull Test1>\'. Type \'Map<K,V>\' doesn\'t seem to be designed with null type annotations in mind\n" +
- "----------\n" +
- "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/test1/Test1.java (at line 11)\n" +
- " throw new RuntimeException(); // should not be reported as dead code, although V is a \'@NonNull Test1\'\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/test1/Test1.java (at line 13)\n" +
- " public boolean equals(@NonNull Object other) { return false; }\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Illegal redefinition of parameter other, inherited method from Object declares this parameter as @Nullable\n" +
- "----------\n" +
+ runTest440687("-annotationpath \"" + zipName + "\"",
+ File.pathSeparator + annots_dir1, // extra source path
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/test1/Test1.java (at line 9)\n" +
+ " Test1 v = map.get(key);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'@NonNull Map<@NonNull String,@NonNull Test1>\'. Type \'Map<K,V>\' doesn\'t seem to be designed with null type annotations in mind\n" +
+ "----------\n" +
+ "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/test1/Test1.java (at line 11)\n" +
+ " throw new RuntimeException(); // should not be reported as dead code, although V is a \'@NonNull Test1\'\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/test1/Test1.java (at line 13)\n" +
+ " public boolean equals(@NonNull Object other) { return false; }\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Illegal redefinition of parameter other, inherited method from Object declares this parameter as @Nullable\n" +
+ "----------\n" +
"3 problems (3 warnings)\n",
true);
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java
index 4c87fcfa1..74c12db38 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java
@@ -56,8 +56,8 @@ public static Class testClass() {
}
String mismatch_NonNull_Nullable(String type) {
- return (this.complianceLevel < ClassFileConstants.JDK1_8)
- ? "Null type mismatch: required \'@NonNull "+type+"\' but the provided value is specified as @Nullable\n"
+ return (this.complianceLevel < ClassFileConstants.JDK1_8)
+ ? "Null type mismatch: required \'@NonNull "+type+"\' but the provided value is specified as @Nullable\n"
: "Null type mismatch (type annotations): required '@NonNull "+type+"' but this expression has type '@Nullable "+type+"'\n";
}
String nullTypeSafety() {
@@ -66,8 +66,8 @@ String nullTypeSafety() {
: "Null type safety (type annotations): ";
}
String variableMayBeNull(String var) {
- return (this.complianceLevel < ClassFileConstants.JDK1_8)
- ? "Potential null pointer access: The variable "+var+" may be null at this location\n"
+ return (this.complianceLevel < ClassFileConstants.JDK1_8)
+ ? "Potential null pointer access: The variable "+var+" may be null at this location\n"
: "Potential null pointer access: this expression has a '@Nullable' type\n";
}
String redundant_check_nonnull(String expr, String type) {
@@ -397,13 +397,13 @@ public void test_nonnull_parameter_010() {
runNegativeTestWithLibs(
new String[] {
"ContainingInner2.java",
- "public class ContainingInner2 {\n" +
- " public ContainingInner2 (@org.eclipse.jdt.annotation.NonNull Object o) {\n" +
- " }\n" +
- " public class Inner {\n" +
- " public Inner (@org.eclipse.jdt.annotation.NonNull Object o) {\n" +
- " }\n" +
- " }\n" +
+ "public class ContainingInner2 {\n" +
+ " public ContainingInner2 (@org.eclipse.jdt.annotation.NonNull Object o) {\n" +
+ " }\n" +
+ " public class Inner {\n" +
+ " public Inner (@org.eclipse.jdt.annotation.NonNull Object o) {\n" +
+ " }\n" +
+ " }\n" +
"}\n",
"X.java",
"public class X {\n" +
@@ -413,16 +413,16 @@ public void test_nonnull_parameter_010() {
" }\n" +
"}\n"},
customOptions,
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " ContainingInner2 container = new ContainingInner2(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " ContainingInner2.Inner inner = container.new Inner(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " ContainingInner2 container = new ContainingInner2(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " ContainingInner2.Inner inner = container.new Inner(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
"----------\n" /* compiler output */);
}
// null is passed to a non-null parameter in a qualified allocation expression, target class read from .class
@@ -432,13 +432,13 @@ public void test_nonnull_parameter_011() {
runConformTestWithLibs(
new String[] {
"ContainingInner2.java",
- "public class ContainingInner2 {\n" +
- " public ContainingInner2 (@org.eclipse.jdt.annotation.NonNull Object o) {\n" +
- " }\n" +
- " public class Inner {\n" +
- " public Inner (@org.eclipse.jdt.annotation.NonNull Object o) {\n" +
- " }\n" +
- " }\n" +
+ "public class ContainingInner2 {\n" +
+ " public ContainingInner2 (@org.eclipse.jdt.annotation.NonNull Object o) {\n" +
+ " }\n" +
+ " public class Inner {\n" +
+ " public Inner (@org.eclipse.jdt.annotation.NonNull Object o) {\n" +
+ " }\n" +
+ " }\n" +
"}\n",
},
null /*customOptions*/,
@@ -454,16 +454,16 @@ public void test_nonnull_parameter_011() {
" }\n" +
"}\n"},
customOptions,
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " ContainingInner2 container = new ContainingInner2(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " ContainingInner2.Inner inner = container.new Inner(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " ContainingInner2 container = new ContainingInner2(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " ContainingInner2.Inner inner = container.new Inner(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
"----------\n" /* compiler output */);
}
// null is passed to a non-null parameter in a qualified allocation expression, generic constructor, target class read from .class
@@ -476,13 +476,13 @@ public void test_nonnull_parameter_012() {
runConformTestWithLibs(
new String[] {
"ContainingInner2.java",
- "public class ContainingInner2 {\n" +
- " public ContainingInner2 (@org.eclipse.jdt.annotation.NonNull Object o) {\n" +
- " }\n" +
- " public class Inner {\n" +
- " public <T> Inner (@org.eclipse.jdt.annotation.NonNull T o) {\n" +
- " }\n" +
- " }\n" +
+ "public class ContainingInner2 {\n" +
+ " public ContainingInner2 (@org.eclipse.jdt.annotation.NonNull Object o) {\n" +
+ " }\n" +
+ " public class Inner {\n" +
+ " public <T> Inner (@org.eclipse.jdt.annotation.NonNull T o) {\n" +
+ " }\n" +
+ " }\n" +
"}\n",
},
null /*customOptions*/,
@@ -498,15 +498,15 @@ public void test_nonnull_parameter_012() {
" }\n" +
"}\n"},
customOptions,
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " ContainingInner2 container = new ContainingInner2(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " ContainingInner2.Inner inner = container.new Inner(null);\n" +
- " ^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " ContainingInner2 container = new ContainingInner2(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " ContainingInner2.Inner inner = container.new Inner(null);\n" +
+ " ^^^^\n" +
"Null type mismatch: required \'@NonNull Object' but the provided value is null\n" +
"----------\n");
}
@@ -526,11 +526,11 @@ public void test_nonnull_parameter_013() {
" } \n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in B.java (at line 8)\n" +
- " l.callMe(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in B.java (at line 8)\n" +
+ " l.callMe(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
"----------\n");
}
// non-null varargs (message send)
@@ -564,26 +564,26 @@ public void test_nonnull_parameter_015() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (o != null)\n" +
- " ^\n" +
- redundant_check_nonnull("The variable o", "Object @NonNull[]") +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " foo(objs);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'"+nonNullArrayOf("Object")+"\' but the provided value is null\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 18)\n" +
- " foo2(2, null);\n" +
- " ^^^^^^^^^^^^^\n" +
- "Type null of the last argument to method foo2(int, Object...) doesn't exactly match the vararg parameter type. Cast to Object[] to confirm the non-varargs invocation, or pass individual arguments of type Object for a varargs invocation.\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 18)\n" +
- " foo2(2, null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'"+nonNullArrayOf("Object")+"\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " if (o != null)\n" +
+ " ^\n" +
+ redundant_check_nonnull("The variable o", "Object @NonNull[]") +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " foo(objs);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'"+nonNullArrayOf("Object")+"\' but the provided value is null\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 18)\n" +
+ " foo2(2, null);\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Type null of the last argument to method foo2(int, Object...) doesn't exactly match the vararg parameter type. Cast to Object[] to confirm the non-varargs invocation, or pass individual arguments of type Object for a varargs invocation.\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 18)\n" +
+ " foo2(2, null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'"+nonNullArrayOf("Object")+"\' but the provided value is null\n" +
"----------\n");
}
// non-null varargs (allocation and explicit constructor calls)
@@ -625,7 +625,7 @@ public void test_nonnull_parameter_016() {
"1. ERROR in X.java (at line 4)\n" +
" if (o != null)\n" +
" ^\n" +
- redundant_check_nonnull("The variable o", "Object @NonNull[]") +
+ redundant_check_nonnull("The variable o", "Object @NonNull[]") +
"----------\n" +
"2. ERROR in X.java (at line 16)\n" +
" new X((Object[])null);\n" +
@@ -643,26 +643,26 @@ public void test_nonnull_argument_001() {
runNegativeTestWithLibs(
new String[] {
"ShowNPE2.java",
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "@NonNullByDefault\n" +
- "public class ShowNPE2 {\n" +
- " public Object foo(Object o1, final boolean b) {\n" +
- " o1 = null; // expect NPE error\n" +
- " System.out.println(o1.toString()); \n" +
- " return null; // expect NPE error\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "@NonNullByDefault\n" +
+ "public class ShowNPE2 {\n" +
+ " public Object foo(Object o1, final boolean b) {\n" +
+ " o1 = null; // expect NPE error\n" +
+ " System.out.println(o1.toString()); \n" +
+ " return null; // expect NPE error\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in ShowNPE2.java (at line 5)\n" +
- " o1 = null; // expect NPE error\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in ShowNPE2.java (at line 7)\n" +
- " return null; // expect NPE error\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in ShowNPE2.java (at line 5)\n" +
+ " o1 = null; // expect NPE error\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in ShowNPE2.java (at line 7)\n" +
+ " return null; // expect NPE error\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
"----------\n");
}
// Bug 367203 - [compiler][null] detect assigning null to nonnull argument
@@ -670,21 +670,21 @@ public void test_nonnull_argument_002() {
runNegativeTestWithLibs(
new String[] {
"ShowNPE2.java",
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "@NonNullByDefault\n" +
- "public class ShowNPE2 {\n" +
- " public Object foo(Object o1, final boolean b) {\n" +
- " bar(o1); // expecting no problem\n" +
- " return null; // expect NPE error\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "@NonNullByDefault\n" +
+ "public class ShowNPE2 {\n" +
+ " public Object foo(Object o1, final boolean b) {\n" +
+ " bar(o1); // expecting no problem\n" +
+ " return null; // expect NPE error\n" +
" }\n" +
- " void bar(Object o2) {}\n" +
+ " void bar(Object o2) {}\n" +
"}"
},
- "----------\n" +
- "1. ERROR in ShowNPE2.java (at line 6)\n" +
- " return null; // expect NPE error\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in ShowNPE2.java (at line 6)\n" +
+ " return null; // expect NPE error\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
"----------\n");
}
// a method of a local class has a non-null parameter, client passes potential null (msg send)
@@ -704,9 +704,9 @@ public void test_nonnull_parameter_014() {
" @org.eclipse.jdt.annotation.Nullable Object getNull() { return null; }" +
"}\n"
},
- "----------\n" +
- "1. ERROR in B.java (at line 8)\n" +
- " l.callMe(getNull());\n" +
+ "----------\n" +
+ "1. ERROR in B.java (at line 8)\n" +
+ " l.callMe(getNull());\n" +
" ^^^^^^^^^\n" +
mismatch_NonNull_Nullable("Object") +
"----------\n");
@@ -732,8 +732,8 @@ public void test_nonnull_local_001() {
" ^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Null type mismatch: required \'@NonNull Object\' but the provided value is inferred as @Nullable\n"
:
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n") +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n") +
"----------\n" +
"2. ERROR in X.java (at line 6)\n" +
" o2 = null;\n" +
@@ -771,8 +771,8 @@ public void test_nonnull_local_002() {
" ^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Null type mismatch: required \'@NonNull Object\' but the provided value is inferred as @Nullable\n"
:
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n") +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n") +
"----------\n" +
"2. ERROR in X.java (at line 8)\n" +
" o2 = null;\n" +
@@ -1048,11 +1048,11 @@ public void test_parameter_specification_inheritance_008() {
},
options,
"----------\n" +
- "1. WARNING in XSub.java (at line 3)\n" +
- " public void printObject(Object o) { super.printObject(o); }\n" +
- " ^^^^^^\n" +
- "Missing non-null annotation: inherited method from X specifies this parameter as @NonNull\n" +
- "----------\n" +
+ "1. WARNING in XSub.java (at line 3)\n" +
+ " public void printObject(Object o) { super.printObject(o); }\n" +
+ " ^^^^^^\n" +
+ "Missing non-null annotation: inherited method from X specifies this parameter as @NonNull\n" +
+ "----------\n" +
"2. ERROR in XSub.java (at line 3)\n" +
" public void printObject(Object o) { super.printObject(o); }\n" +
" ^\n" +
@@ -1305,26 +1305,26 @@ public void test_parameter_specification_inheritance_014() {
"The method getString3(String) from X cannot implement the corresponding method from IY due to incompatible nullness constraints\n" +
"----------\n"
: // at 1.8 we show null type annotations in the message:
- "----------\n" +
- "1. ERROR in p1\\Y.java (at line 2)\n" +
- " public class Y extends X implements IY {\n" +
- " ^\n" +
- "The method @Nullable String getString1(String) from X cannot implement the corresponding method from IY due to incompatible nullness constraints\n" +
- "----------\n" +
- "2. ERROR in p1\\Y.java (at line 2)\n" +
- " public class Y extends X implements IY {\n" +
- " ^\n" +
- "The method String getString2(String) from X cannot implement the corresponding method from IY due to incompatible nullness constraints\n" +
- "----------\n" +
- "3. ERROR in p1\\Y.java (at line 2)\n" +
- " public class Y extends X implements IY {\n" +
- " ^\n" +
- "The method getString5(@NonNull String) from X cannot implement the corresponding method from IY due to incompatible nullness constraints\n" +
- "----------\n" +
- "4. ERROR in p1\\Y.java (at line 2)\n" +
- " public class Y extends X implements IY {\n" +
- " ^\n" +
- "The method getString3(String) from X cannot implement the corresponding method from IY due to incompatible nullness constraints\n" +
+ "----------\n" +
+ "1. ERROR in p1\\Y.java (at line 2)\n" +
+ " public class Y extends X implements IY {\n" +
+ " ^\n" +
+ "The method @Nullable String getString1(String) from X cannot implement the corresponding method from IY due to incompatible nullness constraints\n" +
+ "----------\n" +
+ "2. ERROR in p1\\Y.java (at line 2)\n" +
+ " public class Y extends X implements IY {\n" +
+ " ^\n" +
+ "The method String getString2(String) from X cannot implement the corresponding method from IY due to incompatible nullness constraints\n" +
+ "----------\n" +
+ "3. ERROR in p1\\Y.java (at line 2)\n" +
+ " public class Y extends X implements IY {\n" +
+ " ^\n" +
+ "The method getString5(@NonNull String) from X cannot implement the corresponding method from IY due to incompatible nullness constraints\n" +
+ "----------\n" +
+ "4. ERROR in p1\\Y.java (at line 2)\n" +
+ " public class Y extends X implements IY {\n" +
+ " ^\n" +
+ "The method getString3(String) from X cannot implement the corresponding method from IY due to incompatible nullness constraints\n" +
"----------\n"));
}
// a method relaxes the parameter null specification from @NonNull to un-annotated
@@ -1344,13 +1344,13 @@ public void test_parameter_specification_inheritance_015() {
" public void foo(String s) { if (s != null) super.foo(s); }\n" +
" void bar() { foo(null); }\n" +
"}\n"
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in XSub.java (at line 3)\n" +
- " public void foo(String s) { if (s != null) super.foo(s); }\n" +
- " ^^^^^^\n" +
- "Missing non-null annotation: inherited method from X specifies this parameter as @NonNull\n" +
+ "----------\n" +
+ "1. WARNING in XSub.java (at line 3)\n" +
+ " public void foo(String s) { if (s != null) super.foo(s); }\n" +
+ " ^^^^^^\n" +
+ "Missing non-null annotation: inherited method from X specifies this parameter as @NonNull\n" +
"----------\n");
}
@@ -1408,11 +1408,11 @@ public void test_parameter_specification_inheritance_017() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in XSub.java (at line 1)\n" +
- " public class XSub extends X implements IX {\n" +
- " ^\n" +
- "Parameter 1 of method foo(String) lacks a @NonNull annotation as specified in type IX\n" +
+ "----------\n" +
+ "1. WARNING in XSub.java (at line 1)\n" +
+ " public class XSub extends X implements IX {\n" +
+ " ^\n" +
+ "Parameter 1 of method foo(String) lacks a @NonNull annotation as specified in type IX\n" +
"----------\n");
}
@@ -1652,11 +1652,11 @@ public void test_nonnull_return_008() {
" if (getObject() == null)\n" +
" ^^^^^^^^^^^\n" +
checkAlwaysFalse_method_cannot_return_null("getObject()", "Object") +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " throw new RuntimeException();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " throw new RuntimeException();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n");
}
// a result from a nonnull method is directly checked for null (from local): redundant
@@ -1871,32 +1871,32 @@ public void test_nonnull_return_014() {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "\n" +
- "public class X {\n" +
- " @NonNull\n" +
- " public Object foo(Object x, int y) {\n" +
- " @NonNull Object local;\n" +
- " while (true) {\n" +
- " if (y == 4) {\n" +
- " local = x; // error\n" +
- " return x; // only a warning.\n" +
- " }\n" +
- " x = null;\n" +
- " }\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "\n" +
+ "public class X {\n" +
+ " @NonNull\n" +
+ " public Object foo(Object x, int y) {\n" +
+ " @NonNull Object local;\n" +
+ " while (true) {\n" +
+ " if (y == 4) {\n" +
+ " local = x; // error\n" +
+ " return x; // only a warning.\n" +
+ " }\n" +
+ " x = null;\n" +
+ " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " local = x; // error\n" +
- " ^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is inferred as @Nullable\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " return x; // only a warning.\n" +
- " ^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is inferred as @Nullable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " local = x; // error\n" +
+ " ^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is inferred as @Nullable\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " return x; // only a warning.\n" +
+ " ^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is inferred as @Nullable\n" +
"----------\n");
}
// suppress an error regarding null-spec violation
@@ -2110,7 +2110,7 @@ public void test_illegal_annotation_003() {
"----------\n" +
"1. ERROR in X.java (at line 3)\n" +
" @NonNull void foo() {}\n" +
- " ^^^^^^^^\n" +
+ " ^^^^^^^^\n" +
((this.complianceLevel < ClassFileConstants.JDK1_8)
? "The nullness annotation @NonNull is not applicable for the primitive type void\n"
: "Type annotation is illegal for a method that returns void\n") +
@@ -2132,7 +2132,7 @@ public void test_illegal_annotation_003b() {
"----------\n" +
"1. ERROR in X.java (at line 3)\n" +
" @NonNull int foo() { return 1; }\n" +
- " ^^^^^^^^\n" +
+ " ^^^^^^^^\n" +
"The nullness annotation @NonNull is not applicable for the primitive type int\n" +
"----------\n");
}
@@ -2232,16 +2232,16 @@ public void test_illegal_annotation_007() {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in p\\Test.java (at line 9)\n" +
- " @org public Object foo() {\n" +
- " ^^^\n" +
- "org cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in p\\Test.java (at line 9)\n" +
- " @org public Object foo() {\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with '@NonNull Object' returned from TestInt.foo() (mismatching null constraints)\n" +
+ "----------\n" +
+ "1. ERROR in p\\Test.java (at line 9)\n" +
+ " @org public Object foo() {\n" +
+ " ^^^\n" +
+ "org cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in p\\Test.java (at line 9)\n" +
+ " @org public Object foo() {\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with '@NonNull Object' returned from TestInt.foo() (mismatching null constraints)\n" +
"----------\n",
this.LIBS,
true, // flush
@@ -2559,25 +2559,25 @@ public void test_default_nullness_003c() {
},
customOptions,
"----------\n" +
- "1. ERROR in p2\\Y.java (at line 5)\n" +
- " protected @Nullable Object getObject(@Nullable Object o) {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The return type is incompatible with '@NonNull Object' returned from X.getObject(Object) (mismatching null constraints)\n" +
- "----------\n" +
- "2. ERROR in p2\\Y.java (at line 6)\n" +
- " bar(o);\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'@Nullable Object\'\n" +
- "----------\n" +
- "3. WARNING in p2\\Y.java (at line 7)\n" +
- " @NonNull Object nno = accept(o); // 2xERR\n" +
- " ^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'Object\' needs unchecked conversion to conform to \'@NonNull Object\'\n" +
- "----------\n" +
- "4. ERROR in p2\\Y.java (at line 7)\n" +
- " @NonNull Object nno = accept(o); // 2xERR\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'@Nullable Object\'\n" +
+ "1. ERROR in p2\\Y.java (at line 5)\n" +
+ " protected @Nullable Object getObject(@Nullable Object o) {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The return type is incompatible with '@NonNull Object' returned from X.getObject(Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "2. ERROR in p2\\Y.java (at line 6)\n" +
+ " bar(o);\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'@Nullable Object\'\n" +
+ "----------\n" +
+ "3. WARNING in p2\\Y.java (at line 7)\n" +
+ " @NonNull Object nno = accept(o); // 2xERR\n" +
+ " ^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'Object\' needs unchecked conversion to conform to \'@NonNull Object\'\n" +
+ "----------\n" +
+ "4. ERROR in p2\\Y.java (at line 7)\n" +
+ " @NonNull Object nno = accept(o); // 2xERR\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'@Nullable Object\'\n" +
"----------\n");
}
// don't apply type-level default to non-reference type
@@ -2833,22 +2833,22 @@ public void test_default_nullness_011() {
"@org.eclipse.jdt.annotation.NonNullByDefault\n" +
"package p1;\n"
},
- "----------\n" +
- "1. ERROR in Main.java (at line 4)\n" +
- " o = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in Main.java (at line 5)\n" +
- " new C(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in p1\\C.java (at line 2)\n" +
- " @org.eclipse.jdt.annotation.NonNullByDefault\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing package p1\n" +
+ "----------\n" +
+ "1. ERROR in Main.java (at line 4)\n" +
+ " o = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in Main.java (at line 5)\n" +
+ " new C(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in p1\\C.java (at line 2)\n" +
+ " @org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing package p1\n" +
"----------\n");
}
// Bug 365836 - [compiler][null] Incomplete propagation of null defaults.
@@ -2856,25 +2856,25 @@ public void test_default_nullness_012() {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "public class X {\n" +
- " @NonNullByDefault \n" +
- " public void foo(@Nullable String [] args) {\n" +
- " class local {\n" +
- " void zoo(Object o) {\n" +
- " }\n" +
- " };\n" +
- " new local().zoo(null); // defaults applying from foo\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "public class X {\n" +
+ " @NonNullByDefault \n" +
+ " public void foo(@Nullable String [] args) {\n" +
+ " class local {\n" +
+ " void zoo(Object o) {\n" +
+ " }\n" +
+ " };\n" +
+ " new local().zoo(null); // defaults applying from foo\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " new local().zoo(null); // defaults applying from foo\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " new local().zoo(null); // defaults applying from foo\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
"----------\n");
}
// Bug 365836 - [compiler][null] Incomplete propagation of null defaults.
@@ -2882,28 +2882,28 @@ public void test_default_nullness_013() {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
"\n" +
"@SuppressWarnings(\"unused\")\n" +
- "public class X {\n" +
- " @NonNullByDefault \n" +
- " public void foo(@Nullable String [] args) {\n" +
+ "public class X {\n" +
+ " @NonNullByDefault \n" +
+ " public void foo(@Nullable String [] args) {\n" +
" class local {\n" +
- " class Deeply {\n" +
+ " class Deeply {\n" +
" Object zoo() {\n" +
" return null; // defaults applying from foo\n" +
- " }\n" +
- " }\n" +
- " };\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " return null; // defaults applying from foo\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " return null; // defaults applying from foo\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
"----------\n");
}
// bug 367154 - [compiler][null] Problem in propagating null defaults.
@@ -2911,29 +2911,29 @@ public void test_default_nullness_014() {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "@SuppressWarnings(\"unused\")\n" +
- "public class X {\n" +
- "\n" +
- " public void foo(@Nullable String [] args) {\n" +
- " @NonNullByDefault\n" +
- " class local {\n" +
- " class Deeply {\n" +
- " Object zoo() {\n" +
- " return null; // expect error here\n" +
- " }\n" +
- " }\n" +
- " };\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "@SuppressWarnings(\"unused\")\n" +
+ "public class X {\n" +
+ "\n" +
+ " public void foo(@Nullable String [] args) {\n" +
+ " @NonNullByDefault\n" +
+ " class local {\n" +
+ " class Deeply {\n" +
+ " Object zoo() {\n" +
+ " return null; // expect error here\n" +
+ " }\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " return null; // expect error here\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " return null; // expect error here\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
"----------\n");
}
// bug 367154 - [compiler][null] Problem in propagating null defaults.
@@ -2942,28 +2942,28 @@ public void test_default_nullness_015() {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "@SuppressWarnings(\"unused\")\n" +
- "@NonNullByDefault\n" +
- "public class X {\n" +
- " {\n" +
- " class local {\n" +
- " class Deeply {\n" +
- " Object zoo() {\n" +
- " return null; // expect error here\n" +
- " }\n" +
- " }\n" +
- " };\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "@SuppressWarnings(\"unused\")\n" +
+ "@NonNullByDefault\n" +
+ "public class X {\n" +
+ " {\n" +
+ " class local {\n" +
+ " class Deeply {\n" +
+ " Object zoo() {\n" +
+ " return null; // expect error here\n" +
+ " }\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " return null; // expect error here\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " return null; // expect error here\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
"----------\n");
}
@@ -2987,26 +2987,26 @@ public void test_default_nullness_016() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " Object foo;\n" +
- " ^^^\n" +
- "The @NonNull field foo may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " foo = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " Object iFoo;\n" +
- " ^^^^\n" +
- "The @NonNull field iFoo may not have been initialized\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 11)\n" +
- " iFoo = arg;\n" +
- " ^^^\n" +
- mismatch_NonNull_Nullable("Object") +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " Object foo;\n" +
+ " ^^^\n" +
+ "The @NonNull field foo may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " foo = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 9)\n" +
+ " Object iFoo;\n" +
+ " ^^^^\n" +
+ "The @NonNull field iFoo may not have been initialized\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 11)\n" +
+ " iFoo = arg;\n" +
+ " ^^^\n" +
+ mismatch_NonNull_Nullable("Object") +
"----------\n");
}
@@ -3030,21 +3030,21 @@ public void test_default_nullness_017() {
"}\n",
},
options,
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " Object foo;\n" +
- " ^^^\n" +
- "The @NonNull field foo may not have been initialized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " @NonNull Object goo;\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The nullness annotation is redundant with a default that applies to this location\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " @NonNull Object goo;\n" +
- " ^^^\n" +
- "The @NonNull field goo may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " Object foo;\n" +
+ " ^^^\n" +
+ "The @NonNull field foo may not have been initialized\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " @NonNull Object goo;\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The nullness annotation is redundant with a default that applies to this location\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " @NonNull Object goo;\n" +
+ " ^^^\n" +
+ "The @NonNull field goo may not have been initialized\n" +
"----------\n");
}
@@ -3057,16 +3057,16 @@ public void test_nullness_default_018() {
new String[] {
"pack/NullWarn.java",
"package pack;\n" +
- "@SuppressWarnings(\"null\")\n" +
- "public class NullWarn {\n" +
- "\n" +
- " // Some code\n" +
- "\n" +
+ "@SuppressWarnings(\"null\")\n" +
+ "public class NullWarn {\n" +
+ "\n" +
+ " // Some code\n" +
+ "\n" +
"}\n"
},
customOptions,
"");
-
+
}
// type case (inside default package)
@@ -3077,16 +3077,16 @@ public void test_nullness_default_018b() {
runConformTestWithLibs(
new String[] {
"NullWarn.java",
- "@SuppressWarnings(\"null\")\n" +
- "public class NullWarn {\n" +
- "\n" +
- " // Some code\n" +
- "\n" +
+ "@SuppressWarnings(\"null\")\n" +
+ "public class NullWarn {\n" +
+ "\n" +
+ " // Some code\n" +
+ "\n" +
"}\n"
},
customOptions,
"");
-
+
}
// redundant default annotations - class vs. inner class
@@ -3129,7 +3129,7 @@ public void test_redundant_annotation_01() {
"}\n"
},
customOptions,
- "----------\n" +
+ "----------\n" +
"1. WARNING in p2\\Y.java (at line 5)\n" +
" @NonNullByDefault class Inner {\n" +
" ^^^^^^^^^^^^^^^^^\n" +
@@ -3240,21 +3240,21 @@ public void test_redundant_annotation_02g() {
"}\n"
},
customOptions,
- "----------\n" +
- "1. WARNING in p2\\Y.java (at line 5)\n" +
- " @NonNullByDefault <TF> void foo(TF arg) {}\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing type Y<TY>\n" +
- "----------\n" +
- "2. WARNING in p2\\Y.java (at line 9)\n" +
- " @NonNullByDefault @SuppressWarnings(\"unused\") class Zork {\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing method bar()\n" +
- "----------\n" +
- "3. WARNING in p2\\Y.java (at line 10)\n" +
- " @NonNullByDefault void fubar(TB arg) {}\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing type Zork\n" +
+ "----------\n" +
+ "1. WARNING in p2\\Y.java (at line 5)\n" +
+ " @NonNullByDefault <TF> void foo(TF arg) {}\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing type Y<TY>\n" +
+ "----------\n" +
+ "2. WARNING in p2\\Y.java (at line 9)\n" +
+ " @NonNullByDefault @SuppressWarnings(\"unused\") class Zork {\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing method bar()\n" +
+ "----------\n" +
+ "3. WARNING in p2\\Y.java (at line 10)\n" +
+ " @NonNullByDefault void fubar(TB arg) {}\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing type Zork\n" +
"----------\n");
}
@@ -3277,17 +3277,17 @@ public void test_missing_default_annotation_01() {
"}\n"
},
customOptions,
- "----------\n" +
- "1. ERROR in Lib.java (at line 1)\n" +
- " public class Lib {\n" +
- " ^^^\n" +
- "A default nullness annotation has not been specified for the type Lib\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X {\n" +
- " ^\n" +
- "A default nullness annotation has not been specified for the type X\n" +
+ "----------\n" +
+ "1. ERROR in Lib.java (at line 1)\n" +
+ " public class Lib {\n" +
+ " ^^^\n" +
+ "A default nullness annotation has not been specified for the type Lib\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X {\n" +
+ " ^\n" +
+ "A default nullness annotation has not been specified for the type X\n" +
"----------\n");
}
@@ -3316,17 +3316,17 @@ public void test_missing_default_annotation_02() {
"}\n",
},
customOptions,
- "----------\n" +
- "1. ERROR in p2\\package-info.java (at line 1)\n" +
- " package p2;\n" +
- " ^^\n" +
- "A default nullness annotation has not been specified for the package p2\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in p3\\Z.java (at line 4)\n" +
- " @NonNullByDefault void bar() {}\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing package p3\n" +
+ "----------\n" +
+ "1. ERROR in p2\\package-info.java (at line 1)\n" +
+ " package p2;\n" +
+ " ^^\n" +
+ "A default nullness annotation has not been specified for the package p2\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in p3\\Z.java (at line 4)\n" +
+ " @NonNullByDefault void bar() {}\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing package p3\n" +
"----------\n");
}
@@ -3393,21 +3393,21 @@ public void test_contradictory_annotations_01() {
"}\n"
},
customOptions,
- "----------\n" +
- "1. ERROR in p2\\Y.java (at line 4)\n" +
- " void foo(@NonNull @Nullable Object o) {}\n" +
- " ^^^^^^^^^\n" +
- "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
- "----------\n" +
- "2. ERROR in p2\\Y.java (at line 5)\n" +
- " @Nullable @NonNull Object bar() {\n" +
- " ^^^^^^^^\n" +
- "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
- "----------\n" +
- "3. ERROR in p2\\Y.java (at line 6)\n" +
- " @NonNull @Nullable Object o = null;\n" +
- " ^^^^^^^^^\n" +
- "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
+ "----------\n" +
+ "1. ERROR in p2\\Y.java (at line 4)\n" +
+ " void foo(@NonNull @Nullable Object o) {}\n" +
+ " ^^^^^^^^^\n" +
+ "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
+ "----------\n" +
+ "2. ERROR in p2\\Y.java (at line 5)\n" +
+ " @Nullable @NonNull Object bar() {\n" +
+ " ^^^^^^^^\n" +
+ "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
+ "----------\n" +
+ "3. ERROR in p2\\Y.java (at line 6)\n" +
+ " @NonNull @Nullable Object o = null;\n" +
+ " ^^^^^^^^^\n" +
+ "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
"----------\n");
}
@@ -3424,11 +3424,11 @@ public void test_contradictory_annotations_02() {
"}\n"
},
customOptions,
- "----------\n" +
- "1. ERROR in p2\\Y.java (at line 4)\n" +
- " @NonNull @Nullable Object o;\n" +
- " ^^^^^^^^^\n" +
- "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
+ "----------\n" +
+ "1. ERROR in p2\\Y.java (at line 4)\n" +
+ " @NonNull @Nullable Object o;\n" +
+ " ^^^^^^^^^\n" +
+ "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
"----------\n");
}
@@ -3445,11 +3445,11 @@ public void test_contradictory_annotations_03() {
"}\n"
},
customOptions,
- "----------\n" +
- "1. ERROR in p2\\Y.java (at line 4)\n" +
- " @NonNull @Nullable Object[] o;\n" +
- " ^^^^^^^^^\n" +
- "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
+ "----------\n" +
+ "1. ERROR in p2\\Y.java (at line 4)\n" +
+ " @NonNull @Nullable Object[] o;\n" +
+ " ^^^^^^^^^\n" +
+ "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
"----------\n");
}
@@ -3696,19 +3696,19 @@ public void test_message_send_in_control_structure_02() {
"import org.eclipse.jdt.annotation.*;\n" +
"import java.util.*;\n" +
"public class Bug370930 {\n" +
- " void loop(Collection<String> list) {\n" +
- " for(@NonNull String s: list) { // warning here: insufficient info on elements\n" +
- " expectNonNull(s); // no warning here\n" +
- " }\n" +
- " }\n" +
- " \n" +
+ " void loop(Collection<String> list) {\n" +
+ " for(@NonNull String s: list) { // warning here: insufficient info on elements\n" +
+ " expectNonNull(s); // no warning here\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
" void expectNonNull(@NonNull String s) {}\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in Bug370930.java (at line 5)\n" +
- " for(@NonNull String s: list) { // warning here: insufficient info on elements\n" +
+ "----------\n" +
+ "1. WARNING in Bug370930.java (at line 5)\n" +
+ " for(@NonNull String s: list) { // warning here: insufficient info on elements\n" +
" ^^^^\n" +
nullTypeSafety() + "The expression of type 'String' needs unchecked conversion to conform to \'@NonNull String\'\n" +
"----------\n");
@@ -3721,20 +3721,20 @@ public void test_message_send_in_control_structure_02a() {
"Bug370930.java",
"import org.eclipse.jdt.annotation.*;\n" +
"public class Bug370930 {\n" +
- " void loop(String[] array) {\n" +
- " for(@NonNull String s: array) { // warning here: insufficient info on elements\n" +
- " expectNonNull(s); // no warning here\n" +
- " }\n" +
- " }\n" +
- " \n" +
+ " void loop(String[] array) {\n" +
+ " for(@NonNull String s: array) { // warning here: insufficient info on elements\n" +
+ " expectNonNull(s); // no warning here\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
" void expectNonNull(@NonNull String s) {}\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in Bug370930.java (at line 4)\n" +
- " for(@NonNull String s: array) { // warning here: insufficient info on elements\n" +
- " ^^^^^\n" +
+ "----------\n" +
+ "1. WARNING in Bug370930.java (at line 4)\n" +
+ " for(@NonNull String s: array) { // warning here: insufficient info on elements\n" +
+ " ^^^^^\n" +
nullTypeSafety() + "The expression of type 'String' needs unchecked conversion to conform to \'@NonNull String\'\n" +
"----------\n");
}
@@ -3746,20 +3746,20 @@ public void test_message_send_in_control_structure_03() {
"import org.eclipse.jdt.annotation.*;\n" +
"import java.util.*;\n" +
"public class Bug370930 {\n" +
- " void loop(Collection<String> list) {\n" +
- " for(@Nullable String s: list) {\n" +
- " expectNonNull(s); // warning here\n" +
- " }\n" +
- " }\n" +
- " \n" +
+ " void loop(Collection<String> list) {\n" +
+ " for(@Nullable String s: list) {\n" +
+ " expectNonNull(s); // warning here\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
" void expectNonNull(@NonNull String s) {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Bug370930.java (at line 6)\n" +
- " expectNonNull(s); // warning here\n" +
- " ^\n" +
- mismatch_NonNull_Nullable("String") +
+ "----------\n" +
+ "1. ERROR in Bug370930.java (at line 6)\n" +
+ " expectNonNull(s); // warning here\n" +
+ " ^\n" +
+ mismatch_NonNull_Nullable("String") +
"----------\n");
}
public void test_assignment_expression_1() {
@@ -3788,7 +3788,7 @@ public void test_assignment_expression_1() {
},
customOptions,
- "");
+ "");
}
// a nonnull variable is dereferenced in a method of a nested type
public void test_nesting_1() {
@@ -3874,13 +3874,13 @@ public void test_options_01() {
runConformTestWithLibs(
new String[] {
"ContainingInner2.java",
- "public class ContainingInner2 {\n" +
- " public ContainingInner2 (@org.eclipse.jdt.annotation.NonNull Object o) {\n" +
- " }\n" +
- " public class Inner {\n" +
- " public <T> Inner (@org.eclipse.jdt.annotation.NonNull T o) {\n" +
- " }\n" +
- " }\n" +
+ "public class ContainingInner2 {\n" +
+ " public ContainingInner2 (@org.eclipse.jdt.annotation.NonNull Object o) {\n" +
+ " }\n" +
+ " public class Inner {\n" +
+ " public <T> Inner (@org.eclipse.jdt.annotation.NonNull T o) {\n" +
+ " }\n" +
+ " }\n" +
"}\n",
},
null /*customOptions*/,
@@ -3912,25 +3912,25 @@ public void test_options_02() {
" Object p = o;\n" +
" if (p == null)\n" +
" p.toString();\n" +
- " }\n" +
+ " }\n" +
"}\n",
},
customOptions,
- "----------\n" +
- "1. ERROR in Test.java (at line 3)\n" +
- " o = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 5)\n" +
- " if (p == null)\n" +
- " ^\n" +
- "Null comparison always yields false: The variable p cannot be null at this location\n" +
- "----------\n" +
- "3. WARNING in Test.java (at line 6)\n" +
- " p.toString();\n" +
- " ^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 3)\n" +
+ " o = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 5)\n" +
+ " if (p == null)\n" +
+ " ^\n" +
+ "Null comparison always yields false: The variable p cannot be null at this location\n" +
+ "----------\n" +
+ "3. WARNING in Test.java (at line 6)\n" +
+ " p.toString();\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n");
}
// test setting null spec violations to "warning"
@@ -3946,25 +3946,25 @@ public void test_options_03() {
" Object p = o;\n" +
" if (p == null)\n" +
" p.toString();\n" +
- " }\n" +
+ " }\n" +
"}\n",
},
customOptions,
- "----------\n" +
- "1. WARNING in Test.java (at line 3)\n" +
- " o = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 5)\n" +
- " if (p == null)\n" +
- " ^\n" +
- "Null comparison always yields false: The variable p cannot be null at this location\n" +
- "----------\n" +
- "3. WARNING in Test.java (at line 6)\n" +
- " p.toString();\n" +
- " ^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. WARNING in Test.java (at line 3)\n" +
+ " o = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 5)\n" +
+ " if (p == null)\n" +
+ " ^\n" +
+ "Null comparison always yields false: The variable p cannot be null at this location\n" +
+ "----------\n" +
+ "3. WARNING in Test.java (at line 6)\n" +
+ " p.toString();\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n");
}
// access to a non-null field
@@ -4030,11 +4030,11 @@ public void test_nonnull_field_2a() {
"}\n"
},
null /*customOptions*/,
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " X (boolean b) { // only potentially initialized\n" +
- " ^^^^^^^^^^^^^\n" +
- "The @NonNull field o may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " X (boolean b) { // only potentially initialized\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The @NonNull field o may not have been initialized\n" +
"----------\n");
}
@@ -4060,11 +4060,11 @@ public void test_nonnull_field_2b() {
"}\n"
},
null /*customOptions*/,
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " X (Color c) { // only potentially initialized\n" +
- " ^^^^^^^^^^^\n" +
- "The @NonNull field o may not have been initialized. Note that a problem regarding missing \'default:\' on \'switch\' has been suppressed, which is perhaps related to this problem\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " X (Color c) { // only potentially initialized\n" +
+ " ^^^^^^^^^^^\n" +
+ "The @NonNull field o may not have been initialized. Note that a problem regarding missing \'default:\' on \'switch\' has been suppressed, which is perhaps related to this problem\n" +
"----------\n");
}
@@ -4084,11 +4084,11 @@ public void test_nonnull_field_2c() {
"}\n"
},
null /*customOptions*/,
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " static @NonNull Object o;\n" +
- " ^\n" +
- "The @NonNull field o may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " static @NonNull Object o;\n" +
+ " ^\n" +
+ "The @NonNull field o may not have been initialized\n" +
"----------\n");
}
@@ -4143,11 +4143,11 @@ public void test_nonnull_field_3() {
"}\n"
},
null /*customOptions*/,
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " @NonNull Object o = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " @NonNull Object o = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
"----------\n");
}
// a non-null field is assigned to null
@@ -4168,16 +4168,16 @@ public void test_nonnull_field_4() {
"}\n"
},
null /*customOptions*/,
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " o = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " this.o = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " o = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " this.o = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
"----------\n");
}
// a non-null field is checked for null
@@ -4198,14 +4198,14 @@ public void test_nonnull_field_5() {
"}\n"
},
null /*customOptions*/,
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " return o == null;\n" +
- " ^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " return o == null;\n" +
+ " ^\n" +
checkAlwaysFalse_nonnull("The field o", "Object") +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " return this.o != null;\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " return this.o != null;\n" +
" ^\n" +
redundant_check_nonnull("The field o", "@NonNull Object") +
"----------\n");
@@ -4229,15 +4229,15 @@ public void test_nonnull_field_6() {
"}\n"
},
null /*customOptions*/,
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " if (o != null)\n" +
- " ^\n" +
- redundant_check_nonnull("The field o", "@NonNull Object") +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " return this.o == null;\n" +
- " ^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " if (o != null)\n" +
+ " ^\n" +
+ redundant_check_nonnull("The field o", "@NonNull Object") +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " return this.o == null;\n" +
+ " ^\n" +
checkAlwaysFalse_nonnull("The field o", "Object") +
"----------\n");
}
@@ -4271,16 +4271,16 @@ public void test_nonnull_field_7() {
"}\n"
},
null /*customOptions*/,
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " if (Objects.o != null) // redundant\n" +
- " ^\n" +
- redundant_check_nonnull("The field o", "@NonNull Object") +
- "----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " if (null != Objects.o) // redundant\n" +
- " ^\n" +
- redundant_check_nonnull("The field o", "@NonNull Object") +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " if (Objects.o != null) // redundant\n" +
+ " ^\n" +
+ redundant_check_nonnull("The field o", "@NonNull Object") +
+ "----------\n" +
+ "2. ERROR in X.java (at line 13)\n" +
+ " if (null != Objects.o) // redundant\n" +
+ " ^\n" +
+ redundant_check_nonnull("The field o", "@NonNull Object") +
"----------\n");
}
@@ -4307,16 +4307,16 @@ public void test_nonnull_field_8() {
"}\n"
},
null /*customOptions*/,
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " if (objs.o == null) // always false\n" +
- " ^\n" +
- checkAlwaysFalse_nonnull("The field o", "Object") +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " System.out.print(\"not null\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " if (objs.o == null) // always false\n" +
+ " ^\n" +
+ checkAlwaysFalse_nonnull("The field o", "Object") +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " System.out.print(\"not null\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n");
}
@@ -4347,16 +4347,16 @@ public void test_nonnull_field_9() {
"}\n"
},
null /*customOptions*/,
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " if (this.objs.o != null) // redundant\n" +
- " ^\n" +
- redundant_check_nonnull("The field o", "@NonNull Object") +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " if (getObjs().o != null) // redundant\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " if (this.objs.o != null) // redundant\n" +
" ^\n" +
- redundant_check_nonnull("The field o", "@NonNull Object") +
+ redundant_check_nonnull("The field o", "@NonNull Object") +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " if (getObjs().o != null) // redundant\n" +
+ " ^\n" +
+ redundant_check_nonnull("The field o", "@NonNull Object") +
"----------\n");
}
@@ -4380,16 +4380,16 @@ public void test_nonnull_field_11() {
"}\n"
},
null /*customOptions*/,
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " o = x;\n" +
- " ^\n" +
- mismatch_NonNull_Nullable("Object") +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " objs.o = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " o = x;\n" +
+ " ^\n" +
+ mismatch_NonNull_Nullable("Object") +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " objs.o = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
"----------\n");
}
@@ -4405,11 +4405,11 @@ public void test_nonnull_field_12() {
"}\n"
},
null /*customOptions*/,
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " @NonNull int o = 1;\n" +
- " ^^^^^^^^\n" +
- "The nullness annotation @NonNull is not applicable for the primitive type int\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " @NonNull int o = 1;\n" +
+ " ^^^^^^^^\n" +
+ "The nullness annotation @NonNull is not applicable for the primitive type int\n" +
"----------\n");
}
@@ -4544,16 +4544,16 @@ public void test_nonnull_field_16() {
"}\n",
},
null /*customOptions*/,
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " @Inject(optional=true) @NonNull Object o;\n" +
- " ^\n" +
- "The @NonNull field o may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " @Inject(optional=true) String s;\n" +
- " ^\n" +
- "The @NonNull field s may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " @Inject(optional=true) @NonNull Object o;\n" +
+ " ^\n" +
+ "The @NonNull field o may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " @Inject(optional=true) String s;\n" +
+ " ^\n" +
+ "The @NonNull field s may not have been initialized\n" +
"----------\n");
}
@@ -4575,11 +4575,11 @@ public void test_nonnull_field_17() {
"}\n",
},
null /*customOptions*/,
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " @NonNull @Inject static String s; // warn since injection of static field is less reliable\n" +
- " ^\n" +
- "The @NonNull field s may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " @NonNull @Inject static String s; // warn since injection of static field is less reliable\n" +
+ " ^\n" +
+ "The @NonNull field s may not have been initialized\n" +
"----------\n");
}
@@ -4598,11 +4598,11 @@ public void test_nullable_field_1() {
"}\n"
},
null /*customOptions*/,
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " return this.o.toString();\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " return this.o.toString();\n" +
" ^\n" +
- potNPE_nullable("The field o") +
+ potNPE_nullable("The field o") +
"----------\n");
}
// access to a nullable field - single name reference
@@ -4620,10 +4620,10 @@ public void test_nullable_field_2() {
"}\n"
},
null /*customOptions*/,
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " return o.toString();\n" +
- " ^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " return o.toString();\n" +
+ " ^\n" +
potNPE_nullable("The field o") +
"----------\n");
}
@@ -4719,16 +4719,16 @@ public void test_nullable_field_4() {
"}\n"
},
options /*customOptions*/,
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " String local = o.toString();\n" +
- " ^\n" +
- potNPE_nullable("The field o") +
- "----------\n" +
- "2. ERROR in X.java (at line 15)\n" +
- " return this.o.toString(); // warn here\n" +
- " ^\n" +
- potNPE_nullable("The field o") +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " String local = o.toString();\n" +
+ " ^\n" +
+ potNPE_nullable("The field o") +
+ "----------\n" +
+ "2. ERROR in X.java (at line 15)\n" +
+ " return this.o.toString(); // warn here\n" +
+ " ^\n" +
+ potNPE_nullable("The field o") +
"----------\n");
}
@@ -4757,11 +4757,11 @@ public void test_nullable_field_5() {
"}\n"
},
null /*customOptions*/,
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " return y.z.o.toString(); // pot.NPE on z\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " return y.z.o.toString(); // pot.NPE on z\n" +
" ^\n" +
- potNPE_nullable("The field z") +
+ potNPE_nullable("The field z") +
"----------\n");
}
@@ -4791,16 +4791,16 @@ public void test_nullable_field_6() {
"}\n"
},
null /*customOptions*/,
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " return y.z.o.toString(); // pot.NPE on y and o\n" +
- " ^\n" +
- potNPE_nullable("The field y") +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " return y.z.o.toString(); // pot.NPE on y and o\n" +
- " ^\n" +
- potNPE_nullable("The field o") +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " return y.z.o.toString(); // pot.NPE on y and o\n" +
+ " ^\n" +
+ potNPE_nullable("The field y") +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " return y.z.o.toString(); // pot.NPE on y and o\n" +
+ " ^\n" +
+ potNPE_nullable("The field o") +
"----------\n");
}
@@ -4824,16 +4824,16 @@ public void test_nullable_field_7() {
"}\n"
},
null /*customOptions*/,
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " return this.y.o.toString(); // pot.NPE on y and o\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " return this.y.o.toString(); // pot.NPE on y and o\n" +
" ^\n" +
- potNPE_nullable("The field y") +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " return this.y.o.toString(); // pot.NPE on y and o\n" +
+ potNPE_nullable("The field y") +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " return this.y.o.toString(); // pot.NPE on y and o\n" +
" ^\n" +
- potNPE_nullable("The field o") +
+ potNPE_nullable("The field o") +
"----------\n");
}
@@ -4869,12 +4869,12 @@ public void test_nullable_field_9() {
"}\n"
},
null /*customOptions*/,
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " @Nullable int i;\n" +
- " ^^^^^^^^^\n" +
- "The nullness annotation @Nullable is not applicable for the primitive type int\n" +
- "----------\n");
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " @Nullable int i;\n" +
+ " ^^^^^^^^^\n" +
+ "The nullness annotation @Nullable is not applicable for the primitive type int\n" +
+ "----------\n");
}
// protected access to nullable fields - different kinds of references
@@ -4942,41 +4942,41 @@ public void test_nullable_field_10b() {
"}\n"
},
options,
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " System.out.println(other.o1.toString());\n" +
- " ^^\n" +
- potNPE_nullable("The field o1") +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " System.out.println(o2.toString());\n" +
- " ^^\n" +
- potNPE_nullable("The field o2") +
- "----------\n" +
- "3. ERROR in X.java (at line 12)\n" +
- " System.out.println(this.o2.toString());\n" +
- " ^^\n" +
- potNPE_nullable("The field o2") +
- "----------\n" +
- "4. ERROR in X.java (at line 13)\n" +
- " System.out.println (null != o3 ? o3.toString() : \"nothing\");\n" +
- " ^^\n" +
- potNPE_nullable("The field o3") +
- "----------\n" +
- "5. ERROR in X.java (at line 15)\n" +
- " System.out.println(x.o1.toString());\n" +
- " ^^\n" +
- potNPE_nullable("The field o1") +
- "----------\n" +
- "6. ERROR in X.java (at line 17)\n" +
- " System.out.println(this.x.o1.toString());\n" +
- " ^^\n" +
- potNPE_nullable("The field o1") +
- "----------\n" +
- "7. ERROR in X.java (at line 19)\n" +
- " System.out.println(this.x.o1.toString());\n" +
- " ^^\n" +
- potNPE_nullable("The field o1") +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " System.out.println(other.o1.toString());\n" +
+ " ^^\n" +
+ potNPE_nullable("The field o1") +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " System.out.println(o2.toString());\n" +
+ " ^^\n" +
+ potNPE_nullable("The field o2") +
+ "----------\n" +
+ "3. ERROR in X.java (at line 12)\n" +
+ " System.out.println(this.o2.toString());\n" +
+ " ^^\n" +
+ potNPE_nullable("The field o2") +
+ "----------\n" +
+ "4. ERROR in X.java (at line 13)\n" +
+ " System.out.println (null != o3 ? o3.toString() : \"nothing\");\n" +
+ " ^^\n" +
+ potNPE_nullable("The field o3") +
+ "----------\n" +
+ "5. ERROR in X.java (at line 15)\n" +
+ " System.out.println(x.o1.toString());\n" +
+ " ^^\n" +
+ potNPE_nullable("The field o1") +
+ "----------\n" +
+ "6. ERROR in X.java (at line 17)\n" +
+ " System.out.println(this.x.o1.toString());\n" +
+ " ^^\n" +
+ potNPE_nullable("The field o1") +
+ "----------\n" +
+ "7. ERROR in X.java (at line 19)\n" +
+ " System.out.println(this.x.o1.toString());\n" +
+ " ^^\n" +
+ potNPE_nullable("The field o1") +
"----------\n");
}
@@ -5058,11 +5058,11 @@ public void test_nullable_field_10d() {
"}\n"
},
options,
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " System.out.println(o1.toString()); // info is expired\n" +
- " ^^\n" +
- potNPE_nullable("The field o1") +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " System.out.println(o1.toString()); // info is expired\n" +
+ " ^^\n" +
+ potNPE_nullable("The field o1") +
"----------\n");
}
@@ -5094,31 +5094,31 @@ public void test_nullable_field_10e() {
"}\n"
},
options,
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " void bar(Object o2) {\n" +
- " ^^\n" +
- "The parameter o2 is hiding a field from type Y\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " System.out.println(this.o2.toString()); // field access is not protected\n" +
- " ^^\n" +
- potNPE_nullable("The field o2") +
- "----------\n" +
- "3. WARNING in X.java (at line 12)\n" +
- " Y o1 = new Y();\n" +
- " ^^\n" +
- "The local variable o1 is hiding a field from type X\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 14)\n" +
- " System.out.println(this.o1.o2.toString()); // field access via other field not protected\n" +
- " ^^\n" +
- potNPE_nullable("The field o2") +
- "----------\n" +
- "5. ERROR in X.java (at line 16)\n" +
- " System.out.println(o1.o2.toString()); // field access via local not protected\n" +
- " ^^\n" +
- potNPE_nullable("The field o2") +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " void bar(Object o2) {\n" +
+ " ^^\n" +
+ "The parameter o2 is hiding a field from type Y\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " System.out.println(this.o2.toString()); // field access is not protected\n" +
+ " ^^\n" +
+ potNPE_nullable("The field o2") +
+ "----------\n" +
+ "3. WARNING in X.java (at line 12)\n" +
+ " Y o1 = new Y();\n" +
+ " ^^\n" +
+ "The local variable o1 is hiding a field from type X\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 14)\n" +
+ " System.out.println(this.o1.o2.toString()); // field access via other field not protected\n" +
+ " ^^\n" +
+ potNPE_nullable("The field o2") +
+ "----------\n" +
+ "5. ERROR in X.java (at line 16)\n" +
+ " System.out.println(o1.o2.toString()); // field access via local not protected\n" +
+ " ^^\n" +
+ potNPE_nullable("The field o2") +
"----------\n");
}
@@ -5143,16 +5143,16 @@ public void test_nullable_field_10f() {
"}\n"
},
options,
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " if (o1 != null && o1 != null) // second term is redundant\n" +
- " ^^\n" +
- "Redundant null check: The field o1 cannot be null at this location (ignoring concurrency)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " if (o1 != null) // this if is redundant\n" +
- " ^^\n" +
- "Redundant null check: The field o1 cannot be null at this location (ignoring concurrency)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " if (o1 != null && o1 != null) // second term is redundant\n" +
+ " ^^\n" +
+ "Redundant null check: The field o1 cannot be null at this location (ignoring concurrency)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " if (o1 != null) // this if is redundant\n" +
+ " ^^\n" +
+ "Redundant null check: The field o1 cannot be null at this location (ignoring concurrency)\n" +
"----------\n");
}
@@ -5164,29 +5164,29 @@ public void test_nullable_field_11() {
new String[] {
"X.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "class X {\n" +
- " @Nullable Object o;\n" +
- " public @NonNull Object foo(X x) {\n" +
- " return x.o != null ? x.o : new Object();\n" +
- " }\n" +
- " public void goo(X x) {\n" +
- " if (x.o != null) {\n" +
- " x.o.toString();\n" +
- " }\n" +
- " }\n" +
- " public void boo(X x) {\n" +
- " if (x.o instanceof String) {\n" +
- " x.o.toString();\n" +
- " }\n" +
- " }\n" +
- " public void zoo(X x) {\n" +
- " x.o = new Object();\n" +
- " System.out.println(\"hashCode of new Object = \" + x.o.hashCode());\n" +
- " }\n" +
- " public void doo(X x) {\n" +
- " x.o = foo(x); // foo is guaranteed to return @NonNull Object.\n" +
- " System.out.println(\"hashCode of new Object = \" + x.o.hashCode());\n" +
- " }\n" +
+ "class X {\n" +
+ " @Nullable Object o;\n" +
+ " public @NonNull Object foo(X x) {\n" +
+ " return x.o != null ? x.o : new Object();\n" +
+ " }\n" +
+ " public void goo(X x) {\n" +
+ " if (x.o != null) {\n" +
+ " x.o.toString();\n" +
+ " }\n" +
+ " }\n" +
+ " public void boo(X x) {\n" +
+ " if (x.o instanceof String) {\n" +
+ " x.o.toString();\n" +
+ " }\n" +
+ " }\n" +
+ " public void zoo(X x) {\n" +
+ " x.o = new Object();\n" +
+ " System.out.println(\"hashCode of new Object = \" + x.o.hashCode());\n" +
+ " }\n" +
+ " public void doo(X x) {\n" +
+ " x.o = foo(x); // foo is guaranteed to return @NonNull Object.\n" +
+ " System.out.println(\"hashCode of new Object = \" + x.o.hashCode());\n" +
+ " }\n" +
"}\n"
},
options,
@@ -5202,29 +5202,29 @@ public void test_nullable_field_11a() {
new String[] {
"X.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "class X {\n" +
- " @Nullable Object o;\n" +
- " public @NonNull Object foo() {\n" +
- " return o != null ? o : new Object();\n" +
- " }\n" +
- " public void goo() {\n" +
- " if (o != null) {\n" +
- " o.toString();\n" +
- " }\n" +
- " }\n" +
- " public void boo() {\n" +
- " if (o instanceof String) {\n" +
- " o.toString();\n" +
- " }\n" +
- " }\n" +
- " public void zoo() {\n" +
- " o = new Object();\n" +
- " System.out.println(\"hashCode of new Object = \" + o.hashCode());\n" +
- " }\n" +
- " public void doo() {\n" +
- " o = foo(); // foo is guaranteed to return @NonNull Object.\n" +
- " System.out.println(\"hashCode of new Object = \" + o.hashCode());\n" +
- " }\n" +
+ "class X {\n" +
+ " @Nullable Object o;\n" +
+ " public @NonNull Object foo() {\n" +
+ " return o != null ? o : new Object();\n" +
+ " }\n" +
+ " public void goo() {\n" +
+ " if (o != null) {\n" +
+ " o.toString();\n" +
+ " }\n" +
+ " }\n" +
+ " public void boo() {\n" +
+ " if (o instanceof String) {\n" +
+ " o.toString();\n" +
+ " }\n" +
+ " }\n" +
+ " public void zoo() {\n" +
+ " o = new Object();\n" +
+ " System.out.println(\"hashCode of new Object = \" + o.hashCode());\n" +
+ " }\n" +
+ " public void doo() {\n" +
+ " o = foo(); // foo is guaranteed to return @NonNull Object.\n" +
+ " System.out.println(\"hashCode of new Object = \" + o.hashCode());\n" +
+ " }\n" +
"}\n"
},
options,
@@ -5258,26 +5258,26 @@ public void test_nullable_field_12() {
"}\n"
},
options,
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " System.out.println(goo()+other.o1.toString()); // warn here: expired by call to goo()\n" +
- " ^^\n" +
- potNPE_nullable("The field o1") +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " System.out.println(goo()+other.o1.toString()); // warn here: expired by call to goo()\n" +
+ " ^^\n" +
+ potNPE_nullable("The field o1") +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
" System.out.println(o2.toString()); // warn here: not protected\n" +
- " ^^\n" +
+ " ^^\n" +
potNPE_nullable("The field o2") +
"----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " System.out.println(o3.toString()); // warn here: expired by empty statement\n" +
- " ^^\n" +
- potNPE_nullable("The field o3") +
- "----------\n" +
- "4. ERROR in X.java (at line 13)\n" +
- " System.out.println(o4.toString()); // warn here: expired by call to hoo()\n" +
- " ^^\n" +
- potNPE_nullable("The field o4") +
+ "3. ERROR in X.java (at line 11)\n" +
+ " System.out.println(o3.toString()); // warn here: expired by empty statement\n" +
+ " ^^\n" +
+ potNPE_nullable("The field o3") +
+ "----------\n" +
+ "4. ERROR in X.java (at line 13)\n" +
+ " System.out.println(o4.toString()); // warn here: expired by call to hoo()\n" +
+ " ^^\n" +
+ potNPE_nullable("The field o4") +
"----------\n");
}
@@ -5301,11 +5301,11 @@ public void test_nullable_field_13() {
"}\n"
},
options,
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " this.o2 = other.o1; // warn here: assign @Nullable to @NonNull\n" +
- " ^^^^^^^^\n" +
- mismatch_NonNull_Nullable("Object") +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " this.o2 = other.o1; // warn here: assign @Nullable to @NonNull\n" +
+ " ^^^^^^^^\n" +
+ mismatch_NonNull_Nullable("Object") +
"----------\n");
}
@@ -5350,11 +5350,11 @@ public void test_nullable_field_14a() {
"}\n"
},
options,
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " return this.o.toString(); // warn here, check has no effect\n" +
- " ^\n" +
- potNPE_nullable("The field o") +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " return this.o.toString(); // warn here, check has no effect\n" +
+ " ^\n" +
+ potNPE_nullable("The field o") +
"----------\n");
}
@@ -5365,35 +5365,35 @@ public void test_nullable_field_15() {
"X.java",
"import org.eclipse.jdt.annotation.*;\n" +
"public class X {\n" +
- " @Nullable\n" +
- " private Object nullable;\n" +
- "\n" +
- " public void test() {\n" +
- " if (nullable instanceof Number) {\n" +
- " ((Number)nullable).intValue(); // A\n" +
- " }\n" +
- " if (nullable != null) {\n" +
- " nullable.toString(); // B\n" +
- " }\n" +
- " nullable.toString(); // C\n" +
+ " @Nullable\n" +
+ " private Object nullable;\n" +
+ "\n" +
+ " public void test() {\n" +
+ " if (nullable instanceof Number) {\n" +
+ " ((Number)nullable).intValue(); // A\n" +
+ " }\n" +
+ " if (nullable != null) {\n" +
+ " nullable.toString(); // B\n" +
+ " }\n" +
+ " nullable.toString(); // C\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " ((Number)nullable).intValue(); // A\n" +
- " ^^^^^^^^\n" +
- potNPE_nullable("The field nullable") +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " nullable.toString(); // B\n" +
- " ^^^^^^^^\n" +
- potNPE_nullable("The field nullable") +
- "----------\n" +
- "3. ERROR in X.java (at line 13)\n" +
- " nullable.toString(); // C\n" +
- " ^^^^^^^^\n" +
- potNPE_nullable("The field nullable") +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " ((Number)nullable).intValue(); // A\n" +
+ " ^^^^^^^^\n" +
+ potNPE_nullable("The field nullable") +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " nullable.toString(); // B\n" +
+ " ^^^^^^^^\n" +
+ potNPE_nullable("The field nullable") +
+ "----------\n" +
+ "3. ERROR in X.java (at line 13)\n" +
+ " nullable.toString(); // C\n" +
+ " ^^^^^^^^\n" +
+ potNPE_nullable("The field nullable") +
"----------\n");
}
// access to a nullable field - dereference after check in while loop
@@ -5409,35 +5409,35 @@ public void test_nullable_field_16() {
"import org.eclipse.jdt.annotation.*;\n" +
"public class X {\n" +
" @Nullable Object prop;\n" +
- " void testWhileAlone(){\n" +
- " while(this.prop != null) {\n" +
- " test(this.prop);\n" +
- " }\n" +
+ " void testWhileAlone(){\n" +
+ " while(this.prop != null) {\n" +
+ " test(this.prop);\n" +
+ " }\n" +
" }\n" +
" @Nullable Object other;\n" +
" void testTwoFields() {\n" +
" boolean b = this.other != null;\n" + // we had funny interaction between analyses of other & prop
- " while(this.prop != null) {\n" +
- " test(this.prop);\n" +
- " }\n" +
+ " while(this.prop != null) {\n" +
+ " test(this.prop);\n" +
+ " }\n" +
" }\n" +
" void testWhileInIf() {\n" +
" if (this.prop != null) {\n" +
- " while(this.other != null) {\n" +
+ " while(this.other != null) {\n" +
" test(this.prop);\n" + // no longer protected by outer if
- " }\n" +
+ " }\n" +
" }\n" +
" }\n" +
- " void test(@NonNull Object param){\n" +
- " assert param != null;\n" +
+ " void test(@NonNull Object param){\n" +
+ " assert param != null;\n" +
" }" +
"}\n"
},
options /*customOptions*/,
- "----------\n" +
- "1. ERROR in X.java (at line 19)\n" +
- " test(this.prop);\n" +
- " ^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 19)\n" +
+ " test(this.prop);\n" +
+ " ^^^^^^^^^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8
? "Null type mismatch: required '@NonNull Object' but the provided value is specified as @Nullable\n"
: "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'@Nullable Object\'\n") +
@@ -5460,11 +5460,11 @@ public void test_nullable_field_17() {
"}\n"
},
options /*customOptions*/,
- "----------\n" +
- "1. INFO in X.java (at line 5)\n" +
- " return this.o.toString();\n" +
+ "----------\n" +
+ "1. INFO in X.java (at line 5)\n" +
+ " return this.o.toString();\n" +
" ^\n" +
- potNPE_nullable("The field o") +
+ potNPE_nullable("The field o") +
"----------\n");
}
// an enum is declared within the scope of a null-default
@@ -5521,7 +5521,7 @@ public void testBug372011() {
new String[] {
"X.java",
"import p11.T11;\n" +
- "import p12.T12;\n" +
+ "import p12.T12;\n" +
"import p12.T12a;\n" +
"import p12.Public;\n" +
"public class X {\n" +
@@ -5538,26 +5538,26 @@ public void testBug372011() {
" return new T11().retSomething();\n" + // don't complain
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " new T11().t11foo(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " new T12().new T122().foo122(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " o.bar(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 15)\n" +
- " new T12().new T122().new T1222().foo1222(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " new T11().t11foo(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " new T12().new T122().foo122(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " o.bar(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 15)\n" +
+ " new T12().new T122().new T1222().foo1222(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
"----------\n",
libs,
true /* shouldFlush*/,
@@ -5581,7 +5581,7 @@ public void testBug374129() {
public static class C1binInner {
public String getId(String id, @Nullable String n) {
return id;
- }
+ }
}
}
p2bin/C2bin.java:
@@ -5597,7 +5597,7 @@ public void testBug374129() {
public static class C2binInner {
public String getId(String id, @Nullable String n) {
return id;
- }
+ }
}
}
p2bin/C3bin.java:
@@ -5607,7 +5607,7 @@ public void testBug374129() {
public class C3bin {
@NonNullByDefault public String getId(String id, @Nullable String n) {
return id;
- }
+ }
}
*/
String[] libs = new String[this.LIBS.length + 1];
@@ -5616,61 +5616,61 @@ public void testBug374129() {
runNegativeNullTest(
new String[] {
"bug374129/Test.java",
- "package bug374129;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "import p1bin.C1bin;\n" +
- "import p1bin.C1bin.C1binInner;\n" +
- "import p2bin.C2bin;\n" +
- "import p2bin.C2bin.C2binInner;\n" +
- "import p2bin.C3bin;\n" +
- "\n" +
- "public class Test {\n" +
- " static C1bin c1 = new C1bin();\n" +
- " static C1binInner c1i = new C1binInner();\n" +
- " static C2bin c2 = new C2bin();\n" +
- " static C2binInner c2i = new C2binInner();\n" +
- " static C3bin c3 = new C3bin();\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " @Nullable String n = getN();\n" +
- " @NonNull String s;\n" +
- " s = c1.getId(n, n); // error on first arg (package default)\n" +
- " s = c1i.getId(n, n); // error on first arg (package default propagated into inner)\n" +
- " s = c2.getId(n, n); // error on first arg (type default)\n" +
- " s = c2i.getId(n, n); // no arg error (canceled default), return requires unchecked conversion\n" +
- " s = c3.getId(n, n); // error on first arg (method default)\n" +
- " }\n" +
- " static String getN() { return null; }\n" +
- "}\n" +
+ "package bug374129;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "import p1bin.C1bin;\n" +
+ "import p1bin.C1bin.C1binInner;\n" +
+ "import p2bin.C2bin;\n" +
+ "import p2bin.C2bin.C2binInner;\n" +
+ "import p2bin.C3bin;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " static C1bin c1 = new C1bin();\n" +
+ " static C1binInner c1i = new C1binInner();\n" +
+ " static C2bin c2 = new C2bin();\n" +
+ " static C2binInner c2i = new C2binInner();\n" +
+ " static C3bin c3 = new C3bin();\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " @Nullable String n = getN();\n" +
+ " @NonNull String s;\n" +
+ " s = c1.getId(n, n); // error on first arg (package default)\n" +
+ " s = c1i.getId(n, n); // error on first arg (package default propagated into inner)\n" +
+ " s = c2.getId(n, n); // error on first arg (type default)\n" +
+ " s = c2i.getId(n, n); // no arg error (canceled default), return requires unchecked conversion\n" +
+ " s = c3.getId(n, n); // error on first arg (method default)\n" +
+ " }\n" +
+ " static String getN() { return null; }\n" +
+ "}\n" +
"\n"},
- "----------\n" +
- "1. ERROR in bug374129\\Test.java (at line 22)\n" +
- " s = c1.getId(n, n); // error on first arg (package default)\n" +
- " ^\n" +
- mismatch_NonNull_Nullable("String") +
- "----------\n" +
- "2. ERROR in bug374129\\Test.java (at line 23)\n" +
- " s = c1i.getId(n, n); // error on first arg (package default propagated into inner)\n" +
- " ^\n" +
- mismatch_NonNull_Nullable("String") +
- "----------\n" +
- "3. ERROR in bug374129\\Test.java (at line 24)\n" +
- " s = c2.getId(n, n); // error on first arg (type default)\n" +
- " ^\n" +
- mismatch_NonNull_Nullable("String") +
- "----------\n" +
- "4. WARNING in bug374129\\Test.java (at line 25)\n" +
- " s = c2i.getId(n, n); // no arg error (canceled default), return requires unchecked conversion\n" +
- " ^^^^^^^^^^^^^^^\n" +
- nullTypeSafety() + "The expression of type 'String' needs unchecked conversion to conform to \'@NonNull String\'\n" +
- "----------\n" +
- "5. ERROR in bug374129\\Test.java (at line 26)\n" +
- " s = c3.getId(n, n); // error on first arg (method default)\n" +
- " ^\n" +
- mismatch_NonNull_Nullable("String") +
+ "----------\n" +
+ "1. ERROR in bug374129\\Test.java (at line 22)\n" +
+ " s = c1.getId(n, n); // error on first arg (package default)\n" +
+ " ^\n" +
+ mismatch_NonNull_Nullable("String") +
+ "----------\n" +
+ "2. ERROR in bug374129\\Test.java (at line 23)\n" +
+ " s = c1i.getId(n, n); // error on first arg (package default propagated into inner)\n" +
+ " ^\n" +
+ mismatch_NonNull_Nullable("String") +
+ "----------\n" +
+ "3. ERROR in bug374129\\Test.java (at line 24)\n" +
+ " s = c2.getId(n, n); // error on first arg (type default)\n" +
+ " ^\n" +
+ mismatch_NonNull_Nullable("String") +
+ "----------\n" +
+ "4. WARNING in bug374129\\Test.java (at line 25)\n" +
+ " s = c2i.getId(n, n); // no arg error (canceled default), return requires unchecked conversion\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ nullTypeSafety() + "The expression of type 'String' needs unchecked conversion to conform to \'@NonNull String\'\n" +
+ "----------\n" +
+ "5. ERROR in bug374129\\Test.java (at line 26)\n" +
+ " s = c3.getId(n, n); // error on first arg (method default)\n" +
+ " ^\n" +
+ mismatch_NonNull_Nullable("String") +
"----------\n",
libs,
true /* shouldFlush*/,
@@ -5692,7 +5692,7 @@ public void testBug385626_1() {
" if (j != null) {\n" +
" @NonNull Integer j1 = i; // bogus error was here\n" +
" }\n" +
- " }\n" +
+ " }\n" +
" }\n" +
" }\n" +
" }\n" +
@@ -5721,7 +5721,7 @@ public void testBug385626_2() {
" if (j != null) {\n" +
" @NonNull Integer j1 = i; // bogus error was here\n" +
" }\n" +
- " }\n" +
+ " }\n" +
" }\n" +
" }\n" +
" }\n" +
@@ -5737,16 +5737,16 @@ public void testBug388630_1() {
runConformTestWithLibs(
new String[] {
"C0.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "public class C0 {\n" +
- " C0 (@NonNull Object o) { }\n" +
- " void test() { }\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "public class C0 {\n" +
+ " C0 (@NonNull Object o) { }\n" +
+ " void test() { }\n" +
"}\n",
"X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " new C0(\"\") { }.test();\n" +
- " }\n" +
+ "public class X {\n" +
+ " void foo() {\n" +
+ " new C0(\"\") { }.test();\n" +
+ " }\n" +
"}\n"
},
null,
@@ -5759,31 +5759,31 @@ public void testBug388630_2() {
runNegativeTestWithLibs(
new String[] {
"C0.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "public class C0 {\n" +
- " C0 (@NonNull Object o) { }\n" +
- " void test() { }\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "public class C0 {\n" +
+ " C0 (@NonNull Object o) { }\n" +
+ " void test() { }\n" +
"}\n",
"X.java",
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "public class X {\n" +
- " void foo(final @Nullable Object a) {\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "public class X {\n" +
+ " void foo(final @Nullable Object a) {\n" +
" new C0(\"\") {\n" +
" @Override\n" +
" void test() {\n" +
" System.out.println(a.toString());\n" +
" super.test();\n" +
" }\n" +
- " }.test();\n" +
- " }\n" +
+ " }.test();\n" +
+ " }\n" +
"}\n"
},
null,
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " System.out.println(a.toString());\n" +
- " ^\n" +
- variableMayBeNull("a") +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " System.out.println(a.toString());\n" +
+ " ^\n" +
+ variableMayBeNull("a") +
"----------\n");
}
@@ -5862,23 +5862,23 @@ public void testBug388281_01() {
new String[] {
"Client.java",
"import c.C1;\n" +
- "public class Client {\n" +
- " void test(C1 c) {\n" +
- " String s = c.m2(null); // (3)\n" +
- " System.out.println(s.toUpperCase()); // (4)\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Client.java (at line 4)\n" +
- " String s = c.m2(null); // (3)\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in Client.java (at line 5)\n" +
- " System.out.println(s.toUpperCase()); // (4)\n" +
- " ^\n" +
- "Potential null pointer access: The variable s may be null at this location\n" +
+ "public class Client {\n" +
+ " void test(C1 c) {\n" +
+ " String s = c.m2(null); // (3)\n" +
+ " System.out.println(s.toUpperCase()); // (4)\n" +
+ " }\n" +
+ "}\n"
+ },
+ "----------\n" +
+ "1. ERROR in Client.java (at line 4)\n" +
+ " String s = c.m2(null); // (3)\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in Client.java (at line 5)\n" +
+ " System.out.println(s.toUpperCase()); // (4)\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable s may be null at this location\n" +
"----------\n",
libs,
true /* shouldFlush*/,
@@ -5901,46 +5901,46 @@ public void testBug388281_02() {
"package ctest;\n" +
"public class C extends c.C1 {\n" +
" @Override\n" +
- " public Object m1(Object a1) {\n" +
- " System.out.println(a1.toString()); // (1)\n" +
- " return null; // (2)\n" +
+ " public Object m1(Object a1) {\n" +
+ " System.out.println(a1.toString()); // (1)\n" +
+ " return null; // (2)\n" +
" }\n" +
" @Override\n" +
- " public String m2(Object a2) {\n" +
- " System.out.println(a2.toString());\n" +
- " return null;\n" +
+ " public String m2(Object a2) {\n" +
+ " System.out.println(a2.toString());\n" +
+ " return null;\n" +
" }\n" +
"}\n",
"Client.java",
"import ctest.C;\n" +
- "public class Client {\n" +
- " void test(C c) {\n" +
- " String s = c.m2(null); // (3)\n" +
- " System.out.println(s.toUpperCase()); // (4)\n" +
- " }\n" +
+ "public class Client {\n" +
+ " void test(C c) {\n" +
+ " String s = c.m2(null); // (3)\n" +
+ " System.out.println(s.toUpperCase()); // (4)\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in ctest\\C.java (at line 5)\n" +
- " System.out.println(a1.toString()); // (1)\n" +
+ "----------\n" +
+ "1. ERROR in ctest\\C.java (at line 5)\n" +
+ " System.out.println(a1.toString()); // (1)\n" +
" ^^\n" +
potNPE_nullable_maybenull("The variable a1") +
- "----------\n" +
- "2. ERROR in ctest\\C.java (at line 6)\n" +
- " return null; // (2)\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Client.java (at line 4)\n" +
- " String s = c.m2(null); // (3)\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in Client.java (at line 5)\n" +
- " System.out.println(s.toUpperCase()); // (4)\n" +
- " ^\n" +
- "Potential null pointer access: The variable s may be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in ctest\\C.java (at line 6)\n" +
+ " return null; // (2)\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in Client.java (at line 4)\n" +
+ " String s = c.m2(null); // (3)\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in Client.java (at line 5)\n" +
+ " System.out.println(s.toUpperCase()); // (4)\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable s may be null at this location\n" +
"----------\n",
libs,
true /* shouldFlush*/,
@@ -5962,13 +5962,13 @@ public void testBug388281_03() {
"ctest/C.java",
"package ctest;\n" +
"public class C implements i.I {\n" +
- " public Object m1(Object a1) {\n" +
- " System.out.println(a1.toString()); // (1)\n" +
- " return null; // (2)\n" +
+ " public Object m1(Object a1) {\n" +
+ " System.out.println(a1.toString()); // (1)\n" +
+ " return null; // (2)\n" +
" }\n" +
- " public String m2(Object a2) {\n" +
- " System.out.println(a2.toString());\n" +
- " return null;\n" +
+ " public String m2(Object a2) {\n" +
+ " System.out.println(a2.toString());\n" +
+ " return null;\n" +
" }\n" +
" public Object m1(Object a1, Object a2) {\n" +
" System.out.println(a1.toString()); // (3)\n" +
@@ -5976,19 +5976,19 @@ public void testBug388281_03() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in ctest\\C.java (at line 4)\n" +
- " System.out.println(a1.toString()); // (1)\n" +
+ "----------\n" +
+ "1. ERROR in ctest\\C.java (at line 4)\n" +
+ " System.out.println(a1.toString()); // (1)\n" +
" ^^\n" +
potNPE_nullable_maybenull("The variable a1") +
- "----------\n" +
- "2. ERROR in ctest\\C.java (at line 5)\n" +
- " return null; // (2)\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "3. ERROR in ctest\\C.java (at line 12)\n" +
- " System.out.println(a1.toString()); // (3)\n" +
+ "----------\n" +
+ "2. ERROR in ctest\\C.java (at line 5)\n" +
+ " return null; // (2)\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "3. ERROR in ctest\\C.java (at line 12)\n" +
+ " System.out.println(a1.toString()); // (3)\n" +
" ^^\n" +
potNPE_nullable_maybenull("The variable a1") +
"----------\n",
@@ -6017,31 +6017,31 @@ public void testBug388281_04() {
"package ctest;\n" +
"import org.eclipse.jdt.annotation.*;\n" +
"public class C implements i.I {\n" +
- " public Object m1(@Nullable Object o1, String s2) {\n" +
- " System.out.println(s2.toString()); // (1)\n" +
- " return null; // (2)\n" +
+ " public Object m1(@Nullable Object o1, String s2) {\n" +
+ " System.out.println(s2.toString()); // (1)\n" +
+ " return null; // (2)\n" +
" }\n" +
- " public @NonNull Object m1(String s1, Object o2) {\n" +
- " System.out.println(s1.toString()); // (3)\n" +
- " return new Object();\n" +
+ " public @NonNull Object m1(String s1, Object o2) {\n" +
+ " System.out.println(s1.toString()); // (3)\n" +
+ " return new Object();\n" +
" }\n" +
"}\n"
},
options,
- "----------\n" +
- "1. ERROR in ctest\\C.java (at line 5)\n" +
- " System.out.println(s2.toString()); // (1)\n" +
- " ^^\n" +
+ "----------\n" +
+ "1. ERROR in ctest\\C.java (at line 5)\n" +
+ " System.out.println(s2.toString()); // (1)\n" +
+ " ^^\n" +
variableMayBeNull("s2") +
- "----------\n" +
- "2. ERROR in ctest\\C.java (at line 6)\n" +
- " return null; // (2)\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "3. ERROR in ctest\\C.java (at line 9)\n" +
- " System.out.println(s1.toString()); // (3)\n" +
- " ^^\n" +
+ "----------\n" +
+ "2. ERROR in ctest\\C.java (at line 6)\n" +
+ " return null; // (2)\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "3. ERROR in ctest\\C.java (at line 9)\n" +
+ " System.out.println(s1.toString()); // (3)\n" +
+ " ^^\n" +
variableMayBeNull("s1") +
"----------\n");
}
@@ -6062,41 +6062,41 @@ public void testBug388281_05() {
"ctest/C.java",
"package ctest;\n" +
"public class C implements i2.I2 {\n" +
- " public Object m1(Object a1) {\n" +
- " System.out.println(a1.toString()); // silent\n" +
- " return null; // (1)\n" +
+ " public Object m1(Object a1) {\n" +
+ " System.out.println(a1.toString()); // silent\n" +
+ " return null; // (1)\n" +
" }\n" +
- " public String m2(Object a2) {\n" +
- " System.out.println(a2.toString());\n" +
- " return null; // (2)\n" +
+ " public String m2(Object a2) {\n" +
+ " System.out.println(a2.toString());\n" +
+ " return null; // (2)\n" +
" }\n" +
"}\n",
"Client.java",
"import ctest.C;\n" +
- "public class Client {\n" +
- " void test(C c) {\n" +
- " String s = c.m2(null); // (3)\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in ctest\\C.java (at line 5)\n" +
- " return null; // (1)\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in ctest\\C.java (at line 9)\n" +
- " return null; // (2)\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Client.java (at line 4)\n" +
- " String s = c.m2(null); // (3)\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "public class Client {\n" +
+ " void test(C c) {\n" +
+ " String s = c.m2(null); // (3)\n" +
+ " }\n" +
+ "}\n"
+ },
+ "----------\n" +
+ "1. ERROR in ctest\\C.java (at line 5)\n" +
+ " return null; // (1)\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in ctest\\C.java (at line 9)\n" +
+ " return null; // (2)\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in Client.java (at line 4)\n" +
+ " String s = c.m2(null); // (3)\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
"----------\n",
- libs,
+ libs,
true /* shouldFlush*/,
options);
}
@@ -6120,30 +6120,30 @@ public void testBug388281_06() {
"}\n"
},
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. ERROR in ctest\\C.java (at line 2)\n" +
- " public class C extends c.C2 implements i2.I2A {\n" +
- " ^^^^\n" +
- "The method m2(Object) from C2 cannot implement the corresponding method from I2A due to incompatible nullness constraints\n" +
- "----------\n" +
- "2. ERROR in ctest\\C.java (at line 2)\n" +
- " public class C extends c.C2 implements i2.I2A {\n" +
- " ^^^^\n" +
- "The method m1(Object) from C2 cannot implement the corresponding method from I2A due to incompatible nullness constraints\n" +
+ "----------\n" +
+ "1. ERROR in ctest\\C.java (at line 2)\n" +
+ " public class C extends c.C2 implements i2.I2A {\n" +
+ " ^^^^\n" +
+ "The method m2(Object) from C2 cannot implement the corresponding method from I2A due to incompatible nullness constraints\n" +
+ "----------\n" +
+ "2. ERROR in ctest\\C.java (at line 2)\n" +
+ " public class C extends c.C2 implements i2.I2A {\n" +
+ " ^^^^\n" +
+ "The method m1(Object) from C2 cannot implement the corresponding method from I2A due to incompatible nullness constraints\n" +
"----------\n"
: // at 1.8 we show null type annotations:
- "----------\n" +
- "1. ERROR in ctest\\C.java (at line 2)\n" +
- " public class C extends c.C2 implements i2.I2A {\n" +
- " ^^^^\n" +
- "The method m2(@NonNull Object) from C2 cannot implement the corresponding method from I2A due to incompatible nullness constraints\n" +
- "----------\n" +
- "2. ERROR in ctest\\C.java (at line 2)\n" +
- " public class C extends c.C2 implements i2.I2A {\n" +
- " ^^^^\n" +
- "The method m1(@NonNull Object) from C2 cannot implement the corresponding method from I2A due to incompatible nullness constraints\n" +
+ "----------\n" +
+ "1. ERROR in ctest\\C.java (at line 2)\n" +
+ " public class C extends c.C2 implements i2.I2A {\n" +
+ " ^^^^\n" +
+ "The method m2(@NonNull Object) from C2 cannot implement the corresponding method from I2A due to incompatible nullness constraints\n" +
+ "----------\n" +
+ "2. ERROR in ctest\\C.java (at line 2)\n" +
+ " public class C extends c.C2 implements i2.I2A {\n" +
+ " ^^^^\n" +
+ "The method m1(@NonNull Object) from C2 cannot implement the corresponding method from I2A due to incompatible nullness constraints\n" +
"----------\n"),
- libs,
+ libs,
true /* shouldFlush*/,
options);
}
@@ -6181,29 +6181,29 @@ public void testBug388281_07() {
" System.out.println(result.toString()); // (2)\n" +
" }\n" +
"}\n"
- },
+ },
options,
- "----------\n" +
- "1. ERROR in p2\\Sub.java (at line 6)\n" +
- " public Object m(Object arg) { // (a)+(b) conflict at arg and return\n" +
- " ^^^^^^\n" +
- "The default \'@NonNull\' conflicts with the inherited \'@Nullable\' annotation in the overridden method from Super \n" +
- "----------\n" +
- "2. ERROR in p2\\Sub.java (at line 6)\n" +
- " public Object m(Object arg) { // (a)+(b) conflict at arg and return\n" +
- " ^^^\n" +
- "The default \'@NonNull\' conflicts with the inherited \'@Nullable\' annotation in the overridden method from Super \n" +
- "----------\n" +
- "3. ERROR in p2\\Sub.java (at line 7)\n" +
- " System.out.println(arg.toString()); // (1)\n" +
- " ^^^\n" +
+ "----------\n" +
+ "1. ERROR in p2\\Sub.java (at line 6)\n" +
+ " public Object m(Object arg) { // (a)+(b) conflict at arg and return\n" +
+ " ^^^^^^\n" +
+ "The default \'@NonNull\' conflicts with the inherited \'@Nullable\' annotation in the overridden method from Super \n" +
+ "----------\n" +
+ "2. ERROR in p2\\Sub.java (at line 6)\n" +
+ " public Object m(Object arg) { // (a)+(b) conflict at arg and return\n" +
+ " ^^^\n" +
+ "The default \'@NonNull\' conflicts with the inherited \'@Nullable\' annotation in the overridden method from Super \n" +
+ "----------\n" +
+ "3. ERROR in p2\\Sub.java (at line 7)\n" +
+ " System.out.println(arg.toString()); // (1)\n" +
+ " ^^^\n" +
variableMayBeNull("arg") +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Client.java (at line 4)\n" +
- " System.out.println(result.toString()); // (2)\n" +
- " ^^^^^^\n" +
- "Potential null pointer access: The variable result may be null at this location\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in Client.java (at line 4)\n" +
+ " System.out.println(result.toString()); // (2)\n" +
+ " ^^^^^^\n" +
+ "Potential null pointer access: The variable result may be null at this location\n" +
"----------\n");
}
@@ -6223,15 +6223,15 @@ public void testBug388281_08() {
"import org.eclipse.jdt.annotation.*;\n" +
"@NonNullByDefault\n" +
"public class Ctest implements i2.II {\n" + // note: i2.II.m1(Object,Object) actually has a bug itself: conflicting default & inherited annotations
- " public Object m1(@Nullable Object a1) { // silent: conflict at a1 avoided\n" +
- " return new Object();\n" +
- " }\n" +
- " public String m2(Object a2) { // (a) conflict at return\n" +
- " return null;\n" +
- " }\n" +
+ " public Object m1(@Nullable Object a1) { // silent: conflict at a1 avoided\n" +
+ " return new Object();\n" +
+ " }\n" +
+ " public String m2(Object a2) { // (a) conflict at return\n" +
+ " return null;\n" +
+ " }\n" +
" public String m1(Object o1, Object o2) { // (b) conflict at o1\n" +
- " System.out.println(o1.toString()); // (1) inherited @Nullable\n" +
- " return null; // (2) @NonNullByDefault in i2.II\n" +
+ " System.out.println(o1.toString()); // (1) inherited @Nullable\n" +
+ " return null; // (2) @NonNullByDefault in i2.II\n" +
" }\n" +
"}\n",
"Client.java",
@@ -6241,32 +6241,32 @@ public void testBug388281_08() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in ctest\\Ctest.java (at line 8)\n" +
- " public String m2(Object a2) { // (a) conflict at return\n" +
- " ^^^^^^\n" +
- "The default \'@NonNull\' conflicts with the inherited \'@Nullable\' annotation in the overridden method from I \n" +
- "----------\n" +
- "2. ERROR in ctest\\Ctest.java (at line 11)\n" +
- " public String m1(Object o1, Object o2) { // (b) conflict at o1\n" +
- " ^^\n" +
- "The default \'@NonNull\' conflicts with the inherited \'@Nullable\' annotation in the overridden method from II \n" +
- "----------\n" +
- "3. ERROR in ctest\\Ctest.java (at line 12)\n" +
- " System.out.println(o1.toString()); // (1) inherited @Nullable\n" +
+ "----------\n" +
+ "1. ERROR in ctest\\Ctest.java (at line 8)\n" +
+ " public String m2(Object a2) { // (a) conflict at return\n" +
+ " ^^^^^^\n" +
+ "The default \'@NonNull\' conflicts with the inherited \'@Nullable\' annotation in the overridden method from I \n" +
+ "----------\n" +
+ "2. ERROR in ctest\\Ctest.java (at line 11)\n" +
+ " public String m1(Object o1, Object o2) { // (b) conflict at o1\n" +
+ " ^^\n" +
+ "The default \'@NonNull\' conflicts with the inherited \'@Nullable\' annotation in the overridden method from II \n" +
+ "----------\n" +
+ "3. ERROR in ctest\\Ctest.java (at line 12)\n" +
+ " System.out.println(o1.toString()); // (1) inherited @Nullable\n" +
" ^^\n" +
potNPE_nullable_maybenull("The variable o1") +
- "----------\n" +
- "4. ERROR in ctest\\Ctest.java (at line 13)\n" +
- " return null; // (2) @NonNullByDefault in i2.II\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Client.java (at line 3)\n" +
- " Object result = c.m1(null, null); // (3) 2nd arg @NonNullByDefault from i2.II\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "4. ERROR in ctest\\Ctest.java (at line 13)\n" +
+ " return null; // (2) @NonNullByDefault in i2.II\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in Client.java (at line 3)\n" +
+ " Object result = c.m1(null, null); // (3) 2nd arg @NonNullByDefault from i2.II\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
"----------\n",
libs,
true, // should flush
@@ -6308,28 +6308,28 @@ public void testBug388281_09() {
" return null;\n" +
" }\n" +
"}\n"
- },
+ },
options,
- "----------\n" +
- "1. ERROR in p2\\Sub.java (at line 4)\n" +
- " public Object compatible(Object arg) {\n" +
- " ^^^^^^\n" +
- "Conflict between inherited null annotations \'@Nullable\' declared in I versus \'@NonNull\' declared in Super \n" +
- "----------\n" +
- "2. ERROR in p2\\Sub.java (at line 4)\n" +
- " public Object compatible(Object arg) {\n" +
- " ^^^^^^\n" +
- "Conflict between inherited null annotations \'@NonNull\' declared in I versus \'@Nullable\' declared in Super \n" +
- "----------\n" +
- "3. ERROR in p2\\Sub.java (at line 8)\n" +
- " public Object incompatible(int dummy, Object arg) {\n" +
- " ^^^^^^\n" +
- "Conflict between inherited null annotations \'@NonNull\' declared in I versus \'@Nullable\' declared in Super \n" +
- "----------\n" +
- "4. ERROR in p2\\Sub.java (at line 8)\n" +
- " public Object incompatible(int dummy, Object arg) {\n" +
- " ^^^^^^\n" +
- "Conflict between inherited null annotations \'@Nullable\' declared in I versus \'@NonNull\' declared in Super \n" +
+ "----------\n" +
+ "1. ERROR in p2\\Sub.java (at line 4)\n" +
+ " public Object compatible(Object arg) {\n" +
+ " ^^^^^^\n" +
+ "Conflict between inherited null annotations \'@Nullable\' declared in I versus \'@NonNull\' declared in Super \n" +
+ "----------\n" +
+ "2. ERROR in p2\\Sub.java (at line 4)\n" +
+ " public Object compatible(Object arg) {\n" +
+ " ^^^^^^\n" +
+ "Conflict between inherited null annotations \'@NonNull\' declared in I versus \'@Nullable\' declared in Super \n" +
+ "----------\n" +
+ "3. ERROR in p2\\Sub.java (at line 8)\n" +
+ " public Object incompatible(int dummy, Object arg) {\n" +
+ " ^^^^^^\n" +
+ "Conflict between inherited null annotations \'@NonNull\' declared in I versus \'@Nullable\' declared in Super \n" +
+ "----------\n" +
+ "4. ERROR in p2\\Sub.java (at line 8)\n" +
+ " public Object incompatible(int dummy, Object arg) {\n" +
+ " ^^^^^^\n" +
+ "Conflict between inherited null annotations \'@Nullable\' declared in I versus \'@NonNull\' declared in Super \n" +
"----------\n");
}
@@ -6354,14 +6354,14 @@ public void testBug388281_10() {
" arg = null;\n" +
" }\n" +
"}\n"
- },
+ },
options,
- "----------\n" +
- "1. ERROR in p2\\Sub.java (at line 5)\n" +
- " arg = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n");
+ "----------\n" +
+ "1. ERROR in p2\\Sub.java (at line 5)\n" +
+ " arg = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n");
}
// https://bugs.eclipse.org/382069 - [null] Make the null analysis consider JUnit's assertNotNull similarly to assertions
@@ -6372,7 +6372,7 @@ public void testBug382069_j() {
runNegativeTestWithLibs(
new String[] {
NullReferenceTestAsserts.JUNIT_ASSERT_NAME,
- NullReferenceTestAsserts.JUNIT_ASSERT_CONTENT,
+ NullReferenceTestAsserts.JUNIT_ASSERT_CONTENT,
"X.java",
"import org.eclipse.jdt.annotation.NonNull;\n" +
"public class X {\n" +
@@ -6391,21 +6391,21 @@ public void testBug382069_j() {
" }\n" +
"}\n"},
options,
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " return false; // dead code\n" +
- " ^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " return; // dead code\n" +
- " ^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 14)\n" +
- " return; // dead code\n" +
- " ^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " return false; // dead code\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " return; // dead code\n" +
+ " ^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 14)\n" +
+ " return; // dead code\n" +
+ " ^^^^^^^\n" +
+ "Dead code\n" +
"----------\n");
}
@@ -6418,7 +6418,7 @@ public void testBug382069_k() {
runNegativeTestWithLibs(
new String[] {
NullReferenceTestAsserts.JUNIT_ASSERT_NAME,
- NullReferenceTestAsserts.JUNIT_ASSERT_CONTENT,
+ NullReferenceTestAsserts.JUNIT_ASSERT_CONTENT,
"X.java",
"import org.eclipse.jdt.annotation.Nullable;\n" +
"public class X {\n" +
@@ -6442,11 +6442,11 @@ public void testBug382069_k() {
" }\n" +
"}\n"},
options,
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " return o1.length(); // no longer protected\n" +
- " ^^\n" +
- potNPE_nullable("The field o1") +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " return o1.length(); // no longer protected\n" +
+ " ^^\n" +
+ potNPE_nullable("The field o1") +
"----------\n");
}
//https://bugs.eclipse.org/400761: [compiler][null] null may be return as boolean without a diagnostic
@@ -6456,19 +6456,19 @@ public void test_conditional_expression_1() {
"X.java",
"import org.eclipse.jdt.annotation.*;\n" +
"public class X {\n" +
- " boolean badFunction5(int i) {\n" +
- " // expected a potential null problem:\n" +
- " return i > 0 ? true : getBoolean();\n" +
+ " boolean badFunction5(int i) {\n" +
+ " // expected a potential null problem:\n" +
+ " return i > 0 ? true : getBoolean();\n" +
" }\n" +
- " private @Nullable Boolean getBoolean() {\n" +
- " return null;\n" +
+ " private @Nullable Boolean getBoolean() {\n" +
+ " return null;\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " return i > 0 ? true : getBoolean();\n" +
- " ^^^^^^^^^^^^\n" +
- "Potential null pointer access: This expression of type Boolean may be null but requires auto-unboxing\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " return i > 0 ? true : getBoolean();\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Potential null pointer access: This expression of type Boolean may be null but requires auto-unboxing\n" +
"----------\n");
}
@@ -6481,7 +6481,7 @@ public void testBug403086_1() {
runConformTestWithLibs(
new String[] {
NullReferenceTestAsserts.JUNIT_ASSERT_NAME,
- NullReferenceTestAsserts.JUNIT_ASSERT_CONTENT,
+ NullReferenceTestAsserts.JUNIT_ASSERT_CONTENT,
"Y.java",
"import org.eclipse.jdt.annotation.*;\n" +
"class Y {\n" +
@@ -6511,7 +6511,7 @@ public void testBug403086_2() {
runConformTestWithLibs(
new String[] {
NullReferenceTestAsserts.JUNIT_ASSERT_NAME,
- NullReferenceTestAsserts.JUNIT_ASSERT_CONTENT,
+ NullReferenceTestAsserts.JUNIT_ASSERT_CONTENT,
"Y.java",
"import org.eclipse.jdt.annotation.*;\n" +
"class Y {\n" +
@@ -6540,10 +6540,10 @@ public void testBug412076() {
new String[] {
"Foo.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "@NonNullByDefault\n" +
- "public interface Foo<V> {\n" +
- " V bar(String... values);\n" +
- " V foo(String value);\n" +
+ "@NonNullByDefault\n" +
+ "public interface Foo<V> {\n" +
+ " V bar(String... values);\n" +
+ " V foo(String value);\n" +
"}\n"
},
options,
@@ -6556,77 +6556,77 @@ public void testBug412076() {
(this.complianceLevel < ClassFileConstants.JDK1_8
? "@NonNullByDefault\n"
: "@NonNullByDefault({DefaultLocation.PARAMETER,DefaultLocation.RETURN_TYPE})\n" // avoid @NonNull on type argument <String>
- ) +
- "public class FooImpl implements Foo<String> {\n" +
- " public String bar(final String... values) {\n" +
- " return (\"\");\n" +
- " }\n" +
- " public String foo(final String value) {\n" +
- " return (\"\");\n" +
- " }\n" +
+ ) +
+ "public class FooImpl implements Foo<String> {\n" +
+ " public String bar(final String... values) {\n" +
+ " return (\"\");\n" +
+ " }\n" +
+ " public String foo(final String value) {\n" +
+ " return (\"\");\n" +
+ " }\n" +
"}\n"
},
options,
- "");
+ "");
}
public void testBug413460() {
runConformTestWithLibs(
new String[] {
"Class2.java",
- "\n" +
- "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
- "public class Class2 {\n" +
- " public class Class3 {\n" +
- " public Class3(String nonNullArg) {\n" +
- " assert nonNullArg != null;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public Class2(String nonNullArg) {\n" +
- " assert nonNullArg != null;\n" +
- " }\n" +
- "\n" +
- " public static Class2 create(String nonNullArg) {\n" +
- " return new Class2(nonNullArg);\n" +
- " }\n" +
- "}\n"
- },
- getCompilerOptions(),
+ "\n" +
+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ "public class Class2 {\n" +
+ " public class Class3 {\n" +
+ " public Class3(String nonNullArg) {\n" +
+ " assert nonNullArg != null;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public Class2(String nonNullArg) {\n" +
+ " assert nonNullArg != null;\n" +
+ " }\n" +
+ "\n" +
+ " public static Class2 create(String nonNullArg) {\n" +
+ " return new Class2(nonNullArg);\n" +
+ " }\n" +
+ "}\n"
+ },
+ getCompilerOptions(),
"");
runNegativeTestWithLibs(false,
new String[] {
"Class1.java",
- "public class Class1 {\n" +
- " public static Class2 works() {\n" +
- " return Class2.create(null);\n" +
- " }\n" +
- "\n" +
- " public static Class2 bug() {\n" +
- " return new Class2(null);\n" +
- " }\n" +
- "\n" +
- " public static Class2.Class3 qualifiedbug() {\n" +
- " return new Class2(\"\").new Class3(null);\n" +
- " }\n" +
+ "public class Class1 {\n" +
+ " public static Class2 works() {\n" +
+ " return Class2.create(null);\n" +
+ " }\n" +
+ "\n" +
+ " public static Class2 bug() {\n" +
+ " return new Class2(null);\n" +
+ " }\n" +
+ "\n" +
+ " public static Class2.Class3 qualifiedbug() {\n" +
+ " return new Class2(\"\").new Class3(null);\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
"----------\n" +
- "1. ERROR in Class1.java (at line 3)\n" +
- " return Class2.create(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "1. ERROR in Class1.java (at line 3)\n" +
+ " return Class2.create(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n" +
- "2. ERROR in Class1.java (at line 7)\n" +
- " return new Class2(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "2. ERROR in Class1.java (at line 7)\n" +
+ " return new Class2(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n" +
- "3. ERROR in Class1.java (at line 11)\n" +
- " return new Class2(\"\").new Class3(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "3. ERROR in Class1.java (at line 11)\n" +
+ " return new Class2(\"\").new Class3(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n");
}
@@ -6662,30 +6662,30 @@ public void testBug415850_a() {
null/*options*/);
}
-// avoid NPE in BinaryTypeBinding.getField(..) due to recursive dependency enum->package-info->annotation->enum
+// avoid NPE in BinaryTypeBinding.getField(..) due to recursive dependency enum->package-info->annotation->enum
public void testBug415850_b() {
runConformTestWithLibs(
new String[] {
"p/package-info.java",
- "@p.Annot(state=p.MyEnum.BROKEN)\n" +
+ "@p.Annot(state=p.MyEnum.BROKEN)\n" +
"package p;",
"p/Annot.java",
- "package p;\n" +
- "@Annot(state=MyEnum.KO)\n" +
- "public @interface Annot {\n" +
- " MyEnum state() default MyEnum.KO;\n" +
+ "package p;\n" +
+ "@Annot(state=MyEnum.KO)\n" +
+ "public @interface Annot {\n" +
+ " MyEnum state() default MyEnum.KO;\n" +
"}",
"p/MyEnum.java",
- "package p;\n" +
- "@Annot(state=MyEnum.KO)\n" +
- "public enum MyEnum {\n" +
- " WORKS, OK, KO, BROKEN, ;\n" +
+ "package p;\n" +
+ "@Annot(state=MyEnum.KO)\n" +
+ "public enum MyEnum {\n" +
+ " WORKS, OK, KO, BROKEN, ;\n" +
"}",
"test180/Test.java",
"package test180;\n" +
- "import p.MyEnum;\n" +
- "import p.Annot;\n" +
- "@Annot(state=MyEnum.OK)\n" +
+ "import p.MyEnum;\n" +
+ "import p.Annot;\n" +
+ "@Annot(state=MyEnum.OK)\n" +
"public class Test {}",
},
getCompilerOptions(),
@@ -6698,10 +6698,10 @@ public void testBug415850_b() {
new String[] {
"X.java",
"import test180.Test;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(Test.class);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(Test.class);\n" +
+ " }\n" +
"}"
},
options,
@@ -6713,18 +6713,18 @@ public void testBug417295_5() {
new String[] {
"AllAreNonNull.java",
"@org.eclipse.jdt.annotation.NonNullByDefault\n" +
- "public class AllAreNonNull {\n" +
- " String s3 = \"\";\n" +
- " void test() {\n" +
- " this.s3 = null;\n" +
- " }\n" +
+ "public class AllAreNonNull {\n" +
+ " String s3 = \"\";\n" +
+ " void test() {\n" +
+ " this.s3 = null;\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in AllAreNonNull.java (at line 5)\n" +
- " this.s3 = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in AllAreNonNull.java (at line 5)\n" +
+ " this.s3 = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n");
}
public void testBug417295_7() {
@@ -6733,8 +6733,8 @@ public void testBug417295_7() {
"p1/AllAreNonNull.java",
"package p1;\n" +
"@org.eclipse.jdt.annotation.NonNullByDefault\n" +
- "public class AllAreNonNull {\n" +
- " public String s3 = \"\";\n" +
+ "public class AllAreNonNull {\n" +
+ " public String s3 = \"\";\n" +
"}\n"
},
getCompilerOptions(),
@@ -6743,18 +6743,18 @@ public void testBug417295_7() {
false,
new String[] {
"Client.java",
- "public class Client {\n" +
- " void test(p1.AllAreNonNull aann) {\n" +
- " aann.s3 = null;\n" +
- " }\n" +
+ "public class Client {\n" +
+ " void test(p1.AllAreNonNull aann) {\n" +
+ " aann.s3 = null;\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in Client.java (at line 3)\n" +
- " aann.s3 = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in Client.java (at line 3)\n" +
+ " aann.s3 = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n");
}
@@ -6763,32 +6763,32 @@ public void testBug415413() {
Map options = getCompilerOptions();
runNegativeTestWithLibs(
new String[]{
- "ClassF.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "public class ClassF {\n" +
- " public static void needNonNull(@NonNull Object o) {\n" +
- " o.hashCode();\n" +
- " }\n" +
- " public void method() {\n" +
- " for (int j = 0; j < 1; j++) {\n" +
- " try {\n" +
- " this.hashCode();\n" +
- " } finally {\n" +
- " for (int i = 0; i < 1; i++) {\n" +
- " Object o = null;\n" +
- " needNonNull(o);\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"
- },
+ "ClassF.java",
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "public class ClassF {\n" +
+ " public static void needNonNull(@NonNull Object o) {\n" +
+ " o.hashCode();\n" +
+ " }\n" +
+ " public void method() {\n" +
+ " for (int j = 0; j < 1; j++) {\n" +
+ " try {\n" +
+ " this.hashCode();\n" +
+ " } finally {\n" +
+ " for (int i = 0; i < 1; i++) {\n" +
+ " Object o = null;\n" +
+ " needNonNull(o);\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n"
+ },
options,
- "----------\n" +
- "1. ERROR in ClassF.java (at line 13)\n" +
- " needNonNull(o);\n" +
- " ^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in ClassF.java (at line 13)\n" +
+ " needNonNull(o);\n" +
+ " ^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
"----------\n");
}
// Bug 415413 - [compiler][null] NullpointerException in Null Analysis caused by interaction of LoopingFlowContext and FinallyFlowContext
@@ -6797,27 +6797,27 @@ public void testBug415413a() {
Map options = getCompilerOptions();
runConformTestWithLibs(
new String[]{
- "ClassF.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "public class ClassF {\n" +
- " public static void needNonNull(@NonNull Object o) {\n" +
- " o.hashCode();\n" +
- " }\n" +
- " public void method() {\n" +
- " for (int j = 0; j < 1; j++) {\n" +
- " try {\n" +
- " this.hashCode();\n" +
- " } finally {\n" +
- " Object o = new Object();\n" +
- " for (int i = 0; i < 1; i++) {\n" +
+ "ClassF.java",
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "public class ClassF {\n" +
+ " public static void needNonNull(@NonNull Object o) {\n" +
+ " o.hashCode();\n" +
+ " }\n" +
+ " public void method() {\n" +
+ " for (int j = 0; j < 1; j++) {\n" +
+ " try {\n" +
+ " this.hashCode();\n" +
+ " } finally {\n" +
+ " Object o = new Object();\n" +
+ " for (int i = 0; i < 1; i++) {\n" +
" needNonNull(o);\n" +
- " o = new Object();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ " o = new Object();\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
- },
+ },
options,
"");
}
@@ -6827,33 +6827,33 @@ public void testBug415413b() {
Map options = getCompilerOptions();
runNegativeTestWithLibs(
new String[]{
- "ClassF.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "public class ClassF {\n" +
- " public static void needNonNull(@NonNull Object o) {\n" +
- " o.hashCode();\n" +
- " }\n" +
- " public void method() {\n" +
- " for (int j = 0; j < 1; j++) {\n" +
- " try {\n" +
- " this.hashCode();\n" +
- " } finally {\n" +
- " Object o = null;\n" +
- " for (int i = 0; i < 1; i++) {\n" +
+ "ClassF.java",
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "public class ClassF {\n" +
+ " public static void needNonNull(@NonNull Object o) {\n" +
+ " o.hashCode();\n" +
+ " }\n" +
+ " public void method() {\n" +
+ " for (int j = 0; j < 1; j++) {\n" +
+ " try {\n" +
+ " this.hashCode();\n" +
+ " } finally {\n" +
+ " Object o = null;\n" +
+ " for (int i = 0; i < 1; i++) {\n" +
" needNonNull(o);\n" +
- " o = new Object();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ " o = new Object();\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
- },
+ },
options,
- "----------\n" +
- "1. ERROR in ClassF.java (at line 13)\n" +
- " needNonNull(o);\n" +
- " ^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is inferred as @Nullable\n" +
+ "----------\n" +
+ "1. ERROR in ClassF.java (at line 13)\n" +
+ " needNonNull(o);\n" +
+ " ^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is inferred as @Nullable\n" +
"----------\n");
}
// Bug 415413 - [compiler][null] NullpointerException in Null Analysis caused by interaction of LoopingFlowContext and FinallyFlowContext
@@ -6862,33 +6862,33 @@ public void testBug415413c() {
Map options = getCompilerOptions();
runNegativeTestWithLibs(
new String[]{
- "ClassF.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "public class ClassF {\n" +
- " public static void needNonNull(@NonNull Object o) {\n" +
- " o.hashCode();\n" +
- " }\n" +
- " public void method() {\n" +
- " for (int j = 0; j < 1; j++) {\n" +
- " try {\n" +
- " this.hashCode();\n" +
- " } finally {\n" +
- " Object o = new Object();\n" +
- " for (int i = 0; i < 1; i++) {\n" +
+ "ClassF.java",
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "public class ClassF {\n" +
+ " public static void needNonNull(@NonNull Object o) {\n" +
+ " o.hashCode();\n" +
+ " }\n" +
+ " public void method() {\n" +
+ " for (int j = 0; j < 1; j++) {\n" +
+ " try {\n" +
+ " this.hashCode();\n" +
+ " } finally {\n" +
+ " Object o = new Object();\n" +
+ " for (int i = 0; i < 1; i++) {\n" +
" needNonNull(o);\n" +
- " o = null;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ " o = null;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
- },
+ },
options,
- "----------\n" +
- "1. ERROR in ClassF.java (at line 13)\n" +
- " needNonNull(o);\n" +
- " ^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is inferred as @Nullable\n" +
+ "----------\n" +
+ "1. ERROR in ClassF.java (at line 13)\n" +
+ " needNonNull(o);\n" +
+ " ^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is inferred as @Nullable\n" +
"----------\n");
}
public void testBug_415269() {
@@ -6911,7 +6911,7 @@ public void testBug_415269() {
" public void method(Object arg);\n"+
" }\n"+
"}\n"
- },
+ },
options,
"");
}
@@ -6925,16 +6925,16 @@ public void testBug416267() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Missing m = new Missing() { };\n" +
- " ^^^^^^^\n" +
- "Missing cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " Missing m = new Missing() { };\n" +
- " ^^^^^^^\n" +
- "Missing cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " Missing m = new Missing() { };\n" +
+ " ^^^^^^^\n" +
+ "Missing cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " Missing m = new Missing() { };\n" +
+ " ^^^^^^^\n" +
+ "Missing cannot be resolved to a type\n" +
"----------\n",
this.LIBS,
true, /*flush*/
@@ -6945,46 +6945,46 @@ public void testBug418843() {
runNegativeTest(
new String[] {
"TestEnum.java",
- "public enum TestEnum {\n" +
- " TestEntry(1){};\n" +
+ "public enum TestEnum {\n" +
+ " TestEntry(1){};\n" +
"}"
},
- "----------\n" +
- "1. ERROR in TestEnum.java (at line 2)\n" +
- " TestEntry(1){};\n" +
- " ^^^^^^^^^\n" +
- "The constructor TestEnum(int) is undefined\n" +
+ "----------\n" +
+ "1. ERROR in TestEnum.java (at line 2)\n" +
+ " TestEntry(1){};\n" +
+ " ^^^^^^^^^\n" +
+ "The constructor TestEnum(int) is undefined\n" +
"----------\n",
this.LIBS,
true,/*flush*/
null/*options*/);
}
public void testBug418235() {
- String[] testFiles =
+ String[] testFiles =
new String[] {
- "GenericInterface.java",
- "public interface GenericInterface<T> {\n" +
- " T doSomethingGeneric(T o);\n" +
+ "GenericInterface.java",
+ "public interface GenericInterface<T> {\n" +
+ " T doSomethingGeneric(T o);\n" +
"}",
"Implementation.java",
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "@NonNullByDefault\n" +
- "public class Implementation implements GenericInterface<Object> {\n" +
- "\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "@NonNullByDefault\n" +
+ "public class Implementation implements GenericInterface<Object> {\n" +
+ "\n" +
(this.complianceLevel < ClassFileConstants.JDK1_6 ? "\n" : " @Override\n" ) +
- " public Object doSomethingGeneric(Object o) {\n" +
- " return o;\n" +
- " }\n" +
+ " public Object doSomethingGeneric(Object o) {\n" +
+ " return o;\n" +
+ " }\n" +
"}\n"
};
if (this.complianceLevel < ClassFileConstants.JDK1_8) {
runNegativeTestWithLibs(
testFiles,
- "----------\n" +
- "1. ERROR in Implementation.java (at line 6)\n" +
- " public Object doSomethingGeneric(Object o) {\n" +
- " ^^^^^^\n" +
- "Illegal redefinition of parameter o, inherited method from GenericInterface<Object> does not constrain this parameter\n" +
+ "----------\n" +
+ "1. ERROR in Implementation.java (at line 6)\n" +
+ " public Object doSomethingGeneric(Object o) {\n" +
+ " ^^^^^^\n" +
+ "Illegal redefinition of parameter o, inherited method from GenericInterface<Object> does not constrain this parameter\n" +
"----------\n");
} else {
// in 1.8 the nullness default also affects the type argument <Object> from which T is instantiated to '@NonNull Object'
@@ -6997,26 +6997,26 @@ public void testBug418235b() {
return;
runNegativeTestWithLibs(
new String[] {
- "GenericInterface.java",
- "public interface GenericInterface<T> {\n" +
- " T doSomethingGeneric(T o);\n" +
+ "GenericInterface.java",
+ "public interface GenericInterface<T> {\n" +
+ " T doSomethingGeneric(T o);\n" +
"}",
"Implementation.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "@NonNullByDefault({DefaultLocation.PARAMETER,DefaultLocation.RETURN_TYPE})\n" +
- "public class Implementation implements GenericInterface<Object> {\n" +
- "\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "@NonNullByDefault({DefaultLocation.PARAMETER,DefaultLocation.RETURN_TYPE})\n" +
+ "public class Implementation implements GenericInterface<Object> {\n" +
+ "\n" +
" @Override\n" +
- " public Object doSomethingGeneric(Object o) {\n" +
- " return o;\n" +
- " }\n" +
+ " public Object doSomethingGeneric(Object o) {\n" +
+ " return o;\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Implementation.java (at line 6)\n" +
- " public Object doSomethingGeneric(Object o) {\n" +
- " ^^^^^^\n" +
- "Illegal redefinition of parameter o, inherited method from GenericInterface<Object> does not constrain this parameter\n" +
+ "----------\n" +
+ "1. ERROR in Implementation.java (at line 6)\n" +
+ " public Object doSomethingGeneric(Object o) {\n" +
+ " ^^^^^^\n" +
+ "Illegal redefinition of parameter o, inherited method from GenericInterface<Object> does not constrain this parameter\n" +
"----------\n");
}
@@ -7034,7 +7034,7 @@ public void testTypeAnnotationProblemNotIn17() {
new String[] {
"X.java",
source
- },
+ },
getCompilerOptions(),
"");
else
@@ -7042,22 +7042,22 @@ public void testTypeAnnotationProblemNotIn17() {
new String[] {
"X.java",
source
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " public @NonNull java.lang.String test(@NonNull java.lang.String arg) {\n" +
- " ^^^^^^^^\n" +
- "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " public @NonNull java.lang.String test(@NonNull java.lang.String arg) {\n" +
- " ^^^^^^^^\n" +
- "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " @NonNull java.lang.String local = arg;\n" +
- " ^^^^^^^^\n" +
- "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " public @NonNull java.lang.String test(@NonNull java.lang.String arg) {\n" +
+ " ^^^^^^^^\n" +
+ "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " public @NonNull java.lang.String test(@NonNull java.lang.String arg) {\n" +
+ " ^^^^^^^^\n" +
+ "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " @NonNull java.lang.String local = arg;\n" +
+ " ^^^^^^^^\n" +
+ "Illegally placed annotation: type annotations must directly precede the simple name of the type they are meant to affect (or the [] for arrays)\n" +
"----------\n",
this.LIBS,
true, // flush
@@ -7068,42 +7068,42 @@ public void testBug420313() {
true, /*flush*/
new String[] {
"OverrideTest.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "\n" +
- "public class OverrideTest implements TypedBase<String>, UntypedBase\n" +
- "{\n" +
- " public void doSomething(String text) // No warning\n" +
- " {\n" +
- " System.out.println(text);\n" +
- " }\n" +
- " \n" +
- " public void doSomethingElse(String text) // \"Missing non-null annotation\" warning\n" +
- " {\n" +
- " System.out.println(text);\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "interface TypedBase<T>\n" +
- "{\n" +
- " void doSomething(@NonNull T text);\n" +
- "}\n" +
- "\n" +
- "interface UntypedBase\n" +
- "{\n" +
- " void doSomethingElse(@NonNull String text);\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "\n" +
+ "public class OverrideTest implements TypedBase<String>, UntypedBase\n" +
+ "{\n" +
+ " public void doSomething(String text) // No warning\n" +
+ " {\n" +
+ " System.out.println(text);\n" +
+ " }\n" +
+ " \n" +
+ " public void doSomethingElse(String text) // \"Missing non-null annotation\" warning\n" +
+ " {\n" +
+ " System.out.println(text);\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "interface TypedBase<T>\n" +
+ "{\n" +
+ " void doSomething(@NonNull T text);\n" +
+ "}\n" +
+ "\n" +
+ "interface UntypedBase\n" +
+ "{\n" +
+ " void doSomethingElse(@NonNull String text);\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in OverrideTest.java (at line 5)\n" +
- " public void doSomething(String text) // No warning\n" +
- " ^^^^^^\n" +
- "Missing non-null annotation: inherited method from TypedBase<String> specifies this parameter as @NonNull\n" +
- "----------\n" +
- "2. WARNING in OverrideTest.java (at line 10)\n" +
- " public void doSomethingElse(String text) // \"Missing non-null annotation\" warning\n" +
- " ^^^^^^\n" +
- "Missing non-null annotation: inherited method from UntypedBase specifies this parameter as @NonNull\n" +
+ "----------\n" +
+ "1. WARNING in OverrideTest.java (at line 5)\n" +
+ " public void doSomething(String text) // No warning\n" +
+ " ^^^^^^\n" +
+ "Missing non-null annotation: inherited method from TypedBase<String> specifies this parameter as @NonNull\n" +
+ "----------\n" +
+ "2. WARNING in OverrideTest.java (at line 10)\n" +
+ " public void doSomethingElse(String text) // \"Missing non-null annotation\" warning\n" +
+ " ^^^^^^\n" +
+ "Missing non-null annotation: inherited method from UntypedBase specifies this parameter as @NonNull\n" +
"----------\n");
}
// original test
@@ -7111,16 +7111,16 @@ public void testBug424624() {
runConformTestWithLibs(
new String[] {
"Test3.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "\n" +
- "public class Test3 {\n" +
- "\n" +
- " public Test3() {\n" +
- " }\n" +
- "\n" +
- " static public class Test3aa extends Object {}\n" +
- " static public final @NonNull Test3aa Test3a = new Test3aa();\n" +
- "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "\n" +
+ "public class Test3 {\n" +
+ "\n" +
+ " public Test3() {\n" +
+ " }\n" +
+ "\n" +
+ " static public class Test3aa extends Object {}\n" +
+ " static public final @NonNull Test3aa Test3a = new Test3aa();\n" +
+ "\n" +
"}\n",
},
getCompilerOptions(),
@@ -7129,20 +7129,20 @@ public void testBug424624() {
false /*flush*/,
new String[] {
"Test4.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "\n" +
- "public class Test4 {\n" +
- "\n" +
- " public Test4() {\n" +
- " }\n" +
- " \n" +
- " public void test() {\n" +
- " test1( Test3.Test3a);\n" +
- " }\n" +
- " \n" +
- " public void test1( @NonNull Object object) {\n" +
- " }\n" +
- "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "\n" +
+ "public class Test4 {\n" +
+ "\n" +
+ " public Test4() {\n" +
+ " }\n" +
+ " \n" +
+ " public void test() {\n" +
+ " test1( Test3.Test3a);\n" +
+ " }\n" +
+ " \n" +
+ " public void test1( @NonNull Object object) {\n" +
+ " }\n" +
+ "\n" +
"}\n"
},
getCompilerOptions(),
@@ -7160,31 +7160,31 @@ public void testBug424624a() {
"@Target(ElementType.TYPE_USE) @interface Marker {}\n"
:
""
- )+
- "\n" +
- "public class Test3 {\n" +
- "\n" +
- " public Test3() {\n" +
- " }\n" +
- "\n" +
+ )+
+ "\n" +
+ "public class Test3 {\n" +
+ "\n" +
+ " public Test3() {\n" +
+ " }\n" +
+ "\n" +
" public class Inner extends Object {\n" +
" class DeepInner {}\n" +
- " }\n" +
+ " }\n" +
" public static class Nested extends Object {\n" +
" class InnerInNested {}\n" +
" static class DeepNested {}\n" +
- " }\n" +
- " static public final @NonNull Inner field1 = new Test3().new Inner();\n" +
+ " }\n" +
+ " static public final @NonNull Inner field1 = new Test3().new Inner();\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- " static public final @NonNull Inner.DeepInner field2 = field1.new DeepInner();\n" +
+ " static public final @NonNull Inner.DeepInner field2 = field1.new DeepInner();\n" +
" static public final @NonNull Nested.InnerInNested field3 = new Nested().new InnerInNested();\n" +
" static public final @NonNull Nested.DeepNested field4 = new Nested.DeepNested();\n"
:
- " static public final @Marker Inner.@NonNull DeepInner field2 = field1.new DeepInner();\n" +
+ " static public final @Marker Inner.@NonNull DeepInner field2 = field1.new DeepInner();\n" +
" static public final Nested.@NonNull InnerInNested field3 = new Nested().new InnerInNested();\n" +
" static public final Nested.@NonNull DeepNested field4 = new Nested.DeepNested();\n"
- ) +
- "\n" +
+ ) +
+ "\n" +
"}\n",
},
getCompilerOptions(),
@@ -7194,23 +7194,23 @@ public void testBug424624a() {
new String[] {
"Test4.java",
"import org.eclipse.jdt.annotation.NonNull;\n" +
- "import test.Test3;\n" +
- "\n" +
- "public class Test4 {\n" +
- "\n" +
- " public Test4() {\n" +
- " }\n" +
- " \n" +
- " public void test() {\n" +
- " test1( Test3.field1);\n" +
- " test1( Test3.field2);\n" +
- " test1( Test3.field3);\n" +
- " test1( Test3.field4);\n" +
- " }\n" +
- " \n" +
- " public void test1( @NonNull Object object) {\n" +
- " }\n" +
- "\n" +
+ "import test.Test3;\n" +
+ "\n" +
+ "public class Test4 {\n" +
+ "\n" +
+ " public Test4() {\n" +
+ " }\n" +
+ " \n" +
+ " public void test() {\n" +
+ " test1( Test3.field1);\n" +
+ " test1( Test3.field2);\n" +
+ " test1( Test3.field3);\n" +
+ " test1( Test3.field4);\n" +
+ " }\n" +
+ " \n" +
+ " public void test1( @NonNull Object object) {\n" +
+ " }\n" +
+ "\n" +
"}\n"
},
getCompilerOptions(),
@@ -7227,50 +7227,50 @@ public void testBug424624b() {
"@Target(ElementType.TYPE_USE) @interface Marker {}\n"
:
""
- )+
- "\n" +
- "public class Test3 {\n" +
- "\n" +
- " public Test3() {\n" +
- " }\n" +
- "\n" +
+ )+
+ "\n" +
+ "public class Test3 {\n" +
+ "\n" +
+ " public Test3() {\n" +
+ " }\n" +
+ "\n" +
" public class Inner extends Object {\n" +
" class DeepInner {}\n" +
- " }\n" +
+ " }\n" +
" public static class Nested extends Object {\n" +
" class InnerInNested {}\n" +
" static class DeepNested {}\n" +
- " }\n" +
- " static public final @NonNull Inner field1 = new Test3().new Inner();\n" +
+ " }\n" +
+ " static public final @NonNull Inner field1 = new Test3().new Inner();\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8 ?
- " static public final @NonNull Inner.DeepInner field2 = field1.new DeepInner();\n" +
+ " static public final @NonNull Inner.DeepInner field2 = field1.new DeepInner();\n" +
" static public final @NonNull Nested.InnerInNested field3 = new Nested().new InnerInNested();\n" +
" static public final @NonNull Nested.DeepNested field4 = new Nested.DeepNested();\n"
:
- " static public final @Marker Inner.@NonNull DeepInner field2 = field1.new DeepInner();\n" +
+ " static public final @Marker Inner.@NonNull DeepInner field2 = field1.new DeepInner();\n" +
" static public final Nested.@NonNull InnerInNested field3 = new Nested().new InnerInNested();\n" +
" static public final Nested.@NonNull DeepNested field4 = new Nested.DeepNested();\n"
- ) +
- "\n" +
+ ) +
+ "\n" +
"}\n",
"Test4.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "\n" +
- "public class Test4 {\n" +
- "\n" +
- " public Test4() {\n" +
- " }\n" +
- " \n" +
- " public void test() {\n" +
- " test1( Test3.field1);\n" +
- " test1( Test3.field2);\n" +
- " test1( Test3.field3);\n" +
- " test1( Test3.field4);\n" +
- " }\n" +
- " \n" +
- " public void test1( @NonNull Object object) {\n" +
- " }\n" +
- "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "\n" +
+ "public class Test4 {\n" +
+ "\n" +
+ " public Test4() {\n" +
+ " }\n" +
+ " \n" +
+ " public void test() {\n" +
+ " test1( Test3.field1);\n" +
+ " test1( Test3.field2);\n" +
+ " test1( Test3.field3);\n" +
+ " test1( Test3.field4);\n" +
+ " }\n" +
+ " \n" +
+ " public void test1( @NonNull Object object) {\n" +
+ " }\n" +
+ "\n" +
"}\n"
},
getCompilerOptions(),
@@ -7298,13 +7298,13 @@ public void testBug430084() {
}
public void testBug432348() {
String sourceString =
- "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
"import java.lang.annotation.*;\n" +
"\n" +
"@Target(ElementType.FIELD)\n" +
- "@interface Marker {}\n" +
- "public enum E {\n" +
- " @Marker @NonNull A, B, C\n" +
+ "@interface Marker {}\n" +
+ "public enum E {\n" +
+ " @Marker @NonNull A, B, C\n" +
"}\n";
if (this.complianceLevel < ClassFileConstants.JDK1_8) {
runConformTestWithLibs(
@@ -7320,11 +7320,11 @@ public void testBug432348() {
"E.java",
sourceString
},
- "----------\n" +
- "1. ERROR in E.java (at line 7)\n" +
- " @Marker @NonNull A, B, C\n" +
- " ^^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "1. ERROR in E.java (at line 7)\n" +
+ " @Marker @NonNull A, B, C\n" +
+ " ^^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n");
}
}
@@ -7402,22 +7402,22 @@ public void testBug422796() {
runConformTestWithLibs(
new String[] {
"NullExprTest.java",
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "@NonNullByDefault\n" +
- "public class NullExprTest {\n" +
- " \n" +
- " private @Nullable Boolean b() { return null; }\n" +
- " \n" +
- " public void testBoolean() {\n" +
- " Boolean b1 = b();\n" +
- " boolean b = b1 == null || \n" +
- " b1; // <-- Previously bugggy: reported potential NPE (*)\n" +
- " assertTrue(b);\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "@NonNullByDefault\n" +
+ "public class NullExprTest {\n" +
+ " \n" +
+ " private @Nullable Boolean b() { return null; }\n" +
+ " \n" +
+ " public void testBoolean() {\n" +
+ " Boolean b1 = b();\n" +
+ " boolean b = b1 == null || \n" +
+ " b1; // <-- Previously bugggy: reported potential NPE (*)\n" +
+ " assertTrue(b);\n" +
" }\n" +
- " static void assertTrue(boolean b) {}\n" +
- "\n" +
+ " static void assertTrue(boolean b) {}\n" +
+ "\n" +
"}"
},
getCompilerOptions(),
@@ -7428,22 +7428,22 @@ public void testBug422796a() {
runConformTestWithLibs(
new String[] {
"NullExprTest.java",
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "@NonNullByDefault\n" +
- "public class NullExprTest {\n" +
- " \n" +
- " private @Nullable Boolean b() { return null; }\n" +
- " \n" +
- " public void testBoolean() {\n" +
- " Boolean b1 = b();\n" +
- " boolean b = b1 != null && \n" +
- " b1; // <-- Previously bugggy: reported potential NPE (*)\n" +
- " assertTrue(b);\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "@NonNullByDefault\n" +
+ "public class NullExprTest {\n" +
+ " \n" +
+ " private @Nullable Boolean b() { return null; }\n" +
+ " \n" +
+ " public void testBoolean() {\n" +
+ " Boolean b1 = b();\n" +
+ " boolean b = b1 != null && \n" +
+ " b1; // <-- Previously bugggy: reported potential NPE (*)\n" +
+ " assertTrue(b);\n" +
" }\n" +
- " static void assertTrue(boolean b) {}\n" +
- "\n" +
+ " static void assertTrue(boolean b) {}\n" +
+ "\n" +
"}"
},
getCompilerOptions(),
@@ -7454,103 +7454,103 @@ public void testBug422796b() {
runNegativeTestWithLibs(
new String[] {
"NullExprTest.java",
- "public class NullExprTest {\n" +
- " \n" +
- " private Boolean b() { return null; }\n" +
- " \n" +
- " public void testBoolean1() {\n" +
- " Boolean b1 = b();\n" +
- " boolean b = b1 == null && \n" +
- " b1; // <-- definite NPE (*)\n" +
- " assertTrue(b);\n" +
+ "public class NullExprTest {\n" +
+ " \n" +
+ " private Boolean b() { return null; }\n" +
+ " \n" +
+ " public void testBoolean1() {\n" +
+ " Boolean b1 = b();\n" +
+ " boolean b = b1 == null && \n" +
+ " b1; // <-- definite NPE (*)\n" +
+ " assertTrue(b);\n" +
" }\n" +
- " public void testBoolean2(boolean x) {\n" +
- " Boolean b1 = b();\n" +
- " boolean b = (b1 == null || x) && \n" +
- " b1; // <-- potential NPE (*)\n" +
- " assertTrue(b);\n" +
+ " public void testBoolean2(boolean x) {\n" +
+ " Boolean b1 = b();\n" +
+ " boolean b = (b1 == null || x) && \n" +
+ " b1; // <-- potential NPE (*)\n" +
+ " assertTrue(b);\n" +
" }\n" +
- " static void assertTrue(boolean b) {}\n" +
- "\n" +
+ " static void assertTrue(boolean b) {}\n" +
+ "\n" +
"}"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in NullExprTest.java (at line 8)\n" +
- " b1; // <-- definite NPE (*)\n" +
- " ^^\n" +
- "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
- "----------\n" +
- "2. ERROR in NullExprTest.java (at line 14)\n" +
- " b1; // <-- potential NPE (*)\n" +
- " ^^\n" +
- "Potential null pointer access: This expression of type Boolean may be null but requires auto-unboxing\n" +
+ "----------\n" +
+ "1. ERROR in NullExprTest.java (at line 8)\n" +
+ " b1; // <-- definite NPE (*)\n" +
+ " ^^\n" +
+ "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
+ "----------\n" +
+ "2. ERROR in NullExprTest.java (at line 14)\n" +
+ " b1; // <-- potential NPE (*)\n" +
+ " ^^\n" +
+ "Potential null pointer access: This expression of type Boolean may be null but requires auto-unboxing\n" +
"----------\n");
}
public void testBug434374() {
runConformTestWithLibs(
new String[] {
"bal/AdapterService.java",
- "/*******************************************************************************\n" +
- " * Copyright (c) 2013 BestSolution.at and others.\n" +
- " * All rights reserved. This program and the accompanying materials\n" +
- " * are made available under the terms of the Eclipse Public License v1.0\n" +
- " * which accompanies this distribution, and is available at\n" +
- " * http://www.eclipse.org/legal/epl-v10.html\n" +
- " *\n" +
- " * Contributors:\n" +
- " * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation\n" +
- " *******************************************************************************/\n" +
- "package bal;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "public interface AdapterService {\n" +
- " public boolean canAdapt(@Nullable Object sourceObject, @NonNull Class<?> targetType);\n" +
- "\n" +
- " @Nullable\n" +
- " public <A> A adapt(@Nullable Object sourceObject, @NonNull Class<A> targetType, ValueAccess... valueAccesses);\n" +
- "\n" +
- " public interface ValueAccess {\n" +
- " @Nullable\n" +
- " public <O> O getValue(@NonNull String key);\n" +
- "\n" +
- " @Nullable\n" +
- " public <O> O getValue(@NonNull Class<O> key);\n" +
- " }\n" +
+ "/*******************************************************************************\n" +
+ " * Copyright (c) 2013 BestSolution.at and others.\n" +
+ " * All rights reserved. This program and the accompanying materials\n" +
+ " * are made available under the terms of the Eclipse Public License v1.0\n" +
+ " * which accompanies this distribution, and is available at\n" +
+ " * http://www.eclipse.org/legal/epl-v10.html\n" +
+ " *\n" +
+ " * Contributors:\n" +
+ " * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation\n" +
+ " *******************************************************************************/\n" +
+ "package bal;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "public interface AdapterService {\n" +
+ " public boolean canAdapt(@Nullable Object sourceObject, @NonNull Class<?> targetType);\n" +
+ "\n" +
+ " @Nullable\n" +
+ " public <A> A adapt(@Nullable Object sourceObject, @NonNull Class<A> targetType, ValueAccess... valueAccesses);\n" +
+ "\n" +
+ " public interface ValueAccess {\n" +
+ " @Nullable\n" +
+ " public <O> O getValue(@NonNull String key);\n" +
+ "\n" +
+ " @Nullable\n" +
+ " public <O> O getValue(@NonNull Class<O> key);\n" +
+ " }\n" +
"}\n",
"bal/AdapterServiceImpl.java",
- "/*******************************************************************************\n" +
- " * Copyright (c) 2013 BestSolution.at and others.\n" +
- " * All rights reserved. This program and the accompanying materials\n" +
- " * are made available under the terms of the Eclipse Public License v1.0\n" +
- " * which accompanies this distribution, and is available at\n" +
- " * http://www.eclipse.org/legal/epl-v10.html\n" +
- " *\n" +
- " * Contributors:\n" +
- " * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation\n" +
- " *******************************************************************************/\n" +
- "package bal;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "public class AdapterServiceImpl implements AdapterService {\n" +
- "\n" +
+ "/*******************************************************************************\n" +
+ " * Copyright (c) 2013 BestSolution.at and others.\n" +
+ " * All rights reserved. This program and the accompanying materials\n" +
+ " * are made available under the terms of the Eclipse Public License v1.0\n" +
+ " * which accompanies this distribution, and is available at\n" +
+ " * http://www.eclipse.org/legal/epl-v10.html\n" +
+ " *\n" +
+ " * Contributors:\n" +
+ " * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation\n" +
+ " *******************************************************************************/\n" +
+ "package bal;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "public class AdapterServiceImpl implements AdapterService {\n" +
+ "\n" +
(this.complianceLevel >= ClassFileConstants.JDK1_6
? " @Override\n"
: "") +
- " public boolean canAdapt(@Nullable Object sourceObject, @NonNull Class<?> targetType) {\n" +
- " return false;\n" +
- " }\n" +
- "\n" +
+ " public boolean canAdapt(@Nullable Object sourceObject, @NonNull Class<?> targetType) {\n" +
+ " return false;\n" +
+ " }\n" +
+ "\n" +
(this.complianceLevel >= ClassFileConstants.JDK1_6
? " @Override\n"
: "") +
- " @Nullable\n" +
- " public <A> A adapt(@Nullable Object sourceObject, @NonNull Class<A> targetType, ValueAccess... valueAccesses) {\n" +
- " return null;\n" +
- " }\n" +
+ " @Nullable\n" +
+ " public <A> A adapt(@Nullable Object sourceObject, @NonNull Class<A> targetType, ValueAccess... valueAccesses) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -7561,29 +7561,29 @@ public void testBug434374a() {
runConformTestWithLibs(
new String[] {
"bug434374/AdapterService.java",
- "package bug434374;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public interface AdapterService {\n" +
- " public @NonNull <A> Class<A> getClassOfA(A object);\n" +
- "\n" +
+ "package bug434374;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "public interface AdapterService {\n" +
+ " public @NonNull <A> Class<A> getClassOfA(A object);\n" +
+ "\n" +
"}\n",
"bug434374/AdapterServiceImpl.java",
- "package bug434374;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "\n" +
- "public class AdapterServiceImpl implements AdapterService {\n" +
+ "package bug434374;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "\n" +
+ "public class AdapterServiceImpl implements AdapterService {\n" +
"\n" +
(this.complianceLevel >= ClassFileConstants.JDK1_6
? " @Override\n"
: "") +
- " @NonNull\n" +
- " public <A> Class<A> getClassOfA(A object) {\n" +
- " throw new RuntimeException();\n" +
- " }\n" +
- "\n" +
+ " @NonNull\n" +
+ " public <A> Class<A> getClassOfA(A object) {\n" +
+ " throw new RuntimeException();\n" +
+ " }\n" +
+ "\n" +
"}\n"
},
getCompilerOptions(),
@@ -7594,22 +7594,22 @@ public void testBug434374b() {
runNegativeTestWithLibs(
new String[] {
"bal/TestGeneric.java",
- "package bal;\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "\n" +
- "public class TestGeneric<T> {\n" +
- " @NonNull\n" +
- " public T test() {\n" +
- " return null;\n" +
- " }\n" +
+ "package bal;\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "\n" +
+ "public class TestGeneric<T> {\n" +
+ " @NonNull\n" +
+ " public T test() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in bal\\TestGeneric.java (at line 7)\n" +
- " return null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull T\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in bal\\TestGeneric.java (at line 7)\n" +
+ " return null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull T\' but the provided value is null\n" +
"----------\n");
}
// rectified test:
@@ -7617,13 +7617,13 @@ public void testBug434374c() {
runConformTestWithLibs(
new String[] {
"bal/TestGeneric.java",
- "package bal;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "public class TestGeneric<T> {\n" +
- " public @Nullable T test() {\n" +
- " return null;\n" +
- " }\n" +
+ "package bal;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "public class TestGeneric<T> {\n" +
+ " public @Nullable T test() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -7635,21 +7635,21 @@ public void testBug443347() {
runConformTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "abstract class Super {\n" +
- " Super(String s) { }\n" +
- " abstract void bar();\n" +
- " void foo() { bar(); }\n" +
- "}\n" +
- "\n" +
- "@NonNullByDefault\n" +
- "public class X {\n" +
- " void test1(@Nullable String s) {\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "abstract class Super {\n" +
+ " Super(String s) { }\n" +
+ " abstract void bar();\n" +
+ " void foo() { bar(); }\n" +
+ "}\n" +
+ "\n" +
+ "@NonNullByDefault\n" +
+ "public class X {\n" +
+ " void test1(@Nullable String s) {\n" +
" new Super(s) {\n" +
- " @Override\n" +
- " void bar() {}\n" +
- " }.foo();\n" +
- " }\n" +
+ " @Override\n" +
+ " void bar() {}\n" +
+ " }.foo();\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -7661,28 +7661,28 @@ public void testBug443347b() {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "abstract class Super {\n" +
- " Super(@NonNull String s) { }\n" +
- " abstract void bar();\n" +
- " void foo() { bar(); }\n" +
- "}\n" +
- "\n" +
- "@NonNullByDefault\n" +
- "public class X {\n" +
- " void test1(@Nullable String s) {\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "abstract class Super {\n" +
+ " Super(@NonNull String s) { }\n" +
+ " abstract void bar();\n" +
+ " void foo() { bar(); }\n" +
+ "}\n" +
+ "\n" +
+ "@NonNullByDefault\n" +
+ "public class X {\n" +
+ " void test1(@Nullable String s) {\n" +
" new Super(s) {\n" +
- " @Override\n" +
- " void bar() {}\n" +
- " }.foo();\n" +
- " }\n" +
+ " @Override\n" +
+ " void bar() {}\n" +
+ " }.foo();\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " new Super(s) {\n" +
- " ^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " new Super(s) {\n" +
+ " ^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8
? "Null type mismatch: required \'@NonNull String\' but the provided value is specified as @Nullable\n"
: "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n") +
@@ -7694,29 +7694,29 @@ public void testBug443347c() {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "@NonNullByDefault\n" +
- "abstract class Super {\n" +
- " Super(String s) { }\n" +
- " abstract void bar();\n" +
- " void foo() { bar(); }\n" +
- "}\n" +
- "\n" +
- "@NonNullByDefault\n" +
- "public class X {\n" +
- " void test1(@Nullable String s) {\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "@NonNullByDefault\n" +
+ "abstract class Super {\n" +
+ " Super(String s) { }\n" +
+ " abstract void bar();\n" +
+ " void foo() { bar(); }\n" +
+ "}\n" +
+ "\n" +
+ "@NonNullByDefault\n" +
+ "public class X {\n" +
+ " void test1(@Nullable String s) {\n" +
" new Super(s) {\n" +
- " @Override\n" +
- " void bar() {}\n" +
- " }.foo();\n" +
- " }\n" +
+ " @Override\n" +
+ " void bar() {}\n" +
+ " }.foo();\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " new Super(s) {\n" +
- " ^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " new Super(s) {\n" +
+ " ^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8
? "Null type mismatch: required \'@NonNull String\' but the provided value is specified as @Nullable\n"
: "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n") +
@@ -7763,32 +7763,32 @@ public void testBug435805() {
"org/foo/Nullable.java",
"package org.foo;\n" +
"import java.lang.annotation.*;\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE})\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE})\n" +
"public @interface Nullable {}\n",
"org/foo/NonNull.java",
"package org.foo;\n" +
"import java.lang.annotation.*;\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE})\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE})\n" +
"public @interface NonNull {}\n",
"TestNulls.java",
- "import org.foo.*;\n" +
- "\n" +
- "public class TestNulls {\n" +
- " public void testCase(@Nullable String theValue) {\n" +
- " int len = theValue.length(); // Is nullable, so should report error here.\n" +
- " }\n" +
- "\n" +
+ "import org.foo.*;\n" +
+ "\n" +
+ "public class TestNulls {\n" +
+ " public void testCase(@Nullable String theValue) {\n" +
+ " int len = theValue.length(); // Is nullable, so should report error here.\n" +
+ " }\n" +
+ "\n" +
"}"
},
null/*libs*/,
options,
- "----------\n" +
- "1. ERROR in TestNulls.java (at line 5)\n" +
- " int len = theValue.length(); // Is nullable, so should report error here.\n" +
- " ^^^^^^^^\n" +
- "Potential null pointer access: The variable theValue may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in TestNulls.java (at line 5)\n" +
+ " int len = theValue.length(); // Is nullable, so should report error here.\n" +
+ " ^^^^^^^^\n" +
+ "Potential null pointer access: The variable theValue may be null at this location\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -7796,12 +7796,12 @@ public void testBug445147() {
runConformTestWithLibs(
new String[] {
"foobar/Bar.java",
- "package foobar;\n" +
- "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ "package foobar;\n" +
+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
"interface Bar<B extends Bar<B, F>, F extends Foo<F, B>> {}",
"foobar/Foo.java",
- "package foobar;\n" +
- "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ "package foobar;\n" +
+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
"interface Foo<F extends Foo<F, B>, B extends Bar<B, F>> {}"
},
getCompilerOptions(),
@@ -7812,86 +7812,86 @@ public void testBug445708() {
runNegativeTestWithLibs(
new String[] {
"SwitchTest.java",
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "public class SwitchTest\n" +
- "{\n" +
- " private enum EnumValue\n" +
- " {\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " // Should be flagged as \"Potential null pointer access,\" but is not.\n" +
- " switch (computeStringValue())\n" +
- " {\n" +
- " }\n" +
- " \n" +
- " @Nullable String stringValue = null;\n" +
- " \n" +
- " // Properly flagged as \"Null pointer access.\"\n" +
- " switch (stringValue)\n" +
- " {\n" +
- " }\n" +
- " \n" +
- " stringValue = computeStringValue();\n" +
- " \n" +
- " // Should be flagged as \"Potential null pointer access,\" but is not.\n" +
- " switch (stringValue)\n" +
- " {\n" +
- " }\n" +
- " \n" +
- " // Should also be flagged, but is not.\n" +
- " switch (computeEnumValue())\n" +
- " {\n" +
- " }\n" +
- " \n" +
- " @Nullable EnumValue enumValue = null;\n" +
- " \n" +
- " // Fixed in bug #403674.\n" +
- " switch (enumValue)\n" +
- " {\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " private static @Nullable String computeStringValue()\n" +
- " {\n" +
- " return null;\n" +
- " }\n" +
- " \n" +
- " private static @Nullable EnumValue computeEnumValue()\n" +
- " {\n" +
- " return null;\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in SwitchTest.java (at line 12)\n" +
- " switch (computeStringValue())\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Potential null pointer access: The method computeStringValue() may return null\n" +
- "----------\n" +
- "2. ERROR in SwitchTest.java (at line 19)\n" +
- " switch (stringValue)\n" +
- " ^^^^^^^^^^^\n" +
- "Null pointer access: The variable stringValue can only be null at this location\n" +
- "----------\n" +
- "3. ERROR in SwitchTest.java (at line 26)\n" +
- " switch (stringValue)\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "public class SwitchTest\n" +
+ "{\n" +
+ " private enum EnumValue\n" +
+ " {\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args)\n" +
+ " {\n" +
+ " // Should be flagged as \"Potential null pointer access,\" but is not.\n" +
+ " switch (computeStringValue())\n" +
+ " {\n" +
+ " }\n" +
+ " \n" +
+ " @Nullable String stringValue = null;\n" +
+ " \n" +
+ " // Properly flagged as \"Null pointer access.\"\n" +
+ " switch (stringValue)\n" +
+ " {\n" +
+ " }\n" +
+ " \n" +
+ " stringValue = computeStringValue();\n" +
+ " \n" +
+ " // Should be flagged as \"Potential null pointer access,\" but is not.\n" +
+ " switch (stringValue)\n" +
+ " {\n" +
+ " }\n" +
+ " \n" +
+ " // Should also be flagged, but is not.\n" +
+ " switch (computeEnumValue())\n" +
+ " {\n" +
+ " }\n" +
+ " \n" +
+ " @Nullable EnumValue enumValue = null;\n" +
+ " \n" +
+ " // Fixed in bug #403674.\n" +
+ " switch (enumValue)\n" +
+ " {\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " private static @Nullable String computeStringValue()\n" +
+ " {\n" +
+ " return null;\n" +
+ " }\n" +
+ " \n" +
+ " private static @Nullable EnumValue computeEnumValue()\n" +
+ " {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n"
+ },
+ "----------\n" +
+ "1. ERROR in SwitchTest.java (at line 12)\n" +
+ " switch (computeStringValue())\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Potential null pointer access: The method computeStringValue() may return null\n" +
+ "----------\n" +
+ "2. ERROR in SwitchTest.java (at line 19)\n" +
+ " switch (stringValue)\n" +
+ " ^^^^^^^^^^^\n" +
+ "Null pointer access: The variable stringValue can only be null at this location\n" +
+ "----------\n" +
+ "3. ERROR in SwitchTest.java (at line 26)\n" +
+ " switch (stringValue)\n" +
" ^^^^^^^^^^^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8
? "Potential null pointer access: The variable stringValue may be null at this location\n"
: "Potential null pointer access: this expression has a \'@Nullable\' type\n" ) +
- "----------\n" +
- "4. ERROR in SwitchTest.java (at line 31)\n" +
- " switch (computeEnumValue())\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Potential null pointer access: The method computeEnumValue() may return null\n" +
- "----------\n" +
- "5. ERROR in SwitchTest.java (at line 38)\n" +
- " switch (enumValue)\n" +
- " ^^^^^^^^^\n" +
- "Null pointer access: The variable enumValue can only be null at this location\n" +
+ "----------\n" +
+ "4. ERROR in SwitchTest.java (at line 31)\n" +
+ " switch (computeEnumValue())\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Potential null pointer access: The method computeEnumValue() may return null\n" +
+ "----------\n" +
+ "5. ERROR in SwitchTest.java (at line 38)\n" +
+ " switch (enumValue)\n" +
+ " ^^^^^^^^^\n" +
+ "Null pointer access: The variable enumValue can only be null at this location\n" +
"----------\n");
}
// same as above but 1.8 with declaration annotations
@@ -7905,84 +7905,84 @@ public void testBug445708b() {
CUSTOM_NULLABLE_NAME,
CUSTOM_NULLABLE_CONTENT,
"SwitchTest.java",
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "public class SwitchTest\n" +
- "{\n" +
- " private enum EnumValue\n" +
- " {\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " // Should be flagged as \"Potential null pointer access,\" but is not.\n" +
- " switch (computeStringValue())\n" +
- " {\n" +
- " }\n" +
- " \n" +
- " @Nullable String stringValue = null;\n" +
- " \n" +
- " // Properly flagged as \"Null pointer access.\"\n" +
- " switch (stringValue)\n" +
- " {\n" +
- " }\n" +
- " \n" +
- " stringValue = computeStringValue();\n" +
- " \n" +
- " // Should be flagged as \"Potential null pointer access,\" but is not.\n" +
- " switch (stringValue)\n" +
- " {\n" +
- " }\n" +
- " \n" +
- " // Should also be flagged, but is not.\n" +
- " switch (computeEnumValue())\n" +
- " {\n" +
- " }\n" +
- " \n" +
- " @Nullable EnumValue enumValue = null;\n" +
- " \n" +
- " // Fixed in bug #403674.\n" +
- " switch (enumValue)\n" +
- " {\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " private static @Nullable String computeStringValue()\n" +
- " {\n" +
- " return null;\n" +
- " }\n" +
- " \n" +
- " private static @Nullable EnumValue computeEnumValue()\n" +
- " {\n" +
- " return null;\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in SwitchTest.java (at line 12)\n" +
- " switch (computeStringValue())\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Potential null pointer access: The method computeStringValue() may return null\n" +
- "----------\n" +
- "2. ERROR in SwitchTest.java (at line 19)\n" +
- " switch (stringValue)\n" +
- " ^^^^^^^^^^^\n" +
- "Null pointer access: The variable stringValue can only be null at this location\n" +
- "----------\n" +
- "3. ERROR in SwitchTest.java (at line 26)\n" +
- " switch (stringValue)\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "public class SwitchTest\n" +
+ "{\n" +
+ " private enum EnumValue\n" +
+ " {\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args)\n" +
+ " {\n" +
+ " // Should be flagged as \"Potential null pointer access,\" but is not.\n" +
+ " switch (computeStringValue())\n" +
+ " {\n" +
+ " }\n" +
+ " \n" +
+ " @Nullable String stringValue = null;\n" +
+ " \n" +
+ " // Properly flagged as \"Null pointer access.\"\n" +
+ " switch (stringValue)\n" +
+ " {\n" +
+ " }\n" +
+ " \n" +
+ " stringValue = computeStringValue();\n" +
+ " \n" +
+ " // Should be flagged as \"Potential null pointer access,\" but is not.\n" +
+ " switch (stringValue)\n" +
+ " {\n" +
+ " }\n" +
+ " \n" +
+ " // Should also be flagged, but is not.\n" +
+ " switch (computeEnumValue())\n" +
+ " {\n" +
+ " }\n" +
+ " \n" +
+ " @Nullable EnumValue enumValue = null;\n" +
+ " \n" +
+ " // Fixed in bug #403674.\n" +
+ " switch (enumValue)\n" +
+ " {\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " private static @Nullable String computeStringValue()\n" +
+ " {\n" +
+ " return null;\n" +
+ " }\n" +
+ " \n" +
+ " private static @Nullable EnumValue computeEnumValue()\n" +
+ " {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n"
+ },
+ "----------\n" +
+ "1. ERROR in SwitchTest.java (at line 12)\n" +
+ " switch (computeStringValue())\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Potential null pointer access: The method computeStringValue() may return null\n" +
+ "----------\n" +
+ "2. ERROR in SwitchTest.java (at line 19)\n" +
+ " switch (stringValue)\n" +
+ " ^^^^^^^^^^^\n" +
+ "Null pointer access: The variable stringValue can only be null at this location\n" +
+ "----------\n" +
+ "3. ERROR in SwitchTest.java (at line 26)\n" +
+ " switch (stringValue)\n" +
" ^^^^^^^^^^^\n" +
"Potential null pointer access: this expression has a \'@Nullable\' type\n" +
- "----------\n" +
- "4. ERROR in SwitchTest.java (at line 31)\n" +
- " switch (computeEnumValue())\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Potential null pointer access: The method computeEnumValue() may return null\n" +
- "----------\n" +
- "5. ERROR in SwitchTest.java (at line 38)\n" +
- " switch (enumValue)\n" +
- " ^^^^^^^^^\n" +
- "Null pointer access: The variable enumValue can only be null at this location\n" +
+ "----------\n" +
+ "4. ERROR in SwitchTest.java (at line 31)\n" +
+ " switch (computeEnumValue())\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Potential null pointer access: The method computeEnumValue() may return null\n" +
+ "----------\n" +
+ "5. ERROR in SwitchTest.java (at line 38)\n" +
+ " switch (enumValue)\n" +
+ " ^^^^^^^^^\n" +
+ "Null pointer access: The variable enumValue can only be null at this location\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=452780 - Internal compiler error: arrayIndexOutOfBounds
@@ -7991,27 +7991,27 @@ public void testBug452780() {
runConformTestWithLibs(
new String[] {
"Tools2.java",
- "import java.util.Arrays;\n" +
- "import java.util.List;\n" +
- "import java.util.Set;\n" +
- "import java.util.stream.Collector;\n" +
- "import java.util.stream.Collectors;\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "public class Tools2 {\n" +
- " @SafeVarargs\n" +
- " public static <T> List<@NonNull T> asList(T... ts) {\n" +
- " @SuppressWarnings(\"null\")\n" +
- " @NonNull\n" +
- " List<@NonNull T> res = Arrays.asList(ts);\n" +
- " return res;\n" +
- " }\n" +
- " @SuppressWarnings(\"null\")\n" +
- " public static <T> Collector<@NonNull T, @NonNull ?, @NonNull Set<@NonNull T>> toSet() {\n" +
- " @NonNull\n" +
- " Collector<@NonNull T, ?, @NonNull Set<@NonNull T>> res = Collectors\n" +
- " .toSet();\n" +
- " return res;\n" +
- " }\n" +
+ "import java.util.Arrays;\n" +
+ "import java.util.List;\n" +
+ "import java.util.Set;\n" +
+ "import java.util.stream.Collector;\n" +
+ "import java.util.stream.Collectors;\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "public class Tools2 {\n" +
+ " @SafeVarargs\n" +
+ " public static <T> List<@NonNull T> asList(T... ts) {\n" +
+ " @SuppressWarnings(\"null\")\n" +
+ " @NonNull\n" +
+ " List<@NonNull T> res = Arrays.asList(ts);\n" +
+ " return res;\n" +
+ " }\n" +
+ " @SuppressWarnings(\"null\")\n" +
+ " public static <T> Collector<@NonNull T, @NonNull ?, @NonNull Set<@NonNull T>> toSet() {\n" +
+ " @NonNull\n" +
+ " Collector<@NonNull T, ?, @NonNull Set<@NonNull T>> res = Collectors\n" +
+ " .toSet();\n" +
+ " return res;\n" +
+ " }\n" +
"}"
},
getCompilerOptions(),
@@ -8022,27 +8022,27 @@ public void testBug455557() {
true, /*flush*/
new String[] {
"X.java",
- "import java.util.List;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "\n" +
- "\n" +
- "public class X {\n" +
- " void test(List<String> list, boolean b) {\n" +
- " if (b) {\n" +
- " while (true) {\n" +
- " for (@NonNull Object y : list) { \n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "\n" +
+ "\n" +
+ "public class X {\n" +
+ " void test(List<String> list, boolean b) {\n" +
+ " if (b) {\n" +
+ " while (true) {\n" +
+ " for (@NonNull Object y : list) { \n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
null,
- "----------\n" +
- "1. WARNING in X.java (at line 10)\n" +
- " for (@NonNull Object y : list) { \n" +
- " ^^^^\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 10)\n" +
+ " for (@NonNull Object y : list) { \n" +
+ " ^^^^\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8
? "Null type safety: The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull Object\'\n"
: "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull Object\'\n"
@@ -8054,22 +8054,22 @@ public void testBug455723() {
new String[] {
"Problem.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "public class Problem {\n" +
- " public void fubar(final @Nullable String arg) {\n" +
- " if (arg == null) {\n" +
- " return;\n" +
- " }\n" +
- " \n" +
- " doSomething(arg);\n" +
- " // no errors here\n" +
- " \n" +
- " while (true) { \n" +
- " doSomething(arg);\n" +
- " // ^^^ compiler error\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " private void doSomething(@NonNull String arg) { }\n" +
+ "public class Problem {\n" +
+ " public void fubar(final @Nullable String arg) {\n" +
+ " if (arg == null) {\n" +
+ " return;\n" +
+ " }\n" +
+ " \n" +
+ " doSomething(arg);\n" +
+ " // no errors here\n" +
+ " \n" +
+ " while (true) { \n" +
+ " doSomething(arg);\n" +
+ " // ^^^ compiler error\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " private void doSomething(@NonNull String arg) { }\n" +
"}\n"
},
null,
@@ -8080,17 +8080,17 @@ public void testBug455723b() {
new String[] {
"Problem.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "public class Problem {\n" +
- " public void fubar(final @Nullable String arg) {\n" +
- " if (arg == null) {\n" +
- " return;\n" +
- " }\n" +
- " @NonNull String local;\n" +
- " \n" +
- " while (true) { \n" +
- " local = arg;\n" +
- " }\n" +
- " }\n" +
+ "public class Problem {\n" +
+ " public void fubar(final @Nullable String arg) {\n" +
+ " if (arg == null) {\n" +
+ " return;\n" +
+ " }\n" +
+ " @NonNull String local;\n" +
+ " \n" +
+ " while (true) { \n" +
+ " local = arg;\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
null,
@@ -8106,11 +8106,11 @@ public void test_null_with_apt() {
runConformTestWithLibs(
new String[] {
"NullWarn.java",
- "@SuppressWarnings(\"null\")\n" +
- "public class NullWarn {\n" +
- "\n" +
- " // Some code\n" +
- "\n" +
+ "@SuppressWarnings(\"null\")\n" +
+ "public class NullWarn {\n" +
+ "\n" +
+ " // Some code\n" +
+ "\n" +
"}\n"
},
customOptions,
@@ -8127,24 +8127,24 @@ public void test_null_with_apt_comment4() {
true, // flush
new String[] {
"Test.java",
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "\n" +
- "@NonNullByDefault\n" +
- "public class Test {\n" +
- "\n" +
- " public static final Test t = new Test(Integer.valueOf(0));\n" +
- "\n" +
- " public Test(Integer integer) {\n" +
- " \n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "\n" +
+ "@NonNullByDefault\n" +
+ "public class Test {\n" +
+ "\n" +
+ " public static final Test t = new Test(Integer.valueOf(0));\n" +
+ "\n" +
+ " public Test(Integer integer) {\n" +
+ " \n" +
+ " }\n" +
"}\n"
},
customOptions,
- "----------\n" +
- "1. WARNING in Test.java (at line 6)\n" +
- " public static final Test t = new Test(Integer.valueOf(0));\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- (this.complianceLevel < ClassFileConstants.JDK1_8
+ "----------\n" +
+ "1. WARNING in Test.java (at line 6)\n" +
+ " public static final Test t = new Test(Integer.valueOf(0));\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ (this.complianceLevel < ClassFileConstants.JDK1_8
? "Null type safety: The expression of type \'Integer\' needs unchecked conversion to conform to \'@NonNull Integer\'\n"
: "Null type safety (type annotations): The expression of type \'Integer\' needs unchecked conversion to conform to \'@NonNull Integer\'\n"
) +
@@ -8172,9 +8172,9 @@ public void testBug457210() {
"TestRunner.java",
"import org.foo.*;\n" +
"public class TestRunner {\n" +
- " private TestRunner() {}\n" +
- "\n" +
- " @Nullable\n" +
+ " private TestRunner() {}\n" +
+ "\n" +
+ " @Nullable\n" +
" OutputHelper m_outputHelper;\n" +
" int foo(@NonNull OutputHelper helper) { return helper.i; }\n" +
"}\n",
@@ -8183,11 +8183,11 @@ public void testBug457210() {
" public int i;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in OutputHelper.java (at line 1)\n" +
- " @org.foo.NonNull public class OutputHelper {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The nullness annotation \'NonNull\' is not applicable at this location\n" +
+ "----------\n" +
+ "1. ERROR in OutputHelper.java (at line 1)\n" +
+ " @org.foo.NonNull public class OutputHelper {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The nullness annotation \'NonNull\' is not applicable at this location\n" +
"----------\n",
null,
true,
@@ -8201,46 +8201,46 @@ public void testBug462790() {
true, /*flush*/
new String[] {
"EclipseBug.java",
- "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
- "public class EclipseBug {\n" +
- "\n" +
- " public void method(Class<? extends String> commandType) {\n" +
- " String command = (String)getCommand(commandType);\n" +
- " }\n" +
- " \n" +
- " public static <T extends String> T getCommand(Class<T> commandType) {\n" +
- " try {\n" +
- " return commandType.newInstance();\n" +
- " } catch (InstantiationException | IllegalAccessException e) {\n" +
- " throw new RuntimeException();\n" +
- " }\n" +
- " }\n" +
+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ "public class EclipseBug {\n" +
+ "\n" +
+ " public void method(Class<? extends String> commandType) {\n" +
+ " String command = (String)getCommand(commandType);\n" +
+ " }\n" +
+ " \n" +
+ " public static <T extends String> T getCommand(Class<T> commandType) {\n" +
+ " try {\n" +
+ " return commandType.newInstance();\n" +
+ " } catch (InstantiationException | IllegalAccessException e) {\n" +
+ " throw new RuntimeException();\n" +
+ " }\n" +
+ " }\n" +
"}"
},
options,
- "----------\n" +
- "1. WARNING in EclipseBug.java (at line 5)\n" +
- " String command = (String)getCommand(commandType);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from capture#1-of ? extends String to String\n" +
- "----------\n" +
- "2. WARNING in EclipseBug.java (at line 8)\n" +
- " public static <T extends String> T getCommand(Class<T> commandType) {\n" +
- " ^^^^^^\n" +
- "The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
+ "----------\n" +
+ "1. WARNING in EclipseBug.java (at line 5)\n" +
+ " String command = (String)getCommand(commandType);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unnecessary cast from capture#1-of ? extends String to String\n" +
+ "----------\n" +
+ "2. WARNING in EclipseBug.java (at line 8)\n" +
+ " public static <T extends String> T getCommand(Class<T> commandType) {\n" +
+ " ^^^^^^\n" +
+ "The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
"----------\n" +
(this.complianceLevel < ClassFileConstants.JDK1_8
?
- "3. WARNING in EclipseBug.java (at line 10)\n" +
- " return commandType.newInstance();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety: The expression of type \'T\' needs unchecked conversion to conform to \'@NonNull T\'\n" +
+ "3. WARNING in EclipseBug.java (at line 10)\n" +
+ " return commandType.newInstance();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety: The expression of type \'T\' needs unchecked conversion to conform to \'@NonNull T\'\n" +
"----------\n"
:
- "3. INFO in EclipseBug.java (at line 10)\n" +
- " return commandType.newInstance();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'@NonNull Class<T extends @NonNull String>\'. Type \'Class<T>\' doesn\'t seem to be designed with null type annotations in mind\n" +
+ "3. INFO in EclipseBug.java (at line 10)\n" +
+ " return commandType.newInstance();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'@NonNull Class<T extends @NonNull String>\'. Type \'Class<T>\' doesn\'t seem to be designed with null type annotations in mind\n" +
"----------\n"));
}
public void testBug459967_Enum_valueOf() {
@@ -8263,7 +8263,7 @@ public void testBug459967_Enum_valueOf_binary() {
runConformTest(
new String[] {
"MyEnum.java",
- "public enum MyEnum { V1, V2 }\n"
+ "public enum MyEnum { V1, V2 }\n"
});
runConformTestWithLibs(
false /*flush*/,
@@ -8304,12 +8304,12 @@ public void testBug459967_Enum_values() {
runConformTestWithLibs(
testFiles,
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " for (@NonNull MyEnum value : MyEnum.values())\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Null type safety: The expression of type \'MyEnum\' needs unchecked conversion to conform to \'@NonNull MyEnum\'\n" +
- "----------\n");
+ "----------\n" +
+ "1. WARNING in X.java (at line 7)\n" +
+ " for (@NonNull MyEnum value : MyEnum.values())\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Null type safety: The expression of type \'MyEnum\' needs unchecked conversion to conform to \'@NonNull MyEnum\'\n" +
+ "----------\n");
} else {
runConformTestWithLibs(
testFiles,
@@ -8346,12 +8346,12 @@ public void testBug459967_Enum_values_binary() {
false /*flush*/,
testFiles,
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " for (@NonNull MyEnum value : MyEnum.values())\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Null type safety: The expression of type \'MyEnum\' needs unchecked conversion to conform to \'@NonNull MyEnum\'\n" +
- "----------\n");
+ "----------\n" +
+ "1. WARNING in X.java (at line 7)\n" +
+ " for (@NonNull MyEnum value : MyEnum.values())\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Null type safety: The expression of type \'MyEnum\' needs unchecked conversion to conform to \'@NonNull MyEnum\'\n" +
+ "----------\n");
} else {
runConformTestWithLibs(
false /*flush*/,
@@ -8556,10 +8556,10 @@ public void testBug407414c() {
" int fI;\n" +
" @org.eclipse.jdt.annotation.NonNull Integer test1(int i) {\n" +
" return fI = i;\n" +
- " }\n" +
+ " }\n" +
" @org.eclipse.jdt.annotation.NonNull Integer test2(int i) {\n" +
" return fI += i;\n" +
- " }\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -8574,7 +8574,7 @@ public void testBug407414d() {
"public class X {\n" +
" @org.eclipse.jdt.annotation.NonNull Long test(int i) {\n" +
" return (long)i;\n" +
- " }\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -8589,7 +8589,7 @@ public void testBug407414e() {
"public class X {\n" +
" @org.eclipse.jdt.annotation.NonNull Long test(long l, boolean b) {\n" +
" return b ? l : 3;\n" +
- " }\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -8604,10 +8604,10 @@ public void testBug407414f() {
"public class X {\n" +
" @org.eclipse.jdt.annotation.NonNull Long test1(long l) {\n" +
" return l + 3;\n" +
- " }\n" +
+ " }\n" +
" @org.eclipse.jdt.annotation.NonNull Long test2(long l) {\n" +
" return l << 3;\n" +
- " }\n" +
+ " }\n" +
" @org.eclipse.jdt.annotation.NonNull Long test3(long l) {\n" +
" return l++;\n" +
" }\n" +
@@ -8677,8 +8677,8 @@ public void testBug237236() {
"X.java",
"@org.eclipse.jdt.annotation.NonNullByDefault\n" +
"public class X {\n" +
- " public void x(Long l) {}\n" +
- " public long z() { return 0L; }\n" +
+ " public void x(Long l) {}\n" +
+ " public long z() { return 0L; }\n" +
" public void y() { x(z()); }\n" +
"}\n"
},
@@ -8689,17 +8689,17 @@ public void testBug418236() {
runConformTestWithLibs(
new String[] {
"MyClass.java",
- "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
- "public class MyClass {\n" +
- " private static final int CONSTANT = 24;\n" +
- "\n" +
- " public Integer returnConstant() {\n" +
- " return CONSTANT; // <-- incorrect error. Integer.valueOf is declared as non-null.\n" +
- " }\n" +
- "\n" +
- " public Integer returnInteger() {\n" +
- " return 24; // <-- no error reported here\n" +
- " }\n" +
+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ "public class MyClass {\n" +
+ " private static final int CONSTANT = 24;\n" +
+ "\n" +
+ " public Integer returnConstant() {\n" +
+ " return CONSTANT; // <-- incorrect error. Integer.valueOf is declared as non-null.\n" +
+ " }\n" +
+ "\n" +
+ " public Integer returnInteger() {\n" +
+ " return 24; // <-- no error reported here\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -8712,25 +8712,25 @@ public void testBug461878() {
true, /*flush*/
new String[] {
"javax/annotation/Nonnull.java",
- "package javax.annotation;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "public @interface Nonnull {\n" +
+ "package javax.annotation;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "public @interface Nonnull {\n" +
"}\n",
"edu/umd/cs/findbugs/annotations/PossiblyNull.java",
- "package edu.umd.cs.findbugs.annotations;\n" +
- "@javax.annotation.Nonnull // <-- error!!!\n" +
- "public @interface PossiblyNull {\n" +
+ "package edu.umd.cs.findbugs.annotations;\n" +
+ "@javax.annotation.Nonnull // <-- error!!!\n" +
+ "public @interface PossiblyNull {\n" +
"}\n"
},
null, /*libs*/
compilerOptions,
- "----------\n" +
- "1. WARNING in edu\\umd\\cs\\findbugs\\annotations\\PossiblyNull.java (at line 2)\n" +
- " @javax.annotation.Nonnull // <-- error!!!\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The nullness annotation \'Nonnull\' is not applicable at this location\n" +
+ "----------\n" +
+ "1. WARNING in edu\\umd\\cs\\findbugs\\annotations\\PossiblyNull.java (at line 2)\n" +
+ " @javax.annotation.Nonnull // <-- error!!!\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The nullness annotation \'Nonnull\' is not applicable at this location\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
}
@@ -8739,23 +8739,23 @@ public void testBug467610() {
new String[] {
"SuperClass.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "@NonNullByDefault\n" +
- "public abstract class SuperClass<T> {\n" +
- "\n" +
- " abstract T doSomething(T arg);\n" +
- "\n" +
- " abstract String returnAString();\n" +
- "\n" +
- " public static abstract class SubClass<S> extends SuperClass<S> {\n" +
- "\n" +
- " @Override\n" +
- " abstract S doSomething(S arg);\n" +
- "\n" +
- " @Override\n" +
- " abstract String returnAString();\n" +
- " \n" +
- " }\n" +
- "\n" +
+ "@NonNullByDefault\n" +
+ "public abstract class SuperClass<T> {\n" +
+ "\n" +
+ " abstract T doSomething(T arg);\n" +
+ "\n" +
+ " abstract String returnAString();\n" +
+ "\n" +
+ " public static abstract class SubClass<S> extends SuperClass<S> {\n" +
+ "\n" +
+ " @Override\n" +
+ " abstract S doSomething(S arg);\n" +
+ "\n" +
+ " @Override\n" +
+ " abstract String returnAString();\n" +
+ " \n" +
+ " }\n" +
+ "\n" +
"}"
},
getCompilerOptions(),
@@ -8784,28 +8784,28 @@ public void testBug482075() {
runConformTestWithLibs(
new String[] {
"TestIncidentImports2.java",
- "public class TestIncidentImports2 {\n" +
- "\n" +
- " private String arg0;\n" +
- " private TestIncidentImports2 arg2;\n" +
- "\n" +
- " public TestIncidentImports2(String arg0) {\n" +
- " this.arg0 = arg0;\n" +
- " }\n" +
- "\n" +
- " protected void apply(Object o) throws Exception {\n" +
- " arg0.length();\n" +
+ "public class TestIncidentImports2 {\n" +
+ "\n" +
+ " private String arg0;\n" +
+ " private TestIncidentImports2 arg2;\n" +
+ "\n" +
+ " public TestIncidentImports2(String arg0) {\n" +
+ " this.arg0 = arg0;\n" +
+ " }\n" +
+ "\n" +
+ " protected void apply(Object o) throws Exception {\n" +
+ " arg0.length();\n" +
" other(arg0);\n" + // arg0 is protected by dereference as MessageSend.receiver
// still triggers an error: QualifiedNameReference doesn't have an ASTNode representing the receiver
// " if (arg2.arg0 != null && other(arg2))\n" + // arg2 is protected by dereference from QualifiedNameReference
-// " System.out.println(7);\n" +
+// " System.out.println(7);\n" +
" if (this.arg2.arg0 != null && other(arg2))\n" + // arg2 is protected by dereference as FieldReference.receiver
- " System.out.println(9);\n" +
- " }\n" +
- "\n" +
- " boolean other(@org.eclipse.jdt.annotation.NonNull Object o) {\n" +
- " return true;\n" +
- " }\n" +
+ " System.out.println(9);\n" +
+ " }\n" +
+ "\n" +
+ " boolean other(@org.eclipse.jdt.annotation.NonNull Object o) {\n" +
+ " return true;\n" +
+ " }\n" +
"}\n"
},
options,
@@ -8821,24 +8821,24 @@ public void testMultipleAnnotations() {
"org/foo1/Nullable.java",
"package org.foo1;\n" +
"import java.lang.annotation.*;\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE})\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE})\n" +
"public @interface Nullable {}\n",
"org/foo1/NonNull.java",
"package org.foo1;\n" +
"import java.lang.annotation.*;\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE})\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE})\n" +
"public @interface NonNull {}\n",
"p1/TestNulls.java",
"package p1;\n" +
- "import org.foo1.*;\n" +
- "\n" +
- "public class TestNulls {\n" +
- " public @Nullable String weaken(@NonNull String theValue) {\n" +
- " return theValue;\n" +
- " }\n" +
- "\n" +
+ "import org.foo1.*;\n" +
+ "\n" +
+ "public class TestNulls {\n" +
+ " public @Nullable String weaken(@NonNull String theValue) {\n" +
+ " return theValue;\n" +
+ " }\n" +
+ "\n" +
"}"
},
options1);
@@ -8853,54 +8853,54 @@ public void testMultipleAnnotations() {
"org/foo2/Nullable2.java",
"package org.foo2;\n" +
"import java.lang.annotation.*;\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE})\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE})\n" +
"public @interface Nullable2 {}\n",
"org/foo2/NonNull2.java",
"package org.foo2;\n" +
"import java.lang.annotation.*;\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE})\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE})\n" +
"public @interface NonNull2 {}\n",
"org/foo2/NoNulls2.java",
"package org.foo2;\n" +
"import java.lang.annotation.*;\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@Target({ElementType.FIELD, ElementType.METHOD, ElementType.TYPE})\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ElementType.FIELD, ElementType.METHOD, ElementType.TYPE})\n" +
"public @interface NoNulls2 {}\n",
"p2/TestNulls2.java",
"package p2;\n" +
- "import org.foo2.*;\n" +
- "\n" +
- "public class TestNulls2 {\n" +
- " public @Nullable2 String weaken(@NonNull2 String theValue) {\n" +
- " return theValue;\n" +
+ "import org.foo2.*;\n" +
+ "\n" +
+ "public class TestNulls2 {\n" +
+ " public @Nullable2 String weaken(@NonNull2 String theValue) {\n" +
+ " return theValue;\n" +
" }\n" +
- " @NoNulls2\n" +
- " public String strong(String theValue) {\n" +
- " return weaken(theValue);\n" +
- " }\n" +
- "\n" +
+ " @NoNulls2\n" +
+ " public String strong(String theValue) {\n" +
+ " return weaken(theValue);\n" +
+ " }\n" +
+ "\n" +
"}",
"p2/TestNulls2a.java",
"package p2;\n" +
- "import org.foo2.*;\n" +
- "\n" +
- "@NoNulls2\n" +
- "public class TestNulls2a {\n" +
- " public String strong(String theValue) {\n" +
- " return theValue;\n" +
- " }\n" +
- "\n" +
+ "import org.foo2.*;\n" +
+ "\n" +
+ "@NoNulls2\n" +
+ "public class TestNulls2a {\n" +
+ " public String strong(String theValue) {\n" +
+ " return theValue;\n" +
+ " }\n" +
+ "\n" +
"}"
},
null, //libs
options2,
- "----------\n" +
- "1. WARNING in p2\\TestNulls2.java (at line 10)\n" +
- " return weaken(theValue);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch: required \'@NonNull2 String\' but the provided value is specified as @Nullable2\n" +
+ "----------\n" +
+ "1. WARNING in p2\\TestNulls2.java (at line 10)\n" +
+ " return weaken(theValue);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch: required \'@NonNull2 String\' but the provided value is specified as @Nullable2\n" +
"----------\n",
"",
"",
@@ -8933,35 +8933,35 @@ public void testMultipleAnnotations() {
"}\n"
},
options3,
- "----------\n" +
- "1. ERROR in p3\\Test.java (at line 8)\n" +
- " return test.weaken(input);\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in p3\\Test.java (at line 8)\n" +
+ " return test.weaken(input);\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
mismatch_NonNull_Nullable("String") +
- "----------\n" +
- "2. ERROR in p3\\Test.java (at line 8)\n" +
- " return test.weaken(input);\n" +
- " ^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in p3\\Test.java (at line 8)\n" +
+ " return test.weaken(input);\n" +
+ " ^^^^^\n" +
mismatch_NonNull_Nullable("String") +
- "----------\n" +
- "3. ERROR in p3\\Test.java (at line 11)\n" +
- " return test.weaken(input);\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "3. ERROR in p3\\Test.java (at line 11)\n" +
+ " return test.weaken(input);\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
mismatch_NonNull_Nullable("String") +
- "----------\n" +
- "4. ERROR in p3\\Test.java (at line 11)\n" +
- " return test.weaken(input);\n" +
- " ^^^^^\n" +
+ "----------\n" +
+ "4. ERROR in p3\\Test.java (at line 11)\n" +
+ " return test.weaken(input);\n" +
+ " ^^^^^\n" +
mismatch_NonNull_Nullable("String") +
- "----------\n" +
- "5. ERROR in p3\\Test.java (at line 14)\n" +
- " return test.strong(input); // requires nonnull due to method-level default\n" +
- " ^^^^^\n" +
+ "----------\n" +
+ "5. ERROR in p3\\Test.java (at line 14)\n" +
+ " return test.strong(input); // requires nonnull due to method-level default\n" +
+ " ^^^^^\n" +
mismatch_NonNull_Nullable("String") +
- "----------\n" +
- "6. ERROR in p3\\Test.java (at line 17)\n" +
- " return test.strong(input); // requires nonnull due to type-level default\n" +
- " ^^^^^\n" +
+ "----------\n" +
+ "6. ERROR in p3\\Test.java (at line 17)\n" +
+ " return test.strong(input); // requires nonnull due to type-level default\n" +
+ " ^^^^^\n" +
mismatch_NonNull_Nullable("String") +
"----------\n");
}
@@ -8986,7 +8986,7 @@ public void testBug489486conform() {
"test/package-info.java",
"@TheAnnotation(value = DurationAdapter.class)\n" +
"package test;\n",
- },
+ },
getCompilerOptions(),
""
);
@@ -9013,11 +9013,11 @@ public void testBug489486negative() {
"@TheAnnotation(value = DurationAdapter.class)\n" +
"package test;\n",
},
- "----------\n" +
- "1. ERROR in test\\package-info.java (at line 1)\n" +
- " @TheAnnotation(value = DurationAdapter.class)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Class<DurationAdapter> to Class<? extends SoftReference<?>>\n" +
+ "----------\n" +
+ "1. ERROR in test\\package-info.java (at line 1)\n" +
+ " @TheAnnotation(value = DurationAdapter.class)\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Class<DurationAdapter> to Class<? extends SoftReference<?>>\n" +
"----------\n",
this.LIBS,
true, /*flush*/
@@ -9049,7 +9049,7 @@ public void testBug502113() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -9087,18 +9087,18 @@ public void testBug502113b() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\X.java (at line 8)\n" +
- " public boolean equals(Object other) {\n" +
- " ^^^^^^\n" +
- "Missing nullable annotation: inherited method from I specifies this parameter as @Nullable\n" +
- "----------\n" +
- "2. ERROR in test\\X.java (at line 12)\n" +
- " public String toString() {\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull String\' returned from I.toString() (mismatching null constraints)\n" +
+ "----------\n" +
+ "1. ERROR in test\\X.java (at line 8)\n" +
+ " public boolean equals(Object other) {\n" +
+ " ^^^^^^\n" +
+ "Missing nullable annotation: inherited method from I specifies this parameter as @Nullable\n" +
+ "----------\n" +
+ "2. ERROR in test\\X.java (at line 12)\n" +
+ " public String toString() {\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull String\' returned from I.toString() (mismatching null constraints)\n" +
"----------\n"
);
}
@@ -9133,31 +9133,31 @@ public void testBug502214() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- (this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. ERROR in test\\X.java (at line 22)\n" +
- " class Y extends A implements I {\n" +
- " ^\n" +
- "The method m2() from A cannot implement the corresponding method from I due to incompatible nullness constraints\n" +
- "----------\n" +
- "2. ERROR in test\\X.java (at line 22)\n" +
- " class Y extends A implements I {\n" +
- " ^\n" +
- "The method m1(Object) from A cannot implement the corresponding method from I due to incompatible nullness constraints\n" +
- "----------\n"
+ (this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ "----------\n" +
+ "1. ERROR in test\\X.java (at line 22)\n" +
+ " class Y extends A implements I {\n" +
+ " ^\n" +
+ "The method m2() from A cannot implement the corresponding method from I due to incompatible nullness constraints\n" +
+ "----------\n" +
+ "2. ERROR in test\\X.java (at line 22)\n" +
+ " class Y extends A implements I {\n" +
+ " ^\n" +
+ "The method m1(Object) from A cannot implement the corresponding method from I due to incompatible nullness constraints\n" +
+ "----------\n"
:
- "----------\n" +
- "1. ERROR in test\\X.java (at line 22)\n" +
- " class Y extends A implements I {\n" +
- " ^\n" +
- "The method @Nullable String m2() from A cannot implement the corresponding method from I due to incompatible nullness constraints\n" +
- "----------\n" +
- "2. ERROR in test\\X.java (at line 22)\n" +
- " class Y extends A implements I {\n" +
- " ^\n" +
- "The method m1(Object) from A cannot implement the corresponding method from I due to incompatible nullness constraints\n" +
+ "----------\n" +
+ "1. ERROR in test\\X.java (at line 22)\n" +
+ " class Y extends A implements I {\n" +
+ " ^\n" +
+ "The method @Nullable String m2() from A cannot implement the corresponding method from I due to incompatible nullness constraints\n" +
+ "----------\n" +
+ "2. ERROR in test\\X.java (at line 22)\n" +
+ " class Y extends A implements I {\n" +
+ " ^\n" +
+ "The method m1(Object) from A cannot implement the corresponding method from I due to incompatible nullness constraints\n" +
"----------\n"
)
);
@@ -9200,7 +9200,7 @@ public void testBug530970_param() {
"public @interface Nullable {\n" +
"}\n" +
"",
- },
+ },
customOptions,
""
);
@@ -9225,21 +9225,21 @@ public void testBug530970_param() {
"}\n"
},
customOptions,
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " test1(null); // ERR\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " test2(null); // ERR\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 14)\n" +
- " void redundant(@NonNullByDefault(DefaultLocation.PARAMETER) java.lang.Number in) { // WARNING\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " test1(null); // ERR\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " test2(null); // ERR\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 14)\n" +
+ " void redundant(@NonNullByDefault(DefaultLocation.PARAMETER) java.lang.Number in) { // WARNING\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing type X\n" +
"----------\n"
);
}
@@ -9281,7 +9281,7 @@ public void testBug530970_return() {
"public @interface Nullable {\n" +
"}\n" +
"",
- },
+ },
customOptions,
""
);
@@ -9299,11 +9299,11 @@ public void testBug530970_return() {
"}\n"
},
customOptions,
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " return null; // ERR\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " return null; // ERR\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
"----------\n");
}
@@ -9344,7 +9344,7 @@ public void testBug530970_field() {
"public @interface Nullable {\n" +
"}\n" +
"",
- },
+ },
customOptions,
""
);
@@ -9358,11 +9358,11 @@ public void testBug530970_field() {
"}\n"
},
customOptions,
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " Number field; // ERR since uninitialized\n" +
- " ^^^^^\n" +
- "The @NonNull field field may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " Number field; // ERR since uninitialized\n" +
+ " ^^^^^\n" +
+ "The @NonNull field field may not have been initialized\n" +
"----------\n");
}
@@ -9403,7 +9403,7 @@ public void testBug530970_default() {
"public @interface Nullable {\n" +
"}\n" +
"",
- },
+ },
customOptions,
""
);
@@ -9423,11 +9423,11 @@ public void testBug530970_default() {
"}\n"
},
customOptions,
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " Number field; // ERR since uninitialized\n" +
- " ^^^^^\n" +
- "The @NonNull field field may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " Number field; // ERR since uninitialized\n" +
+ " ^^^^^\n" +
+ "The @NonNull field field may not have been initialized\n" +
"----------\n");
}
@@ -9468,7 +9468,7 @@ public void testBug530970_param_bin() {
"public @interface Nullable {\n" +
"}\n" +
"",
- },
+ },
customOptions,
""
);
@@ -9497,16 +9497,16 @@ public void testBug530970_param_bin() {
"}\n"
},
customOptions,
- "----------\n" +
- "1. WARNING in Y.java (at line 4)\n" +
- " return x.test1(null); // error at arg, unchecked at return\n" +
- " ^^^^^^^^^^^^^\n" +
- "Null type safety: The expression of type \'Number\' needs unchecked conversion to conform to \'@NonNull Number\'\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 4)\n" +
- " return x.test1(null); // error at arg, unchecked at return\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
+ "----------\n" +
+ "1. WARNING in Y.java (at line 4)\n" +
+ " return x.test1(null); // error at arg, unchecked at return\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Null type safety: The expression of type \'Number\' needs unchecked conversion to conform to \'@NonNull Number\'\n" +
+ "----------\n" +
+ "2. ERROR in Y.java (at line 4)\n" +
+ " return x.test1(null); // error at arg, unchecked at return\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
"----------\n");
}
@@ -9548,7 +9548,7 @@ public void testBug530970_return_bin() {
"public @interface Nullable {\n" +
"}\n" +
"",
- },
+ },
customOptions,
""
);
@@ -9619,7 +9619,7 @@ public void testBug530970_field_bin() {
"public @interface Nullable {\n" +
"}\n" +
"",
- },
+ },
customOptions,
""
);
@@ -9645,11 +9645,11 @@ public void testBug530970_field_bin() {
"}\n"
},
customOptions,
- "----------\n" +
- "1. ERROR in Y.java (at line 3)\n" +
- " x.field = null; // ERR\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in Y.java (at line 3)\n" +
+ " x.field = null; // ERR\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
"----------\n");}
//default default
@@ -9690,7 +9690,7 @@ public void testBug530970_default_bin() {
"public @interface Nullable {\n" +
"}\n" +
"",
- },
+ },
customOptions,
""
);
@@ -9720,11 +9720,11 @@ public void testBug530970_default_bin() {
"}\n"
},
customOptions,
- "----------\n" +
- "1. ERROR in Y.java (at line 4)\n" +
- " x.field = null; // ERR\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in Y.java (at line 4)\n" +
+ " x.field = null; // ERR\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
"----------\n");}
public void testBug530970_on_field_and_local() {
@@ -9764,7 +9764,7 @@ public void testBug530970_on_field_and_local() {
"public @interface Nullable {\n" +
"}\n" +
"",
- },
+ },
customOptions,
""
);
@@ -9902,128 +9902,128 @@ public void testBug530970_on_field_and_local() {
" }\n" +
"}\n" +
"",
- },
+ },
customOptions,
- "----------\n" +
- "1. WARNING in nnbd_test1\\Test.java (at line 32)\n" +
- " public String f(Integer p) { // warning on parameter expected\n" +
- " ^^^^^^^\n" +
- "Missing non-null annotation: inherited method from X specifies this parameter as @NonNull\n" +
- "----------\n" +
- "2. ERROR in nnbd_test1\\Test.java (at line 33)\n" +
- " this.a = null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "3. ERROR in nnbd_test1\\Test.java (at line 35)\n" +
- " return null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "4. ERROR in nnbd_test1\\Test.java (at line 40)\n" +
- " return null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "5. WARNING in nnbd_test1\\Test.java (at line 44)\n" +
- " public String h(Integer p) { // warning on parameter type expected\n" +
- " ^^^^^^^\n" +
- "Missing non-null annotation: inherited method from X specifies this parameter as @NonNull\n" +
- "----------\n" +
- "6. ERROR in nnbd_test1\\Test.java (at line 45)\n" +
- " return null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "7. ERROR in nnbd_test1\\Test.java (at line 50)\n" +
- " return null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "8. ERROR in nnbd_test1\\Test.java (at line 56)\n" +
- " public String f(Integer p) { // warning on return type expected\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull String\' returned from X.f(Integer) (mismatching null constraints)\n" +
- "----------\n" +
- "9. ERROR in nnbd_test1\\Test.java (at line 57)\n" +
- " this.a = null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "10. ERROR in nnbd_test1\\Test.java (at line 63)\n" +
- " public String g(Integer p) { // warning on return type and parameter expected\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull String\' returned from X.g(Integer) (mismatching null constraints)\n" +
- "----------\n" +
- "11. ERROR in nnbd_test1\\Test.java (at line 63)\n" +
- " public String g(Integer p) { // warning on return type and parameter expected\n" +
- " ^^^^^^^\n" +
- "Illegal redefinition of parameter p, inherited method from X does not constrain this parameter\n" +
- "----------\n" +
- "12. ERROR in nnbd_test1\\Test.java (at line 73)\n" +
- " public String i(Integer p) { // warning on parameter expected\n" +
- " ^^^^^^^\n" +
- "Illegal redefinition of parameter p, inherited method from X does not constrain this parameter\n" +
- "----------\n" +
- "13. WARNING in nnbd_test1\\Test.java (at line 82)\n" +
- " public String f(Integer p) { // warning on parameter expected\n" +
- " ^^^^^^^\n" +
- "Missing non-null annotation: inherited method from X specifies this parameter as @NonNull\n" +
- "----------\n" +
- "14. ERROR in nnbd_test1\\Test.java (at line 83)\n" +
- " this.a = null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "15. ERROR in nnbd_test1\\Test.java (at line 85)\n" +
- " return null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "16. ERROR in nnbd_test1\\Test.java (at line 90)\n" +
- " return null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "17. WARNING in nnbd_test1\\Test.java (at line 94)\n" +
- " public String h(Integer p) { // warning on parameter type expected\n" +
- " ^^^^^^^\n" +
- "Missing non-null annotation: inherited method from X specifies this parameter as @NonNull\n" +
- "----------\n" +
- "18. ERROR in nnbd_test1\\Test.java (at line 95)\n" +
- " return null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "19. ERROR in nnbd_test1\\Test.java (at line 100)\n" +
- " return null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "20. ERROR in nnbd_test1\\Test.java (at line 106)\n" +
- " public String f(Integer p) { // warning on return type expected\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull String\' returned from X.f(Integer) (mismatching null constraints)\n" +
- "----------\n" +
- "21. ERROR in nnbd_test1\\Test.java (at line 107)\n" +
- " this.a = null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "22. ERROR in nnbd_test1\\Test.java (at line 113)\n" +
- " public String g(Integer p) { // warning on return type and parameter expected\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull String\' returned from X.g(Integer) (mismatching null constraints)\n" +
- "----------\n" +
- "23. ERROR in nnbd_test1\\Test.java (at line 113)\n" +
- " public String g(Integer p) { // warning on return type and parameter expected\n" +
- " ^^^^^^^\n" +
- "Illegal redefinition of parameter p, inherited method from X does not constrain this parameter\n" +
- "----------\n" +
- "24. ERROR in nnbd_test1\\Test.java (at line 123)\n" +
- " public String i(Integer p) { // warning on parameter expected\n" +
- " ^^^^^^^\n" +
- "Illegal redefinition of parameter p, inherited method from X does not constrain this parameter\n" +
+ "----------\n" +
+ "1. WARNING in nnbd_test1\\Test.java (at line 32)\n" +
+ " public String f(Integer p) { // warning on parameter expected\n" +
+ " ^^^^^^^\n" +
+ "Missing non-null annotation: inherited method from X specifies this parameter as @NonNull\n" +
+ "----------\n" +
+ "2. ERROR in nnbd_test1\\Test.java (at line 33)\n" +
+ " this.a = null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "3. ERROR in nnbd_test1\\Test.java (at line 35)\n" +
+ " return null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "4. ERROR in nnbd_test1\\Test.java (at line 40)\n" +
+ " return null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "5. WARNING in nnbd_test1\\Test.java (at line 44)\n" +
+ " public String h(Integer p) { // warning on parameter type expected\n" +
+ " ^^^^^^^\n" +
+ "Missing non-null annotation: inherited method from X specifies this parameter as @NonNull\n" +
+ "----------\n" +
+ "6. ERROR in nnbd_test1\\Test.java (at line 45)\n" +
+ " return null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "7. ERROR in nnbd_test1\\Test.java (at line 50)\n" +
+ " return null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "8. ERROR in nnbd_test1\\Test.java (at line 56)\n" +
+ " public String f(Integer p) { // warning on return type expected\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull String\' returned from X.f(Integer) (mismatching null constraints)\n" +
+ "----------\n" +
+ "9. ERROR in nnbd_test1\\Test.java (at line 57)\n" +
+ " this.a = null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "10. ERROR in nnbd_test1\\Test.java (at line 63)\n" +
+ " public String g(Integer p) { // warning on return type and parameter expected\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull String\' returned from X.g(Integer) (mismatching null constraints)\n" +
+ "----------\n" +
+ "11. ERROR in nnbd_test1\\Test.java (at line 63)\n" +
+ " public String g(Integer p) { // warning on return type and parameter expected\n" +
+ " ^^^^^^^\n" +
+ "Illegal redefinition of parameter p, inherited method from X does not constrain this parameter\n" +
+ "----------\n" +
+ "12. ERROR in nnbd_test1\\Test.java (at line 73)\n" +
+ " public String i(Integer p) { // warning on parameter expected\n" +
+ " ^^^^^^^\n" +
+ "Illegal redefinition of parameter p, inherited method from X does not constrain this parameter\n" +
+ "----------\n" +
+ "13. WARNING in nnbd_test1\\Test.java (at line 82)\n" +
+ " public String f(Integer p) { // warning on parameter expected\n" +
+ " ^^^^^^^\n" +
+ "Missing non-null annotation: inherited method from X specifies this parameter as @NonNull\n" +
+ "----------\n" +
+ "14. ERROR in nnbd_test1\\Test.java (at line 83)\n" +
+ " this.a = null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "15. ERROR in nnbd_test1\\Test.java (at line 85)\n" +
+ " return null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "16. ERROR in nnbd_test1\\Test.java (at line 90)\n" +
+ " return null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "17. WARNING in nnbd_test1\\Test.java (at line 94)\n" +
+ " public String h(Integer p) { // warning on parameter type expected\n" +
+ " ^^^^^^^\n" +
+ "Missing non-null annotation: inherited method from X specifies this parameter as @NonNull\n" +
+ "----------\n" +
+ "18. ERROR in nnbd_test1\\Test.java (at line 95)\n" +
+ " return null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "19. ERROR in nnbd_test1\\Test.java (at line 100)\n" +
+ " return null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "20. ERROR in nnbd_test1\\Test.java (at line 106)\n" +
+ " public String f(Integer p) { // warning on return type expected\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull String\' returned from X.f(Integer) (mismatching null constraints)\n" +
+ "----------\n" +
+ "21. ERROR in nnbd_test1\\Test.java (at line 107)\n" +
+ " this.a = null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "22. ERROR in nnbd_test1\\Test.java (at line 113)\n" +
+ " public String g(Integer p) { // warning on return type and parameter expected\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull String\' returned from X.g(Integer) (mismatching null constraints)\n" +
+ "----------\n" +
+ "23. ERROR in nnbd_test1\\Test.java (at line 113)\n" +
+ " public String g(Integer p) { // warning on return type and parameter expected\n" +
+ " ^^^^^^^\n" +
+ "Illegal redefinition of parameter p, inherited method from X does not constrain this parameter\n" +
+ "----------\n" +
+ "24. ERROR in nnbd_test1\\Test.java (at line 123)\n" +
+ " public String i(Integer p) { // warning on parameter expected\n" +
+ " ^^^^^^^\n" +
+ "Illegal redefinition of parameter p, inherited method from X does not constrain this parameter\n" +
"----------\n"
);
}
@@ -10064,7 +10064,7 @@ public void testBug530970_on_field_bin() {
"public @interface Nullable {\n" +
"}\n" +
"",
- },
+ },
customOptions,
""
);
@@ -10098,7 +10098,7 @@ public void testBug530970_on_field_bin() {
" abstract String i(@NonNullByDefault({}) Integer p);\n" +
"}\n" +
"",
- },
+ },
customOptions,
""
);
@@ -10236,128 +10236,128 @@ public void testBug530970_on_field_bin() {
" }\n" +
"}\n" +
"",
- },
+ },
customOptions,
- "----------\n" +
- "1. WARNING in nnbd_test1\\Test.java (at line 32)\n" +
- " public String f(Integer p) { // warning on parameter expected\n" +
- " ^^^^^^^\n" +
- "Missing non-null annotation: inherited method from X specifies this parameter as @NonNull\n" +
- "----------\n" +
- "2. ERROR in nnbd_test1\\Test.java (at line 33)\n" +
- " this.a = null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "3. ERROR in nnbd_test1\\Test.java (at line 35)\n" +
- " return null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "4. ERROR in nnbd_test1\\Test.java (at line 40)\n" +
- " return null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "5. WARNING in nnbd_test1\\Test.java (at line 44)\n" +
- " public String h(Integer p) { // warning on parameter type expected\n" +
- " ^^^^^^^\n" +
- "Missing non-null annotation: inherited method from X specifies this parameter as @NonNull\n" +
- "----------\n" +
- "6. ERROR in nnbd_test1\\Test.java (at line 45)\n" +
- " return null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "7. ERROR in nnbd_test1\\Test.java (at line 50)\n" +
- " return null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "8. ERROR in nnbd_test1\\Test.java (at line 56)\n" +
- " public String f(Integer p) { // warning on return type expected\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull String\' returned from X.f(Integer) (mismatching null constraints)\n" +
- "----------\n" +
- "9. ERROR in nnbd_test1\\Test.java (at line 57)\n" +
- " this.a = null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "10. ERROR in nnbd_test1\\Test.java (at line 63)\n" +
- " public String g(Integer p) { // warning on return type and parameter expected\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull String\' returned from X.g(Integer) (mismatching null constraints)\n" +
- "----------\n" +
- "11. ERROR in nnbd_test1\\Test.java (at line 63)\n" +
- " public String g(Integer p) { // warning on return type and parameter expected\n" +
- " ^^^^^^^\n" +
- "Illegal redefinition of parameter p, inherited method from X does not constrain this parameter\n" +
- "----------\n" +
- "12. ERROR in nnbd_test1\\Test.java (at line 73)\n" +
- " public String i(Integer p) { // warning on parameter expected\n" +
- " ^^^^^^^\n" +
- "Illegal redefinition of parameter p, inherited method from X does not constrain this parameter\n" +
- "----------\n" +
- "13. WARNING in nnbd_test1\\Test.java (at line 82)\n" +
- " public String f(Integer p) { // warning on parameter expected\n" +
- " ^^^^^^^\n" +
- "Missing non-null annotation: inherited method from X specifies this parameter as @NonNull\n" +
- "----------\n" +
- "14. ERROR in nnbd_test1\\Test.java (at line 83)\n" +
- " this.a = null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "15. ERROR in nnbd_test1\\Test.java (at line 85)\n" +
- " return null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "16. ERROR in nnbd_test1\\Test.java (at line 90)\n" +
- " return null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "17. WARNING in nnbd_test1\\Test.java (at line 94)\n" +
- " public String h(Integer p) { // warning on parameter type expected\n" +
- " ^^^^^^^\n" +
- "Missing non-null annotation: inherited method from X specifies this parameter as @NonNull\n" +
- "----------\n" +
- "18. ERROR in nnbd_test1\\Test.java (at line 95)\n" +
- " return null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "19. ERROR in nnbd_test1\\Test.java (at line 100)\n" +
- " return null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "20. ERROR in nnbd_test1\\Test.java (at line 106)\n" +
- " public String f(Integer p) { // warning on return type expected\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull String\' returned from X.f(Integer) (mismatching null constraints)\n" +
- "----------\n" +
- "21. ERROR in nnbd_test1\\Test.java (at line 107)\n" +
- " this.a = null; // warning expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "22. ERROR in nnbd_test1\\Test.java (at line 113)\n" +
- " public String g(Integer p) { // warning on return type and parameter expected\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull String\' returned from X.g(Integer) (mismatching null constraints)\n" +
- "----------\n" +
- "23. ERROR in nnbd_test1\\Test.java (at line 113)\n" +
- " public String g(Integer p) { // warning on return type and parameter expected\n" +
- " ^^^^^^^\n" +
- "Illegal redefinition of parameter p, inherited method from X does not constrain this parameter\n" +
- "----------\n" +
- "24. ERROR in nnbd_test1\\Test.java (at line 123)\n" +
- " public String i(Integer p) { // warning on parameter expected\n" +
- " ^^^^^^^\n" +
- "Illegal redefinition of parameter p, inherited method from X does not constrain this parameter\n" +
+ "----------\n" +
+ "1. WARNING in nnbd_test1\\Test.java (at line 32)\n" +
+ " public String f(Integer p) { // warning on parameter expected\n" +
+ " ^^^^^^^\n" +
+ "Missing non-null annotation: inherited method from X specifies this parameter as @NonNull\n" +
+ "----------\n" +
+ "2. ERROR in nnbd_test1\\Test.java (at line 33)\n" +
+ " this.a = null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "3. ERROR in nnbd_test1\\Test.java (at line 35)\n" +
+ " return null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "4. ERROR in nnbd_test1\\Test.java (at line 40)\n" +
+ " return null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "5. WARNING in nnbd_test1\\Test.java (at line 44)\n" +
+ " public String h(Integer p) { // warning on parameter type expected\n" +
+ " ^^^^^^^\n" +
+ "Missing non-null annotation: inherited method from X specifies this parameter as @NonNull\n" +
+ "----------\n" +
+ "6. ERROR in nnbd_test1\\Test.java (at line 45)\n" +
+ " return null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "7. ERROR in nnbd_test1\\Test.java (at line 50)\n" +
+ " return null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "8. ERROR in nnbd_test1\\Test.java (at line 56)\n" +
+ " public String f(Integer p) { // warning on return type expected\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull String\' returned from X.f(Integer) (mismatching null constraints)\n" +
+ "----------\n" +
+ "9. ERROR in nnbd_test1\\Test.java (at line 57)\n" +
+ " this.a = null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "10. ERROR in nnbd_test1\\Test.java (at line 63)\n" +
+ " public String g(Integer p) { // warning on return type and parameter expected\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull String\' returned from X.g(Integer) (mismatching null constraints)\n" +
+ "----------\n" +
+ "11. ERROR in nnbd_test1\\Test.java (at line 63)\n" +
+ " public String g(Integer p) { // warning on return type and parameter expected\n" +
+ " ^^^^^^^\n" +
+ "Illegal redefinition of parameter p, inherited method from X does not constrain this parameter\n" +
+ "----------\n" +
+ "12. ERROR in nnbd_test1\\Test.java (at line 73)\n" +
+ " public String i(Integer p) { // warning on parameter expected\n" +
+ " ^^^^^^^\n" +
+ "Illegal redefinition of parameter p, inherited method from X does not constrain this parameter\n" +
+ "----------\n" +
+ "13. WARNING in nnbd_test1\\Test.java (at line 82)\n" +
+ " public String f(Integer p) { // warning on parameter expected\n" +
+ " ^^^^^^^\n" +
+ "Missing non-null annotation: inherited method from X specifies this parameter as @NonNull\n" +
+ "----------\n" +
+ "14. ERROR in nnbd_test1\\Test.java (at line 83)\n" +
+ " this.a = null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "15. ERROR in nnbd_test1\\Test.java (at line 85)\n" +
+ " return null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "16. ERROR in nnbd_test1\\Test.java (at line 90)\n" +
+ " return null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "17. WARNING in nnbd_test1\\Test.java (at line 94)\n" +
+ " public String h(Integer p) { // warning on parameter type expected\n" +
+ " ^^^^^^^\n" +
+ "Missing non-null annotation: inherited method from X specifies this parameter as @NonNull\n" +
+ "----------\n" +
+ "18. ERROR in nnbd_test1\\Test.java (at line 95)\n" +
+ " return null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "19. ERROR in nnbd_test1\\Test.java (at line 100)\n" +
+ " return null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "20. ERROR in nnbd_test1\\Test.java (at line 106)\n" +
+ " public String f(Integer p) { // warning on return type expected\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull String\' returned from X.f(Integer) (mismatching null constraints)\n" +
+ "----------\n" +
+ "21. ERROR in nnbd_test1\\Test.java (at line 107)\n" +
+ " this.a = null; // warning expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "22. ERROR in nnbd_test1\\Test.java (at line 113)\n" +
+ " public String g(Integer p) { // warning on return type and parameter expected\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull String\' returned from X.g(Integer) (mismatching null constraints)\n" +
+ "----------\n" +
+ "23. ERROR in nnbd_test1\\Test.java (at line 113)\n" +
+ " public String g(Integer p) { // warning on return type and parameter expected\n" +
+ " ^^^^^^^\n" +
+ "Illegal redefinition of parameter p, inherited method from X does not constrain this parameter\n" +
+ "----------\n" +
+ "24. ERROR in nnbd_test1\\Test.java (at line 123)\n" +
+ " public String i(Integer p) { // warning on parameter expected\n" +
+ " ^^^^^^^\n" +
+ "Illegal redefinition of parameter p, inherited method from X does not constrain this parameter\n" +
"----------\n"
);
}
@@ -10366,7 +10366,7 @@ public void testBug542707_001() {
return;
Map options = getCompilerOptions();
options.put(JavaCore.COMPILER_PB_POTENTIAL_NULL_REFERENCE, JavaCore.ERROR);
- options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+ options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
@@ -10404,11 +10404,11 @@ public void testBug542707_001() {
"}\n"
},
options,
- "----------\n" +
- "1. ERROR in X.java (at line 0)\n" +
- " import java.io.IOException;\n" +
- " ^\n" +
- "Preview features enabled at an invalid source release level 12, preview can be enabled only at source level "+AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL+"\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 0)\n" +
+ " import java.io.IOException;\n" +
+ " ^\n" +
+ "Preview features enabled at an invalid source release level 12, preview can be enabled only at source level "+AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL+"\n" +
"----------\n"
);
}
@@ -10420,7 +10420,7 @@ public void testBug542707_002() {
return;
Map options = getCompilerOptions();
options.put(JavaCore.COMPILER_PB_POTENTIAL_NULL_REFERENCE, JavaCore.ERROR);
- options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+ options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
@@ -10445,11 +10445,11 @@ public void testBug542707_002() {
"}\n"
},
options,
- "----------\n" +
- "1. ERROR in X.java (at line 0)\n" +
- " import org.eclipse.jdt.annotation.*;\n" +
- " ^\n" +
- "Preview features enabled at an invalid source release level 12, preview can be enabled only at source level "+AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL+"\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 0)\n" +
+ " import org.eclipse.jdt.annotation.*;\n" +
+ " ^\n" +
+ "Preview features enabled at an invalid source release level 12, preview can be enabled only at source level "+AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL+"\n" +
"----------\n"
);
}
@@ -10465,28 +10465,28 @@ public void testBug542707_003() {
"X.java",
"import org.eclipse.jdt.annotation.*;\n" +
"public class X {\n" +
- " @Nullable String maybe() { return null; }\n" +
+ " @Nullable String maybe() { return null; }\n" +
" void test(int i) {\n" +
- " @NonNull String s = switch (i) {\n" +
- " case 1 -> \"\";\n" +
- " default -> i == 3 ? maybe() : \"\";\n" +
- " };\n" +
+ " @NonNull String s = switch (i) {\n" +
+ " case 1 -> \"\";\n" +
+ " default -> i == 3 ? maybe() : \"\";\n" +
+ " };\n" +
" System.out.println(s.toLowerCase());\n" +
" }\n" +
"}\n"
};
runner.expectedCompilerLog = checkPreviewAllowed() ?
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " default -> i == 3 ? maybe() : \"\";\n" +
- " ^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " default -> i == 3 ? maybe() : \"\";\n" +
+ " ^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 0)\n" +
- " import org.eclipse.jdt.annotation.*;\n" +
- " ^\n" +
- "Preview features enabled at an invalid source release level "+CompilerOptions.versionFromJdkLevel(this.complianceLevel)+", preview can be enabled only at source level "+AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL+"\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 0)\n" +
+ " import org.eclipse.jdt.annotation.*;\n" +
+ " ^\n" +
+ "Preview features enabled at an invalid source release level "+CompilerOptions.versionFromJdkLevel(this.complianceLevel)+", preview can be enabled only at source level "+AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL+"\n" +
"----------\n";
runner.runNegativeTest();
}
@@ -10503,24 +10503,24 @@ public void _testBug542707_004() {
"X.java",
"import org.eclipse.jdt.annotation.*;\n" +
"public class X {\n" +
- " @Nullable String maybe() { return null; }\n" +
- " void need(@NonNull String s) {\n" +
- " System.out.println(s.toLowerCase());\n" +
+ " @Nullable String maybe() { return null; }\n" +
+ " void need(@NonNull String s) {\n" +
+ " System.out.println(s.toLowerCase());\n" +
" }\n" +
" void test(int i) {\n" +
- " need(switch (i) {\n" +
- " case 1 -> \"\";\n" +
- " default -> i == 3 ? maybe() : \"\";\n" +
- " });\n" +
+ " need(switch (i) {\n" +
+ " case 1 -> \"\";\n" +
+ " default -> i == 3 ? maybe() : \"\";\n" +
+ " });\n" +
" }\n" +
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " default -> i == 3 ? maybe() : \"\";\n" +
- " ^^^^^^^\n" +
- "Null type mismatch (type annotations): required '@NonNull String' but this expression has type '@Nullable String'\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " default -> i == 3 ? maybe() : \"\";\n" +
+ " ^^^^^^^\n" +
+ "Null type mismatch (type annotations): required '@NonNull String' but this expression has type '@Nullable String'\n" +
"----------\n";
runner.runNegativeTest();
}
@@ -10537,27 +10537,27 @@ public void testBug542707_005() {
"import org.eclipse.jdt.annotation.*;\n" +
"enum SomeDays { Mon, Wed, Fri }\n" +
"public class X {\n" +
- " int testEnum(@Nullable SomeDays day) {\n" +
- " return switch(day) {\n" +
- " case Mon -> 1;\n" +
- " case Wed -> 2;\n" +
- " case Fri -> 3;\n" +
- " };\n" +
+ " int testEnum(@Nullable SomeDays day) {\n" +
+ " return switch(day) {\n" +
+ " case Mon -> 1;\n" +
+ " case Wed -> 2;\n" +
+ " case Fri -> 3;\n" +
+ " };\n" +
" }\n" +
"}\n"
};
runner.expectedCompilerLog = checkPreviewAllowed() ?
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " return switch(day) {\n" +
- " ^^^\n" +
- "Potential null pointer access: this expression has a \'@Nullable\' type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " return switch(day) {\n" +
+ " ^^^\n" +
+ "Potential null pointer access: this expression has a \'@Nullable\' type\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 0)\n" +
- " import org.eclipse.jdt.annotation.*;\n" +
- " ^\n" +
- "Preview features enabled at an invalid source release level "+CompilerOptions.versionFromJdkLevel(this.complianceLevel)+", preview can be enabled only at source level "+AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL+"\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 0)\n" +
+ " import org.eclipse.jdt.annotation.*;\n" +
+ " ^\n" +
+ "Preview features enabled at an invalid source release level "+CompilerOptions.versionFromJdkLevel(this.complianceLevel)+", preview can be enabled only at source level "+AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL+"\n" +
"----------\n";
runner.runNegativeTest();
}
@@ -10574,27 +10574,27 @@ public void testBug542707_006() {
"enum SomeDays { Mon, Wed, Fri }\n" +
"public class X {\n" +
" int testEnum(boolean b) {\n" +
- " SomeDays day = b ? SomeDays.Mon : null;\n" +
- " return switch(day) {\n" +
- " case Mon -> 1;\n" +
- " case Wed -> 2;\n" +
- " case Fri -> 3;\n" +
- " };\n" +
+ " SomeDays day = b ? SomeDays.Mon : null;\n" +
+ " return switch(day) {\n" +
+ " case Mon -> 1;\n" +
+ " case Wed -> 2;\n" +
+ " case Fri -> 3;\n" +
+ " };\n" +
" }\n" +
"}\n"
};
runner.expectedCompilerLog = checkPreviewAllowed() ?
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " return switch(day) {\n" +
- " ^^^\n" +
- "Potential null pointer access: The variable day may be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " return switch(day) {\n" +
+ " ^^^\n" +
+ "Potential null pointer access: The variable day may be null at this location\n" +
"----------\n" :
"----------\n" +
- "1. ERROR in X.java (at line 0)\n" +
- " enum SomeDays { Mon, Wed, Fri }\n" +
- " ^\n" +
- "Preview features enabled at an invalid source release level "+CompilerOptions.versionFromJdkLevel(this.complianceLevel)+", preview can be enabled only at source level "+AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL+"\n" +
+ "1. ERROR in X.java (at line 0)\n" +
+ " enum SomeDays { Mon, Wed, Fri }\n" +
+ " ^\n" +
+ "Preview features enabled at an invalid source release level "+CompilerOptions.versionFromJdkLevel(this.complianceLevel)+", preview can be enabled only at source level "+AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL+"\n" +
"----------\n";
runner.runNegativeTest();
}
@@ -10655,11 +10655,11 @@ public void testBug548418_001a() {
" }\n"+
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " break x;\n" +
- " ^^^^^^^^\n" +
- "Breaking out of switch expressions not permitted\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " break x;\n" +
+ " ^^^^^^^^\n" +
+ "Breaking out of switch expressions not permitted\n" +
"----------\n"
);
}
@@ -10697,16 +10697,16 @@ public void testBug548418_001b() {
" }\n"+
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " x = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull X\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 15)\n" +
- " default -> null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull X\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " x = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull X\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 15)\n" +
+ " default -> null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull X\' but the provided value is null\n" +
"----------\n"
);
}
@@ -10731,21 +10731,21 @@ public void testBug548418_002a() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " break \"hello\";\n" +
- " ^^^^^^^\n" +
- "Syntax error on token \"\"hello\"\", delete this token\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " default : break \"world\";\n" +
- " ^^^^^^^\n" +
- "Syntax error on token \"\"world\"\", delete this token\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 13)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " break \"hello\";\n" +
+ " ^^^^^^^\n" +
+ "Syntax error on token \"\"hello\"\", delete this token\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " default : break \"world\";\n" +
+ " ^^^^^^^\n" +
+ "Syntax error on token \"\"world\"\", delete this token\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 13)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n"
);
}
@@ -10770,11 +10770,11 @@ public void testBug548418_002b() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n"
);
}
@@ -10782,33 +10782,33 @@ public void testBug499714() {
runConformTestWithLibs(
new String[] {
"test/X.java",
- "package test;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "@NonNullByDefault\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Object o = null;\n" +
- " for (final String s : args) {\n" +
- " if (s.equals(\"-x\")) {\n" +
- " if (o != null) { // bogus warning here\n" +
- " //\n" +
- " }\n" +
- " continue;\n" +
- " }\n" +
- " o = read();\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " @Nullable\n" +
- " public static Object read() {\n" +
- " return \"\";\n" +
- " }\n" +
- "}\n" +
+ "package test;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "@NonNullByDefault\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object o = null;\n" +
+ " for (final String s : args) {\n" +
+ " if (s.equals(\"-x\")) {\n" +
+ " if (o != null) { // bogus warning here\n" +
+ " //\n" +
+ " }\n" +
+ " continue;\n" +
+ " }\n" +
+ " o = read();\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " @Nullable\n" +
+ " public static Object read() {\n" +
+ " return \"\";\n" +
+ " }\n" +
+ "}\n" +
"",
- },
+ },
getCompilerOptions(),
"");
}
@@ -10835,30 +10835,30 @@ public void testBug481931_source() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (INST_CONST == null) {\n" +
- " ^^^^^^^^^^\n" +
- "Null comparison always yields false: The field INST_CONST is a nonnull constant\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " if (INST_CONST == null) {\n" +
- " System.out.println(\"null\");\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 12)\n" +
- " if (CONST == null) {\n" +
- " ^^^^^\n" +
- "Null comparison always yields false: The field CONST is a nonnull constant\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 12)\n" +
- " if (CONST == null) {\n" +
- " System.out.println(\"null\");\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " if (INST_CONST == null) {\n" +
+ " ^^^^^^^^^^\n" +
+ "Null comparison always yields false: The field INST_CONST is a nonnull constant\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " if (INST_CONST == null) {\n" +
+ " System.out.println(\"null\");\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 12)\n" +
+ " if (CONST == null) {\n" +
+ " ^^^^^\n" +
+ "Null comparison always yields false: The field CONST is a nonnull constant\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 12)\n" +
+ " if (CONST == null) {\n" +
+ " System.out.println(\"null\");\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n");
}
public void testBug481931_binary() {
@@ -10899,30 +10899,30 @@ public void testBug481931_binary() {
runner.classLibraries = this.LIBS;
runner.customOptions = getCompilerOptions();
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in Y.java (at line 5)\n" +
- " if (x.INST_CONST == null) {\n" +
- " ^^^^^^^^^^\n" +
- "Null comparison always yields false: The field INST_CONST is a nonnull constant\n" +
- "----------\n" +
- "2. WARNING in Y.java (at line 5)\n" +
- " if (x.INST_CONST == null) {\n" +
- " System.out.println(\"null\");\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. ERROR in Y.java (at line 11)\n" +
- " if (X.CONST == null) {\n" +
- " ^^^^^\n" +
- "Null comparison always yields false: The field CONST is a nonnull constant\n" +
- "----------\n" +
- "4. WARNING in Y.java (at line 11)\n" +
- " if (X.CONST == null) {\n" +
- " System.out.println(\"null\");\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in Y.java (at line 5)\n" +
+ " if (x.INST_CONST == null) {\n" +
+ " ^^^^^^^^^^\n" +
+ "Null comparison always yields false: The field INST_CONST is a nonnull constant\n" +
+ "----------\n" +
+ "2. WARNING in Y.java (at line 5)\n" +
+ " if (x.INST_CONST == null) {\n" +
+ " System.out.println(\"null\");\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in Y.java (at line 11)\n" +
+ " if (X.CONST == null) {\n" +
+ " ^^^^^\n" +
+ "Null comparison always yields false: The field CONST is a nonnull constant\n" +
+ "----------\n" +
+ "4. WARNING in Y.java (at line 11)\n" +
+ " if (X.CONST == null) {\n" +
+ " System.out.println(\"null\");\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n";
runner.javacTestOptions = Excuse.EclipseWarningConfiguredAsError;
runner.runNegativeTest();
@@ -10931,135 +10931,135 @@ public void testBug459397() {
runNegativeTestWithLibs(
new String[] {
"NonNullBug.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "public class NonNullBug {\n" +
- " public static final String PACKid_$metamodel$ = null;\n" +
- " public static final String PACKid_http_c_s_s_www_eclipse_org_s_qvt_s_examples_s_0_1_s_SimpleRDBMS = null;\n" +
- " public static final String PACKid_http_c_s_s_www_eclipse_org_s_qvt_s_examples_s_0_1_s_UMLtoRDBMS = null;\n" +
- " public static final String PACKid_http_c_s_s_www_eclipse_org_s_qvt_s_examples_s_0_1_s_simpleUML = null;\n" +
- " public static final String CLSSid_Association = null;\n" +
- " public static final String CLSSid_AssociationToForeignKey = null;\n" +
- " public static final String CLSSid_Attribute = null;\n" +
- " public static final String CLSSid_AttributeToColumn = null;\n" +
- " public static final String CLSSid_Class = null;\n" +
- " public static final String CLSSid_ClassToTable = null;\n" +
- " public static final String CLSSid_Class_0 = null;\n" +
- " public static final String CLSSid_Classifier = null;\n" +
- " public static final String CLSSid_Column = null;\n" +
- " public static final String CLSSid_ForeignKey = null;\n" +
- " public static final String CLSSid_FromAttribute = null;\n" +
- " public static final String CLSSid_Key = null;\n" +
- " public static final String CLSSid_NonLeafAttribute = null;\n" +
- " public static final String CLSSid_Package = null;\n" +
- " public static final String CLSSid_PackageElement = null;\n" +
- " public static final String CLSSid_PackageToSchema = null;\n" +
- " public static final String CLSSid_PrimitiveDataType = null;\n" +
- " public static final String CLSSid_PrimitiveToName = null;\n" +
- " public static final String CLSSid_Schema = null;\n" +
- " public static final String CLSSid_Table = null;\n" +
- " public static final String STR_2 = \"2\";\n" +
- " public static final String STR_BOOLEAN = \"BOOLEAN\";\n" +
- " public static final String STR_Boolean = \"Boolean\";\n" +
- " public static final String STR_Integer = \"Integer\";\n" +
- " public static final String STR_NUMBER = \"NUMBER\";\n" +
- " public static final String STR_String = \"String\";\n" +
- " public static final String STR_VARCHAR = \"VARCHAR\";\n" +
- " public static final String STR__ = \"_\";\n" +
- " public static final String STR__pk = \"_pk\";\n" +
- " public static final String STR__tid = \"_tid\";\n" +
- " public static final String STR_base = \"base\";\n" +
- " public static final String STR_persistent = \"persistent\";\n" +
- " public static final String STR_primary = \"primary\";\n" +
- " public static final String BAG_CLSSid_AttributeToColumn = null;\n" +
- " public static final String BAG_CLSSid_FromAttribute = null;\n" +
- " public static final String ORD_CLSSid_AssociationToForeignKey = null;\n" +
- " public static final String ORD_CLSSid_Attribute = null;\n" +
- " public static final String ORD_CLSSid_Column = null;\n" +
- " public static final String ORD_CLSSid_ForeignKey = null;\n" +
- " public static final String ORD_CLSSid_Key = null;\n" +
- " public static final String ORD_CLSSid_PackageElement = null;\n" +
- " public static final String SET_CLSSid_Association = null;\n" +
- " public static final String SET_CLSSid_Attribute = null;\n" +
- " public static final String SET_CLSSid_AttributeToColumn = null;\n" +
- " public static final String SET_CLSSid_Class = null;\n" +
- " public static final String SET_CLSSid_ClassToTable = null;\n" +
- " public static final String SET_CLSSid_FromAttribute = null;\n" +
- " public static final String SET_CLSSid_NonLeafAttribute = null;\n" +
- " public static final String SET_CLSSid_Package = null;\n" +
- " public static final String SET_CLSSid_PrimitiveToName = null;\n" +
- "\n" +
- " protected final String OPPOSITE_OF_ClassToTable_table = null;\n" +
- " protected final String OPPOSITE_OF_ClassToTable_umlClass = null;\n" +
- " protected final String OPPOSITE_OF_FromAttribute_attribute = null;\n" +
- " protected final String OPPOSITE_OF_PrimitiveToName_primitive = null;\n" +
- "\n" +
- " @SuppressWarnings(\"unused\")\n" +
- " private static final String[] classIndex2classId = new String[] {};\n" +
- " @SuppressWarnings(\"unused\")\n" +
- " private final static int[][] classIndex2allClassIndexes = new int[][] {};\n" +
- "\n" +
- " protected String x(final @NonNull Exception a, final @NonNull String p_4, final @Nullable String p2s_9) throws Exception {\n" +
- " final @Nullable Throwable destination = a.getCause();\n" +
- " final @Nullable Throwable dc = a.getCause();\n" +
- " if (dc == null) {\n" +
- " throw new Exception();\n" +
- " }\n" +
- " try {\n" +
- " if (dc instanceof Exception) {\n" +
- " throw (Exception) dc;\n" +
- " }\n" +
- " boolean eq_2 = (destination != null) ? destination.equals(dc) : (dc == null);\n" +
- " } catch (Exception e) {\n" +
- " }\n" +
- " boolean ne = (destination != null) ? !destination.equals(dc) : (dc != null);\n" +
- " return dc.toString();\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "public class NonNullBug {\n" +
+ " public static final String PACKid_$metamodel$ = null;\n" +
+ " public static final String PACKid_http_c_s_s_www_eclipse_org_s_qvt_s_examples_s_0_1_s_SimpleRDBMS = null;\n" +
+ " public static final String PACKid_http_c_s_s_www_eclipse_org_s_qvt_s_examples_s_0_1_s_UMLtoRDBMS = null;\n" +
+ " public static final String PACKid_http_c_s_s_www_eclipse_org_s_qvt_s_examples_s_0_1_s_simpleUML = null;\n" +
+ " public static final String CLSSid_Association = null;\n" +
+ " public static final String CLSSid_AssociationToForeignKey = null;\n" +
+ " public static final String CLSSid_Attribute = null;\n" +
+ " public static final String CLSSid_AttributeToColumn = null;\n" +
+ " public static final String CLSSid_Class = null;\n" +
+ " public static final String CLSSid_ClassToTable = null;\n" +
+ " public static final String CLSSid_Class_0 = null;\n" +
+ " public static final String CLSSid_Classifier = null;\n" +
+ " public static final String CLSSid_Column = null;\n" +
+ " public static final String CLSSid_ForeignKey = null;\n" +
+ " public static final String CLSSid_FromAttribute = null;\n" +
+ " public static final String CLSSid_Key = null;\n" +
+ " public static final String CLSSid_NonLeafAttribute = null;\n" +
+ " public static final String CLSSid_Package = null;\n" +
+ " public static final String CLSSid_PackageElement = null;\n" +
+ " public static final String CLSSid_PackageToSchema = null;\n" +
+ " public static final String CLSSid_PrimitiveDataType = null;\n" +
+ " public static final String CLSSid_PrimitiveToName = null;\n" +
+ " public static final String CLSSid_Schema = null;\n" +
+ " public static final String CLSSid_Table = null;\n" +
+ " public static final String STR_2 = \"2\";\n" +
+ " public static final String STR_BOOLEAN = \"BOOLEAN\";\n" +
+ " public static final String STR_Boolean = \"Boolean\";\n" +
+ " public static final String STR_Integer = \"Integer\";\n" +
+ " public static final String STR_NUMBER = \"NUMBER\";\n" +
+ " public static final String STR_String = \"String\";\n" +
+ " public static final String STR_VARCHAR = \"VARCHAR\";\n" +
+ " public static final String STR__ = \"_\";\n" +
+ " public static final String STR__pk = \"_pk\";\n" +
+ " public static final String STR__tid = \"_tid\";\n" +
+ " public static final String STR_base = \"base\";\n" +
+ " public static final String STR_persistent = \"persistent\";\n" +
+ " public static final String STR_primary = \"primary\";\n" +
+ " public static final String BAG_CLSSid_AttributeToColumn = null;\n" +
+ " public static final String BAG_CLSSid_FromAttribute = null;\n" +
+ " public static final String ORD_CLSSid_AssociationToForeignKey = null;\n" +
+ " public static final String ORD_CLSSid_Attribute = null;\n" +
+ " public static final String ORD_CLSSid_Column = null;\n" +
+ " public static final String ORD_CLSSid_ForeignKey = null;\n" +
+ " public static final String ORD_CLSSid_Key = null;\n" +
+ " public static final String ORD_CLSSid_PackageElement = null;\n" +
+ " public static final String SET_CLSSid_Association = null;\n" +
+ " public static final String SET_CLSSid_Attribute = null;\n" +
+ " public static final String SET_CLSSid_AttributeToColumn = null;\n" +
+ " public static final String SET_CLSSid_Class = null;\n" +
+ " public static final String SET_CLSSid_ClassToTable = null;\n" +
+ " public static final String SET_CLSSid_FromAttribute = null;\n" +
+ " public static final String SET_CLSSid_NonLeafAttribute = null;\n" +
+ " public static final String SET_CLSSid_Package = null;\n" +
+ " public static final String SET_CLSSid_PrimitiveToName = null;\n" +
+ "\n" +
+ " protected final String OPPOSITE_OF_ClassToTable_table = null;\n" +
+ " protected final String OPPOSITE_OF_ClassToTable_umlClass = null;\n" +
+ " protected final String OPPOSITE_OF_FromAttribute_attribute = null;\n" +
+ " protected final String OPPOSITE_OF_PrimitiveToName_primitive = null;\n" +
+ "\n" +
+ " @SuppressWarnings(\"unused\")\n" +
+ " private static final String[] classIndex2classId = new String[] {};\n" +
+ " @SuppressWarnings(\"unused\")\n" +
+ " private final static int[][] classIndex2allClassIndexes = new int[][] {};\n" +
+ "\n" +
+ " protected String x(final @NonNull Exception a, final @NonNull String p_4, final @Nullable String p2s_9) throws Exception {\n" +
+ " final @Nullable Throwable destination = a.getCause();\n" +
+ " final @Nullable Throwable dc = a.getCause();\n" +
+ " if (dc == null) {\n" +
+ " throw new Exception();\n" +
+ " }\n" +
+ " try {\n" +
+ " if (dc instanceof Exception) {\n" +
+ " throw (Exception) dc;\n" +
+ " }\n" +
+ " boolean eq_2 = (destination != null) ? destination.equals(dc) : (dc == null);\n" +
+ " } catch (Exception e) {\n" +
+ " }\n" +
+ " boolean ne = (destination != null) ? !destination.equals(dc) : (dc != null);\n" +
+ " return dc.toString();\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in NonNullBug.java (at line 80)\n" +
- " boolean eq_2 = (destination != null) ? destination.equals(dc) : (dc == null);\n" +
- " ^^\n" +
- "Null comparison always yields false: The variable dc cannot be null at this location\n" +
- "----------\n" +
- "2. ERROR in NonNullBug.java (at line 83)\n" +
- " boolean ne = (destination != null) ? !destination.equals(dc) : (dc != null);\n" +
- " ^^\n" +
- "Redundant null check: The variable dc cannot be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in NonNullBug.java (at line 80)\n" +
+ " boolean eq_2 = (destination != null) ? destination.equals(dc) : (dc == null);\n" +
+ " ^^\n" +
+ "Null comparison always yields false: The variable dc cannot be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in NonNullBug.java (at line 83)\n" +
+ " boolean ne = (destination != null) ? !destination.equals(dc) : (dc != null);\n" +
+ " ^^\n" +
+ "Redundant null check: The variable dc cannot be null at this location\n" +
"----------\n");
}
public void testBug466477() {
runNegativeTestWithLibs(
new String[] {
"SuperI.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public interface SuperI {\n" +
- " void testNN(@NonNull String s);\n" +
- " void testNu(@Nullable String s);\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "public interface SuperI {\n" +
+ " void testNN(@NonNull String s);\n" +
+ " void testNu(@Nullable String s);\n" +
"}\n",
"Base.java",
- "public class Base {\n" +
- " public void testNN(String s) { }\n" +
- " public void testNu(String s) { }\n" +
+ "public class Base {\n" +
+ " public void testNN(String s) { }\n" +
+ " public void testNu(String s) { }\n" +
"}\n",
"Custom.java",
- "public class Custom extends Base implements SuperI {\n" +
+ "public class Custom extends Base implements SuperI {\n" +
"}"
},
- "----------\n" +
- "1. ERROR in Custom.java (at line 1)\n" +
- " public class Custom extends Base implements SuperI {\n" +
- " ^^^^\n" +
- "The method testNu(String) from Base cannot implement the corresponding method from SuperI due to incompatible nullness constraints\n" +
- "----------\n" +
- "2. WARNING in Custom.java (at line 1)\n" +
- " public class Custom extends Base implements SuperI {\n" +
- " ^^^^\n" +
- "Parameter 1 of method testNN(String) lacks a @NonNull annotation as specified in type SuperI\n" +
+ "----------\n" +
+ "1. ERROR in Custom.java (at line 1)\n" +
+ " public class Custom extends Base implements SuperI {\n" +
+ " ^^^^\n" +
+ "The method testNu(String) from Base cannot implement the corresponding method from SuperI due to incompatible nullness constraints\n" +
+ "----------\n" +
+ "2. WARNING in Custom.java (at line 1)\n" +
+ " public class Custom extends Base implements SuperI {\n" +
+ " ^^^^\n" +
+ "Parameter 1 of method testNN(String) lacks a @NonNull annotation as specified in type SuperI\n" +
"----------\n");
}
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTests9.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTests9.java
index deabd1537..8b717f92a 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTests9.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTests9.java
@@ -45,7 +45,7 @@ public class NullAnnotationTests9 extends AbstractNullAnnotationTest {
public NullAnnotationTests9(String name) {
super(name);
}
-
+
static {
// TESTS_NAMES = new String[] { "testBug456497" };
// TESTS_NUMBERS = new int[] { 001 };
@@ -81,53 +81,53 @@ public class NullAnnotationTests9 extends AbstractNullAnnotationTest {
"}\n",
"org/eclipse/jdt/annotation/DefaultLocation.java",
- "package org.eclipse.jdt.annotation;\n" +
- "\n" +
- "public enum DefaultLocation {\n" +
- " \n" +
- " PARAMETER, RETURN_TYPE, FIELD, TYPE_PARAMETER, TYPE_BOUND, TYPE_ARGUMENT, ARRAY_CONTENTS\n" +
+ "package org.eclipse.jdt.annotation;\n" +
+ "\n" +
+ "public enum DefaultLocation {\n" +
+ " \n" +
+ " PARAMETER, RETURN_TYPE, FIELD, TYPE_PARAMETER, TYPE_BOUND, TYPE_ARGUMENT, ARRAY_CONTENTS\n" +
"}\n",
-
+
"org/eclipse/jdt/annotation/NonNullByDefault.java",
- "package org.eclipse.jdt.annotation;\n" +
- "\n" +
- "import java.lang.annotation.ElementType;\n" +
- "import static org.eclipse.jdt.annotation.DefaultLocation.*;\n" +
- "\n" +
- "import java.lang.annotation.*;\n" +
- " \n" +
- "@Documented\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@Target({ ElementType.MODULE, ElementType.PACKAGE, ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.LOCAL_VARIABLE })\n" +
- "public @interface NonNullByDefault {\n" +
- " DefaultLocation[] value() default { PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT };\n" +
+ "package org.eclipse.jdt.annotation;\n" +
+ "\n" +
+ "import java.lang.annotation.ElementType;\n" +
+ "import static org.eclipse.jdt.annotation.DefaultLocation.*;\n" +
+ "\n" +
+ "import java.lang.annotation.*;\n" +
+ " \n" +
+ "@Documented\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ ElementType.MODULE, ElementType.PACKAGE, ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.LOCAL_VARIABLE })\n" +
+ "public @interface NonNullByDefault {\n" +
+ " DefaultLocation[] value() default { PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT };\n" +
"}",
-
+
"org/eclipse/jdt/annotation/NonNull.java",
"package org.eclipse.jdt.annotation;\n" +
- "import static java.lang.annotation.ElementType.TYPE_USE;\n" +
- "\n" +
- "import java.lang.annotation.*;\n" +
- " \n" +
- "@Documented\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@Target({ TYPE_USE })\n" +
- "public @interface NonNull {\n" +
- " // marker annotation with no members\n" +
+ "import static java.lang.annotation.ElementType.TYPE_USE;\n" +
+ "\n" +
+ "import java.lang.annotation.*;\n" +
+ " \n" +
+ "@Documented\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ TYPE_USE })\n" +
+ "public @interface NonNull {\n" +
+ " // marker annotation with no members\n" +
"}\n",
-
+
"org/eclipse/jdt/annotation/Nullable.java",
- "package org.eclipse.jdt.annotation;\n" +
- "\n" +
- "import static java.lang.annotation.ElementType.TYPE_USE;\n" +
- "\n" +
- "import java.lang.annotation.*;\n" +
- " \n" +
- "@Documented\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@Target({ TYPE_USE })\n" +
- "public @interface Nullable {\n" +
- " // marker annotation with no members\n" +
+ "package org.eclipse.jdt.annotation;\n" +
+ "\n" +
+ "import static java.lang.annotation.ElementType.TYPE_USE;\n" +
+ "\n" +
+ "import java.lang.annotation.*;\n" +
+ " \n" +
+ "@Documented\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ TYPE_USE })\n" +
+ "public @interface Nullable {\n" +
+ " // marker annotation with no members\n" +
"}\n"
},
null,
@@ -185,7 +185,7 @@ public class NullAnnotationTests9 extends AbstractNullAnnotationTest {
IModule extractModuleDesc(String fileName, String fileContent) {
if (fileName.toLowerCase().endsWith(IModule.MODULE_INFO_JAVA)) {
Parser parser = createParser();
-
+
ICompilationUnit cu = new CompilationUnit(fileContent.toCharArray(), fileName, null);
CompilationResult compilationResult = new CompilationResult(cu, 0, 1, 10);
CompilationUnitDeclaration unit = parser.parse(cu, compilationResult);
@@ -211,7 +211,7 @@ public class NullAnnotationTests9 extends AbstractNullAnnotationTest {
for (String fileName : fileNames)
this.file2module.put(fileName, moduleName);
}
-
+
private Runner getDefaultRunner() {
Runner runner = new Runner();
runner.classLibraries = this.LIBS;
@@ -241,17 +241,17 @@ public class NullAnnotationTests9 extends AbstractNullAnnotationTest {
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in my.mod\\p\\X.java (at line 3)\n" +
- " String f; // missing nn init\n" +
- " ^\n" +
- "The @NonNull field f may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in my.mod\\p\\X.java (at line 3)\n" +
+ " String f; // missing nn init\n" +
+ " ^\n" +
+ "The @NonNull field f may not have been initialized\n" +
"----------\n";
runner.runNegativeTest();
}
public void test_nnbd_in_module_02() throws IOException {
-
+
String jarPath = OUTPUT_DIR+"/mod.one.jar";
createJar(
new String[] {
@@ -271,7 +271,7 @@ public class NullAnnotationTests9 extends AbstractNullAnnotationTest {
jarPath,
this.LIBS,
"9");
-
+
associateToModule("my.mod", "my.mod/p/X.java");
Runner runner = new Runner();
runner.shouldFlushOutputDirectory = false;
@@ -297,11 +297,11 @@ public class NullAnnotationTests9 extends AbstractNullAnnotationTest {
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in my.mod\\p\\X.java (at line 6)\n" +
- " api.id(null); // NOK\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in my.mod\\p\\X.java (at line 6)\n" +
+ " api.id(null); // NOK\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -342,22 +342,22 @@ public class NullAnnotationTests9 extends AbstractNullAnnotationTest {
"package p2;\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in my.mod\\p\\X.java (at line 2)\n" +
- " @org.eclipse.jdt.annotation.NonNullByDefault\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing module my.mod\n" +
- "----------\n" +
- "2. ERROR in my.mod\\p\\X.java (at line 4)\n" +
- " String f; // missing nn init\n" +
- " ^\n" +
- "The @NonNull field f may not have been initialized\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in my.mod\\p2\\package-info.java (at line 1)\n" +
- " @org.eclipse.jdt.annotation.NonNullByDefault\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing module my.mod\n" +
+ "----------\n" +
+ "1. WARNING in my.mod\\p\\X.java (at line 2)\n" +
+ " @org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing module my.mod\n" +
+ "----------\n" +
+ "2. ERROR in my.mod\\p\\X.java (at line 4)\n" +
+ " String f; // missing nn init\n" +
+ " ^\n" +
+ "The @NonNull field f may not have been initialized\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in my.mod\\p2\\package-info.java (at line 1)\n" +
+ " @org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing module my.mod\n" +
"----------\n";
runner.runNegativeTest();
}
@@ -366,11 +366,11 @@ public class NullAnnotationTests9 extends AbstractNullAnnotationTest {
runConformTestWithLibs(
new String[] {
"Bar.java",
- "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
- "public class Bar {\n" +
- " static void bar(Iterable<String> list) {\n" +
- " for(var s : list);\n" +
- " }\n" +
+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ "public class Bar {\n" +
+ " static void bar(Iterable<String> list) {\n" +
+ " for(var s : list);\n" +
+ " }\n" +
"}\n"
},
null,
@@ -394,38 +394,38 @@ public class NullAnnotationTests9 extends AbstractNullAnnotationTest {
"@Target({ElementType.LOCAL_VARIABLE,ElementType.PARAMETER}) public @interface Nullable {}\n",
"Bar.java",
"import test.*;\n" +
- "public class Bar {\n" +
- " static void bar1(@Nullable String s1, Iterable<String> list) {\n" +
+ "public class Bar {\n" +
+ " static void bar1(@Nullable String s1, Iterable<String> list) {\n" +
" @NonNull var s2 = s1;\n" +
" for (@NonNull var s : list);\n" +
- " }\n" +
- " static void bar2(int[] array) {\n" +
+ " }\n" +
+ " static void bar2(int[] array) {\n" +
" @NonNull var i1 = 3;\n" +
" for (@NonNull var s : array);\n" +
- " }\n" +
+ " }\n" +
"}\n"
},
options,
- "----------\n" +
- "1. ERROR in Bar.java (at line 4)\n" +
- " @NonNull var s2 = s1;\n" +
- " ^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is specified as @Nullable\n" +
- "----------\n" +
- "2. WARNING in Bar.java (at line 5)\n" +
- " for (@NonNull var s : list);\n" +
- " ^^^^\n" +
- "Null type safety: The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull String\'\n" +
- "----------\n" +
- "3. ERROR in Bar.java (at line 8)\n" +
- " @NonNull var i1 = 3;\n" +
- " ^^^^^^^^\n" +
- "The nullness annotation @NonNull is not applicable for the primitive type int\n" +
- "----------\n" +
- "4. ERROR in Bar.java (at line 9)\n" +
- " for (@NonNull var s : array);\n" +
- " ^^^^^^^^\n" +
- "The nullness annotation @NonNull is not applicable for the primitive type int\n" +
+ "----------\n" +
+ "1. ERROR in Bar.java (at line 4)\n" +
+ " @NonNull var s2 = s1;\n" +
+ " ^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is specified as @Nullable\n" +
+ "----------\n" +
+ "2. WARNING in Bar.java (at line 5)\n" +
+ " for (@NonNull var s : list);\n" +
+ " ^^^^\n" +
+ "Null type safety: The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull String\'\n" +
+ "----------\n" +
+ "3. ERROR in Bar.java (at line 8)\n" +
+ " @NonNull var i1 = 3;\n" +
+ " ^^^^^^^^\n" +
+ "The nullness annotation @NonNull is not applicable for the primitive type int\n" +
+ "----------\n" +
+ "4. ERROR in Bar.java (at line 9)\n" +
+ " for (@NonNull var s : array);\n" +
+ " ^^^^^^^^\n" +
+ "The nullness annotation @NonNull is not applicable for the primitive type int\n" +
"----------\n");
}
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullChecksTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullChecksTests.java
index 68677dd49..e47b8adca 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullChecksTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullChecksTests.java
@@ -56,7 +56,7 @@ public class NullChecksTests extends AbstractNullAnnotationTest {
},
getCompilerOptions(),
"",
- "Value in position 1 must not be null\n" +
+ "Value in position 1 must not be null\n" +
"Shouldn\'t!");
}
@@ -94,7 +94,7 @@ public class NullChecksTests extends AbstractNullAnnotationTest {
},
getCompilerOptions(),
"",
- "Value in position 1 must not be null\n" +
+ "Value in position 1 must not be null\n" +
"Shouldn\'t!");
}
@@ -204,7 +204,7 @@ public class NullChecksTests extends AbstractNullAnnotationTest {
"npe:null\n" +
"Shouldn\'t!");
}
-
+
public void testIsNull() {
Map<String, String> compilerOptions = getCompilerOptions();
compilerOptions.put(JavaCore.COMPILER_PB_SUPPRESS_OPTIONAL_ERRORS, JavaCore.ENABLED);
@@ -229,14 +229,14 @@ public class NullChecksTests extends AbstractNullAnnotationTest {
" public static void main(String... args) {\n" +
" test(hide(null), new X(), new X());\n" +
" }\n" +
- "}\n"
+ "}\n"
},
compilerOptions,
"",
"IS NULL\n" +
"IS ANY NULL 1");
}
-
+
public void testAsNullable() {
runConformTestWithLibs(
new String[] {
@@ -254,13 +254,13 @@ public class NullChecksTests extends AbstractNullAnnotationTest {
" public static void main(String... args) {\n" +
" test(Optional.ofNullable(null));\n" +
" }\n" +
- "}\n"
+ "}\n"
},
getCompilerOptions(),
"",
"NULL");
}
-
+
public void testNonNullElse() {
runConformTestWithLibs(
new String[] {
@@ -278,7 +278,7 @@ public class NullChecksTests extends AbstractNullAnnotationTest {
" public static void main(String... args) {\n" +
" test(\"good\", null, () -> \"ELSE4\");\n" +
" }\n" +
- "}\n"
+ "}\n"
},
getCompilerOptions(),
"",
@@ -287,7 +287,7 @@ public class NullChecksTests extends AbstractNullAnnotationTest {
"good\n" +
"ELSE4");
}
-
+
public void _testIfNonNull() { // FIXME: see https://bugs.eclipse.org/489609 - [1.8][null] null annotation on wildcard is dropped during inference
runConformTestWithLibs(
new String[] {
@@ -304,7 +304,7 @@ public class NullChecksTests extends AbstractNullAnnotationTest {
" public static void main(String... args) {\n" +
" test(\"good\");\n" +
" }\n" +
- "}\n"
+ "}\n"
},
getCompilerOptions(),
"",
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java
index 5003fbd39..5f5685104 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java
@@ -76,7 +76,7 @@ static {
// TESTS_NAMES = new String[] { "testBug384380_b" };
// TESTS_NAMES = new String[] { "testBug321926a2" };
// TESTS_NAMES = new String[] { "testBug432109" };
-// TESTS_NAMES = new String[] { "testBug418500" };
+// TESTS_NAMES = new String[] { "testBug418500" };
// TESTS_NUMBERS = new int[] { 561 };
// TESTS_RANGE = new int[] { 1, 2049 };
}
@@ -227,10 +227,10 @@ public void test0006_final_local() {
" ^\n" +
"Null comparison always yields false: The variable o can only be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " if (o != null) { /* */ }\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " if (o != null) { /* */ }\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -691,16 +691,16 @@ public void test0030_conditional_expression() {
" o.toString();\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " Object o = true ? null : null;\n" +
- " ^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " o.toString();\n" +
- " ^\n" +
- "Null pointer access: The variable o can only be null at this location\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " Object o = true ? null : null;\n" +
+ " ^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " o.toString();\n" +
+ " ^\n" +
+ "Null pointer access: The variable o can only be null at this location\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -716,16 +716,16 @@ public void test0031_conditional_expression() {
" o.toString();\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " Object o = true ? null : new Object();\n" +
- " ^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " o.toString();\n" +
- " ^\n" +
- "Null pointer access: The variable o can only be null at this location\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " Object o = true ? null : new Object();\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " o.toString();\n" +
+ " ^\n" +
+ "Null pointer access: The variable o can only be null at this location\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -755,21 +755,21 @@ public void test0033_conditional_expression() {
" o.toString();\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " Object o = (1 == 1) ? null : new Object();\n" +
- " ^^^^^^^^\n" +
- "Comparing identical expressions\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " Object o = (1 == 1) ? null : new Object();\n" +
- " ^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " o.toString();\n" +
- " ^\n" +
- "Null pointer access: The variable o can only be null at this location\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " Object o = (1 == 1) ? null : new Object();\n" +
+ " ^^^^^^^^\n" +
+ "Comparing identical expressions\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " Object o = (1 == 1) ? null : new Object();\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " o.toString();\n" +
+ " ^\n" +
+ "Null pointer access: The variable o can only be null at this location\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -916,15 +916,15 @@ public void test0037_conditional_expression_1() {
new String[] {
"X.java",
"public class X {\n" +
- " boolean badFunction(int i) {\n" +
- " return i > 0 ? true : null;\n" +
+ " boolean badFunction(int i) {\n" +
+ " return i > 0 ? true : null;\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " return i > 0 ? true : null;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Potential null pointer access: This expression of type Boolean may be null but requires auto-unboxing\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " return i > 0 ? true : null;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Potential null pointer access: This expression of type Boolean may be null but requires auto-unboxing\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -948,11 +948,11 @@ public void test0037_conditional_expression_2() {
"}\n"},
null,
options,
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " return i > 0 ? null : Integer.MIN_VALUE;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Potential null pointer access: This expression of type Integer may be null but requires auto-unboxing\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " return i > 0 ? null : Integer.MIN_VALUE;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Potential null pointer access: This expression of type Integer may be null but requires auto-unboxing\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -966,18 +966,18 @@ public void test0037_conditional_expression_3() {
new String[] {
"X.java",
"public class X {\n" +
- " boolean badFunction3(int i) {\n" +
- " //expected a potential null problem:\n" +
- " return i > 0 ? true : (Boolean) null;\n" +
+ " boolean badFunction3(int i) {\n" +
+ " //expected a potential null problem:\n" +
+ " return i > 0 ? true : (Boolean) null;\n" +
" }\n" +
"}\n"},
null,
options,
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " return i > 0 ? true : (Boolean) null;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " return i > 0 ? true : (Boolean) null;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -993,21 +993,21 @@ public void test0037_conditional_expression_4() {
new String[] {
"X.java",
"public class X {\n" +
- " boolean badFunction4(int i) {\n" +
- " if (i > 0)\n" +
- " return true;\n" +
- " else\n" +
- " // expected a null problem:\n" +
- " return (Boolean) null;\n" +
+ " boolean badFunction4(int i) {\n" +
+ " if (i > 0)\n" +
+ " return true;\n" +
+ " else\n" +
+ " // expected a null problem:\n" +
+ " return (Boolean) null;\n" +
" }\n" +
"}\n"},
null,
options,
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " return (Boolean) null;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " return (Boolean) null;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -1021,26 +1021,26 @@ public void test0037_conditional_expression_5() {
new String[] {
"X.java",
"public class X {\n" +
- " String badFunction3(int i) {\n" +
- " return (i > 0 ? this : null).toString();\n" +
+ " String badFunction3(int i) {\n" +
+ " return (i > 0 ? this : null).toString();\n" +
" }\n" +
" String badFunction4(int i) {\n" +
- " Object o = null;\n" +
- " return (i > 0 ? o : null).toString();\n" +
+ " Object o = null;\n" +
+ " return (i > 0 ? o : null).toString();\n" +
" }\n" +
"}\n"},
null,
options,
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " return (i > 0 ? this : null).toString();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Potential null pointer access: This expression may be null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " return (i > 0 ? o : null).toString();\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Null pointer access: This expression can only be null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " return (i > 0 ? this : null).toString();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Potential null pointer access: This expression may be null\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " return (i > 0 ? o : null).toString();\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Null pointer access: This expression can only be null\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -1056,45 +1056,45 @@ public void test0037_autounboxing_1() {
"X.java",
"public class X {\n" +
" void foo1(boolean b) {\n" +
- " int j = 0;\n" +
- " Integer i = null;\n" +
- " while (true) {\n" +
- " try {\n" +
- " j = 1;\n" +
- " } finally {\n" +
- " j = (b?i:1)+1;\n" +
- " i = 2;\n" +
- " }\n" +
- " }\n" +
+ " int j = 0;\n" +
+ " Integer i = null;\n" +
+ " while (true) {\n" +
+ " try {\n" +
+ " j = 1;\n" +
+ " } finally {\n" +
+ " j = (b?i:1)+1;\n" +
+ " i = 2;\n" +
+ " }\n" +
+ " }\n" +
" }\n" +
" void foo2(boolean b) {\n" +
- " int j = 0;\n" +
- " Integer i = null;\n" +
- " try {\n" +
- " j = 1;\n" +
- " } finally {\n" +
- " j = (b?i:1)+1;\n" +
- " i = 2;\n" +
- " }\n" +
+ " int j = 0;\n" +
+ " Integer i = null;\n" +
+ " try {\n" +
+ " j = 1;\n" +
+ " } finally {\n" +
+ " j = (b?i:1)+1;\n" +
+ " i = 2;\n" +
+ " }\n" +
" }\n" +
"}\n"},
null,
options,
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " j = (b?i:1)+1;\n" +
- " ^\n" +
- "Potential null pointer access: This expression of type Integer may be null but requires auto-unboxing\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 20)\n" +
- " j = (b?i:1)+1;\n" +
- " ^\n" +
- "Null pointer access: This expression of type Integer is null but requires auto-unboxing\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " j = (b?i:1)+1;\n" +
+ " ^\n" +
+ "Potential null pointer access: This expression of type Integer may be null but requires auto-unboxing\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 20)\n" +
+ " j = (b?i:1)+1;\n" +
+ " ^\n" +
+ "Null pointer access: This expression of type Integer is null but requires auto-unboxing\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
// https://bugs.eclipse.org/403147 [compiler][null] FUP of bug 400761: consolidate interaction between unboxing, NPE, and deferred checking
-// inject pot.nn from try into finally
+// inject pot.nn from try into finally
public void test0037_autounboxing_2() {
if (this.complianceLevel < ClassFileConstants.JDK1_5) return;
Map options = getCompilerOptions();
@@ -1104,41 +1104,41 @@ public void test0037_autounboxing_2() {
new String[] {
"X.java",
"public class X {\n" +
- " void foo2(boolean b) {\n" +
- " int j = 0;\n" +
- " Integer i = null;\n" +
- " while (true) {\n" +
- " try {\n" +
- " if (b)\n" +
- " i = 3;\n" +
- " } finally {\n" +
- " j = (b?i:1)+1;\n" +
- " }\n" +
- " }\n" +
+ " void foo2(boolean b) {\n" +
+ " int j = 0;\n" +
+ " Integer i = null;\n" +
+ " while (true) {\n" +
+ " try {\n" +
+ " if (b)\n" +
+ " i = 3;\n" +
+ " } finally {\n" +
+ " j = (b?i:1)+1;\n" +
+ " }\n" +
+ " }\n" +
" }\n" +
- " void foo3(boolean b) {\n" +
- " int j = 0;\n" +
- " Integer i = null;\n" +
- " try {\n" +
- " if (b)\n" +
- " i = 3;\n" +
- " } finally {\n" +
- " j = (b?i:1)+1;\n" +
- " }\n" +
+ " void foo3(boolean b) {\n" +
+ " int j = 0;\n" +
+ " Integer i = null;\n" +
+ " try {\n" +
+ " if (b)\n" +
+ " i = 3;\n" +
+ " } finally {\n" +
+ " j = (b?i:1)+1;\n" +
+ " }\n" +
" }\n" +
"}\n"},
null,
options,
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " j = (b?i:1)+1;\n" +
- " ^\n" +
- "Potential null pointer access: This expression of type Integer may be null but requires auto-unboxing\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 21)\n" +
- " j = (b?i:1)+1;\n" +
- " ^\n" +
- "Potential null pointer access: This expression of type Integer may be null but requires auto-unboxing\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " j = (b?i:1)+1;\n" +
+ " ^\n" +
+ "Potential null pointer access: This expression of type Integer may be null but requires auto-unboxing\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 21)\n" +
+ " j = (b?i:1)+1;\n" +
+ " ^\n" +
+ "Potential null pointer access: This expression of type Integer may be null but requires auto-unboxing\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -1153,48 +1153,48 @@ public void test0037_autounboxing_3() {
new String[] {
"X.java",
"public class X {\n" +
- " void foo3(Integer i, boolean b) {\n" +
- " int j = 0;\n" +
- " while (true) {\n" +
- " try {\n" +
- " i = null;\n" +
- " unsafe();\n" +
- " } catch (Exception e) {\n" +
- " i = 3;\n" +
- " } finally {\n" +
- " j = (b?i:1)+1;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " void foo4(Integer i, boolean b) {\n" +
- " int j = 0;\n" +
- " try {\n" +
- " i = null;\n" +
- " unsafe();\n" +
- " } catch (Exception e) {\n" +
- " i = 3;\n" +
- " } finally {\n" +
- " while (j < 0)\n" +
- " j = (b?i:1)+1;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private void unsafe() throws Exception {\n" +
- " throw new Exception();\n" +
+ " void foo3(Integer i, boolean b) {\n" +
+ " int j = 0;\n" +
+ " while (true) {\n" +
+ " try {\n" +
+ " i = null;\n" +
+ " unsafe();\n" +
+ " } catch (Exception e) {\n" +
+ " i = 3;\n" +
+ " } finally {\n" +
+ " j = (b?i:1)+1;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " void foo4(Integer i, boolean b) {\n" +
+ " int j = 0;\n" +
+ " try {\n" +
+ " i = null;\n" +
+ " unsafe();\n" +
+ " } catch (Exception e) {\n" +
+ " i = 3;\n" +
+ " } finally {\n" +
+ " while (j < 0)\n" +
+ " j = (b?i:1)+1;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " private void unsafe() throws Exception {\n" +
+ " throw new Exception();\n" +
" }\n" +
"}\n"},
null,
options,
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " j = (b?i:1)+1;\n" +
- " ^\n" +
- "Potential null pointer access: This expression of type Integer may be null but requires auto-unboxing\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 24)\n" +
- " j = (b?i:1)+1;\n" +
- " ^\n" +
- "Potential null pointer access: This expression of type Integer may be null but requires auto-unboxing\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " j = (b?i:1)+1;\n" +
+ " ^\n" +
+ "Potential null pointer access: This expression of type Integer may be null but requires auto-unboxing\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 24)\n" +
+ " j = (b?i:1)+1;\n" +
+ " ^\n" +
+ "Potential null pointer access: This expression of type Integer may be null but requires auto-unboxing\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -1208,37 +1208,37 @@ public void test0037_autounboxing_4() {
new String[] {
"X.java",
"public class X {\n" +
- " void foo3(Integer i, boolean b) {\n" +
- " int j = 0;\n" +
- " while (true) {\n" +
- " try {\n" +
- " i = null;\n" +
- " unsafe();\n" +
- " } catch (Exception e) {\n" +
- " i = 3;\n" +
+ " void foo3(Integer i, boolean b) {\n" +
+ " int j = 0;\n" +
+ " while (true) {\n" +
+ " try {\n" +
+ " i = null;\n" +
+ " unsafe();\n" +
+ " } catch (Exception e) {\n" +
+ " i = 3;\n" +
" } finally {\n" +
- " if (i == null) i = 4;\n" +
- " j = (b?i:1)+1;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " void foo4(Integer i, boolean b) {\n" +
- " int j = 0;\n" +
- " try {\n" +
- " i = null;\n" +
- " unsafe();\n" +
- " } catch (Exception e) {\n" +
- " i = 3;\n" +
+ " if (i == null) i = 4;\n" +
+ " j = (b?i:1)+1;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " void foo4(Integer i, boolean b) {\n" +
+ " int j = 0;\n" +
+ " try {\n" +
+ " i = null;\n" +
+ " unsafe();\n" +
+ " } catch (Exception e) {\n" +
+ " i = 3;\n" +
" } finally {\n" +
- " while (i == null)\n" +
- " i = 4;\n" +
- " while (j < 4)\n" +
- " j = (b?i:1)+1;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private void unsafe() throws Exception {\n" +
- " throw new Exception();\n" +
+ " while (i == null)\n" +
+ " i = 4;\n" +
+ " while (j < 4)\n" +
+ " j = (b?i:1)+1;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " private void unsafe() throws Exception {\n" +
+ " throw new Exception();\n" +
" }\n" +
"}\n"},
options);
@@ -1254,33 +1254,33 @@ public void test0037_autounboxing_5() {
new String[] {
"X.java",
"public class X {\n" +
- " void foo(Object [] o, boolean b, Integer i) {\n" +
- " int j = 1;\n" +
- " try {\n" +
- " if (b) i = null;\n" +
- " } catch (RuntimeException r) {\n" +
- " i = 3;\n" +
- " } finally {\n" +
- " try {\n" +
- " System.out.println(o[i]); \n" +
- " } finally {\n" +
- " System.out.println(j);\n" +
- " }\n" +
- " }\n" +
+ " void foo(Object [] o, boolean b, Integer i) {\n" +
+ " int j = 1;\n" +
+ " try {\n" +
+ " if (b) i = null;\n" +
+ " } catch (RuntimeException r) {\n" +
+ " i = 3;\n" +
+ " } finally {\n" +
+ " try {\n" +
+ " System.out.println(o[i]); \n" +
+ " } finally {\n" +
+ " System.out.println(j);\n" +
+ " }\n" +
+ " }\n" +
" }\n" +
"}\n"},
null,
options,
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " System.out.println(o[i]); \n" +
- " ^\n" +
- "Potential null pointer access: This expression of type Integer may be null but requires auto-unboxing\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " System.out.println(o[i]); \n" +
+ " ^\n" +
+ "Potential null pointer access: This expression of type Integer may be null but requires auto-unboxing\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
-// Bug 406384 - Internal error with I20130413
+// Bug 406384 - Internal error with I20130413
public void test0037_autounboxing_6() {
if (this.complianceLevel < ClassFileConstants.JDK1_5)
return;
@@ -1366,10 +1366,10 @@ public void test0042_autoboxing_literal() {
" ^\n" +
"Null comparison always yields false: The variable i cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " if (i == null) {};\n" +
- " ^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " if (i == null) {};\n" +
+ " ^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -1433,10 +1433,10 @@ public void test0045_autoboxing_operator() {
" ^\n" +
"Null comparison always yields false: The variable i cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " if (i == null) {}\n" +
- " ^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " if (i == null) {}\n" +
+ " ^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -1523,10 +1523,10 @@ public void test0061_method_call_guard() {
" ^\n" +
"Null comparison always yields false: The variable o cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " if (o == null) {};\n" +
- " ^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " if (o == null) {};\n" +
+ " ^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -1594,10 +1594,10 @@ public void test0064_method_call_isolation() {
" ^\n" +
"Null comparison always yields false: The variable o cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " if (o == null) {/* empty */}\n" +
- " ^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " if (o == null) {/* empty */}\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -1653,10 +1653,10 @@ public void test0067_method_call_invocation_target() {
" ^\n" +
"Null comparison always yields false: The variable o cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " if (o == null) { /* */ }\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " if (o == null) { /* */ }\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -1695,10 +1695,10 @@ public void test0070_type_reference() {
" ^\n" +
"Null comparison always yields false: The variable c cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " if (c == null) {};\n" +
- " ^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " if (c == null) {};\n" +
+ " ^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -1763,10 +1763,10 @@ public void test0082_shortcut_boolean_expression() {
" ^\n" +
"Null comparison always yields false: The variable o cannot be null at this location\n" +
"----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " if (o == null) { /* */ }\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " if (o == null) { /* */ }\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -1795,10 +1795,10 @@ public void test0083_shortcut_boolean_expression() {
" ^\n" +
"Null comparison always yields false: The variable o cannot be null at this location\n" +
"----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " if (o == null) { /* */ }\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " if (o == null) { /* */ }\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -1972,10 +1972,10 @@ public void test0093_instanceof() {
" ^\n" +
"Null comparison always yields false: The variable x cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " if (x == null) { /* */ }\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " if (x == null) { /* */ }\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -2185,25 +2185,25 @@ public void test0300_if_else() {
" o.toString();\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " if (false) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " else {\n" +
- " o = new Object();\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 13)\n" +
- " o.toString();\n" +
- " ^\n" +
- "Null pointer access: The variable o can only be null at this location\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " if (false) {\n" +
+ " o = new Object();\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " else {\n" +
+ " o = new Object();\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 13)\n" +
+ " o.toString();\n" +
+ " ^\n" +
+ "Null pointer access: The variable o can only be null at this location\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -2338,12 +2338,12 @@ public void test0306_if_else() {
" ^\n" +
"Null comparison always yields false: The variable o cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " if (o == null) {\n" +
- " // do nothing\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " if (o == null) {\n" +
+ " // do nothing\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -2519,10 +2519,10 @@ public void test0313_if_else() {
" ^\n" +
"Null comparison always yields false: The variable o cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " if (o == null) { /* */ }\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " if (o == null) { /* */ }\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -2662,10 +2662,10 @@ public void test0320_if_else() {
" ^\n" +
"Null comparison always yields false: The variable o cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " if (o == null) { /* */ }\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " if (o == null) { /* */ }\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -2705,10 +2705,10 @@ public void test0322_if_else() {
" ^\n" +
"Null comparison always yields false: The variable o cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " if (o == null) { /* */ }\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " if (o == null) { /* */ }\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -3002,11 +3002,11 @@ public void test0334_if_else() {
"Redundant null check: The variable o cannot be null at this location\n" +
"----------\n" +
"2. WARNING in X.java (at line 7)\n" +
- " else {\n" +
- " o.toString();\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ " else {\n" +
+ " o.toString();\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -3063,12 +3063,12 @@ public void test0336_if_else() {
" ^\n" +
"Redundant null check: The variable o cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " else {\n" +
- " o.toString();\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " else {\n" +
+ " o.toString();\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -3740,10 +3740,10 @@ public void test0422_while() {
" ^\n" +
"Null comparison always yields false: The variable o cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " if (o == null) { /* */ }\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " if (o == null) { /* */ }\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -3770,10 +3770,10 @@ public void test0423_while() {
" ^\n" +
"Null comparison always yields false: The variable o cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " if (o == null) { /* */ }\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " if (o == null) { /* */ }\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -3844,10 +3844,10 @@ public void test0426_while() {
" ^\n" +
"Null comparison always yields false: The variable o cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " if (o == null) { /* */ }\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " if (o == null) { /* */ }\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -4939,11 +4939,11 @@ public void test0470_while() {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " if (o != null && o.toString().equals(\"o\")) {\n" +
- " ^\n" +
- "Redundant null check: The variable o cannot be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " if (o != null && o.toString().equals(\"o\")) {\n" +
+ " ^\n" +
+ "Redundant null check: The variable o cannot be null at this location\n" +
"----------\n");
}
// null analysis -- try/finally
@@ -5058,7 +5058,7 @@ public void test0504_try_finally() {
// null analysis -- try/finally
// origin: AssignmentTest#test017
-// The whole issue here is whether or not to detect premature exits.
+// The whole issue here is whether or not to detect premature exits.
// Previously, we followed JLS's conservative approach, which considers
// that the try block may exit before the assignment is completed.
// As of Bug 345305 this has been changed to a more accurate analysis.
@@ -5103,11 +5103,11 @@ public void test0506_try_finally() {
" if (o == null) { /* */ }\n" +
" ^\n" +
"Null comparison always yields false: The variable o cannot be null at this location\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " if (o == null) { /* */ }\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " if (o == null) { /* */ }\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -5134,12 +5134,12 @@ public void test0507_try_finally() {
" ^\n" +
"Null comparison always yields false: The variable o cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " if (o == null) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " if (o == null) {\n" +
+ " o = new Object();\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -6018,11 +6018,11 @@ public void test0536_try_finally() {
" }\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " x.toString();\n" +
- " ^\n" +
- "Potential null pointer access: The variable x may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " x.toString();\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable x may be null at this location\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -6056,16 +6056,16 @@ public void test0537_try_finally() {
" }\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 16)\n" +
- " x1.toString();\n" +
- " ^^\n" +
- "Potential null pointer access: The variable x1 may be null at this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 17)\n" +
- " x2.toString();\n" +
- " ^^\n" +
- "Potential null pointer access: The variable x2 may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 16)\n" +
+ " x1.toString();\n" +
+ " ^^\n" +
+ "Potential null pointer access: The variable x1 may be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 17)\n" +
+ " x2.toString();\n" +
+ " ^^\n" +
+ "Potential null pointer access: The variable x2 may be null at this location\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -6517,11 +6517,11 @@ public void test0563_try_catch() {
" ^^\n" +
"Null comparison always yields false: The variable ex cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 20)\n" +
- " if (ex == null) {\n" +
- " }\n" +
- " ^^^^^^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 20)\n" +
+ " if (ex == null) {\n" +
+ " }\n" +
+ " ^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -6697,16 +6697,16 @@ public void test0569_try_catch() {
" }\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " if (o == null)\n" +
- " ^\n" +
- "Redundant null check: The variable o can only be null at this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " System.out.println(i);\n" +
- " ^\n" +
- "The local variable i may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " if (o == null)\n" +
+ " ^\n" +
+ "Redundant null check: The variable o can only be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " System.out.println(i);\n" +
+ " ^\n" +
+ "The local variable i may not have been initialized\n" +
"----------\n");
}
// null analysis -- try/catch
@@ -6734,21 +6734,21 @@ public void test0570_try_catch() {
" }\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " if (o == null)\n" +
- " ^\n" +
- "Redundant null check: The variable o can only be null at this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " if (o != null)\n" +
- " ^\n" +
- "Redundant null check: The variable o cannot be null at this location\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 15)\n" +
- " if(i == 0)\n" +
- " ^\n" +
- "The local variable i may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " if (o == null)\n" +
+ " ^\n" +
+ "Redundant null check: The variable o can only be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " if (o != null)\n" +
+ " ^\n" +
+ "Redundant null check: The variable o cannot be null at this location\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 15)\n" +
+ " if(i == 0)\n" +
+ " ^\n" +
+ "The local variable i may not have been initialized\n" +
"----------\n");
}
//null analysis -- try/catch
@@ -6781,21 +6781,21 @@ public void test0571_try_catch_finally() {
" }\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " if (o == null)\n" +
- " ^\n" +
- "Redundant null check: The variable o can only be null at this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 18)\n" +
- " if (i==1) {\n" +
- " ^\n" +
- "The local variable i may not have been initialized\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 20)\n" +
- " System.out.println(o.toString());\n" +
- " ^\n" +
- "Potential null pointer access: The variable o may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " if (o == null)\n" +
+ " ^\n" +
+ "Redundant null check: The variable o can only be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 18)\n" +
+ " if (i==1) {\n" +
+ " ^\n" +
+ "The local variable i may not have been initialized\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 20)\n" +
+ " System.out.println(o.toString());\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable o may be null at this location\n" +
"----------\n");
}
//null analysis -- if statement
@@ -6804,26 +6804,26 @@ public void test0572_if_statement() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " int i;\n" +
- " if (o == null) // redundant check\n" +
- " i = 0;\n" +
- " System.out.println(i);\n" +
- " }\n" +
- "}\n" +
+ "public class X {\n" +
+ " void foo() {\n" +
+ " Object o = null;\n" +
+ " int i;\n" +
+ " if (o == null) // redundant check\n" +
+ " i = 0;\n" +
+ " System.out.println(i);\n" +
+ " }\n" +
+ "}\n" +
""},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " if (o == null) // redundant check\n" +
- " ^\n" +
- "Redundant null check: The variable o can only be null at this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " System.out.println(i);\n" +
- " ^\n" +
- "The local variable i may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " if (o == null) // redundant check\n" +
+ " ^\n" +
+ "Redundant null check: The variable o can only be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " System.out.println(i);\n" +
+ " ^\n" +
+ "The local variable i may not have been initialized\n" +
"----------\n");
}
@@ -6849,16 +6849,16 @@ public void test0573_try_catch_unchecked_and_checked_exception() {
" return new Object();\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " o.toString();\n" +
- " ^\n" +
- "Null pointer access: The variable o can only be null at this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " o.toString();\n" +
- " ^\n" +
- "Potential null pointer access: The variable o may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " o.toString();\n" +
+ " ^\n" +
+ "Null pointer access: The variable o can only be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " o.toString();\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable o may be null at this location\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -6952,31 +6952,31 @@ public void test0576_try_with_resources() {
" } finally {}\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " class MyException extends Exception {}\n" +
- " ^^^^^^^^^^^\n" +
- "The serializable class MyException does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " fis2.available();\n" +
- " ^^^^\n" +
- "Potential null pointer access: The variable fis2 may be null at this location\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 14)\n" +
- " fis3.close();\n" +
- " ^^^^\n" +
- "Potential null pointer access: The variable fis3 may be null at this location\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 15)\n" +
- " fis4.available();\n" +
- " ^^^^\n" +
- "Null pointer access: The variable fis4 can only be null at this location\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 18)\n" +
- " fis.available();\n" +
- " ^^^\n" +
- "Potential null pointer access: The variable fis may be null at this location\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " class MyException extends Exception {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "The serializable class MyException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 13)\n" +
+ " fis2.available();\n" +
+ " ^^^^\n" +
+ "Potential null pointer access: The variable fis2 may be null at this location\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 14)\n" +
+ " fis3.close();\n" +
+ " ^^^^\n" +
+ "Potential null pointer access: The variable fis3 may be null at this location\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 15)\n" +
+ " fis4.available();\n" +
+ " ^^^^\n" +
+ "Null pointer access: The variable fis4 can only be null at this location\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 18)\n" +
+ " fis.available();\n" +
+ " ^^^\n" +
+ "Potential null pointer access: The variable fis may be null at this location\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -8620,10 +8620,10 @@ public void test0801_switch() {
" ^\n" +
"Null comparison always yields false: The variable o cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 12)\n" +
- " if(o == null) { /* */ }\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 12)\n" +
+ " if(o == null) { /* */ }\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -8993,21 +8993,21 @@ public void test0953_assert_combined() {
" if (o2 == null) { };\n" + // complain
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (o1 == null) { };\n" +
- " ^^\n" +
- "Null comparison always yields false: The variable o1 cannot be null at this location\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " if (o1 == null) { };\n" +
- " ^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " if (o2 == null) { };\n" +
- " ^^\n" +
- "Redundant null check: The variable o2 can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " if (o1 == null) { };\n" +
+ " ^^\n" +
+ "Null comparison always yields false: The variable o1 cannot be null at this location\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " if (o1 == null) { };\n" +
+ " ^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " if (o2 == null) { };\n" +
+ " ^^\n" +
+ "Redundant null check: The variable o2 can only be null at this location\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -9028,11 +9028,11 @@ public void test0954_assert_fake_reachable() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " assert(false && o != null);\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " assert(false && o != null);\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
"",
"",
@@ -9053,16 +9053,16 @@ public void test0955_assert_combined() {
" if (o == null) { };\n" + // complain
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (o == null) { };\n" +
- " ^\n" +
- "Null comparison always yields false: The variable o cannot be null at this location\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " if (o == null) { };\n" +
- " ^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " if (o == null) { };\n" +
+ " ^\n" +
+ "Null comparison always yields false: The variable o cannot be null at this location\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " if (o == null) { };\n" +
+ " ^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -9082,21 +9082,21 @@ public void test0956_assert_combined() {
" if (o == null) { };\n" + // complain
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " assert(o != null);\n" +
- " ^\n" +
- "Null comparison always yields false: The variable o can only be null at this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " if (o == null) { };\n" +
- " ^\n" +
- "Null comparison always yields false: The variable o cannot be null at this location\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 5)\n" +
- " if (o == null) { };\n" +
- " ^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " assert(o != null);\n" +
+ " ^\n" +
+ "Null comparison always yields false: The variable o can only be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " if (o == null) { };\n" +
+ " ^\n" +
+ "Null comparison always yields false: The variable o cannot be null at this location\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 5)\n" +
+ " if (o == null) { };\n" +
+ " ^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -9126,46 +9126,46 @@ public void test0957_assert() {
" if (bar2 == null) {}\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " if (foo == null) {}\n" +
- " ^^^\n" +
- "Null comparison always yields false: The variable foo cannot be null at this location\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " if (foo == null) {}\n" +
- " ^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " assert (foo2 == null);\n" +
- " ^^^^\n" +
- "Null comparison always yields false: The variable foo2 cannot be null at this location\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " if (foo2 == null) {}\n" +
- " ^^^^\n" +
- "Redundant null check: The variable foo2 can only be null at this location\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 11)\n" +
- " if (bar == null) {}\n" +
- " ^^^\n" +
- "Redundant null check: The variable bar can only be null at this location\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 13)\n" +
- " assert (bar2 != null);\n" +
- " ^^^^\n" +
- "Null comparison always yields false: The variable bar2 can only be null at this location\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 14)\n" +
- " if (bar2 == null) {}\n" +
- " ^^^^\n" +
- "Null comparison always yields false: The variable bar2 cannot be null at this location\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 14)\n" +
- " if (bar2 == null) {}\n" +
- " ^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " if (foo == null) {}\n" +
+ " ^^^\n" +
+ "Null comparison always yields false: The variable foo cannot be null at this location\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " if (foo == null) {}\n" +
+ " ^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " assert (foo2 == null);\n" +
+ " ^^^^\n" +
+ "Null comparison always yields false: The variable foo2 cannot be null at this location\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " if (foo2 == null) {}\n" +
+ " ^^^^\n" +
+ "Redundant null check: The variable foo2 can only be null at this location\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 11)\n" +
+ " if (bar == null) {}\n" +
+ " ^^^\n" +
+ "Redundant null check: The variable bar can only be null at this location\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 13)\n" +
+ " assert (bar2 != null);\n" +
+ " ^^^^\n" +
+ "Null comparison always yields false: The variable bar2 can only be null at this location\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 14)\n" +
+ " if (bar2 == null) {}\n" +
+ " ^^^^\n" +
+ "Null comparison always yields false: The variable bar2 cannot be null at this location\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 14)\n" +
+ " if (bar2 == null) {}\n" +
+ " ^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -9195,15 +9195,15 @@ public void test0958_assert() {
" }\n" +
"}\n"},
"----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " if (foo != null) {}\n" +
- " ^^^\n" +
- "Redundant null check: The variable foo cannot be null at this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " if (bar == null) {}\n" +
- " ^^^\n" +
- "Redundant null check: The variable bar can only be null at this location\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " if (foo != null) {}\n" +
+ " ^^^\n" +
+ "Redundant null check: The variable foo cannot be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 13)\n" +
+ " if (bar == null) {}\n" +
+ " ^^^\n" +
+ "Redundant null check: The variable bar can only be null at this location\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -9227,54 +9227,54 @@ public void test0959a_assert_loop() {
" assert (foo != null);\n" + //don't warn
" if (foo == null) {}\n" +
" assert (foo2 == null);\n" + //don't warn
- " if (foo2 == null) {}\n" +
+ " if (foo2 == null) {}\n" +
" assert (bar == null);\n" + //don't warn
- " if (bar == null) {}\n" +
+ " if (bar == null) {}\n" +
" assert (bar2 != null);\n" + //don't warn
" if (bar2 == null) {}\n" +
" }\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " if (foo == null) {}\n" +
- " ^^^\n" +
- "Null comparison always yields false: The variable foo cannot be null at this location\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " if (foo == null) {}\n" +
- " ^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " assert (foo2 == null);\n" +
- " ^^^^\n" +
- "Null comparison always yields false: The variable foo2 cannot be null at this location\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 11)\n" +
- " if (foo2 == null) {}\n" +
- " ^^^^\n" +
- "Redundant null check: The variable foo2 can only be null at this location\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 13)\n" +
- " if (bar == null) {}\n" +
- " ^^^\n" +
- "Redundant null check: The variable bar can only be null at this location\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 14)\n" +
- " assert (bar2 != null);\n" +
- " ^^^^\n" +
- "Null comparison always yields false: The variable bar2 can only be null at this location\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 15)\n" +
- " if (bar2 == null) {}\n" +
- " ^^^^\n" +
- "Null comparison always yields false: The variable bar2 cannot be null at this location\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 15)\n" +
- " if (bar2 == null) {}\n" +
- " ^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " if (foo == null) {}\n" +
+ " ^^^\n" +
+ "Null comparison always yields false: The variable foo cannot be null at this location\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " if (foo == null) {}\n" +
+ " ^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 10)\n" +
+ " assert (foo2 == null);\n" +
+ " ^^^^\n" +
+ "Null comparison always yields false: The variable foo2 cannot be null at this location\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 11)\n" +
+ " if (foo2 == null) {}\n" +
+ " ^^^^\n" +
+ "Redundant null check: The variable foo2 can only be null at this location\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 13)\n" +
+ " if (bar == null) {}\n" +
+ " ^^^\n" +
+ "Redundant null check: The variable bar can only be null at this location\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 14)\n" +
+ " assert (bar2 != null);\n" +
+ " ^^^^\n" +
+ "Null comparison always yields false: The variable bar2 can only be null at this location\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 15)\n" +
+ " if (bar2 == null) {}\n" +
+ " ^^^^\n" +
+ "Null comparison always yields false: The variable bar2 cannot be null at this location\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 15)\n" +
+ " if (bar2 == null) {}\n" +
+ " ^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -9306,46 +9306,46 @@ public void test0959b_assert_loop() {
" }\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (foo == null) {}\n" +
- " ^^^\n" +
- "Null comparison always yields false: The variable foo cannot be null at this location\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " if (foo == null) {}\n" +
- " ^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " assert (foo2 == null);\n" +
- " ^^^^\n" +
- "Null comparison always yields false: The variable foo2 cannot be null at this location\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " if (foo2 == null) {}\n" +
- " ^^^^\n" +
- "Redundant null check: The variable foo2 can only be null at this location\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 12)\n" +
- " if (bar == null) {}\n" +
- " ^^^\n" +
- "Redundant null check: The variable bar can only be null at this location\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 14)\n" +
- " assert (bar2 != null);\n" +
- " ^^^^\n" +
- "Null comparison always yields false: The variable bar2 can only be null at this location\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 15)\n" +
- " if (bar2 == null) {}\n" +
- " ^^^^\n" +
- "Null comparison always yields false: The variable bar2 cannot be null at this location\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 15)\n" +
- " if (bar2 == null) {}\n" +
- " ^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " if (foo == null) {}\n" +
+ " ^^^\n" +
+ "Null comparison always yields false: The variable foo cannot be null at this location\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " if (foo == null) {}\n" +
+ " ^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " assert (foo2 == null);\n" +
+ " ^^^^\n" +
+ "Null comparison always yields false: The variable foo2 cannot be null at this location\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 9)\n" +
+ " if (foo2 == null) {}\n" +
+ " ^^^^\n" +
+ "Redundant null check: The variable foo2 can only be null at this location\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 12)\n" +
+ " if (bar == null) {}\n" +
+ " ^^^\n" +
+ "Redundant null check: The variable bar can only be null at this location\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 14)\n" +
+ " assert (bar2 != null);\n" +
+ " ^^^^\n" +
+ "Null comparison always yields false: The variable bar2 can only be null at this location\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 15)\n" +
+ " if (bar2 == null) {}\n" +
+ " ^^^^\n" +
+ "Null comparison always yields false: The variable bar2 cannot be null at this location\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 15)\n" +
+ " if (bar2 == null) {}\n" +
+ " ^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -9372,54 +9372,54 @@ public void test0960_assert_finally() {
" assert (foo != null);\n" + //don't warn
" if (foo == null) {}\n" +
" assert (foo2 == null);\n" + //don't warn
- " if (foo2 == null) {}\n" +
+ " if (foo2 == null) {}\n" +
" assert (bar == null);\n" + //don't warn
- " if (bar == null) {}\n" +
+ " if (bar == null) {}\n" +
" assert (bar2 != null);\n" + //don't warn
" if (bar2 == null) {}\n" +
" }\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " if (foo == null) {}\n" +
- " ^^^\n" +
- "Null comparison always yields false: The variable foo cannot be null at this location\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 12)\n" +
- " if (foo == null) {}\n" +
- " ^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 13)\n" +
- " assert (foo2 == null);\n" +
- " ^^^^\n" +
- "Null comparison always yields false: The variable foo2 cannot be null at this location\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 14)\n" +
- " if (foo2 == null) {}\n" +
- " ^^^^\n" +
- "Redundant null check: The variable foo2 can only be null at this location\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 16)\n" +
- " if (bar == null) {}\n" +
- " ^^^\n" +
- "Redundant null check: The variable bar can only be null at this location\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 17)\n" +
- " assert (bar2 != null);\n" +
- " ^^^^\n" +
- "Null comparison always yields false: The variable bar2 can only be null at this location\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 18)\n" +
- " if (bar2 == null) {}\n" +
- " ^^^^\n" +
- "Null comparison always yields false: The variable bar2 cannot be null at this location\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 18)\n" +
- " if (bar2 == null) {}\n" +
- " ^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " if (foo == null) {}\n" +
+ " ^^^\n" +
+ "Null comparison always yields false: The variable foo cannot be null at this location\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 12)\n" +
+ " if (foo == null) {}\n" +
+ " ^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 13)\n" +
+ " assert (foo2 == null);\n" +
+ " ^^^^\n" +
+ "Null comparison always yields false: The variable foo2 cannot be null at this location\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 14)\n" +
+ " if (foo2 == null) {}\n" +
+ " ^^^^\n" +
+ "Redundant null check: The variable foo2 can only be null at this location\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 16)\n" +
+ " if (bar == null) {}\n" +
+ " ^^^\n" +
+ "Redundant null check: The variable bar can only be null at this location\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 17)\n" +
+ " assert (bar2 != null);\n" +
+ " ^^^^\n" +
+ "Null comparison always yields false: The variable bar2 can only be null at this location\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 18)\n" +
+ " if (bar2 == null) {}\n" +
+ " ^^^^\n" +
+ "Null comparison always yields false: The variable bar2 cannot be null at this location\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 18)\n" +
+ " if (bar2 == null) {}\n" +
+ " ^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -9753,16 +9753,16 @@ public void test1011() {
" ^^^^^\n" +
"Redundant null check: The variable other cannot be null at this location\n" +
"----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " if (other == null) {\n" +
- " ^^^^^\n" +
- "Null comparison always yields false: The variable other cannot be null at this location\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 11)\n" +
- " if (other == null) {\n" +
- " }\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " if (other == null) {\n" +
+ " ^^^^^\n" +
+ "Null comparison always yields false: The variable other cannot be null at this location\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 11)\n" +
+ " if (other == null) {\n" +
+ " }\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -10071,9 +10071,9 @@ public void test1023() {
"Null comparison always yields false: The variable o cannot be null at this location\n" +
"----------\n" +
"2. WARNING in X.java (at line 13)\n" +
- " if (o == null) return;\n" +
- " ^^^^^^^\n" +
- "Dead code\n" +
+ " if (o == null) return;\n" +
+ " ^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -10134,10 +10134,10 @@ public void test1025() {
" ^\n" +
"Null comparison always yields false: The variable o cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " if (o == null) return;\n" +
- " ^^^^^^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " if (o == null) return;\n" +
+ " ^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -10254,16 +10254,16 @@ public void test1030() {
" }\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " a = null;\n" +
- " ^\n" +
- "Redundant assignment: The variable a can only be null at this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " if (a == null) {\n" +
- " ^\n" +
- "Redundant null check: The variable a can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " a = null;\n" +
+ " ^\n" +
+ "Redundant assignment: The variable a can only be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " if (a == null) {\n" +
+ " ^\n" +
+ "Redundant null check: The variable a can only be null at this location\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -10289,28 +10289,28 @@ public void test1031() {
" }\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " a = null;\n" +
- " ^\n" +
- "Redundant assignment: The variable a can only be null at this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " if (a == null) {\n" +
- " ^\n" +
- "Redundant null check: The variable a can only be null at this location\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 13)\n" +
- " if (a == null) {\n" +
- " ^\n" +
- "Null comparison always yields false: The variable a cannot be null at this location\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 13)\n" +
- " if (a == null) {\n" +
- " System.out.println();\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " a = null;\n" +
+ " ^\n" +
+ "Redundant assignment: The variable a can only be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " if (a == null) {\n" +
+ " ^\n" +
+ "Redundant null check: The variable a can only be null at this location\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 13)\n" +
+ " if (a == null) {\n" +
+ " ^\n" +
+ "Null comparison always yields false: The variable a cannot be null at this location\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 13)\n" +
+ " if (a == null) {\n" +
+ " System.out.println();\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -10369,10 +10369,10 @@ public void test1033() {
" ^\n" +
"Null comparison always yields false: The variable a can only be null at this location\n" +
"----------\n" +
- "3. WARNING in X.java (at line 9)\n" +
- " { /* */ }\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
+ "3. WARNING in X.java (at line 9)\n" +
+ " { /* */ }\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -10478,7 +10478,7 @@ public void test1050_options_all_default() {
" if (o != null) {\n" +
" o = null;\n" +
" }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Dead code\n" +
"----------\n" +
"2. WARNING in X.java (at line 8)\n" +
@@ -10546,14 +10546,14 @@ public void test1052_options_all_error() {
"1. ERROR in X.java (at line 4)\n" +
" if (o != null) {\n" +
" ^\n" +
- "Null comparison always yields false: The variable o can only be null at this location\n" +
+ "Null comparison always yields false: The variable o can only be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " if (o != null) {\n" +
- " o = null;\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " if (o != null) {\n" +
+ " o = null;\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n" +
"3. ERROR in X.java (at line 8)\n" +
" o.toString();\n" +
@@ -10597,12 +10597,12 @@ public void test1053_options_mix() {
customOptions /* custom options */,
// compiler results
"----------\n" + /* expected compiler log */
- "1. WARNING in X.java (at line 4)\n" +
- " if (o != null) {\n" +
- " o = null;\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " if (o != null) {\n" +
+ " o = null;\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n" +
"2. ERROR in X.java (at line 8)\n" +
" o.toString();\n" +
@@ -10647,12 +10647,12 @@ public void test1054_options_mix() {
" ^\n" +
"Null comparison always yields false: The variable o can only be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " if (o != null) {\n" +
- " o = null;\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " if (o != null) {\n" +
+ " o = null;\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n" +
"3. WARNING in X.java (at line 8)\n" +
" o.toString();\n" +
@@ -10697,12 +10697,12 @@ public void test1055_options_mix() {
" ^\n" +
"Null comparison always yields false: The variable o can only be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " if (o != null) {\n" +
- " o = null;\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " if (o != null) {\n" +
+ " o = null;\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n" +
"3. ERROR in X.java (at line 9)\n" +
" p.toString();\n" +
@@ -10744,12 +10744,12 @@ public void test1056_options_mix_with_SuppressWarnings() {
customOptions /* custom options */,
// compiler results
"----------\n" + /* expected compiler log */
- "1. WARNING in X.java (at line 5)\n" +
- " if (o != null) {\n" +
- " o = null;\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " if (o != null) {\n" +
+ " o = null;\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n" +
"2. ERROR in X.java (at line 9)\n" +
" o.toString();\n" +
@@ -10963,15 +10963,15 @@ public void test2000_flow_info() {
" ^^^\n" +
"Null comparison always yields false: The variable o65 cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 18)\n" +
- " if (o65 == null) { /* */ }\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 19)\n" +
- " if (o65 != null) { /* */ }\n" +
- " ^^^\n" +
- "Redundant null check: The variable o65 cannot be null at this location\n" +
+ "2. WARNING in X.java (at line 18)\n" +
+ " if (o65 == null) { /* */ }\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 19)\n" +
+ " if (o65 != null) { /* */ }\n" +
+ " ^^^\n" +
+ "Redundant null check: The variable o65 cannot be null at this location\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -11230,10 +11230,10 @@ public void test2009_flow_info() {
" ^\n" +
"Null comparison always yields false: The variable o cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 20)\n" +
- " if (o == null) { /* */ }\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 20)\n" +
+ " if (o == null) { /* */ }\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -11272,10 +11272,10 @@ public void test2010_flow_info() {
" ^\n" +
"Null comparison always yields false: The variable o cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 21)\n" +
- " if (o == null) { /* */ }\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 21)\n" +
+ " if (o == null) { /* */ }\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -11317,10 +11317,10 @@ public void test2011_flow_info() {
" ^\n" +
"Null comparison always yields false: The variable o cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 24)\n" +
- " if (o == null) { /* */ }\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 24)\n" +
+ " if (o == null) { /* */ }\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -11362,10 +11362,10 @@ public void test2012_flow_info() {
" ^\n" +
"Null comparison always yields false: The variable o cannot be null at this location\n" +
"----------\n" +
- "2. WARNING in X.java (at line 24)\n" +
- " if (o == null) { /* */ }\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
+ "2. WARNING in X.java (at line 24)\n" +
+ " if (o == null) { /* */ }\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -11511,11 +11511,11 @@ public void test2015_flow_info() {
" System.out.println((new Inner()).bar());\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 34)\n" +
- " final int m164;\n" +
- " ^^^^\n" +
- "The blank final field m164 may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 34)\n" +
+ " final int m164;\n" +
+ " ^^^^\n" +
+ "The blank final field m164 may not have been initialized\n" +
"----------\n");
}
@@ -11820,16 +11820,16 @@ public void testBug291418b() {
" }\n" +
" }\n" +
"}"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (collectionVar == null);\n" +
- " ^^^^^^^^^^^^^\n" +
- "Null comparison always yields false: The variable collectionVar cannot be null at this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " if (argArray == null);\n" +
- " ^^^^^^^^\n" +
- "Null comparison always yields false: The variable argArray cannot be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " if (collectionVar == null);\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Null comparison always yields false: The variable collectionVar cannot be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " if (argArray == null);\n" +
+ " ^^^^^^^^\n" +
+ "Null comparison always yields false: The variable argArray cannot be null at this location\n" +
"----------\n");
}
}
@@ -11846,20 +11846,20 @@ public void testBug293917a() {
" String x = null, y = null;\n" +
" if (x == null) x = \"foo\";\n" +
" if (x != null) y = \"bar\";\n" +
- " x.length();\n" + // shouldn't warn here
+ " x.length();\n" + // shouldn't warn here
" y.length();\n" + // shouldn't warn here
" }\n" +
"}\n"},
"----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (x == null) x = \"foo\";\n" +
- " ^\n" +
- "Redundant null check: The variable x can only be null at this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " if (x != null) y = \"bar\";\n" +
- " ^\n" +
- "Redundant null check: The variable x cannot be null at this location\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " if (x == null) x = \"foo\";\n" +
+ " ^\n" +
+ "Redundant null check: The variable x can only be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " if (x != null) y = \"bar\";\n" +
+ " ^\n" +
+ "Redundant null check: The variable x cannot be null at this location\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -11877,16 +11877,16 @@ public void testBug293917b() {
" while(true) {\n" +
" if (x == null) x = \"foo\";\n" +
" if (x != null) y = \"bar\";\n" +
- " x.length();\n" + // shouldn't warn here
+ " x.length();\n" + // shouldn't warn here
" y.length();\n" + // shouldn't warn here
" }\n" +
" }\n" +
"}\n"},
"----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " if (x != null) y = \"bar\";\n" +
- " ^\n" +
- "Redundant null check: The variable x cannot be null at this location\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " if (x != null) y = \"bar\";\n" +
+ " ^\n" +
+ "Redundant null check: The variable x cannot be null at this location\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -11905,21 +11905,21 @@ public void testBug293917c() {
" finally {\n" +
" if (x == null) x = \"foo\";\n" +
" if (x != null) y = \"bar\";\n" +
- " x.length();\n" + // shouldn't warn here
+ " x.length();\n" + // shouldn't warn here
" y.length();\n" + // shouldn't warn here
" }\n" +
" }\n" +
"}\n"},
"----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " if (x == null) x = \"foo\";\n" +
- " ^\n" +
- "Redundant null check: The variable x can only be null at this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " if (x != null) y = \"bar\";\n" +
- " ^\n" +
- "Redundant null check: The variable x cannot be null at this location\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " if (x == null) x = \"foo\";\n" +
+ " ^\n" +
+ "Redundant null check: The variable x can only be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " if (x != null) y = \"bar\";\n" +
+ " ^\n" +
+ "Redundant null check: The variable x cannot be null at this location\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -11951,21 +11951,21 @@ public void testBug190623() {
" }\n" +
"}\n"},
"----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (d != null && d.isNaN()) {\n" +
- " ^\n" +
- "Redundant null check: The variable d cannot be null at this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " if (d != null && d.isNaN()) {\n" +
- " ^\n" +
- "Redundant null check: The variable d cannot be null at this location\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " if (d != null && d.isNaN()) {\n" +
+ " ^\n" +
+ "Redundant null check: The variable d cannot be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " if (d != null && d.isNaN()) {\n" +
+ " ^\n" +
+ "Redundant null check: The variable d cannot be null at this location\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=299900
-//Test to verify that null checks are properly reported for the variable(s)
+//Test to verify that null checks are properly reported for the variable(s)
//in the right expression of an OR condition statement.
public void testBug299900a() {
runNegativeNullTest(
@@ -11988,12 +11988,12 @@ public void testBug299900a() {
"2. ERROR in X.java (at line 5)\n" +
" System.out.println(bar.toString());\n" +
" ^^^\n" +
- "Potential null pointer access: The variable bar may be null at this location\n" +
+ "Potential null pointer access: The variable bar may be null at this location\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=299900
-//Test to verify that null checks are properly reported for the variable(s)
+//Test to verify that null checks are properly reported for the variable(s)
//in the right expression of an OR condition statement.
public void testBug299900b() {
runNegativeNullTest(
@@ -12007,7 +12007,7 @@ public void testBug299900b() {
" System.out.println(bar.toString());\n" +
" }\n" +
"}"},
- "----------\n" +
+ "----------\n" +
"1. ERROR in X.java (at line 5)\n" +
" System.out.println(foo.toString());\n" +
" ^^^\n" +
@@ -12016,7 +12016,7 @@ public void testBug299900b() {
"2. ERROR in X.java (at line 6)\n" +
" System.out.println(bar.toString());\n" +
" ^^^\n" +
- "Potential null pointer access: The variable bar may be null at this location\n" +
+ "Potential null pointer access: The variable bar may be null at this location\n" +
"----------\n");
}
@@ -12043,30 +12043,30 @@ public void testBug253896a() {
" }\n" +
"}"},
"----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if(f1 == 1)\n" +
- " ^^\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " if(f1 == 1)\n" +
+ " ^^\n" +
"Null pointer access: This expression of type Integer is null but requires auto-unboxing\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " int abc = (f2 != 1)? 1 : 0;\n" +
- " ^^\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " int abc = (f2 != 1)? 1 : 0;\n" +
+ " ^^\n" +
"Null pointer access: This expression of type Integer is null but requires auto-unboxing\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " if(f3 == null)\n" +
- " ^^\n" +
- "Redundant null check: The variable f3 can only be null at this location\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 12)\n" +
- " if(f4 != null)\n" +
- " ^^\n" +
- "Null comparison always yields false: The variable f4 can only be null at this location\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 13)\n" +
- " System.out.println(\"f4 is not null\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 9)\n" +
+ " if(f3 == null)\n" +
+ " ^^\n" +
+ "Redundant null check: The variable f3 can only be null at this location\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 12)\n" +
+ " if(f4 != null)\n" +
+ " ^^\n" +
+ "Null comparison always yields false: The variable f4 can only be null at this location\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 13)\n" +
+ " System.out.println(\"f4 is not null\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n");
}
}
@@ -12132,40 +12132,40 @@ public void testBug253896c() {
" }\n" +
"}"},
"----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " if(f1 == 1)\n" +
- " ^^\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " if(f1 == 1)\n" +
+ " ^^\n" +
"Null pointer access: This expression of type Integer is null but requires auto-unboxing\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " int abc = (f2 != 1)? 1 : 0;\n" +
- " ^^\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " int abc = (f2 != 1)? 1 : 0;\n" +
+ " ^^\n" +
"Null pointer access: This expression of type Integer is null but requires auto-unboxing\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 12)\n" +
- " if(f3 == null)\n" +
- " ^^\n" +
- "Redundant null check: The variable f3 can only be null at this location\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 15)\n" +
- " if(f4 != null)\n" +
- " ^^\n" +
- "Null comparison always yields false: The variable f4 can only be null at this location\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 16)\n" +
- " System.out.println(\"f4 is not null\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 17)\n" +
- " if(a == 1) {}\n" +
- " ^\n" +
- "Null pointer access: This expression of type Integer is null but requires auto-unboxing\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 18)\n" +
- " if(outer2 == 1) {}\n" +
- " ^^^^^^\n" +
- "Potential null pointer access: This expression of type Integer may be null but requires auto-unboxing\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 12)\n" +
+ " if(f3 == null)\n" +
+ " ^^\n" +
+ "Redundant null check: The variable f3 can only be null at this location\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 15)\n" +
+ " if(f4 != null)\n" +
+ " ^^\n" +
+ "Null comparison always yields false: The variable f4 can only be null at this location\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 16)\n" +
+ " System.out.println(\"f4 is not null\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 17)\n" +
+ " if(a == 1) {}\n" +
+ " ^\n" +
+ "Null pointer access: This expression of type Integer is null but requires auto-unboxing\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 18)\n" +
+ " if(outer2 == 1) {}\n" +
+ " ^^^^^^\n" +
+ "Potential null pointer access: This expression of type Integer may be null but requires auto-unboxing\n" +
"----------\n");
}
}
@@ -12200,39 +12200,39 @@ public void testBug253896d() {
" }\n" +
"}"},
"----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " if(f1 == 1)\n" +
- " ^^\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " if(f1 == 1)\n" +
+ " ^^\n" +
"Null pointer access: This expression of type Integer is null but requires auto-unboxing\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " int abc = (f2 != 1)? 1 : 0;\n" +
- " ^^\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " int abc = (f2 != 1)? 1 : 0;\n" +
+ " ^^\n" +
"Null pointer access: This expression of type Integer is null but requires auto-unboxing\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 13)\n" +
- " if(f3 == null)\n" +
- " ^^\n" +
- "Redundant null check: The variable f3 can only be null at this location\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 16)\n" +
- " if(f4 != null)\n" +
- " ^^\n" +
- "Null comparison always yields false: The variable f4 can only be null at this location\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 17)\n" +
- " System.out.println(\"f4 is not null\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 18)\n" +
- " if(outer == 1) {}\n" +
- " ^^^^^\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 13)\n" +
+ " if(f3 == null)\n" +
+ " ^^\n" +
+ "Redundant null check: The variable f3 can only be null at this location\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 16)\n" +
+ " if(f4 != null)\n" +
+ " ^^\n" +
+ "Null comparison always yields false: The variable f4 can only be null at this location\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 17)\n" +
+ " System.out.println(\"f4 is not null\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 18)\n" +
+ " if(outer == 1) {}\n" +
+ " ^^^^^\n" +
"Null pointer access: This expression of type Integer is null but requires auto-unboxing\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 19)\n" +
- " if(param == 1) {}\n" +
- " ^^^^^\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 19)\n" +
+ " if(param == 1) {}\n" +
+ " ^^^^^\n" +
"Potential null pointer access: This expression of type Integer may be null but requires auto-unboxing\n" +
"----------\n");
}
@@ -12278,176 +12278,176 @@ public void testBug303448a() throws Exception {
null,
options,
null); // custom requestor
-
+
String expectedOutput = this.complianceLevel < ClassFileConstants.JDK1_5?
- " // Method descriptor #11 ()V\n" +
- " // Stack: 2, Locals: 3\n" +
- " public void foo();\n" +
- " 0 aconst_null\n" +
- " 1 astore_1 [foo]\n" +
- " 2 aconst_null\n" +
- " 3 astore_2 [foo2]\n" +
- " 4 getstatic X.$assertionsDisabled : boolean [38]\n" +
- " 7 ifne 26\n" +
- " 10 aload_1 [foo]\n" +
- " 11 ifnull 18\n" +
- " 14 aload_2 [foo2]\n" +
- " 15 ifnonnull 26\n" +
- " 18 new java.lang.AssertionError [49]\n" +
- " 21 dup\n" +
- " 22 invokespecial java.lang.AssertionError() [51]\n" +
- " 25 athrow\n" +
- " 26 aload_1 [foo]\n" +
- " 27 ifnull 41\n" +
- " 30 getstatic java.lang.System.out : java.io.PrintStream [52]\n" +
- " 33 ldc <String \"foo is not null\"> [58]\n" +
- " 35 invokevirtual java.io.PrintStream.println(java.lang.String) : void [60]\n" +
- " 38 goto 49\n" +
- " 41 getstatic java.lang.System.out : java.io.PrintStream [52]\n" +
- " 44 ldc <String \"foo is null\"> [65]\n" +
- " 46 invokevirtual java.io.PrintStream.println(java.lang.String) : void [60]\n" +
- " 49 aload_2 [foo2]\n" +
- " 50 ifnull 64\n" +
- " 53 getstatic java.lang.System.out : java.io.PrintStream [52]\n" +
- " 56 ldc <String \"foo2 is not null\"> [67]\n" +
- " 58 invokevirtual java.io.PrintStream.println(java.lang.String) : void [60]\n" +
- " 61 goto 72\n" +
- " 64 getstatic java.lang.System.out : java.io.PrintStream [52]\n" +
- " 67 ldc <String \"foo2 is null\"> [69]\n" +
- " 69 invokevirtual java.io.PrintStream.println(java.lang.String) : void [60]\n" +
- " 72 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
- " [pc: 2, line: 4]\n" +
- " [pc: 4, line: 7]\n" +
- " [pc: 26, line: 8]\n" +
- " [pc: 30, line: 9]\n" +
- " [pc: 38, line: 10]\n" +
- " [pc: 41, line: 11]\n" +
- " [pc: 49, line: 13]\n" +
- " [pc: 53, line: 14]\n" +
- " [pc: 61, line: 15]\n" +
- " [pc: 64, line: 16]\n" +
- " [pc: 72, line: 19]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 73] local: this index: 0 type: X\n" +
- " [pc: 2, pc: 73] local: foo index: 1 type: java.lang.Object\n" +
+ " // Method descriptor #11 ()V\n" +
+ " // Stack: 2, Locals: 3\n" +
+ " public void foo();\n" +
+ " 0 aconst_null\n" +
+ " 1 astore_1 [foo]\n" +
+ " 2 aconst_null\n" +
+ " 3 astore_2 [foo2]\n" +
+ " 4 getstatic X.$assertionsDisabled : boolean [38]\n" +
+ " 7 ifne 26\n" +
+ " 10 aload_1 [foo]\n" +
+ " 11 ifnull 18\n" +
+ " 14 aload_2 [foo2]\n" +
+ " 15 ifnonnull 26\n" +
+ " 18 new java.lang.AssertionError [49]\n" +
+ " 21 dup\n" +
+ " 22 invokespecial java.lang.AssertionError() [51]\n" +
+ " 25 athrow\n" +
+ " 26 aload_1 [foo]\n" +
+ " 27 ifnull 41\n" +
+ " 30 getstatic java.lang.System.out : java.io.PrintStream [52]\n" +
+ " 33 ldc <String \"foo is not null\"> [58]\n" +
+ " 35 invokevirtual java.io.PrintStream.println(java.lang.String) : void [60]\n" +
+ " 38 goto 49\n" +
+ " 41 getstatic java.lang.System.out : java.io.PrintStream [52]\n" +
+ " 44 ldc <String \"foo is null\"> [65]\n" +
+ " 46 invokevirtual java.io.PrintStream.println(java.lang.String) : void [60]\n" +
+ " 49 aload_2 [foo2]\n" +
+ " 50 ifnull 64\n" +
+ " 53 getstatic java.lang.System.out : java.io.PrintStream [52]\n" +
+ " 56 ldc <String \"foo2 is not null\"> [67]\n" +
+ " 58 invokevirtual java.io.PrintStream.println(java.lang.String) : void [60]\n" +
+ " 61 goto 72\n" +
+ " 64 getstatic java.lang.System.out : java.io.PrintStream [52]\n" +
+ " 67 ldc <String \"foo2 is null\"> [69]\n" +
+ " 69 invokevirtual java.io.PrintStream.println(java.lang.String) : void [60]\n" +
+ " 72 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
+ " [pc: 2, line: 4]\n" +
+ " [pc: 4, line: 7]\n" +
+ " [pc: 26, line: 8]\n" +
+ " [pc: 30, line: 9]\n" +
+ " [pc: 38, line: 10]\n" +
+ " [pc: 41, line: 11]\n" +
+ " [pc: 49, line: 13]\n" +
+ " [pc: 53, line: 14]\n" +
+ " [pc: 61, line: 15]\n" +
+ " [pc: 64, line: 16]\n" +
+ " [pc: 72, line: 19]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 73] local: this index: 0 type: X\n" +
+ " [pc: 2, pc: 73] local: foo index: 1 type: java.lang.Object\n" +
" [pc: 4, pc: 73] local: foo2 index: 2 type: java.lang.Object\n"
: this.complianceLevel < ClassFileConstants.JDK1_6?
- " // Method descriptor #8 ()V\n" +
- " // Stack: 2, Locals: 3\n" +
- " public void foo();\n" +
- " 0 aconst_null\n" +
- " 1 astore_1 [foo]\n" +
- " 2 aconst_null\n" +
- " 3 astore_2 [foo2]\n" +
- " 4 getstatic X.$assertionsDisabled : boolean [16]\n" +
- " 7 ifne 26\n" +
- " 10 aload_1 [foo]\n" +
- " 11 ifnull 18\n" +
- " 14 aload_2 [foo2]\n" +
- " 15 ifnonnull 26\n" +
- " 18 new java.lang.AssertionError [26]\n" +
- " 21 dup\n" +
- " 22 invokespecial java.lang.AssertionError() [28]\n" +
- " 25 athrow\n" +
- " 26 aload_1 [foo]\n" +
- " 27 ifnull 41\n" +
- " 30 getstatic java.lang.System.out : java.io.PrintStream [29]\n" +
- " 33 ldc <String \"foo is not null\"> [35]\n" +
- " 35 invokevirtual java.io.PrintStream.println(java.lang.String) : void [37]\n" +
- " 38 goto 49\n" +
- " 41 getstatic java.lang.System.out : java.io.PrintStream [29]\n" +
- " 44 ldc <String \"foo is null\"> [43]\n" +
- " 46 invokevirtual java.io.PrintStream.println(java.lang.String) : void [37]\n" +
- " 49 aload_2 [foo2]\n" +
- " 50 ifnull 64\n" +
- " 53 getstatic java.lang.System.out : java.io.PrintStream [29]\n" +
- " 56 ldc <String \"foo2 is not null\"> [45]\n" +
- " 58 invokevirtual java.io.PrintStream.println(java.lang.String) : void [37]\n" +
- " 61 goto 72\n" +
- " 64 getstatic java.lang.System.out : java.io.PrintStream [29]\n" +
- " 67 ldc <String \"foo2 is null\"> [47]\n" +
- " 69 invokevirtual java.io.PrintStream.println(java.lang.String) : void [37]\n" +
- " 72 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
- " [pc: 2, line: 4]\n" +
- " [pc: 4, line: 7]\n" +
- " [pc: 26, line: 8]\n" +
- " [pc: 30, line: 9]\n" +
- " [pc: 38, line: 10]\n" +
- " [pc: 41, line: 11]\n" +
- " [pc: 49, line: 13]\n" +
- " [pc: 53, line: 14]\n" +
- " [pc: 61, line: 15]\n" +
- " [pc: 64, line: 16]\n" +
- " [pc: 72, line: 19]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 73] local: this index: 0 type: X\n" +
- " [pc: 2, pc: 73] local: foo index: 1 type: java.lang.Object\n" +
+ " // Method descriptor #8 ()V\n" +
+ " // Stack: 2, Locals: 3\n" +
+ " public void foo();\n" +
+ " 0 aconst_null\n" +
+ " 1 astore_1 [foo]\n" +
+ " 2 aconst_null\n" +
+ " 3 astore_2 [foo2]\n" +
+ " 4 getstatic X.$assertionsDisabled : boolean [16]\n" +
+ " 7 ifne 26\n" +
+ " 10 aload_1 [foo]\n" +
+ " 11 ifnull 18\n" +
+ " 14 aload_2 [foo2]\n" +
+ " 15 ifnonnull 26\n" +
+ " 18 new java.lang.AssertionError [26]\n" +
+ " 21 dup\n" +
+ " 22 invokespecial java.lang.AssertionError() [28]\n" +
+ " 25 athrow\n" +
+ " 26 aload_1 [foo]\n" +
+ " 27 ifnull 41\n" +
+ " 30 getstatic java.lang.System.out : java.io.PrintStream [29]\n" +
+ " 33 ldc <String \"foo is not null\"> [35]\n" +
+ " 35 invokevirtual java.io.PrintStream.println(java.lang.String) : void [37]\n" +
+ " 38 goto 49\n" +
+ " 41 getstatic java.lang.System.out : java.io.PrintStream [29]\n" +
+ " 44 ldc <String \"foo is null\"> [43]\n" +
+ " 46 invokevirtual java.io.PrintStream.println(java.lang.String) : void [37]\n" +
+ " 49 aload_2 [foo2]\n" +
+ " 50 ifnull 64\n" +
+ " 53 getstatic java.lang.System.out : java.io.PrintStream [29]\n" +
+ " 56 ldc <String \"foo2 is not null\"> [45]\n" +
+ " 58 invokevirtual java.io.PrintStream.println(java.lang.String) : void [37]\n" +
+ " 61 goto 72\n" +
+ " 64 getstatic java.lang.System.out : java.io.PrintStream [29]\n" +
+ " 67 ldc <String \"foo2 is null\"> [47]\n" +
+ " 69 invokevirtual java.io.PrintStream.println(java.lang.String) : void [37]\n" +
+ " 72 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
+ " [pc: 2, line: 4]\n" +
+ " [pc: 4, line: 7]\n" +
+ " [pc: 26, line: 8]\n" +
+ " [pc: 30, line: 9]\n" +
+ " [pc: 38, line: 10]\n" +
+ " [pc: 41, line: 11]\n" +
+ " [pc: 49, line: 13]\n" +
+ " [pc: 53, line: 14]\n" +
+ " [pc: 61, line: 15]\n" +
+ " [pc: 64, line: 16]\n" +
+ " [pc: 72, line: 19]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 73] local: this index: 0 type: X\n" +
+ " [pc: 2, pc: 73] local: foo index: 1 type: java.lang.Object\n" +
" [pc: 4, pc: 73] local: foo2 index: 2 type: java.lang.Object\n"
- : " // Method descriptor #8 ()V\n" +
- " // Stack: 2, Locals: 3\n" +
- " public void foo();\n" +
- " 0 aconst_null\n" +
- " 1 astore_1 [foo]\n" +
- " 2 aconst_null\n" +
- " 3 astore_2 [foo2]\n" +
- " 4 getstatic X.$assertionsDisabled : boolean [16]\n" +
- " 7 ifne 26\n" +
- " 10 aload_1 [foo]\n" +
- " 11 ifnull 18\n" +
- " 14 aload_2 [foo2]\n" +
- " 15 ifnonnull 26\n" +
- " 18 new java.lang.AssertionError [27]\n" +
- " 21 dup\n" +
- " 22 invokespecial java.lang.AssertionError() [29]\n" +
- " 25 athrow\n" +
- " 26 aload_1 [foo]\n" +
- " 27 ifnull 41\n" +
- " 30 getstatic java.lang.System.out : java.io.PrintStream [30]\n" +
- " 33 ldc <String \"foo is not null\"> [36]\n" +
- " 35 invokevirtual java.io.PrintStream.println(java.lang.String) : void [38]\n" +
- " 38 goto 49\n" +
- " 41 getstatic java.lang.System.out : java.io.PrintStream [30]\n" +
- " 44 ldc <String \"foo is null\"> [44]\n" +
- " 46 invokevirtual java.io.PrintStream.println(java.lang.String) : void [38]\n" +
- " 49 aload_2 [foo2]\n" +
- " 50 ifnull 64\n" +
- " 53 getstatic java.lang.System.out : java.io.PrintStream [30]\n" +
- " 56 ldc <String \"foo2 is not null\"> [46]\n" +
- " 58 invokevirtual java.io.PrintStream.println(java.lang.String) : void [38]\n" +
- " 61 goto 72\n" +
- " 64 getstatic java.lang.System.out : java.io.PrintStream [30]\n" +
- " 67 ldc <String \"foo2 is null\"> [48]\n" +
- " 69 invokevirtual java.io.PrintStream.println(java.lang.String) : void [38]\n" +
- " 72 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
- " [pc: 2, line: 4]\n" +
- " [pc: 4, line: 7]\n" +
- " [pc: 26, line: 8]\n" +
- " [pc: 30, line: 9]\n" +
- " [pc: 38, line: 10]\n" +
- " [pc: 41, line: 11]\n" +
- " [pc: 49, line: 13]\n" +
- " [pc: 53, line: 14]\n" +
- " [pc: 61, line: 15]\n" +
- " [pc: 64, line: 16]\n" +
- " [pc: 72, line: 19]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 73] local: this index: 0 type: X\n" +
- " [pc: 2, pc: 73] local: foo index: 1 type: java.lang.Object\n" +
- " [pc: 4, pc: 73] local: foo2 index: 2 type: java.lang.Object\n" +
- " Stack map table: number of frames 6\n" +
- " [pc: 18, append: {java.lang.Object, java.lang.Object}]\n" +
- " [pc: 26, same]\n" +
- " [pc: 41, same]\n" +
- " [pc: 49, same]\n" +
- " [pc: 64, same]\n" +
+ : " // Method descriptor #8 ()V\n" +
+ " // Stack: 2, Locals: 3\n" +
+ " public void foo();\n" +
+ " 0 aconst_null\n" +
+ " 1 astore_1 [foo]\n" +
+ " 2 aconst_null\n" +
+ " 3 astore_2 [foo2]\n" +
+ " 4 getstatic X.$assertionsDisabled : boolean [16]\n" +
+ " 7 ifne 26\n" +
+ " 10 aload_1 [foo]\n" +
+ " 11 ifnull 18\n" +
+ " 14 aload_2 [foo2]\n" +
+ " 15 ifnonnull 26\n" +
+ " 18 new java.lang.AssertionError [27]\n" +
+ " 21 dup\n" +
+ " 22 invokespecial java.lang.AssertionError() [29]\n" +
+ " 25 athrow\n" +
+ " 26 aload_1 [foo]\n" +
+ " 27 ifnull 41\n" +
+ " 30 getstatic java.lang.System.out : java.io.PrintStream [30]\n" +
+ " 33 ldc <String \"foo is not null\"> [36]\n" +
+ " 35 invokevirtual java.io.PrintStream.println(java.lang.String) : void [38]\n" +
+ " 38 goto 49\n" +
+ " 41 getstatic java.lang.System.out : java.io.PrintStream [30]\n" +
+ " 44 ldc <String \"foo is null\"> [44]\n" +
+ " 46 invokevirtual java.io.PrintStream.println(java.lang.String) : void [38]\n" +
+ " 49 aload_2 [foo2]\n" +
+ " 50 ifnull 64\n" +
+ " 53 getstatic java.lang.System.out : java.io.PrintStream [30]\n" +
+ " 56 ldc <String \"foo2 is not null\"> [46]\n" +
+ " 58 invokevirtual java.io.PrintStream.println(java.lang.String) : void [38]\n" +
+ " 61 goto 72\n" +
+ " 64 getstatic java.lang.System.out : java.io.PrintStream [30]\n" +
+ " 67 ldc <String \"foo2 is null\"> [48]\n" +
+ " 69 invokevirtual java.io.PrintStream.println(java.lang.String) : void [38]\n" +
+ " 72 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
+ " [pc: 2, line: 4]\n" +
+ " [pc: 4, line: 7]\n" +
+ " [pc: 26, line: 8]\n" +
+ " [pc: 30, line: 9]\n" +
+ " [pc: 38, line: 10]\n" +
+ " [pc: 41, line: 11]\n" +
+ " [pc: 49, line: 13]\n" +
+ " [pc: 53, line: 14]\n" +
+ " [pc: 61, line: 15]\n" +
+ " [pc: 64, line: 16]\n" +
+ " [pc: 72, line: 19]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 73] local: this index: 0 type: X\n" +
+ " [pc: 2, pc: 73] local: foo index: 1 type: java.lang.Object\n" +
+ " [pc: 4, pc: 73] local: foo2 index: 2 type: java.lang.Object\n" +
+ " Stack map table: number of frames 6\n" +
+ " [pc: 18, append: {java.lang.Object, java.lang.Object}]\n" +
+ " [pc: 26, same]\n" +
+ " [pc: 41, same]\n" +
+ " [pc: 49, same]\n" +
+ " [pc: 64, same]\n" +
" [pc: 72, same]\n";
-
+
File f = new File(OUTPUT_DIR + File.separator + "X.class");
byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
@@ -12505,15 +12505,15 @@ public void testBug304416() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " String s = null;\n" +
- " String s2 = null;\n" +
- " if (s != null && s2 != null) {\n" +
- " System.out.println(s);\n" +
- " System.out.println(s2);\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " String s = null;\n" +
+ " String s2 = null;\n" +
+ " if (s != null && s2 != null) {\n" +
+ " System.out.println(s);\n" +
+ " System.out.println(s2);\n" +
+ " }\n" +
+ " }\n" +
"}",
},
"",
@@ -12523,21 +12523,21 @@ public void testBug304416() throws Exception {
options,
null);
String expectedOutput =
- " public static void main(java.lang.String[] args);\n" +
- " 0 aconst_null\n" +
- " 1 astore_1 [s]\n" +
- " 2 aconst_null\n" +
- " 3 astore_2 [s2]\n" +
- " 4 aload_1 [s]\n" +
- " 5 ifnull 26\n" +
- " 8 aload_2 [s2]\n" +
- " 9 ifnull 26\n" +
- " 12 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 15 aload_1 [s]\n" +
- " 16 invokevirtual java.io.PrintStream.println(java.lang.String) : void [22]\n" +
- " 19 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 22 aload_2 [s2]\n" +
- " 23 invokevirtual java.io.PrintStream.println(java.lang.String) : void [22]\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 aconst_null\n" +
+ " 1 astore_1 [s]\n" +
+ " 2 aconst_null\n" +
+ " 3 astore_2 [s2]\n" +
+ " 4 aload_1 [s]\n" +
+ " 5 ifnull 26\n" +
+ " 8 aload_2 [s2]\n" +
+ " 9 ifnull 26\n" +
+ " 12 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 15 aload_1 [s]\n" +
+ " 16 invokevirtual java.io.PrintStream.println(java.lang.String) : void [22]\n" +
+ " 19 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 22 aload_2 [s2]\n" +
+ " 23 invokevirtual java.io.PrintStream.println(java.lang.String) : void [22]\n" +
" 26 return\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
}
@@ -12560,10 +12560,10 @@ public void testBug305590() {
" }\n" +
"}"},
"----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " if (str instanceof String) {}\n" +
- " ^^^\n" +
- "instanceof always yields false: The variable str can only be null at this location\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " if (str instanceof String) {}\n" +
+ " ^^^\n" +
+ "instanceof always yields false: The variable str can only be null at this location\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -12582,11 +12582,11 @@ public void testBug319201() {
" int j = i;\n" + // should warn
" }\n" +
"}"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " int j = i;\n" +
- " ^\n" +
- "Null pointer access: This expression of type Integer is null but requires auto-unboxing\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " int j = i;\n" +
+ " ^\n" +
+ "Null pointer access: This expression of type Integer is null but requires auto-unboxing\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -12606,11 +12606,11 @@ public void testBug319201a() {
" j = i;\n" + // should warn
" }\n" +
"}"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " j = i;\n" +
- " ^\n" +
- "Potential null pointer access: This expression of type Integer may be null but requires auto-unboxing\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " j = i;\n" +
+ " ^\n" +
+ "Potential null pointer access: This expression of type Integer may be null but requires auto-unboxing\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -12630,11 +12630,11 @@ public void testBug319201b() {
" }\n" +
" void bar(boolean b) {}\n" +
"}"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " bar(bo);\n" +
- " ^^\n" +
- "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " bar(bo);\n" +
+ " ^^\n" +
+ "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -12703,81 +12703,81 @@ public void testBug319201c() {
" return b11;\n" +
" }\n" +
"}"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " super(b2 == null, b2);\n" +
- " ^^\n" +
- "Potential null pointer access: This expression of type Boolean may be null but requires auto-unboxing\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " boolean fB = (Boolean)null;\n" +
- " ^^^^^^^^^^^^^\n" +
- "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 12)\n" +
- " X x = new X(b1, null);\n" +
- " ^^\n" +
- "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 14)\n" +
- " boolean dontcare = b2 && inB;\n" +
- " ^^\n" +
- "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 16)\n" +
- " dontcare = inB || b3;\n" +
- " ^^\n" +
- "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 18)\n" +
- " char[] cs = new char[dims];\n" +
- " ^^^^\n" +
- "Null pointer access: This expression of type Integer is null but requires auto-unboxing\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 22)\n" +
- " for (int i=0;b4; i++);\n" +
- " ^^\n" +
- "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 23)\n" +
- " } while (b5);\n" +
- " ^^\n" +
- "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 25)\n" +
- " if (b6) { }\n" +
- " ^^\n" +
- "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 27)\n" +
- " Z z = this.new Z(b7);\n" +
- " ^^\n" +
- "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
- "----------\n" +
- "11. ERROR in X.java (at line 29)\n" +
- " switch(sel) {\n" +
- " ^^^\n" +
- "Null pointer access: This expression of type Integer is null but requires auto-unboxing\n" +
- "----------\n" +
- "12. ERROR in X.java (at line 34)\n" +
- " while (b8) {}\n" +
- " ^^\n" +
- "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
- "----------\n" +
- "13. ERROR in X.java (at line 36)\n" +
- " dontcare = (boolean)b9;\n" +
- " ^^\n" +
- "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
- "----------\n" +
- "14. ERROR in X.java (at line 38)\n" +
- " assert b10 : \"shouldn\'t happen, but will\";\n" +
- " ^^^\n" +
- "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
- "----------\n" +
- "15. ERROR in X.java (at line 40)\n" +
- " return b11;\n" +
- " ^^^\n" +
- "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " super(b2 == null, b2);\n" +
+ " ^^\n" +
+ "Potential null pointer access: This expression of type Boolean may be null but requires auto-unboxing\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " boolean fB = (Boolean)null;\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 12)\n" +
+ " X x = new X(b1, null);\n" +
+ " ^^\n" +
+ "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 14)\n" +
+ " boolean dontcare = b2 && inB;\n" +
+ " ^^\n" +
+ "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 16)\n" +
+ " dontcare = inB || b3;\n" +
+ " ^^\n" +
+ "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 18)\n" +
+ " char[] cs = new char[dims];\n" +
+ " ^^^^\n" +
+ "Null pointer access: This expression of type Integer is null but requires auto-unboxing\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 22)\n" +
+ " for (int i=0;b4; i++);\n" +
+ " ^^\n" +
+ "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 23)\n" +
+ " } while (b5);\n" +
+ " ^^\n" +
+ "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 25)\n" +
+ " if (b6) { }\n" +
+ " ^^\n" +
+ "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
+ "----------\n" +
+ "10. ERROR in X.java (at line 27)\n" +
+ " Z z = this.new Z(b7);\n" +
+ " ^^\n" +
+ "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
+ "----------\n" +
+ "11. ERROR in X.java (at line 29)\n" +
+ " switch(sel) {\n" +
+ " ^^^\n" +
+ "Null pointer access: This expression of type Integer is null but requires auto-unboxing\n" +
+ "----------\n" +
+ "12. ERROR in X.java (at line 34)\n" +
+ " while (b8) {}\n" +
+ " ^^\n" +
+ "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
+ "----------\n" +
+ "13. ERROR in X.java (at line 36)\n" +
+ " dontcare = (boolean)b9;\n" +
+ " ^^\n" +
+ "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
+ "----------\n" +
+ "14. ERROR in X.java (at line 38)\n" +
+ " assert b10 : \"shouldn\'t happen, but will\";\n" +
+ " ^^^\n" +
+ "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
+ "----------\n" +
+ "15. ERROR in X.java (at line 40)\n" +
+ " return b11;\n" +
+ " ^^^\n" +
+ "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -12818,7 +12818,7 @@ public void testBug319201d() {
" Boolean b5 = null;\n" +
" do {\n" +
" b5 = true;\n" +
- " } while (b5);\n" + // don't complain
+ " } while (b5);\n" + // don't complain
" Boolean b6 = null;\n" +
" do {\n" +
" b6 = true;\n" +
@@ -12836,21 +12836,21 @@ public void testBug319201d() {
" } while (b7);\n" + // complain here: after else branch b7 can still be null
" }\n" +
"}"},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " } while (b2);\n" +
- " ^^\n" +
- "Potential null pointer access: This expression of type Boolean may be null but requires auto-unboxing\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 15)\n" +
- " } while (b3);\n" +
- " ^^\n" +
- "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 42)\n" +
- " } while (b7);\n" +
- " ^^\n" +
- "Potential null pointer access: This expression of type Boolean may be null but requires auto-unboxing\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " } while (b2);\n" +
+ " ^^\n" +
+ "Potential null pointer access: This expression of type Boolean may be null but requires auto-unboxing\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 15)\n" +
+ " } while (b3);\n" +
+ " ^^\n" +
+ "Null pointer access: This expression of type Boolean is null but requires auto-unboxing\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 42)\n" +
+ " } while (b7);\n" +
+ " ^^\n" +
+ "Potential null pointer access: This expression of type Boolean may be null but requires auto-unboxing\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -12868,23 +12868,23 @@ public void testBug320414() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " static class B {\n" +
- " public static final int CONST = 16;\n" +
- " int i;\n" +
- " }\n" +
- " B b;\n" +
- " public static void main(String[] args) {\n" +
- " new X().foo();\n" +
- " }\n" +
- " void foo() {\n" +
- " B localB = b; \n" +
- " int i = localB.CONST;\n" +
- " if (localB != null) {\n" +
- " i = localB.i;\n" +
- " }\n" +
- " System.out.println(i);\n" +
- " }\n" +
+ "public class X {\n" +
+ " static class B {\n" +
+ " public static final int CONST = 16;\n" +
+ " int i;\n" +
+ " }\n" +
+ " B b;\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().foo();\n" +
+ " }\n" +
+ " void foo() {\n" +
+ " B localB = b; \n" +
+ " int i = localB.CONST;\n" +
+ " if (localB != null) {\n" +
+ " i = localB.i;\n" +
+ " }\n" +
+ " System.out.println(i);\n" +
+ " }\n" +
"}",
},
"16",
@@ -12894,20 +12894,20 @@ public void testBug320414() throws Exception {
options,
null);
String expectedOutput =
- " void foo();\n" +
- " 0 aload_0 [this]\n" +
- " 1 getfield X.b : X.B [24]\n" +
- " 4 astore_1 [localB]\n" +
- " 5 bipush 16\n" +
- " 7 istore_2 [i]\n" +
- " 8 aload_1 [localB]\n" +
- " 9 ifnull 17\n" +
- " 12 aload_1 [localB]\n" +
- " 13 getfield X$B.i : int [26]\n" +
- " 16 istore_2 [i]\n" +
- " 17 getstatic java.lang.System.out : java.io.PrintStream [32]\n" +
- " 20 iload_2 [i]\n" +
- " 21 invokevirtual java.io.PrintStream.println(int) : void [38]\n" +
+ " void foo();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 getfield X.b : X.B [24]\n" +
+ " 4 astore_1 [localB]\n" +
+ " 5 bipush 16\n" +
+ " 7 istore_2 [i]\n" +
+ " 8 aload_1 [localB]\n" +
+ " 9 ifnull 17\n" +
+ " 12 aload_1 [localB]\n" +
+ " 13 getfield X$B.i : int [26]\n" +
+ " 16 istore_2 [i]\n" +
+ " 17 getstatic java.lang.System.out : java.io.PrintStream [32]\n" +
+ " 20 iload_2 [i]\n" +
+ " 21 invokevirtual java.io.PrintStream.println(int) : void [38]\n" +
" 24 return\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
}
@@ -13014,11 +13014,11 @@ public void testBug321926b() {
" }\n" +
" }\n" +
"}"},
- "----------\n" +
- "1. ERROR in X.java (at line 15)\n" +
- " System.out.println(\"This is dead code\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unreachable code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 15)\n" +
+ " System.out.println(\"This is dead code\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unreachable code\n" +
"----------\n");
}
// Check nullness in catch block, finally block and downstream code.
@@ -13107,7 +13107,7 @@ public void testBug321926d() {
"}"},
"Compiler good Compiler good Compiler good");
}
-// Test widening catch.
+// Test widening catch.
public void testBug321926e() {
this.runConformTest(
new String[] {
@@ -13272,7 +13272,7 @@ public void testBug321926i() {
"}"},
"Compiler good");
}
-// Test with non-explicit throws, i.e call method which throws rather than an inline throw statement.
+// Test with non-explicit throws, i.e call method which throws rather than an inline throw statement.
public void testBug321926j() {
this.runConformTest(
new String[] {
@@ -13393,19 +13393,19 @@ public void testBug321926l() {
" }\n" +
"}"},
false,
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " someVariable = null;\n" +
- " ^^^^^^^^^^^^\n" +
- "Redundant assignment: The variable someVariable can only be null at this location\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " someVariable = null;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Redundant assignment: The variable someVariable can only be null at this location\n" +
"----------\n",
- "Compiler good Compiler good",
+ "Compiler good Compiler good",
"",
true, // force execution
null, // classlibs
true, // flush output,
null, // vm args
- options,
+ options,
null,
JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
}
@@ -14008,10 +14008,10 @@ public void testBug292478() {
" }\n" +
"}"},
"----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " p.toString();\n" +
- " ^\n" +
- "Potential null pointer access: The variable p may be null at this location\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " p.toString();\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable p may be null at this location\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -14031,10 +14031,10 @@ public void testBug292478a() {
" }\n" +
"}"},
"----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " p.toString();\n" +
- " ^\n" +
- "Potential null pointer access: The variable p may be null at this location\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " p.toString();\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable p may be null at this location\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -14054,10 +14054,10 @@ this.runNegativeTest(
" }\n" +
"}"},
"----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " p.toString();\n" +
- " ^\n" +
- "Potential null pointer access: The variable p may be null at this location\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " p.toString();\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable p may be null at this location\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -14084,10 +14084,10 @@ this.runNegativeTest(
" }\n" +
"}"},
"----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " p.toString();\n" +
- " ^\n" +
- "Potential null pointer access: The variable p may be null at this location\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " p.toString();\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable p may be null at this location\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -14118,11 +14118,11 @@ public void testBug292478d() {
" }\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 17)\n" +
- " y.toString();\n" +
- " ^\n" +
- "Potential null pointer access: The variable y may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 17)\n" +
+ " y.toString();\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable y may be null at this location\n" +
"----------\n");
}
@@ -14435,11 +14435,11 @@ public void testBug325342a() {
" test.foo(null,null, null);\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in Test.java (at line 10)\n" +
- " if (a== null) {}\n" +
- " ^\n" +
- "Redundant null check: The variable a can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 10)\n" +
+ " if (a== null) {}\n" +
+ " ^\n" +
+ "Redundant null check: The variable a can only be null at this location\n" +
"----------\n",
null,
true,
@@ -14485,81 +14485,81 @@ public void testBug325342b() {
" test.foo(null,null,null);\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in Test.java (at line 4)\n" +
- " if (a!=null) {\n" +
- " ^\n" +
- "Null comparison always yields false: The variable a can only be null at this location\n" +
- "----------\n" +
- "2. WARNING in Test.java (at line 4)\n" +
- " if (a!=null) {\n" +
- " System.out.println(\"a is not null\");\n" +
- " } else{\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 10)\n" +
- " if (b!=null) {\n" +
- " ^\n" +
- "Redundant null check: The variable b cannot be null at this location\n" +
- "----------\n" +
- "4. WARNING in Test.java (at line 12)\n" +
- " } else{\n" +
- " System.out.println(\"a is null\");\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 16)\n" +
- " if (c.equals(a)) {\n" +
- " ^\n" +
- "Null pointer access: The variable c can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 4)\n" +
+ " if (a!=null) {\n" +
+ " ^\n" +
+ "Null comparison always yields false: The variable a can only be null at this location\n" +
+ "----------\n" +
+ "2. WARNING in Test.java (at line 4)\n" +
+ " if (a!=null) {\n" +
+ " System.out.println(\"a is not null\");\n" +
+ " } else{\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 10)\n" +
+ " if (b!=null) {\n" +
+ " ^\n" +
+ "Redundant null check: The variable b cannot be null at this location\n" +
+ "----------\n" +
+ "4. WARNING in Test.java (at line 12)\n" +
+ " } else{\n" +
+ " System.out.println(\"a is null\");\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "5. ERROR in Test.java (at line 16)\n" +
+ " if (c.equals(a)) {\n" +
+ " ^\n" +
+ "Null pointer access: The variable c can only be null at this location\n" +
"----------\n",
null, true, compilerOptions, "",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=325755
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=325755
// null analysis -- conditional expression
public void testBug325755a() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static Object foo(String s1, String s2) {\n" +
- " String local1 = s1;\n" +
- " String local2 = s2;\n" +
- " \n" +
- " String local3 = null;\n" +
- " if (local1 != null && local2 != null)\n" +
- " local3 = \"\"; //$NON-NLS-1$\n" +
- " else\n" +
- " local3 = local1 != null ? local1 : local2;\n" +
- "\n" +
- " if (local3 != null)\n" +
- " return new Integer(local3.length());\n" +
- " return null;\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " System.out.print(foo(null, null));\n" +
- " System.out.print(foo(\"p1\", null));\n" +
- " System.out.print(foo(null, \"p2\"));\n" +
- " System.out.print(foo(\"p1\", \"p2\"));\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static Object foo(String s1, String s2) {\n" +
+ " String local1 = s1;\n" +
+ " String local2 = s2;\n" +
+ " \n" +
+ " String local3 = null;\n" +
+ " if (local1 != null && local2 != null)\n" +
+ " local3 = \"\"; //$NON-NLS-1$\n" +
+ " else\n" +
+ " local3 = local1 != null ? local1 : local2;\n" +
+ "\n" +
+ " if (local3 != null)\n" +
+ " return new Integer(local3.length());\n" +
+ " return null;\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.print(foo(null, null));\n" +
+ " System.out.print(foo(\"p1\", null));\n" +
+ " System.out.print(foo(null, \"p2\"));\n" +
+ " System.out.print(foo(\"p1\", \"p2\"));\n" +
+ " }\n" +
"}"},
"null220");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=325755
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=325755
// null analysis -- conditional expression, many locals
public void testBug325755b() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static Object foo(String s1, String s2) {\n" +
+ "public class X {\n" +
+ " public static Object foo(String s1, String s2) {\n" +
" int i00, i01, i02, i03, i04, i05, i06, i07, i08, i09;\n" +
" int i10, i11, i12, i13, i14, i15, i16, i17, i18, i19;\n" +
" int i20, i21, i22, i23, i24, i25, i26, i27, i28, i29;\n" +
@@ -14568,30 +14568,30 @@ public void testBug325755b() {
" int i50, i51, i52, i53, i54, i55, i56, i57, i58, i59;\n" +
" int i60, i61, i62, i63, i64, i65, i66, i67, i68, i69;\n" +
- " String local1 = s1;\n" +
- " String local2 = s2;\n" +
- " \n" +
- " String local3 = null;\n" +
- " if (local1 != null && local2 != null)\n" +
- " local3 = \"\"; //$NON-NLS-1$\n" +
- " else\n" +
- " local3 = local1 != null ? local1 : local2;\n" +
- "\n" +
- " if (local3 != null)\n" +
- " return new Integer(local3.length());\n" +
- " return null;\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " System.out.print(foo(null, null));\n" +
- " System.out.print(foo(\"p1\", null));\n" +
- " System.out.print(foo(null, \"p2\"));\n" +
- " System.out.print(foo(\"p1\", \"p2\"));\n" +
- " }\n" +
+ " String local1 = s1;\n" +
+ " String local2 = s2;\n" +
+ " \n" +
+ " String local3 = null;\n" +
+ " if (local1 != null && local2 != null)\n" +
+ " local3 = \"\"; //$NON-NLS-1$\n" +
+ " else\n" +
+ " local3 = local1 != null ? local1 : local2;\n" +
+ "\n" +
+ " if (local3 != null)\n" +
+ " return new Integer(local3.length());\n" +
+ " return null;\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.print(foo(null, null));\n" +
+ " System.out.print(foo(\"p1\", null));\n" +
+ " System.out.print(foo(null, \"p2\"));\n" +
+ " System.out.print(foo(\"p1\", \"p2\"));\n" +
+ " }\n" +
"}"},
"null220");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=332637
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=332637
// Dead Code detection removing code that isn't dead
public void testBug332637() {
if (this.complianceLevel < ClassFileConstants.JDK1_5)
@@ -14599,64 +14599,64 @@ public void testBug332637() {
this.runConformTest(
new String[] {
"DeadCodeExample.java",
- "public class DeadCodeExample {\n" +
- "\n" +
- " private class CanceledException extends Exception {\n" +
- " }\n" +
- "\n" +
- " private interface ProgressMonitor {\n" +
- " boolean isCanceled();\n" +
- " }\n" +
- "\n" +
- " private void checkForCancellation(ProgressMonitor monitor)\n" +
- " throws CanceledException {\n" +
- " if (monitor.isCanceled()) {\n" +
- " throw new CanceledException();\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private int run() {\n" +
- "\n" +
- " ProgressMonitor monitor = new ProgressMonitor() {\n" +
- " private int i = 0;\n" +
- "\n" +
- " public boolean isCanceled() {\n" +
- " return (++i == 5);\n" +
- " }\n" +
- " };\n" +
- "\n" +
- " Integer number = null;\n" +
- "\n" +
- " try {\n" +
- " checkForCancellation(monitor);\n" +
- "\n" +
- " number = Integer.valueOf(0);\n" +
- "\n" +
- " for (String s : new String[10]) {\n" +
- " checkForCancellation(monitor);\n" +
- " number++;\n" +
- " }\n" +
- " return 0;\n" +
- " } catch (CanceledException e) {\n" +
- " System.out.println(\"Canceled after \" + number\n" +
- " + \" times through the loop\");\n" +
- " if (number != null) {\n" +
- " System.out.println(\"number = \" + number);\n" +
- " }\n" +
- " return -1;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(new DeadCodeExample().run());\n" +
- " }\n" +
- "}\n"
+ "public class DeadCodeExample {\n" +
+ "\n" +
+ " private class CanceledException extends Exception {\n" +
+ " }\n" +
+ "\n" +
+ " private interface ProgressMonitor {\n" +
+ " boolean isCanceled();\n" +
+ " }\n" +
+ "\n" +
+ " private void checkForCancellation(ProgressMonitor monitor)\n" +
+ " throws CanceledException {\n" +
+ " if (monitor.isCanceled()) {\n" +
+ " throw new CanceledException();\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " private int run() {\n" +
+ "\n" +
+ " ProgressMonitor monitor = new ProgressMonitor() {\n" +
+ " private int i = 0;\n" +
+ "\n" +
+ " public boolean isCanceled() {\n" +
+ " return (++i == 5);\n" +
+ " }\n" +
+ " };\n" +
+ "\n" +
+ " Integer number = null;\n" +
+ "\n" +
+ " try {\n" +
+ " checkForCancellation(monitor);\n" +
+ "\n" +
+ " number = Integer.valueOf(0);\n" +
+ "\n" +
+ " for (String s : new String[10]) {\n" +
+ " checkForCancellation(monitor);\n" +
+ " number++;\n" +
+ " }\n" +
+ " return 0;\n" +
+ " } catch (CanceledException e) {\n" +
+ " System.out.println(\"Canceled after \" + number\n" +
+ " + \" times through the loop\");\n" +
+ " if (number != null) {\n" +
+ " System.out.println(\"number = \" + number);\n" +
+ " }\n" +
+ " return -1;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(new DeadCodeExample().run());\n" +
+ " }\n" +
+ "}\n"
},
- "Canceled after 3 times through the loop\n" +
- "number = 3\n" +
+ "Canceled after 3 times through the loop\n" +
+ "number = 3\n" +
"-1");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=332637
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=332637
// Dead Code detection removing code that isn't dead
// variant with a finally block
public void testBug332637b() {
@@ -14665,64 +14665,64 @@ public void testBug332637b() {
this.runConformTest(
new String[] {
"DeadCodeExample.java",
- "public class DeadCodeExample {\n" +
- "\n" +
- " private class CanceledException extends Exception {\n" +
- " }\n" +
- "\n" +
- " private interface ProgressMonitor {\n" +
- " boolean isCanceled();\n" +
- " }\n" +
- "\n" +
- " private void checkForCancellation(ProgressMonitor monitor)\n" +
- " throws CanceledException {\n" +
- " if (monitor.isCanceled()) {\n" +
- " throw new CanceledException();\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private int run() {\n" +
- "\n" +
- " ProgressMonitor monitor = new ProgressMonitor() {\n" +
- " private int i = 0;\n" +
- "\n" +
- " public boolean isCanceled() {\n" +
- " return (++i == 5);\n" +
- " }\n" +
- " };\n" +
- "\n" +
- " Integer number = null;\n" +
- "\n" +
- " try {\n" +
- " checkForCancellation(monitor);\n" +
- "\n" +
- " number = Integer.valueOf(0);\n" +
- "\n" +
- " for (String s : new String[10]) {\n" +
- " checkForCancellation(monitor);\n" +
- " number++;\n" +
- " }\n" +
- " return 0;\n" +
- " } catch (CanceledException e) {\n" +
- " System.out.println(\"Canceled after \" + number\n" +
- " + \" times through the loop\");\n" +
- " if (number != null) {\n" +
- " System.out.println(\"number = \" + number);\n" +
- " }\n" +
- " return -1;\n" +
+ "public class DeadCodeExample {\n" +
+ "\n" +
+ " private class CanceledException extends Exception {\n" +
+ " }\n" +
+ "\n" +
+ " private interface ProgressMonitor {\n" +
+ " boolean isCanceled();\n" +
+ " }\n" +
+ "\n" +
+ " private void checkForCancellation(ProgressMonitor monitor)\n" +
+ " throws CanceledException {\n" +
+ " if (monitor.isCanceled()) {\n" +
+ " throw new CanceledException();\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " private int run() {\n" +
+ "\n" +
+ " ProgressMonitor monitor = new ProgressMonitor() {\n" +
+ " private int i = 0;\n" +
+ "\n" +
+ " public boolean isCanceled() {\n" +
+ " return (++i == 5);\n" +
+ " }\n" +
+ " };\n" +
+ "\n" +
+ " Integer number = null;\n" +
+ "\n" +
+ " try {\n" +
+ " checkForCancellation(monitor);\n" +
+ "\n" +
+ " number = Integer.valueOf(0);\n" +
+ "\n" +
+ " for (String s : new String[10]) {\n" +
+ " checkForCancellation(monitor);\n" +
+ " number++;\n" +
+ " }\n" +
+ " return 0;\n" +
+ " } catch (CanceledException e) {\n" +
+ " System.out.println(\"Canceled after \" + number\n" +
+ " + \" times through the loop\");\n" +
+ " if (number != null) {\n" +
+ " System.out.println(\"number = \" + number);\n" +
+ " }\n" +
+ " return -1;\n" +
" } finally {\n" +
" System.out.println(\"Done\");\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(new DeadCodeExample().run());\n" +
- " }\n" +
- "}\n"
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(new DeadCodeExample().run());\n" +
+ " }\n" +
+ "}\n"
},
- "Canceled after 3 times through the loop\n" +
- "number = 3\n" +
- "Done\n" +
+ "Canceled after 3 times through the loop\n" +
+ "number = 3\n" +
+ "Done\n" +
"-1");
}
@@ -14732,76 +14732,76 @@ public void testBug406160a() {
this.runConformTest(
new String[] {
"DeadCodeExample.java",
- "public class DeadCodeExample {\n" +
- "\n" +
- " class CanceledException extends Exception {\n" +
- " }\n" +
- "\n" +
- " private interface ProgressMonitor {\n" +
- " boolean isCanceled();\n" +
- " }\n" +
- "\n" +
- " private void checkForCancellation(ProgressMonitor monitor)\n" +
- " throws CanceledException {\n" +
- " if (monitor.isCanceled()) {\n" +
- " throw new CanceledException();\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private int run() {\n" +
- "\n" +
- " ProgressMonitor monitor = new ProgressMonitor() {\n" +
- " private int i = 0;\n" +
- "\n" +
- " public boolean isCanceled() {\n" +
- " return (++i == 5);\n" +
- " }\n" +
- " };\n" +
- "\n" +
- " Integer number = null;\n" +
+ "public class DeadCodeExample {\n" +
"\n" +
- " for (int j = 0; j < 1; ) {\n" +
- "\n" +
- " try {\n" +
- " checkForCancellation(monitor);\n" +
- "\n" +
- " number = Integer.valueOf(0);\n" +
- "\n" +
- " for (String s : new String[10]) {\n" +
- " checkForCancellation(monitor);\n" +
- " number++;\n" +
- " }\n" +
- " return 0;\n" +
- " } catch (CanceledException e) {\n" +
- " System.out.println(\"Canceled after \" + number\n" +
- " + \" times through the loop\");\n" +
- " if (number != null) {\n" +
- " System.out.println(\"number = \" + number);\n" +
- " }\n" +
- " return -1;\n" +
- " }\n" +
- " }\n" +
- " return 13;\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(new DeadCodeExample().run());\n" +
- " }\n" +
- "}\n"
+ " class CanceledException extends Exception {\n" +
+ " }\n" +
+ "\n" +
+ " private interface ProgressMonitor {\n" +
+ " boolean isCanceled();\n" +
+ " }\n" +
+ "\n" +
+ " private void checkForCancellation(ProgressMonitor monitor)\n" +
+ " throws CanceledException {\n" +
+ " if (monitor.isCanceled()) {\n" +
+ " throw new CanceledException();\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " private int run() {\n" +
+ "\n" +
+ " ProgressMonitor monitor = new ProgressMonitor() {\n" +
+ " private int i = 0;\n" +
+ "\n" +
+ " public boolean isCanceled() {\n" +
+ " return (++i == 5);\n" +
+ " }\n" +
+ " };\n" +
+ "\n" +
+ " Integer number = null;\n" +
+ "\n" +
+ " for (int j = 0; j < 1; ) {\n" +
+ "\n" +
+ " try {\n" +
+ " checkForCancellation(monitor);\n" +
+ "\n" +
+ " number = Integer.valueOf(0);\n" +
+ "\n" +
+ " for (String s : new String[10]) {\n" +
+ " checkForCancellation(monitor);\n" +
+ " number++;\n" +
+ " }\n" +
+ " return 0;\n" +
+ " } catch (CanceledException e) {\n" +
+ " System.out.println(\"Canceled after \" + number\n" +
+ " + \" times through the loop\");\n" +
+ " if (number != null) {\n" +
+ " System.out.println(\"number = \" + number);\n" +
+ " }\n" +
+ " return -1;\n" +
+ " }\n" +
+ " }\n" +
+ " return 13;\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(new DeadCodeExample().run());\n" +
+ " }\n" +
+ "}\n"
},
- "Canceled after 3 times through the loop\n" +
- "number = 3\n" +
+ "Canceled after 3 times through the loop\n" +
+ "number = 3\n" +
"-1");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=333089
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=333089
// null analysis -- to make sure no AIOOBE or NPE is thrown while calling UnconditionalFlowInfo.markNullStatus(..)
public void testBug333089() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void foo(Object s1) {\n" +
+ "public class X {\n" +
+ " public static void foo(Object s1) {\n" +
" int i00, i01, i02, i03, i04, i05, i06, i07, i08, i09;\n" +
" int i10, i11, i12, i13, i14, i15, i16, i17, i18, i19;\n" +
" int i20, i21, i22, i23, i24, i25, i26, i27, i28, i29;\n" +
@@ -14809,13 +14809,13 @@ public void testBug333089() {
" int i40, i41, i42, i43, i44, i45, i46, i47, i48, i49;\n" +
" int i50, i51, i52, i53, i54, i55, i56, i57, i58, i59;\n" +
" int i60, i61, i62, i63, i64, i65, i66, i67, i68, i69;\n" +
- " Object local1;\n" +
- " if (s1 == null){}\n" +
+ " Object local1;\n" +
+ " if (s1 == null){}\n" +
" try {" +
" local1 = s1;\n" +
" } finally {\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}"},
"");
}
@@ -14826,15 +14826,15 @@ public void testBug336428() {
this.runConformTest(
new String[] {
"DoWhileBug.java",
- "public class DoWhileBug {\n" +
- " void test(boolean b1, Object o1) {\n" +
- " Object o2 = new Object();\n" +
+ "public class DoWhileBug {\n" +
+ " void test(boolean b1, Object o1) {\n" +
+ " Object o2 = new Object();\n" +
" do {\n" +
- " if (b1)\n" +
- " o1 = null;\n" +
- " } while ((o2 = o1) != null);\n" +
- " }\n" +
- "}"
+ " if (b1)\n" +
+ " o1 = null;\n" +
+ " } while ((o2 = o1) != null);\n" +
+ " }\n" +
+ "}"
},
"");
}
@@ -14845,17 +14845,17 @@ public void _testBug336428a() {
this.runConformTest(
new String[] {
"DoWhileBug.java",
- "public class DoWhileBug {\n" +
- " void test(boolean b1, Object o1) {\n" +
- " Object o2 = null;\n" +
+ "public class DoWhileBug {\n" +
+ " void test(boolean b1, Object o1) {\n" +
+ " Object o2 = null;\n" +
" do {\n" +
- " if (b1)\n" +
+ " if (b1)\n" +
" o1 = null;\n" +
" if ((o2 = o1) != null)\n" +
" break;\n" +
- " } while (true);\n" +
- " }\n" +
- "}"
+ " } while (true);\n" +
+ " }\n" +
+ "}"
},
"");
}
@@ -14866,21 +14866,21 @@ public void _testBug336428b() {
runNegativeNullTest(
new String[] {
"DoWhileBug.java",
- "public class DoWhileBug {\n" +
- " void test(boolean b1) {\n" +
- " Object o1 = null;\n" +
- " Object o2 = null;\n" +
+ "public class DoWhileBug {\n" +
+ " void test(boolean b1) {\n" +
+ " Object o1 = null;\n" +
+ " Object o2 = null;\n" +
" do {\n" +
" if ((o2 = o1) == null) break;\n" +
- " } while (true);\n" +
- " }\n" +
- "}"
+ " } while (true);\n" +
+ " }\n" +
+ "}"
},
- "----------\n" +
- "1. ERROR in DoWhileBug.java (at line 6)\n" +
- " if ((o2 = o1) == null) break;\n" +
- " ^^^^^^^^^\n" +
- "Redundant null check: The variable o2 can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in DoWhileBug.java (at line 6)\n" +
+ " if ((o2 = o1) == null) break;\n" +
+ " ^^^^^^^^^\n" +
+ "Redundant null check: The variable o2 can only be null at this location\n" +
"----------\n");
}
@@ -14891,14 +14891,14 @@ public void testBug336428c() {
this.runConformTest(
new String[] {
"DoWhileBug.java",
- "public class DoWhileBug {\n" +
- " void test(boolean b1, Object o1) {\n" +
- " Object o2 = null;\n" +
+ "public class DoWhileBug {\n" +
+ " void test(boolean b1, Object o1) {\n" +
+ " Object o2 = null;\n" +
" do {\n" +
" if ((o2 = o1) == null) break;\n" +
- " } while (true);\n" +
- " }\n" +
- "}"
+ " } while (true);\n" +
+ " }\n" +
+ "}"
},
"");
}
@@ -14910,29 +14910,29 @@ public void testBug336428d() {
runNegativeNullTest(
new String[] {
"DoWhileBug.java",
- "public class DoWhileBug {\n" +
- " void test(boolean b1) {\n" +
- " Object o1 = null;\n" +
- " Object o2 = null;\n" +
+ "public class DoWhileBug {\n" +
+ " void test(boolean b1) {\n" +
+ " Object o1 = null;\n" +
+ " Object o2 = null;\n" +
" do {\n" +
- " if (b1)\n" +
+ " if (b1)\n" +
" o1 = null;\n" +
" if ((o2 = o1) == null) break;\n" +
- " } while (true);\n" +
- " }\n" +
- "}"
+ " } while (true);\n" +
+ " }\n" +
+ "}"
},
- "----------\n" +
- "1. ERROR in DoWhileBug.java (at line 7)\n" +
- " o1 = null;\n" +
- " ^^\n" +
- "Redundant assignment: The variable o1 can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in DoWhileBug.java (at line 7)\n" +
+ " o1 = null;\n" +
+ " ^^\n" +
+ "Redundant assignment: The variable o1 can only be null at this location\n" +
/* In general it's safer *not* to assume that o1 is null on every iteration (see also testBug336428d2):
- "----------\n" +
- "2. ERROR in DoWhileBug.java (at line 8)\n" +
- " if ((o2 = o1) == null) break;\n" +
- " ^^^^^^^^^\n" +
- "Redundant null check: The variable o2 can only be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in DoWhileBug.java (at line 8)\n" +
+ " if ((o2 = o1) == null) break;\n" +
+ " ^^^^^^^^^\n" +
+ "Redundant null check: The variable o2 can only be null at this location\n" +
*/
"----------\n"
);
@@ -14946,18 +14946,18 @@ public void testBug336428d2() {
this.runConformTest(
new String[] {
"DoWhileBug.java",
- "public class DoWhileBug {\n" +
- " void test(boolean b1) {\n" +
- " Object o1 = null;\n" +
- " Object o2 = null;\n" +
+ "public class DoWhileBug {\n" +
+ " void test(boolean b1) {\n" +
+ " Object o1 = null;\n" +
+ " Object o2 = null;\n" +
" do {\n" +
- " if (b1)\n" +
+ " if (b1)\n" +
" o1 = null;\n" +
" if ((o2 = o1) == null) System.out.println(\"null\");\n" +
" o1 = new Object();\n" +
- " } while (true);\n" +
- " }\n" +
- "}"
+ " } while (true);\n" +
+ " }\n" +
+ "}"
});
}
@@ -14968,29 +14968,29 @@ public void testBug336428e() {
runNegativeNullTest(
new String[] {
"DoWhileBug.java",
- "public class DoWhileBug {\n" +
- " void test(boolean b1) {\n" +
- " Object o1 = null;\n" +
- " Object o2 = null;\n" +
+ "public class DoWhileBug {\n" +
+ " void test(boolean b1) {\n" +
+ " Object o1 = null;\n" +
+ " Object o2 = null;\n" +
" do {\n" +
- " if (b1)\n" +
+ " if (b1)\n" +
" o1 = null;\n" +
" assert (o2 = o1) != null : \"bug\";\n" +
- " } while (true);\n" +
- " }\n" +
- "}"
+ " } while (true);\n" +
+ " }\n" +
+ "}"
},
- "----------\n" +
- "1. ERROR in DoWhileBug.java (at line 7)\n" +
- " o1 = null;\n" +
- " ^^\n" +
- "Redundant assignment: The variable o1 can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in DoWhileBug.java (at line 7)\n" +
+ " o1 = null;\n" +
+ " ^^\n" +
+ "Redundant assignment: The variable o1 can only be null at this location\n" +
/* In general it's safer *not* to assume that o1 is null on every iteration:
"----------\n" +
- "2. ERROR in DoWhileBug.java (at line 8)\n" +
- " assert (o2 = o1) != null : \"bug\";\n" +
- " ^^^^^^^^^\n" +
- "Null comparison always yields false: The variable o2 can only be null at this location\n" +
+ "2. ERROR in DoWhileBug.java (at line 8)\n" +
+ " assert (o2 = o1) != null : \"bug\";\n" +
+ " ^^^^^^^^^\n" +
+ "Null comparison always yields false: The variable o2 can only be null at this location\n" +
*/
"----------\n");
}
@@ -15004,23 +15004,23 @@ public void testBug336428f() {
runNegativeNullTest(
new String[] {
"DoWhileBug.java",
- "public class DoWhileBug {\n" +
- " void test(boolean b1) {\n" +
- " Object o1 = null;\n" +
- " Object o2 = null;\n" +
+ "public class DoWhileBug {\n" +
+ " void test(boolean b1) {\n" +
+ " Object o1 = null;\n" +
+ " Object o2 = null;\n" +
" do {\n" +
- " if (b1)\n" +
+ " if (b1)\n" +
" o1 = null;\n" +
" assert (o2 = o1) == null : \"bug\";\n" +
- " } while (true);\n" +
- " }\n" +
- "}"
+ " } while (true);\n" +
+ " }\n" +
+ "}"
},
- "----------\n" +
- "1. ERROR in DoWhileBug.java (at line 7)\n" +
- " o1 = null;\n" +
- " ^^\n" +
- "Redundant assignment: The variable o1 can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in DoWhileBug.java (at line 7)\n" +
+ " o1 = null;\n" +
+ " ^^\n" +
+ "Redundant assignment: The variable o1 can only be null at this location\n" +
"----------\n");
}
}
@@ -15053,16 +15053,16 @@ public void testBug332838() {
" void doSomething() {}\n" +
" boolean checkSomething() {return true;}\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in Info.java (at line 11)\n" +
- " assert info.checkSomething();\n" +
- " ^^^^\n" +
- "Null pointer access: The variable info can only be null at this location\n" +
- "----------\n" +
- "2. ERROR in Info.java (at line 12)\n" +
- " info.doSomething();\n" +
- " ^^^^\n" +
- "Null pointer access: The variable info can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in Info.java (at line 11)\n" +
+ " assert info.checkSomething();\n" +
+ " ^^^^\n" +
+ "Null pointer access: The variable info can only be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in Info.java (at line 12)\n" +
+ " info.doSomething();\n" +
+ " ^^^^\n" +
+ "Null pointer access: The variable info can only be null at this location\n" +
"----------\n",
null,
true,
@@ -15077,19 +15077,19 @@ public void testBug336544() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Integer i1 = getInt();\n" +
- " Integer i2 = i1 == null ? null : i1;\n" +
- " if (i2 != null) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " return;\n" +
- " }\n" +
- " System.out.println(\"FAILURE\");\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Integer i1 = getInt();\n" +
+ " Integer i2 = i1 == null ? null : i1;\n" +
+ " if (i2 != null) {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " return;\n" +
+ " }\n" +
+ " System.out.println(\"FAILURE\");\n" +
+ " }\n" +
+ " private static Integer getInt() {\n" +
+ " return new Integer(0);\n" +
" }\n" +
- " private static Integer getInt() {\n" +
- " return new Integer(0);\n" +
- " }\n" +
"}"
},
"SUCCESS");
@@ -15100,19 +15100,19 @@ public void testBug336544_2() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Integer i1 = null;\n" +
- " Integer i2 = (i1 = getInt()) == null ? null : i1;\n" +
- " if (i2 != null) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " return;\n" +
- " }\n" +
- " System.out.println(\"FAILURE\");\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Integer i1 = null;\n" +
+ " Integer i2 = (i1 = getInt()) == null ? null : i1;\n" +
+ " if (i2 != null) {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " return;\n" +
+ " }\n" +
+ " System.out.println(\"FAILURE\");\n" +
+ " }\n" +
+ " private static Integer getInt() {\n" +
+ " return new Integer(0);\n" +
" }\n" +
- " private static Integer getInt() {\n" +
- " return new Integer(0);\n" +
- " }\n" +
"}"
},
"SUCCESS");
@@ -15123,20 +15123,20 @@ public void testBug336544_3() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Integer i1 = null;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Integer i1 = null;\n" +
" Integer i2;\n" +
- " i2 = (i1 = getInt()) == null ? null : i1;\n" +
- " if (i2 != null) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " return;\n" +
- " }\n" +
- " System.out.println(\"FAILURE\");\n" +
+ " i2 = (i1 = getInt()) == null ? null : i1;\n" +
+ " if (i2 != null) {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " return;\n" +
+ " }\n" +
+ " System.out.println(\"FAILURE\");\n" +
+ " }\n" +
+ " private static Integer getInt() {\n" +
+ " return new Integer(0);\n" +
" }\n" +
- " private static Integer getInt() {\n" +
- " return new Integer(0);\n" +
- " }\n" +
"}"
},
"SUCCESS");
@@ -15147,7 +15147,7 @@ public void testBug313870() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" public static void main(String[] args) {\n" +
" String s = \"\";\n" +
" for (int i = 0; i < 2; i++) {\n" +
@@ -15157,11 +15157,11 @@ public void testBug313870() {
" if (s == null) {\n" +
" System.out.println(\"null\");\n" +
" }\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
" public static String test() {\n" +
" return null;\n" +
- " }\n" +
+ " }\n" +
"}"
},
"null");
@@ -15174,7 +15174,7 @@ public void testBug313870b() {
"X.java",
"import java.io.BufferedReader;\n" +
"import java.io.IOException;\n" +
- "public class X {\n" +
+ "public class X {\n" +
" public void main(BufferedReader bufReader) throws IOException {\n" +
" String line = \"\";\n" +
" boolean doRead = false;\n" +
@@ -15187,7 +15187,7 @@ public void testBug313870b() {
" }\n" +
" doRead = true;\n" +
" }\n" +
- " }\n" +
+ " }\n" +
"}"
},
"");
@@ -15199,7 +15199,7 @@ public void testBug313870c() {
new String[] {
"X.java",
"import java.io.File;\n" +
- "public class X {\n" +
+ "public class X {\n" +
" public static void main(String[] args) {\n" +
" boolean sometimes = (System.currentTimeMillis() & 1L) != 0L;\n" +
" File file = new File(\"myfile\");\n" +
@@ -15214,7 +15214,7 @@ public void testBug313870c() {
" }\n" +
" private static File getNewFile() {\n" +
" return null;\n" +
- " }\n" +
+ " }\n" +
"}"
},
"");
@@ -15224,26 +15224,26 @@ public void testBug338303() {
this.runConformTest(
new String[] {
"Bug338303.java",
- "import java.io.File;\n" +
- "import java.io.IOException;\n" +
- "\n" +
- "public class Bug338303 {\n" +
- " Object test(Object in, final File f) {\n" +
- " Object local;\n" +
- " try {\n" +
- " local = in;\n" +
- " if (local == null)\n" +
- " local = loadEntry(f, false);\n" +
- " } catch (final IOException e) {\n" +
- " e.printStackTrace();\n" +
- " local = null;\n" +
- " }\n" +
- " return local;\n" +
- " }\n" +
- "\n" +
- " private Object loadEntry(File f, boolean b) throws IOException {\n" +
- " throw new IOException();\n" +
- " }\n" +
+ "import java.io.File;\n" +
+ "import java.io.IOException;\n" +
+ "\n" +
+ "public class Bug338303 {\n" +
+ " Object test(Object in, final File f) {\n" +
+ " Object local;\n" +
+ " try {\n" +
+ " local = in;\n" +
+ " if (local == null)\n" +
+ " local = loadEntry(f, false);\n" +
+ " } catch (final IOException e) {\n" +
+ " e.printStackTrace();\n" +
+ " local = null;\n" +
+ " }\n" +
+ " return local;\n" +
+ " }\n" +
+ "\n" +
+ " private Object loadEntry(File f, boolean b) throws IOException {\n" +
+ " throw new IOException();\n" +
+ " }\n" +
"}\n"
},
"");
@@ -15254,32 +15254,32 @@ public void testBug338234() {
runNegativeNullTest(
new String[] {
"X.java",
- "public class X {\n" +
- " static int foo() {\n" +
+ "public class X {\n" +
+ " static int foo() {\n" +
" Object o = null;\n" +
- " int i = 0;\n" +
- " label: {\n" +
- " if (o == null)\n" +
+ " int i = 0;\n" +
+ " label: {\n" +
+ " if (o == null)\n" +
" break label;\n" +
- " i++;" +
- " }\n" +
- " if (i != 0) {\n" +
- " System.out.println(i);\n" +
- " }\n" +
- " return 0;\n" +
- " }\n" +
+ " i++;" +
+ " }\n" +
+ " if (i != 0) {\n" +
+ " System.out.println(i);\n" +
+ " }\n" +
+ " return 0;\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (o == null)\n" +
- " ^\n" +
- "Redundant null check: The variable o can only be null at this location\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " i++; }\n" +
- " ^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " if (o == null)\n" +
+ " ^\n" +
+ "Redundant null check: The variable o can only be null at this location\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " i++; }\n" +
+ " ^^^\n" +
+ "Dead code\n" +
"----------\n");
}
// Bug 324178 - [null] ConditionalExpression.nullStatus(..) doesn't take into account the analysis of condition itself
@@ -15325,15 +15325,15 @@ public void testBug326950a() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
" String s = null;\n" +
- " if (s == null) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
+ " if (s == null) {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
" } else {\n" +
" System.out.println(\"Dead code, but don't optimize me out\");\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}",
},
"SUCCESS",
@@ -15343,18 +15343,18 @@ public void testBug326950a() throws Exception {
options,
null);
String expectedOutput =
- " public static void main(java.lang.String[] args);\n" +
- " 0 aconst_null\n" +
- " 1 astore_1 [s]\n" +
- " 2 aload_1 [s]\n" +
- " 3 ifnonnull 17\n" +
- " 6 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 9 ldc <String \"SUCCESS\"> [22]\n" +
- " 11 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n" +
- " 14 goto 25\n" +
- " 17 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 20 ldc <String \"Dead code, but don\'t optimize me out\"> [30]\n" +
- " 22 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 aconst_null\n" +
+ " 1 astore_1 [s]\n" +
+ " 2 aload_1 [s]\n" +
+ " 3 ifnonnull 17\n" +
+ " 6 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 9 ldc <String \"SUCCESS\"> [22]\n" +
+ " 11 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n" +
+ " 14 goto 25\n" +
+ " 17 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 20 ldc <String \"Dead code, but don\'t optimize me out\"> [30]\n" +
+ " 22 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n" +
" 25 return\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
}
@@ -15368,18 +15368,18 @@ public void testBug326950b() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" public static void main(String[] args) {\n" +
- " int i = 0;\n" +
- " if (false) {\n" +
- " System.out.println(\"Deadcode and you can optimize me out\");\n" +
+ " int i = 0;\n" +
+ " if (false) {\n" +
+ " System.out.println(\"Deadcode and you can optimize me out\");\n" +
" }\n" +
" if (true) {\n" +
" i++;\n" +
" } else {\n" +
" System.out.println(\"Deadcode and you can optimize me out\");\n" +
" }\n" +
- " }\n" +
+ " }\n" +
"}",
},
"",
@@ -15389,10 +15389,10 @@ public void testBug326950b() throws Exception {
options,
null);
String expectedOutput =
- " public static void main(java.lang.String[] args);\n" +
- " 0 iconst_0\n" +
- " 1 istore_1 [i]\n" +
- " 2 iinc 1 1 [i]\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 iconst_0\n" +
+ " 1 istore_1 [i]\n" +
+ " 2 iinc 1 1 [i]\n" +
" 5 return\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
}
@@ -15406,15 +15406,15 @@ public void testBug326950c() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public void foo(String[] args) {\n" +
+ "public class X {\n" +
+ " public void foo(String[] args) {\n" +
" String s = \"\";\n" +
" int i = 0;\n" +
- " if (s != null) {\n" +
- " return;\n" +
+ " if (s != null) {\n" +
+ " return;\n" +
" }\n" +
" i++;\n" +
- " }\n" +
+ " }\n" +
"}",
},
"",
@@ -15424,15 +15424,15 @@ public void testBug326950c() throws Exception {
options,
null);
String expectedOutput =
- " public void foo(java.lang.String[] args);\n" +
- " 0 ldc <String \"\"> [16]\n" +
- " 2 astore_2 [s]\n" +
- " 3 iconst_0\n" +
- " 4 istore_3 [i]\n" +
- " 5 aload_2 [s]\n" +
- " 6 ifnull 10\n" +
- " 9 return\n" +
- " 10 iinc 3 1 [i]\n" +
+ " public void foo(java.lang.String[] args);\n" +
+ " 0 ldc <String \"\"> [16]\n" +
+ " 2 astore_2 [s]\n" +
+ " 3 iconst_0\n" +
+ " 4 istore_3 [i]\n" +
+ " 5 aload_2 [s]\n" +
+ " 6 ifnull 10\n" +
+ " 9 return\n" +
+ " 10 iinc 3 1 [i]\n" +
" 13 return\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
}
@@ -15446,15 +15446,15 @@ public void testBug326950d() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " X() {\n" +
+ "public class X {\n" +
+ " X() {\n" +
" String s = \"\";\n" +
" int i = 0;\n" +
- " if (s != null) {\n" +
- " return;\n" +
+ " if (s != null) {\n" +
+ " return;\n" +
" }\n" +
" i++;\n" +
- " }\n" +
+ " }\n" +
"}",
},
"",
@@ -15464,17 +15464,17 @@ public void testBug326950d() throws Exception {
options,
null);
String expectedOutput =
- " X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [8]\n" +
- " 4 ldc <String \"\"> [10]\n" +
- " 6 astore_1 [s]\n" +
- " 7 iconst_0\n" +
- " 8 istore_2 [i]\n" +
- " 9 aload_1 [s]\n" +
- " 10 ifnull 14\n" +
- " 13 return\n" +
- " 14 iinc 2 1 [i]\n" +
+ " X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [8]\n" +
+ " 4 ldc <String \"\"> [10]\n" +
+ " 6 astore_1 [s]\n" +
+ " 7 iconst_0\n" +
+ " 8 istore_2 [i]\n" +
+ " 9 aload_1 [s]\n" +
+ " 10 ifnull 14\n" +
+ " 13 return\n" +
+ " 14 iinc 2 1 [i]\n" +
" 17 return\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
}
@@ -15486,14 +15486,14 @@ public void testBug339250() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
" String s = null;\n" +
" s += \"correctly\";\n" +
" if (s != null) {\n" + // s cannot be null
- " System.out.println(\"It works \" + s);\n" +
+ " System.out.println(\"It works \" + s);\n" +
" }\n" +
- " }\n" +
+ " }\n" +
"}",
},
"It works nullcorrectly",
@@ -15509,21 +15509,21 @@ public void testBug339250a() throws Exception {
runNegativeNullTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
" String s = null;\n" +
" s += \"correctly\";\n" +
" if (s != null) {\n" + // s cannot be null
- " System.out.println(\"It works \" + s);\n" +
+ " System.out.println(\"It works \" + s);\n" +
" }\n" +
- " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " if (s != null) {\n" +
- " ^\n" +
- "Redundant null check: The variable s cannot be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " if (s != null) {\n" +
+ " ^\n" +
+ "Redundant null check: The variable s cannot be null at this location\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=339250
@@ -15532,39 +15532,39 @@ public void testBug339250b() throws Exception {
runNegativeNullTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
" String s = null;\n" +
" s += null;\n" +
" if (s != null) {\n" + // s is definitely not null
- " System.out.println(\"It works \" + s);\n" +
- " }\n" +
+ " System.out.println(\"It works \" + s);\n" +
+ " }\n" +
" s = null;\n" +
" if (s != null) {\n" + // s is definitely null
- " System.out.println(\"Fails \" + s);\n" +
- " } else {\n" +
+ " System.out.println(\"Fails \" + s);\n" +
+ " } else {\n" +
" System.out.println(\"Works second time too \" + s);\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " if (s != null) {\n" +
- " ^\n" +
- "Redundant null check: The variable s cannot be null at this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " if (s != null) {\n" +
- " ^\n" +
- "Null comparison always yields false: The variable s can only be null at this location\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 9)\n" +
- " if (s != null) {\n" +
- " System.out.println(\"Fails \" + s);\n" +
- " } else {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " if (s != null) {\n" +
+ " ^\n" +
+ "Redundant null check: The variable s cannot be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " if (s != null) {\n" +
+ " ^\n" +
+ "Null comparison always yields false: The variable s can only be null at this location\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 9)\n" +
+ " if (s != null) {\n" +
+ " System.out.println(\"Fails \" + s);\n" +
+ " } else {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=342300
@@ -15573,16 +15573,16 @@ public void testBug342300() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void initPattern(String p, Character escapeChar) {\n" +
+ "public class X {\n" +
+ " public static void initPattern(String p, Character escapeChar) {\n" +
" int len = p.length();\n" +
" for (int i = 0; i < len; i++) {\n" +
" char c = p.charAt(i);\n" +
" if (escapeChar != null && escapeChar == c) {\n" + // quiet
" c = p.charAt(++i);\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}",
},
"");
@@ -15595,23 +15595,23 @@ public void testBug342300b() throws Exception {
runNegativeNullTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void initPattern(String p, Character escapeChar) {\n" +
+ "public class X {\n" +
+ " public static void initPattern(String p, Character escapeChar) {\n" +
" int len = p.length();\n" +
" for (int i = 0; i < len; i++) {\n" +
" char c = p.charAt(i);\n" +
" if (escapeChar != null && escapeChar != null) {\n" + // look here
" c = p.charAt(++i);\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (escapeChar != null && escapeChar != null) {\n" +
- " ^^^^^^^^^^\n" +
- "Redundant null check: The variable escapeChar cannot be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " if (escapeChar != null && escapeChar != null) {\n" +
+ " ^^^^^^^^^^\n" +
+ "Redundant null check: The variable escapeChar cannot be null at this location\n" +
"----------\n");
}
}
@@ -15621,8 +15621,8 @@ public void testBug348379a() throws Exception {
runNegativeNullTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public void foo() {\n" +
+ "public class X {\n" +
+ " public void foo() {\n" +
" String s = null;\n" +
" switch(s) {\n" +
" case \"abcd\":\n" +
@@ -15631,15 +15631,15 @@ public void testBug348379a() throws Exception {
" default:\n" +
" System.out.println(\"oops\");\n" +
" break;\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " switch(s) {\n" +
- " ^\n" +
- "Null pointer access: The variable s can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " switch(s) {\n" +
+ " ^\n" +
+ "Null pointer access: The variable s can only be null at this location\n" +
"----------\n");
}
}
@@ -15649,8 +15649,8 @@ public void testBug348379b() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
" String s = \"abcd\";\n" +
" switch(s) {\n" + // no warning since s is not null
" case \"abcd\":\n" +
@@ -15659,8 +15659,8 @@ public void testBug348379b() throws Exception {
" default:\n" +
" System.out.println(\"oops\");\n" +
" break;\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}",
},
"abcd");
@@ -15672,8 +15672,8 @@ public void testBug348379c() throws Exception {
runNegativeNullTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public void foo(String s) {\n" +
+ "public class X {\n" +
+ " public void foo(String s) {\n" +
" if (s == null) {}\n" + // tainting s
" switch(s) {\n" +
" case \"abcd\":\n" +
@@ -15682,15 +15682,15 @@ public void testBug348379c() throws Exception {
" default:\n" +
" System.out.println(\"oops\");\n" +
" break;\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " switch(s) {\n" +
- " ^\n" +
- "Potential null pointer access: The variable s may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " switch(s) {\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable s may be null at this location\n" +
"----------\n");
}
}
@@ -15700,8 +15700,8 @@ public void testBug348379d() throws Exception {
runNegativeNullTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public void foo(String s) {\n" +
+ "public class X {\n" +
+ " public void foo(String s) {\n" +
" if (s != null) {}\n" + // tainting s
" switch(s) {\n" +
" case \"abcd\":\n" +
@@ -15710,15 +15710,15 @@ public void testBug348379d() throws Exception {
" default:\n" +
" System.out.println(\"oops\");\n" +
" break;\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " switch(s) {\n" +
- " ^\n" +
- "Potential null pointer access: The variable s may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " switch(s) {\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable s may be null at this location\n" +
"----------\n");
}
}
@@ -15728,8 +15728,8 @@ public void testBug348379e() throws Exception {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public void foo(String s) {\n" +
+ "public class X {\n" +
+ " public void foo(String s) {\n" +
" if (s == null) {}\n" + // tainting s
" else\n" +
" switch(s) {\n" + // no warning because we're inside else
@@ -15739,8 +15739,8 @@ public void testBug348379e() throws Exception {
" default:\n" +
" System.out.println(\"oops\");\n" +
" break;\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}",
},
"");
@@ -15752,8 +15752,8 @@ public void testBug348379f() throws Exception {
runNegativeNullTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public void foo(String s) {\n" +
+ "public class X {\n" +
+ " public void foo(String s) {\n" +
" s = null;\n" +
" switch(s) {\n" +
" case \"abcd\":\n" +
@@ -15767,15 +15767,15 @@ public void testBug348379f() throws Exception {
" default:\n" +
" break;\n" +
" }\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " switch(s) {\n" +
- " ^\n" +
- "Null pointer access: The variable s can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " switch(s) {\n" +
+ " ^\n" +
+ "Null pointer access: The variable s can only be null at this location\n" +
"----------\n");
}
}
@@ -15792,16 +15792,16 @@ public void testBug354554() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Bug354554.java (at line 4)\n" +
- " Object r = (u == null ? u : null);\n" +
- " ^\n" +
- "Null comparison always yields false: The variable u cannot be null at this location\n" +
- "----------\n" +
- "2. ERROR in Bug354554.java (at line 5)\n" +
- " System.out.println(r.toString());\n" +
- " ^\n" +
- "Null pointer access: The variable r can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in Bug354554.java (at line 4)\n" +
+ " Object r = (u == null ? u : null);\n" +
+ " ^\n" +
+ "Null comparison always yields false: The variable u cannot be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in Bug354554.java (at line 5)\n" +
+ " System.out.println(r.toString());\n" +
+ " ^\n" +
+ "Null pointer access: The variable r can only be null at this location\n" +
"----------\n");
}
//Bug 354554 - [null] conditional with redundant condition yields weak error message
@@ -15817,11 +15817,11 @@ public void testBug354554b() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Bug354554.java (at line 4)\n" +
- " Object r = (u != null ? u : null);\n" +
- " ^\n" +
- "Redundant null check: The variable u cannot be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in Bug354554.java (at line 4)\n" +
+ " Object r = (u != null ? u : null);\n" +
+ " ^\n" +
+ "Redundant null check: The variable u cannot be null at this location\n" +
"----------\n");
}
// Bug 358827 - [1.7] exception analysis for t-w-r spoils null analysis
@@ -15832,22 +15832,22 @@ public void test358827() {
"Bug358827.java",
"import java.io.FileReader;\n" +
"public class Bug358827 {\n" +
- " Object foo2() throws Exception {\n" +
- " String o = null;\n" +
- " try (FileReader rf = new FileReader(\"file\")){\n" +
- " o = o.toUpperCase();\n" +
- " } finally {\n" +
- " o = \"OK\";\n" +
- " }\n" +
- " return o;\n" +
- " }\n" +
+ " Object foo2() throws Exception {\n" +
+ " String o = null;\n" +
+ " try (FileReader rf = new FileReader(\"file\")){\n" +
+ " o = o.toUpperCase();\n" +
+ " } finally {\n" +
+ " o = \"OK\";\n" +
+ " }\n" +
+ " return o;\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Bug358827.java (at line 6)\n" +
- " o = o.toUpperCase();\n" +
- " ^\n" +
- "Null pointer access: The variable o can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in Bug358827.java (at line 6)\n" +
+ " o = o.toUpperCase();\n" +
+ " ^\n" +
+ "Null pointer access: The variable o can only be null at this location\n" +
"----------\n");
}
}
@@ -15862,16 +15862,16 @@ public void test367879() {
"import java.net.HttpURLConnection;\n" +
"import java.net.URL;\n" +
"public class Bug367879 {\n" +
- " public void test() throws IOException {\n" +
- " HttpURLConnection http = null;\n" +
- " try {\n" +
- " http = (HttpURLConnection) new URL(\"http://example.com/\").openConnection();\n" +
- " try (InputStream in = http.getInputStream()) { /* get input */ }\n" +
- " http.getURL();\n" + // shouldn't *not* flag as Potential null pointer access
- " } finally {\n" +
- " if (http != null) { http.disconnect(); }\n" +
- " }\n" +
- " }\n" +
+ " public void test() throws IOException {\n" +
+ " HttpURLConnection http = null;\n" +
+ " try {\n" +
+ " http = (HttpURLConnection) new URL(\"http://example.com/\").openConnection();\n" +
+ " try (InputStream in = http.getInputStream()) { /* get input */ }\n" +
+ " http.getURL();\n" + // shouldn't *not* flag as Potential null pointer access
+ " } finally {\n" +
+ " if (http != null) { http.disconnect(); }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
"");
@@ -15889,7 +15889,7 @@ public void testBug256796() {
"public class Bug {\n" +
" private static final boolean TRUE = true;\n" +
" private static final boolean FALSE = false;\n" +
- " void foo() throws Exception {\n" +
+ " void foo() throws Exception {\n" +
" if (TRUE) return;\n" +
" else System.out.println(\"\");\n" +
" System.out.println(\"\");\n" + // not dead code
@@ -15904,22 +15904,22 @@ public void testBug256796() {
" if (FALSE) return;\n" +
" System.out.println(\"\");\n" + // not dead code
" if (false) return;\n" + // dead code
- " System.out.println(\"\");\n" +
+ " System.out.println(\"\");\n" +
" if (true) return;\n" +
" System.out.println(\"\");\n" + // dead code
- " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in Bug.java (at line 18)\n" +
- " if (false) return;\n" +
- " ^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. WARNING in Bug.java (at line 21)\n" +
- " System.out.println(\"\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. WARNING in Bug.java (at line 18)\n" +
+ " if (false) return;\n" +
+ " ^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. WARNING in Bug.java (at line 21)\n" +
+ " System.out.println(\"\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
null,
true,
@@ -15939,7 +15939,7 @@ public void testBug256796a() {
"public class Bug {\n" +
" private static final boolean TRUE = true;\n" +
" private static final boolean FALSE = false;\n" +
- " void foo() throws Exception {\n" +
+ " void foo() throws Exception {\n" +
" if (TRUE) return;\n" +
" else System.out.println(\"\");\n" +
" System.out.println(\"\");\n" + // dead code
@@ -15948,78 +15948,78 @@ public void testBug256796a() {
" if (TRUE) return;\n" +
" System.out.println(\"\");\n" + // dead code
" }\n" +
- " void foo3() throws Exception {\n" +
+ " void foo3() throws Exception {\n" +
" if (TRUE) throw new Exception();\n" +
" else System.out.println(\"\");\n" + // dead code
" System.out.println(\"\");\n" + // dead code
- " }\n" +
- " void foo4() throws Exception {\n" +
+ " }\n" +
+ " void foo4() throws Exception {\n" +
" if (FALSE) System.out.println(\"\");\n" +
" else return;\n" +
" System.out.println(\"\");\n" + // dead code
- " }\n" +
- " void foo5() throws Exception {\n" +
+ " }\n" +
+ " void foo5() throws Exception {\n" +
" if (FALSE) return;\n" + // dead code
- " System.out.println(\"\");\n" +
+ " System.out.println(\"\");\n" +
" }\n" +
- " void foo6() throws Exception {\n" +
+ " void foo6() throws Exception {\n" +
" if (false) return;\n" + // dead code
- " System.out.println(\"\");\n" +
+ " System.out.println(\"\");\n" +
" if (true) return;\n" +
" System.out.println(\"\");\n" + // dead code
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in Bug.java (at line 6)\n" +
- " else System.out.println(\"\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. WARNING in Bug.java (at line 7)\n" +
- " System.out.println(\"\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. WARNING in Bug.java (at line 11)\n" +
- " System.out.println(\"\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "4. WARNING in Bug.java (at line 15)\n" +
- " else System.out.println(\"\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "5. WARNING in Bug.java (at line 16)\n" +
- " System.out.println(\"\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "6. WARNING in Bug.java (at line 19)\n" +
- " if (FALSE) System.out.println(\"\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "7. WARNING in Bug.java (at line 21)\n" +
- " System.out.println(\"\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "8. WARNING in Bug.java (at line 24)\n" +
- " if (FALSE) return;\n" +
- " ^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "9. WARNING in Bug.java (at line 28)\n" +
- " if (false) return;\n" +
- " ^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "10. WARNING in Bug.java (at line 31)\n" +
- " System.out.println(\"\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. WARNING in Bug.java (at line 6)\n" +
+ " else System.out.println(\"\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. WARNING in Bug.java (at line 7)\n" +
+ " System.out.println(\"\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. WARNING in Bug.java (at line 11)\n" +
+ " System.out.println(\"\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "4. WARNING in Bug.java (at line 15)\n" +
+ " else System.out.println(\"\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "5. WARNING in Bug.java (at line 16)\n" +
+ " System.out.println(\"\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "6. WARNING in Bug.java (at line 19)\n" +
+ " if (FALSE) System.out.println(\"\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "7. WARNING in Bug.java (at line 21)\n" +
+ " System.out.println(\"\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "8. WARNING in Bug.java (at line 24)\n" +
+ " if (FALSE) return;\n" +
+ " ^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "9. WARNING in Bug.java (at line 28)\n" +
+ " if (false) return;\n" +
+ " ^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "10. WARNING in Bug.java (at line 31)\n" +
+ " System.out.println(\"\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n",
null,
true,
@@ -16318,7 +16318,7 @@ public void testBug384380() {
" for (final Container c : list) {\n" +
" if(c == null)\n" +
" continue; // return or break, are fine though\n" +
- "\n" +
+ "\n" +
" // without this try-catch+for+exception block it does not fails\n" +
" try {\n" +
" for(int i = 0; i < 10 ; i++) // needs a loop here (a 'while' or a 'for') to fail\n" +
@@ -16355,7 +16355,7 @@ public void testBug384380_a() {
" for (final Container c : list) {\n" +
" if(c == null)\n" +
" continue; // return or break, are fine though\n" +
- "\n" +
+ "\n" +
" // without this try-catch+for+exception block it does not fails\n" +
" try {\n" +
" for(int i = 0; i < 10 ; i++) // needs a loop here (a 'while' or a 'for') to fail\n" +
@@ -16396,7 +16396,7 @@ public void testBug384380_b() {
" final Container c = it.next();\n" +
" if(c == null)\n" +
" continue; // return or break, are fine though\n" +
- "\n" +
+ "\n" +
" // without this try-catch+for+exception block it does not fails\n" +
" try {\n" +
" for(Container c1 : list) // needs a loop here (a 'while' or a 'for') to fail\n" +
@@ -16419,26 +16419,26 @@ public void testBug376263() {
runConformTest(
new String[] {
"Test.java",
- "public class Test {\n" +
- " private int x;\n" +
- "\n" +
- " static void test(Test[] array) {\n" +
- " Test elem = null;\n" +
- " int i = 0;\n" +
- " while (i < array.length) {\n" +
- " if (i == 0) {\n" +
- " elem = array[0];\n" +
- " }\n" +
- " if (elem != null) {\n" +
- " while (true) {\n" +
- " if (elem.x >= 0 || i >= array.length) { // should not warn here\n" +
- " break;\n" +
- " }\n" +
- " elem = array[i++];\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " private int x;\n" +
+ "\n" +
+ " static void test(Test[] array) {\n" +
+ " Test elem = null;\n" +
+ " int i = 0;\n" +
+ " while (i < array.length) {\n" +
+ " if (i == 0) {\n" +
+ " elem = array[0];\n" +
+ " }\n" +
+ " if (elem != null) {\n" +
+ " while (true) {\n" +
+ " if (elem.x >= 0 || i >= array.length) { // should not warn here\n" +
+ " break;\n" +
+ " }\n" +
+ " elem = array[i++];\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}"
},
"",
@@ -16469,26 +16469,26 @@ public void testExpressions01() {
" class I {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " if (new Object() == null)\n" +
- " ^^^^^^^^^^^^\n" +
- "Null comparison always yields false: this expression cannot be null\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " System.out.println(\"null\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " if (null != this.new I())\n" +
- " ^^^^^^^^^^^^\n" +
- "Redundant null check: this expression cannot be null\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 11)\n" +
- " if (null != new Object[3])\n" +
- " ^^^^^^^^^^^^^\n" +
- "Redundant null check: this expression cannot be null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " if (new Object() == null)\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Null comparison always yields false: this expression cannot be null\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " System.out.println(\"null\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " if (null != this.new I())\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Redundant null check: this expression cannot be null\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 11)\n" +
+ " if (null != new Object[3])\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Redundant null check: this expression cannot be null\n" +
"----------\n"
);
}
@@ -16510,21 +16510,21 @@ public void testExpressions02() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " if (this == null)\n" +
- " ^^^^\n" +
- "Null comparison always yields false: this expression cannot be null\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " System.out.println(\"null\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " if (null != X.this)\n" +
- " ^^^^^^\n" +
- "Redundant null check: this expression cannot be null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " if (this == null)\n" +
+ " ^^^^\n" +
+ "Null comparison always yields false: this expression cannot be null\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " System.out.println(\"null\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " if (null != X.this)\n" +
+ " ^^^^^^\n" +
+ "Redundant null check: this expression cannot be null\n" +
"----------\n"
);
}
@@ -16546,31 +16546,31 @@ public void testExpressions03() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " if (X.class == null)\n" +
- " ^^^^^^^\n" +
- "Null comparison always yields false: this expression cannot be null\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " System.out.println(\"null\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " if (null != \"STRING\")\n" +
- " ^^^^^^^^\n" +
- "Redundant null check: this expression cannot be null\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " if (null == (Object)this)\n" +
- " ^^^^^^^^^^^^\n" +
- "Null comparison always yields false: this expression cannot be null\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 10)\n" +
- " System.out.println(\"I\'m null\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " if (X.class == null)\n" +
+ " ^^^^^^^\n" +
+ "Null comparison always yields false: this expression cannot be null\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " System.out.println(\"null\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " if (null != \"STRING\")\n" +
+ " ^^^^^^^^\n" +
+ "Redundant null check: this expression cannot be null\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 9)\n" +
+ " if (null == (Object)this)\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Null comparison always yields false: this expression cannot be null\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 10)\n" +
+ " System.out.println(\"I\'m null\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n"
);
}
@@ -16581,19 +16581,19 @@ public void testExpressions04() {
new String[] {
"X.java",
"public class X {\n" +
- " void foo(boolean b) {\n" +
- " Object o1 = new Object();\n" +
- " Object o2 = new Object();\n" +
- " if ((b ? o1 : o2) != null)\n" +
- " System.out.println(\"null\");\n" +
+ " void foo(boolean b) {\n" +
+ " Object o1 = new Object();\n" +
+ " Object o2 = new Object();\n" +
+ " if ((b ? o1 : o2) != null)\n" +
+ " System.out.println(\"null\");\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " if ((b ? o1 : o2) != null)\n" +
- " ^^^^^^^^^^^^^\n" +
- "Redundant null check: this expression cannot be null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " if ((b ? o1 : o2) != null)\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Redundant null check: this expression cannot be null\n" +
"----------\n"
);
}
@@ -16606,13 +16606,13 @@ public void testBug345305_1() {
"X.java",
"public class X {\n" +
" void foo() {\n" +
- " String s = null;\n" +
- " try {\n" +
- " s = \"hi\";\n" +
- " } finally {\n" +
- " s.length();\n" +
- " s = null;\n" +
- " }\n" +
+ " String s = null;\n" +
+ " try {\n" +
+ " s = \"hi\";\n" +
+ " } finally {\n" +
+ " s.length();\n" +
+ " s = null;\n" +
+ " }\n" +
" }\n" +
"}\n"
});
@@ -16626,16 +16626,16 @@ public void testBug345305_2() {
"X.java",
"public class X {\n" +
" void foo() {\n" +
- " String s = null;\n" +
- " while (true) {\n" +
- " try {\n" +
- " s = \"hi\";\n" +
- " }\n" +
- " finally {\n" +
- " s.length();\n" +
- " s = null;\n" +
- " }\n" +
- " }\n" +
+ " String s = null;\n" +
+ " while (true) {\n" +
+ " try {\n" +
+ " s = \"hi\";\n" +
+ " }\n" +
+ " finally {\n" +
+ " s.length();\n" +
+ " s = null;\n" +
+ " }\n" +
+ " }\n" +
" }\n" +
"}\n"
});
@@ -16649,16 +16649,16 @@ public void testBug345305_3() {
"X.java",
"public class X {\n" +
" void foo() {\n" +
- " String s = null;\n" +
- " while (true) {\n" +
- " try {\n" +
- " check(s = \"hi\");\n" +
- " }\n" +
- " finally {\n" +
- " s.length();\n" +
- " s = null;\n" +
- " }\n" +
- " }\n" +
+ " String s = null;\n" +
+ " while (true) {\n" +
+ " try {\n" +
+ " check(s = \"hi\");\n" +
+ " }\n" +
+ " finally {\n" +
+ " s.length();\n" +
+ " s = null;\n" +
+ " }\n" +
+ " }\n" +
" }\n" +
" void check(String s) {}\n" +
"}\n"
@@ -16673,28 +16673,28 @@ public void testBug345305_4() {
"X.java",
"public class X {\n" +
" void foo() {\n" +
- " String s = \"\";\n" +
- " String s2 = null;\n" +
- " while (true) {\n" +
- " try {\n" +
+ " String s = \"\";\n" +
+ " String s2 = null;\n" +
+ " while (true) {\n" +
+ " try {\n" +
" s = null;\n" +
" bar();\n" +
" s2 = \"world\";\n" +
- " }\n" +
- " finally {\n" +
- " s.length();\n" +
- " s = null;\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " finally {\n" +
+ " s.length();\n" +
+ " s = null;\n" +
+ " }\n" +
+ " }\n" +
" }\n" +
" void bar() {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " s.length();\n" +
- " ^\n" +
- "Null pointer access: The variable s can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " s.length();\n" +
+ " ^\n" +
+ "Null pointer access: The variable s can only be null at this location\n" +
"----------\n");
}
@@ -16706,25 +16706,25 @@ public void testBug345305_6() {
"X.java",
"public class X {\n" +
" void foo(boolean b) {\n" +
- " String s = null;\n" +
- " while (true) {\n" +
+ " String s = null;\n" +
+ " while (true) {\n" +
" try {\n" +
- " if (b)\n" +
- " s = \"hi\";\n" +
- " }\n" +
- " finally {\n" +
- " s.length();\n" +
- " s = null;\n" +
- " }\n" +
- " }\n" +
+ " if (b)\n" +
+ " s = \"hi\";\n" +
+ " }\n" +
+ " finally {\n" +
+ " s.length();\n" +
+ " s = null;\n" +
+ " }\n" +
+ " }\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " s.length();\n" +
- " ^\n" +
- "Potential null pointer access: The variable s may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " s.length();\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable s may be null at this location\n" +
"----------\n");
}
@@ -16736,25 +16736,25 @@ public void testBug345305_7() {
"X.java",
"public class X {\n" +
" void foo(boolean b) {\n" +
- " while (true) {\n" +
- " String s = null;\n" +
+ " while (true) {\n" +
+ " String s = null;\n" +
" try {\n" +
- " if (b)\n" +
- " s = \"hi\";\n" +
- " }\n" +
- " finally {\n" +
- " s.length();\n" +
- " s = null;\n" +
- " }\n" +
- " }\n" +
+ " if (b)\n" +
+ " s = \"hi\";\n" +
+ " }\n" +
+ " finally {\n" +
+ " s.length();\n" +
+ " s = null;\n" +
+ " }\n" +
+ " }\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " s.length();\n" +
- " ^\n" +
- "Potential null pointer access: The variable s may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " s.length();\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable s may be null at this location\n" +
"----------\n");
}
@@ -16766,24 +16766,24 @@ public void testBug345305_8() {
"X.java",
"public class X {\n" +
" void foo(Object o) {\n" +
- " while (true) {\n" +
- " String s = null;\n" +
+ " while (true) {\n" +
+ " String s = null;\n" +
" try {\n" +
- " s = (String) o;\n" +
- " }\n" +
- " finally {\n" +
- " s.length();\n" +
- " s = null;\n" +
- " }\n" +
- " }\n" +
+ " s = (String) o;\n" +
+ " }\n" +
+ " finally {\n" +
+ " s.length();\n" +
+ " s = null;\n" +
+ " }\n" +
+ " }\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " s.length();\n" +
- " ^\n" +
- "Potential null pointer access: The variable s may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " s.length();\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable s may be null at this location\n" +
"----------\n");
}
@@ -16795,24 +16795,24 @@ public void testBug345305_9() {
"X.java",
"public class X {\n" +
" void foo(int i, int j) {\n" +
- " while (true) {\n" +
- " String s = null;\n" +
+ " while (true) {\n" +
+ " String s = null;\n" +
" try {\n" +
- " s = ((i / j) == 3) ? \"3\" : \"not-3\";\n" +
- " }\n" +
- " finally {\n" +
- " s.length();\n" +
- " s = null;\n" +
- " }\n" +
- " }\n" +
+ " s = ((i / j) == 3) ? \"3\" : \"not-3\";\n" +
+ " }\n" +
+ " finally {\n" +
+ " s.length();\n" +
+ " s = null;\n" +
+ " }\n" +
+ " }\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " s.length();\n" +
- " ^\n" +
- "Potential null pointer access: The variable s may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " s.length();\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable s may be null at this location\n" +
"----------\n");
}
@@ -16824,8 +16824,8 @@ public void testBug345305_10() {
"X.java",
"public class X {\n" +
" void foo(int j) {\n" +
- " while (true) {\n" +
- " String s = null;\n" +
+ " while (true) {\n" +
+ " String s = null;\n" +
" try {\n" +
" int i=0;\n" +
" block: {\n" +
@@ -16833,21 +16833,21 @@ public void testBug345305_10() {
" break block;\n" +
" s = \"\";\n" +
" return;\n" +
- " }\n" +
- " }\n" +
- " finally {\n" +
- " s.length();\n" +
- " s = null;\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
+ " finally {\n" +
+ " s.length();\n" +
+ " s = null;\n" +
+ " }\n" +
+ " }\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 15)\n" +
- " s.length();\n" +
- " ^\n" +
- "Potential null pointer access: The variable s may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 15)\n" +
+ " s.length();\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable s may be null at this location\n" +
"----------\n");
}
@@ -16859,29 +16859,29 @@ public void testBug345305_11() {
"X.java",
"public class X {\n" +
" void foo(int j) {\n" +
- " while (true) {\n" +
- " String s = null;\n" +
+ " while (true) {\n" +
+ " String s = null;\n" +
" try {\n" +
" switch (j) {\n" +
" case 3:\n" +
" s = \"\";\n" +
" return;\n" +
" default: return;\n" +
- " }\n" +
- " }\n" +
- " finally {\n" +
- " s.length();\n" +
- " s = null;\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
+ " finally {\n" +
+ " s.length();\n" +
+ " s = null;\n" +
+ " }\n" +
+ " }\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 14)\n" +
- " s.length();\n" +
- " ^\n" +
- "Potential null pointer access: The variable s may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 14)\n" +
+ " s.length();\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable s may be null at this location\n" +
"----------\n");
}
@@ -16893,24 +16893,24 @@ public void testBug345305_12() {
"X.java",
"public class X {\n" +
" String foo(boolean b) {\n" +
- " while (true) {\n" +
- " String s = null;\n" +
+ " while (true) {\n" +
+ " String s = null;\n" +
" try {\n" +
- " return b ? (s = \"be\") : \"be not\";\n" +
- " }\n" +
- " finally {\n" +
- " s.length();\n" +
- " s = null;\n" +
- " }\n" +
- " }\n" +
+ " return b ? (s = \"be\") : \"be not\";\n" +
+ " }\n" +
+ " finally {\n" +
+ " s.length();\n" +
+ " s = null;\n" +
+ " }\n" +
+ " }\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " s.length();\n" +
- " ^\n" +
- "Potential null pointer access: The variable s may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " s.length();\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable s may be null at this location\n" +
"----------\n");
}
@@ -16922,27 +16922,27 @@ public void testBug345305_13() {
"X.java",
"public class X {\n" +
" String foo(boolean b) {\n" +
- " while (true) {\n" +
+ " while (true) {\n" +
" String s = null;\n" +
- " RuntimeException ex = new RuntimeException();\n" +
+ " RuntimeException ex = new RuntimeException();\n" +
" try {\n" +
" if (b)\n" +
" throw ex;\n" +
- " s = \"be\";\n" +
- " }\n" +
- " finally {\n" +
- " s.length();\n" +
- " s = null;\n" +
- " }\n" +
- " }\n" +
+ " s = \"be\";\n" +
+ " }\n" +
+ " finally {\n" +
+ " s.length();\n" +
+ " s = null;\n" +
+ " }\n" +
+ " }\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " s.length();\n" +
- " ^\n" +
- "Potential null pointer access: The variable s may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " s.length();\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable s may be null at this location\n" +
"----------\n");
}
@@ -16954,23 +16954,23 @@ public void testBug345305_14() {
"X.java",
"public class X {\n" +
" void foo1(boolean b) {\n" +
- " while (true) {\n" +
+ " while (true) {\n" +
" String s = null;\n" +
" try {\n" +
" do {\n" +
" s = \"be\";\n" +
" if (b)\n" +
" return;\n" +
- " } while (true);\n" +
- " }\n" +
- " finally {\n" +
- " s.length(); // don't complain here\n" +
- " s = null;\n" +
- " }\n" +
- " }\n" +
+ " } while (true);\n" +
+ " }\n" +
+ " finally {\n" +
+ " s.length(); // don't complain here\n" +
+ " s = null;\n" +
+ " }\n" +
+ " }\n" +
" }\n" +
" void foo2(boolean b) {\n" +
- " while (true) {\n" +
+ " while (true) {\n" +
" String s = null;\n" +
" try {\n" +
" do {\n" +
@@ -16978,21 +16978,21 @@ public void testBug345305_14() {
" continue;\n" +
" s = \"be\";\n" +
" b = !b;\n" +
- " } while (b);\n" +
- " }\n" +
- " finally {\n" +
- " s.length();\n" +
- " s = null;\n" +
- " }\n" +
- " }\n" +
+ " } while (b);\n" +
+ " }\n" +
+ " finally {\n" +
+ " s.length();\n" +
+ " s = null;\n" +
+ " }\n" +
+ " }\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 30)\n" +
- " s.length();\n" +
- " ^\n" +
- "Potential null pointer access: The variable s may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 30)\n" +
+ " s.length();\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable s may be null at this location\n" +
"----------\n");
}
@@ -17002,37 +17002,37 @@ public void testBug364326() {
runNegativeNullTest(
new String[] {
"NPE_OnBoxing.java",
- "\n" +
- "public class NPE_OnBoxing\n" +
- "{\n" +
- " private interface IValue\n" +
- " {\n" +
- " boolean isSomething();\n" +
- " }\n" +
- "\n" +
- " private final IValue m_Value;\n" +
- "\n" +
- " public NPE_OnBoxing()\n" +
- " {\n" +
- " m_Value = null;\n" +
- " }\n" +
- "\n" +
- " public boolean isSomething()\n" +
- " {\n" +
- " return m_Value != null ? m_Value.isSomething() : null;\n" +
- " }\n" +
- "\n" +
- " public static void main(final String [] args)\n" +
- " {\n" +
- " new NPE_OnBoxing().isSomething();\n" +
- " }\n" +
+ "\n" +
+ "public class NPE_OnBoxing\n" +
+ "{\n" +
+ " private interface IValue\n" +
+ " {\n" +
+ " boolean isSomething();\n" +
+ " }\n" +
+ "\n" +
+ " private final IValue m_Value;\n" +
+ "\n" +
+ " public NPE_OnBoxing()\n" +
+ " {\n" +
+ " m_Value = null;\n" +
+ " }\n" +
+ "\n" +
+ " public boolean isSomething()\n" +
+ " {\n" +
+ " return m_Value != null ? m_Value.isSomething() : null;\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(final String [] args)\n" +
+ " {\n" +
+ " new NPE_OnBoxing().isSomething();\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in NPE_OnBoxing.java (at line 18)\n" +
- " return m_Value != null ? m_Value.isSomething() : null;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Potential null pointer access: This expression of type Boolean may be null but requires auto-unboxing\n" +
+ "----------\n" +
+ "1. ERROR in NPE_OnBoxing.java (at line 18)\n" +
+ " return m_Value != null ? m_Value.isSomething() : null;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Potential null pointer access: This expression of type Boolean may be null but requires auto-unboxing\n" +
"----------\n");
}
@@ -17041,41 +17041,41 @@ public void testBug401088() {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- "\n" +
- " private static void occasionallyThrowException() throws Exception {\n" +
- " throw new Exception();\n" +
- " }\n" +
- "\n" +
- " private static void open() throws Exception {\n" +
- " occasionallyThrowException();\n" +
- " }\n" +
- "\n" +
- " private static void close() throws Exception {\n" +
- " occasionallyThrowException();\n" +
- " }\n" +
- "\n" +
- " public static void main(String s[]) {\n" +
- " Exception exc = null;\n" +
- " try {\n" +
- " open();\n" +
- " // do more things\n" +
- " }\n" +
- " catch (Exception e) {\n" +
- " exc = e;\n" +
- " }\n" +
- " finally {\n" +
- " try {\n" +
- " close();\n" +
- " }\n" +
- " catch (Exception e) {\n" +
- " if (exc == null) // should not warn on this line\n" +
- " exc = e;\n" +
- " }\n" +
- " }\n" +
- " if (exc != null)\n" +
- " System.out.println(exc);\n" +
- " }\n" +
+ "public class X {\n" +
+ "\n" +
+ " private static void occasionallyThrowException() throws Exception {\n" +
+ " throw new Exception();\n" +
+ " }\n" +
+ "\n" +
+ " private static void open() throws Exception {\n" +
+ " occasionallyThrowException();\n" +
+ " }\n" +
+ "\n" +
+ " private static void close() throws Exception {\n" +
+ " occasionallyThrowException();\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String s[]) {\n" +
+ " Exception exc = null;\n" +
+ " try {\n" +
+ " open();\n" +
+ " // do more things\n" +
+ " }\n" +
+ " catch (Exception e) {\n" +
+ " exc = e;\n" +
+ " }\n" +
+ " finally {\n" +
+ " try {\n" +
+ " close();\n" +
+ " }\n" +
+ " catch (Exception e) {\n" +
+ " if (exc == null) // should not warn on this line\n" +
+ " exc = e;\n" +
+ " }\n" +
+ " }\n" +
+ " if (exc != null)\n" +
+ " System.out.println(exc);\n" +
+ " }\n" +
"}\n"
},
"java.lang.Exception");
@@ -17085,42 +17085,42 @@ public void testBug401088a() {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- "\n" +
- " private static void occasionallyThrowException() throws Exception {\n" +
- " throw new Exception();\n" +
- " }\n" +
- "\n" +
- " private static void open() throws Exception {\n" +
- " occasionallyThrowException();\n" +
- " }\n" +
- "\n" +
- " private static void close() throws Exception {\n" +
- " occasionallyThrowException();\n" +
- " }\n" +
- "\n" +
- " public static void main(String s[]) {\n" +
- " Exception exc = null;\n" +
- " try {\n" +
- " open();\n" +
- " // do more things\n" +
- " }\n" +
- " catch (Exception e) {\n" +
- " exc = e;\n" +
- " }\n" +
- " finally {\n" +
- " try {\n" +
- " close();\n" +
- " }\n" +
- " catch (Exception e) {\n" +
- " if (exc == null) // should not warn on this line\n" +
- " exc = e;\n" +
- " }\n" +
- " finally { System.out.print(1); }\n" +
- " }\n" +
- " if (exc != null)\n" +
- " System.out.println(exc);\n" +
- " }\n" +
+ "public class X {\n" +
+ "\n" +
+ " private static void occasionallyThrowException() throws Exception {\n" +
+ " throw new Exception();\n" +
+ " }\n" +
+ "\n" +
+ " private static void open() throws Exception {\n" +
+ " occasionallyThrowException();\n" +
+ " }\n" +
+ "\n" +
+ " private static void close() throws Exception {\n" +
+ " occasionallyThrowException();\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String s[]) {\n" +
+ " Exception exc = null;\n" +
+ " try {\n" +
+ " open();\n" +
+ " // do more things\n" +
+ " }\n" +
+ " catch (Exception e) {\n" +
+ " exc = e;\n" +
+ " }\n" +
+ " finally {\n" +
+ " try {\n" +
+ " close();\n" +
+ " }\n" +
+ " catch (Exception e) {\n" +
+ " if (exc == null) // should not warn on this line\n" +
+ " exc = e;\n" +
+ " }\n" +
+ " finally { System.out.print(1); }\n" +
+ " }\n" +
+ " if (exc != null)\n" +
+ " System.out.println(exc);\n" +
+ " }\n" +
"}\n"
},
"1java.lang.Exception");
@@ -17130,35 +17130,35 @@ public void test401092() {
runConformTest(
new String[] {
"X.java",
- "import java.util.Date;\n" +
- "\n" +
- "public class X {\n" +
- "\n" +
- " private static void occasionallyThrowException() throws Exception {\n" +
- " throw new Exception();\n" +
- " }\n" +
- "\n" +
- " private static Date createDate() throws Exception {\n" +
- " occasionallyThrowException();\n" +
- " return new Date();\n" +
- " }\n" +
- "\n" +
- " public static void main(String s[]) {\n" +
- " Date d = null;\n" +
- " try {\n" +
- " d = createDate();\n" +
- " System.out.println(d.toString());\n" +
- " try {\n" +
- " occasionallyThrowException();\n" +
- " }\n" +
- " catch (Exception exc) {\n" +
- " }\n" +
- " }\n" +
- " catch (Exception exc) {\n" +
- " if (d != null) // should not warn in this line\n" +
- " System.out.println(d.toString());\n" +
- " }\n" +
- " }\n" +
+ "import java.util.Date;\n" +
+ "\n" +
+ "public class X {\n" +
+ "\n" +
+ " private static void occasionallyThrowException() throws Exception {\n" +
+ " throw new Exception();\n" +
+ " }\n" +
+ "\n" +
+ " private static Date createDate() throws Exception {\n" +
+ " occasionallyThrowException();\n" +
+ " return new Date();\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String s[]) {\n" +
+ " Date d = null;\n" +
+ " try {\n" +
+ " d = createDate();\n" +
+ " System.out.println(d.toString());\n" +
+ " try {\n" +
+ " occasionallyThrowException();\n" +
+ " }\n" +
+ " catch (Exception exc) {\n" +
+ " }\n" +
+ " }\n" +
+ " catch (Exception exc) {\n" +
+ " if (d != null) // should not warn in this line\n" +
+ " System.out.println(d.toString());\n" +
+ " }\n" +
+ " }\n" +
"}\n"
});
}
@@ -17167,37 +17167,37 @@ public void test401092a() {
runConformTest(
new String[] {
"X.java",
- "import java.util.Date;\n" +
- "\n" +
- "public class X {\n" +
- "\n" +
- " private static void occasionallyThrowException() throws Exception {\n" +
- " throw new Exception();\n" +
- " }\n" +
- "\n" +
- " private static Date createDate() throws Exception {\n" +
- " occasionallyThrowException();\n" +
- " return new Date();\n" +
- " }\n" +
- "\n" +
- " public static void main(String s[]) {\n" +
- " Date d = null;\n" +
- " try {\n" +
- " d = createDate();\n" +
- " System.out.println(d.toString());\n" +
- " try {\n" +
- " occasionallyThrowException();\n" +
- " }\n" +
- " catch (Exception exc) {\n" +
+ "import java.util.Date;\n" +
+ "\n" +
+ "public class X {\n" +
+ "\n" +
+ " private static void occasionallyThrowException() throws Exception {\n" +
+ " throw new Exception();\n" +
+ " }\n" +
+ "\n" +
+ " private static Date createDate() throws Exception {\n" +
+ " occasionallyThrowException();\n" +
+ " return new Date();\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String s[]) {\n" +
+ " Date d = null;\n" +
+ " try {\n" +
+ " d = createDate();\n" +
+ " System.out.println(d.toString());\n" +
+ " try {\n" +
+ " occasionallyThrowException();\n" +
" }\n" +
- " finally { System.out.println(1); }\n" +
- " }\n" +
- " catch (Exception exc) {\n" +
- " if (d != null) // should not warn in this line\n" +
- " System.out.println(d.toString());\n" +
+ " catch (Exception exc) {\n" +
+ " }\n" +
+ " finally { System.out.println(1); }\n" +
+ " }\n" +
+ " catch (Exception exc) {\n" +
+ " if (d != null) // should not warn in this line\n" +
+ " System.out.println(d.toString());\n" +
" }\n" +
- " finally { System.out.println(2); }\n" +
- " }\n" +
+ " finally { System.out.println(2); }\n" +
+ " }\n" +
"}\n"
});
}
@@ -17206,53 +17206,53 @@ public void testBug402993() {
runNegativeNullTest(
new String[] {
"Test.java",
- "public class Test {\n" +
- "\n" +
- " private static void occasionallyThrowException() throws Exception {\n" +
- " if ((System.currentTimeMillis() & 1L) != 0L)\n" +
- " throw new Exception();\n" +
- " }\n" +
- "\n" +
- " private static void open() throws Exception {\n" +
- " occasionallyThrowException();\n" +
- " }\n" +
- "\n" +
- " private static void close() throws Exception {\n" +
- " occasionallyThrowException();\n" +
- " }\n" +
- "\n" +
- " public static void main(String s[]) {\n" +
+ "public class Test {\n" +
+ "\n" +
+ " private static void occasionallyThrowException() throws Exception {\n" +
+ " if ((System.currentTimeMillis() & 1L) != 0L)\n" +
+ " throw new Exception();\n" +
+ " }\n" +
+ "\n" +
+ " private static void open() throws Exception {\n" +
+ " occasionallyThrowException();\n" +
+ " }\n" +
+ "\n" +
+ " private static void close() throws Exception {\n" +
+ " occasionallyThrowException();\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String s[]) {\n" +
" Exception exc = null;\n" +
- " try {\n" +
- " open();\n" +
- " // do more things\n" +
- " }\n" +
- " catch (Exception e) {\n" +
- " if (exc == null) // no warning here ??\n" +
- " ;\n" +
- " }\n" +
- " finally {\n" +
- " try {\n" +
- " close();\n" +
- " }\n" +
- " catch (Exception e) {\n" +
- " if (exc == null) // No warning here ??\n" +
- " exc = e;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ " try {\n" +
+ " open();\n" +
+ " // do more things\n" +
+ " }\n" +
+ " catch (Exception e) {\n" +
+ " if (exc == null) // no warning here ??\n" +
+ " ;\n" +
+ " }\n" +
+ " finally {\n" +
+ " try {\n" +
+ " close();\n" +
+ " }\n" +
+ " catch (Exception e) {\n" +
+ " if (exc == null) // No warning here ??\n" +
+ " exc = e;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 23)\n" +
- " if (exc == null) // no warning here ??\n" +
- " ^^^\n" +
- "Redundant null check: The variable exc can only be null at this location\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 31)\n" +
- " if (exc == null) // No warning here ??\n" +
- " ^^^\n" +
- "Redundant null check: The variable exc can only be null at this location\n" +
+ },
+ "----------\n" +
+ "1. ERROR in Test.java (at line 23)\n" +
+ " if (exc == null) // no warning here ??\n" +
+ " ^^^\n" +
+ "Redundant null check: The variable exc can only be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 31)\n" +
+ " if (exc == null) // No warning here ??\n" +
+ " ^^^\n" +
+ "Redundant null check: The variable exc can only be null at this location\n" +
"----------\n");
}
// Bug 402993 - [null] Follow up of bug 401088: Missing warning about redundant null check
@@ -17261,55 +17261,55 @@ public void testBug402993a() {
runNegativeNullTest(
new String[] {
"Test.java",
- "public class Test {\n" +
- "\n" +
- " private static void occasionallyThrowException() throws Exception {\n" +
- " if ((System.currentTimeMillis() & 1L) != 0L)\n" +
- " throw new Exception();\n" +
- " }\n" +
- "\n" +
- " private static void open() throws Exception {\n" +
- " occasionallyThrowException();\n" +
- " }\n" +
- "\n" +
- " private static void close() throws Exception {\n" +
- " occasionallyThrowException();\n" +
- " }\n" +
- "\n" +
- " public static void main(String s[]) {\n" +
- " Exception exc = null;\n" +
- " try {\n" +
- " open();\n" +
- " // do more things\n" +
- " }\n" +
- " catch (Exception e) {\n" +
- " if (exc == null) // no warning here ??\n" +
- " ;\n" +
- " }\n" +
- " finally {\n" +
- " try {\n" +
- " close();\n" +
- " }\n" +
- " catch (Exception e) {\n" +
- " if (exc == null) // No warning here ??\n" +
- " exc = e;\n" +
+ "public class Test {\n" +
+ "\n" +
+ " private static void occasionallyThrowException() throws Exception {\n" +
+ " if ((System.currentTimeMillis() & 1L) != 0L)\n" +
+ " throw new Exception();\n" +
+ " }\n" +
+ "\n" +
+ " private static void open() throws Exception {\n" +
+ " occasionallyThrowException();\n" +
+ " }\n" +
+ "\n" +
+ " private static void close() throws Exception {\n" +
+ " occasionallyThrowException();\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String s[]) {\n" +
+ " Exception exc = null;\n" +
+ " try {\n" +
+ " open();\n" +
+ " // do more things\n" +
+ " }\n" +
+ " catch (Exception e) {\n" +
+ " if (exc == null) // no warning here ??\n" +
+ " ;\n" +
+ " }\n" +
+ " finally {\n" +
+ " try {\n" +
+ " close();\n" +
+ " }\n" +
+ " catch (Exception e) {\n" +
+ " if (exc == null) // No warning here ??\n" +
+ " exc = e;\n" +
" } finally {\n" +
" System.out.print(1);\n" +
" }\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 23)\n" +
- " if (exc == null) // no warning here ??\n" +
- " ^^^\n" +
- "Redundant null check: The variable exc can only be null at this location\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 31)\n" +
- " if (exc == null) // No warning here ??\n" +
- " ^^^\n" +
- "Redundant null check: The variable exc can only be null at this location\n" +
+ },
+ "----------\n" +
+ "1. ERROR in Test.java (at line 23)\n" +
+ " if (exc == null) // no warning here ??\n" +
+ " ^^^\n" +
+ "Redundant null check: The variable exc can only be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 31)\n" +
+ " if (exc == null) // No warning here ??\n" +
+ " ^^^\n" +
+ "Redundant null check: The variable exc can only be null at this location\n" +
"----------\n");
}
public void testBug453305() {
@@ -17317,35 +17317,35 @@ public void testBug453305() {
runConformTest(
new String[] {
"NullTest.java",
- "import java.util.*;\n" +
- "public class NullTest {\n" +
- " class SomeOtherClass {\n" +
- "\n" +
- " public SomeOtherClass m() {\n" +
- " return new SomeOtherClass();\n" +
- " }\n" +
- "\n" +
- " public void doSomething() {\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public Object m1() {\n" +
- " SomeOtherClass result = null;\n" +
- " List<Object> list = new ArrayList<Object>();\n" +
- " for (Object next : list) {\n" +
- " System.out.println(next);\n" +
- " boolean bool = false;\n" +
- " if (bool) {\n" +
- " SomeOtherClass something = new SomeOtherClass();\n" +
- " result = something.m();\n" +
- " } else {\n" +
- " result = new SomeOtherClass();\n" +
- " }\n" +
- " result.doSomething(); // warning is here\n" +
- " break;\n" +
- " }\n" +
- " return null;\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "public class NullTest {\n" +
+ " class SomeOtherClass {\n" +
+ "\n" +
+ " public SomeOtherClass m() {\n" +
+ " return new SomeOtherClass();\n" +
+ " }\n" +
+ "\n" +
+ " public void doSomething() {\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public Object m1() {\n" +
+ " SomeOtherClass result = null;\n" +
+ " List<Object> list = new ArrayList<Object>();\n" +
+ " for (Object next : list) {\n" +
+ " System.out.println(next);\n" +
+ " boolean bool = false;\n" +
+ " if (bool) {\n" +
+ " SomeOtherClass something = new SomeOtherClass();\n" +
+ " result = something.m();\n" +
+ " } else {\n" +
+ " result = new SomeOtherClass();\n" +
+ " }\n" +
+ " result.doSomething(); // warning is here\n" +
+ " break;\n" +
+ " }\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
});
}
@@ -17354,21 +17354,21 @@ public void testBug431016() {
runConformTest(
new String[] {
"Test.java",
- "public class Test {\n" +
- " void test(Object[] values) {\n" +
- " Object first = null;\n" +
- " for (Object current : values) {\n" +
- " if (first == null) {\n" +
- " first = current;\n" +
- " }\n" +
- "\n" +
- " if (current.hashCode() > 0) {\n" +
- " System.out.println(first.hashCode());\n" +
- " }\n" +
- "\n" +
- " System.out.println(first.hashCode());\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " void test(Object[] values) {\n" +
+ " Object first = null;\n" +
+ " for (Object current : values) {\n" +
+ " if (first == null) {\n" +
+ " first = current;\n" +
+ " }\n" +
+ "\n" +
+ " if (current.hashCode() > 0) {\n" +
+ " System.out.println(first.hashCode());\n" +
+ " }\n" +
+ "\n" +
+ " System.out.println(first.hashCode());\n" +
+ " }\n" +
+ " }\n" +
"}\n"
});
}
@@ -17377,17 +17377,17 @@ public void testBug431016_simplified() {
runConformTest(
new String[] {
"Test.java",
- "public class Test {\n" +
- " void test(Object input, boolean b) {\n" +
- " Object o = null;\n" +
- " while (true) {\n" +
- " if (o == null)\n" +
- " o = input;\n" +
- " if (b)\n" +
- " o.toString();\n" +
- " o.toString();\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " void test(Object input, boolean b) {\n" +
+ " Object o = null;\n" +
+ " while (true) {\n" +
+ " if (o == null)\n" +
+ " o = input;\n" +
+ " if (b)\n" +
+ " o.toString();\n" +
+ " o.toString();\n" +
+ " }\n" +
+ " }\n" +
"}\n"
});
}
@@ -17398,30 +17398,30 @@ public void testBug432109() {
"Test.java",
"import java.util.Collection;\n" +
"public class Test {\n" +
- " public void test(Collection <Object> values)\n" +
- " {\n" +
- " boolean condition = false;\n" +
- " \n" +
- " for(Object value : values)\n" +
- " {\n" +
- " \n" +
- " if(value == null)\n" +
- " {\n" +
- " if( condition )\n" +
- " {\n" +
- " // without this continue statement, \n" +
- " // there is no warning below\n" +
- " continue; \n" +
- " }\n" +
- " \n" +
- " value = getDefaultValue();\n" +
- " }\n" +
- " \n" +
- " // IDE complains here about potential null pointer access\n" +
- " value.toString();\n" +
- " }\n" +
- " }\n" +
- "\n" +
+ " public void test(Collection <Object> values)\n" +
+ " {\n" +
+ " boolean condition = false;\n" +
+ " \n" +
+ " for(Object value : values)\n" +
+ " {\n" +
+ " \n" +
+ " if(value == null)\n" +
+ " {\n" +
+ " if( condition )\n" +
+ " {\n" +
+ " // without this continue statement, \n" +
+ " // there is no warning below\n" +
+ " continue; \n" +
+ " }\n" +
+ " \n" +
+ " value = getDefaultValue();\n" +
+ " }\n" +
+ " \n" +
+ " // IDE complains here about potential null pointer access\n" +
+ " value.toString();\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
" public String getDefaultValue() { return \"<empty>\"; }\n" +
"}\n"
});
@@ -17431,40 +17431,40 @@ public void testBug435528_orig() {
runner.testFiles =
new String[] {
"Test.java",
- "public class Test\n" +
- "{\n" +
- " static final String a = \"A\";\n" +
- "\n" +
- " static void main(String args[])\n" +
- " {\n" +
- " String x = null;\n" +
- " while (true) {\n" +
- " x = Math.random() < 0.5 ? a : \"BB\";\n" +
- " if (a != null) {\n" +
- " System.out.println(\"s2 value: \" + x);\n" +
- " }\n" +
- " if (x.equals(\"A\")) {\n" +
- " break;\n" +
- " } else {\n" +
- " x = null;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class Test\n" +
+ "{\n" +
+ " static final String a = \"A\";\n" +
+ "\n" +
+ " static void main(String args[])\n" +
+ " {\n" +
+ " String x = null;\n" +
+ " while (true) {\n" +
+ " x = Math.random() < 0.5 ? a : \"BB\";\n" +
+ " if (a != null) {\n" +
+ " System.out.println(\"s2 value: \" + x);\n" +
+ " }\n" +
+ " if (x.equals(\"A\")) {\n" +
+ " break;\n" +
+ " } else {\n" +
+ " x = null;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in Test.java (at line 10)\n" +
- " if (a != null) {\n" +
- " ^\n" +
- "Redundant null check: The field a is a nonnull constant\n" +
- "----------\n" +
- "2. WARNING in Test.java (at line 15)\n" +
- " } else {\n" +
- " x = null;\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 10)\n" +
+ " if (a != null) {\n" +
+ " ^\n" +
+ "Redundant null check: The field a is a nonnull constant\n" +
+ "----------\n" +
+ "2. WARNING in Test.java (at line 15)\n" +
+ " } else {\n" +
+ " x = null;\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
"----------\n";
runner.customOptions = getCompilerOptions();
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -17475,34 +17475,34 @@ public void testBug435528_notaconstant() {
true/*flush*/,
new String[] {
"Test.java",
- "public class Test\n" +
- "{\n" +
- " static String a ;\n" +
- "\n" +
- " static void main(String args[])\n" +
- " {\n" +
- " String x = null;\n" +
- " while (true) {\n" +
- " x = Math.random() < 0.5 ? a : \"BB\";\n" +
- " if (a != null) {\n" +
- " System.out.println(\"s2 value: \" + x);\n" +
- " }\n" +
- " if (x.equals(\"A\")) {\n" +
- " break;\n" +
- " } else {\n" +
- " x = null;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class Test\n" +
+ "{\n" +
+ " static String a ;\n" +
+ "\n" +
+ " static void main(String args[])\n" +
+ " {\n" +
+ " String x = null;\n" +
+ " while (true) {\n" +
+ " x = Math.random() < 0.5 ? a : \"BB\";\n" +
+ " if (a != null) {\n" +
+ " System.out.println(\"s2 value: \" + x);\n" +
+ " }\n" +
+ " if (x.equals(\"A\")) {\n" +
+ " break;\n" +
+ " } else {\n" +
+ " x = null;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in Test.java (at line 15)\n" +
- " } else {\n" +
- " x = null;\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
+ "----------\n" +
+ "1. WARNING in Test.java (at line 15)\n" +
+ " } else {\n" +
+ " x = null;\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
"----------\n",
"",
"",
@@ -17515,28 +17515,28 @@ public void testBug418500() {
"import java.util.*;\n" +
"public class Test {\n" +
(this.complianceLevel < ClassFileConstants.JDK1_5 ? "\n" : " @SuppressWarnings(\"unchecked\")\n" ) +
- " void method() {\n" +
- " Map topMap = new HashMap();\n" +
- " List targets = null;\n" +
- " \n" +
- " for (int idx = 1; idx < 100; idx++) {\n" +
- " String[] targetArray = (String[]) topMap.get(\"a\");\n" +
- " if (targetArray != null) {\n" +
- " targets = Arrays.asList(targetArray);\n" +
- " } else {\n" +
- " targets = new ArrayList(64);\n" +
- " }\n" +
- " if (targets.size() > 0) {\n" +
- " topMap.put(\"b\", targets.toArray(new String[1]));\n" +
- " } else {\n" +
- " topMap.remove(\"b\");\n" +
- " }\n" +
- "\n" +
- " // BUG - this statement causes null analysis to\n" +
- " // report that at the targets.size() statement above\n" +
- " // targets must be null. Commenting this line eliminates the error.\n" +
- " targets = null;\n" +
- " }\n" +
+ " void method() {\n" +
+ " Map topMap = new HashMap();\n" +
+ " List targets = null;\n" +
+ " \n" +
+ " for (int idx = 1; idx < 100; idx++) {\n" +
+ " String[] targetArray = (String[]) topMap.get(\"a\");\n" +
+ " if (targetArray != null) {\n" +
+ " targets = Arrays.asList(targetArray);\n" +
+ " } else {\n" +
+ " targets = new ArrayList(64);\n" +
+ " }\n" +
+ " if (targets.size() > 0) {\n" +
+ " topMap.put(\"b\", targets.toArray(new String[1]));\n" +
+ " } else {\n" +
+ " topMap.remove(\"b\");\n" +
+ " }\n" +
+ "\n" +
+ " // BUG - this statement causes null analysis to\n" +
+ " // report that at the targets.size() statement above\n" +
+ " // targets must be null. Commenting this line eliminates the error.\n" +
+ " targets = null;\n" +
+ " }\n" +
" }\n" +
"}\n"
});
@@ -17545,30 +17545,30 @@ public void testBug441737() {
runConformTest(
new String[] {
"Bogus.java",
- "public class Bogus {\n" +
- " static boolean ok = true;\n" +
- " static int count = 0;\n" +
- " public static void main(String[] args) {\n" +
- " Thing x = new Thing();\n" +
- " // if y is left uninitialized here, the warning below disappears\n" +
- " Thing y = null;\n" +
- " do {\n" +
- " y = x;\n" +
- " if (ok) {\n" +
- " // if this assignment is moved out of the if statement\n" +
- " // or commented out, the warning below disappears\n" +
- " x = y.resolve();\n" +
- " }\n" +
- " // a warning about y being potentially null occurs here:\n" +
- " x = y.resolve();\n" +
- " } while (x != y);\n" +
- " }\n" +
- "\n" +
- " static class Thing {\n" +
- " public Thing resolve() {\n" +
- " return count++ > 2 ? this : new Thing();\n" +
- " }\n" +
- " }\n" +
+ "public class Bogus {\n" +
+ " static boolean ok = true;\n" +
+ " static int count = 0;\n" +
+ " public static void main(String[] args) {\n" +
+ " Thing x = new Thing();\n" +
+ " // if y is left uninitialized here, the warning below disappears\n" +
+ " Thing y = null;\n" +
+ " do {\n" +
+ " y = x;\n" +
+ " if (ok) {\n" +
+ " // if this assignment is moved out of the if statement\n" +
+ " // or commented out, the warning below disappears\n" +
+ " x = y.resolve();\n" +
+ " }\n" +
+ " // a warning about y being potentially null occurs here:\n" +
+ " x = y.resolve();\n" +
+ " } while (x != y);\n" +
+ " }\n" +
+ "\n" +
+ " static class Thing {\n" +
+ " public Thing resolve() {\n" +
+ " return count++ > 2 ? this : new Thing();\n" +
+ " }\n" +
+ " }\n" +
"}\n"
});
}
@@ -17579,38 +17579,38 @@ public void testBug195638_comment3() {
"Test.java",
"import java.sql.Connection;\n" +
"import java.sql.SQLException;\n" +
- "public class Test {\n" +
- " void m() throws SQLException\n" +
- " {\n" +
- " Connection conn = null;\n" +
- " try\n" +
- " {\n" +
- " conn = createConnection();\n" +
- "\n" +
- " for (; ; )\n" +
- " {\n" +
- " throwSomething();\n" +
- " }\n" +
- " }\n" +
- " catch (MyException e)\n" +
- " {\n" +
- " conn.rollback(); //The variable can never be null here...\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private void throwSomething() throws MyException\n" +
- " {\n" +
- " throw new MyException();\n" +
- " }\n" +
- "\n" +
- " class MyException extends Exception\n" +
- " {\n" +
- "\n" +
- " }\n" +
- "\n" +
- " private Connection createConnection()\n" +
- " {\n" +
- " return null;\n" +
+ "public class Test {\n" +
+ " void m() throws SQLException\n" +
+ " {\n" +
+ " Connection conn = null;\n" +
+ " try\n" +
+ " {\n" +
+ " conn = createConnection();\n" +
+ "\n" +
+ " for (; ; )\n" +
+ " {\n" +
+ " throwSomething();\n" +
+ " }\n" +
+ " }\n" +
+ " catch (MyException e)\n" +
+ " {\n" +
+ " conn.rollback(); //The variable can never be null here...\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " private void throwSomething() throws MyException\n" +
+ " {\n" +
+ " throw new MyException();\n" +
+ " }\n" +
+ "\n" +
+ " class MyException extends Exception\n" +
+ " {\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
+ " private Connection createConnection()\n" +
+ " {\n" +
+ " return null;\n" +
" }\n" +
"}\n"
});
@@ -17619,86 +17619,86 @@ public void testBug195638_comment6() {
runNegativeNullTest(
new String[] {
"CanOnlyBeNullShouldBeMayBeNull.java",
- "public class CanOnlyBeNullShouldBeMayBeNull {\n" +
- "\n" +
- " private void method() {\n" +
- " String tblVarRpl = null;\n" +
- " while (true) {\n" +
- " boolean isOpenVariableMortageRateProduct = true;\n" +
- " boolean tblVarRplAllElementAddedIndicator = false;\n" +
- " if (isOpenVariableMortageRateProduct) {\n" +
- " if (tblVarRplAllElementAddedIndicator == false)\n" +
- " tblVarRpl = \"\";\n" +
- " tblVarRpl.substring(1); //Can only be null???\n" +
- " return; \n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "public class CanOnlyBeNullShouldBeMayBeNull {\n" +
+ "\n" +
+ " private void method() {\n" +
+ " String tblVarRpl = null;\n" +
+ " while (true) {\n" +
+ " boolean isOpenVariableMortageRateProduct = true;\n" +
+ " boolean tblVarRplAllElementAddedIndicator = false;\n" +
+ " if (isOpenVariableMortageRateProduct) {\n" +
+ " if (tblVarRplAllElementAddedIndicator == false)\n" +
+ " tblVarRpl = \"\";\n" +
+ " tblVarRpl.substring(1); //Can only be null???\n" +
+ " return; \n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in CanOnlyBeNullShouldBeMayBeNull.java (at line 3)\n" +
- " private void method() {\n" +
- " ^^^^^^^^\n" +
- "The method method() from the type CanOnlyBeNullShouldBeMayBeNull is never used locally\n" +
- "----------\n" +
- "2. ERROR in CanOnlyBeNullShouldBeMayBeNull.java (at line 11)\n" +
- " tblVarRpl.substring(1); //Can only be null???\n" +
- " ^^^^^^^^^\n" +
- "Potential null pointer access: The variable tblVarRpl may be null at this location\n" +
+ "----------\n" +
+ "1. WARNING in CanOnlyBeNullShouldBeMayBeNull.java (at line 3)\n" +
+ " private void method() {\n" +
+ " ^^^^^^^^\n" +
+ "The method method() from the type CanOnlyBeNullShouldBeMayBeNull is never used locally\n" +
+ "----------\n" +
+ "2. ERROR in CanOnlyBeNullShouldBeMayBeNull.java (at line 11)\n" +
+ " tblVarRpl.substring(1); //Can only be null???\n" +
+ " ^^^^^^^^^\n" +
+ "Potential null pointer access: The variable tblVarRpl may be null at this location\n" +
"----------\n");
}
public void testBug195638_comment14() {
runNegativeNullTest(
new String[] {
"Test.java",
- "public class Test {\n" +
- " private void test() {\n" +
- " boolean x = true;\n" +
- " Object o = null;\n" +
- " \n" +
- " for (;;) {\n" +
- " if (x) o = new Object();\n" +
- " \n" +
+ "public class Test {\n" +
+ " private void test() {\n" +
+ " boolean x = true;\n" +
+ " Object o = null;\n" +
+ " \n" +
+ " for (;;) {\n" +
+ " if (x) o = new Object();\n" +
+ " \n" +
" o.toString(); // warning here\n" + // bug was: Null pointer access: The variable o can only be null at this location
- " \n" +
- " o = null;\n" +
- " }\n" +
- " }\n" +
+ " \n" +
+ " o = null;\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in Test.java (at line 2)\n" +
- " private void test() {\n" +
- " ^^^^^^\n" +
- "The method test() from the type Test is never used locally\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 9)\n" +
- " o.toString(); // warning here\n" +
- " ^\n" +
- "Potential null pointer access: The variable o may be null at this location\n" +
+ "----------\n" +
+ "1. WARNING in Test.java (at line 2)\n" +
+ " private void test() {\n" +
+ " ^^^^^^\n" +
+ "The method test() from the type Test is never used locally\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 9)\n" +
+ " o.toString(); // warning here\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable o may be null at this location\n" +
"----------\n");
}
public void testBug195638_comment19() {
runConformTest(
new String[] {
"Test.java",
- "public class Test {\n" +
- " public void testIt() {\n" +
- " Object aRole = null;\n" +
- " for (;;) {\n" +
- " aRole = new Object();\n" +
- " if (aRole.toString() == null) {\n" +
- " aRole = getObject(); // changing to \"new Object()\" makes warning disappear.\n" +
- " }\n" +
- " aRole.toString();\n" +
- " // above line gets: \"Null pointer access: The variable aRole can only be null at this location\"\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- " private Object getObject() {\n" +
- " return new Object();\n" +
- " }\n" +
+ "public class Test {\n" +
+ " public void testIt() {\n" +
+ " Object aRole = null;\n" +
+ " for (;;) {\n" +
+ " aRole = new Object();\n" +
+ " if (aRole.toString() == null) {\n" +
+ " aRole = getObject(); // changing to \"new Object()\" makes warning disappear.\n" +
+ " }\n" +
+ " aRole.toString();\n" +
+ " // above line gets: \"Null pointer access: The variable aRole can only be null at this location\"\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
+ " private Object getObject() {\n" +
+ " return new Object();\n" +
+ " }\n" +
"}\n"
});
}
@@ -17706,38 +17706,38 @@ public void testBug454031() {
runNegativeNullTest(
new String[] {
"xy/Try.java",
- "package xy;\n" +
- "\n" +
- "public class Try {\n" +
- " public static void main(String[] args) {\n" +
- " foo(new Node());\n" +
- " }\n" +
- " static void foo(Node n) {\n" +
- " Node selectedNode= n;\n" +
- " if (selectedNode == null) {\n" +
- " return;\n" +
- " }\n" +
- " while (selectedNode != null && !(selectedNode instanceof Cloneable)) {\n" +
- " selectedNode= selectedNode.getParent();\n" +
- " }\n" +
- " if (selectedNode == null) { //wrong problem: Null comparison always yields false: The variable selectedNode cannot be null at this location\n" +
- " // wrong problem: dead code\n" +
- " System.out.println(selectedNode.hashCode());\n" +
- " }\n" +
- " }\n" +
+ "package xy;\n" +
+ "\n" +
+ "public class Try {\n" +
+ " public static void main(String[] args) {\n" +
+ " foo(new Node());\n" +
+ " }\n" +
+ " static void foo(Node n) {\n" +
+ " Node selectedNode= n;\n" +
+ " if (selectedNode == null) {\n" +
+ " return;\n" +
+ " }\n" +
+ " while (selectedNode != null && !(selectedNode instanceof Cloneable)) {\n" +
+ " selectedNode= selectedNode.getParent();\n" +
+ " }\n" +
+ " if (selectedNode == null) { //wrong problem: Null comparison always yields false: The variable selectedNode cannot be null at this location\n" +
+ " // wrong problem: dead code\n" +
+ " System.out.println(selectedNode.hashCode());\n" +
+ " }\n" +
+ " }\n" +
"}\n" +
- "\n" +
- "class Node {\n" +
- " Node getParent() {\n" +
- " return null;\n" +
- " }\n" +
+ "\n" +
+ "class Node {\n" +
+ " Node getParent() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in xy\\Try.java (at line 17)\n" +
- " System.out.println(selectedNode.hashCode());\n" +
- " ^^^^^^^^^^^^\n" +
- "Null pointer access: The variable selectedNode can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in xy\\Try.java (at line 17)\n" +
+ " System.out.println(selectedNode.hashCode());\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Null pointer access: The variable selectedNode can only be null at this location\n" +
"----------\n");
}
// switch with fall-through nested in for:
@@ -17745,30 +17745,30 @@ public void testBug451660() {
runNegativeNullTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " String s = null;\n" +
- " for(; true;) // ok with \"while(true)\"\n" +
- " {\n" +
- " switch(0)\n" +
- " {\n" +
- " default:\n" +
- " s = \"Hello!\";\n" +
- " case 1:\n" +
- " System.out.println(s.toString());\n" +
- " }\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args)\n" +
+ " {\n" +
+ " String s = null;\n" +
+ " for(; true;) // ok with \"while(true)\"\n" +
+ " {\n" +
+ " switch(0)\n" +
+ " {\n" +
+ " default:\n" +
+ " s = \"Hello!\";\n" +
+ " case 1:\n" +
+ " System.out.println(s.toString());\n" +
+ " }\n" +
+ " return;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " System.out.println(s.toString());\n" +
- " ^\n" +
- "Potential null pointer access: The variable s may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " System.out.println(s.toString());\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable s may be null at this location\n" +
"----------\n");
}
public void testBug486912KnownNullInLoop() {
@@ -17794,17 +17794,17 @@ public void testBug486912KnownNullInLoop() {
" }\n" +
"}\n" +
"",
- },
- "----------\n" +
- "1. ERROR in test\\KnownNullInLoop.java (at line 7)\n" +
- " o1.hashCode(); // ERROR1: known null, but no problem reported.\n" +
- " ^^\n" +
- "Null pointer access: The variable o1 can only be null at this location\n" +
- "----------\n" +
- "2. ERROR in test\\KnownNullInLoop.java (at line 14)\n" +
- " o1.hashCode(); // ERROR2: known null, but no problem reported.\n" +
- " ^^\n" +
- "Null pointer access: The variable o1 can only be null at this location\n" +
+ },
+ "----------\n" +
+ "1. ERROR in test\\KnownNullInLoop.java (at line 7)\n" +
+ " o1.hashCode(); // ERROR1: known null, but no problem reported.\n" +
+ " ^^\n" +
+ "Null pointer access: The variable o1 can only be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in test\\KnownNullInLoop.java (at line 14)\n" +
+ " o1.hashCode(); // ERROR2: known null, but no problem reported.\n" +
+ " ^^\n" +
+ "Null pointer access: The variable o1 can only be null at this location\n" +
"----------\n"
);
}
@@ -17885,57 +17885,57 @@ public void testBug486912PotNullInLoop_orig() {
"\n" +
"}\n" +
"",
- },
- "----------\n" +
- "1. ERROR in test\\PotNullInLoop.java (at line 14)\n" +
- " potNull.hashCode(); // ERROR 1: pot null, but nothing reported\n" +
- " ^^^^^^^\n" +
- "Null pointer access: The variable potNull can only be null at this location\n" +
- "----------\n" +
- "2. ERROR in test\\PotNullInLoop.java (at line 15)\n" +
- " ponNullOrNonNull.hashCode(); // ERROR 2: pot null, but nothing reported\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Potential null pointer access: The variable ponNullOrNonNull may be null at this location\n" +
- "----------\n" +
- "3. ERROR in test\\PotNullInLoop.java (at line 27)\n" +
- " potNull.hashCode(); // ERROR 3 : pot null, but nothing reported\n" +
- " ^^^^^^^\n" +
- "Null pointer access: The variable potNull can only be null at this location\n" +
- "----------\n" +
- "4. ERROR in test\\PotNullInLoop.java (at line 28)\n" +
- " ponNullOrNonNull.hashCode(); // ERROR 4: pot null, but nothing reported\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Potential null pointer access: The variable ponNullOrNonNull may be null at this location\n" +
- "----------\n" +
- "5. ERROR in test\\PotNullInLoop.java (at line 41)\n" +
- " potNull.hashCode(); // OK: pot null, is reported\n" +
- " ^^^^^^^\n" +
- "Null pointer access: The variable potNull can only be null at this location\n" +
- "----------\n" +
- "6. ERROR in test\\PotNullInLoop.java (at line 42)\n" +
- " ponNullOrNonNull.hashCode(); // OK: pot null, is reported\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Potential null pointer access: The variable ponNullOrNonNull may be null at this location\n" +
- "----------\n" +
- "7. ERROR in test\\PotNullInLoop.java (at line 54)\n" +
- " potNull.hashCode(); // OK: pot null, is reported\n" +
- " ^^^^^^^\n" +
- "Null pointer access: The variable potNull can only be null at this location\n" +
- "----------\n" +
- "8. ERROR in test\\PotNullInLoop.java (at line 55)\n" +
- " ponNullOrNonNull.hashCode(); // OK: pot null, is reported\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Potential null pointer access: The variable ponNullOrNonNull may be null at this location\n" +
- "----------\n" +
- "9. ERROR in test\\PotNullInLoop.java (at line 67)\n" +
- " potNull.hashCode(); // OK: pot null, is reported\n" +
- " ^^^^^^^\n" +
- "Null pointer access: The variable potNull can only be null at this location\n" +
- "----------\n" +
- "10. ERROR in test\\PotNullInLoop.java (at line 68)\n" +
- " ponNullOrNonNull.hashCode(); // OK: pot null, is reported\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Potential null pointer access: The variable ponNullOrNonNull may be null at this location\n" +
+ },
+ "----------\n" +
+ "1. ERROR in test\\PotNullInLoop.java (at line 14)\n" +
+ " potNull.hashCode(); // ERROR 1: pot null, but nothing reported\n" +
+ " ^^^^^^^\n" +
+ "Null pointer access: The variable potNull can only be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in test\\PotNullInLoop.java (at line 15)\n" +
+ " ponNullOrNonNull.hashCode(); // ERROR 2: pot null, but nothing reported\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Potential null pointer access: The variable ponNullOrNonNull may be null at this location\n" +
+ "----------\n" +
+ "3. ERROR in test\\PotNullInLoop.java (at line 27)\n" +
+ " potNull.hashCode(); // ERROR 3 : pot null, but nothing reported\n" +
+ " ^^^^^^^\n" +
+ "Null pointer access: The variable potNull can only be null at this location\n" +
+ "----------\n" +
+ "4. ERROR in test\\PotNullInLoop.java (at line 28)\n" +
+ " ponNullOrNonNull.hashCode(); // ERROR 4: pot null, but nothing reported\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Potential null pointer access: The variable ponNullOrNonNull may be null at this location\n" +
+ "----------\n" +
+ "5. ERROR in test\\PotNullInLoop.java (at line 41)\n" +
+ " potNull.hashCode(); // OK: pot null, is reported\n" +
+ " ^^^^^^^\n" +
+ "Null pointer access: The variable potNull can only be null at this location\n" +
+ "----------\n" +
+ "6. ERROR in test\\PotNullInLoop.java (at line 42)\n" +
+ " ponNullOrNonNull.hashCode(); // OK: pot null, is reported\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Potential null pointer access: The variable ponNullOrNonNull may be null at this location\n" +
+ "----------\n" +
+ "7. ERROR in test\\PotNullInLoop.java (at line 54)\n" +
+ " potNull.hashCode(); // OK: pot null, is reported\n" +
+ " ^^^^^^^\n" +
+ "Null pointer access: The variable potNull can only be null at this location\n" +
+ "----------\n" +
+ "8. ERROR in test\\PotNullInLoop.java (at line 55)\n" +
+ " ponNullOrNonNull.hashCode(); // OK: pot null, is reported\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Potential null pointer access: The variable ponNullOrNonNull may be null at this location\n" +
+ "----------\n" +
+ "9. ERROR in test\\PotNullInLoop.java (at line 67)\n" +
+ " potNull.hashCode(); // OK: pot null, is reported\n" +
+ " ^^^^^^^\n" +
+ "Null pointer access: The variable potNull can only be null at this location\n" +
+ "----------\n" +
+ "10. ERROR in test\\PotNullInLoop.java (at line 68)\n" +
+ " ponNullOrNonNull.hashCode(); // OK: pot null, is reported\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Potential null pointer access: The variable ponNullOrNonNull may be null at this location\n" +
"----------\n"
);
}
@@ -18007,32 +18007,32 @@ public void testBug486912PotNullInLoop() {
"\n" +
"}\n" +
"",
- },
- "----------\n" +
- "1. ERROR in test\\PotNullInLoop.java (at line 13)\n" +
- " potNull.hashCode(); // ERROR 1: pot null, but nothing reported\n" +
- " ^^^^^^^\n" +
- "Potential null pointer access: The variable potNull may be null at this location\n" +
- "----------\n" +
- "2. ERROR in test\\PotNullInLoop.java (at line 24)\n" +
- " potNull.hashCode(); // ERROR 3 : pot null, but nothing reported\n" +
- " ^^^^^^^\n" +
- "Potential null pointer access: The variable potNull may be null at this location\n" +
- "----------\n" +
- "3. ERROR in test\\PotNullInLoop.java (at line 36)\n" +
- " potNull.hashCode(); // OK: pot null, is reported\n" +
- " ^^^^^^^\n" +
- "Potential null pointer access: The variable potNull may be null at this location\n" +
- "----------\n" +
- "4. ERROR in test\\PotNullInLoop.java (at line 47)\n" +
- " potNull.hashCode(); // OK: pot null, is reported\n" +
- " ^^^^^^^\n" +
- "Potential null pointer access: The variable potNull may be null at this location\n" +
- "----------\n" +
- "5. ERROR in test\\PotNullInLoop.java (at line 58)\n" +
- " potNull.hashCode(); // OK: pot null, is reported\n" +
- " ^^^^^^^\n" +
- "Potential null pointer access: The variable potNull may be null at this location\n" +
+ },
+ "----------\n" +
+ "1. ERROR in test\\PotNullInLoop.java (at line 13)\n" +
+ " potNull.hashCode(); // ERROR 1: pot null, but nothing reported\n" +
+ " ^^^^^^^\n" +
+ "Potential null pointer access: The variable potNull may be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in test\\PotNullInLoop.java (at line 24)\n" +
+ " potNull.hashCode(); // ERROR 3 : pot null, but nothing reported\n" +
+ " ^^^^^^^\n" +
+ "Potential null pointer access: The variable potNull may be null at this location\n" +
+ "----------\n" +
+ "3. ERROR in test\\PotNullInLoop.java (at line 36)\n" +
+ " potNull.hashCode(); // OK: pot null, is reported\n" +
+ " ^^^^^^^\n" +
+ "Potential null pointer access: The variable potNull may be null at this location\n" +
+ "----------\n" +
+ "4. ERROR in test\\PotNullInLoop.java (at line 47)\n" +
+ " potNull.hashCode(); // OK: pot null, is reported\n" +
+ " ^^^^^^^\n" +
+ "Potential null pointer access: The variable potNull may be null at this location\n" +
+ "----------\n" +
+ "5. ERROR in test\\PotNullInLoop.java (at line 58)\n" +
+ " potNull.hashCode(); // OK: pot null, is reported\n" +
+ " ^^^^^^^\n" +
+ "Potential null pointer access: The variable potNull may be null at this location\n" +
"----------\n"
);
}
@@ -18052,7 +18052,7 @@ public void testBug447695() {
" return (array = new int[1])[0];\n" +
" }\n" +
"}\n"
- }
+ }
);
}
public void testBug447695b() {
@@ -18102,7 +18102,7 @@ public void testBug447695d() {
" Supplier<String> l = (s = \"\")::toString;\n" +
" }\n" +
"}\n"
- }
+ }
);
}
public void testBug447695e() {
@@ -18180,36 +18180,36 @@ public void testBug447695g() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in test\\Test447695.java (at line 20)\n" +
- " x1.i = 1; // error 1 expected\n" +
- " ^^\n" +
- "Null pointer access: The variable x1 can only be null at this location\n" +
- "----------\n" +
- "2. ERROR in test\\Test447695.java (at line 21)\n" +
- " x2.i += 1; // error 2 expected\n" +
- " ^^\n" +
- "Null pointer access: The variable x2 can only be null at this location\n" +
- "----------\n" +
- "3. ERROR in test\\Test447695.java (at line 22)\n" +
- " (x3).i = 1; // error 3 expected\n" +
- " ^^^^\n" +
- "Null pointer access: The variable x3 can only be null at this location\n" +
- "----------\n" +
- "4. ERROR in test\\Test447695.java (at line 23)\n" +
- " (x4).i += 1; // error 4 expected\n" +
- " ^^^^\n" +
- "Null pointer access: The variable x4 can only be null at this location\n" +
- "----------\n" +
- "5. ERROR in test\\Test447695.java (at line 26)\n" +
- " int i1 = x9.i; // error 5 expected\n" +
- " ^^\n" +
- "Null pointer access: The variable x9 can only be null at this location\n" +
- "----------\n" +
- "6. ERROR in test\\Test447695.java (at line 27)\n" +
- " int i2 = (x10).i; // error 6 expected\n" +
- " ^^^^^\n" +
- "Null pointer access: The variable x10 can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in test\\Test447695.java (at line 20)\n" +
+ " x1.i = 1; // error 1 expected\n" +
+ " ^^\n" +
+ "Null pointer access: The variable x1 can only be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in test\\Test447695.java (at line 21)\n" +
+ " x2.i += 1; // error 2 expected\n" +
+ " ^^\n" +
+ "Null pointer access: The variable x2 can only be null at this location\n" +
+ "----------\n" +
+ "3. ERROR in test\\Test447695.java (at line 22)\n" +
+ " (x3).i = 1; // error 3 expected\n" +
+ " ^^^^\n" +
+ "Null pointer access: The variable x3 can only be null at this location\n" +
+ "----------\n" +
+ "4. ERROR in test\\Test447695.java (at line 23)\n" +
+ " (x4).i += 1; // error 4 expected\n" +
+ " ^^^^\n" +
+ "Null pointer access: The variable x4 can only be null at this location\n" +
+ "----------\n" +
+ "5. ERROR in test\\Test447695.java (at line 26)\n" +
+ " int i1 = x9.i; // error 5 expected\n" +
+ " ^^\n" +
+ "Null pointer access: The variable x9 can only be null at this location\n" +
+ "----------\n" +
+ "6. ERROR in test\\Test447695.java (at line 27)\n" +
+ " int i2 = (x10).i; // error 6 expected\n" +
+ " ^^^^^\n" +
+ "Null pointer access: The variable x10 can only be null at this location\n" +
"----------\n"
);
}
@@ -18246,7 +18246,7 @@ public void testBug509188() {
" }\n" +
"}\n" +
"",
- },
+ },
"not dead"
);
}
@@ -18257,27 +18257,27 @@ public void testBug536408() {
runner.testFiles =
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Long s1 = null;\n" +
- " long t = 0;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Long s1 = null;\n" +
+ " long t = 0;\n" +
" t += s1;\n" +
" Long s2 = t > 0 ? 1l : null;\n" +
- " t += s2;\n" +
- " }\n" +
+ " t += s2;\n" +
+ " }\n" +
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " t += s1;\n" +
- " ^^\n" +
- "Null pointer access: This expression of type Long is null but requires auto-unboxing\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " t += s2;\n" +
- " ^^\n" +
- "Potential null pointer access: This expression of type Long may be null but requires auto-unboxing\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " t += s1;\n" +
+ " ^^\n" +
+ "Null pointer access: This expression of type Long is null but requires auto-unboxing\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " t += s2;\n" +
+ " ^^\n" +
+ "Potential null pointer access: This expression of type Long may be null but requires auto-unboxing\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
runner.runNegativeTest();
@@ -18301,11 +18301,11 @@ public void testBug542707_1() {
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " System.out.println(s.toLowerCase());\n" +
- " ^\n" +
- "Potential null pointer access: The variable s may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " System.out.println(s.toLowerCase());\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable s may be null at this location\n" +
"----------\n";
runner.runNegativeTest();
}
@@ -18313,22 +18313,22 @@ public void testBug544872() {
runNegativeNullTest(
new String[] {
"Test.java",
- "public class Test {\n" +
- " static void f(String string) {\n" +
- " if (string != null)\n" +
- " string.hashCode();\n" +
- " synchronized (string) {\n" +
- " string.hashCode();\n" +
- " }\n" +
- " }\n" +
- "}\n" +
+ "public class Test {\n" +
+ " static void f(String string) {\n" +
+ " if (string != null)\n" +
+ " string.hashCode();\n" +
+ " synchronized (string) {\n" +
+ " string.hashCode();\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
""
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 5)\n" +
- " synchronized (string) {\n" +
- " ^^^^^^\n" +
- "Potential null pointer access: The variable string may be null at this location\n" +
+ },
+ "----------\n" +
+ "1. ERROR in Test.java (at line 5)\n" +
+ " synchronized (string) {\n" +
+ " ^^^^^^\n" +
+ "Potential null pointer access: The variable string may be null at this location\n" +
"----------\n"
);
}
@@ -18336,51 +18336,51 @@ public void testBug551012() {
runNegativeNullTest(
new String[] {
"NullConstants.java",
- "public class NullConstants {\n" +
- " protected static final String FOO = null;\n" +
- "\n" +
- " protected String foo = FOO;\n" +
- "\n" +
- " protected static final String BAR = \"\";\n" +
- "\n" +
- " protected String bar = BAR;\n" +
- "\n" +
- " public boolean notAProblemButWhyNot() {\n" +
- " return FOO == null ? foo != null : !FOO.equals(foo);\n" +
- " }\n" +
- "\n" +
- " public boolean alsoNotAProblemButThisWillAlwaysNPE() {\n" +
- " return FOO != null ? foo != null : !FOO.equals(foo);\n" +
- " }\n" +
- "\n" +
- " public boolean aProblemButHowToAvoid() {\n" +
- " return BAR == null ? bar != null : !BAR.equals(bar);\n" +
- " }\n" +
- "\n" +
- " public boolean wrongpProblemMessage() {\n" +
- " return BAR != null ? !BAR.equals(bar) : bar != null;\n" +
- " }\n" +
- "\n" +
- " public boolean howAboutThis() {\n" +
- " return bar == null ? BAR != null : bar.equals(BAR);\n" +
- " }\n" +
+ "public class NullConstants {\n" +
+ " protected static final String FOO = null;\n" +
+ "\n" +
+ " protected String foo = FOO;\n" +
+ "\n" +
+ " protected static final String BAR = \"\";\n" +
+ "\n" +
+ " protected String bar = BAR;\n" +
+ "\n" +
+ " public boolean notAProblemButWhyNot() {\n" +
+ " return FOO == null ? foo != null : !FOO.equals(foo);\n" +
+ " }\n" +
+ "\n" +
+ " public boolean alsoNotAProblemButThisWillAlwaysNPE() {\n" +
+ " return FOO != null ? foo != null : !FOO.equals(foo);\n" +
+ " }\n" +
+ "\n" +
+ " public boolean aProblemButHowToAvoid() {\n" +
+ " return BAR == null ? bar != null : !BAR.equals(bar);\n" +
+ " }\n" +
+ "\n" +
+ " public boolean wrongpProblemMessage() {\n" +
+ " return BAR != null ? !BAR.equals(bar) : bar != null;\n" +
+ " }\n" +
+ "\n" +
+ " public boolean howAboutThis() {\n" +
+ " return bar == null ? BAR != null : bar.equals(BAR);\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in NullConstants.java (at line 19)\n" +
- " return BAR == null ? bar != null : !BAR.equals(bar);\n" +
- " ^^^\n" +
- "Null comparison always yields false: The field BAR is a nonnull constant\n" +
- "----------\n" +
- "2. ERROR in NullConstants.java (at line 23)\n" +
- " return BAR != null ? !BAR.equals(bar) : bar != null;\n" +
- " ^^^\n" +
- "Redundant null check: The field BAR is a nonnull constant\n" +
- "----------\n" +
- "3. ERROR in NullConstants.java (at line 27)\n" +
- " return bar == null ? BAR != null : bar.equals(BAR);\n" +
- " ^^^\n" +
- "Redundant null check: The field BAR is a nonnull constant\n" +
+ "----------\n" +
+ "1. ERROR in NullConstants.java (at line 19)\n" +
+ " return BAR == null ? bar != null : !BAR.equals(bar);\n" +
+ " ^^^\n" +
+ "Null comparison always yields false: The field BAR is a nonnull constant\n" +
+ "----------\n" +
+ "2. ERROR in NullConstants.java (at line 23)\n" +
+ " return BAR != null ? !BAR.equals(bar) : bar != null;\n" +
+ " ^^^\n" +
+ "Redundant null check: The field BAR is a nonnull constant\n" +
+ "----------\n" +
+ "3. ERROR in NullConstants.java (at line 27)\n" +
+ " return bar == null ? BAR != null : bar.equals(BAR);\n" +
+ " ^^^\n" +
+ "Redundant null check: The field BAR is a nonnull constant\n" +
"----------\n");
}
} \ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTestAsserts.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTestAsserts.java
index 44d1ff47e..e972ed5da 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTestAsserts.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTestAsserts.java
@@ -30,7 +30,7 @@ import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
/* See also NullReferenceTests for general null reference tests */
@SuppressWarnings({ "unchecked", "rawtypes" })
public class NullReferenceTestAsserts extends AbstractRegressionTest {
-
+
// class libraries including org.eclipse.equinox.common
String[] assertLib = null;
public NullReferenceTestAsserts(String name) {
@@ -229,21 +229,21 @@ public void testBug127575d() {
" }\n" +
"}\n"};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (o1 == null) { };\n" +
- " ^^\n" +
- "Null comparison always yields false: The variable o1 cannot be null at this location\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " if (o1 == null) { };\n" +
- " ^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " if (o2 == null) { };\n" +
- " ^^\n" +
- "Redundant null check: The variable o2 can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " if (o1 == null) { };\n" +
+ " ^^\n" +
+ "Null comparison always yields false: The variable o1 cannot be null at this location\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " if (o1 == null) { };\n" +
+ " ^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " if (o2 == null) { };\n" +
+ " ^^\n" +
+ "Redundant null check: The variable o2 can only be null at this location\n" +
"----------\n";
runner.classLibraries =
this.assertLib;
@@ -264,11 +264,11 @@ public void testBug127575e() {
" }\n" +
"}\n"};
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " org.eclipse.core.runtime.Assert.isLegal(false && o != null);\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " org.eclipse.core.runtime.Assert.isLegal(false && o != null);\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n";
runner.classLibraries =
this.assertLib;
@@ -289,16 +289,16 @@ public void testBug127575e_1() {
" }\n" +
"}\n"};
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " org.eclipse.core.runtime.Assert.isLegal(false && o != null);\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " if (o == null) { };\n" +
- " ^\n" +
- "Redundant null check: The variable o can only be null at this location\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " org.eclipse.core.runtime.Assert.isLegal(false && o != null);\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " if (o == null) { };\n" +
+ " ^\n" +
+ "Redundant null check: The variable o can only be null at this location\n" +
"----------\n";
runner.classLibraries =
this.assertLib;
@@ -319,11 +319,11 @@ public void testBug127575e_2() {
" }\n" +
"}\n"};
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " org.eclipse.core.runtime.Assert.isLegal(true || o != null);\n" +
- " ^^^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " org.eclipse.core.runtime.Assert.isLegal(true || o != null);\n" +
+ " ^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n";
runner.classLibraries =
this.assertLib;
@@ -343,16 +343,16 @@ public void testBug127575f() {
" }\n" +
"}\n"};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (o == null) { };\n" +
- " ^\n" +
- "Null comparison always yields false: The variable o cannot be null at this location\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " if (o == null) { };\n" +
- " ^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " if (o == null) { };\n" +
+ " ^\n" +
+ "Null comparison always yields false: The variable o cannot be null at this location\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " if (o == null) { };\n" +
+ " ^^^\n" +
+ "Dead code\n" +
"----------\n";
runner.classLibraries =
this.assertLib;
@@ -375,21 +375,21 @@ public void testBug127575g() {
" }\n" +
"}\n"};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " org.eclipse.core.runtime.Assert.isLegal(o != null);\n" +
- " ^\n" +
- "Null comparison always yields false: The variable o can only be null at this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " if (o == null) { };\n" +
- " ^\n" +
- "Null comparison always yields false: The variable o cannot be null at this location\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 5)\n" +
- " if (o == null) { };\n" +
- " ^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " org.eclipse.core.runtime.Assert.isLegal(o != null);\n" +
+ " ^\n" +
+ "Null comparison always yields false: The variable o can only be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " if (o == null) { };\n" +
+ " ^\n" +
+ "Null comparison always yields false: The variable o cannot be null at this location\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 5)\n" +
+ " if (o == null) { };\n" +
+ " ^^^\n" +
+ "Dead code\n" +
"----------\n";
runner.classLibraries =
this.assertLib;
@@ -422,46 +422,46 @@ public void testBug127575h() {
" }\n" +
"}\n"};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " if (foo == null) {}\n" +
- " ^^^\n" +
- "Null comparison always yields false: The variable foo cannot be null at this location\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " if (foo == null) {}\n" +
- " ^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " org.eclipse.core.runtime.Assert.isLegal (foo2 == null);\n" +
- " ^^^^\n" +
- "Null comparison always yields false: The variable foo2 cannot be null at this location\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " if (foo2 == null) {}\n" +
- " ^^^^\n" +
- "Redundant null check: The variable foo2 can only be null at this location\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 11)\n" +
- " if (bar == null) {}\n" +
- " ^^^\n" +
- "Redundant null check: The variable bar can only be null at this location\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 13)\n" +
- " org.eclipse.core.runtime.Assert.isLegal (bar2 != null);\n" +
- " ^^^^\n" +
- "Null comparison always yields false: The variable bar2 can only be null at this location\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 14)\n" +
- " if (bar2 == null) {}\n" +
- " ^^^^\n" +
- "Null comparison always yields false: The variable bar2 cannot be null at this location\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 14)\n" +
- " if (bar2 == null) {}\n" +
- " ^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " if (foo == null) {}\n" +
+ " ^^^\n" +
+ "Null comparison always yields false: The variable foo cannot be null at this location\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " if (foo == null) {}\n" +
+ " ^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " org.eclipse.core.runtime.Assert.isLegal (foo2 == null);\n" +
+ " ^^^^\n" +
+ "Null comparison always yields false: The variable foo2 cannot be null at this location\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " if (foo2 == null) {}\n" +
+ " ^^^^\n" +
+ "Redundant null check: The variable foo2 can only be null at this location\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 11)\n" +
+ " if (bar == null) {}\n" +
+ " ^^^\n" +
+ "Redundant null check: The variable bar can only be null at this location\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 13)\n" +
+ " org.eclipse.core.runtime.Assert.isLegal (bar2 != null);\n" +
+ " ^^^^\n" +
+ "Null comparison always yields false: The variable bar2 can only be null at this location\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 14)\n" +
+ " if (bar2 == null) {}\n" +
+ " ^^^^\n" +
+ "Null comparison always yields false: The variable bar2 cannot be null at this location\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 14)\n" +
+ " if (bar2 == null) {}\n" +
+ " ^^\n" +
+ "Dead code\n" +
"----------\n";
runner.classLibraries =
this.assertLib;
@@ -492,15 +492,15 @@ public void testBug127575i() {
"}\n"};
runner.expectedCompilerLog =
"----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " if (foo != null) {}\n" +
- " ^^^\n" +
- "Redundant null check: The variable foo cannot be null at this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " if (bar == null) {}\n" +
- " ^^^\n" +
- "Redundant null check: The variable bar can only be null at this location\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " if (foo != null) {}\n" +
+ " ^^^\n" +
+ "Redundant null check: The variable foo cannot be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " if (bar == null) {}\n" +
+ " ^^^\n" +
+ "Redundant null check: The variable bar can only be null at this location\n" +
"----------\n";
runner.classLibraries =
this.assertLib;
@@ -526,55 +526,55 @@ public void testBug127575j() {
" org.eclipse.core.runtime.Assert.isLegal (foo != null);\n" + //don't warn
" if (foo == null) {}\n" +
" org.eclipse.core.runtime.Assert.isLegal (foo2 == null);\n" + //don't warn
- " if (foo2 == null) {}\n" +
+ " if (foo2 == null) {}\n" +
" org.eclipse.core.runtime.Assert.isLegal (bar == null);\n" + //don't warn
- " if (bar == null) {}\n" +
+ " if (bar == null) {}\n" +
" org.eclipse.core.runtime.Assert.isLegal (bar2 != null);\n" + //don't warn
" if (bar2 == null) {}\n" +
" }\n" +
" }\n" +
"}\n"};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " if (foo == null) {}\n" +
- " ^^^\n" +
- "Null comparison always yields false: The variable foo cannot be null at this location\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " if (foo == null) {}\n" +
- " ^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " org.eclipse.core.runtime.Assert.isLegal (foo2 == null);\n" +
- " ^^^^\n" +
- "Null comparison always yields false: The variable foo2 cannot be null at this location\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 11)\n" +
- " if (foo2 == null) {}\n" +
- " ^^^^\n" +
- "Redundant null check: The variable foo2 can only be null at this location\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 13)\n" +
- " if (bar == null) {}\n" +
- " ^^^\n" +
- "Redundant null check: The variable bar can only be null at this location\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 14)\n" +
- " org.eclipse.core.runtime.Assert.isLegal (bar2 != null);\n" +
- " ^^^^\n" +
- "Null comparison always yields false: The variable bar2 can only be null at this location\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 15)\n" +
- " if (bar2 == null) {}\n" +
- " ^^^^\n" +
- "Null comparison always yields false: The variable bar2 cannot be null at this location\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 15)\n" +
- " if (bar2 == null) {}\n" +
- " ^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " if (foo == null) {}\n" +
+ " ^^^\n" +
+ "Null comparison always yields false: The variable foo cannot be null at this location\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " if (foo == null) {}\n" +
+ " ^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 10)\n" +
+ " org.eclipse.core.runtime.Assert.isLegal (foo2 == null);\n" +
+ " ^^^^\n" +
+ "Null comparison always yields false: The variable foo2 cannot be null at this location\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 11)\n" +
+ " if (foo2 == null) {}\n" +
+ " ^^^^\n" +
+ "Redundant null check: The variable foo2 can only be null at this location\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 13)\n" +
+ " if (bar == null) {}\n" +
+ " ^^^\n" +
+ "Redundant null check: The variable bar can only be null at this location\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 14)\n" +
+ " org.eclipse.core.runtime.Assert.isLegal (bar2 != null);\n" +
+ " ^^^^\n" +
+ "Null comparison always yields false: The variable bar2 can only be null at this location\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 15)\n" +
+ " if (bar2 == null) {}\n" +
+ " ^^^^\n" +
+ "Null comparison always yields false: The variable bar2 cannot be null at this location\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 15)\n" +
+ " if (bar2 == null) {}\n" +
+ " ^^\n" +
+ "Dead code\n" +
"----------\n";
runner.classLibraries =
this.assertLib;
@@ -603,55 +603,55 @@ public void testBug127575k() {
" org.eclipse.core.runtime.Assert.isLegal (foo != null);\n" + //don't warn
" if (foo == null) {}\n" +
" org.eclipse.core.runtime.Assert.isLegal (foo2 == null);\n" + //don't warn
- " if (foo2 == null) {}\n" +
+ " if (foo2 == null) {}\n" +
" org.eclipse.core.runtime.Assert.isLegal (bar == null);\n" + //don't warn
- " if (bar == null) {}\n" +
+ " if (bar == null) {}\n" +
" org.eclipse.core.runtime.Assert.isLegal (bar2 != null);\n" + //don't warn
" if (bar2 == null) {}\n" +
" }\n" +
" }\n" +
"}\n"};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " if (foo == null) {}\n" +
- " ^^^\n" +
- "Null comparison always yields false: The variable foo cannot be null at this location\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 12)\n" +
- " if (foo == null) {}\n" +
- " ^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 13)\n" +
- " org.eclipse.core.runtime.Assert.isLegal (foo2 == null);\n" +
- " ^^^^\n" +
- "Null comparison always yields false: The variable foo2 cannot be null at this location\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 14)\n" +
- " if (foo2 == null) {}\n" +
- " ^^^^\n" +
- "Redundant null check: The variable foo2 can only be null at this location\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 16)\n" +
- " if (bar == null) {}\n" +
- " ^^^\n" +
- "Redundant null check: The variable bar can only be null at this location\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 17)\n" +
- " org.eclipse.core.runtime.Assert.isLegal (bar2 != null);\n" +
- " ^^^^\n" +
- "Null comparison always yields false: The variable bar2 can only be null at this location\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 18)\n" +
- " if (bar2 == null) {}\n" +
- " ^^^^\n" +
- "Null comparison always yields false: The variable bar2 cannot be null at this location\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 18)\n" +
- " if (bar2 == null) {}\n" +
- " ^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " if (foo == null) {}\n" +
+ " ^^^\n" +
+ "Null comparison always yields false: The variable foo cannot be null at this location\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 12)\n" +
+ " if (foo == null) {}\n" +
+ " ^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 13)\n" +
+ " org.eclipse.core.runtime.Assert.isLegal (foo2 == null);\n" +
+ " ^^^^\n" +
+ "Null comparison always yields false: The variable foo2 cannot be null at this location\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 14)\n" +
+ " if (foo2 == null) {}\n" +
+ " ^^^^\n" +
+ "Redundant null check: The variable foo2 can only be null at this location\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 16)\n" +
+ " if (bar == null) {}\n" +
+ " ^^^\n" +
+ "Redundant null check: The variable bar can only be null at this location\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 17)\n" +
+ " org.eclipse.core.runtime.Assert.isLegal (bar2 != null);\n" +
+ " ^^^^\n" +
+ "Null comparison always yields false: The variable bar2 can only be null at this location\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 18)\n" +
+ " if (bar2 == null) {}\n" +
+ " ^^^^\n" +
+ "Null comparison always yields false: The variable bar2 cannot be null at this location\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 18)\n" +
+ " if (bar2 == null) {}\n" +
+ " ^^\n" +
+ "Dead code\n" +
"----------\n";
runner.classLibraries =
this.assertLib;
@@ -696,45 +696,45 @@ public void testBug127575l() {
" }\n" +
"}\n"};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in Test.java (at line 4)\n" +
- " if (a!=null) {\n" +
- " ^\n" +
- "Null comparison always yields false: The variable a can only be null at this location\n" +
- "----------\n" +
- "2. WARNING in Test.java (at line 4)\n" +
- " if (a!=null) {\n" +
- " System.out.println(\"a is not null\");\n" +
- " } else{\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 9)\n" +
- " a = null;\n" +
- " ^\n" +
- "Redundant assignment: The variable a can only be null at this location\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 10)\n" +
- " if (a== null) {}\n" +
- " ^\n" +
- "Redundant null check: The variable a can only be null at this location\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 12)\n" +
- " if (b!=null) {\n" +
- " ^\n" +
- "Redundant null check: The variable b cannot be null at this location\n" +
- "----------\n" +
- "6. WARNING in Test.java (at line 14)\n" +
- " } else{\n" +
- " System.out.println(\"b is null\");\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "7. ERROR in Test.java (at line 18)\n" +
- " if (c.equals(a)) {\n" +
- " ^\n" +
- "Null pointer access: The variable c can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 4)\n" +
+ " if (a!=null) {\n" +
+ " ^\n" +
+ "Null comparison always yields false: The variable a can only be null at this location\n" +
+ "----------\n" +
+ "2. WARNING in Test.java (at line 4)\n" +
+ " if (a!=null) {\n" +
+ " System.out.println(\"a is not null\");\n" +
+ " } else{\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 9)\n" +
+ " a = null;\n" +
+ " ^\n" +
+ "Redundant assignment: The variable a can only be null at this location\n" +
+ "----------\n" +
+ "4. ERROR in Test.java (at line 10)\n" +
+ " if (a== null) {}\n" +
+ " ^\n" +
+ "Redundant null check: The variable a can only be null at this location\n" +
+ "----------\n" +
+ "5. ERROR in Test.java (at line 12)\n" +
+ " if (b!=null) {\n" +
+ " ^\n" +
+ "Redundant null check: The variable b cannot be null at this location\n" +
+ "----------\n" +
+ "6. WARNING in Test.java (at line 14)\n" +
+ " } else{\n" +
+ " System.out.println(\"b is null\");\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "7. ERROR in Test.java (at line 18)\n" +
+ " if (c.equals(a)) {\n" +
+ " ^\n" +
+ "Null pointer access: The variable c can only be null at this location\n" +
"----------\n";
runner.classLibraries =
this.assertLib;
@@ -754,13 +754,13 @@ public void testBug127575m() {
" for (final Info info : infos) {\n " +
" if (info != null) {\n" +
" org.eclipse.core.runtime.Assert.isLegal( info.checkSomething());\n" +
- " info.doSomething();\n" +
+ " info.doSomething();\n" +
" }\n" +
" }\n" +
" for (final Info info : infos) {\n " +
" if (info == null) {\n" +
" org.eclipse.core.runtime.Assert.isLegal(info.checkSomething());\n" + // warn NPE
- " info.doSomething();\n" +
+ " info.doSomething();\n" +
" }\n" +
" }\n" +
" }\n" +
@@ -768,11 +768,11 @@ public void testBug127575m() {
" boolean checkSomething() {return true;}\n" +
"}\n"};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in Info.java (at line 11)\n" +
- " org.eclipse.core.runtime.Assert.isLegal(info.checkSomething());\n" +
- " ^^^^\n" +
- "Null pointer access: The variable info can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in Info.java (at line 11)\n" +
+ " org.eclipse.core.runtime.Assert.isLegal(info.checkSomething());\n" +
+ " ^^^^\n" +
+ "Null pointer access: The variable info can only be null at this location\n" +
"----------\n";
runner.classLibraries =
this.assertLib;
@@ -789,29 +789,29 @@ public void testBug127575n() {
runner.testFiles =
new String[] {
"DoWhileBug.java",
- "public class DoWhileBug {\n" +
- " void test(boolean b1) {\n" +
- " Object o1 = null;\n" +
- " Object o2 = null;\n" +
+ "public class DoWhileBug {\n" +
+ " void test(boolean b1) {\n" +
+ " Object o1 = null;\n" +
+ " Object o2 = null;\n" +
" do {\n" +
- " if (b1)\n" +
+ " if (b1)\n" +
" o1 = null;\n" +
" org.eclipse.core.runtime.Assert.isLegal (o1 != null);\n" +
- " } while (true);\n" +
- " }\n" +
- "}"
+ " } while (true);\n" +
+ " }\n" +
+ "}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in DoWhileBug.java (at line 7)\n" +
- " o1 = null;\n" +
- " ^^\n" +
- "Redundant assignment: The variable o1 can only be null at this location\n" +
- "----------\n" +
- "2. ERROR in DoWhileBug.java (at line 8)\n" +
- " org.eclipse.core.runtime.Assert.isLegal (o1 != null);\n" +
- " ^^\n" +
- "Null comparison always yields false: The variable o1 can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in DoWhileBug.java (at line 7)\n" +
+ " o1 = null;\n" +
+ " ^^\n" +
+ "Redundant assignment: The variable o1 can only be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in DoWhileBug.java (at line 8)\n" +
+ " org.eclipse.core.runtime.Assert.isLegal (o1 != null);\n" +
+ " ^^\n" +
+ "Null comparison always yields false: The variable o1 can only be null at this location\n" +
"----------\n";
runner.classLibraries =
this.assertLib;
@@ -828,24 +828,24 @@ public void testBug127575o() {
runner.testFiles =
new String[] {
"DoWhileBug.java",
- "public class DoWhileBug {\n" +
- " void test(boolean b1) {\n" +
- " Object o1 = null;\n" +
- " Object o2 = null;\n" +
+ "public class DoWhileBug {\n" +
+ " void test(boolean b1) {\n" +
+ " Object o1 = null;\n" +
+ " Object o2 = null;\n" +
" do {\n" +
- " if (b1)\n" +
+ " if (b1)\n" +
" o1 = null;\n" +
" org.eclipse.core.runtime.Assert.isLegal ((o2 = o1) == null);\n" +
- " } while (true);\n" +
- " }\n" +
- "}"
+ " } while (true);\n" +
+ " }\n" +
+ "}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in DoWhileBug.java (at line 7)\n" +
- " o1 = null;\n" +
- " ^^\n" +
- "Redundant assignment: The variable o1 can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in DoWhileBug.java (at line 7)\n" +
+ " o1 = null;\n" +
+ " ^^\n" +
+ "Redundant assignment: The variable o1 can only be null at this location\n" +
"----------\n";
runner.classLibraries =
this.assertLib;
@@ -886,16 +886,16 @@ public void testBug373953() throws IOException {
" }\n" +
"}\n"};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " o.toString();\n" +
- " ^\n" +
- "Potential null pointer access: The variable o may be null at this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " o.toString();\n" +
- " ^\n" +
- "Potential null pointer access: The variable o may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " o.toString();\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable o may be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " o.toString();\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable o may be null at this location\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
runner.runNegativeTest();
@@ -930,7 +930,7 @@ public void testBug382069b() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" void foo(Object o1, String o2) {\n" +
" boolean b = o1 != null;\n" + // sheds doubts upon o1
" org.eclipse.core.runtime.Assert.isNotNull(o1);\n" + // protection
@@ -939,7 +939,7 @@ public void testBug382069b() {
" org.eclipse.core.runtime.Assert.isNotNull(o2, \"msg\");\n" + // protection
" o2.toString();\n" + // quiet
" }\n" +
- "}"
+ "}"
},
"",
this.assertLib,
@@ -973,21 +973,21 @@ public void testBug382069c() throws IOException {
" }\n" +
"}\n"};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " return o1 != null;\n" +
- " ^^\n" +
- "Null comparison always yields false: The variable o1 can only be null at this location\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " return false; // dead code\n" +
- " ^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 12)\n" +
- " return; // dead code\n" +
- " ^^^^^^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " return o1 != null;\n" +
+ " ^^\n" +
+ "Null comparison always yields false: The variable o1 can only be null at this location\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " return false; // dead code\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 12)\n" +
+ " return; // dead code\n" +
+ " ^^^^^^^\n" +
+ "Dead code\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
runner.runNegativeTest();
@@ -1015,11 +1015,11 @@ public void testBug382069d() throws IOException {
" }\n" +
"}\n"};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " x.foo(null, null, null); // definite NPE\n" +
- " ^\n" +
- "Null pointer access: The variable x can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " x.foo(null, null, null); // definite NPE\n" +
+ " ^\n" +
+ "Null pointer access: The variable x can only be null at this location\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
runner.runNegativeTest();
@@ -1048,11 +1048,11 @@ public void testBug382069e() throws IOException {
" }\n" +
"}\n"};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " x.foo(null, null, null); // definite NPE\n" +
- " ^\n" +
- "Null pointer access: The variable x can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " x.foo(null, null, null); // definite NPE\n" +
+ " ^\n" +
+ "Null pointer access: The variable x can only be null at this location\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
runner.runNegativeTest();
@@ -1082,11 +1082,11 @@ public void testBug382069f() throws IOException {
" }\n" +
"}\n"};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " x.foo(null, null, null); // definite NPE\n" +
- " ^\n" +
- "Null pointer access: The variable x can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " x.foo(null, null, null); // definite NPE\n" +
+ " ^\n" +
+ "Null pointer access: The variable x can only be null at this location\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
runner.runNegativeTest();
@@ -1157,11 +1157,11 @@ public void testBug401159() throws IOException {
" }\n" +
"}\n"};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " x.foo(null, null, null); // definite NPE\n" +
- " ^\n" +
- "Null pointer access: The variable x can only be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " x.foo(null, null, null); // definite NPE\n" +
+ " ^\n" +
+ "Null pointer access: The variable x can only be null at this location\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
}
@@ -1175,23 +1175,23 @@ public void testBug472618() throws IOException {
JUNIT_ASSERT_NAME,
JUNIT_ASSERT_CONTENT,
"AssertionTest.java",
- "import junit.framework.Assert;\n" +
- "\n" +
- "public class AssertionTest extends Assert\n" +
- "{\n" +
- " void test()\n" +
- " {\n" +
- " Long test = null;\n" +
- "\n" +
- " if(Boolean.TRUE)\n" +
- " {\n" +
- " test = 0L;\n" +
- " }\n" +
- "\n" +
- " assertNotNull(test);\n" +
- "\n" +
- " test.longValue(); // <- potential null pointer access\n" +
- " }\n" +
+ "import junit.framework.Assert;\n" +
+ "\n" +
+ "public class AssertionTest extends Assert\n" +
+ "{\n" +
+ " void test()\n" +
+ " {\n" +
+ " Long test = null;\n" +
+ "\n" +
+ " if(Boolean.TRUE)\n" +
+ " {\n" +
+ " test = 0L;\n" +
+ " }\n" +
+ "\n" +
+ " assertNotNull(test);\n" +
+ "\n" +
+ " test.longValue(); // <- potential null pointer access\n" +
+ " }\n" +
"}\n"},
"");
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java
index 614ed13a8..11ec22706 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java
@@ -72,16 +72,16 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" l.add(null);\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " System.out.print(l.get(0).toString()); // problem: retrieved element can be null\n" +
- " ^^^^^^^^\n" +
- "Potential null pointer access: The method get(int) may return null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " System.out.print(l.get(1).toString()); // problem: retrieved element can be null\n" +
- " ^^^^^^^^\n" +
- "Potential null pointer access: The method get(int) may return null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " System.out.print(l.get(0).toString()); // problem: retrieved element can be null\n" +
+ " ^^^^^^^^\n" +
+ "Potential null pointer access: The method get(int) may return null\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " System.out.print(l.get(1).toString()); // problem: retrieved element can be null\n" +
+ " ^^^^^^^^\n" +
+ "Potential null pointer access: The method get(int) may return null\n" +
"----------\n");
}
@@ -111,16 +111,16 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" l.add(null);\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " System.out.print(l.get(0).toString()); // problem: retrieved element can be null\n" +
- " ^^^^^^^^\n" +
- "Potential null pointer access: The method get(int) may return null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " System.out.print(l.get(1).toString()); // problem: retrieved element can be null\n" +
- " ^^^^^^^^\n" +
- "Potential null pointer access: The method get(int) may return null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " System.out.print(l.get(0).toString()); // problem: retrieved element can be null\n" +
+ " ^^^^^^^^\n" +
+ "Potential null pointer access: The method get(int) may return null\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " System.out.print(l.get(1).toString()); // problem: retrieved element can be null\n" +
+ " ^^^^^^^^\n" +
+ "Potential null pointer access: The method get(int) may return null\n" +
"----------\n",
null,
true, /* shouldFlush*/
@@ -155,21 +155,21 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" l2.add(null);\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " System.out.print(l.get(0).toString()); // problem: retrieved element can be null\n" +
- " ^^^^^^^^\n" +
- "Potential null pointer access: The method get(int) may return null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " System.out.print(l.get(1).toString()); // problem: retrieved element can be null\n" +
- " ^^^^^^^^\n" +
- "Potential null pointer access: The method get(int) may return null\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 13)\n" +
- " System.out.print(l2.get(1).toString()); // problem: retrieved element can be null\n" +
- " ^^^^^^^^^\n" +
- "Potential null pointer access: The method get(int) may return null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " System.out.print(l.get(0).toString()); // problem: retrieved element can be null\n" +
+ " ^^^^^^^^\n" +
+ "Potential null pointer access: The method get(int) may return null\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " System.out.print(l.get(1).toString()); // problem: retrieved element can be null\n" +
+ " ^^^^^^^^\n" +
+ "Potential null pointer access: The method get(int) may return null\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 13)\n" +
+ " System.out.print(l2.get(1).toString()); // problem: retrieved element can be null\n" +
+ " ^^^^^^^^^\n" +
+ "Potential null pointer access: The method get(int) may return null\n" +
"----------\n");
}
@@ -208,36 +208,36 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" l2.add(0, null); // problem: cannot insert 'null' into this list\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " System.out.print(l.get(0).toString()); // problem: l may be null\n" +
- " ^\n" +
- "Potential null pointer access: this expression has a \'@Nullable\' type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " l.add(null); // problem: cannot insert \'null\' into this list\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " System.out.print(l.get(0).toString()); // problem: l may be null\n" +
- " ^\n" +
- "Potential null pointer access: this expression has a \'@Nullable\' type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " l.add(0, null); // problem: cannot insert \'null\' into this list\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 13)\n" +
- " System.out.print(l2.get(0).toString()); // problem: l2 may be null\n" +
- " ^^\n" +
- "Potential null pointer access: this expression has a \'@Nullable\' type\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 14)\n" +
- " l2.add(0, null); // problem: cannot insert \'null\' into this list\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " System.out.print(l.get(0).toString()); // problem: l may be null\n" +
+ " ^\n" +
+ "Potential null pointer access: this expression has a \'@Nullable\' type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " l.add(null); // problem: cannot insert \'null\' into this list\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 9)\n" +
+ " System.out.print(l.get(0).toString()); // problem: l may be null\n" +
+ " ^\n" +
+ "Potential null pointer access: this expression has a \'@Nullable\' type\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 10)\n" +
+ " l.add(0, null); // problem: cannot insert \'null\' into this list\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 13)\n" +
+ " System.out.print(l2.get(0).toString()); // problem: l2 may be null\n" +
+ " ^^\n" +
+ "Potential null pointer access: this expression has a \'@Nullable\' type\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 14)\n" +
+ " l2.add(0, null); // problem: cannot insert \'null\' into this list\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
"----------\n");
}
@@ -262,16 +262,16 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" @NonNull Object o = i.foo(null); // problems: argument and assignment violate null contracts\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in A.java (at line 13)\n" +
- " @NonNull Object o = i.foo(null); // problems: argument and assignment violate null contracts\n" +
- " ^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required '@NonNull Object' but this expression has type '@Nullable Object'\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 13)\n" +
- " @NonNull Object o = i.foo(null); // problems: argument and assignment violate null contracts\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 13)\n" +
+ " @NonNull Object o = i.foo(null); // problems: argument and assignment violate null contracts\n" +
+ " ^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required '@NonNull Object' but this expression has type '@Nullable Object'\n" +
+ "----------\n" +
+ "2. ERROR in A.java (at line 13)\n" +
+ " @NonNull Object o = i.foo(null); // problems: argument and assignment violate null contracts\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
"----------\n");
}
@@ -301,16 +301,16 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" }\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in B.java (at line 6)\n" +
- " System.out.print(idX(null));\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in B.java (at line 7)\n" +
- " return idY(null);\n" +
- " ^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required '@NonNull Object' but this expression has type '@Nullable String'\n" +
+ "----------\n" +
+ "1. ERROR in B.java (at line 6)\n" +
+ " System.out.print(idX(null));\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in B.java (at line 7)\n" +
+ " return idY(null);\n" +
+ " ^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required '@NonNull Object' but this expression has type '@Nullable String'\n" +
"----------\n");
}
@@ -336,16 +336,16 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" }\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in B.java (at line 5)\n" +
- " public @Nullable Object foo(@NonNull String l) {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The return type is incompatible with '@NonNull Object' returned from A<Object>.I<String>.foo(String) (mismatching null constraints)\n" +
- "----------\n" +
- "2. ERROR in B.java (at line 5)\n" +
- " public @Nullable Object foo(@NonNull String l) {\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Illegal redefinition of parameter l, inherited method from A<Object>.I<String> declares this parameter as @Nullable\n" +
+ "----------\n" +
+ "1. ERROR in B.java (at line 5)\n" +
+ " public @Nullable Object foo(@NonNull String l) {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The return type is incompatible with '@NonNull Object' returned from A<Object>.I<String>.foo(String) (mismatching null constraints)\n" +
+ "----------\n" +
+ "2. ERROR in B.java (at line 5)\n" +
+ " public @Nullable Object foo(@NonNull String l) {\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Illegal redefinition of parameter l, inherited method from A<Object>.I<String> declares this parameter as @Nullable\n" +
"----------\n");
}
@@ -366,16 +366,16 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" ai.foo(null); // problems: ai can be null, arg must not be null\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in B.java (at line 4)\n" +
- " ai.foo(null); // problems: ai can be null, arg must not be null\n" +
- " ^^\n" +
- "Potential null pointer access: this expression has a \'@Nullable\' type\n" +
- "----------\n" +
- "2. ERROR in B.java (at line 4)\n" +
- " ai.foo(null); // problems: ai can be null, arg must not be null\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in B.java (at line 4)\n" +
+ " ai.foo(null); // problems: ai can be null, arg must not be null\n" +
+ " ^^\n" +
+ "Potential null pointer access: this expression has a \'@Nullable\' type\n" +
+ "----------\n" +
+ "2. ERROR in B.java (at line 4)\n" +
+ " ai.foo(null); // problems: ai can be null, arg must not be null\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n");
}
@@ -396,11 +396,11 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" A<@Nullable Object>.@Nullable I<@NonNull String> ai2 = ai1;\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in B.java (at line 4)\n" +
- " A<@Nullable Object>.@Nullable I<@NonNull String> ai2 = ai1;\n" +
- " ^^^\n" +
- "Null type mismatch (type annotations): required \'A<@Nullable Object>.@Nullable I<@NonNull String>\' but this expression has type \'A<@NonNull Object>.@Nullable I<@NonNull String>\'\n" +
+ "----------\n" +
+ "1. ERROR in B.java (at line 4)\n" +
+ " A<@Nullable Object>.@Nullable I<@NonNull String> ai2 = ai1;\n" +
+ " ^^^\n" +
+ "Null type mismatch (type annotations): required \'A<@Nullable Object>.@Nullable I<@NonNull String>\' but this expression has type \'A<@NonNull Object>.@Nullable I<@NonNull String>\'\n" +
"----------\n");
}
@@ -413,16 +413,16 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" @Missing1 X.@Missing2 U fU;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " @Missing1 X.@Missing2 U fU;\n" +
- " ^^^^^^^^\n" +
- "Missing1 cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " @Missing1 X.@Missing2 U fU;\n" +
- " ^^^^^^^^\n" +
- "Missing2 cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " @Missing1 X.@Missing2 U fU;\n" +
+ " ^^^^^^^^\n" +
+ "Missing1 cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " @Missing1 X.@Missing2 U fU;\n" +
+ " ^^^^^^^^\n" +
+ "Missing2 cannot be resolved to a type\n" +
"----------\n",
this.LIBS,
true/*shouldFlush*/);
@@ -450,16 +450,16 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" maybeStrings.content()[0] = null; // no problem\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in A.java (at line 5)\n" +
- " realStrings.content()[0] = null; // problem: cannot assign null as @NonNull element\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 6)\n" +
- " System.out.println(maybeStrings.content()[0].toUpperCase()); // problem: element can be null\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Potential null pointer access: array element may be null\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 5)\n" +
+ " realStrings.content()[0] = null; // problem: cannot assign null as @NonNull element\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in A.java (at line 6)\n" +
+ " System.out.println(maybeStrings.content()[0].toUpperCase()); // problem: element can be null\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Potential null pointer access: array element may be null\n" +
"----------\n");
}
@@ -485,16 +485,16 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" maybeStrings.content()[0][0] = null; // no problem\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in A.java (at line 5)\n" +
- " realStrings.content()[0][0] = null; // problem: cannot assign null as @NonNull element\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 6)\n" +
- " System.out.println(maybeStrings.content()[0][0].toUpperCase()); // problem: element can be null\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Potential null pointer access: array element may be null\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 5)\n" +
+ " realStrings.content()[0][0] = null; // problem: cannot assign null as @NonNull element\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in A.java (at line 6)\n" +
+ " System.out.println(maybeStrings.content()[0][0].toUpperCase()); // problem: element can be null\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Potential null pointer access: array element may be null\n" +
"----------\n");
}
@@ -524,36 +524,36 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" maybeStringArray[0] = null; // problem protected by previous dereference\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in A.java (at line 6)\n" +
- " realStringArray = null; // problem: cannot assign null as @NonNull array\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'String @NonNull[]\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 7)\n" +
- " array = maybeStringArray; // problem: array can be null\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required '@NonNull Object' but this expression has type 'String @Nullable[]'\n" +
- "----------\n" +
- "3. WARNING in A.java (at line 12)\n" +
- " string = realStringArray[0]; // problem: unchecked conversion\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type 'String' needs unchecked conversion to conform to \'@NonNull String\'\n" +
- "----------\n" +
- "4. ERROR in A.java (at line 15)\n" +
- " string = maybeStringArray[0]; // problems: indexing nullable array & unchecked conversion\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Potential null pointer access: this expression has a \'@Nullable\' type\n" +
- "----------\n" +
- "5. WARNING in A.java (at line 15)\n" +
- " string = maybeStringArray[0]; // problems: indexing nullable array & unchecked conversion\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type 'String' needs unchecked conversion to conform to \'@NonNull String\'\n" +
- "----------\n" +
- "6. ERROR in A.java (at line 17)\n" +
- " maybeStringArray[0] = null; // problem: indexing nullable array\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Potential null pointer access: this expression has a \'@Nullable\' type\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 6)\n" +
+ " realStringArray = null; // problem: cannot assign null as @NonNull array\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'String @NonNull[]\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in A.java (at line 7)\n" +
+ " array = maybeStringArray; // problem: array can be null\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required '@NonNull Object' but this expression has type 'String @Nullable[]'\n" +
+ "----------\n" +
+ "3. WARNING in A.java (at line 12)\n" +
+ " string = realStringArray[0]; // problem: unchecked conversion\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type 'String' needs unchecked conversion to conform to \'@NonNull String\'\n" +
+ "----------\n" +
+ "4. ERROR in A.java (at line 15)\n" +
+ " string = maybeStringArray[0]; // problems: indexing nullable array & unchecked conversion\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Potential null pointer access: this expression has a \'@Nullable\' type\n" +
+ "----------\n" +
+ "5. WARNING in A.java (at line 15)\n" +
+ " string = maybeStringArray[0]; // problems: indexing nullable array & unchecked conversion\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type 'String' needs unchecked conversion to conform to \'@NonNull String\'\n" +
+ "----------\n" +
+ "6. ERROR in A.java (at line 17)\n" +
+ " maybeStringArray[0] = null; // problem: indexing nullable array\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Potential null pointer access: this expression has a \'@Nullable\' type\n" +
"----------\n");
}
@@ -587,46 +587,46 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" maybeArrays[0][0] = null; // problem: indexing nullable array\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. WARNING in A.java (at line 5)\n" +
- " array = realArrays; // problem: unchecked conversion\n" +
- " ^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String [] @NonNull[]\' needs unchecked conversion to conform to \'@NonNull Object\'\n" +
- "----------\n" +
- "2. WARNING in A.java (at line 7)\n" +
- " array = maybeArrays; // problem: unchecked conversion\n" +
- " ^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String [] @Nullable[]\' needs unchecked conversion to conform to \'@NonNull Object\'\n" +
- "----------\n" +
- "3. ERROR in A.java (at line 13)\n" +
- " realArrays[0] = null; // problem: cannot assign null to @NonNull array\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'String @NonNull[]\' but the provided value is null\n" +
- "----------\n" +
- "4. ERROR in A.java (at line 14)\n" +
- " array = maybeArrays[0]; // problem: element can be null\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'String @Nullable[]\'\n" +
- "----------\n" +
- "5. WARNING in A.java (at line 19)\n" +
- " array = realArrays[0][0]; // problem: unchecked conversion\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull Object\'\n" +
- "----------\n" +
- "6. ERROR in A.java (at line 21)\n" +
- " array = maybeArrays[0][0]; // problems: indexing nullable array & unchecked conversion\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Potential null pointer access: array element may be null\n" +
- "----------\n" +
- "7. WARNING in A.java (at line 21)\n" +
- " array = maybeArrays[0][0]; // problems: indexing nullable array & unchecked conversion\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull Object\'\n" +
- "----------\n" +
- "8. ERROR in A.java (at line 22)\n" +
- " maybeArrays[0][0] = null; // problem: indexing nullable array\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Potential null pointer access: array element may be null\n" +
+ "----------\n" +
+ "1. WARNING in A.java (at line 5)\n" +
+ " array = realArrays; // problem: unchecked conversion\n" +
+ " ^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String [] @NonNull[]\' needs unchecked conversion to conform to \'@NonNull Object\'\n" +
+ "----------\n" +
+ "2. WARNING in A.java (at line 7)\n" +
+ " array = maybeArrays; // problem: unchecked conversion\n" +
+ " ^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String [] @Nullable[]\' needs unchecked conversion to conform to \'@NonNull Object\'\n" +
+ "----------\n" +
+ "3. ERROR in A.java (at line 13)\n" +
+ " realArrays[0] = null; // problem: cannot assign null to @NonNull array\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'String @NonNull[]\' but the provided value is null\n" +
+ "----------\n" +
+ "4. ERROR in A.java (at line 14)\n" +
+ " array = maybeArrays[0]; // problem: element can be null\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'String @Nullable[]\'\n" +
+ "----------\n" +
+ "5. WARNING in A.java (at line 19)\n" +
+ " array = realArrays[0][0]; // problem: unchecked conversion\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull Object\'\n" +
+ "----------\n" +
+ "6. ERROR in A.java (at line 21)\n" +
+ " array = maybeArrays[0][0]; // problems: indexing nullable array & unchecked conversion\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Potential null pointer access: array element may be null\n" +
+ "----------\n" +
+ "7. WARNING in A.java (at line 21)\n" +
+ " array = maybeArrays[0][0]; // problems: indexing nullable array & unchecked conversion\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull Object\'\n" +
+ "----------\n" +
+ "8. ERROR in A.java (at line 22)\n" +
+ " maybeArrays[0][0] = null; // problem: indexing nullable array\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Potential null pointer access: array element may be null\n" +
"----------\n");
}
@@ -650,41 +650,41 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" }\n" +
" void consume(String @NonNull[] s) {};\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in A.java (at line 4)\n" +
- " realArrays[0] = maybeArrays[0]; // problem: inner array can be null\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'String @NonNull[]\' but this expression has type \'String @Nullable[]\'\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 5)\n" +
- " realArrays[0] = unknownArrays[0]; // problems: inner array is unspecified, outer can be null\n" +
- " ^^^^^^^^^^^^^\n" +
- "Potential null pointer access: this expression has a \'@Nullable\' type\n" +
- "----------\n" +
- "3. WARNING in A.java (at line 5)\n" +
- " realArrays[0] = unknownArrays[0]; // problems: inner array is unspecified, outer can be null\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'String @NonNull[]\'\n" +
- "----------\n" +
- "4. ERROR in A.java (at line 8)\n" +
- " String @NonNull[] s = maybeStrings;\n" +
- " ^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'String @NonNull[]\' but this expression has type \'String @Nullable[]\'\n" +
- "----------\n" +
- "5. WARNING in A.java (at line 9)\n" +
- " s = unknownStrings;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'String @NonNull[]\'\n" +
- "----------\n" +
- "6. ERROR in A.java (at line 10)\n" +
- " consume(maybeStrings);\n" +
- " ^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'String @NonNull[]\' but this expression has type \'String @Nullable[]\'\n" +
- "----------\n" +
- "7. WARNING in A.java (at line 11)\n" +
- " consume(unknownStrings);\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'String @NonNull[]\'\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 4)\n" +
+ " realArrays[0] = maybeArrays[0]; // problem: inner array can be null\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'String @NonNull[]\' but this expression has type \'String @Nullable[]\'\n" +
+ "----------\n" +
+ "2. ERROR in A.java (at line 5)\n" +
+ " realArrays[0] = unknownArrays[0]; // problems: inner array is unspecified, outer can be null\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Potential null pointer access: this expression has a \'@Nullable\' type\n" +
+ "----------\n" +
+ "3. WARNING in A.java (at line 5)\n" +
+ " realArrays[0] = unknownArrays[0]; // problems: inner array is unspecified, outer can be null\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'String @NonNull[]\'\n" +
+ "----------\n" +
+ "4. ERROR in A.java (at line 8)\n" +
+ " String @NonNull[] s = maybeStrings;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'String @NonNull[]\' but this expression has type \'String @Nullable[]\'\n" +
+ "----------\n" +
+ "5. WARNING in A.java (at line 9)\n" +
+ " s = unknownStrings;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'String @NonNull[]\'\n" +
+ "----------\n" +
+ "6. ERROR in A.java (at line 10)\n" +
+ " consume(maybeStrings);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'String @NonNull[]\' but this expression has type \'String @Nullable[]\'\n" +
+ "----------\n" +
+ "7. WARNING in A.java (at line 11)\n" +
+ " consume(unknownStrings);\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'String @NonNull[]\'\n" +
"----------\n");
}
@@ -708,120 +708,120 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" void consume(String @NonNull[] @NonNull[] realStrings, String @NonNull[] @Nullable[] maybeArrays, String @Nullable[][] unknownArrays) {\n" +
" }\n" +
"}\n"},
- "----------\n" +
- "1. ERROR in A.java (at line 4)\n" +
- " realArrays = maybeArrays; // problem on inner dimension!\n" +
- " ^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'String @NonNull[] @NonNull[]\' but this expression has type \'String @NonNull[] @Nullable[]\'\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 5)\n" +
- " realArrays = unknownArrays; // problems on both dimensions\n" +
- " ^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'String @NonNull[] @NonNull[]\' but this expression has type \'String @Nullable[] []\'\n" +
- "----------\n" +
- "3. ERROR in A.java (at line 6)\n" +
- " maybeArrays = realArrays; // problem on inner dimension\n" +
- " ^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'String @NonNull[] @Nullable[]\' but this expression has type \'String @NonNull[] @NonNull[]\'\n" +
- "----------\n" +
- "4. WARNING in A.java (at line 8)\n" +
- " realArrays = mixedArrays; // problem on inner\n" +
- " ^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String @NonNull[] []\' needs unchecked conversion to conform to \'String @NonNull[] @NonNull[]\'\n" +
- "----------\n" +
- "5. WARNING in A.java (at line 9)\n" +
- " maybeArrays = mixedArrays; // problem on inner\n" +
- " ^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String @NonNull[] []\' needs unchecked conversion to conform to \'String @NonNull[] @Nullable[]\'\n" +
- "----------\n" +
- "6. ERROR in A.java (at line 10)\n" +
- " consume(maybeArrays, mixedArrays, maybeArrays);\n" +
- " ^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'String @NonNull[] @NonNull[]\' but this expression has type \'String @NonNull[] @Nullable[]\'\n" +
- "----------\n" +
- "7. WARNING in A.java (at line 10)\n" +
- " consume(maybeArrays, mixedArrays, maybeArrays);\n" +
- " ^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String @NonNull[] []\' needs unchecked conversion to conform to \'String @NonNull[] @Nullable[]\'\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 4)\n" +
+ " realArrays = maybeArrays; // problem on inner dimension!\n" +
+ " ^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'String @NonNull[] @NonNull[]\' but this expression has type \'String @NonNull[] @Nullable[]\'\n" +
+ "----------\n" +
+ "2. ERROR in A.java (at line 5)\n" +
+ " realArrays = unknownArrays; // problems on both dimensions\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'String @NonNull[] @NonNull[]\' but this expression has type \'String @Nullable[] []\'\n" +
+ "----------\n" +
+ "3. ERROR in A.java (at line 6)\n" +
+ " maybeArrays = realArrays; // problem on inner dimension\n" +
+ " ^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'String @NonNull[] @Nullable[]\' but this expression has type \'String @NonNull[] @NonNull[]\'\n" +
+ "----------\n" +
+ "4. WARNING in A.java (at line 8)\n" +
+ " realArrays = mixedArrays; // problem on inner\n" +
+ " ^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String @NonNull[] []\' needs unchecked conversion to conform to \'String @NonNull[] @NonNull[]\'\n" +
+ "----------\n" +
+ "5. WARNING in A.java (at line 9)\n" +
+ " maybeArrays = mixedArrays; // problem on inner\n" +
+ " ^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String @NonNull[] []\' needs unchecked conversion to conform to \'String @NonNull[] @Nullable[]\'\n" +
+ "----------\n" +
+ "6. ERROR in A.java (at line 10)\n" +
+ " consume(maybeArrays, mixedArrays, maybeArrays);\n" +
+ " ^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'String @NonNull[] @NonNull[]\' but this expression has type \'String @NonNull[] @Nullable[]\'\n" +
+ "----------\n" +
+ "7. WARNING in A.java (at line 10)\n" +
+ " consume(maybeArrays, mixedArrays, maybeArrays);\n" +
+ " ^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String @NonNull[] []\' needs unchecked conversion to conform to \'String @NonNull[] @Nullable[]\'\n" +
"----------\n");
}
-
+
// combine flow info on outer type with annotation analysis for inners
public void testArrayType_11() {
runNegativeTestWithLibs(
new String[] {
"ArrayTest.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public class ArrayTest {\n" +
- " \n" +
- " @NonNull Object @NonNull[] test1(@NonNull Object @Nullable[] in) {\n" +
- " if (in == null) throw new NullPointerException(); \n" +
- " return in; // array needs check, element is OK\n" +
- " }\n" +
- " @NonNull Object @NonNull[] test2(@Nullable Object @Nullable[] in) {\n" +
- " if (in == null) throw new NullPointerException(); \n" +
- " return in; // array needs check, element is NOK\n" +
- " }\n" +
- " @NonNull Object @NonNull[]@NonNull[] test3(@NonNull Object @Nullable[][] in) {\n" +
- " if (in == null) throw new NullPointerException(); \n" +
- " return in; // outer needs check, inner is unchecked, element is OK\n" +
- " }\n" +
- " @NonNull Object @NonNull[]@NonNull[] test4(@Nullable Object @Nullable[][] in) {\n" +
- " if (in == null) throw new NullPointerException(); \n" +
- " return in; // outer needs check, inner is unchecked, element is NOK\n" +
- " }\n" +
- " @NonNull Object @NonNull[]@NonNull[] test5(@NonNull Object @Nullable[]@Nullable[] in) {\n" +
- " if (in == null) throw new NullPointerException(); \n" +
- " return in; // outer needs check, inner is NOK, element is OK\n" +
- " }\n" +
- " @NonNull Object @NonNull[]@NonNull[] test6(@NonNull Object @Nullable[]@NonNull[] in) {\n" +
- " if (in == null) throw new NullPointerException(); \n" +
- " return in; // outer needs check, inner is OK, element is OK\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "public class ArrayTest {\n" +
+ " \n" +
+ " @NonNull Object @NonNull[] test1(@NonNull Object @Nullable[] in) {\n" +
+ " if (in == null) throw new NullPointerException(); \n" +
+ " return in; // array needs check, element is OK\n" +
+ " }\n" +
+ " @NonNull Object @NonNull[] test2(@Nullable Object @Nullable[] in) {\n" +
+ " if (in == null) throw new NullPointerException(); \n" +
+ " return in; // array needs check, element is NOK\n" +
+ " }\n" +
+ " @NonNull Object @NonNull[]@NonNull[] test3(@NonNull Object @Nullable[][] in) {\n" +
+ " if (in == null) throw new NullPointerException(); \n" +
+ " return in; // outer needs check, inner is unchecked, element is OK\n" +
+ " }\n" +
+ " @NonNull Object @NonNull[]@NonNull[] test4(@Nullable Object @Nullable[][] in) {\n" +
+ " if (in == null) throw new NullPointerException(); \n" +
+ " return in; // outer needs check, inner is unchecked, element is NOK\n" +
+ " }\n" +
+ " @NonNull Object @NonNull[]@NonNull[] test5(@NonNull Object @Nullable[]@Nullable[] in) {\n" +
+ " if (in == null) throw new NullPointerException(); \n" +
+ " return in; // outer needs check, inner is NOK, element is OK\n" +
+ " }\n" +
+ " @NonNull Object @NonNull[]@NonNull[] test6(@NonNull Object @Nullable[]@NonNull[] in) {\n" +
+ " if (in == null) throw new NullPointerException(); \n" +
+ " return in; // outer needs check, inner is OK, element is OK\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in ArrayTest.java (at line 11)\n" +
- " return in; // array needs check, element is NOK\n" +
- " ^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Object @NonNull[]\' but this expression has type \'@Nullable Object @Nullable[]\'\n" +
- "----------\n" +
- "2. WARNING in ArrayTest.java (at line 15)\n" +
- " return in; // outer needs check, inner is unchecked, element is OK\n" +
- " ^^\n" +
- "Null type safety (type annotations): The expression of type \'@NonNull Object @Nullable[] []\' needs unchecked conversion to conform to \'@NonNull Object @NonNull[] @NonNull[]\'\n" +
- "----------\n" +
- "3. ERROR in ArrayTest.java (at line 19)\n" +
- " return in; // outer needs check, inner is unchecked, element is NOK\n" +
- " ^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Object @NonNull[] @NonNull[]\' but this expression has type \'@Nullable Object @Nullable[] []\'\n" +
- "----------\n" +
- "4. ERROR in ArrayTest.java (at line 23)\n" +
- " return in; // outer needs check, inner is NOK, element is OK\n" +
- " ^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Object @NonNull[] @NonNull[]\' but this expression has type \'@NonNull Object @Nullable[] @Nullable[]\'\n" +
+ "----------\n" +
+ "1. ERROR in ArrayTest.java (at line 11)\n" +
+ " return in; // array needs check, element is NOK\n" +
+ " ^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Object @NonNull[]\' but this expression has type \'@Nullable Object @Nullable[]\'\n" +
+ "----------\n" +
+ "2. WARNING in ArrayTest.java (at line 15)\n" +
+ " return in; // outer needs check, inner is unchecked, element is OK\n" +
+ " ^^\n" +
+ "Null type safety (type annotations): The expression of type \'@NonNull Object @Nullable[] []\' needs unchecked conversion to conform to \'@NonNull Object @NonNull[] @NonNull[]\'\n" +
+ "----------\n" +
+ "3. ERROR in ArrayTest.java (at line 19)\n" +
+ " return in; // outer needs check, inner is unchecked, element is NOK\n" +
+ " ^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Object @NonNull[] @NonNull[]\' but this expression has type \'@Nullable Object @Nullable[] []\'\n" +
+ "----------\n" +
+ "4. ERROR in ArrayTest.java (at line 23)\n" +
+ " return in; // outer needs check, inner is NOK, element is OK\n" +
+ " ^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Object @NonNull[] @NonNull[]\' but this expression has type \'@NonNull Object @Nullable[] @Nullable[]\'\n" +
"----------\n");
}
-
- // https://bugs.eclipse.org/403216 - [1.8][null] TypeReference#captureTypeAnnotations treats type annotations as type argument annotations
+
+ // https://bugs.eclipse.org/403216 - [1.8][null] TypeReference#captureTypeAnnotations treats type annotations as type argument annotations
public void testBug403216_1() {
runConformTestWithLibs(
new String[] {
"Test.java",
- "import java.lang.annotation.ElementType;\n" +
- "import java.lang.annotation.Target;\n" +
- "\n" +
- "public class Test {}\n" +
- "\n" +
- "class X {\n" +
- " class Y {\n" +
- " public void foo( @A X. @B Y this) {}\n" +
- " }\n" +
- "}\n" +
- "@Target(value={ElementType.TYPE_USE})\n" +
- "@interface A {}\n" +
- "@Target(value={ElementType.TYPE_USE})\n" +
+ "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "\n" +
+ "public class Test {}\n" +
+ "\n" +
+ "class X {\n" +
+ " class Y {\n" +
+ " public void foo( @A X. @B Y this) {}\n" +
+ " }\n" +
+ "}\n" +
+ "@Target(value={ElementType.TYPE_USE})\n" +
+ "@interface A {}\n" +
+ "@Target(value={ElementType.TYPE_USE})\n" +
"@interface B {}\n"
},
null,
@@ -838,8 +838,8 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
"import org.eclipse.jdt.annotation.*;\n" +
"import java.util.*;\n" +
"public class X {\n" +
- " void test(List<@NonNull String> strings) {\n" +
- " List<String> someStrings;\n" +
+ " void test(List<@NonNull String> strings) {\n" +
+ " List<String> someStrings;\n" +
" someStrings = strings;\n" +
" }\n" +
"}\n"
@@ -847,51 +847,51 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
options,
"");
}
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=403216#c9
+
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=403216#c9
public void testBug403216_3a() {
runNegativeTestWithLibs(
new String[] {
"Test.java",
- "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.ElementType;\n" +
"import java.lang.annotation.Target;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public class Test {}\n" +
- "\n" +
- "class X {\n" +
- " class Y {\n" +
- " public void foo( @A X. @NonNull Y this) {}\n" +
- " }\n" +
- "}\n" +
- "@Target(value={ElementType.TYPE_USE})\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "public class Test {}\n" +
+ "\n" +
+ "class X {\n" +
+ " class Y {\n" +
+ " public void foo( @A X. @NonNull Y this) {}\n" +
+ " }\n" +
+ "}\n" +
+ "@Target(value={ElementType.TYPE_USE})\n" +
"@interface A {}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in Test.java (at line 9)\n" +
- " public void foo( @A X. @NonNull Y this) {}\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Nullness annotations are not applicable at this location \n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 9)\n" +
+ " public void foo( @A X. @NonNull Y this) {}\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Nullness annotations are not applicable at this location \n" +
"----------\n");
}
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=403216#c9
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=403216#c9
public void testBug403216_3b() {
runConformTestWithLibs(
new String[] {
"Test.java",
- "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.ElementType;\n" +
"import java.lang.annotation.Target;\n" +
- "\n" +
- "public class Test {}\n" +
- "\n" +
- "class X {\n" +
- " class Y {\n" +
- " public void foo( @A X. @A Y this) {}\n" +
- " }\n" +
- "}\n" +
- "@Target(value={ElementType.TYPE_USE})\n" +
+ "\n" +
+ "public class Test {}\n" +
+ "\n" +
+ "class X {\n" +
+ " class Y {\n" +
+ " public void foo( @A X. @A Y this) {}\n" +
+ " }\n" +
+ "}\n" +
+ "@Target(value={ElementType.TYPE_USE})\n" +
"@interface A {}\n"
},
getCompilerOptions(),
@@ -903,30 +903,30 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
runNegativeTest(
new String[] {
"X.java",
- "import java.lang.annotation.ElementType;\n" +
- "import java.lang.annotation.Target;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public class X {\n" +
- " void foo(Map<@Marker ? super @Marker Object, @Marker ? extends @Marker String> m){}\n" +
- " void goo(Map<@Marker ? extends @Marker Object, @Marker ? super @Marker String> m){}\n" +
- "}\n" +
- "\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@interface Marker {\n" +
- " \n" +
+ "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "public class X {\n" +
+ " void foo(Map<@Marker ? super @Marker Object, @Marker ? extends @Marker String> m){}\n" +
+ " void goo(Map<@Marker ? extends @Marker Object, @Marker ? super @Marker String> m){}\n" +
+ "}\n" +
+ "\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@interface Marker {\n" +
+ " \n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " void foo(Map<@Marker ? super @Marker Object, @Marker ? extends @Marker String> m){}\n" +
- " ^^^\n" +
- "Map cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " void goo(Map<@Marker ? extends @Marker Object, @Marker ? super @Marker String> m){}\n" +
- " ^^^\n" +
- "Map cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " void foo(Map<@Marker ? super @Marker Object, @Marker ? extends @Marker String> m){}\n" +
+ " ^^^\n" +
+ "Map cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " void goo(Map<@Marker ? extends @Marker Object, @Marker ? super @Marker String> m){}\n" +
+ " ^^^\n" +
+ "Map cannot be resolved to a type\n" +
"----------\n",
this.LIBS,
true/*flush*/);
@@ -939,23 +939,23 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
new String[] {
"X.java",
"// import java.util.Map;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public class X {\n" +
- " void foo(Map<@Nullable ? super @Nullable Object, @Nullable ? extends @Nullable String> m){}\n" +
- " void goo(Map<@Nullable ? extends @Nullable Object, @Nullable ? super @Nullable String> m){}\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "public class X {\n" +
+ " void foo(Map<@Nullable ? super @Nullable Object, @Nullable ? extends @Nullable String> m){}\n" +
+ " void goo(Map<@Nullable ? extends @Nullable Object, @Nullable ? super @Nullable String> m){}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " void foo(Map<@Nullable ? super @Nullable Object, @Nullable ? extends @Nullable String> m){}\n" +
- " ^^^\n" +
- "Map cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " void goo(Map<@Nullable ? extends @Nullable Object, @Nullable ? super @Nullable String> m){}\n" +
- " ^^^\n" +
- "Map cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " void foo(Map<@Nullable ? super @Nullable Object, @Nullable ? extends @Nullable String> m){}\n" +
+ " ^^^\n" +
+ "Map cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " void goo(Map<@Nullable ? extends @Nullable Object, @Nullable ? super @Nullable String> m){}\n" +
+ " ^^^\n" +
+ "Map cannot be resolved to a type\n" +
"----------\n",
this.LIBS,
true/*flush*/);
@@ -987,13 +987,13 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" System.out.println(s0.toUpperCase());\n" +
" }\n" +
"}\n"
- },
+ },
customOptions,
- "----------\n" +
- "1. ERROR in Y.java (at line 5)\n" +
- " System.out.println(s0.toUpperCase());\n" +
- " ^^\n" +
- "Potential null pointer access: The variable s0 may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in Y.java (at line 5)\n" +
+ " System.out.println(s0.toUpperCase());\n" +
+ " ^^\n" +
+ "Potential null pointer access: The variable s0 may be null at this location\n" +
"----------\n"
);
}
@@ -1031,13 +1031,13 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" x.setAllStrings(-1, ss);\n" +
" }\n" +
"}\n"
- },
+ },
customOptions,
- "----------\n" +
- "1. ERROR in Y.java (at line 6)\n" +
- " x.setAllStrings(-1, ss);\n" +
- " ^^\n" +
- "Null type mismatch (type annotations): required \'List<@NonNull String>\' but this expression has type \'List<@Nullable String>\'\n" +
+ "----------\n" +
+ "1. ERROR in Y.java (at line 6)\n" +
+ " x.setAllStrings(-1, ss);\n" +
+ " ^^\n" +
+ "Null type mismatch (type annotations): required \'List<@NonNull String>\' but this expression has type \'List<@Nullable String>\'\n" +
"----------\n"
);
}
@@ -1069,18 +1069,18 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" System.out.println(X1.f2[0].length);\n" +
" }\n" +
"}\n"
- },
+ },
customOptions,
- "----------\n" +
- "1. ERROR in Y1.java (at line 4)\n" +
- " System.out.println(p.X1.f1.length);\n" +
- " ^^\n" +
- "Potential null pointer access: this expression has a \'@Nullable\' type\n" +
- "----------\n" +
- "2. ERROR in Y1.java (at line 5)\n" +
- " System.out.println(X1.f2[0].length);\n" +
- " ^^^^^^^^\n" +
- "Potential null pointer access: array element may be null\n" +
+ "----------\n" +
+ "1. ERROR in Y1.java (at line 4)\n" +
+ " System.out.println(p.X1.f1.length);\n" +
+ " ^^\n" +
+ "Potential null pointer access: this expression has a \'@Nullable\' type\n" +
+ "----------\n" +
+ "2. ERROR in Y1.java (at line 5)\n" +
+ " System.out.println(X1.f2[0].length);\n" +
+ " ^^^^^^^^\n" +
+ "Potential null pointer access: array element may be null\n" +
"----------\n"
);
}
@@ -1125,19 +1125,19 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" System.out.println(s0.toUpperCase());\n" +
" }\n" +
"}\n"
- },
+ },
customOptions,
- "----------\n" +
- "1. ERROR in Y1.java (at line 5)\n" +
- " System.out.println(s0.toUpperCase());\n" +
- " ^^\n" +
+ "----------\n" +
+ "1. ERROR in Y1.java (at line 5)\n" +
+ " System.out.println(s0.toUpperCase());\n" +
+ " ^^\n" +
"Potential null pointer access: The variable s0 may be null at this location\n" +
"----------\n" +
"----------\n" +
- "1. ERROR in Y2.java (at line 5)\n" +
- " System.out.println(s0.toUpperCase());\n" +
- " ^^\n" +
- "Potential null pointer access: The variable s0 may be null at this location\n" +
+ "1. ERROR in Y2.java (at line 5)\n" +
+ " System.out.println(s0.toUpperCase());\n" +
+ " ^^\n" +
+ "Potential null pointer access: The variable s0 may be null at this location\n" +
"----------\n"
);
}
@@ -1170,18 +1170,18 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" x.<@NonNull Object>foo(new Object());\n" + // incompatible: S is constrained to @Nullable
" }\n" +
"}\n"
- },
+ },
customOptions,
- "----------\n" +
- "1. ERROR in Y1.java (at line 4)\n" +
- " X1<@Nullable String> maybeStrings;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@Nullable String\' is not a valid substitute for the type parameter \'@NonNull T extends Object\'\n" +
- "----------\n" +
- "2. ERROR in Y1.java (at line 6)\n" +
- " x.<@NonNull Object>foo(new Object());\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@NonNull Object\' is not a valid substitute for the type parameter \'@Nullable S extends Object\'\n" +
+ "----------\n" +
+ "1. ERROR in Y1.java (at line 4)\n" +
+ " X1<@Nullable String> maybeStrings;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@Nullable String\' is not a valid substitute for the type parameter \'@NonNull T extends Object\'\n" +
+ "----------\n" +
+ "2. ERROR in Y1.java (at line 6)\n" +
+ " x.<@NonNull Object>foo(new Object());\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@NonNull Object\' is not a valid substitute for the type parameter \'@Nullable S extends Object\'\n" +
"----------\n");
}
@@ -1199,19 +1199,19 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
"public abstract class X1<T extends @NonNull Object> extends ArrayList<T> {\n" +
" public <U, V extends @Nullable Object> void foo(U u, V v) {}\n" +
"}\n",
- "p/X2.java",
+ "p/X2.java",
"package p;\n"+
"import org.eclipse.jdt.annotation.*;\n" +
"public class X2<@NonNull W extends @Nullable Object> {}\n" // incompatible constraints
},
customOptions,
- "----------\n" +
- "1. ERROR in p\\X2.java (at line 3)\n" +
- " public class X2<@NonNull W extends @Nullable Object> {}\n" +
- " ^^^^^^^^^\n" +
- "This nullness annotation conflicts with a \'@NonNull\' annotation which is effective on the same type parameter \n" +
+ "----------\n" +
+ "1. ERROR in p\\X2.java (at line 3)\n" +
+ " public class X2<@NonNull W extends @Nullable Object> {}\n" +
+ " ^^^^^^^^^\n" +
+ "This nullness annotation conflicts with a \'@NonNull\' annotation which is effective on the same type parameter \n" +
"----------\n");
- // fix the bug:
+ // fix the bug:
runConformTestWithLibs(
new String[] {
"p/X1.java",
@@ -1222,7 +1222,7 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
"public abstract class X1<T extends @NonNull Object> extends ArrayList<T> {\n" +
" public <U, V extends @Nullable Object> void foo(U u, V v) {}\n" +
"}\n",
- "p/X2.java",
+ "p/X2.java",
"package p;\n"+
"import org.eclipse.jdt.annotation.*;\n" +
"public class X2<@Nullable W extends Object> {}\n"
@@ -1242,18 +1242,18 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" x.<Y1, @NonNull Object>foo(this, new Object());\n" + // OK: 'extends @Nullable' is no restriction
" }\n" +
"}\n"
- },
+ },
customOptions,
- "----------\n" +
- "1. ERROR in Y1.java (at line 5)\n" +
- " X1<@Nullable String> maybeStrings;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@Nullable String\' is not a valid substitute for the type parameter \'T extends @NonNull Object\'\n" +
- "----------\n" +
- "2. ERROR in Y1.java (at line 6)\n" +
- " X2<@NonNull String> strings;\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@NonNull String\' is not a valid substitute for the type parameter \'@Nullable W extends Object\'\n" +
+ "----------\n" +
+ "1. ERROR in Y1.java (at line 5)\n" +
+ " X1<@Nullable String> maybeStrings;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@Nullable String\' is not a valid substitute for the type parameter \'T extends @NonNull Object\'\n" +
+ "----------\n" +
+ "2. ERROR in Y1.java (at line 6)\n" +
+ " X2<@NonNull String> strings;\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@NonNull String\' is not a valid substitute for the type parameter \'@Nullable W extends Object\'\n" +
"----------\n"
);
}
@@ -1273,19 +1273,19 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
"public abstract class X1<T extends java.lang.@NonNull Object> extends ArrayList<T> {\n" +
" public <U, V extends java.lang.@Nullable Object> void foo(U u, V v) {}\n" +
"}\n",
- "p/X2.java",
+ "p/X2.java",
"package p;\n"+
"import org.eclipse.jdt.annotation.*;\n" +
"public class X2<@NonNull W extends java.lang.@Nullable Object> {}\n" // incompatible constraints
},
customOptions,
- "----------\n" +
- "1. ERROR in p\\X2.java (at line 3)\n" +
- " public class X2<@NonNull W extends java.lang.@Nullable Object> {}\n" +
- " ^^^^^^^^^\n" +
- "This nullness annotation conflicts with a \'@NonNull\' annotation which is effective on the same type parameter \n" +
+ "----------\n" +
+ "1. ERROR in p\\X2.java (at line 3)\n" +
+ " public class X2<@NonNull W extends java.lang.@Nullable Object> {}\n" +
+ " ^^^^^^^^^\n" +
+ "This nullness annotation conflicts with a \'@NonNull\' annotation which is effective on the same type parameter \n" +
"----------\n");
- // fix the bug:
+ // fix the bug:
runConformTestWithLibs(
new String[] {
"p/X1.java",
@@ -1296,7 +1296,7 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
"public abstract class X1<T extends java.lang.@NonNull Object> extends ArrayList<T> {\n" +
" public <U, V extends java.lang.@Nullable Object> void foo(U u, V v) {}\n" +
"}\n",
- "p/X2.java",
+ "p/X2.java",
"package p;\n"+
"import org.eclipse.jdt.annotation.*;\n" +
"public class X2<@Nullable W extends Object> {}\n"
@@ -1314,18 +1314,18 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" x.<Y1, java.lang.@NonNull Object>foo(this, new Object());\n" + // // OK: 'extends @Nullable' is no restriction
" }\n" +
"}\n"
- },
+ },
customOptions,
- "----------\n" +
- "1. ERROR in Y1.java (at line 3)\n" +
- " p.X1<java.lang.@Nullable String> maybeStrings;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@Nullable String\' is not a valid substitute for the type parameter \'T extends @NonNull Object\'\n" +
- "----------\n" +
- "2. ERROR in Y1.java (at line 4)\n" +
- " p.X2<java.lang.@NonNull String> strings;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@NonNull String\' is not a valid substitute for the type parameter \'@Nullable W extends Object\'\n" +
+ "----------\n" +
+ "1. ERROR in Y1.java (at line 3)\n" +
+ " p.X1<java.lang.@Nullable String> maybeStrings;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@Nullable String\' is not a valid substitute for the type parameter \'T extends @NonNull Object\'\n" +
+ "----------\n" +
+ "2. ERROR in Y1.java (at line 4)\n" +
+ " p.X2<java.lang.@NonNull String> strings;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@NonNull String\' is not a valid substitute for the type parameter \'@Nullable W extends Object\'\n" +
"----------\n"
);
}
@@ -1369,13 +1369,13 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" .get(0).put(null, null);\n" + // second null is illegal
" }\n" +
"}\n"
- },
+ },
customOptions,
- "----------\n" +
- "1. ERROR in Y1.java (at line 6)\n" +
- " .get(0).put(null, null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in Y1.java (at line 6)\n" +
+ " .get(0).put(null, null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n");
}
@@ -1399,11 +1399,11 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
"}\n"
},
customOptions,
- "----------\n" +
- "1. ERROR in p\\X1.java (at line 8)\n" +
- " public void wildcard1(List<@Nullable ? extends @NonNull X1> l) { } // contradiction\n" +
- " ^^^^^^^^\n" +
- "This nullness annotation conflicts with a \'@Nullable\' annotation which is effective on the same type parameter \n" +
+ "----------\n" +
+ "1. ERROR in p\\X1.java (at line 8)\n" +
+ " public void wildcard1(List<@Nullable ? extends @NonNull X1> l) { } // contradiction\n" +
+ " ^^^^^^^^\n" +
+ "This nullness annotation conflicts with a \'@Nullable\' annotation which is effective on the same type parameter \n" +
"----------\n");
// fix the error:
runConformTestWithLibs(
@@ -1439,23 +1439,23 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" x.wildcard1(new ArrayList<@NonNull X1>()); // incompatible\n" +
" }\n" +
"}\n"
- },
+ },
customOptions,
- "----------\n" +
- "1. ERROR in Y1.java (at line 7)\n" +
- " x.arrays(a)[0] = null; // illegal\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'Object @NonNull[]\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in Y1.java (at line 8)\n" +
- " x.nesting(null, null); // 1st null is illegal\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'X1.@NonNull Inner\' but the provided value is null\n" +
- "----------\n" +
- "3. ERROR in Y1.java (at line 11)\n" +
- " x.wildcard1(new ArrayList<@NonNull X1>()); // incompatible\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'List<@Nullable ? extends X1>\' but this expression has type \'@NonNull ArrayList<@NonNull X1>\', corresponding supertype is \'List<@NonNull X1>\'\n" +
+ "----------\n" +
+ "1. ERROR in Y1.java (at line 7)\n" +
+ " x.arrays(a)[0] = null; // illegal\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'Object @NonNull[]\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in Y1.java (at line 8)\n" +
+ " x.nesting(null, null); // 1st null is illegal\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'X1.@NonNull Inner\' but the provided value is null\n" +
+ "----------\n" +
+ "3. ERROR in Y1.java (at line 11)\n" +
+ " x.wildcard1(new ArrayList<@NonNull X1>()); // incompatible\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'List<@Nullable ? extends X1>\' but this expression has type \'@NonNull ArrayList<@NonNull X1>\', corresponding supertype is \'List<@NonNull X1>\'\n" +
"----------\n");
}
@@ -1479,11 +1479,11 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
"}\n"
},
customOptions,
- "----------\n" +
- "1. ERROR in p\\X1.java (at line 7)\n" +
- " public void wildcard1(java.util.List<@Nullable ? extends p.@NonNull X1> l) { } // contradiction\n" +
- " ^^^^^^^^\n" +
- "This nullness annotation conflicts with a \'@Nullable\' annotation which is effective on the same type parameter \n" +
+ "----------\n" +
+ "1. ERROR in p\\X1.java (at line 7)\n" +
+ " public void wildcard1(java.util.List<@Nullable ? extends p.@NonNull X1> l) { } // contradiction\n" +
+ " ^^^^^^^^\n" +
+ "This nullness annotation conflicts with a \'@Nullable\' annotation which is effective on the same type parameter \n" +
"----------\n");
// fix the error:
runConformTestWithLibs(
@@ -1519,26 +1519,26 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" x.wildcard1(new ArrayList<p.@NonNull X1>()); // incompatible\n" +
" }\n" +
"}\n"
- },
+ },
customOptions,
- "----------\n" +
- "1. ERROR in Y1.java (at line 7)\n" +
- " x.arrays(a)[0] = null; // illegal\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'Object @NonNull[]\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in Y1.java (at line 8)\n" +
- " x.nesting(null, null); // 1st null is illegal\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'X1.@NonNull Inner\' but the provided value is null\n" +
- "----------\n" +
- "3. ERROR in Y1.java (at line 11)\n" +
- " x.wildcard1(new ArrayList<p.@NonNull X1>()); // incompatible\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'List<@Nullable ? extends X1>\' but this expression has type \'@NonNull ArrayList<@NonNull X1>\', corresponding supertype is \'List<@NonNull X1>\'\n" +
+ "----------\n" +
+ "1. ERROR in Y1.java (at line 7)\n" +
+ " x.arrays(a)[0] = null; // illegal\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'Object @NonNull[]\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in Y1.java (at line 8)\n" +
+ " x.nesting(null, null); // 1st null is illegal\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'X1.@NonNull Inner\' but the provided value is null\n" +
+ "----------\n" +
+ "3. ERROR in Y1.java (at line 11)\n" +
+ " x.wildcard1(new ArrayList<p.@NonNull X1>()); // incompatible\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'List<@Nullable ? extends X1>\' but this expression has type \'@NonNull ArrayList<@NonNull X1>\', corresponding supertype is \'List<@NonNull X1>\'\n" +
"----------\n");
}
-
+
// storing and decoding null-type-annotations to/from classfile: EXTENDED DIMENSIONS.
public void testBinary09() {
Map customOptions = getCompilerOptions();
@@ -1557,21 +1557,21 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " @NonNull String @Nullable [] f @NonNull [] = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String @NonNull[] @Nullable[]\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " p = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String @NonNull[] @Nullable[]\' but the provided value is null\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " @NonNull String @Nullable [] l @NonNull [] = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String @NonNull[] @Nullable[]\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " @NonNull String @Nullable [] f @NonNull [] = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String @NonNull[] @Nullable[]\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " p = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String @NonNull[] @Nullable[]\' but the provided value is null\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " @NonNull String @Nullable [] l @NonNull [] = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String @NonNull[] @Nullable[]\' but the provided value is null\n" +
"----------\n");
// fix the error:
runConformTestWithLibs(
@@ -1597,31 +1597,31 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" x.f[0][0] = null;\n" +
" }\n" +
"}\n"
- },
+ },
customOptions,
- "----------\n" +
- "1. WARNING in Y.java (at line 1)\n" +
- " import org.eclipse.jdt.annotation.*;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The import org.eclipse.jdt.annotation is never used\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 4)\n" +
- " x.f = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String @NonNull[] @Nullable[]\' but the provided value is null\n" +
- "----------\n" +
- "3. ERROR in Y.java (at line 6)\n" +
- " x.f[0][0] = null;\n" +
- " ^^^^^^\n" +
- "Potential null pointer access: array element may be null\n" +
- "----------\n" +
- "4. ERROR in Y.java (at line 6)\n" +
- " x.f[0][0] = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "1. WARNING in Y.java (at line 1)\n" +
+ " import org.eclipse.jdt.annotation.*;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The import org.eclipse.jdt.annotation is never used\n" +
+ "----------\n" +
+ "2. ERROR in Y.java (at line 4)\n" +
+ " x.f = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String @NonNull[] @Nullable[]\' but the provided value is null\n" +
+ "----------\n" +
+ "3. ERROR in Y.java (at line 6)\n" +
+ " x.f[0][0] = null;\n" +
+ " ^^^^^^\n" +
+ "Potential null pointer access: array element may be null\n" +
+ "----------\n" +
+ "4. ERROR in Y.java (at line 6)\n" +
+ " x.f[0][0] = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n");
}
-
+
// storing and decoding null-type-annotations to/from classfile: array annotations.
public void testBinary10() {
Map customOptions = getCompilerOptions();
@@ -1641,11 +1641,11 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " super.foo(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'ArrayList<String> @NonNull[]\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " super.foo(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'ArrayList<String> @NonNull[]\' but the provided value is null\n" +
"----------\n");
// fix the error:
runConformTestWithLibs(
@@ -1669,13 +1669,13 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" super.foo(null);\n" +
" }\n" +
"}\n"
- },
+ },
customOptions,
- "----------\n" +
- "1. ERROR in Y.java (at line 3)\n" +
- " super.foo(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'ArrayList<String> @NonNull[]\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in Y.java (at line 3)\n" +
+ " super.foo(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'ArrayList<String> @NonNull[]\' but the provided value is null\n" +
"----------\n");
}
@@ -1699,16 +1699,16 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
+ "}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " return f == 0 ? good : dubious;\n" +
- " ^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'List<String>\' needs unchecked conversion to conform to \'List<@NonNull String>\'\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " return f == 2 ? dubious : good;\n" +
- " ^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'List<String>\' needs unchecked conversion to conform to \'List<@NonNull String>\'\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " return f == 0 ? good : dubious;\n" +
+ " ^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'List<String>\' needs unchecked conversion to conform to \'List<@NonNull String>\'\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " return f == 2 ? dubious : good;\n" +
+ " ^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'List<String>\' needs unchecked conversion to conform to \'List<@NonNull String>\'\n" +
"----------\n");
}
@@ -1732,16 +1732,16 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
+ "}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " return f == 0 ? good : dubious;\n" +
- " ^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'ArrayList<String>\' needs unchecked conversion to conform to \'List<@NonNull String>\', corresponding supertype is 'List<String>'\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " return f == 2 ? dubious : good;\n" +
- " ^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'ArrayList<String>\' needs unchecked conversion to conform to \'List<@NonNull String>\', corresponding supertype is 'List<String>'\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " return f == 0 ? good : dubious;\n" +
+ " ^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'ArrayList<String>\' needs unchecked conversion to conform to \'List<@NonNull String>\', corresponding supertype is 'List<String>'\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " return f == 2 ? dubious : good;\n" +
+ " ^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'ArrayList<String>\' needs unchecked conversion to conform to \'List<@NonNull String>\', corresponding supertype is 'List<String>'\n" +
"----------\n");
}
@@ -1763,16 +1763,16 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
+ "}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " consume(f == 0 ? good : dubious);\n" +
- " ^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'List<String>\' needs unchecked conversion to conform to \'List<@NonNull String>\'\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " consume(f == 2 ? dubious : good);\n" +
- " ^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'List<String>\' needs unchecked conversion to conform to \'List<@NonNull String>\'\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " consume(f == 0 ? good : dubious);\n" +
+ " ^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'List<String>\' needs unchecked conversion to conform to \'List<@NonNull String>\'\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " consume(f == 2 ? dubious : good);\n" +
+ " ^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'List<String>\' needs unchecked conversion to conform to \'List<@NonNull String>\'\n" +
"----------\n");
}
@@ -1928,36 +1928,36 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
+ "}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " return dubious;\n" +
- " ^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'List<String>\' needs unchecked conversion to conform to \'List<@NonNull String>\'\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " return dubious;\n" +
- " ^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'List<String>\' needs unchecked conversion to conform to \'List<@Nullable String>\'\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 11)\n" +
- " List<@Nullable String> l1 = dubious;\n" +
- " ^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'List<String>\' needs unchecked conversion to conform to \'List<@Nullable String>\'\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 12)\n" +
- " List<@NonNull String> l2 = dubious;\n" +
- " ^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'List<String>\' needs unchecked conversion to conform to \'List<@NonNull String>\'\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 15)\n" +
- " acceptNulls(dubious);\n" +
- " ^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'List<String>\' needs unchecked conversion to conform to \'List<@NonNull String>\'\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 16)\n" +
- " acceptNoNulls(dubious);\n" +
- " ^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'List<String>\' needs unchecked conversion to conform to \'List<@NonNull String>\'\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " return dubious;\n" +
+ " ^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'List<String>\' needs unchecked conversion to conform to \'List<@NonNull String>\'\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " return dubious;\n" +
+ " ^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'List<String>\' needs unchecked conversion to conform to \'List<@Nullable String>\'\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 11)\n" +
+ " List<@Nullable String> l1 = dubious;\n" +
+ " ^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'List<String>\' needs unchecked conversion to conform to \'List<@Nullable String>\'\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 12)\n" +
+ " List<@NonNull String> l2 = dubious;\n" +
+ " ^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'List<String>\' needs unchecked conversion to conform to \'List<@NonNull String>\'\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 15)\n" +
+ " acceptNulls(dubious);\n" +
+ " ^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'List<String>\' needs unchecked conversion to conform to \'List<@NonNull String>\'\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 16)\n" +
+ " acceptNoNulls(dubious);\n" +
+ " ^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'List<String>\' needs unchecked conversion to conform to \'List<@NonNull String>\'\n" +
"----------\n");
}
@@ -1988,36 +1988,36 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
+ "}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " return dubious;\n" +
- " ^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'@NonNull String []\'\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " return dubious;\n" +
- " ^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'@Nullable String []\'\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 10)\n" +
- " @Nullable String[] l1 = dubious;\n" +
- " ^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'@Nullable String []\'\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 11)\n" +
- " @NonNull String[] l2 = dubious;\n" +
- " ^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'@NonNull String []\'\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 14)\n" +
- " acceptNulls(dubious);\n" +
- " ^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'@Nullable String []\'\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 15)\n" +
- " acceptNoNulls(dubious);\n" +
- " ^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'@NonNull String []\'\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " return dubious;\n" +
+ " ^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'@NonNull String []\'\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " return dubious;\n" +
+ " ^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'@Nullable String []\'\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 10)\n" +
+ " @Nullable String[] l1 = dubious;\n" +
+ " ^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'@Nullable String []\'\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 11)\n" +
+ " @NonNull String[] l2 = dubious;\n" +
+ " ^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'@NonNull String []\'\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 14)\n" +
+ " acceptNulls(dubious);\n" +
+ " ^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'@Nullable String []\'\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 15)\n" +
+ " acceptNoNulls(dubious);\n" +
+ " ^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'@NonNull String []\'\n" +
"----------\n");
}
@@ -2044,36 +2044,36 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
+ " }\n"
+ "}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " return noNulls;\n" +
- " ^^^^^^^\n" +
- "Null type mismatch (type annotations): required 'List<@Nullable String>' but this expression has type 'List<@NonNull String>'\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " return withNulls;\n" +
- " ^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required 'List<@NonNull String>' but this expression has type 'List<@Nullable String>'\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " List<@NonNull String> l1 = withNulls;\n" +
- " ^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required 'List<@NonNull String>' but this expression has type 'List<@Nullable String>'\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 12)\n" +
- " List<@Nullable String> l2 = noNulls;\n" +
- " ^^^^^^^\n" +
- "Null type mismatch (type annotations): required 'List<@Nullable String>' but this expression has type 'List<@NonNull String>'\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 15)\n" +
- " assigns(withNulls, noNulls);\n" +
- " ^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required 'List<@NonNull String>' but this expression has type 'List<@Nullable String>'\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 15)\n" +
- " assigns(withNulls, noNulls);\n" +
- " ^^^^^^^\n" +
- "Null type mismatch (type annotations): required 'List<@Nullable String>' but this expression has type 'List<@NonNull String>'\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " return noNulls;\n" +
+ " ^^^^^^^\n" +
+ "Null type mismatch (type annotations): required 'List<@Nullable String>' but this expression has type 'List<@NonNull String>'\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " return withNulls;\n" +
+ " ^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required 'List<@NonNull String>' but this expression has type 'List<@Nullable String>'\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " List<@NonNull String> l1 = withNulls;\n" +
+ " ^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required 'List<@NonNull String>' but this expression has type 'List<@Nullable String>'\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 12)\n" +
+ " List<@Nullable String> l2 = noNulls;\n" +
+ " ^^^^^^^\n" +
+ "Null type mismatch (type annotations): required 'List<@Nullable String>' but this expression has type 'List<@NonNull String>'\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 15)\n" +
+ " assigns(withNulls, noNulls);\n" +
+ " ^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required 'List<@NonNull String>' but this expression has type 'List<@Nullable String>'\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 15)\n" +
+ " assigns(withNulls, noNulls);\n" +
+ " ^^^^^^^\n" +
+ "Null type mismatch (type annotations): required 'List<@Nullable String>' but this expression has type 'List<@NonNull String>'\n" +
"----------\n");
}
@@ -2099,36 +2099,36 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
+ " }\n"
+ "}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " return noNulls;\n" +
- " ^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@Nullable String []\' but this expression has type \'@NonNull String []\'\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " return withNulls;\n" +
- " ^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String []\' but this expression has type \'@Nullable String []\'\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " @NonNull String[] l1 = withNulls;\n" +
- " ^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String []\' but this expression has type \'@Nullable String []\'\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 11)\n" +
- " @Nullable String[] l2 = noNulls;\n" +
- " ^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@Nullable String []\' but this expression has type \'@NonNull String []\'\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 14)\n" +
- " assigns(withNulls, noNulls);\n" +
- " ^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String []\' but this expression has type \'@Nullable String []\'\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 14)\n" +
- " assigns(withNulls, noNulls);\n" +
- " ^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@Nullable String []\' but this expression has type \'@NonNull String []\'\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " return noNulls;\n" +
+ " ^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@Nullable String []\' but this expression has type \'@NonNull String []\'\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " return withNulls;\n" +
+ " ^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String []\' but this expression has type \'@Nullable String []\'\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 10)\n" +
+ " @NonNull String[] l1 = withNulls;\n" +
+ " ^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String []\' but this expression has type \'@Nullable String []\'\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 11)\n" +
+ " @Nullable String[] l2 = noNulls;\n" +
+ " ^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@Nullable String []\' but this expression has type \'@NonNull String []\'\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 14)\n" +
+ " assigns(withNulls, noNulls);\n" +
+ " ^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String []\' but this expression has type \'@Nullable String []\'\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 14)\n" +
+ " assigns(withNulls, noNulls);\n" +
+ " ^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@Nullable String []\' but this expression has type \'@NonNull String []\'\n" +
"----------\n");
}
@@ -2137,23 +2137,23 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import java.util.Map;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "abstract public class X<Y> implements Map<@NonNull String,Y> {\n" +
- " void foo(X<Object> x) {\n" +
- " Map<@NonNull String, Object> m1 = x; // OK\n" +
- " Map<@Nullable String, Object> m2 = x; // NOK\n" +
- " }\n" +
+ "import java.util.Map;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "abstract public class X<Y> implements Map<@NonNull String,Y> {\n" +
+ " void foo(X<Object> x) {\n" +
+ " Map<@NonNull String, Object> m1 = x; // OK\n" +
+ " Map<@Nullable String, Object> m2 = x; // NOK\n" +
+ " }\n" +
"}"
},
getCompilerOptions(),
"----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " Map<@Nullable String, Object> m2 = x; // NOK\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'Map<@Nullable String,Object>\' but this expression has type \'X<Object>\', corresponding supertype is \'Map<@NonNull String,Object>\'\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " Map<@Nullable String, Object> m2 = x; // NOK\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'Map<@Nullable String,Object>\' but this expression has type \'X<Object>\', corresponding supertype is \'Map<@NonNull String,Object>\'\n" +
"----------\n");
}
@@ -2162,23 +2162,23 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import java.util.Map;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "abstract public class X<@Nullable Y> implements Map<@Nullable String,Y> {\n" +
- " void foo(X<@Nullable Object> x) {\n" +
- " Map<@Nullable String, @Nullable Object> m1 = x; // OK\n" +
- " Map<@Nullable String, @NonNull Object> m2 = x; // NOK\n" +
- " }\n" +
+ "import java.util.Map;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "abstract public class X<@Nullable Y> implements Map<@Nullable String,Y> {\n" +
+ " void foo(X<@Nullable Object> x) {\n" +
+ " Map<@Nullable String, @Nullable Object> m1 = x; // OK\n" +
+ " Map<@Nullable String, @NonNull Object> m2 = x; // NOK\n" +
+ " }\n" +
"}"
},
getCompilerOptions(),
"----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " Map<@Nullable String, @NonNull Object> m2 = x; // NOK\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'Map<@Nullable String,@NonNull Object>\' but this expression has type \'X<@Nullable Object>\', corresponding supertype is \'Map<@Nullable String,@Nullable Object>\'\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " Map<@Nullable String, @NonNull Object> m2 = x; // NOK\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'Map<@Nullable String,@NonNull Object>\' but this expression has type \'X<@Nullable Object>\', corresponding supertype is \'Map<@Nullable String,@Nullable Object>\'\n" +
"----------\n");
}
@@ -2190,11 +2190,11 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
"import org.eclipse.jdt.annotation.*;\n" +
"public @NonNull class X {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public @NonNull class X {}\n" +
- " ^^^^^^^^\n" +
- "The nullness annotation \'NonNull\' is not applicable at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public @NonNull class X {}\n" +
+ " ^^^^^^^^\n" +
+ "The nullness annotation \'NonNull\' is not applicable at this location\n" +
"----------\n");
}
@@ -2213,26 +2213,26 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " @NonNull X.Inner f;\n" +
- " ^^^^^^^^\n" +
- "The nullness annotation \'NonNull\' is not applicable at this location, it must be placed directly before the nested type name.\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " @NonNull X.Inner foo(@NonNull X.Inner arg) {\n" +
- " ^^^^^^^^\n" +
- "The nullness annotation \'NonNull\' is not applicable at this location, it must be placed directly before the nested type name.\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " @NonNull X.Inner foo(@NonNull X.Inner arg) {\n" +
- " ^^^^^^^^\n" +
- "The nullness annotation \'NonNull\' is not applicable at this location, it must be placed directly before the nested type name.\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " @NonNull X.Inner local = arg;\n" +
- " ^^^^^^^^\n" +
- "The nullness annotation \'NonNull\' is not applicable at this location, it must be placed directly before the nested type name.\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " @NonNull X.Inner f;\n" +
+ " ^^^^^^^^\n" +
+ "The nullness annotation \'NonNull\' is not applicable at this location, it must be placed directly before the nested type name.\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " @NonNull X.Inner foo(@NonNull X.Inner arg) {\n" +
+ " ^^^^^^^^\n" +
+ "The nullness annotation \'NonNull\' is not applicable at this location, it must be placed directly before the nested type name.\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " @NonNull X.Inner foo(@NonNull X.Inner arg) {\n" +
+ " ^^^^^^^^\n" +
+ "The nullness annotation \'NonNull\' is not applicable at this location, it must be placed directly before the nested type name.\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " @NonNull X.Inner local = arg;\n" +
+ " ^^^^^^^^\n" +
+ "The nullness annotation \'NonNull\' is not applicable at this location, it must be placed directly before the nested type name.\n" +
"----------\n");
}
@@ -2250,21 +2250,21 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " if (!(arg instanceof @NonNull X))\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The expression of type X is already an instance of type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " if (!(arg instanceof @NonNull X))\n" +
- " ^^^^^^^^^^\n" +
- "Nullness annotations are not applicable at this location \n" +
- "----------\n" +
- "3. WARNING in X.java (at line 5)\n" +
- " return (@NonNull X)arg;\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Null type safety: Unchecked cast from X to @NonNull X\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " if (!(arg instanceof @NonNull X))\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The expression of type X is already an instance of type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " if (!(arg instanceof @NonNull X))\n" +
+ " ^^^^^^^^^^\n" +
+ "Nullness annotations are not applicable at this location \n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 5)\n" +
+ " return (@NonNull X)arg;\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Null type safety: Unchecked cast from X to @NonNull X\n" +
"----------\n");
}
@@ -2287,49 +2287,49 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" return (p.X @NonNull[])arg;\n" +
" return arg;\n" +
" }\n" +
- " ArrayList<@NonNull String> foo(List<@NonNull String> l) {\n" +
- " return (ArrayList<@NonNull String>) l;\n" + // OK
+ " ArrayList<@NonNull String> foo(List<@NonNull String> l) {\n" +
+ " return (ArrayList<@NonNull String>) l;\n" + // OK
" }" +
- " ArrayList<@NonNull String> foo2(List<@NonNull String> l) {\n" +
+ " ArrayList<@NonNull String> foo2(List<@NonNull String> l) {\n" +
" return (ArrayList<String>) l;\n" + // warn, TODO(stephan) with flow analysis (bug 415292) we might recover the original @NonNull...
" }" +
"}\n"
},
- "----------\n" +
- "1. ERROR in p\\X.java (at line 6)\n" +
- " if (!(arg instanceof List<@NonNull X>))\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot perform instanceof check against parameterized type List<X>. Use the form List<?> instead since further generic type information will be erased at runtime\n" +
- "----------\n" +
- "2. ERROR in p\\X.java (at line 6)\n" +
- " if (!(arg instanceof List<@NonNull X>))\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Nullness annotations are not applicable at this location \n" +
- "----------\n" +
- "3. WARNING in p\\X.java (at line 7)\n" +
- " return (java.util.List<@NonNull X>)arg;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety: Unchecked cast from List<X> to List<@NonNull X>\n" +
- "----------\n" +
- "4. WARNING in p\\X.java (at line 11)\n" +
- " if (!(arg instanceof X @NonNull[]))\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The expression of type X[] is already an instance of type X[]\n" +
- "----------\n" +
- "5. ERROR in p\\X.java (at line 11)\n" +
- " if (!(arg instanceof X @NonNull[]))\n" +
- " ^^^^^^^^^^^^\n" +
- "Nullness annotations are not applicable at this location \n" +
- "----------\n" +
- "6. WARNING in p\\X.java (at line 12)\n" +
- " return (p.X @NonNull[])arg;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety: Unchecked cast from X[] to X @NonNull[]\n" +
- "----------\n" +
- "7. WARNING in p\\X.java (at line 18)\n" +
- " return (ArrayList<String>) l;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'ArrayList<String>\' needs unchecked conversion to conform to \'ArrayList<@NonNull String>\'\n" +
+ "----------\n" +
+ "1. ERROR in p\\X.java (at line 6)\n" +
+ " if (!(arg instanceof List<@NonNull X>))\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot perform instanceof check against parameterized type List<X>. Use the form List<?> instead since further generic type information will be erased at runtime\n" +
+ "----------\n" +
+ "2. ERROR in p\\X.java (at line 6)\n" +
+ " if (!(arg instanceof List<@NonNull X>))\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Nullness annotations are not applicable at this location \n" +
+ "----------\n" +
+ "3. WARNING in p\\X.java (at line 7)\n" +
+ " return (java.util.List<@NonNull X>)arg;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety: Unchecked cast from List<X> to List<@NonNull X>\n" +
+ "----------\n" +
+ "4. WARNING in p\\X.java (at line 11)\n" +
+ " if (!(arg instanceof X @NonNull[]))\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The expression of type X[] is already an instance of type X[]\n" +
+ "----------\n" +
+ "5. ERROR in p\\X.java (at line 11)\n" +
+ " if (!(arg instanceof X @NonNull[]))\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Nullness annotations are not applicable at this location \n" +
+ "----------\n" +
+ "6. WARNING in p\\X.java (at line 12)\n" +
+ " return (p.X @NonNull[])arg;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety: Unchecked cast from X[] to X @NonNull[]\n" +
+ "----------\n" +
+ "7. WARNING in p\\X.java (at line 18)\n" +
+ " return (ArrayList<String>) l;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'ArrayList<String>\' needs unchecked conversion to conform to \'ArrayList<@NonNull String>\'\n" +
"----------\n",
this.LIBS,
true/*flush*/);
@@ -2343,16 +2343,16 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
"import org.eclipse.jdt.annotation.*;\n" +
"import java.util.*;\n" +
"public class X {\n" +
- " boolean instanceOf2(Object o) {\n" +
- " return o instanceof List<@Nullable ?>;\n" +
- " }\n" +
+ " boolean instanceOf2(Object o) {\n" +
+ " return o instanceof List<@Nullable ?>;\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " return o instanceof List<@Nullable ?>;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Nullness annotations are not applicable at this location \n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " return o instanceof List<@Nullable ?>;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Nullness annotations are not applicable at this location \n" +
"----------\n");
}
@@ -2369,16 +2369,16 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" java.util.List<@NonNull String> s = new java.util.ArrayList<@NonNull String>();\n" + // OK
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " X x = new @NonNull X();\n" +
- " ^^^^^^^^\n" +
- "The nullness annotation \'NonNull\' is not applicable at this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " Inner i = this.new @Nullable Inner();\n" +
- " ^^^^^^^^^\n" +
- "The nullness annotation \'Nullable\' is not applicable at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " X x = new @NonNull X();\n" +
+ " ^^^^^^^^\n" +
+ "The nullness annotation \'NonNull\' is not applicable at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " Inner i = this.new @Nullable Inner();\n" +
+ " ^^^^^^^^^\n" +
+ "The nullness annotation \'Nullable\' is not applicable at this location\n" +
"----------\n");
}
@@ -2389,14 +2389,14 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
"X.java",
"import org.eclipse.jdt.annotation.*;\n" +
"public class X {\n" +
- " void receiver(@Nullable X this, Object o) {}\n" +
+ " void receiver(@Nullable X this, Object o) {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " void receiver(@Nullable X this, Object o) {}\n" +
- " ^^^^^^^^^^^\n" +
- "Nullness annotations are not applicable at this location \n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " void receiver(@Nullable X this, Object o) {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "Nullness annotations are not applicable at this location \n" +
"----------\n");
}
@@ -2408,24 +2408,24 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
"import org.eclipse.jdt.annotation.*;\n" +
"import java.util.function.Supplier;\n" +
"public class X {\n" +
- " void consume(Supplier<Object> c) {}\n" +
- " static Object supply() { return null; }\n" +
- " void consumeSupplied() {\n" +
- " consume(@NonNull X::supply);\n" +
- " consume(@NonNull X::new);\n" +
- " }\n" +
+ " void consume(Supplier<Object> c) {}\n" +
+ " static Object supply() { return null; }\n" +
+ " void consumeSupplied() {\n" +
+ " consume(@NonNull X::supply);\n" +
+ " consume(@NonNull X::new);\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " consume(@NonNull X::supply);\n" +
- " ^^^^^^^^^^\n" +
- "Nullness annotations are not applicable at this location \n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " consume(@NonNull X::new);\n" +
- " ^^^^^^^^^^\n" +
- "Nullness annotations are not applicable at this location \n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " consume(@NonNull X::supply);\n" +
+ " ^^^^^^^^^^\n" +
+ "Nullness annotations are not applicable at this location \n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " consume(@NonNull X::new);\n" +
+ " ^^^^^^^^^^\n" +
+ "Nullness annotations are not applicable at this location \n" +
"----------\n");
}
@@ -2437,24 +2437,24 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
"import org.eclipse.jdt.annotation.*;\n" +
"import java.io.*;\n" +
"public class X {\n" +
- " void throwsDecl() throws @Nullable IOException {}\n" +
- " void excParam() {\n" +
- " try {\n" +
- " throwsDecl();\n" +
- " } catch (@NonNull IOException ioe) {}\n" +
- " }\n" +
+ " void throwsDecl() throws @Nullable IOException {}\n" +
+ " void excParam() {\n" +
+ " try {\n" +
+ " throwsDecl();\n" +
+ " } catch (@NonNull IOException ioe) {}\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " void throwsDecl() throws @Nullable IOException {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Nullness annotations are not applicable at this location \n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " } catch (@NonNull IOException ioe) {}\n" +
- " ^^^^^^^^^^^\n" +
- "Nullness annotations are not applicable at this location \n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " void throwsDecl() throws @Nullable IOException {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Nullness annotations are not applicable at this location \n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " } catch (@NonNull IOException ioe) {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "Nullness annotations are not applicable at this location \n" +
"----------\n");
}
@@ -2477,14 +2477,14 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" void logMsg(@NonNull String msg) { }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " logMsg(s2);\n" +
- " ^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is inferred as @Nullable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " logMsg(s2);\n" +
+ " ^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is inferred as @Nullable\n" +
"----------\n");
}
-
+
// poly-null method
public void testNullTypeInference1() {
Map compilerOptions = getCompilerOptions();
@@ -2511,11 +2511,11 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
"}\n"
},
compilerOptions,
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " return polyNullMethod(strings).get(0);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " return polyNullMethod(strings).get(0);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
"----------\n");
}
@@ -2524,27 +2524,27 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
runNegativeTestWithLibs(
new String[] {
"PolyNull.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "interface NNFunc {\n" +
- " @NonNull String a(@NonNull String i);\n" +
- "}\n" +
- "public class PolyNull {\n" +
- " @NonNull String extract(NNFunc f, @NonNull String s) { return f.a(s); }\n" +
- " @NonNull String testOK() {\n" +
- " return extract(i -> i, \"hallo\");\n" +
- " }\n" +
- " @NonNull String testERR() {\n" +
- " return extract(i -> null, \"hallo\"); // err\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "interface NNFunc {\n" +
+ " @NonNull String a(@NonNull String i);\n" +
+ "}\n" +
+ "public class PolyNull {\n" +
+ " @NonNull String extract(NNFunc f, @NonNull String s) { return f.a(s); }\n" +
+ " @NonNull String testOK() {\n" +
+ " return extract(i -> i, \"hallo\");\n" +
+ " }\n" +
+ " @NonNull String testERR() {\n" +
+ " return extract(i -> null, \"hallo\"); // err\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in PolyNull.java (at line 12)\n" +
- " return extract(i -> null, \"hallo\"); // err\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in PolyNull.java (at line 12)\n" +
+ " return extract(i -> null, \"hallo\"); // err\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n");
}
@@ -2553,27 +2553,27 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
runNegativeTestWithLibs(
new String[] {
"PolyNull.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "interface Func<T> {\n" +
- " T a(T i);\n" +
- "}\n" +
- "public class PolyNull {\n" +
- " @NonNull String extract(Func<@NonNull String> f, @NonNull String s) { return f.a(s); }\n" +
- " @NonNull String testOK() {\n" +
- " return extract(i -> i, \"hallo\");\n" +
- " }\n" +
- " @NonNull String testERR() {\n" +
- " return extract(i -> null, \"hallo\"); // err\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "interface Func<T> {\n" +
+ " T a(T i);\n" +
+ "}\n" +
+ "public class PolyNull {\n" +
+ " @NonNull String extract(Func<@NonNull String> f, @NonNull String s) { return f.a(s); }\n" +
+ " @NonNull String testOK() {\n" +
+ " return extract(i -> i, \"hallo\");\n" +
+ " }\n" +
+ " @NonNull String testERR() {\n" +
+ " return extract(i -> null, \"hallo\"); // err\n" +
" }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in PolyNull.java (at line 12)\n" +
- " return extract(i -> null, \"hallo\"); // err\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in PolyNull.java (at line 12)\n" +
+ " return extract(i -> null, \"hallo\"); // err\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n");
}
@@ -2582,27 +2582,27 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
runNegativeTestWithLibs(
new String[] {
"PolyNull.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "interface Func<T> {\n" +
- " T a(T i);\n" +
- "}\n" +
- "public class PolyNull {\n" +
- " <X> X extract(Func<X> f, X s) { return f.a(s); }\n" +
- " @NonNull String testOK() {\n" +
- " return extract((@NonNull String i) -> i, \"hallo\");\n" +
- " }\n" +
- " @NonNull String testERR() {\n" +
- " return extract((@NonNull String i) -> null, \"hallo\"); // err\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "interface Func<T> {\n" +
+ " T a(T i);\n" +
+ "}\n" +
+ "public class PolyNull {\n" +
+ " <X> X extract(Func<X> f, X s) { return f.a(s); }\n" +
+ " @NonNull String testOK() {\n" +
+ " return extract((@NonNull String i) -> i, \"hallo\");\n" +
+ " }\n" +
+ " @NonNull String testERR() {\n" +
+ " return extract((@NonNull String i) -> null, \"hallo\"); // err\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in PolyNull.java (at line 12)\n" +
- " return extract((@NonNull String i) -> null, \"hallo\"); // err\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in PolyNull.java (at line 12)\n" +
+ " return extract((@NonNull String i) -> null, \"hallo\"); // err\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n");
}
@@ -2611,27 +2611,27 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
runNegativeTestWithLibs(
new String[] {
"PolyNull.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "interface Func<T> {\n" +
- " T a(T i);\n" +
- "}\n" +
- "public class PolyNull {\n" +
- " <X> X extract(Func<X> f, X s) { return f.a(s); }\n" +
- " @NonNull String testOK() {\n" +
- " return extract(i -> i, \"hallo\");\n" +
- " }\n" +
- " @NonNull String testERR() {\n" +
- " return extract(i -> null, \"hallo\"); // err\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "interface Func<T> {\n" +
+ " T a(T i);\n" +
+ "}\n" +
+ "public class PolyNull {\n" +
+ " <X> X extract(Func<X> f, X s) { return f.a(s); }\n" +
+ " @NonNull String testOK() {\n" +
+ " return extract(i -> i, \"hallo\");\n" +
+ " }\n" +
+ " @NonNull String testERR() {\n" +
+ " return extract(i -> null, \"hallo\"); // err\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in PolyNull.java (at line 12)\n" +
- " return extract(i -> null, \"hallo\"); // err\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in PolyNull.java (at line 12)\n" +
+ " return extract(i -> null, \"hallo\"); // err\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n");
}
@@ -2641,24 +2641,24 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
true/*flush*/,
new String[] {
"PolyNull.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "interface Func<T> {\n" +
- " T a(T i);\n" +
- "}\n" +
- "public class PolyNull {\n" +
- " String extract(Func<@Nullable String> f, @Nullable String s) { return f.a(s); }\n" +
- " @NonNull String testWARN() {\n" +
- " return extract(i -> null, \"hallo\"); // OK to pass null\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "interface Func<T> {\n" +
+ " T a(T i);\n" +
+ "}\n" +
+ "public class PolyNull {\n" +
+ " String extract(Func<@Nullable String> f, @Nullable String s) { return f.a(s); }\n" +
+ " @NonNull String testWARN() {\n" +
+ " return extract(i -> null, \"hallo\"); // OK to pass null\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in PolyNull.java (at line 9)\n" +
- " return extract(i -> null, \"hallo\"); // OK to pass null\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull String\'\n" +
+ "----------\n" +
+ "1. WARNING in PolyNull.java (at line 9)\n" +
+ " return extract(i -> null, \"hallo\"); // OK to pass null\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull String\'\n" +
"----------\n");
}
@@ -2667,35 +2667,35 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
runNegativeTestWithLibs(
new String[] {
"PolyNull.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "interface Func<T> {\n" +
- " T a(T i);\n" +
- "}\n" +
- "public class PolyNull {\n" +
- " <X> X extract(Func<@Nullable X> f, @Nullable X s) { return f.a(s); }\n" +
- " @NonNull String testERR() {\n" +
- " return extract(i -> needNN(i), \"ola\");\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "interface Func<T> {\n" +
+ " T a(T i);\n" +
+ "}\n" +
+ "public class PolyNull {\n" +
+ " <X> X extract(Func<@Nullable X> f, @Nullable X s) { return f.a(s); }\n" +
+ " @NonNull String testERR() {\n" +
+ " return extract(i -> needNN(i), \"ola\");\n" +
" }\n" +
- " @NonNull String needNN(@NonNull String s) { return \"\"; }\n" +
- "" +
+ " @NonNull String needNN(@NonNull String s) { return \"\"; }\n" +
+ "" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in PolyNull.java (at line 7)\n" +
- " <X> X extract(Func<@Nullable X> f, @Nullable X s) { return f.a(s); }\n" +
- " ^^^^^^\n" +
- "Null type mismatch (type annotations): required \'X\' but this expression has type \'@Nullable X\', where 'X' is a free type variable\n" +
- "----------\n" +
- "2. ERROR in PolyNull.java (at line 9)\n" +
- " return extract(i -> needNN(i), \"ola\");\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
+ "----------\n" +
+ "1. ERROR in PolyNull.java (at line 7)\n" +
+ " <X> X extract(Func<@Nullable X> f, @Nullable X s) { return f.a(s); }\n" +
+ " ^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'X\' but this expression has type \'@Nullable X\', where 'X' is a free type variable\n" +
+ "----------\n" +
+ "2. ERROR in PolyNull.java (at line 9)\n" +
+ " return extract(i -> needNN(i), \"ola\");\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
"----------\n");
}
- // seemingly conflicting annotations from type variable application and type variable substitution
+ // seemingly conflicting annotations from type variable application and type variable substitution
// -> ignore @Nullable which overrides the type variable's nullness for this one location
public void testNullTypeInference3() {
Map compilerOptions = getCompilerOptions();
@@ -2703,25 +2703,25 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
runNegativeTestWithLibs(
new String[] {
"Generics.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public class Generics {\n" +
- " <X> X m(@Nullable X a) { return null; }\n" +
- " void test(@NonNull String in) {\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "public class Generics {\n" +
+ " <X> X m(@Nullable X a) { return null; }\n" +
+ " void test(@NonNull String in) {\n" +
" @NonNull String s = m(in);\n" + // inferred OK as 'm(@Nullable String) -> @NonNull String'
- " System.out.println(s.toLowerCase());\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new Generics().test(\"hallo\");\n" +
- " }\n" +
+ " System.out.println(s.toLowerCase());\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new Generics().test(\"hallo\");\n" +
+ " }\n" +
"}\n"
},
compilerOptions,
- "----------\n" +
- "1. ERROR in Generics.java (at line 4)\n" +
- " <X> X m(@Nullable X a) { return null; }\n" +
- " ^^^^\n" +
- "Null type mismatch (type annotations): \'null\' is not compatible to the free type variable 'X'\n" +
+ "----------\n" +
+ "1. ERROR in Generics.java (at line 4)\n" +
+ " <X> X m(@Nullable X a) { return null; }\n" +
+ " ^^^^\n" +
+ "Null type mismatch (type annotations): \'null\' is not compatible to the free type variable 'X'\n" +
"----------\n");
}
@@ -2730,72 +2730,72 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
runNegativeTestWithLibs(
new String[] {
"Generics.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public class Generics {\n" +
- " <X> @Nullable X m1(@Nullable X a) { return null; }\n" +
- " <X> @Nullable X m2(X a) { return null; }\n" +
- " void test(@NonNull String in) {\n" +
- " @NonNull String s1 = m1(in);\n" +
- " @NonNull String s2 = m2(in);\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new Generics().test(\"hallo\");\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "public class Generics {\n" +
+ " <X> @Nullable X m1(@Nullable X a) { return null; }\n" +
+ " <X> @Nullable X m2(X a) { return null; }\n" +
+ " void test(@NonNull String in) {\n" +
+ " @NonNull String s1 = m1(in);\n" +
+ " @NonNull String s2 = m2(in);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new Generics().test(\"hallo\");\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in Generics.java (at line 7)\n" +
- " @NonNull String s1 = m1(in);\n" +
- " ^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
- "----------\n" +
- "2. ERROR in Generics.java (at line 8)\n" +
- " @NonNull String s2 = m2(in);\n" +
- " ^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
+ "----------\n" +
+ "1. ERROR in Generics.java (at line 7)\n" +
+ " @NonNull String s1 = m1(in);\n" +
+ " ^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
+ "----------\n" +
+ "2. ERROR in Generics.java (at line 8)\n" +
+ " @NonNull String s2 = m2(in);\n" +
+ " ^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
"----------\n");
}
// conflicting annotations from type variable application and type variable substitution
- public void testNullTypeInference3c() {
+ public void testNullTypeInference3c() {
runNegativeTestWithLibs(
new String[] {
"Generics.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "import java.util.*;\n" +
- "\n" +
- "interface Function<I,O> { }\n" +
- "abstract class MyFunc implements Function<@NonNull Object, @Nullable String> { }\n" +
- " \n" +
- "public class Generics {\n" +
- " <@NonNull I,@Nullable O> \n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "import java.util.*;\n" +
+ "\n" +
+ "interface Function<I,O> { }\n" +
+ "abstract class MyFunc implements Function<@NonNull Object, @Nullable String> { }\n" +
+ " \n" +
+ "public class Generics {\n" +
+ " <@NonNull I,@Nullable O> \n" +
" Collection<O> map1(Collection<I> in, Function<I, O> f) { return null; }\n" +
- " <@Nullable I,@NonNull O> \n" +
+ " <@Nullable I,@NonNull O> \n" +
" Collection<O> map2(Collection<I> in, Function<I, O> f) { return null; }\n" +
" void test(@NonNull List<Object> inList, MyFunc f) {\n" +
- " Collection<@Nullable String> result = map1(inList, f);\n" +
- " map2(inList, f);\n" +
+ " Collection<@Nullable String> result = map1(inList, f);\n" +
+ " map2(inList, f);\n" +
" }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in Generics.java (at line 13)\n" +
- " Collection<@Nullable String> result = map1(inList, f);\n" +
- " ^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'@NonNull List<Object>\' needs unchecked conversion to conform to \'Collection<@NonNull Object>\', corresponding supertype is 'Collection<Object>'\n" +
- "----------\n" +
- "2. WARNING in Generics.java (at line 14)\n" +
- " map2(inList, f);\n" +
- " ^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'@NonNull List<Object>\' needs unchecked conversion to conform to \'Collection<@Nullable Object>\', corresponding supertype is 'Collection<Object>'\n" +
- "----------\n" +
- "3. ERROR in Generics.java (at line 14)\n" +
- " map2(inList, f);\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'Function<@Nullable Object,@NonNull String>\' but this expression has type \'MyFunc\', corresponding supertype is \'Function<@NonNull Object,@Nullable String>\'\n" +
+ "----------\n" +
+ "1. WARNING in Generics.java (at line 13)\n" +
+ " Collection<@Nullable String> result = map1(inList, f);\n" +
+ " ^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'@NonNull List<Object>\' needs unchecked conversion to conform to \'Collection<@NonNull Object>\', corresponding supertype is 'Collection<Object>'\n" +
+ "----------\n" +
+ "2. WARNING in Generics.java (at line 14)\n" +
+ " map2(inList, f);\n" +
+ " ^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'@NonNull List<Object>\' needs unchecked conversion to conform to \'Collection<@Nullable Object>\', corresponding supertype is 'Collection<Object>'\n" +
+ "----------\n" +
+ "3. ERROR in Generics.java (at line 14)\n" +
+ " map2(inList, f);\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'Function<@Nullable Object,@NonNull String>\' but this expression has type \'MyFunc\', corresponding supertype is \'Function<@NonNull Object,@Nullable String>\'\n" +
"----------\n");
}
@@ -2809,17 +2809,17 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" @NonNull foo() {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " @NonNull foo() {}\n" +
- " ^^^^^\n" +
- "Return type for the method is missing\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " @NonNull foo() {}\n" +
+ " ^^^^^\n" +
+ "Return type for the method is missing\n" +
"----------\n",
this.LIBS,
true/*flush*/);
}
-
- // enum constant inside raw type: initialization must be recognized as conform to the implicitly @NonNull declaration
+
+ // enum constant inside raw type: initialization must be recognized as conform to the implicitly @NonNull declaration
public void testBug415850_02(){
runConformTestWithLibs(
new String[] {
@@ -2869,24 +2869,24 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
"X.java",
"public class X implements @B @C('i') J { }",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"C.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface C {\n" +
- " char value() default '-';\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface C {\n" +
+ " char value() default '-';\n" +
"}\n",
"J.java",
"interface J {}\n"
@@ -2913,14 +2913,14 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
"@Target (java.lang.annotation.ElementType.TYPE_USE)\n" +
"@interface Marker {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " int @Marker [][][] i = new @Marker int @Marker [2] @Marker [@Marker bar()] @Marker [];\n" +
- " ^^^^^^^\n" +
- "Syntax error, type annotations are illegal here\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " int @Marker [][][] i = new @Marker int @Marker [2] @Marker [@Marker bar()] @Marker [];\n" +
+ " ^^^^^^^\n" +
+ "Syntax error, type annotations are illegal here\n" +
"----------\n",
this.LIBS,
- true/*flush*/);
+ true/*flush*/);
}
// don't let type annotations on array dimensions spoil type compatibility
@@ -2942,84 +2942,84 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
"@interface Marker {}\n"
},
getCompilerOptions(),
- "");
+ "");
}
public void testBug416172() {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "\n" +
- "public class X {\n" +
- " class Y {}\n" +
- " X.@NonNull Y foo(X.@NonNull Y xy) {\n" +
- " return new X().new Y();\n" +
- " }\n" +
- "}\n" +
- "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "\n" +
+ "public class X {\n" +
+ " class Y {}\n" +
+ " X.@NonNull Y foo(X.@NonNull Y xy) {\n" +
+ " return new X().new Y();\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
"class Z extends X {\n" +
- " @Override\n" +
- " X.@NonNull Y foo(X.Y xy) {\n" +
- " return null;\n" +
- " }\n" +
+ " @Override\n" +
+ " X.@NonNull Y foo(X.Y xy) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in X.java (at line 12)\n" +
- " X.@NonNull Y foo(X.Y xy) {\n" +
- " ^^^\n" +
- "Missing non-null annotation: inherited method from X specifies this parameter as @NonNull\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " return null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'X.@NonNull Y\' but the provided value is null\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 12)\n" +
+ " X.@NonNull Y foo(X.Y xy) {\n" +
+ " ^^^\n" +
+ "Missing non-null annotation: inherited method from X specifies this parameter as @NonNull\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 13)\n" +
+ " return null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'X.@NonNull Y\' but the provided value is null\n" +
"----------\n");
}
-
- // incompatible null constraints on parameters
+
+ // incompatible null constraints on parameters
public void testBug416174() {
Map options = getCompilerOptions();
options.put(JavaCore.COMPILER_PB_NONNULL_PARAMETER_ANNOTATION_DROPPED, JavaCore.IGNORE);
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import java.util.List;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public class X {\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "public class X {\n" +
" void foo1(List<X> lx) {}\n" +
" void foo2(List<@NonNull X> lx) {}\n" +
" void foo3(List<@Nullable X> lx) {}\n" +
" void foo4(@NonNull List<@Nullable X> lx) {}\n" +
- "}\n" +
- "\n" +
- "class Z extends X {\n" +
- " @Override void foo1(List<@NonNull X> xy) {}\n" +
+ "}\n" +
+ "\n" +
+ "class Z extends X {\n" +
+ " @Override void foo1(List<@NonNull X> xy) {}\n" +
" @Override void foo2(List<X> lx) {}\n" +
" @Override void foo3(List<X> lx) {}\n" +
" @Override void foo4(List<@Nullable X> lx) {}\n" + // omitting annotation at toplevel can be tolerated (via option)
"}\n"
},
options,
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " @Override void foo1(List<@NonNull X> xy) {}\n" +
- " ^^^^\n" +
- "Illegal redefinition of parameter xy, inherited method from X declares this parameter as \'List<X>\' (mismatching null constraints)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " @Override void foo2(List<X> lx) {}\n" +
- " ^^^^\n" +
- "Illegal redefinition of parameter lx, inherited method from X declares this parameter as \'List<@NonNull X>\' (mismatching null constraints)\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 15)\n" +
- " @Override void foo3(List<X> lx) {}\n" +
- " ^^^^\n" +
- "Illegal redefinition of parameter lx, inherited method from X declares this parameter as \'List<@Nullable X>\' (mismatching null constraints)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " @Override void foo1(List<@NonNull X> xy) {}\n" +
+ " ^^^^\n" +
+ "Illegal redefinition of parameter xy, inherited method from X declares this parameter as \'List<X>\' (mismatching null constraints)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " @Override void foo2(List<X> lx) {}\n" +
+ " ^^^^\n" +
+ "Illegal redefinition of parameter lx, inherited method from X declares this parameter as \'List<@NonNull X>\' (mismatching null constraints)\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 15)\n" +
+ " @Override void foo3(List<X> lx) {}\n" +
+ " ^^^^\n" +
+ "Illegal redefinition of parameter lx, inherited method from X declares this parameter as \'List<@Nullable X>\' (mismatching null constraints)\n" +
"----------\n");
}
@@ -3028,58 +3028,58 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import java.util.*;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public abstract class X {\n" +
- " List<X> foo1() {\n" +
- " return null;\n" +
- " }\n" +
- " List<@Nullable X> foo2() {\n" +
- " return null;\n" +
- " }\n" +
- " abstract @NonNull List<@NonNull X> foo3();\n" +
- " List<@Nullable X> foo4() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "abstract class Z extends X {\n" +
+ "import java.util.*;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "public abstract class X {\n" +
+ " List<X> foo1() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " List<@Nullable X> foo2() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " abstract @NonNull List<@NonNull X> foo3();\n" +
+ " List<@Nullable X> foo4() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "abstract class Z extends X {\n" +
" @Override\n" +
" List<@NonNull X> foo1() {\n" +
- " return null;\n" +
- " }\n" +
+ " return null;\n" +
+ " }\n" +
" @Override\n" +
" List<@NonNull X> foo2() {\n" +
- " return null;\n" +
- " }\n" +
+ " return null;\n" +
+ " }\n" +
" @Override\n" +
- " @NonNull List<X> foo3() {\n" +
- " return new ArrayList<>();\n" +
- " }\n" +
+ " @NonNull List<X> foo3() {\n" +
+ " return new ArrayList<>();\n" +
+ " }\n" +
" @Override\n" +
" @NonNull List<@Nullable X> foo4() {\n" + // OK
- " return new ArrayList<>();\n" +
- " }\n" +
+ " return new ArrayList<>();\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 20)\n" +
- " List<@NonNull X> foo1() {\n" +
- " ^^^^\n" +
- "The return type is incompatible with \'List<X>\' returned from X.foo1() (mismatching null constraints)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 24)\n" +
- " List<@NonNull X> foo2() {\n" +
- " ^^^^\n" +
- "The return type is incompatible with \'List<@Nullable X>\' returned from X.foo2() (mismatching null constraints)\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 28)\n" +
- " @NonNull List<X> foo3() {\n" +
- " ^^^^\n" +
- "The return type is incompatible with \'@NonNull List<@NonNull X>\' returned from X.foo3() (mismatching null constraints)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 20)\n" +
+ " List<@NonNull X> foo1() {\n" +
+ " ^^^^\n" +
+ "The return type is incompatible with \'List<X>\' returned from X.foo1() (mismatching null constraints)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 24)\n" +
+ " List<@NonNull X> foo2() {\n" +
+ " ^^^^\n" +
+ "The return type is incompatible with \'List<@Nullable X>\' returned from X.foo2() (mismatching null constraints)\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 28)\n" +
+ " @NonNull List<X> foo3() {\n" +
+ " ^^^^\n" +
+ "The return type is incompatible with \'@NonNull List<@NonNull X>\' returned from X.foo3() (mismatching null constraints)\n" +
"----------\n");
}
@@ -3088,20 +3088,20 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
runConformTestWithLibs(
new String[] {
"X.java",
- "\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public abstract class X {\n" +
- " X foo1() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "abstract class Z extends X {\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "public abstract class X {\n" +
+ " X foo1() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "abstract class Z extends X {\n" +
" @Override\n" +
" @Nullable X foo1() {\n" +
- " return null;\n" +
- " }\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -3112,35 +3112,35 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " List<@NonNull ? extends @NonNull String> ls = new ArrayList<String>();\n" +
- " ls.add(null);\n" +
- " @NonNull String s = ls.get(0);\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " List<@NonNull ? extends @NonNull String> ls = new ArrayList<String>();\n" +
+ " ls.add(null);\n" +
+ " @NonNull String s = ls.get(0);\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " List<@NonNull ? extends @NonNull String> ls = new ArrayList<String>();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'@NonNull ArrayList<String>\' needs unchecked conversion to conform to \'List<@NonNull ? extends @NonNull String>\', corresponding supertype is 'List<String>'\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " ls.add(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull ? extends @NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "3. INFO in X.java (at line 10)\n" +
- " @NonNull String s = ls.get(0);\n" +
- " ^^^^^^^^^\n" +
- "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'List<@NonNull capture#of ? extends @NonNull String>\'. Type \'List<E>\' doesn\'t seem to be designed with null type annotations in mind\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " List<@NonNull ? extends @NonNull String> ls = new ArrayList<String>();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'@NonNull ArrayList<String>\' needs unchecked conversion to conform to \'List<@NonNull ? extends @NonNull String>\', corresponding supertype is 'List<String>'\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " ls.add(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull ? extends @NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "3. INFO in X.java (at line 10)\n" +
+ " @NonNull String s = ls.get(0);\n" +
+ " ^^^^^^^^^\n" +
+ "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'List<@NonNull capture#of ? extends @NonNull String>\'. Type \'List<E>\' doesn\'t seem to be designed with null type annotations in mind\n" +
"----------\n");
}
@@ -3149,11 +3149,11 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
runConformTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "\n" +
- "public class X<@NonNull T> {\n" +
- " T foo(T t) {\n" +
- " return t;\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "\n" +
+ "public class X<@NonNull T> {\n" +
+ " T foo(T t) {\n" +
+ " return t;\n" +
" }\n" +
"}\n"
},
@@ -3166,42 +3166,42 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "public class X<@NonNull T> {\n" +
- " T foo(T t) {\n" +
- " return t;\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "public class X<@NonNull T> {\n" +
+ " T foo(T t) {\n" +
+ " return t;\n" +
" }\n" +
" @NonNull T bar1(@NonNull T t) {\n" +
" return t;\n" +
- " }\n" +
+ " }\n" +
" @NonNull T bar2(@Nullable T t) { // argument: no contradiction (1)\n" +
" return t; // mismatch (1)\n" +
- " }\n" +
+ " }\n" +
" @Nullable T bar3(T t) { // return type: no contradiction (2)\n" +
" @Nullable T l = t; // local: no contradiction (3)\n" +
" return l;\n" +
" }\n" +
" class Inner {\n" +
" @Nullable T f; // field: no contradiction (4)\n" +
- " }\n" +
+ " }\n" +
" T bar3() {\n" +
" return null; // mismatch (2)\n" +
- " }\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " return t; // mismatch (1)\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'@NonNull T\' but this expression has type \'@Nullable T\'\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 22)\n" +
- " return null; // mismatch (2)\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull T\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " return t; // mismatch (1)\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull T\' but this expression has type \'@Nullable T\'\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 22)\n" +
+ " return null; // mismatch (2)\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull T\' but the provided value is null\n" +
"----------\n");
}
@@ -3210,28 +3210,28 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
runNegativeTest(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "public class X<T> {\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "public class X<T> {\n" +
" @NonNull T bar(@NonNull T t) {\n" +
" return t;\n" +
- " }\n" +
+ " }\n" +
" @NonNull T bar(@Nullable T t) {\n" +
" return t;\n" +
- " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " @NonNull T bar(@NonNull T t) {\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Duplicate method bar(T) in type X<T>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " @NonNull T bar(@Nullable T t) {\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate method bar(T) in type X<T>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " @NonNull T bar(@NonNull T t) {\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate method bar(T) in type X<T>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " @NonNull T bar(@Nullable T t) {\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate method bar(T) in type X<T>\n" +
"----------\n",
this.LIBS,
true/*flush*/);
@@ -3242,31 +3242,31 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
true,
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "\n" +
- "public class X<T> {\n" +
- " T foo(T t) {\n" +
- " return t;\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " X<String> x = new Y();\n" +
- " }\n" +
- "} \n" +
- "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "\n" +
+ "public class X<T> {\n" +
+ " T foo(T t) {\n" +
+ " return t;\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " X<String> x = new Y();\n" +
+ " }\n" +
+ "} \n" +
+ "\n" +
"class Y extends X<@NonNull String> {\n" +
- " @Override\n" +
- " @NonNull String foo(java.lang.@NonNull String t) {\n" +
- " return \"\";\n" +
- " };\n" +
+ " @Override\n" +
+ " @NonNull String foo(java.lang.@NonNull String t) {\n" +
+ " return \"\";\n" +
+ " };\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. INFO in X.java (at line 9)\n" +
- " X<String> x = new Y();\n" +
- " ^^^^^^^\n" +
- "Unsafe null type conversion (type annotations): The value of type '@NonNull Y' is made accessible using the less-annotated type 'X<String>', corresponding supertype is 'X<@NonNull String>'\n" +
+ "----------\n" +
+ "1. INFO in X.java (at line 9)\n" +
+ " X<String> x = new Y();\n" +
+ " ^^^^^^^\n" +
+ "Unsafe null type conversion (type annotations): The value of type '@NonNull Y' is made accessible using the less-annotated type 'X<String>', corresponding supertype is 'X<@NonNull String>'\n" +
"----------\n");
}
@@ -3274,157 +3274,157 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "\n" +
- "public class X<T> {\n" +
- " class Y {\n" +
- " \n" +
- " }\n" +
- " \n" +
- " X<String>.@NonNull Y y = null; // 1st error here.\n" +
- " \n" +
- " @NonNull Y y2 = null; // 2nd error here.\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "\n" +
+ "public class X<T> {\n" +
+ " class Y {\n" +
+ " \n" +
+ " }\n" +
+ " \n" +
+ " X<String>.@NonNull Y y = null; // 1st error here.\n" +
+ " \n" +
+ " @NonNull Y y2 = null; // 2nd error here.\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " X<String>.@NonNull Y y = null; // 1st error here.\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'X<String>.@NonNull Y\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " @NonNull Y y2 = null; // 2nd error here.\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'X<T>.@NonNull Y\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " X<String>.@NonNull Y y = null; // 1st error here.\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'X<String>.@NonNull Y\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " @NonNull Y y2 = null; // 2nd error here.\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'X<T>.@NonNull Y\' but the provided value is null\n" +
"----------\n");
}
- public void testBug416182() {
+ public void testBug416182() {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "public class X<T> {\n" +
- " T foo(@NonNull T t) {\n" +
- " return t;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X<@Nullable String> xs = new X<String>();\n" +
- " xs.foo(null);\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "public class X<T> {\n" +
+ " T foo(@NonNull T t) {\n" +
+ " return t;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X<@Nullable String> xs = new X<String>();\n" +
+ " xs.foo(null);\n" +
+ " }\n" +
" \n" +
- " public void test(X<String> x) {\n" +
- " X<@Nullable String> xs = x;\n" +
- " xs.bar(null);\n" +
- " }\n" +
- " public void bar(T t) {}\n" +
- "\n" +
+ " public void test(X<String> x) {\n" +
+ " X<@Nullable String> xs = x;\n" +
+ " xs.bar(null);\n" +
+ " }\n" +
+ " public void bar(T t) {}\n" +
+ "\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " X<@Nullable String> xs = new X<String>();\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'@NonNull X<String>\' needs unchecked conversion to conform to \'X<@Nullable String>\'\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " xs.foo(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 14)\n" +
- " X<@Nullable String> xs = x;\n" +
- " ^\n" +
- "Null type safety (type annotations): The expression of type \'X<String>\' needs unchecked conversion to conform to \'X<@Nullable String>\'\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " X<@Nullable String> xs = new X<String>();\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'@NonNull X<String>\' needs unchecked conversion to conform to \'X<@Nullable String>\'\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " xs.foo(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 14)\n" +
+ " X<@Nullable String> xs = x;\n" +
+ " ^\n" +
+ "Null type safety (type annotations): The expression of type \'X<String>\' needs unchecked conversion to conform to \'X<@Nullable String>\'\n" +
"----------\n");
}
// introduce unrelated method lookup before the bogus one
- public void testBug416182a() {
+ public void testBug416182a() {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
"public class X<T> {\n" +
- " T foo(@NonNull T t) {\n" +
- " return t;\n" +
+ " T foo(@NonNull T t) {\n" +
+ " return t;\n" +
" }\n" +
- " void foo() {}\n" +
- " public static void main(String[] args) {\n" +
+ " void foo() {}\n" +
+ " public static void main(String[] args) {\n" +
" X<@Nullable String> xs = new X<String>();\n" +
- " xs.foo();\n" +
- " xs.foo(null);\n" +
- " }\n" +
+ " xs.foo();\n" +
+ " xs.foo(null);\n" +
+ " }\n" +
" \n" +
- " public void test(X<String> x) {\n" +
- " X<@Nullable String> xs = x;\n" +
- " xs.bar(null);\n" +
- " }\n" +
- " public void bar(T t) {}\n" +
- "\n" +
+ " public void test(X<String> x) {\n" +
+ " X<@Nullable String> xs = x;\n" +
+ " xs.bar(null);\n" +
+ " }\n" +
+ " public void bar(T t) {}\n" +
+ "\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in X.java (at line 10)\n" +
- " X<@Nullable String> xs = new X<String>();\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'@NonNull X<String>\' needs unchecked conversion to conform to \'X<@Nullable String>\'\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " xs.foo(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 16)\n" +
- " X<@Nullable String> xs = x;\n" +
- " ^\n" +
- "Null type safety (type annotations): The expression of type \'X<String>\' needs unchecked conversion to conform to \'X<@Nullable String>\'\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 10)\n" +
+ " X<@Nullable String> xs = new X<String>();\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'@NonNull X<String>\' needs unchecked conversion to conform to \'X<@Nullable String>\'\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 12)\n" +
+ " xs.foo(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 16)\n" +
+ " X<@Nullable String> xs = x;\n" +
+ " ^\n" +
+ "Null type safety (type annotations): The expression of type \'X<String>\' needs unchecked conversion to conform to \'X<@Nullable String>\'\n" +
"----------\n");
}
-
+
// avoid extra warning by use of diamond.
- public void testBug416182b() {
+ public void testBug416182b() {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "public class X<T> {\n" +
- " T foo(@NonNull T t) {\n" +
- " return t;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X<@Nullable String> xs = new X<>();\n" +
- " xs.foo(null);\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "public class X<T> {\n" +
+ " T foo(@NonNull T t) {\n" +
+ " return t;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X<@Nullable String> xs = new X<>();\n" +
+ " xs.foo(null);\n" +
+ " }\n" +
" \n" +
- " public void test(X<String> x) {\n" +
- " X<@Nullable String> xs = x;\n" +
- " xs.bar(null);\n" +
- " }\n" +
- " public void bar(T t) {}\n" +
- "\n" +
+ " public void test(X<String> x) {\n" +
+ " X<@Nullable String> xs = x;\n" +
+ " xs.bar(null);\n" +
+ " }\n" +
+ " public void bar(T t) {}\n" +
+ "\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " xs.foo(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 14)\n" +
- " X<@Nullable String> xs = x;\n" +
- " ^\n" +
- "Null type safety (type annotations): The expression of type \'X<String>\' needs unchecked conversion to conform to \'X<@Nullable String>\'\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " xs.foo(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 14)\n" +
+ " X<@Nullable String> xs = x;\n" +
+ " ^\n" +
+ "Null type safety (type annotations): The expression of type \'X<String>\' needs unchecked conversion to conform to \'X<@Nullable String>\'\n" +
"----------\n");
}
@@ -3432,28 +3432,28 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
runConformTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "\n" +
- "public class X<T> {\n" +
- " T foo(@NonNull T t) {\n" +
- " return t;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X<String> xs = new X<String>();\n" +
- " xs.foo(\"\");\n" +
- " }\n" +
- " \n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "\n" +
+ "public class X<T> {\n" +
+ " T foo(@NonNull T t) {\n" +
+ " return t;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " X<String> xs = new X<String>();\n" +
+ " xs.foo(\"\");\n" +
+ " }\n" +
+ " \n" +
"}\n"
},
getCompilerOptions(),
"");
}
// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=417113#c25, point 4.
- public void testSubstitution() {
+ public void testSubstitution() {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
"import java.util.List;\n" +
"import java.util.ArrayList;\n" +
"public class X<T> {\n" +
@@ -3469,30 +3469,30 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
},
getCompilerOptions(),
- "----------\n" +
- "1. INFO in X.java (at line 6)\n" +
- " return l.get(0);\n" +
- " ^^^^^^^^\n" +
- "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'@NonNull List<@NonNull T>\'. Type \'List<E>\' doesn\'t seem to be designed with null type annotations in mind\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " s.foo(new ArrayList<String>()); // (1)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'@NonNull ArrayList<String>\' needs unchecked conversion to conform to \'@NonNull List<@NonNull String>\', corresponding supertype is 'List<String>'\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " s.foo(null); // (2)\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull List<@NonNull String>\' but the provided value is null\n" +
+ "----------\n" +
+ "1. INFO in X.java (at line 6)\n" +
+ " return l.get(0);\n" +
+ " ^^^^^^^^\n" +
+ "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'@NonNull List<@NonNull T>\'. Type \'List<E>\' doesn\'t seem to be designed with null type annotations in mind\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " s.foo(new ArrayList<String>()); // (1)\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'@NonNull ArrayList<String>\' needs unchecked conversion to conform to \'@NonNull List<@NonNull String>\', corresponding supertype is 'List<String>'\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " s.foo(null); // (2)\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull List<@NonNull String>\' but the provided value is null\n" +
"----------\n");
}
// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=417113#c25, point 4.
- public void testSubstitution2() {
+ public void testSubstitution2() {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
"public class X<T> {\n" +
" T foo(@NonNull T @NonNull [] l) {\n" +
" return l[0];\n" +
@@ -3510,39 +3510,39 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " s.foo(new String [] { null });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'@NonNull String @NonNull[]\'\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " s.foo(new String @Nullable [] { null });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String @Nullable[]\' needs unchecked conversion to conform to \'@NonNull String @NonNull[]\'\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 11)\n" +
- " s.foo(new String @NonNull [] { null });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String @NonNull[]\' needs unchecked conversion to conform to \'@NonNull String @NonNull[]\'\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 12)\n" +
- " s.foo(new @Nullable String @NonNull [] { null });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String @NonNull[]\' but this expression has type \'@Nullable String @NonNull[]\'\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 14)\n" +
- " s.foo(null); // (2)\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String @NonNull[]\' but the provided value is null\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " s.foo(new String [] { null });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'@NonNull String @NonNull[]\'\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " s.foo(new String @Nullable [] { null });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String @Nullable[]\' needs unchecked conversion to conform to \'@NonNull String @NonNull[]\'\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 11)\n" +
+ " s.foo(new String @NonNull [] { null });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String @NonNull[]\' needs unchecked conversion to conform to \'@NonNull String @NonNull[]\'\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 12)\n" +
+ " s.foo(new @Nullable String @NonNull [] { null });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String @NonNull[]\' but this expression has type \'@Nullable String @NonNull[]\'\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 14)\n" +
+ " s.foo(null); // (2)\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String @NonNull[]\' but the provided value is null\n" +
"----------\n");
}
// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=417113#c25, point 4.
- public void testSubstitution3() {
+ public void testSubstitution3() {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
"public class X<T> {\n" +
" T foo(@NonNull T l) {\n" +
" return l;\n" +
@@ -3555,15 +3555,15 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " s.foo(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " s.foo(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n");
}
// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=417113#c25, point 4.
- public void testSubstitution4() {
+ public void testSubstitution4() {
runNegativeTestWithLibs(
new String[] {
"X.java",
@@ -3584,15 +3584,15 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " s.foo(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'X<String>.@NonNull Y\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " s.foo(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'X<String>.@NonNull Y\' but the provided value is null\n" +
"----------\n");
}
// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=417113#c25, point 4.
- public void testSubstitution5() {
+ public void testSubstitution5() {
runWarningTestWithLibs(
true/*flush*/,
new String[] {
@@ -3610,89 +3610,89 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " s.foo(s);\n" +
- " ^\n" +
- "Null type safety (type annotations): The expression of type \'X<String>\' needs unchecked conversion to conform to \'@NonNull X<@NonNull ? extends String>\'\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " s.foo(s);\n" +
+ " ^\n" +
+ "Null type safety (type annotations): The expression of type \'X<String>\' needs unchecked conversion to conform to \'@NonNull X<@NonNull ? extends String>\'\n" +
"----------\n");
}
-
+
// https://bugs.eclipse.org/417758 - [1.8][null] Null safety compromise during array creation.
// original test case
public void testArray1() {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "\n" +
- "public class X<T> {\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " @NonNull String @NonNull [] s = new @NonNull String [] { null };\n" +
- " if (s != null && s[0] != null) {\n" +
- " System.out.println(\"Not null\");\n" +
- " }\n" +
- " System.out.println(\"Length = \" + s[0].length());\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "\n" +
+ "public class X<T> {\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " @NonNull String @NonNull [] s = new @NonNull String [] { null };\n" +
+ " if (s != null && s[0] != null) {\n" +
+ " System.out.println(\"Not null\");\n" +
+ " }\n" +
+ " System.out.println(\"Length = \" + s[0].length());\n" +
+ " }\n" +
"}"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " @NonNull String @NonNull [] s = new @NonNull String [] { null };\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " if (s != null && s[0] != null) {\n" +
- " ^\n" +
- "Redundant null check: comparing \'@NonNull String @NonNull[]\' against null\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " if (s != null && s[0] != null) {\n" +
- " ^^^^\n" +
- "Redundant null check: comparing \'@NonNull String\' against null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " @NonNull String @NonNull [] s = new @NonNull String [] { null };\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " if (s != null && s[0] != null) {\n" +
+ " ^\n" +
+ "Redundant null check: comparing \'@NonNull String @NonNull[]\' against null\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " if (s != null && s[0] != null) {\n" +
+ " ^^^^\n" +
+ "Redundant null check: comparing \'@NonNull String\' against null\n" +
"----------\n");
}
-
+
// https://bugs.eclipse.org/417758 - [1.8][null] Null safety compromise during array creation.
// two-dim array with annotations on dimensions
public void testArray2() {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "\n" +
- "public class X<T> {\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " @NonNull String @NonNull [][] s1 = new @NonNull String @NonNull [][] { null, { null} }; // problem at inner null\n" +
- " @NonNull String @NonNull [][] s2 = new @NonNull String [] @NonNull [] { null, { null} }; // problem at both nulls\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "\n" +
+ "public class X<T> {\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " @NonNull String @NonNull [][] s1 = new @NonNull String @NonNull [][] { null, { null} }; // problem at inner null\n" +
+ " @NonNull String @NonNull [][] s2 = new @NonNull String [] @NonNull [] { null, { null} }; // problem at both nulls\n" +
+ " }\n" +
"}"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " @NonNull String @NonNull [][] s1 = new @NonNull String @NonNull [][] { null, { null} }; // problem at inner null\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "2. INFO in X.java (at line 7)\n" +
- " @NonNull String @NonNull [][] s2 = new @NonNull String [] @NonNull [] { null, { null} }; // problem at both nulls\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unsafe null type conversion (type annotations): The value of type \'@NonNull String [] @NonNull[]\' is made accessible using the less-annotated type \'@NonNull String @NonNull[] []\'\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " @NonNull String @NonNull [][] s2 = new @NonNull String [] @NonNull [] { null, { null} }; // problem at both nulls\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String @NonNull[]\' but the provided value is null\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " @NonNull String @NonNull [][] s2 = new @NonNull String [] @NonNull [] { null, { null} }; // problem at both nulls\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " @NonNull String @NonNull [][] s1 = new @NonNull String @NonNull [][] { null, { null} }; // problem at inner null\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "2. INFO in X.java (at line 7)\n" +
+ " @NonNull String @NonNull [][] s2 = new @NonNull String [] @NonNull [] { null, { null} }; // problem at both nulls\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unsafe null type conversion (type annotations): The value of type \'@NonNull String [] @NonNull[]\' is made accessible using the less-annotated type \'@NonNull String @NonNull[] []\'\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " @NonNull String @NonNull [][] s2 = new @NonNull String [] @NonNull [] { null, { null} }; // problem at both nulls\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String @NonNull[]\' but the provided value is null\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " @NonNull String @NonNull [][] s2 = new @NonNull String [] @NonNull [] { null, { null} }; // problem at both nulls\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n");
}
@@ -3704,31 +3704,31 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "\n" +
- "public class X<T> {\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " @NonNull String [][] @NonNull [] s = new @NonNull String []@NonNull [][] { null, { {null}, null/*ok*/ } };\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "\n" +
+ "public class X<T> {\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " @NonNull String [][] @NonNull [] s = new @NonNull String []@NonNull [][] { null, { {null}, null/*ok*/ } };\n" +
+ " }\n" +
"}"
},
options,
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " @NonNull String [][] @NonNull [] s = new @NonNull String []@NonNull [][] { null, { {null}, null/*ok*/ } };\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unsafe null type conversion (type annotations): The value of type \'@NonNull String [] @NonNull[] []\' is made accessible using the less-annotated type \'@NonNull String [] [] @NonNull[]\'\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " @NonNull String [][] @NonNull [] s = new @NonNull String []@NonNull [][] { null, { {null}, null/*ok*/ } };\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String @NonNull[] []\' but the provided value is null\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " @NonNull String [][] @NonNull [] s = new @NonNull String []@NonNull [][] { null, { {null}, null/*ok*/ } };\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " @NonNull String [][] @NonNull [] s = new @NonNull String []@NonNull [][] { null, { {null}, null/*ok*/ } };\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unsafe null type conversion (type annotations): The value of type \'@NonNull String [] @NonNull[] []\' is made accessible using the less-annotated type \'@NonNull String [] [] @NonNull[]\'\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " @NonNull String [][] @NonNull [] s = new @NonNull String []@NonNull [][] { null, { {null}, null/*ok*/ } };\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String @NonNull[] []\' but the provided value is null\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " @NonNull String [][] @NonNull [] s = new @NonNull String []@NonNull [][] { null, { {null}, null/*ok*/ } };\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n");
}
@@ -3736,33 +3736,33 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public class X<T> {\n" +
- " void foo(@NonNull X<@NonNull ?> l) { \n" +
- " } \n" +
- " public static void main(String[] args) {\n" +
- " @NonNull X<String> s = new X<>();\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "public class X<T> {\n" +
+ " void foo(@NonNull X<@NonNull ?> l) { \n" +
+ " } \n" +
+ " public static void main(String[] args) {\n" +
+ " @NonNull X<String> s = new X<>();\n" +
" s.foo(s); // String vs. @NonNull ?\n" +
" @NonNull X<@Nullable String> s2 = new X<>();\n" +
" s.foo(s2); // @Nullable String vs. @NonNull ?\n" +
" @NonNull X<@NonNull String> s3 = new X<>();\n" +
" s.foo(s3); // good\n" +
- " }\n" +
+ " }\n" +
"}"
- },
- getCompilerOptions(),
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " s.foo(s); // String vs. @NonNull ?\n" +
- " ^\n" +
- "Null type safety (type annotations): The expression of type \'@NonNull X<String>\' needs unchecked conversion to conform to \'@NonNull X<@NonNull ?>\'\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " s.foo(s2); // @Nullable String vs. @NonNull ?\n" +
- " ^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull X<@NonNull ?>\' but this expression has type \'@NonNull X<@Nullable String>\'\n" +
- "----------\n");
+ },
+ getCompilerOptions(),
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " s.foo(s); // String vs. @NonNull ?\n" +
+ " ^\n" +
+ "Null type safety (type annotations): The expression of type \'@NonNull X<String>\' needs unchecked conversion to conform to \'@NonNull X<@NonNull ?>\'\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " s.foo(s2); // @Nullable String vs. @NonNull ?\n" +
+ " ^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull X<@NonNull ?>\' but this expression has type \'@NonNull X<@Nullable String>\'\n" +
+ "----------\n");
}
public void testTypeVariable1() {
runNegativeTestWithLibs(
@@ -3778,19 +3778,19 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" T t = null;\n" +
" @Junk T t2 = null;\n" +
"}\n"
- },
- getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " T t = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull T\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " @Junk T t2 = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull T\' but the provided value is null\n" +
- "----------\n");
+ },
+ getCompilerOptions(),
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " T t = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull T\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " @Junk T t2 = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull T\' but the provided value is null\n" +
+ "----------\n");
}
// free type variable does not ensure @NonNull, but cannot accept null either, unbounded type variable
public void testTypeVariable2() {
@@ -3818,36 +3818,36 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " consume(t); // error, t can be null\n" +
- " ^\n" +
- "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " consumeObject(t); // error, t can be null\n" +
- " ^\n" +
- "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " consume(t); // error, both sides explicit, mismatch\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'@NonNull T\' but this expression has type \'@Nullable T\'\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " consumeObject(t); // error, both sides explicit, mismatch\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'@Nullable T\'\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 14)\n" +
- " return null; // error, T may not accept null\n" +
- " ^^^^\n" +
- "Null type mismatch (type annotations): \'null\' is not compatible to the free type variable 'T'\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 17)\n" +
- " return t; // error, T may not accept nullable\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'T\' but this expression has type \'@Nullable T\', where \'T\' is a free type variable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " consume(t); // error, t can be null\n" +
+ " ^\n" +
+ "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " consumeObject(t); // error, t can be null\n" +
+ " ^\n" +
+ "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " consume(t); // error, both sides explicit, mismatch\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull T\' but this expression has type \'@Nullable T\'\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 9)\n" +
+ " consumeObject(t); // error, both sides explicit, mismatch\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'@Nullable T\'\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 14)\n" +
+ " return null; // error, T may not accept null\n" +
+ " ^^^^\n" +
+ "Null type mismatch (type annotations): \'null\' is not compatible to the free type variable 'T'\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 17)\n" +
+ " return t; // error, T may not accept nullable\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'T\' but this expression has type \'@Nullable T\', where \'T\' is a free type variable\n" +
"----------\n");
}
// free type variable does not ensure @NonNull, but cannot accept null either, type variable with upper bound
@@ -3876,36 +3876,36 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " consume(t); // error, t can be null\n" +
- " ^\n" +
- "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " consumeObject(t); // error, t can be null\n" +
- " ^\n" +
- "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " consume(t); // error, both sides explicit, mismatch\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'@NonNull T extends Number\' but this expression has type \'@Nullable T extends Number\'\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " consumeObject(t); // error, both sides explicit, mismatch\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'@Nullable T extends Number\'\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 14)\n" +
- " return null; // error, T may not accept null\n" +
- " ^^^^\n" +
- "Null type mismatch (type annotations): \'null\' is not compatible to the free type variable \'T\'\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 17)\n" +
- " return t; // error, T may not accept nullable\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'T\' but this expression has type \'@Nullable T extends Number\', where \'T\' is a free type variable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " consume(t); // error, t can be null\n" +
+ " ^\n" +
+ "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " consumeObject(t); // error, t can be null\n" +
+ " ^\n" +
+ "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " consume(t); // error, both sides explicit, mismatch\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull T extends Number\' but this expression has type \'@Nullable T extends Number\'\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 9)\n" +
+ " consumeObject(t); // error, both sides explicit, mismatch\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'@Nullable T extends Number\'\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 14)\n" +
+ " return null; // error, T may not accept null\n" +
+ " ^^^^\n" +
+ "Null type mismatch (type annotations): \'null\' is not compatible to the free type variable \'T\'\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 17)\n" +
+ " return t; // error, T may not accept nullable\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'T\' but this expression has type \'@Nullable T extends Number\', where \'T\' is a free type variable\n" +
"----------\n");
}
// free type variable is compatible to itself even with different not null-related type annotations
@@ -3929,11 +3929,11 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " return t; // Not OK\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'T\' but this expression has type \'@Nullable T\', where 'T' is a free type variable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " return t; // Not OK\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'T\' but this expression has type \'@Nullable T\', where 'T' is a free type variable\n" +
"----------\n");
}
// https://bugs.eclipse.org/433906
@@ -3941,16 +3941,16 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
runConformTestWithLibs(
new String[] {
"ExFunction.java",
- "@FunctionalInterface\n" +
- "public interface ExFunction<T, R, E extends Exception> {\n" +
- " R apply(T t1) throws E;\n" +
- "\n" +
- " default <V> ExFunction<V, R, E> compose(ExFunction<? super V, ? extends T, E> before) {\n" +
- " java.util.Objects.requireNonNull(before);\n" +
- " //warning on before.apply(v):\n" +
- " //Null type safety (type annotations): The expression of type 'capture#of ? extends T' needs unchecked conversion to conform to 'T'\n" +
- " return (V v) -> apply(before.apply(v));\n" +
- " }\n" +
+ "@FunctionalInterface\n" +
+ "public interface ExFunction<T, R, E extends Exception> {\n" +
+ " R apply(T t1) throws E;\n" +
+ "\n" +
+ " default <V> ExFunction<V, R, E> compose(ExFunction<? super V, ? extends T, E> before) {\n" +
+ " java.util.Objects.requireNonNull(before);\n" +
+ " //warning on before.apply(v):\n" +
+ " //Null type safety (type annotations): The expression of type 'capture#of ? extends T' needs unchecked conversion to conform to 'T'\n" +
+ " return (V v) -> apply(before.apply(v));\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -3972,14 +3972,14 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" foo(null);\n" +
" }\n" +
"}\n"
- },
- getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " foo(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'X.@NonNull Y\' but the provided value is null\n" +
- "----------\n");
+ },
+ getCompilerOptions(),
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " foo(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'X.@NonNull Y\' but the provided value is null\n" +
+ "----------\n");
}
public void testWildcardCapture() {
runWarningTestWithLibs(
@@ -4007,14 +4007,14 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" lt.add(lt.get(0));\n" +
" }\n" +
"}\n"
- },
- getCompilerOptions(),
- "----------\n" +
- "1. WARNING in X.java (at line 16)\n" +
- " getAdd(lx);\n" +
- " ^^\n" +
- "Null type safety (type annotations): The expression of type \'List<capture#of ? extends X>\' needs unchecked conversion to conform to \'List<@NonNull capture#of ? extends X>\'\n" +
- "----------\n");
+ },
+ getCompilerOptions(),
+ "----------\n" +
+ "1. WARNING in X.java (at line 16)\n" +
+ " getAdd(lx);\n" +
+ " ^^\n" +
+ "Null type safety (type annotations): The expression of type \'List<capture#of ? extends X>\' needs unchecked conversion to conform to \'List<@NonNull capture#of ? extends X>\'\n" +
+ "----------\n");
}
public void testWildcardCapture2() {
runConformTestWithLibs(
@@ -4041,9 +4041,9 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" lt.add(lt.get(0));\n" +
" }\n" +
"}\n"
- },
- getCompilerOptions(),
- "");
+ },
+ getCompilerOptions(),
+ "");
}
public void testWildcardCapture3() {
runNegativeTestWithLibs(
@@ -4071,14 +4071,14 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" lt.add(lt.get(0));\n" +
" }\n" +
"}\n"
- },
- getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 17)\n" +
- " getAdd(lx);\n" +
- " ^^\n" +
- "Null type mismatch (type annotations): required \'List<@NonNull capture#of ? extends X>\' but this expression has type \'List<@Nullable capture#of ? extends X>\'\n" +
- "----------\n");
+ },
+ getCompilerOptions(),
+ "----------\n" +
+ "1. ERROR in X.java (at line 17)\n" +
+ " getAdd(lx);\n" +
+ " ^^\n" +
+ "Null type mismatch (type annotations): required \'List<@NonNull capture#of ? extends X>\' but this expression has type \'List<@Nullable capture#of ? extends X>\'\n" +
+ "----------\n");
}
public void testLocalArrays() {
runNegativeTestWithLibs(
@@ -4101,25 +4101,25 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" la = la2;\n" +
" }\n" +
"}\n"
- },
- getCompilerOptions(),
- "----------\n" +
- "1. WARNING in X.java (at line 13)\n" +
- " L @NonNull [] @Nullable [] la = new L[5][];\n" +
- " ^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'L[][]\' needs unchecked conversion to conform to \'L @NonNull[] @Nullable[]\'\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 14)\n" +
- " L @Nullable [] @NonNull [] la2 = new L[3][];\n" +
- " ^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'L[][]\' needs unchecked conversion to conform to \'L @Nullable[] @NonNull[]\'\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 15)\n" +
- " la = la2;\n" +
- " ^^^\n" +
- "Null type mismatch (type annotations): required \'L @NonNull[] @Nullable[]\' but this expression has type \'L @Nullable[] @NonNull[]\'\n" +
+ },
+ getCompilerOptions(),
+ "----------\n" +
+ "1. WARNING in X.java (at line 13)\n" +
+ " L @NonNull [] @Nullable [] la = new L[5][];\n" +
+ " ^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'L[][]\' needs unchecked conversion to conform to \'L @NonNull[] @Nullable[]\'\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 14)\n" +
+ " L @Nullable [] @NonNull [] la2 = new L[3][];\n" +
+ " ^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'L[][]\' needs unchecked conversion to conform to \'L @Nullable[] @NonNull[]\'\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 15)\n" +
+ " la = la2;\n" +
+ " ^^^\n" +
+ "Null type mismatch (type annotations): required \'L @NonNull[] @Nullable[]\' but this expression has type \'L @Nullable[] @NonNull[]\'\n" +
"----------\n");
-
+
// Without annotations.
runConformTestWithLibs(
false /* don't flush output dir */,
@@ -4151,29 +4151,29 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" X.@NonNull Y xy = null;\n" +
" }\n" +
"}\n"
- },
- getCompilerOptions(),
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " @NonNull X x = null;\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " @NonNull X x = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull X\' but the provided value is null\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " X.@NonNull Y xy = null;\n" +
- " ^^^^^^^^^^^^\n" +
- "X.Y is a raw type. References to generic type X<T>.Y<P> should be parameterized\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " X.@NonNull Y xy = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'X.@NonNull Y\' but the provided value is null\n" +
- "----------\n");
+ },
+ getCompilerOptions(),
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " @NonNull X x = null;\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " @NonNull X x = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull X\' but the provided value is null\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " X.@NonNull Y xy = null;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "X.Y is a raw type. References to generic type X<T>.Y<P> should be parameterized\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " X.@NonNull Y xy = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'X.@NonNull Y\' but the provided value is null\n" +
+ "----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=420456, [1.8][null] AIOOB in null analysis code.
public void test420456() {
@@ -4190,10 +4190,10 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" System.out.println(\"\" + array[0] + array[1] + array[2]);\n" +
" }\n" +
"}\n"
- },
+ },
compilerOptions,
"",
- "78912345678");
+ "78912345678");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=422134, [1.8] NPE in NullAnnotationMatching with inlined lambda expression used with a raw type
public void test422134() {
@@ -4210,29 +4210,29 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " Collections.sort(new ArrayList(), (o1, o2) -> {\n" +
- " return o1.compareToIgnoreCase(o1);\n" +
- " });\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation sort(ArrayList, (<no type> o1, <no type> o2) -> {})" +
- " of the generic method sort(List<T>, Comparator<? super T>) of type Collections\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " Collections.sort(new ArrayList(), (o1, o2) -> {\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type safety: The expression of type ArrayList needs unchecked conversion to conform to List<Object>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 5)\n" +
- " Collections.sort(new ArrayList(), (o1, o2) -> {\n" +
- " ^^^^^^^^^\n" +
- "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " return o1.compareToIgnoreCase(o1);\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The method compareToIgnoreCase(Object) is undefined for the type Object\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " Collections.sort(new ArrayList(), (o1, o2) -> {\n" +
+ " return o1.compareToIgnoreCase(o1);\n" +
+ " });\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation sort(ArrayList, (<no type> o1, <no type> o2) -> {})" +
+ " of the generic method sort(List<T>, Comparator<? super T>) of type Collections\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " Collections.sort(new ArrayList(), (o1, o2) -> {\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Type safety: The expression of type ArrayList needs unchecked conversion to conform to List<Object>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 5)\n" +
+ " Collections.sort(new ArrayList(), (o1, o2) -> {\n" +
+ " ^^^^^^^^^\n" +
+ "ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " return o1.compareToIgnoreCase(o1);\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The method compareToIgnoreCase(Object) is undefined for the type Object\n" +
"----------\n",
this.LIBS,
true/*flush*/);
@@ -4243,21 +4243,21 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
runConformTestWithLibs(
new String[] {
"AnnotatedRecordMapper.java",
- "import java.lang.invoke.MethodHandle;\n" +
- "\n" +
- "public final class AnnotatedRecordMapper<T> {\n" +
- " private MethodHandle afterLoadStore;\n" +
- "\n" +
- " public void invokeAfterLoadStore(Object object, Object database) {\n" +
- " if(afterLoadStore != null) {\n" +
- " try {\n" +
- " afterLoadStore.invoke(object, database);\n" +
- " }\n" +
- " catch(Throwable e) {\n" +
- " throw new RuntimeException(e);\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "import java.lang.invoke.MethodHandle;\n" +
+ "\n" +
+ "public final class AnnotatedRecordMapper<T> {\n" +
+ " private MethodHandle afterLoadStore;\n" +
+ "\n" +
+ " public void invokeAfterLoadStore(Object object, Object database) {\n" +
+ " if(afterLoadStore != null) {\n" +
+ " try {\n" +
+ " afterLoadStore.invoke(object, database);\n" +
+ " }\n" +
+ " catch(Throwable e) {\n" +
+ " throw new RuntimeException(e);\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}"
},
null,
@@ -4273,11 +4273,11 @@ public class NullTypeAnnotationTest extends AbstractNullAnnotationTest {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " @org.eclipse.jdt.annotation.NonNull public class X {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The nullness annotation \'NonNull\' is not applicable at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " @org.eclipse.jdt.annotation.NonNull public class X {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The nullness annotation \'NonNull\' is not applicable at this location\n" +
"----------\n");
// note: to be updated with https://bugs.eclipse.org/415918
}
@@ -4286,23 +4286,23 @@ public void testBug424637() {
runNegativeTest(
new String[] {
"X.java",
- "import java.io.IOException;\n" +
- "import java.nio.file.Files;\n" +
- "import java.nio.file.Path;\n" +
- "import java.util.function.Function;\n" +
- "import java.util.stream.Stream;\n" +
- "\n" +
- "public class X {\n" +
- " public static void method() {\n" +
- " Function<Path, Stream<Path>> method = Files::walk;\n" +
- " }\n" +
+ "import java.io.IOException;\n" +
+ "import java.nio.file.Files;\n" +
+ "import java.nio.file.Path;\n" +
+ "import java.util.function.Function;\n" +
+ "import java.util.stream.Stream;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void method() {\n" +
+ " Function<Path, Stream<Path>> method = Files::walk;\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " Function<Path, Stream<Path>> method = Files::walk;\n" +
- " ^^^^^^^^^^^\n" +
- "Unhandled exception type IOException\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " Function<Path, Stream<Path>> method = Files::walk;\n" +
+ " ^^^^^^^^^^^\n" +
+ "Unhandled exception type IOException\n" +
"----------\n",
this.LIBS,
true/*flush*/);
@@ -4312,43 +4312,43 @@ public void testBug424637a() {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import java.nio.file.FileVisitOption;\n" +
- "import java.nio.file.Path;\n" +
- "import java.util.function.BiFunction;\n" +
+ "import java.nio.file.FileVisitOption;\n" +
+ "import java.nio.file.Path;\n" +
+ "import java.util.function.BiFunction;\n" +
"import java.util.stream.Stream;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
"\n" +
- "interface TriFunc<A,B,C,D> { D apply(A a, B b, C c); }\n" +
+ "interface TriFunc<A,B,C,D> { D apply(A a, B b, C c); }\n" +
"public class X {\n" +
- " public static Stream<Path> myWalk(Path p, @NonNull FileVisitOption ... options) { return null; }\n" +
- " public static void method() {\n" +
+ " public static Stream<Path> myWalk(Path p, @NonNull FileVisitOption ... options) { return null; }\n" +
+ " public static void method() {\n" +
" BiFunction<Path, @Nullable FileVisitOption, Stream<Path>> method1 = X::myWalk;\n" + // one element varargs - nullity mismatch
" BiFunction<Path, @Nullable FileVisitOption[], Stream<Path>> method2 = X::myWalk;\n" + // pass-through array varargs - nullity mismatch
" BiFunction<Path, FileVisitOption[], Stream<Path>> method3 = X::myWalk;\n" + // pass-through array varargs - unchecked
" TriFunc<Path, @NonNull FileVisitOption, @Nullable FileVisitOption, Stream<Path>> method4 = X::myWalk;\n" + // two-element varargs - nullity mismatch on one of them
- " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " BiFunction<Path, @Nullable FileVisitOption, Stream<Path>> method1 = X::myWalk;\n" +
- " ^^^^^^^^^\n" +
- "Null type mismatch at parameter 2: required \'@NonNull FileVisitOption\' but provided \'@Nullable FileVisitOption\' via method descriptor BiFunction<Path,FileVisitOption,Stream<Path>>.apply(Path, FileVisitOption)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " BiFunction<Path, @Nullable FileVisitOption[], Stream<Path>> method2 = X::myWalk;\n" +
- " ^^^^^^^^^\n" +
- "Null type mismatch at parameter 2: required \'@NonNull FileVisitOption []\' but provided \'@Nullable FileVisitOption []\' via method descriptor BiFunction<Path,FileVisitOption[],Stream<Path>>.apply(Path, FileVisitOption[])\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 13)\n" +
- " BiFunction<Path, FileVisitOption[], Stream<Path>> method3 = X::myWalk;\n" +
- " ^^^^^^^^^\n" +
- "Null type safety: parameter 2 provided via method descriptor BiFunction<Path,FileVisitOption[],Stream<Path>>.apply(Path, FileVisitOption[]) needs unchecked conversion to conform to \'@NonNull FileVisitOption []\'\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 14)\n" +
- " TriFunc<Path, @NonNull FileVisitOption, @Nullable FileVisitOption, Stream<Path>> method4 = X::myWalk;\n" +
- " ^^^^^^^^^\n" +
- "Null type mismatch at parameter 3: required \'@NonNull FileVisitOption\' but provided \'@Nullable FileVisitOption\' via method descriptor TriFunc<Path,FileVisitOption,FileVisitOption,Stream<Path>>.apply(Path, FileVisitOption, FileVisitOption)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " BiFunction<Path, @Nullable FileVisitOption, Stream<Path>> method1 = X::myWalk;\n" +
+ " ^^^^^^^^^\n" +
+ "Null type mismatch at parameter 2: required \'@NonNull FileVisitOption\' but provided \'@Nullable FileVisitOption\' via method descriptor BiFunction<Path,FileVisitOption,Stream<Path>>.apply(Path, FileVisitOption)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 12)\n" +
+ " BiFunction<Path, @Nullable FileVisitOption[], Stream<Path>> method2 = X::myWalk;\n" +
+ " ^^^^^^^^^\n" +
+ "Null type mismatch at parameter 2: required \'@NonNull FileVisitOption []\' but provided \'@Nullable FileVisitOption []\' via method descriptor BiFunction<Path,FileVisitOption[],Stream<Path>>.apply(Path, FileVisitOption[])\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 13)\n" +
+ " BiFunction<Path, FileVisitOption[], Stream<Path>> method3 = X::myWalk;\n" +
+ " ^^^^^^^^^\n" +
+ "Null type safety: parameter 2 provided via method descriptor BiFunction<Path,FileVisitOption[],Stream<Path>>.apply(Path, FileVisitOption[]) needs unchecked conversion to conform to \'@NonNull FileVisitOption []\'\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 14)\n" +
+ " TriFunc<Path, @NonNull FileVisitOption, @Nullable FileVisitOption, Stream<Path>> method4 = X::myWalk;\n" +
+ " ^^^^^^^^^\n" +
+ "Null type mismatch at parameter 3: required \'@NonNull FileVisitOption\' but provided \'@Nullable FileVisitOption\' via method descriptor TriFunc<Path,FileVisitOption,FileVisitOption,Stream<Path>>.apply(Path, FileVisitOption, FileVisitOption)\n" +
"----------\n");
}
@@ -4356,12 +4356,12 @@ public void testBug424637_comment3() {
runConformTestWithLibs(
new String[] {
"VarArgsMethodReferenceTest.java",
- "import java.util.function.Consumer;\n" +
- "public class VarArgsMethodReferenceTest {\n" +
- " public static void main(String[] argv) {\n" +
- " Consumer<String> printffer;\n" +
- " printffer = System.out::printf;\n" +
- " }\n" +
+ "import java.util.function.Consumer;\n" +
+ "public class VarArgsMethodReferenceTest {\n" +
+ " public static void main(String[] argv) {\n" +
+ " Consumer<String> printffer;\n" +
+ " printffer = System.out::printf;\n" +
+ " }\n" +
"}"
},
null,
@@ -4373,7 +4373,7 @@ public void testBug427163() {
"X.java",
"import org.eclipse.jdt.annotation.*;\n" +
"public class X {\n" +
- " void consume(@NonNull String @Nullable... strings) {\n" +
+ " void consume(@NonNull String @Nullable... strings) {\n" +
" }\n" +
"}\n"
},
@@ -4387,27 +4387,27 @@ public void testBug427163b() {
"X.java",
"import org.eclipse.jdt.annotation.*;\n" +
"public class X {\n" +
- " void consume1(@NonNull @Nullable String @Nullable[] strings) {}\n" +
+ " void consume1(@NonNull @Nullable String @Nullable[] strings) {}\n" +
" void consume2(@Nullable String @NonNull @Nullable... strings) {}\n" +
" void consume3(@Nullable String[] @NonNull @Nullable[] strings) {}\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " void consume1(@NonNull @Nullable String @Nullable[] strings) {}\n" +
- " ^^^^^^^^^\n" +
- "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " void consume2(@Nullable String @NonNull @Nullable... strings) {}\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " void consume3(@Nullable String[] @NonNull @Nullable[] strings) {}\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " void consume1(@NonNull @Nullable String @Nullable[] strings) {}\n" +
+ " ^^^^^^^^^\n" +
+ "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " void consume2(@Nullable String @NonNull @Nullable... strings) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " void consume3(@Nullable String[] @NonNull @Nullable[] strings) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
"----------\n"
);
}
@@ -4417,8 +4417,8 @@ public void testBug427163c() {
"X.java",
"import org.eclipse.jdt.annotation.*;\n" +
"public class X {\n" +
- " String[][] strings0 = new @NonNull String @Nullable[] @Nullable[] {};\n" +
- " String[] strings1 = new String @NonNull @Nullable[] {};\n" +
+ " String[][] strings0 = new @NonNull String @Nullable[] @Nullable[] {};\n" +
+ " String[] strings1 = new String @NonNull @Nullable[] {};\n" +
" Object[] objects2 = new Object @NonNull @Nullable[1];\n" +
" String[] strings3 = new @NonNull @Nullable String [1];\n" +
" String[] strings4 = new @NonNull String @Nullable @NonNull[1];\n" +
@@ -4426,31 +4426,31 @@ public void testBug427163c() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " String[] strings1 = new String @NonNull @Nullable[] {};\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " Object[] objects2 = new Object @NonNull @Nullable[1];\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " String[] strings3 = new @NonNull @Nullable String [1];\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " String[] strings4 = new @NonNull String @Nullable @NonNull[1];\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 8)\n" +
- " String[][] strings5 = new String[] @NonNull @Nullable[] {};\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " String[] strings1 = new String @NonNull @Nullable[] {};\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " Object[] objects2 = new Object @NonNull @Nullable[1];\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " String[] strings3 = new @NonNull @Nullable String [1];\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " String[] strings4 = new @NonNull String @Nullable @NonNull[1];\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 8)\n" +
+ " String[][] strings5 = new String[] @NonNull @Nullable[] {};\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
"----------\n"
);
}
@@ -4459,70 +4459,70 @@ public void testTypeBounds1() {
runNegativeTestWithLibs(
new String[] {
"C.java",
- "import java.util.List;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "class A { }\n" +
- "class B extends A {}\n" +
- "public class C {\n" +
- " \n" +
- " @NonNull A testExtends(List<@NonNull B> lb1, List<@Nullable B> lb2, boolean f) {\n" +
- " List<? extends @NonNull A> la1 = lb1;\n" +
- " la1.add(null); // ERR1\n" +
- " if (la1.size() > 0)\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "class A { }\n" +
+ "class B extends A {}\n" +
+ "public class C {\n" +
+ " \n" +
+ " @NonNull A testExtends(List<@NonNull B> lb1, List<@Nullable B> lb2, boolean f) {\n" +
+ " List<? extends @NonNull A> la1 = lb1;\n" +
+ " la1.add(null); // ERR1\n" +
+ " if (la1.size() > 0)\n" +
" return la1.get(0); // OK\n" +
- " la1 = lb2; // ERR2\n" +
- " List<? extends @Nullable A> la2 = lb1; // OK\n" +
- " la2.add(null); // ERR3\n" +
- " if (la2.size() > 0)\n" +
+ " la1 = lb2; // ERR2\n" +
+ " List<? extends @Nullable A> la2 = lb1; // OK\n" +
+ " la2.add(null); // ERR3\n" +
+ " if (la2.size() > 0)\n" +
" return la2.get(0); // ERR4\n" +
- " la2 = lb2; // OK\n" +
- " if (f)\n" +
- " return mExtends1(lb1); // OK, since we infer T to @NonNull B\n" +
- " return mExtends2(lb1);\n" +
- " }\n" +
- " <T extends @Nullable A> T mExtends1(List<T> t) { return null; /*ERR5*/ }\n" +
- " <T extends @NonNull A> T mExtends2(List<T> t) { return null; /*ERR6*/ }\n" +
+ " la2 = lb2; // OK\n" +
+ " if (f)\n" +
+ " return mExtends1(lb1); // OK, since we infer T to @NonNull B\n" +
+ " return mExtends2(lb1);\n" +
+ " }\n" +
+ " <T extends @Nullable A> T mExtends1(List<T> t) { return null; /*ERR5*/ }\n" +
+ " <T extends @NonNull A> T mExtends2(List<T> t) { return null; /*ERR6*/ }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in C.java (at line 12)\n" +
- " la1.add(null); // ERR1\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'? extends @NonNull A\' but the provided value is null\n" +
- "----------\n" +
- "2. INFO in C.java (at line 14)\n" +
- " return la1.get(0); // OK\n" +
- " ^^^^^^^^^^\n" +
- "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'List<capture#of ? extends @NonNull A>\'. Type \'List<E>\' doesn\'t seem to be designed with null type annotations in mind\n" +
- "----------\n" +
- "3. ERROR in C.java (at line 15)\n" +
- " la1 = lb2; // ERR2\n" +
- " ^^^\n" +
- "Null type mismatch (type annotations): required \'List<? extends @NonNull A>\' but this expression has type \'List<@Nullable B>\'\n" +
- "----------\n" +
- "4. ERROR in C.java (at line 17)\n" +
- " la2.add(null); // ERR3\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'? extends @Nullable A\' but the provided value is null\n" +
- "----------\n" +
- "5. ERROR in C.java (at line 19)\n" +
- " return la2.get(0); // ERR4\n" +
- " ^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull A\' but this expression has type \'capture#of ? extends @Nullable A\'\n" +
- "----------\n" +
- "6. ERROR in C.java (at line 25)\n" +
- " <T extends @Nullable A> T mExtends1(List<T> t) { return null; /*ERR5*/ }\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'T extends @Nullable A\' but the provided value is null\n" +
- "----------\n" +
- "7. ERROR in C.java (at line 26)\n" +
- " <T extends @NonNull A> T mExtends2(List<T> t) { return null; /*ERR6*/ }\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'T extends @NonNull A\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 12)\n" +
+ " la1.add(null); // ERR1\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'? extends @NonNull A\' but the provided value is null\n" +
+ "----------\n" +
+ "2. INFO in C.java (at line 14)\n" +
+ " return la1.get(0); // OK\n" +
+ " ^^^^^^^^^^\n" +
+ "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'List<capture#of ? extends @NonNull A>\'. Type \'List<E>\' doesn\'t seem to be designed with null type annotations in mind\n" +
+ "----------\n" +
+ "3. ERROR in C.java (at line 15)\n" +
+ " la1 = lb2; // ERR2\n" +
+ " ^^^\n" +
+ "Null type mismatch (type annotations): required \'List<? extends @NonNull A>\' but this expression has type \'List<@Nullable B>\'\n" +
+ "----------\n" +
+ "4. ERROR in C.java (at line 17)\n" +
+ " la2.add(null); // ERR3\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'? extends @Nullable A\' but the provided value is null\n" +
+ "----------\n" +
+ "5. ERROR in C.java (at line 19)\n" +
+ " return la2.get(0); // ERR4\n" +
+ " ^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull A\' but this expression has type \'capture#of ? extends @Nullable A\'\n" +
+ "----------\n" +
+ "6. ERROR in C.java (at line 25)\n" +
+ " <T extends @Nullable A> T mExtends1(List<T> t) { return null; /*ERR5*/ }\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'T extends @Nullable A\' but the provided value is null\n" +
+ "----------\n" +
+ "7. ERROR in C.java (at line 26)\n" +
+ " <T extends @NonNull A> T mExtends2(List<T> t) { return null; /*ERR6*/ }\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'T extends @NonNull A\' but the provided value is null\n" +
"----------\n"
);
}
@@ -4531,75 +4531,75 @@ public void testTypeBounds2() {
runNegativeTestWithLibs(
new String[] {
"C.java",
- "import java.util.List;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "class A { }\n" +
- "class B extends A {}\n" +
- "public class C {\n" +
- " \n" +
- " @NonNull Object testSuper(List<@Nullable A> la1, List<@NonNull A> la2, boolean f) {\n" +
- " List<? super @NonNull B> lb1 = la1; // OK\n" +
- " lb1.add(null); // ERR1\n" +
- " if (lb1.size() > 0)\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "class A { }\n" +
+ "class B extends A {}\n" +
+ "public class C {\n" +
+ " \n" +
+ " @NonNull Object testSuper(List<@Nullable A> la1, List<@NonNull A> la2, boolean f) {\n" +
+ " List<? super @NonNull B> lb1 = la1; // OK\n" +
+ " lb1.add(null); // ERR1\n" +
+ " if (lb1.size() > 0)\n" +
" return lb1.get(0); // ERR2\n" +
- " lb1 = la2; // OK\n" +
- " List<? super @Nullable B> lb2 = la1;\n" +
- " lb2.add(null);\n" +
- " if (lb2.size() > 0)\n" +
+ " lb1 = la2; // OK\n" +
+ " List<? super @Nullable B> lb2 = la1;\n" +
+ " lb2.add(null);\n" +
+ " if (lb2.size() > 0)\n" +
" return lb2.get(0); // ERR3\n" +
- " lb2 = la2; // ERR4\n" +
- " if (f)\n" +
- " return mSuper1(la1); // ERR5\n" +
- " return mSuper2(la1); // ERR6 on arg\n" +
- " }\n" +
- " <T extends @Nullable A> T mSuper1(List<T> t) { return null; /*ERR7*/ }\n" +
- " <T extends @NonNull A> T mSuper2(List<T> t) { return null; /*ERR8*/ }\n" +
+ " lb2 = la2; // ERR4\n" +
+ " if (f)\n" +
+ " return mSuper1(la1); // ERR5\n" +
+ " return mSuper2(la1); // ERR6 on arg\n" +
+ " }\n" +
+ " <T extends @Nullable A> T mSuper1(List<T> t) { return null; /*ERR7*/ }\n" +
+ " <T extends @NonNull A> T mSuper2(List<T> t) { return null; /*ERR8*/ }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in C.java (at line 12)\n" +
- " lb1.add(null); // ERR1\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'? super @NonNull B\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in C.java (at line 14)\n" +
- " return lb1.get(0); // ERR2\n" +
- " ^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'capture#of ? super @NonNull B\'\n" +
- "----------\n" +
- "3. ERROR in C.java (at line 19)\n" +
- " return lb2.get(0); // ERR3\n" +
- " ^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'capture#of ? super @Nullable B\'\n" +
- "----------\n" +
- "4. ERROR in C.java (at line 20)\n" +
- " lb2 = la2; // ERR4\n" +
- " ^^^\n" +
- "Null type mismatch (type annotations): required \'List<? super @Nullable B>\' but this expression has type \'List<@NonNull A>\'\n" +
- "----------\n" +
- "5. ERROR in C.java (at line 22)\n" +
- " return mSuper1(la1); // ERR5\n" +
- " ^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'@Nullable A\'\n" +
- "----------\n" +
- "6. ERROR in C.java (at line 23)\n" +
- " return mSuper2(la1); // ERR6 on arg\n" +
- " ^^^\n" +
- "Null type mismatch (type annotations): required \'List<@NonNull A>\' but this expression has type \'List<@Nullable A>\'\n" +
- "----------\n" +
- "7. ERROR in C.java (at line 25)\n" +
- " <T extends @Nullable A> T mSuper1(List<T> t) { return null; /*ERR7*/ }\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'T extends @Nullable A\' but the provided value is null\n" +
- "----------\n" +
- "8. ERROR in C.java (at line 26)\n" +
- " <T extends @NonNull A> T mSuper2(List<T> t) { return null; /*ERR8*/ }\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'T extends @NonNull A\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 12)\n" +
+ " lb1.add(null); // ERR1\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'? super @NonNull B\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in C.java (at line 14)\n" +
+ " return lb1.get(0); // ERR2\n" +
+ " ^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'capture#of ? super @NonNull B\'\n" +
+ "----------\n" +
+ "3. ERROR in C.java (at line 19)\n" +
+ " return lb2.get(0); // ERR3\n" +
+ " ^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'capture#of ? super @Nullable B\'\n" +
+ "----------\n" +
+ "4. ERROR in C.java (at line 20)\n" +
+ " lb2 = la2; // ERR4\n" +
+ " ^^^\n" +
+ "Null type mismatch (type annotations): required \'List<? super @Nullable B>\' but this expression has type \'List<@NonNull A>\'\n" +
+ "----------\n" +
+ "5. ERROR in C.java (at line 22)\n" +
+ " return mSuper1(la1); // ERR5\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'@Nullable A\'\n" +
+ "----------\n" +
+ "6. ERROR in C.java (at line 23)\n" +
+ " return mSuper2(la1); // ERR6 on arg\n" +
+ " ^^^\n" +
+ "Null type mismatch (type annotations): required \'List<@NonNull A>\' but this expression has type \'List<@Nullable A>\'\n" +
+ "----------\n" +
+ "7. ERROR in C.java (at line 25)\n" +
+ " <T extends @Nullable A> T mSuper1(List<T> t) { return null; /*ERR7*/ }\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'T extends @Nullable A\' but the provided value is null\n" +
+ "----------\n" +
+ "8. ERROR in C.java (at line 26)\n" +
+ " <T extends @NonNull A> T mSuper2(List<T> t) { return null; /*ERR8*/ }\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'T extends @NonNull A\' but the provided value is null\n" +
"----------\n"
);
}
@@ -4608,29 +4608,29 @@ public void testTypeBounds3() {
runNegativeTestWithLibs(
new String[] {
"C.java",
- "import java.util.List;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "class A { }\n" +
- "class B extends A {}\n" +
- "public class C {\n" +
- " \n" +
- " void testExtends(List<? extends @NonNull B> lb1, List<? extends @Nullable B> lb2) {\n" +
- " List<? extends @NonNull A> la1 = lb1;\n" +
- " la1 = lb2; // ERR\n" +
- " List<? extends @Nullable A> la2 = lb1;\n" +
- " la2 = lb2;\n" +
- " }\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "class A { }\n" +
+ "class B extends A {}\n" +
+ "public class C {\n" +
+ " \n" +
+ " void testExtends(List<? extends @NonNull B> lb1, List<? extends @Nullable B> lb2) {\n" +
+ " List<? extends @NonNull A> la1 = lb1;\n" +
+ " la1 = lb2; // ERR\n" +
+ " List<? extends @Nullable A> la2 = lb1;\n" +
+ " la2 = lb2;\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in C.java (at line 12)\n" +
- " la1 = lb2; // ERR\n" +
- " ^^^\n" +
- "Null type mismatch (type annotations): required \'List<? extends @NonNull A>\' but this expression has type \'List<capture#of ? extends @Nullable B>\'\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 12)\n" +
+ " la1 = lb2; // ERR\n" +
+ " ^^^\n" +
+ "Null type mismatch (type annotations): required \'List<? extends @NonNull A>\' but this expression has type \'List<capture#of ? extends @Nullable B>\'\n" +
"----------\n"
);
}
@@ -4639,29 +4639,29 @@ public void testTypeBounds4() {
runNegativeTestWithLibs(
new String[] {
"C.java",
- "import java.util.List;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "class A { }\n" +
- "class B extends A {}\n" +
- "public class C {\n" +
- " \n" +
- " void testSuper(List<? super @Nullable A> la1, List<? super @NonNull A> la2) {\n" +
- " List<? super @NonNull B> lb1 = la1; // OK\n" +
- " lb1 = la2; // OK\n" +
- " List<? super @Nullable B> lb2 = la1;\n" +
- " lb2 = la2; // ERR4\n" +
- " }\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "class A { }\n" +
+ "class B extends A {}\n" +
+ "public class C {\n" +
+ " \n" +
+ " void testSuper(List<? super @Nullable A> la1, List<? super @NonNull A> la2) {\n" +
+ " List<? super @NonNull B> lb1 = la1; // OK\n" +
+ " lb1 = la2; // OK\n" +
+ " List<? super @Nullable B> lb2 = la1;\n" +
+ " lb2 = la2; // ERR4\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in C.java (at line 14)\n" +
- " lb2 = la2; // ERR4\n" +
- " ^^^\n" +
- "Null type mismatch (type annotations): required \'List<? super @Nullable B>\' but this expression has type \'List<capture#of ? super @NonNull A>\'\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 14)\n" +
+ " lb2 = la2; // ERR4\n" +
+ " ^^^\n" +
+ "Null type mismatch (type annotations): required \'List<? super @Nullable B>\' but this expression has type \'List<capture#of ? super @NonNull A>\'\n" +
"----------\n"
);
}
@@ -4685,31 +4685,31 @@ public void test429387() {
"}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " static <BT, T extends BT, IS extends IntStream, E extends Exception> IntStreamy<E>\n" +
- " ^^^^^^^^^^\n" +
- "IntStreamy cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " internalFlatMapToInt(Functionish<BT, IS, E> mapper,\n" +
- " ^^^^^^^^^^^\n" +
- "Functionish cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " BiFunction<Stream<T>, ToIntFunction<BT>, IntStream> func = (Stream<T> t, ToIntFunction<BT, IS> m) -> t.flatmmapToInt(m);\n" +
- " ^^^^^^^^^^^^^\n" +
- "Incorrect number of arguments for type ToIntFunction<T>; it cannot be parameterized with arguments <BT, IS>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 11)\n" +
- " BiFunction<Stream<T>, ToIntFunction<BT>, IntStream> func = (Stream<T> t, ToIntFunction<BT, IS> m) -> t.flatmmapToInt(m);\n" +
- " ^\n" +
- "m cannot be resolved to a variable\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 12)\n" +
- " return IntStreamy.fromFlatMap(func, mapper, classOfE, maker);\n" +
- " ^^^^^^^^^^\n" +
- "IntStreamy cannot be resolved\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " static <BT, T extends BT, IS extends IntStream, E extends Exception> IntStreamy<E>\n" +
+ " ^^^^^^^^^^\n" +
+ "IntStreamy cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " internalFlatMapToInt(Functionish<BT, IS, E> mapper,\n" +
+ " ^^^^^^^^^^^\n" +
+ "Functionish cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " BiFunction<Stream<T>, ToIntFunction<BT>, IntStream> func = (Stream<T> t, ToIntFunction<BT, IS> m) -> t.flatmmapToInt(m);\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Incorrect number of arguments for type ToIntFunction<T>; it cannot be parameterized with arguments <BT, IS>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 11)\n" +
+ " BiFunction<Stream<T>, ToIntFunction<BT>, IntStream> func = (Stream<T> t, ToIntFunction<BT, IS> m) -> t.flatmmapToInt(m);\n" +
+ " ^\n" +
+ "m cannot be resolved to a variable\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 12)\n" +
+ " return IntStreamy.fromFlatMap(func, mapper, classOfE, maker);\n" +
+ " ^^^^^^^^^^\n" +
+ "IntStreamy cannot be resolved\n" +
"----------\n",
this.LIBS,
true/*flush*/);
@@ -4725,11 +4725,11 @@ public void testBug429403() {
" List<@NonNull Person> l = new ArrayList<@Nullable Person>();" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " List<@NonNull Person> l = new ArrayList<@Nullable Person>();}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'List<@NonNull Person>\' but this expression has type \'@NonNull ArrayList<@Nullable Person>\', corresponding supertype is \'List<@Nullable Person>\'\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " List<@NonNull Person> l = new ArrayList<@Nullable Person>();}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'List<@NonNull Person>\' but this expression has type \'@NonNull ArrayList<@Nullable Person>\', corresponding supertype is \'List<@Nullable Person>\'\n" +
"----------\n");
}
public void testBug430219() {
@@ -4787,26 +4787,26 @@ public void testDefault01() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " in.add(null); // ERR\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " return new ArrayList<@Nullable Number>(); // ERR\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'List<@NonNull Number>\' but this expression has type \'@NonNull ArrayList<@Nullable Number>\', corresponding supertype is \'List<@Nullable Number>\'\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " in.add(null); // ERR\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 11)\n" +
- " return new ArrayList<java.lang.@Nullable Number>(); // ERR\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'List<@NonNull Number>\' but this expression has type \'@NonNull ArrayList<@Nullable Number>\', corresponding supertype is \'List<@Nullable Number>\'\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " in.add(null); // ERR\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " return new ArrayList<@Nullable Number>(); // ERR\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'List<@NonNull Number>\' but this expression has type \'@NonNull ArrayList<@Nullable Number>\', corresponding supertype is \'List<@Nullable Number>\'\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 10)\n" +
+ " in.add(null); // ERR\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 11)\n" +
+ " return new ArrayList<java.lang.@Nullable Number>(); // ERR\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'List<@NonNull Number>\' but this expression has type \'@NonNull ArrayList<@Nullable Number>\', corresponding supertype is \'List<@Nullable Number>\'\n" +
"----------\n");
}
@@ -4828,21 +4828,21 @@ public void testDefault01b() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " in.add(null); // NOK, cannot assume nullable\n" +
- " ^^^^\n" +
- "Null type mismatch (type annotations): \'null\' is not compatible to the free type variable \'? extends Number\'\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " needNN(in.get(0)); // NOK, cannot assume nonnull\n" +
- " ^^^^^^^^^\n" +
- "Null type safety: required \'@NonNull\' but this expression has type \'capture#2-of ? extends java.lang.Number\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " return new ArrayList<@Nullable T>(); // NOK, cannot assume nullable for T in List<T>\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'List<T>\' but this expression has type \'@NonNull ArrayList<@Nullable T>\', corresponding supertype is \'List<@Nullable T>\'\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " in.add(null); // NOK, cannot assume nullable\n" +
+ " ^^^^\n" +
+ "Null type mismatch (type annotations): \'null\' is not compatible to the free type variable \'? extends Number\'\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " needNN(in.get(0)); // NOK, cannot assume nonnull\n" +
+ " ^^^^^^^^^\n" +
+ "Null type safety: required \'@NonNull\' but this expression has type \'capture#2-of ? extends java.lang.Number\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " return new ArrayList<@Nullable T>(); // NOK, cannot assume nullable for T in List<T>\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'List<T>\' but this expression has type \'@NonNull ArrayList<@Nullable T>\', corresponding supertype is \'List<@Nullable T>\'\n" +
"----------\n");
}
@@ -4867,16 +4867,16 @@ public void testDefault02() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " test1(null); // ERR\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " test2(null); // ERR\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " test1(null); // ERR\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " test2(null); // ERR\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
"----------\n");
}
@@ -4896,11 +4896,11 @@ public void testDefault03() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " return null; // ERR\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " return null; // ERR\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
"----------\n");
}
@@ -4916,11 +4916,11 @@ public void testDefault04() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " Number field; // ERR since uninitialized\n" +
- " ^^^^^\n" +
- "The @NonNull field field may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " Number field; // ERR since uninitialized\n" +
+ " ^^^^^\n" +
+ "The @NonNull field field may not have been initialized\n" +
"----------\n");
}
@@ -4942,11 +4942,11 @@ public void testDefault05() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " Number field; // ERR since uninitialized\n" +
- " ^^^^^\n" +
- "The @NonNull field field may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " Number field; // ERR since uninitialized\n" +
+ " ^^^^^\n" +
+ "The @NonNull field field may not have been initialized\n" +
"----------\n");
}
@@ -4981,11 +4981,11 @@ public void testDefault05_custom() {
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in test\\X.java (at line 3)\n" +
- " Number field; // ERR since uninitialized\n" +
- " ^^^^^\n" +
- "The @NonNull field field may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in test\\X.java (at line 3)\n" +
+ " Number field; // ERR since uninitialized\n" +
+ " ^^^^^\n" +
+ "The @NonNull field field may not have been initialized\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
runner.runNegativeTest();
@@ -5027,11 +5027,11 @@ public void testDefault05_custom2() {
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in test\\X.java (at line 3)\n" +
- " Number field; // ERR since uninitialized\n" +
- " ^^^^^\n" +
- "The @NonNull field field may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in test\\X.java (at line 3)\n" +
+ " Number field; // ERR since uninitialized\n" +
+ " ^^^^^\n" +
+ "The @NonNull field field may not have been initialized\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
runner.runNegativeTest();
@@ -5057,21 +5057,21 @@ public void testDefault06() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " return null; // ERR\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull T\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " void test(Inner<Number> inum) {\n" +
- " ^^^^^^\n" +
- "Null constraint mismatch: The type \'Number\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " @NonNull Number nnn = inum.process(null); // ERR on argument\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " return null; // ERR\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull T\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " void test(Inner<Number> inum) {\n" +
+ " ^^^^^^\n" +
+ "Null constraint mismatch: The type \'Number\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " @NonNull Number nnn = inum.process(null); // ERR on argument\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
"----------\n");
}
@@ -5096,16 +5096,16 @@ public void testDefault06_b() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " return null; // ERR\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull T\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " @NonNull Number nnn = inum.process(null); // ERR on argument\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " return null; // ERR\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull T\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 12)\n" +
+ " @NonNull Number nnn = inum.process(null); // ERR on argument\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
"----------\n");
}
@@ -5131,26 +5131,26 @@ public void testDefault07() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. INFO in X.java (at line 8)\n" +
- " @NonNull Number n = l.get(0); // OK\n" +
- " ^^^^^^^^\n" +
- "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'List<capture#of ? extends @NonNull Number>\'. Type \'List<E>\' doesn\'t seem to be designed with null type annotations in mind\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " return null; // ERR\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'T extends @NonNull Number\' but the provided value is null\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 13)\n" +
- " @NonNull Number nnn = inner.process(Integer.valueOf(3), new ArrayList<@Nullable Integer>()); // WARN on 1. arg; ERR on 2. arg\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'Integer\' needs unchecked conversion to conform to \'@NonNull Integer\'\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 13)\n" +
- " @NonNull Number nnn = inner.process(Integer.valueOf(3), new ArrayList<@Nullable Integer>()); // WARN on 1. arg; ERR on 2. arg\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'List<? extends @NonNull Number>\' but this expression has type \'@NonNull ArrayList<@Nullable Integer>\', corresponding supertype is \'List<@Nullable Integer>\'\n" +
+ "----------\n" +
+ "1. INFO in X.java (at line 8)\n" +
+ " @NonNull Number n = l.get(0); // OK\n" +
+ " ^^^^^^^^\n" +
+ "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'List<capture#of ? extends @NonNull Number>\'. Type \'List<E>\' doesn\'t seem to be designed with null type annotations in mind\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " return null; // ERR\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'T extends @NonNull Number\' but the provided value is null\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 13)\n" +
+ " @NonNull Number nnn = inner.process(Integer.valueOf(3), new ArrayList<@Nullable Integer>()); // WARN on 1. arg; ERR on 2. arg\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'Integer\' needs unchecked conversion to conform to \'@NonNull Integer\'\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 13)\n" +
+ " @NonNull Number nnn = inner.process(Integer.valueOf(3), new ArrayList<@Nullable Integer>()); // WARN on 1. arg; ERR on 2. arg\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'List<? extends @NonNull Number>\' but this expression has type \'@NonNull ArrayList<@Nullable Integer>\', corresponding supertype is \'List<@Nullable Integer>\'\n" +
"----------\n");
}
@@ -5187,16 +5187,16 @@ public void testDefault01_bin() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in Y.java (at line 5)\n" +
- " x.test1(new ArrayList<@Nullable Number>()) // ERR at arg\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'List<@NonNull Number>\' but this expression has type \'@NonNull ArrayList<@Nullable Number>\', corresponding supertype is \'List<@Nullable Number>\'\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 6)\n" +
- " .add(null); // ERR\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in Y.java (at line 5)\n" +
+ " x.test1(new ArrayList<@Nullable Number>()) // ERR at arg\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'List<@NonNull Number>\' but this expression has type \'@NonNull ArrayList<@Nullable Number>\', corresponding supertype is \'List<@Nullable Number>\'\n" +
+ "----------\n" +
+ "2. ERROR in Y.java (at line 6)\n" +
+ " .add(null); // ERR\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
"----------\n");
}
@@ -5226,16 +5226,16 @@ public void testDefault02_bin() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in Y.java (at line 4)\n" +
- " return x.test1(null); // error at arg, unchecked at return\n" +
- " ^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'Number\' needs unchecked conversion to conform to \'@NonNull Number\'\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 4)\n" +
- " return x.test1(null); // error at arg, unchecked at return\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
+ "----------\n" +
+ "1. WARNING in Y.java (at line 4)\n" +
+ " return x.test1(null); // error at arg, unchecked at return\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'Number\' needs unchecked conversion to conform to \'@NonNull Number\'\n" +
+ "----------\n" +
+ "2. ERROR in Y.java (at line 4)\n" +
+ " return x.test1(null); // error at arg, unchecked at return\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
"----------\n");
}
@@ -5304,11 +5304,11 @@ public void testDefault04_bin() {
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in Y.java (at line 3)\n" +
- " x.field = null; // ERR\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in Y.java (at line 3)\n" +
+ " x.field = null; // ERR\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
runner.runNegativeTest();
@@ -5346,11 +5346,11 @@ public void testDefault05_bin() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in Y.java (at line 5)\n" +
- " x.field = null; // ERR\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in Y.java (at line 5)\n" +
+ " x.field = null; // ERR\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
"----------\n");}
// apply default to type parameter - inner class
@@ -5381,16 +5381,16 @@ public void testDefault06_bin() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in Y.java (at line 3)\n" +
- " void test(X.Inner<Number> inum) { // illegal substitution\n" +
- " ^^^^^^\n" +
- "Null constraint mismatch: The type \'Number\' is not a valid substitute for the type parameter \'@NonNull T extends Object\'\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 4)\n" +
- " @NonNull Number nnn = inum.process(null); // ERR on argument\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in Y.java (at line 3)\n" +
+ " void test(X.Inner<Number> inum) { // illegal substitution\n" +
+ " ^^^^^^\n" +
+ "Null constraint mismatch: The type \'Number\' is not a valid substitute for the type parameter \'@NonNull T extends Object\'\n" +
+ "----------\n" +
+ "2. ERROR in Y.java (at line 4)\n" +
+ " @NonNull Number nnn = inum.process(null); // ERR on argument\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Number\' but the provided value is null\n" +
"----------\n");}
// apply default to type bound - method in inner class
@@ -5424,75 +5424,75 @@ public void testDefault07_bin() {
},
getCompilerOptions(),
"----------\n" +
- "1. WARNING in Y.java (at line 5)\n" +
- " @NonNull Number nnn = inner.process(Integer.valueOf(3), new ArrayList<@Nullable Integer>()); // WARN on 1. arg; ERR on 2. arg\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'Integer\' needs unchecked conversion to conform to \'@NonNull Integer\'\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 5)\n" +
- " @NonNull Number nnn = inner.process(Integer.valueOf(3), new ArrayList<@Nullable Integer>()); // WARN on 1. arg; ERR on 2. arg\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'List<? extends @NonNull Number>\' but this expression has type \'@NonNull ArrayList<@Nullable Integer>\', corresponding supertype is \'List<@Nullable Integer>\'\n" +
+ "1. WARNING in Y.java (at line 5)\n" +
+ " @NonNull Number nnn = inner.process(Integer.valueOf(3), new ArrayList<@Nullable Integer>()); // WARN on 1. arg; ERR on 2. arg\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'Integer\' needs unchecked conversion to conform to \'@NonNull Integer\'\n" +
+ "----------\n" +
+ "2. ERROR in Y.java (at line 5)\n" +
+ " @NonNull Number nnn = inner.process(Integer.valueOf(3), new ArrayList<@Nullable Integer>()); // WARN on 1. arg; ERR on 2. arg\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'List<? extends @NonNull Number>\' but this expression has type \'@NonNull ArrayList<@Nullable Integer>\', corresponding supertype is \'List<@Nullable Integer>\'\n" +
"----------\n");
}
public void testBug431269() {
runNegativeTest(
new String[] {
"p/QField.java",
- "package p;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public class QField<R extends QField<R, ? >, T> {\n" +
- " @NonNull\n" +
- " protected R m_root;\n" +
- "\n" +
- " public QField(@Nullable R root, @Nullable QField<R, ? > parent, @Nullable String propertyNameInParent) {\n" +
- " m_root = root;\n" +
- " }\n" +
+ "package p;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "public class QField<R extends QField<R, ? >, T> {\n" +
+ " @NonNull\n" +
+ " protected R m_root;\n" +
+ "\n" +
+ " public QField(@Nullable R root, @Nullable QField<R, ? > parent, @Nullable String propertyNameInParent) {\n" +
+ " m_root = root;\n" +
+ " }\n" +
"}\n",
"p/PLogLine.java",
- "package p;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public class PLogLine<R extends QField<R, ? >> extends QField<R, LogLine> {\n" +
- " public PLogLine(@Nullable R root, @Nullable QField<R, ? > parent, @Nullable String name) {\n" +
- " super(root, parent, name);\n" +
- " }\n" +
- "\n" +
- " @NonNull\n" +
- " public final QField<R, java.lang.String> lastName() {\n" +
- " return new QField<R, java.lang.Long>(m_root, this, \"lastName\");\n" +
- " }\n" +
- "\n" +
+ "package p;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "public class PLogLine<R extends QField<R, ? >> extends QField<R, LogLine> {\n" +
+ " public PLogLine(@Nullable R root, @Nullable QField<R, ? > parent, @Nullable String name) {\n" +
+ " super(root, parent, name);\n" +
+ " }\n" +
+ "\n" +
+ " @NonNull\n" +
+ " public final QField<R, java.lang.String> lastName() {\n" +
+ " return new QField<R, java.lang.Long>(m_root, this, \"lastName\");\n" +
+ " }\n" +
+ "\n" +
"}\n",
"p/LogLine.java",
- "package p;\n" +
- "\n" +
- "public class LogLine {\n" +
- " private String m_lastName;\n" +
- "\n" +
- " public String getLastName() {\n" +
- " return m_lastName;\n" +
- " }\n" +
- "\n" +
- " public void setLastName(String property) {\n" +
- " m_lastName = property;\n" +
- " }\n" +
+ "package p;\n" +
+ "\n" +
+ "public class LogLine {\n" +
+ " private String m_lastName;\n" +
+ "\n" +
+ " public String getLastName() {\n" +
+ " return m_lastName;\n" +
+ " }\n" +
+ "\n" +
+ " public void setLastName(String property) {\n" +
+ " m_lastName = property;\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in p\\QField.java (at line 10)\n" +
- " m_root = root;\n" +
- " ^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull R extends QField<R extends QField<R,?>,?>\' but this expression has type \'@Nullable R extends QField<R extends QField<R,?>,?>\'\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in p\\PLogLine.java (at line 12)\n" +
- " return new QField<R, java.lang.Long>(m_root, this, \"lastName\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from QField<R,Long> to QField<R,String>\n" +
+ "----------\n" +
+ "1. ERROR in p\\QField.java (at line 10)\n" +
+ " m_root = root;\n" +
+ " ^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull R extends QField<R extends QField<R,?>,?>\' but this expression has type \'@Nullable R extends QField<R extends QField<R,?>,?>\'\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in p\\PLogLine.java (at line 12)\n" +
+ " return new QField<R, java.lang.Long>(m_root, this, \"lastName\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from QField<R,Long> to QField<R,String>\n" +
"----------\n",
this.LIBS,
true/*flush*/);
@@ -5505,15 +5505,15 @@ public void testBug432223() {
"import org.eclipse.jdt.annotation.*;\n" +
"public class X {\n" +
" String val;\n" +
- " public static @NonNull <T> T assertNotNull(@Nullable T object) {\n" +
- " return assertNotNull(null, object);\n" +
- " }\n" +
- "\n" +
- " public static @NonNull <T> T assertNotNull(@Nullable String message, @Nullable T object) {\n" +
- " if (object == null) {\n" +
- " throw new NullPointerException(message);\n" +
- " }\n" +
- " return object;\n" +
+ " public static @NonNull <T> T assertNotNull(@Nullable T object) {\n" +
+ " return assertNotNull(null, object);\n" +
+ " }\n" +
+ "\n" +
+ " public static @NonNull <T> T assertNotNull(@Nullable String message, @Nullable T object) {\n" +
+ " if (object == null) {\n" +
+ " throw new NullPointerException(message);\n" +
+ " }\n" +
+ " return object;\n" +
" }\n" +
" void test(@Nullable X x) {\n" +
" @NonNull X safe = assertNotNull(x);\n" +
@@ -5529,13 +5529,13 @@ public void testBug432977() {
new String[] {
"Bar.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "@NonNullByDefault\n" +
- "public class Bar {\n" +
- " private String prop = \"\";\n" +
- "\n" +
- " public String getProp() {\n" +
- " return prop;\n" +
- " }\n" +
+ "@NonNullByDefault\n" +
+ "public class Bar {\n" +
+ " private String prop = \"\";\n" +
+ "\n" +
+ " public String getProp() {\n" +
+ " return prop;\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -5544,12 +5544,12 @@ public void testBug432977() {
false /* flush */,
new String[] {
"Fu.java",
- "public class Fu {\n" +
- " private Bar fubar = new Bar();\n" +
- " \n" +
- " public void method() {\n" +
- " fubar.getProp().equals(\"\");\n" +
- " } \n" +
+ "public class Fu {\n" +
+ " private Bar fubar = new Bar();\n" +
+ " \n" +
+ " public void method() {\n" +
+ " fubar.getProp().equals(\"\");\n" +
+ " } \n" +
"}\n"
},
getCompilerOptions(),
@@ -5559,21 +5559,21 @@ public void testBug433586() {
runConformTestWithLibs(
new String[] {
"NullConversionWarning.java",
- "import java.util.function.Consumer;\n" +
- "public class NullConversionWarning<T> {\n" +
- "\n" +
- " public Consumer<T> peek2(Consumer<? super T> action) {\n" +
- " // Null type safety: parameter 1 provided via\n" +
- " // method descriptor Consumer<T>.accept(T) needs\n" +
- " // unchecked conversion to conform to 'capture#of ? super T'\n" +
- " Consumer<T> action2 = action::accept;\n" +
- " return action2;\n" +
- " }\n" +
- " void foo(Consumer<? super T> action, T t) {\n" +
- " Consumer<T> action2 = t2 -> action.accept(t2);\n" +
- " action.accept(t);\n" +
- " action2.accept(t);\n" +
- " }\n" +
+ "import java.util.function.Consumer;\n" +
+ "public class NullConversionWarning<T> {\n" +
+ "\n" +
+ " public Consumer<T> peek2(Consumer<? super T> action) {\n" +
+ " // Null type safety: parameter 1 provided via\n" +
+ " // method descriptor Consumer<T>.accept(T) needs\n" +
+ " // unchecked conversion to conform to 'capture#of ? super T'\n" +
+ " Consumer<T> action2 = action::accept;\n" +
+ " return action2;\n" +
+ " }\n" +
+ " void foo(Consumer<? super T> action, T t) {\n" +
+ " Consumer<T> action2 = t2 -> action.accept(t2);\n" +
+ " action.accept(t);\n" +
+ " action2.accept(t);\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -5601,11 +5601,11 @@ public void testBug433478() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 14)\n" +
- " return null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Y\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 14)\n" +
+ " return null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Y\' but the provided value is null\n" +
"----------\n");
}
// https://bugs.eclipse.org/434899
@@ -5614,22 +5614,22 @@ public void testTypeVariable6() {
new String[] {
"Assert.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "public class Assert {\n" +
- " public static void caller() {\n" +
- " assertNotNull(\"not null\"); // Compiler error\n" +
- " assertNotNull(null); // Compiler error\n" +
- " }\n" +
- " private static @NonNull <T> T assertNotNull(@Nullable T object) {\n" +
- " return object; // this IS bogus\n" +
- " }\n" +
+ "public class Assert {\n" +
+ " public static void caller() {\n" +
+ " assertNotNull(\"not null\"); // Compiler error\n" +
+ " assertNotNull(null); // Compiler error\n" +
+ " }\n" +
+ " private static @NonNull <T> T assertNotNull(@Nullable T object) {\n" +
+ " return object; // this IS bogus\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in Assert.java (at line 8)\n" +
- " return object; // this IS bogus\n" +
- " ^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull T\' but this expression has type \'@Nullable T\'\n" +
+ "----------\n" +
+ "1. ERROR in Assert.java (at line 8)\n" +
+ " return object; // this IS bogus\n" +
+ " ^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull T\' but this expression has type \'@Nullable T\'\n" +
"----------\n");
}
// https://bugs.eclipse.org/434899 - variant which has always worked
@@ -5638,22 +5638,22 @@ public void testTypeVariable6a() {
new String[] {
"Assert.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "public class Assert {\n" +
- " public static Object caller() {\n" +
- " @NonNull Object result = assertNotNull(\"not null\");\n" +
+ "public class Assert {\n" +
+ " public static Object caller() {\n" +
+ " @NonNull Object result = assertNotNull(\"not null\");\n" +
" result = assertNotNull(null);\n" +
- " return result;\n" +
- " }\n" +
+ " return result;\n" +
+ " }\n" +
" private static @NonNull <T> T assertNotNull(@Nullable T object) {\n" +
- " if (object == null) throw new NullPointerException();\n" +
- " return object;\n" +
- " }\n" +
+ " if (object == null) throw new NullPointerException();\n" +
+ " return object;\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
"");
}
-// Bug 438458 - [1.8][null] clean up handling of null type annotations wrt type variables
+// Bug 438458 - [1.8][null] clean up handling of null type annotations wrt type variables
// - type parameter with explicit nullness, cannot infer otherwise
public void testTypeVariable7() {
runNegativeTestWithLibs(
@@ -5669,14 +5669,14 @@ public void testTypeVariable7() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " <U> U m(I1<U> in) { return in.get(); }\n" +
- " ^\n" +
- "Null constraint mismatch: The type \'U\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " <U> U m(I1<U> in) { return in.get(); }\n" +
+ " ^\n" +
+ "Null constraint mismatch: The type \'U\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
"----------\n");
}
-// Bug 438458 - [1.8][null] clean up handling of null type annotations wrt type variables
+// Bug 438458 - [1.8][null] clean up handling of null type annotations wrt type variables
// - type parameter with explicit nullness, nullness must not spoil inference
public void testTypeVariable7a() {
Map compilerOptions = getCompilerOptions();
@@ -5699,20 +5699,20 @@ public void testTypeVariable7a() {
"}\n"
},
compilerOptions,
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " <U> U m(I1<U> in) { return in.get(); }\n" +
- " ^\n" +
- "Null constraint mismatch: The type \'U\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " @Nullable String s = m(() -> \"OK\");\n" +
- " ^^^^^^^^^^\n" +
- "Contradictory null annotations: function type was inferred as \'@NonNull @Nullable String ()\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " <U> U m(I1<U> in) { return in.get(); }\n" +
+ " ^\n" +
+ "Null constraint mismatch: The type \'U\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " @Nullable String s = m(() -> \"OK\");\n" +
+ " ^^^^^^^^^^\n" +
+ "Contradictory null annotations: function type was inferred as \'@NonNull @Nullable String ()\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
"----------\n",
"OK");
}
-// Bug 438458 - [1.8][null] clean up handling of null type annotations wrt type variables
+// Bug 438458 - [1.8][null] clean up handling of null type annotations wrt type variables
// - type parameter with explicit nullness, nullness must not spoil inference
public void testTypeVariable7err() {
runNegativeTestWithLibs(
@@ -5728,21 +5728,21 @@ public void testTypeVariable7err() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " <U> U m(I1<U> in) { return in.get(); }\n" +
- " ^\n" +
- "Null constraint mismatch: The type \'U\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " <U> U m(I1<U> in) { return in.get(); }\n" +
- " ^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'U\' but this expression has type \'@Nullable U\', where \'U\' is a free type variable\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " @NonNull String s = m(() -> \"\");\n" +
- " ^^^^^^^^\n" +
- "Contradictory null annotations: function type was inferred as \'@Nullable @NonNull String ()\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " <U> U m(I1<U> in) { return in.get(); }\n" +
+ " ^\n" +
+ "Null constraint mismatch: The type \'U\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " <U> U m(I1<U> in) { return in.get(); }\n" +
+ " ^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'U\' but this expression has type \'@Nullable U\', where \'U\' is a free type variable\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " @NonNull String s = m(() -> \"\");\n" +
+ " ^^^^^^^^\n" +
+ "Contradictory null annotations: function type was inferred as \'@Nullable @NonNull String ()\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
"----------\n");
}
//Bug 435570 - [1.8][null] @NonNullByDefault illegally tries to affect "throws E"
@@ -5750,8 +5750,8 @@ public void testTypeVariable8() {
runConformTestWithLibs(
new String[] {
"Test.java",
- "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
- "public class Test<E extends Exception> {\n" +
+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ "public class Test<E extends Exception> {\n" +
" void test() throws E {}\n" + // was: Nullness annotations are not applicable at this location
"}\n"
},
@@ -5763,13 +5763,13 @@ public void testTypeVariable9() {
runConformTestWithLibs(
new String[] {
"Bar.java",
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "import static org.eclipse.jdt.annotation.DefaultLocation.*;\n" +
- "\n" +
- "@NonNullByDefault({ PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT, TYPE_PARAMETER })\n" +
- "interface Bar<V> {\n" +
- " V getV(V in);\n" +
- " void setV(V v);\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "import static org.eclipse.jdt.annotation.DefaultLocation.*;\n" +
+ "\n" +
+ "@NonNullByDefault({ PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT, TYPE_PARAMETER })\n" +
+ "interface Bar<V> {\n" +
+ " V getV(V in);\n" +
+ " void setV(V v);\n" +
"}"
},
getCompilerOptions(),
@@ -5788,7 +5788,7 @@ public void testTypeVariable10() {
getCompilerOptions(),
"");
runConformTestWithLibs(
- false,
+ false,
new String[] {
"Y.java",
"public class Y {\n" +
@@ -5796,8 +5796,8 @@ public void testTypeVariable10() {
" xs.test(null);\n" +
" }\n" +
"}\n"
- },
- getCompilerOptions(),
+ },
+ getCompilerOptions(),
"");
}
// Bug 439516 - [1.8][null] NonNullByDefault wrongly applied to implicit type bound of binary type
@@ -5815,7 +5815,7 @@ public void testTypeVariable10a() {
getCompilerOptions(),
"");
runConformTestWithLibs(
- false,
+ false,
new String[] {
"Y.java",
"public class Y {\n" +
@@ -5824,8 +5824,8 @@ public void testTypeVariable10a() {
" xs.test(null);\n" + // was: Contradictory null annotations: method was inferred as ...
" }\n" +
"}\n"
- },
- getCompilerOptions(),
+ },
+ getCompilerOptions(),
"");
}
// Bug 439516 - [1.8][null] NonNullByDefault wrongly applied to implicit type bound of binary type
@@ -5846,13 +5846,13 @@ public void testTypeVariable11() {
" xs.test(null);\n" +
" }\n" +
"}\n"
- },
- getCompilerOptions(),
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public class X<T extends Object> {\n" +
- " ^^^^^^\n" +
- "The explicit type bound \'Object\' is not affected by the nullness default for DefaultLocation.TYPE_BOUND.\n" +
+ },
+ getCompilerOptions(),
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public class X<T extends Object> {\n" +
+ " ^^^^^^\n" +
+ "The explicit type bound \'Object\' is not affected by the nullness default for DefaultLocation.TYPE_BOUND.\n" +
"----------\n");
}
// Bug 438179 - [1.8][null] 'Contradictory null annotations' error on type variable with explicit null-annotation.
@@ -5861,17 +5861,17 @@ public void testTypeVariable12() {
new String[] {
"Test.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "@NonNullByDefault\n" +
- "public class Test {\n" +
- " private Fu<String> fu = new Fu<>();\n" +
- " public void foo() {\n" +
- " fu.method(); // 'Contradictory null annotations' error\n" +
- " }\n" +
- "}\n" +
- "class Fu<T> {\n" +
- " @Nullable T method() {\n" +
- " return null;\n" +
- " }\n" +
+ "@NonNullByDefault\n" +
+ "public class Test {\n" +
+ " private Fu<String> fu = new Fu<>();\n" +
+ " public void foo() {\n" +
+ " fu.method(); // 'Contradictory null annotations' error\n" +
+ " }\n" +
+ "}\n" +
+ "class Fu<T> {\n" +
+ " @Nullable T method() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -5882,9 +5882,9 @@ public void testTypeVariable13() {
runConformTestWithLibs(
new String[] {
"FooBar.java",
- "@org.eclipse.jdt.annotation.NonNullByDefault(org.eclipse.jdt.annotation.DefaultLocation.TYPE_BOUND)\n" +
- "public interface FooBar {\n" +
- " <@org.eclipse.jdt.annotation.Nullable R extends Runnable> R foobar(R r);\n" +
+ "@org.eclipse.jdt.annotation.NonNullByDefault(org.eclipse.jdt.annotation.DefaultLocation.TYPE_BOUND)\n" +
+ "public interface FooBar {\n" +
+ " <@org.eclipse.jdt.annotation.Nullable R extends Runnable> R foobar(R r);\n" +
"}\n"
},
getCompilerOptions(),
@@ -5895,8 +5895,8 @@ public void testTypeVariable14() {
runConformTestWithLibs(
new String[] {
"ITest.java",
- "interface ITest {\n" +
- " <T> T foo(T arg); // or arg Class<T> or TypeToken<T> + return TypeAdapter<T>, etc.\n" +
+ "interface ITest {\n" +
+ " <T> T foo(T arg); // or arg Class<T> or TypeToken<T> + return TypeAdapter<T>, etc.\n" +
"}"
},
getCompilerOptions(),
@@ -5907,12 +5907,12 @@ public void testTypeVariable14() {
false,
new String[] {
"Test.java",
- "class Test implements ITest {\n" +
- " @Override\n" +
+ "class Test implements ITest {\n" +
+ " @Override\n" +
" @SuppressWarnings(\"null\")\n" +
- " public <T> @org.eclipse.jdt.annotation.Nullable T foo(T arg) {\n" +
- " return null;\n" +
- " }\n" +
+ " public <T> @org.eclipse.jdt.annotation.Nullable T foo(T arg) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
},
options,
@@ -5923,36 +5923,36 @@ public void testTypeVariable15() {
runNegativeTestWithLibs(
new String[] {
"ITest.java",
- "interface ITest {\n" +
- " <T> T foo(T arg); // or arg Class<T> or TypeToken<T> + return TypeAdapter<T>, etc.\n" +
+ "interface ITest {\n" +
+ " <T> T foo(T arg); // or arg Class<T> or TypeToken<T> + return TypeAdapter<T>, etc.\n" +
"}",
"Test.java",
- "class Test implements ITest {\n" +
- " @Override\n" +
- " public <T> @org.eclipse.jdt.annotation.Nullable T foo(T arg) {\n" +
- " return null;\n" +
- " }\n" +
+ "class Test implements ITest {\n" +
+ " @Override\n" +
+ " public <T> @org.eclipse.jdt.annotation.Nullable T foo(T arg) {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n",
"Test2.java",
- "class Test2 implements ITest {\n" +
- " @Override\n" +
- " public <T> T foo(@org.eclipse.jdt.annotation.NonNull T arg) {\n" +
- " return arg;\n" +
- " }\n" +
+ "class Test2 implements ITest {\n" +
+ " @Override\n" +
+ " public <T> T foo(@org.eclipse.jdt.annotation.NonNull T arg) {\n" +
+ " return arg;\n" +
+ " }\n" +
"}\n",
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in Test.java (at line 3)\n" +
- " public <T> @org.eclipse.jdt.annotation.Nullable T foo(T arg) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The return type is incompatible with the free type variable 'T' returned from ITest.foo(T) (mismatching null constraints)\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Test2.java (at line 3)\n" +
- " public <T> T foo(@org.eclipse.jdt.annotation.NonNull T arg) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Illegal redefinition of parameter arg, inherited method from ITest does not constrain this parameter\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 3)\n" +
+ " public <T> @org.eclipse.jdt.annotation.Nullable T foo(T arg) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The return type is incompatible with the free type variable 'T' returned from ITest.foo(T) (mismatching null constraints)\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in Test2.java (at line 3)\n" +
+ " public <T> T foo(@org.eclipse.jdt.annotation.NonNull T arg) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Illegal redefinition of parameter arg, inherited method from ITest does not constrain this parameter\n" +
"----------\n");
}
// Bug 438467 - [compiler][null] Better error position for "The method _ cannot implement the corresponding method _ due to incompatible nullness constraints"
@@ -5961,29 +5961,29 @@ public void testTypeVariable15a() {
new String[] {
"ITest.java",
"import java.util.List;\n" +
- "interface ITest {\n" +
- " <T> T foo(List<T> arg); // or arg Class<T> or TypeToken<T> + return TypeAdapter<T>, etc.\n" +
+ "interface ITest {\n" +
+ " <T> T foo(List<T> arg); // or arg Class<T> or TypeToken<T> + return TypeAdapter<T>, etc.\n" +
"}",
"Test.java",
"import java.util.List;\n" +
- "class Test implements ITest {\n" +
- " @Override\n" +
- " public <T> T foo(List<@org.eclipse.jdt.annotation.NonNull T> arg) {\n" +
- " return arg.get(0);\n" +
- " }\n" +
+ "class Test implements ITest {\n" +
+ " @Override\n" +
+ " public <T> T foo(List<@org.eclipse.jdt.annotation.NonNull T> arg) {\n" +
+ " return arg.get(0);\n" +
+ " }\n" +
"}\n",
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in Test.java (at line 4)\n" +
- " public <T> T foo(List<@org.eclipse.jdt.annotation.NonNull T> arg) {\n" +
- " ^^^^\n" +
- "Illegal redefinition of parameter arg, inherited method from ITest declares this parameter as \'List<T>\' (mismatching null constraints)\n" +
- "----------\n" +
- "2. INFO in Test.java (at line 5)\n" +
- " return arg.get(0);\n" +
- " ^^^^^^^^^^\n" +
- "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'List<@NonNull T>\'. Type \'List<E>\' doesn\'t seem to be designed with null type annotations in mind\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 4)\n" +
+ " public <T> T foo(List<@org.eclipse.jdt.annotation.NonNull T> arg) {\n" +
+ " ^^^^\n" +
+ "Illegal redefinition of parameter arg, inherited method from ITest declares this parameter as \'List<T>\' (mismatching null constraints)\n" +
+ "----------\n" +
+ "2. INFO in Test.java (at line 5)\n" +
+ " return arg.get(0);\n" +
+ " ^^^^^^^^^^\n" +
+ "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'List<@NonNull T>\'. Type \'List<E>\' doesn\'t seem to be designed with null type annotations in mind\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=434602
@@ -6010,11 +6010,11 @@ public void testTypeVariable16() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " y.doit(); // check that @Nullable from bar's declaration has effect on 'y'\n" +
- " ^\n" +
- "Potential null pointer access: The variable y may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " y.doit(); // check that @Nullable from bar's declaration has effect on 'y'\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable y may be null at this location\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=434602
@@ -6064,11 +6064,11 @@ public void testTypeVariable16b() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " x.bar(null); // null arg is illegal\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Y\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " x.bar(null); // null arg is illegal\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Y\' but the provided value is null\n" +
"----------\n");
}
// Bug 440143 - [1.8][null] one more case of contradictory null annotations regarding type variables
@@ -6076,30 +6076,30 @@ public void testTypeVariable17() {
runNegativeTestWithLibs(
new String[] {
"Test7.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public class Test7<@Nullable E> {\n" +
- " E e;\n" +
- "\n" +
- " @Nullable\n" +
- " E test() {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " @NonNull\n" +
- " E getNotNull() {\n" +
- " if (e == null)\n" +
- " throw new NullPointerException();\n" +
- " return e;\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "public class Test7<@Nullable E> {\n" +
+ " E e;\n" +
+ "\n" +
+ " @Nullable\n" +
+ " E test() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " @NonNull\n" +
+ " E getNotNull() {\n" +
+ " if (e == null)\n" +
+ " throw new NullPointerException();\n" +
+ " return e;\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in Test7.java (at line 15)\n" +
- " return e;\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'@NonNull E\' but this expression has type \'@Nullable E\'\n" +
+ "----------\n" +
+ "1. ERROR in Test7.java (at line 15)\n" +
+ " return e;\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull E\' but this expression has type \'@Nullable E\'\n" +
"----------\n");
}
// Bug 440143 - [1.8][null] one more case of contradictory null annotations regarding type variables
@@ -6108,23 +6108,23 @@ public void testTypeVariable17a() {
runConformTestWithLibs(
new String[] {
"Test7.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public class Test7<@Nullable E> {\n" +
- " E e;\n" +
- "\n" +
- " @Nullable\n" +
- " E test() {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " @NonNull\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "public class Test7<@Nullable E> {\n" +
+ " E e;\n" +
+ "\n" +
+ " @Nullable\n" +
+ " E test() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " @NonNull\n" +
" E getNotNull() {\n" +
- " E el = e;\n" +
- " if (el == null)\n" +
- " throw new NullPointerException();\n" +
- " return el;\n" +
- " }\n" +
+ " E el = e;\n" +
+ " if (el == null)\n" +
+ " throw new NullPointerException();\n" +
+ " return el;\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -6135,61 +6135,61 @@ public void testTypeVariable18() {
runNegativeTestWithLibs(
new String[] {
"Test.java",
- "import java.util.*;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "interface Lib1 {\n" +
- " <T extends Collection<?>> T constrainedTypeParameter(@NonNull T in);\n" +
- "}\n" +
- "\n" +
- "public class Test {\n" +
- " @NonNull Collection<?> test4(Lib1 lib, @Nullable Collection<String> in) {\n" +
- " return lib.constrainedTypeParameter(in);\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "interface Lib1 {\n" +
+ " <T extends Collection<?>> T constrainedTypeParameter(@NonNull T in);\n" +
+ "}\n" +
+ "\n" +
+ "public class Test {\n" +
+ " @NonNull Collection<?> test4(Lib1 lib, @Nullable Collection<String> in) {\n" +
+ " return lib.constrainedTypeParameter(in);\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in Test.java (at line 10)\n" +
- " return lib.constrainedTypeParameter(in);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'Collection<String>\' needs unchecked conversion to conform to \'@NonNull Collection<?>\'\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 10)\n" +
- " return lib.constrainedTypeParameter(in);\n" +
- " ^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Collection<String>\' but this expression has type \'@Nullable Collection<String>\'\n" +
+ "----------\n" +
+ "1. WARNING in Test.java (at line 10)\n" +
+ " return lib.constrainedTypeParameter(in);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'Collection<String>\' needs unchecked conversion to conform to \'@NonNull Collection<?>\'\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 10)\n" +
+ " return lib.constrainedTypeParameter(in);\n" +
+ " ^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Collection<String>\' but this expression has type \'@Nullable Collection<String>\'\n" +
"----------\n");
}
public void testTypeVariable18raw() {
runNegativeTestWithLibs(
new String[] {
"Test.java",
- "import java.util.*;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "interface Lib1 {\n" +
- " <T extends Collection<?>> T constrainedTypeParameter(@NonNull T in);\n" +
- "}\n" +
- "\n" +
+ "import java.util.*;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "interface Lib1 {\n" +
+ " <T extends Collection<?>> T constrainedTypeParameter(@NonNull T in);\n" +
+ "}\n" +
+ "\n" +
"public class Test {\n" +
- " @SuppressWarnings(\"rawtypes\")\n" +
- " @NonNull Collection test4(Lib1 lib, @Nullable Collection in) {\n" +
- " return lib.constrainedTypeParameter(in);\n" +
- " }\n" +
+ " @SuppressWarnings(\"rawtypes\")\n" +
+ " @NonNull Collection test4(Lib1 lib, @Nullable Collection in) {\n" +
+ " return lib.constrainedTypeParameter(in);\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in Test.java (at line 11)\n" +
- " return lib.constrainedTypeParameter(in);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'Collection\' needs unchecked conversion to conform to \'@NonNull Collection\'\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 11)\n" +
- " return lib.constrainedTypeParameter(in);\n" +
- " ^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Collection\' but this expression has type \'@Nullable Collection\'\n" +
+ "----------\n" +
+ "1. WARNING in Test.java (at line 11)\n" +
+ " return lib.constrainedTypeParameter(in);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'Collection\' needs unchecked conversion to conform to \'@NonNull Collection\'\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 11)\n" +
+ " return lib.constrainedTypeParameter(in);\n" +
+ " ^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Collection\' but this expression has type \'@Nullable Collection\'\n" +
"----------\n");
}
// top-level annotation is overridden at use-site, details remain - parameterized type
@@ -6199,62 +6199,62 @@ public void testTypeVariable19() {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
"import org.eclipse.jdt.annotation.Nullable;\n" +
"interface I<T,U extends List<T>> {\n" +
" U get0();\n" +
- " @Nullable U get1();\n" +
- " @NonNull U get2();\n" +
- "}\n" +
- "class X {\n" +
+ " @Nullable U get1();\n" +
+ " @NonNull U get2();\n" +
+ "}\n" +
+ "class X {\n" +
" static String test (I<@Nullable String, @NonNull ArrayList<@Nullable String>> i1,\n" +
" I<@NonNull String, @Nullable ArrayList<@NonNull String>> i2, int s) {\n" +
" switch(s) {\n" +
- " case 0 : return i1.get0().get(0).toUpperCase(); // problem at detail\n" +
- " case 1 : return i1.get1().get(0).toUpperCase(); // 2 problems\n" +
- " case 2 : return i1.get2().get(0).toUpperCase(); // problem at detail\n" +
- " case 3 : return i2.get0().get(0).toUpperCase(); // problem at top\n" +
- " case 4 : return i2.get1().get(0).toUpperCase(); // problem at top\n" +
+ " case 0 : return i1.get0().get(0).toUpperCase(); // problem at detail\n" +
+ " case 1 : return i1.get1().get(0).toUpperCase(); // 2 problems\n" +
+ " case 2 : return i1.get2().get(0).toUpperCase(); // problem at detail\n" +
+ " case 3 : return i2.get0().get(0).toUpperCase(); // problem at top\n" +
+ " case 4 : return i2.get1().get(0).toUpperCase(); // problem at top\n" +
" case 5 : return i2.get2().get(0).toUpperCase(); // OK\n" +
" default : return \"\";" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
compilerOptions,
- "----------\n" +
- "1. ERROR in X.java (at line 15)\n" +
- " case 0 : return i1.get0().get(0).toUpperCase(); // problem at detail\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Potential null pointer access: The method get(int) may return null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 16)\n" +
- " case 1 : return i1.get1().get(0).toUpperCase(); // 2 problems\n" +
- " ^^^^^^^^^\n" +
- "Potential null pointer access: The method get1() may return null\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 16)\n" +
- " case 1 : return i1.get1().get(0).toUpperCase(); // 2 problems\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Potential null pointer access: The method get(int) may return null\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 17)\n" +
- " case 2 : return i1.get2().get(0).toUpperCase(); // problem at detail\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Potential null pointer access: The method get(int) may return null\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 18)\n" +
- " case 3 : return i2.get0().get(0).toUpperCase(); // problem at top\n" +
- " ^^^^^^^^^\n" +
- "Potential null pointer access: The method get0() may return null\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 19)\n" +
- " case 4 : return i2.get1().get(0).toUpperCase(); // problem at top\n" +
- " ^^^^^^^^^\n" +
- "Potential null pointer access: The method get1() may return null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 15)\n" +
+ " case 0 : return i1.get0().get(0).toUpperCase(); // problem at detail\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Potential null pointer access: The method get(int) may return null\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 16)\n" +
+ " case 1 : return i1.get1().get(0).toUpperCase(); // 2 problems\n" +
+ " ^^^^^^^^^\n" +
+ "Potential null pointer access: The method get1() may return null\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 16)\n" +
+ " case 1 : return i1.get1().get(0).toUpperCase(); // 2 problems\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Potential null pointer access: The method get(int) may return null\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 17)\n" +
+ " case 2 : return i1.get2().get(0).toUpperCase(); // problem at detail\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Potential null pointer access: The method get(int) may return null\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 18)\n" +
+ " case 3 : return i2.get0().get(0).toUpperCase(); // problem at top\n" +
+ " ^^^^^^^^^\n" +
+ "Potential null pointer access: The method get0() may return null\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 19)\n" +
+ " case 4 : return i2.get1().get(0).toUpperCase(); // problem at top\n" +
+ " ^^^^^^^^^\n" +
+ "Potential null pointer access: The method get1() may return null\n" +
"----------\n");
}
// top-level annotation is overridden at use-site, array with anotations on dimensions
@@ -6262,63 +6262,63 @@ public void testTypeVariable19a() {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
"import org.eclipse.jdt.annotation.Nullable;\n" +
- "interface I1<T> {\n" +
- " T @Nullable[] get0();\n" +
- " @Nullable T @NonNull[] get1();\n" +
- " @Nullable T @Nullable[] get2();\n" +
- "}\n" +
- "interface I2<T> {\n" +
- " T @NonNull[] get0();\n" +
- " @NonNull T @NonNull[] get1();\n" +
- " @NonNull T @Nullable[] get2();\n" +
- "}\n" +
- "class X {\n" +
+ "interface I1<T> {\n" +
+ " T @Nullable[] get0();\n" +
+ " @Nullable T @NonNull[] get1();\n" +
+ " @Nullable T @Nullable[] get2();\n" +
+ "}\n" +
+ "interface I2<T> {\n" +
+ " T @NonNull[] get0();\n" +
+ " @NonNull T @NonNull[] get1();\n" +
+ " @NonNull T @Nullable[] get2();\n" +
+ "}\n" +
+ "class X {\n" +
" static String test (I1<@NonNull String> i1, I2<@Nullable String> i2, int s) {\n" +
- " switch (s) {\n" +
- " case 0: return i1.get0()[0].toUpperCase(); // problem on array\n" +
- " case 1: return i1.get1()[0].toUpperCase(); // problem on element\n" +
+ " switch (s) {\n" +
+ " case 0: return i1.get0()[0].toUpperCase(); // problem on array\n" +
+ " case 1: return i1.get1()[0].toUpperCase(); // problem on element\n" +
" case 2: return i1.get2()[0].toUpperCase(); // 2 problems\n" +
- " case 3: return i2.get0()[0].toUpperCase(); // problem on element\n" +
- " case 4: return i2.get1()[0].toUpperCase(); // OK\n" +
+ " case 3: return i2.get0()[0].toUpperCase(); // problem on element\n" +
+ " case 4: return i2.get1()[0].toUpperCase(); // OK\n" +
" case 5: return i2.get2()[0].toUpperCase(); // problem on array\n" +
" default: return \"\";\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 16)\n" +
- " case 0: return i1.get0()[0].toUpperCase(); // problem on array\n" +
- " ^^^^^^^^^\n" +
- "Potential null pointer access: The method get0() may return null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 17)\n" +
- " case 1: return i1.get1()[0].toUpperCase(); // problem on element\n" +
- " ^^^^^^^^^^^^\n" +
- "Potential null pointer access: array element may be null\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 18)\n" +
- " case 2: return i1.get2()[0].toUpperCase(); // 2 problems\n" +
- " ^^^^^^^^^\n" +
- "Potential null pointer access: The method get2() may return null\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 18)\n" +
- " case 2: return i1.get2()[0].toUpperCase(); // 2 problems\n" +
- " ^^^^^^^^^^^^\n" +
- "Potential null pointer access: array element may be null\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 19)\n" +
- " case 3: return i2.get0()[0].toUpperCase(); // problem on element\n" +
- " ^^^^^^^^^^^^\n" +
- "Potential null pointer access: array element may be null\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 21)\n" +
- " case 5: return i2.get2()[0].toUpperCase(); // problem on array\n" +
- " ^^^^^^^^^\n" +
- "Potential null pointer access: The method get2() may return null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 16)\n" +
+ " case 0: return i1.get0()[0].toUpperCase(); // problem on array\n" +
+ " ^^^^^^^^^\n" +
+ "Potential null pointer access: The method get0() may return null\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 17)\n" +
+ " case 1: return i1.get1()[0].toUpperCase(); // problem on element\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Potential null pointer access: array element may be null\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 18)\n" +
+ " case 2: return i1.get2()[0].toUpperCase(); // 2 problems\n" +
+ " ^^^^^^^^^\n" +
+ "Potential null pointer access: The method get2() may return null\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 18)\n" +
+ " case 2: return i1.get2()[0].toUpperCase(); // 2 problems\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Potential null pointer access: array element may be null\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 19)\n" +
+ " case 3: return i2.get0()[0].toUpperCase(); // problem on element\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Potential null pointer access: array element may be null\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 21)\n" +
+ " case 5: return i2.get2()[0].toUpperCase(); // problem on array\n" +
+ " ^^^^^^^^^\n" +
+ "Potential null pointer access: The method get2() may return null\n" +
"----------\n");
}
public void testTypeVariable20() {
@@ -6330,11 +6330,11 @@ public void testTypeVariable20() {
"public class X implements I<String> {}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " public class X implements I<String> {}\n" +
- " ^^^^^^\n" +
- "Null constraint mismatch: The type \'String\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " public class X implements I<String> {}\n" +
+ " ^^^^^^\n" +
+ "Null constraint mismatch: The type \'String\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
"----------\n");
}
public void testBug434600() {
@@ -6342,31 +6342,31 @@ public void testBug434600() {
new String[] {
"bug/Main.java",
"package bug;\n" +
- "public class Main {\n" +
- " public static void main(final String[] args) {\n" +
- " System.out.println(\"Hello World\");\n" +
- " }\n" +
+ "public class Main {\n" +
+ " public static void main(final String[] args) {\n" +
+ " System.out.println(\"Hello World\");\n" +
+ " }\n" +
"}\n",
"bug/package-info.java",
- "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
"package bug;\n",
"bug/ExpressionNode.java",
- "package bug;\n" +
- "\n" +
- "public interface ExpressionNode extends CopyableNode<ExpressionNode> {\n" +
- " \n" +
+ "package bug;\n" +
+ "\n" +
+ "public interface ExpressionNode extends CopyableNode<ExpressionNode> {\n" +
+ " \n" +
"}\n",
"bug/ExtendedNode.java",
- "package bug;\n" +
- "\n" +
- "public interface ExtendedNode {\n" +
- " \n" +
+ "package bug;\n" +
+ "\n" +
+ "public interface ExtendedNode {\n" +
+ " \n" +
"}\n",
"bug/CopyableNode.java",
- "package bug;\n" +
- "\n" +
- "public interface CopyableNode<T extends ExtendedNode> extends ExtendedNode {\n" +
- " \n" +
+ "package bug;\n" +
+ "\n" +
+ "public interface CopyableNode<T extends ExtendedNode> extends ExtendedNode {\n" +
+ " \n" +
"}\n"
},
getCompilerOptions(),
@@ -6423,21 +6423,21 @@ public void testBug434600b() {
"class C2 implements I<@NonNull String, @NonNull ArrayList<@NonNull List<@Nullable String>>> {}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in C.java (at line 3)\n" +
- " public class C implements I<@Nullable String, ArrayList<@NonNull List<@Nullable String>>> {}\n" +
- " ^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'ArrayList<@NonNull List<@Nullable String>>\' is not a valid substitute for the type parameter \'T extends @NonNull List<@NonNull List<S>>\'\n" +
- "----------\n" +
- "2. ERROR in C.java (at line 5)\n" +
- " I<String, @NonNull ArrayList<@Nullable List<String>>> field;\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@NonNull ArrayList<@Nullable List<String>>\' is not a valid substitute for the type parameter \'T extends @NonNull List<@NonNull List<S>>\'\n" +
- "----------\n" +
- "3. ERROR in C.java (at line 7)\n" +
- " class C2 implements I<@NonNull String, @NonNull ArrayList<@NonNull List<@Nullable String>>> {}\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@NonNull ArrayList<@NonNull List<@Nullable String>>\' is not a valid substitute for the type parameter \'T extends @NonNull List<@NonNull List<S>>\'\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 3)\n" +
+ " public class C implements I<@Nullable String, ArrayList<@NonNull List<@Nullable String>>> {}\n" +
+ " ^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'ArrayList<@NonNull List<@Nullable String>>\' is not a valid substitute for the type parameter \'T extends @NonNull List<@NonNull List<S>>\'\n" +
+ "----------\n" +
+ "2. ERROR in C.java (at line 5)\n" +
+ " I<String, @NonNull ArrayList<@Nullable List<String>>> field;\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@NonNull ArrayList<@Nullable List<String>>\' is not a valid substitute for the type parameter \'T extends @NonNull List<@NonNull List<S>>\'\n" +
+ "----------\n" +
+ "3. ERROR in C.java (at line 7)\n" +
+ " class C2 implements I<@NonNull String, @NonNull ArrayList<@NonNull List<@Nullable String>>> {}\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@NonNull ArrayList<@NonNull List<@Nullable String>>\' is not a valid substitute for the type parameter \'T extends @NonNull List<@NonNull List<S>>\'\n" +
"----------\n");
}
public void testBug434600b_qualified() {
@@ -6459,32 +6459,32 @@ public void testBug434600b_qualified() {
"class C2 implements p.I<@NonNull String, @Nullable ArrayList<@NonNull List<@Nullable String>>> {}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in C.java (at line 5)\n" +
- " p.I<String, @Nullable ArrayList<@Nullable List<String>>> field;\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@Nullable ArrayList<@Nullable List<String>>\' is not a valid substitute for the type parameter \'T extends @Nullable List<@NonNull List<S>>\'\n" +
- "----------\n" +
- "2. ERROR in C.java (at line 7)\n" +
- " class C2 implements p.I<@NonNull String, @Nullable ArrayList<@NonNull List<@Nullable String>>> {}\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@Nullable ArrayList<@NonNull List<@Nullable String>>\' is not a valid substitute for the type parameter \'T extends @Nullable List<@NonNull List<S>>\'\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 5)\n" +
+ " p.I<String, @Nullable ArrayList<@Nullable List<String>>> field;\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@Nullable ArrayList<@Nullable List<String>>\' is not a valid substitute for the type parameter \'T extends @Nullable List<@NonNull List<S>>\'\n" +
+ "----------\n" +
+ "2. ERROR in C.java (at line 7)\n" +
+ " class C2 implements p.I<@NonNull String, @Nullable ArrayList<@NonNull List<@Nullable String>>> {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@Nullable ArrayList<@NonNull List<@Nullable String>>\' is not a valid substitute for the type parameter \'T extends @Nullable List<@NonNull List<S>>\'\n" +
"----------\n");
}
public void testBug435399() {
runConformTestWithLibs(
new String[] {
"bug/Bug1.java",
- "package bug;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "public class Bug1 {\n" +
- " public static <T> void method(@Nullable T value, T defaultValue) {\n" +
- " }\n" +
- " public void invoke() {\n" +
- " method(Integer.valueOf(1), Boolean.TRUE);\n" +
- " }\n" +
+ "package bug;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "public class Bug1 {\n" +
+ " public static <T> void method(@Nullable T value, T defaultValue) {\n" +
+ " }\n" +
+ " public void invoke() {\n" +
+ " method(Integer.valueOf(1), Boolean.TRUE);\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -6494,64 +6494,64 @@ public void testBug435962() {
runConformTestWithLibs(
new String[] {
"interfaces/CopyableNode.java",
- "package interfaces;\n" +
- "public interface CopyableNode<T extends ExtendedNode> extends ExtendedNode {\n" +
- " public T deepCopy();\n" +
+ "package interfaces;\n" +
+ "public interface CopyableNode<T extends ExtendedNode> extends ExtendedNode {\n" +
+ " public T deepCopy();\n" +
"}\n",
"interfaces/package-info.java",
- "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
"package interfaces;\n",
"interfaces/ExtendedNode.java",
- "package interfaces;\n" +
- "import java.util.ArrayList;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "public interface ExtendedNode {\n" +
- " ExtendedNode getParent();\n" +
- " void setParent(ExtendedNode newParent);\n" +
- " int numChildren();\n" +
- " void mutateNode(ExtendedNode root);\n" +
- " void getAllNodes(ArrayList<ExtendedNode> array);\n" +
- " ExtendedNode getNode(int nodeIndex);\n" +
- " <N extends ExtendedNode> void getNodesOfType(Class<N> desiredType,\n" +
- " ArrayList<N> array);\n" +
- " <N extends ExtendedNode> @Nullable N getRandomNodeOfType(\n" +
- " Class<N> desiredType, ExtendedNode root, ExtendedNode caller);\n" +
+ "package interfaces;\n" +
+ "import java.util.ArrayList;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "public interface ExtendedNode {\n" +
+ " ExtendedNode getParent();\n" +
+ " void setParent(ExtendedNode newParent);\n" +
+ " int numChildren();\n" +
+ " void mutateNode(ExtendedNode root);\n" +
+ " void getAllNodes(ArrayList<ExtendedNode> array);\n" +
+ " ExtendedNode getNode(int nodeIndex);\n" +
+ " <N extends ExtendedNode> void getNodesOfType(Class<N> desiredType,\n" +
+ " ArrayList<N> array);\n" +
+ " <N extends ExtendedNode> @Nullable N getRandomNodeOfType(\n" +
+ " Class<N> desiredType, ExtendedNode root, ExtendedNode caller);\n" +
"}\n",
"interfaces/ValueNode.java",
- "package interfaces;\n" +
- "public interface ValueNode extends ExtendedNode {\n" +
+ "package interfaces;\n" +
+ "public interface ValueNode extends ExtendedNode {\n" +
"}\n",
"framework/package-info.java",
- "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
"package framework;\n",
"framework/BinaryOpNode.java",
- "package framework;\n" +
- "\n" +
- "import interfaces.CopyableNode;\n" +
- "import interfaces.ValueNode;\n" +
- "public abstract class BinaryOpNode<T extends ValueNode & CopyableNode<T>, O>\n" +
- " extends EqualBinaryNode<T> implements ValueNode {\n" +
- " @SuppressWarnings(\"unused\") private O op;\n" +
- " \n" +
- " protected BinaryOpNode(final T left, @org.eclipse.jdt.annotation.NonNull final O op, final T right) {\n" +
- " super(left, right);\n" +
- " this.op = op;\n" +
- " }\n" +
+ "package framework;\n" +
+ "\n" +
+ "import interfaces.CopyableNode;\n" +
+ "import interfaces.ValueNode;\n" +
+ "public abstract class BinaryOpNode<T extends ValueNode & CopyableNode<T>, O>\n" +
+ " extends EqualBinaryNode<T> implements ValueNode {\n" +
+ " @SuppressWarnings(\"unused\") private O op;\n" +
+ " \n" +
+ " protected BinaryOpNode(final T left, @org.eclipse.jdt.annotation.NonNull final O op, final T right) {\n" +
+ " super(left, right);\n" +
+ " this.op = op;\n" +
+ " }\n" +
"}\n",
"framework/EqualBinaryNode.java",
- "package framework;\n" +
- "\n" +
- "import interfaces.CopyableNode;\n" +
- "import interfaces.ExtendedNode;\n" +
- "public abstract class EqualBinaryNode<T extends ExtendedNode & CopyableNode<T>>\n" +
- " implements ExtendedNode {\n" +
- " protected T left;\n" +
- " protected T right;\n" +
- " \n" +
- " protected EqualBinaryNode(final T left, final T right) {\n" +
- " this.left = left;\n" +
- " this.right = right;\n" +
- " }\n" +
+ "package framework;\n" +
+ "\n" +
+ "import interfaces.CopyableNode;\n" +
+ "import interfaces.ExtendedNode;\n" +
+ "public abstract class EqualBinaryNode<T extends ExtendedNode & CopyableNode<T>>\n" +
+ " implements ExtendedNode {\n" +
+ " protected T left;\n" +
+ " protected T right;\n" +
+ " \n" +
+ " protected EqualBinaryNode(final T left, final T right) {\n" +
+ " this.left = left;\n" +
+ " this.right = right;\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -6561,14 +6561,14 @@ public void testBug440462() {
runConformTestWithLibs(
new String[]{
"CompilerError.java",
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "import java.util.*;\n" +
- "@NonNullByDefault\n" +
- "public class CompilerError {\n" +
- "\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "import java.util.*;\n" +
+ "@NonNullByDefault\n" +
+ "public class CompilerError {\n" +
+ "\n" +
" List<@Nullable ? extends Integer> list = new ArrayList<@Nullable Integer>();\n" + // FIXME: should be able to use diamond!
- "\n" +
+ "\n" +
"}\n"
},
getCompilerOptions(),
@@ -6578,28 +6578,28 @@ public void testBug440773() {
runConformTestWithLibs(
new String[] {
"CountingComparator.java",
- "import java.util.Comparator;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "\n" +
- "@NonNullByDefault\n" +
- "public class CountingComparator<T> implements Comparator<T> {\n" +
- "\n" +
- " private int m_accessCount = 0;\n" +
- "\n" +
- " private final Comparator<T> m_wrapped;\n" +
- "\n" +
- " public CountingComparator(final Comparator<T> wrapped) {\n" +
- " m_wrapped = wrapped;\n" +
- " }\n" +
- "\n" +
- " @Override\n" +
- " @NonNullByDefault(DefaultLocation.RETURN_TYPE)\n" +
- " public int compare(final T element1, final T element2) {\n" +
- " m_accessCount++;\n" +
- " return m_wrapped.compare(element1, element2);\n" +
- " }\n" +
+ "import java.util.Comparator;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "\n" +
+ "@NonNullByDefault\n" +
+ "public class CountingComparator<T> implements Comparator<T> {\n" +
+ "\n" +
+ " private int m_accessCount = 0;\n" +
+ "\n" +
+ " private final Comparator<T> m_wrapped;\n" +
+ "\n" +
+ " public CountingComparator(final Comparator<T> wrapped) {\n" +
+ " m_wrapped = wrapped;\n" +
+ " }\n" +
+ "\n" +
+ " @Override\n" +
+ " @NonNullByDefault(DefaultLocation.RETURN_TYPE)\n" +
+ " public int compare(final T element1, final T element2) {\n" +
+ " m_accessCount++;\n" +
+ " return m_wrapped.compare(element1, element2);\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -6609,17 +6609,17 @@ public void testBug439298_comment2() {
runConformTestWithLibs(
new String[] {
"Extract.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "class R<T> {\n" +
- " R(@Nullable T t) {}\n" +
- "}\n" +
- "class A {}\n" +
- "@NonNullByDefault\n" +
- "public class Extract {\n" +
- " R<A> test() {\n" +
- " return new R<A>(null);\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "class R<T> {\n" +
+ " R(@Nullable T t) {}\n" +
+ "}\n" +
+ "class A {}\n" +
+ "@NonNullByDefault\n" +
+ "public class Extract {\n" +
+ " R<A> test() {\n" +
+ " return new R<A>(null);\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -6630,40 +6630,40 @@ public void testBug439298_comment3() {
true,
new String[] {
"Extract.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "class R<T> {\n" +
- " R(@Nullable T t) {}\n" +
- "}\n" +
- "class A {}\n" +
- "public class Extract {\n" +
- " R<A> test() {\n" +
- " return new R<@NonNull A>(null);\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "class R<T> {\n" +
+ " R(@Nullable T t) {}\n" +
+ "}\n" +
+ "class A {}\n" +
+ "public class Extract {\n" +
+ " R<A> test() {\n" +
+ " return new R<@NonNull A>(null);\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. INFO in Extract.java (at line 9)\n" +
- " return new R<@NonNull A>(null);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unsafe null type conversion (type annotations): The value of type '@NonNull R<@NonNull A>' is made accessible using the less-annotated type 'R<A>'\n" +
+ "----------\n" +
+ "1. INFO in Extract.java (at line 9)\n" +
+ " return new R<@NonNull A>(null);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unsafe null type conversion (type annotations): The value of type '@NonNull R<@NonNull A>' is made accessible using the less-annotated type 'R<A>'\n" +
"----------\n");
}
public void testBug439298_comment4() {
runConformTestWithLibs(
new String[] {
"Extract.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "class R<T> {\n" +
- " R(@Nullable T t) {}\n" +
- "}\n" +
- "class A {}\n" +
- "public class Extract {\n" +
- " R<@NonNull A> test() {\n" +
- " return new R<>(null);\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "class R<T> {\n" +
+ " R(@Nullable T t) {}\n" +
+ "}\n" +
+ "class A {}\n" +
+ "public class Extract {\n" +
+ " R<@NonNull A> test() {\n" +
+ " return new R<>(null);\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -6675,36 +6675,36 @@ public void testBug440764() {
runNegativeTestWithLibs(
new String[] {
"Extract.java",
- "import java.util.Comparator;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "@NonNullByDefault({ DefaultLocation.TYPE_PARAMETER })\n" +
+ "import java.util.Comparator;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "@NonNullByDefault({ DefaultLocation.TYPE_PARAMETER })\n" +
"public class Extract<T> implements Comparator<@NonNull T> {\n" + // FIXME: annot on 'T' shouldn't be needed
- " public Extract(Comparator<T> wrapped) {\n" +
- " }\n" +
- "\n" +
- " @Override\n" +
- " public int compare(T o1, T o2) {\n" +
- " return 0;\n" +
- " }\n" +
- " \n" +
- " void test(final Comparator<@Nullable Integer> c) {\n" +
- " new Extract<>(c).compare(1, null);\n" +
- " }\n" +
+ " public Extract(Comparator<T> wrapped) {\n" +
+ " }\n" +
+ "\n" +
+ " @Override\n" +
+ " public int compare(T o1, T o2) {\n" +
+ " return 0;\n" +
+ " }\n" +
+ " \n" +
+ " void test(final Comparator<@Nullable Integer> c) {\n" +
+ " new Extract<>(c).compare(1, null);\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in Extract.java (at line 16)\n" +
- " new Extract<>(c).compare(1, null);\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'Comparator<@NonNull Integer>\' but this expression has type \'Comparator<@Nullable Integer>\'\n" +
- "----------\n" +
- "2. ERROR in Extract.java (at line 16)\n" +
- " new Extract<>(c).compare(1, null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Integer\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in Extract.java (at line 16)\n" +
+ " new Extract<>(c).compare(1, null);\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'Comparator<@NonNull Integer>\' but this expression has type \'Comparator<@Nullable Integer>\'\n" +
+ "----------\n" +
+ "2. ERROR in Extract.java (at line 16)\n" +
+ " new Extract<>(c).compare(1, null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Integer\' but the provided value is null\n" +
"----------\n");
}
public void testBug440759a() {
@@ -6721,16 +6721,16 @@ public void testBug440759a() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " @NonNull T localT = t; // err#1\n" +
- " ^\n" +
- "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " return null; // err must mention free type variable, not @NonNull\n" +
- " ^^^^\n" +
- "Null type mismatch (type annotations): \'null\' is not compatible to the free type variable \'T\'\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " @NonNull T localT = t; // err#1\n" +
+ " ^\n" +
+ "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " return null; // err must mention free type variable, not @NonNull\n" +
+ " ^^^^\n" +
+ "Null type mismatch (type annotations): \'null\' is not compatible to the free type variable \'T\'\n" +
"----------\n");
}
// involves overriding, work done in ImplicitNullAnnotationVerifier.checkNullSpecInheritance()
@@ -6751,32 +6751,32 @@ public void testBug440759b() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " @NonNull T localT = t; // err#1\n" +
- " ^\n" +
- "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " return null; // err must mention free type variable, not @NonNull\n" +
- " ^^^^\n" +
- "Null type mismatch (type annotations): \'null\' is not compatible to the free type variable \'T\'\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " @NonNull T localT = t; // err#1\n" +
+ " ^\n" +
+ "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " return null; // err must mention free type variable, not @NonNull\n" +
+ " ^^^^\n" +
+ "Null type mismatch (type annotations): \'null\' is not compatible to the free type variable \'T\'\n" +
"----------\n");
}
public void testBug438383() {
runConformTestWithLibs(
new String[] {
"Foo.java",
- "import java.util.*;\n" +
- "import java.util.function.Supplier;\n" +
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "\n" +
- "@NonNullByDefault public class Foo {\n" +
- " static void foo(Supplier<List<?>> f) { }\n" +
- " \n" +
- " static void test() {\n" +
- " foo(ArrayList::new);\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "import java.util.function.Supplier;\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "\n" +
+ "@NonNullByDefault public class Foo {\n" +
+ " static void foo(Supplier<List<?>> f) { }\n" +
+ " \n" +
+ " static void test() {\n" +
+ " foo(ArrayList::new);\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -6788,9 +6788,9 @@ public void testBug437270() {
"Foo.java",
"import org.eclipse.jdt.annotation.*;\n" +
"public class Foo {\n" +
- " void test(String[] arguments) {\n" +
- " if (arguments != null) {\n" +
- " String @NonNull [] temp = arguments;\n" +
+ " void test(String[] arguments) {\n" +
+ " if (arguments != null) {\n" +
+ " String @NonNull [] temp = arguments;\n" +
" }\n" +
" }\n" +
"}\n"
@@ -6804,16 +6804,16 @@ public void testBug437270_comment3() {
"Foo.java",
"import org.eclipse.jdt.annotation.*;\n" +
"public class Foo {\n" +
- " void test() {\n" +
- " @NonNull Object b = new Object();\n" +
- " Object @NonNull[] c = { new Object() };\n" +
- " \n" +
- " test2( b );\n" +
- " test3( c );\n" +
- " }\n" +
- " \n" +
- " void test2(@Nullable Object z) { }\n" +
- " \n" +
+ " void test() {\n" +
+ " @NonNull Object b = new Object();\n" +
+ " Object @NonNull[] c = { new Object() };\n" +
+ " \n" +
+ " test2( b );\n" +
+ " test3( c );\n" +
+ " }\n" +
+ " \n" +
+ " void test2(@Nullable Object z) { }\n" +
+ " \n" +
" void test3(Object @Nullable[] z) { }\n" +
"}\n"
},
@@ -6825,22 +6825,22 @@ public void testBug435841() {
new String[] {
"ArrayProblem.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "@NonNullByDefault\n" +
- "public class ArrayProblem {\n" +
- " private String[] data = new String[0];\n" +
- " \n" +
- " void error1() {\n" +
- " foo(data); // Compiler error: required 'String @Nullable[]', but this expression has type 'String @NonNull[]'\n" +
- " }\n" +
- " \n" +
- " private String[] foo(String @Nullable[] input) {\n" +
- " return new String[0];\n" +
- " }\n" +
- " \n" +
- " String @Nullable[] error2() {\n" +
- " String @NonNull[] nonnull = new String[0];\n" +
- " return nonnull; // Compiler error: required 'String @Nullable[]' but this expression has type 'String @NonNull[]'\n" +
- " }\n" +
+ "@NonNullByDefault\n" +
+ "public class ArrayProblem {\n" +
+ " private String[] data = new String[0];\n" +
+ " \n" +
+ " void error1() {\n" +
+ " foo(data); // Compiler error: required 'String @Nullable[]', but this expression has type 'String @NonNull[]'\n" +
+ " }\n" +
+ " \n" +
+ " private String[] foo(String @Nullable[] input) {\n" +
+ " return new String[0];\n" +
+ " }\n" +
+ " \n" +
+ " String @Nullable[] error2() {\n" +
+ " String @NonNull[] nonnull = new String[0];\n" +
+ " return nonnull; // Compiler error: required 'String @Nullable[]' but this expression has type 'String @NonNull[]'\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -6850,20 +6850,20 @@ public void testBug441693() {
runConformTestWithLibs(
new String[] {
"Foo.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "@NonNullByDefault({})\n" +
- "public abstract class Foo {\n" +
- " \n" +
- " abstract <T> @NonNull T requireNonNull(@Nullable T obj);\n" +
- " \n" +
- " @NonNull Iterable<@NonNull String> iterable;\n" +
- " \n" +
- " Foo(@Nullable Iterable<@NonNull String> iterable) {\n" +
- " this.iterable = requireNonNull(iterable); // (*)\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "@NonNullByDefault({})\n" +
+ "public abstract class Foo {\n" +
+ " \n" +
+ " abstract <T> @NonNull T requireNonNull(@Nullable T obj);\n" +
+ " \n" +
+ " @NonNull Iterable<@NonNull String> iterable;\n" +
+ " \n" +
+ " Foo(@Nullable Iterable<@NonNull String> iterable) {\n" +
+ " this.iterable = requireNonNull(iterable); // (*)\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -6873,45 +6873,45 @@ public void testBug441693other() {
runNegativeTestWithLibs(
new String[] {
"Foo.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
"import org.eclipse.jdt.annotation.Nullable;\n" +
- "import java.util.*;\n" +
- "\n" +
- "@NonNullByDefault({})\n" +
- "public abstract class Foo {\n" +
- " \n" +
- " abstract <T> @NonNull T requireNonNull(@Nullable T obj);\n" +
- " \n" +
- " @NonNull String @NonNull[] array;\n" +
- " \n" +
- " Foo(@NonNull String @Nullable[] arr) {\n" +
- " this.array = requireNonNull(arr); // (*)\n" +
+ "import java.util.*;\n" +
+ "\n" +
+ "@NonNullByDefault({})\n" +
+ "public abstract class Foo {\n" +
+ " \n" +
+ " abstract <T> @NonNull T requireNonNull(@Nullable T obj);\n" +
+ " \n" +
+ " @NonNull String @NonNull[] array;\n" +
+ " \n" +
+ " Foo(@NonNull String @Nullable[] arr) {\n" +
+ " this.array = requireNonNull(arr); // (*)\n" +
" }\n" +
" @NonNull Foo testWild1(@Nullable List<? extends @NonNull Foo> foos) {\n" +
" return requireNonNull(foos).get(0);\n" +
- " }\n" +
+ " }\n" +
" @NonNull Foo testWild2(@Nullable List<@Nullable ? extends List<@NonNull Foo>> foos) {\n" +
" return requireNonNull(foos.get(0)).get(0);\n" +
- " }\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. INFO in Foo.java (at line 17)\n" +
- " return requireNonNull(foos).get(0);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'@NonNull List<capture#of ? extends @NonNull Foo>\'. Type \'List<E>\' doesn\'t seem to be designed with null type annotations in mind\n" +
- "----------\n" +
- "2. INFO in Foo.java (at line 20)\n" +
- " return requireNonNull(foos.get(0)).get(0);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'List<@NonNull Foo>\'. Type \'List<E>\' doesn\'t seem to be designed with null type annotations in mind\n" +
- "----------\n" +
- "3. ERROR in Foo.java (at line 20)\n" +
- " return requireNonNull(foos.get(0)).get(0);\n" +
- " ^^^^\n" +
- "Potential null pointer access: this expression has a \'@Nullable\' type\n" +
+ "----------\n" +
+ "1. INFO in Foo.java (at line 17)\n" +
+ " return requireNonNull(foos).get(0);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'@NonNull List<capture#of ? extends @NonNull Foo>\'. Type \'List<E>\' doesn\'t seem to be designed with null type annotations in mind\n" +
+ "----------\n" +
+ "2. INFO in Foo.java (at line 20)\n" +
+ " return requireNonNull(foos.get(0)).get(0);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'List<@NonNull Foo>\'. Type \'List<E>\' doesn\'t seem to be designed with null type annotations in mind\n" +
+ "----------\n" +
+ "3. ERROR in Foo.java (at line 20)\n" +
+ " return requireNonNull(foos.get(0)).get(0);\n" +
+ " ^^^^\n" +
+ "Potential null pointer access: this expression has a \'@Nullable\' type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=439158, [1.8][compiler][null] Adding null annotation to return type causes IllegalStateException and sometimes InvocationTargetException
@@ -6919,25 +6919,25 @@ public void testBug439158() {
runConformTestWithLibs(
new String[] {
"Test.java",
- "import java.util.Collection;\n" +
- "import java.util.List;\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.List;\n" +
"import java.util.Set;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public class Test {\n" +
- " class X {\n" +
- " \n" +
- " }\n" +
- " \n" +
- " public static <C extends Collection<?>, A extends C, B extends C>\n" +
- " @Nullable A transform(B arg) {\n" +
- " return null;\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " List<X> list = null;\n" +
- " Set<X> result = transform(list);\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " class X {\n" +
+ " \n" +
+ " }\n" +
+ " \n" +
+ " public static <C extends Collection<?>, A extends C, B extends C>\n" +
+ " @Nullable A transform(B arg) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " List<X> list = null;\n" +
+ " Set<X> result = transform(list);\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -6989,16 +6989,16 @@ public void testBug434579() {
"}\n"
},
options,
- "----------\n" +
- "1. ERROR in UnequalBinaryNode.java (at line 8)\n" +
- " left.setParent(this);\n" +
- " ^^^^\n" +
- "Potential null pointer access: this expression has type \'L\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "2. ERROR in UnequalBinaryNode.java (at line 9)\n" +
- " right.setParent(this); // error on this line without fix\n" +
- " ^^^^^\n" +
- "Potential null pointer access: this expression has type \'R\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "1. ERROR in UnequalBinaryNode.java (at line 8)\n" +
+ " left.setParent(this);\n" +
+ " ^^^^\n" +
+ "Potential null pointer access: this expression has type \'L\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "2. ERROR in UnequalBinaryNode.java (at line 9)\n" +
+ " right.setParent(this); // error on this line without fix\n" +
+ " ^^^^^\n" +
+ "Potential null pointer access: this expression has type \'R\', a free type variable that may represent a \'@Nullable\' type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=434582,
@@ -7082,11 +7082,11 @@ public void test443467() throws Exception {
"}\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in BuildIdeMain.java (at line 9)\n" +
- " filter2.map(p -> new SimpleEntry<>(updateToFile.get(p), p->ideFiles.get(p)));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot infer type arguments for SimpleEntry<>\n" +
+ "----------\n" +
+ "1. ERROR in BuildIdeMain.java (at line 9)\n" +
+ " filter2.map(p -> new SimpleEntry<>(updateToFile.get(p), p->ideFiles.get(p)));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for SimpleEntry<>\n" +
"----------\n",
this.LIBS,
true/*flush*/);
@@ -7095,27 +7095,27 @@ public void testBug445227() {
runConformTestWithLibs(
new String[] {
"Bar.java",
- "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
- "class Bar<E extends Bar.Foo<E>> {\n" +
- " final Iterable<E> list;\n" +
- "\n" +
- " Bar() {\n" +
- " this((Iterable<E>) emptyList());\n" +
- " }\n" +
- "\n" +
- " Bar(Iterable<E> list) { this.list = list; }\n" +
- "\n" +
- " private static <X extends Foo<X>> Iterable<X> emptyList() { throw new UnsupportedOperationException(); }\n" +
- "\n" +
- " interface Foo<F extends Foo<F>> { }\n" +
+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ "class Bar<E extends Bar.Foo<E>> {\n" +
+ " final Iterable<E> list;\n" +
+ "\n" +
+ " Bar() {\n" +
+ " this((Iterable<E>) emptyList());\n" +
+ " }\n" +
+ "\n" +
+ " Bar(Iterable<E> list) { this.list = list; }\n" +
+ "\n" +
+ " private static <X extends Foo<X>> Iterable<X> emptyList() { throw new UnsupportedOperationException(); }\n" +
+ "\n" +
+ " interface Foo<F extends Foo<F>> { }\n" +
"}\n"
- },
- getCompilerOptions(),
- "----------\n" +
- "1. WARNING in Bar.java (at line 6)\n" +
- " this((Iterable<E>) emptyList());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from Iterable<Bar.Foo<Bar.Foo<X>>> to Iterable<E>\n" +
+ },
+ getCompilerOptions(),
+ "----------\n" +
+ "1. WARNING in Bar.java (at line 6)\n" +
+ " this((Iterable<E>) emptyList());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from Iterable<Bar.Foo<Bar.Foo<X>>> to Iterable<E>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=446715, [compiler] org.eclipse.jdt.internal.compiler.lookup.TypeSystem.cacheDerivedType
@@ -7147,11 +7147,11 @@ public void test446715() {
"}\n"
},
options,
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " y.zz = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'Z.ZI @NonNull[]\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " y.zz = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'Z.ZI @NonNull[]\' but the provided value is null\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=445669, java.lang.IllegalStateException at org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.clone
@@ -7186,16 +7186,16 @@ public void test445669() {
"}\n"
},
options,
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " y.zzi = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'Z.@NonNull ZI\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " y.z = null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Z\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " y.zzi = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'Z.@NonNull ZI\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " y.z = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Z\' but the provided value is null\n" +
"----------\n");
}
public void testArrayOfArrays() {
@@ -7214,11 +7214,11 @@ public void testArrayOfArrays() {
"}\n",
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " String [] @Nullable [] @NonNull [] arr = new String[][][] {};\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String[][][]\' needs unchecked conversion to conform to \'String [] @Nullable[] @NonNull[]\'\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " String [] @Nullable [] @NonNull [] arr = new String[][][] {};\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String[][][]\' needs unchecked conversion to conform to \'String [] @Nullable[] @NonNull[]\'\n" +
"----------\n");
}
public void testBug447088() {
@@ -7241,51 +7241,51 @@ public void testBug448777() {
runNegativeTestWithLibs(
new String[] {
"DoubleInference.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public class DoubleInference {\n" +
- "\n" +
- " @FunctionalInterface\n" +
- " interface Func<@Nullable T> {\n" +
- " T a(T i);\n" +
- " }\n" +
- "\n" +
- " <X> X applyWith(Func<X> f, X x) { return x; }\n" +
- "\n" +
- " @NonNull String test1() {\n" +
- " return applyWith(i -> i, \"hallo\");\n" +
- " }\n" +
- " void test2(Func<String> f1, Func<@NonNull String> f2) {\n" +
- " f1.a(null);\n" +
- " f2.a(null);\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "public class DoubleInference {\n" +
+ "\n" +
+ " @FunctionalInterface\n" +
+ " interface Func<@Nullable T> {\n" +
+ " T a(T i);\n" +
+ " }\n" +
+ "\n" +
+ " <X> X applyWith(Func<X> f, X x) { return x; }\n" +
+ "\n" +
+ " @NonNull String test1() {\n" +
+ " return applyWith(i -> i, \"hallo\");\n" +
+ " }\n" +
+ " void test2(Func<String> f1, Func<@NonNull String> f2) {\n" +
+ " f1.a(null);\n" +
+ " f2.a(null);\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in DoubleInference.java (at line 10)\n" +
- " <X> X applyWith(Func<X> f, X x) { return x; }\n" +
- " ^\n" +
- "Null constraint mismatch: The type \'X\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
- "----------\n" +
- "2. ERROR in DoubleInference.java (at line 13)\n" +
- " return applyWith(i -> i, \"hallo\");\n" +
- " ^^^^^^\n" +
- "Contradictory null annotations: function type was inferred as \'@Nullable @NonNull String (@Nullable @NonNull String)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
- "----------\n" +
- "3. ERROR in DoubleInference.java (at line 15)\n" +
- " void test2(Func<String> f1, Func<@NonNull String> f2) {\n" +
- " ^^^^^^\n" +
- "Null constraint mismatch: The type \'String\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
- "----------\n" +
- "4. ERROR in DoubleInference.java (at line 15)\n" +
- " void test2(Func<String> f1, Func<@NonNull String> f2) {\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@NonNull String\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
- "----------\n" +
- "5. ERROR in DoubleInference.java (at line 17)\n" +
- " f2.a(null);\n" +
- " ^^^^^^^^^^\n" +
- "Contradictory null annotations: method was inferred as \'@Nullable @NonNull String a(@Nullable @NonNull String)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
+ "----------\n" +
+ "1. ERROR in DoubleInference.java (at line 10)\n" +
+ " <X> X applyWith(Func<X> f, X x) { return x; }\n" +
+ " ^\n" +
+ "Null constraint mismatch: The type \'X\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "2. ERROR in DoubleInference.java (at line 13)\n" +
+ " return applyWith(i -> i, \"hallo\");\n" +
+ " ^^^^^^\n" +
+ "Contradictory null annotations: function type was inferred as \'@Nullable @NonNull String (@Nullable @NonNull String)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
+ "----------\n" +
+ "3. ERROR in DoubleInference.java (at line 15)\n" +
+ " void test2(Func<String> f1, Func<@NonNull String> f2) {\n" +
+ " ^^^^^^\n" +
+ "Null constraint mismatch: The type \'String\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "4. ERROR in DoubleInference.java (at line 15)\n" +
+ " void test2(Func<String> f1, Func<@NonNull String> f2) {\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@NonNull String\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "5. ERROR in DoubleInference.java (at line 17)\n" +
+ " f2.a(null);\n" +
+ " ^^^^^^^^^^\n" +
+ "Contradictory null annotations: method was inferred as \'@Nullable @NonNull String a(@Nullable @NonNull String)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
"----------\n");
}
public void testBug446442_comment2a() {
@@ -7293,29 +7293,29 @@ public void testBug446442_comment2a() {
new String[] {
"Test.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "interface Foo<T, N extends Number> {\n" +
- " void m(@NonNull N arg2);\n" +
- "\n" +
- " void m(@Nullable T arg1);\n" +
- "}\n" +
- "\n" +
- "interface Baz extends Foo<Integer, Integer> {}\n" +
- "\n" +
- "class Impl implements Baz {\n" +
- " public void m(@NonNull Integer i) {}\n" +
- "}\n" +
- "\n" +
- "public class Test {\n" +
- " Baz baz= x -> {\n" +
- " x= null;\n" +
- " }; \n" +
+ "interface Foo<T, N extends Number> {\n" +
+ " void m(@NonNull N arg2);\n" +
+ "\n" +
+ " void m(@Nullable T arg1);\n" +
+ "}\n" +
+ "\n" +
+ "interface Baz extends Foo<Integer, Integer> {}\n" +
+ "\n" +
+ "class Impl implements Baz {\n" +
+ " public void m(@NonNull Integer i) {}\n" +
+ "}\n" +
+ "\n" +
+ "public class Test {\n" +
+ " Baz baz= x -> {\n" +
+ " x= null;\n" +
+ " }; \n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 11)\n" +
- " public void m(@NonNull Integer i) {}\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Illegal redefinition of parameter i, inherited method from Foo<Integer,Integer> declares this parameter as @Nullable\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 11)\n" +
+ " public void m(@NonNull Integer i) {}\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Illegal redefinition of parameter i, inherited method from Foo<Integer,Integer> declares this parameter as @Nullable\n" +
"----------\n");
}
// swapped order of method declarations
@@ -7324,29 +7324,29 @@ public void testBug446442_comment2b() {
new String[] {
"Test.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "interface Foo<T, N extends Number> {\n" +
- " void m(@Nullable T arg1);\n" +
- "\n" +
- " void m(@NonNull N arg2);\n" +
- "}\n" +
- "\n" +
- "interface Baz extends Foo<Integer, Integer> {}\n" +
- "\n" +
- "class Impl implements Baz {\n" +
- " public void m(@NonNull Integer i) {}\n" +
- "}\n" +
- "\n" +
- "public class Test {\n" +
- " Baz baz= x -> {\n" +
- " x= null;\n" +
- " }; \n" +
+ "interface Foo<T, N extends Number> {\n" +
+ " void m(@Nullable T arg1);\n" +
+ "\n" +
+ " void m(@NonNull N arg2);\n" +
+ "}\n" +
+ "\n" +
+ "interface Baz extends Foo<Integer, Integer> {}\n" +
+ "\n" +
+ "class Impl implements Baz {\n" +
+ " public void m(@NonNull Integer i) {}\n" +
+ "}\n" +
+ "\n" +
+ "public class Test {\n" +
+ " Baz baz= x -> {\n" +
+ " x= null;\n" +
+ " }; \n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 11)\n" +
- " public void m(@NonNull Integer i) {}\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Illegal redefinition of parameter i, inherited method from Foo<Integer,Integer> declares this parameter as @Nullable\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 11)\n" +
+ " public void m(@NonNull Integer i) {}\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Illegal redefinition of parameter i, inherited method from Foo<Integer,Integer> declares this parameter as @Nullable\n" +
"----------\n");
}
// inherit from two different supers
@@ -7355,31 +7355,31 @@ public void testBug446442_comment2c() {
new String[] {
"Test.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "interface Foo0<T, N extends Number> {\n" +
- " void m(@Nullable T arg1);\n" +
- "}\n" +
- "\n" +
- "interface Foo1<T, N extends Number> {\n" +
- " void m(@NonNull N arg2);\n" +
- "}\n" +
- "\n" +
- "interface Baz extends Foo1<Integer, Integer>, Foo0<Integer, Integer> {}\n" +
- "\n" +
- "class Impl implements Baz {\n" +
- " public void m(@NonNull Integer i) {}\n" +
- "}\n" +
- "\n" +
- "public class Test {\n" +
- " Baz baz= x -> {\n" +
- " x= null;\n" +
- " }; \n" +
+ "interface Foo0<T, N extends Number> {\n" +
+ " void m(@Nullable T arg1);\n" +
+ "}\n" +
+ "\n" +
+ "interface Foo1<T, N extends Number> {\n" +
+ " void m(@NonNull N arg2);\n" +
+ "}\n" +
+ "\n" +
+ "interface Baz extends Foo1<Integer, Integer>, Foo0<Integer, Integer> {}\n" +
+ "\n" +
+ "class Impl implements Baz {\n" +
+ " public void m(@NonNull Integer i) {}\n" +
+ "}\n" +
+ "\n" +
+ "public class Test {\n" +
+ " Baz baz= x -> {\n" +
+ " x= null;\n" +
+ " }; \n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 13)\n" +
- " public void m(@NonNull Integer i) {}\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Illegal redefinition of parameter i, inherited method from Foo0<Integer,Integer> declares this parameter as @Nullable\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 13)\n" +
+ " public void m(@NonNull Integer i) {}\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Illegal redefinition of parameter i, inherited method from Foo0<Integer,Integer> declares this parameter as @Nullable\n" +
"----------\n");
}
// merging @NonNull & unannotated in arg-position must answer unannotated
@@ -7389,26 +7389,26 @@ public void testBug446442_2a() {
new String[] {
"Test.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "interface Foo<T, N extends Number> {\n" +
- " void m(@NonNull N arg2);\n" +
- "\n" +
- " void m(T arg1);\n" +
- "}\n" +
- "\n" +
- "interface Baz extends Foo<Integer, Integer> {}\n" +
- "\n" +
- "public class Test {\n" +
- " Baz baz= x -> {\n" +
- " @NonNull Object o = x;\n" +
- " }; \n" +
+ "interface Foo<T, N extends Number> {\n" +
+ " void m(@NonNull N arg2);\n" +
+ "\n" +
+ " void m(T arg1);\n" +
+ "}\n" +
+ "\n" +
+ "interface Baz extends Foo<Integer, Integer> {}\n" +
+ "\n" +
+ "public class Test {\n" +
+ " Baz baz= x -> {\n" +
+ " @NonNull Object o = x;\n" +
+ " }; \n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in Test.java (at line 12)\n" +
- " @NonNull Object o = x;\n" +
- " ^\n" +
- "Null type safety (type annotations): The expression of type \'Integer\' needs unchecked conversion to conform to \'@NonNull Object\'\n" +
+ "----------\n" +
+ "1. WARNING in Test.java (at line 12)\n" +
+ " @NonNull Object o = x;\n" +
+ " ^\n" +
+ "Null type safety (type annotations): The expression of type \'Integer\' needs unchecked conversion to conform to \'@NonNull Object\'\n" +
"----------\n");
}
// merging @NonNull & unannotated in arg-position must answer unannotated - swapped order
@@ -7418,26 +7418,26 @@ public void testBug446442_2b() {
new String[] {
"Test.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "interface Foo<T, N extends Number> {\n" +
- " void m(T arg1);\n" +
- "\n" +
- " void m(@NonNull N arg2);\n" +
- "}\n" +
- "\n" +
- "interface Baz extends Foo<Integer, Integer> {}\n" +
- "\n" +
- "public class Test {\n" +
- " Baz baz= x -> {\n" +
- " @NonNull Object o = x;\n" +
- " }; \n" +
+ "interface Foo<T, N extends Number> {\n" +
+ " void m(T arg1);\n" +
+ "\n" +
+ " void m(@NonNull N arg2);\n" +
+ "}\n" +
+ "\n" +
+ "interface Baz extends Foo<Integer, Integer> {}\n" +
+ "\n" +
+ "public class Test {\n" +
+ " Baz baz= x -> {\n" +
+ " @NonNull Object o = x;\n" +
+ " }; \n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in Test.java (at line 12)\n" +
- " @NonNull Object o = x;\n" +
- " ^\n" +
- "Null type safety (type annotations): The expression of type \'Integer\' needs unchecked conversion to conform to \'@NonNull Object\'\n" +
+ "----------\n" +
+ "1. WARNING in Test.java (at line 12)\n" +
+ " @NonNull Object o = x;\n" +
+ " ^\n" +
+ "Null type safety (type annotations): The expression of type \'Integer\' needs unchecked conversion to conform to \'@NonNull Object\'\n" +
"----------\n");
}
// using inherited implementation to fulfill both contracts
@@ -7445,23 +7445,23 @@ public void testBug446442_3() {
runConformTestWithLibs(
new String[] {
"Test.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "interface Foo<T, N extends Number> {\n" +
- " void m(@NonNull N arg2);\n" +
- "\n" +
- " void m(T arg1);\n" +
- "}\n" +
- "\n" +
- "interface Baz extends Foo<Integer, Integer> {}\n" +
- "class Impl {\n" +
- " public void m(Integer a) {}\n" +
- "}\n" +
- "class BazImpl extends Impl implements Baz {}\n" +
- "\n" +
- "public class Test {\n" +
- " void test(BazImpl b) {\n" +
- " b.m(null);\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "interface Foo<T, N extends Number> {\n" +
+ " void m(@NonNull N arg2);\n" +
+ "\n" +
+ " void m(T arg1);\n" +
+ "}\n" +
+ "\n" +
+ "interface Baz extends Foo<Integer, Integer> {}\n" +
+ "class Impl {\n" +
+ " public void m(Integer a) {}\n" +
+ "}\n" +
+ "class BazImpl extends Impl implements Baz {}\n" +
+ "\n" +
+ "public class Test {\n" +
+ " void test(BazImpl b) {\n" +
+ " b.m(null);\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -7472,23 +7472,23 @@ public void testBug446442_4() {
runConformTestWithLibs(
new String[] {
"Test.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "interface Foo<T, N extends Number> {\n" +
- " abstract void m(@NonNull N arg2) throws Exception;\n" +
- "\n" +
- " default void m(T arg1) throws java.io.IOException {}\n" +
- "}\n" +
- "\n" +
- "interface Baz extends Foo<Integer, Integer> {}\n" +
- "abstract class Impl {\n" +
- " public void m(Integer a) throws java.io.IOException {}\n" +
- "}\n" +
- "class BazImpl extends Impl implements Baz {}\n" +
- "\n" +
- "public class Test {\n" +
- " void test(BazImpl b) throws java.io.IOException {\n" +
- " b.m(null);\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "interface Foo<T, N extends Number> {\n" +
+ " abstract void m(@NonNull N arg2) throws Exception;\n" +
+ "\n" +
+ " default void m(T arg1) throws java.io.IOException {}\n" +
+ "}\n" +
+ "\n" +
+ "interface Baz extends Foo<Integer, Integer> {}\n" +
+ "abstract class Impl {\n" +
+ " public void m(Integer a) throws java.io.IOException {}\n" +
+ "}\n" +
+ "class BazImpl extends Impl implements Baz {}\n" +
+ "\n" +
+ "public class Test {\n" +
+ " void test(BazImpl b) throws java.io.IOException {\n" +
+ " b.m(null);\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -7500,32 +7500,32 @@ public void testBug446442_5() {
new String[] {
"Test.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "interface Foo<T, N extends Number> {\n" +
- " T m(T t);\n" +
- "\n" +
- " @NonNull N m(N n);\n" +
- "}\n" +
- "\n" +
- "interface Baz extends Foo<Integer, Integer> {}\n" +
- "\n" +
- "class Impl implements Baz {\n" +
- " public Integer m(Integer i) { return Integer.valueOf(0); }\n" +
- "}\n" +
- "\n" +
- "public class Test {\n" +
- " Baz baz= x -> null;\n" +
+ "interface Foo<T, N extends Number> {\n" +
+ " T m(T t);\n" +
+ "\n" +
+ " @NonNull N m(N n);\n" +
+ "}\n" +
+ "\n" +
+ "interface Baz extends Foo<Integer, Integer> {}\n" +
+ "\n" +
+ "class Impl implements Baz {\n" +
+ " public Integer m(Integer i) { return Integer.valueOf(0); }\n" +
+ "}\n" +
+ "\n" +
+ "public class Test {\n" +
+ " Baz baz= x -> null;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 11)\n" +
- " public Integer m(Integer i) { return Integer.valueOf(0); }\n" +
- " ^^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Integer\' returned from Foo<Integer,Integer>.m(Integer) (mismatching null constraints)\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 15)\n" +
- " Baz baz= x -> null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Integer\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 11)\n" +
+ " public Integer m(Integer i) { return Integer.valueOf(0); }\n" +
+ " ^^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Integer\' returned from Foo<Integer,Integer>.m(Integer) (mismatching null constraints)\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 15)\n" +
+ " Baz baz= x -> null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Integer\' but the provided value is null\n" +
"----------\n");
}
// conflicting annotations on type arguments
@@ -7535,41 +7535,41 @@ public void testBug446442_6a() {
"Test.java",
"import org.eclipse.jdt.annotation.*;\n" +
"import java.util.*;\n" +
- "interface Foo<T,C1 extends Collection<T>, C2 extends List<T>> {\n" +
- " void m(C1 a1);\n" +
- "\n" +
- " void m(C2 a2);\n" +
- "}\n" +
- "\n" +
- "interface Baz extends Foo<Integer, ArrayList<@NonNull Integer>, ArrayList<@Nullable Integer>> {}\n" +
- "\n" +
- "class Impl implements Baz {\n" +
+ "interface Foo<T,C1 extends Collection<T>, C2 extends List<T>> {\n" +
+ " void m(C1 a1);\n" +
+ "\n" +
+ " void m(C2 a2);\n" +
+ "}\n" +
+ "\n" +
+ "interface Baz extends Foo<Integer, ArrayList<@NonNull Integer>, ArrayList<@Nullable Integer>> {}\n" +
+ "\n" +
+ "class Impl implements Baz {\n" +
" public void m(ArrayList<@NonNull Integer> i) {} // contradictory type cannot be implemented\n" +
"}\n" +
- "\n" +
- "public class Test {\n" +
+ "\n" +
+ "public class Test {\n" +
" Baz baz= x -> { // contradictory type cannot be used as SAM\n" +
" x.add(null); // contradictory type cause errors at call sites\n" +
- " }; \n" +
+ " }; \n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 12)\n" +
- " public void m(ArrayList<@NonNull Integer> i) {} // contradictory type cannot be implemented\n" +
- " ^^^^^^^^^\n" +
- "Illegal redefinition of parameter i, inherited method from Foo<Integer,ArrayList<Integer>,ArrayList<Integer>> declares this parameter as \'ArrayList<@Nullable Integer>\' (mismatching null constraints)\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 16)\n" +
- " Baz baz= x -> { // contradictory type cannot be used as SAM\n" +
- " x.add(null); // contradictory type cause errors at call sites\n" +
- " }; \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Contradictory null annotations: function type was inferred as \'void (ArrayList<@NonNull @Nullable Integer>)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 17)\n" +
- " x.add(null); // contradictory type cause errors at call sites\n" +
- " ^^^^^^^^^^^\n" +
- "Contradictory null annotations: method was inferred as \'boolean add(@NonNull @Nullable Integer)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 12)\n" +
+ " public void m(ArrayList<@NonNull Integer> i) {} // contradictory type cannot be implemented\n" +
+ " ^^^^^^^^^\n" +
+ "Illegal redefinition of parameter i, inherited method from Foo<Integer,ArrayList<Integer>,ArrayList<Integer>> declares this parameter as \'ArrayList<@Nullable Integer>\' (mismatching null constraints)\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 16)\n" +
+ " Baz baz= x -> { // contradictory type cannot be used as SAM\n" +
+ " x.add(null); // contradictory type cause errors at call sites\n" +
+ " }; \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Contradictory null annotations: function type was inferred as \'void (ArrayList<@NonNull @Nullable Integer>)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 17)\n" +
+ " x.add(null); // contradictory type cause errors at call sites\n" +
+ " ^^^^^^^^^^^\n" +
+ "Contradictory null annotations: method was inferred as \'boolean add(@NonNull @Nullable Integer)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
"----------\n");
}
// swapped order of method declarations + added return type
@@ -7579,88 +7579,88 @@ public void testBug446442_6b() {
"Test.java",
"import org.eclipse.jdt.annotation.*;\n" +
"import java.util.*;\n" +
- "interface Foo<T,C1 extends Collection<T>, C2 extends List<T>> {\n" +
- " C2 m(C2 a2);\n" +
- "\n" +
- " C1 m(C1 a1);\n" +
- "}\n" +
- "\n" +
- "interface Baz extends Foo<Integer, ArrayList<@NonNull Integer>, ArrayList<@Nullable Integer>> {}\n" +
- "\n" +
- "class Impl implements Baz {\n" +
- " public ArrayList<@NonNull Integer> m(ArrayList<@Nullable Integer> i) { return i; }\n" +
- "}\n" +
- "\n" +
- "public class Test {\n" +
- " Baz baz= x -> {\n" +
+ "interface Foo<T,C1 extends Collection<T>, C2 extends List<T>> {\n" +
+ " C2 m(C2 a2);\n" +
+ "\n" +
+ " C1 m(C1 a1);\n" +
+ "}\n" +
+ "\n" +
+ "interface Baz extends Foo<Integer, ArrayList<@NonNull Integer>, ArrayList<@Nullable Integer>> {}\n" +
+ "\n" +
+ "class Impl implements Baz {\n" +
+ " public ArrayList<@NonNull Integer> m(ArrayList<@Nullable Integer> i) { return i; }\n" +
+ "}\n" +
+ "\n" +
+ "public class Test {\n" +
+ " Baz baz= x -> {\n" +
" x.add(null);\n" +
" x.get(0);\n" +
- " return x;\n" +
- " };\n" +
+ " return x;\n" +
+ " };\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 12)\n" +
- " public ArrayList<@NonNull Integer> m(ArrayList<@Nullable Integer> i) { return i; }\n" +
- " ^^^^^^^^^\n" +
- "The return type is incompatible with \'ArrayList<@Nullable Integer>\' returned from Foo<Integer,ArrayList<Integer>,ArrayList<Integer>>.m(ArrayList<Integer>) (mismatching null constraints)\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 12)\n" +
- " public ArrayList<@NonNull Integer> m(ArrayList<@Nullable Integer> i) { return i; }\n" +
- " ^^^^^^^^^\n" +
- "Illegal redefinition of parameter i, inherited method from Foo<Integer,ArrayList<Integer>,ArrayList<Integer>> declares this parameter as \'ArrayList<@NonNull Integer>\' (mismatching null constraints)\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 12)\n" +
- " public ArrayList<@NonNull Integer> m(ArrayList<@Nullable Integer> i) { return i; }\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'ArrayList<@NonNull Integer>\' but this expression has type \'ArrayList<@Nullable Integer>\'\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 16)\n" +
- " Baz baz= x -> {\n" +
- " x.add(null);\n" +
- " x.get(0);\n" +
- " return x;\n" +
- " };\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Contradictory null annotations: function type was inferred as \'ArrayList<@NonNull @Nullable Integer> (ArrayList<@Nullable @NonNull Integer>)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 17)\n" +
- " x.add(null);\n" +
- " ^^^^^^^^^^^\n" +
- "Contradictory null annotations: method was inferred as \'boolean add(@Nullable @NonNull Integer)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
- "----------\n" +
- "6. ERROR in Test.java (at line 18)\n" +
- " x.get(0);\n" +
- " ^^^^^^^^\n" +
- "Contradictory null annotations: method was inferred as \'@Nullable @NonNull Integer get(int)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 12)\n" +
+ " public ArrayList<@NonNull Integer> m(ArrayList<@Nullable Integer> i) { return i; }\n" +
+ " ^^^^^^^^^\n" +
+ "The return type is incompatible with \'ArrayList<@Nullable Integer>\' returned from Foo<Integer,ArrayList<Integer>,ArrayList<Integer>>.m(ArrayList<Integer>) (mismatching null constraints)\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 12)\n" +
+ " public ArrayList<@NonNull Integer> m(ArrayList<@Nullable Integer> i) { return i; }\n" +
+ " ^^^^^^^^^\n" +
+ "Illegal redefinition of parameter i, inherited method from Foo<Integer,ArrayList<Integer>,ArrayList<Integer>> declares this parameter as \'ArrayList<@NonNull Integer>\' (mismatching null constraints)\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 12)\n" +
+ " public ArrayList<@NonNull Integer> m(ArrayList<@Nullable Integer> i) { return i; }\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'ArrayList<@NonNull Integer>\' but this expression has type \'ArrayList<@Nullable Integer>\'\n" +
+ "----------\n" +
+ "4. ERROR in Test.java (at line 16)\n" +
+ " Baz baz= x -> {\n" +
+ " x.add(null);\n" +
+ " x.get(0);\n" +
+ " return x;\n" +
+ " };\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Contradictory null annotations: function type was inferred as \'ArrayList<@NonNull @Nullable Integer> (ArrayList<@Nullable @NonNull Integer>)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
+ "----------\n" +
+ "5. ERROR in Test.java (at line 17)\n" +
+ " x.add(null);\n" +
+ " ^^^^^^^^^^^\n" +
+ "Contradictory null annotations: method was inferred as \'boolean add(@Nullable @NonNull Integer)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
+ "----------\n" +
+ "6. ERROR in Test.java (at line 18)\n" +
+ " x.get(0);\n" +
+ " ^^^^^^^^\n" +
+ "Contradictory null annotations: method was inferred as \'@Nullable @NonNull Integer get(int)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
"----------\n");
}
public void testBug453475() {
runConformTestWithLibs(
new String[] {
"TestMap.java",
- "import java.util.*;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "@NonNullByDefault\n" +
- "public abstract class TestMap extends AbstractMap<String,@Nullable String> {\n" +
- "\n" +
+ "import java.util.*;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "@NonNullByDefault\n" +
+ "public abstract class TestMap extends AbstractMap<String,@Nullable String> {\n" +
+ "\n" +
"}\n"
}, null, "");
runConformTestWithLibs(
false /* don't flush */,
new String[] {
"Test.java",
- "import java.util.*;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "@NonNullByDefault\n" +
- "public class Test {\n" +
- "\n" +
- " public static final void test(TestMap testMap) {\n" +
- " testMap.putAll(new HashMap<String,@Nullable String>()); // Error: Contradictory null annotations: method was inferred as 'void putAll(Map<? extends @NonNull String,? extends @NonNull @Nullable String>)', but only one of '@NonNull' and '@Nullable' can be effective at any location\n" +
- " }\n" +
- "\n" +
+ "import java.util.*;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "@NonNullByDefault\n" +
+ "public class Test {\n" +
+ "\n" +
+ " public static final void test(TestMap testMap) {\n" +
+ " testMap.putAll(new HashMap<String,@Nullable String>()); // Error: Contradictory null annotations: method was inferred as 'void putAll(Map<? extends @NonNull String,? extends @NonNull @Nullable String>)', but only one of '@NonNull' and '@Nullable' can be effective at any location\n" +
+ " }\n" +
+ "\n" +
"}\n"
}, null, "");
}
@@ -7670,12 +7670,12 @@ public void testBug453475a() {
new String[] {
"NamespaceStorage.java",
"import java.util.*;\n" +
- "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
- "public interface NamespaceStorage<T> \n" +
- "{\n" +
- "\n" +
+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ "public interface NamespaceStorage<T> \n" +
+ "{\n" +
+ "\n" +
" Set<T> getObjects(); \n" + // here <T> was wrongly read from .class as <@NonNull T>
- " T getObject(T in);\n" +
+ " T getObject(T in);\n" +
"}\n"
}, null, "");
runConformTestWithLibs(
@@ -7683,19 +7683,19 @@ public void testBug453475a() {
new String[] {
"NamespaceStorageImpl.java",
"import java.util.*;\n" +
- "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
- "public class NamespaceStorageImpl<T> implements NamespaceStorage<T>\n" +
- "{\n" +
- " @Override\n" +
- " public Set<T> getObjects() \n" +
- " {\n" +
- " return new TreeSet<T>();\n" +
- " }\n" +
- " @Override\n" +
- " public T getObject(T in)\n" +
- " {\n" +
- " return in;\n" +
- " }\n" +
+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ "public class NamespaceStorageImpl<T> implements NamespaceStorage<T>\n" +
+ "{\n" +
+ " @Override\n" +
+ " public Set<T> getObjects() \n" +
+ " {\n" +
+ " return new TreeSet<T>();\n" +
+ " }\n" +
+ " @Override\n" +
+ " public T getObject(T in)\n" +
+ " {\n" +
+ " return in;\n" +
+ " }\n" +
"}\n"
},
null, "");
@@ -7706,11 +7706,11 @@ public void testBug453475b() {
new String[] {
"X.java",
"import java.util.*;\n" +
- "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
- "public interface X {\n" +
- "\n" +
+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ "public interface X {\n" +
+ "\n" +
" void test(List<?> list);\n" + // here <?> was wrongly read from .class as <@NonNull ?>
- " \n" +
+ " \n" +
"}\n"
}, null, "");
runConformTestWithLibs(
@@ -7719,11 +7719,11 @@ public void testBug453475b() {
"Y.java",
"import java.util.*;\n" +
"import org.eclipse.jdt.annotation.*;\n" +
- "public class Y {\n" +
- " public void run(X x, @NonNull List<@Nullable String> s) \n" +
- " {\n" +
- " x.test(s);\n" +
- " }\n" +
+ "public class Y {\n" +
+ " public void run(X x, @NonNull List<@Nullable String> s) \n" +
+ " {\n" +
+ " x.test(s);\n" +
+ " }\n" +
"}\n"
},
null, "");
@@ -7733,15 +7733,15 @@ public void testBug456236() {
new String[] {
"Nullsafe.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "class Nullsafe<T> {\n" +
- " final @Nullable T t;\n" +
- "\n" +
- " Nullsafe(@Nullable T t) {\n" +
- " this.t = t;\n" +
- " }\n" +
- " public static <U> Nullsafe<U> of(@Nullable U u) {\n" +
- " return new Nullsafe<>(u); // compile error\n" +
- " }\n" +
+ "class Nullsafe<T> {\n" +
+ " final @Nullable T t;\n" +
+ "\n" +
+ " Nullsafe(@Nullable T t) {\n" +
+ " this.t = t;\n" +
+ " }\n" +
+ " public static <U> Nullsafe<U> of(@Nullable U u) {\n" +
+ " return new Nullsafe<>(u); // compile error\n" +
+ " }\n" +
"}\n"
},
null,
@@ -7752,34 +7752,34 @@ public void testBug456497() throws Exception {
runConformTestWithLibs(
new String[] {
"libs/Lib1.java",
- "package libs;\n" +
- "\n" +
- "import java.util.Collection;\n" +
- "import java.util.Iterator;\n" +
+ "package libs;\n" +
+ "\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.Iterator;\n" +
"import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public interface Lib1 {\n" +
- " <T> Iterator<T> unconstrainedTypeArguments1(Collection<@Nullable T> in);\n" +
- " Iterator<@NonNull String> unconstrainedTypeArguments2(Collection<String> in);\n" +
+ "\n" +
+ "public interface Lib1 {\n" +
+ " <T> Iterator<T> unconstrainedTypeArguments1(Collection<@Nullable T> in);\n" +
+ " Iterator<@NonNull String> unconstrainedTypeArguments2(Collection<String> in);\n" +
"}\n",
"tests/Test1.java",
- "package tests;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "import java.util.Collection;\n" +
- "import java.util.Iterator;\n" +
- "\n" +
- "import libs.Lib1;\n" +
- "\n" +
- "public class Test1 {\n" +
- " Iterator<@NonNull String> test1(Lib1 lib, Collection<@Nullable String> coll) {\n" +
- " return lib.unconstrainedTypeArguments1(coll);\n" +
- " }\n" +
- " Iterator<@NonNull String> test2(Lib1 lib, Collection<@Nullable String> coll) {\n" +
- " return lib.unconstrainedTypeArguments2(coll);\n" +
+ "package tests;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.Iterator;\n" +
+ "\n" +
+ "import libs.Lib1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " Iterator<@NonNull String> test1(Lib1 lib, Collection<@Nullable String> coll) {\n" +
+ " return lib.unconstrainedTypeArguments1(coll);\n" +
+ " }\n" +
+ " Iterator<@NonNull String> test2(Lib1 lib, Collection<@Nullable String> coll) {\n" +
+ " return lib.unconstrainedTypeArguments2(coll);\n" +
" }\n" +
"}\n"
- },
+ },
null,
"");
}
@@ -7789,16 +7789,16 @@ public void testBug456487a() {
new String[]{
"Optional.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "public class Optional<@NonNull T> {\n" +
- " @Nullable T value;\n" +
- " private Optional(T value) { this.value = value; }\n" +
- " public static <@NonNull T> Optional<T> of(T value) { return new Optional<T>(value); }\n" +
- " public T get() { \n" +
- " @Nullable T t = this.value;\n" +
- " if (t != null) return t; \n" +
- " throw new RuntimeException(\"No value present\");\n" +
- " }\n" +
- " public @Nullable T orElse(@Nullable T other) { return (this.value != null) ? this.value : other; }\n" +
+ "public class Optional<@NonNull T> {\n" +
+ " @Nullable T value;\n" +
+ " private Optional(T value) { this.value = value; }\n" +
+ " public static <@NonNull T> Optional<T> of(T value) { return new Optional<T>(value); }\n" +
+ " public T get() { \n" +
+ " @Nullable T t = this.value;\n" +
+ " if (t != null) return t; \n" +
+ " throw new RuntimeException(\"No value present\");\n" +
+ " }\n" +
+ " public @Nullable T orElse(@Nullable T other) { return (this.value != null) ? this.value : other; }\n" +
"}\n"
},
null,
@@ -7810,82 +7810,82 @@ public void testBug456487b() {
new String[]{
"Optional.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "public class Optional<@Nullable T> {\n" +
- " @Nullable T value;\n" +
- " private Optional(T value) { this.value = value; }\n" +
- " public static <@NonNull T> Optional<T> of(T value) { return new Optional<T>(value); }\n" +
- " public T get() { \n" +
- " @Nullable T t = this.value;\n" +
- " if (t != null) return t; \n" +
- " throw new RuntimeException(\"No value present\");\n" +
- " }\n" +
- " public @Nullable T orElse(@Nullable T other) { return (this.value != null) ? this.value : other; }\n" +
+ "public class Optional<@Nullable T> {\n" +
+ " @Nullable T value;\n" +
+ " private Optional(T value) { this.value = value; }\n" +
+ " public static <@NonNull T> Optional<T> of(T value) { return new Optional<T>(value); }\n" +
+ " public T get() { \n" +
+ " @Nullable T t = this.value;\n" +
+ " if (t != null) return t; \n" +
+ " throw new RuntimeException(\"No value present\");\n" +
+ " }\n" +
+ " public @Nullable T orElse(@Nullable T other) { return (this.value != null) ? this.value : other; }\n" +
"}\n",
"OTest.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "@NonNullByDefault\n" +
- "class OTest {\n" +
- " public static void good() {\n" +
- " Optional<String> os1 = Optional.of(\"yes\");\n" +
- " @NonNull String s = os1.get();\n" +
- " @Nullable String ns = os1.orElse(null);\n" +
- " }\n" +
- " public static void bad() {\n" +
- " Optional<String> os = Optional.of(null);\n" +
- " @NonNull String s = os.orElse(null);\n" +
- " }\n" +
+ "@NonNullByDefault\n" +
+ "class OTest {\n" +
+ " public static void good() {\n" +
+ " Optional<String> os1 = Optional.of(\"yes\");\n" +
+ " @NonNull String s = os1.get();\n" +
+ " @Nullable String ns = os1.orElse(null);\n" +
+ " }\n" +
+ " public static void bad() {\n" +
+ " Optional<String> os = Optional.of(null);\n" +
+ " @NonNull String s = os.orElse(null);\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Optional.java (at line 5)\n" +
- " public static <@NonNull T> Optional<T> of(T value) { return new Optional<T>(value); }\n" +
- " ^\n" +
- "Null constraint mismatch: The type \'@NonNull T\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
- "----------\n" +
- "2. ERROR in Optional.java (at line 5)\n" +
- " public static <@NonNull T> Optional<T> of(T value) { return new Optional<T>(value); }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Contradictory null annotations: method was inferred as \'void <init>(@Nullable @NonNull T)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
- "----------\n" +
- "3. ERROR in Optional.java (at line 5)\n" +
- " public static <@NonNull T> Optional<T> of(T value) { return new Optional<T>(value); }\n" +
- " ^\n" +
- "Null constraint mismatch: The type \'@NonNull T\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in OTest.java (at line 5)\n" +
- " Optional<String> os1 = Optional.of(\"yes\");\n" +
- " ^^^^^^\n" +
- "Null constraint mismatch: The type \'@NonNull String\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
- "----------\n" +
- "2. ERROR in OTest.java (at line 6)\n" +
- " @NonNull String s = os1.get();\n" +
- " ^^^^^^^^^\n" +
- "Contradictory null annotations: method was inferred as \'@Nullable @NonNull String get()\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
- "----------\n" +
- "3. ERROR in OTest.java (at line 7)\n" +
- " @Nullable String ns = os1.orElse(null);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Contradictory null annotations: method was inferred as \'@Nullable @NonNull String orElse(@Nullable @NonNull String)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
- "----------\n" +
- "4. ERROR in OTest.java (at line 10)\n" +
- " Optional<String> os = Optional.of(null);\n" +
- " ^^^^^^\n" +
- "Null constraint mismatch: The type \'@NonNull String\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
- "----------\n" +
- "5. ERROR in OTest.java (at line 10)\n" +
- " Optional<String> os = Optional.of(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "6. ERROR in OTest.java (at line 11)\n" +
- " @NonNull String s = os.orElse(null);\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Contradictory null annotations: method was inferred as \'@Nullable @NonNull String orElse(@Nullable @NonNull String)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
+ "----------\n" +
+ "1. ERROR in Optional.java (at line 5)\n" +
+ " public static <@NonNull T> Optional<T> of(T value) { return new Optional<T>(value); }\n" +
+ " ^\n" +
+ "Null constraint mismatch: The type \'@NonNull T\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "2. ERROR in Optional.java (at line 5)\n" +
+ " public static <@NonNull T> Optional<T> of(T value) { return new Optional<T>(value); }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Contradictory null annotations: method was inferred as \'void <init>(@Nullable @NonNull T)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
+ "----------\n" +
+ "3. ERROR in Optional.java (at line 5)\n" +
+ " public static <@NonNull T> Optional<T> of(T value) { return new Optional<T>(value); }\n" +
+ " ^\n" +
+ "Null constraint mismatch: The type \'@NonNull T\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in OTest.java (at line 5)\n" +
+ " Optional<String> os1 = Optional.of(\"yes\");\n" +
+ " ^^^^^^\n" +
+ "Null constraint mismatch: The type \'@NonNull String\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "2. ERROR in OTest.java (at line 6)\n" +
+ " @NonNull String s = os1.get();\n" +
+ " ^^^^^^^^^\n" +
+ "Contradictory null annotations: method was inferred as \'@Nullable @NonNull String get()\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
+ "----------\n" +
+ "3. ERROR in OTest.java (at line 7)\n" +
+ " @Nullable String ns = os1.orElse(null);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Contradictory null annotations: method was inferred as \'@Nullable @NonNull String orElse(@Nullable @NonNull String)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
+ "----------\n" +
+ "4. ERROR in OTest.java (at line 10)\n" +
+ " Optional<String> os = Optional.of(null);\n" +
+ " ^^^^^^\n" +
+ "Null constraint mismatch: The type \'@NonNull String\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "5. ERROR in OTest.java (at line 10)\n" +
+ " Optional<String> os = Optional.of(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "6. ERROR in OTest.java (at line 11)\n" +
+ " @NonNull String s = os.orElse(null);\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Contradictory null annotations: method was inferred as \'@Nullable @NonNull String orElse(@Nullable @NonNull String)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
"----------\n");
}
public void testBug454182() {
-
+
Map options = getCompilerOptions();
options.put(JavaCore.COMPILER_NONNULL_BY_DEFAULT_ANNOTATION_NAME, "annot.NonNullByDefault");
String[] libs = this.LIBS.clone();
@@ -7941,36 +7941,36 @@ public void testBug437072() {
" List<@NonNull int> intlist;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " @NonNull int[][] ints = new int[3][4];\n" +
- " ^^^^^^^^\n" +
- "The nullness annotation @NonNull is not applicable for the primitive type int\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " @NonNull int[][] test1() { return new int[3][4]; }\n" +
- " ^^^^^^^^\n" +
- "The nullness annotation @NonNull is not applicable for the primitive type int\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " void test2(@NonNull boolean[][] bools) {\n" +
- " ^^^^^^^^\n" +
- "The nullness annotation @NonNull is not applicable for the primitive type boolean\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " @NonNull boolean[][] bools2 = bools;\n" +
- " ^^^^^^^^\n" +
- "The nullness annotation @NonNull is not applicable for the primitive type boolean\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 9)\n" +
- " List<@NonNull int[]> intslist;\n" +
- " ^^^^^^^^\n" +
- "The nullness annotation @Nullable is not applicable for the primitive type int\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 10)\n" +
- " List<@NonNull int> intlist;\n" +
- " ^^^\n" +
- "Syntax error, insert \"Dimensions\" to complete ReferenceType\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " @NonNull int[][] ints = new int[3][4];\n" +
+ " ^^^^^^^^\n" +
+ "The nullness annotation @NonNull is not applicable for the primitive type int\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " @NonNull int[][] test1() { return new int[3][4]; }\n" +
+ " ^^^^^^^^\n" +
+ "The nullness annotation @NonNull is not applicable for the primitive type int\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " void test2(@NonNull boolean[][] bools) {\n" +
+ " ^^^^^^^^\n" +
+ "The nullness annotation @NonNull is not applicable for the primitive type boolean\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " @NonNull boolean[][] bools2 = bools;\n" +
+ " ^^^^^^^^\n" +
+ "The nullness annotation @NonNull is not applicable for the primitive type boolean\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 9)\n" +
+ " List<@NonNull int[]> intslist;\n" +
+ " ^^^^^^^^\n" +
+ "The nullness annotation @Nullable is not applicable for the primitive type int\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 10)\n" +
+ " List<@NonNull int> intlist;\n" +
+ " ^^^\n" +
+ "Syntax error, insert \"Dimensions\" to complete ReferenceType\n" +
"----------\n",
this.LIBS,
true/*flush*/);
@@ -7983,79 +7983,79 @@ public void testBug448709() {
true/*flush*/,
new String[] {
"Test.java",
- "import java.util.*;\n" +
- "import java.util.function.*;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public class Test {\n" +
- "\n" +
- " /**\n" +
- " * A null-annotated version of {@link Objects#requireNonNull(Object)}.\n" +
- " */\n" +
- " public static final <T> @NonNull T requireNonNull(final @Nullable T obj) {\n" +
- " if (obj == null) throw new NullPointerException();\n" +
- " return obj;\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * A null-annotated version of {@link Optional#map(Function)}.\n" +
- " */\n" +
- " public static final <T,U> @NonNull Optional<U> map(final @NonNull Optional<T> optional, final Function<@NonNull ? super T,? extends U> mapper) {\n" +
- " if (!optional.isPresent()) return requireNonNull(Optional.empty());\n" +
- " final T source = optional.get();\n" +
+ "import java.util.*;\n" +
+ "import java.util.function.*;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * A null-annotated version of {@link Objects#requireNonNull(Object)}.\n" +
+ " */\n" +
+ " public static final <T> @NonNull T requireNonNull(final @Nullable T obj) {\n" +
+ " if (obj == null) throw new NullPointerException();\n" +
+ " return obj;\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * A null-annotated version of {@link Optional#map(Function)}.\n" +
+ " */\n" +
+ " public static final <T,U> @NonNull Optional<U> map(final @NonNull Optional<T> optional, final Function<@NonNull ? super T,? extends U> mapper) {\n" +
+ " if (!optional.isPresent()) return requireNonNull(Optional.empty());\n" +
+ " final T source = optional.get();\n" +
" final U result = mapper.apply(source);\n" +
- " System.out.println(source+\"->\"+result);\n" +
- " return requireNonNull(Optional.<U> ofNullable(result));\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * A method with a {@link NonNull} {@link DefaultLocation#PARAMETER} and {@link DefaultLocation#RETURN_TYPE}.\n" +
- " */\n" +
- " public static final @NonNull Integer testMethod(final @NonNull String s) {\n" +
- " final Integer r = Integer.valueOf(s);\n" +
- " if (r == null) throw new NullPointerException();\n" +
- " return r+1;\n" +
- " }\n" +
- "\n" +
- " public static void main(final String[] args) {\n" +
- " final @NonNull Optional<@Nullable String> optNullableString = requireNonNull(Optional.ofNullable(\"1\"));\n" +
- "\n" +
- " final Function<@NonNull String,@NonNull Integer> testMethodRef = Test::testMethod;\n" +
- " map(optNullableString, testMethodRef);\n" +
- "\n" +
+ " System.out.println(source+\"->\"+result);\n" +
+ " return requireNonNull(Optional.<U> ofNullable(result));\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * A method with a {@link NonNull} {@link DefaultLocation#PARAMETER} and {@link DefaultLocation#RETURN_TYPE}.\n" +
+ " */\n" +
+ " public static final @NonNull Integer testMethod(final @NonNull String s) {\n" +
+ " final Integer r = Integer.valueOf(s);\n" +
+ " if (r == null) throw new NullPointerException();\n" +
+ " return r+1;\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(final String[] args) {\n" +
+ " final @NonNull Optional<@Nullable String> optNullableString = requireNonNull(Optional.ofNullable(\"1\"));\n" +
+ "\n" +
+ " final Function<@NonNull String,@NonNull Integer> testMethodRef = Test::testMethod;\n" +
+ " map(optNullableString, testMethodRef);\n" +
+ "\n" +
" map(optNullableString, Test::testMethod); // Error: Null type mismatch at parameter 1: required '@NonNull String' but provided '@Nullable String' via method descriptor Function<String,Integer>.apply(String)\n" +
"\n" +
- " map(optNullableString, (s) -> Test.testMethod(s));\n" +
- " }\n" +
- "\n" +
+ " map(optNullableString, (s) -> Test.testMethod(s));\n" +
+ " }\n" +
+ "\n" +
"}\n"
},
compilerOptions,
- "----------\n" +
- "1. WARNING in Test.java (at line 21)\n" +
- " final U result = mapper.apply(source);\n" +
- " ^^^^^^\n" +
- "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "2. WARNING in Test.java (at line 39)\n" +
- " map(optNullableString, testMethodRef);\n" +
- " ^^^^^^^^^^^^^\n" +
- "Contradictory null annotations: method was inferred as \'@NonNull Optional<@NonNull Integer> map(@NonNull Optional<@Nullable String>, Function<@NonNull ? super @Nullable String,? extends @NonNull Integer>)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
- "----------\n" +
- "3. WARNING in Test.java (at line 41)\n" +
- " map(optNullableString, Test::testMethod); // Error: Null type mismatch at parameter 1: required \'@NonNull String\' but provided \'@Nullable String\' via method descriptor Function<String,Integer>.apply(String)\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Contradictory null annotations: method was inferred as \'@NonNull Optional<@NonNull Integer> map(@NonNull Optional<@Nullable String>, Function<@NonNull ? super @Nullable String,? extends @NonNull Integer>)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
- "----------\n" +
- "4. WARNING in Test.java (at line 43)\n" +
- " map(optNullableString, (s) -> Test.testMethod(s));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Contradictory null annotations: method was inferred as \'@NonNull Optional<@NonNull Integer> map(@NonNull Optional<@Nullable String>, Function<@NonNull ? super @Nullable String,? extends @NonNull Integer>)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
- "----------\n" +
- "5. WARNING in Test.java (at line 43)\n" +
- " map(optNullableString, (s) -> Test.testMethod(s));\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
+ "----------\n" +
+ "1. WARNING in Test.java (at line 21)\n" +
+ " final U result = mapper.apply(source);\n" +
+ " ^^^^^^\n" +
+ "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "2. WARNING in Test.java (at line 39)\n" +
+ " map(optNullableString, testMethodRef);\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Contradictory null annotations: method was inferred as \'@NonNull Optional<@NonNull Integer> map(@NonNull Optional<@Nullable String>, Function<@NonNull ? super @Nullable String,? extends @NonNull Integer>)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
+ "----------\n" +
+ "3. WARNING in Test.java (at line 41)\n" +
+ " map(optNullableString, Test::testMethod); // Error: Null type mismatch at parameter 1: required \'@NonNull String\' but provided \'@Nullable String\' via method descriptor Function<String,Integer>.apply(String)\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Contradictory null annotations: method was inferred as \'@NonNull Optional<@NonNull Integer> map(@NonNull Optional<@Nullable String>, Function<@NonNull ? super @Nullable String,? extends @NonNull Integer>)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
+ "----------\n" +
+ "4. WARNING in Test.java (at line 43)\n" +
+ " map(optNullableString, (s) -> Test.testMethod(s));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Contradictory null annotations: method was inferred as \'@NonNull Optional<@NonNull Integer> map(@NonNull Optional<@Nullable String>, Function<@NonNull ? super @Nullable String,? extends @NonNull Integer>)\', but only one of \'@NonNull\' and \'@Nullable\' can be effective at any location\n" +
+ "----------\n" +
+ "5. WARNING in Test.java (at line 43)\n" +
+ " map(optNullableString, (s) -> Test.testMethod(s));\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
"----------\n",
"1->2\n" +
"1->2\n" +
@@ -8065,19 +8065,19 @@ public void testBug448709b() {
runConformTestWithLibs(
new String[] {
"Test.java",
- "import java.util.*;\n" +
- "import java.util.function.*;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public class Test {\n" +
- "\n" +
- " public static final <T,U> void map(final @NonNull Optional<T> optional, final Function<@NonNull ? super T,? extends U> mapper) {\n" +
+ "import java.util.*;\n" +
+ "import java.util.function.*;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " public static final <T,U> void map(final @NonNull Optional<T> optional, final Function<@NonNull ? super T,? extends U> mapper) {\n" +
" final T source = optional.get();\n" +
- " if (source != null) {\n" +
+ " if (source != null) {\n" +
" final U result = mapper.apply(source);\n" +
- " System.out.println(source+\"->\"+result);\n" +
- " }\n" +
- " }\n" +
+ " System.out.println(source+\"->\"+result);\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -8118,11 +8118,11 @@ public void testBug459967_Array_constructor_b() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " consumer(String[]::new);\n" +
- " ^^^^^^^^^^^^^\n" +
- "Null type safety at method return type: Method descriptor FI<String>.getArray(int) promises \'@NonNull String @NonNull[]\' but referenced method provides \'String @NonNull[]\'\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 7)\n" +
+ " consumer(String[]::new);\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Null type safety at method return type: Method descriptor FI<String>.getArray(int) promises \'@NonNull String @NonNull[]\' but referenced method provides \'String @NonNull[]\'\n" +
"----------\n");
}
public void testBug459967_Array_clone() {
@@ -8160,11 +8160,11 @@ public void testBug459967_Array_clone_b() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " consumer(String[]::clone);\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Null type safety at method return type: Method descriptor FI<String>.getArray(String[]) promises \'@NonNull String @NonNull[]\' but referenced method provides \'String @NonNull[]\'\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 7)\n" +
+ " consumer(String[]::clone);\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Null type safety at method return type: Method descriptor FI<String>.getArray(String[]) promises \'@NonNull String @NonNull[]\' but referenced method provides \'String @NonNull[]\'\n" +
"----------\n");
}
public void testBug448709_allocationExpression1() {
@@ -8184,11 +8184,11 @@ public void testBug448709_allocationExpression1() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " return zork(new FI<>());\n" +
- " ^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'F0<@NonNull String>\' but this expression has type \'@NonNull FI<@Nullable String>\', corresponding supertype is \'F0<@Nullable String>\'\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " return zork(new FI<>());\n" +
+ " ^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'F0<@NonNull String>\' but this expression has type \'@NonNull FI<@Nullable String>\', corresponding supertype is \'F0<@Nullable String>\'\n" +
"----------\n");
}
public void testBug448709_allocationExpression2() {
@@ -8204,11 +8204,11 @@ public void testBug448709_allocationExpression2() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " F f = new <@NonNull Integer>F(1,2);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@NonNull Integer\' is not a valid substitute for the type parameter \'@Nullable U\'\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " F f = new <@NonNull Integer>F(1,2);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@NonNull Integer\' is not a valid substitute for the type parameter \'@Nullable U\'\n" +
"----------\n");
}
public void testBug448709_allocationExpression3() {
@@ -8224,32 +8224,32 @@ public void testBug448709_allocationExpression3() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " F f = this.new <@NonNull Integer>F(1,2);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@NonNull Integer\' is not a valid substitute for the type parameter \'@Nullable U\'\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " F f = this.new <@NonNull Integer>F(1,2);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@NonNull Integer\' is not a valid substitute for the type parameter \'@Nullable U\'\n" +
"----------\n");
}
public void testBug465513() {
runConformTestWithLibs(
new String[] {
"pack1/A.java",
- "package pack1;\r\n" +
- "import java.math.BigInteger;\r\n" +
- "\r\n" +
- "interface A { Object m(Class c); }\r\n" +
- "interface B<S extends Number> { Object m(Class<S> c); }\r\n" +
- "interface C<T extends BigInteger> { Object m(Class<T> c); }\r\n" +
- "@FunctionalInterface\r\n" +
+ "package pack1;\r\n" +
+ "import java.math.BigInteger;\r\n" +
+ "\r\n" +
+ "interface A { Object m(Class c); }\r\n" +
+ "interface B<S extends Number> { Object m(Class<S> c); }\r\n" +
+ "interface C<T extends BigInteger> { Object m(Class<T> c); }\r\n" +
+ "@FunctionalInterface\r\n" +
"interface D<S,T> extends A, B<BigInteger>, C<BigInteger> {}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in pack1\\A.java (at line 4)\n" +
- " interface A { Object m(Class c); }\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "1. WARNING in pack1\\A.java (at line 4)\n" +
+ " interface A { Object m(Class c); }\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
"----------\n");
}
@@ -8272,9 +8272,9 @@ public void testBug455180() {
},
getCompilerOptions(),
"----------\n" +
- "1. WARNING in projA\\ClassWithRawUsage.java (at line 4)\n" +
- " public java.util.List<GenericType> method() {\n" +
- " ^^^^^^^^^^^\n" +
+ "1. WARNING in projA\\ClassWithRawUsage.java (at line 4)\n" +
+ " public java.util.List<GenericType> method() {\n" +
+ " ^^^^^^^^^^^\n" +
"GenericType is a raw type. References to generic type GenericType<T> should be parameterized\n" +
"----------\n");
runConformTestWithLibs( // same warning from ecj & javac
@@ -8292,16 +8292,16 @@ public void testBug455180() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in projB\\ClassThatImports.java (at line 7)\n" +
- " @NonNull GenericType gt = cwru.method().get(0);\n" +
- " ^^^^^^^^^^^\n" +
- "GenericType is a raw type. References to generic type GenericType<T> should be parameterized\n" +
- "----------\n" +
- "2. INFO in projB\\ClassThatImports.java (at line 7)\n" +
- " @NonNull GenericType gt = cwru.method().get(0);\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'@NonNull List<@NonNull GenericType>\'. Type \'List<E>\' doesn\'t seem to be designed with null type annotations in mind\n" +
+ "----------\n" +
+ "1. WARNING in projB\\ClassThatImports.java (at line 7)\n" +
+ " @NonNull GenericType gt = cwru.method().get(0);\n" +
+ " ^^^^^^^^^^^\n" +
+ "GenericType is a raw type. References to generic type GenericType<T> should be parameterized\n" +
+ "----------\n" +
+ "2. INFO in projB\\ClassThatImports.java (at line 7)\n" +
+ " @NonNull GenericType gt = cwru.method().get(0);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'@NonNull List<@NonNull GenericType>\'. Type \'List<E>\' doesn\'t seem to be designed with null type annotations in mind\n" +
"----------\n");
}
@@ -8333,7 +8333,7 @@ public void testBug455180WithOtherAnnotation() {
"----------\n" +
"1. WARNING in projA\\ClassWithRawUsage.java (at line 3)\n" +
" public java.util.List<@proj0.MyAnnotation GenericType> method() {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"GenericType is a raw type. References to generic type GenericType<T> should be parameterized\n" +
"----------\n");
runWarningTestWithLibs(
@@ -8364,8 +8364,8 @@ public void testBug466713() {
runConformTestWithLibs(
new String[] {
"Bug.java",
- "class Bug {\n" +
- " java.util.Iterator<int @org.eclipse.jdt.annotation.Nullable []> x;\n" +
+ "class Bug {\n" +
+ " java.util.Iterator<int @org.eclipse.jdt.annotation.Nullable []> x;\n" +
"}\n"
},
getCompilerOptions(),
@@ -8377,16 +8377,16 @@ public void testBug466713b() {
new String[] {
"Bug.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "class Bug {\n" +
- " java.util.Iterator<@Nullable int @Nullable []> x;\n" +
+ "class Bug {\n" +
+ " java.util.Iterator<@Nullable int @Nullable []> x;\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in Bug.java (at line 3)\n" +
- " java.util.Iterator<@Nullable int @Nullable []> x;\n" +
- " ^^^^^^^^^\n" +
- "The nullness annotation @Nullable is not applicable for the primitive type int\n" +
+ "----------\n" +
+ "1. ERROR in Bug.java (at line 3)\n" +
+ " java.util.Iterator<@Nullable int @Nullable []> x;\n" +
+ " ^^^^^^^^^\n" +
+ "The nullness annotation @Nullable is not applicable for the primitive type int\n" +
"----------\n");
}
// variant to ensure we are not complaining against an unrelated annotation
@@ -8399,8 +8399,8 @@ public void testBug466713c() {
"@Target(ElementType.TYPE_USE)\n" +
"@interface MyAnnot {}\n",
"Bug.java",
- "class Bug {\n" +
- " java.util.Iterator<@MyAnnot int @org.eclipse.jdt.annotation.Nullable []> x;\n" +
+ "class Bug {\n" +
+ " java.util.Iterator<@MyAnnot int @org.eclipse.jdt.annotation.Nullable []> x;\n" +
"}\n"
},
getCompilerOptions(),
@@ -8417,21 +8417,21 @@ public void testBug466713d() {
"@interface MyAnnot {}\n",
"Bug.java",
"class Bug {\n" +
- " boolean test(Object o) {\n" +
+ " boolean test(Object o) {\n" +
" return o instanceof java.util.Iterator<java.lang. @MyAnnot @org.eclipse.jdt.annotation.Nullable String>;\n" +
- " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Bug.java (at line 3)\n" +
- " return o instanceof java.util.Iterator<java.lang. @MyAnnot @org.eclipse.jdt.annotation.Nullable String>;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot perform instanceof check against parameterized type Iterator<String>. Use the form Iterator<?> instead since further generic type information will be erased at runtime\n" +
- "----------\n" +
- "2. ERROR in Bug.java (at line 3)\n" +
- " return o instanceof java.util.Iterator<java.lang. @MyAnnot @org.eclipse.jdt.annotation.Nullable String>;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Nullness annotations are not applicable at this location \n" +
+ "----------\n" +
+ "1. ERROR in Bug.java (at line 3)\n" +
+ " return o instanceof java.util.Iterator<java.lang. @MyAnnot @org.eclipse.jdt.annotation.Nullable String>;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot perform instanceof check against parameterized type Iterator<String>. Use the form Iterator<?> instead since further generic type information will be erased at runtime\n" +
+ "----------\n" +
+ "2. ERROR in Bug.java (at line 3)\n" +
+ " return o instanceof java.util.Iterator<java.lang. @MyAnnot @org.eclipse.jdt.annotation.Nullable String>;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Nullness annotations are not applicable at this location \n" +
"----------\n",
this.LIBS,
true/*flush*/);
@@ -8442,12 +8442,12 @@ public void testBug466969() {
"GenericType.java",
"public abstract class GenericType<T extends @org.eclipse.jdt.annotation.NonNull Runnable> {\n" +
" abstract T get();\n"+
- "}",
+ "}",
"WildcardUsage.java",
"import static org.eclipse.jdt.annotation.DefaultLocation.*;\n" +
- "\n" +
+ "\n" +
"import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "\n" +
+ "\n" +
"@NonNullByDefault({ ARRAY_CONTENTS, FIELD, PARAMETER, RETURN_TYPE, TYPE_ARGUMENT, TYPE_BOUND, TYPE_PARAMETER })\n" +
"public class WildcardUsage {\n" +
" void f(GenericType<?> p) {\n" +
@@ -8487,7 +8487,7 @@ public void testBug467430() {
" a.m(v);\n" +
" }\n" +
"}"
- },
+ },
getCompilerOptions(),
"");
}
@@ -8504,7 +8504,7 @@ public void testBug467430mismatch() {
" a.m(v);\n" +
" }\n" +
"}"
- },
+ },
getCompilerOptions(),
"");
}
@@ -8512,7 +8512,7 @@ public void testBug467430array() {
runConformTestWithLibs(
new String[] {
"A.java",
- "import org.eclipse.jdt.annotation.*;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
"public class A {\n" +
" @NonNullByDefault\n" +
" void m(@NonNull String @Nullable [] array) {\n" +
@@ -8522,7 +8522,7 @@ public void testBug467430array() {
" a.m(v);\n" +
" }\n" +
"}"
- },
+ },
getCompilerOptions(),
"");
}
@@ -8530,7 +8530,7 @@ public void testBug467430arrayMismatch() {
runConformTestWithLibs(
new String[] {
"A.java",
- "import org.eclipse.jdt.annotation.*;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
"public class A {\n" +
" @NonNullByDefault\n" +
" void m(@NonNull String @Nullable [] array) {\n" +
@@ -8540,7 +8540,7 @@ public void testBug467430arrayMismatch() {
" a.m(v);\n" +
" }\n" +
"}"
- },
+ },
getCompilerOptions(),
"");
}
@@ -8551,35 +8551,35 @@ public void testBug446217() {
runner.testFiles =
new String[] {
"sol/package-info.java",
- "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
"package sol;",
"sol/FuncList.java",
- "\n" +
- "package sol;\n" +
- "\n" +
- "interface FuncList<A> {}\n" +
+ "\n" +
+ "package sol;\n" +
+ "\n" +
+ "interface FuncList<A> {}\n" +
" \n" +
- "@SuppressWarnings(\"unused\")\n" +
- "final class Node<A> implements FuncList<A> {\n" +
- " private final A a;\n" +
- " private final FuncList<A> tail;\n" +
- " \n" +
- " Node(final A a, final FuncList<A> tail) {\n" +
- " this.a = a;\n" +
- " this.tail = tail;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "final class Empty<A> implements FuncList<A> {\n" +
- " Empty() {}\n" +
+ "@SuppressWarnings(\"unused\")\n" +
+ "final class Node<A> implements FuncList<A> {\n" +
+ " private final A a;\n" +
+ " private final FuncList<A> tail;\n" +
+ " \n" +
+ " Node(final A a, final FuncList<A> tail) {\n" +
+ " this.a = a;\n" +
+ " this.tail = tail;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "final class Empty<A> implements FuncList<A> {\n" +
+ " Empty() {}\n" +
"}\n",
"sol/Test.java",
- "package sol;\n" +
- "\n" +
- "public class Test {\n" +
- " public static void main(final String[] args) {\n" +
- " System.out.println(new Node<>(\"A\", new Empty<>()));\n" +
- " }\n" +
+ "package sol;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " public static void main(final String[] args) {\n" +
+ " System.out.println(new Node<>(\"A\", new Empty<>()));\n" +
+ " }\n" +
"}\n"
};
runner.javacTestOptions = new JavacTestOptions.SuppressWarnings("auxiliaryclass");
@@ -8592,30 +8592,30 @@ public void testBug456584() {
true/*flush*/,
new String[] {
"Test.java",
- "import java.util.*;\n" +
- "import java.util.function.*;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "@NonNullByDefault\n" +
- "public class Test {\n" +
- "\n" +
- " public static final <T,R> @NonNull R applyRequired(final T input, final Function<? super T,? extends R> function) { // Warning on '@NonNull R': \"The nullness annotation is redundant with a default that applies to this location\"\n" +
- " return Objects.requireNonNull(function.apply(input));\n" +
- " }\n" +
- "\n" +
+ "import java.util.*;\n" +
+ "import java.util.function.*;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "@NonNullByDefault\n" +
+ "public class Test {\n" +
+ "\n" +
+ " public static final <T,R> @NonNull R applyRequired(final T input, final Function<? super T,? extends R> function) { // Warning on '@NonNull R': \"The nullness annotation is redundant with a default that applies to this location\"\n" +
+ " return Objects.requireNonNull(function.apply(input));\n" +
+ " }\n" +
+ "\n" +
"}\n"
},
compilerOptions,
- "----------\n" +
- "1. INFO in Test.java (at line 9)\n" +
- " return Objects.requireNonNull(function.apply(input));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unsafe interpretation of method return type as \'@NonNull\' based on substitution \'T=@NonNull capture#of ? extends R\'. Declaring type \'Objects\' doesn\'t seem to be designed with null type annotations in mind\n" +
- "----------\n" +
- "2. WARNING in Test.java (at line 9)\n" +
- " return Objects.requireNonNull(function.apply(input));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety: required \'@NonNull\' but this expression has type \'capture#2-of ? extends R\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "1. INFO in Test.java (at line 9)\n" +
+ " return Objects.requireNonNull(function.apply(input));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unsafe interpretation of method return type as \'@NonNull\' based on substitution \'T=@NonNull capture#of ? extends R\'. Declaring type \'Objects\' doesn\'t seem to be designed with null type annotations in mind\n" +
+ "----------\n" +
+ "2. WARNING in Test.java (at line 9)\n" +
+ " return Objects.requireNonNull(function.apply(input));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety: required \'@NonNull\' but this expression has type \'capture#2-of ? extends R\', a free type variable that may represent a \'@Nullable\' type\n" +
"----------\n");
}
public void testBug447661() {
@@ -8623,12 +8623,12 @@ public void testBug447661() {
new String[] {
"Two.java",
"import java.util.*;\n" +
- "public class Two {\n" +
- "\n" +
- " @org.eclipse.jdt.annotation.NonNullByDefault\n" +
- " public static Set<String> getSet() {\n" +
- " return new HashSet<>();\n" +
- " }\n" +
+ "public class Two {\n" +
+ "\n" +
+ " @org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ " public static Set<String> getSet() {\n" +
+ " return new HashSet<>();\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -8638,12 +8638,12 @@ public void testBug447661() {
new String[] {
"One.java",
"import java.util.*;\n" +
- "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
- "public class One {\n" +
- "\n" +
- " public void test() {\n" +
- " Set<String> set = Two.getSet();\n" +
- " }\n" +
+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ "public class One {\n" +
+ "\n" +
+ " public void test() {\n" +
+ " Set<String> set = Two.getSet();\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -8653,54 +8653,54 @@ public void testBug436091() {
runConformTestWithLibs(
new String[] {
"p/package-info.java",
- "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
"package p;\n",
"p/Program.java",
"package p;\n" +
- "public class Program {\n" +
- " private final ProgramNode program;\n" +
- " " +
- " public Program(final ProgramNode astRoot) {\n" +
- " program = astRoot;\n" +
- " }\n" +
- " " +
- " public Integer execute() {\n" +
- " return program.accept(ExecutionEvaluationVisitor.VISITOR);\n" +
- " }\n" +
- " " +
- " class ProgramNode {\n" +
- " public <R> R accept(final ConcreteNodeVisitor<R> visitor) {\n" +
- " return visitor.visit(this);\n" +
- " }\n" +
- " }\n" +
+ "public class Program {\n" +
+ " private final ProgramNode program;\n" +
+ " " +
+ " public Program(final ProgramNode astRoot) {\n" +
+ " program = astRoot;\n" +
+ " }\n" +
+ " " +
+ " public Integer execute() {\n" +
+ " return program.accept(ExecutionEvaluationVisitor.VISITOR);\n" +
+ " }\n" +
+ " " +
+ " class ProgramNode {\n" +
+ " public <R> R accept(final ConcreteNodeVisitor<R> visitor) {\n" +
+ " return visitor.visit(this);\n" +
+ " }\n" +
+ " }\n" +
"}\n",
-
+
"p/ConcreteNodeVisitor.java",
"package p;\n" +
- "import p.Program.ProgramNode;\n" +
- "public interface ConcreteNodeVisitor<R> {\n" +
- " R visit(ProgramNode node);\n" +
+ "import p.Program.ProgramNode;\n" +
+ "public interface ConcreteNodeVisitor<R> {\n" +
+ " R visit(ProgramNode node);\n" +
"}\n",
-
+
"p/ExecutionEvaluationVisitor.java",
- "package p;\n" +
- "" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "" +
- "import p.Program.ProgramNode;\n" +
- "" +
- "public enum ExecutionEvaluationVisitor implements ConcreteNodeVisitor<Integer> {\n" +
- " " +
- " VISITOR;\n" +
- " " +
- " @Override" +
- " public Integer visit(final ProgramNode node) {\n" +
- " @SuppressWarnings(\"null\")\n" +
- " @NonNull\n" +
- " final Integer i = Integer.valueOf(0);\n" +
- " return i;\n" +
- " }\n" +
+ "package p;\n" +
+ "" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "" +
+ "import p.Program.ProgramNode;\n" +
+ "" +
+ "public enum ExecutionEvaluationVisitor implements ConcreteNodeVisitor<Integer> {\n" +
+ " " +
+ " VISITOR;\n" +
+ " " +
+ " @Override" +
+ " public Integer visit(final ProgramNode node) {\n" +
+ " @SuppressWarnings(\"null\")\n" +
+ " @NonNull\n" +
+ " final Integer i = Integer.valueOf(0);\n" +
+ " return i;\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -8711,22 +8711,22 @@ public void testBug436091() {
new String[] {
"p/Program.java",
"package p;\n" +
- "public class Program {\n" +
- " private final ProgramNode program;\n" +
- " " +
- " public Program(final ProgramNode astRoot) {\n" +
- " program = astRoot;\n" +
- " }\n" +
- " " +
- " public Integer execute() {\n" +
- " return program.accept(ExecutionEvaluationVisitor.VISITOR);\n" +
- " }\n" +
- " " +
- " class ProgramNode {\n" +
- " public <R> R accept(final ConcreteNodeVisitor<R> visitor) {\n" +
- " return visitor.visit(this);\n" +
- " }\n" +
- " }\n" +
+ "public class Program {\n" +
+ " private final ProgramNode program;\n" +
+ " " +
+ " public Program(final ProgramNode astRoot) {\n" +
+ " program = astRoot;\n" +
+ " }\n" +
+ " " +
+ " public Integer execute() {\n" +
+ " return program.accept(ExecutionEvaluationVisitor.VISITOR);\n" +
+ " }\n" +
+ " " +
+ " class ProgramNode {\n" +
+ " public <R> R accept(final ConcreteNodeVisitor<R> visitor) {\n" +
+ " return visitor.visit(this);\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -8739,22 +8739,22 @@ public void testBug474239() {
runConformTestWithLibs(
new String[] {
"Test.java",
- "public class Test {\n" +
- " static String s1 = null, s2 = null;\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " int val = (int) System.currentTimeMillis();\n" +
- " switch (val % 2) {\n" +
- " case 0:\n" +
- " if (s1 != null)\n" +
- " s2 = \"\";\n" +
- " break;\n" +
- " case 1:\n" +
- " if (s1 != null) // compiler thinks s1 is never null at this point\n" +
- " throw new RuntimeException(\"\");\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " static String s1 = null, s2 = null;\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " int val = (int) System.currentTimeMillis();\n" +
+ " switch (val % 2) {\n" +
+ " case 0:\n" +
+ " if (s1 != null)\n" +
+ " s2 = \"\";\n" +
+ " break;\n" +
+ " case 1:\n" +
+ " if (s1 != null) // compiler thinks s1 is never null at this point\n" +
+ " throw new RuntimeException(\"\");\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
options,
@@ -8858,7 +8858,7 @@ public void testBug467482regression() {
"public abstract class Check {\n" +
" public static void check(@org.eclipse.jdt.annotation.NonNull Object x) {\n" +
" }\n" +
-
+
" public static void f(Object unknown, boolean flag) {\n" +
" check(unknown); // expected: null type safety warning\n" +
" @org.eclipse.jdt.annotation.Nullable\n" +
@@ -8868,67 +8868,67 @@ public void testBug467482regression() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in Check.java (at line 5)\n" +
- " check(unknown); // expected: null type safety warning\n" +
- " ^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'Object\' needs unchecked conversion to conform to \'@NonNull Object\'\n" +
- "----------\n" +
- "2. ERROR in Check.java (at line 8)\n" +
- " check(nullable); // expected: null type mismatch error\n" +
- " ^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'@Nullable Object\'\n" +
+ "----------\n" +
+ "1. WARNING in Check.java (at line 5)\n" +
+ " check(unknown); // expected: null type safety warning\n" +
+ " ^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'Object\' needs unchecked conversion to conform to \'@NonNull Object\'\n" +
+ "----------\n" +
+ "2. ERROR in Check.java (at line 8)\n" +
+ " check(nullable); // expected: null type mismatch error\n" +
+ " ^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'@Nullable Object\'\n" +
"----------\n");
}
public void testBug484735() {
runConformTestWithLibs(
new String[] {
"test/NullabilityLoopBug.java",
- "package test;\n" +
- "\n" +
- "import java.util.HashMap;\n" +
- "import java.util.Map;\n" +
- "import java.util.Map.Entry;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
- "public class NullabilityLoopBug {\n" +
- "\n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " Map<String, String> map = new HashMap<>();\n" +
- " \n" +
- " map.put(\"key\", \"value\");\n" +
- " \n" +
- " System.out.println(getKeyByValue(map, \"value\"));\n" +
- " }\n" +
- " \n" +
- " private static <K, V> K getKeyByValue(Map<K, V> map, @Nullable V value)\n" +
- " {\n" +
- " @Nullable K result = null; // some nullability bug? assigning null results in compiler complaining 'result can only be null' below\n" +
- " for (Entry<K, V> entry : map.entrySet())\n" +
- " {\n" +
- " boolean equals;\n" +
- " if (value == null)\n" +
- " equals = (entry.getValue() == null);\n" +
- " else\n" +
- " equals = value.equals(entry.getValue());\n" +
- " \n" +
- " if (equals)\n" +
- " {\n" +
- " if (result == null) // Incorrect warning: Redundant null check: The variable result can only be null at this location\n" +
- " result = entry.getKey();\n" +
- " else\n" +
- " throw new IllegalStateException(\"Multiple matches for looking up key via value [\" + value + \"]: [\" + result + \"] and [\" + entry.getKey() + \"]\");\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " if (result == null) // Incorrect warning: Redundant null check: The variable result can only be null at this location\n" +
- " throw new IllegalStateException(\"No matches for looking up key via value [\" + value + \"]\");\n" +
- " \n" +
- " return result; // Incorrect warning: Dead code\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "import java.util.HashMap;\n" +
+ "import java.util.Map;\n" +
+ "import java.util.Map.Entry;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ "public class NullabilityLoopBug {\n" +
+ "\n" +
+ " public static void main(String[] args)\n" +
+ " {\n" +
+ " Map<String, String> map = new HashMap<>();\n" +
+ " \n" +
+ " map.put(\"key\", \"value\");\n" +
+ " \n" +
+ " System.out.println(getKeyByValue(map, \"value\"));\n" +
+ " }\n" +
+ " \n" +
+ " private static <K, V> K getKeyByValue(Map<K, V> map, @Nullable V value)\n" +
+ " {\n" +
+ " @Nullable K result = null; // some nullability bug? assigning null results in compiler complaining 'result can only be null' below\n" +
+ " for (Entry<K, V> entry : map.entrySet())\n" +
+ " {\n" +
+ " boolean equals;\n" +
+ " if (value == null)\n" +
+ " equals = (entry.getValue() == null);\n" +
+ " else\n" +
+ " equals = value.equals(entry.getValue());\n" +
+ " \n" +
+ " if (equals)\n" +
+ " {\n" +
+ " if (result == null) // Incorrect warning: Redundant null check: The variable result can only be null at this location\n" +
+ " result = entry.getKey();\n" +
+ " else\n" +
+ " throw new IllegalStateException(\"Multiple matches for looking up key via value [\" + value + \"]: [\" + result + \"] and [\" + entry.getKey() + \"]\");\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " if (result == null) // Incorrect warning: Redundant null check: The variable result can only be null at this location\n" +
+ " throw new IllegalStateException(\"No matches for looking up key via value [\" + value + \"]\");\n" +
+ " \n" +
+ " return result; // Incorrect warning: Dead code\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -8942,21 +8942,21 @@ public void testBug474239b() {
runConformTestWithLibs(
new String[] {
"Test.java",
- "public class Test {\n" +
- " static String s2 = null;\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " int val = (int) System.currentTimeMillis();\n" +
- " switch (val % 2) {\n" +
- " case 0:\n" +
- " s2 = \"\";\n" +
- " break;\n" +
- " case 1:\n" +
- " if (s2 != null)\n" +
- " throw new RuntimeException(\"\");\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " static String s2 = null;\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " int val = (int) System.currentTimeMillis();\n" +
+ " switch (val % 2) {\n" +
+ " case 0:\n" +
+ " s2 = \"\";\n" +
+ " break;\n" +
+ " case 1:\n" +
+ " if (s2 != null)\n" +
+ " throw new RuntimeException(\"\");\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
options,
@@ -8966,19 +8966,19 @@ public void testBug472663() {
runConformTestWithLibs(
new String[] {
"test/Callee.java",
- "package test;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "\n" +
- "@NonNullByDefault\n" +
- "public class Callee {\n" +
- " public static String staticOtherClass(String foo) {\n" +
- " return foo;\n" +
- " }\n" +
- "\n" +
- " public String instanceOtherClass(String foo) {\n" +
- " return foo;\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "\n" +
+ "@NonNullByDefault\n" +
+ "public class Callee {\n" +
+ " public static String staticOtherClass(String foo) {\n" +
+ " return foo;\n" +
+ " }\n" +
+ "\n" +
+ " public String instanceOtherClass(String foo) {\n" +
+ " return foo;\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -8988,35 +8988,35 @@ public void testBug472663() {
false /* don't flush */,
new String[] {
"test/Caller.java",
- "package test;\n" +
- "\n" +
- "import java.util.function.Function;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "\n" +
- "@NonNullByDefault\n" +
- "public class Caller {\n" +
- " public void foo(final Callee callee) {\n" +
- " Function<String, String> function;\n" +
- "\n" +
- " // assignments with warnings (wrong):\n" +
- " function = Callee::staticOtherClass;\n" +
- " function = callee::instanceOtherClass;\n" +
- "\n" +
- " // assignments with no warnings (ok):\n" +
- " function = foo -> Callee.staticOtherClass(foo);\n" +
- " function = foo -> callee.instanceOtherClass(foo);\n" +
- " function = Caller::staticSameClass;\n" +
- " function = this::instanceSameClass;\n" +
- " }\n" +
- "\n" +
- " public static String staticSameClass(String foo) {\n" +
- " return foo;\n" +
- " }\n" +
- "\n" +
- " public String instanceSameClass(String foo) {\n" +
- " return foo;\n" +
- " }\n" +
+ "package test;\n" +
+ "\n" +
+ "import java.util.function.Function;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "\n" +
+ "@NonNullByDefault\n" +
+ "public class Caller {\n" +
+ " public void foo(final Callee callee) {\n" +
+ " Function<String, String> function;\n" +
+ "\n" +
+ " // assignments with warnings (wrong):\n" +
+ " function = Callee::staticOtherClass;\n" +
+ " function = callee::instanceOtherClass;\n" +
+ "\n" +
+ " // assignments with no warnings (ok):\n" +
+ " function = foo -> Callee.staticOtherClass(foo);\n" +
+ " function = foo -> callee.instanceOtherClass(foo);\n" +
+ " function = Caller::staticSameClass;\n" +
+ " function = this::instanceSameClass;\n" +
+ " }\n" +
+ "\n" +
+ " public static String staticSameClass(String foo) {\n" +
+ " return foo;\n" +
+ " }\n" +
+ "\n" +
+ " public String instanceSameClass(String foo) {\n" +
+ " return foo;\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -9029,8 +9029,8 @@ public void testBug467094() {
"class A {;\n"+
" @org.eclipse.jdt.annotation.NonNull String @org.eclipse.jdt.annotation.Nullable [] x;\n"+
"}\n"
- },
- getCompilerOptions(),
+ },
+ getCompilerOptions(),
"");
}
public void testBug467094_local() {
@@ -9046,7 +9046,7 @@ public void testBug467094_local() {
" }\n"+
"}\n"
},
- getCompilerOptions(),
+ getCompilerOptions(),
"----------\n"+
"1. ERROR in X.java (at line 4)\n" +
" if (o != null) {\n" +
@@ -9071,18 +9071,18 @@ public void testBug467094_method() {
}
public void testBug440398() {
runConformTestWithLibs(
- new String[] {
+ new String[] {
"NullTest.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "@NonNullByDefault({})\r\n" +
- "public class NullTest {\r\n" +
- " public static @NonNull Object[] obj = null;\r\n" +
- " public static void main(String[] args) {\r\n" +
- " obj = null;\r\n" +
- " if (obj == null) { // WARNING 1\r\n" +
- " System.out.println(\"NULL\"); // WARNING 2\r\n" +
- " }\r\n" +
- " }\r\n" +
+ "@NonNullByDefault({})\r\n" +
+ "public class NullTest {\r\n" +
+ " public static @NonNull Object[] obj = null;\r\n" +
+ " public static void main(String[] args) {\r\n" +
+ " obj = null;\r\n" +
+ " if (obj == null) { // WARNING 1\r\n" +
+ " System.out.println(\"NULL\"); // WARNING 2\r\n" +
+ " }\r\n" +
+ " }\r\n" +
"}\n"
},
getCompilerOptions(),
@@ -9091,18 +9091,18 @@ public void testBug440398() {
}
public void testBug440398_comment2() {
runConformTestWithLibs(
- new String[] {
+ new String[] {
"MyClass.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "@NonNullByDefault({DefaultLocation.FIELD})\n" +
- "public class MyClass {\n" +
- " private @NonNull String [] names = new @NonNull String[]{\"Alice\", \"Bob\", \"Charlie\"};\n" +
- "\n" +
- " public String getName(int index) {\n" +
- " String name = names[index];\n" +
- " return name; /* statement A */\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "@NonNullByDefault({DefaultLocation.FIELD})\n" +
+ "public class MyClass {\n" +
+ " private @NonNull String [] names = new @NonNull String[]{\"Alice\", \"Bob\", \"Charlie\"};\n" +
+ "\n" +
+ " public String getName(int index) {\n" +
+ " String name = names[index];\n" +
+ " return name; /* statement A */\n" +
+ " }\n" +
"}",
},
getCompilerOptions(),
@@ -9110,21 +9110,21 @@ public void testBug440398_comment2() {
}
public void testBug440398_comment2a() {
runConformTestWithLibs(
- new String[] {
+ new String[] {
"p/package-info.java",
"@org.eclipse.jdt.annotation.NonNullByDefault({org.eclipse.jdt.annotation.DefaultLocation.FIELD})\n" +
"package p;\n",
"p/MyClass.java",
"package p;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public class MyClass {\n" +
- " private @NonNull String [] names = new @NonNull String[]{\"Alice\", \"Bob\", \"Charlie\"};\n" +
- "\n" +
- " public String getName(int index) {\n" +
- " String name = names[index];\n" +
- " return name; /* statement A */\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "public class MyClass {\n" +
+ " private @NonNull String [] names = new @NonNull String[]{\"Alice\", \"Bob\", \"Charlie\"};\n" +
+ "\n" +
+ " public String getName(int index) {\n" +
+ " String name = names[index];\n" +
+ " return name; /* statement A */\n" +
+ " }\n" +
"}",
},
getCompilerOptions(),
@@ -9137,99 +9137,99 @@ public void testBug481332() {
"import java.util.*;\n" +
"import org.eclipse.jdt.annotation.*;\n" +
"public class X {\n" +
- " public void foo() {\n" +
- " @Nullable\n" +
- " List<@NonNull String> list = new ArrayList<>();\n" +
- " checkNotNull(list); // OK\n" +
- "\n" +
- " @Nullable\n" +
- " Map<@NonNull String, @NonNull String> map = new HashMap<>();\n" +
- " checkNotNull(map); // OK\n" +
- "\n" +
- " @NonNull\n" +
- " Object @Nullable [] objects = new @NonNull Object[0];\n" +
- " // Error: Null type mismatch (type annotations): required '@NonNull Object @NonNull[]' but this expression ...\n" +
- " checkNotNull(objects);\n" +
- " }\n" +
- " \n" +
- " public static <@Nullable T> T[] checkNotNull(T @Nullable [] array) {\n" +
- " if (array == null) {\n" +
- " throw new NullPointerException();\n" +
- " }\n" +
- " return array;\n" +
- " }\n" +
- "\n" +
- " public static <@Nullable T, C extends Iterable<T>> C checkNotNull(@Nullable C container) {\n" +
- " if (container == null) {\n" +
- " throw new NullPointerException();\n" +
- " }\n" +
- " return container;\n" +
- " }\n" +
- "\n" +
- " public static <@Nullable K, @Nullable V, M extends Map<K, V>> M checkNotNull(@Nullable M map) {\n" +
- " if (map == null) {\n" +
- " throw new NullPointerException();\n" +
- " }\n" +
- " return map;\n" +
+ " public void foo() {\n" +
+ " @Nullable\n" +
+ " List<@NonNull String> list = new ArrayList<>();\n" +
+ " checkNotNull(list); // OK\n" +
+ "\n" +
+ " @Nullable\n" +
+ " Map<@NonNull String, @NonNull String> map = new HashMap<>();\n" +
+ " checkNotNull(map); // OK\n" +
+ "\n" +
+ " @NonNull\n" +
+ " Object @Nullable [] objects = new @NonNull Object[0];\n" +
+ " // Error: Null type mismatch (type annotations): required '@NonNull Object @NonNull[]' but this expression ...\n" +
+ " checkNotNull(objects);\n" +
+ " }\n" +
+ " \n" +
+ " public static <@Nullable T> T[] checkNotNull(T @Nullable [] array) {\n" +
+ " if (array == null) {\n" +
+ " throw new NullPointerException();\n" +
+ " }\n" +
+ " return array;\n" +
+ " }\n" +
+ "\n" +
+ " public static <@Nullable T, C extends Iterable<T>> C checkNotNull(@Nullable C container) {\n" +
+ " if (container == null) {\n" +
+ " throw new NullPointerException();\n" +
+ " }\n" +
+ " return container;\n" +
+ " }\n" +
+ "\n" +
+ " public static <@Nullable K, @Nullable V, M extends Map<K, V>> M checkNotNull(@Nullable M map) {\n" +
+ " if (map == null) {\n" +
+ " throw new NullPointerException();\n" +
+ " }\n" +
+ " return map;\n" +
" }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " checkNotNull(list); // OK\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'List<@NonNull String>\' is not a valid substitute for the type parameter \'C extends Iterable<@Nullable T>\'\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " checkNotNull(map); // OK\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'Map<@NonNull String,@NonNull String>\' is not a valid substitute for the type parameter \'M extends Map<@Nullable K,@Nullable V>\'\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 16)\n" +
- " checkNotNull(objects);\n" +
- " ^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@Nullable Object @Nullable[]\' but this expression has type \'@NonNull Object @Nullable[]\'\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " checkNotNull(list); // OK\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'List<@NonNull String>\' is not a valid substitute for the type parameter \'C extends Iterable<@Nullable T>\'\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " checkNotNull(map); // OK\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'Map<@NonNull String,@NonNull String>\' is not a valid substitute for the type parameter \'M extends Map<@Nullable K,@Nullable V>\'\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 16)\n" +
+ " checkNotNull(objects);\n" +
+ " ^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@Nullable Object @Nullable[]\' but this expression has type \'@NonNull Object @Nullable[]\'\n" +
"----------\n");
}
public void testBug481322a() {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "class Super<S, T extends List<S>> {\n" +
- " S pick(T list) {\n" +
- " return list.get(0);\n" +
- " }\n" +
- "}\n" +
- "public class X extends Super<@NonNull String, List<@Nullable String>> {\n" +
- " @Override\n" +
- " public @NonNull String pick(List<@Nullable String> list) {\n" +
- " return super.pick(list);\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " List<@Nullable String> withNulls = new ArrayList<@Nullable String>();\n" +
- " withNulls.add(null);\n" +
- " System.out.println(new X().pick(withNulls).toUpperCase());\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "class Super<S, T extends List<S>> {\n" +
+ " S pick(T list) {\n" +
+ " return list.get(0);\n" +
+ " }\n" +
+ "}\n" +
+ "public class X extends Super<@NonNull String, List<@Nullable String>> {\n" +
+ " @Override\n" +
+ " public @NonNull String pick(List<@Nullable String> list) {\n" +
+ " return super.pick(list);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " List<@Nullable String> withNulls = new ArrayList<@Nullable String>();\n" +
+ " withNulls.add(null);\n" +
+ " System.out.println(new X().pick(withNulls).toUpperCase());\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " return list.get(0);\n" +
- " ^^^^\n" +
- "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " public class X extends Super<@NonNull String, List<@Nullable String>> {\n" +
- " ^^^^\n" +
- "Null constraint mismatch: The type \'List<@Nullable String>\' is not a valid substitute for the type parameter \'T extends List<S>\'\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " return list.get(0);\n" +
+ " ^^^^\n" +
+ "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 12)\n" +
+ " public class X extends Super<@NonNull String, List<@Nullable String>> {\n" +
+ " ^^^^\n" +
+ "Null constraint mismatch: The type \'List<@Nullable String>\' is not a valid substitute for the type parameter \'T extends List<S>\'\n" +
"----------\n");
}
public void testBug477719() {
@@ -9277,16 +9277,16 @@ public void testBug482247() {
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in X.java (at line 12)\n" +
- " other(new String[0]);\n" +
- " ^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'@Nullable String []\'\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 13)\n" +
- " return first(new String[0]);\n" +
- " ^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'@NonNull String @NonNull[]\'\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 12)\n" +
+ " other(new String[0]);\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'@Nullable String []\'\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 13)\n" +
+ " return first(new String[0]);\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String[]\' needs unchecked conversion to conform to \'@NonNull String @NonNull[]\'\n" +
"----------\n");
}
public void testBug482247_comment5() {
@@ -9294,13 +9294,13 @@ public void testBug482247_comment5() {
new String[] {
"Snippet.java",
"import org.eclipse.jdt.annotation.*;\n" +
- "public class Snippet {\n" +
- " @NonNull String[] s1 = new String[0]; // No warning\n" +
- " public void handleIncidentBeforeCreate() {\n" +
+ "public class Snippet {\n" +
+ " @NonNull String[] s1 = new String[0]; // No warning\n" +
+ " public void handleIncidentBeforeCreate() {\n" +
" @NonNull String[] s = new String[0]; // Warning\n" +
" String [] @NonNull[] s2 = new String[0][];\n" +
" String [] @NonNull[] @Nullable[] s3 = new String[0][][];\n" +
- " }\n" +
+ " }\n" +
"}"
},
getCompilerOptions(),
@@ -9310,30 +9310,30 @@ public void testBug483146() {
runConformTestWithLibs(
new String[] {
"Foo.java",
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "class Foo {\n" +
- "\n" +
- " void example1() {\n" +
- " @Nullable List<String> container = new ArrayList<>();\n" +
- " @NonNull List<String> list = checkNotNull(container);\n" +
- " }\n" +
- "\n" +
- " void example2() {\n" +
- " @Nullable List<String> container= new ArrayList<>();\n" +
- " @NonNull List<String> list = checkNotNull(container);\n" +
- " }\n" +
- " \n" +
- " @NonNull <T, C extends Iterable<T>> C checkNotNull(C container) {\n" +
- " if (container == null) {\n" +
- " throw new NullPointerException();\n" +
- " }\n" +
- " return container;\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "class Foo {\n" +
+ "\n" +
+ " void example1() {\n" +
+ " @Nullable List<String> container = new ArrayList<>();\n" +
+ " @NonNull List<String> list = checkNotNull(container);\n" +
+ " }\n" +
+ "\n" +
+ " void example2() {\n" +
+ " @Nullable List<String> container= new ArrayList<>();\n" +
+ " @NonNull List<String> list = checkNotNull(container);\n" +
+ " }\n" +
+ " \n" +
+ " @NonNull <T, C extends Iterable<T>> C checkNotNull(C container) {\n" +
+ " if (container == null) {\n" +
+ " throw new NullPointerException();\n" +
+ " }\n" +
+ " return container;\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -9343,30 +9343,30 @@ public void testBug483146b() {
runConformTestWithLibs(
new String[] {
"Foo.java",
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "class Foo {\n" +
- "\n" +
- " void example1() {\n" +
- " @Nullable List<String> container = new ArrayList<>();\n" +
- " @NonNull List<String> list = checkNotNull(container);\n" +
- " }\n" +
- "\n" +
- " void example2() {\n" +
- " @Nullable List<String> container= new ArrayList<>();\n" +
- " @NonNull List<String> list = checkNotNull(container);\n" +
- " }\n" +
- " \n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "class Foo {\n" +
+ "\n" +
+ " void example1() {\n" +
+ " @Nullable List<String> container = new ArrayList<>();\n" +
+ " @NonNull List<String> list = checkNotNull(container);\n" +
+ " }\n" +
+ "\n" +
+ " void example2() {\n" +
+ " @Nullable List<String> container= new ArrayList<>();\n" +
+ " @NonNull List<String> list = checkNotNull(container);\n" +
+ " }\n" +
+ " \n" +
" <T, C extends Iterable<T>> @NonNull C checkNotNull(@Nullable C container) {\n" + // <- variation: param is @Nullable
- " if (container == null) {\n" +
- " throw new NullPointerException();\n" +
- " }\n" +
- " return container;\n" +
- " }\n" +
+ " if (container == null) {\n" +
+ " throw new NullPointerException();\n" +
+ " }\n" +
+ " return container;\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -9376,7 +9376,7 @@ public void testBug473713() {
runConformTestWithLibs(
new String[] {
"a/A1.java",
- "package a;\n" +
+ "package a;\n" +
"@org.eclipse.jdt.annotation.NonNullByDefault\n" +
"public class A1 {\n" +
" public class NestedInA1 {\n" +
@@ -9409,45 +9409,45 @@ public void testBug482228() {
runNegativeTestWithLibs(
new String[] {
"X.java",
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "class Super<S> {\n" +
- " <T extends List<S>> S pick(T list) {\n" +
- " return list.get(0);\n" +
- " }\n" +
- "}\n" +
- "public class X extends Super<@NonNull String> {\n" +
- " @Override\n" +
- " <T extends List<@Nullable String>> @NonNull String pick(T list) {\n" +
- " return super.pick(list);\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " List<@Nullable String> withNulls = new ArrayList<>();\n" +
- " withNulls.add(null);\n" +
- " System.out.println(new X().pick(withNulls).toUpperCase());\n" +
- " }\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "class Super<S> {\n" +
+ " <T extends List<S>> S pick(T list) {\n" +
+ " return list.get(0);\n" +
+ " }\n" +
+ "}\n" +
+ "public class X extends Super<@NonNull String> {\n" +
+ " @Override\n" +
+ " <T extends List<@Nullable String>> @NonNull String pick(T list) {\n" +
+ " return super.pick(list);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " List<@Nullable String> withNulls = new ArrayList<>();\n" +
+ " withNulls.add(null);\n" +
+ " System.out.println(new X().pick(withNulls).toUpperCase());\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " return list.get(0);\n" +
- " ^^^^\n" +
- "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " <T extends List<@Nullable String>> @NonNull String pick(T list) {\n" +
- " ^\n" +
- "Cannot redefine null constraints of type variable \'T extends List<@NonNull String>\' declared in \'Super<String>.pick(T)\'\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 15)\n" +
- " return super.pick(list);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'T extends List<@Nullable String>\' is not a valid substitute for the type parameter \'T extends List<@NonNull String>\'\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " return list.get(0);\n" +
+ " ^^^^\n" +
+ "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " <T extends List<@Nullable String>> @NonNull String pick(T list) {\n" +
+ " ^\n" +
+ "Cannot redefine null constraints of type variable \'T extends List<@NonNull String>\' declared in \'Super<String>.pick(T)\'\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 15)\n" +
+ " return super.pick(list);\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'T extends List<@Nullable String>\' is not a valid substitute for the type parameter \'T extends List<@NonNull String>\'\n" +
"----------\n");
}
public void testBug483527() {
@@ -9456,13 +9456,13 @@ public void testBug483527() {
runConformTestWithLibs(
new String[] {
"Test.java",
- "public class Test {\n" +
- " static final short foo;\n" +
- " static {\n" +
- " foo = 1;\n" +
- " for (int i=0; i<10; i++) {\n" +
- " }\n" +
- " }\n" +
+ "public class Test {\n" +
+ " static final short foo;\n" +
+ " static {\n" +
+ " foo = 1;\n" +
+ " for (int i=0; i<10; i++) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
compilerOptions,
@@ -9477,24 +9477,24 @@ public void testMultipleAnnotations1() {
"org/foo/Nullable.java",
"package org.foo;\n" +
"import java.lang.annotation.*;\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@Target({ElementType.TYPE_USE})\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ElementType.TYPE_USE})\n" +
"public @interface Nullable {}\n",
"org/foo/NonNull.java",
"package org.foo;\n" +
"import java.lang.annotation.*;\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@Target({ElementType.TYPE_USE})\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ElementType.TYPE_USE})\n" +
"public @interface NonNull {}\n",
"p1/TestNulls.java",
"package p1;\n" +
- "import org.foo.*;\n" +
- "\n" +
- "public class TestNulls {\n" +
- " public @Nullable String weaken(@NonNull String theValue) {\n" +
- " return theValue;\n" +
- " }\n" +
- "\n" +
+ "import org.foo.*;\n" +
+ "\n" +
+ "public class TestNulls {\n" +
+ " public @Nullable String weaken(@NonNull String theValue) {\n" +
+ " return theValue;\n" +
+ " }\n" +
+ "\n" +
"}"
},
options1);
@@ -9514,16 +9514,16 @@ public void testMultipleAnnotations1() {
"}\n"
},
options2,
- "----------\n" +
- "1. ERROR in p2\\Test.java (at line 6)\n" +
- " return test.weaken(input);\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
- "----------\n" +
- "2. ERROR in p2\\Test.java (at line 6)\n" +
- " return test.weaken(input);\n" +
- " ^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
+ "----------\n" +
+ "1. ERROR in p2\\Test.java (at line 6)\n" +
+ " return test.weaken(input);\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
+ "----------\n" +
+ "2. ERROR in p2\\Test.java (at line 6)\n" +
+ " return test.weaken(input);\n" +
+ " ^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
"----------\n");
}
public void test483952 () {
@@ -9545,39 +9545,39 @@ public void test483952 () {
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in test\\Test.java (at line 6)\n" +
- " Function function = x -> x;\n" +
- " ^^^^^^^^\n" +
- "Function is a raw type. References to generic type Function<T,R> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in test\\Test.java (at line 7)\n" +
- " String @Nullable [] z = test2(function, \"\");\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation test2(Function, String) of the generic method test2(Function<T,T>, T) of type Test\n" +
- "----------\n" +
- "3. WARNING in test\\Test.java (at line 7)\n" +
- " String @Nullable [] z = test2(function, \"\");\n" +
- " ^^^^^^^^\n" +
- "Type safety: The expression of type Function needs unchecked conversion to conform to Function<String,String>\n" +
+ "----------\n" +
+ "1. WARNING in test\\Test.java (at line 6)\n" +
+ " Function function = x -> x;\n" +
+ " ^^^^^^^^\n" +
+ "Function is a raw type. References to generic type Function<T,R> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in test\\Test.java (at line 7)\n" +
+ " String @Nullable [] z = test2(function, \"\");\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: Unchecked invocation test2(Function, String) of the generic method test2(Function<T,T>, T) of type Test\n" +
+ "----------\n" +
+ "3. WARNING in test\\Test.java (at line 7)\n" +
+ " String @Nullable [] z = test2(function, \"\");\n" +
+ " ^^^^^^^^\n" +
+ "Type safety: The expression of type Function needs unchecked conversion to conform to Function<String,String>\n" +
"----------\n");
}
public void test484055() {
runConformTestWithLibs(
new String[] {
"B.java",
- "interface A {\n" +
- " public void f(String[] x);\n" +
- "\n" +
- " public void f2(String x);\n" +
- "}\n" +
- "\n" +
- "public class B implements A {\n" +
- " public void f(String @org.eclipse.jdt.annotation.Nullable [] x) {\n" +
- " }\n" +
- "\n" +
- " public void f2(@org.eclipse.jdt.annotation.Nullable String x) {\n" +
- " }\n" +
+ "interface A {\n" +
+ " public void f(String[] x);\n" +
+ "\n" +
+ " public void f2(String x);\n" +
+ "}\n" +
+ "\n" +
+ "public class B implements A {\n" +
+ " public void f(String @org.eclipse.jdt.annotation.Nullable [] x) {\n" +
+ " }\n" +
+ "\n" +
+ " public void f2(@org.eclipse.jdt.annotation.Nullable String x) {\n" +
+ " }\n" +
"}"
},
null,
@@ -9588,15 +9588,15 @@ public void testBug484108() {
new String[] {
"test/Test.java",
"package test;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "\n" +
- "public interface Test <T0 extends Other> {\n" +
- " public void a ( @NonNull T0 test );\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "\n" +
+ "public interface Test <T0 extends Other> {\n" +
+ " public void a ( @NonNull T0 test );\n" +
"}\n",
"test/Other.java",
- "package test;\n" +
- "\n" +
+ "package test;\n" +
+ "\n" +
"public interface Other { }\n"
},
getCompilerOptions(),
@@ -9605,26 +9605,26 @@ public void testBug484108() {
false /* don't flush output dir */,
new String[] {
"test/TestImpl.java",
- "package test;\n" +
- "\n" +
+ "package test;\n" +
+ "\n" +
"import org.eclipse.jdt.annotation.NonNull;\n" +
- "import java.lang.reflect.*;\n" +
- "\n" +
- "public class TestImpl <T extends Other> implements Test<T> {\n" +
- "\n" +
- " /**\n" +
- " * {@inheritDoc}\n" +
- " *\n" +
- " * @see test.Test#a(java.lang.Object)\n" +
- " */\n" +
- " @Override\n" +
- " public void a ( @NonNull T test ) {\n" +
+ "import java.lang.reflect.*;\n" +
+ "\n" +
+ "public class TestImpl <T extends Other> implements Test<T> {\n" +
+ "\n" +
+ " /**\n" +
+ " * {@inheritDoc}\n" +
+ " *\n" +
+ " * @see test.Test#a(java.lang.Object)\n" +
+ " */\n" +
+ " @Override\n" +
+ " public void a ( @NonNull T test ) {\n" +
" }\n" +
" public static void main(String... args) {\n" +
" Class<?> c = TestImpl.class;\n" +
" Method[] ms = c.getDeclaredMethods();\n" +
" System.out.println(ms.length);\n" +
- " }\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -9643,17 +9643,17 @@ public void testBug484954() {
CUSTOM_NONNULL_NAME,
CUSTOM_NONNULL_CONTENT, // sic: declaration annotation
"Snippet.java",
- "import java.util.function.*;\n" +
- "import org.foo.*;\n" +
- "\n" +
- "public class Snippet {\n" +
- "\n" +
- " public void test() {\n" +
- " doStuff((@NonNull Object[] data) -> updateSelectionData(data)); \n" +
- " }\n" +
- "\n" +
- " private void doStuff(Consumer<Object[]> postAction) { }\n" +
- " private void updateSelectionData(final @NonNull Object data) { }\n" +
+ "import java.util.function.*;\n" +
+ "import org.foo.*;\n" +
+ "\n" +
+ "public class Snippet {\n" +
+ "\n" +
+ " public void test() {\n" +
+ " doStuff((@NonNull Object[] data) -> updateSelectionData(data)); \n" +
+ " }\n" +
+ "\n" +
+ " private void doStuff(Consumer<Object[]> postAction) { }\n" +
+ " private void updateSelectionData(final @NonNull Object data) { }\n" +
"}\n"
},
customOptions,
@@ -9663,128 +9663,128 @@ public void testBug484981() {
runNegativeTestWithLibs(
new String[] {
"test1/GenericWithNullableBound.java",
- "package test1;\n" +
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "package test1;\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+
+ "@NonNullByDefault\n" +
+ "public class GenericWithNullableBound<T extends @Nullable Number> {\n" +
+ "}\n",
- "@NonNullByDefault\n" +
- "public class GenericWithNullableBound<T extends @Nullable Number> {\n" +
- "}\n",
-
"test1/GenericWithNullableBound2.java",
- "package test1;\n" +
- "import static java.lang.annotation.ElementType.TYPE_USE;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
- "import java.lang.annotation.Target;\n" +
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "package test1;\n" +
+ "import static java.lang.annotation.ElementType.TYPE_USE;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@Target({ TYPE_USE })\n" +
- "@interface SomeAnnotation {\n" +
- "}\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ TYPE_USE })\n" +
+ "@interface SomeAnnotation {\n" +
+ "}\n" +
- "@NonNullByDefault\n" +
- "public class GenericWithNullableBound2<@SomeAnnotation T extends @Nullable Number> {\n" +
- "}\n",
+ "@NonNullByDefault\n" +
+ "public class GenericWithNullableBound2<@SomeAnnotation T extends @Nullable Number> {\n" +
+ "}\n",
- "test1/GenericWithNullable.java",
- "package test1;\n" +
+ "test1/GenericWithNullable.java",
+ "package test1;\n" +
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
- "@NonNullByDefault\n" +
- "public class GenericWithNullable<@Nullable T> {\n" +
+ "@NonNullByDefault\n" +
+ "public class GenericWithNullable<@Nullable T> {\n" +
"}\n",
-
- "test1/GenericWithNonNullBound.java",
- "package test1;\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "test1/GenericWithNonNullBound.java",
+ "package test1;\n" +
+
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
- "public class GenericWithNonNullBound<T extends @NonNull Number> {\n" +
+ "public class GenericWithNonNullBound<T extends @NonNull Number> {\n" +
"}\n",
"test1/ClassInSameProject.java",
- "package test1;\n" +
+ "package test1;\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
- "public class ClassInSameProject {\n" +
- " static void f1() {\n" +
- " new GenericWithNullableBound<@NonNull Number>();\n" +
- " }\n" +
+ "public class ClassInSameProject {\n" +
+ " static void f1() {\n" +
+ " new GenericWithNullableBound<@NonNull Number>();\n" +
+ " }\n" +
- " static void f2() {\n" +
- " new GenericWithNullableBound2<@NonNull Number>();\n" +
- " }\n" +
+ " static void f2() {\n" +
+ " new GenericWithNullableBound2<@NonNull Number>();\n" +
+ " }\n" +
- " static void f3() {\n" +
- " new GenericWithNonNullBound<@Nullable Number>(); // error 1 expected\n" +
- " }\n" +
+ " static void f3() {\n" +
+ " new GenericWithNonNullBound<@Nullable Number>(); // error 1 expected\n" +
+ " }\n" +
- " static void f4() {\n" +
- " new GenericWithNullable<@NonNull Number>(); // error 2 expected\n" +
- " }\n" +
- "}"
+ " static void f4() {\n" +
+ " new GenericWithNullable<@NonNull Number>(); // error 2 expected\n" +
+ " }\n" +
+ "}"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test1\\ClassInSameProject.java (at line 12)\n" +
- " new GenericWithNonNullBound<@Nullable Number>(); // error 1 expected\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@Nullable Number\' is not a valid substitute for the type parameter \'T extends @NonNull Number\'\n" +
- "----------\n" +
- "2. ERROR in test1\\ClassInSameProject.java (at line 15)\n" +
- " new GenericWithNullable<@NonNull Number>(); // error 2 expected\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@NonNull Number\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "1. ERROR in test1\\ClassInSameProject.java (at line 12)\n" +
+ " new GenericWithNonNullBound<@Nullable Number>(); // error 1 expected\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@Nullable Number\' is not a valid substitute for the type parameter \'T extends @NonNull Number\'\n" +
+ "----------\n" +
+ "2. ERROR in test1\\ClassInSameProject.java (at line 15)\n" +
+ " new GenericWithNullable<@NonNull Number>(); // error 2 expected\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@NonNull Number\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
"----------\n"
);
runNegativeTestWithLibs(
new String[] {
"test2/ClassInOtherProject.java",
- "package test2;\n" +
+ "package test2;\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
- "import test1.GenericWithNonNullBound;\n" +
- "import test1.GenericWithNullable;\n" +
- "import test1.GenericWithNullableBound;\n" +
- "import test1.GenericWithNullableBound2;\n" +
+ "import test1.GenericWithNonNullBound;\n" +
+ "import test1.GenericWithNullable;\n" +
+ "import test1.GenericWithNullableBound;\n" +
+ "import test1.GenericWithNullableBound2;\n" +
- "public class ClassInOtherProject {\n" +
- " static void g1() {\n" +
- " new GenericWithNullableBound<@NonNull Number>();\n" +
- " }\n" +
+ "public class ClassInOtherProject {\n" +
+ " static void g1() {\n" +
+ " new GenericWithNullableBound<@NonNull Number>();\n" +
+ " }\n" +
- " static void g2() {\n" +
- " new GenericWithNullableBound2<@NonNull Number>();\n" +
- " }\n" +
+ " static void g2() {\n" +
+ " new GenericWithNullableBound2<@NonNull Number>();\n" +
+ " }\n" +
- " static void g3() {\n" +
- " new GenericWithNonNullBound<@Nullable Number>(); // error 3 expected\n" +
- " }\n" +
+ " static void g3() {\n" +
+ " new GenericWithNonNullBound<@Nullable Number>(); // error 3 expected\n" +
+ " }\n" +
- " static void g4() {\n" +
- " new GenericWithNullable<@NonNull Number>(); // error 4 expected\n" +
- " }\n" +
+ " static void g4() {\n" +
+ " new GenericWithNullable<@NonNull Number>(); // error 4 expected\n" +
+ " }\n" +
"}"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test2\\ClassInOtherProject.java (at line 16)\n" +
- " new GenericWithNonNullBound<@Nullable Number>(); // error 3 expected\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@Nullable Number\' is not a valid substitute for the type parameter \'T extends @NonNull Number\'\n" +
- "----------\n" +
- "2. ERROR in test2\\ClassInOtherProject.java (at line 19)\n" +
- " new GenericWithNullable<@NonNull Number>(); // error 4 expected\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@NonNull Number\' is not a valid substitute for the type parameter \'@Nullable T extends Object\'\n" +
+ "----------\n" +
+ "1. ERROR in test2\\ClassInOtherProject.java (at line 16)\n" +
+ " new GenericWithNonNullBound<@Nullable Number>(); // error 3 expected\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@Nullable Number\' is not a valid substitute for the type parameter \'T extends @NonNull Number\'\n" +
+ "----------\n" +
+ "2. ERROR in test2\\ClassInOtherProject.java (at line 19)\n" +
+ " new GenericWithNullable<@NonNull Number>(); // error 4 expected\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@NonNull Number\' is not a valid substitute for the type parameter \'@Nullable T extends Object\'\n" +
"----------\n"
);
}
@@ -9802,7 +9802,7 @@ public void testBug484981b() {
"public abstract class X1<T extends @NonNull Object> extends ArrayList<T> {\n" +
" public <U, V extends @Nullable Object> void foo(U u, V v) {}\n" +
"}\n",
- "p/X2.java",
+ "p/X2.java",
"package p;\n"+
"import org.eclipse.jdt.annotation.*;\n" +
"public class X2<@Nullable W extends Object> {}\n",
@@ -9817,18 +9817,18 @@ public void testBug484981b() {
" x.<Y1, @NonNull Object>foo(this, new Object());\n" + // OK: 'extends @Nullable' is no restriction
" }\n" +
"}\n"
- },
+ },
customOptions,
- "----------\n" +
- "1. ERROR in Y1.java (at line 5)\n" +
- " X1<@Nullable String> maybeStrings;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@Nullable String\' is not a valid substitute for the type parameter \'T extends @NonNull Object\'\n" +
- "----------\n" +
- "2. ERROR in Y1.java (at line 6)\n" +
- " X2<@NonNull String> strings;\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@NonNull String\' is not a valid substitute for the type parameter \'@Nullable W extends Object\'\n" +
+ "----------\n" +
+ "1. ERROR in Y1.java (at line 5)\n" +
+ " X1<@Nullable String> maybeStrings;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@Nullable String\' is not a valid substitute for the type parameter \'T extends @NonNull Object\'\n" +
+ "----------\n" +
+ "2. ERROR in Y1.java (at line 6)\n" +
+ " X2<@NonNull String> strings;\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@NonNull String\' is not a valid substitute for the type parameter \'@Nullable W extends Object\'\n" +
"----------\n"
);
}
@@ -9838,7 +9838,7 @@ public void testBug484981c() {
Map customOptions = getCompilerOptions();
customOptions.put(JavaCore.COMPILER_PB_POTENTIAL_NULL_REFERENCE, JavaCore.ERROR);
customOptions.put(JavaCore.COMPILER_PB_MISSING_SERIAL_VERSION, JavaCore.IGNORE);
- // fix the bug:
+ // fix the bug:
runNegativeTestWithLibs(
new String[] {
"p/X1.java",
@@ -9848,7 +9848,7 @@ public void testBug484981c() {
"public abstract class X1<T extends java.lang.@NonNull Object> extends ArrayList<T> {\n" +
" public <U, V extends java.lang.@Nullable Object> void foo(U u, V v) {}\n" +
"}\n",
- "p/X2.java",
+ "p/X2.java",
"package p;\n"+
"import org.eclipse.jdt.annotation.*;\n" +
"public class X2<@Nullable W extends Object> {}\n",
@@ -9861,18 +9861,18 @@ public void testBug484981c() {
" x.<Y1, java.lang.@NonNull Object>foo(this, new Object());\n" + // OK: 'extends @Nullable' is no restriction
" }\n" +
"}\n"
- },
+ },
customOptions,
- "----------\n" +
- "1. ERROR in Y1.java (at line 3)\n" +
- " p.X1<java.lang.@Nullable String> maybeStrings;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@Nullable String\' is not a valid substitute for the type parameter \'T extends @NonNull Object\'\n" +
- "----------\n" +
- "2. ERROR in Y1.java (at line 4)\n" +
- " p.X2<java.lang.@NonNull String> strings;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@NonNull String\' is not a valid substitute for the type parameter \'@Nullable W extends Object\'\n" +
+ "----------\n" +
+ "1. ERROR in Y1.java (at line 3)\n" +
+ " p.X1<java.lang.@Nullable String> maybeStrings;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@Nullable String\' is not a valid substitute for the type parameter \'T extends @NonNull Object\'\n" +
+ "----------\n" +
+ "2. ERROR in Y1.java (at line 4)\n" +
+ " p.X2<java.lang.@NonNull String> strings;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@NonNull String\' is not a valid substitute for the type parameter \'@Nullable W extends Object\'\n" +
"----------\n"
);
}
@@ -9910,126 +9910,126 @@ public void testBug484981d() {
" .get(0).put(null, null);\n" + // second null is illegal
" }\n" +
"}\n"
- },
+ },
customOptions,
- "----------\n" +
- "1. ERROR in Y1.java (at line 6)\n" +
- " .get(0).put(null, null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in Y1.java (at line 6)\n" +
+ " .get(0).put(null, null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n");
}
public void testBug466562() {
runNegativeTestWithLibs(
new String[] {
"x/C.java",
- "package x;\n" +
+ "package x;\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
- "@NonNullByDefault({})\n" +
- "public class C <T1 extends @Nullable Number> {\n" +
- " String consume(T1 t) {\n" +
- " @NonNull Object x = t; // error, should warn?\n" +
- " x.toString();\n" +
- " return t.toString(); // legal???\n" +
- " }\n" +
+ "@NonNullByDefault({})\n" +
+ "public class C <T1 extends @Nullable Number> {\n" +
+ " String consume(T1 t) {\n" +
+ " @NonNull Object x = t; // error, should warn?\n" +
+ " x.toString();\n" +
+ " return t.toString(); // legal???\n" +
+ " }\n" +
- " void y() {\n" +
- " consume(null); // illegal - OK\n" +
- " @NonNull Object t = provide(); // error, should warn?\n" +
- " t.toString();\n" +
- " }\n" +
+ " void y() {\n" +
+ " consume(null); // illegal - OK\n" +
+ " @NonNull Object t = provide(); // error, should warn?\n" +
+ " t.toString();\n" +
+ " }\n" +
- " T1 provide() {\n" +
- " return null; // error, should warn?\n" +
- " }\n" +
+ " T1 provide() {\n" +
+ " return null; // error, should warn?\n" +
+ " }\n" +
- " C<Integer> cString; // OK - Null constraint mismatch: The type 'Integer' is not a valid substitute for the type parameter 'T1 extends @Nullable Number'\n" +
- " C<@NonNull Integer> c1String; // Wrong: Null constraint mismatch: The type '@NonNull Integer' is not a valid substitute for the type parameter 'T1 extends @Nullable Number'\n" +
- " C<@Nullable Integer> c2String; // legal - OK\n" +
- "}"
+ " C<Integer> cString; // OK - Null constraint mismatch: The type 'Integer' is not a valid substitute for the type parameter 'T1 extends @Nullable Number'\n" +
+ " C<@NonNull Integer> c1String; // Wrong: Null constraint mismatch: The type '@NonNull Integer' is not a valid substitute for the type parameter 'T1 extends @Nullable Number'\n" +
+ " C<@Nullable Integer> c2String; // legal - OK\n" +
+ "}"
},
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in x\\C.java (at line 5)\n" +
- " @NonNullByDefault({})\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing package x\n" +
- "----------\n" +
- "2. ERROR in x\\C.java (at line 8)\n" +
- " @NonNull Object x = t; // error, should warn?\n" +
- " ^\n" +
- "Null type safety: required \'@NonNull\' but this expression has type \'T1\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "3. ERROR in x\\C.java (at line 10)\n" +
- " return t.toString(); // legal???\n" +
- " ^\n" +
- "Potential null pointer access: this expression has type \'T1\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "4. ERROR in x\\C.java (at line 13)\n" +
- " consume(null); // illegal - OK\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'T1 extends @Nullable Number\' but the provided value is null\n" +
- "----------\n" +
- "5. ERROR in x\\C.java (at line 14)\n" +
- " @NonNull Object t = provide(); // error, should warn?\n" +
- " ^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'T1 extends @Nullable Number\'\n" +
- "----------\n" +
- "6. ERROR in x\\C.java (at line 18)\n" +
- " return null; // error, should warn?\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'T1 extends @Nullable Number\' but the provided value is null\n" +
+ "----------\n" +
+ "1. WARNING in x\\C.java (at line 5)\n" +
+ " @NonNullByDefault({})\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing package x\n" +
+ "----------\n" +
+ "2. ERROR in x\\C.java (at line 8)\n" +
+ " @NonNull Object x = t; // error, should warn?\n" +
+ " ^\n" +
+ "Null type safety: required \'@NonNull\' but this expression has type \'T1\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "3. ERROR in x\\C.java (at line 10)\n" +
+ " return t.toString(); // legal???\n" +
+ " ^\n" +
+ "Potential null pointer access: this expression has type \'T1\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "4. ERROR in x\\C.java (at line 13)\n" +
+ " consume(null); // illegal - OK\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'T1 extends @Nullable Number\' but the provided value is null\n" +
+ "----------\n" +
+ "5. ERROR in x\\C.java (at line 14)\n" +
+ " @NonNull Object t = provide(); // error, should warn?\n" +
+ " ^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'T1 extends @Nullable Number\'\n" +
+ "----------\n" +
+ "6. ERROR in x\\C.java (at line 18)\n" +
+ " return null; // error, should warn?\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'T1 extends @Nullable Number\' but the provided value is null\n" +
"----------\n"
- );
+ );
}
public void testBug485056() {
runConformTestWithLibs(
new String[] {
"TestExplainedValue.java",
"import java.io.Serializable;\n" +
-
+
"import org.eclipse.jdt.annotation.NonNull;\n" +
"import org.eclipse.jdt.annotation.Nullable;\n" +
-
+
"class ExplainedValue<T extends Serializable> {\n" +
" public @Nullable T featureValue;\n" +
"}\n" +
-
+
"public class TestExplainedValue {\n" +
" static @Nullable Serializable g(ExplainedValue<? extends @NonNull Serializable> explainedValue) {\n" +
" return explainedValue.featureValue;\n" +
" }\n" +
"}"
- },
- getCompilerOptions(),
+ },
+ getCompilerOptions(),
""
- );
+ );
}
public void testBug484741() {
runConformTestWithLibs(
new String[] {
"test/Test.java",
"package test;\n" +
- "\n" +
+ "\n" +
"public class Test {\n" +
" static <T, E extends T> void f(java.util.ArrayList<T> list, E element) {\n" +
" list.add(element);" +
" }\n" +
- "\n" +
+ "\n" +
" static <A> void g(A a) {\n" +
" f(new java.util.ArrayList<A>(), a);\n" +
" }\n" +
- "\n" +
+ "\n" +
" static <T1, E1 extends T1> void h(E1 element1, java.util.ArrayList<T1> list1) {\n" +
" f(list1, element1);\n" +
" }\n" +
"}"
- }, getCompilerOptions(), "");
-}
+ }, getCompilerOptions(), "");
+}
public void testBug484741b() {
runConformTestWithLibs(
new String[] {
@@ -10040,7 +10040,7 @@ public void testBug484741b() {
" return e;\n" +
" }\n" +
"}"
- }, getCompilerOptions(), "");
+ }, getCompilerOptions(), "");
}
public void testBug484741c() {
runConformTestWithLibs(
@@ -10064,7 +10064,7 @@ public void testBug484741c() {
" getValues(feature);\n" +
" }\n" +
"}"
- }, getCompilerOptions(), "");
+ }, getCompilerOptions(), "");
}
public void testBug484741d() {
runConformTestWithLibs(
@@ -10076,7 +10076,7 @@ public void testBug484741d() {
"DerivedNNBD.java",
"@org.eclipse.jdt.annotation.NonNullByDefault\n" +
"public class DerivedNNBD<S1 extends Runnable, I1 extends S1> extends BaseNNBD<S1, I1> { \n" +
- "}\n"
+ "}\n"
},
getCompilerOptions(),
"");
@@ -10090,7 +10090,7 @@ public void testBug484741e() {
"import org.eclipse.jdt.annotation.NonNull;\n" +
"\n"+
"abstract class AbstractFeature<T extends @NonNull Serializable> {\n" +
- "}\n",
+ "}\n",
"test/SubFeature.java",
"package test;\n" +
"import java.io.Serializable;\n" +
@@ -10199,38 +10199,38 @@ public void testBug484741Invoke() {
" return f4(e);\n" +
" }\n" +
"}\n"
- },
- getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\TestInterdepInvoke.java (at line 11)\n" +
- " return e; // error 1 expected\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'T\' but this expression has type \'@Nullable E extends T\', where \'T\' is a free type variable\n" +
- "----------\n" +
- "2. ERROR in test\\TestInterdepInvoke.java (at line 29)\n" +
- " return f1(e); // error 2 expected\n" +
- " ^^^^^\n" +
- "Null type mismatch (type annotations): required \'T12\' but this expression has type \'@Nullable E12 extends T12\', where \'T12\' is a free type variable\n" +
- "----------\n" +
- "3. ERROR in test\\TestInterdepInvoke.java (at line 61)\n" +
- " return f3(e); // error 3 expected\n" +
- " ^^^^^\n" +
- "Null type mismatch (type annotations): required \'T31\' but this expression has type \'@Nullable E31 extends T31\', where \'T31\' is a free type variable\n" +
- "----------\n" +
- "4. ERROR in test\\TestInterdepInvoke.java (at line 65)\n" +
- " return f3(e); // error 4 expected\n" +
- " ^^^^^\n" +
- "Null type mismatch (type annotations): required \'T32\' but this expression has type \'@Nullable E32 extends T32\', where \'T32\' is a free type variable\n" +
- "----------\n" +
- "5. ERROR in test\\TestInterdepInvoke.java (at line 79)\n" +
- " return f4(e); /// error 5 expected\n" +
- " ^^^^^\n" +
- "Null type mismatch (type annotations): required \'T41\' but this expression has type \'@Nullable E41 extends T41\', where \'T41\' is a free type variable\n" +
- "----------\n" +
- "6. ERROR in test\\TestInterdepInvoke.java (at line 83)\n" +
- " return f4(e); // error 6 expected\n" +
- " ^^^^^\n" +
- "Null type mismatch (type annotations): required \'T42\' but this expression has type \'@Nullable E42 extends T42\', where \'T42\' is a free type variable\n" +
+ },
+ getCompilerOptions(),
+ "----------\n" +
+ "1. ERROR in test\\TestInterdepInvoke.java (at line 11)\n" +
+ " return e; // error 1 expected\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'T\' but this expression has type \'@Nullable E extends T\', where \'T\' is a free type variable\n" +
+ "----------\n" +
+ "2. ERROR in test\\TestInterdepInvoke.java (at line 29)\n" +
+ " return f1(e); // error 2 expected\n" +
+ " ^^^^^\n" +
+ "Null type mismatch (type annotations): required \'T12\' but this expression has type \'@Nullable E12 extends T12\', where \'T12\' is a free type variable\n" +
+ "----------\n" +
+ "3. ERROR in test\\TestInterdepInvoke.java (at line 61)\n" +
+ " return f3(e); // error 3 expected\n" +
+ " ^^^^^\n" +
+ "Null type mismatch (type annotations): required \'T31\' but this expression has type \'@Nullable E31 extends T31\', where \'T31\' is a free type variable\n" +
+ "----------\n" +
+ "4. ERROR in test\\TestInterdepInvoke.java (at line 65)\n" +
+ " return f3(e); // error 4 expected\n" +
+ " ^^^^^\n" +
+ "Null type mismatch (type annotations): required \'T32\' but this expression has type \'@Nullable E32 extends T32\', where \'T32\' is a free type variable\n" +
+ "----------\n" +
+ "5. ERROR in test\\TestInterdepInvoke.java (at line 79)\n" +
+ " return f4(e); /// error 5 expected\n" +
+ " ^^^^^\n" +
+ "Null type mismatch (type annotations): required \'T41\' but this expression has type \'@Nullable E41 extends T41\', where \'T41\' is a free type variable\n" +
+ "----------\n" +
+ "6. ERROR in test\\TestInterdepInvoke.java (at line 83)\n" +
+ " return f4(e); // error 6 expected\n" +
+ " ^^^^^\n" +
+ "Null type mismatch (type annotations): required \'T42\' but this expression has type \'@Nullable E42 extends T42\', where \'T42\' is a free type variable\n" +
"----------\n"
);
}
@@ -10336,23 +10336,23 @@ public void testBug484741Invoke2() {
" return f4(e);\n" +
" }\n" +
"}\n"
- },
- getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\TestInterdepInvokeNN.java (at line 48)\n" +
- " return f2(e); // error 1 expected\n" +
- " ^\n" +
- "Null type safety: required '@NonNull' but this expression has type 'E21', a free type variable that may represent a '@Nullable' type\n" +
- "----------\n" +
- "2. ERROR in test\\TestInterdepInvokeNN.java (at line 66)\n" +
- " return f3(e); // error 2 expected\n" +
- " ^\n" +
- "Null type safety: required '@NonNull' but this expression has type 'E31', a free type variable that may represent a '@Nullable' type\n" +
- "----------\n" +
- "3. ERROR in test\\TestInterdepInvokeNN.java (at line 84)\n" +
- " return f4(e); // error 3 expected\n" +
- " ^\n" +
- "Null type safety: required '@NonNull' but this expression has type 'E41', a free type variable that may represent a '@Nullable' type\n" +
+ },
+ getCompilerOptions(),
+ "----------\n" +
+ "1. ERROR in test\\TestInterdepInvokeNN.java (at line 48)\n" +
+ " return f2(e); // error 1 expected\n" +
+ " ^\n" +
+ "Null type safety: required '@NonNull' but this expression has type 'E21', a free type variable that may represent a '@Nullable' type\n" +
+ "----------\n" +
+ "2. ERROR in test\\TestInterdepInvokeNN.java (at line 66)\n" +
+ " return f3(e); // error 2 expected\n" +
+ " ^\n" +
+ "Null type safety: required '@NonNull' but this expression has type 'E31', a free type variable that may represent a '@Nullable' type\n" +
+ "----------\n" +
+ "3. ERROR in test\\TestInterdepInvokeNN.java (at line 84)\n" +
+ " return f4(e); // error 3 expected\n" +
+ " ^\n" +
+ "Null type safety: required '@NonNull' but this expression has type 'E41', a free type variable that may represent a '@Nullable' type\n" +
"----------\n"
);
}
@@ -10420,21 +10420,21 @@ public void testBug484741Invoke3() {
" f2(list, e);\n" +
" }\n" +
"}\n",
- },
- getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\TestInterdepInvoke.java (at line 14)\n" +
- " list.add(e); // error expected\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'T2\' but this expression has type \'@Nullable E2 extends T2\', where \'T2\' is a free type variable\n" +
- "----------\n" +
- "2. ERROR in test\\TestInterdepInvoke.java (at line 38)\n" +
- " list.add(e); // error expected\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'@NonNull T8\' but this expression has type \'@Nullable E8 extends @NonNull T8\'\n" +
+ },
+ getCompilerOptions(),
+ "----------\n" +
+ "1. ERROR in test\\TestInterdepInvoke.java (at line 14)\n" +
+ " list.add(e); // error expected\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'T2\' but this expression has type \'@Nullable E2 extends T2\', where \'T2\' is a free type variable\n" +
+ "----------\n" +
+ "2. ERROR in test\\TestInterdepInvoke.java (at line 38)\n" +
+ " list.add(e); // error expected\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull T8\' but this expression has type \'@Nullable E8 extends @NonNull T8\'\n" +
"----------\n"
- );
-}
+ );
+}
public void testBug484471SubclassNullable() {
@@ -10513,49 +10513,49 @@ public void testBug484471SubclassNullable() {
"\n" +
" static class B44<@Nullable T44, @Nullable E44 extends T44> extends A4<T44, E44> {\n" +
" }\n" +
- "}\n"
- },
+ "}\n"
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\TestInterdepSubClass.java (at line 34)\n" +
- " static class B21<T21, E21 extends T21> extends A2<T21, E21> { // expect error 1\n" +
- " ^^^\n" +
- "Null constraint mismatch: The type \'E21 extends T21\' is not a valid substitute for the type parameter \'@Nullable E extends T\'\n" +
- "----------\n" +
- "2. ERROR in test\\TestInterdepSubClass.java (at line 40)\n" +
- " static class B23<@Nullable T23, E23 extends T23> extends A2<T23, E23> { // expect error 2\n" +
- " ^^^\n" +
- "Null constraint mismatch: The type \'E23 extends @Nullable T23\' is not a valid substitute for the type parameter \'@Nullable E extends T\'\n" +
- "----------\n" +
- "3. ERROR in test\\TestInterdepSubClass.java (at line 48)\n" +
- " static class B31<T31, E31 extends T31> extends A3<T31, E31> { // expect error 3\n" +
- " ^^^\n" +
- "Null constraint mismatch: The type \'T31\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
- "----------\n" +
- "4. ERROR in test\\TestInterdepSubClass.java (at line 51)\n" +
- " static class B32<T32, @Nullable E32 extends T32> extends A3<T32, E32> { // expect error 4\n" +
- " ^^^\n" +
- "Null constraint mismatch: The type \'T32\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
- "----------\n" +
- "5. ERROR in test\\TestInterdepSubClass.java (at line 62)\n" +
- " static class B41<T41, E41 extends T41> extends A4<T41, E41> { // expect errors 5 & 6\n" +
- " ^^^\n" +
- "Null constraint mismatch: The type \'T41\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
- "----------\n" +
- "6. ERROR in test\\TestInterdepSubClass.java (at line 62)\n" +
- " static class B41<T41, E41 extends T41> extends A4<T41, E41> { // expect errors 5 & 6\n" +
- " ^^^\n" +
- "Null constraint mismatch: The type \'E41 extends T41\' is not a valid substitute for the type parameter \'@Nullable E extends @Nullable T\'\n" +
- "----------\n" +
- "7. ERROR in test\\TestInterdepSubClass.java (at line 65)\n" +
- " static class B42<T42, @Nullable E42 extends T42> extends A4<T42, E42> { // expect error 7\n" +
- " ^^^\n" +
- "Null constraint mismatch: The type \'T42\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
- "----------\n" +
- "8. ERROR in test\\TestInterdepSubClass.java (at line 68)\n" +
- " static class B43<@Nullable T43, E43 extends T43> extends A4<T43, E43> { // expect error 8\n" +
- " ^^^\n" +
- "Null constraint mismatch: The type \'E43 extends @Nullable T43\' is not a valid substitute for the type parameter \'@Nullable E extends @Nullable T\'\n" +
+ "----------\n" +
+ "1. ERROR in test\\TestInterdepSubClass.java (at line 34)\n" +
+ " static class B21<T21, E21 extends T21> extends A2<T21, E21> { // expect error 1\n" +
+ " ^^^\n" +
+ "Null constraint mismatch: The type \'E21 extends T21\' is not a valid substitute for the type parameter \'@Nullable E extends T\'\n" +
+ "----------\n" +
+ "2. ERROR in test\\TestInterdepSubClass.java (at line 40)\n" +
+ " static class B23<@Nullable T23, E23 extends T23> extends A2<T23, E23> { // expect error 2\n" +
+ " ^^^\n" +
+ "Null constraint mismatch: The type \'E23 extends @Nullable T23\' is not a valid substitute for the type parameter \'@Nullable E extends T\'\n" +
+ "----------\n" +
+ "3. ERROR in test\\TestInterdepSubClass.java (at line 48)\n" +
+ " static class B31<T31, E31 extends T31> extends A3<T31, E31> { // expect error 3\n" +
+ " ^^^\n" +
+ "Null constraint mismatch: The type \'T31\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "4. ERROR in test\\TestInterdepSubClass.java (at line 51)\n" +
+ " static class B32<T32, @Nullable E32 extends T32> extends A3<T32, E32> { // expect error 4\n" +
+ " ^^^\n" +
+ "Null constraint mismatch: The type \'T32\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "5. ERROR in test\\TestInterdepSubClass.java (at line 62)\n" +
+ " static class B41<T41, E41 extends T41> extends A4<T41, E41> { // expect errors 5 & 6\n" +
+ " ^^^\n" +
+ "Null constraint mismatch: The type \'T41\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "6. ERROR in test\\TestInterdepSubClass.java (at line 62)\n" +
+ " static class B41<T41, E41 extends T41> extends A4<T41, E41> { // expect errors 5 & 6\n" +
+ " ^^^\n" +
+ "Null constraint mismatch: The type \'E41 extends T41\' is not a valid substitute for the type parameter \'@Nullable E extends @Nullable T\'\n" +
+ "----------\n" +
+ "7. ERROR in test\\TestInterdepSubClass.java (at line 65)\n" +
+ " static class B42<T42, @Nullable E42 extends T42> extends A4<T42, E42> { // expect error 7\n" +
+ " ^^^\n" +
+ "Null constraint mismatch: The type \'T42\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "8. ERROR in test\\TestInterdepSubClass.java (at line 68)\n" +
+ " static class B43<@Nullable T43, E43 extends T43> extends A4<T43, E43> { // expect error 8\n" +
+ " ^^^\n" +
+ "Null constraint mismatch: The type \'E43 extends @Nullable T43\' is not a valid substitute for the type parameter \'@Nullable E extends @Nullable T\'\n" +
"----------\n"
);
}
@@ -10641,43 +10641,43 @@ public void testBug484471SubclassNonNull() {
" static class B44<@NonNull T44, @NonNull E44 extends T44> extends A4<T44, E44> {\n" +
" }\n" +
"}\n"
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\TestInterdepSubClassNN.java (at line 39)\n" +
- " static class B21<T21, @SomeAnnotation E21 extends T21> extends A2<T21, E21> { // expect error 1\n" +
- " ^^^\n" +
- "Null constraint mismatch: The type \'E21 extends T21\' is not a valid substitute for the type parameter \'@NonNull E extends T\'\n" +
- "----------\n" +
- "2. ERROR in test\\TestInterdepSubClassNN.java (at line 53)\n" +
- " static class B31<T31, @SomeAnnotation E31 extends T31> extends A3<T31, E31> { // expect errors 2 & 3\n" +
- " ^^^\n" +
- "Null constraint mismatch: The type \'T31\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
- "----------\n" +
- "3. ERROR in test\\TestInterdepSubClassNN.java (at line 53)\n" +
- " static class B31<T31, @SomeAnnotation E31 extends T31> extends A3<T31, E31> { // expect errors 2 & 3\n" +
- " ^^^\n" +
- "Null constraint mismatch: The type \'E31 extends T31\' is not a valid substitute for the type parameter \'E extends @NonNull T\'\n" +
- "----------\n" +
- "4. ERROR in test\\TestInterdepSubClassNN.java (at line 56)\n" +
- " static class B32<T32, @NonNull E32 extends T32> extends A3<T32, E32> { // expect error 4\n" +
- " ^^^\n" +
- "Null constraint mismatch: The type \'T32\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
- "----------\n" +
- "5. ERROR in test\\TestInterdepSubClassNN.java (at line 67)\n" +
- " static class B41<T41, @SomeAnnotation E41 extends T41> extends A4<T41, E41> { // expect error 5 & 6\n" +
- " ^^^\n" +
- "Null constraint mismatch: The type \'T41\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
- "----------\n" +
- "6. ERROR in test\\TestInterdepSubClassNN.java (at line 67)\n" +
- " static class B41<T41, @SomeAnnotation E41 extends T41> extends A4<T41, E41> { // expect error 5 & 6\n" +
- " ^^^\n" +
- "Null constraint mismatch: The type \'E41 extends T41\' is not a valid substitute for the type parameter \'@NonNull E extends @NonNull T\'\n" +
- "----------\n" +
- "7. ERROR in test\\TestInterdepSubClassNN.java (at line 70)\n" +
- " static class B42<T42, @NonNull E42 extends T42> extends A4<T42, E42> { // expect error 7\n" +
- " ^^^\n" +
- "Null constraint mismatch: The type \'T42\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
+ "----------\n" +
+ "1. ERROR in test\\TestInterdepSubClassNN.java (at line 39)\n" +
+ " static class B21<T21, @SomeAnnotation E21 extends T21> extends A2<T21, E21> { // expect error 1\n" +
+ " ^^^\n" +
+ "Null constraint mismatch: The type \'E21 extends T21\' is not a valid substitute for the type parameter \'@NonNull E extends T\'\n" +
+ "----------\n" +
+ "2. ERROR in test\\TestInterdepSubClassNN.java (at line 53)\n" +
+ " static class B31<T31, @SomeAnnotation E31 extends T31> extends A3<T31, E31> { // expect errors 2 & 3\n" +
+ " ^^^\n" +
+ "Null constraint mismatch: The type \'T31\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
+ "----------\n" +
+ "3. ERROR in test\\TestInterdepSubClassNN.java (at line 53)\n" +
+ " static class B31<T31, @SomeAnnotation E31 extends T31> extends A3<T31, E31> { // expect errors 2 & 3\n" +
+ " ^^^\n" +
+ "Null constraint mismatch: The type \'E31 extends T31\' is not a valid substitute for the type parameter \'E extends @NonNull T\'\n" +
+ "----------\n" +
+ "4. ERROR in test\\TestInterdepSubClassNN.java (at line 56)\n" +
+ " static class B32<T32, @NonNull E32 extends T32> extends A3<T32, E32> { // expect error 4\n" +
+ " ^^^\n" +
+ "Null constraint mismatch: The type \'T32\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
+ "----------\n" +
+ "5. ERROR in test\\TestInterdepSubClassNN.java (at line 67)\n" +
+ " static class B41<T41, @SomeAnnotation E41 extends T41> extends A4<T41, E41> { // expect error 5 & 6\n" +
+ " ^^^\n" +
+ "Null constraint mismatch: The type \'T41\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
+ "----------\n" +
+ "6. ERROR in test\\TestInterdepSubClassNN.java (at line 67)\n" +
+ " static class B41<T41, @SomeAnnotation E41 extends T41> extends A4<T41, E41> { // expect error 5 & 6\n" +
+ " ^^^\n" +
+ "Null constraint mismatch: The type \'E41 extends T41\' is not a valid substitute for the type parameter \'@NonNull E extends @NonNull T\'\n" +
+ "----------\n" +
+ "7. ERROR in test\\TestInterdepSubClassNN.java (at line 70)\n" +
+ " static class B42<T42, @NonNull E42 extends T42> extends A4<T42, E42> { // expect error 7\n" +
+ " ^^^\n" +
+ "Null constraint mismatch: The type \'T42\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
"----------\n"
);
}
@@ -10713,35 +10713,35 @@ public void testBug485058() {
" getValues(feature);\n" +
" }\n" +
"}"
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\Test4.java (at line 25)\n" +
- " public static void g(Feature4<@Nullable ? extends @NonNull Serializable> feature) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@Nullable ? extends @NonNull Serializable\' is not a valid substitute for the type parameter \'Q extends @NonNull Serializable\'\n" +
- "----------\n" +
- "2. ERROR in test\\Test4.java (at line 25)\n" +
- " public static void g(Feature4<@Nullable ? extends @NonNull Serializable> feature) {\n" +
- " ^^^^^^^^\n" +
- "This nullness annotation conflicts with a \'@Nullable\' annotation which is effective on the same type parameter \n" +
- "----------\n" +
- "3. ERROR in test\\Test4.java (at line 26)\n" +
- " getValues(feature);\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@NonNull Feature4<@Nullable capture#of ? extends @NonNull Serializable>\' is not a valid substitute for the type parameter \'F extends @NonNull Feature4<Q1 extends @NonNull Serializable>\'\n" +
+ "----------\n" +
+ "1. ERROR in test\\Test4.java (at line 25)\n" +
+ " public static void g(Feature4<@Nullable ? extends @NonNull Serializable> feature) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@Nullable ? extends @NonNull Serializable\' is not a valid substitute for the type parameter \'Q extends @NonNull Serializable\'\n" +
+ "----------\n" +
+ "2. ERROR in test\\Test4.java (at line 25)\n" +
+ " public static void g(Feature4<@Nullable ? extends @NonNull Serializable> feature) {\n" +
+ " ^^^^^^^^\n" +
+ "This nullness annotation conflicts with a \'@Nullable\' annotation which is effective on the same type parameter \n" +
+ "----------\n" +
+ "3. ERROR in test\\Test4.java (at line 26)\n" +
+ " getValues(feature);\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@NonNull Feature4<@Nullable capture#of ? extends @NonNull Serializable>\' is not a valid substitute for the type parameter \'F extends @NonNull Feature4<Q1 extends @NonNull Serializable>\'\n" +
"----------\n"
- );
+ );
}
public void testBug485030() {
runConformTestWithLibs(new String[] {
"SomeAnnotation.java",
- "import static java.lang.annotation.ElementType.TYPE_USE;\n" +
- "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.TYPE_USE;\n" +
+ "import java.lang.annotation.Target;\n" +
- "@Target({ TYPE_USE })\n" +
- "@interface SomeAnnotation {\n" +
- "}\n",
+ "@Target({ TYPE_USE })\n" +
+ "@interface SomeAnnotation {\n" +
+ "}\n",
"TestContradictoryOnGenericArray.java",
"import java.io.Serializable;\n" +
@@ -10790,23 +10790,23 @@ public void testBug485302() {
" }\n" +
"}\n" +
""
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in WildCardNullable.java (at line 21)\n" +
- " return a.returnNull(); // error 1 expected\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Number\' but this expression has type \'@Nullable capture#of ? extends Number\'\n" +
- "----------\n" +
- "2. ERROR in WildCardNullable.java (at line 25)\n" +
- " a.acceptNonNullT(t); // warning 2 expected\n" +
- " ^\n" +
- "Null type safety: required '@NonNull' but this expression has type 'T', a free type variable that may represent a '@Nullable' type\n" +
- "----------\n" +
- "3. ERROR in WildCardNullable.java (at line 26)\n" +
- " a.acceptNonNullObject(t); // warning 3 expected\n" +
- " ^\n" +
- "Null type safety: required '@NonNull' but this expression has type 'T', a free type variable that may represent a '@Nullable' type\n" +
+ "----------\n" +
+ "1. ERROR in WildCardNullable.java (at line 21)\n" +
+ " return a.returnNull(); // error 1 expected\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Number\' but this expression has type \'@Nullable capture#of ? extends Number\'\n" +
+ "----------\n" +
+ "2. ERROR in WildCardNullable.java (at line 25)\n" +
+ " a.acceptNonNullT(t); // warning 2 expected\n" +
+ " ^\n" +
+ "Null type safety: required '@NonNull' but this expression has type 'T', a free type variable that may represent a '@Nullable' type\n" +
+ "----------\n" +
+ "3. ERROR in WildCardNullable.java (at line 26)\n" +
+ " a.acceptNonNullObject(t); // warning 3 expected\n" +
+ " ^\n" +
+ "Null type safety: required '@NonNull' but this expression has type 'T', a free type variable that may represent a '@Nullable' type\n" +
"----------\n"
);
}
@@ -10814,15 +10814,15 @@ public void testBug485302() {
public void testBug485027() {
runConformTestWithLibs(new String[] {
"SomeAnnotation.java",
- "import static java.lang.annotation.ElementType.TYPE_USE;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
- "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.TYPE_USE;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
+ "import java.lang.annotation.Target;\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@Target({ TYPE_USE })\n" +
- "@interface SomeAnnotation {\n" +
- "}\n",
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ TYPE_USE })\n" +
+ "@interface SomeAnnotation {\n" +
+ "}\n",
"Base.java",
"import java.io.Serializable;\n" +
@@ -10836,7 +10836,7 @@ public void testBug485027() {
" }\n" +
"}\n"
}, getCompilerOptions(), "");
-
+
runConformTestWithLibs(
false /* don't flush */,
new String[] {
@@ -10868,7 +10868,7 @@ public void testBug485565() {
" @Nullable\n" +
" public Registry registry;\n" +
"}\n"
- },
+ },
getCompilerOptions(),
""
);
@@ -10957,10 +10957,10 @@ public void testBug485814() {
" }\n" +
"}\n" +
""
- },
+ },
getCompilerOptions(),
""
- );
+ );
}
public void testBug485581() {
runConformTestWithLibs(
@@ -11004,7 +11004,7 @@ public void testBug485581() {
" }\n" +
" }\n" +
"}\n",
- },
+ },
getCompilerOptions(),
""
);
@@ -11022,7 +11022,7 @@ public void testBug482752_lambda() {
"\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -11045,7 +11045,7 @@ public void testBug482752_lambda() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -11064,7 +11064,7 @@ public void testBug482752_methodref() {
"\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -11087,7 +11087,7 @@ public void testBug482752_methodref() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -11110,7 +11110,7 @@ public void testBug485374() {
"public class D implements I<I.@NonNull Nested> {\n" +
"}\n" +
""
- },
+ },
getCompilerOptions(),
""
);
@@ -11121,13 +11121,13 @@ public void testBug485374() {
"package test2;\n" +
"import test.D;\n" +
"class Import {}\n"
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in test2\\Import.java (at line 2)\n" +
- " import test.D;\n" +
- " ^^^^^^\n" +
- "The import test.D is never used\n" +
+ "----------\n" +
+ "1. WARNING in test2\\Import.java (at line 2)\n" +
+ " import test.D;\n" +
+ " ^^^^^^\n" +
+ "The import test.D is never used\n" +
"----------\n"
);
}
@@ -11145,18 +11145,18 @@ public void testBug466556a() {
" return null; // NOT OK since T could require nonnull\n" +
" }\n" +
"}\n",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\C.java (at line 4)\n" +
- " return t.intValue(); // NOT OK since T could be nullable\n" +
- " ^\n" +
- "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "2. ERROR in test\\C.java (at line 7)\n" +
- " return null; // NOT OK since T could require nonnull\n" +
- " ^^^^\n" +
- "Null type mismatch (type annotations): \'null\' is not compatible to the free type variable \'T\'\n" +
+ "----------\n" +
+ "1. ERROR in test\\C.java (at line 4)\n" +
+ " return t.intValue(); // NOT OK since T could be nullable\n" +
+ " ^\n" +
+ "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "2. ERROR in test\\C.java (at line 7)\n" +
+ " return null; // NOT OK since T could require nonnull\n" +
+ " ^^^^\n" +
+ "Null type mismatch (type annotations): \'null\' is not compatible to the free type variable \'T\'\n" +
"----------\n"
);
}
@@ -11173,13 +11173,13 @@ public void testBug466556nonfree() {
" return null; // NOT OK since T could require nonnull\n" +
" }\n" +
"}\n",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\C.java (at line 7)\n" +
- " return null; // NOT OK since T could require nonnull\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'T extends @NonNull Number\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in test\\C.java (at line 7)\n" +
+ " return null; // NOT OK since T could require nonnull\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'T extends @NonNull Number\' but the provided value is null\n" +
"----------\n"
);
}
@@ -11199,18 +11199,18 @@ public void testBug466556b() {
" s.get().hashCode();\n" +
" }\n" +
"}\n",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\C.java (at line 7)\n" +
- " return t.hashCode();\n" +
- " ^\n" +
- "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "2. ERROR in test\\C.java (at line 10)\n" +
- " s.get().hashCode();\n" +
- " ^^^^^^^\n" +
- "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "1. ERROR in test\\C.java (at line 7)\n" +
+ " return t.hashCode();\n" +
+ " ^\n" +
+ "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "2. ERROR in test\\C.java (at line 10)\n" +
+ " s.get().hashCode();\n" +
+ " ^^^^^^^\n" +
+ "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
"----------\n"
);
}
@@ -11233,18 +11233,18 @@ public void testBug466556c() {
" return n.intValue();\n" +
" }\n" +
"}\n",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\C.java (at line 8)\n" +
- " return n.intValue();\n" +
- " ^\n" +
- "Potential null pointer access: The variable n may be null at this location\n" +
- "----------\n" +
- "2. ERROR in test\\C.java (at line 13)\n" +
- " return n.intValue();\n" +
- " ^\n" +
- "Potential null pointer access: The variable n may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in test\\C.java (at line 8)\n" +
+ " return n.intValue();\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable n may be null at this location\n" +
+ "----------\n" +
+ "2. ERROR in test\\C.java (at line 13)\n" +
+ " return n.intValue();\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable n may be null at this location\n" +
"----------\n"
);
}
@@ -11305,63 +11305,63 @@ public void testBug466556field() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\D.java (at line 7)\n" +
- " T t;\n" +
- " ^\n" +
- "The field t may not have been initialized, whereas its type \'T\' is a free type variable that may represent a \'@NonNull\' type\n" +
- "----------\n" +
- "2. ERROR in test\\D.java (at line 27)\n" +
- " D(@NonNull T t) {\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The field t1 may not have been initialized, whereas its type \'T\' is a free type variable that may represent a \'@NonNull\' type. Note that a problem regarding missing \'default:\' on \'switch\' has been suppressed, which is perhaps related to this problem\n" +
- "----------\n" +
- "3. ERROR in test\\D.java (at line 27)\n" +
- " D(@NonNull T t) {\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The field t3 may not have been initialized, whereas its type \'T\' is a free type variable that may represent a \'@NonNull\' type. Note that a problem regarding missing \'default:\' on \'switch\' has been suppressed, which is perhaps related to this problem\n" +
- "----------\n" +
- "4. ERROR in test\\D.java (at line 27)\n" +
- " D(@NonNull T t) {\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The @NonNull field t5 may not have been initialized. Note that a problem regarding missing \'default:\' on \'switch\' has been suppressed, which is perhaps related to this problem\n" +
- "----------\n" +
- "5. ERROR in test\\D.java (at line 27)\n" +
- " D(@NonNull T t) {\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The @NonNull field t7 may not have been initialized. Note that a problem regarding missing \'default:\' on \'switch\' has been suppressed, which is perhaps related to this problem\n" +
- "----------\n" +
- "6. ERROR in test\\D.java (at line 38)\n" +
- " t1.hashCode();\n" +
- " ^^\n" +
- "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "7. ERROR in test\\D.java (at line 39)\n" +
- " t2.hashCode();\n" +
- " ^^\n" +
- "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "8. ERROR in test\\D.java (at line 40)\n" +
- " t3.hashCode();\n" +
- " ^^\n" +
- "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "9. ERROR in test\\D.java (at line 41)\n" +
- " t4.hashCode();\n" +
- " ^^\n" +
- "Potential null pointer access: this expression has a \'@Nullable\' type\n" +
- "----------\n" +
- "10. ERROR in test\\D.java (at line 46)\n" +
- " t.hashCode();\n" +
- " ^\n" +
- "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "11. ERROR in test\\D.java (at line 50)\n" +
- " t1.hashCode();\n" +
- " ^^\n" +
- "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "1. ERROR in test\\D.java (at line 7)\n" +
+ " T t;\n" +
+ " ^\n" +
+ "The field t may not have been initialized, whereas its type \'T\' is a free type variable that may represent a \'@NonNull\' type\n" +
+ "----------\n" +
+ "2. ERROR in test\\D.java (at line 27)\n" +
+ " D(@NonNull T t) {\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The field t1 may not have been initialized, whereas its type \'T\' is a free type variable that may represent a \'@NonNull\' type. Note that a problem regarding missing \'default:\' on \'switch\' has been suppressed, which is perhaps related to this problem\n" +
+ "----------\n" +
+ "3. ERROR in test\\D.java (at line 27)\n" +
+ " D(@NonNull T t) {\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The field t3 may not have been initialized, whereas its type \'T\' is a free type variable that may represent a \'@NonNull\' type. Note that a problem regarding missing \'default:\' on \'switch\' has been suppressed, which is perhaps related to this problem\n" +
+ "----------\n" +
+ "4. ERROR in test\\D.java (at line 27)\n" +
+ " D(@NonNull T t) {\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The @NonNull field t5 may not have been initialized. Note that a problem regarding missing \'default:\' on \'switch\' has been suppressed, which is perhaps related to this problem\n" +
+ "----------\n" +
+ "5. ERROR in test\\D.java (at line 27)\n" +
+ " D(@NonNull T t) {\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The @NonNull field t7 may not have been initialized. Note that a problem regarding missing \'default:\' on \'switch\' has been suppressed, which is perhaps related to this problem\n" +
+ "----------\n" +
+ "6. ERROR in test\\D.java (at line 38)\n" +
+ " t1.hashCode();\n" +
+ " ^^\n" +
+ "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "7. ERROR in test\\D.java (at line 39)\n" +
+ " t2.hashCode();\n" +
+ " ^^\n" +
+ "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "8. ERROR in test\\D.java (at line 40)\n" +
+ " t3.hashCode();\n" +
+ " ^^\n" +
+ "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "9. ERROR in test\\D.java (at line 41)\n" +
+ " t4.hashCode();\n" +
+ " ^^\n" +
+ "Potential null pointer access: this expression has a \'@Nullable\' type\n" +
+ "----------\n" +
+ "10. ERROR in test\\D.java (at line 46)\n" +
+ " t.hashCode();\n" +
+ " ^\n" +
+ "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "11. ERROR in test\\D.java (at line 50)\n" +
+ " t1.hashCode();\n" +
+ " ^^\n" +
+ "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
"----------\n"
);
}
@@ -11379,7 +11379,7 @@ public void testBug466556withRaw() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -11400,13 +11400,13 @@ public void testBug466556withPGMB() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\TestWithParameterizedGenericMethodBinding.java (at line 9)\n" +
- " f1(e).hashCode();\n" +
- " ^^^^^\n" +
- "Potential null pointer access: this expression has type \'E11\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "1. ERROR in test\\TestWithParameterizedGenericMethodBinding.java (at line 9)\n" +
+ " f1(e).hashCode();\n" +
+ " ^^^^^\n" +
+ "Potential null pointer access: this expression has type \'E11\', a free type variable that may represent a \'@Nullable\' type\n" +
"----------\n"
);
}
@@ -11454,48 +11454,48 @@ public void testBug466556captures() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\TestCapture.java (at line 25)\n" +
- " int i1 = ke.e.i; // error 1\n" +
- " ^\n" +
- "Potential null pointer access: this expression has type \'E2\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "2. ERROR in test\\TestCapture.java (at line 26)\n" +
- " ke.e.s().substring(i1); // error 2\n" +
- " ^\n" +
- "Potential null pointer access: this expression has type \'E2\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "3. ERROR in test\\TestCapture.java (at line 27)\n" +
- " int i2 = ke.getE().i; // error 3\n" +
- " ^^^^^^^^^\n" +
- "Potential null pointer access: this expression has type \'E2\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "4. ERROR in test\\TestCapture.java (at line 28)\n" +
- " ke.getE().s().substring(i2); // error 4\n" +
- " ^^^^^^^^^\n" +
- "Potential null pointer access: this expression has type \'E2\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "5. ERROR in test\\TestCapture.java (at line 34)\n" +
- " int i1 = ke.e.i; // error 5\n" +
- " ^\n" +
- "Potential null pointer access: this expression has type \'capture#1-of ? extends test.I\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "6. ERROR in test\\TestCapture.java (at line 35)\n" +
- " ke.e.s().substring(i1); // error 6\n" +
- " ^\n" +
- "Potential null pointer access: this expression has type \'capture#2-of ? extends test.I\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "7. ERROR in test\\TestCapture.java (at line 36)\n" +
- " int i2 = ke.getE().i; // error 7\n" +
- " ^^^^^^^^^\n" +
- "Potential null pointer access: this expression has type \'capture#3-of ? extends test.I\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "8. ERROR in test\\TestCapture.java (at line 37)\n" +
- " ke.getE().s().substring(i2); // error 8\n" +
- " ^^^^^^^^^\n" +
- "Potential null pointer access: this expression has type \'capture#4-of ? extends test.I\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "1. ERROR in test\\TestCapture.java (at line 25)\n" +
+ " int i1 = ke.e.i; // error 1\n" +
+ " ^\n" +
+ "Potential null pointer access: this expression has type \'E2\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "2. ERROR in test\\TestCapture.java (at line 26)\n" +
+ " ke.e.s().substring(i1); // error 2\n" +
+ " ^\n" +
+ "Potential null pointer access: this expression has type \'E2\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "3. ERROR in test\\TestCapture.java (at line 27)\n" +
+ " int i2 = ke.getE().i; // error 3\n" +
+ " ^^^^^^^^^\n" +
+ "Potential null pointer access: this expression has type \'E2\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "4. ERROR in test\\TestCapture.java (at line 28)\n" +
+ " ke.getE().s().substring(i2); // error 4\n" +
+ " ^^^^^^^^^\n" +
+ "Potential null pointer access: this expression has type \'E2\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "5. ERROR in test\\TestCapture.java (at line 34)\n" +
+ " int i1 = ke.e.i; // error 5\n" +
+ " ^\n" +
+ "Potential null pointer access: this expression has type \'capture#1-of ? extends test.I\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "6. ERROR in test\\TestCapture.java (at line 35)\n" +
+ " ke.e.s().substring(i1); // error 6\n" +
+ " ^\n" +
+ "Potential null pointer access: this expression has type \'capture#2-of ? extends test.I\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "7. ERROR in test\\TestCapture.java (at line 36)\n" +
+ " int i2 = ke.getE().i; // error 7\n" +
+ " ^^^^^^^^^\n" +
+ "Potential null pointer access: this expression has type \'capture#3-of ? extends test.I\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "8. ERROR in test\\TestCapture.java (at line 37)\n" +
+ " ke.getE().s().substring(i2); // error 8\n" +
+ " ^^^^^^^^^\n" +
+ "Potential null pointer access: this expression has type \'capture#4-of ? extends test.I\', a free type variable that may represent a \'@Nullable\' type\n" +
"----------\n"
);
}
@@ -11553,63 +11553,63 @@ public void testBug466556Loops() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\TestLoop.java (at line 13)\n" +
- " nn(t1); // 1: unchecked warning\n" +
- " ^^\n" +
- "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "2. ERROR in test\\TestLoop.java (at line 15)\n" +
- " nn(t1); // 2: unchecked warning\n" +
- " ^^\n" +
- "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "3. ERROR in test\\TestLoop.java (at line 16)\n" +
- " t1.hashCode(); // 3: Potential null pointer access...free type variable\n" +
- " ^^\n" +
- "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "4. ERROR in test\\TestLoop.java (at line 22)\n" +
- " nn(t1); // 4: unchecked warning\n" +
- " ^^\n" +
- "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "5. ERROR in test\\TestLoop.java (at line 23)\n" +
- " t1.hashCode(); // 5: Potential null pointer access...free type variable\n" +
- " ^^\n" +
- "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "6. ERROR in test\\TestLoop.java (at line 31)\n" +
- " nn(t1); // 6: unchecked warning\n" +
- " ^^\n" +
- "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "7. ERROR in test\\TestLoop.java (at line 32)\n" +
- " t1.hashCode(); // 7: Potential null pointer access...free type variable\n" +
- " ^^\n" +
- "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "8. ERROR in test\\TestLoop.java (at line 38)\n" +
- " nn(t1); // 8: unchecked warning\n" +
- " ^^\n" +
- "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "9. ERROR in test\\TestLoop.java (at line 39)\n" +
- " t1.hashCode(); // 9: Potential null pointer access...free type variable\n" +
- " ^^\n" +
- "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "10. ERROR in test\\TestLoop.java (at line 45)\n" +
- " nn(t1); // 10: unchecked warning\n" +
- " ^^\n" +
- "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "11. ERROR in test\\TestLoop.java (at line 46)\n" +
- " t1.hashCode(); // 11: Potential null pointer access: The variable t1 may be null at this location\n" +
- " ^^\n" +
- "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "1. ERROR in test\\TestLoop.java (at line 13)\n" +
+ " nn(t1); // 1: unchecked warning\n" +
+ " ^^\n" +
+ "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "2. ERROR in test\\TestLoop.java (at line 15)\n" +
+ " nn(t1); // 2: unchecked warning\n" +
+ " ^^\n" +
+ "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "3. ERROR in test\\TestLoop.java (at line 16)\n" +
+ " t1.hashCode(); // 3: Potential null pointer access...free type variable\n" +
+ " ^^\n" +
+ "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "4. ERROR in test\\TestLoop.java (at line 22)\n" +
+ " nn(t1); // 4: unchecked warning\n" +
+ " ^^\n" +
+ "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "5. ERROR in test\\TestLoop.java (at line 23)\n" +
+ " t1.hashCode(); // 5: Potential null pointer access...free type variable\n" +
+ " ^^\n" +
+ "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "6. ERROR in test\\TestLoop.java (at line 31)\n" +
+ " nn(t1); // 6: unchecked warning\n" +
+ " ^^\n" +
+ "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "7. ERROR in test\\TestLoop.java (at line 32)\n" +
+ " t1.hashCode(); // 7: Potential null pointer access...free type variable\n" +
+ " ^^\n" +
+ "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "8. ERROR in test\\TestLoop.java (at line 38)\n" +
+ " nn(t1); // 8: unchecked warning\n" +
+ " ^^\n" +
+ "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "9. ERROR in test\\TestLoop.java (at line 39)\n" +
+ " t1.hashCode(); // 9: Potential null pointer access...free type variable\n" +
+ " ^^\n" +
+ "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "10. ERROR in test\\TestLoop.java (at line 45)\n" +
+ " nn(t1); // 10: unchecked warning\n" +
+ " ^^\n" +
+ "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "11. ERROR in test\\TestLoop.java (at line 46)\n" +
+ " t1.hashCode(); // 11: Potential null pointer access: The variable t1 may be null at this location\n" +
+ " ^^\n" +
+ "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
"----------\n"
);
}
@@ -11629,11 +11629,11 @@ public void testBug461268() {
"}\n"
},
compilerOptions,
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " @NonNull String s = list.get(0);\n" +
- " ^^^^^^^^^^^\n" +
- "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'List<@NonNull String>\'. Type \'List<E>\' doesn\'t seem to be designed with null type annotations in mind\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " @NonNull String s = list.get(0);\n" +
+ " ^^^^^^^^^^^\n" +
+ "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'List<@NonNull String>\'. Type \'List<E>\' doesn\'t seem to be designed with null type annotations in mind\n" +
"----------\n");
}
public void testBug461268invoke() {
@@ -11651,11 +11651,11 @@ public void testBug461268invoke() {
"}\n"
},
compilerOptions,
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " map.get(this).length();\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'Map<Object,@NonNull String>\'. Type \'Map<K,V>\' doesn\'t seem to be designed with null type annotations in mind\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " map.get(this).length();\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'Map<Object,@NonNull String>\'. Type \'Map<K,V>\' doesn\'t seem to be designed with null type annotations in mind\n" +
"----------\n");
}
public void testBug461268nnbd() {
@@ -11684,7 +11684,7 @@ public void testBug461268nnbd() {
" return this.t;\n" +
" }\n" +
"}\n",
- },
+ },
getCompilerOptions(),
""
);
@@ -11705,7 +11705,7 @@ public void testBug461268nnbd() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -11752,7 +11752,7 @@ public void testBug485988WildcardOverride() {
" return new Result<BigDecimal>(0, new BigDecimal(\"1\"));\n" +
" }\n" +
"}\n",
- },
+ },
getCompilerOptions(),
""
);
@@ -11851,7 +11851,7 @@ public void testBug485988neutral() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -11950,89 +11950,89 @@ public void testBug485988nonnull() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in nonnull\\WildcardNonNullTest.java (at line 52)\n" +
- " return new A<@Nullable String>();\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@Nullable String\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
- "----------\n" +
- "2. ERROR in nonnull\\WildcardNonNullTest.java (at line 56)\n" +
- " A<@Nullable ?> h2() {\n" +
- " ^\n" +
- "The return type is incompatible with \'A<@NonNull ?>\' returned from X.h2() (mismatching null constraints)\n" +
- "----------\n" +
- "3. ERROR in nonnull\\WildcardNonNullTest.java (at line 56)\n" +
- " A<@Nullable ?> h2() {\n" +
- " ^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@Nullable ?\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
- "----------\n" +
- "4. ERROR in nonnull\\WildcardNonNullTest.java (at line 57)\n" +
- " return new A<@Nullable String>();\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@Nullable String\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
- "----------\n" +
- "5. ERROR in nonnull\\WildcardNonNullTest.java (at line 61)\n" +
- " A<? super @Nullable String> h2b() {\n" +
- " ^\n" +
- "The return type is incompatible with \'A<@NonNull ?>\' returned from X.h2b() (mismatching null constraints)\n" +
- "----------\n" +
- "6. ERROR in nonnull\\WildcardNonNullTest.java (at line 61)\n" +
- " A<? super @Nullable String> h2b() {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'? super @Nullable String\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
- "----------\n" +
- "7. ERROR in nonnull\\WildcardNonNullTest.java (at line 62)\n" +
- " return new A<@Nullable String>();\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@Nullable String\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
- "----------\n" +
- "8. ERROR in nonnull\\WildcardNonNullTest.java (at line 66)\n" +
- " A<@Nullable String> h3() {\n" +
- " ^\n" +
- "The return type is incompatible with \'A<@NonNull ?>\' returned from X.h3() (mismatching null constraints)\n" +
- "----------\n" +
- "9. ERROR in nonnull\\WildcardNonNullTest.java (at line 66)\n" +
- " A<@Nullable String> h3() {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@Nullable String\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
- "----------\n" +
- "10. ERROR in nonnull\\WildcardNonNullTest.java (at line 67)\n" +
- " return new A<@Nullable String>();\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@Nullable String\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
- "----------\n" +
- "11. ERROR in nonnull\\WildcardNonNullTest.java (at line 80)\n" +
- " f(new A<T2>());\n" +
- " ^^\n" +
- "Null constraint mismatch: The type \'T2\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
- "----------\n" +
- "12. WARNING in nonnull\\WildcardNonNullTest.java (at line 81)\n" +
- " g(new A<T2>());\n" +
- " ^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'@NonNull A<T2>\' needs unchecked conversion to conform to \'@NonNull A<@NonNull T2>\'\n" +
- "----------\n" +
- "13. ERROR in nonnull\\WildcardNonNullTest.java (at line 81)\n" +
- " g(new A<T2>());\n" +
- " ^^\n" +
- "Null constraint mismatch: The type \'T2\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
- "----------\n" +
- "14. ERROR in nonnull\\WildcardNonNullTest.java (at line 86)\n" +
- " f(new A<@Nullable T2>());\n" +
- " ^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@Nullable T2\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
- "----------\n" +
- "15. ERROR in nonnull\\WildcardNonNullTest.java (at line 87)\n" +
- " g(new A<@Nullable T2>());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull A<@NonNull T2>\' but this expression has type \'@NonNull A<@Nullable T2>\'\n" +
- "----------\n" +
- "16. ERROR in nonnull\\WildcardNonNullTest.java (at line 87)\n" +
- " g(new A<@Nullable T2>());\n" +
- " ^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@Nullable T2\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
- "----------\n"
+ "----------\n" +
+ "1. ERROR in nonnull\\WildcardNonNullTest.java (at line 52)\n" +
+ " return new A<@Nullable String>();\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@Nullable String\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
+ "----------\n" +
+ "2. ERROR in nonnull\\WildcardNonNullTest.java (at line 56)\n" +
+ " A<@Nullable ?> h2() {\n" +
+ " ^\n" +
+ "The return type is incompatible with \'A<@NonNull ?>\' returned from X.h2() (mismatching null constraints)\n" +
+ "----------\n" +
+ "3. ERROR in nonnull\\WildcardNonNullTest.java (at line 56)\n" +
+ " A<@Nullable ?> h2() {\n" +
+ " ^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@Nullable ?\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
+ "----------\n" +
+ "4. ERROR in nonnull\\WildcardNonNullTest.java (at line 57)\n" +
+ " return new A<@Nullable String>();\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@Nullable String\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
+ "----------\n" +
+ "5. ERROR in nonnull\\WildcardNonNullTest.java (at line 61)\n" +
+ " A<? super @Nullable String> h2b() {\n" +
+ " ^\n" +
+ "The return type is incompatible with \'A<@NonNull ?>\' returned from X.h2b() (mismatching null constraints)\n" +
+ "----------\n" +
+ "6. ERROR in nonnull\\WildcardNonNullTest.java (at line 61)\n" +
+ " A<? super @Nullable String> h2b() {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'? super @Nullable String\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
+ "----------\n" +
+ "7. ERROR in nonnull\\WildcardNonNullTest.java (at line 62)\n" +
+ " return new A<@Nullable String>();\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@Nullable String\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
+ "----------\n" +
+ "8. ERROR in nonnull\\WildcardNonNullTest.java (at line 66)\n" +
+ " A<@Nullable String> h3() {\n" +
+ " ^\n" +
+ "The return type is incompatible with \'A<@NonNull ?>\' returned from X.h3() (mismatching null constraints)\n" +
+ "----------\n" +
+ "9. ERROR in nonnull\\WildcardNonNullTest.java (at line 66)\n" +
+ " A<@Nullable String> h3() {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@Nullable String\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
+ "----------\n" +
+ "10. ERROR in nonnull\\WildcardNonNullTest.java (at line 67)\n" +
+ " return new A<@Nullable String>();\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@Nullable String\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
+ "----------\n" +
+ "11. ERROR in nonnull\\WildcardNonNullTest.java (at line 80)\n" +
+ " f(new A<T2>());\n" +
+ " ^^\n" +
+ "Null constraint mismatch: The type \'T2\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
+ "----------\n" +
+ "12. WARNING in nonnull\\WildcardNonNullTest.java (at line 81)\n" +
+ " g(new A<T2>());\n" +
+ " ^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'@NonNull A<T2>\' needs unchecked conversion to conform to \'@NonNull A<@NonNull T2>\'\n" +
+ "----------\n" +
+ "13. ERROR in nonnull\\WildcardNonNullTest.java (at line 81)\n" +
+ " g(new A<T2>());\n" +
+ " ^^\n" +
+ "Null constraint mismatch: The type \'T2\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
+ "----------\n" +
+ "14. ERROR in nonnull\\WildcardNonNullTest.java (at line 86)\n" +
+ " f(new A<@Nullable T2>());\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@Nullable T2\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
+ "----------\n" +
+ "15. ERROR in nonnull\\WildcardNonNullTest.java (at line 87)\n" +
+ " g(new A<@Nullable T2>());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull A<@NonNull T2>\' but this expression has type \'@NonNull A<@Nullable T2>\'\n" +
+ "----------\n" +
+ "16. ERROR in nonnull\\WildcardNonNullTest.java (at line 87)\n" +
+ " g(new A<@Nullable T2>());\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@Nullable T2\' is not a valid substitute for the type parameter \'@NonNull T\'\n" +
+ "----------\n"
);
}
public void testBug485988nullable() {
@@ -12129,88 +12129,88 @@ public void testBug485988nullable() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in nullable\\WildcardNullableTest.java (at line 32)\n" +
- " return new A<@NonNull String>();\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@NonNull String\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
- "----------\n" +
- "2. ERROR in nullable\\WildcardNullableTest.java (at line 36)\n" +
- " A<@NonNull ?> g2() {\n" +
- " ^\n" +
- "The return type is incompatible with \'A<@Nullable ?>\' returned from X.g2() (mismatching null constraints)\n" +
- "----------\n" +
- "3. ERROR in nullable\\WildcardNullableTest.java (at line 36)\n" +
- " A<@NonNull ?> g2() {\n" +
- " ^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@NonNull ?\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
- "----------\n" +
- "4. ERROR in nullable\\WildcardNullableTest.java (at line 37)\n" +
- " return new A<@NonNull String>();\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@NonNull String\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
- "----------\n" +
- "5. ERROR in nullable\\WildcardNullableTest.java (at line 41)\n" +
- " A<? extends @NonNull Number> g2b() {\n" +
- " ^\n" +
- "The return type is incompatible with \'A<@Nullable ?>\' returned from X.g2b() (mismatching null constraints)\n" +
- "----------\n" +
- "6. ERROR in nullable\\WildcardNullableTest.java (at line 41)\n" +
- " A<? extends @NonNull Number> g2b() {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'? extends @NonNull Number\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
- "----------\n" +
- "7. ERROR in nullable\\WildcardNullableTest.java (at line 42)\n" +
- " return new A<@NonNull Integer>();\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@NonNull Integer\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
- "----------\n" +
- "8. ERROR in nullable\\WildcardNullableTest.java (at line 46)\n" +
- " A<@NonNull String> g3() {\n" +
- " ^\n" +
- "The return type is incompatible with \'A<@Nullable ?>\' returned from X.g3() (mismatching null constraints)\n" +
- "----------\n" +
- "9. ERROR in nullable\\WildcardNullableTest.java (at line 46)\n" +
- " A<@NonNull String> g3() {\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@NonNull String\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
- "----------\n" +
- "10. ERROR in nullable\\WildcardNullableTest.java (at line 47)\n" +
- " return new A<@NonNull String>();\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@NonNull String\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
- "----------\n" +
- "11. ERROR in nullable\\WildcardNullableTest.java (at line 80)\n" +
- " f(new A<T2>());\n" +
- " ^^\n" +
- "Null constraint mismatch: The type \'T2\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
- "----------\n" +
- "12. WARNING in nullable\\WildcardNullableTest.java (at line 81)\n" +
- " g(new A<T2>());\n" +
- " ^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'@NonNull A<T2>\' needs unchecked conversion to conform to \'@NonNull A<@Nullable T2>\'\n" +
- "----------\n" +
- "13. ERROR in nullable\\WildcardNullableTest.java (at line 81)\n" +
- " g(new A<T2>());\n" +
- " ^^\n" +
- "Null constraint mismatch: The type \'T2\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
- "----------\n" +
- "14. ERROR in nullable\\WildcardNullableTest.java (at line 83)\n" +
- " f(new A<@NonNull T2>());\n" +
- " ^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@NonNull T2\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
- "----------\n" +
- "15. ERROR in nullable\\WildcardNullableTest.java (at line 84)\n" +
- " g(new A<@NonNull T2>());\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull A<@Nullable T2>\' but this expression has type \'@NonNull A<@NonNull T2>\'\n" +
- "----------\n" +
- "16. ERROR in nullable\\WildcardNullableTest.java (at line 84)\n" +
- " g(new A<@NonNull T2>());\n" +
- " ^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@NonNull T2\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "1. ERROR in nullable\\WildcardNullableTest.java (at line 32)\n" +
+ " return new A<@NonNull String>();\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@NonNull String\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "2. ERROR in nullable\\WildcardNullableTest.java (at line 36)\n" +
+ " A<@NonNull ?> g2() {\n" +
+ " ^\n" +
+ "The return type is incompatible with \'A<@Nullable ?>\' returned from X.g2() (mismatching null constraints)\n" +
+ "----------\n" +
+ "3. ERROR in nullable\\WildcardNullableTest.java (at line 36)\n" +
+ " A<@NonNull ?> g2() {\n" +
+ " ^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@NonNull ?\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "4. ERROR in nullable\\WildcardNullableTest.java (at line 37)\n" +
+ " return new A<@NonNull String>();\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@NonNull String\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "5. ERROR in nullable\\WildcardNullableTest.java (at line 41)\n" +
+ " A<? extends @NonNull Number> g2b() {\n" +
+ " ^\n" +
+ "The return type is incompatible with \'A<@Nullable ?>\' returned from X.g2b() (mismatching null constraints)\n" +
+ "----------\n" +
+ "6. ERROR in nullable\\WildcardNullableTest.java (at line 41)\n" +
+ " A<? extends @NonNull Number> g2b() {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'? extends @NonNull Number\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "7. ERROR in nullable\\WildcardNullableTest.java (at line 42)\n" +
+ " return new A<@NonNull Integer>();\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@NonNull Integer\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "8. ERROR in nullable\\WildcardNullableTest.java (at line 46)\n" +
+ " A<@NonNull String> g3() {\n" +
+ " ^\n" +
+ "The return type is incompatible with \'A<@Nullable ?>\' returned from X.g3() (mismatching null constraints)\n" +
+ "----------\n" +
+ "9. ERROR in nullable\\WildcardNullableTest.java (at line 46)\n" +
+ " A<@NonNull String> g3() {\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@NonNull String\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "10. ERROR in nullable\\WildcardNullableTest.java (at line 47)\n" +
+ " return new A<@NonNull String>();\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@NonNull String\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "11. ERROR in nullable\\WildcardNullableTest.java (at line 80)\n" +
+ " f(new A<T2>());\n" +
+ " ^^\n" +
+ "Null constraint mismatch: The type \'T2\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "12. WARNING in nullable\\WildcardNullableTest.java (at line 81)\n" +
+ " g(new A<T2>());\n" +
+ " ^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'@NonNull A<T2>\' needs unchecked conversion to conform to \'@NonNull A<@Nullable T2>\'\n" +
+ "----------\n" +
+ "13. ERROR in nullable\\WildcardNullableTest.java (at line 81)\n" +
+ " g(new A<T2>());\n" +
+ " ^^\n" +
+ "Null constraint mismatch: The type \'T2\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "14. ERROR in nullable\\WildcardNullableTest.java (at line 83)\n" +
+ " f(new A<@NonNull T2>());\n" +
+ " ^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@NonNull T2\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
+ "----------\n" +
+ "15. ERROR in nullable\\WildcardNullableTest.java (at line 84)\n" +
+ " g(new A<@NonNull T2>());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull A<@Nullable T2>\' but this expression has type \'@NonNull A<@NonNull T2>\'\n" +
+ "----------\n" +
+ "16. ERROR in nullable\\WildcardNullableTest.java (at line 84)\n" +
+ " g(new A<@NonNull T2>());\n" +
+ " ^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@NonNull T2\' is not a valid substitute for the type parameter \'@Nullable T\'\n" +
"----------\n"
);
}
@@ -12237,7 +12237,7 @@ public void testBug485988WildCardForTVWithNonNullBound() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -12261,13 +12261,13 @@ public void testBug485988WildcardWithGenericBound() {
" }\n" +
"}\n" +
"\n",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in test\\Test1.java (at line 11)\n" +
- " return lib.constrainedWildcards(coll);\n" +
- " ^^^^\n" +
- "Null type safety (type annotations): The expression of type \'Collection<String>\' needs unchecked conversion to conform to \'Collection<? extends @NonNull String>\'\n" +
+ "----------\n" +
+ "1. WARNING in test\\Test1.java (at line 11)\n" +
+ " return lib.constrainedWildcards(coll);\n" +
+ " ^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'Collection<String>\' needs unchecked conversion to conform to \'Collection<? extends @NonNull String>\'\n" +
"----------\n"
);
}
@@ -12295,28 +12295,28 @@ public void testBug485988Contradictory() {
" }\n" +
"}\n" +
"\n",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\Test1.java (at line 7)\n" +
- " void f1(A<@Nullable @NonNull ?> a) {\n" +
- " ^^^^^^^^\n" +
- "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
- "----------\n" +
- "2. ERROR in test\\Test1.java (at line 9)\n" +
- " void f2(A<@NonNull @Nullable ?> a) {\n" +
- " ^^^^^^^^^\n" +
- "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
- "----------\n" +
- "3. ERROR in test\\Test1.java (at line 11)\n" +
- " void f3(A<@Nullable ? extends @NonNull Object> a) {\n" +
- " ^^^^^^^^\n" +
- "This nullness annotation conflicts with a \'@Nullable\' annotation which is effective on the same type parameter \n" +
- "----------\n" +
- "4. ERROR in test\\Test1.java (at line 13)\n" +
- " void f4(A<@NonNull ? super @Nullable Integer> a) {\n" +
- " ^^^^^^^^^\n" +
- "This nullness annotation conflicts with a \'@NonNull\' annotation which is effective on the same type parameter \n" +
+ "----------\n" +
+ "1. ERROR in test\\Test1.java (at line 7)\n" +
+ " void f1(A<@Nullable @NonNull ?> a) {\n" +
+ " ^^^^^^^^\n" +
+ "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
+ "----------\n" +
+ "2. ERROR in test\\Test1.java (at line 9)\n" +
+ " void f2(A<@NonNull @Nullable ?> a) {\n" +
+ " ^^^^^^^^^\n" +
+ "Contradictory null specification; only one of @NonNull and @Nullable can be specified at any location\n" +
+ "----------\n" +
+ "3. ERROR in test\\Test1.java (at line 11)\n" +
+ " void f3(A<@Nullable ? extends @NonNull Object> a) {\n" +
+ " ^^^^^^^^\n" +
+ "This nullness annotation conflicts with a \'@Nullable\' annotation which is effective on the same type parameter \n" +
+ "----------\n" +
+ "4. ERROR in test\\Test1.java (at line 13)\n" +
+ " void f4(A<@NonNull ? super @Nullable Integer> a) {\n" +
+ " ^^^^^^^^^\n" +
+ "This nullness annotation conflicts with a \'@NonNull\' annotation which is effective on the same type parameter \n" +
"----------\n"
);
}
@@ -12324,18 +12324,18 @@ public void testBug485988bound() {
runConformTestWithLibs(
new String[] {
"C.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "\n" +
- "interface I<T> { }\n" +
- "\n" +
- "public class C {\n" +
- " I<@NonNull ?> m1(I<? extends @NonNull C> i) {\n" +
- " return i;\n" +
- " }\n" +
- " I<? extends @NonNull C> m2(I<@NonNull ? extends C> i) {\n" +
- " return i;\n" +
- " }\n" +
- " \n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "\n" +
+ "interface I<T> { }\n" +
+ "\n" +
+ "public class C {\n" +
+ " I<@NonNull ?> m1(I<? extends @NonNull C> i) {\n" +
+ " return i;\n" +
+ " }\n" +
+ " I<? extends @NonNull C> m2(I<@NonNull ? extends C> i) {\n" +
+ " return i;\n" +
+ " }\n" +
+ " \n" +
"}\n"
},
getCompilerOptions(),
@@ -12345,9 +12345,9 @@ public void testBug466585_comment_0() {
runConformTestWithLibs(
new String[] {
"C3.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "class C3<T extends @NonNull Number> {\n" +
- " C3<?> x; // Null constraint mismatch: The type '?' is not a valid substitute for the type parameter 'T extends @NonNull Number'\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "class C3<T extends @NonNull Number> {\n" +
+ " C3<?> x; // Null constraint mismatch: The type '?' is not a valid substitute for the type parameter 'T extends @NonNull Number'\n" +
"}\n"
},
getCompilerOptions(),
@@ -12357,37 +12357,37 @@ public void testBug466585_comment_4() {
runNegativeTestWithLibs(
new String[] {
"C3.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "class C4<T extends @NonNull Number> {\n" +
- " C4<@Nullable ?> err1;\n" +
- " C4<@Nullable ? extends Integer> err2;\n" +
- " C4<? super @Nullable Integer> err3;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "class C4<T extends @NonNull Number> {\n" +
+ " C4<@Nullable ?> err1;\n" +
+ " C4<@Nullable ? extends Integer> err2;\n" +
+ " C4<? super @Nullable Integer> err3;\n" +
" C4<@Nullable ? super Integer> err4;\n" +
" C4<@NonNull ? super Integer> ok1;\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in C3.java (at line 4)\n" +
- " C4<@Nullable ?> err1;\n" +
- " ^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@Nullable ?\' is not a valid substitute for the type parameter \'T extends @NonNull Number\'\n" +
- "----------\n" +
- "2. ERROR in C3.java (at line 5)\n" +
- " C4<@Nullable ? extends Integer> err2;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@Nullable ? extends Integer\' is not a valid substitute for the type parameter \'T extends @NonNull Number\'\n" +
- "----------\n" +
- "3. ERROR in C3.java (at line 6)\n" +
- " C4<? super @Nullable Integer> err3;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'? super @Nullable Integer\' is not a valid substitute for the type parameter \'T extends @NonNull Number\'\n" +
- "----------\n" +
- "4. ERROR in C3.java (at line 7)\n" +
- " C4<@Nullable ? super Integer> err4;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'@Nullable ? super Integer\' is not a valid substitute for the type parameter \'T extends @NonNull Number\'\n" +
+ "----------\n" +
+ "1. ERROR in C3.java (at line 4)\n" +
+ " C4<@Nullable ?> err1;\n" +
+ " ^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@Nullable ?\' is not a valid substitute for the type parameter \'T extends @NonNull Number\'\n" +
+ "----------\n" +
+ "2. ERROR in C3.java (at line 5)\n" +
+ " C4<@Nullable ? extends Integer> err2;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@Nullable ? extends Integer\' is not a valid substitute for the type parameter \'T extends @NonNull Number\'\n" +
+ "----------\n" +
+ "3. ERROR in C3.java (at line 6)\n" +
+ " C4<? super @Nullable Integer> err3;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'? super @Nullable Integer\' is not a valid substitute for the type parameter \'T extends @NonNull Number\'\n" +
+ "----------\n" +
+ "4. ERROR in C3.java (at line 7)\n" +
+ " C4<@Nullable ? super Integer> err4;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'@Nullable ? super Integer\' is not a valid substitute for the type parameter \'T extends @NonNull Number\'\n" +
"----------\n");
}
public void testBug489978() {
@@ -12409,7 +12409,7 @@ public void testBug489978() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -12430,7 +12430,7 @@ public void testBug489978() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -12467,13 +12467,13 @@ public void testBug489245() {
" }\n" +
"}\n" +
"",
- },
+ },
compilerOptions,
- "----------\n" +
- "1. INFO in test\\TestBogusProblemReportOnlyAsInfo.java (at line 21)\n" +
- " return null; // correctly reported (but twice with the bug)\n" +
- " ^^^^\n" +
- "Null type mismatch (type annotations): \'null\' is not compatible to the free type variable \'T\'\n" +
+ "----------\n" +
+ "1. INFO in test\\TestBogusProblemReportOnlyAsInfo.java (at line 21)\n" +
+ " return null; // correctly reported (but twice with the bug)\n" +
+ " ^^^^\n" +
+ "Null type mismatch (type annotations): \'null\' is not compatible to the free type variable \'T\'\n" +
"----------\n"
);
}
@@ -12487,15 +12487,15 @@ public void testBug489674() {
"package org.foo;\n" +
"import java.lang.annotation.*;\n" +
"import static java.lang.annotation.ElementType.*;\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@Target({ FIELD, METHOD, PARAMETER, LOCAL_VARIABLE })\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ FIELD, METHOD, PARAMETER, LOCAL_VARIABLE })\n" +
"public @interface Nullable {}\n",
"org/foo/NonNull.java",
"package org.foo;\n" +
"import java.lang.annotation.*;\n" +
"import static java.lang.annotation.ElementType.*;\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@Target({ FIELD, METHOD, PARAMETER, LOCAL_VARIABLE })\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ FIELD, METHOD, PARAMETER, LOCAL_VARIABLE })\n" +
"public @interface NonNull {}\n",
},
options);
@@ -12531,7 +12531,7 @@ public void testBug489674() {
" }\n" +
"}\n" +
"",
- },
+ },
options,
""
);
@@ -12558,18 +12558,18 @@ public void testBug489674() {
" }\n" +
"}\n" +
"",
- },
+ },
options,
- "----------\n" +
- "1. ERROR in test\\Test4.java (at line 11)\n" +
- " P1.f0().hashCode();\n" +
- " ^^^^^^^\n" +
- "Potential null pointer access: The method f0() may return null\n" +
- "----------\n" +
- "2. ERROR in test\\Test4.java (at line 15)\n" +
- " P2.f(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in test\\Test4.java (at line 11)\n" +
+ " P1.f0().hashCode();\n" +
+ " ^^^^^^^\n" +
+ "Potential null pointer access: The method f0() may return null\n" +
+ "----------\n" +
+ "2. ERROR in test\\Test4.java (at line 15)\n" +
+ " P2.f(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n",
false
);
@@ -12586,7 +12586,7 @@ public void testBug492327() {
"public interface Watchable {\n" +
" void register(WatchEvent.Modifier[] modifiers);\n" +
"}\n",
- },
+ },
getCompilerOptions(),
""
);
@@ -12598,7 +12598,7 @@ public void testBug492327() {
" @Override\n" +
" void register(WatchEvent.Modifier[] modifiers);\n" +
"}\n",
- },
+ },
getCompilerOptions(),
""
);
@@ -12633,7 +12633,7 @@ public void testBug488495collector() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -12672,7 +12672,7 @@ public void testBug496591() {
" Map<Descriptors.FieldDescriptor> getAllFields();\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -12691,11 +12691,11 @@ public void testBug496591() {
" public abstract Map<FieldDescriptor> getAllFields();\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
-}
+}
public void testBug497698() {
runNegativeTest(
new String[] {
@@ -12723,20 +12723,20 @@ public void testBug497698() {
" }\n" +
"}\n" +
"",
- },
+ },
//{ObjectTeams: different compile order causes method to be removed from STB
- "----------\n" +
- "1. ERROR in test\\And.java (at line 8)\n" +
- " Or.create();\n" +
- " ^^^^^^\n" +
- "The method create() is undefined for the type Or\n" +
- "----------\n" +
+ "----------\n" +
+ "1. ERROR in test\\And.java (at line 8)\n" +
+ " Or.create();\n" +
+ " ^^^^^^\n" +
+ "The method create() is undefined for the type Or\n" +
+ "----------\n" +
// SH}
- "----------\n" +
- "1. ERROR in test\\Or.java (at line 7)\n" +
- " public static <V> Or<V> create() {\n" +
- " ^^\n" +
- "Incorrect number of arguments for type Or<D,V>; it cannot be parameterized with arguments <V>\n" +
+ "----------\n" +
+ "1. ERROR in test\\Or.java (at line 7)\n" +
+ " public static <V> Or<V> create() {\n" +
+ " ^^\n" +
+ "Incorrect number of arguments for type Or<D,V>; it cannot be parameterized with arguments <V>\n" +
"----------\n",
this.LIBS,
true/*flush*/
@@ -12769,25 +12769,25 @@ public void testBug497698raw() {
" }\n" +
"}\n" +
"",
- },
- "----------\n" +
- "1. WARNING in test\\And.java (at line 8)\n" +
- " new Or().create();\n" +
- " ^^\n" +
- "Or is a raw type. References to generic type Or<D,V> should be parameterized\n" +
- "----------\n" +
+ },
+ "----------\n" +
+ "1. WARNING in test\\And.java (at line 8)\n" +
+ " new Or().create();\n" +
+ " ^^\n" +
+ "Or is a raw type. References to generic type Or<D,V> should be parameterized\n" +
+ "----------\n" +
//{ObjectTeams: different compile order causes method to be removed from STB
- "2. ERROR in test\\And.java (at line 8)\n" +
- " new Or().create();\n" +
- " ^^^^^^\n" +
- "The method create() is undefined for the type Or\n" +
- "----------\n" +
+ "2. ERROR in test\\And.java (at line 8)\n" +
+ " new Or().create();\n" +
+ " ^^^^^^\n" +
+ "The method create() is undefined for the type Or\n" +
+ "----------\n" +
// SH}
- "----------\n" +
- "1. ERROR in test\\Or.java (at line 7)\n" +
- " public <V1> Or<V1> create() {\n" +
- " ^^\n" +
- "Incorrect number of arguments for type Or<D,V>; it cannot be parameterized with arguments <V1>\n" +
+ "----------\n" +
+ "1. ERROR in test\\Or.java (at line 7)\n" +
+ " public <V1> Or<V1> create() {\n" +
+ " ^^\n" +
+ "Incorrect number of arguments for type Or<D,V>; it cannot be parameterized with arguments <V1>\n" +
"----------\n",
this.LIBS,
false/*shouldFlush*/
@@ -12822,25 +12822,25 @@ public void testBug497698nestedinraw() {
" }\n" +
"}\n" +
"",
- },
- "----------\n" +
- "1. WARNING in test\\And.java (at line 7)\n" +
- " public static void createAnd(X.Or x) {\n" +
- " ^^^^\n" +
- "X.Or is a raw type. References to generic type X<Z>.Or<D,V> should be parameterized\n" +
- "----------\n" +
+ },
+ "----------\n" +
+ "1. WARNING in test\\And.java (at line 7)\n" +
+ " public static void createAnd(X.Or x) {\n" +
+ " ^^^^\n" +
+ "X.Or is a raw type. References to generic type X<Z>.Or<D,V> should be parameterized\n" +
+ "----------\n" +
//{ObjectTeams: different compile order causes method to be removed from STB
- "2. ERROR in test\\And.java (at line 8)\n" +
- " x.create();\n" +
- " ^^^^^^\n" +
- "The method create() is undefined for the type X.Or\n" +
+ "2. ERROR in test\\And.java (at line 8)\n" +
+ " x.create();\n" +
+ " ^^^^^^\n" +
+ "The method create() is undefined for the type X.Or\n" +
"----------\n" +
// SH}
- "----------\n" +
- "1. ERROR in test\\X.java (at line 8)\n" +
- " public <V1> Or<V1> create() {\n" +
- " ^^\n" +
- "Incorrect number of arguments for type X<Z>.Or<D,V>; it cannot be parameterized with arguments <V1>\n" +
+ "----------\n" +
+ "1. ERROR in test\\X.java (at line 8)\n" +
+ " public <V1> Or<V1> create() {\n" +
+ " ^^\n" +
+ "Incorrect number of arguments for type X<Z>.Or<D,V>; it cannot be parameterized with arguments <V1>\n" +
"----------\n",
this.LIBS,
true/*flush*/
@@ -12866,7 +12866,7 @@ public void testBug492322() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -12884,7 +12884,7 @@ public void testBug492322() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -12906,7 +12906,7 @@ public void testBug492322field() {
" protected @Nullable GenericInner<Object> field;\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -12924,7 +12924,7 @@ public void testBug492322field() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -12957,7 +12957,7 @@ public void testBug492322deep() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -12975,7 +12975,7 @@ public void testBug492322deep() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -13008,7 +13008,7 @@ public void testBug492322withGenericBase() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -13026,7 +13026,7 @@ public void testBug492322withGenericBase() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -13038,12 +13038,12 @@ public void testBug499862a() {
"import org.eclipse.jdt.annotation.*;\n" +
"import java.util.*;\n" +
"public class Test {\n" +
- " static void printChecked(Collection<? extends @Nullable String> collection) {\n" +
- " for(String s : collection)\n" +
- " if (s != null)\n" +
- " System.out.println(s.toString());\n" +
- " else\n" +
- " System.out.println(\"NULL\");\n" +
+ " static void printChecked(Collection<? extends @Nullable String> collection) {\n" +
+ " for(String s : collection)\n" +
+ " if (s != null)\n" +
+ " System.out.println(s.toString());\n" +
+ " else\n" +
+ " System.out.println(\"NULL\");\n" +
" }\n" +
"}\n"
},
@@ -13057,18 +13057,18 @@ public void testBug499862b() {
"import org.eclipse.jdt.annotation.*;\n" +
"import java.util.*;\n" +
"public class Test {\n" +
- " static void printChecked(Collection<? extends @Nullable String> collection) {\n" +
- " for(String s : collection)\n" +
- " System.out.println(s.toString());\n" +
+ " static void printChecked(Collection<? extends @Nullable String> collection) {\n" +
+ " for(String s : collection)\n" +
+ " System.out.println(s.toString());\n" +
" }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in Test.java (at line 6)\n" +
- " System.out.println(s.toString());\n" +
- " ^\n" +
- "Potential null pointer access: The variable s may be null at this location\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 6)\n" +
+ " System.out.println(s.toString());\n" +
+ " ^\n" +
+ "Potential null pointer access: The variable s may be null at this location\n" +
"----------\n");
}
public void testBug499862c() {
@@ -13077,18 +13077,18 @@ public void testBug499862c() {
"Test.java",
"import java.util.*;\n" +
"public class Test {\n" +
- " static <T> void printUnchecked(Collection<T> collection) {\n" +
- " for(T t : collection)\n" +
- " System.out.println(t.toString());\n" +
- " }\n" +
+ " static <T> void printUnchecked(Collection<T> collection) {\n" +
+ " for(T t : collection)\n" +
+ " System.out.println(t.toString());\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in Test.java (at line 5)\n" +
- " System.out.println(t.toString());\n" +
- " ^\n" +
- "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 5)\n" +
+ " System.out.println(t.toString());\n" +
+ " ^\n" +
+ "Potential null pointer access: this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
"----------\n");
}
public void testBug499597simplified() {
@@ -13113,7 +13113,7 @@ public void testBug499597simplified() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -13149,18 +13149,18 @@ public void testBug499597original() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in Foo.java (at line 12)\n" +
- " static <T> Collection<T> of(@NonNull T @NonNull... elements) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The nullness annotation is redundant with a default that applies to this location\n" +
- "----------\n" +
- "2. WARNING in Foo.java (at line 13)\n" +
- " return Collections.singleton(elements[0]);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'Set<@NonNull T>\' needs unchecked conversion to conform to \'@NonNull Collection<@NonNull T>\', corresponding supertype is \'Collection<@NonNull T>\'\n" +
+ "----------\n" +
+ "1. WARNING in Foo.java (at line 12)\n" +
+ " static <T> Collection<T> of(@NonNull T @NonNull... elements) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The nullness annotation is redundant with a default that applies to this location\n" +
+ "----------\n" +
+ "2. WARNING in Foo.java (at line 13)\n" +
+ " return Collections.singleton(elements[0]);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'Set<@NonNull T>\' needs unchecked conversion to conform to \'@NonNull Collection<@NonNull T>\', corresponding supertype is \'Collection<@NonNull T>\'\n" +
"----------\n"
);
}
@@ -13179,7 +13179,7 @@ public void testBug501031() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -13199,13 +13199,13 @@ public void testBug501031return() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " return null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull T\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " return null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull T\' but the provided value is null\n" +
"----------\n"
);
}
@@ -13223,7 +13223,7 @@ public void testBug501031btb() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -13240,13 +13240,13 @@ public void testBug501031btb() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in Y.java (at line 7)\n" +
- " x.identity(string);\n" +
- " ^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
+ "----------\n" +
+ "1. ERROR in Y.java (at line 7)\n" +
+ " x.identity(string);\n" +
+ " ^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
"----------\n"
);
}
@@ -13265,18 +13265,18 @@ public void testBug501449() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in Test.java (at line 5)\n" +
- " objects[0] = null;\n" +
- " ^^^^\n" +
- "Null type mismatch (type annotations): \'null\' is not compatible to the free type variable \'T\'\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 6)\n" +
- " objects[1] = nullableValue;\n" +
- " ^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'T\' but this expression has type \'@Nullable T\', where \'T\' is a free type variable\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 5)\n" +
+ " objects[0] = null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch (type annotations): \'null\' is not compatible to the free type variable \'T\'\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 6)\n" +
+ " objects[1] = nullableValue;\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'T\' but this expression has type \'@Nullable T\', where \'T\' is a free type variable\n" +
"----------\n"
);
}
@@ -13286,7 +13286,7 @@ public void testBug502112() {
"org/foo/Nullable.java",
"package org.foo;\n" +
"import java.lang.annotation.*;\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
"public @interface Nullable {}\n",
},
getCompilerOptions());
@@ -13308,7 +13308,7 @@ public void testBug502112() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -13335,18 +13335,18 @@ public void testBug502112() {
" }\n" +
"}\n" +
"",
- },
+ },
options,
- "----------\n" +
- "1. ERROR in test\\Test.java (at line 14)\n" +
- " return Optional.<String>returnNull(s);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
- "----------\n" +
- "2. ERROR in test\\Test.java (at line 14)\n" +
- " return Optional.<String>returnNull(s);\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
+ "----------\n" +
+ "1. ERROR in test\\Test.java (at line 14)\n" +
+ " return Optional.<String>returnNull(s);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
+ "----------\n" +
+ "2. ERROR in test\\Test.java (at line 14)\n" +
+ " return Optional.<String>returnNull(s);\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
"----------\n"
);
}
@@ -13356,12 +13356,12 @@ public void testBug502112b() {
"org/foo/NonNull.java",
"package org.foo;\n" +
"import java.lang.annotation.*;\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
"public @interface NonNull {}\n",
"org/foo/Nullable.java",
"package org.foo;\n" +
"import java.lang.annotation.*;\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
"public @interface Nullable {}\n",
},
getCompilerOptions());
@@ -13381,7 +13381,7 @@ public void testBug502112b() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -13407,23 +13407,23 @@ public void testBug502112b() {
" }\n" +
"}\n" +
"",
- },
+ },
options,
- "----------\n" +
- "1. ERROR in test\\Test.java (at line 12)\n" +
- " public <T> @Nullable T nonNull(@NonNull T t, T t2) {\n" +
- " ^^^^^^^^^^^\n" +
- "The return type is incompatible with \'@NonNull T extends Object\' returned from X.nonNull(T, T) (mismatching null constraints)\n" +
- "----------\n" +
- "2. ERROR in test\\Test.java (at line 12)\n" +
- " public <T> @Nullable T nonNull(@NonNull T t, T t2) {\n" +
- " ^^^^^^^^^^\n" +
- "Illegal redefinition of parameter t, inherited method from X declares this parameter as @Nullable\n" +
- "----------\n" +
- "3. ERROR in test\\Test.java (at line 12)\n" +
- " public <T> @Nullable T nonNull(@NonNull T t, T t2) {\n" +
- " ^\n" +
- "Missing nullable annotation: inherited method from X specifies this parameter as @Nullable\n" +
+ "----------\n" +
+ "1. ERROR in test\\Test.java (at line 12)\n" +
+ " public <T> @Nullable T nonNull(@NonNull T t, T t2) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull T extends Object\' returned from X.nonNull(T, T) (mismatching null constraints)\n" +
+ "----------\n" +
+ "2. ERROR in test\\Test.java (at line 12)\n" +
+ " public <T> @Nullable T nonNull(@NonNull T t, T t2) {\n" +
+ " ^^^^^^^^^^\n" +
+ "Illegal redefinition of parameter t, inherited method from X declares this parameter as @Nullable\n" +
+ "----------\n" +
+ "3. ERROR in test\\Test.java (at line 12)\n" +
+ " public <T> @Nullable T nonNull(@NonNull T t, T t2) {\n" +
+ " ^\n" +
+ "Missing nullable annotation: inherited method from X specifies this parameter as @Nullable\n" +
"----------\n"
);
}
@@ -13460,29 +13460,29 @@ public void testBug484926locals() {
" y2.set(null);\n" +
" y3.set(null);\n" +
" }\n" +
- "}\n"
- },
+ "}\n"
+ },
options,
- "----------\n" +
- "1. ERROR in test\\NNBDOnLocalOrField.java (at line 16)\n" +
- " AtomicReference<String> x2 = new AtomicReference<@NonNull String>(), x3=new AtomicReference<@Nullable String>();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'AtomicReference<@NonNull String>\' but this expression has type \'@NonNull AtomicReference<@Nullable String>\'\n" +
- "----------\n" +
- "2. ERROR in test\\NNBDOnLocalOrField.java (at line 21)\n" +
- " x1.set(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "3. ERROR in test\\NNBDOnLocalOrField.java (at line 22)\n" +
- " x2.set(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "4. ERROR in test\\NNBDOnLocalOrField.java (at line 23)\n" +
- " x3.set(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in test\\NNBDOnLocalOrField.java (at line 16)\n" +
+ " AtomicReference<String> x2 = new AtomicReference<@NonNull String>(), x3=new AtomicReference<@Nullable String>();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'AtomicReference<@NonNull String>\' but this expression has type \'@NonNull AtomicReference<@Nullable String>\'\n" +
+ "----------\n" +
+ "2. ERROR in test\\NNBDOnLocalOrField.java (at line 21)\n" +
+ " x1.set(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "3. ERROR in test\\NNBDOnLocalOrField.java (at line 22)\n" +
+ " x2.set(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "4. ERROR in test\\NNBDOnLocalOrField.java (at line 23)\n" +
+ " x3.set(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n"
);
}
@@ -13519,29 +13519,29 @@ public void testBug484926fields() {
" y2.set(null);\n" +
" y3.set(null);\n" +
" }\n" +
- "}\n"
- },
+ "}\n"
+ },
options,
- "----------\n" +
- "1. ERROR in test\\NNBDOnLocalOrField.java (at line 15)\n" +
- " AtomicReference<String> x2 = new AtomicReference<@NonNull String>(), x3=new AtomicReference<@Nullable String>();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull AtomicReference<@NonNull String>\' but this expression has type \'@NonNull AtomicReference<@Nullable String>\'\n" +
- "----------\n" +
- "2. ERROR in test\\NNBDOnLocalOrField.java (at line 21)\n" +
- " x1.set(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "3. ERROR in test\\NNBDOnLocalOrField.java (at line 22)\n" +
- " x2.set(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "4. ERROR in test\\NNBDOnLocalOrField.java (at line 23)\n" +
- " x3.set(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in test\\NNBDOnLocalOrField.java (at line 15)\n" +
+ " AtomicReference<String> x2 = new AtomicReference<@NonNull String>(), x3=new AtomicReference<@Nullable String>();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull AtomicReference<@NonNull String>\' but this expression has type \'@NonNull AtomicReference<@Nullable String>\'\n" +
+ "----------\n" +
+ "2. ERROR in test\\NNBDOnLocalOrField.java (at line 21)\n" +
+ " x1.set(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "3. ERROR in test\\NNBDOnLocalOrField.java (at line 22)\n" +
+ " x2.set(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "4. ERROR in test\\NNBDOnLocalOrField.java (at line 23)\n" +
+ " x3.set(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n"
);
}
@@ -13590,7 +13590,7 @@ public void testBug484926() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -13634,13 +13634,13 @@ public void testBug484926nesting() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\NNBDOnLocalOrField.java (at line 29)\n" +
- " x3.set(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in test\\NNBDOnLocalOrField.java (at line 29)\n" +
+ " x3.set(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n"
);
}
@@ -13676,7 +13676,7 @@ public void testBug484926localDeclarationInForLoop() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -13795,113 +13795,113 @@ public void testBug484926redundantNNBD() {
"@org.eclipse.jdt.annotation.NonNullByDefault\n" +
"package testnnbd;\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 13)\n" +
- " @NonNullByDefault\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing package testnnbd\n" +
- "----------\n" +
- "2. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 15)\n" +
- " @NonNullByDefault\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the field r1\n" +
- "----------\n" +
- "3. ERROR in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 17)\n" +
- " x3.set(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "4. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 21)\n" +
- " @NonNullByDefault({})\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the variable x4\n" +
- "----------\n" +
- "5. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 22)\n" +
- " public void set(String object) {\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The method set(String) of type new AtomicReference<String>(){} should be tagged with @Override since it actually overrides a superclass method\n" +
- "----------\n" +
- "6. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 28)\n" +
- " @NonNullByDefault\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing package testnnbd\n" +
- "----------\n" +
- "7. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 30)\n" +
- " @NonNullByDefault\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing type NNBDRedundantOnLocalOrField.X1\n" +
- "----------\n" +
- "8. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 34)\n" +
- " @NonNullByDefault(DefaultLocation.RETURN_TYPE)\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing type Local\n" +
- "----------\n" +
- "9. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 36)\n" +
- " @NonNullByDefault(DefaultLocation.RETURN_TYPE)\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing type Local.X2\n" +
- "----------\n" +
- "10. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 37)\n" +
- " String s;\n" +
- " ^\n" +
- "The value of the field Local.X2.s is not used\n" +
- "----------\n" +
- "11. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 54)\n" +
- " @NonNullByDefault(DefaultLocation.RETURN_TYPE)\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing method someMethod()\n" +
- "----------\n" +
- "12. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 65)\n" +
- " @NonNullByDefault(DefaultLocation.RETURN_TYPE)\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing method someMethod()\n" +
- "----------\n" +
- "13. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 66)\n" +
- " Runnable r2 = new Runnable() {\n" +
- " ^^\n" +
- "The local variable r2 is hiding a field from type NNBDRedundantOnLocalOrField\n" +
- "----------\n" +
- "14. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 67)\n" +
- " @NonNullByDefault(DefaultLocation.RETURN_TYPE)\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the variable r2\n" +
- "----------\n" +
- "15. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 80)\n" +
- " @NonNullByDefault(DefaultLocation.RETURN_TYPE)\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing method forLoopVariable()\n" +
- "----------\n" +
- "16. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 84)\n" +
- " }, r2 = () -> {\n" +
- " ^^\n" +
- "The local variable r2 is hiding a field from type NNBDRedundantOnLocalOrField\n" +
- "----------\n" +
- "17. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 91)\n" +
- " for (@NonNullByDefault(DefaultLocation.RETURN_TYPE)\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing method forLoopVariable()\n" +
- "----------\n" +
- "18. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 91)\n" +
- " for (@NonNullByDefault(DefaultLocation.RETURN_TYPE)\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing method forLoopVariable()\n" +
- "----------\n" +
- "19. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 93)\n" +
- " @NonNullByDefault(DefaultLocation.RETURN_TYPE)\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the variable r\n" +
- "----------\n" +
- "20. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 96)\n" +
- " }, r2 = () -> {\n" +
- " ^^\n" +
- "The local variable r2 is hiding a field from type NNBDRedundantOnLocalOrField\n" +
- "----------\n" +
- "21. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 97)\n" +
- " @NonNullByDefault(DefaultLocation.RETURN_TYPE)\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the variable r2\n" +
+ "----------\n" +
+ "1. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 13)\n" +
+ " @NonNullByDefault\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing package testnnbd\n" +
+ "----------\n" +
+ "2. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 15)\n" +
+ " @NonNullByDefault\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the field r1\n" +
+ "----------\n" +
+ "3. ERROR in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 17)\n" +
+ " x3.set(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "4. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 21)\n" +
+ " @NonNullByDefault({})\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the variable x4\n" +
+ "----------\n" +
+ "5. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 22)\n" +
+ " public void set(String object) {\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "The method set(String) of type new AtomicReference<String>(){} should be tagged with @Override since it actually overrides a superclass method\n" +
+ "----------\n" +
+ "6. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 28)\n" +
+ " @NonNullByDefault\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing package testnnbd\n" +
+ "----------\n" +
+ "7. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 30)\n" +
+ " @NonNullByDefault\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing type NNBDRedundantOnLocalOrField.X1\n" +
+ "----------\n" +
+ "8. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 34)\n" +
+ " @NonNullByDefault(DefaultLocation.RETURN_TYPE)\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing type Local\n" +
+ "----------\n" +
+ "9. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 36)\n" +
+ " @NonNullByDefault(DefaultLocation.RETURN_TYPE)\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing type Local.X2\n" +
+ "----------\n" +
+ "10. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 37)\n" +
+ " String s;\n" +
+ " ^\n" +
+ "The value of the field Local.X2.s is not used\n" +
+ "----------\n" +
+ "11. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 54)\n" +
+ " @NonNullByDefault(DefaultLocation.RETURN_TYPE)\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing method someMethod()\n" +
+ "----------\n" +
+ "12. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 65)\n" +
+ " @NonNullByDefault(DefaultLocation.RETURN_TYPE)\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing method someMethod()\n" +
+ "----------\n" +
+ "13. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 66)\n" +
+ " Runnable r2 = new Runnable() {\n" +
+ " ^^\n" +
+ "The local variable r2 is hiding a field from type NNBDRedundantOnLocalOrField\n" +
+ "----------\n" +
+ "14. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 67)\n" +
+ " @NonNullByDefault(DefaultLocation.RETURN_TYPE)\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the variable r2\n" +
+ "----------\n" +
+ "15. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 80)\n" +
+ " @NonNullByDefault(DefaultLocation.RETURN_TYPE)\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing method forLoopVariable()\n" +
+ "----------\n" +
+ "16. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 84)\n" +
+ " }, r2 = () -> {\n" +
+ " ^^\n" +
+ "The local variable r2 is hiding a field from type NNBDRedundantOnLocalOrField\n" +
+ "----------\n" +
+ "17. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 91)\n" +
+ " for (@NonNullByDefault(DefaultLocation.RETURN_TYPE)\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing method forLoopVariable()\n" +
+ "----------\n" +
+ "18. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 91)\n" +
+ " for (@NonNullByDefault(DefaultLocation.RETURN_TYPE)\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing method forLoopVariable()\n" +
+ "----------\n" +
+ "19. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 93)\n" +
+ " @NonNullByDefault(DefaultLocation.RETURN_TYPE)\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the variable r\n" +
+ "----------\n" +
+ "20. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 96)\n" +
+ " }, r2 = () -> {\n" +
+ " ^^\n" +
+ "The local variable r2 is hiding a field from type NNBDRedundantOnLocalOrField\n" +
+ "----------\n" +
+ "21. WARNING in testnnbd\\NNBDRedundantOnLocalOrField.java (at line 97)\n" +
+ " @NonNullByDefault(DefaultLocation.RETURN_TYPE)\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the variable r2\n" +
"----------\n"
);
}
@@ -13944,7 +13944,7 @@ public void testBug484926BTB() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -13964,7 +13964,7 @@ public void testBug484926BTB() {
"\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -14047,18 +14047,18 @@ public void testBug505671() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in snippet\\Snippet.java (at line 9)\n" +
- " return Pair.<String, @NonNull Object>make(null, FALSE, null);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull Object\'\n" +
- "----------\n" +
- "2. ERROR in snippet\\Snippet.java (at line 9)\n" +
- " return Pair.<String, @NonNull Object>make(null, FALSE, null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "1. WARNING in snippet\\Snippet.java (at line 9)\n" +
+ " return Pair.<String, @NonNull Object>make(null, FALSE, null);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull Object\'\n" +
+ "----------\n" +
+ "2. ERROR in snippet\\Snippet.java (at line 9)\n" +
+ " return Pair.<String, @NonNull Object>make(null, FALSE, null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
"----------\n"
);
}
@@ -14081,13 +14081,13 @@ public void testBug501564() {
" static class Bar<E3 extends Generic<E3>> { }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in xxx\\Foo.java (at line 8)\n" +
- " static <E2 extends Generic<E2>> Bar<E2> foo() {\n" +
- " ^^\n" +
- "Null constraint mismatch: The type \'E2 extends Generic<E2>\' is not a valid substitute for the type parameter \'@NonNull E3 extends Generic<E3 extends Generic<E3>>\'\n" +
+ "----------\n" +
+ "1. ERROR in xxx\\Foo.java (at line 8)\n" +
+ " static <E2 extends Generic<E2>> Bar<E2> foo() {\n" +
+ " ^^\n" +
+ "Null constraint mismatch: The type \'E2 extends Generic<E2>\' is not a valid substitute for the type parameter \'@NonNull E3 extends Generic<E3 extends Generic<E3>>\'\n" +
"----------\n"
);
}
@@ -14110,13 +14110,13 @@ public void testBug501564interface() {
" static class Bar<E3 extends Generic<E3>> { }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in xxx\\Foo.java (at line 8)\n" +
- " static <E2 extends Generic<E2>> Bar<E2> foo() {\n" +
- " ^^\n" +
- "Null constraint mismatch: The type \'E2 extends Generic<E2>\' is not a valid substitute for the type parameter \'@NonNull E3 extends Generic<E3 extends Generic<E3>>\'\n" +
+ "----------\n" +
+ "1. ERROR in xxx\\Foo.java (at line 8)\n" +
+ " static <E2 extends Generic<E2>> Bar<E2> foo() {\n" +
+ " ^^\n" +
+ "Null constraint mismatch: The type \'E2 extends Generic<E2>\' is not a valid substitute for the type parameter \'@NonNull E3 extends Generic<E3 extends Generic<E3>>\'\n" +
"----------\n"
);
}
@@ -14148,23 +14148,23 @@ public void testBug501464() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in Foo.java (at line 11)\n" +
- " ((@NonNull Object)f).hashCode(); // Error (unexpected): Potential null pointer access: this expression has a \'@Nullable\' type\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety: Unchecked cast from @Nullable Object to @NonNull Object\n" +
- "----------\n" +
- "2. WARNING in Foo.java (at line 16)\n" +
- " @NonNull Object g = (@NonNull Object)f; // Warning (expected): Null type safety: Unchecked cast from @Nullable Object to @NonNull Object\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety: Unchecked cast from @Nullable Object to @NonNull Object\n" +
- "----------\n" +
- "3. WARNING in Foo.java (at line 20)\n" +
- " return ((@NonNull MyList<@NonNull String>) list).getAny().toUpperCase();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety: Unchecked cast from @NonNull MyList<@Nullable String> to @NonNull MyList<@NonNull String>\n" +
+ "----------\n" +
+ "1. WARNING in Foo.java (at line 11)\n" +
+ " ((@NonNull Object)f).hashCode(); // Error (unexpected): Potential null pointer access: this expression has a \'@Nullable\' type\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety: Unchecked cast from @Nullable Object to @NonNull Object\n" +
+ "----------\n" +
+ "2. WARNING in Foo.java (at line 16)\n" +
+ " @NonNull Object g = (@NonNull Object)f; // Warning (expected): Null type safety: Unchecked cast from @Nullable Object to @NonNull Object\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety: Unchecked cast from @Nullable Object to @NonNull Object\n" +
+ "----------\n" +
+ "3. WARNING in Foo.java (at line 20)\n" +
+ " return ((@NonNull MyList<@NonNull String>) list).getAny().toUpperCase();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety: Unchecked cast from @NonNull MyList<@Nullable String> to @NonNull MyList<@NonNull String>\n" +
"----------\n"
);
}
@@ -14182,7 +14182,7 @@ public void testBug507840() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -14198,7 +14198,7 @@ public void testBug507840() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -14214,7 +14214,7 @@ public void testBug508497() {
" abstract T get();\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -14232,23 +14232,23 @@ public void testBug508497() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in B2.java (at line 2)\n" +
- " void b1(Fluent f) {\n" +
- " ^^^^^^\n" +
- "Fluent is a raw type. References to generic type Fluent<SELF> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in B2.java (at line 6)\n" +
- " void b2(Reference<@org.eclipse.jdt.annotation.NonNull Fluent> ref) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Fluent is a raw type. References to generic type Fluent<SELF> should be parameterized\n" +
- "----------\n" +
- "3. INFO in B2.java (at line 7)\n" +
- " ref.get().self();\n" +
- " ^^^^^^^^^\n" +
- "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'Reference<@NonNull Fluent>\'. Type \'Reference<T>\' doesn\'t seem to be designed with null type annotations in mind\n" +
+ "----------\n" +
+ "1. WARNING in B2.java (at line 2)\n" +
+ " void b1(Fluent f) {\n" +
+ " ^^^^^^\n" +
+ "Fluent is a raw type. References to generic type Fluent<SELF> should be parameterized\n" +
+ "----------\n" +
+ "2. WARNING in B2.java (at line 6)\n" +
+ " void b2(Reference<@org.eclipse.jdt.annotation.NonNull Fluent> ref) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Fluent is a raw type. References to generic type Fluent<SELF> should be parameterized\n" +
+ "----------\n" +
+ "3. INFO in B2.java (at line 7)\n" +
+ " ref.get().self();\n" +
+ " ^^^^^^^^^\n" +
+ "Unsafe interpretation of method return type as \'@NonNull\' based on the receiver type \'Reference<@NonNull Fluent>\'. Type \'Reference<T>\' doesn\'t seem to be designed with null type annotations in mind\n" +
"----------\n"
);
}
@@ -14269,7 +14269,7 @@ public void testBug509025() {
"\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -14288,7 +14288,7 @@ public void testBug509025() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -14310,13 +14310,13 @@ public void testBug501598() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in Foo.java (at line 8)\n" +
- " static <T> @NonNull List<?> f() {\n" +
- " ^^^^^^^^^^^^^\n" +
- "The nullness annotation is redundant with a default that applies to this location\n" +
+ "----------\n" +
+ "1. WARNING in Foo.java (at line 8)\n" +
+ " static <T> @NonNull List<?> f() {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The nullness annotation is redundant with a default that applies to this location\n" +
"----------\n"
);
}
@@ -14334,7 +14334,7 @@ public void testBug509328() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -14354,13 +14354,13 @@ public void testBug509328() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\Test.java (at line 8)\n" +
- " new Feature(null) {\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in test\\Test.java (at line 8)\n" +
+ " new Feature(null) {\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n"
);
}
@@ -14379,7 +14379,7 @@ public void testBug510799() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -14402,7 +14402,7 @@ public void testBug490403() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -14425,7 +14425,7 @@ public void testBug490403while() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -14455,28 +14455,28 @@ public void testBug490403negative() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. WARNING in test\\TestNullInt.java (at line 9)\n" +
- " keys[0] = o;\n" +
- " ^\n" +
- "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull Object\'\n" +
- "----------\n" +
- "2. WARNING in test\\TestNullInt.java (at line 10)\n" +
- " keys[1] = b() ? o : \"\";\n" +
- " ^\n" +
- "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull Object\'\n" +
- "----------\n" +
- "3. ERROR in test\\TestNullInt.java (at line 15)\n" +
- " keys[0] = o;\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'@Nullable String\'\n" +
- "----------\n" +
- "4. ERROR in test\\TestNullInt.java (at line 16)\n" +
- " keys[1] = b() ? \"\" : o;\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'@Nullable String\'\n" +
+ "----------\n" +
+ "1. WARNING in test\\TestNullInt.java (at line 9)\n" +
+ " keys[0] = o;\n" +
+ " ^\n" +
+ "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull Object\'\n" +
+ "----------\n" +
+ "2. WARNING in test\\TestNullInt.java (at line 10)\n" +
+ " keys[1] = b() ? o : \"\";\n" +
+ " ^\n" +
+ "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull Object\'\n" +
+ "----------\n" +
+ "3. ERROR in test\\TestNullInt.java (at line 15)\n" +
+ " keys[0] = o;\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'@Nullable String\'\n" +
+ "----------\n" +
+ "4. ERROR in test\\TestNullInt.java (at line 16)\n" +
+ " keys[1] = b() ? \"\" : o;\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Object\' but this expression has type \'@Nullable String\'\n" +
"----------\n"
);
}
@@ -14504,23 +14504,23 @@ public void testBug490403typeArgAnnotationMismatch() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\Test.java (at line 13)\n" +
- " keys[0] = x;\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Ref<@NonNull String>\' but this expression has type \'@NonNull Ref<@Nullable String>\'\n" +
- "----------\n" +
- "2. ERROR in test\\Test.java (at line 15)\n" +
- " keys[0] = x;\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Ref<@NonNull String>\' but this expression has type \'@NonNull Ref<@Nullable String>\'\n" +
- "----------\n" +
- "3. ERROR in test\\Test.java (at line 16)\n" +
- " keys[1] = b() ? keys[0] : x;\n" +
- " ^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Ref<@NonNull String>\' but this expression has type \'@NonNull Ref<@Nullable String>\'\n" +
+ "----------\n" +
+ "1. ERROR in test\\Test.java (at line 13)\n" +
+ " keys[0] = x;\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Ref<@NonNull String>\' but this expression has type \'@NonNull Ref<@Nullable String>\'\n" +
+ "----------\n" +
+ "2. ERROR in test\\Test.java (at line 15)\n" +
+ " keys[0] = x;\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Ref<@NonNull String>\' but this expression has type \'@NonNull Ref<@Nullable String>\'\n" +
+ "----------\n" +
+ "3. ERROR in test\\Test.java (at line 16)\n" +
+ " keys[1] = b() ? keys[0] : x;\n" +
+ " ^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Ref<@NonNull String>\' but this expression has type \'@NonNull Ref<@Nullable String>\'\n" +
"----------\n"
);
}
@@ -14553,7 +14553,7 @@ public void testBug499589() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -14580,13 +14580,13 @@ public void testBug499589multidim() {
"\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\BogusWarning.java (at line 11)\n" +
- " x(array[0]);\n" +
- " ^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String @NonNull[]\' but this expression has type \'@NonNull String @Nullable[]\'\n" +
+ "----------\n" +
+ "1. ERROR in test\\BogusWarning.java (at line 11)\n" +
+ " x(array[0]);\n" +
+ " ^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String @NonNull[]\' but this expression has type \'@NonNull String @Nullable[]\'\n" +
"----------\n"
);
}
@@ -14613,13 +14613,13 @@ public void testBug499589leafTypeNullable() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\BogusWarning.java (at line 11)\n" +
- " x(array[0]);\n" +
- " ^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
+ "----------\n" +
+ "1. ERROR in test\\BogusWarning.java (at line 11)\n" +
+ " x(array[0]);\n" +
+ " ^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
"----------\n"
);
}
@@ -14645,7 +14645,7 @@ public void testBug499589qualified() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -14673,13 +14673,13 @@ public void testBug499589qualified_leafTypeNullable() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\BogusWarning.java (at line 11)\n" +
- " x(array[0]);\n" +
- " ^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
+ "----------\n" +
+ "1. ERROR in test\\BogusWarning.java (at line 11)\n" +
+ " x(array[0]);\n" +
+ " ^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String\' but this expression has type \'@Nullable String\'\n" +
"----------\n"
);
}
@@ -14705,13 +14705,13 @@ public void testBug499589qualified_multidim() {
"\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\BogusWarning.java (at line 11)\n" +
- " x(array[0]);\n" +
- " ^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String @NonNull[]\' but this expression has type \'@NonNull String @Nullable[]\'\n" +
+ "----------\n" +
+ "1. ERROR in test\\BogusWarning.java (at line 11)\n" +
+ " x(array[0]);\n" +
+ " ^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String @NonNull[]\' but this expression has type \'@NonNull String @Nullable[]\'\n" +
"----------\n"
);
}
@@ -14777,48 +14777,48 @@ public void testBug499589STB() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\X.java (at line 36)\n" +
- " check(x.fieldWithNullable1);\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@Nullable String @NonNull[] @NonNull[]\'\n" +
- "----------\n" +
- "2. ERROR in test\\X.java (at line 37)\n" +
- " check(x.fieldWithNullable2);\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@NonNull String @NonNull[] @Nullable[]\'\n" +
- "----------\n" +
- "3. ERROR in test\\X.java (at line 39)\n" +
- " check(x.listWithNullable1.get());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@Nullable String @NonNull[] @NonNull[]\'\n" +
- "----------\n" +
- "4. ERROR in test\\X.java (at line 40)\n" +
- " check(x.listWithNullable2.get());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@NonNull String @NonNull[] @Nullable[]\'\n" +
- "----------\n" +
- "5. ERROR in test\\X.java (at line 42)\n" +
- " check(x.methodWithNullable1());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@Nullable String @NonNull[] @NonNull[]\'\n" +
- "----------\n" +
- "6. ERROR in test\\X.java (at line 43)\n" +
- " check(x.methodWithNullable2());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@NonNull String @NonNull[] @Nullable[]\'\n" +
- "----------\n" +
- "7. ERROR in test\\X.java (at line 45)\n" +
- " checkGeneric(x.genericFieldWithNullable1);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Ref<@NonNull String @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\' but this expression has type \'@Nullable Ref<@Nullable String @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\'\n" +
- "----------\n" +
- "8. ERROR in test\\X.java (at line 46)\n" +
- " checkGeneric(x.genericFieldWithNullable2);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Ref<@NonNull String @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\' but this expression has type \'@NonNull Ref<@NonNull String @NonNull[] @Nullable[]> @NonNull[] @Nullable[]\'\n" +
+ "----------\n" +
+ "1. ERROR in test\\X.java (at line 36)\n" +
+ " check(x.fieldWithNullable1);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@Nullable String @NonNull[] @NonNull[]\'\n" +
+ "----------\n" +
+ "2. ERROR in test\\X.java (at line 37)\n" +
+ " check(x.fieldWithNullable2);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@NonNull String @NonNull[] @Nullable[]\'\n" +
+ "----------\n" +
+ "3. ERROR in test\\X.java (at line 39)\n" +
+ " check(x.listWithNullable1.get());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@Nullable String @NonNull[] @NonNull[]\'\n" +
+ "----------\n" +
+ "4. ERROR in test\\X.java (at line 40)\n" +
+ " check(x.listWithNullable2.get());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@NonNull String @NonNull[] @Nullable[]\'\n" +
+ "----------\n" +
+ "5. ERROR in test\\X.java (at line 42)\n" +
+ " check(x.methodWithNullable1());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@Nullable String @NonNull[] @NonNull[]\'\n" +
+ "----------\n" +
+ "6. ERROR in test\\X.java (at line 43)\n" +
+ " check(x.methodWithNullable2());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@NonNull String @NonNull[] @Nullable[]\'\n" +
+ "----------\n" +
+ "7. ERROR in test\\X.java (at line 45)\n" +
+ " checkGeneric(x.genericFieldWithNullable1);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Ref<@NonNull String @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\' but this expression has type \'@Nullable Ref<@Nullable String @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\'\n" +
+ "----------\n" +
+ "8. ERROR in test\\X.java (at line 46)\n" +
+ " checkGeneric(x.genericFieldWithNullable2);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Ref<@NonNull String @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\' but this expression has type \'@NonNull Ref<@NonNull String @NonNull[] @Nullable[]> @NonNull[] @Nullable[]\'\n" +
"----------\n"
);
}
@@ -14901,48 +14901,48 @@ public void testBug499589BTB() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\BinaryUsage.java (at line 15)\n" +
- " check(x.fieldWithNullable1);\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@Nullable String @NonNull[] @NonNull[]\'\n" +
- "----------\n" +
- "2. ERROR in test\\BinaryUsage.java (at line 16)\n" +
- " check(x.fieldWithNullable2);\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@NonNull String @NonNull[] @Nullable[]\'\n" +
- "----------\n" +
- "3. ERROR in test\\BinaryUsage.java (at line 18)\n" +
- " check(x.listWithNullable1.get());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@Nullable String @NonNull[] @NonNull[]\'\n" +
- "----------\n" +
- "4. ERROR in test\\BinaryUsage.java (at line 19)\n" +
- " check(x.listWithNullable2.get());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@NonNull String @NonNull[] @Nullable[]\'\n" +
- "----------\n" +
- "5. ERROR in test\\BinaryUsage.java (at line 21)\n" +
- " check(x.methodWithNullable1());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@Nullable String @NonNull[] @NonNull[]\'\n" +
- "----------\n" +
- "6. ERROR in test\\BinaryUsage.java (at line 22)\n" +
- " check(x.methodWithNullable2());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@NonNull String @NonNull[] @Nullable[]\'\n" +
- "----------\n" +
- "7. ERROR in test\\BinaryUsage.java (at line 24)\n" +
- " checkGeneric(x.genericFieldWithNullable1);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Ref<@NonNull String @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\' but this expression has type \'@Nullable Ref<@Nullable String @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\'\n" +
- "----------\n" +
- "8. ERROR in test\\BinaryUsage.java (at line 25)\n" +
- " checkGeneric(x.genericFieldWithNullable2);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Ref<@NonNull String @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\' but this expression has type \'@NonNull Ref<@NonNull String @NonNull[] @Nullable[]> @NonNull[] @Nullable[]\'\n" +
+ "----------\n" +
+ "1. ERROR in test\\BinaryUsage.java (at line 15)\n" +
+ " check(x.fieldWithNullable1);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@Nullable String @NonNull[] @NonNull[]\'\n" +
+ "----------\n" +
+ "2. ERROR in test\\BinaryUsage.java (at line 16)\n" +
+ " check(x.fieldWithNullable2);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@NonNull String @NonNull[] @Nullable[]\'\n" +
+ "----------\n" +
+ "3. ERROR in test\\BinaryUsage.java (at line 18)\n" +
+ " check(x.listWithNullable1.get());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@Nullable String @NonNull[] @NonNull[]\'\n" +
+ "----------\n" +
+ "4. ERROR in test\\BinaryUsage.java (at line 19)\n" +
+ " check(x.listWithNullable2.get());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@NonNull String @NonNull[] @Nullable[]\'\n" +
+ "----------\n" +
+ "5. ERROR in test\\BinaryUsage.java (at line 21)\n" +
+ " check(x.methodWithNullable1());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@Nullable String @NonNull[] @NonNull[]\'\n" +
+ "----------\n" +
+ "6. ERROR in test\\BinaryUsage.java (at line 22)\n" +
+ " check(x.methodWithNullable2());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull String @NonNull[] @NonNull[]\' but this expression has type \'@NonNull String @NonNull[] @Nullable[]\'\n" +
+ "----------\n" +
+ "7. ERROR in test\\BinaryUsage.java (at line 24)\n" +
+ " checkGeneric(x.genericFieldWithNullable1);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Ref<@NonNull String @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\' but this expression has type \'@Nullable Ref<@Nullable String @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\'\n" +
+ "----------\n" +
+ "8. ERROR in test\\BinaryUsage.java (at line 25)\n" +
+ " checkGeneric(x.genericFieldWithNullable2);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Ref<@NonNull String @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\' but this expression has type \'@NonNull Ref<@NonNull String @NonNull[] @Nullable[]> @NonNull[] @Nullable[]\'\n" +
"----------\n"
);
}
@@ -15016,48 +15016,48 @@ public void testBug499589STBqualified() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\X.java (at line 35)\n" +
- " check(x.fieldWithNullable1);\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@Nullable B @NonNull[] @NonNull[]\'\n" +
- "----------\n" +
- "2. ERROR in test\\X.java (at line 36)\n" +
- " check(x.fieldWithNullable2);\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@NonNull B @NonNull[] @Nullable[]\'\n" +
- "----------\n" +
- "3. ERROR in test\\X.java (at line 38)\n" +
- " check(x.listWithNullable1.get());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@Nullable B @NonNull[] @NonNull[]\'\n" +
- "----------\n" +
- "4. ERROR in test\\X.java (at line 39)\n" +
- " check(x.listWithNullable2.get());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@NonNull B @NonNull[] @Nullable[]\'\n" +
- "----------\n" +
- "5. ERROR in test\\X.java (at line 41)\n" +
- " check(x.methodWithNullable1());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@Nullable B @NonNull[] @NonNull[]\'\n" +
- "----------\n" +
- "6. ERROR in test\\X.java (at line 42)\n" +
- " check(x.methodWithNullable2());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@NonNull B @NonNull[] @Nullable[]\'\n" +
- "----------\n" +
- "7. ERROR in test\\X.java (at line 44)\n" +
- " checkGeneric(x.genericFieldWithNullable1);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Ref<A.@NonNull B @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\' but this expression has type \'@Nullable Ref<A.@Nullable B @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\'\n" +
- "----------\n" +
- "8. ERROR in test\\X.java (at line 45)\n" +
- " checkGeneric(x.genericFieldWithNullable2);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Ref<A.@NonNull B @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\' but this expression has type \'@NonNull Ref<A.@NonNull B @NonNull[] @Nullable[]> @NonNull[] @Nullable[]\'\n" +
+ "----------\n" +
+ "1. ERROR in test\\X.java (at line 35)\n" +
+ " check(x.fieldWithNullable1);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@Nullable B @NonNull[] @NonNull[]\'\n" +
+ "----------\n" +
+ "2. ERROR in test\\X.java (at line 36)\n" +
+ " check(x.fieldWithNullable2);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@NonNull B @NonNull[] @Nullable[]\'\n" +
+ "----------\n" +
+ "3. ERROR in test\\X.java (at line 38)\n" +
+ " check(x.listWithNullable1.get());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@Nullable B @NonNull[] @NonNull[]\'\n" +
+ "----------\n" +
+ "4. ERROR in test\\X.java (at line 39)\n" +
+ " check(x.listWithNullable2.get());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@NonNull B @NonNull[] @Nullable[]\'\n" +
+ "----------\n" +
+ "5. ERROR in test\\X.java (at line 41)\n" +
+ " check(x.methodWithNullable1());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@Nullable B @NonNull[] @NonNull[]\'\n" +
+ "----------\n" +
+ "6. ERROR in test\\X.java (at line 42)\n" +
+ " check(x.methodWithNullable2());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@NonNull B @NonNull[] @Nullable[]\'\n" +
+ "----------\n" +
+ "7. ERROR in test\\X.java (at line 44)\n" +
+ " checkGeneric(x.genericFieldWithNullable1);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Ref<A.@NonNull B @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\' but this expression has type \'@Nullable Ref<A.@Nullable B @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\'\n" +
+ "----------\n" +
+ "8. ERROR in test\\X.java (at line 45)\n" +
+ " checkGeneric(x.genericFieldWithNullable2);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Ref<A.@NonNull B @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\' but this expression has type \'@NonNull Ref<A.@NonNull B @NonNull[] @Nullable[]> @NonNull[] @Nullable[]\'\n" +
"----------\n"
);
}
@@ -15143,48 +15143,48 @@ public void testBug499589BTBqualified() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\BinaryUsage.java (at line 14)\n" +
- " check(x.fieldWithNullable1);\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@Nullable B @NonNull[] @NonNull[]\'\n" +
- "----------\n" +
- "2. ERROR in test\\BinaryUsage.java (at line 15)\n" +
- " check(x.fieldWithNullable2);\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@NonNull B @NonNull[] @Nullable[]\'\n" +
- "----------\n" +
- "3. ERROR in test\\BinaryUsage.java (at line 17)\n" +
- " check(x.listWithNullable1.get());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@Nullable B @NonNull[] @NonNull[]\'\n" +
- "----------\n" +
- "4. ERROR in test\\BinaryUsage.java (at line 18)\n" +
- " check(x.listWithNullable2.get());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@NonNull B @NonNull[] @Nullable[]\'\n" +
- "----------\n" +
- "5. ERROR in test\\BinaryUsage.java (at line 20)\n" +
- " check(x.methodWithNullable1());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@Nullable B @NonNull[] @NonNull[]\'\n" +
- "----------\n" +
- "6. ERROR in test\\BinaryUsage.java (at line 21)\n" +
- " check(x.methodWithNullable2());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@NonNull B @NonNull[] @Nullable[]\'\n" +
- "----------\n" +
- "7. ERROR in test\\BinaryUsage.java (at line 23)\n" +
- " checkGeneric(x.genericFieldWithNullable1);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Ref<A.@NonNull B @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\' but this expression has type \'@Nullable Ref<A.@Nullable B @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\'\n" +
- "----------\n" +
- "8. ERROR in test\\BinaryUsage.java (at line 24)\n" +
- " checkGeneric(x.genericFieldWithNullable2);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch (type annotations): required \'@NonNull Ref<A.@NonNull B @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\' but this expression has type \'@NonNull Ref<A.@NonNull B @NonNull[] @Nullable[]> @NonNull[] @Nullable[]\'\n" +
+ "----------\n" +
+ "1. ERROR in test\\BinaryUsage.java (at line 14)\n" +
+ " check(x.fieldWithNullable1);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@Nullable B @NonNull[] @NonNull[]\'\n" +
+ "----------\n" +
+ "2. ERROR in test\\BinaryUsage.java (at line 15)\n" +
+ " check(x.fieldWithNullable2);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@NonNull B @NonNull[] @Nullable[]\'\n" +
+ "----------\n" +
+ "3. ERROR in test\\BinaryUsage.java (at line 17)\n" +
+ " check(x.listWithNullable1.get());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@Nullable B @NonNull[] @NonNull[]\'\n" +
+ "----------\n" +
+ "4. ERROR in test\\BinaryUsage.java (at line 18)\n" +
+ " check(x.listWithNullable2.get());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@NonNull B @NonNull[] @Nullable[]\'\n" +
+ "----------\n" +
+ "5. ERROR in test\\BinaryUsage.java (at line 20)\n" +
+ " check(x.methodWithNullable1());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@Nullable B @NonNull[] @NonNull[]\'\n" +
+ "----------\n" +
+ "6. ERROR in test\\BinaryUsage.java (at line 21)\n" +
+ " check(x.methodWithNullable2());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'A.@NonNull B @NonNull[] @NonNull[]\' but this expression has type \'A.@NonNull B @NonNull[] @Nullable[]\'\n" +
+ "----------\n" +
+ "7. ERROR in test\\BinaryUsage.java (at line 23)\n" +
+ " checkGeneric(x.genericFieldWithNullable1);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Ref<A.@NonNull B @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\' but this expression has type \'@Nullable Ref<A.@Nullable B @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\'\n" +
+ "----------\n" +
+ "8. ERROR in test\\BinaryUsage.java (at line 24)\n" +
+ " checkGeneric(x.genericFieldWithNullable2);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch (type annotations): required \'@NonNull Ref<A.@NonNull B @NonNull[] @NonNull[]> @NonNull[] @NonNull[]\' but this expression has type \'@NonNull Ref<A.@NonNull B @NonNull[] @Nullable[]> @NonNull[] @Nullable[]\'\n" +
"----------\n"
);
}
@@ -15206,23 +15206,23 @@ public void testBug499589arrayAllocation() {
" public Integer[] x4 = new Integer[3];\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\ArrayAllocation.java (at line 9)\n" +
- " public Integer[] x1 = { 1, 2, 3, null };\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Integer\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in test\\ArrayAllocation.java (at line 11)\n" +
- " public Integer[] x3 = new Integer[] { 1, 2, 3, null };\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Integer\' but the provided value is null\n" +
- "----------\n" +
- "3. WARNING in test\\ArrayAllocation.java (at line 12)\n" +
- " public Integer[] x4 = new Integer[3];\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'Integer[]\' needs unchecked conversion to conform to \'@NonNull Integer []\'\n" +
+ "----------\n" +
+ "1. ERROR in test\\ArrayAllocation.java (at line 9)\n" +
+ " public Integer[] x1 = { 1, 2, 3, null };\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Integer\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in test\\ArrayAllocation.java (at line 11)\n" +
+ " public Integer[] x3 = new Integer[] { 1, 2, 3, null };\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Integer\' but the provided value is null\n" +
+ "----------\n" +
+ "3. WARNING in test\\ArrayAllocation.java (at line 12)\n" +
+ " public Integer[] x4 = new Integer[3];\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'Integer[]\' needs unchecked conversion to conform to \'@NonNull Integer []\'\n" +
"----------\n"
);
}
@@ -15278,18 +15278,18 @@ public void testBug499589generics() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\Methods.java (at line 26)\n" +
- " Object o = list.get(0); // problem\n" +
- " ^^^^^^^^^^^\n" +
- "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "2. ERROR in test\\Methods.java (at line 32)\n" +
- " Object o = array[0]; // problem\n" +
- " ^^^^^^^^\n" +
- "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "1. ERROR in test\\Methods.java (at line 26)\n" +
+ " Object o = list.get(0); // problem\n" +
+ " ^^^^^^^^^^^\n" +
+ "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "2. ERROR in test\\Methods.java (at line 32)\n" +
+ " Object o = array[0]; // problem\n" +
+ " ^^^^^^^^\n" +
+ "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
"----------\n"
);
}
@@ -15318,18 +15318,18 @@ public void testBug511723() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\ArrayVsList.java (at line 11)\n" +
- " Object o = list.get(0); // problem\n" +
- " ^^^^^^^^^^^\n" +
- "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
- "----------\n" +
- "2. ERROR in test\\ArrayVsList.java (at line 17)\n" +
- " Object o = array[0]; // problem\n" +
- " ^^^^^^^^\n" +
- "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "1. ERROR in test\\ArrayVsList.java (at line 11)\n" +
+ " Object o = list.get(0); // problem\n" +
+ " ^^^^^^^^^^^\n" +
+ "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
+ "----------\n" +
+ "2. ERROR in test\\ArrayVsList.java (at line 17)\n" +
+ " Object o = array[0]; // problem\n" +
+ " ^^^^^^^^\n" +
+ "Null type safety: required \'@NonNull\' but this expression has type \'T\', a free type variable that may represent a \'@Nullable\' type\n" +
"----------\n"
);
}
@@ -15365,7 +15365,7 @@ public void testBug498084() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -15392,18 +15392,18 @@ public void testBug498084b() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\Test2.java (at line 12)\n" +
- " Consumer<@Nullable Integer> sam = Test2::f;\n" +
- " ^^^^^^^^\n" +
- "Null type mismatch at parameter 1: required \'int\' but provided \'@Nullable Integer\' via method descriptor Consumer<Integer>.accept(Integer)\n" +
- "----------\n" +
- "2. WARNING in test\\Test2.java (at line 14)\n" +
- " Consumer<Integer> sam2 = Test2::f;\n" +
- " ^^^^^^^^\n" +
- "Null type safety: parameter 1 provided via method descriptor Consumer<Integer>.accept(Integer) needs unchecked conversion to conform to \'int\'\n" +
+ "----------\n" +
+ "1. ERROR in test\\Test2.java (at line 12)\n" +
+ " Consumer<@Nullable Integer> sam = Test2::f;\n" +
+ " ^^^^^^^^\n" +
+ "Null type mismatch at parameter 1: required \'int\' but provided \'@Nullable Integer\' via method descriptor Consumer<Integer>.accept(Integer)\n" +
+ "----------\n" +
+ "2. WARNING in test\\Test2.java (at line 14)\n" +
+ " Consumer<Integer> sam2 = Test2::f;\n" +
+ " ^^^^^^^^\n" +
+ "Null type safety: parameter 1 provided via method descriptor Consumer<Integer>.accept(Integer) needs unchecked conversion to conform to \'int\'\n" +
"----------\n"
);
}
@@ -15429,13 +15429,13 @@ public void testBug513495() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\Test3.java (at line 9)\n" +
- " Function<@Nullable Integer, Object> sam = Integer::intValue;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Null type mismatch at parameter 'this': required \'@NonNull Integer\' but provided \'@Nullable Integer\' via method descriptor Function<Integer,Object>.apply(Integer)\n" +
+ "----------\n" +
+ "1. ERROR in test\\Test3.java (at line 9)\n" +
+ " Function<@Nullable Integer, Object> sam = Integer::intValue;\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Null type mismatch at parameter 'this': required \'@NonNull Integer\' but provided \'@Nullable Integer\' via method descriptor Function<Integer,Object>.apply(Integer)\n" +
"----------\n"
);
}
@@ -15467,7 +15467,7 @@ public void testBug513855() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -15497,7 +15497,7 @@ public void testBug513855lambda() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -15513,7 +15513,7 @@ public void testBug514091() {
" void f(A[] a);\n" +
"}\n" +
""
- },
+ },
getCompilerOptions(),
""
);
@@ -15532,7 +15532,7 @@ public void testBug514091() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -15557,7 +15557,7 @@ public void testBug514570() {
" }\n" +
"}\n" +
"",
- },
+ },
compilerOptions,
""
);
@@ -15604,38 +15604,38 @@ public void testBug514977() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in test\\Test.java (at line 30)\n" +
- " f(array);\n" +
- " ^^^^^\n" +
- "Null type mismatch: required \'@NonNull Integer @NonNull[]\' but the provided value is inferred as @Nullable\n" +
- "----------\n" +
- "2. ERROR in test\\Test.java (at line 31)\n" +
- " f(i);\n" +
- " ^\n" +
- "Null type mismatch: required \'@NonNull Integer\' but the provided value is inferred as @Nullable\n" +
- "----------\n" +
- "3. ERROR in test\\Test.java (at line 32)\n" +
- " f(1, i);\n" +
- " ^\n" +
- "Null type mismatch: required \'@NonNull Integer\' but the provided value is inferred as @Nullable\n" +
- "----------\n" +
- "4. ERROR in test\\Test.java (at line 33)\n" +
- " g(array);\n" +
- " ^^^^^\n" +
- "Null type mismatch: required \'@NonNull Integer @NonNull[]\' but the provided value is inferred as @Nullable\n" +
- "----------\n" +
- "5. ERROR in test\\Test.java (at line 34)\n" +
- " g(i);\n" +
- " ^\n" +
- "Null type mismatch: required \'@NonNull Integer\' but the provided value is inferred as @Nullable\n" +
- "----------\n" +
- "6. ERROR in test\\Test.java (at line 35)\n" +
- " g(1, i);\n" +
- " ^\n" +
- "Null type mismatch: required \'@NonNull Integer\' but the provided value is inferred as @Nullable\n" +
+ "----------\n" +
+ "1. ERROR in test\\Test.java (at line 30)\n" +
+ " f(array);\n" +
+ " ^^^^^\n" +
+ "Null type mismatch: required \'@NonNull Integer @NonNull[]\' but the provided value is inferred as @Nullable\n" +
+ "----------\n" +
+ "2. ERROR in test\\Test.java (at line 31)\n" +
+ " f(i);\n" +
+ " ^\n" +
+ "Null type mismatch: required \'@NonNull Integer\' but the provided value is inferred as @Nullable\n" +
+ "----------\n" +
+ "3. ERROR in test\\Test.java (at line 32)\n" +
+ " f(1, i);\n" +
+ " ^\n" +
+ "Null type mismatch: required \'@NonNull Integer\' but the provided value is inferred as @Nullable\n" +
+ "----------\n" +
+ "4. ERROR in test\\Test.java (at line 33)\n" +
+ " g(array);\n" +
+ " ^^^^^\n" +
+ "Null type mismatch: required \'@NonNull Integer @NonNull[]\' but the provided value is inferred as @Nullable\n" +
+ "----------\n" +
+ "5. ERROR in test\\Test.java (at line 34)\n" +
+ " g(i);\n" +
+ " ^\n" +
+ "Null type mismatch: required \'@NonNull Integer\' but the provided value is inferred as @Nullable\n" +
+ "----------\n" +
+ "6. ERROR in test\\Test.java (at line 35)\n" +
+ " g(1, i);\n" +
+ " ^\n" +
+ "Null type mismatch: required \'@NonNull Integer\' but the provided value is inferred as @Nullable\n" +
"----------\n"
);
}
@@ -15660,7 +15660,7 @@ public void testBug515292() {
" }\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -15668,41 +15668,41 @@ public void testBug515292() {
public void testBug526555() {
Map customOptions = getCompilerOptions();
customOptions.put(JavaCore.COMPILER_PB_NULL_SPECIFICATION_VIOLATION, JavaCore.WARNING);
-
+
runWarningTestWithLibs(
true/*flush*/,
new String[] {
"ztest/OverrideTest.java",
- "package ztest;\n" +
- "\n" +
- "import static org.eclipse.jdt.annotation.DefaultLocation.ARRAY_CONTENTS;\n" +
- "import static org.eclipse.jdt.annotation.DefaultLocation.FIELD;\n" +
- "import static org.eclipse.jdt.annotation.DefaultLocation.PARAMETER;\n" +
- "import static org.eclipse.jdt.annotation.DefaultLocation.RETURN_TYPE;\n" +
- "import static org.eclipse.jdt.annotation.DefaultLocation.TYPE_ARGUMENT;\n" +
- "import static org.eclipse.jdt.annotation.DefaultLocation.TYPE_BOUND;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "interface X509TrustManager {\n" +
- " void checkClientTrusted(String[] arg0, String arg1);\n" +
- "\n" +
- "}\n" +
- "\n" +
- "@NonNullByDefault({ PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT, ARRAY_CONTENTS })\n" +
- "public class OverrideTest implements X509TrustManager {\n" +
- " @Override\n" +
- " public void checkClientTrusted(String @Nullable [] arg0, @Nullable String arg1) {\n" +
- " }\n" +
+ "package ztest;\n" +
+ "\n" +
+ "import static org.eclipse.jdt.annotation.DefaultLocation.ARRAY_CONTENTS;\n" +
+ "import static org.eclipse.jdt.annotation.DefaultLocation.FIELD;\n" +
+ "import static org.eclipse.jdt.annotation.DefaultLocation.PARAMETER;\n" +
+ "import static org.eclipse.jdt.annotation.DefaultLocation.RETURN_TYPE;\n" +
+ "import static org.eclipse.jdt.annotation.DefaultLocation.TYPE_ARGUMENT;\n" +
+ "import static org.eclipse.jdt.annotation.DefaultLocation.TYPE_BOUND;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "interface X509TrustManager {\n" +
+ " void checkClientTrusted(String[] arg0, String arg1);\n" +
+ "\n" +
+ "}\n" +
+ "\n" +
+ "@NonNullByDefault({ PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT, ARRAY_CONTENTS })\n" +
+ "public class OverrideTest implements X509TrustManager {\n" +
+ " @Override\n" +
+ " public void checkClientTrusted(String @Nullable [] arg0, @Nullable String arg1) {\n" +
+ " }\n" +
"}",
- },
+ },
customOptions,
- "----------\n" +
- "1. WARNING in ztest\\OverrideTest.java (at line 21)\n" +
- " public void checkClientTrusted(String @Nullable [] arg0, @Nullable String arg1) {\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Illegal redefinition of parameter arg0, inherited method from X509TrustManager declares this parameter as \'String[]\' (mismatching null constraints)\n" +
+ "----------\n" +
+ "1. WARNING in ztest\\OverrideTest.java (at line 21)\n" +
+ " public void checkClientTrusted(String @Nullable [] arg0, @Nullable String arg1) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Illegal redefinition of parameter arg0, inherited method from X509TrustManager declares this parameter as \'String[]\' (mismatching null constraints)\n" +
"----------\n"
);
}
@@ -15750,7 +15750,7 @@ public void testBug530913() {
"public @interface Nullable {\n" +
"}\n" +
"",
- },
+ },
customOptions,
""
);
@@ -15781,7 +15781,7 @@ public void testBug530913() {
" }\n" +
"}\n" +
"",
- },
+ },
customOptions,
""
);
@@ -15883,103 +15883,103 @@ public void testBug530913() {
" }\n" +
"}\n" +
"",
- },
+ },
customOptions,
- "----------\n" +
- "1. ERROR in nnbd_test1\\Test.java (at line 15)\n" +
- " if (s2 == null) { // warning expected\n" +
- " ^^\n" +
- "Redundant null check: comparing \'@NonNull String\' against null\n" +
- "----------\n" +
- "2. ERROR in nnbd_test1\\Test.java (at line 21)\n" +
- " if (s1 == null) { // warning expected\n" +
- " ^^\n" +
- "Redundant null check: comparing \'@NonNull String\' against null\n" +
- "----------\n" +
- "3. ERROR in nnbd_test1\\Test.java (at line 31)\n" +
- " if (s1 == null) { // warning expected\n" +
- " ^^\n" +
- "Redundant null check: comparing \'@NonNull Supplier<String>\' against null\n" +
- "----------\n" +
- "4. ERROR in nnbd_test1\\Test.java (at line 35)\n" +
- " if (s2 == null) { // warning expected\n" +
- " ^^\n" +
- "Redundant null check: comparing \'@NonNull Supplier<@NonNull String>\' against null\n" +
- "----------\n" +
- "5. ERROR in nnbd_test1\\Test.java (at line 42)\n" +
- " if (s2.get() == null) { // warning expected\n" +
- " ^^^^^^^^\n" +
- "Redundant null check: comparing \'@NonNull String\' against null\n" +
- "----------\n" +
- "6. ERROR in nnbd_test1\\Test.java (at line 49)\n" +
- " d.f(null, null); // warning on the second null expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "7. ERROR in nnbd_test1\\Test.java (at line 50)\n" +
- " d.g(null, null); // warning on the first null expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "8. ERROR in nnbd_test1\\Test.java (at line 55)\n" +
- " d.f(null, null); // warning on the second null expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "9. ERROR in nnbd_test1\\Test.java (at line 56)\n" +
- " d.g(null, null); // warning on the first null expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "10. ERROR in nnbd_test1\\Test.java (at line 62)\n" +
- " void f(String s1, String s2) { // warning on the first parameter expected\n" +
- " ^^^^^^\n" +
- "Illegal redefinition of parameter s1, inherited method from Test does not constrain this parameter\n" +
- "----------\n" +
- "11. ERROR in nnbd_test1\\Test.java (at line 63)\n" +
- " super.f(null, null); // warning on the second null expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "12. ERROR in nnbd_test1\\Test.java (at line 67)\n" +
- " void g(String s1, String s2) { // warning on the second parameter expected\n" +
- " ^^^^^^\n" +
- "Illegal redefinition of parameter s2, inherited method from Test does not constrain this parameter\n" +
- "----------\n" +
- "13. ERROR in nnbd_test1\\Test.java (at line 68)\n" +
- " super.g(null, null); // warning on the first null expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "14. ERROR in nnbd_test1\\Test.java (at line 72)\n" +
- " void h(Supplier<String> s1, Supplier<String> s2) { // warning on the first parameter expected\n" +
- " ^^^^^^^^\n" +
- "Illegal redefinition of parameter s1, inherited method from Test declares this parameter as \'@NonNull Supplier<String>\' (mismatching null constraints)\n" +
- "----------\n" +
- "15. ERROR in nnbd_test1\\Test.java (at line 80)\n" +
- " public void f(String s1, String s2) { // warning on the first parameter expected\n" +
- " ^^^^^^\n" +
- "Illegal redefinition of parameter s1, inherited method from Data does not constrain this parameter\n" +
- "----------\n" +
- "16. ERROR in nnbd_test1\\Test.java (at line 81)\n" +
- " super.f(null, null); // warning on the second null expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "17. ERROR in nnbd_test1\\Test.java (at line 85)\n" +
- " public void g(String s1, String s2) { // warning on the second parameter expected\n" +
- " ^^^^^^\n" +
- "Illegal redefinition of parameter s2, inherited method from Data does not constrain this parameter\n" +
- "----------\n" +
- "18. ERROR in nnbd_test1\\Test.java (at line 86)\n" +
- " super.g(null, null); // warning on the first null expected\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "19. ERROR in nnbd_test1\\Test.java (at line 90)\n" +
- " public void h(Supplier<String> s1, Supplier<String> s2) { // warning on the first parameter expected\n" +
- " ^^^^^^^^\n" +
- "Illegal redefinition of parameter s1, inherited method from Data declares this parameter as \'@NonNull Supplier<String>\' (mismatching null constraints)\n" +
+ "----------\n" +
+ "1. ERROR in nnbd_test1\\Test.java (at line 15)\n" +
+ " if (s2 == null) { // warning expected\n" +
+ " ^^\n" +
+ "Redundant null check: comparing \'@NonNull String\' against null\n" +
+ "----------\n" +
+ "2. ERROR in nnbd_test1\\Test.java (at line 21)\n" +
+ " if (s1 == null) { // warning expected\n" +
+ " ^^\n" +
+ "Redundant null check: comparing \'@NonNull String\' against null\n" +
+ "----------\n" +
+ "3. ERROR in nnbd_test1\\Test.java (at line 31)\n" +
+ " if (s1 == null) { // warning expected\n" +
+ " ^^\n" +
+ "Redundant null check: comparing \'@NonNull Supplier<String>\' against null\n" +
+ "----------\n" +
+ "4. ERROR in nnbd_test1\\Test.java (at line 35)\n" +
+ " if (s2 == null) { // warning expected\n" +
+ " ^^\n" +
+ "Redundant null check: comparing \'@NonNull Supplier<@NonNull String>\' against null\n" +
+ "----------\n" +
+ "5. ERROR in nnbd_test1\\Test.java (at line 42)\n" +
+ " if (s2.get() == null) { // warning expected\n" +
+ " ^^^^^^^^\n" +
+ "Redundant null check: comparing \'@NonNull String\' against null\n" +
+ "----------\n" +
+ "6. ERROR in nnbd_test1\\Test.java (at line 49)\n" +
+ " d.f(null, null); // warning on the second null expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "7. ERROR in nnbd_test1\\Test.java (at line 50)\n" +
+ " d.g(null, null); // warning on the first null expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "8. ERROR in nnbd_test1\\Test.java (at line 55)\n" +
+ " d.f(null, null); // warning on the second null expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "9. ERROR in nnbd_test1\\Test.java (at line 56)\n" +
+ " d.g(null, null); // warning on the first null expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "10. ERROR in nnbd_test1\\Test.java (at line 62)\n" +
+ " void f(String s1, String s2) { // warning on the first parameter expected\n" +
+ " ^^^^^^\n" +
+ "Illegal redefinition of parameter s1, inherited method from Test does not constrain this parameter\n" +
+ "----------\n" +
+ "11. ERROR in nnbd_test1\\Test.java (at line 63)\n" +
+ " super.f(null, null); // warning on the second null expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "12. ERROR in nnbd_test1\\Test.java (at line 67)\n" +
+ " void g(String s1, String s2) { // warning on the second parameter expected\n" +
+ " ^^^^^^\n" +
+ "Illegal redefinition of parameter s2, inherited method from Test does not constrain this parameter\n" +
+ "----------\n" +
+ "13. ERROR in nnbd_test1\\Test.java (at line 68)\n" +
+ " super.g(null, null); // warning on the first null expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "14. ERROR in nnbd_test1\\Test.java (at line 72)\n" +
+ " void h(Supplier<String> s1, Supplier<String> s2) { // warning on the first parameter expected\n" +
+ " ^^^^^^^^\n" +
+ "Illegal redefinition of parameter s1, inherited method from Test declares this parameter as \'@NonNull Supplier<String>\' (mismatching null constraints)\n" +
+ "----------\n" +
+ "15. ERROR in nnbd_test1\\Test.java (at line 80)\n" +
+ " public void f(String s1, String s2) { // warning on the first parameter expected\n" +
+ " ^^^^^^\n" +
+ "Illegal redefinition of parameter s1, inherited method from Data does not constrain this parameter\n" +
+ "----------\n" +
+ "16. ERROR in nnbd_test1\\Test.java (at line 81)\n" +
+ " super.f(null, null); // warning on the second null expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "17. ERROR in nnbd_test1\\Test.java (at line 85)\n" +
+ " public void g(String s1, String s2) { // warning on the second parameter expected\n" +
+ " ^^^^^^\n" +
+ "Illegal redefinition of parameter s2, inherited method from Data does not constrain this parameter\n" +
+ "----------\n" +
+ "18. ERROR in nnbd_test1\\Test.java (at line 86)\n" +
+ " super.g(null, null); // warning on the first null expected\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "19. ERROR in nnbd_test1\\Test.java (at line 90)\n" +
+ " public void h(Supplier<String> s1, Supplier<String> s2) { // warning on the first parameter expected\n" +
+ " ^^^^^^^^\n" +
+ "Illegal redefinition of parameter s1, inherited method from Data declares this parameter as \'@NonNull Supplier<String>\' (mismatching null constraints)\n" +
"----------\n"
);
}
@@ -16034,7 +16034,7 @@ public void testBug530913b() {
"public @interface Nullable {\n" +
"}\n" +
"",
- },
+ },
customOptions,
""
);
@@ -16072,7 +16072,7 @@ public void testBug530913b() {
" }\n" +
"}\n" +
"",
- };
+ };
runner.runConformTest();
}
public void testBug530971() {
@@ -16170,7 +16170,7 @@ public void testBug530971() {
"public @interface Nullable {\n" +
"}\n" +
"",
- },
+ },
customOptions,
""
);
@@ -16338,143 +16338,143 @@ public void testBug530971() {
" }\n" +
"}\n" +
"",
- },
+ },
customOptions,
- "----------\n" +
- "1. ERROR in test\\Test.java (at line 17)\n" +
- " C<Object, ? extends Number> f1; // warning 1\n" +
- " ^^\n" +
- "The @NonNull field f1 may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in test\\Test.java (at line 20)\n" +
- " C<@NonNull Object, ? extends @NonNull Number> f2; // warning 2\n" +
- " ^^\n" +
- "The @NonNull field f2 may not have been initialized\n" +
- "----------\n" +
- "3. ERROR in test\\Test.java (at line 35)\n" +
- " Object m1(@NonNull C<@NonNull Object, ? extends @NonNull Number> p1, @NonNull Object p2) { // warning 3 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m1(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "4. ERROR in test\\Test.java (at line 36)\n" +
- " f1 = null; // warning 4\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
- "----------\n" +
- "5. ERROR in test\\Test.java (at line 37)\n" +
- " f2 = null; // warning 5\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
- "----------\n" +
- "6. ERROR in test\\Test.java (at line 43)\n" +
- " Object m2(@NonNull C<@NonNull Object, ? extends @NonNull Number> p1, @NonNull Object p2) { // warning 6 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m2(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "7. ERROR in test\\Test.java (at line 49)\n" +
- " Object m3(@NonNull C<@NonNull Object, ? extends @NonNull Number> p1, @NonNull Object p2) { // warning 7 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m3(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "8. ERROR in test\\Test.java (at line 60)\n" +
- " Object m1(C<Object, ? extends Number> p1, Object p2) { // warning 8 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m1(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "9. ERROR in test\\Test.java (at line 61)\n" +
- " f1 = null; // warning 9\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
- "----------\n" +
- "10. ERROR in test\\Test.java (at line 62)\n" +
- " f2 = null; // warning 10\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
- "----------\n" +
- "11. ERROR in test\\Test.java (at line 68)\n" +
- " Object m2(C<Object, ? extends Number> p1, Object p2) { // warning 11 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m2(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "12. ERROR in test\\Test.java (at line 74)\n" +
- " Object m3(C<Object, ? extends Number> p1, Object p2) { // warning 12 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m3(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "13. ERROR in test\\Test.java (at line 86)\n" +
- " Object m1(C<Object, ? extends Number> p1, Object p2) { // warning 13 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m1(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "14. ERROR in test\\Test.java (at line 87)\n" +
- " f1 = null; // warning 14\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
- "----------\n" +
- "15. ERROR in test\\Test.java (at line 88)\n" +
- " f2 = null; // warning 15\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
- "----------\n" +
- "16. ERROR in test\\Test.java (at line 94)\n" +
- " Object m2(C<Object, ? extends Number> p1, Object p2) { // warning 16 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m2(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "17. ERROR in test\\Test.java (at line 100)\n" +
- " Object m3(C<Object, ? extends Number> p1, Object p2) { // warning 17 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m3(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "18. ERROR in test\\Test.java (at line 112)\n" +
- " Object m1(C<Object, ? extends Number> p1, Object p2) { // warning 18 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m1(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "19. ERROR in test\\Test.java (at line 113)\n" +
- " f1 = null; // warning 19\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
- "----------\n" +
- "20. ERROR in test\\Test.java (at line 114)\n" +
- " f2 = null; // warning 20\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
- "----------\n" +
- "21. ERROR in test\\Test.java (at line 120)\n" +
- " Object m2(C<Object, ? extends Number> p1, Object p2) { // warning 21 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m2(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "22. ERROR in test\\Test.java (at line 126)\n" +
- " Object m3(C<Object, ? extends Number> p1, Object p2) { // warning 22 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m3(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "23. ERROR in test\\Test.java (at line 139)\n" +
- " Object m1(C<Object, ? extends Number> p1, Object p2) { // warning 23 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m1(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "24. ERROR in test\\Test.java (at line 140)\n" +
- " f1 = null; // warning 24\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
- "----------\n" +
- "25. ERROR in test\\Test.java (at line 141)\n" +
- " f2 = null; // warning 25\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
- "----------\n" +
- "26. ERROR in test\\Test.java (at line 147)\n" +
- " Object m2(C<Object, ? extends Number> p1, Object p2) { // warning 26 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m2(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "27. ERROR in test\\Test.java (at line 153)\n" +
- " Object m3(C<Object, ? extends Number> p1, Object p2) { // warning 27 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m3(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "1. ERROR in test\\Test.java (at line 17)\n" +
+ " C<Object, ? extends Number> f1; // warning 1\n" +
+ " ^^\n" +
+ "The @NonNull field f1 may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in test\\Test.java (at line 20)\n" +
+ " C<@NonNull Object, ? extends @NonNull Number> f2; // warning 2\n" +
+ " ^^\n" +
+ "The @NonNull field f2 may not have been initialized\n" +
+ "----------\n" +
+ "3. ERROR in test\\Test.java (at line 35)\n" +
+ " Object m1(@NonNull C<@NonNull Object, ? extends @NonNull Number> p1, @NonNull Object p2) { // warning 3 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m1(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "4. ERROR in test\\Test.java (at line 36)\n" +
+ " f1 = null; // warning 4\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
+ "----------\n" +
+ "5. ERROR in test\\Test.java (at line 37)\n" +
+ " f2 = null; // warning 5\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
+ "----------\n" +
+ "6. ERROR in test\\Test.java (at line 43)\n" +
+ " Object m2(@NonNull C<@NonNull Object, ? extends @NonNull Number> p1, @NonNull Object p2) { // warning 6 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m2(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "7. ERROR in test\\Test.java (at line 49)\n" +
+ " Object m3(@NonNull C<@NonNull Object, ? extends @NonNull Number> p1, @NonNull Object p2) { // warning 7 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m3(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "8. ERROR in test\\Test.java (at line 60)\n" +
+ " Object m1(C<Object, ? extends Number> p1, Object p2) { // warning 8 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m1(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "9. ERROR in test\\Test.java (at line 61)\n" +
+ " f1 = null; // warning 9\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
+ "----------\n" +
+ "10. ERROR in test\\Test.java (at line 62)\n" +
+ " f2 = null; // warning 10\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
+ "----------\n" +
+ "11. ERROR in test\\Test.java (at line 68)\n" +
+ " Object m2(C<Object, ? extends Number> p1, Object p2) { // warning 11 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m2(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "12. ERROR in test\\Test.java (at line 74)\n" +
+ " Object m3(C<Object, ? extends Number> p1, Object p2) { // warning 12 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m3(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "13. ERROR in test\\Test.java (at line 86)\n" +
+ " Object m1(C<Object, ? extends Number> p1, Object p2) { // warning 13 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m1(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "14. ERROR in test\\Test.java (at line 87)\n" +
+ " f1 = null; // warning 14\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
+ "----------\n" +
+ "15. ERROR in test\\Test.java (at line 88)\n" +
+ " f2 = null; // warning 15\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
+ "----------\n" +
+ "16. ERROR in test\\Test.java (at line 94)\n" +
+ " Object m2(C<Object, ? extends Number> p1, Object p2) { // warning 16 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m2(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "17. ERROR in test\\Test.java (at line 100)\n" +
+ " Object m3(C<Object, ? extends Number> p1, Object p2) { // warning 17 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m3(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "18. ERROR in test\\Test.java (at line 112)\n" +
+ " Object m1(C<Object, ? extends Number> p1, Object p2) { // warning 18 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m1(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "19. ERROR in test\\Test.java (at line 113)\n" +
+ " f1 = null; // warning 19\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
+ "----------\n" +
+ "20. ERROR in test\\Test.java (at line 114)\n" +
+ " f2 = null; // warning 20\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
+ "----------\n" +
+ "21. ERROR in test\\Test.java (at line 120)\n" +
+ " Object m2(C<Object, ? extends Number> p1, Object p2) { // warning 21 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m2(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "22. ERROR in test\\Test.java (at line 126)\n" +
+ " Object m3(C<Object, ? extends Number> p1, Object p2) { // warning 22 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m3(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "23. ERROR in test\\Test.java (at line 139)\n" +
+ " Object m1(C<Object, ? extends Number> p1, Object p2) { // warning 23 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m1(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "24. ERROR in test\\Test.java (at line 140)\n" +
+ " f1 = null; // warning 24\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
+ "----------\n" +
+ "25. ERROR in test\\Test.java (at line 141)\n" +
+ " f2 = null; // warning 25\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
+ "----------\n" +
+ "26. ERROR in test\\Test.java (at line 147)\n" +
+ " Object m2(C<Object, ? extends Number> p1, Object p2) { // warning 26 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m2(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "27. ERROR in test\\Test.java (at line 153)\n" +
+ " Object m3(C<Object, ? extends Number> p1, Object p2) { // warning 27 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m3(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
"----------\n"
);
}
@@ -16576,7 +16576,7 @@ public void testBug530971_BTB() {
"public @interface Nullable {\n" +
"}\n" +
"",
- },
+ },
customOptions,
""
);
@@ -16620,7 +16620,7 @@ public void testBug530971_BTB() {
},
customOptions,
""
- );
+ );
runNegativeTestWithLibs(
new String[] {
"test/Test.java",
@@ -16785,143 +16785,143 @@ public void testBug530971_BTB() {
" }\n" +
"}\n" +
"",
- },
+ },
customOptions,
- "----------\n" +
- "1. ERROR in test\\Test.java (at line 17)\n" +
- " C<Object, ? extends Number> f1; // warning 1\n" +
- " ^^\n" +
- "The @NonNull field f1 may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in test\\Test.java (at line 20)\n" +
- " C<@NonNull Object, ? extends @NonNull Number> f2; // warning 2\n" +
- " ^^\n" +
- "The @NonNull field f2 may not have been initialized\n" +
- "----------\n" +
- "3. ERROR in test\\Test.java (at line 35)\n" +
- " Object m1(@NonNull C<@NonNull Object, ? extends @NonNull Number> p1, @NonNull Object p2) { // warning 3 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m1(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "4. ERROR in test\\Test.java (at line 36)\n" +
- " f1 = null; // warning 4\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
- "----------\n" +
- "5. ERROR in test\\Test.java (at line 37)\n" +
- " f2 = null; // warning 5\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
- "----------\n" +
- "6. ERROR in test\\Test.java (at line 43)\n" +
- " Object m2(@NonNull C<@NonNull Object, ? extends @NonNull Number> p1, @NonNull Object p2) { // warning 6 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m2(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "7. ERROR in test\\Test.java (at line 49)\n" +
- " Object m3(@NonNull C<@NonNull Object, ? extends @NonNull Number> p1, @NonNull Object p2) { // warning 7 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m3(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "8. ERROR in test\\Test.java (at line 60)\n" +
- " Object m1(C<Object, ? extends Number> p1, Object p2) { // warning 8 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m1(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "9. ERROR in test\\Test.java (at line 61)\n" +
- " f1 = null; // warning 9\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
- "----------\n" +
- "10. ERROR in test\\Test.java (at line 62)\n" +
- " f2 = null; // warning 10\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
- "----------\n" +
- "11. ERROR in test\\Test.java (at line 68)\n" +
- " Object m2(C<Object, ? extends Number> p1, Object p2) { // warning 11 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m2(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "12. ERROR in test\\Test.java (at line 74)\n" +
- " Object m3(C<Object, ? extends Number> p1, Object p2) { // warning 12 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m3(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "13. ERROR in test\\Test.java (at line 86)\n" +
- " Object m1(C<Object, ? extends Number> p1, Object p2) { // warning 13 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m1(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "14. ERROR in test\\Test.java (at line 87)\n" +
- " f1 = null; // warning 14\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
- "----------\n" +
- "15. ERROR in test\\Test.java (at line 88)\n" +
- " f2 = null; // warning 15\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
- "----------\n" +
- "16. ERROR in test\\Test.java (at line 94)\n" +
- " Object m2(C<Object, ? extends Number> p1, Object p2) { // warning 16 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m2(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "17. ERROR in test\\Test.java (at line 100)\n" +
- " Object m3(C<Object, ? extends Number> p1, Object p2) { // warning 17 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m3(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "18. ERROR in test\\Test.java (at line 112)\n" +
- " Object m1(C<Object, ? extends Number> p1, Object p2) { // warning 18 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m1(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "19. ERROR in test\\Test.java (at line 113)\n" +
- " f1 = null; // warning 19\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
- "----------\n" +
- "20. ERROR in test\\Test.java (at line 114)\n" +
- " f2 = null; // warning 20\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
- "----------\n" +
- "21. ERROR in test\\Test.java (at line 120)\n" +
- " Object m2(C<Object, ? extends Number> p1, Object p2) { // warning 21 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m2(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "22. ERROR in test\\Test.java (at line 126)\n" +
- " Object m3(C<Object, ? extends Number> p1, Object p2) { // warning 22 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m3(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "23. ERROR in test\\Test.java (at line 139)\n" +
- " Object m1(C<Object, ? extends Number> p1, Object p2) { // warning 23 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m1(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "24. ERROR in test\\Test.java (at line 140)\n" +
- " f1 = null; // warning 24\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
- "----------\n" +
- "25. ERROR in test\\Test.java (at line 141)\n" +
- " f2 = null; // warning 25\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
- "----------\n" +
- "26. ERROR in test\\Test.java (at line 147)\n" +
- " Object m2(C<Object, ? extends Number> p1, Object p2) { // warning 26 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m2(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
- "----------\n" +
- "27. ERROR in test\\Test.java (at line 153)\n" +
- " Object m3(C<Object, ? extends Number> p1, Object p2) { // warning 27 on return type\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with \'@NonNull Object\' returned from X.m3(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "1. ERROR in test\\Test.java (at line 17)\n" +
+ " C<Object, ? extends Number> f1; // warning 1\n" +
+ " ^^\n" +
+ "The @NonNull field f1 may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in test\\Test.java (at line 20)\n" +
+ " C<@NonNull Object, ? extends @NonNull Number> f2; // warning 2\n" +
+ " ^^\n" +
+ "The @NonNull field f2 may not have been initialized\n" +
+ "----------\n" +
+ "3. ERROR in test\\Test.java (at line 35)\n" +
+ " Object m1(@NonNull C<@NonNull Object, ? extends @NonNull Number> p1, @NonNull Object p2) { // warning 3 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m1(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "4. ERROR in test\\Test.java (at line 36)\n" +
+ " f1 = null; // warning 4\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
+ "----------\n" +
+ "5. ERROR in test\\Test.java (at line 37)\n" +
+ " f2 = null; // warning 5\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
+ "----------\n" +
+ "6. ERROR in test\\Test.java (at line 43)\n" +
+ " Object m2(@NonNull C<@NonNull Object, ? extends @NonNull Number> p1, @NonNull Object p2) { // warning 6 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m2(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "7. ERROR in test\\Test.java (at line 49)\n" +
+ " Object m3(@NonNull C<@NonNull Object, ? extends @NonNull Number> p1, @NonNull Object p2) { // warning 7 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m3(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "8. ERROR in test\\Test.java (at line 60)\n" +
+ " Object m1(C<Object, ? extends Number> p1, Object p2) { // warning 8 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m1(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "9. ERROR in test\\Test.java (at line 61)\n" +
+ " f1 = null; // warning 9\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
+ "----------\n" +
+ "10. ERROR in test\\Test.java (at line 62)\n" +
+ " f2 = null; // warning 10\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
+ "----------\n" +
+ "11. ERROR in test\\Test.java (at line 68)\n" +
+ " Object m2(C<Object, ? extends Number> p1, Object p2) { // warning 11 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m2(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "12. ERROR in test\\Test.java (at line 74)\n" +
+ " Object m3(C<Object, ? extends Number> p1, Object p2) { // warning 12 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m3(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "13. ERROR in test\\Test.java (at line 86)\n" +
+ " Object m1(C<Object, ? extends Number> p1, Object p2) { // warning 13 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m1(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "14. ERROR in test\\Test.java (at line 87)\n" +
+ " f1 = null; // warning 14\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
+ "----------\n" +
+ "15. ERROR in test\\Test.java (at line 88)\n" +
+ " f2 = null; // warning 15\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
+ "----------\n" +
+ "16. ERROR in test\\Test.java (at line 94)\n" +
+ " Object m2(C<Object, ? extends Number> p1, Object p2) { // warning 16 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m2(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "17. ERROR in test\\Test.java (at line 100)\n" +
+ " Object m3(C<Object, ? extends Number> p1, Object p2) { // warning 17 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m3(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "18. ERROR in test\\Test.java (at line 112)\n" +
+ " Object m1(C<Object, ? extends Number> p1, Object p2) { // warning 18 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m1(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "19. ERROR in test\\Test.java (at line 113)\n" +
+ " f1 = null; // warning 19\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
+ "----------\n" +
+ "20. ERROR in test\\Test.java (at line 114)\n" +
+ " f2 = null; // warning 20\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
+ "----------\n" +
+ "21. ERROR in test\\Test.java (at line 120)\n" +
+ " Object m2(C<Object, ? extends Number> p1, Object p2) { // warning 21 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m2(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "22. ERROR in test\\Test.java (at line 126)\n" +
+ " Object m3(C<Object, ? extends Number> p1, Object p2) { // warning 22 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m3(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "23. ERROR in test\\Test.java (at line 139)\n" +
+ " Object m1(C<Object, ? extends Number> p1, Object p2) { // warning 23 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m1(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "24. ERROR in test\\Test.java (at line 140)\n" +
+ " f1 = null; // warning 24\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
+ "----------\n" +
+ "25. ERROR in test\\Test.java (at line 141)\n" +
+ " f2 = null; // warning 25\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull C<@NonNull Object,? extends @NonNull Number>\' but the provided value is null\n" +
+ "----------\n" +
+ "26. ERROR in test\\Test.java (at line 147)\n" +
+ " Object m2(C<Object, ? extends Number> p1, Object p2) { // warning 26 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m2(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
+ "----------\n" +
+ "27. ERROR in test\\Test.java (at line 153)\n" +
+ " Object m3(C<Object, ? extends Number> p1, Object p2) { // warning 27 on return type\n" +
+ " ^^^^^^\n" +
+ "The return type is incompatible with \'@NonNull Object\' returned from X.m3(C<Object,? extends Number>, Object) (mismatching null constraints)\n" +
"----------\n"
);
}
@@ -17020,7 +17020,7 @@ public void testBug530971_redundant() {
"public @interface Nullable {\n" +
"}\n" +
"",
- },
+ },
customOptions,
""
);
@@ -17070,31 +17070,31 @@ public void testBug530971_redundant() {
};
runner.customOptions = customOptions;
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in test\\X.java (at line 11)\n" +
- " @NNBDField // warning 1\n" +
- " ^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing type X\n" +
- "----------\n" +
- "2. WARNING in test\\X.java (at line 17)\n" +
- " @NNBDField // warning 2\n" +
- " ^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing type X\n" +
- "----------\n" +
- "3. WARNING in test\\X.java (at line 23)\n" +
- " @NNBDField // warning 3\n" +
- " ^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing type X\n" +
- "----------\n" +
- "4. WARNING in test\\X.java (at line 29)\n" +
- " @NNBDField // warning 4\n" +
- " ^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing type X\n" +
- "----------\n" +
- "5. WARNING in test\\X.java (at line 35)\n" +
- " @NNBDField // warning 5\n" +
- " ^^^^^^^^^^\n" +
- "Nullness default is redundant with a default specified for the enclosing type X\n" +
+ "----------\n" +
+ "1. WARNING in test\\X.java (at line 11)\n" +
+ " @NNBDField // warning 1\n" +
+ " ^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing type X\n" +
+ "----------\n" +
+ "2. WARNING in test\\X.java (at line 17)\n" +
+ " @NNBDField // warning 2\n" +
+ " ^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing type X\n" +
+ "----------\n" +
+ "3. WARNING in test\\X.java (at line 23)\n" +
+ " @NNBDField // warning 3\n" +
+ " ^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing type X\n" +
+ "----------\n" +
+ "4. WARNING in test\\X.java (at line 29)\n" +
+ " @NNBDField // warning 4\n" +
+ " ^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing type X\n" +
+ "----------\n" +
+ "5. WARNING in test\\X.java (at line 35)\n" +
+ " @NNBDField // warning 5\n" +
+ " ^^^^^^^^^^\n" +
+ "Nullness default is redundant with a default specified for the enclosing type X\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings;
runner.runWarningTest();
@@ -17194,7 +17194,7 @@ public void testBug530971_locally_redundant() {
"public @interface Nullable {\n" +
"}\n" +
"",
- },
+ },
customOptions,
""
);
@@ -17245,7 +17245,7 @@ public void testBug530971_locally_redundant() {
" Object onParameter);\n" +
"}\n" +
"",
- },
+ },
customOptions,
""
);
@@ -17299,7 +17299,7 @@ public void testBug518839() {
" ElementType[] value();\n" +
"}\n" +
"",
- },
+ },
customOptions,
""
);
@@ -17360,40 +17360,40 @@ public void testBug518839() {
"@annotation.NonNullFields\n" +
"package nn_fields;\n" +
"",
- },
+ },
customOptions,
- "----------\n" +
- "1. ERROR in nn_api\\NNApi.java (at line 7)\n" +
- " if (p != null) { // warning\n" +
- " ^\n" +
- "Redundant null check: The variable p is specified as @NonNull\n" +
- "----------\n" +
- "2. ERROR in nn_api\\NNApi.java (at line 10)\n" +
- " return null; // warning\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in nn_api_and_fields\\NNApiAndFields.java (at line 4)\n" +
- " public String f; // warning 1\n" +
- " ^\n" +
- "The @NonNull field f may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in nn_api_and_fields\\NNApiAndFields.java (at line 7)\n" +
- " if (p != null) { // warning 2\n" +
- " ^\n" +
- "Redundant null check: The variable p is specified as @NonNull\n" +
- "----------\n" +
- "3. ERROR in nn_api_and_fields\\NNApiAndFields.java (at line 10)\n" +
- " return null; // warning 3\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in nn_fields\\NNFields.java (at line 4)\n" +
- " public String f; // warning\n" +
- " ^\n" +
- "The @NonNull field f may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in nn_api\\NNApi.java (at line 7)\n" +
+ " if (p != null) { // warning\n" +
+ " ^\n" +
+ "Redundant null check: The variable p is specified as @NonNull\n" +
+ "----------\n" +
+ "2. ERROR in nn_api\\NNApi.java (at line 10)\n" +
+ " return null; // warning\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in nn_api_and_fields\\NNApiAndFields.java (at line 4)\n" +
+ " public String f; // warning 1\n" +
+ " ^\n" +
+ "The @NonNull field f may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in nn_api_and_fields\\NNApiAndFields.java (at line 7)\n" +
+ " if (p != null) { // warning 2\n" +
+ " ^\n" +
+ "Redundant null check: The variable p is specified as @NonNull\n" +
+ "----------\n" +
+ "3. ERROR in nn_api_and_fields\\NNApiAndFields.java (at line 10)\n" +
+ " return null; // warning 3\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in nn_fields\\NNFields.java (at line 4)\n" +
+ " public String f; // warning\n" +
+ " ^\n" +
+ "The @NonNull field f may not have been initialized\n" +
"----------\n"
);
}
@@ -17446,7 +17446,7 @@ public void testBug518839_BTB() {
" ElementType[] value();\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -17509,7 +17509,7 @@ public void testBug518839_BTB() {
"@annotation.NonNullFields\n" +
"package nn_fields;\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -17542,38 +17542,38 @@ public void testBug518839_BTB() {
" }\n" +
"}\n" +
"",
- },
+ },
customOptions,
- "----------\n" +
- "1. ERROR in btbtest\\BTBTest.java (at line 9)\n" +
- " if (p.m(null) == null) { // 2 warnings\n" +
- " ^^^^^^^^^\n" +
- "Null comparison always yields false: The method m(Object) cannot return null\n" +
- "----------\n" +
- "2. ERROR in btbtest\\BTBTest.java (at line 9)\n" +
- " if (p.m(null) == null) { // 2 warnings\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "3. ERROR in btbtest\\BTBTest.java (at line 15)\n" +
- " if (p.m(null) == null) { // 2 warnings\n" +
- " ^^^^^^^^^\n" +
- "Null comparison always yields false: The method m(Object) cannot return null\n" +
- "----------\n" +
- "4. ERROR in btbtest\\BTBTest.java (at line 15)\n" +
- " if (p.m(null) == null) { // 2 warnings\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
- "----------\n" +
- "5. ERROR in btbtest\\BTBTest.java (at line 17)\n" +
- " p.f = null; // warning\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "6. ERROR in btbtest\\BTBTest.java (at line 23)\n" +
- " p.f = null; // warning\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "1. ERROR in btbtest\\BTBTest.java (at line 9)\n" +
+ " if (p.m(null) == null) { // 2 warnings\n" +
+ " ^^^^^^^^^\n" +
+ "Null comparison always yields false: The method m(Object) cannot return null\n" +
+ "----------\n" +
+ "2. ERROR in btbtest\\BTBTest.java (at line 9)\n" +
+ " if (p.m(null) == null) { // 2 warnings\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "3. ERROR in btbtest\\BTBTest.java (at line 15)\n" +
+ " if (p.m(null) == null) { // 2 warnings\n" +
+ " ^^^^^^^^^\n" +
+ "Null comparison always yields false: The method m(Object) cannot return null\n" +
+ "----------\n" +
+ "4. ERROR in btbtest\\BTBTest.java (at line 15)\n" +
+ " if (p.m(null) == null) { // 2 warnings\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "5. ERROR in btbtest\\BTBTest.java (at line 17)\n" +
+ " p.f = null; // warning\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "6. ERROR in btbtest\\BTBTest.java (at line 23)\n" +
+ " p.f = null; // warning\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
"----------\n"
);
}
@@ -17583,39 +17583,39 @@ public void testBug531040() {
runNegativeTestWithLibs(
new String[] {
"Test.java",
- "import java.util.*;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "\n" +
- "public class Test {\n" +
- " void test() {\n" +
- " var list1 = new ArrayList<@NonNull String>();\n" +
- " list1.add(null);\n" +
- " @NonNull String val = \"\";\n" +
- " var list2 = getList(val);\n" +
- " list2.add(null);\n" +
- " }\n" +
- " <T> List<T> getList(T... in) {\n" +
- " return Arrays.asList(in);\n" +
- " }\n" +
- "}\n" +
+ "import java.util.*;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " void test() {\n" +
+ " var list1 = new ArrayList<@NonNull String>();\n" +
+ " list1.add(null);\n" +
+ " @NonNull String val = \"\";\n" +
+ " var list2 = getList(val);\n" +
+ " list2.add(null);\n" +
+ " }\n" +
+ " <T> List<T> getList(T... in) {\n" +
+ " return Arrays.asList(in);\n" +
+ " }\n" +
+ "}\n" +
""
},
- "----------\n" +
- "1. ERROR in Test.java (at line 8)\n" +
- " list1.add(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 11)\n" +
- " list2.add(null);\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
- "----------\n" +
- "3. WARNING in Test.java (at line 13)\n" +
- " <T> List<T> getList(T... in) {\n" +
- " ^^\n" +
- "Type safety: Potential heap pollution via varargs parameter in\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 8)\n" +
+ " list1.add(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 11)\n" +
+ " list2.add(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "3. WARNING in Test.java (at line 13)\n" +
+ " <T> List<T> getList(T... in) {\n" +
+ " ^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter in\n" +
"----------\n"
);
}
@@ -17624,49 +17624,49 @@ public void testBug533339() {
runner.testFiles =
new String[] {
"Test.java",
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "public class Test {\n" +
- "\n" +
- " interface Foo {\n" +
- "\n" +
- " @Nullable\n" +
- " String getString();\n" +
- " }\n" +
- "\n" +
- " class Bar {\n" +
- "\n" +
- " Bar(@NonNull String s) {\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " Bar hasWarning(Foo foo) {\n" +
- " @NonNull String s = checkNotNull(foo.getString());\n" +
- " return new Bar(s);// Null type mismatch: required '@NonNull String' but the provided value is inferred as @Nullable\n" +
- " }\n" +
- "\n" +
- " Bar hasNoWarning(Foo foo) {\n" +
- " return new Bar(checkNotNull(foo.getString()));// no warning when s is inlined\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " interface Foo {\n" +
+ "\n" +
+ " @Nullable\n" +
+ " String getString();\n" +
+ " }\n" +
+ "\n" +
+ " class Bar {\n" +
+ "\n" +
+ " Bar(@NonNull String s) {\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " Bar hasWarning(Foo foo) {\n" +
+ " @NonNull String s = checkNotNull(foo.getString());\n" +
+ " return new Bar(s);// Null type mismatch: required '@NonNull String' but the provided value is inferred as @Nullable\n" +
+ " }\n" +
+ "\n" +
+ " Bar hasNoWarning(Foo foo) {\n" +
+ " return new Bar(checkNotNull(foo.getString()));// no warning when s is inlined\n" +
" }\n" +
" static <T> T checkNotNull(T reference) {\n" +
" if (reference == null) throw new NullPointerException();\n" +
" return reference;\n" +
- " }\n" +
+ " }\n" +
"}\n"
};
runner.classLibraries = this.LIBS;
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in Test.java (at line 19)\n" +
- " @NonNull String s = checkNotNull(foo.getString());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull String\'\n" +
- "----------\n" +
- "2. WARNING in Test.java (at line 24)\n" +
- " return new Bar(checkNotNull(foo.getString()));// no warning when s is inlined\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull String\'\n" +
+ "----------\n" +
+ "1. WARNING in Test.java (at line 19)\n" +
+ " @NonNull String s = checkNotNull(foo.getString());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull String\'\n" +
+ "----------\n" +
+ "2. WARNING in Test.java (at line 24)\n" +
+ " return new Bar(checkNotNull(foo.getString()));// no warning when s is inlined\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull String\'\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings;
runner.runWarningTest();
@@ -17692,7 +17692,7 @@ public void testBug534516() {
"\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -17708,11 +17708,11 @@ public void testBug534516() {
"\n" +
"public class ApplyIfNonNullElseGetBugDemo {\n" +
"\n" +
- " public static <T, U> U applyIfNonNullElse(@Nullable T value, @NonNull Function<@NonNull ? super T, ? extends U> function, U fallbackValue) {\n" +
- " if (value != null)\n" +
- " return function.apply(value);\n" +
- " return fallbackValue;\n" +
- " }\n" +
+ " public static <T, U> U applyIfNonNullElse(@Nullable T value, @NonNull Function<@NonNull ? super T, ? extends U> function, U fallbackValue) {\n" +
+ " if (value != null)\n" +
+ " return function.apply(value);\n" +
+ " return fallbackValue;\n" +
+ " }\n" +
"\n" +
" public static void main(final @Nullable String[] args) {\n" +
" final @Nullable String arg = args.length == 0 ? null : args[0];\n" +
@@ -17721,7 +17721,7 @@ public void testBug534516() {
"\n" +
"}\n" +
"",
- },
+ },
getCompilerOptions(),
""
);
@@ -17730,13 +17730,13 @@ public void testBug536459() {
runConformTestWithLibs(
new String[] {
"X.java",
- "import org.eclipse.jdt.annotation.Nullable;\n" +
- "\n" +
- "public class X {\n" +
- " static void x() {\n" +
- " @Nullable String x1 = \"\";\n" +
- " @Nullable String[] x2 = { \"\" };\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.Nullable;\n" +
+ "\n" +
+ "public class X {\n" +
+ " static void x() {\n" +
+ " @Nullable String x1 = \"\";\n" +
+ " @Nullable String[] x2 = { \"\" };\n" +
+ " }\n" +
"}\n"
},
getCompilerOptions(),
@@ -17749,23 +17749,23 @@ public void testBug536555() {
runner.testFiles =
new String[] {
"Foo.java",
- "public class Foo\n" +
- "{\n" +
- " /** Test {@link #foo(boolean)}. */\n" +
- " public static final String TEST = \"foo\";\n" +
- "\n" +
- " public void foo(@SuppressWarnings(TEST) final boolean test)\n" +
- " {\n" +
- " System.out.println(test);\n" +
- " }\n" +
+ "public class Foo\n" +
+ "{\n" +
+ " /** Test {@link #foo(boolean)}. */\n" +
+ " public static final String TEST = \"foo\";\n" +
+ "\n" +
+ " public void foo(@SuppressWarnings(TEST) final boolean test)\n" +
+ " {\n" +
+ " System.out.println(test);\n" +
+ " }\n" +
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in Foo.java (at line 6)\n" +
- " public void foo(@SuppressWarnings(TEST) final boolean test)\n" +
- " ^^^^\n" +
- "Unsupported @SuppressWarnings(\"foo\")\n" +
+ "----------\n" +
+ "1. WARNING in Foo.java (at line 6)\n" +
+ " public void foo(@SuppressWarnings(TEST) final boolean test)\n" +
+ " ^^^^\n" +
+ "Unsupported @SuppressWarnings(\"foo\")\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings;
runner.runWarningTest();
@@ -17787,21 +17787,21 @@ public void testBug540264() {
},
this.LIBS,
getCompilerOptions(),
- "----------\n" +
- "1. ERROR in example\\Example.java (at line 5)\n" +
- " for (X.Y<Z> entry : x) {\n" +
- " ^\n" +
- "X cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in example\\Example.java (at line 5)\n" +
- " for (X.Y<Z> entry : x) {\n" +
- " ^\n" +
- "Z cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in example\\Example.java (at line 5)\n" +
- " for (X.Y<Z> entry : x) {\n" +
- " ^\n" +
- "x cannot be resolved to a variable\n" +
+ "----------\n" +
+ "1. ERROR in example\\Example.java (at line 5)\n" +
+ " for (X.Y<Z> entry : x) {\n" +
+ " ^\n" +
+ "X cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in example\\Example.java (at line 5)\n" +
+ " for (X.Y<Z> entry : x) {\n" +
+ " ^\n" +
+ "Z cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in example\\Example.java (at line 5)\n" +
+ " for (X.Y<Z> entry : x) {\n" +
+ " ^\n" +
+ "x cannot be resolved to a variable\n" +
"----------\n",
JavacTestOptions.DEFAULT
);
@@ -17818,39 +17818,39 @@ public void testBug542707_1() {
"X.java",
"import org.eclipse.jdt.annotation.*;\n" +
"import java.util.function.*;\n" +
- "interface IN0 {}\n" +
- "interface IN1 extends IN0 {}\n" +
+ "interface IN0 {}\n" +
+ "interface IN1 extends IN0 {}\n" +
"interface IN2 extends IN0 {}\n" +
"public class X {\n" +
- " @NonNull IN1 n1() { return new IN1() {}; }\n" +
- " IN2 n2() { return null; }\n" +
- " <M> void m(@NonNull Supplier<@NonNull M> m2) { }\n" +
- " void testSw(int i) {\n" +
- " m(switch(i) {\n" +
- " case 1 -> this::n1;\n" +
- " case 2 -> () -> n1();\n" +
- " case 3 -> null;\n" +
- " case 4 -> () -> n2();\n" +
- " default -> this::n2; });\n" +
+ " @NonNull IN1 n1() { return new IN1() {}; }\n" +
+ " IN2 n2() { return null; }\n" +
+ " <M> void m(@NonNull Supplier<@NonNull M> m2) { }\n" +
+ " void testSw(int i) {\n" +
+ " m(switch(i) {\n" +
+ " case 1 -> this::n1;\n" +
+ " case 2 -> () -> n1();\n" +
+ " case 3 -> null;\n" +
+ " case 4 -> () -> n2();\n" +
+ " default -> this::n2; });\n" +
" }\n" +
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 14)\n" +
- " case 3 -> null;\n" +
- " ^^^^\n" +
- "Null type mismatch: required \'@NonNull Supplier<@NonNull IN0>\' but the provided value is null\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 15)\n" +
- " case 4 -> () -> n2();\n" +
- " ^^^^\n" +
- "Null type safety (type annotations): The expression of type \'IN2\' needs unchecked conversion to conform to \'@NonNull IN0\'\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 16)\n" +
- " default -> this::n2; });\n" +
- " ^^^^^^^^\n" +
- "Null type safety at method return type: Method descriptor Supplier<IN0>.get() promises \'@NonNull IN0\' but referenced method provides \'IN2\'\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 14)\n" +
+ " case 3 -> null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Supplier<@NonNull IN0>\' but the provided value is null\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 15)\n" +
+ " case 4 -> () -> n2();\n" +
+ " ^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'IN2\' needs unchecked conversion to conform to \'@NonNull IN0\'\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 16)\n" +
+ " default -> this::n2; });\n" +
+ " ^^^^^^^^\n" +
+ "Null type safety at method return type: Method descriptor Supplier<IN0>.get() promises \'@NonNull IN0\' but referenced method provides \'IN2\'\n" +
"----------\n";
runner.runNegativeTest();
}
@@ -17858,21 +17858,21 @@ public void testBug499714() {
runNegativeTestWithLibs(
new String[] {
"Type.java",
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "interface Type<@Nullable K> {\n" +
- " K get();\n" +
- "\n" +
- " static <@Nullable T> void x(Type<T> t) {\n" +
- " t.get().toString();\n" +
- " }\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "interface Type<@Nullable K> {\n" +
+ " K get();\n" +
+ "\n" +
+ " static <@Nullable T> void x(Type<T> t) {\n" +
+ " t.get().toString();\n" +
+ " }\n" +
"}"
- },
- "----------\n" +
- "1. ERROR in Type.java (at line 7)\n" +
- " t.get().toString();\n" +
- " ^^^^^^^\n" +
- "Potential null pointer access: The method get() may return null\n" +
+ },
+ "----------\n" +
+ "1. ERROR in Type.java (at line 7)\n" +
+ " t.get().toString();\n" +
+ " ^^^^^^^\n" +
+ "Potential null pointer access: The method get() may return null\n" +
"----------\n");
}
public void testBug482242_simple() {
@@ -17881,26 +17881,26 @@ public void testBug482242_simple() {
runNegativeTestWithLibs(
new String[] {
"Test.java",
- "import java.util.*;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "public class Test {\n" +
- " static void dangerous(List<String> list) {\n" +
- " list.add(null);\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " List<@NonNull String> l = new ArrayList<>();\n" +
- " dangerous(l);\n" +
- " for (String string : l)\n" +
- " System.out.println(string.toLowerCase());\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "public class Test {\n" +
+ " static void dangerous(List<String> list) {\n" +
+ " list.add(null);\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " List<@NonNull String> l = new ArrayList<>();\n" +
+ " dangerous(l);\n" +
+ " for (String string : l)\n" +
+ " System.out.println(string.toLowerCase());\n" +
+ " }\n" +
"}\n"
},
options,
- "----------\n" +
- "1. ERROR in Test.java (at line 9)\n" +
- " dangerous(l);\n" +
- " ^\n" +
- "Unsafe null type conversion (type annotations): The value of type \'List<@NonNull String>\' is made accessible using the less-annotated type \'List<String>\'\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 9)\n" +
+ " dangerous(l);\n" +
+ " ^\n" +
+ "Unsafe null type conversion (type annotations): The value of type \'List<@NonNull String>\' is made accessible using the less-annotated type \'List<String>\'\n" +
"----------\n");
}
public void testBug482242_intermediate() {
@@ -17909,36 +17909,36 @@ public void testBug482242_intermediate() {
runNegativeTestWithLibs(
new String[] {
"Test.java",
- "import java.util.*;\n" +
- "import org.eclipse.jdt.annotation.*;\n" +
- "\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " ArrayList<@NonNull String> list = new ArrayList<>();\n" +
- " collect(list, null);\n" +
- " for (String s : list)\n" +
- " System.out.println(s.toUpperCase());\n" +
- " }\n" +
- " static void collect(List<@NonNull String> list, String string) {\n" +
- " list.add(string); // (1)\n" +
- " insert(list, string); // (2)\n" +
- " }\n" +
- " static void insert(List<? super String> l, String s) {\n" +
- " l.add(s);\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " ArrayList<@NonNull String> list = new ArrayList<>();\n" +
+ " collect(list, null);\n" +
+ " for (String s : list)\n" +
+ " System.out.println(s.toUpperCase());\n" +
+ " }\n" +
+ " static void collect(List<@NonNull String> list, String string) {\n" +
+ " list.add(string); // (1)\n" +
+ " insert(list, string); // (2)\n" +
+ " }\n" +
+ " static void insert(List<? super String> l, String s) {\n" +
+ " l.add(s);\n" +
+ " }\n" +
"}\n"
},
options,
- "----------\n" +
- "1. WARNING in Test.java (at line 12)\n" +
- " list.add(string); // (1)\n" +
- " ^^^^^^\n" +
- "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull String\'\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 13)\n" +
- " insert(list, string); // (2)\n" +
- " ^^^^\n" +
- "Unsafe null type conversion (type annotations): The value of type \'List<@NonNull String>\' is made accessible using the less-annotated type \'List<? super String>\'\n" +
+ "----------\n" +
+ "1. WARNING in Test.java (at line 12)\n" +
+ " list.add(string); // (1)\n" +
+ " ^^^^^^\n" +
+ "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull String\'\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 13)\n" +
+ " insert(list, string); // (2)\n" +
+ " ^^^^\n" +
+ "Unsafe null type conversion (type annotations): The value of type \'List<@NonNull String>\' is made accessible using the less-annotated type \'List<? super String>\'\n" +
"----------\n");
}
public void testBug482242_annotatedTypeVariable() {
@@ -17947,34 +17947,34 @@ public void testBug482242_annotatedTypeVariable() {
runNegativeTestWithLibs(
new String[] {
"Test.java",
- "import org.eclipse.jdt.annotation.*;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
"\n" +
"interface List<T extends @NonNull Object> {\n" +
" void add(T elem);" +
- "}\n" +
- "public class Test {\n" +
- " public static void test(List<@NonNull String> list) {\n" +
- " collect(list, null);\n" +
- " }\n" +
- " static void collect(List<@NonNull String> list, String string) {\n" +
- " insert(list, string);\n" +
- " }\n" +
+ "}\n" +
+ "public class Test {\n" +
+ " public static void test(List<@NonNull String> list) {\n" +
+ " collect(list, null);\n" +
+ " }\n" +
+ " static void collect(List<@NonNull String> list, String string) {\n" +
+ " insert(list, string);\n" +
+ " }\n" +
" static void insert(List<? super String> l, String s) {\n" + // type error at declaration site, no need to signal at the call site
- " l.add(s);\n" +
- " }\n" +
+ " l.add(s);\n" +
+ " }\n" +
"}\n"
},
options,
- "----------\n" +
- "1. ERROR in Test.java (at line 12)\n" +
- " static void insert(List<? super String> l, String s) {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'? super String\' is not a valid substitute for the type parameter \'T extends @NonNull Object\'\n" +
- "----------\n" +
- "2. WARNING in Test.java (at line 13)\n" +
- " l.add(s);\n" +
- " ^\n" +
- "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'capture#of ? super String\'\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 12)\n" +
+ " static void insert(List<? super String> l, String s) {\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'? super String\' is not a valid substitute for the type parameter \'T extends @NonNull Object\'\n" +
+ "----------\n" +
+ "2. WARNING in Test.java (at line 13)\n" +
+ " l.add(s);\n" +
+ " ^\n" +
+ "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'capture#of ? super String\'\n" +
"----------\n");
}
public void testBug482242_boundedWildcard() {
@@ -17983,39 +17983,39 @@ public void testBug482242_boundedWildcard() {
runNegativeTestWithLibs(
new String[] {
"Test.java",
- "import org.eclipse.jdt.annotation.*;\n" +
+ "import org.eclipse.jdt.annotation.*;\n" +
"\n" +
"interface List<T extends @NonNull Object> {\n" +
" void add(T elem);" +
- "}\n" +
- "public class Test {\n" +
- " public static void test(List<@NonNull String> list) {\n" +
- " collect(list, null);\n" +
- " }\n" +
- " static void collect(List<@NonNull String> list, String string) {\n" +
- " insert(list, string);\n" +
- " }\n" +
+ "}\n" +
+ "public class Test {\n" +
+ " public static void test(List<@NonNull String> list) {\n" +
+ " collect(list, null);\n" +
+ " }\n" +
+ " static void collect(List<@NonNull String> list, String string) {\n" +
+ " insert(list, string);\n" +
+ " }\n" +
" static void insert(List<? super @Nullable String> l, String s) {\n" +
- " l.add(s);\n" +
- " }\n" +
+ " l.add(s);\n" +
+ " }\n" +
"}\n"
},
options,
- "----------\n" +
- "1. ERROR in Test.java (at line 10)\n" +
- " insert(list, string);\n" +
- " ^^^^\n" +
- "Null type mismatch (type annotations): required \'List<? super @Nullable String>\' but this expression has type \'List<@NonNull String>\'\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 12)\n" +
- " static void insert(List<? super @Nullable String> l, String s) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Null constraint mismatch: The type \'? super @Nullable String\' is not a valid substitute for the type parameter \'T extends @NonNull Object\'\n" +
- "----------\n" +
- "3. WARNING in Test.java (at line 13)\n" +
- " l.add(s);\n" +
- " ^\n" +
- "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'capture#of ? super @Nullable String\'\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 10)\n" +
+ " insert(list, string);\n" +
+ " ^^^^\n" +
+ "Null type mismatch (type annotations): required \'List<? super @Nullable String>\' but this expression has type \'List<@NonNull String>\'\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 12)\n" +
+ " static void insert(List<? super @Nullable String> l, String s) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Null constraint mismatch: The type \'? super @Nullable String\' is not a valid substitute for the type parameter \'T extends @NonNull Object\'\n" +
+ "----------\n" +
+ "3. WARNING in Test.java (at line 13)\n" +
+ " l.add(s);\n" +
+ " ^\n" +
+ "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'capture#of ? super @Nullable String\'\n" +
"----------\n");
}
public void testBug560213source() {
@@ -18024,27 +18024,27 @@ public void testBug560213source() {
runner.classLibraries = this.LIBS;
runner.testFiles = new String[] {
"nullEnumSort/MyEnum.java",
- "package nullEnumSort;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "\n" +
- "@NonNullByDefault\n" +
- "enum MyEnum {\n" +
- " x\n" +
+ "package nullEnumSort;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "\n" +
+ "@NonNullByDefault\n" +
+ "enum MyEnum {\n" +
+ " x\n" +
"}\n",
"nullEnumSort/EnumProblem.java",
- "package nullEnumSort;\n" +
- "\n" +
- "import java.util.Collections;\n" +
- "import java.util.List;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "\n" +
- "@NonNullByDefault\n" +
- "public class EnumProblem {\n" +
- " void f(List<MyEnum> list) {\n" +
- " Collections.sort(list);\n" +
- " }\n" +
+ "package nullEnumSort;\n" +
+ "\n" +
+ "import java.util.Collections;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "\n" +
+ "@NonNullByDefault\n" +
+ "public class EnumProblem {\n" +
+ " void f(List<MyEnum> list) {\n" +
+ " Collections.sort(list);\n" +
+ " }\n" +
"\n}"
};
runner.runConformTest();
@@ -18054,13 +18054,13 @@ public void testBug560213binary() {
runner.customOptions = getCompilerOptions();
runner.testFiles = new String[] {
"nullEnumSort/MyEnum.java",
- "package nullEnumSort;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "\n" +
- "@NonNullByDefault\n" +
- "enum MyEnum {\n" +
- " x\n" +
+ "package nullEnumSort;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "\n" +
+ "@NonNullByDefault\n" +
+ "enum MyEnum {\n" +
+ " x\n" +
"}\n"
};
runner.classLibraries = this.LIBS;
@@ -18069,18 +18069,18 @@ public void testBug560213binary() {
runner.shouldFlushOutputDirectory = false;
runner.testFiles = new String[] {
"nullEnumSort/EnumProblem.java",
- "package nullEnumSort;\n" +
- "\n" +
- "import java.util.Collections;\n" +
- "import java.util.List;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "\n" +
- "@NonNullByDefault\n" +
- "public class EnumProblem {\n" +
- " void f(List<MyEnum> list) {\n" +
- " Collections.sort(list);\n" +
- " }\n" +
+ "package nullEnumSort;\n" +
+ "\n" +
+ "import java.util.Collections;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "\n" +
+ "@NonNullByDefault\n" +
+ "public class EnumProblem {\n" +
+ " void f(List<MyEnum> list) {\n" +
+ " Collections.sort(list);\n" +
+ " }\n" +
"\n}"
};
runner.runConformTest();
@@ -18091,33 +18091,33 @@ public void testBug560310() {
runner.testFiles =
new String[] {
"confusing/Confusing.java",
- "package confusing;\n" +
- "\n" +
- "import java.util.ArrayList;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "\n" +
- "public abstract class Confusing {\n" +
- " abstract int unannotated(ArrayList<String> list);\n" +
- "\n" +
- " @NonNullByDefault\n" +
- " public void f(boolean x) {\n" +
- " ArrayList<String> list = x ? null : new ArrayList<>();\n" +
- "\n" +
- " while (true) {\n" +
- " unannotated(list);\n" +
- " }\n" +
- " }\n" +
+ "package confusing;\n" +
+ "\n" +
+ "import java.util.ArrayList;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "\n" +
+ "public abstract class Confusing {\n" +
+ " abstract int unannotated(ArrayList<String> list);\n" +
+ "\n" +
+ " @NonNullByDefault\n" +
+ " public void f(boolean x) {\n" +
+ " ArrayList<String> list = x ? null : new ArrayList<>();\n" +
+ "\n" +
+ " while (true) {\n" +
+ " unannotated(list);\n" +
+ " }\n" +
+ " }\n" +
"}\n"
};
runner.classLibraries = this.LIBS;
runner.javacTestOptions = Excuse.EclipseHasSomeMoreWarnings;
runner.expectedCompilerLog =
- "----------\n" +
- "1. INFO in confusing\\Confusing.java (at line 15)\n" +
- " unannotated(list);\n" +
- " ^^^^\n" +
- "Unsafe null type conversion (type annotations): The value of type \'ArrayList<@NonNull String>\' is made accessible using the less-annotated type \'ArrayList<String>\'\n" +
+ "----------\n" +
+ "1. INFO in confusing\\Confusing.java (at line 15)\n" +
+ " unannotated(list);\n" +
+ " ^^^^\n" +
+ "Unsafe null type conversion (type annotations): The value of type \'ArrayList<@NonNull String>\' is made accessible using the less-annotated type \'ArrayList<String>\'\n" +
"----------\n";
runner.runWarningTest();
}
@@ -18127,40 +18127,40 @@ public void testBug560310try_finally() {
runner.testFiles =
new String[] {
"confusing/Confusing.java",
- "package confusing;\n" +
- "\n" +
- "import java.util.ArrayList;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "\n" +
- "public abstract class Confusing {\n" +
- " abstract int unannotated(ArrayList<String> list);\n" +
- "\n" +
- " @NonNullByDefault\n" +
- " public void f(boolean x) {\n" +
- " ArrayList<String> list = x ? null : new ArrayList<>();\n" +
- "\n" +
- " try {\n" +
+ "package confusing;\n" +
+ "\n" +
+ "import java.util.ArrayList;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "\n" +
+ "public abstract class Confusing {\n" +
+ " abstract int unannotated(ArrayList<String> list);\n" +
+ "\n" +
+ " @NonNullByDefault\n" +
+ " public void f(boolean x) {\n" +
+ " ArrayList<String> list = x ? null : new ArrayList<>();\n" +
+ "\n" +
+ " try {\n" +
" unannotated(list);\n" +
" } finally {\n" +
" unannotated(list);\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
};
runner.classLibraries = this.LIBS;
runner.javacTestOptions = Excuse.EclipseHasSomeMoreWarnings;
runner.expectedCompilerLog =
- "----------\n" +
- "1. INFO in confusing\\Confusing.java (at line 15)\n" +
- " unannotated(list);\n" +
- " ^^^^\n" +
- "Unsafe null type conversion (type annotations): The value of type \'ArrayList<@NonNull String>\' is made accessible using the less-annotated type \'ArrayList<String>\'\n" +
- "----------\n" +
- "2. INFO in confusing\\Confusing.java (at line 17)\n" +
- " unannotated(list);\n" +
- " ^^^^\n" +
- "Unsafe null type conversion (type annotations): The value of type \'ArrayList<@NonNull String>\' is made accessible using the less-annotated type \'ArrayList<String>\'\n" +
+ "----------\n" +
+ "1. INFO in confusing\\Confusing.java (at line 15)\n" +
+ " unannotated(list);\n" +
+ " ^^^^\n" +
+ "Unsafe null type conversion (type annotations): The value of type \'ArrayList<@NonNull String>\' is made accessible using the less-annotated type \'ArrayList<String>\'\n" +
+ "----------\n" +
+ "2. INFO in confusing\\Confusing.java (at line 17)\n" +
+ " unannotated(list);\n" +
+ " ^^^^\n" +
+ "Unsafe null type conversion (type annotations): The value of type \'ArrayList<@NonNull String>\' is made accessible using the less-annotated type \'ArrayList<String>\'\n" +
"----------\n";
runner.runWarningTest();
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/OverloadResolutionTest8.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/OverloadResolutionTest8.java
index d7a307d6c..7216da2bf 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/OverloadResolutionTest8.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/OverloadResolutionTest8.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Stephan Herrmann - Contribution for
@@ -57,11 +57,11 @@ public void test001() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " System.out.println(foo((a)->a.length));\n" +
- " ^^^\n" +
- "The method foo(I) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " System.out.println(foo((a)->a.length));\n" +
+ " ^^^\n" +
+ "The method foo(I) is ambiguous for the type X\n" +
"----------\n"
);
}
@@ -154,20 +154,20 @@ public void test004() {
"}\n",
},
// none of the lambdas is compatible because none is value-compatible, whereas foo() needs to return int.
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " goo(()-> { \n" +
- " ^^^\n" +
- "The method goo(J) in the type X is not applicable for the arguments (() -> {})\n" +
- "----------\n2. ERROR in X.java (at line 15)\n" +
- " goo(()-> { \n" +
- " ^^^\n" +
- "The method goo(J) in the type X is not applicable for the arguments (() -> {})\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 18)\n" +
- " goo(()-> { \n" +
- " ^^^\n" +
- "The method goo(J) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " goo(()-> { \n" +
+ " ^^^\n" +
+ "The method goo(J) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n2. ERROR in X.java (at line 15)\n" +
+ " goo(()-> { \n" +
+ " ^^^\n" +
+ "The method goo(J) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 18)\n" +
+ " goo(()-> { \n" +
+ " ^^^\n" +
+ "The method goo(J) in the type X is not applicable for the arguments (() -> {})\n" +
"----------\n");
}
public void test005() {
@@ -198,15 +198,15 @@ public void test005() {
"}\n",
},
"----------\n" +
- "1. ERROR in X.java (at line 18)\n" +
- " goo(()-> { \n" +
- " ^^^\n" +
- "The method goo(J) in the type X is not applicable for the arguments (() -> {})\n" + // because lambda has errors -> not valueCompatible
+ "1. ERROR in X.java (at line 18)\n" +
+ " goo(()-> { \n" +
+ " ^^^\n" +
+ "The method goo(J) in the type X is not applicable for the arguments (() -> {})\n" + // because lambda has errors -> not valueCompatible
"----------\n" +
- "2. ERROR in X.java (at line 19)\n" +
- " while (f); \n" +
- " ^\n" +
- "Cannot make a static reference to the non-static field f\n" +
+ "2. ERROR in X.java (at line 19)\n" +
+ " while (f); \n" +
+ " ^\n" +
+ "Cannot make a static reference to the non-static field f\n" +
"----------\n");
}
public void test006() {
@@ -249,16 +249,16 @@ public void test007() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " goo(()-> 10); \n" +
- " ^^^\n" +
- "The method goo(J) in the type X is not applicable for the arguments (() -> {})\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " goo(()-> 10); \n" +
- " ^^\n" +
- "Void methods cannot return a value\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " goo(()-> 10); \n" +
+ " ^^^\n" +
+ "The method goo(J) in the type X is not applicable for the arguments (() -> {})\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " goo(()-> 10); \n" +
+ " ^^\n" +
+ "Void methods cannot return a value\n" +
"----------\n");
}
public void test008() {
@@ -573,11 +573,11 @@ public void test020() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 20)\n" +
- " foo(Y::new);\n" +
- " ^^^\n" +
- "The method foo(I) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 20)\n" +
+ " foo(Y::new);\n" +
+ " ^^^\n" +
+ "The method foo(I) is ambiguous for the type X\n" +
"----------\n");
}
public void test021() {
@@ -669,11 +669,11 @@ public void test023() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 18)\n" +
- " foo(Y::new);\n" +
- " ^^^\n" +
- "The method foo(I) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 18)\n" +
+ " foo(Y::new);\n" +
+ " ^^^\n" +
+ "The method foo(I) is ambiguous for the type X\n" +
"----------\n");
}
public void test024() {
@@ -701,11 +701,11 @@ public void test024() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 18)\n" +
- " foo(Y::new);\n" +
- " ^^^\n" +
- "The method foo(I) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 18)\n" +
+ " foo(Y::new);\n" +
+ " ^^^\n" +
+ "The method foo(I) is ambiguous for the type X\n" +
"----------\n");
}
public void test025() {
@@ -762,11 +762,11 @@ public void test026() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 19)\n" +
- " foo(Y::new);\n" +
- " ^^^\n" +
- "The method foo(I) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 19)\n" +
+ " foo(Y::new);\n" +
+ " ^^^\n" +
+ "The method foo(I) is ambiguous for the type X\n" +
"----------\n");
}
public void test027() { // javac bug: 8b115 complains of ambiguity here.
@@ -849,16 +849,16 @@ public void test029() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 17)\n" +
- " foo(X []::new);\n" +
- " ^^^\n" +
- "The method foo(I) in the type X is not applicable for the arguments (X[]::new)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 17)\n" +
- " foo(X []::new);\n" +
- " ^^^^^^^^^\n" +
- "Constructed array X[] cannot be assigned to Y[] as required in the interface descriptor \n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 17)\n" +
+ " foo(X []::new);\n" +
+ " ^^^\n" +
+ "The method foo(I) in the type X is not applicable for the arguments (X[]::new)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 17)\n" +
+ " foo(X []::new);\n" +
+ " ^^^^^^^^^\n" +
+ "Constructed array X[] cannot be assigned to Y[] as required in the interface descriptor \n" +
"----------\n");
}
public void test030() {
@@ -904,7 +904,7 @@ public void test031() {
"foo(X<String>)");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401850, [1.8][compiler] Compiler fails to type poly allocation expressions in method invocation contexts
-// FAIL: we no longer see that both methods are applicable...
+// FAIL: we no longer see that both methods are applicable...
// inference starts with X#RAW, finds the second method, then infers the diamond to Object and sees that foo is not ambiguous
public void _test032() {
this.runNegativeTest(
@@ -922,16 +922,16 @@ public void _test032() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " void foo(X xs, String s) {\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " new X<String>().foo(new X<>(), \"Hello\");\n" +
- " ^^^\n" +
- "The method foo(X<String>, Object) is ambiguous for the type X<String>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " void foo(X xs, String s) {\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " new X<String>().foo(new X<>(), \"Hello\");\n" +
+ " ^^^\n" +
+ "The method foo(X<String>, Object) is ambiguous for the type X<String>\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=401850, [1.8][compiler] Compiler fails to type poly allocation expressions in method invocation contexts
@@ -1104,11 +1104,11 @@ public void test400871c() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 23)\n" +
- " goo(new X()::foo);\n" +
- " ^^^\n" +
- "The method goo(I) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 23)\n" +
+ " goo(new X()::foo);\n" +
+ " ^^^\n" +
+ "The method goo(I) is ambiguous for the type X\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=400871, [1.8][compiler] Overhaul overload resolution to reconcile with JLS8 15.12.2
@@ -1142,11 +1142,11 @@ public void test400871d() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 23)\n" +
- " goo(new X()::foo);\n" +
- " ^^^\n" +
- "The method goo(I) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 23)\n" +
+ " goo(new X()::foo);\n" +
+ " ^^^\n" +
+ "The method goo(I) is ambiguous for the type X\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=400871, [1.8][compiler] Overhaul overload resolution to reconcile with JLS8 15.12.2
@@ -1180,11 +1180,11 @@ public void test4008712() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 23)\n" +
- " goo(new X()::foo);\n" +
- " ^^^\n" +
- "The method goo(I) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 23)\n" +
+ " goo(new X()::foo);\n" +
+ " ^^^\n" +
+ "The method goo(I) is ambiguous for the type X\n" +
"----------\n");
}
public void test4008712e() {
@@ -1243,11 +1243,11 @@ public void test4008712f() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 20)\n" +
- " goo(new X()::foo);\n" +
- " ^^^\n" +
- "The method goo(I) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 20)\n" +
+ " goo(new X()::foo);\n" +
+ " ^^^\n" +
+ "The method goo(I) is ambiguous for the type X\n" +
"----------\n");
}
public void test4008712g() {
@@ -1277,21 +1277,21 @@ public void test4008712g() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " private int foo(int x) {\n" +
- " ^^^^^^^^^^\n" +
- "The method foo(int) from the type Y is never used locally\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 20)\n" +
- " goo(new X()::foo);\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (new X()::foo)\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 20)\n" +
- " goo(new X()::foo);\n" +
- " ^^^^^^^^^^^^\n" +
- "The type X does not define foo(int) that is applicable here\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " private int foo(int x) {\n" +
+ " ^^^^^^^^^^\n" +
+ "The method foo(int) from the type Y is never used locally\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 20)\n" +
+ " goo(new X()::foo);\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (new X()::foo)\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 20)\n" +
+ " goo(new X()::foo);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The type X does not define foo(int) that is applicable here\n" +
"----------\n");
}
public void test4008712h() {
@@ -1321,11 +1321,11 @@ public void test4008712h() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 20)\n" +
- " goo(new X()::foo);\n" +
- " ^^^\n" +
- "The method goo(I) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 20)\n" +
+ " goo(new X()::foo);\n" +
+ " ^^^\n" +
+ "The method goo(I) is ambiguous for the type X\n" +
"----------\n");
}
public void test4008712i() { // javac bug: 8b115 complains of ambiguity here.
@@ -1474,11 +1474,11 @@ public void test4008712m() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 21)\n" +
- " goo(new X<String>()::foo);\n" +
- " ^^^\n" +
- "The method goo(I) is ambiguous for the type X<T>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 21)\n" +
+ " goo(new X<String>()::foo);\n" +
+ " ^^^\n" +
+ "The method goo(I) is ambiguous for the type X<T>\n" +
"----------\n");
}
public void test4008712n() {
@@ -1572,16 +1572,16 @@ public void test4008712p() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 21)\n" +
- " goo(new X()::foo);\n" +
- " ^^^\n" +
- "The method goo(I) is ambiguous for the type X<T>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 21)\n" +
- " goo(new X()::foo);\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 21)\n" +
+ " goo(new X()::foo);\n" +
+ " ^^^\n" +
+ "The method goo(I) is ambiguous for the type X<T>\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 21)\n" +
+ " goo(new X()::foo);\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
"----------\n");
}
public void test4008712q_raw() {
@@ -1613,21 +1613,21 @@ public void test4008712q_raw() {
"}\n",
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 20)\n" +
- " goo(new X()::foo);\n" +
- " ^^^\n" +
- "The method goo(I) is ambiguous for the type X<T>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 20)\n" +
- " goo(new X()::foo);\n" +
- " ^^^^^^^^^^^^\n" +
- "Type safety: The method foo(Object) belongs to the raw type Y. References to generic type Y<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 20)\n" +
- " goo(new X()::foo);\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 20)\n" +
+ " goo(new X()::foo);\n" +
+ " ^^^\n" +
+ "The method goo(I) is ambiguous for the type X<T>\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 20)\n" +
+ " goo(new X()::foo);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Type safety: The method foo(Object) belongs to the raw type Y. References to generic type Y<T> should be parameterized\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 20)\n" +
+ " goo(new X()::foo);\n" +
+ " ^\n" +
+ "X is a raw type. References to generic type X<T> should be parameterized\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.Excuse.JavacCompilesIncorrectSource;
runner.runNegativeTest();
@@ -1690,11 +1690,11 @@ public void test4008712r() {
"}\n",
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 20)\n" +
- " goo(new X[0]::clone);\n" +
- " ^^^\n" +
- "The method goo(I) is ambiguous for the type X<T>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 20)\n" +
+ " goo(new X[0]::clone);\n" +
+ " ^^^\n" +
+ "The method goo(I) is ambiguous for the type X<T>\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.Excuse.JavacCompilesIncorrectSource;
runner.runNegativeTest();
@@ -1784,16 +1784,16 @@ public void test4008712u() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 20)\n" +
- " goo(I::clone);\n" +
- " ^^^\n" +
- "The method goo(I) in the type X<T> is not applicable for the arguments (I::clone)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 20)\n" +
- " goo(I::clone);\n" +
- " ^^^^^^^^\n" +
- "The type I does not define clone() that is applicable here\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 20)\n" +
+ " goo(I::clone);\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X<T> is not applicable for the arguments (I::clone)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 20)\n" +
+ " goo(I::clone);\n" +
+ " ^^^^^^^^\n" +
+ "The type I does not define clone() that is applicable here\n" +
"----------\n");
}
public void test4008712v() {
@@ -1854,16 +1854,16 @@ public void test4008712w() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 21)\n" +
- " goo(i::clone);\n" +
- " ^^^\n" +
- "The method goo(I) in the type X<T> is not applicable for the arguments (i::clone)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 21)\n" +
- " goo(i::clone);\n" +
- " ^^^^^^^^\n" +
- "The type I does not define clone() that is applicable here\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 21)\n" +
+ " goo(i::clone);\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X<T> is not applicable for the arguments (i::clone)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 21)\n" +
+ " goo(i::clone);\n" +
+ " ^^^^^^^^\n" +
+ "The type I does not define clone() that is applicable here\n" +
"----------\n");
}
public void test4008712x() {
@@ -1995,11 +1995,11 @@ public void test4008712zb() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 16)\n" +
- " goo(new X()::foo);\n" +
- " ^^^\n" +
- "The method goo(I) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 16)\n" +
+ " goo(new X()::foo);\n" +
+ " ^^^\n" +
+ "The method goo(I) is ambiguous for the type X\n" +
"----------\n");
}
public void test4008712zc() {
@@ -2025,16 +2025,16 @@ public void test4008712zc() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 16)\n" +
- " goo(new X()::foo);\n" +
- " ^^^\n" +
- "The method goo(I) in the type X is not applicable for the arguments (new X()::foo)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 16)\n" +
- " goo(new X()::foo);\n" +
- " ^^^^^^^^^^^^\n" +
- "The type of foo() from the type X is long, this is incompatible with the descriptor\'s return type: int\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 16)\n" +
+ " goo(new X()::foo);\n" +
+ " ^^^\n" +
+ "The method goo(I) in the type X is not applicable for the arguments (new X()::foo)\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 16)\n" +
+ " goo(new X()::foo);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The type of foo() from the type X is long, this is incompatible with the descriptor\'s return type: int\n" +
"----------\n");
}
public void test4008712zd() {
@@ -2199,7 +2199,7 @@ public void test401850() {
},
"foo(X<String>)");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427072, [1.8][compiler] Regression since fix of bug 423505: Method is ambiguous for type X
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427072, [1.8][compiler] Regression since fix of bug 423505: Method is ambiguous for type X
public void test427072() {
this.runConformTest(
new String[] {
@@ -2225,7 +2225,7 @@ public void test427072() {
},
"1");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427072, [1.8][compiler] Regression since fix of bug 423505: Method is ambiguous for type X
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427072, [1.8][compiler] Regression since fix of bug 423505: Method is ambiguous for type X
public void test427072a() {
this.runConformTest(
new String[] {
@@ -2251,7 +2251,7 @@ public void test427072a() {
},
"1");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427072, [1.8][compiler] Regression since fix of bug 423505: Method is ambiguous for type X
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427072, [1.8][compiler] Regression since fix of bug 423505: Method is ambiguous for type X
public void test427072b() {
this.runConformTest(
new String[] {
@@ -2277,7 +2277,7 @@ public void test427072b() {
},
"1");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427072, [1.8][compiler] Regression since fix of bug 423505: Method is ambiguous for type X
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427072, [1.8][compiler] Regression since fix of bug 423505: Method is ambiguous for type X
public void test427072c() {
this.runConformTest(
new String[] {
@@ -2304,7 +2304,7 @@ public void test427072c() {
},
"1");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427628, regression : The method * is ambiguous for the type *
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427628, regression : The method * is ambiguous for the type *
public void test427628() {
this.runConformTest(
new String[] {
@@ -2332,7 +2332,7 @@ public void test427628() {
},
"Jnull");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427628, regression : The method * is ambiguous for the type *
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427628, regression : The method * is ambiguous for the type *
public void test427628a() {
this.runNegativeTest(
new String[] {
@@ -2359,24 +2359,24 @@ public void test427628a() {
" public class K{}\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " test(i!=null?i.getJ():null);\n" +
- " ^^^^\n" +
- "The method test(X.I) in the type X is not applicable for the arguments (((i != null) ? i.getJ() : null))\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " test(i!=null?i.getJ():null);\n" +
- " ^^^^^^^^\n" +
- "Type mismatch: cannot convert from X.J to X.I\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 12)\n" +
- " System.out.println(\"K\" + j);\n" +
- " ^\n" +
- "j cannot be resolved to a variable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " test(i!=null?i.getJ():null);\n" +
+ " ^^^^\n" +
+ "The method test(X.I) in the type X is not applicable for the arguments (((i != null) ? i.getJ() : null))\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " test(i!=null?i.getJ():null);\n" +
+ " ^^^^^^^^\n" +
+ "Type mismatch: cannot convert from X.J to X.I\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 12)\n" +
+ " System.out.println(\"K\" + j);\n" +
+ " ^\n" +
+ "j cannot be resolved to a variable\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427628, regression : The method * is ambiguous for the type *
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427628, regression : The method * is ambiguous for the type *
public void test427628b() {
this.runNegativeTest(
new String[] {
@@ -2391,7 +2391,7 @@ public void test427628b() {
},
"");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=421922, [1.8][compiler] Varargs & Overload - Align to JLS8
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=421922, [1.8][compiler] Varargs & Overload - Align to JLS8
public void _test421922() {
this.runConformTest(
new String[] {
@@ -2413,7 +2413,7 @@ public void _test421922() {
},
"int ... = [1]");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427748, [1.8][compiler] Cannot convert from Boolean to boolean on generic return type
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427748, [1.8][compiler] Cannot convert from Boolean to boolean on generic return type
public void test427748() {
this.runConformTest(
new String[] {
@@ -2433,7 +2433,7 @@ public void test427748() {
},
"OK");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427808, [1.8] Correct super() invocation is not inferred when argument is a conditional expression
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=427808, [1.8] Correct super() invocation is not inferred when argument is a conditional expression
public void test427808() {
this.runConformTest(
new String[] {
@@ -2454,7 +2454,7 @@ public void test427808() {
},
"OK");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429985, [1.8][compiler] Resolution of right method signature
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429985, [1.8][compiler] Resolution of right method signature
public void test429985() {
this.runConformTest(
new String[] {
@@ -2475,7 +2475,7 @@ public void test429985() {
},
"hi");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429985, [1.8][compiler] Resolution of right method signature
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429985, [1.8][compiler] Resolution of right method signature
public void test429985a() {
this.runConformTest(
new String[] {
@@ -2496,7 +2496,7 @@ public void test429985a() {
},
"hi");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=448801, [1.8][compiler] Scope.mSMB & 15.12.3 Compile-Time Step 3
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=448801, [1.8][compiler] Scope.mSMB & 15.12.3 Compile-Time Step 3
public void test448801() {
this.runNegativeTest(
new String[] {
@@ -2511,7 +2511,7 @@ public void test448801() {
" public void goo() {\n" +
" }\n" +
"}\n",
- "Z.java",
+ "Z.java",
"interface I {\n" +
" static void ifoo() {\n" +
" }\n" +
@@ -2544,54 +2544,54 @@ public void test448801() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Z.java (at line 13)\n" +
- " super.goo();\n" +
- " ^^^^^^^^^^^\n" +
- "Cannot directly invoke the abstract method goo() for the type ZSuper\n" +
- "----------\n" +
- "2. ERROR in Z.java (at line 16)\n" +
- " X x = new X();\n" +
- " ^^^^^^^\n" +
- "The constructor X(X.Y...) of type X is not applicable as the formal varargs element type X.Y is not accessible here\n" +
- "----------\n" +
- "3. ERROR in Z.java (at line 17)\n" +
- " x.foo();\n" +
- " ^^^\n" +
- "The method foo(X.Y...) of type X is not applicable as the formal varargs element type X.Y is not accessible here\n" +
- "----------\n" +
- "4. ERROR in Z.java (at line 18)\n" +
- " System.out.println(x.goo());\n" +
- " ^^^^^^^\n" +
- "The method println(boolean) in the type PrintStream is not applicable for the arguments (void)\n" +
- "----------\n" +
- "5. ERROR in Z.java (at line 19)\n" +
- " goo();\n" +
- " ^^^\n" +
- "Cannot make a static reference to the non-static method goo() from the type Z\n" +
- "----------\n" +
- "6. ERROR in Z.java (at line 20)\n" +
- " Z.goo();\n" +
- " ^^^^^^^\n" +
- "Cannot make a static reference to the non-static method goo() from the type Z\n" +
- "----------\n" +
- "7. ERROR in Z.java (at line 21)\n" +
- " zoo();\n" +
- " ^^^\n" +
- "The method zoo() is undefined for the type Z\n" +
- "----------\n" +
- "8. ERROR in Z.java (at line 22)\n" +
- " new Z().ifoo();\n" +
- " ^^^^\n" +
- "The method ifoo() is undefined for the type Z\n" +
- "----------\n" +
- "9. ERROR in Z.java (at line 23)\n" +
- " super.zSuperFoo();\n" +
- " ^^^^^\n" +
- "Cannot use super in a static context\n" +
+ "----------\n" +
+ "1. ERROR in Z.java (at line 13)\n" +
+ " super.goo();\n" +
+ " ^^^^^^^^^^^\n" +
+ "Cannot directly invoke the abstract method goo() for the type ZSuper\n" +
+ "----------\n" +
+ "2. ERROR in Z.java (at line 16)\n" +
+ " X x = new X();\n" +
+ " ^^^^^^^\n" +
+ "The constructor X(X.Y...) of type X is not applicable as the formal varargs element type X.Y is not accessible here\n" +
+ "----------\n" +
+ "3. ERROR in Z.java (at line 17)\n" +
+ " x.foo();\n" +
+ " ^^^\n" +
+ "The method foo(X.Y...) of type X is not applicable as the formal varargs element type X.Y is not accessible here\n" +
+ "----------\n" +
+ "4. ERROR in Z.java (at line 18)\n" +
+ " System.out.println(x.goo());\n" +
+ " ^^^^^^^\n" +
+ "The method println(boolean) in the type PrintStream is not applicable for the arguments (void)\n" +
+ "----------\n" +
+ "5. ERROR in Z.java (at line 19)\n" +
+ " goo();\n" +
+ " ^^^\n" +
+ "Cannot make a static reference to the non-static method goo() from the type Z\n" +
+ "----------\n" +
+ "6. ERROR in Z.java (at line 20)\n" +
+ " Z.goo();\n" +
+ " ^^^^^^^\n" +
+ "Cannot make a static reference to the non-static method goo() from the type Z\n" +
+ "----------\n" +
+ "7. ERROR in Z.java (at line 21)\n" +
+ " zoo();\n" +
+ " ^^^\n" +
+ "The method zoo() is undefined for the type Z\n" +
+ "----------\n" +
+ "8. ERROR in Z.java (at line 22)\n" +
+ " new Z().ifoo();\n" +
+ " ^^^^\n" +
+ "The method ifoo() is undefined for the type Z\n" +
+ "----------\n" +
+ "9. ERROR in Z.java (at line 23)\n" +
+ " super.zSuperFoo();\n" +
+ " ^^^^^\n" +
+ "Cannot use super in a static context\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=450415, [1.8][compiler] Failure to resolve overloaded call.
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=450415, [1.8][compiler] Failure to resolve overloaded call.
public void test450415() {
this.runConformTest(
new String[] {
@@ -2620,7 +2620,7 @@ public void test450415() {
},
"goo(J)");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=450415, [1.8][compiler] Failure to resolve overloaded call.
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=450415, [1.8][compiler] Failure to resolve overloaded call.
public void test450415a() {
this.runConformTest(
new String[] {
@@ -2651,74 +2651,74 @@ public void test482440a() {
runNegativeTest(
new String[] {
"Test.java",
- "class Test {\n" +
- "\n" +
- " // generic method\n" +
- " interface ConsumerA {\n" +
- " <T> void accept(int i);\n" +
- " }\n" +
- "\n" +
- " // non-generic\n" +
- " interface ConsumerB {\n" +
- " void accept(int i);\n" +
- " }\n" +
- "\n" +
- " // A before B\n" +
- " void execute1(ConsumerA c) {}\n" +
- " void execute1(ConsumerB c) {}\n" +
- "\n" +
- " // B before A\n" +
- " void execute2(ConsumerB c) {}\n" +
- " void execute2(ConsumerA c) {}\n" +
- "\n" +
- " void test() {\n" +
- " execute1(x -> {}); // compiles in Eclipse\n" +
- " execute2(x -> {}); // doesn't compile\n" +
- " }\n" +
- "\n" +
+ "class Test {\n" +
+ "\n" +
+ " // generic method\n" +
+ " interface ConsumerA {\n" +
+ " <T> void accept(int i);\n" +
+ " }\n" +
+ "\n" +
+ " // non-generic\n" +
+ " interface ConsumerB {\n" +
+ " void accept(int i);\n" +
+ " }\n" +
+ "\n" +
+ " // A before B\n" +
+ " void execute1(ConsumerA c) {}\n" +
+ " void execute1(ConsumerB c) {}\n" +
+ "\n" +
+ " // B before A\n" +
+ " void execute2(ConsumerB c) {}\n" +
+ " void execute2(ConsumerA c) {}\n" +
+ "\n" +
+ " void test() {\n" +
+ " execute1(x -> {}); // compiles in Eclipse\n" +
+ " execute2(x -> {}); // doesn't compile\n" +
+ " }\n" +
+ "\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 22)\n" +
- " execute1(x -> {}); // compiles in Eclipse\n" +
- " ^^^^^^^^\n" +
- "The method execute1(Test.ConsumerA) is ambiguous for the type Test\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 23)\n" +
- " execute2(x -> {}); // doesn\'t compile\n" +
- " ^^^^^^^^\n" +
- "The method execute2(Test.ConsumerB) is ambiguous for the type Test\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 22)\n" +
+ " execute1(x -> {}); // compiles in Eclipse\n" +
+ " ^^^^^^^^\n" +
+ "The method execute1(Test.ConsumerA) is ambiguous for the type Test\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 23)\n" +
+ " execute2(x -> {}); // doesn\'t compile\n" +
+ " ^^^^^^^^\n" +
+ "The method execute2(Test.ConsumerB) is ambiguous for the type Test\n" +
"----------\n");
}
public void test482440b() {
runConformTest(
new String[] {
"Test.java",
- "class Test {\n" +
- "\n" +
- " // generic method\n" +
- " interface ConsumerA {\n" +
- " <T> void accept(int i);\n" +
- " }\n" +
- "\n" +
- " // non-generic\n" +
- " interface ConsumerB {\n" +
- " void accept(int i);\n" +
- " }\n" +
- "\n" +
- " // A before B\n" +
- " void execute1(ConsumerA c) {}\n" +
- " void execute1(ConsumerB c) {}\n" +
- "\n" +
- " // B before A\n" +
- " void execute2(ConsumerB c) {}\n" +
- " void execute2(ConsumerA c) {}\n" +
- "\n" +
- " void test() {\n" +
- " execute1((int x) -> {}); // compiles in Eclipse\n" +
- " execute2((int x) -> {}); // doesn't compile\n" +
- " }\n" +
- "\n" +
+ "class Test {\n" +
+ "\n" +
+ " // generic method\n" +
+ " interface ConsumerA {\n" +
+ " <T> void accept(int i);\n" +
+ " }\n" +
+ "\n" +
+ " // non-generic\n" +
+ " interface ConsumerB {\n" +
+ " void accept(int i);\n" +
+ " }\n" +
+ "\n" +
+ " // A before B\n" +
+ " void execute1(ConsumerA c) {}\n" +
+ " void execute1(ConsumerB c) {}\n" +
+ "\n" +
+ " // B before A\n" +
+ " void execute2(ConsumerB c) {}\n" +
+ " void execute2(ConsumerA c) {}\n" +
+ "\n" +
+ " void test() {\n" +
+ " execute1((int x) -> {}); // compiles in Eclipse\n" +
+ " execute2((int x) -> {}); // doesn't compile\n" +
+ " }\n" +
+ "\n" +
"}\n"
});
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PatternMatching14Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PatternMatching14Test.java
index e7419854c..aa2aa8b36 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PatternMatching14Test.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PatternMatching14Test.java
@@ -26,7 +26,7 @@ public class PatternMatching14Test extends AbstractRegressionTest {
// TESTS_RANGE = new int[] { 1, -1 };
// TESTS_NAMES = new String[] { "test005" };
}
-
+
public static Class<?> testClass() {
return PatternMatching14Test.class;
}
@@ -79,11 +79,11 @@ public class PatternMatching14Test extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X1.java (at line 3)\n" +
- " if (obj instanceof String s) {\n" +
- " ^^^^^^^^\n" +
- "Instanceof Pattern is a preview feature and disabled by default. Use --enable-preview to enable\n" +
+ "----------\n" +
+ "1. ERROR in X1.java (at line 3)\n" +
+ " if (obj instanceof String s) {\n" +
+ " ^^^^^^^^\n" +
+ "Instanceof Pattern is a preview feature and disabled by default. Use --enable-preview to enable\n" +
"----------\n",
/* omit one arg to directly call super method without JAVA_OPTIONS */
null,
@@ -103,11 +103,11 @@ public class PatternMatching14Test extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X2.java (at line 4)\n" +
- " if (obj instanceof String s) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Incompatible conditional operand types Integer and String\n" +
+ "----------\n" +
+ "1. ERROR in X2.java (at line 4)\n" +
+ " if (obj instanceof String s) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Incompatible conditional operand types Integer and String\n" +
"----------\n",
"",
null,
@@ -128,11 +128,11 @@ public class PatternMatching14Test extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X3.java (at line 5)\n" +
- " } else if (num instanceof String) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Incompatible conditional operand types Number and String\n" +
+ "----------\n" +
+ "1. ERROR in X3.java (at line 5)\n" +
+ " } else if (num instanceof String) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Incompatible conditional operand types Number and String\n" +
"----------\n",
"",
null,
@@ -152,11 +152,11 @@ public class PatternMatching14Test extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X3.java (at line 4)\n" +
- " if (num instanceof int) {\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Incompatible conditional operand types Number and int\n" +
+ "----------\n" +
+ "1. ERROR in X3.java (at line 4)\n" +
+ " if (num instanceof int) {\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Incompatible conditional operand types Number and int\n" +
"----------\n",
"",
null,
@@ -178,11 +178,11 @@ public class PatternMatching14Test extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X4.java (at line 5)\n" +
- " if (obj instanceof Integer s) {\n" +
- " ^\n" +
- "Duplicate local variable s\n" +
+ "----------\n" +
+ "1. ERROR in X4.java (at line 5)\n" +
+ " if (obj instanceof Integer s) {\n" +
+ " ^\n" +
+ "Duplicate local variable s\n" +
"----------\n",
"",
null,
@@ -256,16 +256,16 @@ public class PatternMatching14Test extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X6a.java (at line 8)\n" +
- " System.out.print(i);\n" +
- " ^\n" +
- "The pattern variable i is not in scope in this location\n" +
- "----------\n" +
- "2. ERROR in X6a.java (at line 11)\n" +
- " System.out.print(i);\n" +
- " ^\n" +
- "The pattern variable i is not in scope in this location\n" +
+ "----------\n" +
+ "1. ERROR in X6a.java (at line 8)\n" +
+ " System.out.print(i);\n" +
+ " ^\n" +
+ "The pattern variable i is not in scope in this location\n" +
+ "----------\n" +
+ "2. ERROR in X6a.java (at line 11)\n" +
+ " System.out.print(i);\n" +
+ " ^\n" +
+ "The pattern variable i is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -294,16 +294,16 @@ public class PatternMatching14Test extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X6b.java (at line 8)\n" +
- " System.out.print(i);\n" +
- " ^\n" +
- "The pattern variable i is not in scope in this location\n" +
- "----------\n" +
- "2. ERROR in X6b.java (at line 11)\n" +
- " System.out.print(s);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "1. ERROR in X6b.java (at line 8)\n" +
+ " System.out.print(i);\n" +
+ " ^\n" +
+ "The pattern variable i is not in scope in this location\n" +
+ "----------\n" +
+ "2. ERROR in X6b.java (at line 11)\n" +
+ " System.out.print(s);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -329,11 +329,11 @@ public class PatternMatching14Test extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X6c.java (at line 7)\n" +
- " System.out.print(i);\n" +
- " ^\n" +
- "The pattern variable i is not in scope in this location\n" +
+ "----------\n" +
+ "1. ERROR in X6c.java (at line 7)\n" +
+ " System.out.print(i);\n" +
+ " ^\n" +
+ "The pattern variable i is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -359,11 +359,11 @@ public class PatternMatching14Test extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X6d.java (at line 7)\n" +
- " System.out.print(i);\n" +
- " ^\n" +
- "The pattern variable i is not in scope in this location\n" +
+ "----------\n" +
+ "1. ERROR in X6d.java (at line 7)\n" +
+ " System.out.print(i);\n" +
+ " ^\n" +
+ "The pattern variable i is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -389,24 +389,24 @@ public class PatternMatching14Test extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X7.java (at line 7)\n" +
- " System.out.print(i);\n" +
- " ^\n" +
- "The pattern variable i is not in scope in this location\n" +
+ "----------\n" +
+ "1. ERROR in X7.java (at line 7)\n" +
+ " System.out.print(i);\n" +
+ " ^\n" +
+ "The pattern variable i is not in scope in this location\n" +
"----------\n",
- "X7.java:4: warning: [preview] pattern matching in instanceof is a preview feature and may be removed in a future release.\n" +
- " if (obj instanceof Integer i) {\n" +
- " ^\n" +
- "X7.java:6: warning: [preview] pattern matching in instanceof is a preview feature and may be removed in a future release.\n" +
- " } else if (obj instanceof String s) {\n" +
- " ^\n" +
- "X7.java:7: error: cannot find symbol\n" +
- " System.out.print(i);\n" +
- " ^\n" +
- " symbol: variable i\n" +
- " location: class X7\n" +
- "1 error\n" +
+ "X7.java:4: warning: [preview] pattern matching in instanceof is a preview feature and may be removed in a future release.\n" +
+ " if (obj instanceof Integer i) {\n" +
+ " ^\n" +
+ "X7.java:6: warning: [preview] pattern matching in instanceof is a preview feature and may be removed in a future release.\n" +
+ " } else if (obj instanceof String s) {\n" +
+ " ^\n" +
+ "X7.java:7: error: cannot find symbol\n" +
+ " System.out.print(i);\n" +
+ " ^\n" +
+ " symbol: variable i\n" +
+ " location: class X7\n" +
+ "1 error\n" +
"2 warnings",
null,
true,
@@ -419,14 +419,14 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"X8.java",
"@SuppressWarnings(\"preview\")\n" +
"public class X8 {\n" +
- " public static void foo(Object b) {\n" +
- " Object c = null;\n" +
- " if (b != c) {\n" +
- " if ((b instanceof String s) && (s.length() != 0))\n" +
- " System.out.println(\"s:\" + s);\n" +
- " else \n" +
- " System.out.println(\"b:\" + b);\n" +
- " }\n" +
+ " public static void foo(Object b) {\n" +
+ " Object c = null;\n" +
+ " if (b != c) {\n" +
+ " if ((b instanceof String s) && (s.length() != 0))\n" +
+ " System.out.println(\"s:\" + s);\n" +
+ " else \n" +
+ " System.out.println(\"b:\" + b);\n" +
+ " }\n" +
" }" +
" public static void main(String[] obj) {\n" +
" foo(100);\n" +
@@ -434,7 +434,7 @@ public class PatternMatching14Test extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "b:100\n" +
+ "b:100\n" +
"s:abcd",
options);
}
@@ -445,14 +445,14 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"X9.java",
"@SuppressWarnings(\"preview\")\n" +
"public class X9 {\n" +
- " public static void foo(Object b) {\n" +
- " Object c = null;\n" +
- " if (b != c) {\n" +
- " if ((b instanceof String s) && (s.length() != 0))\n" +
- " System.out.println(\"s:\" + s);\n" +
- " else if ((b instanceof Integer i2))\n" +
- " System.out.println(\"i2:\" + i2);\n" +
- " }\n" +
+ " public static void foo(Object b) {\n" +
+ " Object c = null;\n" +
+ " if (b != c) {\n" +
+ " if ((b instanceof String s) && (s.length() != 0))\n" +
+ " System.out.println(\"s:\" + s);\n" +
+ " else if ((b instanceof Integer i2))\n" +
+ " System.out.println(\"i2:\" + i2);\n" +
+ " }\n" +
" }" +
" public static void main(String[] obj) {\n" +
" foo(100);\n" +
@@ -460,7 +460,7 @@ public class PatternMatching14Test extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "i2:100\n" +
+ "i2:100\n" +
"s:abcd",
options);
}
@@ -471,14 +471,14 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"X10.java",
"@SuppressWarnings(\"preview\")\n" +
"public class X10 {\n" +
- " public static void foo(Object b) {\n" +
- " Object c = null;\n" +
- " if (b != c) {\n" +
- " if (b != null && (b instanceof String s))\n" +
- " System.out.println(\"s:\" + s);\n" +
- " else " +
- " System.out.println(\"b:\" + b);\n" +
- " }\n" +
+ " public static void foo(Object b) {\n" +
+ " Object c = null;\n" +
+ " if (b != c) {\n" +
+ " if (b != null && (b instanceof String s))\n" +
+ " System.out.println(\"s:\" + s);\n" +
+ " else " +
+ " System.out.println(\"b:\" + b);\n" +
+ " }\n" +
" }" +
" public static void main(String[] obj) {\n" +
" foo(100);\n" +
@@ -486,7 +486,7 @@ public class PatternMatching14Test extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "b:100\n" +
+ "b:100\n" +
"s:abcd",
options);
}
@@ -497,12 +497,12 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"X11.java",
"@SuppressWarnings(\"preview\")\n" +
"public class X11 {\n" +
- " public static void foo(Object b) {\n" +
- " Object c = null;\n" +
- " if (b == null && (b instanceof String s)) {\n" +
- " } else {" +
- " }\n" +
- " System.out.println(s);\n" +
+ " public static void foo(Object b) {\n" +
+ " Object c = null;\n" +
+ " if (b == null && (b instanceof String s)) {\n" +
+ " } else {" +
+ " }\n" +
+ " System.out.println(s);\n" +
" }" +
" public static void main(String[] obj) {\n" +
" foo(100);\n" +
@@ -510,11 +510,11 @@ public class PatternMatching14Test extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X11.java (at line 7)\n" +
- " System.out.println(s);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "1. ERROR in X11.java (at line 7)\n" +
+ " System.out.println(s);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -528,16 +528,16 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"X12.java",
"@SuppressWarnings(\"preview\")\n" +
"public class X12 {\n" +
- " public static void foo(Object b) {\n" +
- " Object c = new Object();\n" +
- " if (b != c) {\n" +
- " if (b == null && (b instanceof String s)) {\n" +
- " System.out.println(\"s:\" + s);\n" +
- " } else {\n" +
- " System.out.println(\"b:\" + b);\n" +
- " }\n" +
+ " public static void foo(Object b) {\n" +
+ " Object c = new Object();\n" +
+ " if (b != c) {\n" +
+ " if (b == null && (b instanceof String s)) {\n" +
+ " System.out.println(\"s:\" + s);\n" +
+ " } else {\n" +
+ " System.out.println(\"b:\" + b);\n" +
+ " }\n" +
" s = null;\n" +
- " }\n" +
+ " }\n" +
" }" +
" public static void main(String[] obj) {\n" +
" foo(100);\n" +
@@ -545,11 +545,11 @@ public class PatternMatching14Test extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X12.java (at line 11)\n" +
- " s = null;\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "1. ERROR in X12.java (at line 11)\n" +
+ " s = null;\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -563,15 +563,15 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"X13.java",
"@SuppressWarnings(\"preview\")\n" +
"public class X13 {\n" +
- " public static void foo(Object b) {\n" +
- " Object c = null;\n" +
- " if (b != c) {\n" +
- " if (b == null && (b instanceof String s))\n" +
- " System.out.println(\"s:\" + s);\n" +
- " else " +
- " System.out.println(\"b:\" + b);\n" +
+ " public static void foo(Object b) {\n" +
+ " Object c = null;\n" +
+ " if (b != c) {\n" +
+ " if (b == null && (b instanceof String s))\n" +
+ " System.out.println(\"s:\" + s);\n" +
+ " else " +
+ " System.out.println(\"b:\" + b);\n" +
" System.out.println(s);\n" +
- " }\n" +
+ " }\n" +
" }" +
" public static void main(String[] obj) {\n" +
" foo(100);\n" +
@@ -579,16 +579,16 @@ public class PatternMatching14Test extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X13.java (at line 7)\n" +
- " System.out.println(\"s:\" + s);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. ERROR in X13.java (at line 9)\n" +
- " System.out.println(s);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "1. WARNING in X13.java (at line 7)\n" +
+ " System.out.println(\"s:\" + s);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. ERROR in X13.java (at line 9)\n" +
+ " System.out.println(s);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -602,23 +602,23 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"X14.java",
"@SuppressWarnings(\"preview\")\n" +
"public class X14 {\n" +
- " public static void foo(Object o) {\n" +
- " if (!(o instanceof String s)) {\n" +
+ " public static void foo(Object o) {\n" +
+ " if (!(o instanceof String s)) {\n" +
" System.out.print(\"then:\" + s);\n" +
" } else {\n" +
" System.out.print(\"else:\" + s);\n" +
- " }\n" +
+ " }\n" +
" }" +
" public static void main(String[] obj) {\n" +
" foo(\"abcd\");\n" +
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X14.java (at line 5)\n" +
- " System.out.print(\"then:\" + s);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "1. ERROR in X14.java (at line 5)\n" +
+ " System.out.print(\"then:\" + s);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -632,23 +632,23 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"X14a.java",
"@SuppressWarnings(\"preview\")\n" +
"public class X14a {\n" +
- " public static void foo(Object o) {\n" +
- " if (!(o instanceof String s)) {\n" +
+ " public static void foo(Object o) {\n" +
+ " if (!(o instanceof String s)) {\n" +
" System.out.print(\"then:\" + s);\n" +
" } else {\n" +
" System.out.print(\"else:\" + s);\n" +
- " }\n" +
+ " }\n" +
" }" +
" public static void main(String[] obj) {\n" +
" foo(\"abcd\");\n" +
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X14a.java (at line 5)\n" +
- " System.out.print(\"then:\" + s);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "1. ERROR in X14a.java (at line 5)\n" +
+ " System.out.print(\"then:\" + s);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -662,23 +662,23 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"X14b.java",
"@SuppressWarnings(\"preview\")\n" +
"public class X14b {\n" +
- " public static void foo(Object o) {\n" +
- " if (!!(o instanceof String s)) {\n" +
+ " public static void foo(Object o) {\n" +
+ " if (!!(o instanceof String s)) {\n" +
" System.out.print(\"then:\" + s);\n" +
" } else {\n" +
" System.out.print(\"else:\" + s);\n" +
- " }\n" +
+ " }\n" +
" }" +
" public static void main(String[] obj) {\n" +
" foo(\"abcd\");\n" +
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X14b.java (at line 7)\n" +
- " System.out.print(\"else:\" + s);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "1. ERROR in X14b.java (at line 7)\n" +
+ " System.out.print(\"else:\" + s);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -692,23 +692,23 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"X14c.java",
"@SuppressWarnings(\"preview\")\n" +
"public class X14c {\n" +
- " public static void foo(Object o) {\n" +
- " if (o == null) {\n" +
+ " public static void foo(Object o) {\n" +
+ " if (o == null) {\n" +
" System.out.print(\"null\");\n" +
" } else if(!(o instanceof String s)) {\n" +
" System.out.print(\"else:\" + s);\n" +
- " }\n" +
+ " }\n" +
" }" +
" public static void main(String[] obj) {\n" +
" foo(\"abcd\");\n" +
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X14c.java (at line 7)\n" +
- " System.out.print(\"else:\" + s);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "1. ERROR in X14c.java (at line 7)\n" +
+ " System.out.print(\"else:\" + s);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -722,12 +722,12 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"X14d.java",
"@SuppressWarnings(\"preview\")\n" +
"public class X14d {\n" +
- " public static void foo(Object o) {\n" +
- " if (o == null) {\n" +
+ " public static void foo(Object o) {\n" +
+ " if (o == null) {\n" +
" System.out.print(\"null\");\n" +
" } else if(!!(o instanceof String s)) {\n" +
" System.out.print(\"else:\" + s);\n" +
- " }\n" +
+ " }\n" +
" }" +
" public static void main(String[] obj) {\n" +
" foo(\"abcd\");\n" +
@@ -744,11 +744,11 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"X14a.java",
"@SuppressWarnings(\"preview\")\n" +
"public class X14a {\n" +
- " public static void foo(Object o) {\n" +
- " if (!(!(o instanceof String s))) {\n" +
+ " public static void foo(Object o) {\n" +
+ " if (!(!(o instanceof String s))) {\n" +
" System.out.print(\"s:\" + s);\n" +
- " } else {\n" +
- " }\n" +
+ " } else {\n" +
+ " }\n" +
" }" +
" public static void main(String[] obj) {\n" +
" foo(\"abcd\");\n" +
@@ -769,12 +769,12 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"X15.java",
"@SuppressWarnings(\"preview\")\n" +
"public class X15 {\n" +
- " public static void foo(Object o) {\n" +
- " if (!(o instanceof String s)) {\n" +
+ " public static void foo(Object o) {\n" +
+ " if (!(o instanceof String s)) {\n" +
" throw new IllegalArgumentException();\n" +
- " } else {\n" +
- " System.out.print(\"s:\" + s);\n" +
- " }\n" +
+ " } else {\n" +
+ " System.out.print(\"s:\" + s);\n" +
+ " }\n" +
" System.out.print(s);\n" +
" }" +
" public static void main(String[] obj) {\n" +
@@ -796,10 +796,10 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"X15a.java",
"@SuppressWarnings(\"preview\")\n" +
"public class X15a {\n" +
- " public static void foo(Object o) {\n" +
- " if (!(o instanceof String s)) {\n" +
+ " public static void foo(Object o) {\n" +
+ " if (!(o instanceof String s)) {\n" +
" throw new IllegalArgumentException();\n" +
- " }\n" +
+ " }\n" +
" System.out.print(s);\n" +
" }" +
" public static void main(String[] obj) {\n" +
@@ -821,12 +821,12 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"X15b.java",
"@SuppressWarnings(\"preview\")\n" +
"public class X15b {\n" +
- " public static void foo(Object o) {\n" +
- " if (!(o instanceof String s)) {\n" +
+ " public static void foo(Object o) {\n" +
+ " if (!(o instanceof String s)) {\n" +
" //throw new IllegalArgumentException();\n" +
- " } else {\n" +
- " System.out.print(\"s:\" + s);\n" +
- " }\n" +
+ " } else {\n" +
+ " System.out.print(\"s:\" + s);\n" +
+ " }\n" +
" System.out.print(s);\n" +
" }" +
" public static void main(String[] obj) {\n" +
@@ -834,11 +834,11 @@ public class PatternMatching14Test extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X15b.java (at line 9)\n" +
- " System.out.print(s);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "1. ERROR in X15b.java (at line 9)\n" +
+ " System.out.print(s);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -852,8 +852,8 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"X16.java",
"@SuppressWarnings(\"preview\")\n" +
"public class X16 {\n" +
- " public static void foo(Object o) {\n" +
- " boolean b = (o instanceof String[] s && s.length == 1);\n" +
+ " public static void foo(Object o) {\n" +
+ " boolean b = (o instanceof String[] s && s.length == 1);\n" +
" System.out.print(b);\n" +
" }" +
" public static void main(String[] obj) {\n" +
@@ -871,8 +871,8 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"X17.java",
"@SuppressWarnings(\"preview\")\n" +
"public class X17 {\n" +
- " public static void foo(Object o) {\n" +
- " boolean b = (o instanceof String[] s && s.length == 1);\n" +
+ " public static void foo(Object o) {\n" +
+ " boolean b = (o instanceof String[] s && s.length == 1);\n" +
" System.out.print(s[0]);\n" +
" }" +
" public static void main(String[] obj) {\n" +
@@ -880,11 +880,11 @@ public class PatternMatching14Test extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X17.java (at line 5)\n" +
- " System.out.print(s[0]);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "1. ERROR in X17.java (at line 5)\n" +
+ " System.out.print(s[0]);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -903,11 +903,11 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"public class X18 {\n" +
" public static void main(String[] obj) {\n" +
" boolean a = true;\n" +
- " {\n" +
- " boolean b = (obj instanceof String[] s && s.length == 0);\n" +
- " System.out.print(b + \",\");\n" +
- " }\n" +
- " boolean b = a ? false : (obj instanceof String[] s && s.length == 0);\n" +
+ " {\n" +
+ " boolean b = (obj instanceof String[] s && s.length == 0);\n" +
+ " System.out.print(b + \",\");\n" +
+ " }\n" +
+ " boolean b = a ? false : (obj instanceof String[] s && s.length == 0);\n" +
" System.out.print(b);\n" +
" }\n" +
"}\n",
@@ -927,12 +927,12 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"public class X19 {\n" +
" public static void main(String[] obj) {\n" +
" boolean a = true;\n" +
- " boolean b = a ? false : (obj instanceof String[] s && s.length == 0);\n" +
+ " boolean b = a ? false : (obj instanceof String[] s && s.length == 0);\n" +
" System.out.print(b + \",\");\n" +
- " {\n" +
- " b = (obj instanceof String[] s && s.length == 0);\n" +
- " System.out.print(b);\n" +
- " }\n" +
+ " {\n" +
+ " b = (obj instanceof String[] s && s.length == 0);\n" +
+ " System.out.print(b);\n" +
+ " }\n" +
" }\n" +
"}\n",
},
@@ -950,18 +950,18 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"public class X19b {\n" +
" public static void main(String[] obj) {\n" +
" boolean a = true;\n" +
- " if (obj instanceof String[] s && s.length == 0) {\n" +
- " boolean b = (obj instanceof String[] s && s.length == 0);\n" +
- " System.out.print(b);\n" +
- " }\n" +
+ " if (obj instanceof String[] s && s.length == 0) {\n" +
+ " boolean b = (obj instanceof String[] s && s.length == 0);\n" +
+ " System.out.print(b);\n" +
+ " }\n" +
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X19b.java (at line 6)\n" +
- " boolean b = (obj instanceof String[] s && s.length == 0);\n" +
- " ^\n" +
- "Duplicate local variable s\n" +
+ "----------\n" +
+ "1. ERROR in X19b.java (at line 6)\n" +
+ " boolean b = (obj instanceof String[] s && s.length == 0);\n" +
+ " ^\n" +
+ "Duplicate local variable s\n" +
"----------\n",
"",
null,
@@ -978,8 +978,8 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X20 {\n" +
" public static void main(String[] o) {\n" +
- " boolean b = (o instanceof String[] s) && s instanceof String[] s2;\n" +
- " System.out.print(b);\n" +
+ " boolean b = (o instanceof String[] s) && s instanceof String[] s2;\n" +
+ " System.out.print(b);\n" +
" }\n" +
"}\n",
},
@@ -996,22 +996,22 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X21 {\n" +
" public static void main(String[] o) {\n" +
- " boolean b = (o instanceof String[] s) && s instanceof String[] s2;\n" +
+ " boolean b = (o instanceof String[] s) && s instanceof String[] s2;\n" +
" System.out.print(s);\n" +
- " System.out.print(s2);\n" +
+ " System.out.print(s2);\n" +
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X21.java (at line 5)\n" +
- " System.out.print(s);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
- "----------\n" +
- "2. ERROR in X21.java (at line 6)\n" +
- " System.out.print(s2);\n" +
- " ^^\n" +
- "The pattern variable s2 is not in scope in this location\n" +
+ "----------\n" +
+ "1. ERROR in X21.java (at line 5)\n" +
+ " System.out.print(s);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "2. ERROR in X21.java (at line 6)\n" +
+ " System.out.print(s2);\n" +
+ " ^^\n" +
+ "The pattern variable s2 is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -1028,13 +1028,13 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X22 {\n" +
" public static void main(String[] o) {\n" +
- " foo(\"one\");\n" +
+ " foo(\"one\");\n" +
" }\n" +
" public static void foo(Object o) {\n" +
- " while ((o instanceof String s) && s.length() > 0) {\n" +
+ " while ((o instanceof String s) && s.length() > 0) {\n" +
" o = s.substring(0, s.length() - 1);\n" +
" System.out.println(s);\n" +
- " }\n" +
+ " }\n" +
" }\n" +
"}\n",
},
@@ -1049,33 +1049,33 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X22a {\n" +
" public static void main(String[] o) {\n" +
- " foo(\"one\");\n" +
+ " foo(\"one\");\n" +
" }\n" +
" public static void foo(Object o) {\n" +
- " do {\n" +
+ " do {\n" +
" o = s.substring(0, s.length() - 1);\n" +
" System.out.println(s);\n" +
- " } while ((o instanceof String s) && s.length() > 0);\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X22a.java (at line 8)\n" +
- " o = s.substring(0, s.length() - 1);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
- "----------\n" +
- "2. ERROR in X22a.java (at line 8)\n" +
- " o = s.substring(0, s.length() - 1);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
- "----------\n" +
- "3. ERROR in X22a.java (at line 9)\n" +
- " System.out.println(s);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
+ " } while ((o instanceof String s) && s.length() > 0);\n" +
+ " }\n" +
+ "}\n",
+ },
+ "----------\n" +
+ "1. ERROR in X22a.java (at line 8)\n" +
+ " o = s.substring(0, s.length() - 1);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "2. ERROR in X22a.java (at line 8)\n" +
+ " o = s.substring(0, s.length() - 1);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "3. ERROR in X22a.java (at line 9)\n" +
+ " System.out.println(s);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
"----------\n",
- null,
+ null,
true,
options);
}
@@ -1087,23 +1087,23 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X22b {\n" +
" public static void main(String[] o) {\n" +
- " foo(\"one\");\n" +
+ " foo(\"one\");\n" +
" }\n" +
" public static void foo(Object o) {\n" +
- " do {\n" +
+ " do {\n" +
" // nothing\n" +
- " } while ((o instanceof String s));\n" +
+ " } while ((o instanceof String s));\n" +
" System.out.println(s);\n" +
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X22b.java (at line 10)\n" +
- " System.out.println(s);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "1. ERROR in X22b.java (at line 10)\n" +
+ " System.out.println(s);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
"----------\n",
- null,
+ null,
true,
options);
}
@@ -1115,12 +1115,12 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X22c {\n" +
" public static void main(String[] o) {\n" +
- " foo(\"one\");\n" +
+ " foo(\"one\");\n" +
" }\n" +
" public static void foo(Object o) {\n" +
- " do {\n" +
+ " do {\n" +
" // nothing\n" +
- " } while (!(o instanceof String s));\n" +
+ " } while (!(o instanceof String s));\n" +
" System.out.println(s);\n" +
" }\n" +
"}\n",
@@ -1138,26 +1138,26 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X23 {\n" +
" public static void main(String[] o) {\n" +
- " foo(\"one\");\n" +
+ " foo(\"one\");\n" +
" }\n" +
" public static void foo(Object o) {\n" +
- " while (!(o instanceof String s) && s.length() > 0) {\n" +
+ " while (!(o instanceof String s) && s.length() > 0) {\n" +
" System.out.println(s);\n" +
" break;\n" +
- " }\n" +
+ " }\n" +
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X23.java (at line 7)\n" +
- " while (!(o instanceof String s) && s.length() > 0) {\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
- "----------\n" +
- "2. ERROR in X23.java (at line 8)\n" +
- " System.out.println(s);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "1. ERROR in X23.java (at line 7)\n" +
+ " while (!(o instanceof String s) && s.length() > 0) {\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "2. ERROR in X23.java (at line 8)\n" +
+ " System.out.println(s);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -1172,26 +1172,26 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X23a {\n" +
" public static void main(String[] o) {\n" +
- " foo(\"one\");\n" +
+ " foo(\"one\");\n" +
" }\n" +
" public static void foo(Object o) {\n" +
- " do {\n" +
+ " do {\n" +
" System.out.println(s);\n" +
" break;\n" +
- " } while (!(o instanceof String s) && s.length() > 0);\n" +
+ " } while (!(o instanceof String s) && s.length() > 0);\n" +
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X23a.java (at line 8)\n" +
- " System.out.println(s);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
- "----------\n" +
- "2. ERROR in X23a.java (at line 10)\n" +
- " } while (!(o instanceof String s) && s.length() > 0);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "1. ERROR in X23a.java (at line 8)\n" +
+ " System.out.println(s);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "2. ERROR in X23a.java (at line 10)\n" +
+ " } while (!(o instanceof String s) && s.length() > 0);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -1208,26 +1208,26 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X23b {\n" +
" public static void main(String[] o) {\n" +
- " foo(\"one\");\n" +
+ " foo(\"one\");\n" +
" }\n" +
" public static void foo(Object o) {\n" +
- " while (!(o instanceof String s) && s.length() > 0) {\n" +
+ " while (!(o instanceof String s) && s.length() > 0) {\n" +
" System.out.println(s);\n" +
" //break;\n" +
- " }\n" +
+ " }\n" +
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X23b.java (at line 7)\n" +
- " while (!(o instanceof String s) && s.length() > 0) {\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
- "----------\n" +
- "2. ERROR in X23b.java (at line 8)\n" +
- " System.out.println(s);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "1. ERROR in X23b.java (at line 7)\n" +
+ " while (!(o instanceof String s) && s.length() > 0) {\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "2. ERROR in X23b.java (at line 8)\n" +
+ " System.out.println(s);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -1243,26 +1243,26 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X23c {\n" +
" public static void main(String[] o) {\n" +
- " foo(\"one\");\n" +
+ " foo(\"one\");\n" +
" }\n" +
" public static void foo(Object o) {\n" +
- " do {\n" +
+ " do {\n" +
" System.out.println(s);\n" +
" //break;\n" +
- " }while (!(o instanceof String s) && s.length() > 0);\n" +
+ " }while (!(o instanceof String s) && s.length() > 0);\n" +
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X23c.java (at line 8)\n" +
- " System.out.println(s);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
- "----------\n" +
- "2. ERROR in X23c.java (at line 10)\n" +
- " }while (!(o instanceof String s) && s.length() > 0);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "1. ERROR in X23c.java (at line 8)\n" +
+ " System.out.println(s);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "2. ERROR in X23c.java (at line 10)\n" +
+ " }while (!(o instanceof String s) && s.length() > 0);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -1277,12 +1277,12 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X24a {\n" +
" public static void main(String[] o) {\n" +
- " foo(\"one\");\n" +
+ " foo(\"one\");\n" +
" }\n" +
" public static void foo(Object o) {\n" +
- " while (!(o instanceof String s)) {\n" +
+ " while (!(o instanceof String s)) {\n" +
" throw new IllegalArgumentException();\n" +
- " }\n" +
+ " }\n" +
" System.out.println(s);\n" +
" }\n" +
"}\n",
@@ -1290,7 +1290,7 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"one",
options);
}
- /*
+ /*
* It's not a problem to define the same var in two operands of a binary expression,
* but then it is not in scope below.
*/
@@ -1302,20 +1302,20 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X25 {\n" +
" public static void main(String[] o) {\n" +
- " foo(\"one\", \"two\");\n" +
+ " foo(\"one\", \"two\");\n" +
" }\n" +
" public static void foo(Object o, Object p) {\n" +
- " if ((o instanceof String s) != p instanceof String s) {\n" +
+ " if ((o instanceof String s) != p instanceof String s) {\n" +
" System.out.print(\"s:\" + s);\n" +
- " }\n" +
+ " }\n" +
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X25.java (at line 8)\n" +
- " System.out.print(\"s:\" + s);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "1. ERROR in X25.java (at line 8)\n" +
+ " System.out.print(\"s:\" + s);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -1334,20 +1334,20 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X26 {\n" +
" public static void main(String[] o) {\n" +
- " foo(\"one\", \"two\");\n" +
+ " foo(\"one\", \"two\");\n" +
" }\n" +
" public static void foo(Object o, Object p) {\n" +
- " if ((o instanceof String s) == p instanceof String s) {\n" +
+ " if ((o instanceof String s) == p instanceof String s) {\n" +
" System.out.print(\"s:\" + s);\n" +
- " }\n" +
+ " }\n" +
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X26.java (at line 8)\n" +
- " System.out.print(\"s:\" + s);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "1. ERROR in X26.java (at line 8)\n" +
+ " System.out.print(\"s:\" + s);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -1361,12 +1361,12 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X27 {\n" +
" public static void main(String[] o) {\n" +
- " foo(\"one\");\n" +
+ " foo(\"one\");\n" +
" }\n" +
" public static void foo(Object obj) {\n" +
- " for(int i = 0; (obj instanceof String[] s && s.length > 0 && i < s.length); i++) {\n" +
+ " for(int i = 0; (obj instanceof String[] s && s.length > 0 && i < s.length); i++) {\n" +
" System.out.println(s[i]);\n" +
- " }\n" +
+ " }\n" +
" }\n" +
"}\n",
},
@@ -1380,12 +1380,12 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X28 {\n" +
" public static void main(String[] o) {\n" +
- " foo(new String[] {\"one\", \"two\"});\n" +
+ " foo(new String[] {\"one\", \"two\"});\n" +
" }\n" +
" public static void foo(Object obj) {\n" +
- " for(int i = 0; (obj instanceof String[] s && s.length > 0 && i < s.length); i++) {\n" +
+ " for(int i = 0; (obj instanceof String[] s && s.length > 0 && i < s.length); i++) {\n" +
" System.out.println(s[i]);\n" +
- " }\n" +
+ " }\n" +
" }\n" +
"}\n",
},
@@ -1399,12 +1399,12 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X29 {\n" +
" public static void main(String[] o) {\n" +
- " foo(new String[] {\"one\", \"two\"});\n" +
+ " foo(new String[] {\"one\", \"two\"});\n" +
" }\n" +
" public static void foo(Object obj) {\n" +
- " for(int i = 0; (obj instanceof String[] s) && s.length > 0 && i < s.length; i = (s != null ? i + 1 : i)) {\n" +
+ " for(int i = 0; (obj instanceof String[] s) && s.length > 0 && i < s.length; i = (s != null ? i + 1 : i)) {\n" +
" System.out.println(s[i]);\n" +
- " }\n" +
+ " }\n" +
" }\n" +
"}\n",
},
@@ -1422,20 +1422,20 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X30 {\n" +
" public static void main(String[] o) {\n" +
- " foo(\"one\");\n" +
+ " foo(\"one\");\n" +
" }\n" +
" public static void foo(Object obj) {\n" +
- " for(int i = 0, length = (obj instanceof String s) ? s.length() : 0; i < length; i++) {\n" +
+ " for(int i = 0, length = (obj instanceof String s) ? s.length() : 0; i < length; i++) {\n" +
" System.out.print(s.charAt(i));\n" +
- " }\n" +
+ " }\n" +
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X30.java (at line 8)\n" +
- " System.out.print(s.charAt(i));\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "1. ERROR in X30.java (at line 8)\n" +
+ " System.out.print(s.charAt(i));\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -1449,30 +1449,30 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X31 {\n" +
" public static void main(String[] o) {\n" +
- " foo(\"one\");\n" +
+ " foo(\"one\");\n" +
" }\n" +
" public static void foo(Object obj) {\n" +
- " for(int i = 0; !(obj instanceof String[] s) && s.length > 0 && i < s.length; i++) {\n" +
+ " for(int i = 0; !(obj instanceof String[] s) && s.length > 0 && i < s.length; i++) {\n" +
" System.out.println(s[i]);\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X31.java (at line 7)\n" +
- " for(int i = 0; !(obj instanceof String[] s) && s.length > 0 && i < s.length; i++) {\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
- "----------\n" +
- "2. ERROR in X31.java (at line 7)\n" +
- " for(int i = 0; !(obj instanceof String[] s) && s.length > 0 && i < s.length; i++) {\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
- "----------\n" +
- "3. ERROR in X31.java (at line 8)\n" +
- " System.out.println(s[i]);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
+ " }\n" +
+ " }\n" +
+ "}\n",
+ },
+ "----------\n" +
+ "1. ERROR in X31.java (at line 7)\n" +
+ " for(int i = 0; !(obj instanceof String[] s) && s.length > 0 && i < s.length; i++) {\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "2. ERROR in X31.java (at line 7)\n" +
+ " for(int i = 0; !(obj instanceof String[] s) && s.length > 0 && i < s.length; i++) {\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "3. ERROR in X31.java (at line 8)\n" +
+ " System.out.println(s[i]);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -1486,18 +1486,18 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X32 {\n" +
" public static void main(String[] o) {\n" +
- " foo(\"one\");\n" +
+ " foo(\"one\");\n" +
" }\n" +
" public static void foo(Object obj) {\n" +
- " String res = null;\n" +
- " int i = 0;\n" +
- " switch(i) {\n" +
- " case 0:\n" +
- " res = (obj instanceof String s) ? s : null;\n" +
- " default:\n" +
- " break;\n" +
- " }\n" +
- " System.out.println(res);\n" +
+ " String res = null;\n" +
+ " int i = 0;\n" +
+ " switch(i) {\n" +
+ " case 0:\n" +
+ " res = (obj instanceof String s) ? s : null;\n" +
+ " default:\n" +
+ " break;\n" +
+ " }\n" +
+ " System.out.println(res);\n" +
" }\n" +
"}\n",
},
@@ -1511,27 +1511,27 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X33 {\n" +
" public static void main(String[] o) {\n" +
- " foo(\"one\");\n" +
+ " foo(\"one\");\n" +
" }\n" +
" public static void foo(Object obj) {\n" +
- " String res = null;\n" +
- " int i = 0;\n" +
- " switch(i) {\n" +
- " case 0:\n" +
- " res = (obj instanceof String s) ? s : null;\n" +
- " res = s.substring(1);\n" +
- " default:\n" +
- " break;\n" +
- " }\n" +
- " System.out.println(res);\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X33.java (at line 12)\n" +
- " res = s.substring(1);\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
+ " String res = null;\n" +
+ " int i = 0;\n" +
+ " switch(i) {\n" +
+ " case 0:\n" +
+ " res = (obj instanceof String s) ? s : null;\n" +
+ " res = s.substring(1);\n" +
+ " default:\n" +
+ " break;\n" +
+ " }\n" +
+ " System.out.println(res);\n" +
+ " }\n" +
+ "}\n",
+ },
+ "----------\n" +
+ "1. ERROR in X33.java (at line 12)\n" +
+ " res = s.substring(1);\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -1545,28 +1545,28 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X34 {\n" +
" public static void main(String[] o) {\n" +
- " foo(\"one\");\n" +
+ " foo(\"one\");\n" +
" }\n" +
" public static void foo(Object obj) {\n" +
- " int i = 0;\n" +
- " String result = switch(i) {\n" +
- " case 0 -> {\n" +
- " result = (obj instanceof String s) ? s : null;\n" +
- " yield result;\n" +
- " }\n" +
- " default -> {\n" +
- " yield result;\n" +
- " }\n" +
- " };\n" +
- " System.out.println(result);\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X34.java (at line 14)\n" +
- " yield result;\n" +
- " ^^^^^^\n" +
- "The local variable result may not have been initialized\n" +
+ " int i = 0;\n" +
+ " String result = switch(i) {\n" +
+ " case 0 -> {\n" +
+ " result = (obj instanceof String s) ? s : null;\n" +
+ " yield result;\n" +
+ " }\n" +
+ " default -> {\n" +
+ " yield result;\n" +
+ " }\n" +
+ " };\n" +
+ " System.out.println(result);\n" +
+ " }\n" +
+ "}\n",
+ },
+ "----------\n" +
+ "1. ERROR in X34.java (at line 14)\n" +
+ " yield result;\n" +
+ " ^^^^^^\n" +
+ "The local variable result may not have been initialized\n" +
"----------\n",
"",
null,
@@ -1580,33 +1580,33 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X35 {\n" +
" public static void main(String[] o) {\n" +
- " foo(\"one\");\n" +
+ " foo(\"one\");\n" +
" }\n" +
" public static void foo(Object obj) {\n" +
- " int i = 0;\n" +
- " String result = switch(i) {\n" +
- " case 0 -> {\n" +
- " result = (obj instanceof String s) ? s : null;\n" +
- " yield s;\n" +
- " }\n" +
- " default -> {\n" +
- " yield s;\n" +
- " }\n" +
- " };\n" +
- " System.out.println(result);\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X35.java (at line 11)\n" +
- " yield s;\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
- "----------\n" +
- "2. ERROR in X35.java (at line 14)\n" +
- " yield s;\n" +
- " ^\n" +
- "The pattern variable s is not in scope in this location\n" +
+ " int i = 0;\n" +
+ " String result = switch(i) {\n" +
+ " case 0 -> {\n" +
+ " result = (obj instanceof String s) ? s : null;\n" +
+ " yield s;\n" +
+ " }\n" +
+ " default -> {\n" +
+ " yield s;\n" +
+ " }\n" +
+ " };\n" +
+ " System.out.println(result);\n" +
+ " }\n" +
+ "}\n",
+ },
+ "----------\n" +
+ "1. ERROR in X35.java (at line 11)\n" +
+ " yield s;\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
+ "----------\n" +
+ "2. ERROR in X35.java (at line 14)\n" +
+ " yield s;\n" +
+ " ^\n" +
+ "The pattern variable s is not in scope in this location\n" +
"----------\n",
"",
null,
@@ -1620,17 +1620,17 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X36 {\n" +
" public static void main(String[] o) {\n" +
- " foo(\"one\");\n" +
+ " foo(\"one\");\n" +
" }\n" +
" public static void foo(Object obj) {\n" +
- " int i = 0;\n" +
- " String result = switch(i) {\n" +
- " default -> {\n" +
- " result = (obj instanceof String s) ? s : null;\n" +
- " yield result;\n" +
- " }\n" +
- " };\n" +
- " System.out.println(result);\n" +
+ " int i = 0;\n" +
+ " String result = switch(i) {\n" +
+ " default -> {\n" +
+ " result = (obj instanceof String s) ? s : null;\n" +
+ " yield result;\n" +
+ " }\n" +
+ " };\n" +
+ " System.out.println(result);\n" +
" }\n" +
"}\n",
},
@@ -1644,20 +1644,20 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X37 {\n" +
" public static void main(String[] o) {\n" +
- " foo(new String[] {\"abcd\"});\n" +
+ " foo(new String[] {\"abcd\"});\n" +
" }\n" +
" public static void foo(Object[] obj) {\n" +
- " for(int i = 0; (obj[i] instanceof String s) && s.length() > 0 ; i++) {\n" +
- " System.out.println(s[i]);\n" +
- " }\n" +
+ " for(int i = 0; (obj[i] instanceof String s) && s.length() > 0 ; i++) {\n" +
+ " System.out.println(s[i]);\n" +
+ " }\n" +
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X37.java (at line 8)\n" +
- " System.out.println(s[i]);\n" +
- " ^^^^\n" +
- "The type of the expression must be an array type but it resolved to String\n" +
+ "----------\n" +
+ "1. ERROR in X37.java (at line 8)\n" +
+ " System.out.println(s[i]);\n" +
+ " ^^^^\n" +
+ "The type of the expression must be an array type but it resolved to String\n" +
"----------\n",
"",
null,
@@ -1671,21 +1671,21 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X38 {\n" +
" public static void main(String[] o) {\n" +
- " foo(new String[] {\"abcd\"});\n" +
+ " foo(new String[] {\"abcd\"});\n" +
" }\n" +
" public static void foo(Object[] obj) {\n" +
- " for(int i = 0; (obj[i] instanceof String s) && s.length() > 0 ; i++) {\n" +
- " throw new IllegalArgumentException();\n" +
- " }\n" +
+ " for(int i = 0; (obj[i] instanceof String s) && s.length() > 0 ; i++) {\n" +
+ " throw new IllegalArgumentException();\n" +
+ " }\n" +
" System.out.println(s);\n" +
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X38.java (at line 10)\n" +
- " System.out.println(s);\n" +
- " ^\n" +
- "s cannot be resolved to a variable\n" +
+ "----------\n" +
+ "1. ERROR in X38.java (at line 10)\n" +
+ " System.out.println(s);\n" +
+ " ^\n" +
+ "s cannot be resolved to a variable\n" +
"----------\n",
"",
null,
@@ -1702,12 +1702,12 @@ public class PatternMatching14Test extends AbstractRegressionTest {
"@SuppressWarnings(\"preview\")\n" +
"public class X39 {\n" +
" public static void main(String[] o) {\n" +
- " foo(new String[] {\"one\"});;\n" +
+ " foo(new String[] {\"one\"});;\n" +
" }\n" +
" public static void foo(Object[] obj) {\n" +
- " for(int i = 0; i < obj.length && (obj[i] instanceof String s) && i < s.length(); i++) {\n" +
- " System.out.println(s);\n" +
- " }\n" +
+ " for(int i = 0; i < obj.length && (obj[i] instanceof String s) && i < s.length(); i++) {\n" +
+ " System.out.println(s);\n" +
+ " }\n" +
" }\n" +
"}\n",
},
@@ -1719,22 +1719,22 @@ public class PatternMatching14Test extends AbstractRegressionTest {
new String[] {
"X40.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class X40 {\n" +
- " String a;\n" +
- " Object o1 = \"x\";\n" +
- " public static void main(String argv[]) {\n" +
- " System.out.println(new X40().foo());\n" +
- " }\n" +
- " public String foo() {\n" +
- " String res = \"\";\n" +
- " Object o2 = \"x\";\n" +
- " if (o1 instanceof String s) { \n" +
- " res = \"then_\" + s;\n" +
- " } else {\n" +
+ "public class X40 {\n" +
+ " String a;\n" +
+ " Object o1 = \"x\";\n" +
+ " public static void main(String argv[]) {\n" +
+ " System.out.println(new X40().foo());\n" +
+ " }\n" +
+ " public String foo() {\n" +
+ " String res = \"\";\n" +
+ " Object o2 = \"x\";\n" +
+ " if (o1 instanceof String s) { \n" +
+ " res = \"then_\" + s;\n" +
+ " } else {\n" +
" res = \"else_\";\n" +
- " }\n" +
- " return res;\n" +
- " }\n" +
+ " }\n" +
+ " return res;\n" +
+ " }\n" +
"}\n",
},
"then_x",
@@ -1745,22 +1745,22 @@ public class PatternMatching14Test extends AbstractRegressionTest {
new String[] {
"X41.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class X41 {\n" +
- " String a;\n" +
- " Object o1 = \"x\";\n" +
- " public static void main(String argv[]) {\n" +
- " System.out.println(new X41().foo());\n" +
- " }\n" +
- " public String foo() {\n" +
- " String res = \"\";\n" +
- " Object o2 = \"x\";\n" +
- " if ( !(o1 instanceof String s) || !o1.equals(s) ) { \n" +
- " res = \"then_\";\n" +
- " } else {\n" +
- " res = \"else_\" + s;\n" +
- " }\n" +
- " return res;\n" +
- " }\n" +
+ "public class X41 {\n" +
+ " String a;\n" +
+ " Object o1 = \"x\";\n" +
+ " public static void main(String argv[]) {\n" +
+ " System.out.println(new X41().foo());\n" +
+ " }\n" +
+ " public String foo() {\n" +
+ " String res = \"\";\n" +
+ " Object o2 = \"x\";\n" +
+ " if ( !(o1 instanceof String s) || !o1.equals(s) ) { \n" +
+ " res = \"then_\";\n" +
+ " } else {\n" +
+ " res = \"else_\" + s;\n" +
+ " }\n" +
+ " return res;\n" +
+ " }\n" +
"}\n",
},
"else_x",
@@ -1771,22 +1771,22 @@ public class PatternMatching14Test extends AbstractRegressionTest {
new String[] {
"X42.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class X42 {\n" +
- " String a;\n" +
- " Object o1 = \"x\";\n" +
- " public static void main(String argv[]) {\n" +
- " System.out.println(new X42().foo());\n" +
- " }\n" +
- " public String foo() {\n" +
- " String res = \"\";\n" +
- " Object o2 = o1;\n" +
- " if ( !(o1 instanceof String s) || !o1.equals(s) ) { \n" +
- " res = \"then_\";\n" +
- " } else {\n" +
- " res = \"else_\" + s;\n" +
- " }\n" +
- " return res;\n" +
- " }\n" +
+ "public class X42 {\n" +
+ " String a;\n" +
+ " Object o1 = \"x\";\n" +
+ " public static void main(String argv[]) {\n" +
+ " System.out.println(new X42().foo());\n" +
+ " }\n" +
+ " public String foo() {\n" +
+ " String res = \"\";\n" +
+ " Object o2 = o1;\n" +
+ " if ( !(o1 instanceof String s) || !o1.equals(s) ) { \n" +
+ " res = \"then_\";\n" +
+ " } else {\n" +
+ " res = \"else_\" + s;\n" +
+ " }\n" +
+ " return res;\n" +
+ " }\n" +
"}\n",
},
"else_x",
@@ -1797,24 +1797,24 @@ public class PatternMatching14Test extends AbstractRegressionTest {
new String[] {
"X43.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class X43 {\n" +
- " public static void main(String argv[]) {\n" +
- " System.out.println(new X43().foo(\"foo\", \"test\"));\n" +
- " }\n" +
- " public boolean foo(Object obj, String s) {\n" +
- " class Inner {\n" +
- " public boolean foo(Object obj) {\n" +
- " if (obj instanceof String s) {\n" +
- " // x is shadowed now\n" +
- " if (!\"foo\".equals(s))\n" +
- " return false;\n" +
- " }\n" +
- " // x is not shadowed\n" +
- " return \"test\".equals(s);\n" +
- " }\n" +
- " }\n" +
- " return new Inner().foo(obj);\n" +
- " }\n" +
+ "public class X43 {\n" +
+ " public static void main(String argv[]) {\n" +
+ " System.out.println(new X43().foo(\"foo\", \"test\"));\n" +
+ " }\n" +
+ " public boolean foo(Object obj, String s) {\n" +
+ " class Inner {\n" +
+ " public boolean foo(Object obj) {\n" +
+ " if (obj instanceof String s) {\n" +
+ " // x is shadowed now\n" +
+ " if (!\"foo\".equals(s))\n" +
+ " return false;\n" +
+ " }\n" +
+ " // x is not shadowed\n" +
+ " return \"test\".equals(s);\n" +
+ " }\n" +
+ " }\n" +
+ " return new Inner().foo(obj);\n" +
+ " }\n" +
"}\n",
},
"else_x",
@@ -1828,19 +1828,19 @@ public class PatternMatching14Test extends AbstractRegressionTest {
new String[] {
"X44.java",
"@SuppressWarnings(\"preview\")\n" +
- "class Inner<T> {\n" +
- " public boolean foo(Object obj) {\n" +
- " if (obj instanceof Inner<?> p) {\n" +
- " return true;\n" +
- " }\n" +
- " return false;\n" +
- " }\n" +
- "} \n" +
- "public class X44 {\n" +
- " public static void main(String argv[]) {\n" +
- " Inner<String> param = new Inner<>();\n" +
- " System.out.println(new Inner<String>().foo(param));\n" +
- " }\n" +
+ "class Inner<T> {\n" +
+ " public boolean foo(Object obj) {\n" +
+ " if (obj instanceof Inner<?> p) {\n" +
+ " return true;\n" +
+ " }\n" +
+ " return false;\n" +
+ " }\n" +
+ "} \n" +
+ "public class X44 {\n" +
+ " public static void main(String argv[]) {\n" +
+ " Inner<String> param = new Inner<>();\n" +
+ " System.out.println(new Inner<String>().foo(param));\n" +
+ " }\n" +
"}\n",
},
"true",
@@ -1855,12 +1855,12 @@ public class PatternMatching14Test extends AbstractRegressionTest {
new String[] {
"X45.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class X45 {\n" +
- " String s = \"test\";\n" +
+ "public class X45 {\n" +
+ " String s = \"test\";\n" +
" boolean result = s instanceof String s1;\n" +
- " public static void main(String argv[]) {\n" +
- " System.out.println(\"true\");\n" +
- " }\n" +
+ " public static void main(String argv[]) {\n" +
+ " System.out.println(\"true\");\n" +
+ " }\n" +
"}\n",
},
"true",
@@ -1875,12 +1875,12 @@ public class PatternMatching14Test extends AbstractRegressionTest {
new String[] {
"X46.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class X46 {\n" +
- " String s = \"test\";\n" +
+ "public class X46 {\n" +
+ " String s = \"test\";\n" +
" boolean result = (s instanceof String s1 && s1 != null);\n" +
- " public static void main(String argv[]) {\n" +
- " System.out.println(\"true\");\n" +
- " }\n" +
+ " public static void main(String argv[]) {\n" +
+ " System.out.println(\"true\");\n" +
+ " }\n" +
"}\n",
},
"true",
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PolymorphicSignatureTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PolymorphicSignatureTest.java
index 321b2e5f3..4c70a46b6 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PolymorphicSignatureTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PolymorphicSignatureTest.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -29,7 +29,7 @@ public class PolymorphicSignatureTest extends AbstractRegressionTest {
public static Class testClass() {
return PolymorphicSignatureTest.class;
}
-
+
public void test0001() {
this.runConformTest(
new String[] {
@@ -52,14 +52,14 @@ public class PolymorphicSignatureTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "import static java.lang.invoke.MethodHandles.*; \n" +
- "import java.lang.invoke.MethodHandle;\n" +
- "public class X {\n" +
- " public static void main(String[] args) throws Throwable {\n" +
- " MethodHandle mh = dropArguments(insertArguments(identity(int.class), 0, 42), 0, Object[].class);\n" +
+ "import static java.lang.invoke.MethodHandles.*; \n" +
+ "import java.lang.invoke.MethodHandle;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) throws Throwable {\n" +
+ " MethodHandle mh = dropArguments(insertArguments(identity(int.class), 0, 42), 0, Object[].class);\n" +
" int value = (int)mh.invokeExact(new Object[0]);\n" +
" System.out.println(value);\n"+
- " }\n" +
+ " }\n" +
"}"
},
"42");
@@ -68,20 +68,20 @@ public class PolymorphicSignatureTest extends AbstractRegressionTest {
runConformTest(
new String[] {
"Test.java",
- "import java.lang.invoke.MethodHandle;\n" +
- "import java.util.ArrayList;\n" +
- "import java.util.Collections;\n" +
- "\n" +
- "public class Test {\n" +
- " \n" +
- " public void foo() throws Throwable {\n" +
- " \n" +
- " MethodHandle mh = null;\n" +
- " mh.invoke(null); // works, no issues.\n" +
- " mh.invoke(null, new ArrayList<>()); // Bug 501457 fixed this\n" +
- " mh.invoke(null, Collections.emptyList()); // This triggers UOE\n" +
- " \n" +
- " }\n" +
+ "import java.lang.invoke.MethodHandle;\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.Collections;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " \n" +
+ " public void foo() throws Throwable {\n" +
+ " \n" +
+ " MethodHandle mh = null;\n" +
+ " mh.invoke(null); // works, no issues.\n" +
+ " mh.invoke(null, new ArrayList<>()); // Bug 501457 fixed this\n" +
+ " mh.invoke(null, Collections.emptyList()); // This triggers UOE\n" +
+ " \n" +
+ " }\n" +
"}\n"
});
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProblemConstructorTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProblemConstructorTest.java
index e0acede43..8b9bd38e1 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProblemConstructorTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProblemConstructorTest.java
@@ -145,7 +145,7 @@ public void test003() {
"Zork cannot be resolved to a type\n" +
"----------\n");
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=201912, test to make sure that unused public members of
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=201912, test to make sure that unused public members of
// private class (including constructors, fields, types and methods) get warned about.
public void test004() {
this.runNegativeTest(
@@ -178,26 +178,26 @@ public void test004() {
" }\n" +
"} \n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " public int unusedMethod() { return this.state; }\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method unusedMethod() from the type X.M is never used locally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " public M (int state) { this.state = state;} \n" +
- " ^^^^^^^^^^^^^\n" +
- "The constructor X.M(int) is never used locally\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " public int unusedField = 0;\n" +
- " ^^^^^^^^^^^\n" +
- "The value of the field X.M.unusedField is not used\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 7)\n" +
- " public class N {}\n" +
- " ^\n" +
- "The type X.M.N is never used locally\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " public int unusedMethod() { return this.state; }\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The method unusedMethod() from the type X.M is never used locally\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " public M (int state) { this.state = state;} \n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The constructor X.M(int) is never used locally\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " public int unusedField = 0;\n" +
+ " ^^^^^^^^^^^\n" +
+ "The value of the field X.M.unusedField is not used\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 7)\n" +
+ " public class N {}\n" +
+ " ^\n" +
+ "The type X.M.N is never used locally\n" +
"----------\n"
);
}
@@ -221,11 +221,11 @@ public void test005() {
};
if (!isMinimumCompliant(ClassFileConstants.JDK11)) {
this.runNegativeTest(testFiles,
- "----------\n" +
- "1. WARNING in A.java (at line 3)\n" +
- " B.test();\n" +
- " ^^^^^^^^\n" +
- "Access to enclosing method test() from the type A.B is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "1. WARNING in A.java (at line 3)\n" +
+ " B.test();\n" +
+ " ^^^^^^^^\n" +
+ "Access to enclosing method test() from the type A.B is emulated by a synthetic accessor method\n" +
"----------\n");
} else {
this.runConformTest(testFiles);
@@ -235,23 +235,23 @@ public void test005() {
//we DO complain about the constructor of B not being used when its base class has a no-arg constructor
public void test006() {
String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ?
- "----------\n" +
- "1. WARNING in A.java (at line 8)\n" +
- " public B () { super(\"\"); }\n" +
- " ^^^^\n" +
- "The constructor A.B() is never used locally\n" +
+ "----------\n" +
+ "1. WARNING in A.java (at line 8)\n" +
+ " public B () { super(\"\"); }\n" +
+ " ^^^^\n" +
+ "The constructor A.B() is never used locally\n" +
"----------\n"
:
- "----------\n" +
- "1. WARNING in A.java (at line 3)\n" +
- " B.test();\n" +
- " ^^^^^^^^\n" +
- "Access to enclosing method test() from the type A.B is emulated by a synthetic accessor method\n" +
- "----------\n" +
- "2. WARNING in A.java (at line 8)\n" +
- " public B () { super(\"\"); }\n" +
- " ^^^^\n" +
- "The constructor A.B() is never used locally\n" +
+ "----------\n" +
+ "1. WARNING in A.java (at line 3)\n" +
+ " B.test();\n" +
+ " ^^^^^^^^\n" +
+ "Access to enclosing method test() from the type A.B is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "2. WARNING in A.java (at line 8)\n" +
+ " public B () { super(\"\"); }\n" +
+ " ^^^^\n" +
+ "The constructor A.B() is never used locally\n" +
"----------\n";
this.runNegativeTest(
new String[] {
@@ -330,11 +330,11 @@ public void test009() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in A.java (at line 7)\n" +
- " public B () { super(\"\"); }\n" +
- " ^^^^\n" +
- "The constructor C.B() is never used locally\n" +
+ "----------\n" +
+ "1. WARNING in A.java (at line 7)\n" +
+ " public B () { super(\"\"); }\n" +
+ " ^^^^\n" +
+ "The constructor C.B() is never used locally\n" +
"----------\n");
}
//Bug 408038 - Classes which implement Externalizable should not have an unused constructor warning
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java
index 14bd6d253..1a01b6263 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java
@@ -3370,10 +3370,10 @@ public void test073() {
"The type Foo.Private is not visible\n" +
"----------\n" +
"3. WARNING in X.java (at line 12)\n" +
- " private class Private {\n" +
- " ^^^^^^^\n" +
- "The type Foo.Private is never used locally\n" +
- "----------\n" +
+ " private class Private {\n" +
+ " ^^^^^^^\n" +
+ "The type Foo.Private is never used locally\n" +
+ "----------\n" +
"4. WARNING in X.java (at line 13)\n" +
" private void foo(){}\n" +
" ^^^^^\n" +
@@ -3389,11 +3389,11 @@ public void test074() {
" ^^^^\n" +
"The method bar1() from the type X refers to the missing type Zork\n" +
"----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " bar2();\n" +
- " ^^^^\n" +
- "The method bar2() from the type X refers to the missing type Zork\n" +
- "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " bar2();\n" +
+ " ^^^^\n" +
+ "The method bar2() from the type X refers to the missing type Zork\n" +
+ "----------\n" +
"3. ERROR in X.java (at line 6)\n" +
" bar3(null);\n" +
" ^^^^\n" +
@@ -3820,93 +3820,93 @@ public void test081() {
if (this.complianceLevel <= ClassFileConstants.JDK1_4) return;
Runner runner = new Runner();
runner.customOptions = getCompilerOptions();
- runner.customOptions.put( CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.ENABLED);
+ runner.customOptions.put( CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.ENABLED);
runner.customOptions.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.ERROR);
runner.customOptions.put(CompilerOptions.OPTION_ReportInvalidJavadocTags, CompilerOptions.ENABLED);
runner.testFiles =
new String[] {
"com/ost/util/report/Matrix.java", // =================
- "package com.ost.util.report;\n" +
- "import java.io.Serializable;\n" +
- "import com.ost.util.report.exceptions.InvalidRowSizeException;\n" +
- "public class Matrix<T> implements Serializable {\n" +
- " /**\n" +
- " * @see exceptions.InvalidRowSizeException2\n" +
- " */\n" +
- " public synchronized final void addRow(Object[] row){\n" +
- " throw new InvalidRowSizeException();\n" +
- " }\n" +
+ "package com.ost.util.report;\n" +
+ "import java.io.Serializable;\n" +
+ "import com.ost.util.report.exceptions.InvalidRowSizeException;\n" +
+ "public class Matrix<T> implements Serializable {\n" +
+ " /**\n" +
+ " * @see exceptions.InvalidRowSizeException2\n" +
+ " */\n" +
+ " public synchronized final void addRow(Object[] row){\n" +
+ " throw new InvalidRowSizeException();\n" +
+ " }\n" +
"}\n",
"com/ost/util/report/FilterConstraintSpecification.java", // =================
- "package com.ost.util.report;\n" +
- "import java.io.Serializable;\n" +
- "import com.ost.util.report.exceptions.MalformedFilterConstraintSpecification;\n" +
- "public final class FilterConstraintSpecification implements Serializable, Cloneable {\n" +
- " private final void makeConstraint(){\n" +
- " throw new MalformedFilterConstraintSpecification();\n" +
- " }\n" +
+ "package com.ost.util.report;\n" +
+ "import java.io.Serializable;\n" +
+ "import com.ost.util.report.exceptions.MalformedFilterConstraintSpecification;\n" +
+ "public final class FilterConstraintSpecification implements Serializable, Cloneable {\n" +
+ " private final void makeConstraint(){\n" +
+ " throw new MalformedFilterConstraintSpecification();\n" +
+ " }\n" +
"}\n",
"com/ost/util/report/exceptions/MalformedFilterConstraintSpecification.java", // =================
- "package com.ost.util.report.exceptions;\n" +
- "public class MalformedFilterConstraintSpecification extends RuntimeException {\n" +
- " /** Creates a new instance of MalformedFilterConstraintSpecification */\n" +
- " public MalformedFilterConstraintSpecification() {\n" +
- " super();\n" +
- " }\n" +
- " /* Creates a new instance of MalformedFilterConstraintSpecification */\n" +
- " public MalformedFilterConstraintSpecification(String message) {\n" +
- " super(message);\n" +
- " }\n" +
+ "package com.ost.util.report.exceptions;\n" +
+ "public class MalformedFilterConstraintSpecification extends RuntimeException {\n" +
+ " /** Creates a new instance of MalformedFilterConstraintSpecification */\n" +
+ " public MalformedFilterConstraintSpecification() {\n" +
+ " super();\n" +
+ " }\n" +
+ " /* Creates a new instance of MalformedFilterConstraintSpecification */\n" +
+ " public MalformedFilterConstraintSpecification(String message) {\n" +
+ " super(message);\n" +
+ " }\n" +
"}\n",
"com/ost/util/report/exceptions/InvalidRowSizeException.java", // =================
- "package com.ost.util.report.exceptions;\n" +
- "public class InvalidRowSizeException extends RuntimeException {\n" +
- " /** Creates a new instance of InvalidRowSizeException */\n" +
- " public InvalidRowSizeException() {\n" +
- " super();\n" +
- " }\n" +
- " /* Creates a new instance of InvalidRowSizeException */\n" +
- " public InvalidRowSizeException(String message) {\n" +
- " super(message);\n" +
- " }\n" +
+ "package com.ost.util.report.exceptions;\n" +
+ "public class InvalidRowSizeException extends RuntimeException {\n" +
+ " /** Creates a new instance of InvalidRowSizeException */\n" +
+ " public InvalidRowSizeException() {\n" +
+ " super();\n" +
+ " }\n" +
+ " /* Creates a new instance of InvalidRowSizeException */\n" +
+ " public InvalidRowSizeException(String message) {\n" +
+ " super(message);\n" +
+ " }\n" +
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in com\\ost\\util\\report\\Matrix.java (at line 4)\n" +
- " public class Matrix<T> implements Serializable {\n" +
- " ^^^^^^\n" +
- "The serializable class Matrix does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. ERROR in com\\ost\\util\\report\\Matrix.java (at line 6)\n" +
- " * @see exceptions.InvalidRowSizeException2\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: exceptions cannot be resolved to a type\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in com\\ost\\util\\report\\FilterConstraintSpecification.java (at line 4)\n" +
- " public final class FilterConstraintSpecification implements Serializable, Cloneable {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The serializable class FilterConstraintSpecification does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. WARNING in com\\ost\\util\\report\\FilterConstraintSpecification.java (at line 5)\n" +
- " private final void makeConstraint(){\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The method makeConstraint() from the type FilterConstraintSpecification is never used locally\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in com\\ost\\util\\report\\exceptions\\MalformedFilterConstraintSpecification.java (at line 2)\n" +
- " public class MalformedFilterConstraintSpecification extends RuntimeException {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The serializable class MalformedFilterConstraintSpecification does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in com\\ost\\util\\report\\exceptions\\InvalidRowSizeException.java (at line 2)\n" +
- " public class InvalidRowSizeException extends RuntimeException {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The serializable class InvalidRowSizeException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. WARNING in com\\ost\\util\\report\\Matrix.java (at line 4)\n" +
+ " public class Matrix<T> implements Serializable {\n" +
+ " ^^^^^^\n" +
+ "The serializable class Matrix does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. ERROR in com\\ost\\util\\report\\Matrix.java (at line 6)\n" +
+ " * @see exceptions.InvalidRowSizeException2\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: exceptions cannot be resolved to a type\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in com\\ost\\util\\report\\FilterConstraintSpecification.java (at line 4)\n" +
+ " public final class FilterConstraintSpecification implements Serializable, Cloneable {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The serializable class FilterConstraintSpecification does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. WARNING in com\\ost\\util\\report\\FilterConstraintSpecification.java (at line 5)\n" +
+ " private final void makeConstraint(){\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The method makeConstraint() from the type FilterConstraintSpecification is never used locally\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in com\\ost\\util\\report\\exceptions\\MalformedFilterConstraintSpecification.java (at line 2)\n" +
+ " public class MalformedFilterConstraintSpecification extends RuntimeException {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The serializable class MalformedFilterConstraintSpecification does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in com\\ost\\util\\report\\exceptions\\InvalidRowSizeException.java (at line 2)\n" +
+ " public class InvalidRowSizeException extends RuntimeException {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The serializable class InvalidRowSizeException does not declare a static final serialVersionUID field of type long\n" +
"----------\n";
- runner.javacTestOptions =
+ runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
runner.runNegativeTest();
}
@@ -3916,50 +3916,50 @@ public void test082() {
this.runConformTest(
new String[] {
"com/ost/util/report/Matrix.java", // =================
- "package com.ost.util.report;\n" +
- "import java.io.Serializable;\n" +
- "import com.ost.util.report.exceptions.InvalidRowSizeException;\n" +
- "public class Matrix<T> implements Serializable {\n" +
- " /**\n" +
- " * @see exceptions.InvalidRowSizeException2\n" +
- " */\n" +
- " public synchronized final void addRow(Object[] row){\n" +
- " throw new InvalidRowSizeException();\n" +
- " }\n" +
+ "package com.ost.util.report;\n" +
+ "import java.io.Serializable;\n" +
+ "import com.ost.util.report.exceptions.InvalidRowSizeException;\n" +
+ "public class Matrix<T> implements Serializable {\n" +
+ " /**\n" +
+ " * @see exceptions.InvalidRowSizeException2\n" +
+ " */\n" +
+ " public synchronized final void addRow(Object[] row){\n" +
+ " throw new InvalidRowSizeException();\n" +
+ " }\n" +
"}\n",
"com/ost/util/report/FilterConstraintSpecification.java", // =================
- "package com.ost.util.report;\n" +
- "import java.io.Serializable;\n" +
- "import com.ost.util.report.exceptions.MalformedFilterConstraintSpecification;\n" +
- "public final class FilterConstraintSpecification implements Serializable, Cloneable {\n" +
- " private final void makeConstraint(){\n" +
- " throw new MalformedFilterConstraintSpecification();\n" +
- " }\n" +
+ "package com.ost.util.report;\n" +
+ "import java.io.Serializable;\n" +
+ "import com.ost.util.report.exceptions.MalformedFilterConstraintSpecification;\n" +
+ "public final class FilterConstraintSpecification implements Serializable, Cloneable {\n" +
+ " private final void makeConstraint(){\n" +
+ " throw new MalformedFilterConstraintSpecification();\n" +
+ " }\n" +
"}\n",
"com/ost/util/report/exceptions/MalformedFilterConstraintSpecification.java", // =================
- "package com.ost.util.report.exceptions;\n" +
- "public class MalformedFilterConstraintSpecification extends RuntimeException {\n" +
- " /** Creates a new instance of MalformedFilterConstraintSpecification */\n" +
- " public MalformedFilterConstraintSpecification() {\n" +
- " super();\n" +
- " }\n" +
- " /* Creates a new instance of MalformedFilterConstraintSpecification */\n" +
- " public MalformedFilterConstraintSpecification(String message) {\n" +
- " super(message);\n" +
- " }\n" +
+ "package com.ost.util.report.exceptions;\n" +
+ "public class MalformedFilterConstraintSpecification extends RuntimeException {\n" +
+ " /** Creates a new instance of MalformedFilterConstraintSpecification */\n" +
+ " public MalformedFilterConstraintSpecification() {\n" +
+ " super();\n" +
+ " }\n" +
+ " /* Creates a new instance of MalformedFilterConstraintSpecification */\n" +
+ " public MalformedFilterConstraintSpecification(String message) {\n" +
+ " super(message);\n" +
+ " }\n" +
"}\n",
"com/ost/util/report/exceptions/InvalidRowSizeException.java", // =================
- "package com.ost.util.report.exceptions;\n" +
- "public class InvalidRowSizeException extends RuntimeException {\n" +
- " /** Creates a new instance of InvalidRowSizeException */\n" +
- " public InvalidRowSizeException() {\n" +
- " super();\n" +
- " }\n" +
- " /* Creates a new instance of InvalidRowSizeException */\n" +
- " public InvalidRowSizeException(String message) {\n" +
- " super(message);\n" +
- " }\n" +
- "}\n"
+ "package com.ost.util.report.exceptions;\n" +
+ "public class InvalidRowSizeException extends RuntimeException {\n" +
+ " /** Creates a new instance of InvalidRowSizeException */\n" +
+ " public InvalidRowSizeException() {\n" +
+ " super();\n" +
+ " }\n" +
+ " /* Creates a new instance of InvalidRowSizeException */\n" +
+ " public InvalidRowSizeException(String message) {\n" +
+ " super(message);\n" +
+ " }\n" +
+ "}\n"
},
"");
}
@@ -3968,16 +3968,16 @@ public void test083() {
this.runConformTest(
new String[] {
"foo/X.java", // =================
- "package foo;\n" +
- "import foo.exceptions.*;\n" +
- "public class X {\n" +
- " class exceptions {}\n" +
- " exceptions E;\n" +
+ "package foo;\n" +
+ "import foo.exceptions.*;\n" +
+ "public class X {\n" +
+ " class exceptions {}\n" +
+ " exceptions E;\n" +
"}\n",
"foo/exceptions/Z.java", // =================
- "package foo.exceptions;\n" +
- "public class Z {\n" +
- "}\n"
+ "package foo.exceptions;\n" +
+ "public class Z {\n" +
+ "}\n"
},
"");
}
@@ -3986,28 +3986,28 @@ public void test084() {
this.runNegativeTest(
new String[] {
"foo/X.java", // =================
- "package foo;\n" +
- "import foo.exceptions.*;\n" +
- "public class X {\n" +
- " exceptions E;\n" +
+ "package foo;\n" +
+ "import foo.exceptions.*;\n" +
+ "public class X {\n" +
+ " exceptions E;\n" +
"}\n" +
"class exceptions {}\n",
"foo/exceptions/Z.java", // =================
- "package foo.exceptions;\n" +
- "public class Z {\n" +
- "}\n"
+ "package foo.exceptions;\n" +
+ "public class Z {\n" +
+ "}\n"
},
- "----------\n" +
- "1. WARNING in foo\\X.java (at line 2)\n" +
- " import foo.exceptions.*;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The import foo.exceptions is never used\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in foo\\exceptions\\Z.java (at line 1)\n" +
- " package foo.exceptions;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The package foo.exceptions collides with a type\n" +
+ "----------\n" +
+ "1. WARNING in foo\\X.java (at line 2)\n" +
+ " import foo.exceptions.*;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The import foo.exceptions is never used\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in foo\\exceptions\\Z.java (at line 1)\n" +
+ " package foo.exceptions;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The package foo.exceptions collides with a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239758 - variation
@@ -4015,30 +4015,30 @@ public void test085() {
this.runNegativeTest(
new String[] {
"p/X.java", // =================
- "package p;\n" +
- "public class X extends zork.Z {\n" +
+ "package p;\n" +
+ "public class X extends zork.Z {\n" +
"}\n",
"p/Y.java", // =================
- "package p;\n" +
- "import p.zork.Z;\n" +
- "public class Y {\n" +
+ "package p;\n" +
+ "import p.zork.Z;\n" +
+ "public class Y {\n" +
"}\n",
"p/zork/Z.java", // =================
- "package p.zork;\n" +
- "public class Z {\n" +
+ "package p.zork;\n" +
+ "public class Z {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in p\\X.java (at line 2)\n" +
- " public class X extends zork.Z {\n" +
- " ^^^^\n" +
- "zork cannot be resolved to a type\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in p\\Y.java (at line 2)\n" +
- " import p.zork.Z;\n" +
- " ^^^^^^^^\n" +
- "The import p.zork.Z is never used\n" +
+ "----------\n" +
+ "1. ERROR in p\\X.java (at line 2)\n" +
+ " public class X extends zork.Z {\n" +
+ " ^^^^\n" +
+ "zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in p\\Y.java (at line 2)\n" +
+ " import p.zork.Z;\n" +
+ " ^^^^^^^^\n" +
+ "The import p.zork.Z is never used\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239758 - variation
@@ -4046,29 +4046,29 @@ public void test086() {
this.runNegativeTest(
new String[] {
"p/X.java", // =================
- "package p;\n" +
- "public class X extends zork.Z {\n" +
+ "package p;\n" +
+ "public class X extends zork.Z {\n" +
"}\n",
"p/Y.java", // =================
- "package p;\n" +
- "import p.zork.*;\n" +
- "public class Y {\n" +
+ "package p;\n" +
+ "import p.zork.*;\n" +
+ "public class Y {\n" +
"}\n",
"p/zork/Z.java", // =================
- "package p.zork;\n" +
- "public class Z {\n" +
+ "package p.zork;\n" +
+ "public class Z {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in p\\X.java (at line 2)\n" +
- " public class X extends zork.Z {\n" +
- " ^^^^\n" +
- "zork cannot be resolved to a type\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in p\\Y.java (at line 2)\n" +
- " import p.zork.*;\n" +
- " ^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in p\\X.java (at line 2)\n" +
+ " public class X extends zork.Z {\n" +
+ " ^^^^\n" +
+ "zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in p\\Y.java (at line 2)\n" +
+ " import p.zork.*;\n" +
+ " ^^^^^^\n" +
"The import p.zork is never used\n" +
"----------\n");
}
@@ -4078,31 +4078,31 @@ public void test087() {
this.runNegativeTest(
new String[] {
"p/X.java", // =================
- "package p;\n" +
- "public class X extends zork.Z {\n" +
+ "package p;\n" +
+ "public class X extends zork.Z {\n" +
"}\n",
"p/Y.java", // =================
- "package p;\n" +
- "import static p.zork.Z.M;\n" +
- "public class Y {\n" +
+ "package p;\n" +
+ "import static p.zork.Z.M;\n" +
+ "public class Y {\n" +
"}\n",
"p/zork/Z.java", // =================
- "package p.zork;\n" +
- "public class Z {\n" +
+ "package p.zork;\n" +
+ "public class Z {\n" +
" public static class M {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in p\\X.java (at line 2)\n" +
- " public class X extends zork.Z {\n" +
- " ^^^^\n" +
- "zork cannot be resolved to a type\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in p\\Y.java (at line 2)\n" +
- " import static p.zork.Z.M;\n" +
- " ^^^^^^^^^^\n" +
- "The import p.zork.Z.M is never used\n" +
+ "----------\n" +
+ "1. ERROR in p\\X.java (at line 2)\n" +
+ " public class X extends zork.Z {\n" +
+ " ^^^^\n" +
+ "zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in p\\Y.java (at line 2)\n" +
+ " import static p.zork.Z.M;\n" +
+ " ^^^^^^^^^^\n" +
+ "The import p.zork.Z.M is never used\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239758 - variation
@@ -4111,31 +4111,31 @@ public void test088() {
this.runNegativeTest(
new String[] {
"p/X.java", // =================
- "package p;\n" +
- "public class X extends zork.Z {\n" +
+ "package p;\n" +
+ "public class X extends zork.Z {\n" +
"}\n",
"p/Y.java", // =================
- "package p;\n" +
- "import static p.zork.Z.*;\n" +
- "public class Y {\n" +
+ "package p;\n" +
+ "import static p.zork.Z.*;\n" +
+ "public class Y {\n" +
"}\n",
"p/zork/Z.java", // =================
- "package p.zork;\n" +
- "public class Z {\n" +
+ "package p.zork;\n" +
+ "public class Z {\n" +
" static class M {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in p\\X.java (at line 2)\n" +
- " public class X extends zork.Z {\n" +
- " ^^^^\n" +
- "zork cannot be resolved to a type\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in p\\Y.java (at line 2)\n" +
- " import static p.zork.Z.*;\n" +
- " ^^^^^^^^\n" +
- "The import p.zork.Z is never used\n" +
+ "----------\n" +
+ "1. ERROR in p\\X.java (at line 2)\n" +
+ " public class X extends zork.Z {\n" +
+ " ^^^^\n" +
+ "zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. WARNING in p\\Y.java (at line 2)\n" +
+ " import static p.zork.Z.*;\n" +
+ " ^^^^^^^^\n" +
+ "The import p.zork.Z is never used\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=245304
@@ -4146,24 +4146,24 @@ public void test089() {
this.runConformTest(
new String[] {
"com/foo/bar/baz/reporting/dom/ReportExceptionBase.java", // ================
- "package com.foo.bar.baz.reporting.dom;\n" +
- "public class ReportExceptionBase extends Exception {\n" +
- "}\n",
+ "package com.foo.bar.baz.reporting.dom;\n" +
+ "public class ReportExceptionBase extends Exception {\n" +
+ "}\n",
"com/foo/bar/baz/reporting/Report.java", // ================
- "package com.foo.bar.baz.reporting;\n" +
- "import com.foo.bar.baz.reporting.dom.ReportExceptionBase;\n" +
- "/**\n" +
- " * {@link dom.ReportDefs.ReportType.foo foo}\n" +
- " */\n" +
- "public abstract class Report {\n" +
+ "package com.foo.bar.baz.reporting;\n" +
+ "import com.foo.bar.baz.reporting.dom.ReportExceptionBase;\n" +
+ "/**\n" +
+ " * {@link dom.ReportDefs.ReportType.foo foo}\n" +
+ " */\n" +
+ "public abstract class Report {\n" +
"}\n",
"com/foo/bar/baz/reporting/Derived.java", // ================
- "package com.foo.bar.baz.reporting;\n" +
- "import com.foo.bar.baz.reporting.dom.ReportExceptionBase;\n" +
- "public class Derived {\n" +
- " public Derived() throws ReportExceptionBase {\n" +
- " throw new ReportExceptionBase();\n" +
- " }\n" +
+ "package com.foo.bar.baz.reporting;\n" +
+ "import com.foo.bar.baz.reporting.dom.ReportExceptionBase;\n" +
+ "public class Derived {\n" +
+ " public Derived() throws ReportExceptionBase {\n" +
+ " throw new ReportExceptionBase();\n" +
+ " }\n" +
"}\n",
},
"",
@@ -4179,23 +4179,23 @@ public void test090() {
this.runNegativeTest(
new String[] {
"X.java", // =================
- "public class X {\n" +
- "<U,V extends Runnable> void foo(Zork z) {} \n" +
- " void bar() {\n" +
- " foo(null);\n" +
- " } \n" +
+ "public class X {\n" +
+ "<U,V extends Runnable> void foo(Zork z) {} \n" +
+ " void bar() {\n" +
+ " foo(null);\n" +
+ " } \n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " <U,V extends Runnable> void foo(Zork z) {} \n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " foo(null);\n" +
- " ^^^\n" +
- "The method foo(Zork) from the type X refers to the missing type Zork\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " <U,V extends Runnable> void foo(Zork z) {} \n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " foo(null);\n" +
+ " ^^^\n" +
+ "The method foo(Zork) from the type X refers to the missing type Zork\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=252288
@@ -4204,598 +4204,598 @@ public void test091() throws Exception {
this.runNegativeTest(
new String[] {
"TypeUtils.java",
- "import java.util.Collection;\n" +
- "import java.util.Iterator;\n" +
- "\n" +
- "public final class TypeUtils {\n" +
- "\n" +
- " // personal\n" +
- "\n" +
- " private TypeUtils() {\n" +
- " }\n" +
- "\n" +
- " // class\n" +
- "\n" +
- " /**\n" +
- " * Returns true if a target type is exactly any one in a group of types.\n" +
- " * @param target Target type. Never null.\n" +
- " * @param types Group of types. If empty, returns false. Never null.\n" +
- " * @return True if the target is a valid type.\n" +
- " */\n" +
- " public static boolean isIdenticalToAny(Class<?> target, Collection<Class<?>> types) {\n" +
- " if (target == null) throw new IllegalArgumentException(\n" +
- " \"Target is null.\");\n" +
- "\n" +
- " if (types.contains(target)) return true;\n" +
- " return false;\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Returns true if a target type is the same or a subtype of (assignable to)\n" +
- " * a reference type. Convenience method for completeness. Forwards to\n" +
- " * Class.isAssignableFrom().\n" +
- " * @param target Target type. Never null.\n" +
- " * @param type Reference type. Never null.\n" +
- " * @return True if condition is met.\n" +
- " */\n" +
- " public static boolean isAssignableTo(Class<?> target, Class<?> type) {\n" +
- " return type.isAssignableFrom(target);\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Returns true if a target type is the same or a subtype of (assignable to)\n" +
- " * any one reference type.\n" +
- " * @param target Target type. Never null.\n" +
- " * @param types Reference types (Class). Never null. If empty returns false.\n" +
- " * @return True if condition is met.\n" +
- " */\n" +
- " public static boolean isAssignableToAny(Class<?> target,\n" +
- " Collection<Class<?>> types) {\n" +
- " if (types.isEmpty()) return false;\n" +
- "\n" +
- " for(Class<?> type : types) {\n" +
- " if (type.isAssignableFrom(target)) return true;\n" +
- " }\n" +
- " return false;\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Returns true if any one target type is the same or a subtype of\n" +
- " * (assignable to) a reference type.\n" +
- " * @param targets Target types (Class). Never null. If empty returns false.\n" +
- " * @param type Reference type. Never null.\n" +
- " * @return True if condition is met.\n" +
- " */\n" +
- " public static boolean areAnyAssignableTo(Collection<Class<?>> targets,\n" +
- " Class<?> type) {\n" +
- " if (targets.isEmpty()) return false;\n" +
- "\n" +
- " for(Class<?> target : targets) {\n" +
- " if (type.isAssignableFrom(target)) return true;\n" +
- " }\n" +
- " return false;\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Returns true if any one target type is the same or a subtype of\n" +
- " * (assignable to) any one reference type.\n" +
- " * @param targets Target types (Class). Never null. If empty returns false.\n" +
- " * @param types Reference types (Class). Never null. If empty returns false.\n" +
- " * @return True if condition is met.\n" +
- " */\n" +
- " public static boolean areAnyAssignableToAny(Collection<Class<?>> targets,\n" +
- " Collection<Class<?>> types) {\n" +
- " if (targets.isEmpty()) return false;\n" +
- " if (types.isEmpty()) return false;\n" +
- "\n" +
- " for(Class<?> target : targets) {\n" +
- " if (isAssignableToAny(target, types)) return true;\n" +
- " }\n" +
- " return false;\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Returns true if a target object\'s type is the same or a subtype of\n" +
- " * (assignable to) a reference type. Convenience method for completeness.\n" +
- " * Forwards to Class.isInstance().\n" +
- " * @param target Target object. Never null.\n" +
- " * @param type Reference type. Never null.\n" +
- " * @return True if condition is met.\n" +
- " */\n" +
- " public static boolean isInstanceOf(Object target, Class<?> type) {\n" +
- " return type.isInstance(target);\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Returns true if a target object\'s type is the same or a subtype of\n" +
- " * (assignable to) any one type.\n" +
- " * @param target Target object. Never null.\n" +
- " * @param types Reference types. Never null. If empty returns false.\n" +
- " * @return True if condition is met.\n" +
- " */\n" +
- " public static boolean isInstanceOfAny(Object target,\n" +
- " Collection<Class<?>> types) {\n" +
- " if (types.isEmpty()) return false;\n" +
- "\n" +
- " for (Class<?> type : types) {\n" +
- " if (type.isInstance(target)) return true;\n" +
- " }\n" +
- " return false;\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Returns true if any one target object\'s type is the same or a subtype of\n" +
- " * (assignable to) a reference type.\n" +
- " * @param targets Target objects. Never null. If empty returns false.\n" +
- " * @param type Reference type. Never null.\n" +
- " * @return True if condition is met.\n" +
- " */\n" +
- " public static boolean areAnyInstanceOf(Collection<Object> targets,\n" +
- " Class<?> type) {\n" +
- " if (targets.isEmpty()) return false;\n" +
- "\n" +
- " for(Object target : targets) {\n" +
- " if (type.isInstance(target)) return true;\n" +
- " }\n" +
- " return false;\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Returns true if all target object types are the same or a subtype of\n" +
- " * (assignable to) a reference type.\n" +
- " * @param targets Target objects. Never null. If empty returns\n" +
- " * false.\n" +
- " * @param type Reference type. Never null.\n" +
- " * @return True if condition is met.\n" +
- " */\n" +
- " public static boolean areAllInstanceOf(Collection<Object> targets,\n" +
- " Class<?> type) {\n" +
- " if (targets.isEmpty()) return false;\n" +
- "\n" +
- " for(Object target : targets) {\n" +
- " if (!type.isInstance(target)) return false;\n" +
- " }\n" +
- " return true;\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Returns true if no target object types are the same or a subtype of\n" +
- " * (assignable to) a reference type.\n" +
- " * @param targets Target objects. Never null. If empty returns\n" +
- " * false.\n" +
- " * @param type Reference type. Never null.\n" +
- " * @return True if condition is met.\n" +
- " */\n" +
- " public static boolean areNoneInstanceOf(Collection<Object> targets,\n" +
- " Class<?> type) {\n" +
- " if (targets.isEmpty()) return false;\n" +
- "\n" +
- " for(Object target : targets) {\n" +
- " if (type.isInstance(target)) return false;\n" +
- " }\n" +
- " return true;\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Returns true if any one target object\'s type is the same or a subtype of\n" +
- " * (assignable to) any one reference type.\n" +
- " * @param targets Target objects. Never null. If empty returns\n" +
- " * false.\n" +
- " * @param types Reference types. Never null. If empty returns false.\n" +
- " * @return True if condition is met.\n" +
- " */\n" +
- " public static boolean areAnyInstanceOfAny(Collection<Object> targets,\n" +
- " Collection<Class<?>> types) {\n" +
- " if (targets.isEmpty()) return false;\n" +
- " if (types.isEmpty()) return false;\n" +
- "\n" +
- " for(Object target : targets) {\n" +
- " if (isInstanceOfAny(target, types)) return true;\n" +
- " }\n" +
- " return false;\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Returns only those target objects whose type is identical to the included\n" +
- " * reference type.\n" +
- " * @param targets Group of target objects. If empty, returns empty. Never\n" +
- " * null.\n" +
- " * @param type Included reference type. Never null.\n" +
- " * @param retVal Return value object. The collection of valid target\n" +
- " * objects. Can be {@code targets}. Never null.\n" +
- " * @return Reference to retVal. Never null.\n" +
- " */\n" +
- " public static Collection<Object> includeIdenticalTo(Collection<Object> targets,\n" +
- " Class<?> type, Collection<Object> retVal) {\n" +
- " // save targets in retVal\n" +
- " if (targets != retVal) {\n" +
- " retVal.clear();\n" +
- " retVal.addAll(targets);\n" +
- " }\n" +
- "\n" +
- " // remove unwanted targets, by target\n" +
- " Iterator<?> objectI = retVal.iterator();\n" +
- " while (objectI.hasNext()) {\n" +
- " Object object = objectI.next();\n" +
- " if (!type.equals(object.getClass())) objectI.remove();\n" +
- " }\n" +
- "\n" +
- " return retVal;\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Returns only those target objects whose type is exactly one of the\n" +
- " * included reference types.\n" +
- " * @param targets Group of target objects. If empty, returns empty. Never\n" +
- " * null.\n" +
- " * @param types Group of included reference types. If empty, returns empty.\n" +
- " * If null, all types are included (all targets are returned).\n" +
- " * @param retVal Return value object. The collection of valid target\n" +
- " * objects. Can be {@code targets}. Never null.\n" +
- " * @return Reference to retVal. Never null.\n" +
- " */\n" +
- " public static Collection<Object> includeIdenticalToAny(\n" +
- " Collection<Object> targets,\n" +
- " Collection<Class<?>> types, Collection<Object> retVal) {\n" +
- " // save targets in retVal\n" +
- " if (targets != retVal) {\n" +
- " retVal.clear();\n" +
- " retVal.addAll(targets);\n" +
- " }\n" +
- "\n" +
- " if (types == null) return retVal;\n" +
- "\n" +
- " // remove unwanted targets, by target\n" +
- " Iterator<Object> objectI = retVal.iterator();\n" +
- " while (objectI.hasNext()) {\n" +
- " Object object = objectI.next();\n" +
- " if (!isIdenticalToAny(object.getClass(), types)) objectI.remove();\n" +
- " }\n" +
- "\n" +
- " return retVal;\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Returns only those target objects whose type is NOT identical to the\n" +
- " * excluded reference type.\n" +
- " * @param targets Group of target objects. If empty, returns empty. Never\n" +
- " * null.\n" +
- " * @param type The excluded reference type. Never null.\n" +
- " * @param retVal Return value object. The collection of valid target\n" +
- " * objects. Can be {@code targets}. Never null.\n" +
- " * @return Reference to retVal. Never null.\n" +
- " */\n" +
- " public static Collection<Object> excludeIdenticalTo(\n" +
- " Collection<Object> targets, Class<?> type,\n" +
- " Collection<Object> retVal) {\n" +
- " // save targets in retVal\n" +
- " if (targets != retVal) {\n" +
- " retVal.clear();\n" +
- " retVal.addAll(targets);\n" +
- " }\n" +
- "\n" +
- " // remove unwanted targets, by target\n" +
- " Iterator<Object> objectI = retVal.iterator();\n" +
- " while (objectI.hasNext()) {\n" +
- " Object object = objectI.next();\n" +
- " if (type.equals(object.getClass())) objectI.remove();\n" +
- " }\n" +
- "\n" +
- " return retVal;\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Returns only those target objects whose type is NOT exactly one of the\n" +
- " * excluded reference types.\n" +
- " * @param targets Group of target objects. If empty, returns empty. Never\n" +
- " * null.\n" +
- " * @param types Group of excluded reference types. If empty, returns empty.\n" +
- " * If null, no types are excluded (all targets are returned).\n" +
- " * @param retVal Return value object. The collection of valid target\n" +
- " * objects. Can be targets. Never null.\n" +
- " * @return Reference to retVal. Never null.\n" +
- " */\n" +
- " public static Collection<Object> excludeIdenticalToAny(\n" +
- " Collection<Object> targets, Collection<Class<?>> types,\n" +
- " Collection<Object> retVal) {\n" +
- " // save targets in retVal\n" +
- " if (targets != retVal) {\n" +
- " retVal.clear();\n" +
- " retVal.addAll(targets);\n" +
- " }\n" +
- "\n" +
- " if (types == null) return retVal;\n" +
- "\n" +
- " // remove unwanted targets, by target\n" +
- " Iterator<Object> objectI = retVal.iterator();\n" +
- " while (objectI.hasNext()) {\n" +
- " Object object = objectI.next();\n" +
- " if (isIdenticalToAny(object.getClass(), types)) objectI.remove();\n" +
- " }\n" +
- "\n" +
- " return retVal;\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Returns only those target objects whose type is assignable to (an\n" +
- " * instance of) the included reference type.\n" +
- " * @param targets Group of target objects. If empty, returns empty. Never\n" +
- " * null.\n" +
- " * @param type Included reference type. Never null.\n" +
- " * @param retVal Return value object. The collection of valid target objects\n" +
- " * (Object). Can be targets. Never null.\n" +
- " * @return Reference to retVal. Never null.\n" +
- " */\n" +
- " public static Collection<Object> includeAssignableTo(\n" +
- " Collection<Object> targets, Class<?> type, Collection<Object> retVal) {\n" +
- " // save targets in retVal\n" +
- " if (targets != retVal) {\n" +
- " retVal.clear();\n" +
- " retVal.addAll(targets);\n" +
- " }\n" +
- "\n" +
- " // remove unwanted targets, by target\n" +
- " Iterator<Object> objectI = retVal.iterator();\n" +
- " while (objectI.hasNext()) {\n" +
- " Object object = objectI.next();\n" +
- " if (!type.isInstance(object)) objectI.remove();\n" +
- " }\n" +
- "\n" +
- " return retVal;\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Returns only those target objects whose type is assignable to (an\n" +
- " * instance of) any one of the included reference types.\n" +
- " * @param targets Group of target objects. If empty, returns empty. Never\n" +
- " * null.\n" +
- " * @param types Group of included reference types. If empty, returns empty.\n" +
- " * If null, all types are included (all targets are returned).\n" +
- " * @param retVal Return value object. The collection of valid target\n" +
- " * objects. Can be targets. Never null.\n" +
- " * @return Reference to retVal. Never null.\n" +
- " */\n" +
- " public static Collection<Object> includeAssignableToAny(\n" +
- " Collection<Object> targets, Collection<Class<?>> types,\n" +
- " Collection<Object> retVal) {\n" +
- " // save targets in retVal\n" +
- " if (targets != retVal) {\n" +
- " retVal.clear();\n" +
- " retVal.addAll(targets);\n" +
- " }\n" +
- "\n" +
- " if (types == null) return retVal;\n" +
- "\n" +
- " // remove unwanted targets, by target\n" +
- " Iterator<Object> objectI = retVal.iterator();\n" +
- " while (objectI.hasNext()) {\n" +
- " Object object = objectI.next();\n" +
- " if (!isInstanceOfAny(object, types)) objectI.remove();\n" +
- " }\n" +
- "\n" +
- " return retVal;\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Returns only those target objects whose type is NOT assignable to (an\n" +
- " * instance of) the excluded reference type.\n" +
- " * @param targets Group of target objects. If empty, returns empty. Never\n" +
- " * null.\n" +
- " * @param type The excluded reference type. Never null.\n" +
- " * @param retVal Return value object. The collection of valid target\n" +
- " * objects. Never null.\n" +
- " * @return Reference to retVal. Never null.\n" +
- " */\n" +
- " public static Collection<Object> excludeAssignableTo(\n" +
- " Collection<Object> targets, Class<?> type, Collection<Object> retVal) {\n" +
- " // save targets in retVal\n" +
- " if (targets != retVal) {\n" +
- " retVal.clear();\n" +
- " retVal.addAll(targets);\n" +
- " }\n" +
- "\n" +
- " // remove unwanted targets, by target\n" +
- " Iterator<Object> objectI = retVal.iterator();\n" +
- " while (objectI.hasNext()) {\n" +
- " Object object = objectI.next();\n" +
- " if (type.isInstance(object)) objectI.remove();\n" +
- " }\n" +
- "\n" +
- " return retVal;\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Returns only those target objects whose type is NOT assignable to (an\n" +
- " * instance of) any one of the excluded reference types.\n" +
- " * @param targets Group of target objects. If empty, returns empty. Never\n" +
- " * null.\n" +
- " * @param types Group of excluded reference types. If empty, returns empty.\n" +
- " * If null, no types are excluded (all targets are returned).\n" +
- " * @param retVal Return value object. The collection of valid target\n" +
- " * objects. Never null.\n" +
- " * @return Reference to retVal. Never null.\n" +
- " */\n" +
- " public static Collection<Object> excludeAssignableToAny(\n" +
- " Collection<Object> targets, Collection<Class<?>> types,\n" +
- " Collection<Object> retVal) {\n" +
- " // save targets in retVal\n" +
- " if (targets != retVal) {\n" +
- " retVal.clear();\n" +
- " retVal.addAll(targets);\n" +
- " }\n" +
- "\n" +
- " if (types == null) return retVal;\n" +
- "\n" +
- " // remove unwanted targets, by target\n" +
- " Iterator<Object> objectI = retVal.iterator();\n" +
- " while (objectI.hasNext()) {\n" +
- " Object object = objectI.next();\n" +
- " if (isInstanceOfAny(object, types)) objectI.remove();\n" +
- " }\n" +
- "\n" +
- " return retVal;\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Returns the first target object whose type is assignable to (an instance\n" +
- " * of) the reference type.\n" +
- " * @param targets Group of target objects. If empty, returns null.\n" +
- " * Never null.\n" +
- " * @param type Reference type. Never null.\n" +
- " * @return The result (Object, assignable instance of type). Null if none.\n" +
- " */\n" +
- " public static <T extends Class<?>> T getFirstAssignableTo(\n" +
- " Collection<Object> targets, T type) {\n" +
- " for(Object target : targets) {\n" +
- " if (type.isInstance(target)) return target;\n" +
- " }\n" +
- "\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Returns the first target object whose type is exactly the specified type.\n" +
- " * @param targets Group of target objects (Object). If empty, returns null.\n" +
- " * Never null.\n" +
- " * @param type The type. Never null. objects (Object). Can be targets. Never\n" +
- " * null.\n" +
- " * @return The result (Object, exact instance of type). Null if none.\n" +
- " */\n" +
- " public static Object getFirstIdenticalTo(Collection targets, Class type) {\n" +
- " Iterator targetI = targets.iterator();\n" +
- " while (targetI.hasNext()) {\n" +
- " Object target = targetI.next();\n" +
- " if (type.equals(target.getClass())) return target;\n" +
- " }\n" +
- "\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Gets a target object T from a source object S in a group of objects, and\n" +
- " * returns the target objects in result group R. A group object is ignored\n" +
- " * if it is not a source type or, if it is a source type, its target object\n" +
- " * is not a target type.\n" +
- " * @param group Temp input group of shared exposed objects. If null, returns\n" +
- " * empty.\n" +
- " * @param sourceType Desired source object type. Never null.\n" +
- " * @param getter Gets a target object from a source object. Never null.\n" +
- " * @param targetType Desired target object type. Never null.\n" +
- " * @param retVal Temp output group of shared exposed target objects. Never\n" +
- " * null.\n" +
- " * @return Reference to retVal. Never null.\n" +
- " */\n" +
- " public static <S,T,TT extends T,R extends Collection<? super TT>> R getAll(\n" +
- " Collection<?> group, Class<? extends S> sourceType, Getter<S,T> getter,\n" +
- " Class<TT> targetType, R retVal) {\n" +
- " if (sourceType == null) throw new IllegalArgumentException(\n" +
- " \"Source type is null.\");\n" +
- " if (getter == null) throw new IllegalArgumentException(\n" +
- " \"Getter is null.\");\n" +
- " if (targetType == null) throw new IllegalArgumentException(\n" +
- " \"Target type is null.\");\n" +
- " if (retVal == null) throw new IllegalArgumentException(\n" +
- " \"Return value is null.\");\n" +
- " retVal.clear();\n" +
- "\n" +
- " if (group == null) return retVal;\n" +
- "\n" +
- " for (Object obj : group) {\n" +
- " if (!sourceType.isInstance(obj)) continue; // ignore\n" +
- " S source = (S) obj;\n" +
- " T target = getter.getFrom(source);\n" +
- " if (!targetType.isInstance(target)) continue; // ignore\n" +
- " retVal.add((TT) target);\n" +
- " }\n" +
- "\n" +
- " return retVal;\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Similar to getAll(Collection, Class, Getter, Class, Collection), but all\n" +
- " * target objects are returned, regardless of type, including nulls.\n" +
- " * @param group Temp input group of shared exposed objects. If null, returns\n" +
- " * empty.\n" +
- " * @param sourceType Desired source object type. Never null.\n" +
- " * @param getter Gets a target object from a source object. Never null.\n" +
- " * @param retVal Temp output group of shared exposed target objects. Never\n" +
- " * null.\n" +
- " * @return Reference to retVal. Never null.\n" +
- " */\n" +
- " public static <S,T,R extends Collection<? super T>> R getAll(\n" +
- " Collection<?> group, Class<? extends S> sourceType, Getter<S,T> getter,\n" +
- " R retVal) {\n" +
- " if (sourceType == null) throw new IllegalArgumentException(\n" +
- " \"Source type is null.\");\n" +
- " if (getter == null) throw new IllegalArgumentException(\n" +
- " \"Getter is null.\");\n" +
- " if (retVal == null) throw new IllegalArgumentException(\n" +
- " \"Return value is null.\");\n" +
- " retVal.clear();\n" +
- "\n" +
- " if (group == null) return retVal;\n" +
- "\n" +
- " for (Object obj : group) {\n" +
- " if (!sourceType.isInstance(obj)) continue; // ignore\n" +
- " S source = (S) obj;\n" +
- " T target = getter.getFrom(source);\n" +
- " retVal.add(target);\n" +
- " }\n" +
- "\n" +
- " return retVal;\n" +
- " }\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.Iterator;\n" +
+ "\n" +
+ "public final class TypeUtils {\n" +
+ "\n" +
+ " // personal\n" +
+ "\n" +
+ " private TypeUtils() {\n" +
+ " }\n" +
+ "\n" +
+ " // class\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns true if a target type is exactly any one in a group of types.\n" +
+ " * @param target Target type. Never null.\n" +
+ " * @param types Group of types. If empty, returns false. Never null.\n" +
+ " * @return True if the target is a valid type.\n" +
+ " */\n" +
+ " public static boolean isIdenticalToAny(Class<?> target, Collection<Class<?>> types) {\n" +
+ " if (target == null) throw new IllegalArgumentException(\n" +
+ " \"Target is null.\");\n" +
+ "\n" +
+ " if (types.contains(target)) return true;\n" +
+ " return false;\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns true if a target type is the same or a subtype of (assignable to)\n" +
+ " * a reference type. Convenience method for completeness. Forwards to\n" +
+ " * Class.isAssignableFrom().\n" +
+ " * @param target Target type. Never null.\n" +
+ " * @param type Reference type. Never null.\n" +
+ " * @return True if condition is met.\n" +
+ " */\n" +
+ " public static boolean isAssignableTo(Class<?> target, Class<?> type) {\n" +
+ " return type.isAssignableFrom(target);\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns true if a target type is the same or a subtype of (assignable to)\n" +
+ " * any one reference type.\n" +
+ " * @param target Target type. Never null.\n" +
+ " * @param types Reference types (Class). Never null. If empty returns false.\n" +
+ " * @return True if condition is met.\n" +
+ " */\n" +
+ " public static boolean isAssignableToAny(Class<?> target,\n" +
+ " Collection<Class<?>> types) {\n" +
+ " if (types.isEmpty()) return false;\n" +
+ "\n" +
+ " for(Class<?> type : types) {\n" +
+ " if (type.isAssignableFrom(target)) return true;\n" +
+ " }\n" +
+ " return false;\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns true if any one target type is the same or a subtype of\n" +
+ " * (assignable to) a reference type.\n" +
+ " * @param targets Target types (Class). Never null. If empty returns false.\n" +
+ " * @param type Reference type. Never null.\n" +
+ " * @return True if condition is met.\n" +
+ " */\n" +
+ " public static boolean areAnyAssignableTo(Collection<Class<?>> targets,\n" +
+ " Class<?> type) {\n" +
+ " if (targets.isEmpty()) return false;\n" +
+ "\n" +
+ " for(Class<?> target : targets) {\n" +
+ " if (type.isAssignableFrom(target)) return true;\n" +
+ " }\n" +
+ " return false;\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns true if any one target type is the same or a subtype of\n" +
+ " * (assignable to) any one reference type.\n" +
+ " * @param targets Target types (Class). Never null. If empty returns false.\n" +
+ " * @param types Reference types (Class). Never null. If empty returns false.\n" +
+ " * @return True if condition is met.\n" +
+ " */\n" +
+ " public static boolean areAnyAssignableToAny(Collection<Class<?>> targets,\n" +
+ " Collection<Class<?>> types) {\n" +
+ " if (targets.isEmpty()) return false;\n" +
+ " if (types.isEmpty()) return false;\n" +
+ "\n" +
+ " for(Class<?> target : targets) {\n" +
+ " if (isAssignableToAny(target, types)) return true;\n" +
+ " }\n" +
+ " return false;\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns true if a target object\'s type is the same or a subtype of\n" +
+ " * (assignable to) a reference type. Convenience method for completeness.\n" +
+ " * Forwards to Class.isInstance().\n" +
+ " * @param target Target object. Never null.\n" +
+ " * @param type Reference type. Never null.\n" +
+ " * @return True if condition is met.\n" +
+ " */\n" +
+ " public static boolean isInstanceOf(Object target, Class<?> type) {\n" +
+ " return type.isInstance(target);\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns true if a target object\'s type is the same or a subtype of\n" +
+ " * (assignable to) any one type.\n" +
+ " * @param target Target object. Never null.\n" +
+ " * @param types Reference types. Never null. If empty returns false.\n" +
+ " * @return True if condition is met.\n" +
+ " */\n" +
+ " public static boolean isInstanceOfAny(Object target,\n" +
+ " Collection<Class<?>> types) {\n" +
+ " if (types.isEmpty()) return false;\n" +
+ "\n" +
+ " for (Class<?> type : types) {\n" +
+ " if (type.isInstance(target)) return true;\n" +
+ " }\n" +
+ " return false;\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns true if any one target object\'s type is the same or a subtype of\n" +
+ " * (assignable to) a reference type.\n" +
+ " * @param targets Target objects. Never null. If empty returns false.\n" +
+ " * @param type Reference type. Never null.\n" +
+ " * @return True if condition is met.\n" +
+ " */\n" +
+ " public static boolean areAnyInstanceOf(Collection<Object> targets,\n" +
+ " Class<?> type) {\n" +
+ " if (targets.isEmpty()) return false;\n" +
+ "\n" +
+ " for(Object target : targets) {\n" +
+ " if (type.isInstance(target)) return true;\n" +
+ " }\n" +
+ " return false;\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns true if all target object types are the same or a subtype of\n" +
+ " * (assignable to) a reference type.\n" +
+ " * @param targets Target objects. Never null. If empty returns\n" +
+ " * false.\n" +
+ " * @param type Reference type. Never null.\n" +
+ " * @return True if condition is met.\n" +
+ " */\n" +
+ " public static boolean areAllInstanceOf(Collection<Object> targets,\n" +
+ " Class<?> type) {\n" +
+ " if (targets.isEmpty()) return false;\n" +
+ "\n" +
+ " for(Object target : targets) {\n" +
+ " if (!type.isInstance(target)) return false;\n" +
+ " }\n" +
+ " return true;\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns true if no target object types are the same or a subtype of\n" +
+ " * (assignable to) a reference type.\n" +
+ " * @param targets Target objects. Never null. If empty returns\n" +
+ " * false.\n" +
+ " * @param type Reference type. Never null.\n" +
+ " * @return True if condition is met.\n" +
+ " */\n" +
+ " public static boolean areNoneInstanceOf(Collection<Object> targets,\n" +
+ " Class<?> type) {\n" +
+ " if (targets.isEmpty()) return false;\n" +
+ "\n" +
+ " for(Object target : targets) {\n" +
+ " if (type.isInstance(target)) return false;\n" +
+ " }\n" +
+ " return true;\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns true if any one target object\'s type is the same or a subtype of\n" +
+ " * (assignable to) any one reference type.\n" +
+ " * @param targets Target objects. Never null. If empty returns\n" +
+ " * false.\n" +
+ " * @param types Reference types. Never null. If empty returns false.\n" +
+ " * @return True if condition is met.\n" +
+ " */\n" +
+ " public static boolean areAnyInstanceOfAny(Collection<Object> targets,\n" +
+ " Collection<Class<?>> types) {\n" +
+ " if (targets.isEmpty()) return false;\n" +
+ " if (types.isEmpty()) return false;\n" +
+ "\n" +
+ " for(Object target : targets) {\n" +
+ " if (isInstanceOfAny(target, types)) return true;\n" +
+ " }\n" +
+ " return false;\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns only those target objects whose type is identical to the included\n" +
+ " * reference type.\n" +
+ " * @param targets Group of target objects. If empty, returns empty. Never\n" +
+ " * null.\n" +
+ " * @param type Included reference type. Never null.\n" +
+ " * @param retVal Return value object. The collection of valid target\n" +
+ " * objects. Can be {@code targets}. Never null.\n" +
+ " * @return Reference to retVal. Never null.\n" +
+ " */\n" +
+ " public static Collection<Object> includeIdenticalTo(Collection<Object> targets,\n" +
+ " Class<?> type, Collection<Object> retVal) {\n" +
+ " // save targets in retVal\n" +
+ " if (targets != retVal) {\n" +
+ " retVal.clear();\n" +
+ " retVal.addAll(targets);\n" +
+ " }\n" +
+ "\n" +
+ " // remove unwanted targets, by target\n" +
+ " Iterator<?> objectI = retVal.iterator();\n" +
+ " while (objectI.hasNext()) {\n" +
+ " Object object = objectI.next();\n" +
+ " if (!type.equals(object.getClass())) objectI.remove();\n" +
+ " }\n" +
+ "\n" +
+ " return retVal;\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns only those target objects whose type is exactly one of the\n" +
+ " * included reference types.\n" +
+ " * @param targets Group of target objects. If empty, returns empty. Never\n" +
+ " * null.\n" +
+ " * @param types Group of included reference types. If empty, returns empty.\n" +
+ " * If null, all types are included (all targets are returned).\n" +
+ " * @param retVal Return value object. The collection of valid target\n" +
+ " * objects. Can be {@code targets}. Never null.\n" +
+ " * @return Reference to retVal. Never null.\n" +
+ " */\n" +
+ " public static Collection<Object> includeIdenticalToAny(\n" +
+ " Collection<Object> targets,\n" +
+ " Collection<Class<?>> types, Collection<Object> retVal) {\n" +
+ " // save targets in retVal\n" +
+ " if (targets != retVal) {\n" +
+ " retVal.clear();\n" +
+ " retVal.addAll(targets);\n" +
+ " }\n" +
+ "\n" +
+ " if (types == null) return retVal;\n" +
+ "\n" +
+ " // remove unwanted targets, by target\n" +
+ " Iterator<Object> objectI = retVal.iterator();\n" +
+ " while (objectI.hasNext()) {\n" +
+ " Object object = objectI.next();\n" +
+ " if (!isIdenticalToAny(object.getClass(), types)) objectI.remove();\n" +
+ " }\n" +
+ "\n" +
+ " return retVal;\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns only those target objects whose type is NOT identical to the\n" +
+ " * excluded reference type.\n" +
+ " * @param targets Group of target objects. If empty, returns empty. Never\n" +
+ " * null.\n" +
+ " * @param type The excluded reference type. Never null.\n" +
+ " * @param retVal Return value object. The collection of valid target\n" +
+ " * objects. Can be {@code targets}. Never null.\n" +
+ " * @return Reference to retVal. Never null.\n" +
+ " */\n" +
+ " public static Collection<Object> excludeIdenticalTo(\n" +
+ " Collection<Object> targets, Class<?> type,\n" +
+ " Collection<Object> retVal) {\n" +
+ " // save targets in retVal\n" +
+ " if (targets != retVal) {\n" +
+ " retVal.clear();\n" +
+ " retVal.addAll(targets);\n" +
+ " }\n" +
+ "\n" +
+ " // remove unwanted targets, by target\n" +
+ " Iterator<Object> objectI = retVal.iterator();\n" +
+ " while (objectI.hasNext()) {\n" +
+ " Object object = objectI.next();\n" +
+ " if (type.equals(object.getClass())) objectI.remove();\n" +
+ " }\n" +
+ "\n" +
+ " return retVal;\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns only those target objects whose type is NOT exactly one of the\n" +
+ " * excluded reference types.\n" +
+ " * @param targets Group of target objects. If empty, returns empty. Never\n" +
+ " * null.\n" +
+ " * @param types Group of excluded reference types. If empty, returns empty.\n" +
+ " * If null, no types are excluded (all targets are returned).\n" +
+ " * @param retVal Return value object. The collection of valid target\n" +
+ " * objects. Can be targets. Never null.\n" +
+ " * @return Reference to retVal. Never null.\n" +
+ " */\n" +
+ " public static Collection<Object> excludeIdenticalToAny(\n" +
+ " Collection<Object> targets, Collection<Class<?>> types,\n" +
+ " Collection<Object> retVal) {\n" +
+ " // save targets in retVal\n" +
+ " if (targets != retVal) {\n" +
+ " retVal.clear();\n" +
+ " retVal.addAll(targets);\n" +
+ " }\n" +
+ "\n" +
+ " if (types == null) return retVal;\n" +
+ "\n" +
+ " // remove unwanted targets, by target\n" +
+ " Iterator<Object> objectI = retVal.iterator();\n" +
+ " while (objectI.hasNext()) {\n" +
+ " Object object = objectI.next();\n" +
+ " if (isIdenticalToAny(object.getClass(), types)) objectI.remove();\n" +
+ " }\n" +
+ "\n" +
+ " return retVal;\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns only those target objects whose type is assignable to (an\n" +
+ " * instance of) the included reference type.\n" +
+ " * @param targets Group of target objects. If empty, returns empty. Never\n" +
+ " * null.\n" +
+ " * @param type Included reference type. Never null.\n" +
+ " * @param retVal Return value object. The collection of valid target objects\n" +
+ " * (Object). Can be targets. Never null.\n" +
+ " * @return Reference to retVal. Never null.\n" +
+ " */\n" +
+ " public static Collection<Object> includeAssignableTo(\n" +
+ " Collection<Object> targets, Class<?> type, Collection<Object> retVal) {\n" +
+ " // save targets in retVal\n" +
+ " if (targets != retVal) {\n" +
+ " retVal.clear();\n" +
+ " retVal.addAll(targets);\n" +
+ " }\n" +
+ "\n" +
+ " // remove unwanted targets, by target\n" +
+ " Iterator<Object> objectI = retVal.iterator();\n" +
+ " while (objectI.hasNext()) {\n" +
+ " Object object = objectI.next();\n" +
+ " if (!type.isInstance(object)) objectI.remove();\n" +
+ " }\n" +
+ "\n" +
+ " return retVal;\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns only those target objects whose type is assignable to (an\n" +
+ " * instance of) any one of the included reference types.\n" +
+ " * @param targets Group of target objects. If empty, returns empty. Never\n" +
+ " * null.\n" +
+ " * @param types Group of included reference types. If empty, returns empty.\n" +
+ " * If null, all types are included (all targets are returned).\n" +
+ " * @param retVal Return value object. The collection of valid target\n" +
+ " * objects. Can be targets. Never null.\n" +
+ " * @return Reference to retVal. Never null.\n" +
+ " */\n" +
+ " public static Collection<Object> includeAssignableToAny(\n" +
+ " Collection<Object> targets, Collection<Class<?>> types,\n" +
+ " Collection<Object> retVal) {\n" +
+ " // save targets in retVal\n" +
+ " if (targets != retVal) {\n" +
+ " retVal.clear();\n" +
+ " retVal.addAll(targets);\n" +
+ " }\n" +
+ "\n" +
+ " if (types == null) return retVal;\n" +
+ "\n" +
+ " // remove unwanted targets, by target\n" +
+ " Iterator<Object> objectI = retVal.iterator();\n" +
+ " while (objectI.hasNext()) {\n" +
+ " Object object = objectI.next();\n" +
+ " if (!isInstanceOfAny(object, types)) objectI.remove();\n" +
+ " }\n" +
+ "\n" +
+ " return retVal;\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns only those target objects whose type is NOT assignable to (an\n" +
+ " * instance of) the excluded reference type.\n" +
+ " * @param targets Group of target objects. If empty, returns empty. Never\n" +
+ " * null.\n" +
+ " * @param type The excluded reference type. Never null.\n" +
+ " * @param retVal Return value object. The collection of valid target\n" +
+ " * objects. Never null.\n" +
+ " * @return Reference to retVal. Never null.\n" +
+ " */\n" +
+ " public static Collection<Object> excludeAssignableTo(\n" +
+ " Collection<Object> targets, Class<?> type, Collection<Object> retVal) {\n" +
+ " // save targets in retVal\n" +
+ " if (targets != retVal) {\n" +
+ " retVal.clear();\n" +
+ " retVal.addAll(targets);\n" +
+ " }\n" +
+ "\n" +
+ " // remove unwanted targets, by target\n" +
+ " Iterator<Object> objectI = retVal.iterator();\n" +
+ " while (objectI.hasNext()) {\n" +
+ " Object object = objectI.next();\n" +
+ " if (type.isInstance(object)) objectI.remove();\n" +
+ " }\n" +
+ "\n" +
+ " return retVal;\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns only those target objects whose type is NOT assignable to (an\n" +
+ " * instance of) any one of the excluded reference types.\n" +
+ " * @param targets Group of target objects. If empty, returns empty. Never\n" +
+ " * null.\n" +
+ " * @param types Group of excluded reference types. If empty, returns empty.\n" +
+ " * If null, no types are excluded (all targets are returned).\n" +
+ " * @param retVal Return value object. The collection of valid target\n" +
+ " * objects. Never null.\n" +
+ " * @return Reference to retVal. Never null.\n" +
+ " */\n" +
+ " public static Collection<Object> excludeAssignableToAny(\n" +
+ " Collection<Object> targets, Collection<Class<?>> types,\n" +
+ " Collection<Object> retVal) {\n" +
+ " // save targets in retVal\n" +
+ " if (targets != retVal) {\n" +
+ " retVal.clear();\n" +
+ " retVal.addAll(targets);\n" +
+ " }\n" +
+ "\n" +
+ " if (types == null) return retVal;\n" +
+ "\n" +
+ " // remove unwanted targets, by target\n" +
+ " Iterator<Object> objectI = retVal.iterator();\n" +
+ " while (objectI.hasNext()) {\n" +
+ " Object object = objectI.next();\n" +
+ " if (isInstanceOfAny(object, types)) objectI.remove();\n" +
+ " }\n" +
+ "\n" +
+ " return retVal;\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns the first target object whose type is assignable to (an instance\n" +
+ " * of) the reference type.\n" +
+ " * @param targets Group of target objects. If empty, returns null.\n" +
+ " * Never null.\n" +
+ " * @param type Reference type. Never null.\n" +
+ " * @return The result (Object, assignable instance of type). Null if none.\n" +
+ " */\n" +
+ " public static <T extends Class<?>> T getFirstAssignableTo(\n" +
+ " Collection<Object> targets, T type) {\n" +
+ " for(Object target : targets) {\n" +
+ " if (type.isInstance(target)) return target;\n" +
+ " }\n" +
+ "\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Returns the first target object whose type is exactly the specified type.\n" +
+ " * @param targets Group of target objects (Object). If empty, returns null.\n" +
+ " * Never null.\n" +
+ " * @param type The type. Never null. objects (Object). Can be targets. Never\n" +
+ " * null.\n" +
+ " * @return The result (Object, exact instance of type). Null if none.\n" +
+ " */\n" +
+ " public static Object getFirstIdenticalTo(Collection targets, Class type) {\n" +
+ " Iterator targetI = targets.iterator();\n" +
+ " while (targetI.hasNext()) {\n" +
+ " Object target = targetI.next();\n" +
+ " if (type.equals(target.getClass())) return target;\n" +
+ " }\n" +
+ "\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Gets a target object T from a source object S in a group of objects, and\n" +
+ " * returns the target objects in result group R. A group object is ignored\n" +
+ " * if it is not a source type or, if it is a source type, its target object\n" +
+ " * is not a target type.\n" +
+ " * @param group Temp input group of shared exposed objects. If null, returns\n" +
+ " * empty.\n" +
+ " * @param sourceType Desired source object type. Never null.\n" +
+ " * @param getter Gets a target object from a source object. Never null.\n" +
+ " * @param targetType Desired target object type. Never null.\n" +
+ " * @param retVal Temp output group of shared exposed target objects. Never\n" +
+ " * null.\n" +
+ " * @return Reference to retVal. Never null.\n" +
+ " */\n" +
+ " public static <S,T,TT extends T,R extends Collection<? super TT>> R getAll(\n" +
+ " Collection<?> group, Class<? extends S> sourceType, Getter<S,T> getter,\n" +
+ " Class<TT> targetType, R retVal) {\n" +
+ " if (sourceType == null) throw new IllegalArgumentException(\n" +
+ " \"Source type is null.\");\n" +
+ " if (getter == null) throw new IllegalArgumentException(\n" +
+ " \"Getter is null.\");\n" +
+ " if (targetType == null) throw new IllegalArgumentException(\n" +
+ " \"Target type is null.\");\n" +
+ " if (retVal == null) throw new IllegalArgumentException(\n" +
+ " \"Return value is null.\");\n" +
+ " retVal.clear();\n" +
+ "\n" +
+ " if (group == null) return retVal;\n" +
+ "\n" +
+ " for (Object obj : group) {\n" +
+ " if (!sourceType.isInstance(obj)) continue; // ignore\n" +
+ " S source = (S) obj;\n" +
+ " T target = getter.getFrom(source);\n" +
+ " if (!targetType.isInstance(target)) continue; // ignore\n" +
+ " retVal.add((TT) target);\n" +
+ " }\n" +
+ "\n" +
+ " return retVal;\n" +
+ " }\n" +
+ "\n" +
+ " /**\n" +
+ " * Similar to getAll(Collection, Class, Getter, Class, Collection), but all\n" +
+ " * target objects are returned, regardless of type, including nulls.\n" +
+ " * @param group Temp input group of shared exposed objects. If null, returns\n" +
+ " * empty.\n" +
+ " * @param sourceType Desired source object type. Never null.\n" +
+ " * @param getter Gets a target object from a source object. Never null.\n" +
+ " * @param retVal Temp output group of shared exposed target objects. Never\n" +
+ " * null.\n" +
+ " * @return Reference to retVal. Never null.\n" +
+ " */\n" +
+ " public static <S,T,R extends Collection<? super T>> R getAll(\n" +
+ " Collection<?> group, Class<? extends S> sourceType, Getter<S,T> getter,\n" +
+ " R retVal) {\n" +
+ " if (sourceType == null) throw new IllegalArgumentException(\n" +
+ " \"Source type is null.\");\n" +
+ " if (getter == null) throw new IllegalArgumentException(\n" +
+ " \"Getter is null.\");\n" +
+ " if (retVal == null) throw new IllegalArgumentException(\n" +
+ " \"Return value is null.\");\n" +
+ " retVal.clear();\n" +
+ "\n" +
+ " if (group == null) return retVal;\n" +
+ "\n" +
+ " for (Object obj : group) {\n" +
+ " if (!sourceType.isInstance(obj)) continue; // ignore\n" +
+ " S source = (S) obj;\n" +
+ " T target = getter.getFrom(source);\n" +
+ " retVal.add(target);\n" +
+ " }\n" +
+ "\n" +
+ " return retVal;\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in TypeUtils.java (at line 441)\n" +
- " public static <T extends Class<?>> T getFirstAssignableTo(\n" +
- " ^^^^^\n" +
- "The type parameter T should not be bounded by the final type Class<?>. Final types cannot be further extended\n" +
- "----------\n" +
- "2. ERROR in TypeUtils.java (at line 444)\n" +
- " if (type.isInstance(target)) return target;\n" +
- " ^^^^^^\n" +
- "Type mismatch: cannot convert from Object to T\n" +
- "----------\n" +
- "3. WARNING in TypeUtils.java (at line 458)\n" +
- " public static Object getFirstIdenticalTo(Collection targets, Class type) {\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in TypeUtils.java (at line 458)\n" +
- " public static Object getFirstIdenticalTo(Collection targets, Class type) {\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in TypeUtils.java (at line 459)\n" +
- " Iterator targetI = targets.iterator();\n" +
- " ^^^^^^^^\n" +
- "Iterator is a raw type. References to generic type Iterator<E> should be parameterized\n" +
- "----------\n" +
- "6. ERROR in TypeUtils.java (at line 483)\n" +
- " Collection<?> group, Class<? extends S> sourceType, Getter<S,T> getter,\n" +
- " ^^^^^^\n" +
- "Getter cannot be resolved to a type\n" +
- "----------\n" +
- "7. WARNING in TypeUtils.java (at line 499)\n" +
- " S source = (S) obj;\n" +
- " ^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to S\n" +
- "----------\n" +
- "8. WARNING in TypeUtils.java (at line 502)\n" +
- " retVal.add((TT) target);\n" +
- " ^^^^^^^^^^^\n" +
- "Type safety: Unchecked cast from T to TT\n" +
- "----------\n" +
- "9. ERROR in TypeUtils.java (at line 520)\n" +
- " Collection<?> group, Class<? extends S> sourceType, Getter<S,T> getter,\n" +
- " ^^^^^^\n" +
- "Getter cannot be resolved to a type\n" +
- "----------\n" +
- "10. WARNING in TypeUtils.java (at line 534)\n" +
- " S source = (S) obj;\n" +
- " ^^^^^^^\n" +
- "Type safety: Unchecked cast from Object to S\n" +
+ "----------\n" +
+ "1. WARNING in TypeUtils.java (at line 441)\n" +
+ " public static <T extends Class<?>> T getFirstAssignableTo(\n" +
+ " ^^^^^\n" +
+ "The type parameter T should not be bounded by the final type Class<?>. Final types cannot be further extended\n" +
+ "----------\n" +
+ "2. ERROR in TypeUtils.java (at line 444)\n" +
+ " if (type.isInstance(target)) return target;\n" +
+ " ^^^^^^\n" +
+ "Type mismatch: cannot convert from Object to T\n" +
+ "----------\n" +
+ "3. WARNING in TypeUtils.java (at line 458)\n" +
+ " public static Object getFirstIdenticalTo(Collection targets, Class type) {\n" +
+ " ^^^^^^^^^^\n" +
+ "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in TypeUtils.java (at line 458)\n" +
+ " public static Object getFirstIdenticalTo(Collection targets, Class type) {\n" +
+ " ^^^^^\n" +
+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in TypeUtils.java (at line 459)\n" +
+ " Iterator targetI = targets.iterator();\n" +
+ " ^^^^^^^^\n" +
+ "Iterator is a raw type. References to generic type Iterator<E> should be parameterized\n" +
+ "----------\n" +
+ "6. ERROR in TypeUtils.java (at line 483)\n" +
+ " Collection<?> group, Class<? extends S> sourceType, Getter<S,T> getter,\n" +
+ " ^^^^^^\n" +
+ "Getter cannot be resolved to a type\n" +
+ "----------\n" +
+ "7. WARNING in TypeUtils.java (at line 499)\n" +
+ " S source = (S) obj;\n" +
+ " ^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to S\n" +
+ "----------\n" +
+ "8. WARNING in TypeUtils.java (at line 502)\n" +
+ " retVal.add((TT) target);\n" +
+ " ^^^^^^^^^^^\n" +
+ "Type safety: Unchecked cast from T to TT\n" +
+ "----------\n" +
+ "9. ERROR in TypeUtils.java (at line 520)\n" +
+ " Collection<?> group, Class<? extends S> sourceType, Getter<S,T> getter,\n" +
+ " ^^^^^^\n" +
+ "Getter cannot be resolved to a type\n" +
+ "----------\n" +
+ "10. WARNING in TypeUtils.java (at line 534)\n" +
+ " S source = (S) obj;\n" +
+ " ^^^^^^^\n" +
+ "Type safety: Unchecked cast from Object to S\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=250297
@@ -4803,16 +4803,16 @@ public void test092() {
this.runNegativeTest(
new String[] {
"p1/p2/X.java", // =================
- "package p1.p2;\n" +
- "public class X {\n" +
- " public p2.p3.Z z() {return null;}\n" +
+ "package p1.p2;\n" +
+ "public class X {\n" +
+ " public p2.p3.Z z() {return null;}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in p1\\p2\\X.java (at line 3)\n" +
- " public p2.p3.Z z() {return null;}\n" +
- " ^^\n" +
- "p2 cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in p1\\p2\\X.java (at line 3)\n" +
+ " public p2.p3.Z z() {return null;}\n" +
+ " ^^\n" +
+ "p2 cannot be resolved to a type\n" +
"----------\n",
null,
false,
@@ -4826,14 +4826,14 @@ public void test092() {
runner.testFiles =
new String[] {
"a/b/A.java", // =================
- "package a.b;\n" +
- "public class A {\n" +
- " p1.p2.X x;\n" +
- " void test() { x.z(); }\n" +
- " void foo(p2.p3.Z z) {}\n" +
+ "package a.b;\n" +
+ "public class A {\n" +
+ " p1.p2.X x;\n" +
+ " void test() { x.z(); }\n" +
+ " void foo(p2.p3.Z z) {}\n" +
"}\n",
"p2/p3/Z.java", // =================
- "package p2.p3;\n" +
+ "package p2.p3;\n" +
"public class Z {}\n"
};
runner.shouldFlushOutputDirectory = false;
@@ -4841,11 +4841,11 @@ public void test092() {
runner.testFiles =
new String[] {
"a/b/A.java", // =================
- "package a.b;\n" +
- "public class A {\n" +
- " p1.p2.X x;\n" +
- " void test() { x.z(); }\n" +
- " void foo(p2.p3.Z z) {}\n" +
+ "package a.b;\n" +
+ "public class A {\n" +
+ " p1.p2.X x;\n" +
+ " void test() { x.z(); }\n" +
+ " void foo(p2.p3.Z z) {}\n" +
"}\n"
};
runner.runConformTest();
@@ -4856,21 +4856,21 @@ public void test093() {
this.runNegativeTest(
new String[] {
"X.java", // =================
- "import java.util.List;\n" +
- "\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " List<? extends Zork> zlist = null;\n" +
- " bar(zlist.get(0));\n" +
- " }\n" +
- " <T> T bar(T t) { return t; }\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class X {\n" +
+ " void foo() {\n" +
+ " List<? extends Zork> zlist = null;\n" +
+ " bar(zlist.get(0));\n" +
+ " }\n" +
+ " <T> T bar(T t) { return t; }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " List<? extends Zork> zlist = null;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " List<? extends Zork> zlist = null;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=250297 - variation
@@ -4879,25 +4879,25 @@ public void test094() {
this.runNegativeTest(
new String[] {
"X.java", // =================
- "import java.util.List;\n" +
- "\n" +
- "public class X {\n" +
- " void foo(boolean b, Runnable r) {\n" +
- " bar(r);\n" +
- " }\n" +
- " <T> T bar(Zork z) { return z; }\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class X {\n" +
+ " void foo(boolean b, Runnable r) {\n" +
+ " bar(r);\n" +
+ " }\n" +
+ " <T> T bar(Zork z) { return z; }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " bar(r);\n" +
- " ^^^\n" +
- "The method bar(Zork) from the type X refers to the missing type Zork\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " <T> T bar(Zork z) { return z; }\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " bar(r);\n" +
+ " ^^^\n" +
+ "The method bar(Zork) from the type X refers to the missing type Zork\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " <T> T bar(Zork z) { return z; }\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=250297 - variation
@@ -4906,30 +4906,30 @@ public void test095() {
this.runNegativeTest(
new String[] {
"X.java", // =================
- "import java.util.List;\n" +
- "\n" +
- "public class X {\n" +
- " void foo(boolean b, Runnable r) {\n" +
- " bar(r);\n" +
- " }\n" +
- " <T> bar(Zork z) { return z; }\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class X {\n" +
+ " void foo(boolean b, Runnable r) {\n" +
+ " bar(r);\n" +
+ " }\n" +
+ " <T> bar(Zork z) { return z; }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " bar(r);\n" +
- " ^^^\n" +
- "The method bar(Runnable) is undefined for the type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " <T> bar(Zork z) { return z; }\n" +
- " ^^^^^^^^^^^\n" +
- "Return type for the method is missing\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " <T> bar(Zork z) { return z; }\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " bar(r);\n" +
+ " ^^^\n" +
+ "The method bar(Runnable) is undefined for the type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " <T> bar(Zork z) { return z; }\n" +
+ " ^^^^^^^^^^^\n" +
+ "Return type for the method is missing\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " <T> bar(Zork z) { return z; }\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=257384
@@ -4937,42 +4937,42 @@ public void test096() {
this.runNegativeTest(
new String[] {
"p2/B.java", // =================
- "package p2;\n" +
- "import p1.A;\n" +
- "public abstract class B {\n" +
- " public static A foo() {}\n" +
+ "package p2;\n" +
+ "import p1.A;\n" +
+ "public abstract class B {\n" +
+ " public static A foo() {}\n" +
"}\n",
"p3/C.java", // =================
- "package p3;\n" +
- "import p1.A;\n" +
- "public abstract class C extends p2.B {\n" +
- " public static A foo() {}\n" +
+ "package p3;\n" +
+ "import p1.A;\n" +
+ "public abstract class C extends p2.B {\n" +
+ " public static A foo() {}\n" +
"}\n",
"p/D.java", // =================
- "package p;\n" +
+ "package p;\n" +
"public class D extends p3.C {}"
},
- "----------\n" +
- "1. ERROR in p2\\B.java (at line 2)\n" +
- " import p1.A;\n" +
- " ^^\n" +
- "The import p1 cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in p2\\B.java (at line 4)\n" +
- " public static A foo() {}\n" +
- " ^\n" +
- "A cannot be resolved to a type\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in p3\\C.java (at line 2)\n" +
- " import p1.A;\n" +
- " ^^\n" +
- "The import p1 cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in p3\\C.java (at line 4)\n" +
- " public static A foo() {}\n" +
- " ^\n" +
- "A cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in p2\\B.java (at line 2)\n" +
+ " import p1.A;\n" +
+ " ^^\n" +
+ "The import p1 cannot be resolved\n" +
+ "----------\n" +
+ "2. ERROR in p2\\B.java (at line 4)\n" +
+ " public static A foo() {}\n" +
+ " ^\n" +
+ "A cannot be resolved to a type\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in p3\\C.java (at line 2)\n" +
+ " import p1.A;\n" +
+ " ^^\n" +
+ "The import p1 cannot be resolved\n" +
+ "----------\n" +
+ "2. ERROR in p3\\C.java (at line 4)\n" +
+ " public static A foo() {}\n" +
+ " ^\n" +
+ "A cannot be resolved to a type\n" +
"----------\n"
);
}
@@ -4982,22 +4982,22 @@ public void test097() {
this.runNegativeTest(
new String[] {
"X.java", // =================
- "public class X {\n" +
- "\n" +
- " public static interface InnerInterface<TheTypeMirror, TheDeclaredType extends TheTypeMirror, TheClassType extends TheDeclaredType, TheInterfaceType extends TheDeclaredType, ThePrimitiveType extends TheTypeMirror, TheArrayType extends TheTypeMirror, TheTypeVariable extends TheTypeMirror, TheWildcardType extends TheTypeMirror, TheFieldDeclaration, TheTypeParameterDeclaration, TheTypeDeclaration, TheClassDeclaration extends TheTypeDeclaration> {\n" +
- " }\n" +
- " protected <TheTypeMirror, TheDeclaredType extends TheTypeMirror, TheClassType extends TheDeclaredType, TheInterfaceType extends TheDeclaredType, ThePrimitiveType extends TheTypeMirror, TheArrayType extends TheTypeMirror, TheTypeVariable extends TheTypeMirror, TheWildcardType extends TheTypeMirror, TheFieldDeclaration, TheTypeParameterDeclaration, TheTypeDeclaration, TheClassDeclaration extends TheTypeDeclaration, Env extends InnerInterface<TheTypeMirror, TheDeclaredType, TheClassType, TheInterfaceType, ThePrimitiveType, TheArrayType, TheTypeVariable, TheWildcardType, TheFieldDeclaration, TheTypeParameterDeclaration, TheTypeDeclaration, TheClassDeclaration>, ParamType extends TheTypeMirror> void testMethod(\n" +
- " TheFieldDeclaratation fieldDeclaratation, Env\n" +
- " environment) {\n" +
- "\n" +
- " }\n" +
+ "public class X {\n" +
+ "\n" +
+ " public static interface InnerInterface<TheTypeMirror, TheDeclaredType extends TheTypeMirror, TheClassType extends TheDeclaredType, TheInterfaceType extends TheDeclaredType, ThePrimitiveType extends TheTypeMirror, TheArrayType extends TheTypeMirror, TheTypeVariable extends TheTypeMirror, TheWildcardType extends TheTypeMirror, TheFieldDeclaration, TheTypeParameterDeclaration, TheTypeDeclaration, TheClassDeclaration extends TheTypeDeclaration> {\n" +
+ " }\n" +
+ " protected <TheTypeMirror, TheDeclaredType extends TheTypeMirror, TheClassType extends TheDeclaredType, TheInterfaceType extends TheDeclaredType, ThePrimitiveType extends TheTypeMirror, TheArrayType extends TheTypeMirror, TheTypeVariable extends TheTypeMirror, TheWildcardType extends TheTypeMirror, TheFieldDeclaration, TheTypeParameterDeclaration, TheTypeDeclaration, TheClassDeclaration extends TheTypeDeclaration, Env extends InnerInterface<TheTypeMirror, TheDeclaredType, TheClassType, TheInterfaceType, ThePrimitiveType, TheArrayType, TheTypeVariable, TheWildcardType, TheFieldDeclaration, TheTypeParameterDeclaration, TheTypeDeclaration, TheClassDeclaration>, ParamType extends TheTypeMirror> void testMethod(\n" +
+ " TheFieldDeclaratation fieldDeclaratation, Env\n" +
+ " environment) {\n" +
+ "\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " TheFieldDeclaratation fieldDeclaratation, Env\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "TheFieldDeclaratation cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " TheFieldDeclaratation fieldDeclaratation, Env\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "TheFieldDeclaratation cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=296660
@@ -5009,112 +5009,112 @@ public void test098() {
"public class X {\n" +
" private class A {\n" +
" public void foo(int a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(float a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(boolean a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(Integer a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
- " }\n" +
+ " }\n" +
" private class B extends A {\n" +
" public void foo(int a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(float a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(double a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(char a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" }\n" +
"}\n"
};
runner.expectedCompilerLog = isMinimumCompliant(ClassFileConstants.JDK11) ?
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public void foo(int a) {\n" +
- " ^^^^^^^^^^\n" +
- "The method foo(int) from the type X.A is never used locally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " public void foo(float a) {\n" +
- " ^^^^^^^^^^^^\n" +
- "The method foo(float) from the type X.A is never used locally\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 9)\n" +
- " public void foo(boolean a) {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method foo(boolean) from the type X.A is never used locally\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 12)\n" +
- " public void foo(Integer a) {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method foo(Integer) from the type X.A is never used locally\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 16)\n" +
- " private class B extends A {\n" +
- " ^\n" +
- "The type X.B is never used locally\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 23)\n" +
- " public void foo(double a) {\n" +
- " ^^^^^^^^^^^^^\n" +
- "The method foo(double) from the type X.B is never used locally\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 26)\n" +
- " public void foo(char a) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method foo(char) from the type X.B is never used locally\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public void foo(int a) {\n" +
+ " ^^^^^^^^^^\n" +
+ "The method foo(int) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " public void foo(float a) {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The method foo(float) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 9)\n" +
+ " public void foo(boolean a) {\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The method foo(boolean) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 12)\n" +
+ " public void foo(Integer a) {\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The method foo(Integer) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 16)\n" +
+ " private class B extends A {\n" +
+ " ^\n" +
+ "The type X.B is never used locally\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 23)\n" +
+ " public void foo(double a) {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The method foo(double) from the type X.B is never used locally\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 26)\n" +
+ " public void foo(char a) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method foo(char) from the type X.B is never used locally\n" +
"----------\n"
:
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public void foo(int a) {\n" +
- " ^^^^^^^^^^\n" +
- "The method foo(int) from the type X.A is never used locally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " public void foo(float a) {\n" +
- " ^^^^^^^^^^^^\n" +
- "The method foo(float) from the type X.A is never used locally\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 9)\n" +
- " public void foo(boolean a) {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method foo(boolean) from the type X.A is never used locally\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 12)\n" +
- " public void foo(Integer a) {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method foo(Integer) from the type X.A is never used locally\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 16)\n" +
- " private class B extends A {\n" +
- " ^\n" +
- "The type X.B is never used locally\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 16)\n" +
- " private class B extends A {\n" +
- " ^\n" +
- "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 23)\n" +
- " public void foo(double a) {\n" +
- " ^^^^^^^^^^^^^\n" +
- "The method foo(double) from the type X.B is never used locally\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 26)\n" +
- " public void foo(char a) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method foo(char) from the type X.B is never used locally\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public void foo(int a) {\n" +
+ " ^^^^^^^^^^\n" +
+ "The method foo(int) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " public void foo(float a) {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The method foo(float) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 9)\n" +
+ " public void foo(boolean a) {\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The method foo(boolean) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 12)\n" +
+ " public void foo(Integer a) {\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The method foo(Integer) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 16)\n" +
+ " private class B extends A {\n" +
+ " ^\n" +
+ "The type X.B is never used locally\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 16)\n" +
+ " private class B extends A {\n" +
+ " ^\n" +
+ "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 23)\n" +
+ " public void foo(double a) {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The method foo(double) from the type X.B is never used locally\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 26)\n" +
+ " public void foo(char a) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method foo(char) from the type X.B is never used locally\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings;
@@ -5129,101 +5129,101 @@ public void test099() {
"public class X {\n" +
" private class A {\n" +
" public void foo(int a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(float a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(boolean a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(Integer a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
- " }\n" +
+ " }\n" +
" private class B extends A {\n" +
" public void foo(int a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(float a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(double a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(char a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" }\n" +
" public class C extends B {\n" +
" public void foo(int a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(double a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(boolean a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(byte a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" }\n" +
"}\n"
};
runner.expectedCompilerLog = isMinimumCompliant(ClassFileConstants.JDK11) ?
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public void foo(int a) {\n" +
- " ^^^^^^^^^^\n" +
- "The method foo(int) from the type X.A is never used locally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " public void foo(float a) {\n" +
- " ^^^^^^^^^^^^\n" +
- "The method foo(float) from the type X.A is never used locally\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 9)\n" +
- " public void foo(boolean a) {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method foo(boolean) from the type X.A is never used locally\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 23)\n" +
- " public void foo(double a) {\n" +
- " ^^^^^^^^^^^^^\n" +
- "The method foo(double) from the type X.B is never used locally\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public void foo(int a) {\n" +
+ " ^^^^^^^^^^\n" +
+ "The method foo(int) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " public void foo(float a) {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The method foo(float) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 9)\n" +
+ " public void foo(boolean a) {\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The method foo(boolean) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 23)\n" +
+ " public void foo(double a) {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The method foo(double) from the type X.B is never used locally\n" +
"----------\n"
:
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public void foo(int a) {\n" +
- " ^^^^^^^^^^\n" +
- "The method foo(int) from the type X.A is never used locally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " public void foo(float a) {\n" +
- " ^^^^^^^^^^^^\n" +
- "The method foo(float) from the type X.A is never used locally\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 9)\n" +
- " public void foo(boolean a) {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method foo(boolean) from the type X.A is never used locally\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 16)\n" +
- " private class B extends A {\n" +
- " ^\n" +
- "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 23)\n" +
- " public void foo(double a) {\n" +
- " ^^^^^^^^^^^^^\n" +
- "The method foo(double) from the type X.B is never used locally\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 30)\n" +
- " public class C extends B {\n" +
- " ^\n" +
- "Access to enclosing constructor X.B() is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public void foo(int a) {\n" +
+ " ^^^^^^^^^^\n" +
+ "The method foo(int) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " public void foo(float a) {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The method foo(float) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 9)\n" +
+ " public void foo(boolean a) {\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The method foo(boolean) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 16)\n" +
+ " private class B extends A {\n" +
+ " ^\n" +
+ "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 23)\n" +
+ " public void foo(double a) {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The method foo(double) from the type X.B is never used locally\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 30)\n" +
+ " public class C extends B {\n" +
+ " ^\n" +
+ "Access to enclosing constructor X.B() is emulated by a synthetic accessor method\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings;
@@ -5239,101 +5239,101 @@ public void test099a() {
"public class X {\n" +
" public class C extends B {\n" +
" public void foo(int a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(double a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(boolean a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(byte a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" }\n" +
" private class B extends A {\n" +
" public void foo(int a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(float a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(double a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(char a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" }\n" +
" private class A {\n" +
" public void foo(int a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(float a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(boolean a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(Integer a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
- " }\n" +
+ " }\n" +
"}\n"
};
runner.expectedCompilerLog = isMinimumCompliant(ClassFileConstants.JDK11) ?
- "----------\n" +
- "1. WARNING in X.java (at line 23)\n" +
- " public void foo(double a) {\n" +
- " ^^^^^^^^^^^^^\n" +
- "The method foo(double) from the type X.B is never used locally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 31)\n" +
- " public void foo(int a) {\n" +
- " ^^^^^^^^^^\n" +
- "The method foo(int) from the type X.A is never used locally\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 34)\n" +
- " public void foo(float a) {\n" +
- " ^^^^^^^^^^^^\n" +
- "The method foo(float) from the type X.A is never used locally\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 37)\n" +
- " public void foo(boolean a) {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method foo(boolean) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 23)\n" +
+ " public void foo(double a) {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The method foo(double) from the type X.B is never used locally\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 31)\n" +
+ " public void foo(int a) {\n" +
+ " ^^^^^^^^^^\n" +
+ "The method foo(int) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 34)\n" +
+ " public void foo(float a) {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The method foo(float) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 37)\n" +
+ " public void foo(boolean a) {\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The method foo(boolean) from the type X.A is never used locally\n" +
"----------\n"
:
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " public class C extends B {\n" +
- " ^\n" +
- "Access to enclosing constructor X.B() is emulated by a synthetic accessor method\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 16)\n" +
- " private class B extends A {\n" +
- " ^\n" +
- "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 23)\n" +
- " public void foo(double a) {\n" +
- " ^^^^^^^^^^^^^\n" +
- "The method foo(double) from the type X.B is never used locally\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 31)\n" +
- " public void foo(int a) {\n" +
- " ^^^^^^^^^^\n" +
- "The method foo(int) from the type X.A is never used locally\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 34)\n" +
- " public void foo(float a) {\n" +
- " ^^^^^^^^^^^^\n" +
- "The method foo(float) from the type X.A is never used locally\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 37)\n" +
- " public void foo(boolean a) {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method foo(boolean) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " public class C extends B {\n" +
+ " ^\n" +
+ "Access to enclosing constructor X.B() is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 16)\n" +
+ " private class B extends A {\n" +
+ " ^\n" +
+ "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 23)\n" +
+ " public void foo(double a) {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The method foo(double) from the type X.B is never used locally\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 31)\n" +
+ " public void foo(int a) {\n" +
+ " ^^^^^^^^^^\n" +
+ "The method foo(int) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 34)\n" +
+ " public void foo(float a) {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The method foo(float) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 37)\n" +
+ " public void foo(boolean a) {\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The method foo(boolean) from the type X.A is never used locally\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings;
@@ -5349,44 +5349,44 @@ public void test099b() {
"public class X {\n" +
" private class A {\n" +
" public void foo(int a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(float a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(boolean a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(Integer a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
- " }\n" +
+ " }\n" +
" private class B extends A {\n" +
" public void foo(int a) {\n" +
- " super.foo(a);\n" +
+ " super.foo(a);\n" +
" }\n" +
" public void foo(float a) {\n" +
- " super.foo(a);\n" +
+ " super.foo(a);\n" +
" }\n" +
" public void foo(double a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(char a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" }\n" +
" public class C extends B {\n" +
" public void foo(int a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" public void foo(double a) {\n" +
- " super.foo(a);\n" +
+ " super.foo(a);\n" +
" }\n" +
" public void foo(boolean a) {\n" +
- " super.foo(a);\n" +
+ " super.foo(a);\n" +
" }\n" +
" public void foo(byte a) {\n" +
- " System.out.println(\"Hello\");\n" +
+ " System.out.println(\"Hello\");\n" +
" }\n" +
" }\n" +
"}\n"
@@ -5394,16 +5394,16 @@ public void test099b() {
if (!isMinimumCompliant(ClassFileConstants.JDK11)) {
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings;
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in X.java (at line 16)\n" +
- " private class B extends A {\n" +
- " ^\n" +
- "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 30)\n" +
- " public class C extends B {\n" +
- " ^\n" +
- "Access to enclosing constructor X.B() is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 16)\n" +
+ " private class B extends A {\n" +
+ " ^\n" +
+ "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 30)\n" +
+ " public class C extends B {\n" +
+ " ^\n" +
+ "Access to enclosing constructor X.B() is emulated by a synthetic accessor method\n" +
"----------\n";
runner.runWarningTest();
} else {
@@ -5424,13 +5424,13 @@ public void test100() {
"}"
};
if (!isMinimumCompliant(ClassFileConstants.JDK11)) {
-
+
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " public class B extends A {}\n" +
- " ^\n" +
- "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " public class B extends A {}\n" +
+ " ^\n" +
+ "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings;
runner.runWarningTest();
@@ -5455,10 +5455,10 @@ public void test101() {
if (!isMinimumCompliant(ClassFileConstants.JDK11)) {
runner.expectedCompilerLog =
"----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " public class B extends A {}\n" +
- " ^\n" +
- "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " public class B extends A {}\n" +
+ " ^\n" +
+ "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings;
runner.runWarningTest();
@@ -5481,33 +5481,33 @@ public void test102() {
"}"
};
runner.expectedCompilerLog = isMinimumCompliant(ClassFileConstants.JDK11) ?
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " private void foo() {}\n" +
- " ^^^^^\n" +
- "The method foo() from the type X.A is never used locally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " private void foo(int a) {}\n" +
- " ^^^^^^^^^^\n" +
- "The method foo(int) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " private void foo() {}\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X.A is never used locally\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " private void foo(int a) {}\n" +
+ " ^^^^^^^^^^\n" +
+ "The method foo(int) from the type X.A is never used locally\n" +
"----------\n"
:
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " private void foo() {}\n" +
- " ^^^^^\n" +
- "The method foo() from the type X.A is never used locally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " private void foo(int a) {}\n" +
- " ^^^^^^^^^^\n" +
- "The method foo(int) from the type X.A is never used locally\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " public class B extends A {}\n" +
- " ^\n" +
- "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " private void foo() {}\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X.A is never used locally\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " private void foo(int a) {}\n" +
+ " ^^^^^^^^^^\n" +
+ "The method foo(int) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " public class B extends A {}\n" +
+ " ^\n" +
+ "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings;
@@ -5528,43 +5528,43 @@ public void test103() {
"}"
};
runner.expectedCompilerLog = isMinimumCompliant(ClassFileConstants.JDK11) ?
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public void foo() {}\n" +
- " ^^^^^\n" +
- "The method foo() from the type X.A is never used locally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " public void foo(int a) {}\n" +
- " ^^^^^^^^^^\n" +
- "The method foo(int) from the type X.A is never used locally\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " private class B extends A {}\n" +
- " ^\n" +
- "The type X.B is never used locally\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public void foo() {}\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X.A is never used locally\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " public void foo(int a) {}\n" +
+ " ^^^^^^^^^^\n" +
+ "The method foo(int) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " private class B extends A {}\n" +
+ " ^\n" +
+ "The type X.B is never used locally\n" +
"----------\n"
:
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public void foo() {}\n" +
- " ^^^^^\n" +
- "The method foo() from the type X.A is never used locally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " public void foo(int a) {}\n" +
- " ^^^^^^^^^^\n" +
- "The method foo(int) from the type X.A is never used locally\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " private class B extends A {}\n" +
- " ^\n" +
- "The type X.B is never used locally\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 6)\n" +
- " private class B extends A {}\n" +
- " ^\n" +
- "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public void foo() {}\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X.A is never used locally\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " public void foo(int a) {}\n" +
+ " ^^^^^^^^^^\n" +
+ "The method foo(int) from the type X.A is never used locally\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " private class B extends A {}\n" +
+ " ^\n" +
+ "The type X.B is never used locally\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 6)\n" +
+ " private class B extends A {}\n" +
+ " ^\n" +
+ "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings;
@@ -5576,15 +5576,15 @@ public void test104() {
"p/Bar.java", //-----------------------------------------------------------------------
"package p;\n" +
"import q.Zork;\n" +
- "public abstract class Bar {\n" +
- " protected abstract boolean isBaz();\n" +
+ "public abstract class Bar {\n" +
+ " protected abstract boolean isBaz();\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in p\\Bar.java (at line 2)\n" +
- " import q.Zork;\n" +
- " ^\n" +
- "The import q cannot be resolved\n" +
+ "----------\n" +
+ "1. ERROR in p\\Bar.java (at line 2)\n" +
+ " import q.Zork;\n" +
+ " ^\n" +
+ "The import q cannot be resolved\n" +
"----------\n",
null /* no extra class libraries */,
true /* flush output directory */,
@@ -5601,10 +5601,10 @@ public void test104() {
new String[] {
"X.java", //-----------------------------------------------------------------------
"import p.Bar;\n" +
- "public class X extends Bar {\n" +
- " protected boolean isBaz() {\n" +
- " return false;\n" +
- " }\n" +
+ "public class X extends Bar {\n" +
+ " protected boolean isBaz() {\n" +
+ " return false;\n" +
+ " }\n" +
"}",
};
runner.expectedOutputString =
@@ -5649,16 +5649,16 @@ public void test106() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " new Listener() {\n" +
- " ^^^^^^^^\n" +
- "Listener cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " new Listener() {\n" +
- " ^^^^^^^^\n" +
- "Listener cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " new Listener() {\n" +
+ " ^^^^^^^^\n" +
+ "Listener cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " new Listener() {\n" +
+ " ^^^^^^^^\n" +
+ "Listener cannot be resolved to a type\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=319425
@@ -5667,17 +5667,17 @@ public void test107() {
new String[] {
"p/OuterBogus.java", //-----------------------------------------------------------------------
"package p;\n" +
- "abstract final class OuterBogus {\n" +
- " public static void call() {\n" +
- " System.out.println(\"Hi. I'm outer bogus.\");\n" +
- " }\n" +
+ "abstract final class OuterBogus {\n" +
+ " public static void call() {\n" +
+ " System.out.println(\"Hi. I'm outer bogus.\");\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in p\\OuterBogus.java (at line 2)\n" +
- " abstract final class OuterBogus {\n" +
- " ^^^^^^^^^^\n" +
- "The class OuterBogus can be either abstract or final, not both\n" +
+ "----------\n" +
+ "1. ERROR in p\\OuterBogus.java (at line 2)\n" +
+ " abstract final class OuterBogus {\n" +
+ " ^^^^^^^^^^\n" +
+ "The class OuterBogus can be either abstract or final, not both\n" +
"----------\n",
null /* no extra class libraries */,
true /* flush output directory */,
@@ -5692,17 +5692,17 @@ public void test107() {
new String[] {
"p/Bogus.java", //-----------------------------------------------------------------------
"package p;\n" +
- "\n" +
- "public class Bogus {\n" +
- " public static void main(String[] args) {\n" +
+ "\n" +
+ "public class Bogus {\n" +
+ " public static void main(String[] args) {\n" +
" try {\n" +
- " OuterBogus.call();\n" +
+ " OuterBogus.call();\n" +
" } catch(ClassFormatError e) {\n" +
- " System.out.println(\"Wrong error found\");\n" +
+ " System.out.println(\"Wrong error found\");\n" +
" } catch(Error e) {\n" +
- " System.out.println(\"Compilation error found\");\n" +
+ " System.out.println(\"Compilation error found\");\n" +
" }\n" +
- " }\n" +
+ " }\n" +
"}",
};
runner.expectedOutputString =
@@ -5717,447 +5717,447 @@ public void test107() {
public void test108() {
if (this.complianceLevel <= ClassFileConstants.JDK1_4) return;
String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ?
- "----------\n" +
+ "----------\n" +
"1. WARNING in SyntheticConstructorTooManyArgs.java (at line 23)\n" +
" @SuppressWarnings(\"synthetic-access\")\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
"Unnecessary @SuppressWarnings(\"synthetic-access\")\n" +
"----------\n"
:
- "----------\n" +
- "1. ERROR in SyntheticConstructorTooManyArgs.java (at line 4)\n" +
- " private A(\n" +
- " /*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" +
- " int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" +
- " int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" +
- " int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" +
- " int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" +
- " int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" +
- " int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" +
- " int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" +
- " int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" +
- " int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" +
- " int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" +
- " int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" +
- " int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" +
- " int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" +
- " int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" +
- " int pf0, int pf1, int pf2, int pf3, int pf4, int pf5, int pf6, int pf7, int pf8, int pf9, int pfa, int pfb, int pfc, int pfd, int pfe\n" +
- " ) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The synthetic method created to access A(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) of type SyntheticConstructorTooManyArgs.A has too many parameters\n" +
+ "----------\n" +
+ "1. ERROR in SyntheticConstructorTooManyArgs.java (at line 4)\n" +
+ " private A(\n" +
+ " /*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" +
+ " int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" +
+ " int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" +
+ " int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" +
+ " int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" +
+ " int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" +
+ " int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" +
+ " int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" +
+ " int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" +
+ " int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" +
+ " int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" +
+ " int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" +
+ " int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" +
+ " int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" +
+ " int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" +
+ " int pf0, int pf1, int pf2, int pf3, int pf4, int pf5, int pf6, int pf7, int pf8, int pf9, int pfa, int pfb, int pfc, int pfd, int pfe\n" +
+ " ) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The synthetic method created to access A(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) of type SyntheticConstructorTooManyArgs.A has too many parameters\n" +
"----------\n";
this.runNegativeTest(
new String[] {
"SyntheticConstructorTooManyArgs.java", //-----------------------------------------------------------------------
- "public class SyntheticConstructorTooManyArgs {\n" +
- "\n" +
- " static class A {\n" +
- " private A(\n" +
- " /*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" +
- " int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" +
- " int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" +
- " int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" +
- " int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" +
- " int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" +
- " int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" +
- " int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" +
- " int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" +
- " int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" +
- " int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" +
- " int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" +
- " int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" +
- " int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" +
- " int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" +
- " int pf0, int pf1, int pf2, int pf3, int pf4, int pf5, int pf6, int pf7, int pf8, int pf9, int pfa, int pfb, int pfc, int pfd, int pfe\n" +
- " ) {}\n" +
- " }\n" +
- " @SuppressWarnings(\"synthetic-access\")\n" +
- " A a = new A(\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n" +
- " );\n" +
- " public static void main(String[] args) {\n" +
- " StringBuilder params = new StringBuilder();\n" +
- " params.append(\"/*this,*/\");\n" +
- " for (int p = 1; p < 255; p++) {\n" +
- " if (p > 1) {\n" +
- " params.append(\", \");\n" +
- " if (p % 16 == 0)\n" +
- " params.append('\\n');\n" +
- " }\n" +
- " params.append(\"int p\"\n" +
- " + Character.forDigit(p / 16, 16)\n" +
- " + Character.forDigit(p % 16, 16)\n" +
- " );\n" +
- " }\n" +
- " System.out.println(params);\n" +
- " A.class.getName(); // ClassFormatError\n" +
- " }\n" +
+ "public class SyntheticConstructorTooManyArgs {\n" +
+ "\n" +
+ " static class A {\n" +
+ " private A(\n" +
+ " /*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" +
+ " int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" +
+ " int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" +
+ " int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" +
+ " int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" +
+ " int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" +
+ " int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" +
+ " int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" +
+ " int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" +
+ " int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" +
+ " int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" +
+ " int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" +
+ " int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" +
+ " int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" +
+ " int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" +
+ " int pf0, int pf1, int pf2, int pf3, int pf4, int pf5, int pf6, int pf7, int pf8, int pf9, int pfa, int pfb, int pfc, int pfd, int pfe\n" +
+ " ) {}\n" +
+ " }\n" +
+ " @SuppressWarnings(\"synthetic-access\")\n" +
+ " A a = new A(\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n" +
+ " );\n" +
+ " public static void main(String[] args) {\n" +
+ " StringBuilder params = new StringBuilder();\n" +
+ " params.append(\"/*this,*/\");\n" +
+ " for (int p = 1; p < 255; p++) {\n" +
+ " if (p > 1) {\n" +
+ " params.append(\", \");\n" +
+ " if (p % 16 == 0)\n" +
+ " params.append('\\n');\n" +
+ " }\n" +
+ " params.append(\"int p\"\n" +
+ " + Character.forDigit(p / 16, 16)\n" +
+ " + Character.forDigit(p % 16, 16)\n" +
+ " );\n" +
+ " }\n" +
+ " System.out.println(params);\n" +
+ " A.class.getName(); // ClassFormatError\n" +
+ " }\n" +
"}",
},
errMessage);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=321414
public void test109() {
- if (this.complianceLevel <= ClassFileConstants.JDK1_4) return;
+ if (this.complianceLevel <= ClassFileConstants.JDK1_4) return;
this.runConformTest(
new String[] {
"SyntheticConstructorTooManyArgs.java", //-----------------------------------------------------------------------
- "public class SyntheticConstructorTooManyArgs {\n" +
- "\n" +
- " static class A {\n" +
- " private A foo(\n" +
- " /*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" +
- " int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" +
- " int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" +
- " int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" +
- " int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" +
- " int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" +
- " int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" +
- " int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" +
- " int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" +
- " int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" +
- " int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" +
- " int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" +
- " int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" +
- " int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" +
- " int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" +
- " int pf0, int pf1, int pf2, int pf3, int pf4, int pf5, int pf6, int pf7, int pf8, int pf9, int pfa, int pfb, int pfc, int pfd, int pfe\n" +
- " ) { return new A();}\n" +
- " }\n" +
- " @SuppressWarnings(\"synthetic-access\")\n" +
- " A a = new A().foo(\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n" +
- " );\n" +
- " public static void main(String[] args) {\n" +
- " StringBuilder params = new StringBuilder();\n" +
- " params.append(\"/*this,*/\");\n" +
- " for (int p = 1; p < 255; p++) {\n" +
- " if (p > 1) {\n" +
- " params.append(\", \");\n" +
- " if (p % 16 == 0)\n" +
- " params.append('\\n');\n" +
- " }\n" +
- " params.append(\"int p\"\n" +
- " + Character.forDigit(p / 16, 16)\n" +
- " + Character.forDigit(p % 16, 16)\n" +
- " );\n" +
- " }\n" +
- " System.out.println(params);\n" +
- " A.class.getName(); // ClassFormatError\n" +
- " }\n" +
+ "public class SyntheticConstructorTooManyArgs {\n" +
+ "\n" +
+ " static class A {\n" +
+ " private A foo(\n" +
+ " /*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" +
+ " int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" +
+ " int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" +
+ " int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" +
+ " int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" +
+ " int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" +
+ " int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" +
+ " int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" +
+ " int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" +
+ " int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" +
+ " int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" +
+ " int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" +
+ " int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" +
+ " int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" +
+ " int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" +
+ " int pf0, int pf1, int pf2, int pf3, int pf4, int pf5, int pf6, int pf7, int pf8, int pf9, int pfa, int pfb, int pfc, int pfd, int pfe\n" +
+ " ) { return new A();}\n" +
+ " }\n" +
+ " @SuppressWarnings(\"synthetic-access\")\n" +
+ " A a = new A().foo(\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n" +
+ " );\n" +
+ " public static void main(String[] args) {\n" +
+ " StringBuilder params = new StringBuilder();\n" +
+ " params.append(\"/*this,*/\");\n" +
+ " for (int p = 1; p < 255; p++) {\n" +
+ " if (p > 1) {\n" +
+ " params.append(\", \");\n" +
+ " if (p % 16 == 0)\n" +
+ " params.append('\\n');\n" +
+ " }\n" +
+ " params.append(\"int p\"\n" +
+ " + Character.forDigit(p / 16, 16)\n" +
+ " + Character.forDigit(p % 16, 16)\n" +
+ " );\n" +
+ " }\n" +
+ " System.out.println(params);\n" +
+ " A.class.getName(); // ClassFormatError\n" +
+ " }\n" +
"}",
},
- "/*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" +
- "int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" +
- "int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" +
- "int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" +
- "int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" +
- "int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" +
- "int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" +
- "int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" +
- "int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" +
- "int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" +
- "int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" +
- "int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" +
- "int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" +
- "int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" +
- "int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" +
+ "/*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" +
+ "int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" +
+ "int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" +
+ "int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" +
+ "int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" +
+ "int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" +
+ "int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" +
+ "int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" +
+ "int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" +
+ "int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" +
+ "int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" +
+ "int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" +
+ "int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" +
+ "int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" +
+ "int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" +
"int pf0, int pf1, int pf2, int pf3, int pf4, int pf5, int pf6, int pf7, int pf8, int pf9, int pfa, int pfb, int pfc, int pfd, int pfe");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=321414
public void test110() {
- if (this.complianceLevel <= ClassFileConstants.JDK1_4) return;
+ if (this.complianceLevel <= ClassFileConstants.JDK1_4) return;
this.runConformTest(
new String[] {
"SyntheticConstructorTooManyArgs.java", //-----------------------------------------------------------------------
- "public class SyntheticConstructorTooManyArgs {\n" +
- "\n" +
- " static class A {\n" +
- " private static A foo(\n" +
- " /*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" +
- " int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" +
- " int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" +
- " int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" +
- " int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" +
- " int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" +
- " int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" +
- " int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" +
- " int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" +
- " int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" +
- " int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" +
- " int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" +
- " int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" +
- " int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" +
- " int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" +
- " int pf0, int pf1, int pf2, int pf3, int pf4, int pf5, int pf6, int pf7, int pf8, int pf9, int pfa, int pfb, int pfc, int pfd, int pfe\n" +
- " ) { return new A();}\n" +
- " }\n" +
- " @SuppressWarnings(\"synthetic-access\")\n" +
- " A a = A.foo(\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n" +
- " );\n" +
- " public static void main(String[] args) {\n" +
- " StringBuilder params = new StringBuilder();\n" +
- " params.append(\"/*this,*/\");\n" +
- " for (int p = 1; p < 255; p++) {\n" +
- " if (p > 1) {\n" +
- " params.append(\", \");\n" +
- " if (p % 16 == 0)\n" +
- " params.append('\\n');\n" +
- " }\n" +
- " params.append(\"int p\"\n" +
- " + Character.forDigit(p / 16, 16)\n" +
- " + Character.forDigit(p % 16, 16)\n" +
- " );\n" +
- " }\n" +
- " System.out.println(params);\n" +
- " A.class.getName(); // ClassFormatError\n" +
- " }\n" +
+ "public class SyntheticConstructorTooManyArgs {\n" +
+ "\n" +
+ " static class A {\n" +
+ " private static A foo(\n" +
+ " /*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" +
+ " int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" +
+ " int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" +
+ " int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" +
+ " int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" +
+ " int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" +
+ " int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" +
+ " int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" +
+ " int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" +
+ " int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" +
+ " int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" +
+ " int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" +
+ " int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" +
+ " int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" +
+ " int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" +
+ " int pf0, int pf1, int pf2, int pf3, int pf4, int pf5, int pf6, int pf7, int pf8, int pf9, int pfa, int pfb, int pfc, int pfd, int pfe\n" +
+ " ) { return new A();}\n" +
+ " }\n" +
+ " @SuppressWarnings(\"synthetic-access\")\n" +
+ " A a = A.foo(\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n" +
+ " );\n" +
+ " public static void main(String[] args) {\n" +
+ " StringBuilder params = new StringBuilder();\n" +
+ " params.append(\"/*this,*/\");\n" +
+ " for (int p = 1; p < 255; p++) {\n" +
+ " if (p > 1) {\n" +
+ " params.append(\", \");\n" +
+ " if (p % 16 == 0)\n" +
+ " params.append('\\n');\n" +
+ " }\n" +
+ " params.append(\"int p\"\n" +
+ " + Character.forDigit(p / 16, 16)\n" +
+ " + Character.forDigit(p % 16, 16)\n" +
+ " );\n" +
+ " }\n" +
+ " System.out.println(params);\n" +
+ " A.class.getName(); // ClassFormatError\n" +
+ " }\n" +
"}",
},
- "/*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" +
- "int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" +
- "int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" +
- "int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" +
- "int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" +
- "int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" +
- "int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" +
- "int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" +
- "int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" +
- "int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" +
- "int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" +
- "int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" +
- "int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" +
- "int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" +
- "int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" +
+ "/*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" +
+ "int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" +
+ "int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" +
+ "int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" +
+ "int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" +
+ "int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" +
+ "int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" +
+ "int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" +
+ "int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" +
+ "int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" +
+ "int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" +
+ "int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" +
+ "int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" +
+ "int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" +
+ "int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" +
"int pf0, int pf1, int pf2, int pf3, int pf4, int pf5, int pf6, int pf7, int pf8, int pf9, int pfa, int pfb, int pfc, int pfd, int pfe");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=321414
public void test111() {
if (this.complianceLevel <= ClassFileConstants.JDK1_4) return;
String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ?
- "----------\n" +
+ "----------\n" +
"1. WARNING in SyntheticConstructorTooManyArgs.java (at line 23)\n" +
" @SuppressWarnings(\"synthetic-access\")\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
"Unnecessary @SuppressWarnings(\"synthetic-access\")\n" +
"----------\n"
:
- "----------\n" +
- "1. ERROR in SyntheticConstructorTooManyArgs.java (at line 4)\n" +
- " private A(\n" +
- " /*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" +
- " int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" +
- " int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" +
- " int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" +
- " int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" +
- " int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" +
- " int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" +
- " int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" +
- " int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" +
- " int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" +
- " int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" +
- " int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" +
- " int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" +
- " int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" +
- " int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" +
- " int pf0, int pf1, int pf2, int pf3, int pf4, int pf5, int pf6, int pf7, int pf8, int pf9, int pfa, int pfb, int pfc, int pfd\n" +
- " ) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The synthetic method created to access A(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) of type SyntheticConstructorTooManyArgs.A has too many parameters\n" +
+ "----------\n" +
+ "1. ERROR in SyntheticConstructorTooManyArgs.java (at line 4)\n" +
+ " private A(\n" +
+ " /*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" +
+ " int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" +
+ " int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" +
+ " int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" +
+ " int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" +
+ " int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" +
+ " int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" +
+ " int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" +
+ " int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" +
+ " int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" +
+ " int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" +
+ " int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" +
+ " int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" +
+ " int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" +
+ " int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" +
+ " int pf0, int pf1, int pf2, int pf3, int pf4, int pf5, int pf6, int pf7, int pf8, int pf9, int pfa, int pfb, int pfc, int pfd\n" +
+ " ) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The synthetic method created to access A(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) of type SyntheticConstructorTooManyArgs.A has too many parameters\n" +
"----------\n";
this.runNegativeTest(
new String[] {
"SyntheticConstructorTooManyArgs.java", //-----------------------------------------------------------------------
- "public class SyntheticConstructorTooManyArgs {\n" +
- "\n" +
- " class A {\n" +
- " private A(\n" +
- " /*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" +
- " int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" +
- " int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" +
- " int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" +
- " int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" +
- " int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" +
- " int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" +
- " int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" +
- " int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" +
- " int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" +
- " int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" +
- " int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" +
- " int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" +
- " int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" +
- " int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" +
- " int pf0, int pf1, int pf2, int pf3, int pf4, int pf5, int pf6, int pf7, int pf8, int pf9, int pfa, int pfb, int pfc, int pfd\n" +
- " ) {}\n" +
- " }\n" +
- " @SuppressWarnings(\"synthetic-access\")\n" +
- " A a = new A(\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0\n" +
- " );\n" +
- " public static void main(String[] args) {\n" +
- " StringBuilder params = new StringBuilder();\n" +
- " params.append(\"/*this,*/\");\n" +
- " for (int p = 1; p < 255; p++) {\n" +
- " if (p > 1) {\n" +
- " params.append(\", \");\n" +
- " if (p % 16 == 0)\n" +
- " params.append('\\n');\n" +
- " }\n" +
- " params.append(\"int p\"\n" +
- " + Character.forDigit(p / 16, 16)\n" +
- " + Character.forDigit(p % 16, 16)\n" +
- " );\n" +
- " }\n" +
- " System.out.println(params);\n" +
- " A.class.getName(); // ClassFormatError\n" +
- " }\n" +
+ "public class SyntheticConstructorTooManyArgs {\n" +
+ "\n" +
+ " class A {\n" +
+ " private A(\n" +
+ " /*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" +
+ " int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" +
+ " int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" +
+ " int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" +
+ " int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" +
+ " int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" +
+ " int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" +
+ " int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" +
+ " int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" +
+ " int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" +
+ " int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" +
+ " int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" +
+ " int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" +
+ " int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" +
+ " int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" +
+ " int pf0, int pf1, int pf2, int pf3, int pf4, int pf5, int pf6, int pf7, int pf8, int pf9, int pfa, int pfb, int pfc, int pfd\n" +
+ " ) {}\n" +
+ " }\n" +
+ " @SuppressWarnings(\"synthetic-access\")\n" +
+ " A a = new A(\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0\n" +
+ " );\n" +
+ " public static void main(String[] args) {\n" +
+ " StringBuilder params = new StringBuilder();\n" +
+ " params.append(\"/*this,*/\");\n" +
+ " for (int p = 1; p < 255; p++) {\n" +
+ " if (p > 1) {\n" +
+ " params.append(\", \");\n" +
+ " if (p % 16 == 0)\n" +
+ " params.append('\\n');\n" +
+ " }\n" +
+ " params.append(\"int p\"\n" +
+ " + Character.forDigit(p / 16, 16)\n" +
+ " + Character.forDigit(p % 16, 16)\n" +
+ " );\n" +
+ " }\n" +
+ " System.out.println(params);\n" +
+ " A.class.getName(); // ClassFormatError\n" +
+ " }\n" +
"}",
},
errMessage);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=321414
public void test112() {
- if (this.complianceLevel <= ClassFileConstants.JDK1_4) return;
+ if (this.complianceLevel <= ClassFileConstants.JDK1_4) return;
this.runConformTest(
new String[] {
"SyntheticConstructorTooManyArgs.java", //-----------------------------------------------------------------------
- "public class SyntheticConstructorTooManyArgs {\n" +
- "\n" +
- " class A {\n" +
- " private A(\n" +
- " /*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" +
- " int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" +
- " int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" +
- " int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" +
- " int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" +
- " int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" +
- " int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" +
- " int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" +
- " int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" +
- " int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" +
- " int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" +
- " int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" +
- " int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" +
- " int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" +
- " int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" +
- " int pf0, int pf1, int pf2, int pf3, int pf4, int pf5, int pf6, int pf7, int pf8, int pf9, int pfa, int pfb, int pfc\n" +
- " ) {}\n" +
- " }\n" +
- " @SuppressWarnings(\"synthetic-access\")\n" +
- " A a = new A(\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
- " 0,0,0,0,0,0,0,0,0,0,0,0,0\n" +
- " );\n" +
- " public static void main(String[] args) {\n" +
- " StringBuilder params = new StringBuilder();\n" +
- " params.append(\"/*this,*/\");\n" +
- " for (int p = 1; p < 253; p++) {\n" +
- " if (p > 1) {\n" +
- " params.append(\", \");\n" +
- " if (p % 16 == 0)\n" +
- " params.append('\\n');\n" +
- " }\n" +
- " params.append(\"int p\"\n" +
- " + Character.forDigit(p / 16, 16)\n" +
- " + Character.forDigit(p % 16, 16)\n" +
- " );\n" +
- " }\n" +
- " System.out.println(params);\n" +
- " A.class.getName(); // ClassFormatError\n" +
- " }\n" +
+ "public class SyntheticConstructorTooManyArgs {\n" +
+ "\n" +
+ " class A {\n" +
+ " private A(\n" +
+ " /*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" +
+ " int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" +
+ " int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" +
+ " int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" +
+ " int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" +
+ " int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" +
+ " int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" +
+ " int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" +
+ " int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" +
+ " int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" +
+ " int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" +
+ " int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" +
+ " int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" +
+ " int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" +
+ " int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" +
+ " int pf0, int pf1, int pf2, int pf3, int pf4, int pf5, int pf6, int pf7, int pf8, int pf9, int pfa, int pfb, int pfc\n" +
+ " ) {}\n" +
+ " }\n" +
+ " @SuppressWarnings(\"synthetic-access\")\n" +
+ " A a = new A(\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n" +
+ " 0,0,0,0,0,0,0,0,0,0,0,0,0\n" +
+ " );\n" +
+ " public static void main(String[] args) {\n" +
+ " StringBuilder params = new StringBuilder();\n" +
+ " params.append(\"/*this,*/\");\n" +
+ " for (int p = 1; p < 253; p++) {\n" +
+ " if (p > 1) {\n" +
+ " params.append(\", \");\n" +
+ " if (p % 16 == 0)\n" +
+ " params.append('\\n');\n" +
+ " }\n" +
+ " params.append(\"int p\"\n" +
+ " + Character.forDigit(p / 16, 16)\n" +
+ " + Character.forDigit(p % 16, 16)\n" +
+ " );\n" +
+ " }\n" +
+ " System.out.println(params);\n" +
+ " A.class.getName(); // ClassFormatError\n" +
+ " }\n" +
"}",
},
- "/*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" +
- "int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" +
- "int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" +
- "int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" +
- "int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" +
- "int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" +
- "int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" +
- "int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" +
- "int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" +
- "int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" +
- "int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" +
- "int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" +
- "int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" +
- "int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" +
- "int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" +
+ "/*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" +
+ "int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" +
+ "int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" +
+ "int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" +
+ "int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" +
+ "int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" +
+ "int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" +
+ "int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" +
+ "int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" +
+ "int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" +
+ "int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" +
+ "int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" +
+ "int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" +
+ "int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" +
+ "int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" +
"int pf0, int pf1, int pf2, int pf3, int pf4, int pf5, int pf6, int pf7, int pf8, int pf9, int pfa, int pfb, int pfc");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=325567
@@ -6166,45 +6166,45 @@ public void test113() {
runner.testFiles =
new String[] {
"X.java",
- "import java.io.IOException;\n" +
- "public class X {\n" +
- " public static void bar(int i) {\n" +
- " final String before;\n" +
- " try {\n" +
- " before = foo();\n" +
- " } catch (IOException e) {\n" +
- " // ignore\n" +
- " }\n" +
- " B b = new B(new I() {\n" +
- " public String bar() {\n" +
- " return new String(before);\n" +
- " }\n" +
- " });\n" +
- " try {\n" +
- " b.toString();\n" +
- " } catch(Exception e) {\n" +
- " // ignore\n" +
- " }\n" +
- " }\n" +
- " private static String foo() throws IOException {\n" +
- " return null;\n" +
- " }\n" +
- " static class B {\n" +
- " B(I i) {\n" +
- " //ignore\n" +
- " }\n" +
- " }\n" +
- " static interface I {\n" +
- " String bar();\n" +
- " }\n" +
+ "import java.io.IOException;\n" +
+ "public class X {\n" +
+ " public static void bar(int i) {\n" +
+ " final String before;\n" +
+ " try {\n" +
+ " before = foo();\n" +
+ " } catch (IOException e) {\n" +
+ " // ignore\n" +
+ " }\n" +
+ " B b = new B(new I() {\n" +
+ " public String bar() {\n" +
+ " return new String(before);\n" +
+ " }\n" +
+ " });\n" +
+ " try {\n" +
+ " b.toString();\n" +
+ " } catch(Exception e) {\n" +
+ " // ignore\n" +
+ " }\n" +
+ " }\n" +
+ " private static String foo() throws IOException {\n" +
+ " return null;\n" +
+ " }\n" +
+ " static class B {\n" +
+ " B(I i) {\n" +
+ " //ignore\n" +
+ " }\n" +
+ " }\n" +
+ " static interface I {\n" +
+ " String bar();\n" +
+ " }\n" +
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " return new String(before);\n" +
- " ^^^^^^\n" +
- "The local variable before may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " return new String(before);\n" +
+ " ^^^^^^\n" +
+ "The local variable before may not have been initialized\n" +
"----------\n";
runner.generateOutput =
true;
@@ -6214,14 +6214,14 @@ public void test113() {
runner.testFiles =
new String[] {
"Y.java", //-----------------------------------------------------------------------
- "public class Y {\n" +
- " public static void main(String[] args) {\n" +
+ "public class Y {\n" +
+ " public static void main(String[] args) {\n" +
" try {\n" +
- " X.bar(3);\n" +
+ " X.bar(3);\n" +
" } catch(VerifyError e) {\n" +
" System.out.println(\"FAILED\");\n" +
" }\n" +
- " }\n" +
+ " }\n" +
"}",
};
runner.expectedOutputString =
@@ -6243,57 +6243,57 @@ public void test114() {
runner.customOptions.put(CompilerOptions.OPTION_ReportMethodCanBePotentiallyStatic, CompilerOptions.ERROR);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" public static int field1;\n" +
- " public static int field2;\n" +
- " public void bar(int i) {\n" +
+ " public static int field2;\n" +
+ " public void bar(int i) {\n" +
" System.out.println(foo());\n" +
" foo();" +
" System.out.println(X.field1);\n" +
" System.out.println(field2);\n" +
" field2 = 1;\n" +
- " }\n" +
- " public final void bar2(int i) {\n" +
+ " }\n" +
+ " public final void bar2(int i) {\n" +
" System.out.println(foo());\n" +
" foo();" +
" System.out.println(X.field1);\n" +
" System.out.println(field2);\n" +
" field2 = 1;\n" +
" }\n" +
- " private void bar3(int i) {\n" +
+ " private void bar3(int i) {\n" +
" System.out.println(foo());\n" +
" foo();" +
" System.out.println(X.field1);\n" +
" System.out.println(field2);\n" +
" field2 = 1;\n" +
" }\n" +
- " private static String foo() {\n" +
- " return null;\n" +
- " }\n" +
+ " private static String foo() {\n" +
+ " return null;\n" +
+ " }\n" +
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public void bar(int i) {\n" +
- " ^^^^^^^^^^\n" +
- "The method bar(int) from the type X can potentially be declared as static\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " public final void bar2(int i) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method bar2(int) from the type X can be declared as static\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 16)\n" +
- " private void bar3(int i) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method bar3(int) from the type X is never used locally\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 16)\n" +
- " private void bar3(int i) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method bar3(int) from the type X can be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " public void bar(int i) {\n" +
+ " ^^^^^^^^^^\n" +
+ "The method bar(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " public final void bar2(int i) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method bar2(int) from the type X can be declared as static\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 16)\n" +
+ " private void bar3(int i) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method bar3(int) from the type X is never used locally\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 16)\n" +
+ " private void bar3(int i) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method bar3(int) from the type X can be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -6314,16 +6314,16 @@ public void test115() {
"public class X extends B{\n" +
" public static int field1;\n" +
" public static int field2;\n" +
- " public void bar(int i) {\n" +
+ " public void bar(int i) {\n" +
" System.out.println(foo());\n" +
" X.field2 = 2;\n" +
" System.out.println(field1);\n" +
" A a = new A();\n" +
" a.a1();\n" +
- " }\n" +
- " private static String foo() {\n" +
- " return null;\n" +
- " }\n" +
+ " }\n" +
+ " private static String foo() {\n" +
+ " return null;\n" +
+ " }\n" +
"}\n" +
"class A{\n" +
" public void a1() {\n" +
@@ -6335,11 +6335,11 @@ public void test115() {
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public void bar(int i) {\n" +
- " ^^^^^^^^^^\n" +
- "The method bar(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " public void bar(int i) {\n" +
+ " ^^^^^^^^^^\n" +
+ "The method bar(int) from the type X can potentially be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -6360,36 +6360,36 @@ public void test116a() {
"public class X extends B{\n" +
" public static int field1;\n" +
" public X xfield;\n" +
- " public void bar1(int i) {\n" +
+ " public void bar1(int i) {\n" +
" baz();\n" +
" }\n" +
- " public void bar2(int i) {\n" +
+ " public void bar2(int i) {\n" +
" this.baz();\n" +
" }\n" +
- " public void bar3(int i) {\n" +
+ " public void bar3(int i) {\n" +
" this.xfield.baz();\n" +
" }\n" +
- " public void bar4(int i) {\n" +
+ " public void bar4(int i) {\n" +
" xfield.baz();\n" +
" }\n" +
- " public void bar5(int i) {\n" +
+ " public void bar5(int i) {\n" +
" X x = new X();\n" +
" x.baz();\n" +
" }\n" +
- " public void bar6(int i) {\n" +
+ " public void bar6(int i) {\n" +
" A.xA.baz();\n" +
" }\n" +
- " public void bar7(int i) {\n" +
+ " public void bar7(int i) {\n" +
" b1();\n" +
" }\n" +
- " public void bar8(int i) {\n" +
+ " public void bar8(int i) {\n" +
" this.b1();\n" +
" }\n" +
- " public void bar9(int i) {\n" +
+ " public void bar9(int i) {\n" +
" new X().b1();\n" +
" }\n" +
" public void baz() {\n" +
- " }\n" +
+ " }\n" +
"}\n" +
"class A{\n" +
" public static X xA;\n" +
@@ -6400,21 +6400,21 @@ public void test116a() {
"}",
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 16)\n" +
- " public void bar5(int i) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method bar5(int) from the type X can potentially be declared as static\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 20)\n" +
- " public void bar6(int i) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method bar6(int) from the type X can potentially be declared as static\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 29)\n" +
- " public void bar9(int i) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method bar9(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 16)\n" +
+ " public void bar5(int i) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method bar5(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 20)\n" +
+ " public void bar6(int i) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method bar6(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 29)\n" +
+ " public void bar9(int i) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method bar9(int) from the type X can potentially be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -6435,36 +6435,36 @@ public void test116b() {
"public class X extends B{\n" +
" public static int field1;\n" +
" public static X xfield;\n" +
- " public void bar1(int i) {\n" +
+ " public void bar1(int i) {\n" +
" baz();\n" +
" }\n" +
- " public void bar2(int i) {\n" +
+ " public void bar2(int i) {\n" +
" this.baz();\n" +
" }\n" +
- " public void bar3(int i) {\n" +
+ " public void bar3(int i) {\n" +
" this.xfield.baz();\n" +
" }\n" +
- " public void bar4(int i) {\n" +
+ " public void bar4(int i) {\n" +
" xfield.baz();\n" +
" }\n" +
- " public void bar5(int i) {\n" +
+ " public void bar5(int i) {\n" +
" X x = new X();\n" +
" x.baz();\n" +
" }\n" +
- " public void bar6(int i) {\n" +
+ " public void bar6(int i) {\n" +
" A.xA.baz();\n" +
" }\n" +
- " public void bar7(int i) {\n" +
+ " public void bar7(int i) {\n" +
" b1();\n" +
" }\n" +
- " public void bar8(int i) {\n" +
+ " public void bar8(int i) {\n" +
" this.b1();\n" +
" }\n" +
- " public void bar9(int i) {\n" +
+ " public void bar9(int i) {\n" +
" new X().b1();\n" +
" }\n" +
" public static void baz() {\n" +
- " }\n" +
+ " }\n" +
"}\n" +
"class A{\n" +
" public static X xA;\n" +
@@ -6475,36 +6475,36 @@ public void test116b() {
"}",
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public void bar1(int i) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method bar1(int) from the type X can potentially be declared as static\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " public void bar4(int i) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method bar4(int) from the type X can potentially be declared as static\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 16)\n" +
- " public void bar5(int i) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method bar5(int) from the type X can potentially be declared as static\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 20)\n" +
- " public void bar6(int i) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method bar6(int) from the type X can potentially be declared as static\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 23)\n" +
- " public void bar7(int i) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method bar7(int) from the type X can potentially be declared as static\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 29)\n" +
- " public void bar9(int i) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method bar9(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " public void bar1(int i) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method bar1(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 13)\n" +
+ " public void bar4(int i) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method bar4(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 16)\n" +
+ " public void bar5(int i) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method bar5(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 20)\n" +
+ " public void bar6(int i) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method bar6(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 23)\n" +
+ " public void bar7(int i) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method bar7(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 29)\n" +
+ " public void bar9(int i) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method bar9(int) from the type X can potentially be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -6525,57 +6525,57 @@ public void test117a() {
"public class X extends B{\n" +
" public int field1;\n" +
" public X xfield;\n" +
- " public void bar1(int i) {\n" +
+ " public void bar1(int i) {\n" +
" field1 = 1;\n" +
" }\n" +
- " public void bar2(int i) {\n" +
+ " public void bar2(int i) {\n" +
" this.field1 = 1;\n" +
" }\n" +
- " public void bar3(int i) {\n" +
+ " public void bar3(int i) {\n" +
" System.out.println(field1);\n" +
" }\n" +
- " public void bar4(int i) {\n" +
+ " public void bar4(int i) {\n" +
" System.out.println(this.field1);\n" +
" }\n" +
- " public void bar5(int i) {\n" +
+ " public void bar5(int i) {\n" +
" X x = new X();\n" +
" x.field1 = 1;\n" +
" }\n" +
- " public void bar6(int i) {\n" +
+ " public void bar6(int i) {\n" +
" A.xA.field1 = 1;\n" +
" }\n" +
- " public void bar7(int i) {\n" +
+ " public void bar7(int i) {\n" +
" b1 = 1;\n" +
" }\n" +
- " public void bar8(int i) {\n" +
+ " public void bar8(int i) {\n" +
" this.b1 = 1;\n" +
" }\n" +
- " public void bar9(int i) {\n" +
+ " public void bar9(int i) {\n" +
" new X().b1 = 1;\n" +
" }\n" +
- " public void bar10(int i) {\n" +
+ " public void bar10(int i) {\n" +
" this.xfield.field1 = 1;\n" +
" }\n" +
- " public void bar11(int i) {\n" +
+ " public void bar11(int i) {\n" +
" System.out.println(this.xfield.field1);\n" +
" }\n" +
- " public void bar12(int i) {\n" +
+ " public void bar12(int i) {\n" +
" System.out.println(new X().b1);\n" +
" }\n" +
- " public void bar13(int i) {\n" +
+ " public void bar13(int i) {\n" +
" System.out.println(b1);\n" +
" }\n" +
- " public void bar14(int i) {\n" +
+ " public void bar14(int i) {\n" +
" System.out.println(this.b1);\n" +
" }\n" +
- " public void bar15(int i) {\n" +
+ " public void bar15(int i) {\n" +
" xfield.field1 = 1;\n" +
" }\n" +
- " public void bar16(int i) {\n" +
+ " public void bar16(int i) {\n" +
" System.out.println(xfield.field1);\n" +
" }\n" +
" public void baz() {\n" +
- " }\n" +
+ " }\n" +
"}\n" +
"class A{\n" +
" public static X xA;\n" +
@@ -6585,26 +6585,26 @@ public void test117a() {
"}",
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 16)\n" +
- " public void bar5(int i) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method bar5(int) from the type X can potentially be declared as static\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 20)\n" +
- " public void bar6(int i) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method bar6(int) from the type X can potentially be declared as static\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 29)\n" +
- " public void bar9(int i) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method bar9(int) from the type X can potentially be declared as static\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 38)\n" +
- " public void bar12(int i) {\n" +
- " ^^^^^^^^^^^^\n" +
- "The method bar12(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 16)\n" +
+ " public void bar5(int i) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method bar5(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 20)\n" +
+ " public void bar6(int i) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method bar6(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 29)\n" +
+ " public void bar9(int i) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method bar9(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 38)\n" +
+ " public void bar12(int i) {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The method bar12(int) from the type X can potentially be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -6625,57 +6625,57 @@ public void test117b() {
"public class X extends B{\n" +
" public static int field1;\n" +
" public static X xfield;\n" +
- " public void bar1(int i) {\n" +
+ " public void bar1(int i) {\n" +
" field1 = 1;\n" +
" }\n" +
- " public void bar2(int i) {\n" +
+ " public void bar2(int i) {\n" +
" this.field1 = 1;\n" +
" }\n" +
- " public void bar3(int i) {\n" +
+ " public void bar3(int i) {\n" +
" System.out.println(field1);\n" +
" }\n" +
- " public void bar4(int i) {\n" +
+ " public void bar4(int i) {\n" +
" System.out.println(this.field1);\n" +
" }\n" +
- " public void bar5(int i) {\n" +
+ " public void bar5(int i) {\n" +
" X x = new X();\n" +
" x.field1 = 1;\n" +
" }\n" +
- " public void bar6(int i) {\n" +
+ " public void bar6(int i) {\n" +
" A.xA.field1 = 1;\n" +
" }\n" +
- " public void bar7(int i) {\n" +
+ " public void bar7(int i) {\n" +
" b1 = 1;\n" +
" }\n" +
- " public void bar8(int i) {\n" +
+ " public void bar8(int i) {\n" +
" this.b1 = 1;\n" +
" }\n" +
- " public void bar9(int i) {\n" +
+ " public void bar9(int i) {\n" +
" new X().b1 = 1;\n" +
" }\n" +
- " public void bar10(int i) {\n" +
+ " public void bar10(int i) {\n" +
" this.xfield.field1 = 1;\n" +
" }\n" +
- " public void bar11(int i) {\n" +
+ " public void bar11(int i) {\n" +
" System.out.println(this.xfield.field1);\n" +
" }\n" +
- " public void bar12(int i) {\n" +
+ " public void bar12(int i) {\n" +
" System.out.println(new X().b1);\n" +
" }\n" +
- " public void bar13(int i) {\n" +
+ " public void bar13(int i) {\n" +
" System.out.println(b1);\n" +
" }\n" +
- " public void bar14(int i) {\n" +
+ " public void bar14(int i) {\n" +
" System.out.println(this.b1);\n" +
" }\n" +
- " public void bar15(int i) {\n" +
+ " public void bar15(int i) {\n" +
" xfield.field1 = 1;\n" +
" }\n" +
- " public void bar16(int i) {\n" +
+ " public void bar16(int i) {\n" +
" System.out.println(xfield.field1);\n" +
" }\n" +
" public void baz() {\n" +
- " }\n" +
+ " }\n" +
"}\n" +
"class A{\n" +
" public static X xA;\n" +
@@ -6685,56 +6685,56 @@ public void test117b() {
"}",
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public void bar1(int i) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method bar1(int) from the type X can potentially be declared as static\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " public void bar3(int i) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method bar3(int) from the type X can potentially be declared as static\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 16)\n" +
- " public void bar5(int i) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method bar5(int) from the type X can potentially be declared as static\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 20)\n" +
- " public void bar6(int i) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method bar6(int) from the type X can potentially be declared as static\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 23)\n" +
- " public void bar7(int i) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method bar7(int) from the type X can potentially be declared as static\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 29)\n" +
- " public void bar9(int i) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method bar9(int) from the type X can potentially be declared as static\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 38)\n" +
- " public void bar12(int i) {\n" +
- " ^^^^^^^^^^^^\n" +
- "The method bar12(int) from the type X can potentially be declared as static\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 41)\n" +
- " public void bar13(int i) {\n" +
- " ^^^^^^^^^^^^\n" +
- "The method bar13(int) from the type X can potentially be declared as static\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 47)\n" +
- " public void bar15(int i) {\n" +
- " ^^^^^^^^^^^^\n" +
- "The method bar15(int) from the type X can potentially be declared as static\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 50)\n" +
- " public void bar16(int i) {\n" +
- " ^^^^^^^^^^^^\n" +
- "The method bar16(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " public void bar1(int i) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method bar1(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " public void bar3(int i) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method bar3(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 16)\n" +
+ " public void bar5(int i) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method bar5(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 20)\n" +
+ " public void bar6(int i) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method bar6(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 23)\n" +
+ " public void bar7(int i) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method bar7(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 29)\n" +
+ " public void bar9(int i) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method bar9(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 38)\n" +
+ " public void bar12(int i) {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The method bar12(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 41)\n" +
+ " public void bar13(int i) {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The method bar13(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 47)\n" +
+ " public void bar15(int i) {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The method bar15(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "10. ERROR in X.java (at line 50)\n" +
+ " public void bar16(int i) {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The method bar16(int) from the type X can potentially be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -6750,26 +6750,26 @@ public void test118() {
runner.customOptions.put(CompilerOptions.OPTION_ReportMethodCanBePotentiallyStatic, CompilerOptions.ERROR);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"final public class X {\n" +
" public static int field1;\n" +
- " public static int field2;\n" +
- " public void bar(int i) {\n" +
+ " public static int field2;\n" +
+ " public void bar(int i) {\n" +
" System.out.println(foo());\n" +
" foo();" +
" System.out.println(X.field1);\n" +
" System.out.println(field2);\n" +
" field2 = 1;\n" +
" }\n" +
- " public static int foo(){ return 1;}\n" +
+ " public static int foo(){ return 1;}\n" +
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public void bar(int i) {\n" +
- " ^^^^^^^^^^\n" +
- "The method bar(int) from the type X can be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " public void bar(int i) {\n" +
+ " ^^^^^^^^^^\n" +
+ "The method bar(int) from the type X can be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -6786,10 +6786,10 @@ public void test119() {
runner.customOptions.put(CompilerOptions.OPTION_ReportMethodCanBePotentiallyStatic, CompilerOptions.ERROR);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" public static int field1;\n" +
- " public int field2;\n" +
+ " public int field2;\n" +
" public void bar(int i) {\n" + // don't warn
" (new Object() {\n" +
" public boolean foo1() {\n" + // don't warn for foo1
@@ -6797,7 +6797,7 @@ public void test119() {
" }\n" +
" }).foo1();\n" +
" System.out.println(X.field1);\n" +
- " }\n" +
+ " }\n" +
" public void bar2(int i) {\n" + // warn
" (new Object() {\n" +
" public boolean foo1() {\n" + // don't warn for foo1
@@ -6806,15 +6806,15 @@ public void test119() {
" }\n" +
" }).foo1();\n" +
" System.out.println(X.field1);\n" +
- " }\n" +
+ " }\n" +
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " public void bar2(int i) {\n" +
- " ^^^^^^^^^^^\n" +
- "The method bar2(int) from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " public void bar2(int i) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "The method bar2(int) from the type X can potentially be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -6832,14 +6832,14 @@ public void test120() {
runner.customOptions.put(CompilerOptions.OPTION_ReportMethodCanBePotentiallyStatic, CompilerOptions.ERROR);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"public class X<T> {\n" +
" public static int field1;\n" +
- " public int field2;\n" +
+ " public int field2;\n" +
" public void bar(T t) {\n" + // don't warn
" X.field1 = 1;\n" +
" System.out.println(t);\n" +
- " }\n" +
+ " }\n" +
" public <E> void bar2(E e) {\n" + // warn
" X.field1 = 1;\n" +
" System.out.println(e);\n" +
@@ -6847,24 +6847,24 @@ public void test120() {
" public <E> void bar3() {\n" + // don't warn
" T a;\n" +
" System.out.println();\n" +
- " }\n" +
+ " }\n" +
" public <E,Y> void bar4() {\n" + // warn
" Y a;\n" +
" System.out.println();\n" +
- " }\n" +
+ " }\n" +
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " public <E> void bar2(E e) {\n" +
- " ^^^^^^^^^\n" +
- "The method bar2(E) from the type X<T> can potentially be declared as static\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 16)\n" +
- " public <E,Y> void bar4() {\n" +
- " ^^^^^^\n" +
- "The method bar4() from the type X<T> can potentially be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " public <E> void bar2(E e) {\n" +
+ " ^^^^^^^^^\n" +
+ "The method bar2(E) from the type X<T> can potentially be declared as static\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 16)\n" +
+ " public <E,Y> void bar4() {\n" +
+ " ^^^^^^\n" +
+ "The method bar4() from the type X<T> can potentially be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -6881,13 +6881,13 @@ public void test121() {
runner.customOptions.put(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, CompilerOptions.IGNORE);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"public class X extends A{\n" +
" public static int field1;\n" +
- " public int field2;\n" +
+ " public int field2;\n" +
" public void methodA() {\n" + // don't warn
" super.methodA();\n" +
- " }\n" +
+ " }\n" +
" public void bar() {\n" + // don't warn
" super.fieldA = 1;\n" +
" }\n" +
@@ -6905,11 +6905,11 @@ public void test121() {
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " public void bar3() {\n" +
- " ^^^^^^\n" +
- "The method bar3() from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " public void bar3() {\n" +
+ " ^^^^^^\n" +
+ "The method bar3() from the type X can potentially be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -6926,7 +6926,7 @@ public void test122() {
runner.customOptions.put(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, CompilerOptions.IGNORE);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" class A{\n" +
" void methodA() {\n" + // don't warn
@@ -6941,11 +6941,11 @@ public void test122() {
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " void methodB() {\n" +
- " ^^^^^^^^^\n" +
- "The method methodB() from the type X.B can potentially be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " void methodB() {\n" +
+ " ^^^^^^^^^\n" +
+ "The method methodB() from the type X.B can potentially be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -6964,22 +6964,22 @@ public void test123() {
runner.customOptions.put(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, CompilerOptions.IGNORE);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"public class X<T> {\n" +
" <E,Y> T method1() {\n" + // don't warn
" return null;\n" +
- " }\n" +
+ " }\n" +
" <E,Y> E method2() {\n" + // warn
" return null;\n" +
- " }\n" +
+ " }\n" +
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " <E,Y> E method2() {\n" +
- " ^^^^^^^^^\n" +
- "The method method2() from the type X<T> can potentially be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " <E,Y> E method2() {\n" +
+ " ^^^^^^^^^\n" +
+ "The method method2() from the type X<T> can potentially be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -6999,14 +6999,14 @@ public void testBug335845a() {
compilerOptions.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" private class Bar {\n" +
" int a = 1;\n" +
- " }\n" +
+ " }\n" +
" private void foo() {\n" + // don't warn
" new Bar();\n" +
- " }\n" +
+ " }\n" +
"}"
},
"",
@@ -7029,14 +7029,14 @@ public void testBug335845b() {
compilerOptions.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" private class Bar {\n" +
" int a = 1;\n" +
- " }\n" +
+ " }\n" +
" private void foo() {\n" + // don't warn
" int x = new Bar().a;\n" +
- " }\n" +
+ " }\n" +
"}"
},
"",
@@ -7060,23 +7060,23 @@ public void testBug335845c() {
runner.customOptions.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" private static class Bar {\n" +
" int a = 1;\n" +
- " }\n" +
+ " }\n" +
" private void foo() {\n" + // warn since Bar is static
" new Bar();\n" +
" int x = new Bar().a;" +
- " }\n" +
+ " }\n" +
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " private void foo() {\n" +
- " ^^^^^\n" +
- "The method foo() from the type X can be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " private void foo() {\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X can be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -7096,14 +7096,14 @@ public void testBug335845d() {
compilerOptions.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" private class Bar {\n" +
" class Bar2{}\n" +
- " }\n" +
+ " }\n" +
" private void foo() {\n" + // don't warn
" new Bar().new Bar2();\n" +
- " }\n" +
+ " }\n" +
"}"
},
"",
@@ -7127,22 +7127,22 @@ public void testBug335845e() {
runner.customOptions.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" private class Bar {\n" +
" int a = 1;\n" +
- " }\n" +
+ " }\n" +
" private void foo() {\n" + // warn since Bar is allocated via Test object
" new X().new Bar();\n" +
- " }\n" +
+ " }\n" +
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " private void foo() {\n" +
- " ^^^^^\n" +
- "The method foo() from the type X can be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " private void foo() {\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X can be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -7163,23 +7163,23 @@ public void testBug335845f() {
runner.customOptions.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" private class Bar {\n" +
" int a = 1;\n" +
- " }\n" +
+ " }\n" +
" private void foo() {\n" + // warn since Bar is allocated via Test object
" X x = new X();" +
" x.new Bar().a = 2;\n" +
- " }\n" +
+ " }\n" +
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " private void foo() {\n" +
- " ^^^^^\n" +
- "The method foo() from the type X can be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " private void foo() {\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X can be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -7199,7 +7199,7 @@ public void testBug335845g() {
compilerOptions.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
this.runConformTest(
new String[] {
- "p/X.java",
+ "p/X.java",
"package p;\n" +
"public class X {\n" +
" class Bar {\n" +
@@ -7214,7 +7214,7 @@ public void testBug335845g() {
"public class Y extends X {\n" +
" private void foo() {\n" + // warn since Bar is allocated via Test object
" new Bar();\n" +
- " }\n" +
+ " }\n" +
"}"
},
"",
@@ -7235,15 +7235,15 @@ public void test124a() {
compilerOptions.put(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" public void method1() {\n" + // don't warn
" Foo.m(this);\n" +
" }\n" +
- "static class Foo{\n" +
- " static void m(X bug) {\n" +
+ "static class Foo{\n" +
+ " static void m(X bug) {\n" +
" \n" +
- " }\n" +
+ " }\n" +
"}\n" +
"}"
},
@@ -7264,24 +7264,24 @@ public void test124b() {
compilerOptions.put(CompilerOptions.OPTION_ReportMethodCanBePotentiallyStatic, CompilerOptions.ERROR);
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" public static X xField;" +
" public void method1() {\n" + // don't warn
" Foo.m(this.xField);\n" +
" }\n" +
- "static class Foo{\n" +
- " static void m(X bug) {\n" +
+ "static class Foo{\n" +
+ " static void m(X bug) {\n" +
" \n" +
- " }\n" +
+ " }\n" +
"}\n" +
"}"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " Foo.m(this.xField);\n" +
- " ^^^^^^\n" +
- "The static field X.xField should be accessed in a static way\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " Foo.m(this.xField);\n" +
+ " ^^^^^^\n" +
+ "The static field X.xField should be accessed in a static way\n" +
"----------\n",
null /* no extra class libraries */,
true /* flush output directory */,
@@ -7302,7 +7302,7 @@ public void test354502() {
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" public abstract class Abstract{}\n" +
" public static abstract class Abstract2{}\n" +
@@ -7315,11 +7315,11 @@ public void test354502() {
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " private void method2() {\n" +
- " ^^^^^^^^^\n" +
- "The method method2() from the type X can be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " private void method2() {\n" +
+ " ^^^^^^^^^\n" +
+ "The method method2() from the type X can be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -7330,29 +7330,29 @@ public void test360164() {
if (this.complianceLevel < ClassFileConstants.JDK1_5) return;
this.runConformTest(
new String[] {
- "p/B.java",
+ "p/B.java",
"package p;\n" +
"\n" +
"public abstract class B<K,V> {\n" +
" protected abstract V foo(K element);\n" +
"}\n",
- "p/C.java",
+ "p/C.java",
"package p;\n" +
"public class C {\n" +
"}\n",
- "p/D.java",
+ "p/D.java",
"package p;\n" +
"public class D extends E {\n" +
"}\n",
- "p/E.java",
+ "p/E.java",
"package p;\n" +
"public abstract class E implements I {\n" +
"}\n",
- "p/I.java",
+ "p/I.java",
"package p;\n" +
"public interface I {\n" +
"}\n",
- "p/X.java",
+ "p/X.java",
"package p;\n" +
"public class X {\n" +
" private final class A extends B<C,D>{\n" +
@@ -7372,7 +7372,7 @@ public void test360164() {
// test directory preparation
false /* do not flush output directory */,
new String[] { /* test files */
- "p/X.java",
+ "p/X.java",
"package p;\n" +
"public class X {\n" +
" private final class A extends B<C,D>{\n" +
@@ -7387,17 +7387,17 @@ public void test360164() {
// compiler options
null /* no class libraries */,
null /* no custom options */,
- // compiler results
- "----------\n" +
- "1. WARNING in p\\X.java (at line 3)\n" +
- " private final class A extends B<C,D>{\n" +
- " ^\n" +
- "The type X.A is never used locally\n" +
- "----------\n" +
- "2. ERROR in p\\X.java (at line 6)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ // compiler results
+ "----------\n" +
+ "1. WARNING in p\\X.java (at line 3)\n" +
+ " private final class A extends B<C,D>{\n" +
+ " ^\n" +
+ "The type X.A is never used locally\n" +
+ "----------\n" +
+ "2. ERROR in p\\X.java (at line 6)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n",
// javac options
JavacTestOptions.SKIP_UNTIL_FRAMEWORK_FIX /* javac test options */);
@@ -7414,7 +7414,7 @@ public void test376550_1a() {
compilerOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" int i = 1;\n" +
" public void upper1(){}\n" +
@@ -7447,7 +7447,7 @@ public void test376550_1b() {
this.customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
this.testFiles =
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" int i = 1;\n" +
" public void upper1(){}\n" +
@@ -7462,11 +7462,11 @@ public void test376550_1b() {
"}"
};
this.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public void foo(){\n" +
- " ^^^^^\n" +
- "The method foo() from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " public void foo(){\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X can potentially be declared as static\n" +
"----------\n";
this.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -7485,7 +7485,7 @@ public void test376550_2a() {
runner.customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"public class X<T> {\n" +
" public void upper1(){}\n" +
" public void foo(){\n" + // can be static
@@ -7498,11 +7498,11 @@ public void test376550_2a() {
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " public void foo(){\n" +
- " ^^^^^\n" +
- "The method foo() from the type X<T> can potentially be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " public void foo(){\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X<T> can potentially be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -7520,7 +7520,7 @@ public void test376550_2b() {
compilerOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"public class X<T> {\n" +
" public void upper1(){}\n" +
" public void foo(){\n" + // can't be static
@@ -7550,7 +7550,7 @@ public void test376550_3a() {
compilerOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"public class X<T> {\n" +
" public void upper1(){}\n" +
" public void foo(){\n" + // can't be static
@@ -7582,7 +7582,7 @@ public void test376550_3b() {
runner.customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"public class X<T> {\n" +
" public void upper1(){}\n" +
" public void foo(){\n" + // can be static
@@ -7596,11 +7596,11 @@ public void test376550_3b() {
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " public void foo(){\n" +
- " ^^^^^\n" +
- "The method foo() from the type X<T> can potentially be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " public void foo(){\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X<T> can potentially be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -7619,7 +7619,7 @@ public void test376550_4a() {
runner.customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"public class X<T> {\n" +
" int i1 = 1;\n" +
" public void foo(){\n" + // can be static
@@ -7634,11 +7634,11 @@ public void test376550_4a() {
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " public void foo(){\n" +
- " ^^^^^\n" +
- "The method foo() from the type X<T> can potentially be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " public void foo(){\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X<T> can potentially be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -7656,7 +7656,7 @@ public void test376550_4b() {
compilerOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"public class X<T> {\n" +
" int i1 = 1;\n" +
" public void foo(){\n" + // can't be static
@@ -7689,7 +7689,7 @@ public void test376550_5a() {
runner.customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" int i1 = 1;\n" +
" public void foo(){\n" + // can be static
@@ -7703,11 +7703,11 @@ public void test376550_5a() {
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " public void foo(){\n" +
- " ^^^^^\n" +
- "The method foo() from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " public void foo(){\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X can potentially be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -7727,7 +7727,7 @@ public void test376550_5aa() {
runner.customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" int i1 = 1;\n" +
" public void foo(){\n" +
@@ -7765,7 +7765,7 @@ public void test376550_5b() {
compilerOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" int i1 = 1;\n" +
" public void foo(){\n" + // can't be static
@@ -7797,7 +7797,7 @@ public void test376550_6a() {
runner.customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" int i1 = 1;\n" +
" public void foo(){\n" + // can be static
@@ -7811,11 +7811,11 @@ public void test376550_6a() {
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " public void foo(){\n" +
- " ^^^^^\n" +
- "The method foo() from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " public void foo(){\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X can potentially be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -7833,7 +7833,7 @@ public void test376550_6b() {
compilerOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" int i1 = 1;\n" +
" public void foo(){\n" + // can't be static
@@ -7866,7 +7866,7 @@ public void test376550_7a() {
runner.customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" abstract class AbsUp{}\n" +
" public void foo(){\n" + // can be static
@@ -7880,11 +7880,11 @@ public void test376550_7a() {
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " public void foo(){\n" +
- " ^^^^^\n" +
- "The method foo() from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " public void foo(){\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X can potentially be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -7903,7 +7903,7 @@ public void test376550_7b() {
compilerOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" abstract class AbsUp{}\n" +
" public void foo(){\n" + // can't be static
@@ -7935,7 +7935,7 @@ public void test376550_8a() {
runner.customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" class AbsUp{ int a;}\n" +
" public void foo(){\n" + // can be static
@@ -7949,11 +7949,11 @@ public void test376550_8a() {
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " public void foo(){\n" +
- " ^^^^^\n" +
- "The method foo() from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " public void foo(){\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X can potentially be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -7971,7 +7971,7 @@ public void test376550_8b() {
compilerOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" class AbsUp{ int a;}\n" +
" public void foo(){\n" + // can't be static
@@ -8003,7 +8003,7 @@ public void test376550_9a() {
runner.customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" X xup;\n" +
" int i = 1;\n" +
@@ -8019,11 +8019,11 @@ public void test376550_9a() {
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public void foo(){\n" +
- " ^^^^^\n" +
- "The method foo() from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " public void foo(){\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X can potentially be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -8041,7 +8041,7 @@ public void test376550_9b() {
compilerOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" X xup;\n" +
" int i = 1;\n" +
@@ -8075,7 +8075,7 @@ public void test376550_10a() {
runner.customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" X xup;\n" +
" int i = 1;\n" +
@@ -8091,11 +8091,11 @@ public void test376550_10a() {
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public void foo(){\n" +
- " ^^^^^\n" +
- "The method foo() from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " public void foo(){\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X can potentially be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -8113,7 +8113,7 @@ public void test376550_10b() {
compilerOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
this.runNegativeTest(
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" X xup;\n" +
" int i = 1;\n" +
@@ -8147,7 +8147,7 @@ public void test376550_11() {
runner.customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"import java.util.ArrayList;\n" +
"import java.util.Collection;\n" +
"public class X {\n" +
@@ -8160,23 +8160,23 @@ public void test376550_11() {
"}"
};
runner.expectedCompilerLog = isMinimumCompliant(ClassFileConstants.JDK11) ?
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " return new ArrayList<Object>() {\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The serializable class does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " return new ArrayList<Object>() {\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The serializable class does not declare a static final serialVersionUID field of type long\n" +
"----------\n"
:
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " return new ArrayList<Object>() {\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The serializable class does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " { add(o);}\n" +
- " ^\n" +
- "Read access to enclosing field X.o is emulated by a synthetic accessor method\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " return new ArrayList<Object>() {\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The serializable class does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 7)\n" +
+ " { add(o);}\n" +
+ " ^\n" +
+ "Read access to enclosing field X.o is emulated by a synthetic accessor method\n" +
"----------\n";
runner.runWarningTest();
}
@@ -8194,7 +8194,7 @@ public void test376550_11a() {
runner.customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"import java.util.ArrayList;\n" +
"import java.util.Collection;\n" +
"public class X {\n" +
@@ -8234,7 +8234,7 @@ public void test376550_12() {
runner.customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"import java.util.ArrayList;\n" +
"import java.util.Collection;\n" +
"public class X<E> {\n" +
@@ -8247,16 +8247,16 @@ public void test376550_12() {
"}"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " public final <E1> Collection<E1> go() {\n" +
- " ^^^^\n" +
- "The method go() from the type X<E> can be declared as static\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " return new ArrayList<E1>() {\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The serializable class does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " public final <E1> Collection<E1> go() {\n" +
+ " ^^^^\n" +
+ "The method go() from the type X<E> can be declared as static\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " return new ArrayList<E1>() {\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "The serializable class does not declare a static final serialVersionUID field of type long\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -8274,19 +8274,19 @@ public void test376550_13() {
compilerOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
this.runConformTest(
new String[] {
- "QualifiedSuper.java",
- "public class QualifiedSuper {\n" +
- " class InnerS {\n" +
- " void flub() {}\n" +
- " }\n" +
- " static class InnerT extends InnerS {\n" +
- " InnerT(QualifiedSuper qs) {\n" +
- " qs.super();\n" +
- " }\n" +
- " final void schlumpf() {\n" +
- " InnerT.super.flub();\n" +
- " }\n" +
- " } \n" +
+ "QualifiedSuper.java",
+ "public class QualifiedSuper {\n" +
+ " class InnerS {\n" +
+ " void flub() {}\n" +
+ " }\n" +
+ " static class InnerT extends InnerS {\n" +
+ " InnerT(QualifiedSuper qs) {\n" +
+ " qs.super();\n" +
+ " }\n" +
+ " final void schlumpf() {\n" +
+ " InnerT.super.flub();\n" +
+ " }\n" +
+ " } \n" +
"}\n"
},
"",
@@ -8308,7 +8308,7 @@ public void test379530() {
compilerOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
this.runConformTest(
new String[] {
- "X.java",
+ "X.java",
"public class X<S> {\n" +
" S s;\n" +
" {\n" +
@@ -8333,7 +8333,7 @@ public void test393781() {
try {
this.runNegativeTest(
new String[] {
- "p/X.java",
+ "p/X.java",
"public class X {\n" +
" public void foo(Map map, String str) {}\n" +
" public void foo1() {}\n" +
@@ -8346,26 +8346,26 @@ public void test393781() {
"}\n" +
"class Map {}\n"
},
- "----------\n" +
- "1. ERROR in p\\X.java (at line 5)\n" +
- " foo(map, \"\");\n" +
- " ^^^\n" +
- "The method foo(Map, java.lang.String) in the type X is not applicable for the arguments (java.util.Map, java.lang.String)\n" +
- "----------\n" +
- "2. ERROR in p\\X.java (at line 6)\n" +
- " foo(map);\n" +
- " ^^^\n" +
- "The method foo(Map, String) in the type X is not applicable for the arguments (Map)\n" +
- "----------\n" +
- "3. ERROR in p\\X.java (at line 7)\n" +
- " foo();\n" +
- " ^^^\n" +
- "The method foo(Map, String) in the type X is not applicable for the arguments ()\n" +
- "----------\n" +
- "4. ERROR in p\\X.java (at line 8)\n" +
- " foo1(map, \"\");\n" +
- " ^^^^\n" +
- "The method foo1() in the type X is not applicable for the arguments (Map, String)\n" +
+ "----------\n" +
+ "1. ERROR in p\\X.java (at line 5)\n" +
+ " foo(map, \"\");\n" +
+ " ^^^\n" +
+ "The method foo(Map, java.lang.String) in the type X is not applicable for the arguments (java.util.Map, java.lang.String)\n" +
+ "----------\n" +
+ "2. ERROR in p\\X.java (at line 6)\n" +
+ " foo(map);\n" +
+ " ^^^\n" +
+ "The method foo(Map, String) in the type X is not applicable for the arguments (Map)\n" +
+ "----------\n" +
+ "3. ERROR in p\\X.java (at line 7)\n" +
+ " foo();\n" +
+ " ^^^\n" +
+ "The method foo(Map, String) in the type X is not applicable for the arguments ()\n" +
+ "----------\n" +
+ "4. ERROR in p\\X.java (at line 8)\n" +
+ " foo1(map, \"\");\n" +
+ " ^^^^\n" +
+ "The method foo1() in the type X is not applicable for the arguments (Map, String)\n" +
"----------\n",
null,
true,
@@ -8383,7 +8383,7 @@ private void runStaticWarningConformTest(String fileName, String body) {
compilerOptions.put(CompilerOptions.OPTION_ReportMethodCanBePotentiallyStatic, CompilerOptions.ERROR);
this.runConformTest(
new String[] {
- fileName,
+ fileName,
body
},
compilerOptions /* custom options */
@@ -8393,36 +8393,36 @@ private void runStaticWarningConformTest(String fileName, String body) {
//Can be static warning shown in the wrong places, i.e. if the type parameter is used in the signature
public void test378674_comment0() {
runStaticWarningConformTest(
- "Test.java",
- "public class Test<T> {\n" +
- "\n" +
- " @SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n" +
- " public static void main(String[] args) {\n" +
- " new Test().method(null);\n" +
- " }\n" +
- "\n" +
- " private static class SubClass<A> {\n" +
- "\n" +
- " }\n" +
- "\n" +
- " private void method(SubClass<T> s) {\n" +
- " System.out.println(s);\n" +
- " }\n" +
- "\n" +
- "}\n" +
+ "Test.java",
+ "public class Test<T> {\n" +
+ "\n" +
+ " @SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n" +
+ " public static void main(String[] args) {\n" +
+ " new Test().method(null);\n" +
+ " }\n" +
+ "\n" +
+ " private static class SubClass<A> {\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
+ " private void method(SubClass<T> s) {\n" +
+ " System.out.println(s);\n" +
+ " }\n" +
+ "\n" +
+ "}\n" +
""
);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=378674
public void test378674_comment1b() {
runStaticWarningConformTest(
- "X.java",
+ "X.java",
"import java.util.Collection;\n" +
- "class X<E>{\n" +
- " public final <E1> Collection<E> go() { // cannot be static\n" +
- " return null; \n" +
- " }\n" +
- "}\n" +
+ "class X<E>{\n" +
+ " public final <E1> Collection<E> go() { // cannot be static\n" +
+ " return null; \n" +
+ " }\n" +
+ "}\n" +
""
);
}
@@ -8430,14 +8430,14 @@ public void test378674_comment1b() {
//Can be static warning shown in the wrong places
public void test378674_comment1c() {
runStaticWarningConformTest(
- "X.java",
+ "X.java",
"import java.util.Collection;\n" +
"import java.util.ArrayList;\n" +
- " class X<E>{\n" +
- " public final <E1> Collection<?> go() { // cannot be static\n" +
- " return new ArrayList<E>(); \n" +
- " }\n" +
- "}\n" +
+ " class X<E>{\n" +
+ " public final <E1> Collection<?> go() { // cannot be static\n" +
+ " return new ArrayList<E>(); \n" +
+ " }\n" +
+ "}\n" +
""
);
}
@@ -8445,29 +8445,29 @@ public void test378674_comment1c() {
//Can be static warning shown in the wrong places
public void test378674_comment2() {
runStaticWarningConformTest(
- "X.java",
- "public class X<T> {\n" +
- " public final void foo() {\n" +
- " java.util.List<T> k;\n" +
- " }\n" +
- "}\n" +
+ "X.java",
+ "public class X<T> {\n" +
+ " public final void foo() {\n" +
+ " java.util.List<T> k;\n" +
+ " }\n" +
+ "}\n" +
""
);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=378674
public void test378674_comment3() {
runStaticWarningConformTest(
- "Test.java",
- "public class Test {\n" +
- " //false positive of method can be declared static\n" +
- " void bar() {\n" +
- " foo(Test.this);\n" +
- " }\n" +
- "\n" +
- " private static void foo(Test test) {\n" +
- " System.out.println(test.getClass().getName());\n" +
- " }\n" +
- "}\n" +
+ "Test.java",
+ "public class Test {\n" +
+ " //false positive of method can be declared static\n" +
+ " void bar() {\n" +
+ " foo(Test.this);\n" +
+ " }\n" +
+ "\n" +
+ " private static void foo(Test test) {\n" +
+ " System.out.println(test.getClass().getName());\n" +
+ " }\n" +
+ "}\n" +
""
);
}
@@ -8475,101 +8475,101 @@ public void test378674_comment3() {
//Can be static warning shown in the wrong places
public void test378674_comment5a() {
runStaticWarningConformTest(
- "Test.java",
- "public class Test<T> {\n" +
- "\n" +
- " @SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n" +
- " public static void main(String[] args) {\n" +
- " new Test().method2(null);\n" +
- " }\n" +
- "\n" +
- " private static class SubClass<A> {\n" +
- "\n" +
- " }\n" +
- "\n" +
- " private void method2(SubClass<java.util.List<T>> s) {\n" +
- " System.out.println(s);\n" +
- " }\n" +
- "\n" +
- "}\n" +
+ "Test.java",
+ "public class Test<T> {\n" +
+ "\n" +
+ " @SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n" +
+ " public static void main(String[] args) {\n" +
+ " new Test().method2(null);\n" +
+ " }\n" +
+ "\n" +
+ " private static class SubClass<A> {\n" +
+ "\n" +
+ " }\n" +
+ "\n" +
+ " private void method2(SubClass<java.util.List<T>> s) {\n" +
+ " System.out.println(s);\n" +
+ " }\n" +
+ "\n" +
+ "}\n" +
""
);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=378674
public void test378674_comment5b() {
runStaticWarningConformTest(
- "Test.java",
- "public class Test<T> {\n" +
- "\n" +
- " @SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n" +
- " public static void main(String[] args) {\n" +
- " new Test().method();\n" +
- " }\n" +
- "\n" +
- " private java.util.Collection<T> method() {\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- "}\n" +
+ "Test.java",
+ "public class Test<T> {\n" +
+ "\n" +
+ " @SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n" +
+ " public static void main(String[] args) {\n" +
+ " new Test().method();\n" +
+ " }\n" +
+ "\n" +
+ " private java.util.Collection<T> method() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ "}\n" +
""
);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=378674
public void test378674_comment9() {
runStaticWarningConformTest(
- "Test.java",
- "public class Test<T> {\n" +
- "\n" +
- " @SuppressWarnings({ \"rawtypes\" })\n" +
- " public static void main(String[] args) {\n" +
- " new Test().method();\n" +
- " }\n" +
- "\n" +
- " private java.util.Collection<? extends T> method() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
+ "Test.java",
+ "public class Test<T> {\n" +
+ "\n" +
+ " @SuppressWarnings({ \"rawtypes\" })\n" +
+ " public static void main(String[] args) {\n" +
+ " new Test().method();\n" +
+ " }\n" +
+ "\n" +
+ " private java.util.Collection<? extends T> method() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
""
);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=378674
public void test378674_comment11() {
runStaticWarningConformTest(
- "Test.java",
- "public class Test<T> {\n" +
- "\n" +
- " @SuppressWarnings({ \"rawtypes\" })\n" +
- " public static void main(String[] args) {\n" +
- " new Test().method1();\n" +
- " new Test().method2();\n" +
- " }\n" +
- "\n" +
- " private <TT extends T> TT method1() { \n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " private <TT extends Object & Comparable<? super T>> TT method2() { \n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
+ "Test.java",
+ "public class Test<T> {\n" +
+ "\n" +
+ " @SuppressWarnings({ \"rawtypes\" })\n" +
+ " public static void main(String[] args) {\n" +
+ " new Test().method1();\n" +
+ " new Test().method2();\n" +
+ " }\n" +
+ "\n" +
+ " private <TT extends T> TT method1() { \n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " private <TT extends Object & Comparable<? super T>> TT method2() { \n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
""
);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=378674
public void test378674_comment21a() {
runStaticWarningConformTest(
- "X.java",
+ "X.java",
"public class X<P extends Exception> {\n" +
" final <T> void foo(T x) throws P {\n" +
" }\n" +
- "}\n" +
+ "}\n" +
""
);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=378674
public void test378674_comment21b() {
runStaticWarningConformTest(
- "X.java",
+ "X.java",
"public class X<P extends Exception> {\n" +
" final <T> void foo(T x) {\n" +
" Object o = (P) null;\n" +
@@ -8579,7 +8579,7 @@ public void test378674_comment21b() {
}//https://bugs.eclipse.org/bugs/show_bug.cgi?id=378674
public void test378674_comment21c() {
runStaticWarningConformTest(
- "X.java",
+ "X.java",
"public class X<P extends Exception> {\n" +
" final <T> void foo(T x) {\n" +
" new Outer().new Inner<P>();\n" +
@@ -8592,7 +8592,7 @@ public void test378674_comment21c() {
}//https://bugs.eclipse.org/bugs/show_bug.cgi?id=378674
public void test378674_comment21d() {
runStaticWarningConformTest(
- "X.java",
+ "X.java",
"public class X<P extends Exception> {\n" +
" final <T> void foo(T x) {\n" +
" class Local {\n" +
@@ -8602,7 +8602,7 @@ public void test378674_comment21d() {
"}\n"
);
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406396, Method can be static analysis misses a bunch of cases...
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406396, Method can be static analysis misses a bunch of cases...
public void test406396() {
Runner runner = new Runner();
runner.customOptions = getCompilerOptions();
@@ -8610,7 +8610,7 @@ public void test406396() {
runner.customOptions.put(CompilerOptions.OPTION_ReportMethodCanBePotentiallyStatic, CompilerOptions.ERROR);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" int f;\n" +
" void foo() {\n" +
@@ -8626,37 +8626,37 @@ public void test406396() {
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " void foo() {\n" +
- " ^^^^^\n" +
- "The method foo() from the type X can potentially be declared as static\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " class Y {\n" +
- " ^\n" +
- "The type Y is never used locally\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 7)\n" +
- " class Z {\n" +
- " ^\n" +
- "The type Z is never used locally\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 8)\n" +
- " int f = p;\n" +
- " ^\n" +
- "The field Z.f is hiding a field from type X\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 8)\n" +
- " int f = p;\n" +
- " ^\n" +
- "The value of the field Z.f is not used\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " void foo() {\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " class Y {\n" +
+ " ^\n" +
+ "The type Y is never used locally\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 7)\n" +
+ " class Z {\n" +
+ " ^\n" +
+ "The type Z is never used locally\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 8)\n" +
+ " int f = p;\n" +
+ " ^\n" +
+ "The field Z.f is hiding a field from type X\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 8)\n" +
+ " int f = p;\n" +
+ " ^\n" +
+ "The value of the field Z.f is not used\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
runner.runNegativeTest();
}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406396, Method can be static analysis misses a bunch of cases...
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=406396, Method can be static analysis misses a bunch of cases...
public void test406396a() {
Runner runner = new Runner();
runner.customOptions = getCompilerOptions();
@@ -8664,7 +8664,7 @@ public void test406396a() {
runner.customOptions.put(CompilerOptions.OPTION_ReportMethodCanBePotentiallyStatic, CompilerOptions.ERROR);
runner.testFiles =
new String[] {
- "X.java",
+ "X.java",
"public class X {\n" +
" int f;\n" +
" int foo() {\n" +
@@ -8677,21 +8677,21 @@ public void test406396a() {
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " int foo() {\n" +
- " ^^^^^\n" +
- "The method foo() from the type X can potentially be declared as static\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " int f = 0;\n" +
- " ^\n" +
- "The local variable f is hiding a field from type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " int goo() {\n" +
- " ^^^^^\n" +
- "The method goo() from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " int foo() {\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type X can potentially be declared as static\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " int f = 0;\n" +
+ " ^\n" +
+ "The local variable f is hiding a field from type X\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " int goo() {\n" +
+ " ^^^^^\n" +
+ "The method goo() from the type X can potentially be declared as static\n" +
"----------\n";
runner.javacTestOptions =
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
@@ -8699,7 +8699,7 @@ public void test406396a() {
}
public void testBug542829() {
if (this.complianceLevel < ClassFileConstants.JDK1_7) return;
-
+
// m.Issing is a type that comes and goes:
String nameMissing = "m/Issing.java";
String contentMissing =
@@ -8734,7 +8734,7 @@ public void testBug542829() {
// now we break it:
Util.delete(new File(OUTPUT_DIR + File.separator + "m" + File.separator + "Issing.class"));
runner.shouldFlushOutputDirectory = false;
-
+
// in this class file a MissingTypes attribute ("m/Issing") is generated:
runner.testFiles = new String[] {
"b/Roken.java",
@@ -8747,11 +8747,11 @@ public void testBug542829() {
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in b\\Roken.java (at line 3)\n" +
- " Ood getGood(m.Issing provider) {\n" +
- " ^^^^^^^^\n" +
- "m.Issing cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in b\\Roken.java (at line 3)\n" +
+ " Ood getGood(m.Issing provider) {\n" +
+ " ^^^^^^^^\n" +
+ "m.Issing cannot be resolved to a type\n" +
"----------\n";
runner.runNegativeTest();
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProgrammingProblemsTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProgrammingProblemsTest.java
index 3901990a9..12ef8a38c 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProgrammingProblemsTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProgrammingProblemsTest.java
@@ -1451,61 +1451,61 @@ public void test0038() {
" Zork z;\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " boolean b1 = 1 == 1;\n" +
- " ^^^^^^\n" +
- "Comparing identical expressions\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " boolean b2 = 1 != 1;\n" +
- " ^^^^^^\n" +
- "Comparing identical expressions\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 5)\n" +
- " boolean b3 = 1 == 1.0;\n" +
- " ^^^^^^^^\n" +
- "Comparing identical expressions\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 6)\n" +
- " boolean b4 = 1 != 1.0;\n" +
- " ^^^^^^^^\n" +
- "Comparing identical expressions\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 13)\n" +
- " boolean b9 = 1 == s1;\n" +
- " ^^^^^^^\n" +
- "Comparing identical expressions\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 15)\n" +
- " boolean b91 = 1 != s1;\n" +
- " ^^^^^^^\n" +
- "Comparing identical expressions\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 19)\n" +
- " boolean b11 = 1 == l1;\n" +
- " ^^^^^^^\n" +
- "Comparing identical expressions\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 21)\n" +
- " boolean b111 = 1 != l1;\n" +
- " ^^^^^^^\n" +
- "Comparing identical expressions\n" +
- "----------\n" +
- "9. WARNING in X.java (at line 23)\n" +
- " boolean b13 = s1 == l1;\n" +
- " ^^^^^^^^\n" +
- "Comparing identical expressions\n" +
- "----------\n" +
- "10. WARNING in X.java (at line 25)\n" +
- " boolean b15 = s1 != l1;\n" +
- " ^^^^^^^^\n" +
- "Comparing identical expressions\n" +
- "----------\n" +
- "11. ERROR in X.java (at line 28)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " boolean b1 = 1 == 1;\n" +
+ " ^^^^^^\n" +
+ "Comparing identical expressions\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " boolean b2 = 1 != 1;\n" +
+ " ^^^^^^\n" +
+ "Comparing identical expressions\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 5)\n" +
+ " boolean b3 = 1 == 1.0;\n" +
+ " ^^^^^^^^\n" +
+ "Comparing identical expressions\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 6)\n" +
+ " boolean b4 = 1 != 1.0;\n" +
+ " ^^^^^^^^\n" +
+ "Comparing identical expressions\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 13)\n" +
+ " boolean b9 = 1 == s1;\n" +
+ " ^^^^^^^\n" +
+ "Comparing identical expressions\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 15)\n" +
+ " boolean b91 = 1 != s1;\n" +
+ " ^^^^^^^\n" +
+ "Comparing identical expressions\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 19)\n" +
+ " boolean b11 = 1 == l1;\n" +
+ " ^^^^^^^\n" +
+ "Comparing identical expressions\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 21)\n" +
+ " boolean b111 = 1 != l1;\n" +
+ " ^^^^^^^\n" +
+ "Comparing identical expressions\n" +
+ "----------\n" +
+ "9. WARNING in X.java (at line 23)\n" +
+ " boolean b13 = s1 == l1;\n" +
+ " ^^^^^^^^\n" +
+ "Comparing identical expressions\n" +
+ "----------\n" +
+ "10. WARNING in X.java (at line 25)\n" +
+ " boolean b15 = s1 != l1;\n" +
+ " ^^^^^^^^\n" +
+ "Comparing identical expressions\n" +
+ "----------\n" +
+ "11. ERROR in X.java (at line 28)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
@@ -1519,34 +1519,34 @@ public void test0039() {
"public class X {\n" +
" public void gain(String[] args) {\n" +
" boolean b1 = this == this;\n" +
- " boolean b2 = this != this;\n" +
+ " boolean b2 = this != this;\n" +
" boolean b3 = this != new X();\n" +
" boolean b4 = this == new X();\n" +
" }\n" +
" Zork z;\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " boolean b1 = this == this;\n" +
- " ^^^^^^^^^^^^\n" +
- "Comparing identical expressions\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " boolean b2 = this != this;\n" +
- " ^^^^^^^^^^^^\n" +
- "Comparing identical expressions\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " boolean b1 = this == this;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Comparing identical expressions\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " boolean b2 = this != this;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Comparing identical expressions\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
/**
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=281776"
* We now tolerate comparison of float and double entities against
- * themselves as a legitimate idiom for NaN checking.
+ * themselves as a legitimate idiom for NaN checking.
*/
public void test0040() {
this.runNegativeTest(
@@ -1566,11 +1566,11 @@ public void test0040() {
" Zork z;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=251227
@@ -1585,16 +1585,16 @@ public void test0041() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " System.out.println(1.0 == 1.0);\n" +
- " ^^^^^^^^^^\n" +
- "Comparing identical expressions\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " System.out.println(1.0f == 1.0f);\n" +
- " ^^^^^^^^^^^^\n" +
- "Comparing identical expressions\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " System.out.println(1.0 == 1.0);\n" +
+ " ^^^^^^^^^^\n" +
+ "Comparing identical expressions\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " System.out.println(1.0f == 1.0f);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Comparing identical expressions\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=248897
@@ -1639,17 +1639,17 @@ public void test0043() {
this.runNegativeTest(
new String[] {
"X.java",
- "class X {\n" +
- " void foo(int i) {\n" +
- " foo((a));\n" +
- " }\n" +
+ "class X {\n" +
+ " void foo(int i) {\n" +
+ " foo((a));\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " foo((a));\n" +
- " ^\n" +
- "a cannot be resolved to a variable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " foo((a));\n" +
+ " ^\n" +
+ "a cannot be resolved to a variable\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=310264
@@ -1657,20 +1657,20 @@ public void test0044() {
this.runNegativeTest(
new String[] {
"X.java",
- "class X {\n" +
+ "class X {\n" +
" volatile int x;\n" +
" int nvx;\n" +
" void foo(int i) {\n" +
- " x = x;\n" +
+ " x = x;\n" +
" nvx = nvx;\n" +
- " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " nvx = nvx;\n" +
- " ^^^^^^^^^\n" +
- "The assignment to variable nvx has no effect\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 6)\n" +
+ " nvx = nvx;\n" +
+ " ^^^^^^^^^\n" +
+ "The assignment to variable nvx has no effect\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=310264
@@ -1678,23 +1678,23 @@ public void test0045() {
this.runNegativeTest(
new String[] {
"X.java",
- "class X {\n" +
+ "class X {\n" +
" volatile int x = this.x;\n" +
" int nvx = this.nvx;\n" +
" void foo(int i) {\n" +
- " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " volatile int x = this.x;\n" +
- " ^^^^^^^^^^\n" +
- "The assignment to variable x has no effect\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " int nvx = this.nvx;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The assignment to variable nvx has no effect\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " volatile int x = this.x;\n" +
+ " ^^^^^^^^^^\n" +
+ "The assignment to variable x has no effect\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 3)\n" +
+ " int nvx = this.nvx;\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The assignment to variable nvx has no effect\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=185682
@@ -1706,31 +1706,31 @@ public void test0046() {
this.runNegativeTest(
new String[] {
"X.java",
- "class X {\n" +
- " int foo() {\n" +
- " int i=1;\n" +
- " boolean b=false;\n" +
+ "class X {\n" +
+ " int foo() {\n" +
+ " int i=1;\n" +
+ " boolean b=false;\n" +
" b|=true;\n" + // not a relevant usage
- " int k = 2;\n" +
+ " int k = 2;\n" +
" --k;\n" + // not a relevant usage
" k+=3;\n" + // not a relevant usage
- " Integer j = 3;\n" +
+ " Integer j = 3;\n" +
" j++;\n" + // relevant because unboxing is involved
" i++;\n" + // not relevant but should still not report because next is relevant
" return i++;\n" + // value after increment is used
- " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " boolean b=false;\n" +
- " ^\n" +
- "The value of the local variable b is not used\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 6)\n" +
- " int k = 2;\n" +
- " ^\n" +
- "The value of the local variable k is not used\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " boolean b=false;\n" +
+ " ^\n" +
+ "The value of the local variable b is not used\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " int k = 2;\n" +
+ " ^\n" +
+ "The value of the local variable k is not used\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -1746,30 +1746,30 @@ public void test0046_field() {
this.runNegativeTest(
new String[] {
"X.java",
- "class X {\n" +
- " private int i=1;\n" +
- " private boolean b=false;\n" +
- " private int k = 2;\n" +
- " private Integer j = 3;\n" +
- " int foo() {\n" +
+ "class X {\n" +
+ " private int i=1;\n" +
+ " private boolean b=false;\n" +
+ " private int k = 2;\n" +
+ " private Integer j = 3;\n" +
+ " int foo() {\n" +
" b|=true;\n" + // not a relevant usage
" --k;\n" + // not a relevant usage
" k+=3;\n" + // not a relevant usage
" j++;\n" + // relevant because unboxing is involved
" return i++;\n" + // value after increment is used
- " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " private boolean b=false;\n" +
- " ^\n" +
- "The value of the field X.b is not used\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " private int k = 2;\n" +
- " ^\n" +
- "The value of the field X.k is not used\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " private boolean b=false;\n" +
+ " ^\n" +
+ "The value of the field X.b is not used\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " private int k = 2;\n" +
+ " ^\n" +
+ "The value of the field X.k is not used\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -1785,31 +1785,31 @@ public void test0046_field_this_qualified() {
this.runNegativeTest(
new String[] {
"X.java",
- "class X {\n" +
- " private int i=1;\n" +
- " private boolean b=false;\n" +
- " private int k = 2;\n" +
- " private Integer j = 3;\n" +
- " int foo() {\n" +
+ "class X {\n" +
+ " private int i=1;\n" +
+ " private boolean b=false;\n" +
+ " private int k = 2;\n" +
+ " private Integer j = 3;\n" +
+ " int foo() {\n" +
" this.b|=true;\n" + // not a relevant usage
" --this.k;\n" + // not a relevant usage
" getThis().k+=3;\n" + // not a relevant usage
" this.j++;\n" + // relevant because unboxing is involved
" return this.i++;\n" + // value after increment is used
" }\n" +
- " X getThis() { return this; }\n" +
+ " X getThis() { return this; }\n" +
"}"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " private boolean b=false;\n" +
- " ^\n" +
- "The value of the field X.b is not used\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " private int k = 2;\n" +
- " ^\n" +
- "The value of the field X.k is not used\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " private boolean b=false;\n" +
+ " ^\n" +
+ "The value of the field X.b is not used\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " private int k = 2;\n" +
+ " ^\n" +
+ "The value of the field X.k is not used\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -1825,31 +1825,31 @@ public void test0046_field_qualified() {
this.runNegativeTest(
new String[] {
"X.java",
- "class X {\n" +
- " private int i=1;\n" +
- " private boolean b=false;\n" +
- " private int k = 2;\n" +
- " private Integer j = 3;\n" +
- " int foo(X that) {\n" +
+ "class X {\n" +
+ " private int i=1;\n" +
+ " private boolean b=false;\n" +
+ " private int k = 2;\n" +
+ " private Integer j = 3;\n" +
+ " int foo(X that) {\n" +
" that.b|=true;\n" + // not a relevant usage
" --that.k;\n" + // not a relevant usage
" that.k+=3;\n" + // not a relevant usage
" that.j++;\n" + // relevant because unboxing is involved
" that.i++;\n"+ // not relevant but should still not report because next is relevant
" return that.i++;\n" + // value after increment is used
- " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " private boolean b=false;\n" +
- " ^\n" +
- "The value of the field X.b is not used\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " private int k = 2;\n" +
- " ^\n" +
- "The value of the field X.k is not used\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " private boolean b=false;\n" +
+ " ^\n" +
+ "The value of the field X.b is not used\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " private int k = 2;\n" +
+ " ^\n" +
+ "The value of the field X.k is not used\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -1866,13 +1866,13 @@ public void test0046_field_in_private_type() {
new String[] {
"X.java",
"class X {\n" +
- " private class Y {\n" +
- " int i=1;\n" +
- " public boolean b=false;\n" +
- " protected int k = 2;\n" +
+ " private class Y {\n" +
+ " int i=1;\n" +
+ " public boolean b=false;\n" +
+ " protected int k = 2;\n" +
" Integer j = 3;\n" +
- " }\n" +
- " int foo(Y y) {\n" +
+ " }\n" +
+ " int foo(Y y) {\n" +
" y.b|=true;\n" + // not a relevant usage
" --y.k;\n" + // not a relevant usage
" y.k+=3;\n" + // not a relevant usage
@@ -1880,19 +1880,19 @@ public void test0046_field_in_private_type() {
" int result = y.i++;\n" + // value after increment is used
" y.i++;\n" + // not relevant, but previous is
" return result;\n" +
- " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " public boolean b=false;\n" +
- " ^\n" +
- "The value of the field X.Y.b is not used\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " protected int k = 2;\n" +
- " ^\n" +
- "The value of the field X.Y.k is not used\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " public boolean b=false;\n" +
+ " ^\n" +
+ "The value of the field X.Y.b is not used\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " protected int k = 2;\n" +
+ " ^\n" +
+ "The value of the field X.Y.k is not used\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -1908,9 +1908,9 @@ public void test0047() {
this.runNegativeTest(
new String[] {
"X.java",
- "class X {\n" +
- " void foo(int param1, int param2, Integer param3) {\n" +
- " boolean b=false;\n" +
+ "class X {\n" +
+ " void foo(int param1, int param2, Integer param3) {\n" +
+ " boolean b=false;\n" +
" b|=true;\n" + // not a relevant usage
" param1++;\n" + // not a relevant usage
" {\n" +
@@ -1918,24 +1918,24 @@ public void test0047() {
" param2 += val;\n" +// not a relevant usage of param2
" }\n" +
" param3++;\n" + // relevant because unboxing is involved
- " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " void foo(int param1, int param2, Integer param3) {\n" +
- " ^^^^^^\n" +
- "The value of the parameter param1 is not used\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 2)\n" +
- " void foo(int param1, int param2, Integer param3) {\n" +
- " ^^^^^^\n" +
- "The value of the parameter param2 is not used\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 3)\n" +
- " boolean b=false;\n" +
- " ^\n" +
- "The value of the local variable b is not used\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " void foo(int param1, int param2, Integer param3) {\n" +
+ " ^^^^^^\n" +
+ "The value of the parameter param1 is not used\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 2)\n" +
+ " void foo(int param1, int param2, Integer param3) {\n" +
+ " ^^^^^^\n" +
+ "The value of the parameter param2 is not used\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 3)\n" +
+ " boolean b=false;\n" +
+ " ^\n" +
+ "The value of the local variable b is not used\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -1954,16 +1954,16 @@ public void test0048() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X extends A implements Y{\n" +
+ "public class X extends A implements Y{\n" +
" public void foo(int param1, int param2, Integer param3) {\n" + // implementing method, so dont warn
- " boolean b=false;\n" +
+ " boolean b=false;\n" +
" b|=true;\n" + // not a relevant usage
" param1++;\n" + // not a relevant usage
" param2 += 1;\n" + // not a relevant usage
" param3++;\n" + // relevant because unboxing is involved
- " }\n" +
+ " }\n" +
" public void foo(int param1, int param2) {\n" + // warn
- " boolean b=false;\n" +
+ " boolean b=false;\n" +
" b|=true;\n" + // not a relevant usage
" param1++;\n" + // not a relevant usage
" param2 += 1;\n" + // not a relevant usage
@@ -1981,26 +1981,26 @@ public void test0048() {
" public abstract void bar(int param1, int param2, Integer param3);" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " boolean b=false;\n" +
- " ^\n" +
- "The value of the local variable b is not used\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " public void foo(int param1, int param2) {\n" +
- " ^^^^^^\n" +
- "The value of the parameter param1 is not used\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 9)\n" +
- " public void foo(int param1, int param2) {\n" +
- " ^^^^^^\n" +
- "The value of the parameter param2 is not used\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 10)\n" +
- " boolean b=false;\n" +
- " ^\n" +
- "The value of the local variable b is not used\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " boolean b=false;\n" +
+ " ^\n" +
+ "The value of the local variable b is not used\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " public void foo(int param1, int param2) {\n" +
+ " ^^^^^^\n" +
+ "The value of the parameter param1 is not used\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 9)\n" +
+ " public void foo(int param1, int param2) {\n" +
+ " ^^^^^^\n" +
+ "The value of the parameter param2 is not used\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 10)\n" +
+ " boolean b=false;\n" +
+ " ^\n" +
+ "The value of the local variable b is not used\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -2019,47 +2019,47 @@ public void test0049() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X extends A {\n" +
+ "public class X extends A {\n" +
" public void foo(int param1, int param2, Integer param3) {\n" + // overriding method, so dont warn
- " boolean b=false;\n" +
+ " boolean b=false;\n" +
" b|=true;\n" + // not a relevant usage
" param1++;\n" + // not a relevant usage
" param2 += 1;\n" + // not a relevant usage
" param3++;\n" + // relevant because unboxing is involved
- " }\n" +
+ " }\n" +
" public void foo(int param1, Integer param3) {\n" + // overriding method, so dont warn
" param1++;\n" + // not a relevant usage
" param3++;\n" + // relevant because unboxing is involved
- " }\n" +
+ " }\n" +
"}\n" +
"class A{\n" +
" public void foo(int param1, int param2, Integer param3) {\n" +
" param1 -=1;\n" + // not a relevant usage
" param2--;\n" + // not a relevant usage
" param3--;\n" + // relevant because unboxing is involved
- " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " boolean b=false;\n" +
- " ^\n" +
- "The value of the local variable b is not used\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " public void foo(int param1, Integer param3) {\n" +
- " ^^^^^^\n" +
- "The value of the parameter param1 is not used\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 15)\n" +
- " public void foo(int param1, int param2, Integer param3) {\n" +
- " ^^^^^^\n" +
- "The value of the parameter param1 is not used\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 15)\n" +
- " public void foo(int param1, int param2, Integer param3) {\n" +
- " ^^^^^^\n" +
- "The value of the parameter param2 is not used\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " boolean b=false;\n" +
+ " ^\n" +
+ "The value of the local variable b is not used\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " public void foo(int param1, Integer param3) {\n" +
+ " ^^^^^^\n" +
+ "The value of the parameter param1 is not used\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 15)\n" +
+ " public void foo(int param1, int param2, Integer param3) {\n" +
+ " ^^^^^^\n" +
+ "The value of the parameter param1 is not used\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 15)\n" +
+ " public void foo(int param1, int param2, Integer param3) {\n" +
+ " ^^^^^^\n" +
+ "The value of the parameter param2 is not used\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -2075,35 +2075,35 @@ public void test0050() {
this.runNegativeTest(
new String[] {
"X.java",
- "class X {\n" +
- " int foo() {\n" +
+ "class X {\n" +
+ " int foo() {\n" +
" int i=1;\n" +
- " if (false) {\n" +
+ " if (false) {\n" +
" boolean b=false;\n" + // don't complain as unused
" b|=true;\n" +
" }\n" + // not a relevant usage
- " int k = 2;\n" +
+ " int k = 2;\n" +
" --k;\n" + // not a relevant usage
" k+=3;\n" + // not a relevant usage
- " Integer j = 3;\n" +
+ " Integer j = 3;\n" +
" j++;\n" + // relevant because unboxing is involved
" return i++;\n" + // value after increment is used
- " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " if (false) {\n" +
- " boolean b=false;\n" +
- " b|=true;\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " int k = 2;\n" +
- " ^\n" +
- "The value of the local variable k is not used\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " if (false) {\n" +
+ " boolean b=false;\n" +
+ " b|=true;\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " int k = 2;\n" +
+ " ^\n" +
+ "The value of the local variable k is not used\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -2117,17 +2117,17 @@ public void test0051() {
this.runNegativeTest(
new String[] {
"X.java",
- "class X {\n" +
- " X(int abc) {\n" +
+ "class X {\n" +
+ " X(int abc) {\n" +
" abc++;\n" + // not a relevant usage
- " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " X(int abc) {\n" +
- " ^^^\n" +
- "The value of the parameter abc is not used\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 2)\n" +
+ " X(int abc) {\n" +
+ " ^^^\n" +
+ "The value of the parameter abc is not used\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -2143,8 +2143,8 @@ public void test0052() {
"class X {\n" +
" Y y = new Y();\n" +
" private class Y {\n" +
- " int abc;\n" +
- " Y() {\n" +
+ " int abc;\n" +
+ " Y() {\n" +
" abc++;\n" + // not a relevant usage
" }\n" +
" }\n" +
@@ -2167,11 +2167,11 @@ public void test0052a() {
this.runConformTest(
new String[] {
"Outer.java",
- "class Outer {\n" +
- " private class Inner1 {\n" +
+ "class Outer {\n" +
+ " private class Inner1 {\n" +
" int foo;\n" +
- " }\n" +
- " private class Inner2 extends Inner1 { }\n" +
+ " }\n" +
+ " private class Inner2 extends Inner1 { }\n" +
" class Inner3 extends Inner2 { }\n" + // foo is exposed here
"}\n"
},
@@ -2191,11 +2191,11 @@ public void test0052b() {
this.runConformTest(
new String[] {
"Outer.java",
- "class Outer {\n" +
- " private class Inner1 {\n" +
+ "class Outer {\n" +
+ " private class Inner1 {\n" +
" class Foo{}\n" +
- " }\n" +
- " private class Inner2 extends Inner1 { }\n" +
+ " }\n" +
+ " private class Inner2 extends Inner1 { }\n" +
" class Inner3 extends Inner2 { }\n" + // Foo is exposed here
"}\n"
},
@@ -2213,12 +2213,12 @@ public void test0053() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "class X {\n" +
- " int foo() {\n" +
+ "class X {\n" +
+ " int foo() {\n" +
" int i=1;\n" +
" i++;\n" + // value after increment is still not used
- " return 0;\n" +
- " }\n" +
+ " return 0;\n" +
+ " }\n" +
"}"
},
"",
@@ -2228,14 +2228,14 @@ public void test0053() throws Exception {
customOptions,
null);
String expectedOutput =
- " // Method descriptor #15 ()I\n" +
- " // Stack: 1, Locals: 1\n" +
- " int foo();\n" +
- " 0 iconst_0\n" +
- " 1 ireturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 5]\n" +
- " Local variable table:\n" +
+ " // Method descriptor #15 ()I\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " int foo();\n" +
+ " 0 iconst_0\n" +
+ " 1 ireturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 5]\n" +
+ " Local variable table:\n" +
" [pc: 0, pc: 2] local: this index: 0 type: X\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
}
@@ -2246,11 +2246,11 @@ public void test0054() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "class X {\n" +
- " int foo() {\n" +
+ "class X {\n" +
+ " int foo() {\n" +
" int i=1;\n" +
" return i+=1;\n" + // value is used as it is returned
- " }\n" +
+ " }\n" +
"}"
},
"",
@@ -2260,19 +2260,19 @@ public void test0054() throws Exception {
customOptions,
null);
String expectedOutput =
- " // Method descriptor #15 ()I\n" +
- " // Stack: 1, Locals: 2\n" +
- " int foo();\n" +
- " 0 iconst_1\n" +
- " 1 istore_1 [i]\n" +
- " 2 iinc 1 1 [i]\n" +
- " 5 iload_1 [i]\n" +
- " 6 ireturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
- " [pc: 2, line: 4]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 7] local: this index: 0 type: X\n" +
+ " // Method descriptor #15 ()I\n" +
+ " // Stack: 1, Locals: 2\n" +
+ " int foo();\n" +
+ " 0 iconst_1\n" +
+ " 1 istore_1 [i]\n" +
+ " 2 iinc 1 1 [i]\n" +
+ " 5 iload_1 [i]\n" +
+ " 6 ireturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
+ " [pc: 2, line: 4]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 7] local: this index: 0 type: X\n" +
" [pc: 2, pc: 7] local: i index: 1 type: int\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
}
@@ -2317,15 +2317,15 @@ public void test0056() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " static int foo() {\n" +
- " int i = 2;\n" +
- " int j = 3;\n" +
+ "public class X {\n" +
+ " static int foo() {\n" +
+ " int i = 2;\n" +
+ " int j = 3;\n" +
" return (i += j *= 3);\n" + // value is used as it is returned
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(foo());\n" +
- " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(foo());\n" +
+ " }\n" +
"}"
},
"11",
@@ -2342,15 +2342,15 @@ public void test0057() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main (String args[]) {\n" +
- " int i = 0;\n" +
- " i += 4 + foo();\n" +
- " }\n" +
- " public static int foo() {\n" +
- " System.out.println(\"OK\");\n" +
- " return 0;\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main (String args[]) {\n" +
+ " int i = 0;\n" +
+ " i += 4 + foo();\n" +
+ " }\n" +
+ " public static int foo() {\n" +
+ " System.out.println(\"OK\");\n" +
+ " return 0;\n" +
+ " }\n" +
"}"
},
"OK",
@@ -2380,11 +2380,11 @@ public void _test0058() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " bug(); // undefined method\n" +
- " ^^^\n" +
- "The method bug() is undefined for the type new Runnable(){}\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " bug(); // undefined method\n" +
+ " ^^^\n" +
+ "The method bug() is undefined for the type new Runnable(){}\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -2399,30 +2399,30 @@ public void test0059() throws Exception {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Object a = null;\n" +
- " if (a != null){\n" +
- " int j = 3;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object a = null;\n" +
+ " if (a != null){\n" +
+ " int j = 3;\n" +
" j++;\n" + // value is not used
" }\n" +
- " System.out.println(\"OK\");\n" +
- " }\n" +
+ " System.out.println(\"OK\");\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " if (a != null){\n" +
- " int j = 3;\n" +
- " j++;\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " int j = 3;\n" +
- " ^\n" +
- "The value of the local variable j is not used\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " if (a != null){\n" +
+ " int j = 3;\n" +
+ " j++;\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " int j = 3;\n" +
+ " ^\n" +
+ "The value of the local variable j is not used\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -2480,31 +2480,31 @@ public void test0060() throws Exception {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in org\\eclipse\\jdt\\internal\\compiler\\lookup\\X.java (at line 7)\n" +
- " if (t1 == t2) { \n" +
- " ^^^^^^^^\n" +
- "The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" +
- "----------\n" +
- "2. ERROR in org\\eclipse\\jdt\\internal\\compiler\\lookup\\X.java (at line 9)\n" +
- " if (t1 == t2) {\n" +
- " ^^^^^^^^\n" +
- "The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" +
- "----------\n" +
- "3. ERROR in org\\eclipse\\jdt\\internal\\compiler\\lookup\\X.java (at line 16)\n" +
- " if (t1 == t2) { \n" +
- " ^^^^^^^^\n" +
- "The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" +
- "----------\n" +
- "4. ERROR in org\\eclipse\\jdt\\internal\\compiler\\lookup\\X.java (at line 18)\n" +
- " if (t1 == t2) {\n" +
- " ^^^^^^^^\n" +
- "The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" +
- "----------\n" +
- "5. ERROR in org\\eclipse\\jdt\\internal\\compiler\\lookup\\X.java (at line 28)\n" +
- " if (t1 == t2) { \n" +
- " ^^^^^^^^\n" +
- "The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" +
+ "----------\n" +
+ "1. ERROR in org\\eclipse\\jdt\\internal\\compiler\\lookup\\X.java (at line 7)\n" +
+ " if (t1 == t2) { \n" +
+ " ^^^^^^^^\n" +
+ "The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" +
+ "----------\n" +
+ "2. ERROR in org\\eclipse\\jdt\\internal\\compiler\\lookup\\X.java (at line 9)\n" +
+ " if (t1 == t2) {\n" +
+ " ^^^^^^^^\n" +
+ "The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" +
+ "----------\n" +
+ "3. ERROR in org\\eclipse\\jdt\\internal\\compiler\\lookup\\X.java (at line 16)\n" +
+ " if (t1 == t2) { \n" +
+ " ^^^^^^^^\n" +
+ "The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" +
+ "----------\n" +
+ "4. ERROR in org\\eclipse\\jdt\\internal\\compiler\\lookup\\X.java (at line 18)\n" +
+ " if (t1 == t2) {\n" +
+ " ^^^^^^^^\n" +
+ "The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" +
+ "----------\n" +
+ "5. ERROR in org\\eclipse\\jdt\\internal\\compiler\\lookup\\X.java (at line 28)\n" +
+ " if (t1 == t2) { \n" +
+ " ^^^^^^^^\n" +
+ "The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -2677,31 +2677,31 @@ public void test0063() throws Exception {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in org\\eclipse\\jdt\\core\\dom\\X.java (at line 9)\n" +
- " if (t1 == t2) { \n" +
- " ^^^^^^^^\n" +
- "The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" +
- "----------\n" +
- "2. ERROR in org\\eclipse\\jdt\\core\\dom\\X.java (at line 11)\n" +
- " if (t1 == t2) {\n" +
- " ^^^^^^^^\n" +
- "The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" +
- "----------\n" +
- "3. ERROR in org\\eclipse\\jdt\\core\\dom\\X.java (at line 18)\n" +
- " if (t1 == t2) { \n" +
- " ^^^^^^^^\n" +
- "The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" +
- "----------\n" +
- "4. ERROR in org\\eclipse\\jdt\\core\\dom\\X.java (at line 20)\n" +
- " if (t1 == t2) {\n" +
- " ^^^^^^^^\n" +
- "The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" +
- "----------\n" +
- "5. ERROR in org\\eclipse\\jdt\\core\\dom\\X.java (at line 30)\n" +
- " if (t1 == t2) { \n" +
- " ^^^^^^^^\n" +
- "The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" +
+ "----------\n" +
+ "1. ERROR in org\\eclipse\\jdt\\core\\dom\\X.java (at line 9)\n" +
+ " if (t1 == t2) { \n" +
+ " ^^^^^^^^\n" +
+ "The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" +
+ "----------\n" +
+ "2. ERROR in org\\eclipse\\jdt\\core\\dom\\X.java (at line 11)\n" +
+ " if (t1 == t2) {\n" +
+ " ^^^^^^^^\n" +
+ "The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" +
+ "----------\n" +
+ "3. ERROR in org\\eclipse\\jdt\\core\\dom\\X.java (at line 18)\n" +
+ " if (t1 == t2) { \n" +
+ " ^^^^^^^^\n" +
+ "The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" +
+ "----------\n" +
+ "4. ERROR in org\\eclipse\\jdt\\core\\dom\\X.java (at line 20)\n" +
+ " if (t1 == t2) {\n" +
+ " ^^^^^^^^\n" +
+ "The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" +
+ "----------\n" +
+ "5. ERROR in org\\eclipse\\jdt\\core\\dom\\X.java (at line 30)\n" +
+ " if (t1 == t2) { \n" +
+ " ^^^^^^^^\n" +
+ "The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -2717,44 +2717,44 @@ public void testBug410218a() {
"import java.util.*;\n" +
"class X {\n" +
" void test() {\n" +
- " Set<Short> set = new HashSet<Short>();\n" +
- " short one = 1;\n" +
- " set.add(one);\n" +
- "\n" +
+ " Set<Short> set = new HashSet<Short>();\n" +
+ " short one = 1;\n" +
+ " set.add(one);\n" +
+ "\n" +
" if (set.contains(\"ONE\")) // bad\n" +
- " set.remove(\"ONE\"); // bad\n" +
+ " set.remove(\"ONE\"); // bad\n" +
" if (set.contains(1)) // bad\n" +
- " set.remove(1); // bad (tries to remove \"Integer 1\")\n" +
- " System.out.println(set); // shows that the \"Short 1\" is still in!\n" +
- "\n" +
+ " set.remove(1); // bad (tries to remove \"Integer 1\")\n" +
+ " System.out.println(set); // shows that the \"Short 1\" is still in!\n" +
+ "\n" +
" if (set.contains(one)) // ok\n" +
- " set.remove(one); // ok\n" +
+ " set.remove(one); // ok\n" +
" if (set.contains(Short.valueOf(one))) // ok\n" +
- " set.remove(Short.valueOf(one)); // ok\n" +
+ " set.remove(Short.valueOf(one)); // ok\n" +
" System.out.println(set);\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " if (set.contains(\"ONE\")) // bad\n" +
- " ^^^^^\n" +
- "Unlikely argument type String for contains(Object) on a Collection<Short>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " set.remove(\"ONE\"); // bad\n" +
- " ^^^^^\n" +
- "Unlikely argument type String for remove(Object) on a Collection<Short>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 10)\n" +
- " if (set.contains(1)) // bad\n" +
- " ^\n" +
- "Unlikely argument type int for contains(Object) on a Collection<Short>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 11)\n" +
- " set.remove(1); // bad (tries to remove \"Integer 1\")\n" +
- " ^\n" +
- "Unlikely argument type int for remove(Object) on a Collection<Short>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " if (set.contains(\"ONE\")) // bad\n" +
+ " ^^^^^\n" +
+ "Unlikely argument type String for contains(Object) on a Collection<Short>\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 9)\n" +
+ " set.remove(\"ONE\"); // bad\n" +
+ " ^^^^^\n" +
+ "Unlikely argument type String for remove(Object) on a Collection<Short>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 10)\n" +
+ " if (set.contains(1)) // bad\n" +
+ " ^\n" +
+ "Unlikely argument type int for contains(Object) on a Collection<Short>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 11)\n" +
+ " set.remove(1); // bad (tries to remove \"Integer 1\")\n" +
+ " ^\n" +
+ "Unlikely argument type int for remove(Object) on a Collection<Short>\n" +
"----------\n");
}
// HashSet vs. TreeSet
@@ -2768,24 +2768,24 @@ public void testBug410218b() {
"class X {\n" +
" <T> void test(Set<HashSet<T>> hss, TreeSet<T> ts, LinkedHashSet<T> lhs) {\n" +
" if (hss.contains(ts)) // bad\n" +
- " hss.remove(ts); // bad\n" +
+ " hss.remove(ts); // bad\n" +
" if (hss.contains((Set<T>)ts)) // ok\n" +
- " hss.remove((Set<T>)ts); // ok\n" +
+ " hss.remove((Set<T>)ts); // ok\n" +
" if (hss.contains(lhs)) // ok\n" +
- " hss.remove(lhs); // ok\n" +
+ " hss.remove(lhs); // ok\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " if (hss.contains(ts)) // bad\n" +
- " ^^\n" +
- "Unlikely argument type TreeSet<T> for contains(Object) on a Collection<HashSet<T>>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " hss.remove(ts); // bad\n" +
- " ^^\n" +
- "Unlikely argument type TreeSet<T> for remove(Object) on a Collection<HashSet<T>>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " if (hss.contains(ts)) // bad\n" +
+ " ^^\n" +
+ "Unlikely argument type TreeSet<T> for contains(Object) on a Collection<HashSet<T>>\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " hss.remove(ts); // bad\n" +
+ " ^^\n" +
+ "Unlikely argument type TreeSet<T> for remove(Object) on a Collection<HashSet<T>>\n" +
"----------\n");
}
// HashSet vs. TreeSet or: strict
@@ -2801,34 +2801,34 @@ public void testBug410218b2() {
"class X {\n" +
" <T> void test(Set<HashSet<T>> hss, TreeSet<T> ts, LinkedHashSet<T> lhs) {\n" +
" if (hss.contains(ts)) // bad\n" +
- " hss.remove(ts); // bad\n" +
+ " hss.remove(ts); // bad\n" +
" if (hss.contains((Set<T>)ts)) // bad (because of strict check)\n" +
- " hss.remove((Set<T>)ts); // bad (because of strict check)\n" +
+ " hss.remove((Set<T>)ts); // bad (because of strict check)\n" +
" if (hss.contains(lhs)) // ok\n" +
- " hss.remove(lhs); // ok\n" +
+ " hss.remove(lhs); // ok\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " if (hss.contains(ts)) // bad\n" +
- " ^^\n" +
- "Unlikely argument type TreeSet<T> for contains(Object) on a Collection<HashSet<T>>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " hss.remove(ts); // bad\n" +
- " ^^\n" +
- "Unlikely argument type TreeSet<T> for remove(Object) on a Collection<HashSet<T>>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " if (hss.contains((Set<T>)ts)) // bad (because of strict check)\n" +
- " ^^^^^^^^^^\n" +
- "Unlikely argument type Set<T> for contains(Object) on a Collection<HashSet<T>>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 7)\n" +
- " hss.remove((Set<T>)ts); // bad (because of strict check)\n" +
- " ^^^^^^^^^^\n" +
- "Unlikely argument type Set<T> for remove(Object) on a Collection<HashSet<T>>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " if (hss.contains(ts)) // bad\n" +
+ " ^^\n" +
+ "Unlikely argument type TreeSet<T> for contains(Object) on a Collection<HashSet<T>>\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " hss.remove(ts); // bad\n" +
+ " ^^\n" +
+ "Unlikely argument type TreeSet<T> for remove(Object) on a Collection<HashSet<T>>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " if (hss.contains((Set<T>)ts)) // bad (because of strict check)\n" +
+ " ^^^^^^^^^^\n" +
+ "Unlikely argument type Set<T> for contains(Object) on a Collection<HashSet<T>>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 7)\n" +
+ " hss.remove((Set<T>)ts); // bad (because of strict check)\n" +
+ " ^^^^^^^^^^\n" +
+ "Unlikely argument type Set<T> for remove(Object) on a Collection<HashSet<T>>\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -2844,46 +2844,46 @@ public void testBug410218c() {
"import java.util.*;\n" +
"class X {\n" +
" Number test(Map<? extends Number, Number> m, boolean f) {\n" +
- " if (m.containsKey(\"ONE\")) // bad\n" +
+ " if (m.containsKey(\"ONE\")) // bad\n" +
+ " m.remove(\"ONE\"); // bad\n" +
+ " if (m.containsValue(\"ONE\")) // bad\n" +
" m.remove(\"ONE\"); // bad\n" +
- " if (m.containsValue(\"ONE\")) // bad\n" +
- " m.remove(\"ONE\"); // bad\n" +
" short one = 1;\n" +
" if (m.containsKey(one)) // almost ok\n" +
" m.remove(one); // almost ok\n" +
- " if (m.containsValue(Short.valueOf(one))) // ok\n" +
- " m.remove(Short.valueOf(one)); // almost ok\n" +
+ " if (m.containsValue(Short.valueOf(one))) // ok\n" +
+ " m.remove(Short.valueOf(one)); // almost ok\n" +
" if (f)\n" +
" return m.get(\"ONE\"); // bad\n" +
" return m.get(one);\n // almost ok\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " if (m.containsKey(\"ONE\")) // bad\n" +
- " ^^^^^\n" +
- "Unlikely argument type String for containsKey(Object) on a Map<capture#1-of ? extends Number,Number>\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " m.remove(\"ONE\"); // bad\n" +
- " ^^^^^\n" +
- "Unlikely argument type String for remove(Object) on a Map<capture#2-of ? extends Number,Number>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 6)\n" +
- " if (m.containsValue(\"ONE\")) // bad\n" +
- " ^^^^^\n" +
- "Unlikely argument type String for containsValue(Object) on a Map<capture#3-of ? extends Number,Number>\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 7)\n" +
- " m.remove(\"ONE\"); // bad\n" +
- " ^^^^^\n" +
- "Unlikely argument type String for remove(Object) on a Map<capture#4-of ? extends Number,Number>\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 14)\n" +
- " return m.get(\"ONE\"); // bad\n" +
- " ^^^^^\n" +
- "Unlikely argument type String for get(Object) on a Map<capture#9-of ? extends Number,Number>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " if (m.containsKey(\"ONE\")) // bad\n" +
+ " ^^^^^\n" +
+ "Unlikely argument type String for containsKey(Object) on a Map<capture#1-of ? extends Number,Number>\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " m.remove(\"ONE\"); // bad\n" +
+ " ^^^^^\n" +
+ "Unlikely argument type String for remove(Object) on a Map<capture#2-of ? extends Number,Number>\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 6)\n" +
+ " if (m.containsValue(\"ONE\")) // bad\n" +
+ " ^^^^^\n" +
+ "Unlikely argument type String for containsValue(Object) on a Map<capture#3-of ? extends Number,Number>\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 7)\n" +
+ " m.remove(\"ONE\"); // bad\n" +
+ " ^^^^^\n" +
+ "Unlikely argument type String for remove(Object) on a Map<capture#4-of ? extends Number,Number>\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 14)\n" +
+ " return m.get(\"ONE\"); // bad\n" +
+ " ^^^^^\n" +
+ "Unlikely argument type String for get(Object) on a Map<capture#9-of ? extends Number,Number>\n" +
"----------\n");
}
// Collection: {contains,remove,retain}All, non-generic sub type of Collection, configured to be ERROR
@@ -2900,19 +2900,19 @@ public void testBug410218d() {
"class X {\n" +
" void test(NumberCollection numbers, List<Integer> ints, Set<String> stringSet) {\n" +
" if (numbers.containsAll(ints)) // ok\n" +
- " numbers.removeAll(ints); // ok\n" +
+ " numbers.removeAll(ints); // ok\n" +
" else\n" +
- " numbers.retainAll(ints); // ok\n" +
- "\n" +
- " numbers.removeAll(stringSet); // bad\n" +
+ " numbers.retainAll(ints); // ok\n" +
+ "\n" +
+ " numbers.removeAll(stringSet); // bad\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " numbers.removeAll(stringSet); // bad\n" +
- " ^^^^^^^^^\n" +
- "Unlikely argument type Set<String> for removeAll(Collection<?>) on a Collection<Number>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " numbers.removeAll(stringSet); // bad\n" +
+ " ^^^^^^^^^\n" +
+ "Unlikely argument type Set<String> for removeAll(Collection<?>) on a Collection<Number>\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -2930,21 +2930,21 @@ public void testBug410218e() {
"import java.util.*;\n" +
"class X {\n" +
" int test1(List<Integer> ints, Object o) {\n" +
- " return ints.indexOf(\"ONE\"); // bad\n" +
+ " return ints.indexOf(\"ONE\"); // bad\n" +
" }\n" +
" @SuppressWarnings(\"unlikely-arg-type\")\n" +
" int test2(List<Integer> ints, boolean f, Object o) {\n" +
" if (f)\n" +
" return ints.indexOf(\"ONE\"); // bad but suppressed\n" +
- " return ints.indexOf(o); // supertype\n" +
+ " return ints.indexOf(o); // supertype\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " return ints.indexOf(\"ONE\"); // bad\n" +
- " ^^^^^\n" +
- "Unlikely argument type String for indexOf(Object) on a List<Integer>\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " return ints.indexOf(\"ONE\"); // bad\n" +
+ " ^^^^^\n" +
+ "Unlikely argument type String for indexOf(Object) on a List<Integer>\n" +
"----------\n",
null/*classLibraries*/,
true/*shouldFlushOutputDirectory*/,
@@ -3102,122 +3102,122 @@ public void testBug410218f() {
"\n" +
"}\n" +
"",
- },
- "----------\n" +
- "1. WARNING in test\\TestUnlikely.java (at line 30)\n" +
- " c.remove(o); // warning: unrelated interface\n" +
- " ^\n" +
- "Unlikely argument type TestUnlikely.OtherInterface for remove(Object) on a Collection<TestUnlikely.Interface>\n" +
- "----------\n" +
- "2. WARNING in test\\TestUnlikely.java (at line 37)\n" +
- " c.remove(i); // warning: unrelated interface\n" +
- " ^\n" +
- "Unlikely argument type TestUnlikely.Interface for remove(Object) on a Collection<TestUnlikely.OtherInterface>\n" +
- "----------\n" +
- "3. WARNING in test\\TestUnlikely.java (at line 39)\n" +
- " c.remove(f); // warning: impossible\n" +
- " ^\n" +
- "Unlikely argument type TestUnlikely.Final for remove(Object) on a Collection<TestUnlikely.OtherInterface>\n" +
- "----------\n" +
- "4. WARNING in test\\TestUnlikely.java (at line 40)\n" +
- " c.remove(nf); // warning: castable, but not supertype\n" +
- " ^^\n" +
- "Unlikely argument type TestUnlikely.NonFinal for remove(Object) on a Collection<TestUnlikely.OtherInterface>\n" +
- "----------\n" +
- "5. WARNING in test\\TestUnlikely.java (at line 46)\n" +
- " c.remove(o); // warning: impossible\n" +
- " ^\n" +
- "Unlikely argument type TestUnlikely.OtherInterface for remove(Object) on a Collection<TestUnlikely.Final>\n" +
- "----------\n" +
- "6. WARNING in test\\TestUnlikely.java (at line 48)\n" +
- " c.remove(nf); // warning: impossible\n" +
- " ^^\n" +
- "Unlikely argument type TestUnlikely.NonFinal for remove(Object) on a Collection<TestUnlikely.Final>\n" +
- "----------\n" +
- "7. WARNING in test\\TestUnlikely.java (at line 49)\n" +
- " c.remove(s); // warning: impossible\n" +
- " ^\n" +
- "Unlikely argument type TestUnlikely.Sub for remove(Object) on a Collection<TestUnlikely.Final>\n" +
- "----------\n" +
- "8. WARNING in test\\TestUnlikely.java (at line 54)\n" +
- " c.remove(o); // warning: unrelated interface\n" +
- " ^\n" +
- "Unlikely argument type TestUnlikely.OtherInterface for remove(Object) on a Collection<TestUnlikely.NonFinal>\n" +
- "----------\n" +
- "9. WARNING in test\\TestUnlikely.java (at line 55)\n" +
- " c.remove(f); // warning: impossible\n" +
- " ^\n" +
- "Unlikely argument type TestUnlikely.Final for remove(Object) on a Collection<TestUnlikely.NonFinal>\n" +
- "----------\n" +
- "10. WARNING in test\\TestUnlikely.java (at line 63)\n" +
- " c.remove(f); // warning: impossible\n" +
- " ^\n" +
- "Unlikely argument type TestUnlikely.Final for remove(Object) on a Collection<TestUnlikely.Sub>\n" +
- "----------\n" +
- "11. WARNING in test\\TestUnlikely.java (at line 70)\n" +
- " map.containsKey(value); // warning\n" +
- " ^^^^^\n" +
- "Unlikely argument type V for containsKey(Object) on a Map<K,V>\n" +
- "----------\n" +
- "12. WARNING in test\\TestUnlikely.java (at line 71)\n" +
- " map.containsValue(key); // warning\n" +
- " ^^^\n" +
- "Unlikely argument type K for containsValue(Object) on a Map<K,V>\n" +
- "----------\n" +
- "13. WARNING in test\\TestUnlikely.java (at line 95)\n" +
- " if (c.contains(iterator.next())) { // warning\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Unlikely argument type U for contains(Object) on a Collection<T>\n" +
- "----------\n" +
- "14. WARNING in test\\TestUnlikely.java (at line 105)\n" +
- " c.removeAll(other); // warning\n" +
- " ^^^^^\n" +
- "Unlikely argument type Set<TestUnlikely.Final> for removeAll(Collection<?>) on a Collection<TestUnlikely.NonFinal>\n" +
- "----------\n" +
- "15. WARNING in test\\TestUnlikely.java (at line 111)\n" +
- " Predicate<OtherInterface> p2 = c::contains; // warning\n" +
- " ^^^^^^^^^^^\n" +
- "Unlikely argument type TestUnlikely.OtherInterface for contains(Object) on a Collection<TestUnlikely.Interface>\n" +
- "----------\n" +
- "16. WARNING in test\\TestUnlikely.java (at line 112)\n" +
- " BiPredicate<Collection<Interface>, OtherInterface> bp2 = Collection<Interface>::contains; // warning\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unlikely argument type TestUnlikely.OtherInterface for contains(Object) on a Collection<TestUnlikely.Interface>\n" +
- "----------\n" +
- "17. INFO in test\\TestUnlikely.java (at line 120)\n" +
- " s.equals(i); // info\n" +
- " ^\n" +
- "Unlikely argument type for equals(): Integer seems to be unrelated to String\n" +
- "----------\n" +
- "18. INFO in test\\TestUnlikely.java (at line 121)\n" +
- " i.equals(s); // info\n" +
- " ^\n" +
- "Unlikely argument type for equals(): String seems to be unrelated to Integer\n" +
- "----------\n" +
- "19. INFO in test\\TestUnlikely.java (at line 125)\n" +
- " Predicate<String> p1 = i::equals; // info\n" +
- " ^^^^^^^^^\n" +
- "Unlikely argument type for equals(): String seems to be unrelated to Integer\n" +
- "----------\n" +
- "20. INFO in test\\TestUnlikely.java (at line 128)\n" +
- " BiPredicate<String, Integer> bp2 = Object::equals; // info\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Unlikely argument type for equals(): Integer seems to be unrelated to String\n" +
- "----------\n" +
- "21. INFO in test\\TestUnlikely.java (at line 131)\n" +
- " Objects.equals(s, i); // info\n" +
- " ^\n" +
- "Unlikely argument type for equals(): Integer seems to be unrelated to String\n" +
- "----------\n" +
- "22. INFO in test\\TestUnlikely.java (at line 132)\n" +
- " Objects.equals(i, s); // info\n" +
- " ^\n" +
- "Unlikely argument type for equals(): String seems to be unrelated to Integer\n" +
- "----------\n" +
- "23. INFO in test\\TestUnlikely.java (at line 136)\n" +
- " BiPredicate<String, Integer> bp3 = Objects::equals; // info\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Unlikely argument type for equals(): Integer seems to be unrelated to String\n" +
+ },
+ "----------\n" +
+ "1. WARNING in test\\TestUnlikely.java (at line 30)\n" +
+ " c.remove(o); // warning: unrelated interface\n" +
+ " ^\n" +
+ "Unlikely argument type TestUnlikely.OtherInterface for remove(Object) on a Collection<TestUnlikely.Interface>\n" +
+ "----------\n" +
+ "2. WARNING in test\\TestUnlikely.java (at line 37)\n" +
+ " c.remove(i); // warning: unrelated interface\n" +
+ " ^\n" +
+ "Unlikely argument type TestUnlikely.Interface for remove(Object) on a Collection<TestUnlikely.OtherInterface>\n" +
+ "----------\n" +
+ "3. WARNING in test\\TestUnlikely.java (at line 39)\n" +
+ " c.remove(f); // warning: impossible\n" +
+ " ^\n" +
+ "Unlikely argument type TestUnlikely.Final for remove(Object) on a Collection<TestUnlikely.OtherInterface>\n" +
+ "----------\n" +
+ "4. WARNING in test\\TestUnlikely.java (at line 40)\n" +
+ " c.remove(nf); // warning: castable, but not supertype\n" +
+ " ^^\n" +
+ "Unlikely argument type TestUnlikely.NonFinal for remove(Object) on a Collection<TestUnlikely.OtherInterface>\n" +
+ "----------\n" +
+ "5. WARNING in test\\TestUnlikely.java (at line 46)\n" +
+ " c.remove(o); // warning: impossible\n" +
+ " ^\n" +
+ "Unlikely argument type TestUnlikely.OtherInterface for remove(Object) on a Collection<TestUnlikely.Final>\n" +
+ "----------\n" +
+ "6. WARNING in test\\TestUnlikely.java (at line 48)\n" +
+ " c.remove(nf); // warning: impossible\n" +
+ " ^^\n" +
+ "Unlikely argument type TestUnlikely.NonFinal for remove(Object) on a Collection<TestUnlikely.Final>\n" +
+ "----------\n" +
+ "7. WARNING in test\\TestUnlikely.java (at line 49)\n" +
+ " c.remove(s); // warning: impossible\n" +
+ " ^\n" +
+ "Unlikely argument type TestUnlikely.Sub for remove(Object) on a Collection<TestUnlikely.Final>\n" +
+ "----------\n" +
+ "8. WARNING in test\\TestUnlikely.java (at line 54)\n" +
+ " c.remove(o); // warning: unrelated interface\n" +
+ " ^\n" +
+ "Unlikely argument type TestUnlikely.OtherInterface for remove(Object) on a Collection<TestUnlikely.NonFinal>\n" +
+ "----------\n" +
+ "9. WARNING in test\\TestUnlikely.java (at line 55)\n" +
+ " c.remove(f); // warning: impossible\n" +
+ " ^\n" +
+ "Unlikely argument type TestUnlikely.Final for remove(Object) on a Collection<TestUnlikely.NonFinal>\n" +
+ "----------\n" +
+ "10. WARNING in test\\TestUnlikely.java (at line 63)\n" +
+ " c.remove(f); // warning: impossible\n" +
+ " ^\n" +
+ "Unlikely argument type TestUnlikely.Final for remove(Object) on a Collection<TestUnlikely.Sub>\n" +
+ "----------\n" +
+ "11. WARNING in test\\TestUnlikely.java (at line 70)\n" +
+ " map.containsKey(value); // warning\n" +
+ " ^^^^^\n" +
+ "Unlikely argument type V for containsKey(Object) on a Map<K,V>\n" +
+ "----------\n" +
+ "12. WARNING in test\\TestUnlikely.java (at line 71)\n" +
+ " map.containsValue(key); // warning\n" +
+ " ^^^\n" +
+ "Unlikely argument type K for containsValue(Object) on a Map<K,V>\n" +
+ "----------\n" +
+ "13. WARNING in test\\TestUnlikely.java (at line 95)\n" +
+ " if (c.contains(iterator.next())) { // warning\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Unlikely argument type U for contains(Object) on a Collection<T>\n" +
+ "----------\n" +
+ "14. WARNING in test\\TestUnlikely.java (at line 105)\n" +
+ " c.removeAll(other); // warning\n" +
+ " ^^^^^\n" +
+ "Unlikely argument type Set<TestUnlikely.Final> for removeAll(Collection<?>) on a Collection<TestUnlikely.NonFinal>\n" +
+ "----------\n" +
+ "15. WARNING in test\\TestUnlikely.java (at line 111)\n" +
+ " Predicate<OtherInterface> p2 = c::contains; // warning\n" +
+ " ^^^^^^^^^^^\n" +
+ "Unlikely argument type TestUnlikely.OtherInterface for contains(Object) on a Collection<TestUnlikely.Interface>\n" +
+ "----------\n" +
+ "16. WARNING in test\\TestUnlikely.java (at line 112)\n" +
+ " BiPredicate<Collection<Interface>, OtherInterface> bp2 = Collection<Interface>::contains; // warning\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unlikely argument type TestUnlikely.OtherInterface for contains(Object) on a Collection<TestUnlikely.Interface>\n" +
+ "----------\n" +
+ "17. INFO in test\\TestUnlikely.java (at line 120)\n" +
+ " s.equals(i); // info\n" +
+ " ^\n" +
+ "Unlikely argument type for equals(): Integer seems to be unrelated to String\n" +
+ "----------\n" +
+ "18. INFO in test\\TestUnlikely.java (at line 121)\n" +
+ " i.equals(s); // info\n" +
+ " ^\n" +
+ "Unlikely argument type for equals(): String seems to be unrelated to Integer\n" +
+ "----------\n" +
+ "19. INFO in test\\TestUnlikely.java (at line 125)\n" +
+ " Predicate<String> p1 = i::equals; // info\n" +
+ " ^^^^^^^^^\n" +
+ "Unlikely argument type for equals(): String seems to be unrelated to Integer\n" +
+ "----------\n" +
+ "20. INFO in test\\TestUnlikely.java (at line 128)\n" +
+ " BiPredicate<String, Integer> bp2 = Object::equals; // info\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Unlikely argument type for equals(): Integer seems to be unrelated to String\n" +
+ "----------\n" +
+ "21. INFO in test\\TestUnlikely.java (at line 131)\n" +
+ " Objects.equals(s, i); // info\n" +
+ " ^\n" +
+ "Unlikely argument type for equals(): Integer seems to be unrelated to String\n" +
+ "----------\n" +
+ "22. INFO in test\\TestUnlikely.java (at line 132)\n" +
+ " Objects.equals(i, s); // info\n" +
+ " ^\n" +
+ "Unlikely argument type for equals(): String seems to be unrelated to Integer\n" +
+ "----------\n" +
+ "23. INFO in test\\TestUnlikely.java (at line 136)\n" +
+ " BiPredicate<String, Integer> bp3 = Objects::equals; // info\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Unlikely argument type for equals(): Integer seems to be unrelated to String\n" +
"----------\n"
,
null/*classLibraries*/,
@@ -3233,14 +3233,14 @@ public void testBug514956a() {
runConformTest(
new String[] {
"Unlikely.java",
- "import java.util.Map;\n" +
- "\n" +
- "interface MApplicationElement {}\n" +
- "interface EObject {}\n" +
- "public class Unlikely {\n" +
- " void m(Map<MApplicationElement, MApplicationElement> map, EObject key) {\n" +
- " map.get((MApplicationElement)key);\n" +
- " }\n" +
+ "import java.util.Map;\n" +
+ "\n" +
+ "interface MApplicationElement {}\n" +
+ "interface EObject {}\n" +
+ "public class Unlikely {\n" +
+ " void m(Map<MApplicationElement, MApplicationElement> map, EObject key) {\n" +
+ " map.get((MApplicationElement)key);\n" +
+ " }\n" +
"}\n"
},
customOptions);
@@ -3252,11 +3252,11 @@ public void testBug514956b() {
runConformTest(
new String[] {
"Unlikely.java",
- "interface EObject {}\n" +
- "public class Unlikely {\n" +
- " boolean m(EObject key) {\n" +
- " return this.equals((Unlikely)key);\n" +
- " }\n" +
+ "interface EObject {}\n" +
+ "public class Unlikely {\n" +
+ " boolean m(EObject key) {\n" +
+ " return this.equals((Unlikely)key);\n" +
+ " }\n" +
"}\n"
},
customOptions);
@@ -3268,33 +3268,33 @@ public void testBug514956c() {
runNegativeTest(
new String[] {
"Unlikely.java",
- "interface I1 {}\n" +
- "interface I2 {}\n" +
- "interface I3 {}\n" +
- "public class Unlikely implements I1 {\n" +
- " boolean m1(I1 i1) {\n" +
+ "interface I1 {}\n" +
+ "interface I2 {}\n" +
+ "interface I3 {}\n" +
+ "public class Unlikely implements I1 {\n" +
+ " boolean m1(I1 i1) {\n" +
" return i1.equals((I1)this);\n" + // not a downcast
- " }\n" +
- " boolean m2(I1 i1, I2 i2) {\n" +
+ " }\n" +
+ " boolean m2(I1 i1, I2 i2) {\n" +
" return i1.equals((I3)i2);\n" + // cast doesn't fix a problem
- " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Unlikely.java (at line 6)\n" +
- " return i1.equals((I1)this);\n" +
- " ^^^^^^^^\n" +
- "Unnecessary cast from Unlikely to I1\n" +
- "----------\n" +
- "2. ERROR in Unlikely.java (at line 9)\n" +
- " return i1.equals((I3)i2);\n" +
- " ^^^^^^\n" +
- "Unnecessary cast from I2 to I3\n" +
- "----------\n" +
- "3. WARNING in Unlikely.java (at line 9)\n" +
- " return i1.equals((I3)i2);\n" +
- " ^^^^^^\n" +
- "Unlikely argument type for equals(): I3 seems to be unrelated to I1\n" +
+ "----------\n" +
+ "1. ERROR in Unlikely.java (at line 6)\n" +
+ " return i1.equals((I1)this);\n" +
+ " ^^^^^^^^\n" +
+ "Unnecessary cast from Unlikely to I1\n" +
+ "----------\n" +
+ "2. ERROR in Unlikely.java (at line 9)\n" +
+ " return i1.equals((I3)i2);\n" +
+ " ^^^^^^\n" +
+ "Unnecessary cast from I2 to I3\n" +
+ "----------\n" +
+ "3. WARNING in Unlikely.java (at line 9)\n" +
+ " return i1.equals((I3)i2);\n" +
+ " ^^^^^^\n" +
+ "Unlikely argument type for equals(): I3 seems to be unrelated to I1\n" +
"----------\n",
null, // classlibs
false, // flush output dir
@@ -3318,7 +3318,7 @@ public void testBug513310() {
" }\n" +
"}\n" +
"",
- }
+ }
);
}
} \ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RecordsRestrictedClassTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RecordsRestrictedClassTest.java
index 8714d6b78..b42388d45 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RecordsRestrictedClassTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RecordsRestrictedClassTest.java
@@ -31,7 +31,7 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
// TESTS_RANGE = new int[] { 1, -1 };
// TESTS_NAMES = new String[] { "testBug560798_002" };
}
-
+
public static Class<?> testClass() {
return RecordsRestrictedClassTest.class;
}
@@ -52,7 +52,7 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
return defaultOptions;
}
-
+
@Override
protected void runConformTest(String[] testFiles, String expectedOutput) {
runConformTest(testFiles, expectedOutput, getCompilerOptions());
@@ -134,11 +134,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"abstract record Point(int x, int y){\n"+
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " abstract record Point(int x, int y){\n" +
- " ^^^^^\n" +
- "Illegal modifier for the record Point; only public, final and strictfp are permitted\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " abstract record Point(int x, int y){\n" +
+ " ^^^^^\n" +
+ "Illegal modifier for the record Point; only public, final and strictfp are permitted\n" +
"----------\n");
}
/* A record declaration is implicitly final. It is permitted for the declaration of
@@ -169,11 +169,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"final final record Point(int x, int y){\n"+
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " final final record Point(int x, int y){\n" +
- " ^^^^^\n" +
- "Duplicate modifier for the type Point\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " final final record Point(int x, int y){\n" +
+ " ^^^^^\n" +
+ "Duplicate modifier for the type Point\n" +
"----------\n");
}
public void testBug550750_005() {
@@ -197,11 +197,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"public public record X(int x, int y){\n"+
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public public record X(int x, int y){\n" +
- " ^\n" +
- "Duplicate modifier for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public public record X(int x, int y){\n" +
+ " ^\n" +
+ "Duplicate modifier for the type X\n" +
"----------\n");
}
public void testBug550750_007() {
@@ -395,16 +395,16 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " public Point(int myInt, char myChar){\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The blank final field myChar may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " public Point(int myInt, char myChar){\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The blank final field myInt may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " public Point(int myInt, char myChar){\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The blank final field myChar may not have been initialized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " public Point(int myInt, char myChar){\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The blank final field myInt may not have been initialized\n" +
"----------\n");
}
public void testBug550750_019() {
@@ -424,11 +424,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " private Point {\n" +
- " ^^^^^\n" +
- "The canonical constructor Point of a record declaration must be declared public.\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " private Point {\n" +
+ " ^^^^^\n" +
+ "The canonical constructor Point of a record declaration must be declared public.\n" +
"----------\n");
}
public void testBug550750_020() {
@@ -448,11 +448,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " protected Point {\n" +
- " ^^^^^\n" +
- "The canonical constructor Point of a record declaration must be declared public.\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " protected Point {\n" +
+ " ^^^^^\n" +
+ "The canonical constructor Point of a record declaration must be declared public.\n" +
"----------\n");
}
public void testBug550750_021() {
@@ -492,11 +492,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " return;\n" +
- " ^^^^^^^\n" +
- "The body of a compact constructor must not contain a return statement\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " return;\n" +
+ " ^^^^^^^\n" +
+ "The body of a compact constructor must not contain a return statement\n" +
"----------\n");
}
public void testBug550750_023() {
@@ -515,11 +515,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " record Point(int myInt, int finalize) implements I {\n" +
- " ^^^^^^^^\n" +
- "Illegal component name finalize in record Point;\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " record Point(int myInt, int finalize) implements I {\n" +
+ " ^^^^^^^^\n" +
+ "Illegal component name finalize in record Point;\n" +
"----------\n");
}
public void testBug550750_024() {
@@ -539,11 +539,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " record Point(int myInt, int finalize, int myZ) implements I {\n" +
- " ^^^^^^^^\n" +
- "Illegal component name finalize in record Point;\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " record Point(int myInt, int finalize, int myZ) implements I {\n" +
+ " ^^^^^^^^\n" +
+ "Illegal component name finalize in record Point;\n" +
"----------\n");
}
public void testBug550750_025() {
@@ -563,11 +563,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " record Point(int myInt, int myZ, int myZ) implements I {\n" +
- " ^^^\n" +
- "Duplicate component myZ in record\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " record Point(int myInt, int myZ, int myZ) implements I {\n" +
+ " ^^^\n" +
+ "Duplicate component myZ in record\n" +
"----------\n");
}
public void testBug550750_026() {
@@ -587,16 +587,16 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " record Point(int myInt, int myInt, int myInt, int myZ) implements I {\n" +
- " ^^^^^\n" +
- "Duplicate component myInt in record\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " record Point(int myInt, int myInt, int myInt, int myZ) implements I {\n" +
- " ^^^^^\n" +
- "Duplicate component myInt in record\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " record Point(int myInt, int myInt, int myInt, int myZ) implements I {\n" +
+ " ^^^^^\n" +
+ "Duplicate component myInt in record\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " record Point(int myInt, int myInt, int myInt, int myZ) implements I {\n" +
+ " ^^^^^\n" +
+ "Duplicate component myInt in record\n" +
"----------\n");
}
public void testBug550750_027() {
@@ -617,11 +617,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " static final int z;\n" +
- " ^\n" +
- "The blank final field z may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " static final int z;\n" +
+ " ^\n" +
+ "The blank final field z may not have been initialized\n" +
"----------\n");
}
public void testBug550750_028() {
@@ -642,11 +642,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " int z;\n" +
- " ^\n" +
- "User declared non-static fields z are not permitted in a record\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " int z;\n" +
+ " ^\n" +
+ "User declared non-static fields z are not permitted in a record\n" +
"----------\n");
}
public void testBug550750_029() {
@@ -667,11 +667,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " public native void foo();\n" +
- " ^^^^^\n" +
- "Illegal modifier native for method foo; native methods are not allowed in record\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " public native void foo();\n" +
+ " ^^^^^\n" +
+ "Illegal modifier native for method foo; native methods are not allowed in record\n" +
"----------\n");
}
public void testBug550750_030() {
@@ -690,13 +690,13 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " {\n" +
- " System.out.println(0);\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Instance Initializer is not allowed in a record declaration\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " {\n" +
+ " System.out.println(0);\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Instance Initializer is not allowed in a record declaration\n" +
"----------\n");
}
public void testBug550750_031() {
@@ -727,11 +727,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
" }\n"+
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " class record {\n" +
- " ^^^^^^\n" +
- "Record is a restricted identifier and hence not a valid type name\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " class record {\n" +
+ " ^^^^^^\n" +
+ "Record is a restricted identifier and hence not a valid type name\n" +
"----------\n");
}
public void testBug550750_033() {
@@ -744,11 +744,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
" }\n"+
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " class X<record> {\n" +
- " ^^^^^^\n" +
- "Record is a restricted identifier and hence not a valid type name\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " class X<record> {\n" +
+ " ^^^^^^\n" +
+ "Record is a restricted identifier and hence not a valid type name\n" +
"----------\n");
}
public void testBug550750_034() {
@@ -762,11 +762,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
" public <record> void foo(record args){}\n"+
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " public <record> void foo(record args){}\n" +
- " ^^^^^^\n" +
- "Record is a restricted identifier and hence not a valid type name\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " public <record> void foo(record args){}\n" +
+ " ^^^^^^\n" +
+ "Record is a restricted identifier and hence not a valid type name\n" +
"----------\n");
}
public void testBug550750_035() {
@@ -780,16 +780,16 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
" public void foo(record args){}\n"+
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " public void foo(record args){}\n" +
- " ^^^^^^\n" +
- "record cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public void foo(record args){}\n" +
- " ^^^^^^\n" +
- "Record is a restricted identifier and hence not a valid type name\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " public void foo(record args){}\n" +
+ " ^^^^^^\n" +
+ "record cannot be resolved to a type\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " public void foo(record args){}\n" +
+ " ^^^^^^\n" +
+ "Record is a restricted identifier and hence not a valid type name\n" +
"----------\n");
}
public void testBug550750_036() {
@@ -806,21 +806,21 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
" public void apply(int i);\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " I lambda = (record r) -> {};\n" +
- " ^^^^^^^^^^^^^\n" +
- "This lambda expression refers to the missing type record\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " I lambda = (record r) -> {};\n" +
- " ^^^^^^\n" +
- "record cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " I lambda = (record r) -> {};\n" +
- " ^^^^^^\n" +
- "Record is a restricted identifier and hence not a valid type name\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " I lambda = (record r) -> {};\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "This lambda expression refers to the missing type record\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " I lambda = (record r) -> {};\n" +
+ " ^^^^^^\n" +
+ "record cannot be resolved to a type\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " I lambda = (record r) -> {};\n" +
+ " ^^^^^^\n" +
+ "Record is a restricted identifier and hence not a valid type name\n" +
"----------\n");
}
public void testBug550750_037() {
@@ -881,11 +881,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
" public Point() {}\n"+
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " private int f;\n" +
- " ^\n" +
- "User declared non-static fields f are not permitted in a record\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " private int f;\n" +
+ " ^\n" +
+ "User declared non-static fields f are not permitted in a record\n" +
"----------\n");
}
public void testBug550750_041() {
@@ -923,11 +923,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " public char myInt() {;\n" +
- " ^^^^\n" +
- "Illegal return type of accessor; should be the same as the declared type int of the record component\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " public char myInt() {;\n" +
+ " ^^^^\n" +
+ "Illegal return type of accessor; should be the same as the declared type int of the record component\n" +
"----------\n");
}
public void testBug553152_002() {
@@ -964,11 +964,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " public <T> int myInt() {;\n" +
- " ^^^^^^^\n" +
- "The accessor method must not be generic\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " public <T> int myInt() {;\n" +
+ " ^^^^^^^\n" +
+ "The accessor method must not be generic\n" +
"----------\n");
}
public void testBug553152_004() {
@@ -990,16 +990,16 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " private int myInt() {;\n" +
- " ^^^^^^^\n" +
- "The accessor method must be declared public\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " /* package */ int myZ() {;\n" +
- " ^^^^^\n" +
- "The accessor method must be declared public\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " private int myInt() {;\n" +
+ " ^^^^^^^\n" +
+ "The accessor method must be declared public\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " /* package */ int myZ() {;\n" +
+ " ^^^^^\n" +
+ "The accessor method must be declared public\n" +
"----------\n");
}
public void testBug553152_005() {
@@ -1018,11 +1018,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " public int myInt() throws Exception {;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Throws clause not allowed for explicitly declared accessor method\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " public int myInt() throws Exception {;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Throws clause not allowed for explicitly declared accessor method\n" +
"----------\n");
}
public void testBug553152_006() {
@@ -1060,11 +1060,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " public Point(Integer myInt, int myZ) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The blank final field myZ may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " public Point(Integer myInt, int myZ) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The blank final field myZ may not have been initialized\n" +
"----------\n");
}
public void testBug553152_008() {
@@ -1088,16 +1088,16 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " public Point {\n" +
- " ^^^^^\n" +
- "Duplicate method Point(Integer, int) in type Point\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " public Point(Integer myInt, int myZ) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate method Point(Integer, int) in type Point\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " public Point {\n" +
+ " ^^^^^\n" +
+ "Duplicate method Point(Integer, int) in type Point\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " public Point(Integer myInt, int myZ) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate method Point(Integer, int) in type Point\n" +
"----------\n");
}
public void testBug553152_009() {
@@ -1117,11 +1117,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " Point(Integer myInt, int myZ) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The canonical constructor Point of a record declaration must be declared public.\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " Point(Integer myInt, int myZ) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The canonical constructor Point of a record declaration must be declared public.\n" +
"----------\n");
}
public void testBug553152_010() {
@@ -1141,11 +1141,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " public <T> Point(Integer myInt, int myZ) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Canonical constructor Point of a record declaration should not be generic\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " public <T> Point(Integer myInt, int myZ) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Canonical constructor Point of a record declaration should not be generic\n" +
"----------\n");
}
public void testBug553152_011() {
@@ -1165,11 +1165,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " public Point(Integer myInt, int myZ) throws Exception {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Throws clause not allowed for canonical constructor Point\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " public Point(Integer myInt, int myZ) throws Exception {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Throws clause not allowed for canonical constructor Point\n" +
"----------\n");
}
public void testBug553152_012() {
@@ -1190,11 +1190,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " return;\n" +
- " ^^^^^^^\n" +
- "The body of a compact constructor must not contain a return statement\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " return;\n" +
+ " ^^^^^^^\n" +
+ "The body of a compact constructor must not contain a return statement\n" +
"----------\n");
}
public void testBug553152_013() {
@@ -1217,11 +1217,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I { void apply();}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type Point\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type Point\n" +
"----------\n");
}
public void testBug553152_014() {
@@ -1242,11 +1242,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " super();\n" +
- " ^^^^^^^^\n" +
- "The body of a canonical constructor must not contain an explicit constructor call\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " super();\n" +
+ " ^^^^^^^^\n" +
+ "The body of a canonical constructor must not contain an explicit constructor call\n" +
"----------\n");
}
public void testBug553152_015() {
@@ -1268,20 +1268,20 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " this.Point(0);\n" +
- " ^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " this.Point(0);\n" +
+ " ^^^^^\n" +
"The method Point(int) is undefined for the type Point\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " public Point(Integer myInt) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 12)\n" +
+ " public Point(Integer myInt) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
"The blank final field myInt may not have been initialized\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 12)\n" +
- " public Point(Integer myInt) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 12)\n" +
+ " public Point(Integer myInt) {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
"The blank final field myZ may not have been initialized\n" +
"----------\n");
}
@@ -1303,11 +1303,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " super();\n" +
- " ^^^^^^^^\n" +
- "The body of a compact constructor must not contain an explicit constructor call\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " super();\n" +
+ " ^^^^^^^^\n" +
+ "The body of a compact constructor must not contain an explicit constructor call\n" +
"----------\n");
}
public void testBug553152_017() {
@@ -1324,10 +1324,10 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n"
},
"----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " record Point(int myInt, char myChar) {}\n" +
- " ^^^^^\n" +
- "Nested Record is (implicitly) static and hence enclosing type should be static\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " record Point(int myInt, char myChar) {}\n" +
+ " ^^^^^\n" +
+ "Nested Record is (implicitly) static and hence enclosing type should be static\n" +
"----------\n");
}
public void _testBug553152_018() {
@@ -1363,11 +1363,11 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " public static int myInt() {;\n" +
- " ^^^^^^^\n" +
- "The accessor method must not be static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " public static int myInt() {;\n" +
+ " ^^^^^^^\n" +
+ "The accessor method must not be static\n" +
"----------\n");
}
public void testBug553153_01() {
@@ -1408,8 +1408,8 @@ public void testBug553153_01() {
},
"----------\n" +
"1. ERROR in X.java (at line 7)\n" +
- " public Point {\n" +
- " ^^^^^\n" +
+ " public Point {\n" +
+ " ^^^^^\n" +
"The blank final field myChar may not have been initialized\n" +
"----------\n");
}
@@ -1427,7 +1427,7 @@ public void testBug553153_003() {
" public Point {\n"+
" this.myInt = myInt;\n" +
" }\n"+
- "}\n" +
+ "}\n" +
"interface I {}\n"
},
"0");
@@ -1449,10 +1449,10 @@ public void testBug553153_004() {
"interface I {}\n"
},
"----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " public Point(int myInt, char myChar) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The blank final field myChar may not have been initialized\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " public Point(int myInt, char myChar) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The blank final field myChar may not have been initialized\n" +
"----------\n");
}
public void testBug558069_001() {
@@ -1467,11 +1467,11 @@ public void testBug558069_001() {
"private record Point(){\n"+
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " private record Point(){\n" +
- " ^^^^^\n" +
- "Illegal modifier for the record Point; only public, final and strictfp are permitted\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " private record Point(){\n" +
+ " ^^^^^\n" +
+ "Illegal modifier for the record Point; only public, final and strictfp are permitted\n" +
"----------\n");
}
public void testBug558069_002() {
@@ -1591,10 +1591,10 @@ public void testBug558494_001() throws Exception {
"}\n"
},
"0");
- String expectedOutput = "Record: #Record\n" +
- "Components:\n" +
- " \n" +
- "// Component descriptor #6 I\n" +
+ String expectedOutput = "Record: #Record\n" +
+ "Components:\n" +
+ " \n" +
+ "// Component descriptor #6 I\n" +
"int heyPinkCity;\n";
RecordsRestrictedClassTest.verifyClassFile(expectedOutput, "Point.class", ClassFileBytesDisassembler.SYSTEM);
}
@@ -1615,8 +1615,8 @@ public void testBug558494_002() throws Exception {
"}\n"
},
"Point@1");
- String expectedOutput = "Record: #Record\n" +
- "Components:\n" +
+ String expectedOutput = "Record: #Record\n" +
+ "Components:\n" +
" \n";
RecordsRestrictedClassTest.verifyClassFile(expectedOutput, "Point.class", ClassFileBytesDisassembler.SYSTEM);
}
@@ -1635,8 +1635,8 @@ public void testBug558494_003() throws Exception {
"}\n"
},
"");
- String expectedOutput = "Record: #Record\n" +
- "Components:\n" +
+ String expectedOutput = "Record: #Record\n" +
+ "Components:\n" +
" \n";
RecordsRestrictedClassTest.verifyClassFile(expectedOutput, "Forts.class", ClassFileBytesDisassembler.SYSTEM);
}
@@ -1655,7 +1655,7 @@ public void testBug558494_004() throws Exception {
"}\n"
},
"");
- String expectedOutput =
+ String expectedOutput =
"Record: #Record\n" +
"Components:\n" +
" \n" +
@@ -1697,11 +1697,11 @@ public void testBug558764_002() {
" }\n"+
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " record Point(@MyAnnotation int myInt, char myChar) {}\n" +
- " ^^^^^^^^^^^^^\n" +
- "The annotation @MyAnnotation is disallowed for this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " record Point(@MyAnnotation int myInt, char myChar) {}\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The annotation @MyAnnotation is disallowed for this location\n" +
"----------\n");
}
public void testBug558764_003() {
@@ -1731,17 +1731,17 @@ public void testBug558764_004() {
" @Target({ElementType.RECORD_COMPONENT})\n"+
" @interface MyAnnotation {}\n" +
"class X {\n"+
- " public @MyAnnotation String f = \"hello\";\n" +
+ " public @MyAnnotation String f = \"hello\";\n" +
" public static void main(String[] args){\n"+
" System.out.println(0);\n" +
" }\n"+
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " public @MyAnnotation String f = \"hello\";\n" +
- " ^^^^^^^^^^^^^\n" +
- "The annotation @MyAnnotation is disallowed for this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " public @MyAnnotation String f = \"hello\";\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The annotation @MyAnnotation is disallowed for this location\n" +
"----------\n");
}
public void testBug553567_001() {
@@ -1754,11 +1754,11 @@ public void testBug553567_001() {
" }\n"+
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " class X extends Record{\n" +
- " ^^^^^^\n" +
- "The type X may not subclass Record explicitly\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " class X extends Record{\n" +
+ " ^^^^^^\n" +
+ "The type X may not subclass Record explicitly\n" +
"----------\n");
}
public void testBug553567_002() {
@@ -1833,15 +1833,15 @@ public void testBug559448_002() {
"}\n"
},
"----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " record Point(int... x, int y){\n" +
- " ^\n" +
- "The variable argument type int of the record Point must be the last parameter\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " record Point(int... x, int y){\n" +
- " ^\n" +
- "The variable argument type int of the method Point must be the last parameter\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " record Point(int... x, int y){\n" +
+ " ^\n" +
+ "The variable argument type int of the record Point must be the last parameter\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " record Point(int... x, int y){\n" +
+ " ^\n" +
+ "The variable argument type int of the method Point must be the last parameter\n" +
"----------\n");
}
public void testBug559448_003() {
@@ -1857,15 +1857,15 @@ public void testBug559448_003() {
"}\n"
},
"----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " record Point(int... x, int... y){\n" +
- " ^\n" +
- "The variable argument type int of the record Point must be the last parameter\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " record Point(int... x, int... y){\n" +
- " ^\n" +
- "The variable argument type int of the method Point must be the last parameter\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " record Point(int... x, int... y){\n" +
+ " ^\n" +
+ "The variable argument type int of the record Point must be the last parameter\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " record Point(int... x, int... y){\n" +
+ " ^\n" +
+ "The variable argument type int of the method Point must be the last parameter\n" +
"----------\n");
}
public void testBug559574_001() {
@@ -1881,25 +1881,25 @@ public void testBug559574_001() {
"}\n"
},
"----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public XX3 {}\n" +
- " ^^^\n" +
- "Return type for the method is missing\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " public XX3(int x, int y, int z) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Return type for the method is missing\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 3)\n" +
- " public XX3(int x, int y, int z) {\n" +
- " ^\n" +
- "The parameter x is hiding a field from type X\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " this.y = y;\n" +
- " ^\n" +
- "y cannot be resolved or is not a field\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public XX3 {}\n" +
+ " ^^^\n" +
+ "Return type for the method is missing\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " public XX3(int x, int y, int z) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Return type for the method is missing\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 3)\n" +
+ " public XX3(int x, int y, int z) {\n" +
+ " ^\n" +
+ "The parameter x is hiding a field from type X\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " this.y = y;\n" +
+ " ^\n" +
+ "y cannot be resolved or is not a field\n" +
"----------\n");
}
public void testBug559992_001() {
@@ -1911,11 +1911,11 @@ public void testBug559992_001() {
" }\n"+
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public R throws Exception {\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Throws clause not allowed for canonical constructor R\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public R throws Exception {\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Throws clause not allowed for canonical constructor R\n" +
"----------\n");
}
public void testBug559992_002() {
@@ -1927,11 +1927,11 @@ public void testBug559992_002() {
" }\n"+
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public R() throws Exception {\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Throws clause not allowed for canonical constructor R\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public R() throws Exception {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Throws clause not allowed for canonical constructor R\n" +
"----------\n");
}
public void testBug560256_001() {
@@ -1946,11 +1946,11 @@ public void testBug560256_001() {
"final protected record Point(int x, int y){\n"+
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " final protected record Point(int x, int y){\n" +
- " ^^^^^\n" +
- "Illegal modifier for the record Point; only public, final and strictfp are permitted\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " final protected record Point(int x, int y){\n" +
+ " ^^^^^\n" +
+ "Illegal modifier for the record Point; only public, final and strictfp are permitted\n" +
"----------\n");
}
public void testBug560256_002() {
@@ -1965,11 +1965,11 @@ public void testBug560256_002() {
"native record Point(int x, int y){\n"+
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " native record Point(int x, int y){\n" +
- " ^^^^^\n" +
- "Illegal modifier for the record Point; only public, final and strictfp are permitted\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " native record Point(int x, int y){\n" +
+ " ^^^^^\n" +
+ "Illegal modifier for the record Point; only public, final and strictfp are permitted\n" +
"----------\n");
}
public void testBug560256_003() {
@@ -1982,11 +1982,11 @@ public void testBug560256_003() {
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " record Point(int x, int y){}\n" +
- " ^^^^^\n" +
- "Nested Record is (implicitly) static and hence enclosing type should be static\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " record Point(int x, int y){}\n" +
+ " ^^^^^\n" +
+ "Nested Record is (implicitly) static and hence enclosing type should be static\n" +
"----------\n");
}
public void testBug560256_004() {
@@ -1999,11 +1999,11 @@ public void testBug560256_004() {
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " native record Point(int x, int y){}\n" +
- " ^^^^^\n" +
- "Illegal modifier for the record Point; only public, private, protected, static, final and strictfp are permitted\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " native record Point(int x, int y){}\n" +
+ " ^^^^^\n" +
+ "Illegal modifier for the record Point; only public, private, protected, static, final and strictfp are permitted\n" +
"----------\n");
}
public void testBug560531_001() {
@@ -2061,13 +2061,13 @@ public void testBug560569_001() throws Exception {
"}\n"
},
"true");
- String expectedOutput =
- "Bootstrap methods:\n" +
- " 0 : # 68 invokestatic java/lang/runtime/ObjectMethods.bootstrap:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/TypeDescriptor;Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/invoke/MethodHandle;)Ljava/lang/Object;\n" +
- " Method arguments:\n" +
- " #1 Car\n" +
- " #69 model;year\n" +
- " #71 REF_getField model:Ljava/lang/String;\n" +
+ String expectedOutput =
+ "Bootstrap methods:\n" +
+ " 0 : # 68 invokestatic java/lang/runtime/ObjectMethods.bootstrap:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/TypeDescriptor;Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/invoke/MethodHandle;)Ljava/lang/Object;\n" +
+ " Method arguments:\n" +
+ " #1 Car\n" +
+ " #69 model;year\n" +
+ " #71 REF_getField model:Ljava/lang/String;\n" +
" #72 REF_getField year:I\n";
RecordsRestrictedClassTest.verifyClassFile(expectedOutput, "Car.class", ClassFileBytesDisassembler.SYSTEM);
}
@@ -2083,7 +2083,7 @@ public void testBug560496_001() throws Exception {
"}\n"
},
"0");
- String expectedOutput =
+ String expectedOutput =
"public final int hashCode();\n";
RecordsRestrictedClassTest.verifyClassFile(expectedOutput, "R.class", ClassFileBytesDisassembler.SYSTEM);
}
@@ -2099,7 +2099,7 @@ public void testBug560496_002() throws Exception {
"}\n"
},
"0");
- String expectedOutput =
+ String expectedOutput =
"public final strictfp int hashCode();\n";
RecordsRestrictedClassTest.verifyClassFile(expectedOutput, "R.class", ClassFileBytesDisassembler.SYSTEM);
}
@@ -2115,7 +2115,7 @@ public void testBug560797_001() throws Exception {
"}\n"
},
"true");
- String expectedOutput =
+ String expectedOutput =
"public strictfp int x();\n";
RecordsRestrictedClassTest.verifyClassFile(expectedOutput, "R.class", ClassFileBytesDisassembler.SYSTEM);
}
@@ -2133,7 +2133,7 @@ public void testBug560797_002() throws Exception {
"}\n"
},
"true");
- String expectedOutput =
+ String expectedOutput =
"public strictfp int x();\n";
RecordsRestrictedClassTest.verifyClassFile(expectedOutput, "R.class", ClassFileBytesDisassembler.SYSTEM);
}
@@ -2160,7 +2160,7 @@ public void testBug560798_002() {
"X.java",
"import java.lang.annotation.Target;\n"+
"import java.lang.annotation.ElementType;\n"+
- "@Target({ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.LOCAL_VARIABLE,\n" +
+ "@Target({ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.LOCAL_VARIABLE,\n" +
" ElementType.MODULE, ElementType.PACKAGE, ElementType.TYPE, ElementType.TYPE_PARAMETER})\n"+
"@interface MyAnnot {}\n"+
"record R(@MyAnnot() int i, int j) {}\n" +
@@ -2169,11 +2169,11 @@ public void testBug560798_002() {
" }\n"+
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " record R(@MyAnnot() int i, int j) {}\n" +
- " ^^^^^^^^\n" +
- "The annotation @MyAnnot is disallowed for this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " record R(@MyAnnot() int i, int j) {}\n" +
+ " ^^^^^^^^\n" +
+ "The annotation @MyAnnot is disallowed for this location\n" +
"----------\n");
}
public void testBug560798_003() throws Exception {
@@ -2236,11 +2236,11 @@ public void testBug560770_001() {
"X.java",
"record R() {}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " record R() {}\n" +
- " ^\n" +
- "You are using a preview language feature that may or may not be supported in a future release\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " record R() {}\n" +
+ " ^\n" +
+ "You are using a preview language feature that may or may not be supported in a future release\n" +
"----------\n",
null,
true,
@@ -2361,16 +2361,16 @@ public void testBug560893_007() {
" }\n"+
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " System.out.println(li); // error, local variable\n" +
- " ^^\n" +
- "Cannot make a static reference to the non-static variable li from a local record\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " System.out.println(nsi); // error, non-static member\n" +
- " ^^^\n" +
- "Cannot make a static reference to the non-static field nsi\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " System.out.println(li); // error, local variable\n" +
+ " ^^\n" +
+ "Cannot make a static reference to the non-static variable li from a local record\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " System.out.println(nsi); // error, non-static member\n" +
+ " ^^^\n" +
+ "Cannot make a static reference to the non-static field nsi\n" +
"----------\n");
}
} \ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RepeatableAnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RepeatableAnnotationTest.java
index 2fe3168dd..3f57e330c 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RepeatableAnnotationTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RepeatableAnnotationTest.java
@@ -81,16 +81,16 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"public @interface Foo {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public @Foo @Foo class X {\n" +
- " ^^^^\n" +
- "Duplicate annotation of non-repeatable type @Foo. Only annotation types marked @Repeatable can be used multiple times at one target.\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " public @Foo @Foo class X {\n" +
- " ^^^^\n" +
- "Duplicate annotation of non-repeatable type @Foo. Only annotation types marked @Repeatable can be used multiple times at one target.\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public @Foo @Foo class X {\n" +
+ " ^^^^\n" +
+ "Duplicate annotation of non-repeatable type @Foo. Only annotation types marked @Repeatable can be used multiple times at one target.\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 1)\n" +
+ " public @Foo @Foo class X {\n" +
+ " ^^^^\n" +
+ "Duplicate annotation of non-repeatable type @Foo. Only annotation types marked @Repeatable can be used multiple times at one target.\n" +
"----------\n");
}
@@ -112,7 +112,7 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"");
}
- // check repeated occurrence of annotation where annotation container is not valid for the target
+ // check repeated occurrence of annotation where annotation container is not valid for the target
public void test003() {
this.runNegativeTest(
new String[] {
@@ -120,7 +120,7 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"import java.lang.annotation.ElementType;\n" +
"import java.lang.annotation.Target;\n" +
"@Target({ElementType.METHOD, ElementType.FIELD}) public @interface FooContainer {\n" +
-
+
" Foo[] value();\n" +
"}\n",
"Foo.java",
@@ -135,16 +135,16 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
" @Foo class Y {} /* No problem since not repeated */\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " @Foo @Foo public class X { /* Problem */\n" +
- " ^^^^\n" +
- "The annotation @Foo cannot be repeated at this location since its container annotation type @FooContainer is disallowed at this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " @Foo @Foo int local = 0; /* Problem! */\n" +
- " ^^^^\n" +
- "The annotation @Foo cannot be repeated at this location since its container annotation type @FooContainer is disallowed at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " @Foo @Foo public class X { /* Problem */\n" +
+ " ^^^^\n" +
+ "The annotation @Foo cannot be repeated at this location since its container annotation type @FooContainer is disallowed at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " @Foo @Foo int local = 0; /* Problem! */\n" +
+ " ^^^^\n" +
+ "The annotation @Foo cannot be repeated at this location since its container annotation type @FooContainer is disallowed at this location\n" +
"----------\n");
}
@@ -161,7 +161,7 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"Foo.java",
"@java.lang.annotation.Repeatable(FooContainer.class) public @interface Foo {\n" +
"}\n"
- },
+ },
"");
Runner runner = new Runner();
runner.testFiles =
@@ -171,11 +171,11 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " @Foo @Foo public class X { /* Problem */\n" +
- " ^^^^\n" +
- "The annotation @Foo cannot be repeated at this location since its container annotation type @FooContainer is disallowed at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " @Foo @Foo public class X { /* Problem */\n" +
+ " ^^^^\n" +
+ "The annotation @Foo cannot be repeated at this location since its container annotation type @FooContainer is disallowed at this location\n" +
"----------\n";
runner.shouldFlushOutputDirectory = false;
runner.javacTestOptions = JavacTestOptions.JavacHasABug.JavacBug8044196;
@@ -190,7 +190,7 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"@java.lang.annotation.Repeatable(FooContainer.class) @interface Foo {}\n" +
"@interface FooContainer { Foo[] value(); }\n" +
"@Foo @FooContainer({@Foo, @Foo}) public class X { /* Not a problem */ }\n"
- },
+ },
"");
}
@@ -202,12 +202,12 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"@interface FooContainer { Foo[] value(); }\n" +
"@java.lang.annotation.Repeatable(FooContainer.class) @interface Foo {}\n" +
"@Foo @Foo @FooContainer({@Foo, @Foo}) public class X { /* A problem */ }\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " @Foo @Foo @FooContainer({@Foo, @Foo}) public class X { /* A problem */ }\n" +
- " ^^^^\n" +
- "The repeatable annotation @Foo may not be repeated where its container annotation type @FooContainer is also used directly\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " @Foo @Foo @FooContainer({@Foo, @Foo}) public class X { /* A problem */ }\n" +
+ " ^^^^\n" +
+ "The repeatable annotation @Foo may not be repeated where its container annotation type @FooContainer is also used directly\n" +
"----------\n");
}
@@ -220,15 +220,15 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"@java.lang.annotation.Repeatable(FooContainerContainer.class) @interface FooContainer { Foo[] value(); }\n" +
"@java.lang.annotation.Repeatable(FooContainer.class) @interface Foo {}\n" +
"@Foo @Foo @FooContainer({@Foo, @Foo}) public class X { /* Still a problem */ }\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " @Foo @Foo @FooContainer({@Foo, @Foo}) public class X { /* Still a problem */ }\n" +
- " ^^^^\n" +
- "The repeatable annotation @Foo may not be repeated where its container annotation type @FooContainer is also used directly\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " @Foo @Foo @FooContainer({@Foo, @Foo}) public class X { /* Still a problem */ }\n" +
+ " ^^^^\n" +
+ "The repeatable annotation @Foo may not be repeated where its container annotation type @FooContainer is also used directly\n" +
"----------\n");
}
-
+
// Test that an repeated annotation can't occur together with its container annotation, even if it itself is repeatable.
public void test007a() {
this.runNegativeTest(
@@ -239,22 +239,22 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"@java.lang.annotation.Repeatable(FooContainer.class) @interface Foo {}\n" +
"@interface Bar {}\n" +
"@Foo @Foo @Bar @Bar @FooContainer({@Foo, @Foo}) public class X { /* Still a problem */ }\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " @Foo @Foo @Bar @Bar @FooContainer({@Foo, @Foo}) public class X { /* Still a problem */ }\n" +
- " ^^^^\n" +
- "The repeatable annotation @Foo may not be repeated where its container annotation type @FooContainer is also used directly\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " @Foo @Foo @Bar @Bar @FooContainer({@Foo, @Foo}) public class X { /* Still a problem */ }\n" +
- " ^^^^\n" +
- "Duplicate annotation of non-repeatable type @Bar. Only annotation types marked @Repeatable can be used multiple times at one target.\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " @Foo @Foo @Bar @Bar @FooContainer({@Foo, @Foo}) public class X { /* Still a problem */ }\n" +
- " ^^^^\n" +
- "Duplicate annotation of non-repeatable type @Bar. Only annotation types marked @Repeatable can be used multiple times at one target.\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " @Foo @Foo @Bar @Bar @FooContainer({@Foo, @Foo}) public class X { /* Still a problem */ }\n" +
+ " ^^^^\n" +
+ "The repeatable annotation @Foo may not be repeated where its container annotation type @FooContainer is also used directly\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " @Foo @Foo @Bar @Bar @FooContainer({@Foo, @Foo}) public class X { /* Still a problem */ }\n" +
+ " ^^^^\n" +
+ "Duplicate annotation of non-repeatable type @Bar. Only annotation types marked @Repeatable can be used multiple times at one target.\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " @Foo @Foo @Bar @Bar @FooContainer({@Foo, @Foo}) public class X { /* Still a problem */ }\n" +
+ " ^^^^\n" +
+ "Duplicate annotation of non-repeatable type @Bar. Only annotation types marked @Repeatable can be used multiple times at one target.\n" +
"----------\n");
}
@@ -268,12 +268,12 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"@java.lang.annotation.Repeatable(FooContainer.class) @interface Foo {}\n" +
"@interface FooContainer { Foo[] value(); }\n" +
"@Foo @Bar @Foo /* just lexical */ @Foo public class X { /* Gives a warning */ }\n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " @Foo @Bar @Foo /* just lexical */ @Foo public class X { /* Gives a warning */ }\n" +
- " ^^^^\n" +
- "Repeated @Foo annotations are not grouped together\n" +
+ },
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " @Foo @Bar @Foo /* just lexical */ @Foo public class X { /* Gives a warning */ }\n" +
+ " ^^^^\n" +
+ "Repeated @Foo annotations are not grouped together\n" +
"----------\n");
}
// Test that deprecation of container annotation is reflected in the repeated annotation (disabled until specification clarification is available)
@@ -283,9 +283,9 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"Y.java",
"@java.lang.annotation.Repeatable(FooContainer.class) @interface Foo { int value(); }\n" +
"@Deprecated @interface FooContainer { Foo[] value(); }\n" +
- "@Foo(0) class X { /* Gives a warning */ }\n" +
+ "@Foo(0) class X { /* Gives a warning */ }\n" +
"@Foo(1) @Foo(2) public class Y { /* Gives a warning */ }\n"
- },
+ },
new ASTVisitor() {
public boolean visit(
TypeDeclaration typeDeclaration,
@@ -313,12 +313,12 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"}\n" +
"@java.lang.annotation.Repeatable(FooContainer.class)\n" +
"@interface Foo {}\n"
- },
- "----------\n" +
- "1. ERROR in Foo.java (at line 3)\n" +
- " @java.lang.annotation.Repeatable(FooContainer.class)\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The container annotation type @FooContainer must declare a member value()\n" +
+ },
+ "----------\n" +
+ "1. ERROR in Foo.java (at line 3)\n" +
+ " @java.lang.annotation.Repeatable(FooContainer.class)\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "The container annotation type @FooContainer must declare a member value()\n" +
"----------\n");
}
// 412151: The collections type's (TC) declaration must have a array of Ts as its value() - with Foo and FooContainer in same compilation round
@@ -331,12 +331,12 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"}\n" +
"@java.lang.annotation.Repeatable(FooContainer.class)\n" +
"@interface Foo {}\n"
- },
- "----------\n" +
- "1. ERROR in Foo.java (at line 4)\n" +
- " @java.lang.annotation.Repeatable(FooContainer.class)\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The value method in the container annotation type @FooContainer must be of type Foo[] but is int[]\n" +
+ },
+ "----------\n" +
+ "1. ERROR in Foo.java (at line 4)\n" +
+ " @java.lang.annotation.Repeatable(FooContainer.class)\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "The value method in the container annotation type @FooContainer must be of type Foo[] but is int[]\n" +
"----------\n");
}
// 412151: The collections type's (TC) declaration must have a array of Ts as its value() - with Foo and FooContainer in same compilation round
@@ -350,16 +350,16 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"@java.lang.annotation.Repeatable(FooContainer.class)\n" +
"@interface Foo {}\n"
},
- "----------\n" +
- "1. ERROR in Foo.java (at line 2)\n" +
- " Foo[][] value();\n" +
- " ^^^^^^^\n" +
- "Invalid type Foo[][] for the annotation attribute FooContainer.value; only primitive type, String, Class, annotation, enumeration are permitted or 1-dimensional arrays thereof\n" +
- "----------\n" +
- "2. ERROR in Foo.java (at line 4)\n" +
- " @java.lang.annotation.Repeatable(FooContainer.class)\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The value method in the container annotation type @FooContainer must be of type Foo[] but is Foo[][]\n" +
+ "----------\n" +
+ "1. ERROR in Foo.java (at line 2)\n" +
+ " Foo[][] value();\n" +
+ " ^^^^^^^\n" +
+ "Invalid type Foo[][] for the annotation attribute FooContainer.value; only primitive type, String, Class, annotation, enumeration are permitted or 1-dimensional arrays thereof\n" +
+ "----------\n" +
+ "2. ERROR in Foo.java (at line 4)\n" +
+ " @java.lang.annotation.Repeatable(FooContainer.class)\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "The value method in the container annotation type @FooContainer must be of type Foo[] but is Foo[][]\n" +
"----------\n"
);
}
@@ -375,12 +375,12 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"}\n" +
"@java.lang.annotation.Repeatable(FooContainer.class)\n" +
"@interface Foo {}\n"
- },
- "----------\n" +
- "1. ERROR in Foo.java (at line 6)\n" +
- " @java.lang.annotation.Repeatable(FooContainer.class)\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The container annotation type @FooContainer must declare a default value for the annotation attribute \'doesntHaveDefaultValue\'\n" +
+ },
+ "----------\n" +
+ "1. ERROR in Foo.java (at line 6)\n" +
+ " @java.lang.annotation.Repeatable(FooContainer.class)\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "The container annotation type @FooContainer must declare a default value for the annotation attribute \'doesntHaveDefaultValue\'\n" +
"----------\n");
}
// 412151: The @Retention meta-annotation of TC must at least include the retention of T ()
@@ -388,8 +388,8 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
this.runConformTest(
new String[] {
"Foo.java",
- "import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
"@Retention(RetentionPolicy.CLASS)\n" +
"@interface FooContainer {\n" +
" Foo[] value();\n" +
@@ -398,11 +398,11 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"@Retention(RetentionPolicy.CLASS)\n" +
"@interface Foo {\n" +
"}\n"
- },
+ },
"");
}
- //
+ //
public void test015() {
// These are fine:
this.runConformTest(
@@ -414,7 +414,7 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"Foo.java",
"@java.lang.annotation.Repeatable(FooContainer.class) public @interface Foo {\n" +
"}\n"
- },
+ },
"");
// This changes FooContainer without re-checking Foo
this.runConformTest(
@@ -434,11 +434,11 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"@Foo @Foo public class X { /* Problem since Foo now uses FooContainer which doesn't work anymore*/\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " @Foo @Foo public class X { /* Problem since Foo now uses FooContainer which doesn\'t work anymore*/\n" +
- " ^^^^\n" +
- "The value method in the container annotation type @FooContainer must be of type Foo[] but is int[]\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " @Foo @Foo public class X { /* Problem since Foo now uses FooContainer which doesn\'t work anymore*/\n" +
+ " ^^^^\n" +
+ "The value method in the container annotation type @FooContainer must be of type Foo[] but is int[]\n" +
"----------\n",
null, false /* don't flush*/);
}
@@ -449,19 +449,19 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
this.runNegativeTest(
new String[] {
"Foo.java",
- "import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
"@Retention(RetentionPolicy.SOURCE)\n" +
"@interface FooContainer { Foo[] value(); }\n" +
"@java.lang.annotation.Repeatable(FooContainer.class)\n" +
"@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface Foo { }\n"
- },
- "----------\n" +
- "1. ERROR in Foo.java (at line 5)\n" +
- " @java.lang.annotation.Repeatable(FooContainer.class)\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Retention \'RUNTIME\' of @Foo is longer than the retention of its container annotation type @FooContainer, which is \'SOURCE\'\n" +
+ },
+ "----------\n" +
+ "1. ERROR in Foo.java (at line 5)\n" +
+ " @java.lang.annotation.Repeatable(FooContainer.class)\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Retention \'RUNTIME\' of @Foo is longer than the retention of its container annotation type @FooContainer, which is \'SOURCE\'\n" +
"----------\n");
}
@@ -471,18 +471,18 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
this.runNegativeTest(
new String[] {
"Foo.java",
- "import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
"@Retention(RetentionPolicy.SOURCE)\n" +
"@interface FooContainer { Foo[] value(); }\n" +
"@java.lang.annotation.Repeatable(FooContainer.class)\n" +
"@interface Foo { }\n"
- },
- "----------\n" +
- "1. ERROR in Foo.java (at line 5)\n" +
- " @java.lang.annotation.Repeatable(FooContainer.class)\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Retention \'CLASS\' of @Foo is longer than the retention of its container annotation type @FooContainer, which is \'SOURCE\'\n" +
+ },
+ "----------\n" +
+ "1. ERROR in Foo.java (at line 5)\n" +
+ " @java.lang.annotation.Repeatable(FooContainer.class)\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Retention \'CLASS\' of @Foo is longer than the retention of its container annotation type @FooContainer, which is \'SOURCE\'\n" +
"----------\n");
}
@@ -492,18 +492,18 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
this.runNegativeTest(
new String[] {
"Foo.java",
- "import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
"@interface FooContainer { Foo[] value(); }\n" +
"@java.lang.annotation.Repeatable(FooContainer.class)\n" +
"@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface Foo { }\n"
- },
- "----------\n" +
- "1. ERROR in Foo.java (at line 4)\n" +
- " @java.lang.annotation.Repeatable(FooContainer.class)\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Retention \'RUNTIME\' of @Foo is longer than the retention of its container annotation type @FooContainer, which is \'CLASS\'\n" +
+ },
+ "----------\n" +
+ "1. ERROR in Foo.java (at line 4)\n" +
+ " @java.lang.annotation.Repeatable(FooContainer.class)\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Retention \'RUNTIME\' of @Foo is longer than the retention of its container annotation type @FooContainer, which is \'CLASS\'\n" +
"----------\n");
}
@@ -513,8 +513,8 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
this.runConformTest(
new String[] {
"Foo.java",
- "import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
"@interface FooContainer { Foo[] value(); }\n" +
"@java.lang.annotation.Repeatable(FooContainer.class)\n" +
"@Retention(RetentionPolicy.SOURCE)\n" +
@@ -528,13 +528,13 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
this.runConformTest(
new String[] {
"FooContainer.java",
- "import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
"@Retention(RetentionPolicy.SOURCE)\n" +
"public @interface FooContainer { Foo[] value(); }\n",
"Foo.java",
- "import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
"@Retention(RetentionPolicy.SOURCE)\n" +
"@java.lang.annotation.Repeatable(FooContainer.class)\n" +
"public @interface Foo { }\n"
@@ -544,12 +544,12 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"Foo.java",
"@java.lang.annotation.Repeatable(FooContainer.class)\n" +
"public @interface Foo { } // If omitted, retention is class\n"
- },
- "----------\n" +
- "1. ERROR in Foo.java (at line 1)\n" +
- " @java.lang.annotation.Repeatable(FooContainer.class)\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Retention \'CLASS\' of @Foo is longer than the retention of its container annotation type @FooContainer, which is \'SOURCE\'\n" +
+ },
+ "----------\n" +
+ "1. ERROR in Foo.java (at line 1)\n" +
+ " @java.lang.annotation.Repeatable(FooContainer.class)\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Retention \'CLASS\' of @Foo is longer than the retention of its container annotation type @FooContainer, which is \'SOURCE\'\n" +
"----------\n",
null, false /* don't flush*/);
}
@@ -560,29 +560,29 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
this.runConformTest(
new String[] {
"FooContainer.java",
- "import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
"public @interface FooContainer { Foo[] value(); }\n",
"Foo.java",
- "import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
"@java.lang.annotation.Repeatable(FooContainer.class)\n" +
"public @interface Foo { }\n"
});
this.runNegativeTest(
new String[] {
"Foo.java",
- "import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.RetentionPolicy;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import java.lang.annotation.RetentionPolicy;\n" +
"@java.lang.annotation.Repeatable(FooContainer.class)\n" +
"@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface Foo { }\n"
- },
- "----------\n" +
- "1. ERROR in Foo.java (at line 3)\n" +
- " @java.lang.annotation.Repeatable(FooContainer.class)\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Retention \'RUNTIME\' of @Foo is longer than the retention of its container annotation type @FooContainer, which is \'CLASS\'\n" +
+ },
+ "----------\n" +
+ "1. ERROR in Foo.java (at line 3)\n" +
+ " @java.lang.annotation.Repeatable(FooContainer.class)\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Retention \'RUNTIME\' of @Foo is longer than the retention of its container annotation type @FooContainer, which is \'CLASS\'\n" +
"----------\n",
null, false /* don't flush*/);
}
@@ -593,22 +593,22 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
this.runNegativeTest(
new String[] {
"FooContainer.java",
- "import java.lang.annotation.Target;\n" +
- "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import java.lang.annotation.ElementType;\n" +
"public @Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})\n" +
"@interface FooContainer { Foo[] value(); }\n",
"Foo.java",
- "import java.lang.annotation.Target;\n" +
- "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import java.lang.annotation.ElementType;\n" +
"public @java.lang.annotation.Repeatable(FooContainer.class)\n" +
"@Target({ElementType.FIELD})\n" +
"@interface Foo { }\n"
},
- "----------\n" +
- "1. ERROR in Foo.java (at line 3)\n" +
- " public @java.lang.annotation.Repeatable(FooContainer.class)\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The container annotation type @FooContainer is allowed at targets where the repeatable annotation type @Foo is not: TYPE, METHOD\n" +
+ "----------\n" +
+ "1. ERROR in Foo.java (at line 3)\n" +
+ " public @java.lang.annotation.Repeatable(FooContainer.class)\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "The container annotation type @FooContainer is allowed at targets where the repeatable annotation type @Foo is not: TYPE, METHOD\n" +
"----------\n");
}
@@ -619,30 +619,30 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
this.runConformTest(
new String[] {
"FooContainer.java",
- "import java.lang.annotation.Target;\n" +
- "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import java.lang.annotation.ElementType;\n" +
"public @Target({ElementType.METHOD})\n" +
"@interface FooContainer { Foo[] value(); }\n",
"Foo.java",
- "import java.lang.annotation.Target;\n" +
- "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import java.lang.annotation.ElementType;\n" +
"public @Target({ElementType.METHOD})\n" +
"@interface Foo { }\n"
});
this.runNegativeTest(
new String[] {
"Foo.java",
- "import java.lang.annotation.Target;\n" +
- "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import java.lang.annotation.ElementType;\n" +
"public @java.lang.annotation.Repeatable(FooContainer.class)\n" +
"@java.lang.annotation.Target({ElementType.FIELD})\n" +
"@interface Foo { }\n"
- },
- "----------\n" +
- "1. ERROR in Foo.java (at line 3)\n" +
- " public @java.lang.annotation.Repeatable(FooContainer.class)\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The container annotation type @FooContainer is allowed at targets where the repeatable annotation type @Foo is not: METHOD\n" +
+ },
+ "----------\n" +
+ "1. ERROR in Foo.java (at line 3)\n" +
+ " public @java.lang.annotation.Repeatable(FooContainer.class)\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "The container annotation type @FooContainer is allowed at targets where the repeatable annotation type @Foo is not: METHOD\n" +
"----------\n",
null, false /* don't flush*/);
}
@@ -653,11 +653,11 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
this.runConformTest(
new String[] {
"FooContainer.java",
- "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.ElementType;\n" +
"@java.lang.annotation.Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})\n" +
"@interface FooContainer { Foo[] value(); }\n",
"Foo.java",
- "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.ElementType;\n" +
"@java.lang.annotation.Repeatable(FooContainer.class)\n" +
"@java.lang.annotation.Target({ElementType.METHOD, ElementType.TYPE})\n" +
"@interface Foo { }\n"
@@ -670,22 +670,22 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
this.runNegativeTest(
new String[] {
"FooContainer.java",
- "import java.lang.annotation.Target;\n" +
- "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import java.lang.annotation.ElementType;\n" +
"public @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.CONSTRUCTOR, ElementType.LOCAL_VARIABLE, ElementType.ANNOTATION_TYPE, ElementType.PACKAGE, ElementType.TYPE_PARAMETER, ElementType.TYPE_USE})\n" +
"@interface FooContainer { Foo[] value(); }\n",
"Foo.java",
- "import java.lang.annotation.Target;\n" +
- "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import java.lang.annotation.ElementType;\n" +
"public @java.lang.annotation.Repeatable(FooContainer.class)\n" +
"@Target({})\n" +
"@interface Foo { }\n"
},
- "----------\n" +
- "1. ERROR in Foo.java (at line 3)\n" +
- " public @java.lang.annotation.Repeatable(FooContainer.class)\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The container annotation type @FooContainer is allowed at targets where the repeatable annotation type @Foo is not: TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE, ANNOTATION_TYPE, PACKAGE, TYPE_PARAMETER, TYPE_USE\n" +
+ "----------\n" +
+ "1. ERROR in Foo.java (at line 3)\n" +
+ " public @java.lang.annotation.Repeatable(FooContainer.class)\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "The container annotation type @FooContainer is allowed at targets where the repeatable annotation type @Foo is not: TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE, ANNOTATION_TYPE, PACKAGE, TYPE_PARAMETER, TYPE_USE\n" +
"----------\n");
}
@@ -702,17 +702,17 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
this.runNegativeTest(
new String[] {
"Foo.java",
- "import java.lang.annotation.Target;\n" +
- "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import java.lang.annotation.ElementType;\n" +
"@java.lang.annotation.Repeatable(FooContainer.class)\n" +
"@java.lang.annotation.Target({ElementType.FIELD})\n" +
"@interface Foo { }\n"
- },
- "----------\n" +
- "1. ERROR in Foo.java (at line 3)\n" +
- " @java.lang.annotation.Repeatable(FooContainer.class)\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The container annotation type @FooContainer is allowed at targets where the repeatable annotation type @Foo is not: TYPE, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE, ANNOTATION_TYPE, PACKAGE\n" +
+ },
+ "----------\n" +
+ "1. ERROR in Foo.java (at line 3)\n" +
+ " @java.lang.annotation.Repeatable(FooContainer.class)\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "The container annotation type @FooContainer is allowed at targets where the repeatable annotation type @Foo is not: TYPE, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE, ANNOTATION_TYPE, PACKAGE\n" +
"----------\n",
null, false /* don't flush*/);
}
@@ -726,7 +726,7 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"Foo.java",
"@java.lang.annotation.Documented @interface Foo { }\n"});
}
-
+
// 412151: If T is @Documented, then TC should also be Documented, OK for TC to be documented while T is not
public void test028() {
this.runConformTest(
@@ -746,12 +746,12 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"Foo.java",
"@java.lang.annotation.Repeatable(FooContainer.class) @java.lang.annotation.Documented\n" +
"@interface Foo { }\n"
- },
- "----------\n" +
- "1. ERROR in Foo.java (at line 1)\n" +
- " @java.lang.annotation.Repeatable(FooContainer.class) @java.lang.annotation.Documented\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The repeatable annotation type @Foo is marked @Documented, but its container annotation type @FooContainer is not\n" +
+ },
+ "----------\n" +
+ "1. ERROR in Foo.java (at line 1)\n" +
+ " @java.lang.annotation.Repeatable(FooContainer.class) @java.lang.annotation.Documented\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "The repeatable annotation type @Foo is marked @Documented, but its container annotation type @FooContainer is not\n" +
"----------\n");
}
@@ -804,12 +804,12 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"Foo.java",
"@java.lang.annotation.Repeatable(FooContainer.class) @java.lang.annotation.Inherited\n" +
"@interface Foo { }\n"
- },
- "----------\n" +
- "1. ERROR in Foo.java (at line 1)\n" +
- " @java.lang.annotation.Repeatable(FooContainer.class) @java.lang.annotation.Inherited\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The repeatable annotation type @Foo is marked @Inherited, but its container annotation type @FooContainer is not\n" +
+ },
+ "----------\n" +
+ "1. ERROR in Foo.java (at line 1)\n" +
+ " @java.lang.annotation.Repeatable(FooContainer.class) @java.lang.annotation.Inherited\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "The repeatable annotation type @Foo is marked @Inherited, but its container annotation type @FooContainer is not\n" +
"----------\n");
}
@@ -853,19 +853,19 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"public class X { \n" +
" X f;\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " @Repeatable(TC.class)\n" +
- " ^^^^^^^^\n" +
- "The container annotation type @TC is allowed at targets where the repeatable annotation type @T is not: FIELD\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " @T @T // we used to double report here.\n" +
- " ^^\n" +
- "The annotation @T cannot be repeated at this location since its container annotation type @TC is disallowed at this location\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " @Repeatable(TC.class)\n" +
+ " ^^^^^^^^\n" +
+ "The container annotation type @TC is allowed at targets where the repeatable annotation type @T is not: FIELD\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 12)\n" +
+ " @T @T // we used to double report here.\n" +
+ " ^^\n" +
+ "The annotation @T cannot be repeated at this location since its container annotation type @TC is disallowed at this location\n" +
"----------\n");
- }
+ }
// 412149: [1.8][compiler] Emit repeated annotations into the designated container
public void test036() {
this.runConformTest(
@@ -880,7 +880,7 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
" public Attr[] value();\n" +
"}\n" +
"@Retention(RUNTIME)\n" +
- "@Repeatable(AttrContainer.class)\n" +
+ "@Repeatable(AttrContainer.class)\n" +
"@interface Attr {\n" +
" public int value() default -1;\n" +
"}\n" +
@@ -894,10 +894,10 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"}"
},
normalizeAnnotationString("@Attr(value=1) @Attr(value=2)"));
-
+
}
// 412149: [1.8][compiler] Emit repeated annotations into the designated container
- // Test that only repetitions go into the container
+ // Test that only repetitions go into the container
public void test037() {
this.runConformTest(
new String[] {
@@ -912,7 +912,7 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
" public Attr[] value();\n" +
"}\n" +
"@Retention(RUNTIME)\n" +
- "@Repeatable(AttrContainer.class)\n" +
+ "@Repeatable(AttrContainer.class)\n" +
"@interface Attr {\n" +
" public int value() default -1;\n" +
"}\n" +
@@ -935,11 +935,11 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
" }\n" +
"}"
},
- normalizeAnnotationString("Y1: @Attr(value=1)\n" +
- "Y2: null\n" +
- "Y1: null\n" +
+ normalizeAnnotationString("Y1: @Attr(value=1)\n" +
+ "Y2: null\n" +
+ "Y1: null\n" +
"Y2: @AttrContainer(value=[@Attr(value=1), @Attr(value=2)])"));
-
+
}
// 412149: [1.8][compiler] Emit repeated annotations into the designated container
// Test that the retention from the containing annotation is used
@@ -956,7 +956,7 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
" public Attr[] value();\n" +
"}\n" +
"@Retention(SOURCE)\n" +
- "@Repeatable(AttrContainer.class)\n" +
+ "@Repeatable(AttrContainer.class)\n" +
"@interface Attr {\n" +
" public int value() default -1;\n" +
"}\n" +
@@ -970,9 +970,9 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
" }\n" +
"}"
},
- "Y1 has 0\n" +
+ "Y1 has 0\n" +
"Y2 has 2");
-
+
}
// 412149: [1.8][compiler] Emit repeated annotations into the designated container
// Test that repeated annotations can appear at package targets
@@ -981,7 +981,7 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"repeatable/Main.java",
"package repeatable;\n" +
"public class Main {\n" +
- " public static void main (String[] argv) {\n" +
+ " public static void main (String[] argv) {\n" +
" };\n" +
"}",
@@ -995,7 +995,7 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"repeatable/Foo.java",
"package repeatable;\n" +
- "@java.lang.annotation.Repeatable(FooContainer.class)\n" +
+ "@java.lang.annotation.Repeatable(FooContainer.class)\n" +
"public @interface Foo {}\n",
"repeatable/package-info.java",
@@ -1004,17 +1004,17 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"import repeatable.Foo;",
};
runConformTest(testFiles, "");
- String expectedOutout =
- " RuntimeVisibleAnnotations: \n" +
- " #8 @repeatable.FooContainer(\n" +
- " #9 value=[\n" +
- " annotation value =\n" +
- " #10 @repeatable.Foo(\n" +
- " )\n" +
- " annotation value =\n" +
- " #10 @repeatable.Foo(\n" +
- " )\n" +
- " ]\n" +
+ String expectedOutout =
+ " RuntimeVisibleAnnotations: \n" +
+ " #8 @repeatable.FooContainer(\n" +
+ " #9 value=[\n" +
+ " annotation value =\n" +
+ " #10 @repeatable.Foo(\n" +
+ " )\n" +
+ " annotation value =\n" +
+ " #10 @repeatable.Foo(\n" +
+ " )\n" +
+ " ]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "repeatable" + File.separator + "package-info.class", "package-info", expectedOutout, ClassFileBytesDisassembler.SYSTEM);
}
@@ -1024,9 +1024,9 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
this.runConformTest(
new String[] {
"X.java",
- "import java.lang.reflect.Field;\n" +
- "import java.lang.reflect.Method;\n" +
- "import java.lang.reflect.Parameter;\n" +
+ "import java.lang.reflect.Field;\n" +
+ "import java.lang.reflect.Method;\n" +
+ "import java.lang.reflect.Parameter;\n" +
"import java.lang.annotation.Repeatable;\n" +
"import java.lang.annotation.Retention;\n" +
"import static java.lang.annotation.RetentionPolicy.*;\n" +
@@ -1036,25 +1036,25 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
" public Attr[] value();\n" +
"}\n" +
"@Retention(RUNTIME)\n" +
- "@Repeatable(AttrContainer.class)\n" +
+ "@Repeatable(AttrContainer.class)\n" +
"@interface Attr {\n" +
" public int value() default -1;\n" +
"}\n" +
"\n" +
"public class X {\n" +
- " @Attr(1) @Attr(2) public int field;\n" +
- "\n" +
- " @Attr(3) @Attr(4)\n" +
- " public static void main(@Attr(5) @Attr(6) String args[]) throws Exception {\n" +
- " Field fieldField = X.class.getField(\"field\");\n" +
- " dump(fieldField.getAnnotationsByType(Attr.class));\n" +
- " Method mainMethod = X.class.getMethod(\"main\", (new String[0]).getClass());\n" +
- " dump(mainMethod.getAnnotationsByType(Attr.class));\n" +
- " Parameter argvParameter = mainMethod.getParameters()[0];\n" +
- " dump(argvParameter.getAnnotationsByType(Attr.class));\n" +
- " }\n" +
- " static void dump(Attr[] attrs) {\n" +
- " for (int i=0; i<attrs.length;++i) System.out.print(attrs[i] + \" \");\n" +
+ " @Attr(1) @Attr(2) public int field;\n" +
+ "\n" +
+ " @Attr(3) @Attr(4)\n" +
+ " public static void main(@Attr(5) @Attr(6) String args[]) throws Exception {\n" +
+ " Field fieldField = X.class.getField(\"field\");\n" +
+ " dump(fieldField.getAnnotationsByType(Attr.class));\n" +
+ " Method mainMethod = X.class.getMethod(\"main\", (new String[0]).getClass());\n" +
+ " dump(mainMethod.getAnnotationsByType(Attr.class));\n" +
+ " Parameter argvParameter = mainMethod.getParameters()[0];\n" +
+ " dump(argvParameter.getAnnotationsByType(Attr.class));\n" +
+ " }\n" +
+ " static void dump(Attr[] attrs) {\n" +
+ " for (int i=0; i<attrs.length;++i) System.out.print(attrs[i] + \" \");\n" +
" }\n" +
"}"
},
@@ -1353,13 +1353,13 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"public class X {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " @Repeatable(X.class)\n" +
- " ^^^^^^^\n" +
- "Type mismatch: cannot convert from Class<X> to Class<? extends Annotation>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " @Repeatable(X.class)\n" +
+ " ^^^^^^^\n" +
+ "Type mismatch: cannot convert from Class<X> to Class<? extends Annotation>\n" +
"----------\n");
- }
+ }
// Test unspecified target.
public void testUnspecifiedTarget() {
this.runNegativeTest(
@@ -1383,11 +1383,11 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
" X f;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " @Repeatable(TC.class)\n" +
- " ^^^^^^^^\n" +
- "The container annotation type @TC is allowed at targets where the repeatable annotation type @T is not: TYPE_USE\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " @Repeatable(TC.class)\n" +
+ " ^^^^^^^^\n" +
+ "The container annotation type @TC is allowed at targets where the repeatable annotation type @T is not: TYPE_USE\n" +
"----------\n");
}
// Test unspecified target.
@@ -1413,16 +1413,16 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
" X f;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " @Repeatable(TC.class)\n" +
- " ^^^^^^^^\n" +
- "The container annotation type @TC is allowed at targets where the repeatable annotation type @T is not: TYPE_PARAMETER\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " @T @T\n" +
- " ^^\n" +
- "The annotation @T cannot be repeated at this location since its container annotation type @TC is disallowed at this location\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " @Repeatable(TC.class)\n" +
+ " ^^^^^^^^\n" +
+ "The container annotation type @TC is allowed at targets where the repeatable annotation type @T is not: TYPE_PARAMETER\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " @T @T\n" +
+ " ^^\n" +
+ "The annotation @T cannot be repeated at this location since its container annotation type @TC is disallowed at this location\n" +
"----------\n");
}
public void testDeprecation() {
@@ -1436,21 +1436,21 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"T.java",
"@java.lang.annotation.Repeatable(TC.class)\n" +
"@interface T {\n" +
- " public int value() default -1;\n" +
+ " public int value() default -1;\n" +
"}\n" +
"interface I<@T(1) @T(2) K> {\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in T.java (at line 1)\n" +
- " @java.lang.annotation.Repeatable(TC.class)\n" +
- " ^^\n" +
- "The type TC is deprecated\n" +
- "----------\n" +
- "2. WARNING in T.java (at line 5)\n" +
- " interface I<@T(1) @T(2) K> {\n" +
- " ^^\n" +
- "The type TC is deprecated\n" +
+ "----------\n" +
+ "1. WARNING in T.java (at line 1)\n" +
+ " @java.lang.annotation.Repeatable(TC.class)\n" +
+ " ^^\n" +
+ "The type TC is deprecated\n" +
+ "----------\n" +
+ "2. WARNING in T.java (at line 5)\n" +
+ " interface I<@T(1) @T(2) K> {\n" +
+ " ^^\n" +
+ "The type TC is deprecated\n" +
"----------\n");
}
public void testDeprecation2() { // verify that deprecation warning does not show up when the deprecated element is used in the same file defining it.
@@ -1464,14 +1464,14 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"}\n" +
"@java.lang.annotation.Repeatable(TC.class)\n" +
"@interface T {\n" +
- " public int value() default -1;\n" +
+ " public int value() default -1;\n" +
"}\n" +
"interface I<@T(1) @T(2) K> {\n" +
"}\n"
},
"");
- }
-
+ }
+
// 419209: [1.8] Repeating container annotations should be rejected in the presence of annotation it contains
public void testRepeatableWithContaining1() {
this.runNegativeTest(
@@ -1488,15 +1488,15 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"}\n" +
"@java.lang.annotation.Repeatable(FooContainer.class)\n" +
"@interface Foo {\n" +
- " public int value() default -1;\n" +
+ " public int value() default -1;\n" +
"}\n" +
"@FooContainer({@Foo(1)}) @FooContainer({@Foo(2)}) @Foo(3) class A {}\n"
},
- "----------\n" +
- "1. WARNING in A.java (at line 12)\n" +
- " @FooContainer({@Foo(1)}) @FooContainer({@Foo(2)}) @Foo(3) class A {}\n" +
- " ^^^^\n" +
- "The repeatable annotation @Foo may not be present where its container annotation type @FooContainer is repeated\n" +
+ "----------\n" +
+ "1. WARNING in A.java (at line 12)\n" +
+ " @FooContainer({@Foo(1)}) @FooContainer({@Foo(2)}) @Foo(3) class A {}\n" +
+ " ^^^^\n" +
+ "The repeatable annotation @Foo may not be present where its container annotation type @FooContainer is repeated\n" +
"----------\n");
}
// 419209: [1.8] Repeating container annotations should be rejected in the presence of annotation it contains
@@ -1515,15 +1515,15 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"}\n" +
"@java.lang.annotation.Repeatable(FooContainer.class)\n" +
"@interface Foo {\n" +
- " public int value() default -1;\n" +
+ " public int value() default -1;\n" +
"}\n" +
"@Foo(1) @FooContainer({@Foo(2)}) @FooContainer({@Foo(3)}) class A {}\n"
},
- "----------\n" +
- "1. WARNING in A.java (at line 12)\n" +
- " @Foo(1) @FooContainer({@Foo(2)}) @FooContainer({@Foo(3)}) class A {}\n" +
- " ^^^^\n" +
- "The repeatable annotation @Foo may not be present where its container annotation type @FooContainer is repeated\n" +
+ "----------\n" +
+ "1. WARNING in A.java (at line 12)\n" +
+ " @Foo(1) @FooContainer({@Foo(2)}) @FooContainer({@Foo(3)}) class A {}\n" +
+ " ^^^^\n" +
+ "The repeatable annotation @Foo may not be present where its container annotation type @FooContainer is repeated\n" +
"----------\n");
}
// 419209: [1.8] Repeating container annotations should be rejected in the presence of annotation it contains
@@ -1542,15 +1542,15 @@ public class RepeatableAnnotationTest extends AbstractComparableTest {
"}\n" +
"@java.lang.annotation.Repeatable(FooContainer.class)\n" +
"@interface Foo {\n" +
- " public int value() default -1;\n" +
+ " public int value() default -1;\n" +
"}\n" +
"@FooContainer({@Foo(2)}) @Foo(1) @FooContainer({@Foo(3)}) class A {}\n"
},
- "----------\n" +
- "1. WARNING in A.java (at line 12)\n" +
- " @FooContainer({@Foo(2)}) @Foo(1) @FooContainer({@Foo(3)}) class A {}\n" +
- " ^^^^\n" +
- "The repeatable annotation @Foo may not be present where its container annotation type @FooContainer is repeated\n" +
+ "----------\n" +
+ "1. WARNING in A.java (at line 12)\n" +
+ " @FooContainer({@Foo(2)}) @Foo(1) @FooContainer({@Foo(3)}) class A {}\n" +
+ " ^^^^\n" +
+ "The repeatable annotation @Foo may not be present where its container annotation type @FooContainer is repeated\n" +
"----------\n");
- }
+ }
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java
index 63d5e6959..7b5c8439a 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java
@@ -3088,12 +3088,12 @@ public void testBug368709a() {
"}\n"
},
"----------\n" +
- "1. ERROR in X.java (at line 15)\n" +
- " return wc.open(getObjectId(), type).openStream();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 18)\n" +
+ "1. ERROR in X.java (at line 15)\n" +
+ " return wc.open(getObjectId(), type).openStream();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 18)\n" +
" return new ObjectStream.Filter(type, size, in);\n" +
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"Potential resource leak: \'in\' may not be closed at this location\n" +
@@ -3141,25 +3141,25 @@ public void test064() {
"Test064.java",
"import java.io.*;\n" +
"public class Test064 {\n" +
- " void foo(File outfile) {\n" +
- " OutputStream out= System.out;\n" +
- " if (outfile != null) {\n" +
- " try {\n" +
- " out = new FileOutputStream(outfile);\n" +
- " } catch (java.io.IOException e) {\n" +
- " throw new RuntimeException(e);\n" +
- " }\n" +
- " }\n" +
- " setOutput(out);\n" +
- " }\n" +
+ " void foo(File outfile) {\n" +
+ " OutputStream out= System.out;\n" +
+ " if (outfile != null) {\n" +
+ " try {\n" +
+ " out = new FileOutputStream(outfile);\n" +
+ " } catch (java.io.IOException e) {\n" +
+ " throw new RuntimeException(e);\n" +
+ " }\n" +
+ " }\n" +
+ " setOutput(out);\n" +
+ " }\n" +
" private void setOutput(OutputStream out) { }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test064.java (at line 7)\n" +
- " out = new FileOutputStream(outfile);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Potential resource leak: \'out\' may not be closed\n" +
+ "----------\n" +
+ "1. ERROR in Test064.java (at line 7)\n" +
+ " out = new FileOutputStream(outfile);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Potential resource leak: \'out\' may not be closed\n" +
"----------\n",
options);
}
@@ -3175,26 +3175,26 @@ public void _test065() {
this.runConformTest(new String[] {
"Test065.java",
"import java.io.*;\n" +
- "class MyException extends Exception{}\n" +
+ "class MyException extends Exception{}\n" +
"public class Test065 {\n" +
- " void foo(String fileName) throws IOException, MyException {\n" +
- " FileReader fileRead = new FileReader(fileName);\n" +
- " BufferedReader bufRead = new BufferedReader(fileRead);\n" +
- " LineNumberReader lineReader = new LineNumberReader(bufRead);\n" +
- " try {\n" +
- " while (lineReader.readLine() != null) {\n" +
- " bufRead.close();\n" +
- " callSome(); // only this can throw MyException\n" +
- " }\n" +
- " } catch (MyException e) {\n" +
- " throw e; // Pot. leak reported here\n" +
- " }\n" +
- " bufRead.close(); \n" +
- " }\n" +
- " private void callSome() throws MyException\n" +
- " {\n" +
- " \n" +
- " }\n" +
+ " void foo(String fileName) throws IOException, MyException {\n" +
+ " FileReader fileRead = new FileReader(fileName);\n" +
+ " BufferedReader bufRead = new BufferedReader(fileRead);\n" +
+ " LineNumberReader lineReader = new LineNumberReader(bufRead);\n" +
+ " try {\n" +
+ " while (lineReader.readLine() != null) {\n" +
+ " bufRead.close();\n" +
+ " callSome(); // only this can throw MyException\n" +
+ " }\n" +
+ " } catch (MyException e) {\n" +
+ " throw e; // Pot. leak reported here\n" +
+ " }\n" +
+ " bufRead.close(); \n" +
+ " }\n" +
+ " private void callSome() throws MyException\n" +
+ " {\n" +
+ " \n" +
+ " }\n" +
"}\n"
},
"",
@@ -3215,31 +3215,31 @@ public void test066() {
runLeakTest(new String[] {
"Test066.java",
"import java.io.*;\n" +
- "class MyException extends Exception{}\n" +
+ "class MyException extends Exception{}\n" +
"public class Test066 {\n" +
- " void countFileLines(String fileName) throws IOException {\n" +
- " FileReader fileRead = new FileReader(fileName);\n" +
- " BufferedReader bufRead = new BufferedReader(fileRead);\n" +
- " LineNumberReader lineReader = new LineNumberReader(bufRead);\n" +
- " while (lineReader.readLine() != null) {\n" +
+ " void countFileLines(String fileName) throws IOException {\n" +
+ " FileReader fileRead = new FileReader(fileName);\n" +
+ " BufferedReader bufRead = new BufferedReader(fileRead);\n" +
+ " LineNumberReader lineReader = new LineNumberReader(bufRead);\n" +
+ " while (lineReader.readLine() != null) {\n" +
" if (lineReader.markSupported())\n" +
- " throw new IOException();\n" +
- " bufRead.close();\n" +
- " }\n" +
- " bufRead.close();\n" +
- " }\n" +
+ " throw new IOException();\n" +
+ " bufRead.close();\n" +
+ " }\n" +
+ " bufRead.close();\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test066.java (at line 10)\n" +
- " throw new IOException();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Potential resource leak: \'lineReader\' may not be closed at this location\n" +
+ "----------\n" +
+ "1. ERROR in Test066.java (at line 10)\n" +
+ " throw new IOException();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Potential resource leak: \'lineReader\' may not be closed at this location\n" +
"----------\n",
options);
}
// Bug 368546 - [compiler][resource] Avoid remaining false positives found when compiling the Eclipse SDK
-// example from comment 11 - variant with closing top-level resource
+// example from comment 11 - variant with closing top-level resource
public void test066b() {
Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR);
@@ -3248,26 +3248,26 @@ public void test066b() {
runLeakTest(new String[] {
"Test066.java",
"import java.io.*;\n" +
- "class MyException extends Exception{}\n" +
+ "class MyException extends Exception{}\n" +
"public class Test066 {\n" +
- " void countFileLines(String fileName) throws IOException {\n" +
- " FileReader fileRead = new FileReader(fileName);\n" +
- " BufferedReader bufRead = new BufferedReader(fileRead);\n" +
- " LineNumberReader lineReader = new LineNumberReader(bufRead);\n" +
- " while (lineReader.readLine() != null) {\n" +
+ " void countFileLines(String fileName) throws IOException {\n" +
+ " FileReader fileRead = new FileReader(fileName);\n" +
+ " BufferedReader bufRead = new BufferedReader(fileRead);\n" +
+ " LineNumberReader lineReader = new LineNumberReader(bufRead);\n" +
+ " while (lineReader.readLine() != null) {\n" +
" if (lineReader.markSupported())\n" +
- " throw new IOException();\n" +
- " lineReader.close();\n" +
- " }\n" +
- " lineReader.close();\n" +
- " }\n" +
+ " throw new IOException();\n" +
+ " lineReader.close();\n" +
+ " }\n" +
+ " lineReader.close();\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test066.java (at line 10)\n" +
- " throw new IOException();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Potential resource leak: \'lineReader\' may not be closed at this location\n" +
+ "----------\n" +
+ "1. ERROR in Test066.java (at line 10)\n" +
+ " throw new IOException();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Potential resource leak: \'lineReader\' may not be closed at this location\n" +
"----------\n",
options);
}
@@ -3285,13 +3285,13 @@ public void _test067() {
"Test067.java",
"import java.io.*;\n" +
"public class Test067 {\n" +
- " public void comment12() throws IOException {\n" +
- " LineNumberReader o = null;\n" +
- " try {\n" +
- " o = new LineNumberReader(null); \n" +
- " } catch (NumberFormatException e) { \n" +
- " }\n" +
- " }\n" +
+ " public void comment12() throws IOException {\n" +
+ " LineNumberReader o = null;\n" +
+ " try {\n" +
+ " o = new LineNumberReader(null); \n" +
+ " } catch (NumberFormatException e) { \n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
"",
@@ -3313,13 +3313,13 @@ public void test067b() {
"Test067.java",
"import java.io.*;\n" +
"public class Test067 {\n" +
- " public void comment12b() throws IOException {\n" +
- " LineNumberReader o = new LineNumberReader(null);\n" +
- " try {\n" +
- " o.close();\n" +
- " } catch (NumberFormatException e) {\n" +
- " }\n" +
- " }\n" +
+ " public void comment12b() throws IOException {\n" +
+ " LineNumberReader o = new LineNumberReader(null);\n" +
+ " try {\n" +
+ " o.close();\n" +
+ " } catch (NumberFormatException e) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
"",
@@ -3341,21 +3341,21 @@ public void test068() {
"Test068.java",
"import java.io.*;\n" +
"public class Test068 {\n" +
- " class ProcessingStep extends OutputStream {\n" +
- " public void write(int b) throws IOException {}\n" +
- " public OutputStream getDestination() { return null; }\n" +
- " }\n" +
- " class ArtifactOutputStream extends OutputStream {\n" +
- " public void write(int b) throws IOException {}\n" +
+ " class ProcessingStep extends OutputStream {\n" +
+ " public void write(int b) throws IOException {}\n" +
+ " public OutputStream getDestination() { return null; }\n" +
+ " }\n" +
+ " class ArtifactOutputStream extends OutputStream {\n" +
+ " public void write(int b) throws IOException {}\n" +
" }" +
- " ArtifactOutputStream comment13(OutputStream stream) {\n" +
- " OutputStream current = stream;\n" +
- " while (current instanceof ProcessingStep)\n" +
- " current = ((ProcessingStep) current).getDestination();\n" + // we previously saw a bogus warning here.
- " if (current instanceof ArtifactOutputStream)\n" +
- " return (ArtifactOutputStream) current;\n" +
- " return null;\n" +
- " }\n" +
+ " ArtifactOutputStream comment13(OutputStream stream) {\n" +
+ " OutputStream current = stream;\n" +
+ " while (current instanceof ProcessingStep)\n" +
+ " current = ((ProcessingStep) current).getDestination();\n" + // we previously saw a bogus warning here.
+ " if (current instanceof ArtifactOutputStream)\n" +
+ " return (ArtifactOutputStream) current;\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
},
"",
@@ -3379,23 +3379,23 @@ public void test069() {
"import java.io.*;\n" +
"import java.util.Collection;\n" +
"public class Test069 {\n" +
- " class Profile {}\n" +
- " class CoreException extends Exception {}\n" +
- " void writeProfilesToStream(Collection<Profile> p, OutputStream s, String enc) {}\n" +
- " CoreException createException(IOException ioex, String message) { return new CoreException(); }\n" +
- " public void comment16(Collection<Profile> profiles, File file, String encoding) throws CoreException {\n" +
- " final OutputStream stream;\n" +
- " try {\n" +
- " stream= new FileOutputStream(file);\n" +
- " try {\n" +
- " writeProfilesToStream(profiles, stream, encoding);\n" +
- " } finally {\n" +
- " try { stream.close(); } catch (IOException e) { /* ignore */ }\n" +
- " }\n" +
- " } catch (IOException e) {\n" +
- " throw createException(e, \"message\"); // should not shout here\n" +
- " }\n" +
- " }\n" +
+ " class Profile {}\n" +
+ " class CoreException extends Exception {}\n" +
+ " void writeProfilesToStream(Collection<Profile> p, OutputStream s, String enc) {}\n" +
+ " CoreException createException(IOException ioex, String message) { return new CoreException(); }\n" +
+ " public void comment16(Collection<Profile> profiles, File file, String encoding) throws CoreException {\n" +
+ " final OutputStream stream;\n" +
+ " try {\n" +
+ " stream= new FileOutputStream(file);\n" +
+ " try {\n" +
+ " writeProfilesToStream(profiles, stream, encoding);\n" +
+ " } finally {\n" +
+ " try { stream.close(); } catch (IOException e) { /* ignore */ }\n" +
+ " }\n" +
+ " } catch (IOException e) {\n" +
+ " throw createException(e, \"message\"); // should not shout here\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
"",
@@ -3407,7 +3407,7 @@ public void test069() {
}
// Bug 368546 - [compiler][resource] Avoid remaining false positives found when compiling the Eclipse SDK
-// referenced in array initializer
+// referenced in array initializer
public void test070() {
Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR);
@@ -3417,24 +3417,24 @@ public void test070() {
"Test070.java",
"import java.io.*;\n" +
"public class Test070 {\n" +
- " void storeInArray(String fileName) throws IOException {\n" +
- " FileReader fileRead = new FileReader(fileName);\n" +
- " closeThemAll(new FileReader[] { fileRead });\n" +
+ " void storeInArray(String fileName) throws IOException {\n" +
+ " FileReader fileRead = new FileReader(fileName);\n" +
+ " closeThemAll(new FileReader[] { fileRead });\n" +
" }\n" +
- " void closeThemAll(FileReader[] readers) { }\n" +
+ " void closeThemAll(FileReader[] readers) { }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test070.java (at line 4)\n" +
- " FileReader fileRead = new FileReader(fileName);\n" +
- " ^^^^^^^^\n" +
- "Potential resource leak: \'fileRead\' may not be closed\n" +
+ "----------\n" +
+ "1. ERROR in Test070.java (at line 4)\n" +
+ " FileReader fileRead = new FileReader(fileName);\n" +
+ " ^^^^^^^^\n" +
+ "Potential resource leak: \'fileRead\' may not be closed\n" +
"----------\n",
options);
}
// Bug 368546 - [compiler][resource] Avoid remaining false positives found when compiling the Eclipse SDK
-// referenced in array initializer
+// referenced in array initializer
public void test071() {
Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR);
@@ -3444,34 +3444,34 @@ public void test071() {
"Test071.java",
"import java.io.*;\n" +
"public class Test071 {\n" +
- " class ReaderHolder {\n" +
- " FileReader reader;\n" +
- " }\n" +
- " private FileReader getReader() {\n" +
- " return null;\n" +
- " }\n" +
- " void invokeCompiler(ReaderHolder readerHolder, boolean flag) throws FileNotFoundException {\n" +
- " FileReader reader = readerHolder.reader;\n" +
- " if (reader == null)\n" +
- " reader = getReader();\n" +
- " try {\n" +
- " return;\n" +
- " } finally {\n" +
- " try {\n" +
- " if (flag)\n" +
- " reader.close();\n" +
- " } catch (IOException e) {\n" +
- " // nop\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ " class ReaderHolder {\n" +
+ " FileReader reader;\n" +
+ " }\n" +
+ " private FileReader getReader() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " void invokeCompiler(ReaderHolder readerHolder, boolean flag) throws FileNotFoundException {\n" +
+ " FileReader reader = readerHolder.reader;\n" +
+ " if (reader == null)\n" +
+ " reader = getReader();\n" +
+ " try {\n" +
+ " return;\n" +
+ " } finally {\n" +
+ " try {\n" +
+ " if (flag)\n" +
+ " reader.close();\n" +
+ " } catch (IOException e) {\n" +
+ " // nop\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test071.java (at line 14)\n" +
- " return;\n" +
- " ^^^^^^^\n" +
- "Potential resource leak: \'reader\' may not be closed at this location\n" +
+ "----------\n" +
+ "1. ERROR in Test071.java (at line 14)\n" +
+ " return;\n" +
+ " ^^^^^^^\n" +
+ "Potential resource leak: \'reader\' may not be closed at this location\n" +
"----------\n",
options);
}
@@ -3489,33 +3489,33 @@ public void _test071b() {
"Test071b.java",
"import java.io.*;\n" +
"public class Test071b {\n" +
- " private FileReader getReader() {\n" +
- " return null;\n" +
- " }\n" +
- " void invokeCompiler(boolean flag) throws FileNotFoundException {\n" +
- " FileReader reader = null;\n" +
- " if (flag)\n" +
- " reader = new FileReader(\"file\");\n" +
- " if (reader == null)\n" +
- " reader = getReader();\n" +
- " try {\n" +
- " return;\n" +
- " } finally {\n" +
- " try {\n" +
- " if (flag)\n" +
- " reader.close();\n" +
- " } catch (IOException e) {\n" +
- " // nop\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ " private FileReader getReader() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " void invokeCompiler(boolean flag) throws FileNotFoundException {\n" +
+ " FileReader reader = null;\n" +
+ " if (flag)\n" +
+ " reader = new FileReader(\"file\");\n" +
+ " if (reader == null)\n" +
+ " reader = getReader();\n" +
+ " try {\n" +
+ " return;\n" +
+ " } finally {\n" +
+ " try {\n" +
+ " if (flag)\n" +
+ " reader.close();\n" +
+ " } catch (IOException e) {\n" +
+ " // nop\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test071b.java (at line 13)\n" +
- " return;\n" +
- " ^^^^^^^\n" +
- "Potential resource leak: \'reader\' may not be closed at this location\n" +
+ "----------\n" +
+ "1. ERROR in Test071b.java (at line 13)\n" +
+ " return;\n" +
+ " ^^^^^^^\n" +
+ "Potential resource leak: \'reader\' may not be closed at this location\n" +
"----------\n",
options);
}
@@ -3531,24 +3531,24 @@ public void test072() {
"Test072.java",
"import java.io.*;\n" +
"public class Test072 {\n" +
- " void readState(File file) {\n" +
- " DataInputStream in = null;\n" +
- " try {\n" +
- " in= new DataInputStream(new BufferedInputStream(new FileInputStream(file)));\n" +
- " int sizeOfFlags = in.readInt();\n" +
- " for (int i = 0; i < sizeOfFlags; ++i) {\n" +
- " String childPath = in.readUTF();\n" +
- " if (childPath.length() == 0)\n" +
- " throw new IOException();\n" +
- " }\n" +
- " }\n" +
- " catch (IOException ioe) { /* nop */ }\n" +
- " finally {\n" +
- " if (in != null) {\n" +
- " try {in.close();} catch (IOException ioe) {}\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ " void readState(File file) {\n" +
+ " DataInputStream in = null;\n" +
+ " try {\n" +
+ " in= new DataInputStream(new BufferedInputStream(new FileInputStream(file)));\n" +
+ " int sizeOfFlags = in.readInt();\n" +
+ " for (int i = 0; i < sizeOfFlags; ++i) {\n" +
+ " String childPath = in.readUTF();\n" +
+ " if (childPath.length() == 0)\n" +
+ " throw new IOException();\n" +
+ " }\n" +
+ " }\n" +
+ " catch (IOException ioe) { /* nop */ }\n" +
+ " finally {\n" +
+ " if (in != null) {\n" +
+ " try {in.close();} catch (IOException ioe) {}\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
"",
@@ -3570,13 +3570,13 @@ public void test073() {
"Test073.java",
"import java.io.*;\n" +
"public class Test073 {\n" +
- " String getEncoding(Object reader) {\n" +
- " if (reader instanceof FileReader) {\n" +
- " final FileReader fr = (FileReader) reader;\n" +
- " return fr.getEncoding();\n" +
- " }\n" +
- " return null;\n" +
- " }\n" +
+ " String getEncoding(Object reader) {\n" +
+ " if (reader instanceof FileReader) {\n" +
+ " final FileReader fr = (FileReader) reader;\n" +
+ " return fr.getEncoding();\n" +
+ " }\n" +
+ " return null;\n" +
+ " }\n" +
"}\n"
},
"",
@@ -3598,27 +3598,27 @@ public void test074() {
"Test074.java",
"import java.io.*;\n" +
"public class Test074 {\n" +
- " void foo() throws FileNotFoundException {\n" +
- " FileOutputStream out = null;\n" +
- " try {\n" +
- " out = new FileOutputStream(\"outfile\");\n" +
- " } finally {\n" +
- " try {\n" +
- " out.flush();\n" +
- " out.close();\n" +
- " } catch (IOException e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
+ " void foo() throws FileNotFoundException {\n" +
+ " FileOutputStream out = null;\n" +
+ " try {\n" +
+ " out = new FileOutputStream(\"outfile\");\n" +
+ " } finally {\n" +
+ " try {\n" +
+ " out.flush();\n" +
+ " out.close();\n" +
+ " } catch (IOException e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
" out = null;\n" + // unclosed if exception occurred on flush()
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test074.java (at line 14)\n" +
- " out = null;\n" +
- " ^^^^^^^^^^\n" +
- "Potential resource leak: \'out\' may not be closed at this location\n" +
+ "----------\n" +
+ "1. ERROR in Test074.java (at line 14)\n" +
+ " out = null;\n" +
+ " ^^^^^^^^^^\n" +
+ "Potential resource leak: \'out\' may not be closed at this location\n" +
"----------\n",
options);
}
@@ -3685,24 +3685,24 @@ public void testBug361073c7() {
"X.java",
"import java.io.*;\n" +
"public class X {\n" +
- " public void test() {\n" +
- " BufferedReader br = null;\n" +
- " try {\n" +
- " br = new BufferedReader(new FileReader(\"blah\"));\n" +
- " String line = null;\n" +
- " while ( (line = br.readLine()) != null ) {\n" +
- " if ( line.startsWith(\"error\") )\n" +
- " throw new Exception(\"error\"); //Resource leak: 'br' is not closed at this location\n" +
- " }\n" +
- " } catch (Throwable t) {\n" +
- " t.printStackTrace();\n" +
- " } finally {\n" +
- " if ( br != null ) {\n" +
- " try { br.close(); }\n" +
- " catch (Throwable e) { br = null; }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ " public void test() {\n" +
+ " BufferedReader br = null;\n" +
+ " try {\n" +
+ " br = new BufferedReader(new FileReader(\"blah\"));\n" +
+ " String line = null;\n" +
+ " while ( (line = br.readLine()) != null ) {\n" +
+ " if ( line.startsWith(\"error\") )\n" +
+ " throw new Exception(\"error\"); //Resource leak: 'br' is not closed at this location\n" +
+ " }\n" +
+ " } catch (Throwable t) {\n" +
+ " t.printStackTrace();\n" +
+ " } finally {\n" +
+ " if ( br != null ) {\n" +
+ " try { br.close(); }\n" +
+ " catch (Throwable e) { br = null; }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}"
},
"",
@@ -3721,42 +3721,42 @@ public void _testBug386534() {
runConformTest(
new String[] {
"Bug.java",
- "import java.io.FileNotFoundException;\n" +
- "import java.io.IOException;\n" +
- "import java.io.OutputStream;\n" +
- "\n" +
- "public class Bug {\n" +
- " private static final String DETAILS_FILE_NAME = null;\n" +
- " private static final String LOG_TAG = null;\n" +
- " private static Context sContext;\n" +
- " static void saveDetails(byte[] detailsData) {\n" +
- " OutputStream os = null;\n" +
- " try {\n" +
- " os = sContext.openFileOutput(DETAILS_FILE_NAME,\n" +
- " Context.MODE_PRIVATE);\n" +
- " os.write(detailsData);\n" +
- " } catch (IOException e) {\n" +
- " Log.w(LOG_TAG, \"Unable to save details\", e);\n" +
- " } finally {\n" +
- " if (os != null) {\n" +
- " try {\n" +
- " os.close();\n" +
- " } catch (IOException ignored) {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " static class Context {\n" +
- " public static final String MODE_PRIVATE = null;\n" +
- " public OutputStream openFileOutput(String detailsFileName,\n" +
- " String modePrivate) throws FileNotFoundException{\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- " static class Log {\n" +
- " public static void w(String logTag, String string, IOException e) {\n" +
- " }\n" +
- " }\n" +
+ "import java.io.FileNotFoundException;\n" +
+ "import java.io.IOException;\n" +
+ "import java.io.OutputStream;\n" +
+ "\n" +
+ "public class Bug {\n" +
+ " private static final String DETAILS_FILE_NAME = null;\n" +
+ " private static final String LOG_TAG = null;\n" +
+ " private static Context sContext;\n" +
+ " static void saveDetails(byte[] detailsData) {\n" +
+ " OutputStream os = null;\n" +
+ " try {\n" +
+ " os = sContext.openFileOutput(DETAILS_FILE_NAME,\n" +
+ " Context.MODE_PRIVATE);\n" +
+ " os.write(detailsData);\n" +
+ " } catch (IOException e) {\n" +
+ " Log.w(LOG_TAG, \"Unable to save details\", e);\n" +
+ " } finally {\n" +
+ " if (os != null) {\n" +
+ " try {\n" +
+ " os.close();\n" +
+ " } catch (IOException ignored) {\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " static class Context {\n" +
+ " public static final String MODE_PRIVATE = null;\n" +
+ " public OutputStream openFileOutput(String detailsFileName,\n" +
+ " String modePrivate) throws FileNotFoundException{\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ " static class Log {\n" +
+ " public static void w(String logTag, String string, IOException e) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
"",
@@ -3776,29 +3776,29 @@ public void testBug388996() {
"Bug.java",
"import java.io.*;\n" +
"public class Bug {\n" +
- " public void processRequest(ResponseContext responseContext) throws IOException {\n" +
- " OutputStream bao = null;\n" +
- "\n" +
- " try {\n" +
- " HttpServletResponse response = responseContext.getResponse();\n" +
- "\n" +
- " bao = response.getOutputStream(); // <<<<\n" +
- " } finally {\n" +
- " if(bao != null) {\n" +
- " bao.close();\n" +
- " }\n" +
- " }\n" +
+ " public void processRequest(ResponseContext responseContext) throws IOException {\n" +
+ " OutputStream bao = null;\n" +
+ "\n" +
+ " try {\n" +
+ " HttpServletResponse response = responseContext.getResponse();\n" +
+ "\n" +
+ " bao = response.getOutputStream(); // <<<<\n" +
+ " } finally {\n" +
+ " if(bao != null) {\n" +
+ " bao.close();\n" +
+ " }\n" +
+ " }\n" +
" }" +
"}\n" +
- "class ResponseContext {\n" +
- " public HttpServletResponse getResponse() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "class HttpServletResponse {\n" +
- " public OutputStream getOutputStream() {\n" +
- " return null;\n" +
- " }\n" +
+ "class ResponseContext {\n" +
+ " public HttpServletResponse getResponse() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "class HttpServletResponse {\n" +
+ " public OutputStream getOutputStream() {\n" +
+ " return null;\n" +
+ " }\n" +
"}"
},
"",
@@ -3816,42 +3816,42 @@ public void testBug386534() {
runConformTest(
new String[] {
"Bug386534.java",
- "import java.io.FileNotFoundException;\n" +
- "import java.io.IOException;\n" +
- "import java.io.OutputStream;\n" +
- "\n" +
- "public class Bug386534 {\n" +
- " private static final String DETAILS_FILE_NAME = null;\n" +
- " private static final String LOG_TAG = null;\n" +
- " private static Context sContext;\n" +
- " static void saveDetails(byte[] detailsData) {\n" +
- " OutputStream os = null;\n" +
- " try {\n" +
- " os = sContext.openFileOutput(DETAILS_FILE_NAME,\n" +
- " Context.MODE_PRIVATE);\n" +
- " os.write(detailsData);\n" +
- " } catch (IOException e) {\n" +
- " Log.w(LOG_TAG, \"Unable to save details\", e);\n" +
- " } finally {\n" +
- " if (os != null) {\n" +
- " try {\n" +
- " os.close();\n" +
- " } catch (IOException ignored) {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " static class Context {\n" +
- " public static final String MODE_PRIVATE = null;\n" +
- " public OutputStream openFileOutput(String detailsFileName,\n" +
- " String modePrivate) throws FileNotFoundException{\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- " static class Log {\n" +
- " public static void w(String logTag, String string, IOException e) {\n" +
- " }\n" +
- " }\n" +
+ "import java.io.FileNotFoundException;\n" +
+ "import java.io.IOException;\n" +
+ "import java.io.OutputStream;\n" +
+ "\n" +
+ "public class Bug386534 {\n" +
+ " private static final String DETAILS_FILE_NAME = null;\n" +
+ " private static final String LOG_TAG = null;\n" +
+ " private static Context sContext;\n" +
+ " static void saveDetails(byte[] detailsData) {\n" +
+ " OutputStream os = null;\n" +
+ " try {\n" +
+ " os = sContext.openFileOutput(DETAILS_FILE_NAME,\n" +
+ " Context.MODE_PRIVATE);\n" +
+ " os.write(detailsData);\n" +
+ " } catch (IOException e) {\n" +
+ " Log.w(LOG_TAG, \"Unable to save details\", e);\n" +
+ " } finally {\n" +
+ " if (os != null) {\n" +
+ " try {\n" +
+ " os.close();\n" +
+ " } catch (IOException ignored) {\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " static class Context {\n" +
+ " public static final String MODE_PRIVATE = null;\n" +
+ " public OutputStream openFileOutput(String detailsFileName,\n" +
+ " String modePrivate) throws FileNotFoundException{\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ " static class Log {\n" +
+ " public static void w(String logTag, String string, IOException e) {\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
"",
@@ -3870,30 +3870,30 @@ public void testBug394768() {
runConformTest(
new String[] {
"Bug394768.java",
- "import java.io.File;\n" +
- "import java.io.FileInputStream;\n" +
- "import java.io.InputStream;\n" +
- "\n" +
- "public class Bug394768 {\n" +
- " public void readFile(String path) throws Exception {\n" +
- " InputStream stream = null;\n" +
- " File file = new File(path);\n" +
- "\n" +
- " if (file.exists())\n" +
- " stream = new FileInputStream(path);\n" +
- " else\n" +
- " stream = getClass().getClassLoader().getResourceAsStream(path);\n" +
- "\n" +
- " if (stream == null)\n" +
- " return;\n" +
- "\n" +
- " try {\n" +
- " // Use the opened stream here\n" +
- " stream.read();\n" +
- " } finally {\n" +
- " stream.close();\n" +
- " }\n" +
- " }\n" +
+ "import java.io.File;\n" +
+ "import java.io.FileInputStream;\n" +
+ "import java.io.InputStream;\n" +
+ "\n" +
+ "public class Bug394768 {\n" +
+ " public void readFile(String path) throws Exception {\n" +
+ " InputStream stream = null;\n" +
+ " File file = new File(path);\n" +
+ "\n" +
+ " if (file.exists())\n" +
+ " stream = new FileInputStream(path);\n" +
+ " else\n" +
+ " stream = getClass().getClassLoader().getResourceAsStream(path);\n" +
+ "\n" +
+ " if (stream == null)\n" +
+ " return;\n" +
+ "\n" +
+ " try {\n" +
+ " // Use the opened stream here\n" +
+ " stream.read();\n" +
+ " } finally {\n" +
+ " stream.close();\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
"",
@@ -3913,33 +3913,33 @@ public void testBug394768_1() {
runConformTest(
new String[] {
"Bug394768.java",
- "import java.io.File;\n" +
- "import java.io.FileInputStream;\n" +
- "import java.io.InputStream;\n" +
- "\n" +
- "public class Bug394768 {\n" +
- " public void readFile(String path) throws Exception {\n" +
- " InputStream stream = null;\n" +
- " File file = new File(path);\n" +
- "\n" +
- " if (file.exists()) {\n" +
- " stream = new FileInputStream(path);\n" +
- " } else {\n" +
+ "import java.io.File;\n" +
+ "import java.io.FileInputStream;\n" +
+ "import java.io.InputStream;\n" +
+ "\n" +
+ "public class Bug394768 {\n" +
+ " public void readFile(String path) throws Exception {\n" +
+ " InputStream stream = null;\n" +
+ " File file = new File(path);\n" +
+ "\n" +
+ " if (file.exists()) {\n" +
+ " stream = new FileInputStream(path);\n" +
+ " } else {\n" +
" stream = getClass().getClassLoader().getResourceAsStream(path);" +
" stream.close();\n" +
" stream = null;\n" +
- " }\n" +
- "\n" +
- " if (stream == null)\n" +
- " return;\n" +
- "\n" +
- " try {\n" +
- " // Use the opened stream here\n" +
- " stream.read();\n" +
- " } finally {\n" +
- " stream.close();\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ "\n" +
+ " if (stream == null)\n" +
+ " return;\n" +
+ "\n" +
+ " try {\n" +
+ " // Use the opened stream here\n" +
+ " stream.read();\n" +
+ " } finally {\n" +
+ " stream.close();\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
"",
@@ -3995,13 +3995,13 @@ public void testBug381445_1() {
" public static void closeQuietly(java.io.Closeable closeable) {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Bug381445.java (at line 11)\n" +
- " InputStream stream4 = new FileInputStream(path);\n" +
- " ^^^^^^^\n" +
- "Potential resource leak: \'stream4\' may not be closed\n" +
+ "----------\n" +
+ "1. ERROR in Bug381445.java (at line 11)\n" +
+ " InputStream stream4 = new FileInputStream(path);\n" +
+ " ^^^^^^^\n" +
+ "Potential resource leak: \'stream4\' may not be closed\n" +
"----------\n",
- options);
+ options);
}
// Bug 405569 - Resource leak check false positive when using DbUtils.closeQuietly
@@ -4048,13 +4048,13 @@ public void testBug381445_1b() {
" public static void closeQuietly(java.lang.AutoCloseable closeable) {}\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Bug381445.java (at line 8)\n" +
+ "----------\n" +
+ "1. ERROR in Bug381445.java (at line 8)\n" +
" ResultSet rset2 = stat.executeQuery(q2);\n" +
- " ^^^^^\n" +
- "Potential resource leak: \'rset2\' may not be closed\n" +
+ " ^^^^^\n" +
+ "Potential resource leak: \'rset2\' may not be closed\n" +
"----------\n",
- options);
+ options);
}
// Bug 381445 - [compiler][resource] Can the resource leak check be made aware of Closeables.closeQuietly?
@@ -4093,13 +4093,13 @@ public void testBug381445_2() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Bug381445.java (at line 10)\n" +
- " InputStream stream2 = new FileInputStream(path);\n" +
- " ^^^^^^^\n" +
- "Potential resource leak: \'stream2\' may not be closed\n" +
+ "----------\n" +
+ "1. ERROR in Bug381445.java (at line 10)\n" +
+ " InputStream stream2 = new FileInputStream(path);\n" +
+ " ^^^^^^^\n" +
+ "Potential resource leak: \'stream2\' may not be closed\n" +
"----------\n",
- options);
+ options);
}
// Bug 381445 - [compiler][resource] Can the resource leak check be made aware of Closeables.closeQuietly?
@@ -4153,9 +4153,9 @@ public void testBug381445_3() {
"",
null,
true,
- null,
+ null,
options,
- null);
+ null);
}
// Bug 395977 - Resource leak warning behavior possibly incorrect for anonymous inner class
@@ -4167,55 +4167,55 @@ public void testBug395977() {
runConformTest(
new String[] {
"WriterTest.java",
- "import java.io.*;\n" +
- "\n" +
- "public class WriterTest implements Runnable\n" +
- "{\n" +
- " private BufferedWriter m_Writer;\n" +
- " \n" +
- " public void run()\n" +
- " {\n" +
- " try\n" +
- " {\n" +
- " initializeWriter();\n" +
- " \n" +
- " m_Writer.write(\"string\");\n" +
- " m_Writer.newLine();\n" +
- " \n" +
- " closeWriter();\n" +
- " }\n" +
- " catch (IOException ioe)\n" +
- " {\n" +
- " ioe.printStackTrace();\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " private void initializeWriter()\n" +
- " throws UnsupportedEncodingException, FileNotFoundException\n" +
- " {\n" +
- " m_Writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(\"file\"), \"UTF-8\"))\n" +
- " {\n" +
- " /**\n" +
- " * Writes an LF character on all platforms, to avoid constantly flipping the line terminator style.\n" +
- " */\n" +
- " public void newLine() throws IOException\n" +
- " {\n" +
- " write('\\n');\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " \n" +
- " private void closeWriter()\n" +
- " throws IOException\n" +
- " {\n" +
- " m_Writer.close();\n" +
- " }\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "public class WriterTest implements Runnable\n" +
+ "{\n" +
+ " private BufferedWriter m_Writer;\n" +
+ " \n" +
+ " public void run()\n" +
+ " {\n" +
+ " try\n" +
+ " {\n" +
+ " initializeWriter();\n" +
+ " \n" +
+ " m_Writer.write(\"string\");\n" +
+ " m_Writer.newLine();\n" +
+ " \n" +
+ " closeWriter();\n" +
+ " }\n" +
+ " catch (IOException ioe)\n" +
+ " {\n" +
+ " ioe.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " private void initializeWriter()\n" +
+ " throws UnsupportedEncodingException, FileNotFoundException\n" +
+ " {\n" +
+ " m_Writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(\"file\"), \"UTF-8\"))\n" +
+ " {\n" +
+ " /**\n" +
+ " * Writes an LF character on all platforms, to avoid constantly flipping the line terminator style.\n" +
+ " */\n" +
+ " public void newLine() throws IOException\n" +
+ " {\n" +
+ " write('\\n');\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
+ " \n" +
+ " private void closeWriter()\n" +
+ " throws IOException\n" +
+ " {\n" +
+ " m_Writer.close();\n" +
+ " }\n" +
"}"
},
"",
null,
true,
- null,
+ null,
options,
null);
}
@@ -4229,51 +4229,51 @@ public void testBug395977_1() {
runConformTest(
new String[] {
"WriterTest.java",
- "import java.io.*;\n" +
- "\n" +
- "public class WriterTest implements Runnable\n" +
- "{\n" +
- " private BufferedWriter m_Writer;\n" +
- " \n" +
- " public void run()\n" +
- " {\n" +
- " try\n" +
- " {\n" +
- " initializeWriter();\n" +
- " \n" +
- " m_Writer.write(\"string\");\n" +
- " m_Writer.newLine();\n" +
- " \n" +
- " closeWriter();\n" +
- " }\n" +
- " catch (IOException ioe)\n" +
- " {\n" +
- " ioe.printStackTrace();\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " private void initializeWriter()\n" +
- " throws UnsupportedEncodingException, FileNotFoundException\n" +
- " {\n" +
- " class MyBufferedWriter extends BufferedWriter\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "public class WriterTest implements Runnable\n" +
+ "{\n" +
+ " private BufferedWriter m_Writer;\n" +
+ " \n" +
+ " public void run()\n" +
+ " {\n" +
+ " try\n" +
+ " {\n" +
+ " initializeWriter();\n" +
+ " \n" +
+ " m_Writer.write(\"string\");\n" +
+ " m_Writer.newLine();\n" +
+ " \n" +
+ " closeWriter();\n" +
+ " }\n" +
+ " catch (IOException ioe)\n" +
+ " {\n" +
+ " ioe.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " private void initializeWriter()\n" +
+ " throws UnsupportedEncodingException, FileNotFoundException\n" +
+ " {\n" +
+ " class MyBufferedWriter extends BufferedWriter\n" +
" {\n" +
" MyBufferedWriter(OutputStreamWriter writer) { super(writer); }\n" +
- " /**\n" +
- " * Writes an LF character on all platforms, to avoid constantly flipping the line terminator style.\n" +
- " */\n" +
- " public void newLine() throws IOException\n" +
- " {\n" +
- " write('\\n');\n" +
- " }\n" +
+ " /**\n" +
+ " * Writes an LF character on all platforms, to avoid constantly flipping the line terminator style.\n" +
+ " */\n" +
+ " public void newLine() throws IOException\n" +
+ " {\n" +
+ " write('\\n');\n" +
+ " }\n" +
" };" +
- " m_Writer = new MyBufferedWriter(new OutputStreamWriter(new FileOutputStream(\"file\"), \"UTF-8\"));\n" +
- " }\n" +
- " \n" +
- " private void closeWriter()\n" +
- " throws IOException\n" +
- " {\n" +
- " m_Writer.close();\n" +
- " }\n" +
+ " m_Writer = new MyBufferedWriter(new OutputStreamWriter(new FileOutputStream(\"file\"), \"UTF-8\"));\n" +
+ " }\n" +
+ " \n" +
+ " private void closeWriter()\n" +
+ " throws IOException\n" +
+ " {\n" +
+ " m_Writer.close();\n" +
+ " }\n" +
"}"
},
"",
@@ -4288,59 +4288,59 @@ public void testBug395977_1a() {
runLeakTest(
new String[] {
"WriterTest.java",
- "import java.io.*;\n" +
- "\n" +
- "public class WriterTest implements Runnable\n" +
- "{\n" +
- " private BufferedWriter m_Writer;\n" +
- " \n" +
- " public void run()\n" +
- " {\n" +
- " try\n" +
- " {\n" +
- " initializeWriter();\n" +
- " \n" +
- " m_Writer.write(\"string\");\n" +
- " m_Writer.newLine();\n" +
- " \n" +
- " closeWriter();\n" +
- " }\n" +
- " catch (IOException ioe)\n" +
- " {\n" +
- " ioe.printStackTrace();\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " private void initializeWriter()\n" +
- " throws UnsupportedEncodingException, FileNotFoundException\n" +
- " {\n" +
- " class MyBufferedWriter extends BufferedWriter\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "public class WriterTest implements Runnable\n" +
+ "{\n" +
+ " private BufferedWriter m_Writer;\n" +
+ " \n" +
+ " public void run()\n" +
+ " {\n" +
+ " try\n" +
+ " {\n" +
+ " initializeWriter();\n" +
+ " \n" +
+ " m_Writer.write(\"string\");\n" +
+ " m_Writer.newLine();\n" +
+ " \n" +
+ " closeWriter();\n" +
+ " }\n" +
+ " catch (IOException ioe)\n" +
+ " {\n" +
+ " ioe.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " private void initializeWriter()\n" +
+ " throws UnsupportedEncodingException, FileNotFoundException\n" +
+ " {\n" +
+ " class MyBufferedWriter extends BufferedWriter\n" +
" {\n" +
" MyBufferedWriter(OutputStreamWriter writer) { super(writer); }\n" +
- " /**\n" +
- " * Writes an LF character on all platforms, to avoid constantly flipping the line terminator style.\n" +
- " */\n" +
- " public void newLine() throws IOException\n" +
- " {\n" +
- " write('\\n');\n" +
+ " /**\n" +
+ " * Writes an LF character on all platforms, to avoid constantly flipping the line terminator style.\n" +
+ " */\n" +
+ " public void newLine() throws IOException\n" +
+ " {\n" +
+ " write('\\n');\n" +
" }\n" +
- " public void close() {}\n" +
+ " public void close() {}\n" +
" };" +
- " m_Writer = new MyBufferedWriter(new OutputStreamWriter(new FileOutputStream(\"file\"), \"UTF-8\"));\n" +
- " }\n" +
- " \n" +
- " private void closeWriter()\n" +
- " throws IOException\n" +
- " {\n" +
- " m_Writer.close();\n" +
- " }\n" +
+ " m_Writer = new MyBufferedWriter(new OutputStreamWriter(new FileOutputStream(\"file\"), \"UTF-8\"));\n" +
+ " }\n" +
+ " \n" +
+ " private void closeWriter()\n" +
+ " throws IOException\n" +
+ " {\n" +
+ " m_Writer.close();\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in WriterTest.java (at line 38)\n" +
- " }; m_Writer = new MyBufferedWriter(new OutputStreamWriter(new FileOutputStream(\"file\"), \"UTF-8\"));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
+ "----------\n" +
+ "1. ERROR in WriterTest.java (at line 38)\n" +
+ " }; m_Writer = new MyBufferedWriter(new OutputStreamWriter(new FileOutputStream(\"file\"), \"UTF-8\"));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
"----------\n",
options);
}
@@ -4354,50 +4354,50 @@ public void testBug395977_2() {
runLeakTest(
new String[] {
"WriterTest.java",
- "import java.io.*;\n" +
- "\n" +
- "public class WriterTest implements Runnable\n" +
- "{\n" +
- " private BufferedWriter m_Writer;\n" +
- " \n" +
- " public void run()\n" +
- " {\n" +
- " try\n" +
- " {\n" +
- " initializeWriter();\n" +
- " \n" +
- " m_Writer.write(\"string\");\n" +
- " m_Writer.newLine();\n" +
- " \n" +
- " closeWriter();\n" +
- " }\n" +
- " catch (IOException ioe)\n" +
- " {\n" +
- " ioe.printStackTrace();\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " private void initializeWriter()\n" +
- " throws UnsupportedEncodingException, FileNotFoundException\n" +
- " {\n" +
- " m_Writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(\"file\"), \"UTF-8\"))\n" +
- " {\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "public class WriterTest implements Runnable\n" +
+ "{\n" +
+ " private BufferedWriter m_Writer;\n" +
+ " \n" +
+ " public void run()\n" +
+ " {\n" +
+ " try\n" +
+ " {\n" +
+ " initializeWriter();\n" +
+ " \n" +
+ " m_Writer.write(\"string\");\n" +
+ " m_Writer.newLine();\n" +
+ " \n" +
+ " closeWriter();\n" +
+ " }\n" +
+ " catch (IOException ioe)\n" +
+ " {\n" +
+ " ioe.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " private void initializeWriter()\n" +
+ " throws UnsupportedEncodingException, FileNotFoundException\n" +
+ " {\n" +
+ " m_Writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(\"file\"), \"UTF-8\"))\n" +
+ " {\n" +
" public void close() { /* nop */}\n" +
- " };\n" +
- " }\n" +
- " \n" +
- " private void closeWriter()\n" +
- " throws IOException\n" +
- " {\n" +
- " m_Writer.close();\n" +
- " }\n" +
+ " };\n" +
+ " }\n" +
+ " \n" +
+ " private void closeWriter()\n" +
+ " throws IOException\n" +
+ " {\n" +
+ " m_Writer.close();\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in WriterTest.java (at line 27)\n" +
- " m_Writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(\"file\"), \"UTF-8\"))\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
+ "----------\n" +
+ "1. ERROR in WriterTest.java (at line 27)\n" +
+ " m_Writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(\"file\"), \"UTF-8\"))\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
"----------\n",
options);
}
@@ -4411,33 +4411,33 @@ public void testBug376053() {
runLeakTest(
new String[] {
"Try.java",
- "package xy;\n" +
- "\n" +
- "import java.io.FileNotFoundException;\n" +
- "import java.io.PrintStream;\n" +
- "\n" +
- "public class Try {\n" +
- " public static void main(String[] args) throws FileNotFoundException {\n" +
- " System.setOut(new PrintStream(\"log.txt\"));\n" +
- " \n" +
- " if (Math.random() > .5) {\n" +
- " return;\n" +
- " }\n" +
- " System.out.println(\"Hello World\");\n" +
- " return;\n" +
- " }\n" +
+ "package xy;\n" +
+ "\n" +
+ "import java.io.FileNotFoundException;\n" +
+ "import java.io.PrintStream;\n" +
+ "\n" +
+ "public class Try {\n" +
+ " public static void main(String[] args) throws FileNotFoundException {\n" +
+ " System.setOut(new PrintStream(\"log.txt\"));\n" +
+ " \n" +
+ " if (Math.random() > .5) {\n" +
+ " return;\n" +
+ " }\n" +
+ " System.out.println(\"Hello World\");\n" +
+ " return;\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in Try.java (at line 11)\n" +
- " return;\n" +
- " ^^^^^^^\n" +
- "Potential resource leak: \'<unassigned Closeable value from line 8>\' may not be closed at this location\n" +
- "----------\n" +
- "2. ERROR in Try.java (at line 14)\n" +
- " return;\n" +
- " ^^^^^^^\n" +
- "Potential resource leak: \'<unassigned Closeable value from line 8>\' may not be closed at this location\n" +
+ "----------\n" +
+ "1. ERROR in Try.java (at line 11)\n" +
+ " return;\n" +
+ " ^^^^^^^\n" +
+ "Potential resource leak: \'<unassigned Closeable value from line 8>\' may not be closed at this location\n" +
+ "----------\n" +
+ "2. ERROR in Try.java (at line 14)\n" +
+ " return;\n" +
+ " ^^^^^^^\n" +
+ "Potential resource leak: \'<unassigned Closeable value from line 8>\' may not be closed at this location\n" +
"----------\n",
options);
}
@@ -4451,12 +4451,12 @@ public void testBug411098_test1() {
runConformTest(
new String[] {
"A.java",
- "import java.io.*;\n" +
- "\n" +
- "class A {\n" +
- " void a(boolean b) throws Exception {\n" +
- " try(FileInputStream in = b ? new FileInputStream(\"a\") : null){}\n" +
- " }\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "class A {\n" +
+ " void a(boolean b) throws Exception {\n" +
+ " try(FileInputStream in = b ? new FileInputStream(\"a\") : null){}\n" +
+ " }\n" +
"}"
},
options
@@ -4473,20 +4473,20 @@ public void testBug411098_test2() {
new String[] {
"A.java",
"import java.io.*;\n"+
- "class A {\n" +
- " void a(boolean b) throws Exception {\n" +
- " try(FileInputStream in = create(new FileInputStream(\"a\"))){}\n" +
- " }\n" +
- " FileInputStream create(FileInputStream ignored) throws IOException {\n" +
- " return new FileInputStream(\"b\"); \n" +
- " }\n" +
+ "class A {\n" +
+ " void a(boolean b) throws Exception {\n" +
+ " try(FileInputStream in = create(new FileInputStream(\"a\"))){}\n" +
+ " }\n" +
+ " FileInputStream create(FileInputStream ignored) throws IOException {\n" +
+ " return new FileInputStream(\"b\"); \n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in A.java (at line 4)\n" +
- " try(FileInputStream in = create(new FileInputStream(\"a\"))){}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Potential resource leak: '<unassigned Closeable value>' may not be closed\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 4)\n" +
+ " try(FileInputStream in = create(new FileInputStream(\"a\"))){}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Potential resource leak: '<unassigned Closeable value>' may not be closed\n" +
"----------\n",
options
);
@@ -4501,22 +4501,22 @@ public void testBug411098_test3() {
runLeakTest(
new String[] {
"A.java",
- "import java.io.*;\n" +
- "class A {\n" +
- " void m() throws IOException {\n" +
- " try (FileInputStream a = new FileInputStream(\"A\") {{\n" +
- " FileInputStream b = new FileInputStream(\"B\");\n" +
- " b.hashCode();\n" +
- " }}){\n" +
- " }\n" +
- " }\n" +
+ "import java.io.*;\n" +
+ "class A {\n" +
+ " void m() throws IOException {\n" +
+ " try (FileInputStream a = new FileInputStream(\"A\") {{\n" +
+ " FileInputStream b = new FileInputStream(\"B\");\n" +
+ " b.hashCode();\n" +
+ " }}){\n" +
+ " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in A.java (at line 5)\n" +
- " FileInputStream b = new FileInputStream(\"B\");\n" +
- " ^\n" +
- "Resource leak: 'b' is never closed\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 5)\n" +
+ " FileInputStream b = new FileInputStream(\"B\");\n" +
+ " ^\n" +
+ "Resource leak: 'b' is never closed\n" +
"----------\n",
options
);
@@ -4531,16 +4531,16 @@ public void testBug411098_test4() {
runConformTest(
new String[] {
"A.java",
- "import java.io.FileInputStream;\n" +
- "class A {\n" +
- " void testB(boolean b) throws Exception {\n" +
- " FileInputStream in = null;\n" +
- " try {\n" +
- " in = b ? new FileInputStream(\"a\") : null;\n" +
- " } finally {\n" +
- " in.close();\n" +
- " }\n" +
- " }\n" +
+ "import java.io.FileInputStream;\n" +
+ "class A {\n" +
+ " void testB(boolean b) throws Exception {\n" +
+ " FileInputStream in = null;\n" +
+ " try {\n" +
+ " in = b ? new FileInputStream(\"a\") : null;\n" +
+ " } finally {\n" +
+ " in.close();\n" +
+ " }\n" +
+ " }\n" +
"}"
},
options
@@ -4556,12 +4556,12 @@ public void testBug411098_test5() {
runConformTest(
new String[] {
"A.java",
- "import java.io.FileInputStream;\n" +
- "class A {\n" +
- " void testA(boolean b) throws Exception {\n" +
- " FileInputStream in = b ? new FileInputStream(\"a\") : null;\n" +
- " in.close();\n" +
- " }\n" +
+ "import java.io.FileInputStream;\n" +
+ "class A {\n" +
+ " void testA(boolean b) throws Exception {\n" +
+ " FileInputStream in = b ? new FileInputStream(\"a\") : null;\n" +
+ " in.close();\n" +
+ " }\n" +
"}"
},
options
@@ -4577,12 +4577,12 @@ public void testBug411098_test6() {
runConformTest(
new String[] {
"A.java",
- "import java.io.FileInputStream;\n" +
- "class A {\n" +
- " void testA(boolean b) throws Exception {\n" +
- " FileInputStream in = b ? new FileInputStream(\"a\") : new FileInputStream(\"b\");\n" +
- " in.close();\n" +
- " }\n" +
+ "import java.io.FileInputStream;\n" +
+ "class A {\n" +
+ " void testA(boolean b) throws Exception {\n" +
+ " FileInputStream in = b ? new FileInputStream(\"a\") : new FileInputStream(\"b\");\n" +
+ " in.close();\n" +
+ " }\n" +
"}"
},
options
@@ -4599,19 +4599,19 @@ public void testBug411098_test7() {
runConformTest(
new String[] {
"A.java",
- "import java.io.*;\n" +
- "class A {\n" +
- " void testA(boolean b) throws Exception {\n" +
- " BufferedReader in = b ? new BufferedReader(new FileReader(\"a\")) : new BufferedReader(new FileReader(\"b\"));\n" +
- " in.close();\n" +
- " }\n" +
+ "import java.io.*;\n" +
+ "class A {\n" +
+ " void testA(boolean b) throws Exception {\n" +
+ " BufferedReader in = b ? new BufferedReader(new FileReader(\"a\")) : new BufferedReader(new FileReader(\"b\"));\n" +
+ " in.close();\n" +
+ " }\n" +
"}"
},
options
);
}
// https://bugs.eclipse.org/411098 - [compiler][resource] Invalid Resource Leak Warning using ternary operator inside try-with-resource
-// should report potential leak only.
+// should report potential leak only.
public void testBug411098_comment19() {
Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportPotentiallyUnclosedCloseable, CompilerOptions.ERROR);
@@ -4619,20 +4619,20 @@ public void testBug411098_comment19() {
runLeakTest(
new String[] {
"A.java",
- "import java.io.PrintWriter;\n" +
- "public class A {\n" +
- " PrintWriter fWriter;\n" +
- " void bug(boolean useField) {\n" +
- " PrintWriter bug= useField ? fWriter : null;\n" +
- " System.out.println(bug);\n" +
- " }\n" +
+ "import java.io.PrintWriter;\n" +
+ "public class A {\n" +
+ " PrintWriter fWriter;\n" +
+ " void bug(boolean useField) {\n" +
+ " PrintWriter bug= useField ? fWriter : null;\n" +
+ " System.out.println(bug);\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in A.java (at line 5)\n" +
- " PrintWriter bug= useField ? fWriter : null;\n" +
- " ^^^\n" +
- "Potential resource leak: \'bug\' may not be closed\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 5)\n" +
+ " PrintWriter bug= useField ? fWriter : null;\n" +
+ " ^^^\n" +
+ "Potential resource leak: \'bug\' may not be closed\n" +
"----------\n",
options
);
@@ -4648,12 +4648,12 @@ public void testStream1() {
new String[] {
"A.java",
"import java.util.*;\n" +
- "import java.util.stream.Stream;\n" +
- "class A {\n" +
- " long test(List<String> ss) {\n" +
- " Stream<String> stream = ss.stream();\n" +
- " return stream.count();\n" +
- " }\n" +
+ "import java.util.stream.Stream;\n" +
+ "class A {\n" +
+ " long test(List<String> ss) {\n" +
+ " Stream<String> stream = ss.stream();\n" +
+ " return stream.count();\n" +
+ " }\n" +
"}"
},
options
@@ -4669,14 +4669,14 @@ public void testStream1_Int() {
runConformTest(
new String[] {
"A.java",
- "import java.util.stream.*;\n" +
- "class A {\n" +
- " public void f(Stream<Object> s) {\n" +
- " IntStream n = s.mapToInt(Object::hashCode);\n" +
- " IntStream n2 = IntStream.range(23, 42);\n" +
- " n.forEach(i -> System.out.println(i));\n" +
- " n2.forEach(i -> System.out.println(i));\n" +
- " }\n" +
+ "import java.util.stream.*;\n" +
+ "class A {\n" +
+ " public void f(Stream<Object> s) {\n" +
+ " IntStream n = s.mapToInt(Object::hashCode);\n" +
+ " IntStream n2 = IntStream.range(23, 42);\n" +
+ " n.forEach(i -> System.out.println(i));\n" +
+ " n2.forEach(i -> System.out.println(i));\n" +
+ " }\n" +
"}"
},
options
@@ -4692,14 +4692,14 @@ public void testStream1_Double_Long() {
runConformTest(
new String[] {
"A.java",
- "import java.util.stream.*;\n" +
- "class A {\n" +
- " public void f(Stream<Object> s) {\n" +
- " DoubleStream n = s.mapToDouble(o -> 0.2);\n" +
- " LongStream n2 = LongStream.range(23, 42);\n" +
- " n.forEach(i -> System.out.println(i));\n" +
- " n2.forEach(i -> System.out.println(i));\n" +
- " }\n" +
+ "import java.util.stream.*;\n" +
+ "class A {\n" +
+ " public void f(Stream<Object> s) {\n" +
+ " DoubleStream n = s.mapToDouble(o -> 0.2);\n" +
+ " LongStream n2 = LongStream.range(23, 42);\n" +
+ " n.forEach(i -> System.out.println(i));\n" +
+ " n2.forEach(i -> System.out.println(i));\n" +
+ " }\n" +
"}"
},
options
@@ -4715,20 +4715,20 @@ public void testStream2() {
runLeakTest(
new String[] {
"A.java",
- "import java.util.stream.Stream;\n" +
- "import java.nio.file.*;\n" +
- "class A {\n" +
- " long test(Path start, FileVisitOption... options) throws java.io.IOException {\n" +
- " Stream<Path> stream = Files.walk(start, options);\n" +
- " return stream.count();\n" +
- " }\n" +
+ "import java.util.stream.Stream;\n" +
+ "import java.nio.file.*;\n" +
+ "class A {\n" +
+ " long test(Path start, FileVisitOption... options) throws java.io.IOException {\n" +
+ " Stream<Path> stream = Files.walk(start, options);\n" +
+ " return stream.count();\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in A.java (at line 5)\n" +
- " Stream<Path> stream = Files.walk(start, options);\n" +
- " ^^^^^^\n" +
- "Resource leak: \'stream\' is never closed\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 5)\n" +
+ " Stream<Path> stream = Files.walk(start, options);\n" +
+ " ^^^^^^\n" +
+ "Resource leak: \'stream\' is never closed\n" +
"----------\n",
options
);
@@ -4743,21 +4743,21 @@ public void testStream3() {
runLeakTest(
new String[] {
"A.java",
- "import java.util.stream.Stream;\n" +
- "import java.nio.file.*;\n" +
- "class A {\n" +
- " void test(Path file) throws java.io.IOException {\n" +
+ "import java.util.stream.Stream;\n" +
+ "import java.nio.file.*;\n" +
+ "class A {\n" +
+ " void test(Path file) throws java.io.IOException {\n" +
" Stream<String> lines = Files.lines(file);\n" +
- " if (lines.count() > 0)" +
- " lines.close();\n" +
- " }\n" +
+ " if (lines.count() > 0)" +
+ " lines.close();\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in A.java (at line 5)\n" +
- " Stream<String> lines = Files.lines(file);\n" +
- " ^^^^^\n" +
- "Potential resource leak: \'lines\' may not be closed\n" +
+ "----------\n" +
+ "1. ERROR in A.java (at line 5)\n" +
+ " Stream<String> lines = Files.lines(file);\n" +
+ " ^^^^^\n" +
+ "Potential resource leak: \'lines\' may not be closed\n" +
"----------\n",
options
);
@@ -4772,14 +4772,14 @@ public void testStream4() {
runConformTest(
new String[] {
"A.java",
- "import java.util.stream.Stream;\n" +
- "import java.nio.file.*;\n" +
- "class A {\n" +
- " void test(Path dir) throws java.io.IOException {\n" +
+ "import java.util.stream.Stream;\n" +
+ "import java.nio.file.*;\n" +
+ "class A {\n" +
+ " void test(Path dir) throws java.io.IOException {\n" +
" try (Stream<Path> list = Files.list(dir)) {\n" +
- " list.forEach(child -> System.out.println(child));\n" +
- " }\n" +
- " }\n" +
+ " list.forEach(child -> System.out.println(child));\n" +
+ " }\n" +
+ " }\n" +
"}"
},
options
@@ -4796,21 +4796,21 @@ public void testBug415790_ex2() {
"X.java",
"import java.io.*;\n" +
"public class X {\n" +
- " public void example2() throws IOException {\n" +
- " for (final File file : new File[] { new File(\"/\") }) {\n" +
- " BufferedReader reader = null;\n" +
- " try {\n" +
- " reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));\n" +
- " }\n" +
- " finally {\n" +
- " try {\n" +
- " reader.close();\n" +
- " }\n" +
- " catch (IOException e) {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ " public void example2() throws IOException {\n" +
+ " for (final File file : new File[] { new File(\"/\") }) {\n" +
+ " BufferedReader reader = null;\n" +
+ " try {\n" +
+ " reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));\n" +
+ " }\n" +
+ " finally {\n" +
+ " try {\n" +
+ " reader.close();\n" +
+ " }\n" +
+ " catch (IOException e) {\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"" +
"}\n"
},
@@ -4825,22 +4825,22 @@ public void testBug415790_ex4() {
"X.java",
"import java.io.*;\n" +
"public class X {\n" +
- " public void example2(File[] files) throws IOException {\n" +
+ " public void example2(File[] files) throws IOException {\n" +
" for (int i = 0; i < files.length; i++) {\n" +
- " File file = files[i];\n" +
- " BufferedReader reader = null;\n" +
- " try {\n" +
- " reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));\n" +
- " }\n" +
- " finally {\n" +
- " try {\n" +
- " reader.close();\n" +
- " }\n" +
- " catch (IOException e) {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ " File file = files[i];\n" +
+ " BufferedReader reader = null;\n" +
+ " try {\n" +
+ " reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));\n" +
+ " }\n" +
+ " finally {\n" +
+ " try {\n" +
+ " reader.close();\n" +
+ " }\n" +
+ " catch (IOException e) {\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"" +
"}\n"
},
@@ -4853,47 +4853,47 @@ public void testBug371614_comment0() {
runLeakTest(
new String[] {
"C.java",
- "import java.io.FileInputStream;\n" +
- "import java.io.IOException;\n" +
- "import java.io.InputStream;\n" +
- "\n" +
- "public class C {\n" +
- " public static void main(String[] args) {\n" +
- " FileInputStream fileInputStream= null;\n" +
- " try {\n" +
- " fileInputStream = new FileInputStream(args[0]);\n" +
- " while (true) {\n" +
- " if (fileInputStream.read() == -1) {\n" +
- " System.out.println(\"done\");\n" +
- "// Resource leak: 'fileInputStream' is not closed at this location\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- " } catch (IOException e) {\n" +
- " e.printStackTrace();\n" +
- " return;\n" +
- " } finally {\n" +
- " closeStream(fileInputStream);\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " private static void closeStream(InputStream stream) {\n" +
- " if (stream != null) {\n" +
- " try {\n" +
- " stream.close();\n" +
- " } catch (IOException e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n" +
+ "import java.io.FileInputStream;\n" +
+ "import java.io.IOException;\n" +
+ "import java.io.InputStream;\n" +
+ "\n" +
+ "public class C {\n" +
+ " public static void main(String[] args) {\n" +
+ " FileInputStream fileInputStream= null;\n" +
+ " try {\n" +
+ " fileInputStream = new FileInputStream(args[0]);\n" +
+ " while (true) {\n" +
+ " if (fileInputStream.read() == -1) {\n" +
+ " System.out.println(\"done\");\n" +
+ "// Resource leak: 'fileInputStream' is not closed at this location\n" +
+ " return;\n" +
+ " }\n" +
+ " }\n" +
+ " } catch (IOException e) {\n" +
+ " e.printStackTrace();\n" +
+ " return;\n" +
+ " } finally {\n" +
+ " closeStream(fileInputStream);\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " private static void closeStream(InputStream stream) {\n" +
+ " if (stream != null) {\n" +
+ " try {\n" +
+ " stream.close();\n" +
+ " } catch (IOException e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
"\n"
},
- "----------\n" +
- "1. ERROR in C.java (at line 14)\n" +
- " return;\n" +
- " ^^^^^^^\n" +
- "Potential resource leak: \'fileInputStream\' may not be closed at this location\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 14)\n" +
+ " return;\n" +
+ " ^^^^^^^\n" +
+ "Potential resource leak: \'fileInputStream\' may not be closed at this location\n" +
"----------\n",
options);
}
@@ -4905,39 +4905,39 @@ public void testBug371614_comment2() {
runConformTest(
new String[] {
"ResourceLeak.java",
- "import java.io.FileInputStream;\n" +
- "import java.io.IOException;\n" +
- "import java.io.InputStreamReader;\n" +
- "import java.io.Reader;\n" +
- "\n" +
- "public class ResourceLeak {\n" +
- "\n" +
- " boolean check(final Reader r) throws IOException {\n" +
- " final int i = r.read();\n" +
- " return (i != -1);\n" +
- " }\n" +
- "\n" +
- " public void test1() throws IOException {\n" +
- " try (Reader r = new InputStreamReader(System.in);) {\n" +
- " while (check(r)) {\n" +
- " if (check(r))\n" +
- " throw new IOException(\"fail\");\n" +
- " if (!check(r))\n" +
- " throw new IOException(\"fail\");\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public void test2() throws IOException {\n" +
- " try (Reader r = new InputStreamReader(new FileInputStream(\"test.txt\"));) {\n" +
- " while (check(r)) {\n" +
- " if (check(r))\n" +
- " throw new IOException(\"fail\");\n" +
- " if (!check(r))\n" +
- " throw new IOException(\"fail\");\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "import java.io.FileInputStream;\n" +
+ "import java.io.IOException;\n" +
+ "import java.io.InputStreamReader;\n" +
+ "import java.io.Reader;\n" +
+ "\n" +
+ "public class ResourceLeak {\n" +
+ "\n" +
+ " boolean check(final Reader r) throws IOException {\n" +
+ " final int i = r.read();\n" +
+ " return (i != -1);\n" +
+ " }\n" +
+ "\n" +
+ " public void test1() throws IOException {\n" +
+ " try (Reader r = new InputStreamReader(System.in);) {\n" +
+ " while (check(r)) {\n" +
+ " if (check(r))\n" +
+ " throw new IOException(\"fail\");\n" +
+ " if (!check(r))\n" +
+ " throw new IOException(\"fail\");\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public void test2() throws IOException {\n" +
+ " try (Reader r = new InputStreamReader(new FileInputStream(\"test.txt\"));) {\n" +
+ " while (check(r)) {\n" +
+ " if (check(r))\n" +
+ " throw new IOException(\"fail\");\n" +
+ " if (!check(r))\n" +
+ " throw new IOException(\"fail\");\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
options);
@@ -4955,12 +4955,12 @@ public void testBug371614_comment8() {
"public class X {\n" +
" Socket fSocket;\n" +
" void test() {\n" +
- " try (InputStreamReader socketIn = new InputStreamReader(fSocket.getInputStream())) {\n" +
- " while (true) {\n" +
- " if (socketIn.read(new char[1024]) < 0)\n" +
- " throw new IOException(\"Error\");\n" +
- " } \n" +
- " } catch (IOException e) {\n" +
+ " try (InputStreamReader socketIn = new InputStreamReader(fSocket.getInputStream())) {\n" +
+ " while (true) {\n" +
+ " if (socketIn.read(new char[1024]) < 0)\n" +
+ " throw new IOException(\"Error\");\n" +
+ " } \n" +
+ " } catch (IOException e) {\n" +
" }" +
" }\n" +
"}\n"
@@ -4981,29 +4981,29 @@ public void testBug462371_orig() {
" boolean exists();\n" +
"}\n" +
"public class X {\n" +
- " public static String getAnnotatedSignature(String typeName, IFile file, String selector, String originalSignature) {\n" +
- " if (file.exists()) {\n" +
- " try (BufferedReader reader = new BufferedReader(new InputStreamReader(file.getContents()))) {\n" +
- " reader.readLine();\n" +
- " while (true) {\n" +
- " String line = reader.readLine(); \n" +
- " // selector:\n" +
- " if (selector.equals(line)) {\n" +
- " // original signature:\n" +
- " line = reader.readLine();\n" +
- " if (originalSignature.equals(\"\")) {\n" +
- " // annotated signature:\n" +
- " return reader.readLine();\n" +
- " }\n" +
- " }\n" +
- " if (line == null)\n" +
- " break;\n" +
- " }\n" +
- " } catch (IOException e) {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- " return null;\n" +
+ " public static String getAnnotatedSignature(String typeName, IFile file, String selector, String originalSignature) {\n" +
+ " if (file.exists()) {\n" +
+ " try (BufferedReader reader = new BufferedReader(new InputStreamReader(file.getContents()))) {\n" +
+ " reader.readLine();\n" +
+ " while (true) {\n" +
+ " String line = reader.readLine(); \n" +
+ " // selector:\n" +
+ " if (selector.equals(line)) {\n" +
+ " // original signature:\n" +
+ " line = reader.readLine();\n" +
+ " if (originalSignature.equals(\"\")) {\n" +
+ " // annotated signature:\n" +
+ " return reader.readLine();\n" +
+ " }\n" +
+ " }\n" +
+ " if (line == null)\n" +
+ " break;\n" +
+ " }\n" +
+ " } catch (IOException e) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ " return null;\n" +
" }\n" +
"}\n"
},
@@ -5022,38 +5022,38 @@ public void _testBug462371_shouldWarn() {
" boolean exists();\n" +
"}\n" +
"public class X {\n" +
- " public static String getAnnotatedSignature(String typeName, IFile file, String selector, String originalSignature) {\n" +
- " if (file.exists()) {\n" +
- " try {\n" +
- " BufferedReader reader = new BufferedReader(new InputStreamReader(file.getContents())); \n" +
- " reader.readLine();\n" +
- " while (true) {\n" +
- " String line = reader.readLine(); \n" +
- " // selector:\n" +
- " if (selector.equals(line)) {\n" +
- " // original signature:\n" +
- " line = reader.readLine();\n" +
- " if (originalSignature.equals(\"\")) {\n" +
- " // annotated signature:\n" +
- " return reader.readLine();\n" +
- " }\n" +
- " }\n" +
- " if (line == null)\n" +
- " break;\n" +
- " }\n" +
- " } catch (IOException e) {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- " return null;\n" +
+ " public static String getAnnotatedSignature(String typeName, IFile file, String selector, String originalSignature) {\n" +
+ " if (file.exists()) {\n" +
+ " try {\n" +
+ " BufferedReader reader = new BufferedReader(new InputStreamReader(file.getContents())); \n" +
+ " reader.readLine();\n" +
+ " while (true) {\n" +
+ " String line = reader.readLine(); \n" +
+ " // selector:\n" +
+ " if (selector.equals(line)) {\n" +
+ " // original signature:\n" +
+ " line = reader.readLine();\n" +
+ " if (originalSignature.equals(\"\")) {\n" +
+ " // annotated signature:\n" +
+ " return reader.readLine();\n" +
+ " }\n" +
+ " }\n" +
+ " if (line == null)\n" +
+ " break;\n" +
+ " }\n" +
+ " } catch (IOException e) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " }\n" +
+ " return null;\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in C.java (at line 14)\n" +
- " return;\n" +
- " ^^^^^^^\n" +
- "Potential resource leak: \'fileInputStream\' may not be closed at this location\n" +
+ "----------\n" +
+ "1. ERROR in C.java (at line 14)\n" +
+ " return;\n" +
+ " ^^^^^^^\n" +
+ "Potential resource leak: \'fileInputStream\' may not be closed at this location\n" +
"----------\n",
options);
}
@@ -5064,21 +5064,21 @@ public void testBug421035() {
runConformTest(
new String[] {
"Test.java",
- "import java.io.BufferedReader;\n" +
- "import java.io.FileNotFoundException;\n" +
- "import java.io.FileReader;\n" +
- "import java.io.IOException;\n" +
- "import java.io.Reader;\n" +
- "\n" +
- "public class Test {\n" +
- " void test() throws FileNotFoundException {\n" +
- " Reader a = (Reader)new BufferedReader(new FileReader(\"a\"));\n" +
- " try {\n" +
- " a.close();\n" +
- " } catch (IOException e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ "import java.io.BufferedReader;\n" +
+ "import java.io.FileNotFoundException;\n" +
+ "import java.io.FileReader;\n" +
+ "import java.io.IOException;\n" +
+ "import java.io.Reader;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " void test() throws FileNotFoundException {\n" +
+ " Reader a = (Reader)new BufferedReader(new FileReader(\"a\"));\n" +
+ " try {\n" +
+ " a.close();\n" +
+ " } catch (IOException e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
options);
@@ -5091,26 +5091,26 @@ public void testBug444964() {
runConformTest(
new String[] {
"Bug444964.java",
- "import java.io.*;\n" +
- "\n" +
- "public class Bug444964 {\n" +
- " void wrong() {\n" +
- " try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {\n" +
- " for (;;) {\n" +
- " return;\n" +
- " }\n" +
- " } catch (Exception e) {\n" +
- " }\n" +
- " }\n" +
- " void right() {\n" +
- " try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {\n" +
- " while (true) {\n" +
- " return;\n" +
- " }\n" +
- " } catch (Exception e) {\n" +
- " }\n" +
- " }\n" +
- "\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "public class Bug444964 {\n" +
+ " void wrong() {\n" +
+ " try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {\n" +
+ " for (;;) {\n" +
+ " return;\n" +
+ " }\n" +
+ " } catch (Exception e) {\n" +
+ " }\n" +
+ " }\n" +
+ " void right() {\n" +
+ " try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {\n" +
+ " while (true) {\n" +
+ " return;\n" +
+ " }\n" +
+ " } catch (Exception e) {\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
"}\n"
},
options);
@@ -5123,55 +5123,55 @@ public void testBug397204() {
runConformTest(
new String[] {
"HostIdTest.java",
- "import java.io.*;\n" +
- "import java.net.InetAddress;\n" +
- "import java.net.NetworkInterface;\n" +
- "import java.util.Enumeration;\n" +
- "import java.util.Formatter;\n" +
- "import java.util.Locale;\n" +
- "\n" +
- "\n" +
- "public class HostIdTest {\n" +
- "\n" +
- " public final void primaryNetworkInterface() throws IOException {\n" +
- " System.out.println(InetAddress.getLocalHost());\n" +
- " System.out.println(InetAddress.getLocalHost().getHostName());\n" +
- " System.out.println(hostId());\n" +
- " }\n" +
- "\n" +
- " String hostId() throws IOException {\n" +
- " try (StringWriter s = new StringWriter(); PrintWriter p = new PrintWriter(s)) {\n" +
- " p.print(InetAddress.getLocalHost().getHostName());\n" +
- " p.print('/');\n" +
- " Enumeration<NetworkInterface> e = NetworkInterface.getNetworkInterfaces();\n" +
- " while (e.hasMoreElements()) {\n" +
- " NetworkInterface i = e.nextElement();\n" +
- " System.out.println(i);\n" +
- " if (i.getHardwareAddress() == null || i.getHardwareAddress().length == 0)\n" +
- " continue;\n" +
- " for (byte b : i.getHardwareAddress())\n" +
- " p.printf(\"%02x\", b);\n" +
- " return s.toString();\n" +
- " }\n" +
- " throw new RuntimeException(\"Unable to determine Host ID\");\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public void otherHostId() throws Exception {\n" +
- " InetAddress addr = InetAddress.getLocalHost();\n" +
- " byte[] ipaddr = addr.getAddress();\n" +
- " if (ipaddr.length == 4) {\n" +
- " int hostid = ipaddr[1] << 24 | ipaddr[0] << 16 | ipaddr[3] << 8 | ipaddr[2];\n" +
- " StringBuilder sb = new StringBuilder();\n" +
- " try (Formatter formatter = new Formatter(sb, Locale.US)) {\n" +
- " formatter.format(\"%08x\", hostid);\n" +
- " System.out.println(sb.toString());\n" +
- " }\n" +
- " } else {\n" +
- " throw new Exception(\"hostid for IPv6 addresses not implemented yet\");\n" +
- " }\n" +
- " }\n" +
- " \n" +
+ "import java.io.*;\n" +
+ "import java.net.InetAddress;\n" +
+ "import java.net.NetworkInterface;\n" +
+ "import java.util.Enumeration;\n" +
+ "import java.util.Formatter;\n" +
+ "import java.util.Locale;\n" +
+ "\n" +
+ "\n" +
+ "public class HostIdTest {\n" +
+ "\n" +
+ " public final void primaryNetworkInterface() throws IOException {\n" +
+ " System.out.println(InetAddress.getLocalHost());\n" +
+ " System.out.println(InetAddress.getLocalHost().getHostName());\n" +
+ " System.out.println(hostId());\n" +
+ " }\n" +
+ "\n" +
+ " String hostId() throws IOException {\n" +
+ " try (StringWriter s = new StringWriter(); PrintWriter p = new PrintWriter(s)) {\n" +
+ " p.print(InetAddress.getLocalHost().getHostName());\n" +
+ " p.print('/');\n" +
+ " Enumeration<NetworkInterface> e = NetworkInterface.getNetworkInterfaces();\n" +
+ " while (e.hasMoreElements()) {\n" +
+ " NetworkInterface i = e.nextElement();\n" +
+ " System.out.println(i);\n" +
+ " if (i.getHardwareAddress() == null || i.getHardwareAddress().length == 0)\n" +
+ " continue;\n" +
+ " for (byte b : i.getHardwareAddress())\n" +
+ " p.printf(\"%02x\", b);\n" +
+ " return s.toString();\n" +
+ " }\n" +
+ " throw new RuntimeException(\"Unable to determine Host ID\");\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public void otherHostId() throws Exception {\n" +
+ " InetAddress addr = InetAddress.getLocalHost();\n" +
+ " byte[] ipaddr = addr.getAddress();\n" +
+ " if (ipaddr.length == 4) {\n" +
+ " int hostid = ipaddr[1] << 24 | ipaddr[0] << 16 | ipaddr[3] << 8 | ipaddr[2];\n" +
+ " StringBuilder sb = new StringBuilder();\n" +
+ " try (Formatter formatter = new Formatter(sb, Locale.US)) {\n" +
+ " formatter.format(\"%08x\", hostid);\n" +
+ " System.out.println(sb.toString());\n" +
+ " }\n" +
+ " } else {\n" +
+ " throw new Exception(\"hostid for IPv6 addresses not implemented yet\");\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
"}\n"
},
options);
@@ -5184,17 +5184,17 @@ public void testBug397204_comment4() {
runConformTest(
new String[] {
"HostIdTest.java",
- "import java.io.*;\n" +
- "\n" +
- "public class HostIdTest {\n" +
- "\n" +
- " void simple() throws Exception {\n" +
- " try (InputStream x = new ByteArrayInputStream(null)) {\n" +
- " while (Math.abs(1) == 1)\n" +
- " if (Math.abs(1) == 1)\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "public class HostIdTest {\n" +
+ "\n" +
+ " void simple() throws Exception {\n" +
+ " try (InputStream x = new ByteArrayInputStream(null)) {\n" +
+ " while (Math.abs(1) == 1)\n" +
+ " if (Math.abs(1) == 1)\n" +
+ " return;\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
options);
@@ -5207,19 +5207,19 @@ public void testBug433510() {
runConformTest(
new String[] {
"Bug433510.java",
- "import java.io.*;\n" +
- "\n" +
- "public class Bug433510 {\n" +
- "\n" +
- " void test() throws Exception {\n" +
- " try (Reader r = new StringReader(\"Hello World!\")) {\n" +
- " int c;\n" +
- " while ((c = r.read()) != -1) {\n" +
- " if (c == ' ')\n" +
- " throw new IOException(\"Unexpected space\");\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "public class Bug433510 {\n" +
+ "\n" +
+ " void test() throws Exception {\n" +
+ " try (Reader r = new StringReader(\"Hello World!\")) {\n" +
+ " int c;\n" +
+ " while ((c = r.read()) != -1) {\n" +
+ " if (c == ' ')\n" +
+ " throw new IOException(\"Unexpected space\");\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
options);
@@ -5231,76 +5231,76 @@ public void testBug440282() {
runLeakTest(
new String[] {
"ResourceLeakFalseNegative.java",
- "import java.io.FileInputStream;\n" +
- "import java.io.IOException;\n" +
- "import java.io.InputStreamReader;\n" +
- "\n" +
- "public final class ResourceLeakFalseNegative {\n" +
- "\n" +
- " private static final class Foo implements AutoCloseable {\n" +
- " final InputStreamReader reader;\n" +
- "\n" +
- " Foo(final InputStreamReader reader) {\n" +
- " this.reader = reader;\n" +
- " }\n" +
- " \n" +
- " public int read() throws IOException {\n" +
- " return reader.read();\n" +
- " }\n" +
- "\n" +
- " public void close() throws IOException {\n" +
- " reader.close();\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private static final class Bar {\n" +
- " final int read;\n" +
- "\n" +
- " Bar(final InputStreamReader reader) throws IOException {\n" +
- " read = reader.read();\n" +
- " }\n" +
- " \n" +
- " public int read() {\n" +
- " return read;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public final static int foo() throws IOException {\n" +
- " final FileInputStream in = new FileInputStream(\"/dev/null\");\n" +
- " final InputStreamReader reader = new InputStreamReader(in);\n" +
- " try {\n" +
- " return new Foo(reader).read();\n" +
- " } finally {\n" +
- " // even though Foo is not closed, no potential resource leak is reported.\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public final static int bar() throws IOException {\n" +
- " final FileInputStream in = new FileInputStream(\"/dev/null\");\n" +
- " final InputStreamReader reader = new InputStreamReader(in);\n" +
- " try {\n" +
- " final Bar bar = new Bar(reader);\n" +
- " return bar.read();\n" +
- " } finally {\n" +
- " // Removing the close correctly reports potential resource leak as a warning,\n" +
- " // because Bar does not implement AutoCloseable.\n" +
- " reader.close();\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) throws IOException {\n" +
- " for (;;) {\n" +
- " foo();\n" +
- " bar();\n" +
- " }\n" +
- " }\n" +
+ "import java.io.FileInputStream;\n" +
+ "import java.io.IOException;\n" +
+ "import java.io.InputStreamReader;\n" +
+ "\n" +
+ "public final class ResourceLeakFalseNegative {\n" +
+ "\n" +
+ " private static final class Foo implements AutoCloseable {\n" +
+ " final InputStreamReader reader;\n" +
+ "\n" +
+ " Foo(final InputStreamReader reader) {\n" +
+ " this.reader = reader;\n" +
+ " }\n" +
+ " \n" +
+ " public int read() throws IOException {\n" +
+ " return reader.read();\n" +
+ " }\n" +
+ "\n" +
+ " public void close() throws IOException {\n" +
+ " reader.close();\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " private static final class Bar {\n" +
+ " final int read;\n" +
+ "\n" +
+ " Bar(final InputStreamReader reader) throws IOException {\n" +
+ " read = reader.read();\n" +
+ " }\n" +
+ " \n" +
+ " public int read() {\n" +
+ " return read;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public final static int foo() throws IOException {\n" +
+ " final FileInputStream in = new FileInputStream(\"/dev/null\");\n" +
+ " final InputStreamReader reader = new InputStreamReader(in);\n" +
+ " try {\n" +
+ " return new Foo(reader).read();\n" +
+ " } finally {\n" +
+ " // even though Foo is not closed, no potential resource leak is reported.\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public final static int bar() throws IOException {\n" +
+ " final FileInputStream in = new FileInputStream(\"/dev/null\");\n" +
+ " final InputStreamReader reader = new InputStreamReader(in);\n" +
+ " try {\n" +
+ " final Bar bar = new Bar(reader);\n" +
+ " return bar.read();\n" +
+ " } finally {\n" +
+ " // Removing the close correctly reports potential resource leak as a warning,\n" +
+ " // because Bar does not implement AutoCloseable.\n" +
+ " reader.close();\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) throws IOException {\n" +
+ " for (;;) {\n" +
+ " foo();\n" +
+ " bar();\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in ResourceLeakFalseNegative.java (at line 39)\n" +
- " return new Foo(reader).read();\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
+ "----------\n" +
+ "1. ERROR in ResourceLeakFalseNegative.java (at line 39)\n" +
+ " return new Foo(reader).read();\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
"----------\n",
options);
}
@@ -5313,50 +5313,50 @@ public void testBug390064() {
runLeakTest(
new String[] {
"Redundant.java",
- "public class Redundant\n" +
- "{\n" +
- " private static class A<T> implements AutoCloseable\n" +
- " {\n" +
- " public void close()\n" +
- " {\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private static class B extends A<Object>\n" +
- " {\n" +
- " \n" +
- " }\n" +
- " \n" +
- " private static class C implements AutoCloseable\n" +
- " {\n" +
- " public void close()\n" +
- " {\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " private static class D extends C\n" +
- " {\n" +
- " \n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " new B();\n" +
- " \n" +
- " new D();\n" +
- " }\n" +
+ "public class Redundant\n" +
+ "{\n" +
+ " private static class A<T> implements AutoCloseable\n" +
+ " {\n" +
+ " public void close()\n" +
+ " {\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " private static class B extends A<Object>\n" +
+ " {\n" +
+ " \n" +
+ " }\n" +
+ " \n" +
+ " private static class C implements AutoCloseable\n" +
+ " {\n" +
+ " public void close()\n" +
+ " {\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " private static class D extends C\n" +
+ " {\n" +
+ " \n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args)\n" +
+ " {\n" +
+ " new B();\n" +
+ " \n" +
+ " new D();\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Redundant.java (at line 29)\n" +
- " new B();\n" +
- " ^^^^^^^\n" +
- "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
- "----------\n" +
- "2. ERROR in Redundant.java (at line 31)\n" +
- " new D();\n" +
- " ^^^^^^^\n" +
- "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
+ "----------\n" +
+ "1. ERROR in Redundant.java (at line 29)\n" +
+ " new B();\n" +
+ " ^^^^^^^\n" +
+ "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
+ "----------\n" +
+ "2. ERROR in Redundant.java (at line 31)\n" +
+ " new D();\n" +
+ " ^^^^^^^\n" +
+ "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
"----------\n",
options);
}
@@ -5368,54 +5368,54 @@ public void testBug396575() {
runLeakTest(
new String[] {
"Bug396575.java",
- "import java.io.*;\n" +
- "\n" +
- "public class Bug396575 {\n" +
- " void test1(File myFile) {\n" +
- " OutputStream out = null;\n" +
- " BufferedWriter bw = null;\n" +
- " try {\n" +
- " // code...\n" +
- " out = new FileOutputStream(myFile);\n" +
- " OutputStreamWriter writer = new OutputStreamWriter(out);\n" +
- " bw = new BufferedWriter(writer);\n" +
- " // more code...\n" +
- " } catch (Exception e) {\n" +
- " try {\n" +
- " bw.close(); // WARN: potential null pointer access\n" +
- " } catch (Exception ignored) {}\n" +
- " return; // WARN: resource leak - bw may not be closed\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " void test2(File myFile) {\n" +
- " BufferedWriter bw = null;\n" +
- " try {\n" +
- " // code...\n" +
- " // declare \"out\" here inside try-catch as a temp variable\n" +
- " OutputStream out = new FileOutputStream(myFile); // WARN: out is never closed.\n" +
- " OutputStreamWriter writer = new OutputStreamWriter(out);\n" +
- " bw = new BufferedWriter(writer);\n" +
- " // more code...\n" +
- " } catch (Exception e) {\n" +
- " try {\n" +
- " bw.close(); // WARN: potential null pointer access\n" +
- " } catch (Exception ignored) {}\n" +
- " return; // WARN: resource leak - bw may not be closed\n" +
- " }\n" +
- " }\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "public class Bug396575 {\n" +
+ " void test1(File myFile) {\n" +
+ " OutputStream out = null;\n" +
+ " BufferedWriter bw = null;\n" +
+ " try {\n" +
+ " // code...\n" +
+ " out = new FileOutputStream(myFile);\n" +
+ " OutputStreamWriter writer = new OutputStreamWriter(out);\n" +
+ " bw = new BufferedWriter(writer);\n" +
+ " // more code...\n" +
+ " } catch (Exception e) {\n" +
+ " try {\n" +
+ " bw.close(); // WARN: potential null pointer access\n" +
+ " } catch (Exception ignored) {}\n" +
+ " return; // WARN: resource leak - bw may not be closed\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " void test2(File myFile) {\n" +
+ " BufferedWriter bw = null;\n" +
+ " try {\n" +
+ " // code...\n" +
+ " // declare \"out\" here inside try-catch as a temp variable\n" +
+ " OutputStream out = new FileOutputStream(myFile); // WARN: out is never closed.\n" +
+ " OutputStreamWriter writer = new OutputStreamWriter(out);\n" +
+ " bw = new BufferedWriter(writer);\n" +
+ " // more code...\n" +
+ " } catch (Exception e) {\n" +
+ " try {\n" +
+ " bw.close(); // WARN: potential null pointer access\n" +
+ " } catch (Exception ignored) {}\n" +
+ " return; // WARN: resource leak - bw may not be closed\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Bug396575.java (at line 11)\n" +
- " bw = new BufferedWriter(writer);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Resource leak: \'bw\' is never closed\n" +
- "----------\n" +
- "2. ERROR in Bug396575.java (at line 28)\n" +
- " bw = new BufferedWriter(writer);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Resource leak: \'bw\' is never closed\n" +
+ "----------\n" +
+ "1. ERROR in Bug396575.java (at line 11)\n" +
+ " bw = new BufferedWriter(writer);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Resource leak: \'bw\' is never closed\n" +
+ "----------\n" +
+ "2. ERROR in Bug396575.java (at line 28)\n" +
+ " bw = new BufferedWriter(writer);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Resource leak: \'bw\' is never closed\n" +
"----------\n",
options);
}
@@ -5427,79 +5427,79 @@ public void testBug473317() {
runner.testFiles =
new String[] {
"AutoCloseableEnhancedForTest.java",
- "import java.util.Iterator;\n" +
- "\n" +
- "public class AutoCloseableEnhancedForTest\n" +
- "{\n" +
- " private static class MyIterator<T> implements Iterator<T>\n" +
- " {\n" +
- " private T value;\n" +
- " \n" +
- " public MyIterator(T value)\n" +
- " {\n" +
- " this.value = value;\n" +
- " }\n" +
- " \n" +
- " @Override\n" +
- " public boolean hasNext()\n" +
- " {\n" +
- " return false;\n" +
- " }\n" +
- "\n" +
- " @Override\n" +
- " public T next()\n" +
- " {\n" +
- " return value;\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " private static class MyIterable<T> implements Iterable<T>, AutoCloseable\n" +
- " {\n" +
- " @Override\n" +
- " public Iterator<T> iterator()\n" +
- " {\n" +
- " return new MyIterator<>(null);\n" +
- " }\n" +
- " \n" +
- " @Override\n" +
- " public void close() throws Exception\n" +
- " {\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " // Not flagged as \"never closed.\"\n" +
- " for (Object value : new MyIterable<>())\n" +
- " {\n" +
- " System.out.println(String.valueOf(value));\n" +
- " \n" +
- " break;\n" +
- " }\n" +
- " \n" +
- " // Flagged as \"never closed.\"\n" +
- " MyIterable<Object> iterable = new MyIterable<>();\n" +
- " \n" +
- " for (Object value : iterable)\n" +
- " {\n" +
- " System.out.println(String.valueOf(value));\n" +
- " \n" +
- " break;\n" +
- " }\n" +
- " }\n" +
+ "import java.util.Iterator;\n" +
+ "\n" +
+ "public class AutoCloseableEnhancedForTest\n" +
+ "{\n" +
+ " private static class MyIterator<T> implements Iterator<T>\n" +
+ " {\n" +
+ " private T value;\n" +
+ " \n" +
+ " public MyIterator(T value)\n" +
+ " {\n" +
+ " this.value = value;\n" +
+ " }\n" +
+ " \n" +
+ " @Override\n" +
+ " public boolean hasNext()\n" +
+ " {\n" +
+ " return false;\n" +
+ " }\n" +
+ "\n" +
+ " @Override\n" +
+ " public T next()\n" +
+ " {\n" +
+ " return value;\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " private static class MyIterable<T> implements Iterable<T>, AutoCloseable\n" +
+ " {\n" +
+ " @Override\n" +
+ " public Iterator<T> iterator()\n" +
+ " {\n" +
+ " return new MyIterator<>(null);\n" +
+ " }\n" +
+ " \n" +
+ " @Override\n" +
+ " public void close() throws Exception\n" +
+ " {\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args)\n" +
+ " {\n" +
+ " // Not flagged as \"never closed.\"\n" +
+ " for (Object value : new MyIterable<>())\n" +
+ " {\n" +
+ " System.out.println(String.valueOf(value));\n" +
+ " \n" +
+ " break;\n" +
+ " }\n" +
+ " \n" +
+ " // Flagged as \"never closed.\"\n" +
+ " MyIterable<Object> iterable = new MyIterable<>();\n" +
+ " \n" +
+ " for (Object value : iterable)\n" +
+ " {\n" +
+ " System.out.println(String.valueOf(value));\n" +
+ " \n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in AutoCloseableEnhancedForTest.java (at line 44)\n" +
- " for (Object value : new MyIterable<>())\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
- "----------\n" +
- "2. WARNING in AutoCloseableEnhancedForTest.java (at line 52)\n" +
- " MyIterable<Object> iterable = new MyIterable<>();\n" +
- " ^^^^^^^^\n" +
- "Resource leak: \'iterable\' is never closed\n" +
+ "----------\n" +
+ "1. WARNING in AutoCloseableEnhancedForTest.java (at line 44)\n" +
+ " for (Object value : new MyIterable<>())\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
+ "----------\n" +
+ "2. WARNING in AutoCloseableEnhancedForTest.java (at line 52)\n" +
+ " MyIterable<Object> iterable = new MyIterable<>();\n" +
+ " ^^^^^^^^\n" +
+ "Resource leak: \'iterable\' is never closed\n" +
"----------\n";
runner.customOptions = compilerOptions;
runner.runWarningTest(); // javac warns about exception thrown from close() method
@@ -5515,20 +5515,20 @@ public void testBug541705() {
"import java.util.zip.*;\n" +
"import java.io.*;\n" +
"public class Test {\n" +
- " private static HashMap<String, ZipFile> fgZipFileCache = new HashMap<>(5);\n" +
- " public static void closeArchives() {\n" +
- " synchronized (fgZipFileCache) {\n" +
+ " private static HashMap<String, ZipFile> fgZipFileCache = new HashMap<>(5);\n" +
+ " public static void closeArchives() {\n" +
+ " synchronized (fgZipFileCache) {\n" +
" for (ZipFile file : fgZipFileCache.values()) {\n" +
- " synchronized (file) {\n" +
- " try {\n" +
- " file.close();\n" +
- " } catch (IOException e) {\n" +
- " System.out.println(e);\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " fgZipFileCache.clear();\n" +
- " }\n" +
+ " synchronized (file) {\n" +
+ " try {\n" +
+ " file.close();\n" +
+ " } catch (IOException e) {\n" +
+ " System.out.println(e);\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " fgZipFileCache.clear();\n" +
+ " }\n" +
" }\n" +
"}\n"
};
@@ -5545,19 +5545,19 @@ public void testBug541705b() {
"import java.util.zip.*;\n" +
"import java.io.*;\n" +
"public class Test {\n" +
- " private static HashMap<String, ZipFile> fgZipFileCache = new HashMap<>(5);\n" +
- " public static void closeArchives() {\n" +
- " synchronized (fgZipFileCache) {\n" +
- " for (ZipFile file : fgZipFileCache.values()) {\n" +
- " synchronized (file) {\n" +
- " try (file) {\n" +
- " } catch (IOException e) {\n" +
- " System.out.println(e);\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " fgZipFileCache.clear();\n" +
- " }\n" +
+ " private static HashMap<String, ZipFile> fgZipFileCache = new HashMap<>(5);\n" +
+ " public static void closeArchives() {\n" +
+ " synchronized (fgZipFileCache) {\n" +
+ " for (ZipFile file : fgZipFileCache.values()) {\n" +
+ " synchronized (file) {\n" +
+ " try (file) {\n" +
+ " } catch (IOException e) {\n" +
+ " System.out.println(e);\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " fgZipFileCache.clear();\n" +
+ " }\n" +
" }\n" +
"}\n"
};
@@ -5608,10 +5608,10 @@ public void testBug542707_001() {
"}\n"
},
"----------\n" +
- "1. ERROR in X.java (at line 31)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "1. ERROR in X.java (at line 31)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n",
options);
}
@@ -5661,15 +5661,15 @@ public void testBug542707_002() {
"}\n"
},
"----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " x = new X();\n" +
- " ^^^^^^^^^^^\n" +
- "Resource leak: \'x\' is not closed at this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 32)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " x = new X();\n" +
+ " ^^^^^^^^^^^\n" +
+ "Resource leak: \'x\' is not closed at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 32)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n",
options);
}
@@ -5718,20 +5718,20 @@ public void testBug542707_003() {
"}\n"
},
"----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " x = switch (i) { \n" +
- " case 1 -> {\n" +
- " yield new X();\n" +
- " }\n" +
- " default -> x;\n" +
- " };\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Resource leak: \'x\' is not closed at this location\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 31)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " x = switch (i) { \n" +
+ " case 1 -> {\n" +
+ " yield new X();\n" +
+ " }\n" +
+ " default -> x;\n" +
+ " };\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Resource leak: \'x\' is not closed at this location\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 31)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n",
options);
}
@@ -5779,41 +5779,41 @@ public void testBug463320() {
"Try17.java",
"import java.util.zip.*;\n" +
"import java.io.*;\n" +
- "public class Try17 {\n" +
- " void potential() throws IOException {\n" +
- " String name= getZipFile().getName();\n" +
- " System.out.println(name);\n" +
- " }\n" +
- " void definite() throws IOException {\n" +
- " String name= new ZipFile(\"bla.jar\").getName();\n" +
- " System.out.println(name);\n" +
+ "public class Try17 {\n" +
+ " void potential() throws IOException {\n" +
+ " String name= getZipFile().getName();\n" +
+ " System.out.println(name);\n" +
+ " }\n" +
+ " void definite() throws IOException {\n" +
+ " String name= new ZipFile(\"bla.jar\").getName();\n" +
+ " System.out.println(name);\n" +
" }\n" +
" void withLocal() throws IOException {\n" +
" ZipFile zipFile = getZipFile();\n" +
- " String name= zipFile.getName();\n" +
- " System.out.println(name);\n" +
- " }\n" +
- "\n" +
- " ZipFile getZipFile() throws IOException {\n" +
- " return new ZipFile(\"bla.jar\");\n" +
- " }\n" +
+ " String name= zipFile.getName();\n" +
+ " System.out.println(name);\n" +
+ " }\n" +
+ "\n" +
+ " ZipFile getZipFile() throws IOException {\n" +
+ " return new ZipFile(\"bla.jar\");\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in Try17.java (at line 5)\n" +
- " String name= getZipFile().getName();\n" +
- " ^^^^^^^^^^^^\n" +
- "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
- "----------\n" +
- "2. ERROR in Try17.java (at line 9)\n" +
- " String name= new ZipFile(\"bla.jar\").getName();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
- "----------\n" +
- "2. ERROR in Try17.java (at line 13)\n" +
- " ZipFile zipFile = getZipFile();\n" +
- " ^^^^^^^\n" +
- "Potential resource leak: \'zipFile\' may not be closed\n" +
+ "----------\n" +
+ "1. ERROR in Try17.java (at line 5)\n" +
+ " String name= getZipFile().getName();\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
+ "----------\n" +
+ "2. ERROR in Try17.java (at line 9)\n" +
+ " String name= new ZipFile(\"bla.jar\").getName();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
+ "----------\n" +
+ "2. ERROR in Try17.java (at line 13)\n" +
+ " ZipFile zipFile = getZipFile();\n" +
+ " ^^^^^^^\n" +
+ "Potential resource leak: \'zipFile\' may not be closed\n" +
"----------\n",
options);
}
@@ -5828,27 +5828,27 @@ public void testBug463320_comment8() {
"import java.io.*;\n" +
"import java.nio.file.*;\n" +
"import java.net.*;\n" +
- "public class Try17 {\n" +
- " public InputStream openInputStream(URI uri) {\n" +
- " try {\n" +
- " System.out.println(FileSystems.getFileSystem(uri));\n" +
- " return Files.newInputStream(Paths.get(uri));\n" +
- " } catch (FileSystemNotFoundException e) {\n" +
- " throw new IllegalArgumentException(e);\n" +
- " } catch (IOException e) {\n" +
- " throw new IllegalStateException(e);\n" +
- " }\n" +
- " }\n" +
+ "public class Try17 {\n" +
+ " public InputStream openInputStream(URI uri) {\n" +
+ " try {\n" +
+ " System.out.println(FileSystems.getFileSystem(uri));\n" +
+ " return Files.newInputStream(Paths.get(uri));\n" +
+ " } catch (FileSystemNotFoundException e) {\n" +
+ " throw new IllegalArgumentException(e);\n" +
+ " } catch (IOException e) {\n" +
+ " throw new IllegalStateException(e);\n" +
+ " }\n" +
+ " }\n" +
" public InputStream delegateGet(URI uri) {\n" +
" return openInputStream(uri);\n" + // no problem here!
- " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in Try17.java (at line 7)\n" +
- " System.out.println(FileSystems.getFileSystem(uri));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
+ "----------\n" +
+ "1. ERROR in Try17.java (at line 7)\n" +
+ " System.out.println(FileSystems.getFileSystem(uri));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
"----------\n",
options);
}
@@ -5903,7 +5903,7 @@ public void testBug560460() {
options);
}
public void testBug463320_comment19() {
- Map options = getCompilerOptions();
+ Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR);
options.put(CompilerOptions.OPTION_ReportPotentiallyUnclosedCloseable, CompilerOptions.ERROR);
@@ -5912,18 +5912,18 @@ public void testBug463320_comment19() {
"Try17.java",
"import java.util.zip.*;\n" +
"import java.io.*;\n" +
- "public class Try17 {\n" +
+ "public class Try17 {\n" +
" void withLocal() throws IOException {\n" +
" ZipFile zipFile = null;\n" +
" if (zipFile != null)" +
" zipFile = getZipFile();\n" + // not reachable
- " String name= zipFile.getName();\n" +
- " System.out.println(name);\n" +
- " }\n" +
- "\n" +
- " ZipFile getZipFile() throws IOException {\n" +
- " return new ZipFile(\"bla.jar\");\n" +
- " }\n" +
+ " String name= zipFile.getName();\n" +
+ " System.out.println(name);\n" +
+ " }\n" +
+ "\n" +
+ " ZipFile getZipFile() throws IOException {\n" +
+ " return new ZipFile(\"bla.jar\");\n" +
+ " }\n" +
"}"
},
options);
@@ -5931,163 +5931,163 @@ public void testBug463320_comment19() {
public void testBug552521() {
if (this.complianceLevel < ClassFileConstants.JDK1_7) return; // uses try-with-resources
- Map options = getCompilerOptions();
+ Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR);
options.put(CompilerOptions.OPTION_ReportPotentiallyUnclosedCloseable, CompilerOptions.WARNING);
runLeakTest(
new String[] {
"EclipseBug552521getChannel.java",
- "import java.io.File;\n" +
- "import java.io.FileInputStream;\n" +
- "import java.io.FileOutputStream;\n" +
- "import java.nio.channels.FileChannel;\n" +
- "\n" +
- "public class EclipseBug552521getChannel {\n" +
- "\n" +
- " @SuppressWarnings(\"unused\")\n" +
- " public void copyFile(final File srcFile, final File dstFile) throws Exception {\n" +
- " /*\n" +
- " * TODO Eclipse Setting: Window/Preferences/Java/Compiler/Errors-Warnings/\n" +
- " * Resource not managed via try-with-resource = Ignore (default)\n" +
- " */\n" +
- " try (\n" +
- " final FileInputStream srcStream = new FileInputStream (srcFile);\n" +
- " final FileChannel srcChannel = srcStream.getChannel();\n" +
+ "import java.io.File;\n" +
+ "import java.io.FileInputStream;\n" +
+ "import java.io.FileOutputStream;\n" +
+ "import java.nio.channels.FileChannel;\n" +
+ "\n" +
+ "public class EclipseBug552521getChannel {\n" +
+ "\n" +
+ " @SuppressWarnings(\"unused\")\n" +
+ " public void copyFile(final File srcFile, final File dstFile) throws Exception {\n" +
+ " /*\n" +
+ " * TODO Eclipse Setting: Window/Preferences/Java/Compiler/Errors-Warnings/\n" +
+ " * Resource not managed via try-with-resource = Ignore (default)\n" +
+ " */\n" +
+ " try (\n" +
+ " final FileInputStream srcStream = new FileInputStream (srcFile);\n" +
+ " final FileChannel srcChannel = srcStream.getChannel();\n" +
" final FileChannel dstChannel = new FileOutputStream(dstFile) .getChannel();\n" + // line 17
- " // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TODO Warning ok\n" +
- " )\n" +
- " {\n" +
- " srcChannel.transferTo(0, srcChannel.size(), dstChannel);\n" +
- " }\n" +
- "\n" +
- " if (srcFile.isFile()) { // \"if\" (resolved at runtime) -> Warning suppressed\n" +
- " try (\n" +
- " final FileInputStream srcStream = new FileInputStream (srcFile);\n" +
- " final FileChannel srcChannel = srcStream.getChannel();\n" +
+ " // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TODO Warning ok\n" +
+ " )\n" +
+ " {\n" +
+ " srcChannel.transferTo(0, srcChannel.size(), dstChannel);\n" +
+ " }\n" +
+ "\n" +
+ " if (srcFile.isFile()) { // \"if\" (resolved at runtime) -> Warning suppressed\n" +
+ " try (\n" +
+ " final FileInputStream srcStream = new FileInputStream (srcFile);\n" +
+ " final FileChannel srcChannel = srcStream.getChannel();\n" +
" final FileChannel dstChannel = new FileOutputStream(dstFile) .getChannel();\n" + // line 28
- " // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FIXME Warning missing!\n" +
- " )\n" +
- " {\n" +
- " srcChannel.transferTo(0, srcChannel.size(), dstChannel);\n" +
- " }\n" +
- " } else { // \"else\" (resolved at runtime) -> Warning suppressed\n" +
- " try (\n" +
- " final FileInputStream srcStream = new FileInputStream (srcFile);\n" +
- " final FileChannel srcChannel = srcStream.getChannel();\n" +
+ " // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FIXME Warning missing!\n" +
+ " )\n" +
+ " {\n" +
+ " srcChannel.transferTo(0, srcChannel.size(), dstChannel);\n" +
+ " }\n" +
+ " } else { // \"else\" (resolved at runtime) -> Warning suppressed\n" +
+ " try (\n" +
+ " final FileInputStream srcStream = new FileInputStream (srcFile);\n" +
+ " final FileChannel srcChannel = srcStream.getChannel();\n" +
" final FileChannel dstChannel = new FileOutputStream(dstFile) .getChannel();\n" + // line 38
- " // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FIXME Warning missing!\n" +
- " )\n" +
- " {\n" +
- " srcChannel.transferTo(0, srcChannel.size(), dstChannel);\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " if (true) { // Dummy \"if\" (= constant true) -> Warning\n" +
- " try (\n" +
- " final FileInputStream srcStream = new FileInputStream (srcFile);\n" +
- " final FileChannel srcChannel = srcStream.getChannel();\n" +
+ " // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FIXME Warning missing!\n" +
+ " )\n" +
+ " {\n" +
+ " srcChannel.transferTo(0, srcChannel.size(), dstChannel);\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " if (true) { // Dummy \"if\" (= constant true) -> Warning\n" +
+ " try (\n" +
+ " final FileInputStream srcStream = new FileInputStream (srcFile);\n" +
+ " final FileChannel srcChannel = srcStream.getChannel();\n" +
" final FileChannel dstChannel = new FileOutputStream(dstFile) .getChannel();\n" + // line 50
- " // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TODO Warning ok\n" +
- " )\n" +
- " {\n" +
- " srcChannel.transferTo(0, srcChannel.size(), dstChannel);\n" +
- " }\n" +
- " } else { // Dummy \"else\" (= constant false) -> Warning suppressed\n" +
- " try (\n" +
- " final FileInputStream srcStream = new FileInputStream (srcFile);\n" +
- " final FileChannel srcChannel = srcStream.getChannel();\n" +
+ " // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TODO Warning ok\n" +
+ " )\n" +
+ " {\n" +
+ " srcChannel.transferTo(0, srcChannel.size(), dstChannel);\n" +
+ " }\n" +
+ " } else { // Dummy \"else\" (= constant false) -> Warning suppressed\n" +
+ " try (\n" +
+ " final FileInputStream srcStream = new FileInputStream (srcFile);\n" +
+ " final FileChannel srcChannel = srcStream.getChannel();\n" +
" final FileChannel dstChannel = new FileOutputStream(dstFile) .getChannel();\n" + // line 60
- " // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FIXME Warning missing!\n" +
- " )\n" +
- " {\n" +
- " srcChannel.transferTo(0, srcChannel.size(), dstChannel);\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " if (false) { // Dummy \"if\" (= constant false) -> Warning suppressed\n" +
- " try (\n" +
- " final FileInputStream srcStream = new FileInputStream (srcFile);\n" +
- " final FileChannel srcChannel = srcStream.getChannel();\n" +
+ " // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FIXME Warning missing!\n" +
+ " )\n" +
+ " {\n" +
+ " srcChannel.transferTo(0, srcChannel.size(), dstChannel);\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " if (false) { // Dummy \"if\" (= constant false) -> Warning suppressed\n" +
+ " try (\n" +
+ " final FileInputStream srcStream = new FileInputStream (srcFile);\n" +
+ " final FileChannel srcChannel = srcStream.getChannel();\n" +
" final FileChannel dstChannel = new FileOutputStream(dstFile) .getChannel();\n" + // line 72
- " // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FIXME Warning missing!\n" +
- " )\n" +
- " {\n" +
- " srcChannel.transferTo(0, srcChannel.size(), dstChannel);\n" +
- " }\n" +
- " } else { // Dummy \"else\" (= constant true) -> Warning\n" +
- " try (\n" +
- " final FileInputStream srcStream = new FileInputStream (srcFile);\n" +
- " final FileChannel srcChannel = srcStream.getChannel();\n" +
+ " // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FIXME Warning missing!\n" +
+ " )\n" +
+ " {\n" +
+ " srcChannel.transferTo(0, srcChannel.size(), dstChannel);\n" +
+ " }\n" +
+ " } else { // Dummy \"else\" (= constant true) -> Warning\n" +
+ " try (\n" +
+ " final FileInputStream srcStream = new FileInputStream (srcFile);\n" +
+ " final FileChannel srcChannel = srcStream.getChannel();\n" +
" final FileChannel dstChannel = new FileOutputStream(dstFile) .getChannel();\n" + // line 82
- " // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TODO Warning ok\n" +
- " )\n" +
- " {\n" +
- " srcChannel.transferTo(0, srcChannel.size(), dstChannel);\n" +
- " }\n" +
- " }\n" +
- " /*\n" +
- " * Following test-case differs from all the above as follows:\n" +
- " * FileInputStream is unassigned, instead of FileOutputStream\n" +
- " */\n" +
- " try (\n" +
+ " // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TODO Warning ok\n" +
+ " )\n" +
+ " {\n" +
+ " srcChannel.transferTo(0, srcChannel.size(), dstChannel);\n" +
+ " }\n" +
+ " }\n" +
+ " /*\n" +
+ " * Following test-case differs from all the above as follows:\n" +
+ " * FileInputStream is unassigned, instead of FileOutputStream\n" +
+ " */\n" +
+ " try (\n" +
" final FileChannel srcChannel = new FileInputStream (srcFile) .getChannel();\n" + // line 94
- " // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TODO Warning ok\n" +
- " final FileOutputStream dstStream = new FileOutputStream(srcFile);\n" +
- " final FileChannel dstChannel = dstStream.getChannel();\n" +
- " )\n" +
- " {\n" +
- " srcChannel.transferTo(0, srcChannel.size(), dstChannel);\n" +
- " }\n" +
- " }\n" +
+ " // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TODO Warning ok\n" +
+ " final FileOutputStream dstStream = new FileOutputStream(srcFile);\n" +
+ " final FileChannel dstChannel = dstStream.getChannel();\n" +
+ " )\n" +
+ " {\n" +
+ " srcChannel.transferTo(0, srcChannel.size(), dstChannel);\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in EclipseBug552521getChannel.java (at line 17)\n" +
- " final FileChannel dstChannel = new FileOutputStream(dstFile) .getChannel();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
- "----------\n" +
- "2. ERROR in EclipseBug552521getChannel.java (at line 28)\n" +
- " final FileChannel dstChannel = new FileOutputStream(dstFile) .getChannel();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
- "----------\n" +
- "3. ERROR in EclipseBug552521getChannel.java (at line 38)\n" +
- " final FileChannel dstChannel = new FileOutputStream(dstFile) .getChannel();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
- "----------\n" +
- "4. ERROR in EclipseBug552521getChannel.java (at line 50)\n" +
- " final FileChannel dstChannel = new FileOutputStream(dstFile) .getChannel();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
- "----------\n" +
- "5. ERROR in EclipseBug552521getChannel.java (at line 60)\n" +
- " final FileChannel dstChannel = new FileOutputStream(dstFile) .getChannel();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
- "----------\n" +
- "6. ERROR in EclipseBug552521getChannel.java (at line 72)\n" +
- " final FileChannel dstChannel = new FileOutputStream(dstFile) .getChannel();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
- "----------\n" +
- "7. ERROR in EclipseBug552521getChannel.java (at line 82)\n" +
- " final FileChannel dstChannel = new FileOutputStream(dstFile) .getChannel();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
- "----------\n" +
- "8. ERROR in EclipseBug552521getChannel.java (at line 94)\n" +
- " final FileChannel srcChannel = new FileInputStream (srcFile) .getChannel();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
+ "----------\n" +
+ "1. ERROR in EclipseBug552521getChannel.java (at line 17)\n" +
+ " final FileChannel dstChannel = new FileOutputStream(dstFile) .getChannel();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
+ "----------\n" +
+ "2. ERROR in EclipseBug552521getChannel.java (at line 28)\n" +
+ " final FileChannel dstChannel = new FileOutputStream(dstFile) .getChannel();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
+ "----------\n" +
+ "3. ERROR in EclipseBug552521getChannel.java (at line 38)\n" +
+ " final FileChannel dstChannel = new FileOutputStream(dstFile) .getChannel();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
+ "----------\n" +
+ "4. ERROR in EclipseBug552521getChannel.java (at line 50)\n" +
+ " final FileChannel dstChannel = new FileOutputStream(dstFile) .getChannel();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
+ "----------\n" +
+ "5. ERROR in EclipseBug552521getChannel.java (at line 60)\n" +
+ " final FileChannel dstChannel = new FileOutputStream(dstFile) .getChannel();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
+ "----------\n" +
+ "6. ERROR in EclipseBug552521getChannel.java (at line 72)\n" +
+ " final FileChannel dstChannel = new FileOutputStream(dstFile) .getChannel();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
+ "----------\n" +
+ "7. ERROR in EclipseBug552521getChannel.java (at line 82)\n" +
+ " final FileChannel dstChannel = new FileOutputStream(dstFile) .getChannel();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
+ "----------\n" +
+ "8. ERROR in EclipseBug552521getChannel.java (at line 94)\n" +
+ " final FileChannel srcChannel = new FileInputStream (srcFile) .getChannel();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Resource leak: \'<unassigned Closeable value>\' is never closed\n" +
"----------\n",
options);
}
public void testBug552521_comment14() {
if (this.complianceLevel < ClassFileConstants.JDK1_5) return; // uses foreach
- Map options = getCompilerOptions();
+ Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR);
options.put(CompilerOptions.OPTION_ReportPotentiallyUnclosedCloseable, CompilerOptions.ERROR);
runLeakTest(
@@ -6101,33 +6101,33 @@ public void testBug552521_comment14() {
" return Collections.emptyList();\n" +
" }\n" +
" void test(String fileName) throws IOException {\n" +
- " for (String string : process(new FileInputStream(fileName))) {\n" +
- " System.out.println(string);\n" +
+ " for (String string : process(new FileInputStream(fileName))) {\n" +
+ " System.out.println(string);\n" +
" }\n" +
" }\n" +
" void test2(String fileName) throws IOException {\n" +
- " for (String string : process(new FileInputStream(fileName)))\n" +
- " System.out.println(string);\n" +
+ " for (String string : process(new FileInputStream(fileName)))\n" +
+ " System.out.println(string);\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " for (String string : process(new FileInputStream(fileName))) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " for (String string : process(new FileInputStream(fileName)))\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " for (String string : process(new FileInputStream(fileName))) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " for (String string : process(new FileInputStream(fileName)))\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
"----------\n",
options);
}
public void testBug552521_comment14b() {
if (this.complianceLevel < ClassFileConstants.JDK1_5) return; // uses foreach
- Map options = getCompilerOptions();
+ Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR);
options.put(CompilerOptions.OPTION_ReportPotentiallyUnclosedCloseable, CompilerOptions.ERROR);
runLeakTest(
@@ -6140,55 +6140,55 @@ public void testBug552521_comment14b() {
" return true;\n" +
" }\n" +
" void test1(String fileName) throws IOException {\n" +
- " while (check(new FileInputStream(fileName)))\n" +
- " System.out.println(\"while\");\n" +
+ " while (check(new FileInputStream(fileName)))\n" +
+ " System.out.println(\"while\");\n" +
" }\n" +
" void test2(String fileName) throws IOException {\n" +
" do {\n" +
- " System.out.println(\"while\");\n" +
- " } while (check(new FileInputStream(fileName)));\n" +
+ " System.out.println(\"while\");\n" +
+ " } while (check(new FileInputStream(fileName)));\n" +
" }\n" +
" void test3(String fileName) throws IOException {\n" +
- " for (int i=0;check(new FileInputStream(fileName));i++)\n" +
- " System.out.println(i);\n" +
+ " for (int i=0;check(new FileInputStream(fileName));i++)\n" +
+ " System.out.println(i);\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " while (check(new FileInputStream(fileName)))\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " } while (check(new FileInputStream(fileName)));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 17)\n" +
- " for (int i=0;check(new FileInputStream(fileName));i++)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " while (check(new FileInputStream(fileName)))\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " } while (check(new FileInputStream(fileName)));\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 17)\n" +
+ " for (int i=0;check(new FileInputStream(fileName));i++)\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
"----------\n",
options);
}
public void testBug519740() {
if (this.complianceLevel < ClassFileConstants.JDK1_7) return; // uses try-with-resources
- Map options = getCompilerOptions();
+ Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR);
options.put(CompilerOptions.OPTION_ReportPotentiallyUnclosedCloseable, CompilerOptions.ERROR);
runConformTest(
new String[] {
"Snippet.java",
- "class Snippet {\n" +
- " static void foo() throws Exception {\n" +
- " try (java.util.Scanner scanner = new java.util.Scanner(new java.io.FileInputStream(\"abc\"))) {\n" +
- " while (scanner.hasNext()) \n" +
- " if (scanner.hasNextInt())\n" +
- " throw new RuntimeException(); /* Potential resource leak: 'scanner' may not be closed at this location */\n" +
- " }\n" +
- " }\n" +
+ "class Snippet {\n" +
+ " static void foo() throws Exception {\n" +
+ " try (java.util.Scanner scanner = new java.util.Scanner(new java.io.FileInputStream(\"abc\"))) {\n" +
+ " while (scanner.hasNext()) \n" +
+ " if (scanner.hasNextInt())\n" +
+ " throw new RuntimeException(); /* Potential resource leak: 'scanner' may not be closed at this location */\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
options);
@@ -6196,122 +6196,122 @@ public void testBug519740() {
public void testBug552441() {
if (this.complianceLevel < ClassFileConstants.JDK1_7) return; // uses try-with-resources
- Map options = getCompilerOptions();
+ Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR);
options.put(CompilerOptions.OPTION_ReportPotentiallyUnclosedCloseable, CompilerOptions.ERROR);
runConformTest(
new String[] {
"Test.java",
- "import java.io.BufferedOutputStream;\n" +
- "import java.io.FileOutputStream;\n" +
- "import java.io.IOException;\n" +
- "import java.io.OutputStream;\n" +
- "import java.util.concurrent.atomic.AtomicLong;\n" +
- "\n" +
- "public class Test {\n" +
- " public static class CountingBufferedOutputStream extends BufferedOutputStream {\n" +
- " private final AtomicLong bytesWritten;\n" +
- "\n" +
- " public CountingBufferedOutputStream(OutputStream out, AtomicLong bytesWritten) throws IOException {\n" +
- " super(out);\n" +
- " this.bytesWritten = bytesWritten;\n" +
- " }\n" +
- "\n" +
- " @Override\n" +
- " public void write(byte[] b) throws IOException {\n" +
- " super.write(b);\n" +
- " bytesWritten.addAndGet(b.length);\n" +
- " }\n" +
- "\n" +
- " @Override\n" +
- " public void write(byte[] b, int off, int len) throws IOException {\n" +
- " super.write(b, off, len);\n" +
- " bytesWritten.addAndGet(len);\n" +
- " }\n" +
- "\n" +
- " @Override\n" +
- " public synchronized void write(int b) throws IOException {\n" +
- " super.write(b);\n" +
- " bytesWritten.incrementAndGet();\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static void test(String[] args) throws IOException {\n" +
- " AtomicLong uncompressedBytesOut = new AtomicLong();\n" +
- " int val = 0;\n" +
- " try (CountingBufferedOutputStream out = new CountingBufferedOutputStream(\n" +
- " new FileOutputStream(\"outputfile\"), uncompressedBytesOut)) {\n" +
- "\n" +
- " for (int i = 0; i < 1; i++) {\n" +
- " if (val > 2) {\n" +
- " throw new RuntimeException(\"X\");\n" +
- " }\n" +
- " }\n" +
- " if (val > 2) {\n" +
- " throw new RuntimeException(\"Y\");\n" +
- " }\n" +
- " throw new RuntimeException(\"Z\");\n" +
- " }\n" +
- " }\n" +
+ "import java.io.BufferedOutputStream;\n" +
+ "import java.io.FileOutputStream;\n" +
+ "import java.io.IOException;\n" +
+ "import java.io.OutputStream;\n" +
+ "import java.util.concurrent.atomic.AtomicLong;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " public static class CountingBufferedOutputStream extends BufferedOutputStream {\n" +
+ " private final AtomicLong bytesWritten;\n" +
+ "\n" +
+ " public CountingBufferedOutputStream(OutputStream out, AtomicLong bytesWritten) throws IOException {\n" +
+ " super(out);\n" +
+ " this.bytesWritten = bytesWritten;\n" +
+ " }\n" +
+ "\n" +
+ " @Override\n" +
+ " public void write(byte[] b) throws IOException {\n" +
+ " super.write(b);\n" +
+ " bytesWritten.addAndGet(b.length);\n" +
+ " }\n" +
+ "\n" +
+ " @Override\n" +
+ " public void write(byte[] b, int off, int len) throws IOException {\n" +
+ " super.write(b, off, len);\n" +
+ " bytesWritten.addAndGet(len);\n" +
+ " }\n" +
+ "\n" +
+ " @Override\n" +
+ " public synchronized void write(int b) throws IOException {\n" +
+ " super.write(b);\n" +
+ " bytesWritten.incrementAndGet();\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public static void test(String[] args) throws IOException {\n" +
+ " AtomicLong uncompressedBytesOut = new AtomicLong();\n" +
+ " int val = 0;\n" +
+ " try (CountingBufferedOutputStream out = new CountingBufferedOutputStream(\n" +
+ " new FileOutputStream(\"outputfile\"), uncompressedBytesOut)) {\n" +
+ "\n" +
+ " for (int i = 0; i < 1; i++) {\n" +
+ " if (val > 2) {\n" +
+ " throw new RuntimeException(\"X\");\n" +
+ " }\n" +
+ " }\n" +
+ " if (val > 2) {\n" +
+ " throw new RuntimeException(\"Y\");\n" +
+ " }\n" +
+ " throw new RuntimeException(\"Z\");\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
options);
}
public void testBug400523() {
- Map options = getCompilerOptions();
+ Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR);
options.put(CompilerOptions.OPTION_ReportPotentiallyUnclosedCloseable, CompilerOptions.ERROR);
runConformTest(
new String[] {
"LeakWarning.java",
- "import java.sql.Connection;\n" +
- "import java.sql.PreparedStatement;\n" +
- "import java.sql.ResultSet;\n" +
- "import java.sql.SQLException;\n" +
- "\n" +
- "public class LeakWarning {\n" +
- " String value = null;\n" +
- " \n" +
- " public void setValue(Connection conn)\n" +
- " { \n" +
- " PreparedStatement stmt = null;\n" +
- " ResultSet rs = null;\n" +
- " try { \n" +
- " stmt = conn.prepareStatement(\"SELECT 'value'\"); /* marked as potential resource leak */\n" +
- " rs = stmt.executeQuery(); /* marked as potential resource leak */\n" +
- " if (rs.next()) value = rs.getString(1);\n" +
- " } catch(SQLException e) {\n" +
- " }\n" +
- " finally {\n" +
- " if (null != rs) try { rs.close(); } catch (SQLException e) {} finally { rs = null; }\n" +
- " if (null != stmt) try { stmt.close(); } catch (SQLException e) {} finally { stmt = null; }\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " public void setValueReturn(Connection conn)\n" +
- " { \n" +
- " PreparedStatement stmt = null;\n" +
- " ResultSet rs = null;\n" +
- " try { \n" +
- " stmt = conn.prepareStatement(\"SELECT 'value'\");\n" +
- " rs = stmt.executeQuery();\n" +
- " if (rs.next()) value = rs.getString(1);\n" +
- " } catch(SQLException e) {\n" +
- " }\n" +
- " finally {\n" +
- " if (null != rs) try { rs.close(); } catch (SQLException e) {} finally { rs = null; }\n" +
- " if (null != stmt) try { stmt.close(); } catch (SQLException e) {} finally { stmt = null; }\n" +
- " }\n" +
- " return; /* no warning now */\n" +
- " }\n" +
+ "import java.sql.Connection;\n" +
+ "import java.sql.PreparedStatement;\n" +
+ "import java.sql.ResultSet;\n" +
+ "import java.sql.SQLException;\n" +
+ "\n" +
+ "public class LeakWarning {\n" +
+ " String value = null;\n" +
+ " \n" +
+ " public void setValue(Connection conn)\n" +
+ " { \n" +
+ " PreparedStatement stmt = null;\n" +
+ " ResultSet rs = null;\n" +
+ " try { \n" +
+ " stmt = conn.prepareStatement(\"SELECT 'value'\"); /* marked as potential resource leak */\n" +
+ " rs = stmt.executeQuery(); /* marked as potential resource leak */\n" +
+ " if (rs.next()) value = rs.getString(1);\n" +
+ " } catch(SQLException e) {\n" +
+ " }\n" +
+ " finally {\n" +
+ " if (null != rs) try { rs.close(); } catch (SQLException e) {} finally { rs = null; }\n" +
+ " if (null != stmt) try { stmt.close(); } catch (SQLException e) {} finally { stmt = null; }\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " public void setValueReturn(Connection conn)\n" +
+ " { \n" +
+ " PreparedStatement stmt = null;\n" +
+ " ResultSet rs = null;\n" +
+ " try { \n" +
+ " stmt = conn.prepareStatement(\"SELECT 'value'\");\n" +
+ " rs = stmt.executeQuery();\n" +
+ " if (rs.next()) value = rs.getString(1);\n" +
+ " } catch(SQLException e) {\n" +
+ " }\n" +
+ " finally {\n" +
+ " if (null != rs) try { rs.close(); } catch (SQLException e) {} finally { rs = null; }\n" +
+ " if (null != stmt) try { stmt.close(); } catch (SQLException e) {} finally { stmt = null; }\n" +
+ " }\n" +
+ " return; /* no warning now */\n" +
+ " }\n" +
"}\n"
},
options);
}
public void testBug527761() {
- Map options = getCompilerOptions();
+ Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR);
options.put(CompilerOptions.OPTION_ReportPotentiallyUnclosedCloseable, CompilerOptions.ERROR);
runConformTest(
@@ -6319,10 +6319,10 @@ public void testBug527761() {
"X.java",
"class BAOSWrapper extends java.io.ByteArrayOutputStream {}\n" +
"public class X {\n" +
- " public static void warningCauser() {\n" +
- " BAOSWrapper baos = new BAOSWrapper();\n" +
- " //WARNING HAS BEEN CAUSED\n" +
- " baos.write(0);\n" +
+ " public static void warningCauser() {\n" +
+ " BAOSWrapper baos = new BAOSWrapper();\n" +
+ " //WARNING HAS BEEN CAUSED\n" +
+ " baos.write(0);\n" +
" }\n" +
"}\n"
},
@@ -6330,15 +6330,15 @@ public void testBug527761() {
}
public void testBug527761_otherClose() {
if (this.complianceLevel < ClassFileConstants.JDK1_5) return; // uses generics
- Map options = getCompilerOptions();
+ Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR);
options.put(CompilerOptions.OPTION_ReportPotentiallyUnclosedCloseable, CompilerOptions.ERROR);
String xSource =
"public class X {\n" +
- " public static void warningCauser() {\n" +
- " BAOSWrapper<String> baos = new BAOSWrapper<String>();\n" +
- " //WARNING HAS BEEN CAUSED\n" +
- " baos.write(0);\n" +
+ " public static void warningCauser() {\n" +
+ " BAOSWrapper<String> baos = new BAOSWrapper<String>();\n" +
+ " //WARNING HAS BEEN CAUSED\n" +
+ " baos.write(0);\n" +
" }\n" +
"}\n";
runConformTest(
@@ -6357,7 +6357,7 @@ public void testBug527761_otherClose() {
"", "", "", null);
}
public void testBug527761_neg() {
- Map options = getCompilerOptions();
+ Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR);
options.put(CompilerOptions.OPTION_ReportPotentiallyUnclosedCloseable, CompilerOptions.ERROR);
runLeakTest(
@@ -6367,25 +6367,25 @@ public void testBug527761_neg() {
" public void close() {}\n" + // indicates that resource could be relevant
"}\n" +
"public class X {\n" +
- " public static void warningCauser() {\n" +
- " BAOSWrapper baos = new BAOSWrapper();\n" +
- " //WARNING HAS BEEN CAUSED\n" +
- " baos.write(0);\n" +
+ " public static void warningCauser() {\n" +
+ " BAOSWrapper baos = new BAOSWrapper();\n" +
+ " //WARNING HAS BEEN CAUSED\n" +
+ " baos.write(0);\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " BAOSWrapper baos = new BAOSWrapper();\n" +
- " ^^^^\n" +
- "Resource leak: \'baos\' is never closed\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " BAOSWrapper baos = new BAOSWrapper();\n" +
+ " ^^^^\n" +
+ "Resource leak: \'baos\' is never closed\n" +
"----------\n",
options);
}
// regression caused by Bug 527761
public void testBug558759() {
if (this.complianceLevel < ClassFileConstants.JDK1_5) return; // uses generics
- Map options = getCompilerOptions();
+ Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR);
options.put(CompilerOptions.OPTION_ReportPotentiallyUnclosedCloseable, CompilerOptions.ERROR);
String ySource =
@@ -6418,7 +6418,7 @@ public void testBug558759() {
}
public void testBug559119() {
if (this.complianceLevel < ClassFileConstants.JDK1_5) return; // uses @Override
- Map options = getCompilerOptions();
+ Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR);
options.put(CompilerOptions.OPTION_ReportPotentiallyUnclosedCloseable, CompilerOptions.WARNING);
runLeakWarningTest(
@@ -6429,34 +6429,34 @@ public void testBug559119() {
"}\n",
"SequencerControl.java",
"public abstract class SequencerControl {\n" +
- " public abstract Sequencer getSequencer();\n" +
- " @Override\n" +
- " public boolean equals(Object obj) {\n" +
- " if (obj != null) {\n" +
- " if (getClass().equals(obj.getClass())) {\n" +
- " return ((SequencerControl)obj).getSequencer().equals(getSequencer());\n" +
- " }\n" +
- " }\n" +
- " return false;\n" +
- " }\n" +
+ " public abstract Sequencer getSequencer();\n" +
+ " @Override\n" +
+ " public boolean equals(Object obj) {\n" +
+ " if (obj != null) {\n" +
+ " if (getClass().equals(obj.getClass())) {\n" +
+ " return ((SequencerControl)obj).getSequencer().equals(getSequencer());\n" +
+ " }\n" +
+ " }\n" +
+ " return false;\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in SequencerControl.java (at line 7)\n" +
- " return ((SequencerControl)obj).getSequencer().equals(getSequencer());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
- "----------\n" +
- "2. WARNING in SequencerControl.java (at line 7)\n" +
- " return ((SequencerControl)obj).getSequencer().equals(getSequencer());\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
+ "----------\n" +
+ "1. WARNING in SequencerControl.java (at line 7)\n" +
+ " return ((SequencerControl)obj).getSequencer().equals(getSequencer());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
+ "----------\n" +
+ "2. WARNING in SequencerControl.java (at line 7)\n" +
+ " return ((SequencerControl)obj).getSequencer().equals(getSequencer());\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Potential resource leak: \'<unassigned Closeable value>\' may not be closed\n" +
"----------\n",
options);
}
public void testBug560610() {
if (this.complianceLevel < ClassFileConstants.JDK1_5) return; // uses enum
- Map options = getCompilerOptions();
+ Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR);
options.put(CompilerOptions.OPTION_ReportPotentiallyUnclosedCloseable, CompilerOptions.WARNING);
runConformTest(
@@ -6474,7 +6474,7 @@ public void testBug560610() {
"public abstract class D extends A<String> {}\n", // extends A causes searching A for a close method, A seen as a PTB
"EN.java",
"public enum EN {\n" + // when we find this via ahead-of-time resolveTypesFor("m()") we don't yet have a superclass
- " One, Two;\n" +
+ " One, Two;\n" +
"}\n"
},
"",
@@ -6482,7 +6482,7 @@ public void testBug560610() {
}
public void testBug560671() {
if (this.complianceLevel < ClassFileConstants.JDK1_7) return; // uses t-w-r
- Map options = getCompilerOptions();
+ Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR);
options.put(CompilerOptions.OPTION_ReportPotentiallyUnclosedCloseable, CompilerOptions.WARNING);
runConformTest(
@@ -6490,17 +6490,17 @@ public void testBug560671() {
"X.java",
"import java.util.Scanner;\n" +
"public class X {\n" +
- " void m(String source) {\n" +
- " try (Scanner s = new Scanner(source).useDelimiter(\"foobar\")) {\n" +
- " System.out.println(s.next());\n" +
- " }\n" +
+ " void m(String source) {\n" +
+ " try (Scanner s = new Scanner(source).useDelimiter(\"foobar\")) {\n" +
+ " System.out.println(s.next());\n" +
+ " }\n" +
" }\n" +
"}\n"
},
options);
}
public void testBug560671b() {
- Map options = getCompilerOptions();
+ Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR);
options.put(CompilerOptions.OPTION_ReportPotentiallyUnclosedCloseable, CompilerOptions.WARNING);
runConformTest(
@@ -6509,20 +6509,20 @@ public void testBug560671b() {
"import java.util.Scanner;\n" +
"public class X {\n" +
" void m(String source) throws java.io.IOException {\n" +
- " Scanner s = null;" +
+ " Scanner s = null;" +
" try {\n" +
- " s = new Scanner(source).useDelimiter(\"foobar\");\n" +
- " System.out.println(s.next());\n" +
+ " s = new Scanner(source).useDelimiter(\"foobar\");\n" +
+ " System.out.println(s.next());\n" +
" } finally {\n" +
" if (s != null) s.close();\n" +
- " }\n" +
+ " }\n" +
" }\n" +
"}\n"
},
options);
}
public void testBug561259() {
- Map options = getCompilerOptions();
+ Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR);
options.put(CompilerOptions.OPTION_ReportPotentiallyUnclosedCloseable, CompilerOptions.WARNING);
runConformTest(
@@ -6530,19 +6530,19 @@ public void testBug561259() {
"X.java",
"import java.io.*;\n" +
"public class X {\n" +
- " protected String m(String charset) throws IOException\n" +
- " {\n" +
- " InputStream contents = new FileInputStream(\"/tmp/f\");\n" +
- " BufferedReader reader = new BufferedReader(new InputStreamReader(contents, charset));\n" +
- " CharArrayWriter writer = new CharArrayWriter();\n" +
- " int c;\n" +
- " while ((c = reader.read()) != -1)\n" +
- " {\n" +
- " writer.write(c);\n" +
- " }\n" +
- " contents.close();\n" +
- " return writer.toString();\n" +
- " }\n" +
+ " protected String m(String charset) throws IOException\n" +
+ " {\n" +
+ " InputStream contents = new FileInputStream(\"/tmp/f\");\n" +
+ " BufferedReader reader = new BufferedReader(new InputStreamReader(contents, charset));\n" +
+ " CharArrayWriter writer = new CharArrayWriter();\n" +
+ " int c;\n" +
+ " while ((c = reader.read()) != -1)\n" +
+ " {\n" +
+ " writer.write(c);\n" +
+ " }\n" +
+ " contents.close();\n" +
+ " return writer.toString();\n" +
+ " }\n" +
"}\n"
},
options);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ScannerTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ScannerTest.java
index e8c64ccb6..83e83b84f 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ScannerTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ScannerTest.java
@@ -1147,11 +1147,11 @@ public class ScannerTest extends AbstractRegressionTest {
public void test054() {
IScanner scanner = ToolFactory.createScanner(false, false, false, JavaCore.VERSION_1_6, JavaCore.VERSION_1_6);
char[] source =
- ("class X {\n" +
- " public static void main(String[] args) {\n" +
- " String \ud804\udc09 = \"Brahmi\";\n" +
- " System.out.println(\ud804\udc09);\n" +
- " }\n" +
+ ("class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " String \ud804\udc09 = \"Brahmi\";\n" +
+ " System.out.println(\ud804\udc09);\n" +
+ " }\n" +
"}").toCharArray();
scanner.setSource(source);
scanner.resetTo(0, source.length - 1);
@@ -1172,11 +1172,11 @@ public class ScannerTest extends AbstractRegressionTest {
public void test055() {
IScanner scanner = ToolFactory.createScanner(false, false, false, JavaCore.VERSION_1_7, JavaCore.VERSION_1_7);
char[] source =
- ("class X {\n" +
- " public static void main(String[] args) {\n" +
- " String \ud804\udc09 = \"Brahmi\";\n" +
- " System.out.println(\ud804\udc09);\n" +
- " }\n" +
+ ("class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " String \ud804\udc09 = \"Brahmi\";\n" +
+ " System.out.println(\ud804\udc09);\n" +
+ " }\n" +
"}").toCharArray();
scanner.setSource(source);
scanner.resetTo(0, source.length - 1);
@@ -1195,11 +1195,11 @@ public class ScannerTest extends AbstractRegressionTest {
public void test056() {
IScanner scanner = ToolFactory.createScanner(false, false, false, JavaCore.VERSION_1_6, JavaCore.VERSION_1_6);
char[] source =
- ("class X {\n" +
- " public static void main(String[] args) {\n" +
- " String \u20B9 = \"Rupee symbol\";\n" +
- " System.out.println(\u20B9);\n" +
- " }\n" +
+ ("class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " String \u20B9 = \"Rupee symbol\";\n" +
+ " System.out.println(\u20B9);\n" +
+ " }\n" +
"}").toCharArray();
scanner.setSource(source);
scanner.resetTo(0, source.length - 1);
@@ -1220,11 +1220,11 @@ public class ScannerTest extends AbstractRegressionTest {
public void test057() {
IScanner scanner = ToolFactory.createScanner(false, false, false, JavaCore.VERSION_1_7, JavaCore.VERSION_1_7);
char[] source =
- ("class X {\n" +
- " public static void main(String[] args) {\n" +
- " String \u20B9 = \"Rupee symbol\";\n" +
- " System.out.println(\u20B9);\n" +
- " }\n" +
+ ("class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " String \u20B9 = \"Rupee symbol\";\n" +
+ " System.out.println(\u20B9);\n" +
+ " }\n" +
"}").toCharArray();
scanner.setSource(source);
scanner.resetTo(0, source.length - 1);
@@ -1240,10 +1240,10 @@ public class ScannerTest extends AbstractRegressionTest {
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=352014
public void test058() {
String source =
- "public class X {\n" +
- " void foo() {\n" +
- " int a\\u1369b;\n" +
- " }\n" +
+ "public class X {\n" +
+ " void foo() {\n" +
+ " int a\\u1369b;\n" +
+ " }\n" +
"}";
if (this.complianceLevel <= ClassFileConstants.JDK1_6) {
this.runConformTest(
@@ -1258,21 +1258,21 @@ public class ScannerTest extends AbstractRegressionTest {
"X.java",
source
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " int a\\u1369b;\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"Invalid Character\", = expected\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " int a\\u1369b;\n" +
+ " ^^^^^^\n" +
+ "Syntax error on token \"Invalid Character\", = expected\n" +
"----------\n");
}
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=352553
public void test059() {
String source =
- "public class X {\n" +
- " void foo() {\n" +
- " int a\\u200B;\n" +
- " }\n" +
+ "public class X {\n" +
+ " void foo() {\n" +
+ " int a\\u200B;\n" +
+ " }\n" +
"}";
if (this.complianceLevel > ClassFileConstants.JDK1_6) {
this.runConformTest(
@@ -1287,11 +1287,11 @@ public class ScannerTest extends AbstractRegressionTest {
"X.java",
source
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " int a\\u200B;\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " int a\\u200B;\n" +
+ " ^^^^^^\n" +
+ "Syntax error on token \"Invalid Character\", delete this token\n" +
"----------\n");
}
}
@@ -1300,15 +1300,15 @@ public class ScannerTest extends AbstractRegressionTest {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static final String ERROR = \"\\u000Ⅻ\";\n" +
+ "public class X {\n" +
+ " public static final String ERROR = \"\\u000Ⅻ\";\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public static final String ERROR = \"\\u000Ⅻ\";\n" +
- " ^^^^^^\n" +
- "Invalid unicode\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public static final String ERROR = \"\\u000Ⅻ\";\n" +
+ " ^^^^^^\n" +
+ "Invalid unicode\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=387146
@@ -1378,12 +1378,12 @@ public class ScannerTest extends AbstractRegressionTest {
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=443854
public void test064() {
String source =
- "public enum X {\n" +
- " Hello\\u205fworld;\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(Hello\\u205fworld);\n" +
- " System.out.println(Character.isJavaIdentifierPart('\\u205f')); // false\n" +
- " }\n" +
+ "public enum X {\n" +
+ " Hello\\u205fworld;\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(Hello\\u205fworld);\n" +
+ " System.out.println(Character.isJavaIdentifierPart('\\u205f')); // false\n" +
+ " }\n" +
"}";
if (this.complianceLevel > ClassFileConstants.JDK1_5) {
this.runNegativeTest(
@@ -1391,24 +1391,24 @@ public class ScannerTest extends AbstractRegressionTest {
"X.java",
source
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Hello\\u205fworld;\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"Invalid Character\", , expected\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " System.out.println(Hello\\u205fworld);\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"Invalid Character\", invalid AssignmentOperator\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " Hello\\u205fworld;\n" +
+ " ^^^^^^\n" +
+ "Syntax error on token \"Invalid Character\", , expected\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " System.out.println(Hello\\u205fworld);\n" +
+ " ^^^^^^\n" +
+ "Syntax error on token \"Invalid Character\", invalid AssignmentOperator\n" +
"----------\n");
}
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=458795
public void test065() {
String source =
- "public class X {\n" +
- " double d = 0XP00;\n" +
+ "public class X {\n" +
+ " double d = 0XP00;\n" +
"}";
if (this.complianceLevel > ClassFileConstants.JDK1_4) {
this.runNegativeTest(
@@ -1416,18 +1416,18 @@ public class ScannerTest extends AbstractRegressionTest {
"X.java",
source
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " double d = 0XP00;\n" +
- " ^^^\n" +
- "Invalid hex literal number\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " double d = 0XP00;\n" +
+ " ^^^\n" +
+ "Invalid hex literal number\n" +
"----------\n");
}
}
public void test066() {
String source =
- "public class X {\n" +
- " double d = 0X.p02d;\n" +
+ "public class X {\n" +
+ " double d = 0X.p02d;\n" +
"}";
if (this.complianceLevel > ClassFileConstants.JDK1_4) {
this.runNegativeTest(
@@ -1435,18 +1435,18 @@ public class ScannerTest extends AbstractRegressionTest {
"X.java",
source
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " double d = 0X.p02d;\n" +
- " ^^^\n" +
- "Invalid hex literal number\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " double d = 0X.p02d;\n" +
+ " ^^^\n" +
+ "Invalid hex literal number\n" +
"----------\n");
}
}
public void test067() {
String source =
- "public class X {\n" +
- " float f = 0Xp02f;\n" +
+ "public class X {\n" +
+ " float f = 0Xp02f;\n" +
"}";
if (this.complianceLevel > ClassFileConstants.JDK1_4) {
this.runNegativeTest(
@@ -1454,18 +1454,18 @@ public class ScannerTest extends AbstractRegressionTest {
"X.java",
source
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " float f = 0Xp02f;\n" +
- " ^^^\n" +
- "Invalid hex literal number\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " float f = 0Xp02f;\n" +
+ " ^^^\n" +
+ "Invalid hex literal number\n" +
"----------\n");
}
}
public void test068() {
String source =
- "public class X {\n" +
- " float f = 0X0p02f;\n" +
+ "public class X {\n" +
+ " float f = 0X0p02f;\n" +
"}";
if (this.complianceLevel > ClassFileConstants.JDK1_4) {
this.runConformTest(
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SerialVersionUIDTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SerialVersionUIDTests.java
index a9b708a5c..87d5f615c 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SerialVersionUIDTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SerialVersionUIDTests.java
@@ -224,11 +224,11 @@ public void test011() {
" private static final long serialVersionUID = 1L;\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " private static final long serialVersionUID = 1L;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The value of the field X.serialVersionUID is not used\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " private static final long serialVersionUID = 1L;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The value of the field X.serialVersionUID is not used\n" +
"----------\n",
null,
true,
@@ -247,11 +247,11 @@ public void test012() {
" private static final long serialVersionUID = 1L;\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " private static final long serialVersionUID = 1L;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The value of the field X<T>.serialVersionUID is not used\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " private static final long serialVersionUID = 1L;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The value of the field X<T>.serialVersionUID is not used\n" +
"----------\n",
null,
true,
@@ -270,11 +270,11 @@ public void test013() {
" private static final long serialPersistentFields = 1L;\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " private static final long serialPersistentFields = 1L;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The value of the field X<T>.serialPersistentFields is not used\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " private static final long serialPersistentFields = 1L;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The value of the field X<T>.serialPersistentFields is not used\n" +
"----------\n",
null,
true,
@@ -292,11 +292,11 @@ public void test014() {
" private static final long serialPersistentFields = 1L;\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " private static final long serialPersistentFields = 1L;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The value of the field X.serialPersistentFields is not used\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " private static final long serialPersistentFields = 1L;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The value of the field X.serialPersistentFields is not used\n" +
"----------\n",
null,
true,
@@ -318,11 +318,11 @@ public void test015() {
" private int i;\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " private int i;\n" +
- " ^\n" +
- "The value of the field X<T>.i is not used\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " private int i;\n" +
+ " ^\n" +
+ "The value of the field X<T>.i is not used\n" +
"----------\n",
null,
true,
@@ -343,11 +343,11 @@ public void test016() {
" private int i;\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " private int i;\n" +
- " ^\n" +
- "The value of the field X.i is not used\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " private int i;\n" +
+ " ^\n" +
+ "The value of the field X.i is not used\n" +
"----------\n",
null,
true,
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SerializableLambdaTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SerializableLambdaTest.java
index c93c05e9d..b07b2086f 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SerializableLambdaTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SerializableLambdaTest.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
* Bug 405104 - [1.8][compiler][codegen] Implement support for serializeable lambdas
@@ -48,7 +48,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
// TESTS_NUMBERS = new int [] { 40 };
// TESTS_NAMES = new String[] { "testTypeVariable" };
}
-
+
public static Class testClass() {
return SerializableLambdaTest.class;
}
@@ -67,14 +67,14 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_8);
return defaultOptions;
}
-
- public static final String RUNNER_CLASS =
+
+ public static final String RUNNER_CLASS =
"public class Y {\n"+
" public static void main(String[]args) {\n"+
" com.foo.X.main(args);\n"+
" }\n"+
"}";
-
+
private static final String HELPER_CLASS =
"package util;\n"+
"import java.io.*;\n"+
@@ -108,7 +108,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
" }\n"+
" return null;\n"+
"}\n"+
- "}\n";
+ "}\n";
/**
* Verifies that after deserializing it is usable, also that the bootstrap methods attribute indicates use of altMetafactory
@@ -145,7 +145,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
String data = printBootstrapMethodsAttribute(OUTPUT_DIR + File.separator + "X.class");
checkExpected(expectedOutput,data);
}
-
+
/**
* Sanity test, non serializable should have bootstrap methods attribute reference to metafactory.
*/
@@ -221,7 +221,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
String data = printBootstrapMethodsAttribute(OUTPUT_DIR + File.separator + "X.class");
checkExpected(expectedOutput,data);
}
-
+
public void test004_lambdaWithParameterInPackage() throws Exception {
this.runConformTest(
new String[]{
@@ -261,7 +261,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
String data = printBootstrapMethodsAttribute(OUTPUT_DIR + File.separator + "com"+File.separator+"foo"+File.separator+"X.class");
checkExpected(expectedOutput,data);
}
-
+
public void test005_capturingVariableLambdaWithParameterInPackage() throws Exception {
this.runConformTest(
new String[]{
@@ -344,7 +344,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
String data = printBootstrapMethodsAttribute(OUTPUT_DIR + File.separator + "com"+File.separator+"foo"+File.separator+"X.class");
checkExpected(expectedOutput,data);
}
-
+
// Fails the same way as javac right now... with NPE (b120)
public void xtest007_capturingFieldLambdaWithParameterInPackage() throws Exception {
this.runConformTest(
@@ -389,7 +389,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
String data = printBootstrapMethodsAttribute(OUTPUT_DIR + File.separator + "com"+File.separator+"foo"+File.separator+"X.class");
checkExpected(expectedOutput,data);
}
-
+
public void test008_capturingTwoVariableLambdaWithParameterInPackage() throws Exception {
this.runConformTest(
new String[]{
@@ -432,7 +432,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
String data = printBootstrapMethodsAttribute(OUTPUT_DIR + File.separator + "com"+File.separator+"foo"+File.separator+"X.class");
checkExpected(expectedOutput,data);
}
-
+
public void test009_capturingTwoSlotVariablesLambdaWithParameterInPackage() throws Exception {
this.runConformTest(
new String[]{
@@ -470,7 +470,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
String data = printBootstrapMethodsAttribute(OUTPUT_DIR + File.separator + "com"+File.separator+"foo"+File.separator+"X.class");
checkExpected(expectedOutput,data);
}
-
+
public void test010_VarargsLambdaExpression() throws Exception {
this.runConformTest(
new String[]{
@@ -508,7 +508,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
String data = printBootstrapMethodsAttribute(OUTPUT_DIR + File.separator + "com"+File.separator+"foo"+File.separator+"X.class");
checkExpected(expectedOutput,data);
}
-
+
// Fails same way as javac right now... with an NPE (b120)
public void xtest011_CapturingInstance() throws Exception {
this.runConformTest(
@@ -630,7 +630,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
String data = printBootstrapMethodsAttribute(OUTPUT_DIR + File.separator + "X.class");
checkExpected(expectedOutput,data);
}
-
+
public void test014_intersectionCastAndNotSerializable() throws Exception {
this.runConformTest(
new String[]{
@@ -669,7 +669,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
String data = printBootstrapMethodsAttribute(OUTPUT_DIR + File.separator + "X.class");
checkExpected(expectedOutput,data);
}
-
+
public void test015_serializableViaIntersectionCast() throws Exception {
this.runConformTest(
new String[]{
@@ -713,7 +713,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
String data = printBootstrapMethodsAttribute(OUTPUT_DIR + File.separator + "X.class");
checkExpected(expectedOutput,data);
}
-
+
// SAM type not first in intersection cast
public void test016_bug424211() throws Exception {
this.runConformTest(
@@ -741,7 +741,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
String data = printBootstrapMethodsAttribute(OUTPUT_DIR + File.separator + "X.class");
checkExpected(expectedOutput,data);
}
-
+
// Now SAM type first
public void test017_bug424211() throws Exception {
this.runConformTest(
@@ -769,7 +769,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
String data = printBootstrapMethodsAttribute(OUTPUT_DIR + File.separator + "X.class");
checkExpected(expectedOutput,data);
}
-
+
// Not Serializable but a regular marker interface
public void test018_bug424211() throws Exception {
this.runConformTest(
@@ -800,7 +800,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
String data = printBootstrapMethodsAttribute(OUTPUT_DIR + File.separator + "X.class");
checkExpected(expectedOutput,data);
}
-
+
// Now SAM type not first and serialization occurring
public void test019_bug424211() throws Exception {
this.runConformTest(
@@ -833,7 +833,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
String data = printBootstrapMethodsAttribute(OUTPUT_DIR + File.separator + "X.class");
checkExpected(expectedOutput,data);
}
-
+
public void test020_lambdaNames() throws Exception {
this.runConformTest(
new String[]{
@@ -862,7 +862,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
" private static synthetic int lambda$1();\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test021_lambdaNamesVariants() throws Exception {
this.runConformTest(
new String[]{
@@ -919,7 +919,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
assertEquals(expectedOutput,actualOutput);
}
}
-
+
public void test022_nestedLambdas() throws Exception {
this.runConformTest(
new String[]{
@@ -957,7 +957,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
String data = printBootstrapMethodsAttribute(OUTPUT_DIR + File.separator + "X.class");
checkExpected(expectedOutput,data);
}
-
+
public void test023_lambdasInOtherPlaces_Field() throws Exception {
this.runConformTest(
new String[]{
@@ -992,7 +992,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
String data = printBootstrapMethodsAttribute(OUTPUT_DIR + File.separator + "X.class");
checkExpected(expectedOutput,data);
}
-
+
public void test024_lambdasInOtherPlaces_MethodParameter() throws Exception {
this.runConformTest(
new String[]{
@@ -1026,7 +1026,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
String data = printBootstrapMethodsAttribute(OUTPUT_DIR + File.separator + "X.class");
checkExpected(expectedOutput,data);
}
-
+
public void test025_lambdasWithGenericInferencing() throws Exception {
this.runConformTest(
new String[]{
@@ -1104,7 +1104,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
String data = printBootstrapMethodsAttribute(OUTPUT_DIR + File.separator + "X.class");
checkExpected(expectedOutput,data);
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=449467 - [1.8][compiler] Invalid lambda deserialization with anonymous class
public void test449467() throws Exception {
this.runConformTest(
@@ -1162,9 +1162,9 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
"HEY!",
null,
true,
- new String [] { "-Ddummy" }); // Not sure, unless we force the VM to not be reused by passing dummy vm argument, the generated program aborts midway through its execution.
+ new String [] { "-Ddummy" }); // Not sure, unless we force the VM to not be reused by passing dummy vm argument, the generated program aborts midway through its execution.
}
-
+
public void test449467_2() throws Exception {
this.runConformTest(
new String[]{
@@ -1221,9 +1221,9 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
"HEY!",
null,
true,
- new String [] { "-Ddummy" }); // Not sure, unless we force the VM to not be reused by passing dummy vm argument, the generated program aborts midway through its execution.
+ new String [] { "-Ddummy" }); // Not sure, unless we force the VM to not be reused by passing dummy vm argument, the generated program aborts midway through its execution.
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428552, [1.8][compiler][codegen] Serialization does not work for method references
public void test428552() throws Exception {
this.runConformTest(
@@ -1251,7 +1251,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
true,
new String [] { "-Ddummy" }); // Not sure, unless we force the VM to not be reused by passing dummy vm argument, the generated program aborts midway through its execution.
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428642
public void test428642() throws Exception {
this.runConformTest(
@@ -1288,7 +1288,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
null,true,
new String[]{"-Ddummy"}); // Not sure, unless we force the VM to not be reused by passing dummy vm argument, the generated program aborts midway through its execution.
}
-
+
public void test428642_2() throws Exception {
this.runConformTest(
new String[]{
@@ -1332,7 +1332,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
null,true,
new String[]{"-Ddummy"}); // Not sure, unless we force the VM to not be reused by passing dummy vm argument, the generated program aborts midway through its execution.
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=429112, [1.8][compiler] Exception when compiling Serializable array constructor reference
public void test429112() throws Exception {
this.runConformTest(
@@ -1361,12 +1361,12 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
" }\n"+
"}\n",
},
- "class [Ljava.lang.String;\n" +
+ "class [Ljava.lang.String;\n" +
"1234",
null,true,
new String[]{"-Ddummy"}); // Not sure, unless we force the VM to not be reused by passing dummy vm argument, the generated program aborts midway through its execution.
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=439889 - [1.8][compiler] [lambda] Deserializing lambda fails with IllegalArgumentException: "Invalid lambda deserialization"
public void test439889() throws Exception {
this.runConformTest(
@@ -1406,7 +1406,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
null,true,
new String[]{"-Ddummy"}); // Not sure, unless we force the VM to not be reused by passing dummy vm argument, the generated program aborts midway through its execution.
}
-
+
public void test439889_2() throws Exception {
this.runConformTest(
new String[]{
@@ -1445,7 +1445,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
null,true,
new String[]{"-Ddummy"}); // Not sure, unless we force the VM to not be reused by passing dummy vm argument, the generated program aborts midway through its execution.
}
-
+
public void testNestedLambdas_442416() throws Exception {
this.runConformTest(
new String[]{
@@ -1494,7 +1494,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
null,true,
new String[]{"-Ddummy"}); // Not sure, unless we force the VM to not be reused by passing dummy vm argument, the generated program aborts midway through its execution.
}
-
+
public void testBindingThis_442418() throws Exception {
this.runConformTest(
new String[]{
@@ -1541,50 +1541,50 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
this.runConformTest(
new String[]{
"Testbed.java",
- "import java.io.ObjectStreamClass;\n" +
- "import java.io.Serializable;\n" +
- "import java.lang.invoke.SerializedLambda;\n" +
- "import java.lang.reflect.Method;\n" +
- "import java.util.function.IntFunction;\n" +
- "import java.util.stream.Stream;\n" +
- "public class Testbed {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(getMethod(Testbed::foo).equals(getMethod(Testbed::foo)));\n" +
- " }\n" +
- " private static void foo() { }\n" +
- " static interface MethodRef extends Runnable, Serializable { }\n" +
- " private static Method getMethod(MethodRef methodRef) {\n" +
- " try {\n" +
- " final Method invokeWriteReplaceMethod = ObjectStreamClass.class.getDeclaredMethod(\"invokeWriteReplace\", Object.class);\n" +
- " invokeWriteReplaceMethod.setAccessible(true);\n" +
- " final SerializedLambda l = (SerializedLambda)invokeWriteReplaceMethod.invoke(\n" +
- " ObjectStreamClass.lookupAny(methodRef.getClass()),\n" +
- " methodRef\n" +
- " );\n" +
- " System.out.println(\"Looking for \" + l.getImplClass() + \".\" + l.getImplMethodName());\n" +
- " final Method[] methods = Stream.of(Class.forName(l.getImplClass()).getDeclaredMethods()).\n" +
- " filter(m -> m.getName().equals(l.getImplMethodName())).\n" +
- " toArray(Method[]::new);\n" +
- " if(methods.length != 1) throw new AssertionError(\"TODO: check signature\");\n" +
- " return methods[0];\n" +
- " } catch(Exception e) {\n" +
- " throw new RuntimeException(e);\n" +
- " }\n" +
- " }\n" +
+ "import java.io.ObjectStreamClass;\n" +
+ "import java.io.Serializable;\n" +
+ "import java.lang.invoke.SerializedLambda;\n" +
+ "import java.lang.reflect.Method;\n" +
+ "import java.util.function.IntFunction;\n" +
+ "import java.util.stream.Stream;\n" +
+ "public class Testbed {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(getMethod(Testbed::foo).equals(getMethod(Testbed::foo)));\n" +
+ " }\n" +
+ " private static void foo() { }\n" +
+ " static interface MethodRef extends Runnable, Serializable { }\n" +
+ " private static Method getMethod(MethodRef methodRef) {\n" +
+ " try {\n" +
+ " final Method invokeWriteReplaceMethod = ObjectStreamClass.class.getDeclaredMethod(\"invokeWriteReplace\", Object.class);\n" +
+ " invokeWriteReplaceMethod.setAccessible(true);\n" +
+ " final SerializedLambda l = (SerializedLambda)invokeWriteReplaceMethod.invoke(\n" +
+ " ObjectStreamClass.lookupAny(methodRef.getClass()),\n" +
+ " methodRef\n" +
+ " );\n" +
+ " System.out.println(\"Looking for \" + l.getImplClass() + \".\" + l.getImplMethodName());\n" +
+ " final Method[] methods = Stream.of(Class.forName(l.getImplClass()).getDeclaredMethods()).\n" +
+ " filter(m -> m.getName().equals(l.getImplMethodName())).\n" +
+ " toArray(Method[]::new);\n" +
+ " if(methods.length != 1) throw new AssertionError(\"TODO: check signature\");\n" +
+ " return methods[0];\n" +
+ " } catch(Exception e) {\n" +
+ " throw new RuntimeException(e);\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
"Looking for Testbed.foo\n" +
"Looking for Testbed.foo\n" +
"true",
null,true,
- (isJRE9Plus
- ? new String[] { "--add-opens", "java.base/java.io=ALL-UNNAMED" }
+ (isJRE9Plus
+ ? new String[] { "--add-opens", "java.base/java.io=ALL-UNNAMED" }
: new String [] { "-Ddummy" })
);
-
+
String bootstrapEntries = printBootstrapMethodsAttribute(OUTPUT_DIR + File.separator + "Testbed.class");
- String expectedOutput =
+ String expectedOutput =
"0: invokestatic java/lang/invoke/LambdaMetafactory.altMetafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;\n"+
" Method arguments:\n"+
" ()V\n"+
@@ -1609,50 +1609,50 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
this.runConformTest(
new String[]{
"Testbed.java",
- "import java.io.ObjectStreamClass;\n" +
- "import java.io.Serializable;\n" +
- "import java.lang.invoke.SerializedLambda;\n" +
- "import java.lang.reflect.Constructor;\n" +
- "import java.lang.reflect.Executable;\n" +
- "import java.lang.reflect.Method;\n" +
- "import java.util.function.IntFunction;\n" +
- "import java.util.stream.Stream;\n" +
- "public class Testbed {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(getMethod(Testbed::foo).equals(getMethod(Testbed::foo)));\n" +
- " System.out.println(getMethod(new Foo()::method).equals(getMethod(new Bar()::method)));\n" +
- " System.out.println(getMethod(MethodRefImpl::new).equals(getMethod(MethodRefImpl::new)));\n" +
- " }\n" +
- " static class MethodRefImpl implements MethodRef {\n" +
- " @Override\n" +
- " public void run() {}\n" +
- " }\n" +
- " public static class Base {\n" +
- " public void method () {}\n" +
- " }\n" +
- " public static class Foo extends Base {}\n" +
- " public static class Bar extends Base {}\n" +
- " private static void foo() { }\n" +
- " static interface MethodRef extends Runnable, Serializable { }\n" +
- " private static Executable getMethod(MethodRef methodRef) {\n" +
- " try {\n" +
- " final Method invokeWriteReplaceMethod = ObjectStreamClass.class.getDeclaredMethod(\"invokeWriteReplace\", Object.class);\n" +
- " invokeWriteReplaceMethod.setAccessible(true);\n" +
- " final SerializedLambda l = (SerializedLambda)invokeWriteReplaceMethod.invoke(\n" +
- " ObjectStreamClass.lookupAny(methodRef.getClass()),\n" +
- " methodRef\n" +
- " );\n" +
- " System.out.println(\"Looking for \" + l.getImplClass() + \".\" + l.getImplMethodName());\n" +
- " boolean isConstructor = l.getImplMethodName().indexOf(\"<init>\") >= 0;\n" +
- " final Executable[] methods = Stream.of(isConstructor ? Class.forName(l.getImplClass()).getDeclaredConstructors() : Class.forName(l.getImplClass()).getDeclaredMethods()).\n" +
- " filter(m -> m.getName().equals(isConstructor ? l.getImplClass() : l.getImplMethodName())).\n" +
- " toArray(isConstructor ? Constructor[]::new : Method[]::new);\n" +
- " if(methods.length != 1) throw new AssertionError(\"TODO: check signature\");\n" +
- " return methods[0];\n" +
- " } catch(Exception e) {\n" +
- " throw new RuntimeException(e);\n" +
- " }\n" +
- " }\n" +
+ "import java.io.ObjectStreamClass;\n" +
+ "import java.io.Serializable;\n" +
+ "import java.lang.invoke.SerializedLambda;\n" +
+ "import java.lang.reflect.Constructor;\n" +
+ "import java.lang.reflect.Executable;\n" +
+ "import java.lang.reflect.Method;\n" +
+ "import java.util.function.IntFunction;\n" +
+ "import java.util.stream.Stream;\n" +
+ "public class Testbed {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(getMethod(Testbed::foo).equals(getMethod(Testbed::foo)));\n" +
+ " System.out.println(getMethod(new Foo()::method).equals(getMethod(new Bar()::method)));\n" +
+ " System.out.println(getMethod(MethodRefImpl::new).equals(getMethod(MethodRefImpl::new)));\n" +
+ " }\n" +
+ " static class MethodRefImpl implements MethodRef {\n" +
+ " @Override\n" +
+ " public void run() {}\n" +
+ " }\n" +
+ " public static class Base {\n" +
+ " public void method () {}\n" +
+ " }\n" +
+ " public static class Foo extends Base {}\n" +
+ " public static class Bar extends Base {}\n" +
+ " private static void foo() { }\n" +
+ " static interface MethodRef extends Runnable, Serializable { }\n" +
+ " private static Executable getMethod(MethodRef methodRef) {\n" +
+ " try {\n" +
+ " final Method invokeWriteReplaceMethod = ObjectStreamClass.class.getDeclaredMethod(\"invokeWriteReplace\", Object.class);\n" +
+ " invokeWriteReplaceMethod.setAccessible(true);\n" +
+ " final SerializedLambda l = (SerializedLambda)invokeWriteReplaceMethod.invoke(\n" +
+ " ObjectStreamClass.lookupAny(methodRef.getClass()),\n" +
+ " methodRef\n" +
+ " );\n" +
+ " System.out.println(\"Looking for \" + l.getImplClass() + \".\" + l.getImplMethodName());\n" +
+ " boolean isConstructor = l.getImplMethodName().indexOf(\"<init>\") >= 0;\n" +
+ " final Executable[] methods = Stream.of(isConstructor ? Class.forName(l.getImplClass()).getDeclaredConstructors() : Class.forName(l.getImplClass()).getDeclaredMethods()).\n" +
+ " filter(m -> m.getName().equals(isConstructor ? l.getImplClass() : l.getImplMethodName())).\n" +
+ " toArray(isConstructor ? Constructor[]::new : Method[]::new);\n" +
+ " if(methods.length != 1) throw new AssertionError(\"TODO: check signature\");\n" +
+ " return methods[0];\n" +
+ " } catch(Exception e) {\n" +
+ " throw new RuntimeException(e);\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
"Looking for Testbed.foo\n" +
@@ -1665,8 +1665,8 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
"Looking for Testbed$MethodRefImpl.<init>\n" +
"true",
null,true,
- (isJRE9Plus
- ? new String[] { "--add-opens", "java.base/java.io=ALL-UNNAMED" }
+ (isJRE9Plus
+ ? new String[] { "--add-opens", "java.base/java.io=ALL-UNNAMED" }
: new String [] { "-Ddummy" })
);
}
@@ -1676,47 +1676,47 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
this.runConformTest(
new String[]{
"X.java",
- "import java.io.ByteArrayInputStream;\n" +
- "import java.io.ByteArrayOutputStream;\n" +
- "import java.io.IOException;\n" +
- "import java.io.ObjectInputStream;\n" +
- "import java.io.ObjectOutputStream;\n" +
- "import java.io.Serializable;\n" +
- "public class X {\n" +
- " public static interface Consumer<T> extends Serializable {\n" +
- " void accept(T t);\n" +
- " }\n" +
- " public static class Foo {\n" +
- " public void method () {\n" +
- " System.out.println(\"Foo\");\n" +
- " }\n" +
- " }\n" +
- " public static class Bar {\n" +
- " public void method () {\n" +
- " System.out.println(\"Bar\");\n" +
- " }\n" +
- " }\n" +
- " public static void main (String[] args) throws IOException, ClassNotFoundException {\n" +
- " Consumer<Foo> foo = Foo::method;\n" +
- " Consumer<Bar> bar = Bar::method;\n" +
- " Consumer<Foo> baz = (b) -> {b.method();};\n" +
- " ByteArrayOutputStream debug=new ByteArrayOutputStream();\n" +
- " try(ObjectOutputStream oo=new ObjectOutputStream(debug)) {\n" +
- " oo.writeObject(bar);\n" +
- " }\n" +
- " try(ObjectInputStream oi=new ObjectInputStream(new ByteArrayInputStream(debug.toByteArray()))) {\n" +
- " Consumer<Bar> x = (Consumer)oi.readObject();\n" +
- " x.accept(new Bar());\n" +
- " }\n" +
- " debug.reset();\n" +
- " try(ObjectOutputStream oo=new ObjectOutputStream(debug)) {\n" +
- " oo.writeObject(foo);\n" +
- " }\n" +
- " try(ObjectInputStream oi=new ObjectInputStream(new ByteArrayInputStream(debug.toByteArray()))) {\n" +
- " Consumer<Foo> x = (Consumer)oi.readObject();\n" +
- " x.accept(new Foo());\n" +
- " }\n" +
- " }\n" +
+ "import java.io.ByteArrayInputStream;\n" +
+ "import java.io.ByteArrayOutputStream;\n" +
+ "import java.io.IOException;\n" +
+ "import java.io.ObjectInputStream;\n" +
+ "import java.io.ObjectOutputStream;\n" +
+ "import java.io.Serializable;\n" +
+ "public class X {\n" +
+ " public static interface Consumer<T> extends Serializable {\n" +
+ " void accept(T t);\n" +
+ " }\n" +
+ " public static class Foo {\n" +
+ " public void method () {\n" +
+ " System.out.println(\"Foo\");\n" +
+ " }\n" +
+ " }\n" +
+ " public static class Bar {\n" +
+ " public void method () {\n" +
+ " System.out.println(\"Bar\");\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main (String[] args) throws IOException, ClassNotFoundException {\n" +
+ " Consumer<Foo> foo = Foo::method;\n" +
+ " Consumer<Bar> bar = Bar::method;\n" +
+ " Consumer<Foo> baz = (b) -> {b.method();};\n" +
+ " ByteArrayOutputStream debug=new ByteArrayOutputStream();\n" +
+ " try(ObjectOutputStream oo=new ObjectOutputStream(debug)) {\n" +
+ " oo.writeObject(bar);\n" +
+ " }\n" +
+ " try(ObjectInputStream oi=new ObjectInputStream(new ByteArrayInputStream(debug.toByteArray()))) {\n" +
+ " Consumer<Bar> x = (Consumer)oi.readObject();\n" +
+ " x.accept(new Bar());\n" +
+ " }\n" +
+ " debug.reset();\n" +
+ " try(ObjectOutputStream oo=new ObjectOutputStream(debug)) {\n" +
+ " oo.writeObject(foo);\n" +
+ " }\n" +
+ " try(ObjectInputStream oi=new ObjectInputStream(new ByteArrayInputStream(debug.toByteArray()))) {\n" +
+ " Consumer<Foo> x = (Consumer)oi.readObject();\n" +
+ " x.accept(new Foo());\n" +
+ " }\n" +
+ " }\n" +
"}\n"
},
"Bar\n" +
@@ -1728,62 +1728,62 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
this.runConformTest(
new String[]{
"Testbed.java",
- "import java.io.ByteArrayInputStream;\n" +
- "import java.io.ByteArrayOutputStream;\n" +
- "import java.io.IOException;\n" +
- "import java.io.ObjectInputStream;\n" +
- "import java.io.ObjectOutputStream;\n" +
- "import java.io.Serializable;\n" +
- "interface FI extends Serializable{\n" +
- " void run(Testbed args);\n" +
- "}\n" +
- "interface IF extends Serializable{\n" +
- " void run();\n" +
- "}\n" +
- "public class Testbed implements Serializable{\n" +
- " String f;\n" +
- " Testbed(String str) {\n" +
- " f = str;\n" +
- " }\n" +
- " void test() throws IOException, ClassNotFoundException {\n" +
- " accept(Testbed::foo);\n" +
- " accept(this::foo); \n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println(this.f);\n" +
- " }\n" +
- " void accept(FI fi) {\n" +
- " fi.run(this);\n" +
- " }\n" +
- " void accept(IF i) {\n" +
- " i.run();\n" +
- " }\n" +
- " public static void main(String[] args) throws ClassNotFoundException, IOException {\n" +
- " Testbed t = new Testbed(\"IF\");\n" +
- " Testbed t2 = new Testbed(\"FI\");\n" +
- " IF i = t::foo;\n" +
- " FI f = Testbed::foo;\n" +
- " ByteArrayOutputStream debug=new ByteArrayOutputStream();\n" +
- " try(ObjectOutputStream oo=new ObjectOutputStream(debug))\n" +
- " {\n" +
- " oo.writeObject(i);\n" +
- " }\n" +
- " try(ObjectInputStream oi=new ObjectInputStream(new ByteArrayInputStream(debug.toByteArray())))\n" +
- " {\n" +
- " IF x = (IF)oi.readObject();\n" +
- " t.accept(x);\n" +
- " }\n" +
- " debug=new ByteArrayOutputStream();\n" +
- " try(ObjectOutputStream oo=new ObjectOutputStream(debug))\n" +
- " {\n" +
- " oo.writeObject(f);\n" +
- " }\n" +
- " try(ObjectInputStream oi=new ObjectInputStream(new ByteArrayInputStream(debug.toByteArray())))\n" +
- " {\n" +
- " FI x = (FI)oi.readObject();\n" +
- " t2.accept(x);\n" +
- " }\n" +
- " }\n" +
+ "import java.io.ByteArrayInputStream;\n" +
+ "import java.io.ByteArrayOutputStream;\n" +
+ "import java.io.IOException;\n" +
+ "import java.io.ObjectInputStream;\n" +
+ "import java.io.ObjectOutputStream;\n" +
+ "import java.io.Serializable;\n" +
+ "interface FI extends Serializable{\n" +
+ " void run(Testbed args);\n" +
+ "}\n" +
+ "interface IF extends Serializable{\n" +
+ " void run();\n" +
+ "}\n" +
+ "public class Testbed implements Serializable{\n" +
+ " String f;\n" +
+ " Testbed(String str) {\n" +
+ " f = str;\n" +
+ " }\n" +
+ " void test() throws IOException, ClassNotFoundException {\n" +
+ " accept(Testbed::foo);\n" +
+ " accept(this::foo); \n" +
+ " }\n" +
+ " void foo() {\n" +
+ " System.out.println(this.f);\n" +
+ " }\n" +
+ " void accept(FI fi) {\n" +
+ " fi.run(this);\n" +
+ " }\n" +
+ " void accept(IF i) {\n" +
+ " i.run();\n" +
+ " }\n" +
+ " public static void main(String[] args) throws ClassNotFoundException, IOException {\n" +
+ " Testbed t = new Testbed(\"IF\");\n" +
+ " Testbed t2 = new Testbed(\"FI\");\n" +
+ " IF i = t::foo;\n" +
+ " FI f = Testbed::foo;\n" +
+ " ByteArrayOutputStream debug=new ByteArrayOutputStream();\n" +
+ " try(ObjectOutputStream oo=new ObjectOutputStream(debug))\n" +
+ " {\n" +
+ " oo.writeObject(i);\n" +
+ " }\n" +
+ " try(ObjectInputStream oi=new ObjectInputStream(new ByteArrayInputStream(debug.toByteArray())))\n" +
+ " {\n" +
+ " IF x = (IF)oi.readObject();\n" +
+ " t.accept(x);\n" +
+ " }\n" +
+ " debug=new ByteArrayOutputStream();\n" +
+ " try(ObjectOutputStream oo=new ObjectOutputStream(debug))\n" +
+ " {\n" +
+ " oo.writeObject(f);\n" +
+ " }\n" +
+ " try(ObjectInputStream oi=new ObjectInputStream(new ByteArrayInputStream(debug.toByteArray())))\n" +
+ " {\n" +
+ " FI x = (FI)oi.readObject();\n" +
+ " t2.accept(x);\n" +
+ " }\n" +
+ " }\n" +
"}"
},
"IF\n" +
@@ -1795,47 +1795,47 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
this.runConformTest(
new String[]{
"Test.java",
- "import java.io.ByteArrayInputStream;\n" +
- "import java.io.ByteArrayOutputStream;\n" +
- "import java.io.ObjectInputStream;\n" +
- "import java.io.ObjectOutputStream;\n" +
- "import java.io.Serializable;\n" +
- "interface Func<T> extends Serializable {\n" +
- " T get();\n" +
- "}\n" +
- "class Impl implements Serializable {\n" +
- " int val = 0;\n" +
- " public int next() {\n" +
- " val += 1;\n" +
- " return val;\n" +
- " }\n" +
- "}\n" +
- "public class Test {\n" +
- " final Impl impl = new Impl();\n" +
- " final Func<Integer> func = (Func<Integer> & Cloneable)impl::next;\n" +
- " public void test() throws Throwable {\n" +
- " byte[] bytes = write(func);//25\n" +
- " Func<Integer> func = read(bytes);\n" +
- " System.out.println(func.get());\n" +
- " }\n" +
- " public static void main(String[] args) throws Throwable {\n" +
- " new Test().test();\n" +
- "}\n" +
- " @SuppressWarnings(\"unchecked\")\n" +
- " private static Func<Integer> read(byte[] bytes) throws Exception {\n" +
- " ByteArrayInputStream bis = new ByteArrayInputStream(bytes);\n" +
- " try (ObjectInputStream ois = new ObjectInputStream(bis)) {\n" +
- " return (Func<Integer>) ois.readObject();\n" +
- " }\n" +
- " }\n" +
- " private static byte[] write(Func<Integer> func) throws Exception {\n" +
- " ByteArrayOutputStream bos = new ByteArrayOutputStream();\n" +
- " System.out.println(func.get());\n" +
- " try (ObjectOutputStream oos = new ObjectOutputStream(bos)) {\n" +
- " oos.writeObject(func);//42\n" +
- " }\n" +
- " return bos.toByteArray();\n" +
- " }\n" +
+ "import java.io.ByteArrayInputStream;\n" +
+ "import java.io.ByteArrayOutputStream;\n" +
+ "import java.io.ObjectInputStream;\n" +
+ "import java.io.ObjectOutputStream;\n" +
+ "import java.io.Serializable;\n" +
+ "interface Func<T> extends Serializable {\n" +
+ " T get();\n" +
+ "}\n" +
+ "class Impl implements Serializable {\n" +
+ " int val = 0;\n" +
+ " public int next() {\n" +
+ " val += 1;\n" +
+ " return val;\n" +
+ " }\n" +
+ "}\n" +
+ "public class Test {\n" +
+ " final Impl impl = new Impl();\n" +
+ " final Func<Integer> func = (Func<Integer> & Cloneable)impl::next;\n" +
+ " public void test() throws Throwable {\n" +
+ " byte[] bytes = write(func);//25\n" +
+ " Func<Integer> func = read(bytes);\n" +
+ " System.out.println(func.get());\n" +
+ " }\n" +
+ " public static void main(String[] args) throws Throwable {\n" +
+ " new Test().test();\n" +
+ "}\n" +
+ " @SuppressWarnings(\"unchecked\")\n" +
+ " private static Func<Integer> read(byte[] bytes) throws Exception {\n" +
+ " ByteArrayInputStream bis = new ByteArrayInputStream(bytes);\n" +
+ " try (ObjectInputStream ois = new ObjectInputStream(bis)) {\n" +
+ " return (Func<Integer>) ois.readObject();\n" +
+ " }\n" +
+ " }\n" +
+ " private static byte[] write(Func<Integer> func) throws Exception {\n" +
+ " ByteArrayOutputStream bos = new ByteArrayOutputStream();\n" +
+ " System.out.println(func.get());\n" +
+ " try (ObjectOutputStream oos = new ObjectOutputStream(bos)) {\n" +
+ " oos.writeObject(func);//42\n" +
+ " }\n" +
+ " return bos.toByteArray();\n" +
+ " }\n" +
"}"
},
"1\n" +
@@ -1849,175 +1849,175 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
this.runConformTest(
new String[]{
"Test.java",
- "import java.io.IOException;\n" +
- "import java.io.Serializable;\n" +
- "public class Test {\n" +
- " class AnException extends Exception {\n" +
- " }\n" +
- " class Asd {\n" +
- " public Asd(String asd) { data = asd; }\n" +
- " private final String data;\n" +
- " @Override\n" +
- " public String toString() {\n" +
- " return data;\n" +
- " }\n" +
- " }\n" +
- " public interface Test1 extends Serializable {\n" +
- " void test() throws IOException;\n" +
- " }\n" +
- " public interface Test2 {\n" +
- " void test() throws AnException;\n" +
- " }\n" +
- " public void test1( Test1 test ) {\n" +
- " try {\n" +
- " test.test();\n" +
- " } catch( IOException e ) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
- " public void test2( Test2 test ) {\n" +
- " try {\n" +
- " test.test();\n" +
- " } catch( AnException e ) {\n" +
- " System.out.println( e );\n" +
- " }\n" +
- " }\n" +
- " public void lambdas() {\n" +
- " test1( () -> System.out.println( \"test a\" ) );\n" +
- " test1( () -> System.out.println( \"test b\" ) );\n" +
- " test2( () -> System.out.println( \"test c\" ) );\n" +
- " test2( () -> System.out.println( \"test d\" ) );\n" +
- " }\n" +
- " public void print( CharSequence a, String b, long c ) {\n" +
- " System.out.println( a );\n" +
- " System.out.println( b );\n" +
- " System.out.println( c );\n" +
- " }\n" +
- " public void filler() {\n" +
- " System.out.println( \"Now we need to get this class file closer to 3000 bytes boundary\" );\n" +
- " filler1();\n" +
- " filler2();\n" +
- " filler3();\n" +
- " filler4();\n" +
- " filler5();\n" +
- " filler6();\n" +
- " filler7();\n" +
- " filler8();\n" +
- " filler9();\n" +
- " filler10();\n" +
- " filler11();\n" +
- " filler12();\n" +
- " filler13();\n" +
- " filler14();\n" +
- " filler15();\n" +
- " filler16();\n" +
- " filler17();\n" +
- " filler18();\n" +
- " filler19();\n" +
- " filler20();\n" +
- " filler21();\n" +
- " filler22();\n" +
- " filler23();\n" +
- " filler24();\n" +
- " filler25();\n" +
- " filler26();\n" +
- " filler27();\n" +
- " filler28();\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler28() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler27() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler26() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler25() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler24() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler23() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler22() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler21() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler20() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler19() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler18() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler17() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler16() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler15() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler14() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler13() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler12() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler11() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler10() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler9() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler8() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler7() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler6() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler5() {\n" +
- " print( c.toString(), d.toString(), System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler4() {\n" +
- " print( a.toString(), b.toString(), System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler3() {\n" +
- " print( \"a\", System.getenv( \"asd\" ), System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler2() {\n" +
- " print( \"a\", System.lineSeparator(), System.currentTimeMillis() );\n" +
- " }\n" +
- " private void filler1() {\n" +
- " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
- " }\n" +
- " private final Asd a = new Asd(\"a\");\n" +
- " private final Asd b = new Asd(\"b\");\n" +
- " private final Asd c = new Asd(\"c\");\n" +
- " private final Asd d = new Asd(\"d\");\n" +
+ "import java.io.IOException;\n" +
+ "import java.io.Serializable;\n" +
+ "public class Test {\n" +
+ " class AnException extends Exception {\n" +
+ " }\n" +
+ " class Asd {\n" +
+ " public Asd(String asd) { data = asd; }\n" +
+ " private final String data;\n" +
+ " @Override\n" +
+ " public String toString() {\n" +
+ " return data;\n" +
+ " }\n" +
+ " }\n" +
+ " public interface Test1 extends Serializable {\n" +
+ " void test() throws IOException;\n" +
+ " }\n" +
+ " public interface Test2 {\n" +
+ " void test() throws AnException;\n" +
+ " }\n" +
+ " public void test1( Test1 test ) {\n" +
+ " try {\n" +
+ " test.test();\n" +
+ " } catch( IOException e ) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
+ " public void test2( Test2 test ) {\n" +
+ " try {\n" +
+ " test.test();\n" +
+ " } catch( AnException e ) {\n" +
+ " System.out.println( e );\n" +
+ " }\n" +
+ " }\n" +
+ " public void lambdas() {\n" +
+ " test1( () -> System.out.println( \"test a\" ) );\n" +
+ " test1( () -> System.out.println( \"test b\" ) );\n" +
+ " test2( () -> System.out.println( \"test c\" ) );\n" +
+ " test2( () -> System.out.println( \"test d\" ) );\n" +
+ " }\n" +
+ " public void print( CharSequence a, String b, long c ) {\n" +
+ " System.out.println( a );\n" +
+ " System.out.println( b );\n" +
+ " System.out.println( c );\n" +
+ " }\n" +
+ " public void filler() {\n" +
+ " System.out.println( \"Now we need to get this class file closer to 3000 bytes boundary\" );\n" +
+ " filler1();\n" +
+ " filler2();\n" +
+ " filler3();\n" +
+ " filler4();\n" +
+ " filler5();\n" +
+ " filler6();\n" +
+ " filler7();\n" +
+ " filler8();\n" +
+ " filler9();\n" +
+ " filler10();\n" +
+ " filler11();\n" +
+ " filler12();\n" +
+ " filler13();\n" +
+ " filler14();\n" +
+ " filler15();\n" +
+ " filler16();\n" +
+ " filler17();\n" +
+ " filler18();\n" +
+ " filler19();\n" +
+ " filler20();\n" +
+ " filler21();\n" +
+ " filler22();\n" +
+ " filler23();\n" +
+ " filler24();\n" +
+ " filler25();\n" +
+ " filler26();\n" +
+ " filler27();\n" +
+ " filler28();\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler28() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler27() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler26() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler25() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler24() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler23() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler22() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler21() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler20() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler19() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler18() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler17() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler16() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler15() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler14() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler13() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler12() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler11() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler10() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler9() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler8() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler7() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler6() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler5() {\n" +
+ " print( c.toString(), d.toString(), System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler4() {\n" +
+ " print( a.toString(), b.toString(), System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler3() {\n" +
+ " print( \"a\", System.getenv( \"asd\" ), System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler2() {\n" +
+ " print( \"a\", System.lineSeparator(), System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private void filler1() {\n" +
+ " print( \"a\", \"b\", System.currentTimeMillis() );\n" +
+ " }\n" +
+ " private final Asd a = new Asd(\"a\");\n" +
+ " private final Asd b = new Asd(\"b\");\n" +
+ " private final Asd c = new Asd(\"c\");\n" +
+ " private final Asd d = new Asd(\"d\");\n" +
"}\n"
},
options);
@@ -2026,43 +2026,43 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
this.runConformTest(
new String[]{
"LambdaSerializationTest.java",
- "import java.io.ByteArrayInputStream;\n" +
- "import java.io.ByteArrayOutputStream;\n" +
- "import java.io.IOException;\n" +
- "import java.io.ObjectInputStream;\n" +
- "import java.io.ObjectOutputStream;\n" +
- "import java.io.Serializable;\n" +
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "import java.util.function.Supplier;\n" +
- "public class LambdaSerializationTest {\n" +
- " interface SerializableSupplier<T> extends Supplier<T>, Serializable {}\n" +
- " public static void constructorReferenceSerialization() throws IOException, ClassNotFoundException {\n" +
- " SerializableSupplier<List<?>> function = ArrayList::new; //Collections::emptyList;\n" +
- " Object result = serializeDeserialize(function);\n" +
+ "import java.io.ByteArrayInputStream;\n" +
+ "import java.io.ByteArrayOutputStream;\n" +
+ "import java.io.IOException;\n" +
+ "import java.io.ObjectInputStream;\n" +
+ "import java.io.ObjectOutputStream;\n" +
+ "import java.io.Serializable;\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "import java.util.function.Supplier;\n" +
+ "public class LambdaSerializationTest {\n" +
+ " interface SerializableSupplier<T> extends Supplier<T>, Serializable {}\n" +
+ " public static void constructorReferenceSerialization() throws IOException, ClassNotFoundException {\n" +
+ " SerializableSupplier<List<?>> function = ArrayList::new; //Collections::emptyList;\n" +
+ " Object result = serializeDeserialize(function);\n" +
" Class<?>[] infs = result.getClass().getInterfaces();\n" +
" for(int i = 0; i < infs.length; i++) {\n" +
" System.out.println(infs[i]);\n" +
" }\n" +
- " }\n" +
- " private static Object serializeDeserialize(Object obj) throws IOException, ClassNotFoundException {\n" +
- " try (\n" +
- " ByteArrayOutputStream buffer = new ByteArrayOutputStream(); //\n" +
- " ObjectOutputStream output = new ObjectOutputStream(buffer)) {\n" +
- " output.writeObject(obj);\n" +
- " try (ObjectInputStream input = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray()))) {\n" +
- " return input.readObject();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " LambdaSerializationTest.constructorReferenceSerialization();\n" +
- " } catch (ClassNotFoundException | IOException e) {\n" +
- " // TODO Auto-generated catch block\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " private static Object serializeDeserialize(Object obj) throws IOException, ClassNotFoundException {\n" +
+ " try (\n" +
+ " ByteArrayOutputStream buffer = new ByteArrayOutputStream(); //\n" +
+ " ObjectOutputStream output = new ObjectOutputStream(buffer)) {\n" +
+ " output.writeObject(obj);\n" +
+ " try (ObjectInputStream input = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray()))) {\n" +
+ " return input.readObject();\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
+ " LambdaSerializationTest.constructorReferenceSerialization();\n" +
+ " } catch (ClassNotFoundException | IOException e) {\n" +
+ " // TODO Auto-generated catch block\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}"
},
"interface LambdaSerializationTest$SerializableSupplier",
@@ -2073,46 +2073,46 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
this.runConformTest(
new String[]{
"LambdaSerializationTest.java",
- "import java.io.ByteArrayInputStream;\n" +
- "import java.io.ByteArrayOutputStream;\n" +
- "import java.io.IOException;\n" +
- "import java.io.ObjectInputStream;\n" +
- "import java.io.ObjectOutputStream;\n" +
- "import java.io.Serializable;\n" +
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "import java.util.function.Supplier;\n" +
- "public class LambdaSerializationTest {\n" +
- " interface SerializableSupplier<T> extends Supplier<T>, Serializable {}\n" +
- " static class Junk {\n" +
- " private Junk() {}\n" +
- " }\n" +
- " public static void constructorReferenceSerialization() throws IOException, ClassNotFoundException {\n" +
- " SerializableSupplier<Junk> function = Junk::new;\n" +
- " Object result = serializeDeserialize(function);\n" +
+ "import java.io.ByteArrayInputStream;\n" +
+ "import java.io.ByteArrayOutputStream;\n" +
+ "import java.io.IOException;\n" +
+ "import java.io.ObjectInputStream;\n" +
+ "import java.io.ObjectOutputStream;\n" +
+ "import java.io.Serializable;\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "import java.util.function.Supplier;\n" +
+ "public class LambdaSerializationTest {\n" +
+ " interface SerializableSupplier<T> extends Supplier<T>, Serializable {}\n" +
+ " static class Junk {\n" +
+ " private Junk() {}\n" +
+ " }\n" +
+ " public static void constructorReferenceSerialization() throws IOException, ClassNotFoundException {\n" +
+ " SerializableSupplier<Junk> function = Junk::new;\n" +
+ " Object result = serializeDeserialize(function);\n" +
" Class<?>[] infs = result.getClass().getInterfaces();\n" +
" for(int i = 0; i < infs.length; i++) {\n" +
" System.out.println(infs[i]);\n" +
- " }\n" +
- " }\n" +
- " private static Object serializeDeserialize(Object obj) throws IOException, ClassNotFoundException {\n" +
- " try (\n" +
- " ByteArrayOutputStream buffer = new ByteArrayOutputStream(); //\n" +
- " ObjectOutputStream output = new ObjectOutputStream(buffer)) {\n" +
- " output.writeObject(obj);\n" +
- " try (ObjectInputStream input = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray()))) {\n" +
- " return input.readObject();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " LambdaSerializationTest.constructorReferenceSerialization();\n" +
- " } catch (ClassNotFoundException | IOException e) {\n" +
- " // TODO Auto-generated catch block\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
+ " private static Object serializeDeserialize(Object obj) throws IOException, ClassNotFoundException {\n" +
+ " try (\n" +
+ " ByteArrayOutputStream buffer = new ByteArrayOutputStream(); //\n" +
+ " ObjectOutputStream output = new ObjectOutputStream(buffer)) {\n" +
+ " output.writeObject(obj);\n" +
+ " try (ObjectInputStream input = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray()))) {\n" +
+ " return input.readObject();\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
+ " LambdaSerializationTest.constructorReferenceSerialization();\n" +
+ " } catch (ClassNotFoundException | IOException e) {\n" +
+ " // TODO Auto-generated catch block\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}"
},
"interface LambdaSerializationTest$SerializableSupplier",
@@ -2123,45 +2123,45 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
this.runConformTest(
new String[]{
"LambdaSerializationTest.java",
- "import java.io.ByteArrayInputStream;\n" +
- "import java.io.ByteArrayOutputStream;\n" +
- "import java.io.IOException;\n" +
- "import java.io.ObjectInputStream;\n" +
- "import java.io.ObjectOutputStream;\n" +
- "import java.io.Serializable;\n" +
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "import java.util.function.Supplier;\n" +
- "public class LambdaSerializationTest {\n" +
+ "import java.io.ByteArrayInputStream;\n" +
+ "import java.io.ByteArrayOutputStream;\n" +
+ "import java.io.IOException;\n" +
+ "import java.io.ObjectInputStream;\n" +
+ "import java.io.ObjectOutputStream;\n" +
+ "import java.io.Serializable;\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "import java.util.function.Supplier;\n" +
+ "public class LambdaSerializationTest {\n" +
" interface SerializableSupplier<T> extends Serializable {\n" +
" T get(int count);\n" +
- " }\n" +
- " public static void constructorReferenceSerialization() throws IOException, ClassNotFoundException {\n" +
- " SerializableSupplier<List[]> function = ArrayList[]::new;\n" +
- " Object result = serializeDeserialize(function);\n" +
+ " }\n" +
+ " public static void constructorReferenceSerialization() throws IOException, ClassNotFoundException {\n" +
+ " SerializableSupplier<List[]> function = ArrayList[]::new;\n" +
+ " Object result = serializeDeserialize(function);\n" +
" Class<?>[] infs = result.getClass().getInterfaces();\n" +
" for(int i = 0; i < infs.length; i++) {\n" +
" System.out.println(infs[i]);\n" +
- " }\n" +
- " }\n" +
- " private static Object serializeDeserialize(Object obj) throws IOException, ClassNotFoundException {\n" +
- " try (\n" +
- " ByteArrayOutputStream buffer = new ByteArrayOutputStream(); //\n" +
- " ObjectOutputStream output = new ObjectOutputStream(buffer)) {\n" +
- " output.writeObject(obj);\n" +
- " try (ObjectInputStream input = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray()))) {\n" +
- " return input.readObject();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " LambdaSerializationTest.constructorReferenceSerialization();\n" +
- " } catch (ClassNotFoundException | IOException e) {\n" +
- " // TODO Auto-generated catch block\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
+ " private static Object serializeDeserialize(Object obj) throws IOException, ClassNotFoundException {\n" +
+ " try (\n" +
+ " ByteArrayOutputStream buffer = new ByteArrayOutputStream(); //\n" +
+ " ObjectOutputStream output = new ObjectOutputStream(buffer)) {\n" +
+ " output.writeObject(obj);\n" +
+ " try (ObjectInputStream input = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray()))) {\n" +
+ " return input.readObject();\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
+ " LambdaSerializationTest.constructorReferenceSerialization();\n" +
+ " } catch (ClassNotFoundException | IOException e) {\n" +
+ " // TODO Auto-generated catch block\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}"
},
"interface LambdaSerializationTest$SerializableSupplier",
@@ -2172,37 +2172,37 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
this.runConformTest(
new String[]{
"lambdabug/App.java",
- "package lambdabug;\n" +
- "import java.io.ByteArrayInputStream;\n" +
- "import java.io.ByteArrayOutputStream;\n" +
- "import java.io.ObjectInputStream;\n" +
- "import java.io.ObjectOutputStream;\n" +
- "import java.io.Serializable;\n" +
- "import java.util.function.Function;\n" +
- "public class App {\n" +
- " public static interface SerialFunction<T, R> extends Function<T, R>, Serializable {\n" +
- " }\n" +
- " public static interface TestInterface extends Serializable {\n" +
- " public Integer method(Integer i);\n" +
- " }\n" +
- " public static class TestClass implements TestInterface {\n" +
- " private static final long serialVersionUID = 1L;\n" +
- " @Override\n" +
- " public Integer method(Integer i) {\n" +
- " return i;\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) throws Exception {\n" +
- " TestInterface testService = getService();\n" +
- " SerialFunction<Integer, Integer> sf = testService::method;\n" +
- " ByteArrayOutputStream bos = new ByteArrayOutputStream();\n" +
- " new ObjectOutputStream(bos).writeObject(sf);\n" +
- " Object o = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())).readObject();\n" +
- " System.out.println(o.getClass().getInterfaces()[0]);\n" +
- " }\n" +
- " private static TestInterface getService() {\n" +
- " return new TestClass();\n" +
- " }\n" +
+ "package lambdabug;\n" +
+ "import java.io.ByteArrayInputStream;\n" +
+ "import java.io.ByteArrayOutputStream;\n" +
+ "import java.io.ObjectInputStream;\n" +
+ "import java.io.ObjectOutputStream;\n" +
+ "import java.io.Serializable;\n" +
+ "import java.util.function.Function;\n" +
+ "public class App {\n" +
+ " public static interface SerialFunction<T, R> extends Function<T, R>, Serializable {\n" +
+ " }\n" +
+ " public static interface TestInterface extends Serializable {\n" +
+ " public Integer method(Integer i);\n" +
+ " }\n" +
+ " public static class TestClass implements TestInterface {\n" +
+ " private static final long serialVersionUID = 1L;\n" +
+ " @Override\n" +
+ " public Integer method(Integer i) {\n" +
+ " return i;\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) throws Exception {\n" +
+ " TestInterface testService = getService();\n" +
+ " SerialFunction<Integer, Integer> sf = testService::method;\n" +
+ " ByteArrayOutputStream bos = new ByteArrayOutputStream();\n" +
+ " new ObjectOutputStream(bos).writeObject(sf);\n" +
+ " Object o = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())).readObject();\n" +
+ " System.out.println(o.getClass().getInterfaces()[0]);\n" +
+ " }\n" +
+ " private static TestInterface getService() {\n" +
+ " return new TestClass();\n" +
+ " }\n" +
"}\n"
},
"interface lambdabug.App$SerialFunction",
@@ -2213,23 +2213,23 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
this.runConformTest(
new String[]{
"VerifyErrorDerived.java",
- "import java.io.Serializable;\n" +
- "import java.util.function.Function;\n" +
- "public class VerifyErrorDerived extends VerifyErrorBase {\n" +
- " public static void main(String [] args) {\n" +
- " System.out.println(\"hello world\");\n" +
- " }\n" +
- " public int derivedMethod(String param) {\n" +
- " SerializableFunction<String, Integer> f = super::baseMethod;\n" +
- " return f.apply(param);\n" +
- " }\n" +
- "}\n" +
+ "import java.io.Serializable;\n" +
+ "import java.util.function.Function;\n" +
+ "public class VerifyErrorDerived extends VerifyErrorBase {\n" +
+ " public static void main(String [] args) {\n" +
+ " System.out.println(\"hello world\");\n" +
+ " }\n" +
+ " public int derivedMethod(String param) {\n" +
+ " SerializableFunction<String, Integer> f = super::baseMethod;\n" +
+ " return f.apply(param);\n" +
+ " }\n" +
+ "}\n" +
"interface SerializableFunction<T, R> extends Function<T, R>, Serializable {}",
"VerifyErrorBase.java",
- "public class VerifyErrorBase {\n" +
- " public int baseMethod(String param) {\n" +
- " return 7;\n" +
- " }\n" +
+ "public class VerifyErrorBase {\n" +
+ " public int baseMethod(String param) {\n" +
+ " return 7;\n" +
+ " }\n" +
"}\n"
},
"hello world",
@@ -2240,34 +2240,34 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
this.runConformTest(
new String[]{
"compilertest/BaseType.java",
- "package compilertest;\n" +
- "import java.io.ByteArrayInputStream;\n" +
- "import java.io.ByteArrayOutputStream;\n" +
- "import java.io.ObjectInputStream;\n" +
- "import java.io.ObjectOutputStream;\n" +
- "import java.io.Serializable;\n" +
- "import compilertest.sub.SubType;\n" +
- "public class BaseType implements Serializable {\n" +
- " protected void doSomething() {\n" +
- " }\n" +
- " public static void main(String[] args) throws Exception {\n" +
- " SubType instance = new SubType();\n" +
- " ByteArrayOutputStream bs = new ByteArrayOutputStream();\n" +
- " ObjectOutputStream out = new ObjectOutputStream(bs);\n" +
- " out.writeObject(instance);\n" +
- " byte[] data = bs.toByteArray();\n" +
- " ObjectInputStream in = new ObjectInputStream(\n" +
- " new ByteArrayInputStream(data));\n" +
- " in.readObject();\n" +
- " System.out.println(\"Done\");\n" +
- " }\n" +
+ "package compilertest;\n" +
+ "import java.io.ByteArrayInputStream;\n" +
+ "import java.io.ByteArrayOutputStream;\n" +
+ "import java.io.ObjectInputStream;\n" +
+ "import java.io.ObjectOutputStream;\n" +
+ "import java.io.Serializable;\n" +
+ "import compilertest.sub.SubType;\n" +
+ "public class BaseType implements Serializable {\n" +
+ " protected void doSomething() {\n" +
+ " }\n" +
+ " public static void main(String[] args) throws Exception {\n" +
+ " SubType instance = new SubType();\n" +
+ " ByteArrayOutputStream bs = new ByteArrayOutputStream();\n" +
+ " ObjectOutputStream out = new ObjectOutputStream(bs);\n" +
+ " out.writeObject(instance);\n" +
+ " byte[] data = bs.toByteArray();\n" +
+ " ObjectInputStream in = new ObjectInputStream(\n" +
+ " new ByteArrayInputStream(data));\n" +
+ " in.readObject();\n" +
+ " System.out.println(\"Done\");\n" +
+ " }\n" +
"}",
"compilertest/sub/SubType.java",
- "package compilertest.sub;\n" +
- "import java.io.Serializable;\n" +
- "import compilertest.BaseType;\n" +
- "public class SubType extends BaseType {\n" +
- " Runnable task = (Runnable & Serializable) this::doSomething;\n" +
+ "package compilertest.sub;\n" +
+ "import java.io.Serializable;\n" +
+ "import compilertest.BaseType;\n" +
+ "public class SubType extends BaseType {\n" +
+ " Runnable task = (Runnable & Serializable) this::doSomething;\n" +
"}\n"
},
"Done",
@@ -2275,14 +2275,14 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
new String[]{"-Ddummy"});
}
// ---
-
+
private void checkExpected(String expected, String actual) {
if (!expected.equals(actual)) {
printIt(actual);
}
assertEquals(expected,actual);
}
-
+
/**
* Print a piece of text with the necessary extra quotes and newlines so that it can be cut/pasted into
* the test source file.
@@ -2295,7 +2295,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
}
System.out.println(quotedText);
}
-
+
/**
* Print the bootstrap methods attribute in a very similar fashion to javap for checking.
* Unlike javap the constant pool indexes are not included, to make the test a little less
@@ -2320,9 +2320,9 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
IBootstrapMethodsEntry entry = bootstrapMethodsAttribute.getBootstrapMethods()[i];
int mr = entry.getBootstrapMethodReference();
IConstantPoolEntry2 icpe = (IConstantPoolEntry2)cfr.getConstantPool().decodeEntry(mr);
-
+
sb.append(i).append(": ").append(formatReferenceKind(icpe.getReferenceKind()));
- sb.append(" ").append(format(cp,icpe.getReferenceIndex()));
+ sb.append(" ").append(format(cp,icpe.getReferenceIndex()));
sb.append("\n");
int[] args = entry.getBootstrapArguments();
sb.append(" Method arguments:\n");
@@ -2332,14 +2332,14 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
}
return sb.toString();
}
-
+
private String printLambdaMethods(String filepath) {
IClassFileReader cfr = ToolFactory.createDefaultClassFileReader(filepath, IClassFileReader.METHOD_INFOS);
IMethodInfo[] methodInfos = cfr.getMethodInfos();
StringBuffer buf = new StringBuffer();
for (int i = 0, max = methodInfos.length; i < max; i++) {
IMethodInfo methodInfo = methodInfos[i];
- if (!new String(methodInfo.getName()).startsWith("lambda"))
+ if (!new String(methodInfo.getName()).startsWith("lambda"))
continue;
int accessFlags = methodInfo.getAccessFlags();
if (Modifier.isStatic(accessFlags)) {
@@ -2351,7 +2351,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
}
return buf.toString();
}
-
+
String formatReferenceKind(int kind) {
switch (kind) {
case IConstantPoolConstant.METHOD_TYPE_REF_InvokeStatic:
@@ -2360,7 +2360,7 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
throw new IllegalStateException("nyi for "+kind);
}
}
-
+
String format(IConstantPool cp, int entryNumber) {
IConstantPoolEntry entry = cp.decodeEntry(entryNumber);
if (entry == null) {
@@ -2384,6 +2384,6 @@ public class SerializableLambdaTest extends AbstractRegressionTest {
throw new IllegalStateException("nyi for "+entry.getKind());
}
}
-
+
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java
index ed924e0d9..858775a01 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java
@@ -2655,3431 +2655,3431 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
},
"SUCCESS");
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=236336
public void test037() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
" System.out.print(\"SUCCESS\");\n" +
- " }\n" +
- " String field;\n" +
- " String field2;\n" +
- " public void foo(int index, Object[] objs, Object[] objs2) {\n" +
- " String methodName = \"foo\";\n" +
- " int i = -1;\n" +
- " try {\n" +
- " switch (index) {\n" +
- " case 1130: {\n" +
- " int j = ((Integer) objs[0]).intValue();\n" +
- " int k = ((Integer) objs[0]).intValue();\n" +
- " {\n" +
- " String s = field;\n" +
- " String s2 = field2;\n" +
- " synchronized (s2) {\n" +
- " String s3 = s2;\n" +
- " try {\n" +
- " System.out.println(s);\n" +
- " System.out.println(s2);\n" +
- " System.out.println(s3);\n" +
- " } finally {\n" +
- " s2.toString();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " break;\n" +
- " case 0 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 2 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 3 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 4 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 5 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 6 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 7 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 8 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 9 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 10 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 11 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 12 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 13 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 14 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 15 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 16 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 17 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 18 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 19 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 20 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 21 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 22 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 23 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 24 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 25 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 26 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 27 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 28 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 29 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 30 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 31 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 32 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 33 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 34 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 35 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 36 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 37 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 38 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 39 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 40 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 41 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 42 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 43 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 44 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 45 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 46 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 47 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 48 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 49 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 50 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 51 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 52 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 53 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 54 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 55 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 56 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 57 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 58 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 59 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 60 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 61 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 62 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 63 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 64 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 65 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 66 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 67 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 68 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 69 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 70 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 71 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 72 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 73 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 74 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 75 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 76 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 77 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 78 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 79 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 80 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 81 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 82 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 83 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 84 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 85 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 86 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 87 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 88 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 89 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 90 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 91 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 92 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 93 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 94 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 95 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 96 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 97 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 98 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 99 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 100 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 101 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 102 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 103 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 104 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 105 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 106 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 107 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 108 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 109 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 110 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 111 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 112 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 113 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 114 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 115 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 116 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 117 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 118 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 119 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 120 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 121 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 122 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 123 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 124 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 125 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 126 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 127 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 128 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 129 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 130 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 131 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 132 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 133 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 134 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 135 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 136 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 137 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 138 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 139 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 140 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 141 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 142 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 143 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 144 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 145 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 146 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 147 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 148 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 149 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 150 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 151 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 152 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 153 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 154 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 155 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 156 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 157 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 158 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 159 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 160 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 161 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 162 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 163 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 164 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 165 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 166 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 167 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 168 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 169 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 170 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 171 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 172 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 173 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 174 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 175 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 176 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 177 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 178 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 179 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 180 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 181 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 182 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 183 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 184 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 185 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 186 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 187 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 188 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 189 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 190 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 191 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 192 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 193 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 194 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 195 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 196 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 197 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 198 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 199 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 200 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 201 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 202 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 203 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 204 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 205 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 206 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 207 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 208 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 209 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 210 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 211 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 212 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 213 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 214 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 215 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 216 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 217 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 218 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 219 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 220 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 221 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 222 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 223 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 224 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 225 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 226 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 227 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 228 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 229 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 230 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 231 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 232 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 233 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 234 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 235 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 236 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 237 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 238 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 239 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 240 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 241 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 242 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 243 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 244 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 245 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 246 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 247 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 248 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 249 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 250 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 251 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 252 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 253 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 254 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 255 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 256 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 257 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 258 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 259 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 260 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 261 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 262 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 263 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 264 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 265 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 266 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 267 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 268 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 269 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 270 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 271 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 272 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 273 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 274 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 275 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 276 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 277 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 278 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 279 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 280 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 281 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 282 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 283 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 284 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 285 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 286 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 287 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 288 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 289 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 290 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 291 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 292 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 293 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 294 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 295 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 296 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 297 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 298 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 299 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 300 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 301 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 302 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 303 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 304 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 305 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 306 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 307 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 308 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 309 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 310 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 311 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 312 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 313 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 314 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 315 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 316 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 317 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 318 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 319 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 320 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 321 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 322 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 323 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 324 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 325 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 326 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 327 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 328 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 329 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 330 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 331 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 332 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 333 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 334 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 335 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 336 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 337 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 338 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 339 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 340 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 341 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 342 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 343 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 344 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 345 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 346 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 347 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 348 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 349 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 350 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 351 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 352 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 353 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 354 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 355 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 356 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 357 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 358 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 359 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 360 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 361 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 362 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 363 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 364 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 365 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 366 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 367 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 368 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 369 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 370 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 371 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 372 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 373 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 374 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 375 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 376 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 377 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 378 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 379 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 380 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 381 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 382 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 383 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 384 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 385 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 386 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 387 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 388 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 389 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 390 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 391 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 392 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 393 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 394 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 395 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 396 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 397 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 398 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 399 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 400 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 401 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 402 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 403 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 404 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 405 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 406 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 407 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 408 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 409 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 410 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 411 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 412 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 413 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 414 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 415 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 416 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 417 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 418 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 419 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 420 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 421 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 422 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 423 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 424 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 425 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 426 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 427 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 428 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 429 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 430 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 431 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 432 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 433 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 434 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 435 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 436 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 437 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 438 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 439 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 440 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 441 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 442 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 443 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 444 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 445 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 446 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 447 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 448 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 449 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 450 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 451 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 452 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 453 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 454 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 455 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 456 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 457 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 458 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 459 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 460 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 461 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 462 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 463 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 464 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 465 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 466 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 467 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 468 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 469 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 470 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 471 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 472 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 473 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 474 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 475 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 476 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 477 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 478 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 479 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 480 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 481 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 482 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 483 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 484 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 485 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 486 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 487 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 488 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 489 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 490 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 491 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 492 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 493 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 494 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 495 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 496 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 497 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 498 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 499 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 500 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 501 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 502 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 503 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 504 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 505 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 506 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 507 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 508 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 509 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 510 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 511 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 512 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 513 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 514 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 515 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 516 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 517 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 518 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 519 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 520 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 521 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 522 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 523 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 524 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 525 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 526 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 527 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 528 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 529 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 530 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 531 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 532 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 533 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 534 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 535 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 536 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 537 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 538 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 539 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 540 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 541 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 542 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 543 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 544 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 545 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 546 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 547 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 548 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 549 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 550 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 551 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 552 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 553 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 554 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 555 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 556 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 557 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 558 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 559 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 560 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 561 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 562 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 563 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 564 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 565 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 566 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 567 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 568 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 569 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 570 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 571 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 572 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 573 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 574 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 575 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 576 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 577 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 578 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 579 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 580 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 581 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 582 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 583 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 584 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 585 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 586 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 587 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 588 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 589 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 590 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 591 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 592 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 593 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 594 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 595 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 596 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 597 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 598 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 599 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 600 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 601 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 602 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 603 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 604 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 605 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 606 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 607 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 608 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 609 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 610 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 611 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 612 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 613 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 614 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 615 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 616 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 617 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 618 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 619 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 620 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 621 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 622 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 623 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 624 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 625 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 626 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 627 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 628 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 629 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 630 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 631 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 632 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 633 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 634 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 635 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 636 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 637 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 638 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 639 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 640 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 641 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 642 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 643 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 644 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 645 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 646 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 647 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 648 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 649 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 650 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 651 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 652 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 653 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 654 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 655 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 656 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 657 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 658 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 659 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 660 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 661 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 662 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 663 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 664 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 665 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 666 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 667 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 668 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 669 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 670 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 671 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 672 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 673 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 674 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 675 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 676 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 677 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 678 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 679 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 680 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 681 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 682 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 683 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 684 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 685 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 686 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 687 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 688 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 689 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 690 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 691 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 692 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 693 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 694 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 695 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 696 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 697 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 698 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 699 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 700 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 701 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 702 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 703 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 704 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 705 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 706 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 707 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 708 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 709 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 710 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 711 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 712 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 713 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 714 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 715 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 716 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 717 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 718 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 719 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 720 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 721 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 722 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 723 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 724 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 725 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 726 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 727 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 728 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 729 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 730 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 731 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 732 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 733 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 734 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 735 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 736 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 737 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 738 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 739 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 740 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 741 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 742 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 743 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 744 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 745 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 746 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 747 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 748 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 749 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 750 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 751 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 752 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 753 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 754 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 755 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 756 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 757 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 758 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 759 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 760 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 761 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 762 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 763 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 764 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 765 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 766 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 767 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 768 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 769 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 770 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 771 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 772 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 773 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 774 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 775 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 776 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 777 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 778 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 779 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 780 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 781 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 782 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 783 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 784 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 785 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 786 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 787 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 788 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 789 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 790 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 791 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 792 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 793 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 794 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 795 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 796 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 797 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 798 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 799 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 800 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 801 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 802 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 803 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 804 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 805 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 806 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 807 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 808 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 809 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 810 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 811 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 812 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 813 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 814 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 815 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 816 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 817 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 818 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 819 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 820 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 821 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 822 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 823 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 824 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 825 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 826 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 827 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 828 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 829 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 830 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 831 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 832 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 833 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 834 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 835 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 836 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 837 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 838 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 839 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 840 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 841 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 842 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 843 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 844 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 845 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 846 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 847 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 848 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 849 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 850 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 851 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 852 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 853 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 854 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 855 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 856 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 857 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 858 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 859 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 860 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 861 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 862 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 863 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 864 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 865 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 866 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 867 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 868 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 869 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 870 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 871 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 872 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 873 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 874 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 875 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 876 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 877 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 878 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 879 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 880 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 881 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 882 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 883 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 884 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 885 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 886 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 887 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 888 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 889 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 890 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 891 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 892 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 893 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 894 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 895 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 896 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 897 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 898 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 899 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 900 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 901 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 902 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 903 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 904 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 905 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 906 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 907 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 908 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 909 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 910 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 911 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 912 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 913 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 914 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 915 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 916 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 917 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 918 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 919 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 920 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 921 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 922 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 923 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 924 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 925 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 926 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 927 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 928 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 929 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 930 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 931 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 932 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 933 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 934 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 935 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 936 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 937 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 938 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 939 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 940 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 941 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 942 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 943 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 944 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 945 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 946 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 947 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 948 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 949 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 950 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 951 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 952 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 953 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 954 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 955 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 956 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 957 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 958 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 959 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 960 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 961 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 962 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 963 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 964 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 965 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 966 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 967 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 968 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 969 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 970 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 971 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 972 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 973 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 974 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 975 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 976 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 977 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 978 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 979 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 980 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 981 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 982 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 983 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 984 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 985 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 986 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 987 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 988 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 989 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 990 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 991 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 992 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 993 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 994 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 995 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 996 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 997 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 998 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 999 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1000 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1001 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1002 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1003 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1004 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1005 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1006 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1007 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1008 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1009 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1010 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1011 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1012 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1013 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1014 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1015 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1016 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1017 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1018 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1019 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1020 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1021 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1022 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1023 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1024 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1025 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1026 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1027 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1028 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1029 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1030 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1031 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1032 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1033 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1034 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1035 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1036 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1037 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1038 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1039 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1040 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1041 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1042 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1043 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1044 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1045 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1046 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1047 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1048 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1049 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1050 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1051 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1052 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1053 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1054 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1055 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1056 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1057 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1058 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1059 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1060 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1061 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1062 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1063 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1064 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1065 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1066 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1067 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1068 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1069 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1070 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1071 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1072 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1073 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1074 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1075 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1076 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1077 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1078 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1079 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1080 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1081 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1082 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1083 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1084 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1085 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1086 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1087 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1088 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1089 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1090 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1091 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1092 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1093 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1094 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1095 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1096 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1097 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1098 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1099 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1100 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1101 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1102 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1103 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1104 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1105 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1106 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1107 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1108 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1109 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1110 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1111 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1112 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1113 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1114 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1115 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1116 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1117 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1118 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1119 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1120 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1121 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1122 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1123 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1124 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1125 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1126 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1127 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1128 :\n" +
- " System.out.println(methodName + i);\n" +
- " break;\n" +
- " case 1129 :\n" +
- " System.out.println(methodName + i);\n" +
+ " }\n" +
+ " String field;\n" +
+ " String field2;\n" +
+ " public void foo(int index, Object[] objs, Object[] objs2) {\n" +
+ " String methodName = \"foo\";\n" +
+ " int i = -1;\n" +
+ " try {\n" +
+ " switch (index) {\n" +
+ " case 1130: {\n" +
+ " int j = ((Integer) objs[0]).intValue();\n" +
+ " int k = ((Integer) objs[0]).intValue();\n" +
+ " {\n" +
+ " String s = field;\n" +
+ " String s2 = field2;\n" +
+ " synchronized (s2) {\n" +
+ " String s3 = s2;\n" +
+ " try {\n" +
+ " System.out.println(s);\n" +
+ " System.out.println(s2);\n" +
+ " System.out.println(s3);\n" +
+ " } finally {\n" +
+ " s2.toString();\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " break;\n" +
+ " case 0 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 2 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 3 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 4 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 5 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 6 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 7 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 8 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 9 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 10 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 11 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 12 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 13 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 14 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 15 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 16 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 17 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 18 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 19 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 20 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 21 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 22 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 23 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 24 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 25 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 26 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 27 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 28 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 29 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 30 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 31 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 32 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 33 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 34 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 35 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 36 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 37 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 38 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 39 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 40 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 41 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 42 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 43 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 44 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 45 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 46 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 47 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 48 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 49 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 50 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 51 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 52 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 53 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 54 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 55 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 56 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 57 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 58 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 59 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 60 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 61 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 62 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 63 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 64 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 65 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 66 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 67 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 68 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 69 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 70 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 71 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 72 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 73 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 74 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 75 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 76 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 77 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 78 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 79 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 80 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 81 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 82 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 83 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 84 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 85 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 86 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 87 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 88 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 89 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 90 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 91 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 92 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 93 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 94 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 95 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 96 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 97 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 98 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 99 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 100 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 101 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 102 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 103 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 104 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 105 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 106 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 107 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 108 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 109 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 110 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 111 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 112 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 113 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 114 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 115 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 116 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 117 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 118 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 119 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 120 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 121 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 122 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 123 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 124 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 125 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 126 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 127 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 128 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 129 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 130 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 131 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 132 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 133 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 134 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 135 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 136 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 137 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 138 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 139 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 140 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 141 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 142 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 143 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 144 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 145 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 146 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 147 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 148 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 149 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 150 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 151 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 152 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 153 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 154 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 155 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 156 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 157 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 158 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 159 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 160 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 161 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 162 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 163 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 164 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 165 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 166 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 167 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 168 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 169 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 170 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 171 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 172 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 173 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 174 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 175 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 176 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 177 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 178 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 179 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 180 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 181 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 182 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 183 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 184 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 185 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 186 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 187 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 188 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 189 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 190 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 191 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 192 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 193 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 194 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 195 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 196 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 197 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 198 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 199 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 200 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 201 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 202 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 203 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 204 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 205 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 206 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 207 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 208 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 209 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 210 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 211 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 212 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 213 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 214 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 215 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 216 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 217 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 218 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 219 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 220 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 221 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 222 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 223 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 224 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 225 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 226 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 227 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 228 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 229 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 230 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 231 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 232 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 233 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 234 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 235 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 236 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 237 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 238 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 239 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 240 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 241 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 242 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 243 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 244 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 245 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 246 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 247 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 248 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 249 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 250 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 251 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 252 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 253 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 254 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 255 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 256 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 257 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 258 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 259 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 260 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 261 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 262 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 263 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 264 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 265 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 266 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 267 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 268 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 269 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 270 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 271 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 272 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 273 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 274 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 275 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 276 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 277 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 278 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 279 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 280 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 281 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 282 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 283 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 284 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 285 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 286 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 287 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 288 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 289 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 290 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 291 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 292 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 293 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 294 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 295 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 296 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 297 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 298 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 299 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 300 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 301 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 302 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 303 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 304 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 305 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 306 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 307 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 308 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 309 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 310 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 311 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 312 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 313 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 314 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 315 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 316 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 317 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 318 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 319 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 320 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 321 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 322 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 323 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 324 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 325 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 326 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 327 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 328 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 329 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 330 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 331 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 332 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 333 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 334 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 335 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 336 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 337 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 338 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 339 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 340 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 341 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 342 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 343 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 344 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 345 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 346 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 347 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 348 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 349 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 350 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 351 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 352 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 353 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 354 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 355 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 356 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 357 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 358 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 359 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 360 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 361 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 362 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 363 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 364 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 365 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 366 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 367 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 368 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 369 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 370 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 371 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 372 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 373 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 374 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 375 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 376 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 377 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 378 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 379 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 380 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 381 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 382 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 383 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 384 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 385 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 386 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 387 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 388 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 389 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 390 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 391 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 392 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 393 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 394 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 395 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 396 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 397 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 398 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 399 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 400 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 401 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 402 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 403 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 404 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 405 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 406 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 407 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 408 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 409 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 410 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 411 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 412 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 413 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 414 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 415 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 416 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 417 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 418 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 419 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 420 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 421 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 422 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 423 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 424 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 425 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 426 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 427 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 428 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 429 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 430 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 431 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 432 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 433 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 434 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 435 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 436 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 437 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 438 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 439 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 440 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 441 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 442 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 443 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 444 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 445 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 446 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 447 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 448 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 449 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 450 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 451 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 452 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 453 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 454 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 455 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 456 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 457 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 458 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 459 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 460 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 461 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 462 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 463 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 464 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 465 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 466 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 467 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 468 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 469 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 470 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 471 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 472 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 473 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 474 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 475 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 476 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 477 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 478 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 479 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 480 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 481 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 482 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 483 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 484 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 485 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 486 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 487 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 488 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 489 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 490 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 491 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 492 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 493 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 494 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 495 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 496 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 497 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 498 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 499 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 500 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 501 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 502 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 503 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 504 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 505 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 506 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 507 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 508 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 509 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 510 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 511 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 512 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 513 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 514 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 515 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 516 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 517 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 518 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 519 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 520 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 521 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 522 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 523 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 524 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 525 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 526 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 527 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 528 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 529 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 530 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 531 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 532 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 533 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 534 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 535 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 536 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 537 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 538 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 539 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 540 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 541 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 542 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 543 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 544 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 545 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 546 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 547 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 548 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 549 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 550 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 551 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 552 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 553 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 554 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 555 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 556 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 557 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 558 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 559 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 560 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 561 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 562 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 563 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 564 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 565 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 566 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 567 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 568 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 569 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 570 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 571 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 572 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 573 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 574 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 575 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 576 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 577 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 578 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 579 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 580 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 581 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 582 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 583 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 584 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 585 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 586 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 587 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 588 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 589 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 590 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 591 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 592 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 593 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 594 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 595 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 596 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 597 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 598 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 599 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 600 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 601 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 602 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 603 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 604 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 605 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 606 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 607 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 608 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 609 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 610 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 611 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 612 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 613 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 614 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 615 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 616 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 617 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 618 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 619 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 620 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 621 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 622 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 623 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 624 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 625 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 626 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 627 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 628 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 629 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 630 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 631 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 632 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 633 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 634 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 635 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 636 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 637 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 638 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 639 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 640 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 641 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 642 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 643 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 644 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 645 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 646 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 647 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 648 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 649 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 650 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 651 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 652 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 653 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 654 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 655 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 656 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 657 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 658 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 659 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 660 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 661 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 662 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 663 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 664 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 665 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 666 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 667 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 668 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 669 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 670 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 671 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 672 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 673 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 674 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 675 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 676 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 677 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 678 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 679 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 680 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 681 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 682 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 683 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 684 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 685 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 686 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 687 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 688 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 689 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 690 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 691 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 692 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 693 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 694 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 695 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 696 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 697 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 698 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 699 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 700 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 701 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 702 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 703 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 704 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 705 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 706 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 707 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 708 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 709 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 710 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 711 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 712 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 713 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 714 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 715 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 716 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 717 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 718 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 719 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 720 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 721 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 722 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 723 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 724 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 725 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 726 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 727 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 728 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 729 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 730 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 731 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 732 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 733 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 734 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 735 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 736 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 737 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 738 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 739 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 740 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 741 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 742 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 743 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 744 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 745 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 746 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 747 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 748 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 749 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 750 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 751 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 752 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 753 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 754 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 755 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 756 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 757 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 758 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 759 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 760 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 761 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 762 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 763 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 764 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 765 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 766 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 767 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 768 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 769 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 770 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 771 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 772 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 773 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 774 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 775 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 776 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 777 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 778 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 779 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 780 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 781 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 782 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 783 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 784 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 785 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 786 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 787 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 788 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 789 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 790 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 791 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 792 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 793 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 794 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 795 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 796 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 797 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 798 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 799 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 800 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 801 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 802 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 803 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 804 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 805 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 806 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 807 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 808 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 809 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 810 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 811 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 812 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 813 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 814 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 815 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 816 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 817 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 818 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 819 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 820 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 821 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 822 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 823 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 824 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 825 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 826 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 827 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 828 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 829 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 830 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 831 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 832 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 833 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 834 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 835 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 836 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 837 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 838 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 839 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 840 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 841 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 842 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 843 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 844 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 845 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 846 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 847 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 848 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 849 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 850 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 851 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 852 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 853 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 854 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 855 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 856 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 857 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 858 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 859 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 860 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 861 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 862 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 863 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 864 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 865 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 866 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 867 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 868 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 869 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 870 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 871 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 872 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 873 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 874 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 875 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 876 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 877 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 878 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 879 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 880 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 881 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 882 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 883 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 884 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 885 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 886 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 887 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 888 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 889 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 890 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 891 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 892 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 893 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 894 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 895 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 896 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 897 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 898 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 899 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 900 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 901 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 902 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 903 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 904 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 905 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 906 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 907 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 908 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 909 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 910 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 911 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 912 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 913 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 914 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 915 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 916 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 917 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 918 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 919 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 920 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 921 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 922 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 923 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 924 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 925 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 926 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 927 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 928 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 929 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 930 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 931 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 932 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 933 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 934 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 935 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 936 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 937 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 938 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 939 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 940 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 941 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 942 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 943 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 944 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 945 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 946 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 947 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 948 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 949 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 950 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 951 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 952 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 953 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 954 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 955 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 956 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 957 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 958 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 959 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 960 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 961 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 962 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 963 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 964 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 965 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 966 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 967 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 968 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 969 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 970 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 971 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 972 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 973 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 974 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 975 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 976 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 977 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 978 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 979 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 980 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 981 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 982 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 983 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 984 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 985 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 986 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 987 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 988 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 989 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 990 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 991 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 992 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 993 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 994 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 995 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 996 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 997 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 998 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 999 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1000 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1001 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1002 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1003 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1004 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1005 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1006 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1007 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1008 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1009 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1010 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1011 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1012 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1013 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1014 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1015 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1016 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1017 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1018 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1019 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1020 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1021 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1022 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1023 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1024 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1025 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1026 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1027 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1028 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1029 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1030 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1031 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1032 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1033 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1034 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1035 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1036 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1037 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1038 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1039 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1040 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1041 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1042 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1043 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1044 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1045 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1046 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1047 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1048 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1049 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1050 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1051 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1052 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1053 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1054 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1055 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1056 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1057 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1058 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1059 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1060 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1061 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1062 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1063 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1064 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1065 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1066 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1067 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1068 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1069 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1070 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1071 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1072 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1073 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1074 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1075 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1076 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1077 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1078 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1079 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1080 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1081 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1082 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1083 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1084 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1085 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1086 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1087 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1088 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1089 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1090 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1091 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1092 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1093 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1094 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1095 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1096 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1097 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1098 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1099 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1100 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1101 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1102 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1103 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1104 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1105 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1106 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1107 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1108 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1109 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1110 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1111 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1112 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1113 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1114 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1115 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1116 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1117 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1118 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1119 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1120 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1121 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1122 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1123 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1124 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1125 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1126 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1127 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1128 :\n" +
+ " System.out.println(methodName + i);\n" +
+ " break;\n" +
+ " case 1129 :\n" +
+ " System.out.println(methodName + i);\n" +
" break;\n" +
" }\n" +
" } catch(Exception e) {\n" +
@@ -6096,15 +6096,15 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " {\n" +
- " for (boolean b : new boolean[] {}) {}\n" +
+ "public class X {\n" +
+ " {\n" +
+ " for (boolean b : new boolean[] {}) {}\n" +
" }\n" +
" public X() {}\n" +
" public X(boolean b) {}\n" +
- " public static void main(String[] args) {\n" +
+ " public static void main(String[] args) {\n" +
" System.out.print(\"SUCCESS\");\n" +
- " }\n" +
+ " }\n" +
"}",
},
"SUCCESS");
@@ -6115,17 +6115,17 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public String[][] foo(String s) {\n" +
- " return\n" +
- " new String[][] { {\" \", s != null ? s : \"\" },\n" +
- " {\" \", s != null ? s : \"\" },\n" +
- " {\" \", s != null ? s : \"\" },\n" +
- " {\" \", s != null ? s : \"\" } };\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
+ "public class X {\n" +
+ " public String[][] foo(String s) {\n" +
+ " return\n" +
+ " new String[][] { {\" \", s != null ? s : \"\" },\n" +
+ " {\" \", s != null ? s : \"\" },\n" +
+ " {\" \", s != null ? s : \"\" },\n" +
+ " {\" \", s != null ? s : \"\" } };\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " }\n" +
"}",
},
"SUCCESS");
@@ -6136,62 +6136,62 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"I.java",
- "public interface I {\n" +
- "\n" +
- " public Object foo();\n" +
- "\n" +
- " public static class B implements I {\n" +
- " public Object foo() {\n" +
- " return X.myI.foo();\n" +
- " }\n" +
- " }\n" +
+ "public interface I {\n" +
+ "\n" +
+ " public Object foo();\n" +
+ "\n" +
+ " public static class B implements I {\n" +
+ " public Object foo() {\n" +
+ " return X.myI.foo();\n" +
+ " }\n" +
+ " }\n" +
"}",
"X.java",
- "public class X {\n" +
- " public static final I myI = new I.B() {\n" +
- " int a = 0;\n" +
- " int b = 1;\n" +
- " };\n" +
- "\n" +
- " private Object bar2() {\n" +
- " return null;\n" +
- " }\n" +
- " private Object bar() {\n" +
- " Object o = bar2();\n" +
- " if (o != null) {\n" +
- " o.toString();\n" +
- " }\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
+ "public class X {\n" +
+ " public static final I myI = new I.B() {\n" +
+ " int a = 0;\n" +
+ " int b = 1;\n" +
+ " };\n" +
+ "\n" +
+ " private Object bar2() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " private Object bar() {\n" +
+ " Object o = bar2();\n" +
+ " if (o != null) {\n" +
+ " o.toString();\n" +
+ " }\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
"}",
},
"");
String expectedOutput =
- " // Method descriptor #23 ()Ljava/lang/Object;\n" +
- " // Stack: 1, Locals: 2\n" +
- " private java.lang.Object bar();\n" +
- " 0 aload_0 [this]\n" +
- " 1 " +
+ " // Method descriptor #23 ()Ljava/lang/Object;\n" +
+ " // Stack: 1, Locals: 2\n" +
+ " private java.lang.Object bar();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 " +
(isMinimumCompliant(ClassFileConstants.JDK11) ? "invokevirtual" : "invokespecial") +
- " X.bar2() : java.lang.Object [25]\n" +
- " 4 astore_1 [o]\n" +
- " 5 aload_1 [o]\n" +
- " 6 ifnull 14\n" +
- " 9 aload_1 [o]\n" +
- " 10 invokevirtual java.lang.Object.toString() : java.lang.String [27]\n" +
- " 13 pop\n" +
- " 14 aconst_null\n" +
- " 15 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 11]\n" +
- " [pc: 5, line: 12]\n" +
- " [pc: 9, line: 13]\n" +
- " [pc: 14, line: 15]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 16] local: this index: 0 type: X\n" +
- " [pc: 5, pc: 16] local: o index: 1 type: java.lang.Object\n" +
- " Stack map table: number of frames 1\n" +
+ " X.bar2() : java.lang.Object [25]\n" +
+ " 4 astore_1 [o]\n" +
+ " 5 aload_1 [o]\n" +
+ " 6 ifnull 14\n" +
+ " 9 aload_1 [o]\n" +
+ " 10 invokevirtual java.lang.Object.toString() : java.lang.String [27]\n" +
+ " 13 pop\n" +
+ " 14 aconst_null\n" +
+ " 15 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 11]\n" +
+ " [pc: 5, line: 12]\n" +
+ " [pc: 9, line: 13]\n" +
+ " [pc: 14, line: 15]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 16] local: this index: 0 type: X\n" +
+ " [pc: 5, pc: 16] local: o index: 1 type: java.lang.Object\n" +
+ " Stack map table: number of frames 1\n" +
" [pc: 14, append: {java.lang.Object}]\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
}
@@ -6200,66 +6200,66 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"I.java",
- "public interface I {\n" +
- "\n" +
- " public Object foo();\n" +
- "\n" +
- " public static class B implements I {\n" +
- " public Object foo() {\n" +
- " return String.valueOf(X.myI.foo()) + String.valueOf(X.myU.foo());\n" +
- " }\n" +
- " }\n" +
+ "public interface I {\n" +
+ "\n" +
+ " public Object foo();\n" +
+ "\n" +
+ " public static class B implements I {\n" +
+ " public Object foo() {\n" +
+ " return String.valueOf(X.myI.foo()) + String.valueOf(X.myU.foo());\n" +
+ " }\n" +
+ " }\n" +
"}",
"X.java",
- "public class X {\n" +
- " public static final I myI = new I.B() {\n" +
- " int a = 0;\n" +
- " int b = 1;\n" +
- " };\n" +
- " public static final I myU = new I.B() {\n" +
- " int a = 0;\n" +
- " int b = 1;\n" +
- " int c = 2;\n" +
+ "public class X {\n" +
+ " public static final I myI = new I.B() {\n" +
+ " int a = 0;\n" +
+ " int b = 1;\n" +
" };\n" +
- " private Object bar2() {\n" +
- " return null;\n" +
- " }\n" +
- " private Object bar() {\n" +
- " Object o = bar2();\n" +
- " if (o != null) {\n" +
- " o.toString();\n" +
- " }\n" +
- " return null;\n" +
- " }\n" +
+ " public static final I myU = new I.B() {\n" +
+ " int a = 0;\n" +
+ " int b = 1;\n" +
+ " int c = 2;\n" +
+ " };\n" +
+ " private Object bar2() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " private Object bar() {\n" +
+ " Object o = bar2();\n" +
+ " if (o != null) {\n" +
+ " o.toString();\n" +
+ " }\n" +
+ " return null;\n" +
+ " }\n" +
"}",
},
"");
-
+
String expectedOutput =
- " // Method descriptor #29 ()Ljava/lang/Object;\n" +
- " // Stack: 1, Locals: 2\n" +
- " private java.lang.Object bar();\n" +
- " 0 aload_0 [this]\n" +
- " 1 " +
+ " // Method descriptor #29 ()Ljava/lang/Object;\n" +
+ " // Stack: 1, Locals: 2\n" +
+ " private java.lang.Object bar();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 " +
(isMinimumCompliant(ClassFileConstants.JDK11) ? "invokevirtual" : "invokespecial") +
- " X.bar2() : java.lang.Object [31]\n" +
- " 4 astore_1 [o]\n" +
- " 5 aload_1 [o]\n" +
- " 6 ifnull 14\n" +
- " 9 aload_1 [o]\n" +
- " 10 invokevirtual java.lang.Object.toString() : java.lang.String [33]\n" +
- " 13 pop\n" +
- " 14 aconst_null\n" +
- " 15 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 15]\n" +
- " [pc: 5, line: 16]\n" +
- " [pc: 9, line: 17]\n" +
- " [pc: 14, line: 19]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 16] local: this index: 0 type: X\n" +
- " [pc: 5, pc: 16] local: o index: 1 type: java.lang.Object\n" +
- " Stack map table: number of frames 1\n" +
+ " X.bar2() : java.lang.Object [31]\n" +
+ " 4 astore_1 [o]\n" +
+ " 5 aload_1 [o]\n" +
+ " 6 ifnull 14\n" +
+ " 9 aload_1 [o]\n" +
+ " 10 invokevirtual java.lang.Object.toString() : java.lang.String [33]\n" +
+ " 13 pop\n" +
+ " 14 aconst_null\n" +
+ " 15 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 15]\n" +
+ " [pc: 5, line: 16]\n" +
+ " [pc: 9, line: 17]\n" +
+ " [pc: 14, line: 19]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 16] local: this index: 0 type: X\n" +
+ " [pc: 5, pc: 16] local: o index: 1 type: java.lang.Object\n" +
+ " Stack map table: number of frames 1\n" +
" [pc: 14, append: {java.lang.Object}]\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
}
@@ -6268,33 +6268,33 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " private static void foo(Class<?> c, int n) { }\n" +
- " public static void main(String... args) {\n" +
- " foo(Integer.class, (args == null ? -1 : 1));\n" +
- " }\n" +
+ "public class X {\n" +
+ " private static void foo(Class<?> c, int n) { }\n" +
+ " public static void main(String... args) {\n" +
+ " foo(Integer.class, (args == null ? -1 : 1));\n" +
+ " }\n" +
"}",
},
"");
-
+
String expectedOutput =
- " // Stack: 2, Locals: 1\n" +
- " public static void main(java.lang.String... args);\n" +
- " 0 ldc <Class java.lang.Integer> [26]\n" +
- " 2 aload_0 [args]\n" +
- " 3 ifnonnull 10\n" +
- " 6 iconst_m1\n" +
- " 7 goto 11\n" +
- " 10 iconst_1\n" +
- " 11 invokestatic X.foo(java.lang.Class, int) : void [28]\n" +
- " 14 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 4]\n" +
- " [pc: 14, line: 5]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 15] local: args index: 0 type: java.lang.String[]\n" +
- " Stack map table: number of frames 2\n" +
- " [pc: 10, same_locals_1_stack_item, stack: {java.lang.Class}]\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " public static void main(java.lang.String... args);\n" +
+ " 0 ldc <Class java.lang.Integer> [26]\n" +
+ " 2 aload_0 [args]\n" +
+ " 3 ifnonnull 10\n" +
+ " 6 iconst_m1\n" +
+ " 7 goto 11\n" +
+ " 10 iconst_1\n" +
+ " 11 invokestatic X.foo(java.lang.Class, int) : void [28]\n" +
+ " 14 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 4]\n" +
+ " [pc: 14, line: 5]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 15] local: args index: 0 type: java.lang.String[]\n" +
+ " Stack map table: number of frames 2\n" +
+ " [pc: 10, same_locals_1_stack_item, stack: {java.lang.Class}]\n" +
" [pc: 11, full, stack: {java.lang.Class, int}, locals: {java.lang.String[]}]\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
}
@@ -6304,145 +6304,145 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"ok\");\n" +
- " }\n" +
- " private static int willNotVerify() {\n" +
- " int limit = 100;\n" +
- " int match;\n" +
- " int result = 200;\n" +
- " do {\n" +
- " if (limit > 0) {\n" +
- " continue;\n" +
- " }\n" +
- " match = 0;\n" +
- " while (++match < 100) {\n" +
- " System.out.println();\n" +
- " }\n" +
- " } while (--limit != 0);\n" +
- " return result;\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"ok\");\n" +
+ " }\n" +
+ " private static int willNotVerify() {\n" +
+ " int limit = 100;\n" +
+ " int match;\n" +
+ " int result = 200;\n" +
+ " do {\n" +
+ " if (limit > 0) {\n" +
+ " continue;\n" +
+ " }\n" +
+ " match = 0;\n" +
+ " while (++match < 100) {\n" +
+ " System.out.println();\n" +
+ " }\n" +
+ " } while (--limit != 0);\n" +
+ " return result;\n" +
+ " }\n" +
"}",
},
"ok");
-
+
String expectedOutput =
- " // Method descriptor #33 ()I\n" +
- " // Stack: 2, Locals: 3\n" +
- " private static int willNotVerify();\n" +
- " 0 bipush 100\n" +
- " 2 istore_0 [limit]\n" +
- " 3 sipush 200\n" +
- " 6 istore_2 [result]\n" +
- " 7 iload_0 [limit]\n" +
- " 8 ifle 14\n" +
- " 11 goto 34\n" +
- " 14 iconst_0\n" +
- " 15 istore_1 [match]\n" +
- " 16 goto 25\n" +
- " 19 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 22 invokevirtual java.io.PrintStream.println() : void [34]\n" +
- " 25 iinc 1 1 [match]\n" +
- " 28 iload_1 [match]\n" +
- " 29 bipush 100\n" +
- " 31 if_icmplt 19\n" +
- " 34 iinc 0 -1 [limit]\n" +
- " 37 iload_0 [limit]\n" +
- " 38 ifne 7\n" +
- " 41 iload_2 [result]\n" +
- " 42 ireturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 6]\n" +
- " [pc: 3, line: 8]\n" +
- " [pc: 7, line: 10]\n" +
- " [pc: 11, line: 11]\n" +
- " [pc: 14, line: 13]\n" +
- " [pc: 16, line: 14]\n" +
- " [pc: 19, line: 15]\n" +
- " [pc: 25, line: 14]\n" +
- " [pc: 34, line: 17]\n" +
- " [pc: 41, line: 18]\n" +
- " Local variable table:\n" +
- " [pc: 3, pc: 43] local: limit index: 0 type: int\n" +
- " [pc: 16, pc: 34] local: match index: 1 type: int\n" +
- " [pc: 7, pc: 43] local: result index: 2 type: int\n" +
- " Stack map table: number of frames 5\n" +
- " [pc: 7, full, stack: {}, locals: {int, _, int}]\n" +
- " [pc: 14, same]\n" +
- " [pc: 19, full, stack: {}, locals: {int, int, int}]\n" +
- " [pc: 25, same]\n" +
+ " // Method descriptor #33 ()I\n" +
+ " // Stack: 2, Locals: 3\n" +
+ " private static int willNotVerify();\n" +
+ " 0 bipush 100\n" +
+ " 2 istore_0 [limit]\n" +
+ " 3 sipush 200\n" +
+ " 6 istore_2 [result]\n" +
+ " 7 iload_0 [limit]\n" +
+ " 8 ifle 14\n" +
+ " 11 goto 34\n" +
+ " 14 iconst_0\n" +
+ " 15 istore_1 [match]\n" +
+ " 16 goto 25\n" +
+ " 19 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 22 invokevirtual java.io.PrintStream.println() : void [34]\n" +
+ " 25 iinc 1 1 [match]\n" +
+ " 28 iload_1 [match]\n" +
+ " 29 bipush 100\n" +
+ " 31 if_icmplt 19\n" +
+ " 34 iinc 0 -1 [limit]\n" +
+ " 37 iload_0 [limit]\n" +
+ " 38 ifne 7\n" +
+ " 41 iload_2 [result]\n" +
+ " 42 ireturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 6]\n" +
+ " [pc: 3, line: 8]\n" +
+ " [pc: 7, line: 10]\n" +
+ " [pc: 11, line: 11]\n" +
+ " [pc: 14, line: 13]\n" +
+ " [pc: 16, line: 14]\n" +
+ " [pc: 19, line: 15]\n" +
+ " [pc: 25, line: 14]\n" +
+ " [pc: 34, line: 17]\n" +
+ " [pc: 41, line: 18]\n" +
+ " Local variable table:\n" +
+ " [pc: 3, pc: 43] local: limit index: 0 type: int\n" +
+ " [pc: 16, pc: 34] local: match index: 1 type: int\n" +
+ " [pc: 7, pc: 43] local: result index: 2 type: int\n" +
+ " Stack map table: number of frames 5\n" +
+ " [pc: 7, full, stack: {}, locals: {int, _, int}]\n" +
+ " [pc: 14, same]\n" +
+ " [pc: 19, full, stack: {}, locals: {int, int, int}]\n" +
+ " [pc: 25, same]\n" +
" [pc: 34, full, stack: {}, locals: {int, _, int}]\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=279183
public void test044() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"ok\");\n" +
- " }\n" +
- " private static int willNotVerify() {\n" +
- " int limit = 100;\n" +
- " int match;\n" +
- " int result = 200;\n" +
- " do {\n" +
- " if (limit > 0) {\n" +
- " continue;\n" +
- " }\n" +
- " match = 0;\n" +
- " while (++match < 100) {\n" +
- " // empty\n" +
- " }\n" +
- " } while (--limit != 0);\n" +
- " return result;\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"ok\");\n" +
+ " }\n" +
+ " private static int willNotVerify() {\n" +
+ " int limit = 100;\n" +
+ " int match;\n" +
+ " int result = 200;\n" +
+ " do {\n" +
+ " if (limit > 0) {\n" +
+ " continue;\n" +
+ " }\n" +
+ " match = 0;\n" +
+ " while (++match < 100) {\n" +
+ " // empty\n" +
+ " }\n" +
+ " } while (--limit != 0);\n" +
+ " return result;\n" +
+ " }\n" +
"}",
},
"ok");
-
+
String expectedOutput =
- " // Method descriptor #33 ()I\n" +
- " // Stack: 2, Locals: 3\n" +
- " private static int willNotVerify();\n" +
- " 0 bipush 100\n" +
- " 2 istore_0 [limit]\n" +
- " 3 sipush 200\n" +
- " 6 istore_2 [result]\n" +
- " 7 iload_0 [limit]\n" +
- " 8 ifle 14\n" +
- " 11 goto 25\n" +
- " 14 iconst_0\n" +
- " 15 istore_1 [match]\n" +
- " 16 iinc 1 1 [match]\n" +
- " 19 iload_1 [match]\n" +
- " 20 bipush 100\n" +
- " 22 if_icmplt 16\n" +
- " 25 iinc 0 -1 [limit]\n" +
- " 28 iload_0 [limit]\n" +
- " 29 ifne 7\n" +
- " 32 iload_2 [result]\n" +
- " 33 ireturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 6]\n" +
- " [pc: 3, line: 8]\n" +
- " [pc: 7, line: 10]\n" +
- " [pc: 11, line: 11]\n" +
- " [pc: 14, line: 13]\n" +
- " [pc: 16, line: 14]\n" +
- " [pc: 25, line: 17]\n" +
- " [pc: 32, line: 18]\n" +
- " Local variable table:\n" +
- " [pc: 3, pc: 34] local: limit index: 0 type: int\n" +
- " [pc: 16, pc: 25] local: match index: 1 type: int\n" +
- " [pc: 7, pc: 34] local: result index: 2 type: int\n" +
- " Stack map table: number of frames 4\n" +
- " [pc: 7, full, stack: {}, locals: {int, _, int}]\n" +
- " [pc: 14, same]\n" +
- " [pc: 16, full, stack: {}, locals: {int, int, int}]\n" +
+ " // Method descriptor #33 ()I\n" +
+ " // Stack: 2, Locals: 3\n" +
+ " private static int willNotVerify();\n" +
+ " 0 bipush 100\n" +
+ " 2 istore_0 [limit]\n" +
+ " 3 sipush 200\n" +
+ " 6 istore_2 [result]\n" +
+ " 7 iload_0 [limit]\n" +
+ " 8 ifle 14\n" +
+ " 11 goto 25\n" +
+ " 14 iconst_0\n" +
+ " 15 istore_1 [match]\n" +
+ " 16 iinc 1 1 [match]\n" +
+ " 19 iload_1 [match]\n" +
+ " 20 bipush 100\n" +
+ " 22 if_icmplt 16\n" +
+ " 25 iinc 0 -1 [limit]\n" +
+ " 28 iload_0 [limit]\n" +
+ " 29 ifne 7\n" +
+ " 32 iload_2 [result]\n" +
+ " 33 ireturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 6]\n" +
+ " [pc: 3, line: 8]\n" +
+ " [pc: 7, line: 10]\n" +
+ " [pc: 11, line: 11]\n" +
+ " [pc: 14, line: 13]\n" +
+ " [pc: 16, line: 14]\n" +
+ " [pc: 25, line: 17]\n" +
+ " [pc: 32, line: 18]\n" +
+ " Local variable table:\n" +
+ " [pc: 3, pc: 34] local: limit index: 0 type: int\n" +
+ " [pc: 16, pc: 25] local: match index: 1 type: int\n" +
+ " [pc: 7, pc: 34] local: result index: 2 type: int\n" +
+ " Stack map table: number of frames 4\n" +
+ " [pc: 7, full, stack: {}, locals: {int, _, int}]\n" +
+ " [pc: 14, same]\n" +
+ " [pc: 16, full, stack: {}, locals: {int, int, int}]\n" +
" [pc: 25, full, stack: {}, locals: {int, _, int}]\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
}
@@ -6451,54 +6451,54 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String args[]) {\n" +
- " int i;\n" +
- " do {\n" +
- " } while ((i = 2) < 0);\n" +
- " if (i != 2) {\n" +
- " System.out.println(\"FAILED\");\n" +
- " } else {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String args[]) {\n" +
+ " int i;\n" +
+ " do {\n" +
+ " } while ((i = 2) < 0);\n" +
+ " if (i != 2) {\n" +
+ " System.out.println(\"FAILED\");\n" +
+ " } else {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " }\n" +
+ " }\n" +
"}",
},
"SUCCESS");
-
+
String expectedOutput =
- " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
- " // Stack: 2, Locals: 2\n" +
- " public static void main(java.lang.String[] args);\n" +
- " 0 iconst_2\n" +
- " 1 dup\n" +
- " 2 istore_1 [i]\n" +
- " 3 iflt 0\n" +
- " 6 iload_1 [i]\n" +
- " 7 iconst_2\n" +
- " 8 if_icmpeq 22\n" +
- " 11 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 14 ldc <String \"FAILED\"> [22]\n" +
- " 16 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n" +
- " 19 goto 30\n" +
- " 22 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 25 ldc <String \"SUCCESS\"> [30]\n" +
- " 27 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n" +
- " 30 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 5]\n" +
- " [pc: 3, line: 4]\n" +
- " [pc: 6, line: 6]\n" +
- " [pc: 11, line: 7]\n" +
- " [pc: 19, line: 8]\n" +
- " [pc: 22, line: 9]\n" +
- " [pc: 30, line: 11]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 31] local: args index: 0 type: java.lang.String[]\n" +
- " [pc: 3, pc: 31] local: i index: 1 type: int\n" +
- " Stack map table: number of frames 3\n" +
- " [pc: 0, same]\n" +
- " [pc: 22, append: {int}]\n" +
+ " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
+ " // Stack: 2, Locals: 2\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 iconst_2\n" +
+ " 1 dup\n" +
+ " 2 istore_1 [i]\n" +
+ " 3 iflt 0\n" +
+ " 6 iload_1 [i]\n" +
+ " 7 iconst_2\n" +
+ " 8 if_icmpeq 22\n" +
+ " 11 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 14 ldc <String \"FAILED\"> [22]\n" +
+ " 16 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n" +
+ " 19 goto 30\n" +
+ " 22 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 25 ldc <String \"SUCCESS\"> [30]\n" +
+ " 27 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n" +
+ " 30 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 5]\n" +
+ " [pc: 3, line: 4]\n" +
+ " [pc: 6, line: 6]\n" +
+ " [pc: 11, line: 7]\n" +
+ " [pc: 19, line: 8]\n" +
+ " [pc: 22, line: 9]\n" +
+ " [pc: 30, line: 11]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 31] local: args index: 0 type: java.lang.String[]\n" +
+ " [pc: 3, pc: 31] local: i index: 1 type: int\n" +
+ " Stack map table: number of frames 3\n" +
+ " [pc: 0, same]\n" +
+ " [pc: 22, append: {int}]\n" +
" [pc: 30, same]\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
}
@@ -6509,31 +6509,31 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " class E1 extends RuntimeException {\n" +
- " private static final long serialVersionUID = 1L;\n" +
- " }\n" +
- " static Object bar() {\n" +
- " return new Object() {\n" +
- " public void foo() {\n" +
- " if (condition())\n" +
- " throw new E1();\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " static boolean condition() {\n" +
- " return false;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- "}\n" +
+ "public class X {\n" +
+ " class E1 extends RuntimeException {\n" +
+ " private static final long serialVersionUID = 1L;\n" +
+ " }\n" +
+ " static Object bar() {\n" +
+ " return new Object() {\n" +
+ " public void foo() {\n" +
+ " if (condition())\n" +
+ " throw new E1();\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
+ " static boolean condition() {\n" +
+ " return false;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
+ "}\n" +
"",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " throw new E1();\n" +
- " ^^^^^^^^\n" +
- "No enclosing instance of type X is accessible. Must qualify the allocation with an enclosing instance of type X (e.g. x.new A() where x is an instance of X).\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " throw new E1();\n" +
+ " ^^^^^^^^\n" +
+ "No enclosing instance of type X is accessible. Must qualify the allocation with an enclosing instance of type X (e.g. x.new A() where x is an instance of X).\n" +
"----------\n",
null,
true,
@@ -6544,25 +6544,25 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void test() {\n" +
- " final boolean x = true;\n" +
- " new Runnable() {\n" +
- " @Override\n" +
- " public void run() {\n" +
- " synchronized (X.this) {\n" +
- " System.out.println(x);\n" +
- " }\n" +
- " }\n" +
- " };\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void test() {\n" +
+ " final boolean x = true;\n" +
+ " new Runnable() {\n" +
+ " @Override\n" +
+ " public void run() {\n" +
+ " synchronized (X.this) {\n" +
+ " System.out.println(x);\n" +
+ " }\n" +
+ " }\n" +
+ " };\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " synchronized (X.this) {\n" +
- " ^^^^^^\n" +
- "No enclosing instance of the type X is accessible in scope\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " synchronized (X.this) {\n" +
+ " ^^^^^^\n" +
+ "No enclosing instance of the type X is accessible in scope\n" +
"----------\n");
}
@@ -6591,72 +6591,72 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "import java.io.IOException;\n" +
- "import java.io.InputStream;\n" +
- "\n" +
- "public class X implements Runnable {\n" +
- "\n" +
- " private boolean contentEquals(final String src, final String tar)\n" +
- " throws IOException {\n" +
- " if (src == null && tar == null) {\n" +
- " return true;\n" +
- " }\n" +
- " if (!isFile(src) || !isFile(tar))\n" +
- " throw new IOException(\"cannot compare non-files\");\n" +
- " if (size(src) != size(tar))\n" +
- " return false;\n" +
- " final byte[] baSrc = new byte[8192];\n" +
- " final byte[] baTar = new byte[baSrc.length];\n" +
- " int lrSrc;\n" +
- " int lrTar;\n" +
- " InputStream isSrc = null;\n" +
- " InputStream isTar = null;\n" +
- " try {\n" +
- " isSrc = newInputStream(src);\n" +
- " if (isSrc == null)\n" +
- " return false;\n" +
- " isTar = newInputStream(tar);\n" +
- " if (isTar == null)\n" +
- " return false;\n" +
- " do {\n" +
- " lrSrc = isSrc.read(baSrc);\n" +
- " lrTar = isTar.read(baTar);\n" +
- " if (lrSrc != lrTar)\n" +
- " return false;\n" +
- " for (int i = 0; i < lrSrc; i++)\n" +
- " if (baSrc[i] != baTar[i])\n" +
- " return false;\n" +
- " } while ((lrSrc >= 0) && (lrSrc == lrTar));\n" +
- " } finally {\n" +
- " try {\n" +
- " close(isSrc);\n" +
- " } finally {\n" +
- " close(isTar);\n" +
- " }\n" +
- " }\n" +
- " return true;\n" +
- " }\n" +
- " private void close(final InputStream isSrc) {\n" +
- " }\n" +
- " private boolean isFile(final String src) {\n" +
- " return false;\n" +
- " }\n" +
- " public void run() {\n" +
- " try {\n" +
- " System.out.println(contentEquals(null, null));\n" +
- " } catch (final IOException e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
+ "import java.io.IOException;\n" +
+ "import java.io.InputStream;\n" +
+ "\n" +
+ "public class X implements Runnable {\n" +
+ "\n" +
+ " private boolean contentEquals(final String src, final String tar)\n" +
+ " throws IOException {\n" +
+ " if (src == null && tar == null) {\n" +
+ " return true;\n" +
+ " }\n" +
+ " if (!isFile(src) || !isFile(tar))\n" +
+ " throw new IOException(\"cannot compare non-files\");\n" +
+ " if (size(src) != size(tar))\n" +
+ " return false;\n" +
+ " final byte[] baSrc = new byte[8192];\n" +
+ " final byte[] baTar = new byte[baSrc.length];\n" +
+ " int lrSrc;\n" +
+ " int lrTar;\n" +
+ " InputStream isSrc = null;\n" +
+ " InputStream isTar = null;\n" +
+ " try {\n" +
+ " isSrc = newInputStream(src);\n" +
+ " if (isSrc == null)\n" +
+ " return false;\n" +
+ " isTar = newInputStream(tar);\n" +
+ " if (isTar == null)\n" +
+ " return false;\n" +
+ " do {\n" +
+ " lrSrc = isSrc.read(baSrc);\n" +
+ " lrTar = isTar.read(baTar);\n" +
+ " if (lrSrc != lrTar)\n" +
+ " return false;\n" +
+ " for (int i = 0; i < lrSrc; i++)\n" +
+ " if (baSrc[i] != baTar[i])\n" +
+ " return false;\n" +
+ " } while ((lrSrc >= 0) && (lrSrc == lrTar));\n" +
+ " } finally {\n" +
+ " try {\n" +
+ " close(isSrc);\n" +
+ " } finally {\n" +
+ " close(isTar);\n" +
+ " }\n" +
+ " }\n" +
+ " return true;\n" +
+ " }\n" +
+ " private void close(final InputStream isSrc) {\n" +
+ " }\n" +
+ " private boolean isFile(final String src) {\n" +
+ " return false;\n" +
+ " }\n" +
+ " public void run() {\n" +
+ " try {\n" +
+ " System.out.println(contentEquals(null, null));\n" +
+ " } catch (final IOException e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
" }\n" +
" static InputStream newInputStream(String path) {\n" +
" return null;\n" +
- " }\n" +
+ " }\n" +
" static int size(String path) {\n" +
" return 0;\n" +
- " }\n" +
- " public static void main(final String[] args) {\n" +
- " new X().run();\n" +
- " }\n" +
+ " }\n" +
+ " public static void main(final String[] args) {\n" +
+ " new X().run();\n" +
+ " }\n" +
"}"
},
"true");
@@ -6666,50 +6666,50 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "import java.io.File;\n" +
- "import java.io.FileFilter;\n" +
- "import java.io.FileNotFoundException;\n" +
- "import java.io.IOException;\n" +
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "\n" +
- "public class X {\n" +
- "\n" +
- " public static final List<File> copyDir(List<File> lf,\n" +
- " final boolean overwrite, final boolean recursive,\n" +
- " final boolean returnSrc, final File src, final File tar,\n" +
- " final FileFilter filter) throws IOException {\n" +
- " if (!src.isDirectory())\n" +
- " throw new FileNotFoundException(\"not a directory: \" + src);\n" +
- " if (!tar.isDirectory())\n" +
- " throw new FileNotFoundException(\"not a directory: \" + tar);\n" +
- " final File[] fa = src.listFiles();\n" +
- " if (fa == null)\n" +
- " throw new FileNotFoundException(\"directory not accessible: \" + src);\n" +
- " if (lf == null)\n" +
- " lf = new ArrayList<File>(fa.length);\n" +
- " for (final File f : fa) {\n" +
- " final File right = new File(tar, f.getName());\n" +
- " if (f.isDirectory()) {\n" +
- " if (recursive && filter.accept(f)) {\n" +
- " if (!right.exists())\n" +
- " right.mkdir();\n" +
- " copyDir(lf, overwrite, recursive, returnSrc, f, right,\n" +
- " filter);\n" +
- " }\n" +
- " } else {\n" +
- " if (overwrite || (!right.exists() && filter.accept(f))) {\n" +
- " lf.add(returnSrc ? f : right);\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " return lf;\n" +
- " }\n" +
- "\n" +
- " public static void main(final String[] args) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "\n" +
+ "import java.io.File;\n" +
+ "import java.io.FileFilter;\n" +
+ "import java.io.FileNotFoundException;\n" +
+ "import java.io.IOException;\n" +
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class X {\n" +
+ "\n" +
+ " public static final List<File> copyDir(List<File> lf,\n" +
+ " final boolean overwrite, final boolean recursive,\n" +
+ " final boolean returnSrc, final File src, final File tar,\n" +
+ " final FileFilter filter) throws IOException {\n" +
+ " if (!src.isDirectory())\n" +
+ " throw new FileNotFoundException(\"not a directory: \" + src);\n" +
+ " if (!tar.isDirectory())\n" +
+ " throw new FileNotFoundException(\"not a directory: \" + tar);\n" +
+ " final File[] fa = src.listFiles();\n" +
+ " if (fa == null)\n" +
+ " throw new FileNotFoundException(\"directory not accessible: \" + src);\n" +
+ " if (lf == null)\n" +
+ " lf = new ArrayList<File>(fa.length);\n" +
+ " for (final File f : fa) {\n" +
+ " final File right = new File(tar, f.getName());\n" +
+ " if (f.isDirectory()) {\n" +
+ " if (recursive && filter.accept(f)) {\n" +
+ " if (!right.exists())\n" +
+ " right.mkdir();\n" +
+ " copyDir(lf, overwrite, recursive, returnSrc, f, right,\n" +
+ " filter);\n" +
+ " }\n" +
+ " } else {\n" +
+ " if (overwrite || (!right.exists() && filter.accept(f))) {\n" +
+ " lf.add(returnSrc ? f : right);\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " return lf;\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(final String[] args) {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " }\n" +
+ "\n" +
"}"
},
"SUCCESS");
@@ -6719,31 +6719,31 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "import java.io.File;\n" +
- "import java.io.IOException;\n" +
- "import java.util.List;\n" +
- "\n" +
- "public class X {\n" +
- "\n" +
- " public static final List<File> copyDir(int j, List<File> lf,\n" +
- " final boolean returnSrc, final File[] fa) throws IOException {\n" +
- " if (lf == null)\n" +
- " lf = null;\n" +
- " for (int i = 0, max = fa.length; i < max; i++) {\n" +
- " final File f = fa[i];\n" +
- " final File right = new File(f.getName());\n" +
- " if (f.isDirectory()) {\n" +
- " } else {\n" +
- " lf.add(returnSrc ? f : right);\n" +
- " }\n" +
- " }\n" +
- " return lf;\n" +
- " }\n" +
- "\n" +
- " public static void main(final String[] args) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "\n" +
+ "import java.io.File;\n" +
+ "import java.io.IOException;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class X {\n" +
+ "\n" +
+ " public static final List<File> copyDir(int j, List<File> lf,\n" +
+ " final boolean returnSrc, final File[] fa) throws IOException {\n" +
+ " if (lf == null)\n" +
+ " lf = null;\n" +
+ " for (int i = 0, max = fa.length; i < max; i++) {\n" +
+ " final File f = fa[i];\n" +
+ " final File right = new File(f.getName());\n" +
+ " if (f.isDirectory()) {\n" +
+ " } else {\n" +
+ " lf.add(returnSrc ? f : right);\n" +
+ " }\n" +
+ " }\n" +
+ " return lf;\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(final String[] args) {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " }\n" +
+ "\n" +
"}"
},
"SUCCESS");
@@ -6771,25 +6771,25 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " static {\n" +
- " for(int i = 0; i < 10; i++){\n" +
- " A a = new A();\n" +
- " a.foo();\n" +
- " }\n" +
- " }\n" +
- " private class A {\n" +
- " private A() {\n" +
- " }\n" +
- " void foo() {}\n" +
- " }\n" +
+ "public class X {\n" +
+ " static {\n" +
+ " for(int i = 0; i < 10; i++){\n" +
+ " A a = new A();\n" +
+ " a.foo();\n" +
+ " }\n" +
+ " }\n" +
+ " private class A {\n" +
+ " private A() {\n" +
+ " }\n" +
+ " void foo() {}\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " A a = new A();\n" +
- " ^^^^^^^\n" +
- "No enclosing instance of type X is accessible. Must qualify the allocation with an enclosing instance of type X (e.g. x.new A() where x is an instance of X).\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " A a = new A();\n" +
+ " ^^^^^^^\n" +
+ "No enclosing instance of type X is accessible. Must qualify the allocation with an enclosing instance of type X (e.g. x.new A() where x is an instance of X).\n" +
"----------\n",
null,
true,
@@ -6819,7 +6819,7 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
},
"SUCCESS");
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=359495
public void testBug359495a() throws Exception {
this.runConformTest(
@@ -6856,62 +6856,62 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
- " // Stack: 2, Locals: 6\n" +
- " public static void main(java.lang.String[] args);\n" +
- " 0 new java.util.concurrent.locks.ReentrantLock [16]\n" +
- " 3 dup\n" +
- " 4 invokespecial java.util.concurrent.locks.ReentrantLock() [18]\n" +
- " 7 astore_1 [lock]\n" +
- " 8 aload_0 [args]\n" +
- " 9 invokestatic java.util.Arrays.asList(java.lang.Object[]) : java.util.List [19]\n" +
- " 12 astore_2 [strings]\n" +
- " 13 aload_1 [lock]\n" +
- " 14 invokeinterface java.util.concurrent.locks.Lock.lock() : void [25] [nargs: 1]\n" +
- " 19 aload_2 [strings]\n" +
- " 20 invokeinterface java.util.List.iterator() : java.util.Iterator [30] [nargs: 1]\n" +
- " 25 astore 4\n" +
- " 27 aload 4\n" +
- " 29 invokeinterface java.util.Iterator.hasNext() : boolean [36] [nargs: 1]\n" +
- " 34 ifeq 55\n" +
- " 37 aload 4\n" +
- " 39 invokeinterface java.util.Iterator.next() : java.lang.Object [42] [nargs: 1]\n" +
- " 44 checkcast java.lang.String [46]\n" +
- " 47 astore_3 [string]\n" +
- " 48 aload_1 [lock]\n" +
- " 49 invokeinterface java.util.concurrent.locks.Lock.unlock() : void [48] [nargs: 1]\n" +
- " 54 return\n" +
- " 55 aload_1 [lock]\n" +
- " 56 invokeinterface java.util.concurrent.locks.Lock.unlock() : void [48] [nargs: 1]\n" +
- " 61 return\n" +
- " 62 astore 5\n" +
- " 64 aload_1 [lock]\n" +
- " 65 invokeinterface java.util.concurrent.locks.Lock.unlock() : void [48] [nargs: 1]\n" +
- " 70 aload 5\n" +
- " 72 athrow\n" +
- " Exception Table:\n" +
- " [pc: 19, pc: 48] -> 62 when : any\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 7]\n" +
- " [pc: 8, line: 8]\n" +
- " [pc: 13, line: 9]\n" +
- " [pc: 19, line: 11]\n" +
- " [pc: 48, line: 16]\n" +
- " [pc: 54, line: 12]\n" +
- " [pc: 55, line: 16]\n" +
- " [pc: 61, line: 14]\n" +
- " [pc: 62, line: 15]\n" +
- " [pc: 64, line: 16]\n" +
- " [pc: 70, line: 17]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 73] local: args index: 0 type: java.lang.String[]\n" +
- " [pc: 8, pc: 73] local: lock index: 1 type: java.util.concurrent.locks.Lock\n" +
- " [pc: 13, pc: 73] local: strings index: 2 type: java.util.List\n" +
- " [pc: 48, pc: 55] local: string index: 3 type: java.lang.String\n" +
- " Local variable type table:\n" +
- " [pc: 13, pc: 73] local: strings index: 2 type: java.util.List<java.lang.String>\n" +
- " Stack map table: number of frames 2\n" +
- " [pc: 55, append: {java.util.concurrent.locks.Lock, java.util.List}]\n" +
+ " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
+ " // Stack: 2, Locals: 6\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 new java.util.concurrent.locks.ReentrantLock [16]\n" +
+ " 3 dup\n" +
+ " 4 invokespecial java.util.concurrent.locks.ReentrantLock() [18]\n" +
+ " 7 astore_1 [lock]\n" +
+ " 8 aload_0 [args]\n" +
+ " 9 invokestatic java.util.Arrays.asList(java.lang.Object[]) : java.util.List [19]\n" +
+ " 12 astore_2 [strings]\n" +
+ " 13 aload_1 [lock]\n" +
+ " 14 invokeinterface java.util.concurrent.locks.Lock.lock() : void [25] [nargs: 1]\n" +
+ " 19 aload_2 [strings]\n" +
+ " 20 invokeinterface java.util.List.iterator() : java.util.Iterator [30] [nargs: 1]\n" +
+ " 25 astore 4\n" +
+ " 27 aload 4\n" +
+ " 29 invokeinterface java.util.Iterator.hasNext() : boolean [36] [nargs: 1]\n" +
+ " 34 ifeq 55\n" +
+ " 37 aload 4\n" +
+ " 39 invokeinterface java.util.Iterator.next() : java.lang.Object [42] [nargs: 1]\n" +
+ " 44 checkcast java.lang.String [46]\n" +
+ " 47 astore_3 [string]\n" +
+ " 48 aload_1 [lock]\n" +
+ " 49 invokeinterface java.util.concurrent.locks.Lock.unlock() : void [48] [nargs: 1]\n" +
+ " 54 return\n" +
+ " 55 aload_1 [lock]\n" +
+ " 56 invokeinterface java.util.concurrent.locks.Lock.unlock() : void [48] [nargs: 1]\n" +
+ " 61 return\n" +
+ " 62 astore 5\n" +
+ " 64 aload_1 [lock]\n" +
+ " 65 invokeinterface java.util.concurrent.locks.Lock.unlock() : void [48] [nargs: 1]\n" +
+ " 70 aload 5\n" +
+ " 72 athrow\n" +
+ " Exception Table:\n" +
+ " [pc: 19, pc: 48] -> 62 when : any\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 7]\n" +
+ " [pc: 8, line: 8]\n" +
+ " [pc: 13, line: 9]\n" +
+ " [pc: 19, line: 11]\n" +
+ " [pc: 48, line: 16]\n" +
+ " [pc: 54, line: 12]\n" +
+ " [pc: 55, line: 16]\n" +
+ " [pc: 61, line: 14]\n" +
+ " [pc: 62, line: 15]\n" +
+ " [pc: 64, line: 16]\n" +
+ " [pc: 70, line: 17]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 73] local: args index: 0 type: java.lang.String[]\n" +
+ " [pc: 8, pc: 73] local: lock index: 1 type: java.util.concurrent.locks.Lock\n" +
+ " [pc: 13, pc: 73] local: strings index: 2 type: java.util.List\n" +
+ " [pc: 48, pc: 55] local: string index: 3 type: java.lang.String\n" +
+ " Local variable type table:\n" +
+ " [pc: 13, pc: 73] local: strings index: 2 type: java.util.List<java.lang.String>\n" +
+ " Stack map table: number of frames 2\n" +
+ " [pc: 55, append: {java.util.concurrent.locks.Lock, java.util.List}]\n" +
" [pc: 62, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n" ;
int index = actualOutput.indexOf(expectedOutput);
@@ -6922,7 +6922,7 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
assertEquals("Wrong contents", expectedOutput, actualOutput);
}
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=359495
public void testBug359495b() throws Exception {
this.runConformTest(
@@ -6960,58 +6960,58 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
- " // Stack: 2, Locals: 5\n" +
- " public static void main(java.lang.String[] args);\n" +
- " 0 new java.util.concurrent.locks.ReentrantLock [16]\n" +
- " 3 dup\n" +
- " 4 invokespecial java.util.concurrent.locks.ReentrantLock() [18]\n" +
- " 7 astore_1 [lock]\n" +
- " 8 aload_0 [args]\n" +
- " 9 invokestatic java.util.Arrays.asList(java.lang.Object[]) : java.util.List [19]\n" +
- " 12 astore_2 [strings]\n" +
- " 13 aload_1 [lock]\n" +
- " 14 invokeinterface java.util.concurrent.locks.Lock.lock() : void [25] [nargs: 1]\n" +
- " 19 aload_2 [strings]\n" +
- " 20 invokeinterface java.util.List.iterator() : java.util.Iterator [30] [nargs: 1]\n" +
- " 25 astore_3 [i]\n" +
- " 26 aload_3 [i]\n" +
- " 27 invokeinterface java.util.Iterator.hasNext() : boolean [36] [nargs: 1]\n" +
- " 32 ifeq 42\n" +
- " 35 aload_1 [lock]\n" +
- " 36 invokeinterface java.util.concurrent.locks.Lock.unlock() : void [42] [nargs: 1]\n" +
- " 41 return\n" +
- " 42 aload_1 [lock]\n" +
- " 43 invokeinterface java.util.concurrent.locks.Lock.unlock() : void [42] [nargs: 1]\n" +
- " 48 return\n" +
- " 49 astore 4\n" +
- " 51 aload_1 [lock]\n" +
- " 52 invokeinterface java.util.concurrent.locks.Lock.unlock() : void [42] [nargs: 1]\n" +
- " 57 aload 4\n" +
- " 59 athrow\n" +
- " Exception Table:\n" +
- " [pc: 19, pc: 35] -> 49 when : any\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 8]\n" +
- " [pc: 8, line: 9]\n" +
- " [pc: 13, line: 10]\n" +
- " [pc: 19, line: 12]\n" +
- " [pc: 35, line: 17]\n" +
- " [pc: 41, line: 13]\n" +
- " [pc: 42, line: 17]\n" +
- " [pc: 48, line: 15]\n" +
- " [pc: 49, line: 16]\n" +
- " [pc: 51, line: 17]\n" +
- " [pc: 57, line: 18]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 60] local: args index: 0 type: java.lang.String[]\n" +
- " [pc: 8, pc: 60] local: lock index: 1 type: java.util.concurrent.locks.Lock\n" +
- " [pc: 13, pc: 60] local: strings index: 2 type: java.util.List\n" +
- " [pc: 26, pc: 42] local: i index: 3 type: java.util.Iterator\n" +
- " Local variable type table:\n" +
- " [pc: 13, pc: 60] local: strings index: 2 type: java.util.List<java.lang.String>\n" +
- " Stack map table: number of frames 2\n" +
- " [pc: 42, append: {java.util.concurrent.locks.Lock, java.util.List}]\n" +
+ " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
+ " // Stack: 2, Locals: 5\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 new java.util.concurrent.locks.ReentrantLock [16]\n" +
+ " 3 dup\n" +
+ " 4 invokespecial java.util.concurrent.locks.ReentrantLock() [18]\n" +
+ " 7 astore_1 [lock]\n" +
+ " 8 aload_0 [args]\n" +
+ " 9 invokestatic java.util.Arrays.asList(java.lang.Object[]) : java.util.List [19]\n" +
+ " 12 astore_2 [strings]\n" +
+ " 13 aload_1 [lock]\n" +
+ " 14 invokeinterface java.util.concurrent.locks.Lock.lock() : void [25] [nargs: 1]\n" +
+ " 19 aload_2 [strings]\n" +
+ " 20 invokeinterface java.util.List.iterator() : java.util.Iterator [30] [nargs: 1]\n" +
+ " 25 astore_3 [i]\n" +
+ " 26 aload_3 [i]\n" +
+ " 27 invokeinterface java.util.Iterator.hasNext() : boolean [36] [nargs: 1]\n" +
+ " 32 ifeq 42\n" +
+ " 35 aload_1 [lock]\n" +
+ " 36 invokeinterface java.util.concurrent.locks.Lock.unlock() : void [42] [nargs: 1]\n" +
+ " 41 return\n" +
+ " 42 aload_1 [lock]\n" +
+ " 43 invokeinterface java.util.concurrent.locks.Lock.unlock() : void [42] [nargs: 1]\n" +
+ " 48 return\n" +
+ " 49 astore 4\n" +
+ " 51 aload_1 [lock]\n" +
+ " 52 invokeinterface java.util.concurrent.locks.Lock.unlock() : void [42] [nargs: 1]\n" +
+ " 57 aload 4\n" +
+ " 59 athrow\n" +
+ " Exception Table:\n" +
+ " [pc: 19, pc: 35] -> 49 when : any\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 8]\n" +
+ " [pc: 8, line: 9]\n" +
+ " [pc: 13, line: 10]\n" +
+ " [pc: 19, line: 12]\n" +
+ " [pc: 35, line: 17]\n" +
+ " [pc: 41, line: 13]\n" +
+ " [pc: 42, line: 17]\n" +
+ " [pc: 48, line: 15]\n" +
+ " [pc: 49, line: 16]\n" +
+ " [pc: 51, line: 17]\n" +
+ " [pc: 57, line: 18]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 60] local: args index: 0 type: java.lang.String[]\n" +
+ " [pc: 8, pc: 60] local: lock index: 1 type: java.util.concurrent.locks.Lock\n" +
+ " [pc: 13, pc: 60] local: strings index: 2 type: java.util.List\n" +
+ " [pc: 26, pc: 42] local: i index: 3 type: java.util.Iterator\n" +
+ " Local variable type table:\n" +
+ " [pc: 13, pc: 60] local: strings index: 2 type: java.util.List<java.lang.String>\n" +
+ " Stack map table: number of frames 2\n" +
+ " [pc: 42, append: {java.util.concurrent.locks.Lock, java.util.List}]\n" +
" [pc: 49, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n";
int index = actualOutput.indexOf(expectedOutput);
@@ -7028,14 +7028,14 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " testError(3, 4, \"d\");\n" +
- " }\n" +
- " public static void testError(Number n0, Number n1, String refValue) {\n" +
- " Number result = refValue.equals(\"ttt\") ? n0 : (n1 == null ? null : n1.intValue());\n" +
- " System.out.println(String.valueOf(result));\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " testError(3, 4, \"d\");\n" +
+ " }\n" +
+ " public static void testError(Number n0, Number n1, String refValue) {\n" +
+ " Number result = refValue.equals(\"ttt\") ? n0 : (n1 == null ? null : n1.intValue());\n" +
+ " System.out.println(String.valueOf(result));\n" +
+ " }\n" +
"}",
},
"4");
@@ -7049,40 +7049,40 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " // Method descriptor #27 (Ljava/lang/Number;Ljava/lang/Number;Ljava/lang/String;)V\n" +
- " // Stack: 2, Locals: 4\n" +
- " public static void testError(java.lang.Number n0, java.lang.Number n1, java.lang.String refValue);\n" +
- " 0 aload_2 [refValue]\n" +
- " 1 ldc <String \"ttt\"> [30]\n" +
- " 3 invokevirtual java.lang.String.equals(java.lang.Object) : boolean [32]\n" +
- " 6 ifeq 13\n" +
- " 9 aload_0 [n0]\n" +
- " 10 goto 28\n" +
- " 13 aload_1 [n1]\n" +
- " 14 ifnonnull 21\n" +
- " 17 aconst_null\n" +
- " 18 goto 28\n" +
- " 21 aload_1 [n1]\n" +
- " 22 invokevirtual java.lang.Number.intValue() : int [38]\n" +
- " 25 invokestatic java.lang.Integer.valueOf(int) : java.lang.Integer [16]\n" +
- " 28 astore_3 [result]\n" +
- " 29 getstatic java.lang.System.out : java.io.PrintStream [44]\n" +
- " 32 aload_3 [result]\n" +
- " 33 invokestatic java.lang.String.valueOf(java.lang.Object) : java.lang.String [50]\n" +
- " 36 invokevirtual java.io.PrintStream.println(java.lang.String) : void [53]\n" +
- " 39 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 6]\n" +
- " [pc: 29, line: 7]\n" +
- " [pc: 39, line: 8]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 40] local: n0 index: 0 type: java.lang.Number\n" +
- " [pc: 0, pc: 40] local: n1 index: 1 type: java.lang.Number\n" +
- " [pc: 0, pc: 40] local: refValue index: 2 type: java.lang.String\n" +
- " [pc: 29, pc: 40] local: result index: 3 type: java.lang.Number\n" +
- " Stack map table: number of frames 3\n" +
- " [pc: 13, same]\n" +
- " [pc: 21, same]\n" +
+ " // Method descriptor #27 (Ljava/lang/Number;Ljava/lang/Number;Ljava/lang/String;)V\n" +
+ " // Stack: 2, Locals: 4\n" +
+ " public static void testError(java.lang.Number n0, java.lang.Number n1, java.lang.String refValue);\n" +
+ " 0 aload_2 [refValue]\n" +
+ " 1 ldc <String \"ttt\"> [30]\n" +
+ " 3 invokevirtual java.lang.String.equals(java.lang.Object) : boolean [32]\n" +
+ " 6 ifeq 13\n" +
+ " 9 aload_0 [n0]\n" +
+ " 10 goto 28\n" +
+ " 13 aload_1 [n1]\n" +
+ " 14 ifnonnull 21\n" +
+ " 17 aconst_null\n" +
+ " 18 goto 28\n" +
+ " 21 aload_1 [n1]\n" +
+ " 22 invokevirtual java.lang.Number.intValue() : int [38]\n" +
+ " 25 invokestatic java.lang.Integer.valueOf(int) : java.lang.Integer [16]\n" +
+ " 28 astore_3 [result]\n" +
+ " 29 getstatic java.lang.System.out : java.io.PrintStream [44]\n" +
+ " 32 aload_3 [result]\n" +
+ " 33 invokestatic java.lang.String.valueOf(java.lang.Object) : java.lang.String [50]\n" +
+ " 36 invokevirtual java.io.PrintStream.println(java.lang.String) : void [53]\n" +
+ " 39 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 6]\n" +
+ " [pc: 29, line: 7]\n" +
+ " [pc: 39, line: 8]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 40] local: n0 index: 0 type: java.lang.Number\n" +
+ " [pc: 0, pc: 40] local: n1 index: 1 type: java.lang.Number\n" +
+ " [pc: 0, pc: 40] local: refValue index: 2 type: java.lang.String\n" +
+ " [pc: 29, pc: 40] local: result index: 3 type: java.lang.Number\n" +
+ " Stack map table: number of frames 3\n" +
+ " [pc: 13, same]\n" +
+ " [pc: 21, same]\n" +
" [pc: 28, same_locals_1_stack_item, stack: {java.lang.Number}]\n";
int index = actualOutput.indexOf(expectedOutput);
@@ -7093,7 +7093,7 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
assertEquals("Wrong contents", expectedOutput, actualOutput);
}
}
-
+
public void test055a() throws Exception {
this.runConformTest(
new String[] {
@@ -7112,39 +7112,39 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "import java.io.BufferedReader;\n" +
- "import java.io.Closeable;\n" +
- "import java.io.File;\n" +
- "import java.io.FileReader;\n" +
- "import java.io.IOException;\n" +
- "\n" +
- "public class X {\n" +
- "\n" +
- " static class C implements Closeable {\n" +
- " @Override\n" +
- " public void close() throws IOException {\n" +
- " //\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " int run() throws IOException {\n" +
- " int lcnt = 0;\n" +
- " try (C c = new C();) {\n" +
- " try (final BufferedReader br = new BufferedReader(new FileReader(\n" +
- " new File(\"logging.properties\")))) {\n" +
- " String s = null;\n" +
- " while ((s = br.readLine()) != null)\n" +
- " lcnt++;\n" +
- " return lcnt;\n" +
- " }\n" +
- " } finally {\n" +
- " System.out.println(\"read \" + lcnt + \" lines\");\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static void main(final String[] args) throws IOException {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
+ "import java.io.BufferedReader;\n" +
+ "import java.io.Closeable;\n" +
+ "import java.io.File;\n" +
+ "import java.io.FileReader;\n" +
+ "import java.io.IOException;\n" +
+ "\n" +
+ "public class X {\n" +
+ "\n" +
+ " static class C implements Closeable {\n" +
+ " @Override\n" +
+ " public void close() throws IOException {\n" +
+ " //\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " int run() throws IOException {\n" +
+ " int lcnt = 0;\n" +
+ " try (C c = new C();) {\n" +
+ " try (final BufferedReader br = new BufferedReader(new FileReader(\n" +
+ " new File(\"logging.properties\")))) {\n" +
+ " String s = null;\n" +
+ " while ((s = br.readLine()) != null)\n" +
+ " lcnt++;\n" +
+ " return lcnt;\n" +
+ " }\n" +
+ " } finally {\n" +
+ " System.out.println(\"read \" + lcnt + \" lines\");\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(final String[] args) throws IOException {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " }\n" +
"}",
},
"SUCCESS");
@@ -7214,27 +7214,27 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
" System.out.println(\"SUCCESS\");\n" +
" }\n" +
"}\n" },
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " label1: do {\n" +
- " ^^^^^^\n" +
- "The label label1 is never explicitly referenced\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " for (;false;) {\n" +
- " s = \"\";\n" +
- " if (s == null) \n" +
- " continue label1;\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " } while (s != null);\n" +
- " ^\n" +
- "The local variable s may not have been initialized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " label1: do {\n" +
+ " ^^^^^^\n" +
+ "The label label1 is never explicitly referenced\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " for (;false;) {\n" +
+ " s = \"\";\n" +
+ " if (s == null) \n" +
+ " continue label1;\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 10)\n" +
+ " } while (s != null);\n" +
+ " ^\n" +
+ "The local variable s may not have been initialized\n" +
"----------\n");
- }
+ }
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=367023
public void test060() throws Exception {
this.runConformTest(
@@ -7256,7 +7256,7 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
" }\n" +
"}\n" },
"SUCCESS");
- }
+ }
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=367023
public void test061() throws Exception {
this.runNegativeTest(
@@ -7278,16 +7278,16 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
" System.out.println(\"SUCCESS\");\n" +
" }\n" +
"}\n" },
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " continue label1;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " } while (s != null);\n" +
- " ^\n" +
- "The local variable s may not have been initialized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " continue label1;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " } while (s != null);\n" +
+ " ^\n" +
+ "The local variable s may not have been initialized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=367023
@@ -7334,25 +7334,25 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
" System.out.println(\"SUCCESS\");\n" +
" }\n" +
"}\n" },
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " label1: do {\n" +
- " ^^^^^^\n" +
- "The label label1 is never explicitly referenced\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " for (; five > ten;) {\n" +
- " s = \"\";\n" +
- " if (s == null) \n" +
- " continue label1;\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " } while (s != null);\n" +
- " ^\n" +
- "The local variable s may not have been initialized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " label1: do {\n" +
+ " ^^^^^^\n" +
+ "The label label1 is never explicitly referenced\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " for (; five > ten;) {\n" +
+ " s = \"\";\n" +
+ " if (s == null) \n" +
+ " continue label1;\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " } while (s != null);\n" +
+ " ^\n" +
+ "The local variable s may not have been initialized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=367023
@@ -7398,25 +7398,25 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
" System.out.println(\"SUCCESS\");\n" +
" }\n" +
"}\n" },
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " label1: do {\n" +
- " ^^^^^^\n" +
- "The label label1 is never explicitly referenced\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " while (false) {\n" +
- " s = \"\";\n" +
- " if (s == null) \n" +
- " continue label1;\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " } while (s != null);\n" +
- " ^\n" +
- "The local variable s may not have been initialized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " label1: do {\n" +
+ " ^^^^^^\n" +
+ "The label label1 is never explicitly referenced\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " while (false) {\n" +
+ " s = \"\";\n" +
+ " if (s == null) \n" +
+ " continue label1;\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 10)\n" +
+ " } while (s != null);\n" +
+ " ^\n" +
+ "The local variable s may not have been initialized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=367023
@@ -7440,7 +7440,7 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
" }\n" +
"}\n" },
"SUCCESS");
- }
+ }
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=367023
public void test067() throws Exception {
this.runNegativeTest(
@@ -7462,16 +7462,16 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
" System.out.println(\"SUCCESS\");\n" +
" }\n" +
"}\n" },
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " continue label1;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Dead code\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " } while (s != null);\n" +
- " ^\n" +
- "The local variable s may not have been initialized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 9)\n" +
+ " continue label1;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " } while (s != null);\n" +
+ " ^\n" +
+ "The local variable s may not have been initialized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=367023
@@ -7518,25 +7518,25 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
" System.out.println(\"SUCCESS\");\n" +
" }\n" +
"}\n" },
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " label1: do {\n" +
- " ^^^^^^\n" +
- "The label label1 is never explicitly referenced\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " while (five > ten) {\n" +
- " s = \"\";\n" +
- " if (s == null) \n" +
- " continue label1;\n" +
- " }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " } while (s != null);\n" +
- " ^\n" +
- "The local variable s may not have been initialized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " label1: do {\n" +
+ " ^^^^^^\n" +
+ "The label label1 is never explicitly referenced\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " while (five > ten) {\n" +
+ " s = \"\";\n" +
+ " if (s == null) \n" +
+ " continue label1;\n" +
+ " }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " } while (s != null);\n" +
+ " ^\n" +
+ "The local variable s may not have been initialized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=367023
@@ -7632,7 +7632,7 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
},
"SUCCESS");
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=380313
// Verify the generated code does not have same branch target for the 2 return statements
public void testBug380313() throws Exception {
@@ -7640,29 +7640,29 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
new String[] {
"X.java",
"public class X {\n" +
- "public void foo() throws Exception {\n" +
- " int i = 1;\n" +
- " try {\n" +
- " if (i == 1) {\n" +
- " int n = bar();\n" +
- " if (n == 35)\n" +
- " return;\n" +
- " } else {\n" +
- " throw new Exception();\n" +
- " }\n" +
- " if (i == 0)\n" +
- " return;\n" +
- " } finally {\n" +
- " bar();\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private int bar() {\n" +
- " return 0;\n" +
- " }\n" +
- "\n" +
+ "public void foo() throws Exception {\n" +
+ " int i = 1;\n" +
+ " try {\n" +
+ " if (i == 1) {\n" +
+ " int n = bar();\n" +
+ " if (n == 35)\n" +
+ " return;\n" +
+ " } else {\n" +
+ " throw new Exception();\n" +
+ " }\n" +
+ " if (i == 0)\n" +
+ " return;\n" +
+ " } finally {\n" +
+ " bar();\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " private int bar() {\n" +
+ " return 0;\n" +
+ " }\n" +
+ "\n" +
" public static void main(String[] args) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
+ " System.out.println(\"SUCCESS\");\n" +
" }\n" +
"}\n"
},
@@ -7679,71 +7679,71 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
String xBarCall = isMinimumCompliant(ClassFileConstants.JDK11) ?
"invokevirtual X.bar() : int [18]\n" : "invokespecial X.bar() : int [18]\n";
String expectedOutput =
- " // Method descriptor #6 ()V\n" +
- " // Stack: 2, Locals: 4\n" +
- " public void foo() throws java.lang.Exception;\n" +
- " 0 iconst_1\n" +
- " 1 istore_1 [i]\n" +
- " 2 iload_1 [i]\n" +
- " 3 iconst_1\n" +
- " 4 if_icmpne 24\n" +
- " 7 aload_0 [this]\n" +
- " 8 " + xBarCall +
- " 11 istore_2 [n]\n" +
- " 12 iload_2 [n]\n" +
- " 13 bipush 35\n" +
- " 15 if_icmpne 32\n" +
- " 18 aload_0 [this]\n" +
- " 19 " + xBarCall +
- " 22 pop\n" +
- " 23 return\n" +
- " 24 new java.lang.Exception [16]\n" +
- " 27 dup\n" +
- " 28 invokespecial java.lang.Exception() [22]\n" +
- " 31 athrow\n" +
- " 32 iload_1 [i]\n" +
- " 33 ifne 50\n" +
- " 36 aload_0 [this]\n" +
- " 37 " + xBarCall +
- " 40 pop\n" +
- " 41 return\n" +
- " 42 astore_3\n" +
- " 43 aload_0 [this]\n" +
- " 44 " + xBarCall +
- " 47 pop\n" +
- " 48 aload_3\n" +
- " 49 athrow\n" +
- " 50 aload_0 [this]\n" +
- " 51 " + xBarCall +
- " 54 pop\n" +
- " 55 return\n" +
- " Exception Table:\n" +
- " [pc: 2, pc: 18] -> 42 when : any\n" +
- " [pc: 24, pc: 36] -> 42 when : any\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
- " [pc: 2, line: 5]\n" +
- " [pc: 7, line: 6]\n" +
- " [pc: 12, line: 7]\n" +
- " [pc: 18, line: 15]\n" +
- " [pc: 23, line: 8]\n" +
- " [pc: 24, line: 10]\n" +
- " [pc: 32, line: 12]\n" +
- " [pc: 36, line: 15]\n" +
- " [pc: 41, line: 13]\n" +
- " [pc: 42, line: 14]\n" +
- " [pc: 43, line: 15]\n" +
- " [pc: 48, line: 16]\n" +
- " [pc: 50, line: 15]\n" +
- " [pc: 55, line: 17]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 56] local: this index: 0 type: X\n" +
- " [pc: 2, pc: 56] local: i index: 1 type: int\n" +
- " [pc: 12, pc: 24] local: n index: 2 type: int\n" +
- " Stack map table: number of frames 4\n" +
- " [pc: 24, append: {int}]\n" +
- " [pc: 32, same]\n" +
- " [pc: 42, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 2, Locals: 4\n" +
+ " public void foo() throws java.lang.Exception;\n" +
+ " 0 iconst_1\n" +
+ " 1 istore_1 [i]\n" +
+ " 2 iload_1 [i]\n" +
+ " 3 iconst_1\n" +
+ " 4 if_icmpne 24\n" +
+ " 7 aload_0 [this]\n" +
+ " 8 " + xBarCall +
+ " 11 istore_2 [n]\n" +
+ " 12 iload_2 [n]\n" +
+ " 13 bipush 35\n" +
+ " 15 if_icmpne 32\n" +
+ " 18 aload_0 [this]\n" +
+ " 19 " + xBarCall +
+ " 22 pop\n" +
+ " 23 return\n" +
+ " 24 new java.lang.Exception [16]\n" +
+ " 27 dup\n" +
+ " 28 invokespecial java.lang.Exception() [22]\n" +
+ " 31 athrow\n" +
+ " 32 iload_1 [i]\n" +
+ " 33 ifne 50\n" +
+ " 36 aload_0 [this]\n" +
+ " 37 " + xBarCall +
+ " 40 pop\n" +
+ " 41 return\n" +
+ " 42 astore_3\n" +
+ " 43 aload_0 [this]\n" +
+ " 44 " + xBarCall +
+ " 47 pop\n" +
+ " 48 aload_3\n" +
+ " 49 athrow\n" +
+ " 50 aload_0 [this]\n" +
+ " 51 " + xBarCall +
+ " 54 pop\n" +
+ " 55 return\n" +
+ " Exception Table:\n" +
+ " [pc: 2, pc: 18] -> 42 when : any\n" +
+ " [pc: 24, pc: 36] -> 42 when : any\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
+ " [pc: 2, line: 5]\n" +
+ " [pc: 7, line: 6]\n" +
+ " [pc: 12, line: 7]\n" +
+ " [pc: 18, line: 15]\n" +
+ " [pc: 23, line: 8]\n" +
+ " [pc: 24, line: 10]\n" +
+ " [pc: 32, line: 12]\n" +
+ " [pc: 36, line: 15]\n" +
+ " [pc: 41, line: 13]\n" +
+ " [pc: 42, line: 14]\n" +
+ " [pc: 43, line: 15]\n" +
+ " [pc: 48, line: 16]\n" +
+ " [pc: 50, line: 15]\n" +
+ " [pc: 55, line: 17]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 56] local: this index: 0 type: X\n" +
+ " [pc: 2, pc: 56] local: i index: 1 type: int\n" +
+ " [pc: 12, pc: 24] local: n index: 2 type: int\n" +
+ " Stack map table: number of frames 4\n" +
+ " [pc: 24, append: {int}]\n" +
+ " [pc: 32, same]\n" +
+ " [pc: 42, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n" +
" [pc: 50, same]\n";
int index = actualOutput.indexOf(expectedOutput);
if (index == -1 || expectedOutput.length() == 0) {
@@ -7764,31 +7764,31 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
"import java.io.FileInputStream;\n" +
"import java.io.IOException;\n" +
"public class X {\n" +
- "public void foo() throws Exception {\n" +
- " int i = 1;\n" +
- " try {\n" +
+ "public void foo() throws Exception {\n" +
+ " int i = 1;\n" +
+ " try {\n" +
" try (FileInputStream fis = new FileInputStream(\"\")) {\n" +
- " if (i == 2)" +
- " return;\n" +
- " }\n" +
- " if (i == 35) \n" +
- " return;\n" +
- " } catch(IOException e) {\n" +
- " bar();\n" +
- " } finally {\n" +
- " bar();\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private int bar() {\n" +
- " return 0;\n" +
- " }\n" +
- "\n" +
+ " if (i == 2)" +
+ " return;\n" +
+ " }\n" +
+ " if (i == 35) \n" +
+ " return;\n" +
+ " } catch(IOException e) {\n" +
+ " bar();\n" +
+ " } finally {\n" +
+ " bar();\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " private int bar() {\n" +
+ " return 0;\n" +
+ " }\n" +
+ "\n" +
" public static void main(String[] args) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
+ " System.out.println(\"SUCCESS\");\n" +
" }\n" +
"}\n"
- },
+ },
"SUCCESS");
ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
@@ -7802,127 +7802,127 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
String xBarCall = (isMinimumCompliant(ClassFileConstants.JDK11) ?
"invokevirtual" : "invokespecial") + " X.bar() : int [28]\n";
String expectedOutput =
- " // Method descriptor #6 ()V\n" +
- " // Stack: 3, Locals: 6\n" +
- " public void foo() throws java.lang.Exception;\n" +
- " 0 iconst_1\n" +
- " 1 istore_1 [i]\n" +
- " 2 aconst_null\n" +
- " 3 astore_2\n" +
- " 4 aconst_null\n" +
- " 5 astore_3\n" +
- " 6 new java.io.FileInputStream [18]\n" +
- " 9 dup\n" +
- " 10 ldc <String \"\"> [20]\n" +
- " 12 invokespecial java.io.FileInputStream(java.lang.String) [22]\n" +
- " 15 astore 4 [fis]\n" +
- " 17 iload_1 [i]\n" +
- " 18 iconst_2\n" +
- " 19 if_icmpne 38\n" +
- " 22 aload 4 [fis]\n" +
- " 24 ifnull 32\n" +
- " 27 aload 4 [fis]\n" +
- " 29 invokevirtual java.io.FileInputStream.close() : void [25]\n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 3, Locals: 6\n" +
+ " public void foo() throws java.lang.Exception;\n" +
+ " 0 iconst_1\n" +
+ " 1 istore_1 [i]\n" +
+ " 2 aconst_null\n" +
+ " 3 astore_2\n" +
+ " 4 aconst_null\n" +
+ " 5 astore_3\n" +
+ " 6 new java.io.FileInputStream [18]\n" +
+ " 9 dup\n" +
+ " 10 ldc <String \"\"> [20]\n" +
+ " 12 invokespecial java.io.FileInputStream(java.lang.String) [22]\n" +
+ " 15 astore 4 [fis]\n" +
+ " 17 iload_1 [i]\n" +
+ " 18 iconst_2\n" +
+ " 19 if_icmpne 38\n" +
+ " 22 aload 4 [fis]\n" +
+ " 24 ifnull 32\n" +
+ " 27 aload 4 [fis]\n" +
+ " 29 invokevirtual java.io.FileInputStream.close() : void [25]\n" +
" 32 aload_0 [this]\n" + // return 1
- " 33 " + xBarCall +
- " 36 pop\n" +
- " 37 return\n" +
- " 38 aload 4 [fis]\n" +
- " 40 ifnull 86\n" +
- " 43 aload 4 [fis]\n" +
- " 45 invokevirtual java.io.FileInputStream.close() : void [25]\n" +
- " 48 goto 86\n" +
- " 51 astore_2\n" +
- " 52 aload 4 [fis]\n" +
- " 54 ifnull 62\n" +
- " 57 aload 4 [fis]\n" +
- " 59 invokevirtual java.io.FileInputStream.close() : void [25]\n" +
- " 62 aload_2\n" +
- " 63 athrow\n" +
- " 64 astore_3\n" +
- " 65 aload_2\n" +
- " 66 ifnonnull 74\n" +
- " 69 aload_3\n" +
- " 70 astore_2\n" +
- " 71 goto 84\n" +
- " 74 aload_2\n" +
- " 75 aload_3\n" +
- " 76 if_acmpeq 84\n" +
- " 79 aload_2\n" +
- " 80 aload_3\n" +
- " 81 invokevirtual java.lang.Throwable.addSuppressed(java.lang.Throwable) : void [32]\n" +
- " 84 aload_2\n" +
- " 85 athrow\n" +
- " 86 iload_1 [i]\n" +
- " 87 bipush 35\n" +
- " 89 if_icmpne 122\n" +
+ " 33 " + xBarCall +
+ " 36 pop\n" +
+ " 37 return\n" +
+ " 38 aload 4 [fis]\n" +
+ " 40 ifnull 86\n" +
+ " 43 aload 4 [fis]\n" +
+ " 45 invokevirtual java.io.FileInputStream.close() : void [25]\n" +
+ " 48 goto 86\n" +
+ " 51 astore_2\n" +
+ " 52 aload 4 [fis]\n" +
+ " 54 ifnull 62\n" +
+ " 57 aload 4 [fis]\n" +
+ " 59 invokevirtual java.io.FileInputStream.close() : void [25]\n" +
+ " 62 aload_2\n" +
+ " 63 athrow\n" +
+ " 64 astore_3\n" +
+ " 65 aload_2\n" +
+ " 66 ifnonnull 74\n" +
+ " 69 aload_3\n" +
+ " 70 astore_2\n" +
+ " 71 goto 84\n" +
+ " 74 aload_2\n" +
+ " 75 aload_3\n" +
+ " 76 if_acmpeq 84\n" +
+ " 79 aload_2\n" +
+ " 80 aload_3\n" +
+ " 81 invokevirtual java.lang.Throwable.addSuppressed(java.lang.Throwable) : void [32]\n" +
+ " 84 aload_2\n" +
+ " 85 athrow\n" +
+ " 86 iload_1 [i]\n" +
+ " 87 bipush 35\n" +
+ " 89 if_icmpne 122\n" +
" 92 aload_0 [this]\n" + // return 2
- " 93 " + xBarCall +
- " 96 pop\n" +
- " 97 return\n" +
- " 98 astore_2 [e]\n" +
- " 99 aload_0 [this]\n" +
- " 100 " + xBarCall +
- " 103 pop\n" +
- " 104 aload_0 [this]\n" +
- " 105 " + xBarCall +
- " 108 pop\n" +
- " 109 goto 127\n" +
- " 112 astore 5\n" +
- " 114 aload_0 [this]\n" +
- " 115 " + xBarCall +
- " 118 pop\n" +
- " 119 aload 5\n" +
- " 121 athrow\n" +
- " 122 aload_0 [this]\n" +
- " 123 " + xBarCall +
- " 126 pop\n" +
- " 127 return\n" +
- " Exception Table:\n" +
- " [pc: 17, pc: 22] -> 51 when : any\n" +
+ " 93 " + xBarCall +
+ " 96 pop\n" +
+ " 97 return\n" +
+ " 98 astore_2 [e]\n" +
+ " 99 aload_0 [this]\n" +
+ " 100 " + xBarCall +
+ " 103 pop\n" +
+ " 104 aload_0 [this]\n" +
+ " 105 " + xBarCall +
+ " 108 pop\n" +
+ " 109 goto 127\n" +
+ " 112 astore 5\n" +
+ " 114 aload_0 [this]\n" +
+ " 115 " + xBarCall +
+ " 118 pop\n" +
+ " 119 aload 5\n" +
+ " 121 athrow\n" +
+ " 122 aload_0 [this]\n" +
+ " 123 " + xBarCall +
+ " 126 pop\n" +
+ " 127 return\n" +
+ " Exception Table:\n" +
+ " [pc: 17, pc: 22] -> 51 when : any\n" +
" [pc: 6, pc: 32] -> 64 when : any\n" +
" [pc: 38, pc: 64] -> 64 when : any\n" +
- " [pc: 2, pc: 32] -> 98 when : java.io.IOException\n" +
- " [pc: 38, pc: 92] -> 98 when : java.io.IOException\n" +
- " [pc: 2, pc: 32] -> 112 when : any\n" +
- " [pc: 38, pc: 92] -> 112 when : any\n" +
- " [pc: 98, pc: 104] -> 112 when : any\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 5]\n" +
- " [pc: 2, line: 7]\n" +
- " [pc: 17, line: 8]\n" +
- " [pc: 22, line: 9]\n" +
- " [pc: 32, line: 15]\n" +
- " [pc: 37, line: 8]\n" +
- " [pc: 38, line: 9]\n" +
- " [pc: 86, line: 10]\n" +
- " [pc: 92, line: 15]\n" +
- " [pc: 97, line: 11]\n" +
- " [pc: 98, line: 12]\n" +
- " [pc: 99, line: 13]\n" +
- " [pc: 104, line: 15]\n" +
- " [pc: 112, line: 14]\n" +
- " [pc: 114, line: 15]\n" +
- " [pc: 119, line: 16]\n" +
- " [pc: 122, line: 15]\n" +
- " [pc: 127, line: 17]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 128] local: this index: 0 type: X\n" +
- " [pc: 2, pc: 128] local: i index: 1 type: int\n" +
- " [pc: 17, pc: 62] local: fis index: 4 type: java.io.FileInputStream\n" +
- " [pc: 99, pc: 104] local: e index: 2 type: java.io.IOException\n" +
- " Stack map table: number of frames 12\n" +
- " [pc: 32, full, stack: {}, locals: {X, int, java.lang.Throwable, java.lang.Throwable, java.io.FileInputStream}]\n" +
- " [pc: 38, same]\n" +
- " [pc: 51, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n" +
- " [pc: 62, chop 1 local(s)]\n" +
- " [pc: 64, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n" +
- " [pc: 74, same]\n" +
- " [pc: 84, same]\n" +
- " [pc: 86, chop 2 local(s)]\n" +
- " [pc: 98, same_locals_1_stack_item, stack: {java.io.IOException}]\n" +
- " [pc: 112, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n" +
- " [pc: 122, same]\n" +
+ " [pc: 2, pc: 32] -> 98 when : java.io.IOException\n" +
+ " [pc: 38, pc: 92] -> 98 when : java.io.IOException\n" +
+ " [pc: 2, pc: 32] -> 112 when : any\n" +
+ " [pc: 38, pc: 92] -> 112 when : any\n" +
+ " [pc: 98, pc: 104] -> 112 when : any\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 5]\n" +
+ " [pc: 2, line: 7]\n" +
+ " [pc: 17, line: 8]\n" +
+ " [pc: 22, line: 9]\n" +
+ " [pc: 32, line: 15]\n" +
+ " [pc: 37, line: 8]\n" +
+ " [pc: 38, line: 9]\n" +
+ " [pc: 86, line: 10]\n" +
+ " [pc: 92, line: 15]\n" +
+ " [pc: 97, line: 11]\n" +
+ " [pc: 98, line: 12]\n" +
+ " [pc: 99, line: 13]\n" +
+ " [pc: 104, line: 15]\n" +
+ " [pc: 112, line: 14]\n" +
+ " [pc: 114, line: 15]\n" +
+ " [pc: 119, line: 16]\n" +
+ " [pc: 122, line: 15]\n" +
+ " [pc: 127, line: 17]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 128] local: this index: 0 type: X\n" +
+ " [pc: 2, pc: 128] local: i index: 1 type: int\n" +
+ " [pc: 17, pc: 62] local: fis index: 4 type: java.io.FileInputStream\n" +
+ " [pc: 99, pc: 104] local: e index: 2 type: java.io.IOException\n" +
+ " Stack map table: number of frames 12\n" +
+ " [pc: 32, full, stack: {}, locals: {X, int, java.lang.Throwable, java.lang.Throwable, java.io.FileInputStream}]\n" +
+ " [pc: 38, same]\n" +
+ " [pc: 51, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n" +
+ " [pc: 62, chop 1 local(s)]\n" +
+ " [pc: 64, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n" +
+ " [pc: 74, same]\n" +
+ " [pc: 84, same]\n" +
+ " [pc: 86, chop 2 local(s)]\n" +
+ " [pc: 98, same_locals_1_stack_item, stack: {java.io.IOException}]\n" +
+ " [pc: 112, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n" +
+ " [pc: 122, same]\n" +
" [pc: 127, same]\n";
int index = actualOutput.indexOf(expectedOutput);
if (index == -1 || expectedOutput.length() == 0) {
@@ -7971,33 +7971,33 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " // Method descriptor #15 ()Ljava/lang/Object;\n" +
- " // Stack: 1, Locals: 2\n" +
- " public static final java.lang.Object f();\n" +
- " 0 aconst_null\n" +
- " 1 astore_0 [a]\n" +
- " 2 iconst_0\n" +
- " 3 tableswitch default: 25\n" +
- " case 1: 20\n" +
- " 20 aload_0 [a]\n" +
- " 21 astore_1 [b]\n" +
- " 22 goto 2\n" +
- " 25 aload_0 [a]\n" +
- " 26 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 3]\n" +
- " [pc: 2, line: 6]\n" +
- " [pc: 20, line: 8]\n" +
- " [pc: 22, line: 10]\n" +
- " [pc: 25, line: 15]\n" +
- " Local variable table:\n" +
- " [pc: 2, pc: 27] local: a index: 0 type: java.lang.Object\n" +
- " [pc: 22, pc: 25] local: b index: 1 type: java.lang.Object\n" +
- " Stack map table: number of frames 3\n" +
- " [pc: 2, append: {java.lang.Object}]\n" +
- " [pc: 20, same]\n" +
- " [pc: 25, same]\n" +
- " \n";
+ " // Method descriptor #15 ()Ljava/lang/Object;\n" +
+ " // Stack: 1, Locals: 2\n" +
+ " public static final java.lang.Object f();\n" +
+ " 0 aconst_null\n" +
+ " 1 astore_0 [a]\n" +
+ " 2 iconst_0\n" +
+ " 3 tableswitch default: 25\n" +
+ " case 1: 20\n" +
+ " 20 aload_0 [a]\n" +
+ " 21 astore_1 [b]\n" +
+ " 22 goto 2\n" +
+ " 25 aload_0 [a]\n" +
+ " 26 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
+ " [pc: 2, line: 6]\n" +
+ " [pc: 20, line: 8]\n" +
+ " [pc: 22, line: 10]\n" +
+ " [pc: 25, line: 15]\n" +
+ " Local variable table:\n" +
+ " [pc: 2, pc: 27] local: a index: 0 type: java.lang.Object\n" +
+ " [pc: 22, pc: 25] local: b index: 1 type: java.lang.Object\n" +
+ " Stack map table: number of frames 3\n" +
+ " [pc: 2, append: {java.lang.Object}]\n" +
+ " [pc: 20, same]\n" +
+ " [pc: 25, same]\n" +
+ " \n";
int index = actualOutput.indexOf(expectedOutput);
if (index == -1 || expectedOutput.length() == 0) {
System.out.println(Util.displayString(actualOutput, 2));
@@ -8012,34 +8012,34 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"stackmap/StackMapTableFormatError.java",
- "package stackmap;\n" +
- "\n" +
- "import java.util.Collection;\n" +
- "import java.util.Collections;\n" +
- "\n" +
- "/**\n" +
- " * If compiled with Eclipse (compiler target >= 1.6) this snippet causes the\n" +
- " * error \"java.lang.ClassFormatError: StackMapTable format error: bad\n" +
- " * verification type\" when executed with JaCoCo code coverage. JaCoCo seems to\n" +
- " * get confused by unexpected stackmap frames generated by ECJ.\n" +
- " */\n" +
- "public class StackMapTableFormatError {\n" +
- "\n" +
- " public static Object exec(Collection<Object> set, Object a,\n" +
- " boolean b) {\n" +
- " for (Object e : set) {\n" +
- " if (a != null && (e == null || b)) {\n" +
- " continue;\n" +
- " }\n" +
- " return null;\n" +
- " }\n" +
- " return null;\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " exec(Collections.emptySet(), null, false);\n" +
- " }\n" +
- "\n" +
+ "package stackmap;\n" +
+ "\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.Collections;\n" +
+ "\n" +
+ "/**\n" +
+ " * If compiled with Eclipse (compiler target >= 1.6) this snippet causes the\n" +
+ " * error \"java.lang.ClassFormatError: StackMapTable format error: bad\n" +
+ " * verification type\" when executed with JaCoCo code coverage. JaCoCo seems to\n" +
+ " * get confused by unexpected stackmap frames generated by ECJ.\n" +
+ " */\n" +
+ "public class StackMapTableFormatError {\n" +
+ "\n" +
+ " public static Object exec(Collection<Object> set, Object a,\n" +
+ " boolean b) {\n" +
+ " for (Object e : set) {\n" +
+ " if (a != null && (e == null || b)) {\n" +
+ " continue;\n" +
+ " }\n" +
+ " return null;\n" +
+ " }\n" +
+ " return null;\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " exec(Collections.emptySet(), null, false);\n" +
+ " }\n" +
+ "\n" +
"}\n"
});
@@ -8052,49 +8052,49 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " // Method descriptor #15 (Ljava/util/Collection;Ljava/lang/Object;Z)Ljava/lang/Object;\n" +
- " // Signature: (Ljava/util/Collection<Ljava/lang/Object;>;Ljava/lang/Object;Z)Ljava/lang/Object;\n" +
- " // Stack: 1, Locals: 5\n" +
- " public static java.lang.Object exec(java.util.Collection set, java.lang.Object a, boolean b);\n" +
- " 0 aload_0 [set]\n" +
- " 1 invokeinterface java.util.Collection.iterator() : java.util.Iterator [18] [nargs: 1]\n" +
- " 6 astore 4\n" +
- " 8 goto 36\n" +
- " 11 aload 4\n" +
- " 13 invokeinterface java.util.Iterator.next() : java.lang.Object [24] [nargs: 1]\n" +
- " 18 astore_3 [e]\n" +
- " 19 aload_1 [a]\n" +
- " 20 ifnull 34\n" +
- " 23 aload_3 [e]\n" +
- " 24 ifnull 36\n" +
- " 27 iload_2 [b]\n" +
- " 28 ifeq 34\n" +
- " 31 goto 36\n" +
- " 34 aconst_null\n" +
- " 35 areturn\n" +
- " 36 aload 4\n" +
- " 38 invokeinterface java.util.Iterator.hasNext() : boolean [30] [nargs: 1]\n" +
- " 43 ifne 11\n" +
- " 46 aconst_null\n" +
- " 47 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 16]\n" +
- " [pc: 19, line: 17]\n" +
- " [pc: 31, line: 18]\n" +
- " [pc: 34, line: 20]\n" +
- " [pc: 36, line: 16]\n" +
- " [pc: 46, line: 22]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 48] local: set index: 0 type: java.util.Collection\n" +
- " [pc: 0, pc: 48] local: a index: 1 type: java.lang.Object\n" +
- " [pc: 0, pc: 48] local: b index: 2 type: boolean\n" +
- " [pc: 19, pc: 36] local: e index: 3 type: java.lang.Object\n" +
- " Local variable type table:\n" +
- " [pc: 0, pc: 48] local: set index: 0 type: java.util.Collection<java.lang.Object>\n" +
- " Stack map table: number of frames 3\n" +
- " [pc: 11, full, stack: {}, locals: {java.util.Collection, java.lang.Object, int, _, java.util.Iterator}]\n" +
- " [pc: 34, full, stack: {}, locals: {java.util.Collection, java.lang.Object, int, java.lang.Object, java.util.Iterator}]\n" +
- " [pc: 36, full, stack: {}, locals: {java.util.Collection, java.lang.Object, int, _, java.util.Iterator}]";
+ " // Method descriptor #15 (Ljava/util/Collection;Ljava/lang/Object;Z)Ljava/lang/Object;\n" +
+ " // Signature: (Ljava/util/Collection<Ljava/lang/Object;>;Ljava/lang/Object;Z)Ljava/lang/Object;\n" +
+ " // Stack: 1, Locals: 5\n" +
+ " public static java.lang.Object exec(java.util.Collection set, java.lang.Object a, boolean b);\n" +
+ " 0 aload_0 [set]\n" +
+ " 1 invokeinterface java.util.Collection.iterator() : java.util.Iterator [18] [nargs: 1]\n" +
+ " 6 astore 4\n" +
+ " 8 goto 36\n" +
+ " 11 aload 4\n" +
+ " 13 invokeinterface java.util.Iterator.next() : java.lang.Object [24] [nargs: 1]\n" +
+ " 18 astore_3 [e]\n" +
+ " 19 aload_1 [a]\n" +
+ " 20 ifnull 34\n" +
+ " 23 aload_3 [e]\n" +
+ " 24 ifnull 36\n" +
+ " 27 iload_2 [b]\n" +
+ " 28 ifeq 34\n" +
+ " 31 goto 36\n" +
+ " 34 aconst_null\n" +
+ " 35 areturn\n" +
+ " 36 aload 4\n" +
+ " 38 invokeinterface java.util.Iterator.hasNext() : boolean [30] [nargs: 1]\n" +
+ " 43 ifne 11\n" +
+ " 46 aconst_null\n" +
+ " 47 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 16]\n" +
+ " [pc: 19, line: 17]\n" +
+ " [pc: 31, line: 18]\n" +
+ " [pc: 34, line: 20]\n" +
+ " [pc: 36, line: 16]\n" +
+ " [pc: 46, line: 22]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 48] local: set index: 0 type: java.util.Collection\n" +
+ " [pc: 0, pc: 48] local: a index: 1 type: java.lang.Object\n" +
+ " [pc: 0, pc: 48] local: b index: 2 type: boolean\n" +
+ " [pc: 19, pc: 36] local: e index: 3 type: java.lang.Object\n" +
+ " Local variable type table:\n" +
+ " [pc: 0, pc: 48] local: set index: 0 type: java.util.Collection<java.lang.Object>\n" +
+ " Stack map table: number of frames 3\n" +
+ " [pc: 11, full, stack: {}, locals: {java.util.Collection, java.lang.Object, int, _, java.util.Iterator}]\n" +
+ " [pc: 34, full, stack: {}, locals: {java.util.Collection, java.lang.Object, int, java.lang.Object, java.util.Iterator}]\n" +
+ " [pc: 36, full, stack: {}, locals: {java.util.Collection, java.lang.Object, int, _, java.util.Iterator}]";
int index = actualOutput.indexOf(expectedOutput);
if (index == -1 || expectedOutput.length() == 0) {
System.out.println(Util.displayString(actualOutput, 2));
@@ -8109,44 +8109,44 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"snippet/X.java",
- "package snippet;\n" +
- "\n" +
- "\n" +
- "public class X { \n" +
- " private void foo(boolean delete) { \n" +
- " \n" +
- " String s = bar(); \n" +
- " StringBuffer buffer =new StringBuffer(); \n" +
- " \n" +
- " try { \n" +
- " \n" +
- " String[] datas = new String[] { \"\" }; \n" +
- " Object[] data= new Object[] { s }; \n" +
- " try { \n" +
- " buffer.append(datas).append(data); \n" +
- " } catch (Exception e) { \n" +
- " if (e != null) \n" +
- " throw e; \n" +
- " return; \n" +
- " } \n" +
- " \n" +
- " if (delete) \n" +
- " buffer.delete(0, buffer.length()); \n" +
- " \n" +
- " } catch (Exception x) { \n" +
- " } finally { \n" +
- " buffer = null; \n" +
- " } \n" +
- " } \n" +
- " \n" +
- " String bar() { \n" +
- " return \"\"; \n" +
- " } \n" +
- " \n" +
- " public static void main(String[] args) { \n" +
- " new X().foo(false); \n" +
- " System.out.println(\"SUCCESS\"); \n" +
- " } \n" +
+ "package snippet;\n" +
+ "\n" +
+ "\n" +
+ "public class X { \n" +
+ " private void foo(boolean delete) { \n" +
+ " \n" +
+ " String s = bar(); \n" +
+ " StringBuffer buffer =new StringBuffer(); \n" +
+ " \n" +
+ " try { \n" +
+ " \n" +
+ " String[] datas = new String[] { \"\" }; \n" +
+ " Object[] data= new Object[] { s }; \n" +
+ " try { \n" +
+ " buffer.append(datas).append(data); \n" +
+ " } catch (Exception e) { \n" +
+ " if (e != null) \n" +
+ " throw e; \n" +
+ " return; \n" +
+ " } \n" +
+ " \n" +
+ " if (delete) \n" +
+ " buffer.delete(0, buffer.length()); \n" +
+ " \n" +
+ " } catch (Exception x) { \n" +
+ " } finally { \n" +
+ " buffer = null; \n" +
+ " } \n" +
+ " } \n" +
+ " \n" +
+ " String bar() { \n" +
+ " return \"\"; \n" +
+ " } \n" +
+ " \n" +
+ " public static void main(String[] args) { \n" +
+ " new X().foo(false); \n" +
+ " System.out.println(\"SUCCESS\"); \n" +
+ " } \n" +
"}\n"
});
@@ -8159,15 +8159,15 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- "Stack map table: number of frames 7\n" +
- " [pc: 49, full, stack: {java.lang.Exception}, locals: {snippet.X, int, java.lang.String, java.lang.StringBuffer, java.lang.String[], java.lang.Object[]}]\n" +
- " [pc: 59, append: {java.lang.Exception}]\n" +
- " [pc: 62, chop 1 local(s)]\n" +
- " [pc: 79, full, stack: {java.lang.Exception}, locals: {snippet.X, int, java.lang.String, java.lang.StringBuffer}]\n" +
- " [pc: 86, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n" +
- " [pc: 93, same]\n" +
- " [pc: 95, same]\n";
-
+ "Stack map table: number of frames 7\n" +
+ " [pc: 49, full, stack: {java.lang.Exception}, locals: {snippet.X, int, java.lang.String, java.lang.StringBuffer, java.lang.String[], java.lang.Object[]}]\n" +
+ " [pc: 59, append: {java.lang.Exception}]\n" +
+ " [pc: 62, chop 1 local(s)]\n" +
+ " [pc: 79, full, stack: {java.lang.Exception}, locals: {snippet.X, int, java.lang.String, java.lang.StringBuffer}]\n" +
+ " [pc: 86, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n" +
+ " [pc: 93, same]\n" +
+ " [pc: 95, same]\n";
+
int index = actualOutput.indexOf(expectedOutput);
if (index == -1 || expectedOutput.length() == 0) {
System.out.println(Util.displayString(actualOutput, 2));
@@ -8181,40 +8181,40 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "public class X\n" +
- "{\n" +
- " public static Boolean test() throws Exception\n" +
- " {\n" +
- " try\n" +
- " {\n" +
- " for (int i = 0; i < 1; i++)\n" +
- " {\n" +
- " long status = System.currentTimeMillis();\n" +
- " if (status < 0)\n" +
- " return false;\n" +
- " if (status == 1)\n" +
- " return false;\n" +
- " }\n" +
- " \n" +
- " return false;\n" +
- " }\n" +
- " finally\n" +
- " {\n" +
- " System.currentTimeMillis();\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) throws Exception\n" +
- " {\n" +
- " System.out.print(\"Starting\");\n" +
- " test();\n" +
- " System.out.println(\"Done\");\n" +
- " }\n" +
+ "public class X\n" +
+ "{\n" +
+ " public static Boolean test() throws Exception\n" +
+ " {\n" +
+ " try\n" +
+ " {\n" +
+ " for (int i = 0; i < 1; i++)\n" +
+ " {\n" +
+ " long status = System.currentTimeMillis();\n" +
+ " if (status < 0)\n" +
+ " return false;\n" +
+ " if (status == 1)\n" +
+ " return false;\n" +
+ " }\n" +
+ " \n" +
+ " return false;\n" +
+ " }\n" +
+ " finally\n" +
+ " {\n" +
+ " System.currentTimeMillis();\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) throws Exception\n" +
+ " {\n" +
+ " System.out.print(\"Starting\");\n" +
+ " test();\n" +
+ " System.out.println(\"Done\");\n" +
+ " }\n" +
"}"
},
"StartingDone");
}
-
+
// https://bugs.eclipse.org/412203
public void testBug412203_a() throws Exception {
if (this.complianceLevel < ClassFileConstants.JDK1_7) return; // using <>
@@ -8227,59 +8227,59 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X2.java",
- "import java.util.*;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
- "\n" +
- "class Y {\n" +
- " public Y() { }\n" +
- "}\n" +
- "\n" +
- "@NonNullByDefault\n" +
- "abstract class X1 {\n" +
- "\n" +
- " private Object a;\n" +
- " private Object b;\n" +
- " private Object c;\n" +
- " private Object d;\n" +
- " private Object e;\n" +
- " private Object f;\n" +
- "\n" +
- " protected Object name;\n" +
- "\n" +
- " @SuppressWarnings(\"null\")\n" +
- " protected X1() {\n" +
- " super ();\n" +
- " }\n" +
- "\n" +
- "}\n" +
- "public class X2 extends X1 {\n" +
- "\n" +
- "\n" +
- " public static final int ID = 4711;\n" +
- "\n" +
- " private Object x;\n" +
- " private Object y;\n" +
- " private Object z;\n" +
- "\n" +
- " private Runnable runable = new Runnable () {\n" +
- " @Override\n" +
- " public void run () {\n" +
- " // whatever\n" +
- " }\n" +
- " };\n" +
- "\n" +
- " private void init () {\n" +
- " final Object selector = new Object ();\n" +
- " this.name = new Object ();\n" +
- " LinkedList<Character> invalidCharactersList = new LinkedList<> ();\n" +
- " char[] invalidCharacters = new char[invalidCharactersList.size ()];\n" +
- " for (int i = 0; i < invalidCharacters.length; i++) {\n" +
- " invalidCharacters[i] = invalidCharactersList.get (i).charValue ();\n" +
- " }\n" +
- " Y inputVerifier = new Y();\n" +
- " }\n" +
- "\n" +
+ "import java.util.*;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+ "\n" +
+ "class Y {\n" +
+ " public Y() { }\n" +
+ "}\n" +
+ "\n" +
+ "@NonNullByDefault\n" +
+ "abstract class X1 {\n" +
+ "\n" +
+ " private Object a;\n" +
+ " private Object b;\n" +
+ " private Object c;\n" +
+ " private Object d;\n" +
+ " private Object e;\n" +
+ " private Object f;\n" +
+ "\n" +
+ " protected Object name;\n" +
+ "\n" +
+ " @SuppressWarnings(\"null\")\n" +
+ " protected X1() {\n" +
+ " super ();\n" +
+ " }\n" +
+ "\n" +
+ "}\n" +
+ "public class X2 extends X1 {\n" +
+ "\n" +
+ "\n" +
+ " public static final int ID = 4711;\n" +
+ "\n" +
+ " private Object x;\n" +
+ " private Object y;\n" +
+ " private Object z;\n" +
+ "\n" +
+ " private Runnable runable = new Runnable () {\n" +
+ " @Override\n" +
+ " public void run () {\n" +
+ " // whatever\n" +
+ " }\n" +
+ " };\n" +
+ "\n" +
+ " private void init () {\n" +
+ " final Object selector = new Object ();\n" +
+ " this.name = new Object ();\n" +
+ " LinkedList<Character> invalidCharactersList = new LinkedList<> ();\n" +
+ " char[] invalidCharacters = new char[invalidCharactersList.size ()];\n" +
+ " for (int i = 0; i < invalidCharacters.length; i++) {\n" +
+ " invalidCharacters[i] = invalidCharactersList.get (i).charValue ();\n" +
+ " }\n" +
+ " Y inputVerifier = new Y();\n" +
+ " }\n" +
+ "\n" +
"}\n",
},
"",
@@ -8299,68 +8299,68 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " // Method descriptor #16 ()V\n" +
- " // Stack: 4, Locals: 5\n" +
- " private void init();\n" +
- " 0 new java.lang.Object [32]\n" +
- " 3 dup\n" +
- " 4 invokespecial java.lang.Object() [34]\n" +
- " 7 astore_1 [selector]\n" +
- " 8 aload_0 [this]\n" +
- " 9 new java.lang.Object [32]\n" +
- " 12 dup\n" +
- " 13 invokespecial java.lang.Object() [34]\n" +
- " 16 putfield X2.name : java.lang.Object [35]\n" +
- " 19 new java.util.LinkedList [38]\n" +
- " 22 dup\n" +
- " 23 invokespecial java.util.LinkedList() [40]\n" +
- " 26 astore_2 [invalidCharactersList]\n" +
- " 27 aload_2 [invalidCharactersList]\n" +
- " 28 invokevirtual java.util.LinkedList.size() : int [41]\n" +
- " 31 newarray char [5]\n" +
- " 33 astore_3 [invalidCharacters]\n" +
- " 34 iconst_0\n" +
- " 35 istore 4 [i]\n" +
- " 37 goto 59\n" +
- " 40 aload_3 [invalidCharacters]\n" +
- " 41 iload 4 [i]\n" +
- " 43 aload_2 [invalidCharactersList]\n" +
- " 44 iload 4 [i]\n" +
- " 46 invokevirtual java.util.LinkedList.get(int) : java.lang.Object [45]\n" +
- " 49 checkcast java.lang.Character [49]\n" +
- " 52 invokevirtual java.lang.Character.charValue() : char [51]\n" +
- " 55 castore\n" +
- " 56 iinc 4 1 [i]\n" +
- " 59 iload 4 [i]\n" +
- " 61 aload_3 [invalidCharacters]\n" +
- " 62 arraylength\n" +
- " 63 if_icmplt 40\n" +
- " 66 new Y [55]\n" +
- " 69 dup\n" +
- " 70 invokespecial Y() [57]\n" +
- " 73 astore 4 [inputVerifier]\n" +
- " 75 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 44]\n" +
- " [pc: 8, line: 45]\n" +
- " [pc: 19, line: 46]\n" +
- " [pc: 27, line: 47]\n" +
- " [pc: 34, line: 48]\n" +
- " [pc: 40, line: 49]\n" +
- " [pc: 56, line: 48]\n" +
- " [pc: 66, line: 51]\n" +
- " [pc: 75, line: 52]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 76] local: this index: 0 type: X2\n" +
- " [pc: 8, pc: 76] local: selector index: 1 type: java.lang.Object\n" +
- " [pc: 27, pc: 76] local: invalidCharactersList index: 2 type: java.util.LinkedList\n" +
- " [pc: 34, pc: 76] local: invalidCharacters index: 3 type: char[]\n" +
- " [pc: 37, pc: 66] local: i index: 4 type: int\n" +
- " [pc: 75, pc: 76] local: inputVerifier index: 4 type: Y\n" +
- " Local variable type table:\n" +
- " [pc: 27, pc: 76] local: invalidCharactersList index: 2 type: java.util.LinkedList<java.lang.Character>\n" +
- " Stack map table: number of frames 2\n" +
- " [pc: 40, full, stack: {}, locals: {X2, java.lang.Object, java.util.LinkedList, char[], int}]\n" +
+ " // Method descriptor #16 ()V\n" +
+ " // Stack: 4, Locals: 5\n" +
+ " private void init();\n" +
+ " 0 new java.lang.Object [32]\n" +
+ " 3 dup\n" +
+ " 4 invokespecial java.lang.Object() [34]\n" +
+ " 7 astore_1 [selector]\n" +
+ " 8 aload_0 [this]\n" +
+ " 9 new java.lang.Object [32]\n" +
+ " 12 dup\n" +
+ " 13 invokespecial java.lang.Object() [34]\n" +
+ " 16 putfield X2.name : java.lang.Object [35]\n" +
+ " 19 new java.util.LinkedList [38]\n" +
+ " 22 dup\n" +
+ " 23 invokespecial java.util.LinkedList() [40]\n" +
+ " 26 astore_2 [invalidCharactersList]\n" +
+ " 27 aload_2 [invalidCharactersList]\n" +
+ " 28 invokevirtual java.util.LinkedList.size() : int [41]\n" +
+ " 31 newarray char [5]\n" +
+ " 33 astore_3 [invalidCharacters]\n" +
+ " 34 iconst_0\n" +
+ " 35 istore 4 [i]\n" +
+ " 37 goto 59\n" +
+ " 40 aload_3 [invalidCharacters]\n" +
+ " 41 iload 4 [i]\n" +
+ " 43 aload_2 [invalidCharactersList]\n" +
+ " 44 iload 4 [i]\n" +
+ " 46 invokevirtual java.util.LinkedList.get(int) : java.lang.Object [45]\n" +
+ " 49 checkcast java.lang.Character [49]\n" +
+ " 52 invokevirtual java.lang.Character.charValue() : char [51]\n" +
+ " 55 castore\n" +
+ " 56 iinc 4 1 [i]\n" +
+ " 59 iload 4 [i]\n" +
+ " 61 aload_3 [invalidCharacters]\n" +
+ " 62 arraylength\n" +
+ " 63 if_icmplt 40\n" +
+ " 66 new Y [55]\n" +
+ " 69 dup\n" +
+ " 70 invokespecial Y() [57]\n" +
+ " 73 astore 4 [inputVerifier]\n" +
+ " 75 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 44]\n" +
+ " [pc: 8, line: 45]\n" +
+ " [pc: 19, line: 46]\n" +
+ " [pc: 27, line: 47]\n" +
+ " [pc: 34, line: 48]\n" +
+ " [pc: 40, line: 49]\n" +
+ " [pc: 56, line: 48]\n" +
+ " [pc: 66, line: 51]\n" +
+ " [pc: 75, line: 52]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 76] local: this index: 0 type: X2\n" +
+ " [pc: 8, pc: 76] local: selector index: 1 type: java.lang.Object\n" +
+ " [pc: 27, pc: 76] local: invalidCharactersList index: 2 type: java.util.LinkedList\n" +
+ " [pc: 34, pc: 76] local: invalidCharacters index: 3 type: char[]\n" +
+ " [pc: 37, pc: 66] local: i index: 4 type: int\n" +
+ " [pc: 75, pc: 76] local: inputVerifier index: 4 type: Y\n" +
+ " Local variable type table:\n" +
+ " [pc: 27, pc: 76] local: invalidCharactersList index: 2 type: java.util.LinkedList<java.lang.Character>\n" +
+ " Stack map table: number of frames 2\n" +
+ " [pc: 40, full, stack: {}, locals: {X2, java.lang.Object, java.util.LinkedList, char[], int}]\n" +
" [pc: 59, same]\n";
int index = actualOutput.indexOf(expectedOutput);
@@ -8384,24 +8384,24 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X2.java",
- "import java.util.LinkedList;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "\n" +
- "abstract class X1 {\n" +
- " protected @NonNull Object name = new Object();\n" +
- "}\n" +
- "\n" +
- "public class X2 extends X1 {\n" +
- " void init () {\n" +
- " this.name = new Object ();\n" +
- " LinkedList<Character> l = new LinkedList<Character> ();\n" +
- " char[] cs = new char[l.size ()];\n" +
- " for (int i = 0; i < cs.length; i++) {\n" +
- " cs[i] = l.get (i).charValue ();\n" +
- " }\n" +
- " Object o2 = new Object();\n" +
- " }\n" +
+ "import java.util.LinkedList;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "\n" +
+ "abstract class X1 {\n" +
+ " protected @NonNull Object name = new Object();\n" +
+ "}\n" +
+ "\n" +
+ "public class X2 extends X1 {\n" +
+ " void init () {\n" +
+ " this.name = new Object ();\n" +
+ " LinkedList<Character> l = new LinkedList<Character> ();\n" +
+ " char[] cs = new char[l.size ()];\n" +
+ " for (int i = 0; i < cs.length; i++) {\n" +
+ " cs[i] = l.get (i).charValue ();\n" +
+ " }\n" +
+ " Object o2 = new Object();\n" +
+ " }\n" +
"}\n",
},
"",
@@ -8421,63 +8421,63 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " // Method descriptor #6 ()V\n" +
- " // Stack: 4, Locals: 4\n" +
- " void init();\n" +
- " 0 aload_0 [this]\n" +
- " 1 new java.lang.Object [15]\n" +
- " 4 dup\n" +
- " 5 invokespecial java.lang.Object() [17]\n" +
- " 8 putfield X2.name : java.lang.Object [18]\n" +
- " 11 new java.util.LinkedList [22]\n" +
- " 14 dup\n" +
- " 15 invokespecial java.util.LinkedList() [24]\n" +
- " 18 astore_1 [l]\n" +
- " 19 aload_1 [l]\n" +
- " 20 invokevirtual java.util.LinkedList.size() : int [25]\n" +
- " 23 newarray char [5]\n" +
- " 25 astore_2 [cs]\n" +
- " 26 iconst_0\n" +
- " 27 istore_3 [i]\n" +
- " 28 goto 48\n" +
- " 31 aload_2 [cs]\n" +
- " 32 iload_3 [i]\n" +
- " 33 aload_1 [l]\n" +
- " 34 iload_3 [i]\n" +
- " 35 invokevirtual java.util.LinkedList.get(int) : java.lang.Object [29]\n" +
- " 38 checkcast java.lang.Character [33]\n" +
- " 41 invokevirtual java.lang.Character.charValue() : char [35]\n" +
- " 44 castore\n" +
- " 45 iinc 3 1 [i]\n" +
- " 48 iload_3 [i]\n" +
- " 49 aload_2 [cs]\n" +
- " 50 arraylength\n" +
- " 51 if_icmplt 31\n" +
- " 54 new java.lang.Object [15]\n" +
- " 57 dup\n" +
- " 58 invokespecial java.lang.Object() [17]\n" +
- " 61 astore_3 [o2]\n" +
- " 62 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 11]\n" +
- " [pc: 11, line: 12]\n" +
- " [pc: 19, line: 13]\n" +
- " [pc: 26, line: 14]\n" +
- " [pc: 31, line: 15]\n" +
- " [pc: 45, line: 14]\n" +
- " [pc: 54, line: 17]\n" +
- " [pc: 62, line: 18]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 63] local: this index: 0 type: X2\n" +
- " [pc: 19, pc: 63] local: l index: 1 type: java.util.LinkedList\n" +
- " [pc: 26, pc: 63] local: cs index: 2 type: char[]\n" +
- " [pc: 28, pc: 54] local: i index: 3 type: int\n" +
- " [pc: 62, pc: 63] local: o2 index: 3 type: java.lang.Object\n" +
- " Local variable type table:\n" +
- " [pc: 19, pc: 63] local: l index: 1 type: java.util.LinkedList<java.lang.Character>\n" +
- " Stack map table: number of frames 2\n" +
- " [pc: 31, append: {java.util.LinkedList, char[], int}]\n" +
- " [pc: 48, same]\n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 4, Locals: 4\n" +
+ " void init();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 new java.lang.Object [15]\n" +
+ " 4 dup\n" +
+ " 5 invokespecial java.lang.Object() [17]\n" +
+ " 8 putfield X2.name : java.lang.Object [18]\n" +
+ " 11 new java.util.LinkedList [22]\n" +
+ " 14 dup\n" +
+ " 15 invokespecial java.util.LinkedList() [24]\n" +
+ " 18 astore_1 [l]\n" +
+ " 19 aload_1 [l]\n" +
+ " 20 invokevirtual java.util.LinkedList.size() : int [25]\n" +
+ " 23 newarray char [5]\n" +
+ " 25 astore_2 [cs]\n" +
+ " 26 iconst_0\n" +
+ " 27 istore_3 [i]\n" +
+ " 28 goto 48\n" +
+ " 31 aload_2 [cs]\n" +
+ " 32 iload_3 [i]\n" +
+ " 33 aload_1 [l]\n" +
+ " 34 iload_3 [i]\n" +
+ " 35 invokevirtual java.util.LinkedList.get(int) : java.lang.Object [29]\n" +
+ " 38 checkcast java.lang.Character [33]\n" +
+ " 41 invokevirtual java.lang.Character.charValue() : char [35]\n" +
+ " 44 castore\n" +
+ " 45 iinc 3 1 [i]\n" +
+ " 48 iload_3 [i]\n" +
+ " 49 aload_2 [cs]\n" +
+ " 50 arraylength\n" +
+ " 51 if_icmplt 31\n" +
+ " 54 new java.lang.Object [15]\n" +
+ " 57 dup\n" +
+ " 58 invokespecial java.lang.Object() [17]\n" +
+ " 61 astore_3 [o2]\n" +
+ " 62 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 11]\n" +
+ " [pc: 11, line: 12]\n" +
+ " [pc: 19, line: 13]\n" +
+ " [pc: 26, line: 14]\n" +
+ " [pc: 31, line: 15]\n" +
+ " [pc: 45, line: 14]\n" +
+ " [pc: 54, line: 17]\n" +
+ " [pc: 62, line: 18]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 63] local: this index: 0 type: X2\n" +
+ " [pc: 19, pc: 63] local: l index: 1 type: java.util.LinkedList\n" +
+ " [pc: 26, pc: 63] local: cs index: 2 type: char[]\n" +
+ " [pc: 28, pc: 54] local: i index: 3 type: int\n" +
+ " [pc: 62, pc: 63] local: o2 index: 3 type: java.lang.Object\n" +
+ " Local variable type table:\n" +
+ " [pc: 19, pc: 63] local: l index: 1 type: java.util.LinkedList<java.lang.Character>\n" +
+ " Stack map table: number of frames 2\n" +
+ " [pc: 31, append: {java.util.LinkedList, char[], int}]\n" +
+ " [pc: 48, same]\n" +
"}";
int index = actualOutput.indexOf(expectedOutput);
@@ -8501,24 +8501,24 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X2.java",
- "import java.util.LinkedList;\n" +
- "\n" +
- "import org.eclipse.jdt.annotation.NonNull;\n" +
- "\n" +
- "abstract class X1 {\n" +
- " protected @NonNull Object name = new Object();\n" +
- "}\n" +
- "\n" +
- "public class X2 extends X1 {\n" +
- " void init () {\n" +
- " name = new Object ();\n" +
- " LinkedList<Character> l = new LinkedList<Character> ();\n" +
- " char[] cs = new char[l.size ()];\n" +
- " for (int i = 0; i < cs.length; i++) {\n" +
- " cs[i] = l.get (i).charValue ();\n" +
- " }\n" +
- " Object o2 = new Object();\n" +
- " }\n" +
+ "import java.util.LinkedList;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "\n" +
+ "abstract class X1 {\n" +
+ " protected @NonNull Object name = new Object();\n" +
+ "}\n" +
+ "\n" +
+ "public class X2 extends X1 {\n" +
+ " void init () {\n" +
+ " name = new Object ();\n" +
+ " LinkedList<Character> l = new LinkedList<Character> ();\n" +
+ " char[] cs = new char[l.size ()];\n" +
+ " for (int i = 0; i < cs.length; i++) {\n" +
+ " cs[i] = l.get (i).charValue ();\n" +
+ " }\n" +
+ " Object o2 = new Object();\n" +
+ " }\n" +
"}\n",
},
"",
@@ -8538,63 +8538,63 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " // Method descriptor #6 ()V\n" +
- " // Stack: 4, Locals: 4\n" +
- " void init();\n" +
- " 0 aload_0 [this]\n" +
- " 1 new java.lang.Object [15]\n" +
- " 4 dup\n" +
- " 5 invokespecial java.lang.Object() [17]\n" +
- " 8 putfield X2.name : java.lang.Object [18]\n" +
- " 11 new java.util.LinkedList [22]\n" +
- " 14 dup\n" +
- " 15 invokespecial java.util.LinkedList() [24]\n" +
- " 18 astore_1 [l]\n" +
- " 19 aload_1 [l]\n" +
- " 20 invokevirtual java.util.LinkedList.size() : int [25]\n" +
- " 23 newarray char [5]\n" +
- " 25 astore_2 [cs]\n" +
- " 26 iconst_0\n" +
- " 27 istore_3 [i]\n" +
- " 28 goto 48\n" +
- " 31 aload_2 [cs]\n" +
- " 32 iload_3 [i]\n" +
- " 33 aload_1 [l]\n" +
- " 34 iload_3 [i]\n" +
- " 35 invokevirtual java.util.LinkedList.get(int) : java.lang.Object [29]\n" +
- " 38 checkcast java.lang.Character [33]\n" +
- " 41 invokevirtual java.lang.Character.charValue() : char [35]\n" +
- " 44 castore\n" +
- " 45 iinc 3 1 [i]\n" +
- " 48 iload_3 [i]\n" +
- " 49 aload_2 [cs]\n" +
- " 50 arraylength\n" +
- " 51 if_icmplt 31\n" +
- " 54 new java.lang.Object [15]\n" +
- " 57 dup\n" +
- " 58 invokespecial java.lang.Object() [17]\n" +
- " 61 astore_3 [o2]\n" +
- " 62 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 11]\n" +
- " [pc: 11, line: 12]\n" +
- " [pc: 19, line: 13]\n" +
- " [pc: 26, line: 14]\n" +
- " [pc: 31, line: 15]\n" +
- " [pc: 45, line: 14]\n" +
- " [pc: 54, line: 17]\n" +
- " [pc: 62, line: 18]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 63] local: this index: 0 type: X2\n" +
- " [pc: 19, pc: 63] local: l index: 1 type: java.util.LinkedList\n" +
- " [pc: 26, pc: 63] local: cs index: 2 type: char[]\n" +
- " [pc: 28, pc: 54] local: i index: 3 type: int\n" +
- " [pc: 62, pc: 63] local: o2 index: 3 type: java.lang.Object\n" +
- " Local variable type table:\n" +
- " [pc: 19, pc: 63] local: l index: 1 type: java.util.LinkedList<java.lang.Character>\n" +
- " Stack map table: number of frames 2\n" +
- " [pc: 31, append: {java.util.LinkedList, char[], int}]\n" +
- " [pc: 48, same]\n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 4, Locals: 4\n" +
+ " void init();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 new java.lang.Object [15]\n" +
+ " 4 dup\n" +
+ " 5 invokespecial java.lang.Object() [17]\n" +
+ " 8 putfield X2.name : java.lang.Object [18]\n" +
+ " 11 new java.util.LinkedList [22]\n" +
+ " 14 dup\n" +
+ " 15 invokespecial java.util.LinkedList() [24]\n" +
+ " 18 astore_1 [l]\n" +
+ " 19 aload_1 [l]\n" +
+ " 20 invokevirtual java.util.LinkedList.size() : int [25]\n" +
+ " 23 newarray char [5]\n" +
+ " 25 astore_2 [cs]\n" +
+ " 26 iconst_0\n" +
+ " 27 istore_3 [i]\n" +
+ " 28 goto 48\n" +
+ " 31 aload_2 [cs]\n" +
+ " 32 iload_3 [i]\n" +
+ " 33 aload_1 [l]\n" +
+ " 34 iload_3 [i]\n" +
+ " 35 invokevirtual java.util.LinkedList.get(int) : java.lang.Object [29]\n" +
+ " 38 checkcast java.lang.Character [33]\n" +
+ " 41 invokevirtual java.lang.Character.charValue() : char [35]\n" +
+ " 44 castore\n" +
+ " 45 iinc 3 1 [i]\n" +
+ " 48 iload_3 [i]\n" +
+ " 49 aload_2 [cs]\n" +
+ " 50 arraylength\n" +
+ " 51 if_icmplt 31\n" +
+ " 54 new java.lang.Object [15]\n" +
+ " 57 dup\n" +
+ " 58 invokespecial java.lang.Object() [17]\n" +
+ " 61 astore_3 [o2]\n" +
+ " 62 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 11]\n" +
+ " [pc: 11, line: 12]\n" +
+ " [pc: 19, line: 13]\n" +
+ " [pc: 26, line: 14]\n" +
+ " [pc: 31, line: 15]\n" +
+ " [pc: 45, line: 14]\n" +
+ " [pc: 54, line: 17]\n" +
+ " [pc: 62, line: 18]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 63] local: this index: 0 type: X2\n" +
+ " [pc: 19, pc: 63] local: l index: 1 type: java.util.LinkedList\n" +
+ " [pc: 26, pc: 63] local: cs index: 2 type: char[]\n" +
+ " [pc: 28, pc: 54] local: i index: 3 type: int\n" +
+ " [pc: 62, pc: 63] local: o2 index: 3 type: java.lang.Object\n" +
+ " Local variable type table:\n" +
+ " [pc: 19, pc: 63] local: l index: 1 type: java.util.LinkedList<java.lang.Character>\n" +
+ " Stack map table: number of frames 2\n" +
+ " [pc: 31, append: {java.util.LinkedList, char[], int}]\n" +
+ " [pc: 48, same]\n" +
"}";
int index = actualOutput.indexOf(expectedOutput);
@@ -8609,33 +8609,33 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " X error = new X();\n" +
- " error.reproduce(\"hello\");\n" +
- " System.out.println(\"DONE\");\n" +
- " }\n" +
- " \n" +
- " public Object reproduce(Object param) throws RuntimeException {\n" +
- " Object local;\n" +
- " try {\n" +
- " return param; \n" +
- " } \n" +
- " catch (RuntimeException e) {\n" +
- " return null;\n" +
- " } \n" +
- " finally {\n" +
- " if (param != null) {\n" +
- " System.out.println(\"FINALLY\");\n" +
- " }\n" +
- " local = null;\n" +
- " }\n" +
- " }\n" +
- "}\n" +
+ "public class X {\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " X error = new X();\n" +
+ " error.reproduce(\"hello\");\n" +
+ " System.out.println(\"DONE\");\n" +
+ " }\n" +
+ " \n" +
+ " public Object reproduce(Object param) throws RuntimeException {\n" +
+ " Object local;\n" +
+ " try {\n" +
+ " return param; \n" +
+ " } \n" +
+ " catch (RuntimeException e) {\n" +
+ " return null;\n" +
+ " } \n" +
+ " finally {\n" +
+ " if (param != null) {\n" +
+ " System.out.println(\"FINALLY\");\n" +
+ " }\n" +
+ " local = null;\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
"",
},
- "FINALLY\n" +
+ "FINALLY\n" +
"DONE");
ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
@@ -8646,72 +8646,72 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
"\n",
ClassFileBytesDisassembler.DETAILED);
String expectedOutput =
- " // Stack: 2, Locals: 6\n" +
- " public java.lang.Object reproduce(java.lang.Object param) throws java.lang.RuntimeException;\n" +
- " 0 aload_1 [param]\n" +
- " 1 astore 5\n" +
- " 3 aload_1 [param]\n" +
- " 4 ifnull 15\n" +
- " 7 getstatic java.lang.System.out : java.io.PrintStream [23]\n" +
- " 10 ldc <String \"FINALLY\"> [43]\n" +
- " 12 invokevirtual java.io.PrintStream.println(java.lang.String) : void [31]\n" +
- " 15 aconst_null\n" +
- " 16 astore_2 [local]\n" +
- " 17 aload 5\n" +
- " 19 areturn\n" +
- " 20 astore_3 [e]\n" +
- " 21 aload_1 [param]\n" +
- " 22 ifnull 33\n" +
- " 25 getstatic java.lang.System.out : java.io.PrintStream [23]\n" +
- " 28 ldc <String \"FINALLY\"> [43]\n" +
- " 30 invokevirtual java.io.PrintStream.println(java.lang.String) : void [31]\n" +
- " 33 aconst_null\n" +
- " 34 astore_2 [local]\n" +
- " 35 aconst_null\n" +
- " 36 areturn\n" +
- " 37 astore 4\n" +
- " 39 aload_1 [param]\n" +
- " 40 ifnull 51\n" +
- " 43 getstatic java.lang.System.out : java.io.PrintStream [23]\n" +
- " 46 ldc <String \"FINALLY\"> [43]\n" +
- " 48 invokevirtual java.io.PrintStream.println(java.lang.String) : void [31]\n" +
- " 51 aconst_null\n" +
- " 52 astore_2 [local]\n" +
- " 53 aload 4\n" +
- " 55 athrow\n" +
- " Exception Table:\n" +
- " [pc: 0, pc: 3] -> 20 when : java.lang.RuntimeException\n" +
- " [pc: 0, pc: 3] -> 37 when : any\n" +
- " [pc: 20, pc: 21] -> 37 when : any\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 12]\n" +
- " [pc: 3, line: 18]\n" +
- " [pc: 7, line: 19]\n" +
- " [pc: 15, line: 21]\n" +
- " [pc: 17, line: 12]\n" +
- " [pc: 20, line: 14]\n" +
- " [pc: 21, line: 18]\n" +
- " [pc: 25, line: 19]\n" +
- " [pc: 33, line: 21]\n" +
- " [pc: 35, line: 15]\n" +
- " [pc: 37, line: 17]\n" +
- " [pc: 39, line: 18]\n" +
- " [pc: 43, line: 19]\n" +
- " [pc: 51, line: 21]\n" +
- " [pc: 53, line: 22]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 56] local: this index: 0 type: X\n" +
- " [pc: 0, pc: 56] local: param index: 1 type: java.lang.Object\n" +
- " [pc: 17, pc: 20] local: local index: 2 type: java.lang.Object\n" +
- " [pc: 35, pc: 37] local: local index: 2 type: java.lang.Object\n" +
- " [pc: 53, pc: 56] local: local index: 2 type: java.lang.Object\n" +
- " [pc: 21, pc: 37] local: e index: 3 type: java.lang.RuntimeException\n" +
- " Stack map table: number of frames 5\n" +
- " [pc: 15, full, stack: {}, locals: {X, java.lang.Object, _, _, _, java.lang.Object}]\n" +
- " [pc: 20, full, stack: {java.lang.RuntimeException}, locals: {X, java.lang.Object}]\n" +
- " [pc: 33, full, stack: {}, locals: {X, java.lang.Object, _, java.lang.RuntimeException}]\n" +
- " [pc: 37, full, stack: {java.lang.Throwable}, locals: {X, java.lang.Object}]\n" +
- " [pc: 51, full, stack: {}, locals: {X, java.lang.Object, _, _, java.lang.Throwable}]\n" +
+ " // Stack: 2, Locals: 6\n" +
+ " public java.lang.Object reproduce(java.lang.Object param) throws java.lang.RuntimeException;\n" +
+ " 0 aload_1 [param]\n" +
+ " 1 astore 5\n" +
+ " 3 aload_1 [param]\n" +
+ " 4 ifnull 15\n" +
+ " 7 getstatic java.lang.System.out : java.io.PrintStream [23]\n" +
+ " 10 ldc <String \"FINALLY\"> [43]\n" +
+ " 12 invokevirtual java.io.PrintStream.println(java.lang.String) : void [31]\n" +
+ " 15 aconst_null\n" +
+ " 16 astore_2 [local]\n" +
+ " 17 aload 5\n" +
+ " 19 areturn\n" +
+ " 20 astore_3 [e]\n" +
+ " 21 aload_1 [param]\n" +
+ " 22 ifnull 33\n" +
+ " 25 getstatic java.lang.System.out : java.io.PrintStream [23]\n" +
+ " 28 ldc <String \"FINALLY\"> [43]\n" +
+ " 30 invokevirtual java.io.PrintStream.println(java.lang.String) : void [31]\n" +
+ " 33 aconst_null\n" +
+ " 34 astore_2 [local]\n" +
+ " 35 aconst_null\n" +
+ " 36 areturn\n" +
+ " 37 astore 4\n" +
+ " 39 aload_1 [param]\n" +
+ " 40 ifnull 51\n" +
+ " 43 getstatic java.lang.System.out : java.io.PrintStream [23]\n" +
+ " 46 ldc <String \"FINALLY\"> [43]\n" +
+ " 48 invokevirtual java.io.PrintStream.println(java.lang.String) : void [31]\n" +
+ " 51 aconst_null\n" +
+ " 52 astore_2 [local]\n" +
+ " 53 aload 4\n" +
+ " 55 athrow\n" +
+ " Exception Table:\n" +
+ " [pc: 0, pc: 3] -> 20 when : java.lang.RuntimeException\n" +
+ " [pc: 0, pc: 3] -> 37 when : any\n" +
+ " [pc: 20, pc: 21] -> 37 when : any\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 12]\n" +
+ " [pc: 3, line: 18]\n" +
+ " [pc: 7, line: 19]\n" +
+ " [pc: 15, line: 21]\n" +
+ " [pc: 17, line: 12]\n" +
+ " [pc: 20, line: 14]\n" +
+ " [pc: 21, line: 18]\n" +
+ " [pc: 25, line: 19]\n" +
+ " [pc: 33, line: 21]\n" +
+ " [pc: 35, line: 15]\n" +
+ " [pc: 37, line: 17]\n" +
+ " [pc: 39, line: 18]\n" +
+ " [pc: 43, line: 19]\n" +
+ " [pc: 51, line: 21]\n" +
+ " [pc: 53, line: 22]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 56] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 56] local: param index: 1 type: java.lang.Object\n" +
+ " [pc: 17, pc: 20] local: local index: 2 type: java.lang.Object\n" +
+ " [pc: 35, pc: 37] local: local index: 2 type: java.lang.Object\n" +
+ " [pc: 53, pc: 56] local: local index: 2 type: java.lang.Object\n" +
+ " [pc: 21, pc: 37] local: e index: 3 type: java.lang.RuntimeException\n" +
+ " Stack map table: number of frames 5\n" +
+ " [pc: 15, full, stack: {}, locals: {X, java.lang.Object, _, _, _, java.lang.Object}]\n" +
+ " [pc: 20, full, stack: {java.lang.RuntimeException}, locals: {X, java.lang.Object}]\n" +
+ " [pc: 33, full, stack: {}, locals: {X, java.lang.Object, _, java.lang.RuntimeException}]\n" +
+ " [pc: 37, full, stack: {java.lang.Throwable}, locals: {X, java.lang.Object}]\n" +
+ " [pc: 51, full, stack: {}, locals: {X, java.lang.Object, _, _, java.lang.Throwable}]\n" +
"}";
int index = actualOutput.indexOf(expectedOutput);
@@ -8727,44 +8727,44 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "interface A {\n" +
- "}\n" +
- "class B implements A {\n" +
- " public C c;\n" +
- " \n" +
- " protected B original() {\n" +
- " return this;\n" +
- " }\n" +
- "}\n" +
- "class C {\n" +
- " C parent;\n" +
- " A context;\n" +
- "}\n" +
- "class F extends C {\n" +
- " \n" +
- "}\n" +
- "class G extends C {\n" +
- " \n" +
- "}\n" +
- "abstract class D implements A {\n" +
- " public F c;\n" +
- "}\n" +
- "class E implements A {\n" +
- " public G c;\n" +
- "}\n" +
- "public class X {\n" +
- " boolean foo(A a) {\n" +
- " if (a instanceof B && a != ((B) a).original())\n" +
- " return true;\n" +
- " C aC = a instanceof D ? ((D) a).c :\n" +
- " a instanceof E ? ((E) a).c : \n" +
- " a instanceof B ? ((B) a).c :\n" +
- " null;\n" +
- " return aC != null ? foo(aC.parent.context) : false;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
+ "interface A {\n" +
+ "}\n" +
+ "class B implements A {\n" +
+ " public C c;\n" +
+ " \n" +
+ " protected B original() {\n" +
+ " return this;\n" +
+ " }\n" +
+ "}\n" +
+ "class C {\n" +
+ " C parent;\n" +
+ " A context;\n" +
+ "}\n" +
+ "class F extends C {\n" +
+ " \n" +
+ "}\n" +
+ "class G extends C {\n" +
+ " \n" +
+ "}\n" +
+ "abstract class D implements A {\n" +
+ " public F c;\n" +
+ "}\n" +
+ "class E implements A {\n" +
+ " public G c;\n" +
+ "}\n" +
+ "public class X {\n" +
+ " boolean foo(A a) {\n" +
+ " if (a instanceof B && a != ((B) a).original())\n" +
+ " return true;\n" +
+ " C aC = a instanceof D ? ((D) a).c :\n" +
+ " a instanceof E ? ((E) a).c : \n" +
+ " a instanceof B ? ((B) a).c :\n" +
+ " null;\n" +
+ " return aC != null ? foo(aC.parent.context) : false;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " }\n" +
"}",
},
"SUCCESS");
@@ -8773,26 +8773,26 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- "\n" +
- " int size;\n" +
- " char[][][] elements;\n" +
- "\n" +
- " public X() {\n" +
- " this.size = 0;\n" +
- " this.elements = new char[10][][];\n" +
- " }\n" +
- "\n" +
- " public void insertIntoArray(char[][][] target) {\n" +
- " }\n" +
- "\n" +
- " public void add(char[][] newElement) {\n" +
- " insertIntoArray(this.size < this.elements.length ? this.elements : new char[this.elements.length * 2][][]);\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
+ "public class X {\n" +
+ "\n" +
+ " int size;\n" +
+ " char[][][] elements;\n" +
+ "\n" +
+ " public X() {\n" +
+ " this.size = 0;\n" +
+ " this.elements = new char[10][][];\n" +
+ " }\n" +
+ "\n" +
+ " public void insertIntoArray(char[][][] target) {\n" +
+ " }\n" +
+ "\n" +
+ " public void add(char[][] newElement) {\n" +
+ " insertIntoArray(this.size < this.elements.length ? this.elements : new char[this.elements.length * 2][][]);\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " }\n" +
"}",
},
"SUCCESS");
@@ -8801,31 +8801,31 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "class B {\n" +
- " public boolean bar() {\n" +
- " return false;\n" +
- " }\n" +
- " public void foo() {}\n" +
- "}\n" +
- "public class X {\n" +
- " \n" +
- " public B foo(boolean test) {\n" +
- " B b =\n" +
- " test ?\n" +
- " new B() {\n" +
- " @Override\n" +
- " public boolean bar() {\n" +
- " return true;\n" +
- " }\n" +
- " } :\n" +
- " new B();\n" +
- " b.foo();\n" +
- " return b;\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
+ "class B {\n" +
+ " public boolean bar() {\n" +
+ " return false;\n" +
+ " }\n" +
+ " public void foo() {}\n" +
+ "}\n" +
+ "public class X {\n" +
+ " \n" +
+ " public B foo(boolean test) {\n" +
+ " B b =\n" +
+ " test ?\n" +
+ " new B() {\n" +
+ " @Override\n" +
+ " public boolean bar() {\n" +
+ " return true;\n" +
+ " }\n" +
+ " } :\n" +
+ " new B();\n" +
+ " b.foo();\n" +
+ " return b;\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " }\n" +
"}",
},
"SUCCESS");
@@ -8834,29 +8834,29 @@ public class StackMapAttributeTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " \n" +
- " public static void main( String[] args ) {\n" +
- " System.out.println(new X().getText());\n" +
- " }\n" +
- "\n" +
- " public String getText() {\n" +
- " Long lValue1 = getValue1();\n" +
- " Long lValue2 = getValue2();\n" +
- " return ( isValue1() ? \"\" : ( lValue1 == null ? \"\" : lValue1.toString() ) + \"-\" ) + ( lValue2 == null ? \"\" : lValue2.toString() );\n" +
- " }\n" +
- "\n" +
- " private Long getValue1() {\n" +
- " return Long.valueOf( 1 );\n" +
- " }\n" +
- "\n" +
- " private Long getValue2() {\n" +
- " return Long.valueOf( 1 );\n" +
- " }\n" +
- "\n" +
- " private boolean isValue1() {\n" +
- " return false;\n" +
- " }\n" +
+ "public class X {\n" +
+ " \n" +
+ " public static void main( String[] args ) {\n" +
+ " System.out.println(new X().getText());\n" +
+ " }\n" +
+ "\n" +
+ " public String getText() {\n" +
+ " Long lValue1 = getValue1();\n" +
+ " Long lValue2 = getValue2();\n" +
+ " return ( isValue1() ? \"\" : ( lValue1 == null ? \"\" : lValue1.toString() ) + \"-\" ) + ( lValue2 == null ? \"\" : lValue2.toString() );\n" +
+ " }\n" +
+ "\n" +
+ " private Long getValue1() {\n" +
+ " return Long.valueOf( 1 );\n" +
+ " }\n" +
+ "\n" +
+ " private Long getValue2() {\n" +
+ " return Long.valueOf( 1 );\n" +
+ " }\n" +
+ "\n" +
+ " private boolean isValue1() {\n" +
+ " return false;\n" +
+ " }\n" +
"}",
},
"1-1");
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StaticImportTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StaticImportTest.java
index d76b71d28..49135bc9f 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StaticImportTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StaticImportTest.java
@@ -498,46 +498,46 @@ public class StaticImportTest extends AbstractComparableTest {
" public static class WW { public static final int WWW = 0; }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " import static p.Y.Zz;\n" +
- " ^^^^^^\n" +
- "The import p.Y.Zz cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " import static p.Z.Zz.WW.*;\n" +
- " ^^^^^^^^^\n" +
- "The import p.Z.Zz.WW cannot be resolved\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " import p.Y.ZZ;\n" +
- " ^^^^^^\n" +
- "The import p.Y.ZZ cannot be resolved\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " import static p.Y.ZZ.*;\n" +
- " ^^^^^^\n" +
- "The import p.Y.ZZ cannot be resolved\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 10)\n" +
- " import static p.Y.ZZ.WW;\n" +
- " ^^^^^^\n" +
- "The import p.Y.ZZ cannot be resolved\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 11)\n" +
- " import static p.Y.ZZ.WW.*;\n" +
- " ^^^^^^\n" +
- "The import p.Y.ZZ cannot be resolved\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 12)\n" +
- " import static p.Y.ZZ.ZZZ;\n" +
- " ^^^^^^\n" +
- "The import p.Y.ZZ cannot be resolved\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 13)\n" +
- " import static p.Y.ZZ.WW.WWW;\n" +
- " ^^^^^^\n" +
- "The import p.Y.ZZ cannot be resolved\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " import static p.Y.Zz;\n" +
+ " ^^^^^^\n" +
+ "The import p.Y.Zz cannot be resolved\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " import static p.Z.Zz.WW.*;\n" +
+ " ^^^^^^^^^\n" +
+ "The import p.Z.Zz.WW cannot be resolved\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " import p.Y.ZZ;\n" +
+ " ^^^^^^\n" +
+ "The import p.Y.ZZ cannot be resolved\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 9)\n" +
+ " import static p.Y.ZZ.*;\n" +
+ " ^^^^^^\n" +
+ "The import p.Y.ZZ cannot be resolved\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 10)\n" +
+ " import static p.Y.ZZ.WW;\n" +
+ " ^^^^^^\n" +
+ "The import p.Y.ZZ cannot be resolved\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 11)\n" +
+ " import static p.Y.ZZ.WW.*;\n" +
+ " ^^^^^^\n" +
+ "The import p.Y.ZZ cannot be resolved\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 12)\n" +
+ " import static p.Y.ZZ.ZZZ;\n" +
+ " ^^^^^^\n" +
+ "The import p.Y.ZZ cannot be resolved\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 13)\n" +
+ " import static p.Y.ZZ.WW.WWW;\n" +
+ " ^^^^^^\n" +
+ "The import p.Y.ZZ cannot be resolved\n" +
"----------\n"
);
}
@@ -827,18 +827,18 @@ public class StaticImportTest extends AbstractComparableTest {
"package p;\n" +
"public class B { public static int F = 2; }\n",
},
- this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ this.complianceLevel < ClassFileConstants.JDK1_8 ?
"----------\n" +
"1. ERROR in X.java (at line 2)\n" +
" import static p.B.F;\n" +
" ^^^^^\n" +
"The import p.B.F collides with another import statement\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " int i = F;\n" +
- " ^\n" +
- "The field F is ambiguous\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " int i = F;\n" +
+ " ^\n" +
+ "The field F is ambiguous\n" +
"----------\n"
// F is already defined in a single-type import
);
@@ -2426,51 +2426,51 @@ public class StaticImportTest extends AbstractComparableTest {
this.runConformTest(
new String[] {
"node/Test.java",//------------------------------
- "package node;\n" +
- "public class Test {\n" +
- " public static void node() {}\n" +
+ "package node;\n" +
+ "public class Test {\n" +
+ " public static void node() {}\n" +
"}\n",
"node2/Test2.java",//------------------------------
- "package node2;\n" +
- "import static node.Test.node;\n" +
- "public class Test2 {\n" +
+ "package node2;\n" +
+ "import static node.Test.node;\n" +
+ "public class Test2 {\n" +
"}\n",
},
"");
- }
+ }
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=250211 - variation
public void test071() {
this.runNegativeTest(
new String[] {
"node/Test/node.java",//------------------------------
- "package node.Test;\n" +
- "public class node {\n" +
- "}\n",
+ "package node.Test;\n" +
+ "public class node {\n" +
+ "}\n",
"node/Test.java",//------------------------------
- "package node;\n" +
- "public class Test {\n" +
- " public static void node() {}\n" +
+ "package node;\n" +
+ "public class Test {\n" +
+ " public static void node() {}\n" +
"}\n",
"node2/Test2.java",//------------------------------
- "package node2;\n" +
+ "package node2;\n" +
"import node.Test;\n" +
- "import static Test.node;\n" +
- "public class Test2 {\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in node\\Test.java (at line 2)\n" +
- " public class Test {\n" +
- " ^^^^\n" +
- "The type Test collides with a package\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in node2\\Test2.java (at line 3)\n" +
- " import static Test.node;\n" +
- " ^^^^\n" +
- "The import Test cannot be resolved\n" +
+ "import static Test.node;\n" +
+ "public class Test2 {\n" +
+ "}\n",
+ },
+ "----------\n" +
+ "1. ERROR in node\\Test.java (at line 2)\n" +
+ " public class Test {\n" +
+ " ^^^^\n" +
+ "The type Test collides with a package\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in node2\\Test2.java (at line 3)\n" +
+ " import static Test.node;\n" +
+ " ^^^^\n" +
+ "The import Test cannot be resolved\n" +
"----------\n");
- }
+ }
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=93913 - variation
public void test072() {
this.runNegativeTest(
@@ -2499,57 +2499,57 @@ public class StaticImportTest extends AbstractComparableTest {
" public static int B;\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in p1\\A.java (at line 6)\n" +
- " int v1 = b.fooB;\n" +
- " ^^^^\n" +
- "fooB cannot be resolved or is not a field\n" +
+ "----------\n" +
+ "1. ERROR in p1\\A.java (at line 6)\n" +
+ " int v1 = b.fooB;\n" +
+ " ^^^^\n" +
+ "fooB cannot be resolved or is not a field\n" +
"----------\n");
- }
+ }
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=256375
public void test073() {
this.runNegativeTest(
new String[] {
"test/Outer.java",
- "package test;\n" +
- "import static test.Outer.Inner.VALUE;\n" +
- "public class Outer {\n" +
- " int i = VALUE;\n" +
- " int i2 = Inner.VALUE;\n" +
- " static class Inner {\n" +
- " private static final int VALUE = 0;\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in test\\Outer.java (at line 2)\n" +
- " import static test.Outer.Inner.VALUE;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The field Outer.Inner.test.Outer.Inner.VALUE is not visible\n" +
- "----------\n" +
- "2. ERROR in test\\Outer.java (at line 4)\n" +
- " int i = VALUE;\n" +
- " ^^^^^\n" +
- "VALUE cannot be resolved to a variable\n" +
+ "package test;\n" +
+ "import static test.Outer.Inner.VALUE;\n" +
+ "public class Outer {\n" +
+ " int i = VALUE;\n" +
+ " int i2 = Inner.VALUE;\n" +
+ " static class Inner {\n" +
+ " private static final int VALUE = 0;\n" +
+ " }\n" +
+ "}\n",
+ },
+ "----------\n" +
+ "1. ERROR in test\\Outer.java (at line 2)\n" +
+ " import static test.Outer.Inner.VALUE;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The field Outer.Inner.test.Outer.Inner.VALUE is not visible\n" +
+ "----------\n" +
+ "2. ERROR in test\\Outer.java (at line 4)\n" +
+ " int i = VALUE;\n" +
+ " ^^^^^\n" +
+ "VALUE cannot be resolved to a variable\n" +
"----------\n");
- }
+ }
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=256375 - variation
public void test074() {
this.runConformTest(
new String[] {
"test/Outer.java",
- "package test;\n" +
- "import static test.Outer.Inner.*;\n" +
- "public class Outer {\n" +
- " int i = VALUE;\n" +
- " int i2 = Inner.VALUE;\n" +
- " static class Inner {\n" +
- " private static final int VALUE = 0;\n" +
- " }\n" +
+ "package test;\n" +
+ "import static test.Outer.Inner.*;\n" +
+ "public class Outer {\n" +
+ " int i = VALUE;\n" +
+ " int i2 = Inner.VALUE;\n" +
+ " static class Inner {\n" +
+ " private static final int VALUE = 0;\n" +
+ " }\n" +
"}\n",
},
"");
- }
+ }
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=302865
// To verify that a static import importing a type which has already been
// imported by a single type import is reported as duplicate
@@ -2613,28 +2613,28 @@ public class StaticImportTest extends AbstractComparableTest {
this.runConformTest(
new String[] {
"p1/X.java",
- "package p1;\n" +
- "import p2.A;\n" +
- "import static p2.A.C;\n" +
- "import static p1.B.C;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " foo();\n" +
- " }\n" +
- " public static void foo() {\n" +
- " if (C.CONST == 1) {\n" +
+ "package p1;\n" +
+ "import p2.A;\n" +
+ "import static p2.A.C;\n" +
+ "import static p1.B.C;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " foo();\n" +
+ " }\n" +
+ " public static void foo() {\n" +
+ " if (C.CONST == 1) {\n" +
" System.out.println(\"SUCCESS\");\n" +
- " return;\n" +
- " }\n" +
- " System.out.println(\"FAILED\");\n" +
- " }\n" +
- "}\n" +
+ " return;\n" +
+ " }\n" +
+ " System.out.println(\"FAILED\");\n" +
+ " }\n" +
+ "}\n" +
"class B extends A {}",
"p2/A.java",
- "package p2;\n" +
- "public class A {\n" +
- " public static class C {\n" +
- " public static int CONST = 1;\n" +
+ "package p2;\n" +
+ "public class A {\n" +
+ " public static class C {\n" +
+ " public static int CONST = 1;\n" +
" }\n" +
"}"
},
@@ -2666,11 +2666,11 @@ public class StaticImportTest extends AbstractComparableTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in A\\A.java (at line 3)\n" +
- " import B.B.C1;\n" +
- " ^^^^^^\n" +
- "The import B.B.C1 collides with another import statement\n" +
+ "----------\n" +
+ "1. ERROR in A\\A.java (at line 3)\n" +
+ " import B.B.C1;\n" +
+ " ^^^^^^\n" +
+ "The import B.B.C1 collides with another import statement\n" +
"----------\n"
);
}
@@ -2695,11 +2695,11 @@ public class StaticImportTest extends AbstractComparableTest {
" public static class C1 {}\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in A\\A.java (at line 2)\n" +
- " import static B.B.C1;\n" +
- " ^^^^^^\n" +
- "The import B.B.C1 is never used\n" +
+ "----------\n" +
+ "1. WARNING in A\\A.java (at line 2)\n" +
+ " import static B.B.C1;\n" +
+ " ^^^^^^\n" +
+ "The import B.B.C1 is never used\n" +
"----------\n"
);
}
@@ -2708,31 +2708,31 @@ public class StaticImportTest extends AbstractComparableTest {
this.runNegativeTest(
new String[] {
"a/B.java",
- "package a;\n" +
+ "package a;\n" +
"public class B {}",
"external/Lib.java",
- "package external;\n" +
- "public class Lib {\n" +
- " public static void m() {}\n" +
+ "package external;\n" +
+ "public class Lib {\n" +
+ " public static void m() {}\n" +
"}",
"a/B/C.java",
- "package a.B;\n" +
- "import static external.Lib.m;\n" +
- "public class C {\n" +
- " public void main() {\n" +
- " m();\n" +
- " }\n" +
+ "package a.B;\n" +
+ "import static external.Lib.m;\n" +
+ "public class C {\n" +
+ " public void main() {\n" +
+ " m();\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in a\\B\\C.java (at line 1)\n" +
- " package a.B;\n" +
- " ^^^\n" +
- "The package a.B collides with a type\n" +
+ "----------\n" +
+ "1. ERROR in a\\B\\C.java (at line 1)\n" +
+ " package a.B;\n" +
+ " ^^^\n" +
+ "The package a.B collides with a type\n" +
"----------\n"
);
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=318401
public void test081() {
this.runConformTest(
@@ -2773,7 +2773,7 @@ public class StaticImportTest extends AbstractComparableTest {
},
"1 + 1 = 2");
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=318401
public void test082() {
this.runNegativeTest(
@@ -2814,13 +2814,13 @@ public class StaticImportTest extends AbstractComparableTest {
"}\n",
},
"----------\n" +
- "1. ERROR in p2\\Test.java (at line 15)\n" +
- " int abc = b.a;\n" +
- " ^\n" +
- "a cannot be resolved or is not a field\n" +
+ "1. ERROR in p2\\Test.java (at line 15)\n" +
+ " int abc = b.a;\n" +
+ " ^\n" +
+ "a cannot be resolved or is not a field\n" +
"----------\n");
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=318401
public void test083() {
this.runConformTest(
@@ -2854,12 +2854,12 @@ public class StaticImportTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "random\n" +
- "random\n" +
- "p1.Bar.B\n" +
+ "random\n" +
+ "random\n" +
+ "p1.Bar.B\n" +
"p1.Bar.B");
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=318401
// Check if we're able to find the correct static member type being imported,
// even though the import originally resolved to the static field of the same name,
@@ -2898,7 +2898,7 @@ public class StaticImportTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "p1.Bar.B\n" +
+ "p1.Bar.B\n" +
"p1.Bar.B");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=361327
@@ -2931,20 +2931,20 @@ public class StaticImportTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " import static p3.Foo.B;\n" +
- " ^^^^^^^^\n" +
- "The import p3.Foo.B collides with another import statement\n" +
- "----------\n" :
- "----------\n" +
- "1. ERROR in Test.java (at line 7)\n" +
- " System.out.println(B.class.getCanonicalName().toString());\n" +
- " ^\n" +
- "The type B is ambiguous\n" +
+ this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ "----------\n" +
+ "1. ERROR in Test.java (at line 2)\n" +
+ " import static p3.Foo.B;\n" +
+ " ^^^^^^^^\n" +
+ "The import p3.Foo.B collides with another import statement\n" +
+ "----------\n" :
+ "----------\n" +
+ "1. ERROR in Test.java (at line 7)\n" +
+ " System.out.println(B.class.getCanonicalName().toString());\n" +
+ " ^\n" +
+ "The type B is ambiguous\n" +
"----------\n"
-
+
);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=361327
@@ -2983,14 +2983,14 @@ public class StaticImportTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " import static p3.Foo.B;\n" +
- " ^^^^^^^^\n" +
- "The import p3.Foo.B collides with another import statement\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 2)\n" +
+ " import static p3.Foo.B;\n" +
+ " ^^^^^^^^\n" +
+ "The import p3.Foo.B collides with another import statement\n" +
"----------\n");
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=361327
// To verify that all static members are imported with a single static import statement
// this tests checks collision with single type import
@@ -3022,14 +3022,14 @@ public class StaticImportTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " import p3.Foo.B;\n" +
- " ^^^^^^^^\n" +
- "The import p3.Foo.B collides with another import statement\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 2)\n" +
+ " import p3.Foo.B;\n" +
+ " ^^^^^^^^\n" +
+ "The import p3.Foo.B collides with another import statement\n" +
"----------\n");
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=361327
// To verify that all static members are imported with a single static import statement
// this tests checks collision with top level type
@@ -3056,14 +3056,14 @@ public class StaticImportTest extends AbstractComparableTest {
" public static String B = new String(\"random\");\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in Test.java (at line 1)\n" +
- " import static p1.Bar.B;\n" +
- " ^^^^^^^^\n" +
- "The import p1.Bar.B conflicts with a type defined in the same file\n" +
+ "----------\n" +
+ "1. ERROR in Test.java (at line 1)\n" +
+ " import static p1.Bar.B;\n" +
+ " ^^^^^^^^\n" +
+ "The import p1.Bar.B conflicts with a type defined in the same file\n" +
"----------\n");
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=361327
// Test obscuring rules defined in JLS 7.5.3
public void test086() {
@@ -3094,7 +3094,7 @@ public class StaticImportTest extends AbstractComparableTest {
" public static String B = new String(\"Foo's field B\");\n" +
"}\n"
},
- "Bar\'s method B\n" +
+ "Bar\'s method B\n" +
"Bar\'s field B");
}
@@ -3107,24 +3107,24 @@ public class StaticImportTest extends AbstractComparableTest {
"public class a {}\n",
"a/b/c/C.java",
"package a.b.c;\n" +
- "public class C {\n" +
- " public static final int a = 3;\n" +
+ "public class C {\n" +
+ " public static final int a = 3;\n" +
"}\n",
"x/y/R.java",
- "package x.y;\n" +
- "import static a.b.c.C.a;\n" +
- "//import a.b.c.a;\n" +
- "\n" +
- "public class R { \n" +
- " a b; \n" +
- " char h = a; \n" +
+ "package x.y;\n" +
+ "import static a.b.c.C.a;\n" +
+ "//import a.b.c.a;\n" +
+ "\n" +
+ "public class R { \n" +
+ " a b; \n" +
+ " char h = a; \n" +
"}"
},
- "----------\n" +
- "1. ERROR in x\\y\\R.java (at line 6)\n" +
- " a b; \n" +
- " ^\n" +
- "a cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in x\\y\\R.java (at line 6)\n" +
+ " a b; \n" +
+ " ^\n" +
+ "a cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=426544 - [1.8][compiler] Compiler over-eagerly detects collision of single static imports
@@ -3146,50 +3146,50 @@ public class StaticImportTest extends AbstractComparableTest {
" public static class I {}\n" +
"}\n",
"X.java",
- "import static p.X.f;\n" +
- "import static q.X.f;\n" +
- "import static p.X.C;\n" +
- "import static p.X.I;\n" +
- "import static q.X.C;\n" +
- "import static q.X.I;\n" +
- "public class X { \n" +
+ "import static p.X.f;\n" +
+ "import static q.X.f;\n" +
+ "import static p.X.C;\n" +
+ "import static p.X.I;\n" +
+ "import static q.X.C;\n" +
+ "import static q.X.I;\n" +
+ "public class X { \n" +
" { f = 0; }\n" +
" { C c = null; }\n" +
" { I i = null; }\n" +
"}\n"
},
- this.complianceLevel < ClassFileConstants.JDK1_8 ?
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " import static q.X.f;\n" +
- " ^^^^^\n" +
- "The import q.X.f collides with another import statement\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " import static q.X.C;\n" +
- " ^^^^^\n" +
- "The import q.X.C collides with another import statement\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " import static q.X.I;\n" +
- " ^^^^^\n" +
- "The import q.X.I collides with another import statement\n" +
+ this.complianceLevel < ClassFileConstants.JDK1_8 ?
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " import static q.X.f;\n" +
+ " ^^^^^\n" +
+ "The import q.X.f collides with another import statement\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " import static q.X.C;\n" +
+ " ^^^^^\n" +
+ "The import q.X.C collides with another import statement\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " import static q.X.I;\n" +
+ " ^^^^^\n" +
+ "The import q.X.I collides with another import statement\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " { f = 0; }\n" +
- " ^\n" +
- "The field f is ambiguous\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " { C c = null; }\n" +
- " ^\n" +
- "The type C is ambiguous\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " { I i = null; }\n" +
- " ^\n" +
- "The type I is ambiguous\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " { f = 0; }\n" +
+ " ^\n" +
+ "The field f is ambiguous\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " { C c = null; }\n" +
+ " ^\n" +
+ "The type C is ambiguous\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 10)\n" +
+ " { I i = null; }\n" +
+ " ^\n" +
+ "The type I is ambiguous\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=479287
@@ -3198,30 +3198,30 @@ public class StaticImportTest extends AbstractComparableTest {
this.runConformTest(
new String[] {
"joetest/GenericsIssue.java",
- "package joetest;\n" +
- "import static joetest.GenericsIssueCollaborator.takesAnything;\n" +
- "import java.util.Collection;\n" +
- "import java.util.Collections;\n" +
- "public class GenericsIssue {\n" +
- " private void oddCompileError() {\n" +
- " takesAnything(returnThings(\"works without wildcard in return value\"));\n" +
- " GenericsIssueCollaborator.takesAnything(returnThingsWildcard(\"works without static import\"));\n" +
- " takesAnything(returnThingsWildcard(\"doesn\'t work with static import\"));\n" +
- " }\n" +
- " private <T> Collection<T> returnThings(T thing) {\n" +
- " return Collections.singleton(thing);\n" +
- " }\n" +
- " \n" +
- " private <T> Collection<? extends T> returnThingsWildcard(T toReturn) {\n" +
- " return Collections.singleton(toReturn);\n" +
- " }\n" +
+ "package joetest;\n" +
+ "import static joetest.GenericsIssueCollaborator.takesAnything;\n" +
+ "import java.util.Collection;\n" +
+ "import java.util.Collections;\n" +
+ "public class GenericsIssue {\n" +
+ " private void oddCompileError() {\n" +
+ " takesAnything(returnThings(\"works without wildcard in return value\"));\n" +
+ " GenericsIssueCollaborator.takesAnything(returnThingsWildcard(\"works without static import\"));\n" +
+ " takesAnything(returnThingsWildcard(\"doesn\'t work with static import\"));\n" +
+ " }\n" +
+ " private <T> Collection<T> returnThings(T thing) {\n" +
+ " return Collections.singleton(thing);\n" +
+ " }\n" +
+ " \n" +
+ " private <T> Collection<? extends T> returnThingsWildcard(T toReturn) {\n" +
+ " return Collections.singleton(toReturn);\n" +
+ " }\n" +
"}",
"joetest/GenericsIssueCollaborator.java",
- "package joetest;\n" +
- "public class GenericsIssueCollaborator {\n" +
- " public static <T> void takesAnything(T thing) {\n" +
- " System.out.println(\"TOOK IT: \" + thing);\n" +
- " }\n" +
+ "package joetest;\n" +
+ "public class GenericsIssueCollaborator {\n" +
+ " public static <T> void takesAnything(T thing) {\n" +
+ " System.out.println(\"TOOK IT: \" + thing);\n" +
+ " }\n" +
"}"
});
}
@@ -3230,30 +3230,30 @@ public class StaticImportTest extends AbstractComparableTest {
public void testBug442580() {
this.runConformTest(new String [] {
"a/A.java",
- "package a;\n" +
- "\n" +
- "public class A {\n" +
- " public static void foo() {\n" +
- " System.out.println(\"A.foo\");\n" +
- " }\n" +
+ "package a;\n" +
+ "\n" +
+ "public class A {\n" +
+ " public static void foo() {\n" +
+ " System.out.println(\"A.foo\");\n" +
+ " }\n" +
"}",
"b/B.java",
- "package b;\n" +
- "\n" +
- "public class B {\n" +
- " public static void foo() {\n" +
- " System.out.println(\"B.foo\");\n" +
- " }\n" +
+ "package b;\n" +
+ "\n" +
+ "public class B {\n" +
+ " public static void foo() {\n" +
+ " System.out.println(\"B.foo\");\n" +
+ " }\n" +
"}",
"Test.java",
- "import static a.A.*;\n" +
- "import static b.B.*;\n" +
- "import static b.B.foo;\n" +
- "\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " foo();\n" +
- " }\n" +
+ "import static a.A.*;\n" +
+ "import static b.B.*;\n" +
+ "import static b.B.foo;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) {\n" +
+ " foo();\n" +
+ " }\n" +
"}"
});
}
@@ -3272,21 +3272,21 @@ public class StaticImportTest extends AbstractComparableTest {
" static class Outer<T extends Inner> {\n" +
" private static interface Inner {}\n" +
" }\n" +
- " static class AnotherOuter {\n" +
- " private static class Inner {}\n" +
- " }\n" +
+ " static class AnotherOuter {\n" +
+ " private static class Inner {}\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in p\\X.java (at line 3)\n" +
- " import static p.A1.AnotherOuter.Inner;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The type p.A1.AnotherOuter.Inner is not visible\n" +
- "----------\n" +
- "2. ERROR in p\\X.java (at line 6)\n" +
- " static class Outer<T extends Inner> {\n" +
- " ^^^^^\n" +
- "The type Inner is not visible\n" +
+ "----------\n" +
+ "1. ERROR in p\\X.java (at line 3)\n" +
+ " import static p.A1.AnotherOuter.Inner;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The type p.A1.AnotherOuter.Inner is not visible\n" +
+ "----------\n" +
+ "2. ERROR in p\\X.java (at line 6)\n" +
+ " static class Outer<T extends Inner> {\n" +
+ " ^^^^^\n" +
+ "The type Inner is not visible\n" +
"----------\n");
}
public void testBug520874b() {
@@ -3305,11 +3305,11 @@ public class StaticImportTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in p\\X.java (at line 5)\n" +
- " static class Outer<T extends Inner> {\n" +
- " ^^^^^\n" +
- "The type Inner is not visible\n" +
+ "----------\n" +
+ "1. ERROR in p\\X.java (at line 5)\n" +
+ " static class Outer<T extends Inner> {\n" +
+ " ^^^^^\n" +
+ "The type Inner is not visible\n" +
"----------\n");
}
public void testBug520874c() {
@@ -3327,31 +3327,31 @@ public class StaticImportTest extends AbstractComparableTest {
" static class Outer<T extends Inner> {\n" +
" private static interface Inner {}\n" +
" }\n" +
- " static class AnotherOuter<T extends Inner> {\n" +
- " private static class Inner {}\n" +
- " }\n" +
+ " static class AnotherOuter<T extends Inner> {\n" +
+ " private static class Inner {}\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in p\\X.java (at line 2)\n" +
- " import static p.A1.Outer.Inner;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The type p.A1.Outer.Inner is not visible\n" +
- "----------\n" +
- "2. ERROR in p\\X.java (at line 3)\n" +
- " import static p.A1.AnotherOuter.Inner;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The type p.A1.AnotherOuter.Inner is not visible\n" +
- "----------\n" +
- "3. ERROR in p\\X.java (at line 6)\n" +
- " static class Outer<T extends Inner> {\n" +
- " ^^^^^\n" +
- "Inner cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in p\\X.java (at line 9)\n" +
- " static class AnotherOuter<T extends Inner> {\n" +
- " ^^^^^\n" +
- "Inner cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in p\\X.java (at line 2)\n" +
+ " import static p.A1.Outer.Inner;\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The type p.A1.Outer.Inner is not visible\n" +
+ "----------\n" +
+ "2. ERROR in p\\X.java (at line 3)\n" +
+ " import static p.A1.AnotherOuter.Inner;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The type p.A1.AnotherOuter.Inner is not visible\n" +
+ "----------\n" +
+ "3. ERROR in p\\X.java (at line 6)\n" +
+ " static class Outer<T extends Inner> {\n" +
+ " ^^^^^\n" +
+ "Inner cannot be resolved to a type\n" +
+ "----------\n" +
+ "4. ERROR in p\\X.java (at line 9)\n" +
+ " static class AnotherOuter<T extends Inner> {\n" +
+ " ^^^^^\n" +
+ "Inner cannot be resolved to a type\n" +
"----------\n");
}
public void testBug520874d() {
@@ -3374,16 +3374,16 @@ public class StaticImportTest extends AbstractComparableTest {
" public static class Inner {}\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in p\\X.java (at line 2)\n" +
- " import static p.A.B.Inner;\n" +
- " ^^^^^^^^^^^\n" +
- "The import p.A.B.Inner is never used\n" +
- "----------\n" +
- "2. WARNING in p\\X.java (at line 3)\n" +
- " import p.Bar.Inner;\n" +
- " ^^^^^^^^^^^\n" +
- "The import p.Bar.Inner is never used\n" +
+ "----------\n" +
+ "1. WARNING in p\\X.java (at line 2)\n" +
+ " import static p.A.B.Inner;\n" +
+ " ^^^^^^^^^^^\n" +
+ "The import p.A.B.Inner is never used\n" +
+ "----------\n" +
+ "2. WARNING in p\\X.java (at line 3)\n" +
+ " import p.Bar.Inner;\n" +
+ " ^^^^^^^^^^^\n" +
+ "The import p.Bar.Inner is never used\n" +
"----------\n");
}
public void testBug520874e() {
@@ -3406,16 +3406,16 @@ public class StaticImportTest extends AbstractComparableTest {
" public static class Inner {}\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in p\\X.java (at line 2)\n" +
- " import static p.A.B.Inner;\n" +
- " ^^^^^^^^^^^\n" +
- "The import p.A.B.Inner is never used\n" +
- "----------\n" +
- "2. WARNING in p\\X.java (at line 3)\n" +
- " import p.Bar.*;\n" +
- " ^^^^^\n" +
- "The import p.Bar is never used\n" +
+ "----------\n" +
+ "1. WARNING in p\\X.java (at line 2)\n" +
+ " import static p.A.B.Inner;\n" +
+ " ^^^^^^^^^^^\n" +
+ "The import p.A.B.Inner is never used\n" +
+ "----------\n" +
+ "2. WARNING in p\\X.java (at line 3)\n" +
+ " import p.Bar.*;\n" +
+ " ^^^^^\n" +
+ "The import p.Bar is never used\n" +
"----------\n");
}
} \ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SuperTypeTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SuperTypeTest.java
index 3aa4f96a1..b26e93bec 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SuperTypeTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SuperTypeTest.java
@@ -413,41 +413,41 @@ public void test013() {
null /* no class libraries */,
customOptions /* custom options */,
// compiler results
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " interface X<E> extends List<E>, Collection<E>, Iterable<E> {}\n" +
- " ^^^^^^^^^^\n" +
- "Redundant superinterface Collection<E> for the type X<E>, already defined by List<E>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " interface X<E> extends List<E>, Collection<E>, Iterable<E> {}\n" +
- " ^^^^^^^^\n" +
- "Redundant superinterface Iterable<E> for the type X<E>, already defined by List<E>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " interface Y<E> extends Collection<E>, List<E> {}\n" +
- " ^^^^^^^^^^\n" +
- "Redundant superinterface Collection<E> for the type Y<E>, already defined by List<E>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 4)\n" +
- " interface XXX<E> extends Iterable<E>, List<E>, Collection<E> {}\n" +
- " ^^^^^^^^\n" +
- "Redundant superinterface Iterable<E> for the type XXX<E>, already defined by List<E>\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 4)\n" +
- " interface XXX<E> extends Iterable<E>, List<E>, Collection<E> {}\n" +
- " ^^^^^^^^^^\n" +
- "Redundant superinterface Collection<E> for the type XXX<E>, already defined by List<E>\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 5)\n" +
- " abstract class Z implements List<Object>, Collection<Object> {}\n" +
- " ^^^^^^^^^^\n" +
- "Redundant superinterface Collection<Object> for the type Z, already defined by List<Object>\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 6)\n" +
- " abstract class ZZ implements Collection<Object>, List<Object> {}\n" +
- " ^^^^^^^^^^\n" +
- "Redundant superinterface Collection<Object> for the type ZZ, already defined by List<Object>\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " interface X<E> extends List<E>, Collection<E>, Iterable<E> {}\n" +
+ " ^^^^^^^^^^\n" +
+ "Redundant superinterface Collection<E> for the type X<E>, already defined by List<E>\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 2)\n" +
+ " interface X<E> extends List<E>, Collection<E>, Iterable<E> {}\n" +
+ " ^^^^^^^^\n" +
+ "Redundant superinterface Iterable<E> for the type X<E>, already defined by List<E>\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " interface Y<E> extends Collection<E>, List<E> {}\n" +
+ " ^^^^^^^^^^\n" +
+ "Redundant superinterface Collection<E> for the type Y<E>, already defined by List<E>\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 4)\n" +
+ " interface XXX<E> extends Iterable<E>, List<E>, Collection<E> {}\n" +
+ " ^^^^^^^^\n" +
+ "Redundant superinterface Iterable<E> for the type XXX<E>, already defined by List<E>\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 4)\n" +
+ " interface XXX<E> extends Iterable<E>, List<E>, Collection<E> {}\n" +
+ " ^^^^^^^^^^\n" +
+ "Redundant superinterface Collection<E> for the type XXX<E>, already defined by List<E>\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 5)\n" +
+ " abstract class Z implements List<Object>, Collection<Object> {}\n" +
+ " ^^^^^^^^^^\n" +
+ "Redundant superinterface Collection<Object> for the type Z, already defined by List<Object>\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 6)\n" +
+ " abstract class ZZ implements Collection<Object>, List<Object> {}\n" +
+ " ^^^^^^^^^^\n" +
+ "Redundant superinterface Collection<Object> for the type ZZ, already defined by List<Object>\n" +
"----------\n",
JavacTestOptions.SKIP);
}
@@ -470,11 +470,11 @@ public void test014() {
null /* no class libraries */,
customOptions /* custom options */,
// compiler results
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X implements I, J {}\n" +
- " ^\n" +
- "Redundant superinterface I for the type X, already defined by J\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X implements I, J {}\n" +
+ " ^\n" +
+ "Redundant superinterface I for the type X, already defined by J\n" +
"----------\n",
JavacTestOptions.SKIP);
}
@@ -498,21 +498,21 @@ public void test015() {
null /* no class libraries */,
customOptions /* custom options */,
// compiler results
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " public final class X implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension, IChangeRulerColumn, IRevisionRulerColumn {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Redundant superinterface IVerticalRulerColumn for the type X, already defined by IChangeRulerColumn\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " public final class X implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension, IChangeRulerColumn, IRevisionRulerColumn {}\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Redundant superinterface IVerticalRulerInfo for the type X, already defined by IRevisionRulerColumn\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " public final class X implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension, IChangeRulerColumn, IRevisionRulerColumn {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Redundant superinterface IVerticalRulerInfoExtension for the type X, already defined by IChangeRulerColumn\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " public final class X implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension, IChangeRulerColumn, IRevisionRulerColumn {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Redundant superinterface IVerticalRulerColumn for the type X, already defined by IChangeRulerColumn\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " public final class X implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension, IChangeRulerColumn, IRevisionRulerColumn {}\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Redundant superinterface IVerticalRulerInfo for the type X, already defined by IRevisionRulerColumn\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " public final class X implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension, IChangeRulerColumn, IRevisionRulerColumn {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Redundant superinterface IVerticalRulerInfoExtension for the type X, already defined by IChangeRulerColumn\n" +
"----------\n",
JavacTestOptions.SKIP);
}
@@ -538,21 +538,21 @@ public void test016() {
null /* no class libraries */,
customOptions /* custom options */,
// compiler results
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " public final class X extends Y implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Redundant superinterface IVerticalRulerColumn for the type X, already defined by IRevisionRulerColumn\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " public final class X extends Y implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension {}\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Redundant superinterface IVerticalRulerInfo for the type X, already defined by IRevisionRulerColumn\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " public final class X extends Y implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Redundant superinterface IVerticalRulerInfoExtension for the type X, already defined by IRevisionRulerColumn\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " public final class X extends Y implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Redundant superinterface IVerticalRulerColumn for the type X, already defined by IRevisionRulerColumn\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " public final class X extends Y implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension {}\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Redundant superinterface IVerticalRulerInfo for the type X, already defined by IRevisionRulerColumn\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " public final class X extends Y implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Redundant superinterface IVerticalRulerInfoExtension for the type X, already defined by IRevisionRulerColumn\n" +
"----------\n",
JavacTestOptions.SKIP);
}
@@ -581,21 +581,21 @@ public void test017() {
null /* no class libraries */,
customOptions /* custom options */,
// compiler results
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " public final class X extends Y implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Redundant superinterface IVerticalRulerColumn for the type X, already defined by IRevisionRulerColumn\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " public final class X extends Y implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension {}\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Redundant superinterface IVerticalRulerInfo for the type X, already defined by IRevisionRulerColumn\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " public final class X extends Y implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Redundant superinterface IVerticalRulerInfoExtension for the type X, already defined by IRevisionRulerColumn\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " public final class X extends Y implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Redundant superinterface IVerticalRulerColumn for the type X, already defined by IRevisionRulerColumn\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " public final class X extends Y implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension {}\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Redundant superinterface IVerticalRulerInfo for the type X, already defined by IRevisionRulerColumn\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " public final class X extends Y implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Redundant superinterface IVerticalRulerInfoExtension for the type X, already defined by IRevisionRulerColumn\n" +
"----------\n",
JavacTestOptions.SKIP);
}
@@ -624,26 +624,26 @@ public void test018() {
null /* no class libraries */,
customOptions /* custom options */,
// compiler results
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " class Y extends H implements IVerticalRulerColumn {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Redundant superinterface IVerticalRulerColumn for the type Y, already defined by IChangeRulerColumn\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " public final class X extends Y implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Redundant superinterface IVerticalRulerColumn for the type X, already defined by Y\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " public final class X extends Y implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension {}\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Redundant superinterface IVerticalRulerInfo for the type X, already defined by H\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 11)\n" +
- " public final class X extends Y implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Redundant superinterface IVerticalRulerInfoExtension for the type X, already defined by Z\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " class Y extends H implements IVerticalRulerColumn {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Redundant superinterface IVerticalRulerColumn for the type Y, already defined by IChangeRulerColumn\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " public final class X extends Y implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Redundant superinterface IVerticalRulerColumn for the type X, already defined by Y\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " public final class X extends Y implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension {}\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Redundant superinterface IVerticalRulerInfo for the type X, already defined by H\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 11)\n" +
+ " public final class X extends Y implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Redundant superinterface IVerticalRulerInfoExtension for the type X, already defined by Z\n" +
"----------\n",
JavacTestOptions.SKIP);
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionTest.java
index 2fb51c653..ac8915d7b 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionTest.java
@@ -25,7 +25,7 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
// TESTS_NUMBERS = new int [] { 40 };
// TESTS_NAMES = new String[] { "testBug548476" };
}
-
+
public static Class<?> testClass() {
return SwitchExpressionTest.class;
}
@@ -46,7 +46,7 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
return defaultOptions;
}
-
+
@Override
protected void runConformTest(String[] testFiles, Map<String, String> customOptions) {
super.runConformTest(testFiles, "", null, true, new String[] {"--enable-preview"}, customOptions, null);
@@ -74,11 +74,11 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 0)\n" +
- " public class X {\n" +
- " ^\n" +
- "Preview features enabled at an invalid source release level "+CompilerOptions.VERSION_12+", preview can be enabled only at source level "+AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL+"\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 0)\n" +
+ " public class X {\n" +
+ " ^\n" +
+ "Preview features enabled at an invalid source release level "+CompilerOptions.VERSION_12+", preview can be enabled only at source level "+AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL+"\n" +
"----------\n");
}
public void testSwitchExpression_531714_002() {
@@ -111,11 +111,11 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
" }\n"+
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 0)\n" +
- " public class X {\n" +
- " ^\n" +
- "Preview features enabled at an invalid source release level "+CompilerOptions.VERSION_12+", preview can be enabled only at source level "+AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL+"\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 0)\n" +
+ " public class X {\n" +
+ " ^\n" +
+ "Preview features enabled at an invalid source release level "+CompilerOptions.VERSION_12+", preview can be enabled only at source level "+AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL+"\n" +
"----------\n");
}
public void _testBug531714_error_003() {
@@ -133,17 +133,17 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " int tw = switch (i) {\n" +
- " };\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "A switch expression should have a non-empty switch block\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " int tw = switch (i) {\n" +
- " ^\n" +
- "A switch expression should have a default case\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " int tw = switch (i) {\n" +
+ " };\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "A switch expression should have a non-empty switch block\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " int tw = switch (i) {\n" +
+ " ^\n" +
+ "A switch expression should have a default case\n" +
"----------\n");
}
public void _testBug531714_error_004() {
@@ -168,11 +168,11 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " break 1;\n" +
- " ^\n" +
- "Syntax error on token \"1\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " break 1;\n" +
+ " ^\n" +
+ "Syntax error on token \"1\", delete this token\n" +
"----------\n");
}
public void _testBug531714_error_005() {
@@ -196,16 +196,16 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " break 1;\n" +
- " ^\n" +
- "Syntax error on token \"1\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " break 1;\n" +
+ " ^\n" +
+ "Syntax error on token \"1\", delete this token\n" +
"----------\n");
}
/**
* Add a test case for enum
- * If the type of the selector expression is an enum type,
+ * If the type of the selector expression is an enum type,
* then the set of all the case constants associated with the switch block
* must contain all the enum constants of that enum type
* Add a missing enum test case
@@ -236,16 +236,16 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " int tw = switch (i) {\n" +
- " ^^^^^\n" +
- " The switch expression should have a default case\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " int tw = switch (i) {\n" +
+ " ^^^^^\n" +
+ " The switch expression should have a default case\n" +
"----------\n");
}
/*
* should compile - test for adding additional nesting in variables
- * dev note: ref consumeToken().case Switch
+ * dev note: ref consumeToken().case Switch
*/
public void _testBug531714_error_007() {
this.runNegativeTest(
@@ -271,16 +271,16 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
" }\n"+
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " default -> {\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " break 12;\n" +
- " ^^\n" +
- "Syntax error on token \"12\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " default -> {\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " break 12;\n" +
+ " ^^\n" +
+ "Syntax error on token \"12\", delete this token\n" +
"----------\n");
}
public void _testBug531714_008() {
@@ -304,30 +304,30 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " int tw = switch (i) {\n" +
- " case 0 -> i * 0;\n" +
- " case 1 -> 2;\n" +
- " default -> 3;\n" +
- " };\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Switch Expressions is a preview feature and disabled by default. Use --enable-preview to enable\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " case 0 -> i * 0;\n" +
- " ^^^^^^\n" +
- "Case Labels with '->' is a preview feature and disabled by default. Use --enable-preview to enable\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " case 1 -> 2;\n" +
- " ^^^^^^\n" +
- "Case Labels with '->' is a preview feature and disabled by default. Use --enable-preview to enable\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " default -> 3;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " int tw = switch (i) {\n" +
+ " case 0 -> i * 0;\n" +
+ " case 1 -> 2;\n" +
+ " default -> 3;\n" +
+ " };\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Switch Expressions is a preview feature and disabled by default. Use --enable-preview to enable\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " case 0 -> i * 0;\n" +
+ " ^^^^^^\n" +
+ "Case Labels with '->' is a preview feature and disabled by default. Use --enable-preview to enable\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " case 1 -> 2;\n" +
+ " ^^^^^^\n" +
+ "Case Labels with '->' is a preview feature and disabled by default. Use --enable-preview to enable\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " default -> 3;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n";
this.runNegativeTest(
@@ -354,11 +354,11 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " default -> System.out.println(\"DEFAULT\");\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " default -> System.out.println(\"DEFAULT\");\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n");
}
public void _testBug531714_009() {
@@ -382,21 +382,21 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case 0 -> i * 0;\n" +
- " ^^^^^^\n" +
- "Case Labels with \'->\' is a preview feature and disabled by default. Use --enable-preview to enable\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " case 1 -> 2;\n" +
- " ^^^^^^\n" +
- "Case Labels with \'->\' is a preview feature and disabled by default. Use --enable-preview to enable\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " default -> 3;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case 0 -> i * 0;\n" +
+ " ^^^^^^\n" +
+ "Case Labels with \'->\' is a preview feature and disabled by default. Use --enable-preview to enable\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " case 1 -> 2;\n" +
+ " ^^^^^^\n" +
+ "Case Labels with \'->\' is a preview feature and disabled by default. Use --enable-preview to enable\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " default -> 3;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -425,16 +425,16 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " default -> 3;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " default -> 3;\n" +
- " ^\n" +
- "Invalid expression as statement\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " default -> 3;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " default -> 3;\n" +
+ " ^\n" +
+ "Invalid expression as statement\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -464,16 +464,16 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " default -> 3;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " default -> 3;\n" +
- " ^\n" +
- "Invalid expression as statement\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " default -> 3;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " default -> 3;\n" +
+ " ^\n" +
+ "Invalid expression as statement\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -505,11 +505,11 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 0)\n" +
- " public class X {\n" +
- " ^\n" +
- "Preview features enabled at an invalid source release level "+CompilerOptions.VERSION_11+", preview can be enabled only at source level "+AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL+"\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 0)\n" +
+ " public class X {\n" +
+ " ^\n" +
+ "Preview features enabled at an invalid source release level "+CompilerOptions.VERSION_11+", preview can be enabled only at source level "+AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL+"\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -546,11 +546,11 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " break 0;\n" +
- " ^\n" +
- "Syntax error on token \"0\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " break 0;\n" +
+ " ^\n" +
+ "Syntax error on token \"0\", delete this token\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -578,16 +578,16 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " default -> null;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " }.toLowerCase());\n" +
- " ^\n" +
- "Syntax error on token \".\", , expected\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " default -> null;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " }.toLowerCase());\n" +
+ " ^\n" +
+ "Syntax error on token \".\", , expected\n" +
"----------\n";
runner.runNegativeTest();
}
@@ -614,11 +614,11 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
" MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " default -> 10;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " default -> 10;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n");
}
/*
@@ -631,14 +631,14 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
String[] testFiles = new String[] {
"X.java",
"public class X {\n" +
- "public static void bar(Day day) {\n" +
- " switch (day) {\n" +
- " case SATURDAY, SUNDAY: \n" +
- " System.out.println(Day.SUNDAY);\n" +
- " break;\n" +
- " case MONDAY : System.out.println(Day.MONDAY);\n" +
- " break;\n" +
- " }\n" +
+ "public static void bar(Day day) {\n" +
+ " switch (day) {\n" +
+ " case SATURDAY, SUNDAY: \n" +
+ " System.out.println(Day.SUNDAY);\n" +
+ " break;\n" +
+ " case MONDAY : System.out.println(Day.MONDAY);\n" +
+ " break;\n" +
+ " }\n" +
" }" +
" public static void main(String[] args) {\n" +
" bar(Day.SATURDAY);\n" +
@@ -648,11 +648,11 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case SATURDAY, SUNDAY: \n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case SATURDAY, SUNDAY: \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -671,32 +671,32 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
String[] testFiles = new String[] {
"X.java",
"public class X {\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- "public static void bar(Day day) {\n" +
- " switch (day) {\n" +
- " case SATURDAY, SUNDAY: \n" +
- " System.out.println(Day.SUNDAY);\n" +
- " break;\n" +
- " case MONDAY : System.out.println(Day.MONDAY);\n" +
- " break;\n" +
- " }\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
+ "public static void bar(Day day) {\n" +
+ " switch (day) {\n" +
+ " case SATURDAY, SUNDAY: \n" +
+ " System.out.println(Day.SUNDAY);\n" +
+ " break;\n" +
+ " case MONDAY : System.out.println(Day.MONDAY);\n" +
+ " break;\n" +
+ " }\n" +
" }" +
"}\n" +
"enum Day { SATURDAY, SUNDAY, MONDAY, TUESDAY;}",
};
String expectedProblemLog =
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " switch (day) {\n" +
- " ^^^\n" +
- "The enum constant TUESDAY needs a corresponding case label in this enum switch on Day\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " case SATURDAY, SUNDAY: \n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " switch (day) {\n" +
+ " ^^^\n" +
+ "The enum constant TUESDAY needs a corresponding case label in this enum switch on Day\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " case SATURDAY, SUNDAY: \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -716,14 +716,14 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
String[] testFiles = new String[] {
"X.java",
"public class X {\n" +
- "public static void bar(Day day) {\n" +
- " switch (day) {\n" +
- " case SATURDAY, SUNDAY: \n" +
- " System.out.println(Day.SUNDAY);\n" +
- " break;\n" +
- " case SUNDAY : System.out.println(Day.SUNDAY);\n" +
- " break;\n" +
- " }\n" +
+ "public static void bar(Day day) {\n" +
+ " switch (day) {\n" +
+ " case SATURDAY, SUNDAY: \n" +
+ " System.out.println(Day.SUNDAY);\n" +
+ " break;\n" +
+ " case SUNDAY : System.out.println(Day.SUNDAY);\n" +
+ " break;\n" +
+ " }\n" +
" }" +
" public static void main(String[] args) {\n" +
" bar(Day.SATURDAY);\n" +
@@ -733,21 +733,21 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case SATURDAY, SUNDAY: \n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " case SATURDAY, SUNDAY: \n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " case SUNDAY : System.out.println(Day.SUNDAY);\n" +
- " ^^^^^^^^^^^\n" +
- "Duplicate case\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case SATURDAY, SUNDAY: \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " case SATURDAY, SUNDAY: \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " case SUNDAY : System.out.println(Day.SUNDAY);\n" +
+ " ^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -766,51 +766,51 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
String[] testFiles = new String[] {
"X.java",
"public class X {\n" +
- "public static void bar(Day day) {\n" +
- " switch (day) {\n" +
- " case SATURDAY, SUNDAY: \n" +
- " System.out.println(Day.SUNDAY);\n" +
- " break;\n" +
+ "public static void bar(Day day) {\n" +
+ " switch (day) {\n" +
+ " case SATURDAY, SUNDAY: \n" +
+ " System.out.println(Day.SUNDAY);\n" +
+ " break;\n" +
" case SUNDAY, SATURDAY : \n" +
- " System.out.println(Day.SUNDAY);\n" +
- " break;\n" +
- " }\n" +
+ " System.out.println(Day.SUNDAY);\n" +
+ " break;\n" +
+ " }\n" +
" }" +
"}\n" +
"enum Day { SATURDAY, SUNDAY, MONDAY;}",
};
String expectedProblemLog =
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " switch (day) {\n" +
- " ^^^\n" +
- "The enum constant MONDAY needs a corresponding case label in this enum switch on Day\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " case SATURDAY, SUNDAY: \n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " case SATURDAY, SUNDAY: \n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " case SUNDAY, SATURDAY : \n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " case SUNDAY, SATURDAY : \n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 7)\n" +
- " case SUNDAY, SATURDAY : \n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " switch (day) {\n" +
+ " ^^^\n" +
+ "The enum constant MONDAY needs a corresponding case label in this enum switch on Day\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " case SATURDAY, SUNDAY: \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " case SATURDAY, SUNDAY: \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " case SUNDAY, SATURDAY : \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 7)\n" +
+ " case SUNDAY, SATURDAY : \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 7)\n" +
+ " case SUNDAY, SATURDAY : \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -820,7 +820,7 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
options);
}
/*
- *
+ *
*/
public void _testBug543240_3() {
Map<String, String> options = getCompilerOptions();
@@ -829,14 +829,14 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
String[] testFiles = new String[] {
"X.java",
"public class X {\n" +
- "public static void bar(Day day) {\n" +
- " switch (day) {\n" +
- " case SATURDAY, SUNDAY: \n" +
- " System.out.println(Day.SUNDAY);\n" +
- " break;\n" +
- " case TUESDAY : System.out.println(Day.SUNDAY);\n" +
- " break;\n" +
- " }\n" +
+ "public static void bar(Day day) {\n" +
+ " switch (day) {\n" +
+ " case SATURDAY, SUNDAY: \n" +
+ " System.out.println(Day.SUNDAY);\n" +
+ " break;\n" +
+ " case TUESDAY : System.out.println(Day.SUNDAY);\n" +
+ " break;\n" +
+ " }\n" +
" }" +
" public static void main(String[] args) {\n" +
" bar(Day.SATURDAY);\n" +
@@ -846,16 +846,16 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
};
String expectedProblemLog =
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " switch (day) {\n" +
- " ^^^\n" +
- "The enum constant MONDAY needs a corresponding case label in this enum switch on Day\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " case SATURDAY, SUNDAY: \n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " switch (day) {\n" +
+ " ^^^\n" +
+ "The enum constant MONDAY needs a corresponding case label in this enum switch on Day\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " case SATURDAY, SUNDAY: \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -872,14 +872,14 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
String[] testFiles = new String[] {
"X.java",
"public class X {\n" +
- "public static void bar(Day day) {\n" +
- " switch (day) {\n" +
- " case SATURDAY, SUNDAY: \n" +
- " System.out.println(day);\n" +
- " break;\n" +
- " case MONDAY : System.out.println(0);\n" +
- " break;\n" +
- " }\n" +
+ "public static void bar(Day day) {\n" +
+ " switch (day) {\n" +
+ " case SATURDAY, SUNDAY: \n" +
+ " System.out.println(day);\n" +
+ " break;\n" +
+ " case MONDAY : System.out.println(0);\n" +
+ " break;\n" +
+ " }\n" +
" }" +
" public static void main(String[] args) {\n" +
" bar(Day.SATURDAY);\n" +
@@ -891,11 +891,11 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case SATURDAY, SUNDAY: \n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case SATURDAY, SUNDAY: \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -913,32 +913,32 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " bar(\"a\");\n" +
- " bar(\"b\");\n" +
- " bar(\"c\");\n" +
- " bar(\"d\");\n" +
- " }\n" +
- " public static void bar(String s) {\n" +
- " switch(s) {\n" +
- " case \"a\":\n" +
- " case \"b\":\n" +
- " System.out.println(\"A/B\");\n" +
- " break;\n" +
- " case \"c\":\n" +
- " System.out.println(\"C\");\n" +
- " break;\n" +
- " default:\n" +
- " System.out.println(\"NA\");\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " bar(\"a\");\n" +
+ " bar(\"b\");\n" +
+ " bar(\"c\");\n" +
+ " bar(\"d\");\n" +
+ " }\n" +
+ " public static void bar(String s) {\n" +
+ " switch(s) {\n" +
+ " case \"a\":\n" +
+ " case \"b\":\n" +
+ " System.out.println(\"A/B\");\n" +
+ " break;\n" +
+ " case \"c\":\n" +
+ " System.out.println(\"C\");\n" +
+ " break;\n" +
+ " default:\n" +
+ " System.out.println(\"NA\");\n" +
+ " }\n" +
+ " }\n" +
"}",
};
String expectedProblemLog =
- "A/B\n" +
- "A/B\n" +
- "C\n" +
+ "A/B\n" +
+ "A/B\n" +
+ "C\n" +
"NA";
this.runConformTest(
testFiles,
@@ -952,33 +952,33 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " bar(\"a\");\n" +
- " bar(\"b\");\n" +
- " bar(\"c\");\n" +
- " bar(\"d\");\n" +
- " }\n" +
- " public static void bar(String s) {\n" +
- " switch(s) {\n" +
- " case \"a\", \"b\":\n" +
- " System.out.println(\"A/B\");\n" +
- " break;\n" +
- " case \"c\":\n" +
- " System.out.println(\"C\");\n" +
- " break;\n" +
- " default:\n" +
- " System.out.println(\"NA\");\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " bar(\"a\");\n" +
+ " bar(\"b\");\n" +
+ " bar(\"c\");\n" +
+ " bar(\"d\");\n" +
+ " }\n" +
+ " public static void bar(String s) {\n" +
+ " switch(s) {\n" +
+ " case \"a\", \"b\":\n" +
+ " System.out.println(\"A/B\");\n" +
+ " break;\n" +
+ " case \"c\":\n" +
+ " System.out.println(\"C\");\n" +
+ " break;\n" +
+ " default:\n" +
+ " System.out.println(\"NA\");\n" +
+ " }\n" +
+ " }\n" +
"}",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " case \"a\", \"b\":\n" +
- " ^^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " case \"a\", \"b\":\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -997,33 +997,33 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " bar(\"FB\");\n" +
- " bar(\"Ea\");\n" +
- " bar(\"c\");\n" +
- " bar(\"D\");\n" +
- " }\n" +
- " public static void bar(String s) {\n" +
- " switch(s) {\n" +
- " case \"FB\", \"c\":\n" +
- " System.out.println(\"A\");\n" +
- " break;\n" +
- " case \"Ea\":\n" +
- " System.out.println(\"B\");\n" +
- " break;\n" +
- " default:\n" +
- " System.out.println(\"NA\");\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " bar(\"FB\");\n" +
+ " bar(\"Ea\");\n" +
+ " bar(\"c\");\n" +
+ " bar(\"D\");\n" +
+ " }\n" +
+ " public static void bar(String s) {\n" +
+ " switch(s) {\n" +
+ " case \"FB\", \"c\":\n" +
+ " System.out.println(\"A\");\n" +
+ " break;\n" +
+ " case \"Ea\":\n" +
+ " System.out.println(\"B\");\n" +
+ " break;\n" +
+ " default:\n" +
+ " System.out.println(\"NA\");\n" +
+ " }\n" +
+ " }\n" +
"}",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " case \"FB\", \"c\":\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " case \"FB\", \"c\":\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -1041,39 +1041,39 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " bar(1);\n" +
- " bar(2);\n" +
- " bar(3);\n" +
- " bar(4);\n" +
- " bar(5);\n" +
- " }\n" +
- " public static void bar(int i) {\n" +
- " switch (i) {\n" +
- " case 1, 3: \n" +
- " System.out.println(\"Odd\");\n" +
- " break;\n" +
- " case 2, 4: \n" +
- " System.out.println(\"Even\");\n" +
- " break;\n" +
- " default:\n" +
- " System.out.println(\"Out of range\");\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " bar(1);\n" +
+ " bar(2);\n" +
+ " bar(3);\n" +
+ " bar(4);\n" +
+ " bar(5);\n" +
+ " }\n" +
+ " public static void bar(int i) {\n" +
+ " switch (i) {\n" +
+ " case 1, 3: \n" +
+ " System.out.println(\"Odd\");\n" +
+ " break;\n" +
+ " case 2, 4: \n" +
+ " System.out.println(\"Even\");\n" +
+ " break;\n" +
+ " default:\n" +
+ " System.out.println(\"Out of range\");\n" +
+ " }\n" +
+ " }\n" +
"}",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " case 1, 3: \n" +
- " ^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " case 2, 4: \n" +
- " ^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " case 1, 3: \n" +
+ " ^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " case 2, 4: \n" +
+ " ^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -1091,34 +1091,34 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public static void bar(int i) {\n" +
- " switch (i) {\n" +
- " case 1, 3: \n" +
- " System.out.println(\"Odd\");\n" +
- " break;\n" +
- " case \"2\": \n" +
- " System.out.println(\"Even\");\n" +
- " break;\n" +
- " default:\n" +
- " System.out.println(\"Out of range\");\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
+ " public static void bar(int i) {\n" +
+ " switch (i) {\n" +
+ " case 1, 3: \n" +
+ " System.out.println(\"Odd\");\n" +
+ " break;\n" +
+ " case \"2\": \n" +
+ " System.out.println(\"Even\");\n" +
+ " break;\n" +
+ " default:\n" +
+ " System.out.println(\"Out of range\");\n" +
+ " }\n" +
+ " }\n" +
"}",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " case 1, 3: \n" +
- " ^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " case \"2\": \n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from String to int\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " case 1, 3: \n" +
+ " ^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " case \"2\": \n" +
+ " ^^^\n" +
+ "Type mismatch: cannot convert from String to int\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -1137,33 +1137,33 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportFallthroughCase, CompilerOptions.WARNING);
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public static void bar(int i) {\n" +
- " switch (i) {\n" +
- " case 1, 3: \n" +
- " System.out.println(\"Odd\");\n" +
- " case 2, 4: \n" +
- " System.out.println(\"Even\");\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
+ " public static void bar(int i) {\n" +
+ " switch (i) {\n" +
+ " case 1, 3: \n" +
+ " System.out.println(\"Odd\");\n" +
+ " case 2, 4: \n" +
+ " System.out.println(\"Even\");\n" +
" break;\n" +
- " default:\n" +
- " System.out.println(\"Out of range\");\n" +
- " }\n" +
- " }\n" +
+ " default:\n" +
+ " System.out.println(\"Out of range\");\n" +
+ " }\n" +
+ " }\n" +
"}",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " case 1, 3: \n" +
- " ^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " case 2, 4: \n" +
- " ^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " case 1, 3: \n" +
+ " ^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " case 2, 4: \n" +
+ " ^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -1182,35 +1182,35 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportMissingDefaultCase, CompilerOptions.WARNING);
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public static void bar(int i) {\n" +
- " switch (i) {\n" +
- " case 1, 3: \n" +
- " System.out.println(\"Odd\");\n" +
- " case 2, 4: \n" +
- " System.out.println(\"Even\");\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
+ " public static void bar(int i) {\n" +
+ " switch (i) {\n" +
+ " case 1, 3: \n" +
+ " System.out.println(\"Odd\");\n" +
+ " case 2, 4: \n" +
+ " System.out.println(\"Even\");\n" +
+ " }\n" +
+ " }\n" +
"}",
};
String expectedProblemLog =
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " switch (i) {\n" +
- " ^\n" +
- "The switch statement should have a default case\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " case 1, 3: \n" +
- " ^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " case 2, 4: \n" +
- " ^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " switch (i) {\n" +
+ " ^\n" +
+ "The switch statement should have a default case\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " case 1, 3: \n" +
+ " ^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " case 2, 4: \n" +
+ " ^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -1228,40 +1228,40 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public static void bar(int i) {\n" +
- " switch (i) {\n" +
- " case 1, 3: \n" +
- " System.out.println(\"Odd\");\n" +
- " case 3, 4: \n" +
- " System.out.println(\"Odd\");\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
+ " public static void bar(int i) {\n" +
+ " switch (i) {\n" +
+ " case 1, 3: \n" +
+ " System.out.println(\"Odd\");\n" +
+ " case 3, 4: \n" +
+ " System.out.println(\"Odd\");\n" +
+ " }\n" +
+ " }\n" +
"}",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " case 1, 3: \n" +
- " ^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " case 1, 3: \n" +
- " ^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " case 3, 4: \n" +
- " ^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " case 3, 4: \n" +
- " ^^^^^^^^^\n" +
- "Duplicate case\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " case 1, 3: \n" +
+ " ^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " case 1, 3: \n" +
+ " ^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " case 3, 4: \n" +
+ " ^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " case 3, 4: \n" +
+ " ^^^^^^^^^\n" +
+ "Duplicate case\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -1279,40 +1279,40 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public static void bar(String s) {\n" +
- " switch (s) {\n" +
- " case \"a\", \"b\": \n" +
- " System.out.println(\"Odd\");\n" +
- " case \"b\", \"c\": \n" +
- " System.out.println(\"Odd\");\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
+ " public static void bar(String s) {\n" +
+ " switch (s) {\n" +
+ " case \"a\", \"b\": \n" +
+ " System.out.println(\"Odd\");\n" +
+ " case \"b\", \"c\": \n" +
+ " System.out.println(\"Odd\");\n" +
+ " }\n" +
+ " }\n" +
"}",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " case \"a\", \"b\": \n" +
- " ^^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " case \"a\", \"b\": \n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " case \"b\", \"c\": \n" +
- " ^^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " case \"b\", \"c\": \n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " case \"a\", \"b\": \n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " case \"a\", \"b\": \n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " case \"b\", \"c\": \n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " case \"b\", \"c\": \n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -1330,29 +1330,29 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public static void bar(Num s) {\n" +
- " switch (s) {\n" +
- " case ONE, Num.TWO: \n" +
- " System.out.println(\"Odd\");\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
+ " public static void bar(Num s) {\n" +
+ " switch (s) {\n" +
+ " case ONE, Num.TWO: \n" +
+ " System.out.println(\"Odd\");\n" +
+ " }\n" +
+ " }\n" +
"}\n" +
"enum Num { ONE, TWO}\n",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " case ONE, Num.TWO: \n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " case ONE, Num.TWO: \n" +
- " ^^^^^^^\n" +
- "The qualified case label Num.TWO must be replaced with the unqualified enum constant TWO\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " case ONE, Num.TWO: \n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " case ONE, Num.TWO: \n" +
+ " ^^^^^^^\n" +
+ "The qualified case label Num.TWO must be replaced with the unqualified enum constant TWO\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -1367,26 +1367,26 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public void bar(int s) {\n" +
- " int j = switch (s) {\n" +
+ "public class X {\n" +
+ " public void bar(int s) {\n" +
+ " int j = switch (s) {\n" +
" case 1, 2, 3 -> (s+1);\n" +
- " default -> j;\n" +
- " };\n" +
- " }\n" +
+ " default -> j;\n" +
+ " };\n" +
+ " }\n" +
"}\n",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case 1, 2, 3 -> (s+1);\n" +
- " ^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " default -> j;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case 1, 2, 3 -> (s+1);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " default -> j;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -1401,29 +1401,29 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
" public void bar(int s) {\n" +
- " int j = 0;" +
- " j = switch (s) {\n" +
+ " int j = 0;" +
+ " j = switch (s) {\n" +
" case 1, 2, 3 -> (s+1);\n" +
- " default -> j;\n" +
- " };\n" +
- " }\n" +
+ " default -> j;\n" +
+ " };\n" +
+ " }\n" +
"}\n",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " case 1, 2, 3 -> (s+1);\n" +
- " ^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " default -> j;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " case 1, 2, 3 -> (s+1);\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " default -> j;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -1466,16 +1466,16 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " break 0;\n" +
- " ^\n" +
- "Syntax error on token \"0\", delete this token\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " default : break 10;\n" +
- " ^^\n" +
- "Syntax error on token \"10\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " break 0;\n" +
+ " ^\n" +
+ "Syntax error on token \"0\", delete this token\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 12)\n" +
+ " default : break 10;\n" +
+ " ^^\n" +
+ "Syntax error on token \"10\", delete this token\n" +
"----------\n");
}
public void _testBug543691() {
@@ -1484,23 +1484,23 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " @SuppressWarnings(\"preview\")\n" +
- " public static void bar(int i) {\n" +
- " i = switch (i+0) {\n" +
- " default: System.out.println(0);\n" +
- " }; " +
- " }\n" +
+ "public class X {\n" +
+ " @SuppressWarnings(\"preview\")\n" +
+ " public static void bar(int i) {\n" +
+ " i = switch (i+0) {\n" +
+ " default: System.out.println(0);\n" +
+ " }; " +
+ " }\n" +
"}",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " i = switch (i+0) {\n" +
- " default: System.out.println(0);\n" +
- " }; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "A switch expression should have at least one result expression\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " i = switch (i+0) {\n" +
+ " default: System.out.println(0);\n" +
+ " }; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "A switch expression should have at least one result expression\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -1516,26 +1516,26 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
String[] testFiles = new String[] {
"X.java",
"public class X {\n" +
- " void test(int i) {\n" +
- " need(switch (i) {\n" +
- " case 1 -> \"\";\n" +
- " default -> i == 3 ? null : \"\";\n" +
- " }); \n" +
- " }\n" +
- " void need(String s) {\n" +
- " System.out.println(s.toLowerCase());\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new X().need(\"Hello World\");\n" +
- " }\n" +
+ " void test(int i) {\n" +
+ " need(switch (i) {\n" +
+ " case 1 -> \"\";\n" +
+ " default -> i == 3 ? null : \"\";\n" +
+ " }); \n" +
+ " }\n" +
+ " void need(String s) {\n" +
+ " System.out.println(s.toLowerCase());\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().need(\"Hello World\");\n" +
+ " }\n" +
"}\n"
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " default -> i == 3 ? null : \"\";\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " default -> i == 3 ? null : \"\";\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n";
runNegativeTest(testFiles, expectedProblemLog, null, true, options);
}
@@ -1546,31 +1546,31 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
String[] testFiles = new String[] {
"X.java",
"public class X {\n" +
- " void test(int i) {\n" +
- " need(switch (i) {\n" +
- " case 1: break \"\";\n" +
- " default: break i == 3 ? null : \"\";\n" +
- " }); \n" +
- " }\n" +
- " void need(String s) {\n" +
- " System.out.println(s.toLowerCase());\n" +
+ " void test(int i) {\n" +
+ " need(switch (i) {\n" +
+ " case 1: break \"\";\n" +
+ " default: break i == 3 ? null : \"\";\n" +
+ " }); \n" +
+ " }\n" +
+ " void need(String s) {\n" +
+ " System.out.println(s.toLowerCase());\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().need(\"Hello World\");\n" +
" }\n" +
- " public static void main(String[] args) {\n" +
- " new X().need(\"Hello World\");\n" +
- " }\n" +
"}\n"
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case 1: break \"\";\n" +
- " ^^\n" +
- "Syntax error on token \"\"\"\", delete this token\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " default: break i == 3 ? null : \"\";\n" +
- " ^^^^^\n" +
- "Syntax error on token \"break\", yield expected\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case 1: break \"\";\n" +
+ " ^^\n" +
+ "Syntax error on token \"\"\"\", delete this token\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " default: break i == 3 ? null : \"\";\n" +
+ " ^^^^^\n" +
+ "Syntax error on token \"break\", yield expected\n" +
"----------\n";
runNegativeTest(testFiles, expectedProblemLog, null, true, options);
}
@@ -1580,34 +1580,34 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
String[] testFiles = new String[] {
"X.java",
- "interface I0 { void i(); }\n" +
- "interface I1 extends I0 {}\n" +
+ "interface I0 { void i(); }\n" +
+ "interface I1 extends I0 {}\n" +
"interface I2 extends I0 {}\n" +
"public class X {\n" +
- " I1 n1() { return null; }\n" +
- " <I extends I2> I n2() { return null; }\n" +
- " <M> M m(M m) { return m; }\n" +
- " void test(int i, boolean b) {\n" +
- " m(switch (i) {\n" +
- " case 1 -> n1();\n" +
- " default -> b ? n1() : n2();\n" +
- " }).i(); \n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
+ " I1 n1() { return null; }\n" +
+ " <I extends I2> I n2() { return null; }\n" +
+ " <M> M m(M m) { return m; }\n" +
+ " void test(int i, boolean b) {\n" +
+ " m(switch (i) {\n" +
+ " case 1 -> n1();\n" +
+ " default -> b ? n1() : n2();\n" +
+ " }).i(); \n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
" try {\n" +
" new X().test(1, true);\n" +
" } catch (NullPointerException e) {\n" +
" System.out.println(\"NPE as expected\");\n" +
" }\n" +
- " }\n" +
+ " }\n" +
"}\n"
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " default -> b ? n1() : n2();\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " default -> b ? n1() : n2();\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n";
runNegativeTest(testFiles, expectedProblemLog, null, true, options);
}
@@ -1618,34 +1618,34 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
String[] testFiles = new String[] {
"X.java",
"import java.util.function.Supplier;\n" +
- "interface I0 { void i(); }\n" +
- "interface I1 extends I0 {}\n" +
+ "interface I0 { void i(); }\n" +
+ "interface I1 extends I0 {}\n" +
"interface I2 extends I0 {}\n" +
"public class X {\n" +
- " I1 n1() { return null; }\n" +
- " <I extends I2> I n2() { return null; }\n" +
- " <M> M m(Supplier<M> m) { return m.get(); }\n" +
- " void test(int i, boolean b) {\n" +
- " m(switch (i) {\n" +
- " case 1 -> this::n1;\n" +
- " default -> this::n2;\n" +
- " }).i(); \n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
+ " I1 n1() { return null; }\n" +
+ " <I extends I2> I n2() { return null; }\n" +
+ " <M> M m(Supplier<M> m) { return m.get(); }\n" +
+ " void test(int i, boolean b) {\n" +
+ " m(switch (i) {\n" +
+ " case 1 -> this::n1;\n" +
+ " default -> this::n2;\n" +
+ " }).i(); \n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
" try {\n" +
" new X().test(1, true);\n" +
" } catch (NullPointerException e) {\n" +
" System.out.println(\"NPE as expected\");\n" +
" }\n" +
- " }\n" +
+ " }\n" +
"}\n"
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " default -> this::n2;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " default -> this::n2;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n";
runNegativeTest(testFiles, expectedProblemLog, null, true, options);
}
@@ -1657,26 +1657,26 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
String[] testFiles = new String[] {
"X.java",
"public class X {\n" +
- " void test(int i) {\n" +
- " need(switch (i) {\n" +
- " case 1 -> 1.0f;\n" +
- " default -> i == 3 ? 3 : 5.0d;\n" +
- " }); \n" +
- " }\n" +
- " <N extends Number> void need(N s) {\n" +
- " System.out.println(s.toString());\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
+ " void test(int i) {\n" +
+ " need(switch (i) {\n" +
+ " case 1 -> 1.0f;\n" +
+ " default -> i == 3 ? 3 : 5.0d;\n" +
+ " }); \n" +
+ " }\n" +
+ " <N extends Number> void need(N s) {\n" +
+ " System.out.println(s.toString());\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
" new X().need(3);\n" +
- " }\n" +
+ " }\n" +
"}\n"
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " default -> i == 3 ? 3 : 5.0d;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " default -> i == 3 ? 3 : 5.0d;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n";
runNegativeTest(testFiles, expectedProblemLog, null, true, options);
}
@@ -1684,59 +1684,59 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " static int twice(int i) throws Exception {\n" +
- " switch (i) {\n" +
- " case 0 -> System.out.println(\"hellow\");\n" +
- " case 1 -> foo();\n" +
- " default -> throw new Exception();\n" +
- " };\n" +
- " return 0;\n" +
- " }\n" +
- "\n" +
- " static int foo() {\n" +
- " System.out.println(\"inside foo\");\n" +
- " return 1;\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " System.out.print(twice(1));\n" +
- " } catch (Exception e) {\n" +
- " System.out.print(\"Got Exception\");\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " static int twice(int i) throws Exception {\n" +
+ " switch (i) {\n" +
+ " case 0 -> System.out.println(\"hellow\");\n" +
+ " case 1 -> foo();\n" +
+ " default -> throw new Exception();\n" +
+ " };\n" +
+ " return 0;\n" +
+ " }\n" +
+ "\n" +
+ " static int foo() {\n" +
+ " System.out.println(\"inside foo\");\n" +
+ " return 1;\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
+ " System.out.print(twice(1));\n" +
+ " } catch (Exception e) {\n" +
+ " System.out.print(\"Got Exception\");\n" +
+ " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " default -> throw new Exception();\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " default -> throw new Exception();\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n");
}
public void _testSwitchStatementWithEnumValues() {
runConformTest(
new String[] {
"X.java",
- "enum SomeDays {\n" +
- " Mon, Wed, Fri\n" +
- "}\n" +
- "\n" +
- "public class X {\n" +
- " int testEnum(boolean b) {\n" +
- " SomeDays day = b ? SomeDays.Mon : null;\n" +
- " return switch(day) {\n" +
- " case Mon -> 1;\n" +
- " case Wed -> 2;\n" +
- " case Fri -> 3;\n" +
- " };\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(new X().testEnum(true));\n" +
- " }\n" +
- "}\n" +
+ "enum SomeDays {\n" +
+ " Mon, Wed, Fri\n" +
+ "}\n" +
+ "\n" +
+ "public class X {\n" +
+ " int testEnum(boolean b) {\n" +
+ " SomeDays day = b ? SomeDays.Mon : null;\n" +
+ " return switch(day) {\n" +
+ " case Mon -> 1;\n" +
+ " case Wed -> 2;\n" +
+ " case Fri -> 3;\n" +
+ " };\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(new X().testEnum(true));\n" +
+ " }\n" +
+ "}\n" +
""
},
"1",
@@ -1762,16 +1762,16 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
"}\n",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " default -> 3; // should flag an error\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " default -> 3; // should flag an error\n" +
- " ^\n" +
- "Invalid expression as statement\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " default -> 3; // should flag an error\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " default -> 3; // should flag an error\n" +
+ " ^\n" +
+ "Invalid expression as statement\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -1785,24 +1785,24 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public void foo(int i) {\n" +
- " int j = switch (i) {\n" +
- " case 1 -> i;\n" +
- " default -> i;\n" +
- " };\n" +
- " System.out.println(j);\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " new X().foo(1);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public void foo(int i) {\n" +
+ " int j = switch (i) {\n" +
+ " case 1 -> i;\n" +
+ " default -> i;\n" +
+ " };\n" +
+ " System.out.println(j);\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " new X().foo(1);\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " default -> i;\n" +
- " ^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " default -> i;\n" +
+ " ^^^^^^^\n" +
"The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n");
}
@@ -1810,54 +1810,54 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public void foo(int i) {\n" +
- " long j = switch (i) {\n" +
- " case 1 -> 10L;\n" +
- " default -> 20L;\n" +
- " };\n" +
- " System.out.println(j);\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " new X().foo(1);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public void foo(int i) {\n" +
+ " long j = switch (i) {\n" +
+ " case 1 -> 10L;\n" +
+ " default -> 20L;\n" +
+ " };\n" +
+ " System.out.println(j);\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " new X().foo(1);\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " default -> 20L;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " default -> 20L;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n");
}
public void _testBug544223() {
runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public int foo(String s) throws Exception {\n" +
- " int i = switch (s) {\n" +
- " case \"hello\" -> 1;\n" +
- " default -> throw new Exception();\n" +
- " };\n" +
- " return i;\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] argv) {\n" +
- " try {\n" +
- " System.out.print(new X().foo(\"hello\"));\n" +
- " } catch (Exception e) {\n" +
- " //\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public int foo(String s) throws Exception {\n" +
+ " int i = switch (s) {\n" +
+ " case \"hello\" -> 1;\n" +
+ " default -> throw new Exception();\n" +
+ " };\n" +
+ " return i;\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] argv) {\n" +
+ " try {\n" +
+ " System.out.print(new X().foo(\"hello\"));\n" +
+ " } catch (Exception e) {\n" +
+ " //\n" +
+ " }\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " default -> throw new Exception();\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " default -> throw new Exception();\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n");
}
public void _testBug544258_01() {
@@ -1891,84 +1891,84 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
" SATURDAY\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " today = switch (day) {\n" +
- " case SATURDAY,SUNDAY :\n" +
- " today=1;\n" +
- " break today;\n" +
- " case MONDAY,TUESDAY,WEDNESDAY,THURSDAY :\n" +
- " today=2;\n" +
- " break today;\n" +
- " };\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "A switch expression should have at least one result expression\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " today = switch (day) {\n" +
- " ^^^\n" +
- "A Switch expression should cover all possible values\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " case SATURDAY,SUNDAY :\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " case MONDAY,TUESDAY,WEDNESDAY,THURSDAY :\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " today = switch (day) {\n" +
+ " case SATURDAY,SUNDAY :\n" +
+ " today=1;\n" +
+ " break today;\n" +
+ " case MONDAY,TUESDAY,WEDNESDAY,THURSDAY :\n" +
+ " today=2;\n" +
+ " break today;\n" +
+ " };\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "A switch expression should have at least one result expression\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " today = switch (day) {\n" +
+ " ^^^\n" +
+ "A Switch expression should cover all possible values\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " case SATURDAY,SUNDAY :\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " case MONDAY,TUESDAY,WEDNESDAY,THURSDAY :\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
"----------\n");
}
public void _testBug544253() {
runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public void foo(int i ) {\n" +
- " boolean b = switch (i) {\n" +
- " case 0 -> i == 1;\n" +
- " default -> true;\n" +
- " };\n" +
- " System.out.println( b ? \" true\" : \"false\");\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " new X().foo(0);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public void foo(int i ) {\n" +
+ " boolean b = switch (i) {\n" +
+ " case 0 -> i == 1;\n" +
+ " default -> true;\n" +
+ " };\n" +
+ " System.out.println( b ? \" true\" : \"false\");\n" +
+ " }\n" +
+ " public static void main(String[] argv) {\n" +
+ " new X().foo(0);\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " default -> true;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " default -> true;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n");
}
public void _testBug544254() {
runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public void foo(String s) {\n" +
- " try {\n" +
- " int i = switch (s) {\n" +
- " case \"hello\" -> 0;\n" +
- " default -> 2;\n" +
- " };\n" +
- " } finally {\n" +
- " System.out.println(s);\n" +
- " }\n" +
- " }\n" +
- " public static void main(String argv[]) {\n" +
- " new X().foo(\"hello\");\n" +
- " }\n" +
+ "public class X {\n" +
+ " public void foo(String s) {\n" +
+ " try {\n" +
+ " int i = switch (s) {\n" +
+ " case \"hello\" -> 0;\n" +
+ " default -> 2;\n" +
+ " };\n" +
+ " } finally {\n" +
+ " System.out.println(s);\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String argv[]) {\n" +
+ " new X().foo(\"hello\");\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " default -> 2;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " default -> 2;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n");
}
public void _testBug544254_2() {
@@ -1977,27 +1977,27 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public void foo(String s) {\n" +
- " try {\n" +
- " int i = switch (s) {\n" +
- " case \"hello\" -> 0;\n" +
- " default -> 2;\n" +
- " };\n" +
- " } finally {\n" +
- " System.out.println(s);\n" +
- " }\n" +
- " }\n" +
- " public static void main(String argv[]) {\n" +
- " new X().foo(\"hello\");\n" +
- " }\n" +
+ "public class X {\n" +
+ " public void foo(String s) {\n" +
+ " try {\n" +
+ " int i = switch (s) {\n" +
+ " case \"hello\" -> 0;\n" +
+ " default -> 2;\n" +
+ " };\n" +
+ " } finally {\n" +
+ " System.out.println(s);\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String argv[]) {\n" +
+ " new X().foo(\"hello\");\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " default -> 2;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " default -> 2;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n");
}
public void _testBug544254_3() {
@@ -2006,27 +2006,27 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public void foo(String s) {\n" +
- " try {\n" +
- " long l = switch (s) {\n" +
- " case \"hello\" -> 0;\n" +
- " default -> 2;\n" +
- " };\n" +
- " } finally {\n" +
- " System.out.println(s);\n" +
- " }\n" +
- " }\n" +
- " public static void main(String argv[]) {\n" +
- " new X().foo(\"hello\");\n" +
- " }\n" +
+ "public class X {\n" +
+ " public void foo(String s) {\n" +
+ " try {\n" +
+ " long l = switch (s) {\n" +
+ " case \"hello\" -> 0;\n" +
+ " default -> 2;\n" +
+ " };\n" +
+ " } finally {\n" +
+ " System.out.println(s);\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String argv[]) {\n" +
+ " new X().foo(\"hello\");\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " default -> 2;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " default -> 2;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n");
}
public void _testBug544224_1() {
@@ -2048,65 +2048,65 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " default -> 2;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " default -> 2;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n");
}
public void _testBug544298() {
runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " enum MyEnum {\n" +
- " FIRST;\n" +
- " }\n" +
- "\n" +
- " public void foo(MyEnum myEnum) {\n" +
- " int i = switch (myEnum) {\n" +
- " case FIRST -> 1;\n" +
- " };\n" +
- " System.out.println( \"i:\" + i);\n" +
- " }\n" +
- "\n" +
- " public static void main(String argv[]) {\n" +
- " new X().foo(MyEnum.FIRST);\n" +
- " }\n" +
+ "public class X {\n" +
+ " enum MyEnum {\n" +
+ " FIRST;\n" +
+ " }\n" +
+ "\n" +
+ " public void foo(MyEnum myEnum) {\n" +
+ " int i = switch (myEnum) {\n" +
+ " case FIRST -> 1;\n" +
+ " };\n" +
+ " System.out.println( \"i:\" + i);\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String argv[]) {\n" +
+ " new X().foo(MyEnum.FIRST);\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
"----------\n");
}
public void _testBug544298_2() {
runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " enum MyEnum {\n" +
- " FIRST;\n" +
- " }\n" +
- "\n" +
- " public void foo(MyEnum myEnum) {\n" +
- " int i = switch (myEnum) {\n" +
- " case FIRST -> 1;\n" +
- " default -> 0;\n" +
- " };\n" +
- " System.out.println( \"i:\" + i);\n" +
- " }\n" +
- "\n" +
- " public static void main(String argv[]) {\n" +
- " new X().foo(MyEnum.FIRST);\n" +
- " }\n" +
+ "public class X {\n" +
+ " enum MyEnum {\n" +
+ " FIRST;\n" +
+ " }\n" +
+ "\n" +
+ " public void foo(MyEnum myEnum) {\n" +
+ " int i = switch (myEnum) {\n" +
+ " case FIRST -> 1;\n" +
+ " default -> 0;\n" +
+ " };\n" +
+ " System.out.println( \"i:\" + i);\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String argv[]) {\n" +
+ " new X().foo(MyEnum.FIRST);\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " default -> 0;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " default -> 0;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n");
}
public void _testBug544428_01() {
@@ -2129,16 +2129,16 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
"}",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case 0 -> x;\n" +
- " ^\n" +
- "x cannot be resolved to a variable\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " default -> 1;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case 0 -> x;\n" +
+ " ^\n" +
+ "x cannot be resolved to a variable\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " default -> 1;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -2169,16 +2169,16 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " default -> 1;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " default -> 1;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " default -> 1;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " default -> 1;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n");
}
public void _testBug544560_01() {
@@ -2201,161 +2201,161 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " default -> 1;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " default -> 1;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " default -> 1;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " default -> 1;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n");
}
public void _testBug544458() {
runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static int foo(int i) {\n" +
- " boolean v = switch (i) {\n" +
- " case 1: i = 10; break true;\n" +
- " default: break false;\n" +
- " };\n" +
- " return v ? 0 : 1;\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " System.out.println(X.foo(0));\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static int foo(int i) {\n" +
+ " boolean v = switch (i) {\n" +
+ " case 1: i = 10; break true;\n" +
+ " default: break false;\n" +
+ " };\n" +
+ " return v ? 0 : 1;\n" +
+ " }\n" +
+ " public static void main(String[] argv) {\n" +
+ " System.out.println(X.foo(0));\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case 1: i = 10; break true;\n" +
- " ^^^^\n" +
- "Syntax error on token \"true\", delete this token\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " default: break false;\n" +
- " ^^^^^\n" +
- "Syntax error on token \"false\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case 1: i = 10; break true;\n" +
+ " ^^^^\n" +
+ "Syntax error on token \"true\", delete this token\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " default: break false;\n" +
+ " ^^^^^\n" +
+ "Syntax error on token \"false\", delete this token\n" +
"----------\n");
}
public void _testBug544458_2() {
runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static int foo(int i) {\n" +
- " boolean v = switch (i) {\n" +
- " case 1: i++; break true;\n" +
- " default: break false;\n" +
- " };\n" +
- " return v ? 0 : 1;\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " System.out.println(X.foo(1));\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static int foo(int i) {\n" +
+ " boolean v = switch (i) {\n" +
+ " case 1: i++; break true;\n" +
+ " default: break false;\n" +
+ " };\n" +
+ " return v ? 0 : 1;\n" +
+ " }\n" +
+ " public static void main(String[] argv) {\n" +
+ " System.out.println(X.foo(1));\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case 1: i++; break true;\n" +
- " ^^^^\n" +
- "Syntax error on token \"true\", delete this token\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " default: break false;\n" +
- " ^^^^^\n" +
- "Syntax error on token \"false\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case 1: i++; break true;\n" +
+ " ^^^^\n" +
+ "Syntax error on token \"true\", delete this token\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " default: break false;\n" +
+ " ^^^^^\n" +
+ "Syntax error on token \"false\", delete this token\n" +
"----------\n");
}
public void _testBug544458_3() {
runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static int foo(int i) {\n" +
- " boolean v = switch (i) {\n" +
- " case 1: i+= 10; break true;\n" +
- " default: break false;\n" +
- " };\n" +
- " return v ? 0 : 1;\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " System.out.println(X.foo(1));\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static int foo(int i) {\n" +
+ " boolean v = switch (i) {\n" +
+ " case 1: i+= 10; break true;\n" +
+ " default: break false;\n" +
+ " };\n" +
+ " return v ? 0 : 1;\n" +
+ " }\n" +
+ " public static void main(String[] argv) {\n" +
+ " System.out.println(X.foo(1));\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case 1: i+= 10; break true;\n" +
- " ^^^^\n" +
- "Syntax error on token \"true\", delete this token\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " default: break false;\n" +
- " ^^^^^\n" +
- "Syntax error on token \"false\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case 1: i+= 10; break true;\n" +
+ " ^^^^\n" +
+ "Syntax error on token \"true\", delete this token\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " default: break false;\n" +
+ " ^^^^^\n" +
+ "Syntax error on token \"false\", delete this token\n" +
"----------\n");
}
public void _testBug544458_4() {
runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static int foo(int i) {\n" +
- " boolean v = switch (i) {\n" +
- " case 1: switch(i) {case 4: break;}; break true;\n" +
- " default: break false;\n" +
- " };\n" +
- " return v ? 0 : 1;\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " System.out.println(X.foo(1));\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static int foo(int i) {\n" +
+ " boolean v = switch (i) {\n" +
+ " case 1: switch(i) {case 4: break;}; break true;\n" +
+ " default: break false;\n" +
+ " };\n" +
+ " return v ? 0 : 1;\n" +
+ " }\n" +
+ " public static void main(String[] argv) {\n" +
+ " System.out.println(X.foo(1));\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case 1: switch(i) {case 4: break;}; break true;\n" +
- " ^^^^\n" +
- "Syntax error on token \"true\", delete this token\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " default: break false;\n" +
- " ^^^^^\n" +
- "Syntax error on token \"false\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case 1: switch(i) {case 4: break;}; break true;\n" +
+ " ^^^^\n" +
+ "Syntax error on token \"true\", delete this token\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " default: break false;\n" +
+ " ^^^^^\n" +
+ "Syntax error on token \"false\", delete this token\n" +
"----------\n");
}
public void _testBug544458_5() {
runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static int foo(int i) {\n" +
- " boolean v = switch (i) {\n" +
- " case 1: foo(5); break true;\n" +
- " default: break false;\n" +
- " };\n" +
- " return v ? 0 : 1;\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " System.out.println(X.foo(1));\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static int foo(int i) {\n" +
+ " boolean v = switch (i) {\n" +
+ " case 1: foo(5); break true;\n" +
+ " default: break false;\n" +
+ " };\n" +
+ " return v ? 0 : 1;\n" +
+ " }\n" +
+ " public static void main(String[] argv) {\n" +
+ " System.out.println(X.foo(1));\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case 1: foo(5); break true;\n" +
- " ^^^^\n" +
- "Syntax error on token \"true\", delete this token\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " default: break false;\n" +
- " ^^^^^\n" +
- "Syntax error on token \"false\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case 1: foo(5); break true;\n" +
+ " ^^^^\n" +
+ "Syntax error on token \"true\", delete this token\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " default: break false;\n" +
+ " ^^^^^\n" +
+ "Syntax error on token \"false\", delete this token\n" +
"----------\n");
}
public void _testBug544601_1() {
@@ -2385,60 +2385,60 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " break true;\n" +
- " ^^^^\n" +
- "Syntax error on token \"true\", delete this token\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " default: break false;\n" +
- " ^^^^^\n" +
- "Syntax error on token \"false\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " break true;\n" +
+ " ^^^^\n" +
+ "Syntax error on token \"true\", delete this token\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " default: break false;\n" +
+ " ^^^^^\n" +
+ "Syntax error on token \"false\", delete this token\n" +
"----------\n");
}
public void _testBug544556() {
runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public int foo(int i) {\n" +
- " @SuppressWarnings(\"preview\")\n" +
- " int v =\n" +
- " switch(switch(i) {\n" +
- " case 0 -> { break 2; }\n" +
- " default -> { break 3; }\n" +
- " }) {\n" +
- " case 0 -> { break 0; }\n" +
- " default -> { break 1; }\n" +
- " };\n" +
- " return v == 1 ? v : 0;\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " System.out.println(new X().foo(0));\n" +
- " }\n" +
+ "public class X {\n" +
+ " public int foo(int i) {\n" +
+ " @SuppressWarnings(\"preview\")\n" +
+ " int v =\n" +
+ " switch(switch(i) {\n" +
+ " case 0 -> { break 2; }\n" +
+ " default -> { break 3; }\n" +
+ " }) {\n" +
+ " case 0 -> { break 0; }\n" +
+ " default -> { break 1; }\n" +
+ " };\n" +
+ " return v == 1 ? v : 0;\n" +
+ " }\n" +
+ " public static void main(String[] argv) {\n" +
+ " System.out.println(new X().foo(0));\n" +
+ " }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " case 0 -> { break 2; }\n" +
- " ^\n" +
- "Syntax error on token \"2\", delete this token\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " default -> { break 3; }\n" +
- " ^\n" +
- "Syntax error on token \"3\", delete this token\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " case 0 -> { break 0; }\n" +
- " ^\n" +
- "Syntax error on token \"0\", delete this token\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " default -> { break 1; }\n" +
- " ^\n" +
- "Syntax error on token \"1\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " case 0 -> { break 2; }\n" +
+ " ^\n" +
+ "Syntax error on token \"2\", delete this token\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " default -> { break 3; }\n" +
+ " ^\n" +
+ "Syntax error on token \"3\", delete this token\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 9)\n" +
+ " case 0 -> { break 0; }\n" +
+ " ^\n" +
+ "Syntax error on token \"0\", delete this token\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 10)\n" +
+ " default -> { break 1; }\n" +
+ " ^\n" +
+ "Syntax error on token \"1\", delete this token\n" +
"----------\n");
}
public void _testBug544702_01() {
@@ -2461,11 +2461,11 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
"\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " default -> k = -1;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " default -> k = -1;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n");
}
public void _testBug545168_01() {
@@ -2492,21 +2492,21 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
" MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " case MONDAY, FRIDAY -> System.out.println(Day.SUNDAY);\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " case THURSDAY, SATURDAY -> System.out.println(8);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " default -> {}\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " case MONDAY, FRIDAY -> System.out.println(Day.SUNDAY);\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " case THURSDAY, SATURDAY -> System.out.println(8);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 9)\n" +
+ " default -> {}\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n");
}
public void _testBug545255_01() {
@@ -2529,39 +2529,39 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
" }\n"+
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case 60, 600: break 6;\n" +
- " ^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " case 60, 600: break 6;\n" +
- " ^\n" +
- "Syntax error on token \"6\", delete this token\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " case 70: break 7;\n" +
- " ^\n" +
- "Syntax error on token \"7\", delete this token\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " case 80: break 8;\n" +
- " ^\n" +
- "Syntax error on token \"8\", delete this token\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " case 90, 900: break 9;\n" +
- " ^\n" +
- "Syntax error on token \"9\", delete this token\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 8)\n" +
- " default: break 0;\n" +
- " ^\n" +
- "Syntax error on token \"0\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case 60, 600: break 6;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " case 60, 600: break 6;\n" +
+ " ^\n" +
+ "Syntax error on token \"6\", delete this token\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " case 70: break 7;\n" +
+ " ^\n" +
+ "Syntax error on token \"7\", delete this token\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " case 80: break 8;\n" +
+ " ^\n" +
+ "Syntax error on token \"8\", delete this token\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 7)\n" +
+ " case 90, 900: break 9;\n" +
+ " ^\n" +
+ "Syntax error on token \"9\", delete this token\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 8)\n" +
+ " default: break 0;\n" +
+ " ^\n" +
+ "Syntax error on token \"0\", delete this token\n" +
"----------\n");
}
- // see comment 12 in the bug
+ // see comment 12 in the bug
public void _testBug513766_01() {
this.runNegativeTest(
new String[] {
@@ -2577,21 +2577,21 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
" <T> T magic() { return null; }\n"+
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (switch(i) { default -> magic(); })\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Object to boolean\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " if (switch(i) { default -> magic(); })\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " if (magic())\n" +
- " ^^^^^^^\n" +
- "Type mismatch: cannot convert from Object to boolean\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " if (switch(i) { default -> magic(); })\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Object to boolean\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " if (switch(i) { default -> magic(); })\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " if (magic())\n" +
+ " ^^^^^^^\n" +
+ "Type mismatch: cannot convert from Object to boolean\n" +
"----------\n");
}
public void _testBug545333() {
@@ -2618,18 +2618,18 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
" private static final long serialVersionUID = 3461899582505930473L; \n"+
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " int v = switch (i) {\n" +
- " default -> throw new MyException();\n" +
- " };\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "A switch expression should have at least one result expression\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " default -> throw new MyException();\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " int v = switch (i) {\n" +
+ " default -> throw new MyException();\n" +
+ " };\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "A switch expression should have at least one result expression\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " default -> throw new MyException();\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n");
}
public void _testBug545518() {
@@ -2638,20 +2638,20 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
Map<String, String> options = getCompilerOptions();
options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.WARNING);
- String message =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ String message =
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
"----------\n";
-
+
this.runNegativeTest(new String[] {
"X.java",
"public class X {\n" +
" public static void main(String [] args) {\n" +
" String arg = \"ABD\";\n" +
- " switch(arg) {\n" +
+ " switch(arg) {\n" +
" case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
" }\n" +
" }\n" +
@@ -2669,20 +2669,20 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
Map<String, String> options = getCompilerOptions();
options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
- String message =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ String message =
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
"----------\n";
-
+
this.runNegativeTest(new String[] {
"X.java",
"public class X {\n" +
" public static void main(String [] args) {\n" +
" String arg = \"ABD\";\n" +
- " switch(arg) {\n" +
+ " switch(arg) {\n" +
" case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
" }\n" +
" }\n" +
@@ -2700,20 +2700,20 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
Map<String, String> options = getCompilerOptions();
options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED);
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.WARNING);
- String message =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ String message =
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
"----------\n";
-
+
this.runNegativeTest(new String[] {
"X.java",
"public class X {\n" +
" public static void main(String [] args) {\n" +
" String arg = \"ABD\";\n" +
- " switch(arg) {\n" +
+ " switch(arg) {\n" +
" case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
" }\n" +
" }\n" +
@@ -2744,11 +2744,11 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
" }\n"+
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " default -> o = 0;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " default -> o = 0;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n");
}
public void _testBug545916_01() {
@@ -2770,11 +2770,11 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
" }\n"+
"} \n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " default -> o = 0;\n" +
- " ^^^^^^^\n" +
- "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " default -> o = 0;\n" +
+ " ^^^^^^^\n" +
+ "The preview feature Case Labels with \'->\' is only available with source level 13 and above\n" +
"----------\n");
}
public void _testBug545983_01() {
@@ -2802,11 +2802,11 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
" }\n"+
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " break 1;\n" +
- " ^\n" +
- "Syntax error on token \"1\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " break 1;\n" +
+ " ^\n" +
+ "Syntax error on token \"1\", delete this token\n" +
"----------\n");
}
public void _testBug545983_02() {
@@ -2834,124 +2834,124 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
" }\n"+
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " break 1;\n" +
- " ^\n" +
- "Syntax error on token \"1\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " break 1;\n" +
+ " ^\n" +
+ "Syntax error on token \"1\", delete this token\n" +
"----------\n");
}
public void _testBug547125_01() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " void foo(Day day) {\n" +
- " switch (day) {\n" +
- " case SATURDAY, SUNDAY, SUNDAY:\n" +
- " System.out.println(\"Weekend\");\n" +
- " case MONDAY:\n" +
+ "public class X {\n" +
+ " void foo(Day day) {\n" +
+ " switch (day) {\n" +
+ " case SATURDAY, SUNDAY, SUNDAY:\n" +
+ " System.out.println(\"Weekend\");\n" +
+ " case MONDAY:\n" +
" System.out.println(\"Weekday\");\n" +
- " default: \n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "enum Day {\n" +
- " MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;\n" +
+ " default: \n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "enum Day {\n" +
+ " MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case SATURDAY, SUNDAY, SUNDAY:\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " case SATURDAY, SUNDAY, SUNDAY:\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
- " ^^^^^^^\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case SATURDAY, SUNDAY, SUNDAY:\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " case SATURDAY, SUNDAY, SUNDAY:\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ " ^^^^^^^\n" +
"----------\n");
}
public void _testBug547125_02() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " void foo(Day day) {\n" +
- " switch (day) {\n" +
- " case SATURDAY, SUNDAY, MONDAY:\n" +
- " System.out.println(\"Weekend\");\n" +
- " case MONDAY, SUNDAY:\n" +
+ "public class X {\n" +
+ " void foo(Day day) {\n" +
+ " switch (day) {\n" +
+ " case SATURDAY, SUNDAY, MONDAY:\n" +
+ " System.out.println(\"Weekend\");\n" +
+ " case MONDAY, SUNDAY:\n" +
" System.out.println(\"Weekday\");\n" +
- " default: \n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "enum Day {\n" +
- " MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;\n" +
+ " default: \n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "enum Day {\n" +
+ " MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case SATURDAY, SUNDAY, MONDAY:\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " case SATURDAY, SUNDAY, MONDAY:\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " case MONDAY, SUNDAY:\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The preview feature Multi constant case is only available with source level 13 and above\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " case MONDAY, SUNDAY:\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 6)\n" +
- " case MONDAY, SUNDAY:\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case SATURDAY, SUNDAY, MONDAY:\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " case SATURDAY, SUNDAY, MONDAY:\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " case MONDAY, SUNDAY:\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The preview feature Multi constant case is only available with source level 13 and above\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " case MONDAY, SUNDAY:\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 6)\n" +
+ " case MONDAY, SUNDAY:\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
"----------\n");
}
public void _testBug544943() {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " @SuppressWarnings(\"preview\")\n" +
- " public static int foo(int i) throws MyException {\n" +
- " int v = -1;\n" +
- " try {\n" +
- " v = switch (i) {\n" +
- " case 0 -> switch(i) {\n" +
- " case 0 -> 1;\n" +
- " default -> throw new MyException();\n" +
- " };\n" +
- " default -> 1;\n" +
- " };\n" +
- " } finally {\n" +
- " // do nothing\n" +
- " }\n" +
- " return v;\n" +
- " } \n" +
- " public static void main(String argv[]) {\n" +
- " try {\n" +
- " System.out.println(X.foo(0));\n" +
- " } catch (MyException e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "class MyException extends Exception {\n" +
- " private static final long serialVersionUID = 3461899582505930473L; \n" +
+ "public class X {\n" +
+ " @SuppressWarnings(\"preview\")\n" +
+ " public static int foo(int i) throws MyException {\n" +
+ " int v = -1;\n" +
+ " try {\n" +
+ " v = switch (i) {\n" +
+ " case 0 -> switch(i) {\n" +
+ " case 0 -> 1;\n" +
+ " default -> throw new MyException();\n" +
+ " };\n" +
+ " default -> 1;\n" +
+ " };\n" +
+ " } finally {\n" +
+ " // do nothing\n" +
+ " }\n" +
+ " return v;\n" +
+ " } \n" +
+ " public static void main(String argv[]) {\n" +
+ " try {\n" +
+ " System.out.println(X.foo(0));\n" +
+ " } catch (MyException e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "class MyException extends Exception {\n" +
+ " private static final long serialVersionUID = 3461899582505930473L; \n" +
"}"
},
"1");
@@ -2960,22 +2960,22 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " @SuppressWarnings({ \"preview\" })\n" +
- " public static int foo(int i) throws Exception {\n" +
- " int v = switch (i) {\n" +
- " case 0 -> switch (i) {\n" +
- " case 0 -> 0;\n" +
- " default-> throw new Exception();\n" +
- " case 3 -> 3;\n" +
- " case 2 -> throw new Exception();\n" +
- " };\n" +
- " default -> 0;\n" +
- " };\n" +
- " return v;\n" +
- " }\n" +
- " public static void main(String argv[]) throws Exception {\n" +
- " System.out.println(X.foo(1));\n" +
+ "public class X {\n" +
+ " @SuppressWarnings({ \"preview\" })\n" +
+ " public static int foo(int i) throws Exception {\n" +
+ " int v = switch (i) {\n" +
+ " case 0 -> switch (i) {\n" +
+ " case 0 -> 0;\n" +
+ " default-> throw new Exception();\n" +
+ " case 3 -> 3;\n" +
+ " case 2 -> throw new Exception();\n" +
+ " };\n" +
+ " default -> 0;\n" +
+ " };\n" +
+ " return v;\n" +
+ " }\n" +
+ " public static void main(String argv[]) throws Exception {\n" +
+ " System.out.println(X.foo(1));\n" +
" }\n" +
"}"
},
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionsYieldTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionsYieldTest.java
index 52839b67b..789546290 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionsYieldTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionsYieldTest.java
@@ -28,7 +28,7 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
// TESTS_RANGE = new int[] { 1, -1 };
// TESTS_NAMES = new String[] { "testBug552764" };
}
-
+
public static Class<?> testClass() {
return SwitchExpressionsYieldTest.class;
}
@@ -52,7 +52,7 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
protected void runConformTestWithJavac(String[] testFiles, String expectedOutput) {
runConformTest(testFiles, expectedOutput, _getCompilerOptions(), new String[] {"--enable-preview"}, new JavacTestOptions("-source 14 --enable-preview"));
}
-
+
@Override
protected void runConformTest(String[] testFiles, String expectedOutput) {
runConformTest(testFiles, expectedOutput, getCompilerOptions());
@@ -182,17 +182,17 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " int tw = switch (i) {\n" +
- " };\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "A switch expression should have a non-empty switch block\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " int tw = switch (i) {\n" +
- " ^\n" +
- "A switch expression should have a default case\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " int tw = switch (i) {\n" +
+ " };\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "A switch expression should have a non-empty switch block\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " int tw = switch (i) {\n" +
+ " ^\n" +
+ "A switch expression should have a default case\n" +
"----------\n");
}
public void testBug544073_004() {
@@ -217,11 +217,11 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " case \"hello\" -> throw new java.io.IOException(\"hello\");\n" +
- " ^^^^^^^\n" +
- "Type mismatch: cannot convert from String to int\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " case \"hello\" -> throw new java.io.IOException(\"hello\");\n" +
+ " ^^^^^^^\n" +
+ "Type mismatch: cannot convert from String to int\n" +
"----------\n");
}
public void testBug544073_005() {
@@ -245,16 +245,16 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " int tw = switch (i) {\n" +
- " ^\n" +
- "A switch expression should have a default case\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " int tw = switch (i) {\n" +
+ " ^\n" +
+ "A switch expression should have a default case\n" +
"----------\n");
}
/**
* Add a test case for enum
- * If the type of the selector expression is an enum type,
+ * If the type of the selector expression is an enum type,
* then the set of all the case constants associated with the switch block
* must contain all the enum constants of that enum type
* Add a missing enum test case
@@ -285,16 +285,16 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " int tw = switch (i) {\n" +
- " ^^^^^\n" +
- " The switch expression should have a default case\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " int tw = switch (i) {\n" +
+ " ^^^^^\n" +
+ " The switch expression should have a default case\n" +
"----------\n");
}
/*
* should compile - test for adding additional nesting in variables
- * dev note: ref consumeToken().case Switch
+ * dev note: ref consumeToken().case Switch
*/
public void testBug544073_007() {
runConformTest(
@@ -344,30 +344,30 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " int tw = switch (i) {\n" +
- " case 0 -> i * 0;\n" +
- " case 1 -> 2;\n" +
- " default -> 3;\n" +
- " };\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Switch Expressions is a preview feature and disabled by default. Use --enable-preview to enable\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " case 0 -> i * 0;\n" +
- " ^^^^^^\n" +
- "Case Labels with '->' is a preview feature and disabled by default. Use --enable-preview to enable\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " case 1 -> 2;\n" +
- " ^^^^^^\n" +
- "Case Labels with '->' is a preview feature and disabled by default. Use --enable-preview to enable\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " default -> 3;\n" +
- " ^^^^^^^\n" +
- "Case Labels with '->' is a preview feature and disabled by default. Use --enable-preview to enable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " int tw = switch (i) {\n" +
+ " case 0 -> i * 0;\n" +
+ " case 1 -> 2;\n" +
+ " default -> 3;\n" +
+ " };\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Switch Expressions is a preview feature and disabled by default. Use --enable-preview to enable\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " case 0 -> i * 0;\n" +
+ " ^^^^^^\n" +
+ "Case Labels with '->' is a preview feature and disabled by default. Use --enable-preview to enable\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " case 1 -> 2;\n" +
+ " ^^^^^^\n" +
+ "Case Labels with '->' is a preview feature and disabled by default. Use --enable-preview to enable\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 6)\n" +
+ " default -> 3;\n" +
+ " ^^^^^^^\n" +
+ "Case Labels with '->' is a preview feature and disabled by default. Use --enable-preview to enable\n" +
"----------\n";
this.runNegativeTest(
@@ -417,21 +417,21 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case 0 -> i * 0;\n" +
- " ^^^^^\n" +
- "Invalid expression as statement\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " case 1 -> 2;\n" +
- " ^\n" +
- "Invalid expression as statement\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " default -> 3;\n" +
- " ^\n" +
- "Invalid expression as statement\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case 0 -> i * 0;\n" +
+ " ^^^^^\n" +
+ "Invalid expression as statement\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " case 1 -> 2;\n" +
+ " ^\n" +
+ "Invalid expression as statement\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " default -> 3;\n" +
+ " ^\n" +
+ "Invalid expression as statement\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -460,11 +460,11 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " default -> 3;\n" +
- " ^\n" +
- "Invalid expression as statement\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " default -> 3;\n" +
+ " ^\n" +
+ "Invalid expression as statement\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -491,11 +491,11 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " default -> 3;\n" +
- " ^\n" +
- "Invalid expression as statement\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " default -> 3;\n" +
+ " ^\n" +
+ "Invalid expression as statement\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -524,11 +524,11 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 0)\n" +
- " public class X {\n" +
- " ^\n" +
- "Preview features enabled at an invalid source release level "+CompilerOptions.VERSION_11+", preview can be enabled only at source level "+AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL+"\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 0)\n" +
+ " public class X {\n" +
+ " ^\n" +
+ "Preview features enabled at an invalid source release level "+CompilerOptions.VERSION_11+", preview can be enabled only at source level "+AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL+"\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -565,11 +565,11 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " default :v = 2;\n" +
- " ^^^^^\n" +
- "A switch labeled block in a switch expression should not complete normally\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " default :v = 2;\n" +
+ " ^^^^^\n" +
+ "A switch labeled block in a switch expression should not complete normally\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -594,11 +594,11 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " }.toLowerCase());\n" +
- " ^\n" +
- "Syntax error on token \".\", , expected\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " }.toLowerCase());\n" +
+ " ^\n" +
+ "Syntax error on token \".\", , expected\n" +
"----------\n";
runner.runNegativeTest();
}
@@ -634,14 +634,14 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
String[] testFiles = new String[] {
"X.java",
"public class X {\n" +
- "public static void bar(Day day) {\n" +
- " switch (day) {\n" +
- " case SATURDAY, SUNDAY: \n" +
- " System.out.println(Day.SUNDAY);\n" +
- " break;\n" +
- " case MONDAY : System.out.println(Day.MONDAY);\n" +
- " break;\n" +
- " }\n" +
+ "public static void bar(Day day) {\n" +
+ " switch (day) {\n" +
+ " case SATURDAY, SUNDAY: \n" +
+ " System.out.println(Day.SUNDAY);\n" +
+ " break;\n" +
+ " case MONDAY : System.out.println(Day.MONDAY);\n" +
+ " break;\n" +
+ " }\n" +
" }" +
" public static void main(String[] args) {\n" +
" bar(Day.SATURDAY);\n" +
@@ -663,27 +663,27 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
String[] testFiles = new String[] {
"X.java",
"public class X {\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- "public static void bar(Day day) {\n" +
- " switch (day) {\n" +
- " case SATURDAY, SUNDAY: \n" +
- " System.out.println(Day.SUNDAY);\n" +
- " break;\n" +
- " case MONDAY : System.out.println(Day.MONDAY);\n" +
- " break;\n" +
- " }\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
+ "public static void bar(Day day) {\n" +
+ " switch (day) {\n" +
+ " case SATURDAY, SUNDAY: \n" +
+ " System.out.println(Day.SUNDAY);\n" +
+ " break;\n" +
+ " case MONDAY : System.out.println(Day.MONDAY);\n" +
+ " break;\n" +
+ " }\n" +
" }" +
"}\n" +
"enum Day { SATURDAY, SUNDAY, MONDAY, TUESDAY;}",
};
String expectedProblemLog =
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " switch (day) {\n" +
- " ^^^\n" +
- "The enum constant TUESDAY needs a corresponding case label in this enum switch on Day\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " switch (day) {\n" +
+ " ^^^\n" +
+ "The enum constant TUESDAY needs a corresponding case label in this enum switch on Day\n" +
"----------\n";
this.runWarningTest(
testFiles,
@@ -696,14 +696,14 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
String[] testFiles = new String[] {
"X.java",
"public class X {\n" +
- "public static void bar(Day day) {\n" +
- " switch (day) {\n" +
- " case SATURDAY, SUNDAY: \n" +
- " System.out.println(Day.SUNDAY);\n" +
- " break;\n" +
- " case SUNDAY : System.out.println(Day.SUNDAY);\n" +
- " break;\n" +
- " }\n" +
+ "public static void bar(Day day) {\n" +
+ " switch (day) {\n" +
+ " case SATURDAY, SUNDAY: \n" +
+ " System.out.println(Day.SUNDAY);\n" +
+ " break;\n" +
+ " case SUNDAY : System.out.println(Day.SUNDAY);\n" +
+ " break;\n" +
+ " }\n" +
" }" +
" public static void main(String[] args) {\n" +
" bar(Day.SATURDAY);\n" +
@@ -713,16 +713,16 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case SATURDAY, SUNDAY: \n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " case SUNDAY : System.out.println(Day.SUNDAY);\n" +
- " ^^^^^^^^^^^\n" +
- "Duplicate case\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case SATURDAY, SUNDAY: \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " case SUNDAY : System.out.println(Day.SUNDAY);\n" +
+ " ^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -735,61 +735,61 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
String[] testFiles = new String[] {
"X.java",
"public class X {\n" +
- "public static void bar(Day day) {\n" +
- " switch (day) {\n" +
- " case SATURDAY, SUNDAY: \n" +
- " System.out.println(Day.SUNDAY);\n" +
- " break;\n" +
+ "public static void bar(Day day) {\n" +
+ " switch (day) {\n" +
+ " case SATURDAY, SUNDAY: \n" +
+ " System.out.println(Day.SUNDAY);\n" +
+ " break;\n" +
" case SUNDAY, SATURDAY : \n" +
- " System.out.println(Day.SUNDAY);\n" +
- " break;\n" +
- " }\n" +
+ " System.out.println(Day.SUNDAY);\n" +
+ " break;\n" +
+ " }\n" +
" }" +
"}\n" +
"enum Day { SATURDAY, SUNDAY, MONDAY;}",
};
String expectedProblemLog =
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " switch (day) {\n" +
- " ^^^\n" +
- "The enum constant MONDAY needs a corresponding case label in this enum switch on Day\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " case SATURDAY, SUNDAY: \n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " switch (day) {\n" +
+ " ^^^\n" +
+ "The enum constant MONDAY needs a corresponding case label in this enum switch on Day\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " case SATURDAY, SUNDAY: \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " case SUNDAY, SATURDAY : \n" +
" ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " case SUNDAY, SATURDAY : \n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " case SUNDAY, SATURDAY : \n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " case SUNDAY, SATURDAY : \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
"----------\n";
this.runNegativeTest(
testFiles,
expectedProblemLog);
}
/*
- *
+ *
*/
public void testBug544073_021() {
String[] testFiles = new String[] {
"X.java",
"public class X {\n" +
- "public static void bar(Day day) {\n" +
- " switch (day) {\n" +
- " case SATURDAY, SUNDAY: \n" +
- " System.out.println(Day.SUNDAY);\n" +
- " break;\n" +
- " case TUESDAY : System.out.println(Day.SUNDAY);\n" +
- " break;\n" +
- " }\n" +
+ "public static void bar(Day day) {\n" +
+ " switch (day) {\n" +
+ " case SATURDAY, SUNDAY: \n" +
+ " System.out.println(Day.SUNDAY);\n" +
+ " break;\n" +
+ " case TUESDAY : System.out.println(Day.SUNDAY);\n" +
+ " break;\n" +
+ " }\n" +
" }" +
" public static void main(String[] args) {\n" +
" bar(Day.SATURDAY);\n" +
@@ -799,11 +799,11 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
};
String expectedProblemLog =
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " switch (day) {\n" +
- " ^^^\n" +
- "The enum constant MONDAY needs a corresponding case label in this enum switch on Day\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " switch (day) {\n" +
+ " ^^^\n" +
+ "The enum constant MONDAY needs a corresponding case label in this enum switch on Day\n" +
"----------\n";
this.runWarningTest(
testFiles,
@@ -813,14 +813,14 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
String[] testFiles = new String[] {
"X.java",
"public class X {\n" +
- "public static void bar(Day day) {\n" +
- " switch (day) {\n" +
- " case SATURDAY, SUNDAY: \n" +
- " System.out.println(day);\n" +
- " break;\n" +
- " case MONDAY : System.out.println(0);\n" +
- " break;\n" +
- " }\n" +
+ "public static void bar(Day day) {\n" +
+ " switch (day) {\n" +
+ " case SATURDAY, SUNDAY: \n" +
+ " System.out.println(day);\n" +
+ " break;\n" +
+ " case MONDAY : System.out.println(0);\n" +
+ " break;\n" +
+ " }\n" +
" }" +
" public static void main(String[] args) {\n" +
" bar(Day.SATURDAY);\n" +
@@ -832,8 +832,8 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
};
String expectedProblemLog =
- "SATURDAY\n" +
- "0\n" +
+ "SATURDAY\n" +
+ "0\n" +
"SUNDAY";
this.runConformTest(
testFiles,
@@ -848,32 +848,32 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " bar(\"a\");\n" +
- " bar(\"b\");\n" +
- " bar(\"c\");\n" +
- " bar(\"d\");\n" +
- " }\n" +
- " public static void bar(String s) {\n" +
- " switch(s) {\n" +
- " case \"a\":\n" +
- " case \"b\":\n" +
- " System.out.println(\"A/B\");\n" +
- " break;\n" +
- " case \"c\":\n" +
- " System.out.println(\"C\");\n" +
- " break;\n" +
- " default:\n" +
- " System.out.println(\"NA\");\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " bar(\"a\");\n" +
+ " bar(\"b\");\n" +
+ " bar(\"c\");\n" +
+ " bar(\"d\");\n" +
+ " }\n" +
+ " public static void bar(String s) {\n" +
+ " switch(s) {\n" +
+ " case \"a\":\n" +
+ " case \"b\":\n" +
+ " System.out.println(\"A/B\");\n" +
+ " break;\n" +
+ " case \"c\":\n" +
+ " System.out.println(\"C\");\n" +
+ " break;\n" +
+ " default:\n" +
+ " System.out.println(\"NA\");\n" +
+ " }\n" +
+ " }\n" +
"}",
};
String expectedProblemLog =
- "A/B\n" +
- "A/B\n" +
- "C\n" +
+ "A/B\n" +
+ "A/B\n" +
+ "C\n" +
"NA";
this.runConformTest(
testFiles,
@@ -882,31 +882,31 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
public void testBug544073_024() {
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " bar(\"a\");\n" +
- " bar(\"b\");\n" +
- " bar(\"c\");\n" +
- " bar(\"d\");\n" +
- " }\n" +
- " public static void bar(String s) {\n" +
- " switch(s) {\n" +
- " case \"a\", \"b\":\n" +
- " System.out.println(\"A/B\");\n" +
- " break;\n" +
- " case \"c\":\n" +
- " System.out.println(\"C\");\n" +
- " break;\n" +
- " default:\n" +
- " System.out.println(\"NA\");\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " bar(\"a\");\n" +
+ " bar(\"b\");\n" +
+ " bar(\"c\");\n" +
+ " bar(\"d\");\n" +
+ " }\n" +
+ " public static void bar(String s) {\n" +
+ " switch(s) {\n" +
+ " case \"a\", \"b\":\n" +
+ " System.out.println(\"A/B\");\n" +
+ " break;\n" +
+ " case \"c\":\n" +
+ " System.out.println(\"C\");\n" +
+ " break;\n" +
+ " default:\n" +
+ " System.out.println(\"NA\");\n" +
+ " }\n" +
+ " }\n" +
"}",
};
String expectedProblemLog =
- "A/B\n" +
- "A/B\n" +
- "C\n" +
+ "A/B\n" +
+ "A/B\n" +
+ "C\n" +
"NA";
this.runConformTest(
testFiles,
@@ -919,31 +919,31 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
public void testBug544073_025() {
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " bar(\"FB\");\n" +
- " bar(\"Ea\");\n" +
- " bar(\"c\");\n" +
- " bar(\"D\");\n" +
- " }\n" +
- " public static void bar(String s) {\n" +
- " switch(s) {\n" +
- " case \"FB\", \"c\":\n" +
- " System.out.println(\"A\");\n" +
- " break;\n" +
- " case \"Ea\":\n" +
- " System.out.println(\"B\");\n" +
- " break;\n" +
- " default:\n" +
- " System.out.println(\"NA\");\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " bar(\"FB\");\n" +
+ " bar(\"Ea\");\n" +
+ " bar(\"c\");\n" +
+ " bar(\"D\");\n" +
+ " }\n" +
+ " public static void bar(String s) {\n" +
+ " switch(s) {\n" +
+ " case \"FB\", \"c\":\n" +
+ " System.out.println(\"A\");\n" +
+ " break;\n" +
+ " case \"Ea\":\n" +
+ " System.out.println(\"B\");\n" +
+ " break;\n" +
+ " default:\n" +
+ " System.out.println(\"NA\");\n" +
+ " }\n" +
+ " }\n" +
"}",
};
String expectedProblemLog =
- "A\n" +
- "B\n" +
- "A\n" +
+ "A\n" +
+ "B\n" +
+ "A\n" +
"NA";
this.runConformTest(
testFiles,
@@ -958,33 +958,33 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " bar(1);\n" +
- " bar(2);\n" +
- " bar(3);\n" +
- " bar(4);\n" +
- " bar(5);\n" +
- " }\n" +
- " public static void bar(int i) {\n" +
- " switch (i) {\n" +
- " case 1, 3: \n" +
- " System.out.println(\"Odd\");\n" +
- " break;\n" +
- " case 2, 4: \n" +
- " System.out.println(\"Even\");\n" +
- " break;\n" +
- " default:\n" +
- " System.out.println(\"Out of range\");\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " bar(1);\n" +
+ " bar(2);\n" +
+ " bar(3);\n" +
+ " bar(4);\n" +
+ " bar(5);\n" +
+ " }\n" +
+ " public static void bar(int i) {\n" +
+ " switch (i) {\n" +
+ " case 1, 3: \n" +
+ " System.out.println(\"Odd\");\n" +
+ " break;\n" +
+ " case 2, 4: \n" +
+ " System.out.println(\"Even\");\n" +
+ " break;\n" +
+ " default:\n" +
+ " System.out.println(\"Out of range\");\n" +
+ " }\n" +
+ " }\n" +
"}",
};
String expectedProblemLog =
- "Odd\n" +
- "Even\n" +
- "Odd\n" +
- "Even\n" +
+ "Odd\n" +
+ "Even\n" +
+ "Odd\n" +
+ "Even\n" +
"Out of range";
this.runConformTest(
testFiles,
@@ -999,29 +999,29 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public static void bar(int i) {\n" +
- " switch (i) {\n" +
- " case 1, 3: \n" +
- " System.out.println(\"Odd\");\n" +
- " break;\n" +
- " case \"2\": \n" +
- " System.out.println(\"Even\");\n" +
- " break;\n" +
- " default:\n" +
- " System.out.println(\"Out of range\");\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
+ " public static void bar(int i) {\n" +
+ " switch (i) {\n" +
+ " case 1, 3: \n" +
+ " System.out.println(\"Odd\");\n" +
+ " break;\n" +
+ " case \"2\": \n" +
+ " System.out.println(\"Even\");\n" +
+ " break;\n" +
+ " default:\n" +
+ " System.out.println(\"Out of range\");\n" +
+ " }\n" +
+ " }\n" +
"}",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " case \"2\": \n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from String to int\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " case \"2\": \n" +
+ " ^^^\n" +
+ "Type mismatch: cannot convert from String to int\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -1040,28 +1040,28 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportFallthroughCase, CompilerOptions.WARNING);
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public static void bar(int i) {\n" +
- " switch (i) {\n" +
- " case 1, 3: \n" +
- " System.out.println(\"Odd\");\n" +
- " case 2, 4: \n" +
- " System.out.println(\"Even\");\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
+ " public static void bar(int i) {\n" +
+ " switch (i) {\n" +
+ " case 1, 3: \n" +
+ " System.out.println(\"Odd\");\n" +
+ " case 2, 4: \n" +
+ " System.out.println(\"Even\");\n" +
" break;\n" +
- " default:\n" +
- " System.out.println(\"Out of range\");\n" +
- " }\n" +
- " }\n" +
+ " default:\n" +
+ " System.out.println(\"Out of range\");\n" +
+ " }\n" +
+ " }\n" +
"}",
};
String expectedProblemLog =
- "----------\n" +
- "1. WARNING in X.java (at line 8)\n" +
- " case 2, 4: \n" +
- " ^^^^^^^^^\n" +
- "Switch case may be entered by falling through previous case. If intended, add a new comment //$FALL-THROUGH$ on the line above\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 8)\n" +
+ " case 2, 4: \n" +
+ " ^^^^^^^^^\n" +
+ "Switch case may be entered by falling through previous case. If intended, add a new comment //$FALL-THROUGH$ on the line above\n" +
"----------\n";
this.runWarningTest(
testFiles,
@@ -1079,25 +1079,25 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportMissingDefaultCase, CompilerOptions.WARNING);
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public static void bar(int i) {\n" +
- " switch (i) {\n" +
- " case 1, 3: \n" +
- " System.out.println(\"Odd\");\n" +
- " case 2, 4: \n" +
- " System.out.println(\"Even\");\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
+ " public static void bar(int i) {\n" +
+ " switch (i) {\n" +
+ " case 1, 3: \n" +
+ " System.out.println(\"Odd\");\n" +
+ " case 2, 4: \n" +
+ " System.out.println(\"Even\");\n" +
+ " }\n" +
+ " }\n" +
"}",
};
String expectedProblemLog =
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " switch (i) {\n" +
- " ^\n" +
- "The switch statement should have a default case\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " switch (i) {\n" +
+ " ^\n" +
+ "The switch statement should have a default case\n" +
"----------\n";
this.runWarningTest(
testFiles,
@@ -1113,30 +1113,30 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public static void bar(int i) {\n" +
- " switch (i) {\n" +
- " case 1, 3: \n" +
- " System.out.println(\"Odd\");\n" +
- " case 3, 4: \n" +
- " System.out.println(\"Odd\");\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
+ " public static void bar(int i) {\n" +
+ " switch (i) {\n" +
+ " case 1, 3: \n" +
+ " System.out.println(\"Odd\");\n" +
+ " case 3, 4: \n" +
+ " System.out.println(\"Odd\");\n" +
+ " }\n" +
+ " }\n" +
"}",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " case 1, 3: \n" +
- " ^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " case 3, 4: \n" +
- " ^^^^^^^^^\n" +
- "Duplicate case\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " case 1, 3: \n" +
+ " ^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " case 3, 4: \n" +
+ " ^^^^^^^^^\n" +
+ "Duplicate case\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -1154,30 +1154,30 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public static void bar(String s) {\n" +
- " switch (s) {\n" +
- " case \"a\", \"b\": \n" +
- " System.out.println(\"Odd\");\n" +
- " case \"b\", \"c\": \n" +
- " System.out.println(\"Odd\");\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
+ " public static void bar(String s) {\n" +
+ " switch (s) {\n" +
+ " case \"a\", \"b\": \n" +
+ " System.out.println(\"Odd\");\n" +
+ " case \"b\", \"c\": \n" +
+ " System.out.println(\"Odd\");\n" +
+ " }\n" +
+ " }\n" +
"}",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " case \"a\", \"b\": \n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " case \"b\", \"c\": \n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " case \"a\", \"b\": \n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " case \"b\", \"c\": \n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -1195,24 +1195,24 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public static void bar(Num s) {\n" +
- " switch (s) {\n" +
- " case ONE, Num.TWO: \n" +
- " System.out.println(\"Odd\");\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
+ " public static void bar(Num s) {\n" +
+ " switch (s) {\n" +
+ " case ONE, Num.TWO: \n" +
+ " System.out.println(\"Odd\");\n" +
+ " }\n" +
+ " }\n" +
"}\n" +
"enum Num { ONE, TWO}\n",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " case ONE, Num.TWO: \n" +
- " ^^^^^^^\n" +
- "The qualified case label Num.TWO must be replaced with the unqualified enum constant TWO\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " case ONE, Num.TWO: \n" +
+ " ^^^^^^^\n" +
+ "The qualified case label Num.TWO must be replaced with the unqualified enum constant TWO\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -1227,21 +1227,21 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public void bar(int s) {\n" +
- " int j = switch (s) {\n" +
+ "public class X {\n" +
+ " public void bar(int s) {\n" +
+ " int j = switch (s) {\n" +
" case 1, 2, 3 -> (s+1);\n" +
- " default -> j;\n" +
- " };\n" +
- " }\n" +
+ " default -> j;\n" +
+ " };\n" +
+ " }\n" +
"}\n",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " default -> j;\n" +
- " ^\n" +
- "The local variable j may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " default -> j;\n" +
+ " ^\n" +
+ "The local variable j may not have been initialized\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -1253,16 +1253,16 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
public void testBug544073_034() {
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " }\n" +
" public void bar(int s) {\n" +
- " int j = 0;" +
- " j = switch (s) {\n" +
+ " int j = 0;" +
+ " j = switch (s) {\n" +
" case 1, 2, 3 -> (s+1);\n" +
- " default -> j;\n" +
- " };\n" +
- " }\n" +
+ " default -> j;\n" +
+ " };\n" +
+ " }\n" +
"}\n",
};
this.runConformTest(
@@ -1303,11 +1303,11 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " break;\n" +
- " ^^^^^^\n" +
- "break out of switch expression not allowed\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " break;\n" +
+ " ^^^^^^\n" +
+ "break out of switch expression not allowed\n" +
"----------\n");
}
public void testBug544073_036() {
@@ -1316,23 +1316,23 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
String[] testFiles = new String[] {
"X.java",
- "public class X {\n" +
- " @SuppressWarnings(\"preview\")\n" +
- " public static void bar(int i) {\n" +
- " i = switch (i+0) {\n" +
- " default: System.out.println(0);\n" +
- " }; " +
- " }\n" +
+ "public class X {\n" +
+ " @SuppressWarnings(\"preview\")\n" +
+ " public static void bar(int i) {\n" +
+ " i = switch (i+0) {\n" +
+ " default: System.out.println(0);\n" +
+ " }; " +
+ " }\n" +
"}",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " i = switch (i+0) {\n" +
- " default: System.out.println(0);\n" +
- " }; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "A switch expression should have at least one result expression\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " i = switch (i+0) {\n" +
+ " default: System.out.println(0);\n" +
+ " }; }\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "A switch expression should have at least one result expression\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -1348,18 +1348,18 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
String[] testFiles = new String[] {
"X.java",
"public class X {\n" +
- " void test(int i) {\n" +
- " need(switch (i) {\n" +
- " case 1 -> \"\";\n" +
- " default -> i == 3 ? null : \"\";\n" +
- " }); \n" +
- " }\n" +
- " void need(String s) {\n" +
- " System.out.println(s.toLowerCase());\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new X().need(\"Hello World\");\n" +
- " }\n" +
+ " void test(int i) {\n" +
+ " need(switch (i) {\n" +
+ " case 1 -> \"\";\n" +
+ " default -> i == 3 ? null : \"\";\n" +
+ " }); \n" +
+ " }\n" +
+ " void need(String s) {\n" +
+ " System.out.println(s.toLowerCase());\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().need(\"Hello World\");\n" +
+ " }\n" +
"}\n"
};
String expectedOutput = "hello world";
@@ -1372,18 +1372,18 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
String[] testFiles = new String[] {
"X.java",
"public class X {\n" +
- " void test(int i) {\n" +
- " need(switch (i) {\n" +
- " case 1: yield \"\";\n" +
- " default: yield i == 3 ? null : \"\";\n" +
- " }); \n" +
- " }\n" +
- " void need(String s) {\n" +
- " System.out.println(s.toLowerCase());\n" +
+ " void test(int i) {\n" +
+ " need(switch (i) {\n" +
+ " case 1: yield \"\";\n" +
+ " default: yield i == 3 ? null : \"\";\n" +
+ " }); \n" +
+ " }\n" +
+ " void need(String s) {\n" +
+ " System.out.println(s.toLowerCase());\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new X().need(\"Hello World\");\n" +
" }\n" +
- " public static void main(String[] args) {\n" +
- " new X().need(\"Hello World\");\n" +
- " }\n" +
"}\n"
};
String expectedOutput = "hello world";
@@ -1395,26 +1395,26 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
String[] testFiles = new String[] {
"X.java",
- "interface I0 { void i(); }\n" +
- "interface I1 extends I0 {}\n" +
+ "interface I0 { void i(); }\n" +
+ "interface I1 extends I0 {}\n" +
"interface I2 extends I0 {}\n" +
"public class X {\n" +
- " I1 n1() { return null; }\n" +
- " <I extends I2> I n2() { return null; }\n" +
- " <M> M m(M m) { return m; }\n" +
- " void test(int i, boolean b) {\n" +
- " m(switch (i) {\n" +
- " case 1 -> n1();\n" +
- " default -> b ? n1() : n2();\n" +
- " }).i(); \n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
+ " I1 n1() { return null; }\n" +
+ " <I extends I2> I n2() { return null; }\n" +
+ " <M> M m(M m) { return m; }\n" +
+ " void test(int i, boolean b) {\n" +
+ " m(switch (i) {\n" +
+ " case 1 -> n1();\n" +
+ " default -> b ? n1() : n2();\n" +
+ " }).i(); \n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
" try {\n" +
" new X().test(1, true);\n" +
" } catch (NullPointerException e) {\n" +
" System.out.println(\"NPE as expected\");\n" +
" }\n" +
- " }\n" +
+ " }\n" +
"}\n"
};
String expectedOutput = "NPE as expected";
@@ -1427,26 +1427,26 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
String[] testFiles = new String[] {
"X.java",
"import java.util.function.Supplier;\n" +
- "interface I0 { void i(); }\n" +
- "interface I1 extends I0 {}\n" +
+ "interface I0 { void i(); }\n" +
+ "interface I1 extends I0 {}\n" +
"interface I2 extends I0 {}\n" +
"public class X {\n" +
- " I1 n1() { return null; }\n" +
- " <I extends I2> I n2() { return null; }\n" +
- " <M> M m(Supplier<M> m) { return m.get(); }\n" +
- " void test(int i, boolean b) {\n" +
- " m(switch (i) {\n" +
- " case 1 -> this::n1;\n" +
- " default -> this::n2;\n" +
- " }).i(); \n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
+ " I1 n1() { return null; }\n" +
+ " <I extends I2> I n2() { return null; }\n" +
+ " <M> M m(Supplier<M> m) { return m.get(); }\n" +
+ " void test(int i, boolean b) {\n" +
+ " m(switch (i) {\n" +
+ " case 1 -> this::n1;\n" +
+ " default -> this::n2;\n" +
+ " }).i(); \n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
" try {\n" +
" new X().test(1, true);\n" +
" } catch (NullPointerException e) {\n" +
" System.out.println(\"NPE as expected\");\n" +
" }\n" +
- " }\n" +
+ " }\n" +
"}\n"
};
String expectedOutput = "NPE as expected";
@@ -1460,18 +1460,18 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
String[] testFiles = new String[] {
"X.java",
"public class X {\n" +
- " void test(int i) {\n" +
- " need(switch (i) {\n" +
- " case 1 -> 1.0f;\n" +
- " default -> i == 3 ? 3 : 5.0d;\n" +
- " }); \n" +
- " }\n" +
- " <N extends Number> void need(N s) {\n" +
- " System.out.println(s.toString());\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
+ " void test(int i) {\n" +
+ " need(switch (i) {\n" +
+ " case 1 -> 1.0f;\n" +
+ " default -> i == 3 ? 3 : 5.0d;\n" +
+ " }); \n" +
+ " }\n" +
+ " <N extends Number> void need(N s) {\n" +
+ " System.out.println(s.toString());\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
" new X().need(3);\n" +
- " }\n" +
+ " }\n" +
"}\n"
};
String expectedOutput = "3";
@@ -1481,28 +1481,28 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " static int twice(int i) throws Exception {\n" +
- " switch (i) {\n" +
- " case 0 -> System.out.println(\"hellow\");\n" +
- " case 1 -> foo();\n" +
- " default -> throw new Exception();\n" +
- " };\n" +
- " return 0;\n" +
- " }\n" +
- "\n" +
- " static int foo() {\n" +
- " System.out.println(\"inside foo\");\n" +
- " return 1;\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " System.out.print(twice(1));\n" +
- " } catch (Exception e) {\n" +
- " System.out.print(\"Got Exception\");\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " static int twice(int i) throws Exception {\n" +
+ " switch (i) {\n" +
+ " case 0 -> System.out.println(\"hellow\");\n" +
+ " case 1 -> foo();\n" +
+ " default -> throw new Exception();\n" +
+ " };\n" +
+ " return 0;\n" +
+ " }\n" +
+ "\n" +
+ " static int foo() {\n" +
+ " System.out.println(\"inside foo\");\n" +
+ " return 1;\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
+ " System.out.print(twice(1));\n" +
+ " } catch (Exception e) {\n" +
+ " System.out.print(\"Got Exception\");\n" +
+ " }\n" +
+ " }\n" +
"}"
},
"inside foo\n"
@@ -1512,24 +1512,24 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
runConformTest(
new String[] {
"X.java",
- "enum SomeDays {\n" +
- " Mon, Wed, Fri\n" +
- "}\n" +
- "\n" +
- "public class X {\n" +
- " int testEnum(boolean b) {\n" +
- " SomeDays day = b ? SomeDays.Mon : null;\n" +
- " return switch(day) {\n" +
- " case Mon -> 1;\n" +
- " case Wed -> 2;\n" +
- " case Fri -> 3;\n" +
- " };\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(new X().testEnum(true));\n" +
- " }\n" +
- "}\n" +
+ "enum SomeDays {\n" +
+ " Mon, Wed, Fri\n" +
+ "}\n" +
+ "\n" +
+ "public class X {\n" +
+ " int testEnum(boolean b) {\n" +
+ " SomeDays day = b ? SomeDays.Mon : null;\n" +
+ " return switch(day) {\n" +
+ " case Mon -> 1;\n" +
+ " case Wed -> 2;\n" +
+ " case Fri -> 3;\n" +
+ " };\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(new X().testEnum(true));\n" +
+ " }\n" +
+ "}\n" +
""
},
"1");
@@ -1553,11 +1553,11 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
"}\n",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " default -> 3; // should flag an error\n" +
- " ^\n" +
- "Invalid expression as statement\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " default -> 3; // should flag an error\n" +
+ " ^\n" +
+ "Invalid expression as statement\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -1571,18 +1571,18 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public void foo(int i) {\n" +
- " int j = switch (i) {\n" +
- " case 1 -> i;\n" +
- " default -> i;\n" +
- " };\n" +
- " System.out.println(j);\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " new X().foo(1);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public void foo(int i) {\n" +
+ " int j = switch (i) {\n" +
+ " case 1 -> i;\n" +
+ " default -> i;\n" +
+ " };\n" +
+ " System.out.println(j);\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " new X().foo(1);\n" +
+ " }\n" +
"}"
},
"1");
@@ -1591,18 +1591,18 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public void foo(int i) {\n" +
- " long j = switch (i) {\n" +
- " case 1 -> 10L;\n" +
- " default -> 20L;\n" +
- " };\n" +
- " System.out.println(j);\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " new X().foo(1);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public void foo(int i) {\n" +
+ " long j = switch (i) {\n" +
+ " case 1 -> 10L;\n" +
+ " default -> 20L;\n" +
+ " };\n" +
+ " System.out.println(j);\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " new X().foo(1);\n" +
+ " }\n" +
"}"
},
"10");
@@ -1611,22 +1611,22 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public int foo(String s) throws Exception {\n" +
- " int i = switch (s) {\n" +
- " case \"hello\" -> 1;\n" +
- " default -> throw new Exception();\n" +
- " };\n" +
- " return i;\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] argv) {\n" +
- " try {\n" +
- " System.out.print(new X().foo(\"hello\"));\n" +
- " } catch (Exception e) {\n" +
- " //\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public int foo(String s) throws Exception {\n" +
+ " int i = switch (s) {\n" +
+ " case \"hello\" -> 1;\n" +
+ " default -> throw new Exception();\n" +
+ " };\n" +
+ " return i;\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String[] argv) {\n" +
+ " try {\n" +
+ " System.out.print(new X().foo(\"hello\"));\n" +
+ " } catch (Exception e) {\n" +
+ " //\n" +
+ " }\n" +
+ " }\n" +
"}"
},
"1");
@@ -1662,28 +1662,28 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" SATURDAY\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " today = switch (day) {\n" +
- " ^^^\n" +
- "A Switch expression should cover all possible values\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " today = switch (day) {\n" +
+ " ^^^\n" +
+ "A Switch expression should cover all possible values\n" +
"----------\n");
}
public void testBug544073_049() {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public void foo(int i ) {\n" +
- " boolean b = switch (i) {\n" +
- " case 0 -> i == 1;\n" +
- " default -> true;\n" +
- " };\n" +
- " System.out.println( b ? \" true\" : \"false\");\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " new X().foo(0);\n" +
- " }\n" +
+ "public class X {\n" +
+ " public void foo(int i ) {\n" +
+ " boolean b = switch (i) {\n" +
+ " case 0 -> i == 1;\n" +
+ " default -> true;\n" +
+ " };\n" +
+ " System.out.println( b ? \" true\" : \"false\");\n" +
+ " }\n" +
+ " public static void main(String[] argv) {\n" +
+ " new X().foo(0);\n" +
+ " }\n" +
"}"
},
"false");
@@ -1692,20 +1692,20 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public void foo(String s) {\n" +
- " try {\n" +
- " int i = switch (s) {\n" +
- " case \"hello\" -> 0;\n" +
- " default -> 2;\n" +
- " };\n" +
- " } finally {\n" +
- " System.out.println(s);\n" +
- " }\n" +
- " }\n" +
- " public static void main(String argv[]) {\n" +
- " new X().foo(\"hello\");\n" +
- " }\n" +
+ "public class X {\n" +
+ " public void foo(String s) {\n" +
+ " try {\n" +
+ " int i = switch (s) {\n" +
+ " case \"hello\" -> 0;\n" +
+ " default -> 2;\n" +
+ " };\n" +
+ " } finally {\n" +
+ " System.out.println(s);\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String argv[]) {\n" +
+ " new X().foo(\"hello\");\n" +
+ " }\n" +
"}"
},
"hello");
@@ -1716,20 +1716,20 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public void foo(String s) {\n" +
- " try {\n" +
- " int i = switch (s) {\n" +
- " case \"hello\" -> 0;\n" +
- " default -> 2;\n" +
- " };\n" +
- " } finally {\n" +
- " System.out.println(s);\n" +
- " }\n" +
- " }\n" +
- " public static void main(String argv[]) {\n" +
- " new X().foo(\"hello\");\n" +
- " }\n" +
+ "public class X {\n" +
+ " public void foo(String s) {\n" +
+ " try {\n" +
+ " int i = switch (s) {\n" +
+ " case \"hello\" -> 0;\n" +
+ " default -> 2;\n" +
+ " };\n" +
+ " } finally {\n" +
+ " System.out.println(s);\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String argv[]) {\n" +
+ " new X().foo(\"hello\");\n" +
+ " }\n" +
"}"
},
"hello");
@@ -1740,20 +1740,20 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public void foo(String s) {\n" +
- " try {\n" +
- " long l = switch (s) {\n" +
- " case \"hello\" -> 0;\n" +
- " default -> 2;\n" +
- " };\n" +
- " } finally {\n" +
- " System.out.println(s);\n" +
- " }\n" +
- " }\n" +
- " public static void main(String argv[]) {\n" +
- " new X().foo(\"hello\");\n" +
- " }\n" +
+ "public class X {\n" +
+ " public void foo(String s) {\n" +
+ " try {\n" +
+ " long l = switch (s) {\n" +
+ " case \"hello\" -> 0;\n" +
+ " default -> 2;\n" +
+ " };\n" +
+ " } finally {\n" +
+ " System.out.println(s);\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String argv[]) {\n" +
+ " new X().foo(\"hello\");\n" +
+ " }\n" +
"}"
},
"hello");
@@ -1784,21 +1784,21 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " enum MyEnum {\n" +
- " FIRST;\n" +
- " }\n" +
- "\n" +
- " public void foo(MyEnum myEnum) {\n" +
- " int i = switch (myEnum) {\n" +
- " case FIRST -> 1;\n" +
- " };\n" +
- " System.out.println( \"i:\" + i);\n" +
- " }\n" +
- "\n" +
- " public static void main(String argv[]) {\n" +
- " new X().foo(MyEnum.FIRST);\n" +
- " }\n" +
+ "public class X {\n" +
+ " enum MyEnum {\n" +
+ " FIRST;\n" +
+ " }\n" +
+ "\n" +
+ " public void foo(MyEnum myEnum) {\n" +
+ " int i = switch (myEnum) {\n" +
+ " case FIRST -> 1;\n" +
+ " };\n" +
+ " System.out.println( \"i:\" + i);\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String argv[]) {\n" +
+ " new X().foo(MyEnum.FIRST);\n" +
+ " }\n" +
"}"
},
"i:1");
@@ -1807,22 +1807,22 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " enum MyEnum {\n" +
- " FIRST;\n" +
- " }\n" +
- "\n" +
- " public void foo(MyEnum myEnum) {\n" +
- " int i = switch (myEnum) {\n" +
- " case FIRST -> 1;\n" +
- " default -> 0;\n" +
- " };\n" +
- " System.out.println( \"i:\" + i);\n" +
- " }\n" +
- "\n" +
- " public static void main(String argv[]) {\n" +
- " new X().foo(MyEnum.FIRST);\n" +
- " }\n" +
+ "public class X {\n" +
+ " enum MyEnum {\n" +
+ " FIRST;\n" +
+ " }\n" +
+ "\n" +
+ " public void foo(MyEnum myEnum) {\n" +
+ " int i = switch (myEnum) {\n" +
+ " case FIRST -> 1;\n" +
+ " default -> 0;\n" +
+ " };\n" +
+ " System.out.println( \"i:\" + i);\n" +
+ " }\n" +
+ "\n" +
+ " public static void main(String argv[]) {\n" +
+ " new X().foo(MyEnum.FIRST);\n" +
+ " }\n" +
"}"
},
"i:1");
@@ -1847,11 +1847,11 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
"}",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case 0 -> x;\n" +
- " ^\n" +
- "x cannot be resolved to a variable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case 0 -> x;\n" +
+ " ^\n" +
+ "x cannot be resolved to a variable\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -1910,17 +1910,17 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static int foo(int i) {\n" +
- " boolean v = switch (i) {\n" +
- " case 1: i = 10; yield true;\n" +
- " default: yield false;\n" +
- " };\n" +
- " return v ? 0 : 1;\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " System.out.println(X.foo(0));\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static int foo(int i) {\n" +
+ " boolean v = switch (i) {\n" +
+ " case 1: i = 10; yield true;\n" +
+ " default: yield false;\n" +
+ " };\n" +
+ " return v ? 0 : 1;\n" +
+ " }\n" +
+ " public static void main(String[] argv) {\n" +
+ " System.out.println(X.foo(0));\n" +
+ " }\n" +
"}"
},
"1");
@@ -1929,17 +1929,17 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static int foo(int i) {\n" +
- " boolean v = switch (i) {\n" +
- " case 1: i++; yield true;\n" +
- " default: yield false;\n" +
- " };\n" +
- " return v ? 0 : 1;\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " System.out.println(X.foo(1));\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static int foo(int i) {\n" +
+ " boolean v = switch (i) {\n" +
+ " case 1: i++; yield true;\n" +
+ " default: yield false;\n" +
+ " };\n" +
+ " return v ? 0 : 1;\n" +
+ " }\n" +
+ " public static void main(String[] argv) {\n" +
+ " System.out.println(X.foo(1));\n" +
+ " }\n" +
"}"
},
"0");
@@ -1948,17 +1948,17 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static int foo(int i) {\n" +
- " boolean v = switch (i) {\n" +
- " case 1: i+= 10; yield true;\n" +
- " default: yield false;\n" +
- " };\n" +
- " return v ? 0 : 1;\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " System.out.println(X.foo(1));\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static int foo(int i) {\n" +
+ " boolean v = switch (i) {\n" +
+ " case 1: i+= 10; yield true;\n" +
+ " default: yield false;\n" +
+ " };\n" +
+ " return v ? 0 : 1;\n" +
+ " }\n" +
+ " public static void main(String[] argv) {\n" +
+ " System.out.println(X.foo(1));\n" +
+ " }\n" +
"}"
},
"0");
@@ -1967,17 +1967,17 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static int foo(int i) {\n" +
- " boolean v = switch (i) {\n" +
- " case 1: switch(i) {case 4: break;}; yield true;\n" +
- " default: yield false;\n" +
- " };\n" +
- " return v ? 0 : 1;\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " System.out.println(X.foo(1));\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static int foo(int i) {\n" +
+ " boolean v = switch (i) {\n" +
+ " case 1: switch(i) {case 4: break;}; yield true;\n" +
+ " default: yield false;\n" +
+ " };\n" +
+ " return v ? 0 : 1;\n" +
+ " }\n" +
+ " public static void main(String[] argv) {\n" +
+ " System.out.println(X.foo(1));\n" +
+ " }\n" +
"}"
},
"0");
@@ -1986,17 +1986,17 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static int foo(int i) {\n" +
- " boolean v = switch (i) {\n" +
- " case 1: foo(5); yield true;\n" +
- " default: yield false;\n" +
- " };\n" +
- " return v ? 0 : 1;\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " System.out.println(X.foo(1));\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static int foo(int i) {\n" +
+ " boolean v = switch (i) {\n" +
+ " case 1: foo(5); yield true;\n" +
+ " default: yield false;\n" +
+ " };\n" +
+ " return v ? 0 : 1;\n" +
+ " }\n" +
+ " public static void main(String[] argv) {\n" +
+ " System.out.println(X.foo(1));\n" +
+ " }\n" +
"}"
},
"0");
@@ -2034,22 +2034,22 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public int foo(int i) {\n" +
- " @SuppressWarnings(\"preview\")\n" +
- " int v =\n" +
- " switch(switch(i) {\n" +
- " case 0 -> { yield 2; }\n" +
- " default -> { yield 3; }\n" +
- " }) {\n" +
- " case 0 -> { yield 0; }\n" +
- " default -> { yield 1; }\n" +
- " };\n" +
- " return v == 1 ? v : 0;\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " System.out.println(new X().foo(0));\n" +
- " }\n" +
+ "public class X {\n" +
+ " public int foo(int i) {\n" +
+ " @SuppressWarnings(\"preview\")\n" +
+ " int v =\n" +
+ " switch(switch(i) {\n" +
+ " case 0 -> { yield 2; }\n" +
+ " default -> { yield 3; }\n" +
+ " }) {\n" +
+ " case 0 -> { yield 0; }\n" +
+ " default -> { yield 1; }\n" +
+ " };\n" +
+ " return v == 1 ? v : 0;\n" +
+ " }\n" +
+ " public static void main(String[] argv) {\n" +
+ " System.out.println(new X().foo(0));\n" +
+ " }\n" +
"}"
},
"1");
@@ -2124,7 +2124,7 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
},
"0");
}
- // see comment 12 in the bug
+ // see comment 12 in the bug
public void testBug513766_01() {
Runner runner = new Runner();
runner.testFiles = new String[] {
@@ -2141,16 +2141,16 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
"}\n",
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (switch(i) { default -> magic(); })\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Object to boolean\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " if (magic())\n" +
- " ^^^^^^^\n" +
- "Type mismatch: cannot convert from Object to boolean\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " if (switch(i) { default -> magic(); })\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Object to boolean\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " if (magic())\n" +
+ " ^^^^^^^\n" +
+ "Type mismatch: cannot convert from Object to boolean\n" +
"----------\n";
runner.vmArguments = new String[] {"--enable-preview"};
runner.javacTestOptions = JavacHasABug.JavacBug8179483_switchExpression;
@@ -2180,13 +2180,13 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" private static final long serialVersionUID = 3461899582505930473L; \n"+
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " int v = switch (i) {\n" +
- " default -> throw new MyException();\n" +
- " };\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "A switch expression should have at least one result expression\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " int v = switch (i) {\n" +
+ " default -> throw new MyException();\n" +
+ " };\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "A switch expression should have at least one result expression\n" +
"----------\n");
}
public void testBug544073_071() {
@@ -2195,46 +2195,46 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
Map<String, String> options = getCompilerOptions();
options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.WARNING);
- String message =
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
- " ^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ String message =
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n";
-
+
this.runWarningTest(new String[] {
"X.java",
"public class X {\n" +
" public static void main(String [] args) {\n" +
" String arg = \"ABD\";\n" +
- " switch(arg) {\n" +
+ " switch(arg) {\n" +
" case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
" }\n" +
" }\n" +
"}\n"
},
- message,
+ message,
options,
"-Xlint:preview");
}
public void testBug544073_072() {
if (this.complianceLevel < ClassFileConstants.JDK12)
return;
- String message =
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
- " ^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ String message =
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n";
-
+
this.runWarningTest(new String[] {
"X.java",
"public class X {\n" +
" public static void main(String [] args) {\n" +
" String arg = \"ABD\";\n" +
- " switch(arg) {\n" +
+ " switch(arg) {\n" +
" case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
" }\n" +
" }\n" +
@@ -2249,20 +2249,20 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
Map<String, String> options = getCompilerOptions();
options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED);
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.WARNING);
- String message =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Multi constant case is a preview feature and disabled by default. Use --enable-preview to enable\n" +
+ String message =
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Multi constant case is a preview feature and disabled by default. Use --enable-preview to enable\n" +
"----------\n";
-
+
this.runNegativeTest(new String[] {
"X.java",
"public class X {\n" +
" public static void main(String [] args) {\n" +
" String arg = \"ABD\";\n" +
- " switch(arg) {\n" +
+ " switch(arg) {\n" +
" case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
" }\n" +
" }\n" +
@@ -2341,11 +2341,11 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" }\n"+
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " continue;\n" +
- " ^^^^^^^^^\n" +
- "'continue' or 'return' cannot be the last statement in a Switch expression case body\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " continue;\n" +
+ " ^^^^^^^^^\n" +
+ "'continue' or 'return' cannot be the last statement in a Switch expression case body\n" +
"----------\n");
}
public void testBug544073_077() {
@@ -2373,75 +2373,75 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" }\n"+
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " return 2;\n" +
- " ^^^^^^^^^\n" +
- "'continue' or 'return' cannot be the last statement in a Switch expression case body\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " return 2;\n" +
+ " ^^^^^^^^^\n" +
+ "'continue' or 'return' cannot be the last statement in a Switch expression case body\n" +
"----------\n");
}
public void testBug544073_078() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " void foo(Day day) {\n" +
- " switch (day) {\n" +
- " case SATURDAY, SUNDAY, SUNDAY:\n" +
- " System.out.println(\"Weekend\");\n" +
- " case MONDAY:\n" +
+ "public class X {\n" +
+ " void foo(Day day) {\n" +
+ " switch (day) {\n" +
+ " case SATURDAY, SUNDAY, SUNDAY:\n" +
+ " System.out.println(\"Weekend\");\n" +
+ " case MONDAY:\n" +
" System.out.println(\"Weekday\");\n" +
- " default: \n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "enum Day {\n" +
- " MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;\n" +
+ " default: \n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "enum Day {\n" +
+ " MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case SATURDAY, SUNDAY, SUNDAY:\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case SATURDAY, SUNDAY, SUNDAY:\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
"----------\n");
}
public void testBug544073_079() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " void foo(Day day) {\n" +
- " switch (day) {\n" +
- " case SATURDAY, SUNDAY, MONDAY:\n" +
- " System.out.println(\"Weekend\");\n" +
- " case MONDAY, SUNDAY:\n" +
+ "public class X {\n" +
+ " void foo(Day day) {\n" +
+ " switch (day) {\n" +
+ " case SATURDAY, SUNDAY, MONDAY:\n" +
+ " System.out.println(\"Weekend\");\n" +
+ " case MONDAY, SUNDAY:\n" +
" System.out.println(\"Weekday\");\n" +
- " default: \n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "enum Day {\n" +
- " MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;\n" +
+ " default: \n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "enum Day {\n" +
+ " MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case SATURDAY, SUNDAY, MONDAY:\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " case MONDAY, SUNDAY:\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " case MONDAY, SUNDAY:\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case SATURDAY, SUNDAY, MONDAY:\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " case MONDAY, SUNDAY:\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " case MONDAY, SUNDAY:\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
"----------\n");
}
public void testBug544073_80() {
@@ -2488,18 +2488,18 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" public static void main(String[] args) {\n"+
" System.out.println(X.foo(1));\n"+
" }\n"+
- "}\n",
+ "}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " case 1 : { break 1; }\n" +
- " ^\n" +
- "Syntax error on token \"1\", delete this token\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " default : { break 2; }\n" +
- " ^\n" +
- "Syntax error on token \"2\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " case 1 : { break 1; }\n" +
+ " ^\n" +
+ "Syntax error on token \"1\", delete this token\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " default : { break 2; }\n" +
+ " ^\n" +
+ "Syntax error on token \"2\", delete this token\n" +
"----------\n");
}
public void testBug547891_01() {
@@ -2512,13 +2512,13 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" yield();\n"+
" X.yield();\n"+
" }\n"+
- "}\n",
+ "}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " yield();\n" +
- " ^^^^^^^\n" +
- "restricted identifier yield not allowed here - method calls need to be qualified\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " yield();\n" +
+ " ^^^^^^^\n" +
+ "restricted identifier yield not allowed here - method calls need to be qualified\n" +
"----------\n");
}
public void testBug547891_02() {
@@ -2534,19 +2534,19 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" public static void bar() {\n"+
" Zork();\n"+
" }\n"+
- "}\n",
+ "}\n",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " yield();\n" +
- " ^^^^^^^\n" +
- "restricted identifier yield not allowed here - method calls need to be qualified\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " yield();\n" +
+ " ^^^^^^^\n" +
+ "restricted identifier yield not allowed here - method calls need to be qualified\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -2566,18 +2566,18 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" }\n"+
"}\n"+
"class yield {\n" +
- "}\n",
+ "}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " yield 1;\n" +
- " ^^^^^\n" +
- "Syntax error on token \"yield\", AssignmentOperator expected after this token\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " class yield {\n" +
- " ^^^^^\n" +
- "yield is a restricted identifier and cannot be used as type name\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " yield 1;\n" +
+ " ^^^^^\n" +
+ "Syntax error on token \"yield\", AssignmentOperator expected after this token\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " class yield {\n" +
+ " ^^^^^\n" +
+ "yield is a restricted identifier and cannot be used as type name\n" +
"----------\n");
}
public void testBug547891_04() {
@@ -2592,19 +2592,19 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" }\n"+
"}\n"+
"class yield {\n" +
- "}\n",
+ "}\n",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " yield 1;\n" +
- " ^^^^^\n" +
- "Syntax error on token \"yield\", AssignmentOperator expected after this token\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " class yield {\n" +
- " ^^^^^\n" +
- "yield is a restricted identifier and cannot be used as type name\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " yield 1;\n" +
+ " ^^^^^\n" +
+ "Syntax error on token \"yield\", AssignmentOperator expected after this token\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " class yield {\n" +
+ " ^^^^^\n" +
+ "yield is a restricted identifier and cannot be used as type name\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -2624,18 +2624,18 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" }\n"+
"}\n"+
"class yield {\n" +
- "}\n",
+ "}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " yield y;\n" +
- " ^^^^^\n" +
- "yield is a restricted identifier and cannot be used as type name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " class yield {\n" +
- " ^^^^^\n" +
- "yield is a restricted identifier and cannot be used as type name\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " yield y;\n" +
+ " ^^^^^\n" +
+ "yield is a restricted identifier and cannot be used as type name\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " class yield {\n" +
+ " ^^^^^\n" +
+ "yield is a restricted identifier and cannot be used as type name\n" +
"----------\n");
}
public void testBug547891_06() {
@@ -2650,24 +2650,24 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" }\n"+
"}\n"+
"class yield {\n" +
- "}\n",
+ "}\n",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " yield y;\n" +
- " ^^^^^\n" +
- "yield is a restricted identifier and cannot be used as type name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " class yield {\n" +
- " ^^^^^\n" +
- "yield is a restricted identifier and cannot be used as type name\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " yield y;\n" +
+ " ^^^^^\n" +
+ "yield is a restricted identifier and cannot be used as type name\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " class yield {\n" +
+ " ^^^^^\n" +
+ "yield is a restricted identifier and cannot be used as type name\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -2687,18 +2687,18 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" }\n"+
"}\n"+
"class yield {\n" +
- "}\n",
+ "}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " yield y = null;\n" +
- " ^^^^^\n" +
- "yield is a restricted identifier and cannot be used as type name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " class yield {\n" +
- " ^^^^^\n" +
- "yield is a restricted identifier and cannot be used as type name\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " yield y = null;\n" +
+ " ^^^^^\n" +
+ "yield is a restricted identifier and cannot be used as type name\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " class yield {\n" +
+ " ^^^^^\n" +
+ "yield is a restricted identifier and cannot be used as type name\n" +
"----------\n");
}
public void testBug547891_08() {
@@ -2713,24 +2713,24 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" }\n"+
"}\n"+
"class yield {\n" +
- "}\n",
+ "}\n",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " yield y = null;\n" +
- " ^^^^^\n" +
- "yield is a restricted identifier and cannot be used as type name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " class yield {\n" +
- " ^^^^^\n" +
- "yield is a restricted identifier and cannot be used as type name\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " yield y = null;\n" +
+ " ^^^^^\n" +
+ "yield is a restricted identifier and cannot be used as type name\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " class yield {\n" +
+ " ^^^^^\n" +
+ "yield is a restricted identifier and cannot be used as type name\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -2748,13 +2748,13 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" }\n"+
"}\n"+
"class yield {\n" +
- "}\n",
+ "}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " class yield {\n" +
- " ^^^^^\n" +
- "yield is a restricted identifier and cannot be used as type name\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " class yield {\n" +
+ " ^^^^^\n" +
+ "yield is a restricted identifier and cannot be used as type name\n" +
"----------\n");
}
public void testBug547891_10() {
@@ -2768,19 +2768,19 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" }\n"+
"}\n"+
"class yield {\n" +
- "}\n",
+ "}\n",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " class yield {\n" +
- " ^^^^^\n" +
- "yield is a restricted identifier and cannot be used as type name\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " class yield {\n" +
+ " ^^^^^\n" +
+ "yield is a restricted identifier and cannot be used as type name\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -2800,18 +2800,18 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" }\n"+
"}\n"+
"class yield {\n" +
- "}\n",
+ "}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " new yield();\n" +
- " ^^^^^\n" +
- "yield is a restricted identifier and cannot be used as type name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " class yield {\n" +
- " ^^^^^\n" +
- "yield is a restricted identifier and cannot be used as type name\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " new yield();\n" +
+ " ^^^^^\n" +
+ "yield is a restricted identifier and cannot be used as type name\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " class yield {\n" +
+ " ^^^^^\n" +
+ "yield is a restricted identifier and cannot be used as type name\n" +
"----------\n");
}
public void testBug547891_12() {
@@ -2826,24 +2826,24 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" }\n"+
"}\n"+
"class yield {\n" +
- "}\n",
+ "}\n",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " new yield();\n" +
- " ^^^^^\n" +
- "yield is a restricted identifier and cannot be used as type name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " class yield {\n" +
- " ^^^^^\n" +
- "yield is a restricted identifier and cannot be used as type name\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " new yield();\n" +
+ " ^^^^^\n" +
+ "yield is a restricted identifier and cannot be used as type name\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " class yield {\n" +
+ " ^^^^^\n" +
+ "yield is a restricted identifier and cannot be used as type name\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -2863,18 +2863,18 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" }\n"+
"}\n"+
"class yield {\n" +
- "}\n",
+ "}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " yield[] y;\n" +
- " ^^^^^^^\n" +
- "yield is a restricted identifier and cannot be used as type name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " class yield {\n" +
- " ^^^^^\n" +
- "yield is a restricted identifier and cannot be used as type name\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " yield[] y;\n" +
+ " ^^^^^^^\n" +
+ "yield is a restricted identifier and cannot be used as type name\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " class yield {\n" +
+ " ^^^^^\n" +
+ "yield is a restricted identifier and cannot be used as type name\n" +
"----------\n");
}
public void testBug547891_14() {
@@ -2889,24 +2889,24 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" }\n"+
"}\n"+
"class yield {\n" +
- "}\n",
+ "}\n",
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " yield[] y;\n" +
- " ^^^^^^^\n" +
- "yield is a restricted identifier and cannot be used as type name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " Zork();\n" +
- " ^^^^\n" +
- "The method Zork() is undefined for the type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " class yield {\n" +
- " ^^^^^\n" +
- "yield is a restricted identifier and cannot be used as type name\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " yield[] y;\n" +
+ " ^^^^^^^\n" +
+ "yield is a restricted identifier and cannot be used as type name\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " Zork();\n" +
+ " ^^^^\n" +
+ "The method Zork() is undefined for the type X\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " class yield {\n" +
+ " ^^^^^\n" +
+ "yield is a restricted identifier and cannot be used as type name\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -2922,24 +2922,24 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
Map<String, String> options = getCompilerOptions();
options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.WARNING);
- String message =
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " case 1 -> yield();\n" +
- " ^^^^^^^\n" +
- "restricted identifier yield not allowed here - method calls need to be qualified\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " case 3 -> {yield yield();}\n" +
- " ^^^^^^^\n" +
- "restricted identifier yield not allowed here - method calls need to be qualified\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " default -> { yield yield();}\n" +
- " ^^^^^^^\n" +
- "restricted identifier yield not allowed here - method calls need to be qualified\n" +
+ String message =
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " case 1 -> yield();\n" +
+ " ^^^^^^^\n" +
+ "restricted identifier yield not allowed here - method calls need to be qualified\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " case 3 -> {yield yield();}\n" +
+ " ^^^^^^^\n" +
+ "restricted identifier yield not allowed here - method calls need to be qualified\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 10)\n" +
+ " default -> { yield yield();}\n" +
+ " ^^^^^^^\n" +
+ "restricted identifier yield not allowed here - method calls need to be qualified\n" +
"----------\n";
-
+
this.runNegativeTest(new String[] {
"X.java",
"public class X {\n"+
@@ -2975,19 +2975,19 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
Map<String, String> options = getCompilerOptions();
options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.WARNING);
- String message =
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " case 3 -> {yield yield();}\n" +
- " ^^^^^^^\n" +
- "restricted identifier yield not allowed here - method calls need to be qualified\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " default -> { yield yield();}\n" +
- " ^^^^^^^\n" +
- "restricted identifier yield not allowed here - method calls need to be qualified\n" +
+ String message =
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " case 3 -> {yield yield();}\n" +
+ " ^^^^^^^\n" +
+ "restricted identifier yield not allowed here - method calls need to be qualified\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " default -> { yield yield();}\n" +
+ " ^^^^^^^\n" +
+ "restricted identifier yield not allowed here - method calls need to be qualified\n" +
"----------\n";
-
+
this.runNegativeTest(new String[] {
"X.java",
"public class X {\n"+
@@ -3125,14 +3125,14 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
Map<String, String> options = getCompilerOptions();
options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.WARNING);
- String message =
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " default -> yield - 1;\n" +
- " ^^^^^\n" +
- "Cannot make a static reference to the non-static field yield\n" +
+ String message =
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " default -> yield - 1;\n" +
+ " ^^^^^\n" +
+ "Cannot make a static reference to the non-static field yield\n" +
"----------\n";
-
+
this.runNegativeTest(new String[] {
"X.java",
"public class X {\n"+
@@ -3432,81 +3432,81 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " @SuppressWarnings(\"nls\")\n" +
- " static final String MONDAY = \"MONDAY\";\n" +
- " public static void main(String[] args) {\n" +
- " int num = switch (day) {\n" +
- " case MONDAY: \n" +
- " // Nothing\n" +
- " default:\n" +
- " yield \"; \n" +
- " }; \n" +
- " }\n" +
+ "public class X {\n" +
+ " @SuppressWarnings(\"nls\")\n" +
+ " static final String MONDAY = \"MONDAY\";\n" +
+ " public static void main(String[] args) {\n" +
+ " int num = switch (day) {\n" +
+ " case MONDAY: \n" +
+ " // Nothing\n" +
+ " default:\n" +
+ " yield \"; \n" +
+ " }; \n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " yield \"; \n" +
- " ^^^^^^^\n" +
- "String literal is not properly closed by a double-quote\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " yield \"; \n" +
+ " ^^^^^^^\n" +
+ "String literal is not properly closed by a double-quote\n" +
"----------\n");
}
public void testBug551030b() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " @SuppressWarnings(\"nls\")\n" +
- " static final String MONDAY = \"MONDAY\";\n" +
- " public static void main(String[] args) {\n" +
- " int num = switch (day) {\n" +
- " case MONDAY: \n" +
- " // Nothing\n" +
- " default:\n" +
- " yield \"\"\"; \n" +
- " }; \n" +
- " }\n" +
+ "public class X {\n" +
+ " @SuppressWarnings(\"nls\")\n" +
+ " static final String MONDAY = \"MONDAY\";\n" +
+ " public static void main(String[] args) {\n" +
+ " int num = switch (day) {\n" +
+ " case MONDAY: \n" +
+ " // Nothing\n" +
+ " default:\n" +
+ " yield \"\"\"; \n" +
+ " }; \n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " yield \"\"\"; \n" +
- " ^^^^^^^\n" +
- "String literal is not properly closed by a double-quote\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " yield \"\"\"; \n" +
+ " ^^^^^^^\n" +
+ "String literal is not properly closed by a double-quote\n" +
"----------\n");
}
public void testBug544943() {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " @SuppressWarnings(\"preview\")\n" +
- " public static int foo(int i) throws MyException {\n" +
- " int v = -1;\n" +
- " try {\n" +
- " v = switch (i) {\n" +
- " case 0 -> switch(i) {\n" +
- " case 0 -> 1;\n" +
- " default -> throw new MyException();\n" +
- " };\n" +
- " default -> 1;\n" +
- " };\n" +
- " } finally {\n" +
- " // do nothing\n" +
- " }\n" +
- " return v;\n" +
- " } \n" +
- " public static void main(String argv[]) {\n" +
- " try {\n" +
- " System.out.println(X.foo(0));\n" +
- " } catch (MyException e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "class MyException extends Exception {\n" +
- " private static final long serialVersionUID = 3461899582505930473L; \n" +
+ "public class X {\n" +
+ " @SuppressWarnings(\"preview\")\n" +
+ " public static int foo(int i) throws MyException {\n" +
+ " int v = -1;\n" +
+ " try {\n" +
+ " v = switch (i) {\n" +
+ " case 0 -> switch(i) {\n" +
+ " case 0 -> 1;\n" +
+ " default -> throw new MyException();\n" +
+ " };\n" +
+ " default -> 1;\n" +
+ " };\n" +
+ " } finally {\n" +
+ " // do nothing\n" +
+ " }\n" +
+ " return v;\n" +
+ " } \n" +
+ " public static void main(String argv[]) {\n" +
+ " try {\n" +
+ " System.out.println(X.foo(0));\n" +
+ " } catch (MyException e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "class MyException extends Exception {\n" +
+ " private static final long serialVersionUID = 3461899582505930473L; \n" +
"}"
},
"1");
@@ -3515,22 +3515,22 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " @SuppressWarnings({ \"preview\" })\n" +
- " public static int foo(int i) throws Exception {\n" +
- " int v = switch (i) {\n" +
- " case 0 -> switch (i) {\n" +
- " case 0 -> 0;\n" +
- " default-> throw new Exception();\n" +
- " case 3 -> 3;\n" +
- " case 2 -> throw new Exception();\n" +
- " };\n" +
- " default -> 0;\n" +
- " };\n" +
- " return v;\n" +
- " }\n" +
- " public static void main(String argv[]) throws Exception {\n" +
- " System.out.println(X.foo(1));\n" +
+ "public class X {\n" +
+ " @SuppressWarnings({ \"preview\" })\n" +
+ " public static int foo(int i) throws Exception {\n" +
+ " int v = switch (i) {\n" +
+ " case 0 -> switch (i) {\n" +
+ " case 0 -> 0;\n" +
+ " default-> throw new Exception();\n" +
+ " case 3 -> 3;\n" +
+ " case 2 -> throw new Exception();\n" +
+ " };\n" +
+ " default -> 0;\n" +
+ " };\n" +
+ " return v;\n" +
+ " }\n" +
+ " public static void main(String argv[]) throws Exception {\n" +
+ " System.out.println(X.foo(1));\n" +
" }\n" +
"}"
},
@@ -3555,11 +3555,11 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " default -> 3;\n" +
- " ^^^^^^^\n" +
- "Arrow in case statement supported from Java 14 onwards only\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " default -> 3;\n" +
+ " ^^^^^^^\n" +
+ "Arrow in case statement supported from Java 14 onwards only\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -3586,18 +3586,18 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " return switch (i) {\n" +
- " default -> 3;\n" +
- " };\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Switch Expressions are supported from Java 14 onwards only\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " default -> 3;\n" +
- " ^^^^^^^\n" +
- "Arrow in case statement supported from Java 14 onwards only\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " return switch (i) {\n" +
+ " default -> 3;\n" +
+ " };\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Switch Expressions are supported from Java 14 onwards only\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " default -> 3;\n" +
+ " ^^^^^^^\n" +
+ "Arrow in case statement supported from Java 14 onwards only\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -3626,11 +3626,11 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
};
String expectedProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case 1, 2 : break;\n" +
- " ^^^^^^^^^\n" +
- "Multi-constant case labels supported from Java 14 onwards only\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case 1, 2 : break;\n" +
+ " ^^^^^^^^^\n" +
+ "Multi-constant case labels supported from Java 14 onwards only\n" +
"----------\n";
this.runNegativeTest(
testFiles,
@@ -3662,11 +3662,11 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" new X().foo(0, 1);\n"+
" }\n"+
"}\n"
- }, "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " break LABEL; // NO error flagged\n" +
- " ^^^^^^^^^^^^\n" +
- "Breaking out of switch expressions not permitted\n" +
+ }, "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " break LABEL; // NO error flagged\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Breaking out of switch expressions not permitted\n" +
"----------\n");
}
public void testBug558067_002() {
@@ -3698,16 +3698,16 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" new X().foo(0, 1);\n"+
" }\n"+
"} \n"
- }, "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " break LABEL;\n" +
- " ^^^^^^^^^^^^\n" +
- "Breaking out of switch expressions not permitted\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 17)\n" +
- " case 2: for(;;) break TOP;\n" +
- " ^^^^^^^^^^\n" +
- "Breaking out of switch expressions not permitted\n" +
+ }, "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " break LABEL;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Breaking out of switch expressions not permitted\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 17)\n" +
+ " case 2: for(;;) break TOP;\n" +
+ " ^^^^^^^^^^\n" +
+ "Breaking out of switch expressions not permitted\n" +
"----------\n");
}
public void testBug558067_003() {
@@ -3733,11 +3733,11 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" new X().foo(0, 1);\n"+
" }\n"+
"}\n"
- }, "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " continue LABEL;\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Continue out of switch expressions not permitted\n" +
+ }, "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " continue LABEL;\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Continue out of switch expressions not permitted\n" +
"----------\n");
}
public void testBug558067_004() {
@@ -3765,11 +3765,11 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" new X().foo(0, 1);\n"+
" }\n"+
"}\n"
- }, "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " break LABEL;\n" +
- " ^^^^^^^^^^^^\n" +
- "Breaking out of switch expressions not permitted\n" +
+ }, "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " break LABEL;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Breaking out of switch expressions not permitted\n" +
"----------\n");
}
public void testBug558067_005() {
@@ -3797,11 +3797,11 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
" new X().foo(0, 1);\n"+
" }\n"+
"}\n"
- }, "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " continue LABEL;\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Continue out of switch expressions not permitted\n" +
+ }, "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " continue LABEL;\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Continue out of switch expressions not permitted\n" +
"----------\n");
}
public void testConversion1() {
@@ -3810,26 +3810,26 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
"X.java",
"public class X {\n" +
" public static int i = 0;\n" +
- " private static String typeName(byte arg){ return \"byte\"; }\n" +
- " private static String typeName(char arg){ return \"char\"; }\n" +
- " private static String typeName(short arg){ return \"short\"; }\n" +
- " private static String typeName(int arg){ return \"int\"; }\n" +
- " private static String typeName(float arg){ return \"float\"; }\n" +
- " private static String typeName(long arg){ return \"long\"; }\n" +
- " private static String typeName(double arg){ return \"double\"; }\n" +
+ " private static String typeName(byte arg){ return \"byte\"; }\n" +
+ " private static String typeName(char arg){ return \"char\"; }\n" +
+ " private static String typeName(short arg){ return \"short\"; }\n" +
+ " private static String typeName(int arg){ return \"int\"; }\n" +
+ " private static String typeName(float arg){ return \"float\"; }\n" +
+ " private static String typeName(long arg){ return \"long\"; }\n" +
+ " private static String typeName(double arg){ return \"double\"; }\n" +
" private static String typeName(String arg){ return \"String\"; }\n" +
" public static void main(String[] args) {\n" +
- " byte v1 = (byte)0;\n" +
- " char v2 = ' ';\n" +
- " var v = switch(i+1){\n" +
- " case 1 -> v2;\n" +
- " case 5 -> v1;\n" +
- " default -> v2;\n" +
- " };\n" +
+ " byte v1 = (byte)0;\n" +
+ " char v2 = ' ';\n" +
+ " var v = switch(i+1){\n" +
+ " case 1 -> v2;\n" +
+ " case 5 -> v1;\n" +
+ " default -> v2;\n" +
+ " };\n" +
" System.out.print(typeName(v));\n" +
" }\n" +
"}\n"
- },
+ },
"int");
}
public void testConversion2() {
@@ -3838,26 +3838,26 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
"X.java",
"public class X {\n" +
" public static int i = 0;\n" +
- " private static String typeName(byte arg){ return \"byte\"; }\n" +
- " private static String typeName(char arg){ return \"char\"; }\n" +
- " private static String typeName(short arg){ return \"short\"; }\n" +
- " private static String typeName(int arg){ return \"int\"; }\n" +
- " private static String typeName(float arg){ return \"float\"; }\n" +
- " private static String typeName(long arg){ return \"long\"; }\n" +
- " private static String typeName(double arg){ return \"double\"; }\n" +
+ " private static String typeName(byte arg){ return \"byte\"; }\n" +
+ " private static String typeName(char arg){ return \"char\"; }\n" +
+ " private static String typeName(short arg){ return \"short\"; }\n" +
+ " private static String typeName(int arg){ return \"int\"; }\n" +
+ " private static String typeName(float arg){ return \"float\"; }\n" +
+ " private static String typeName(long arg){ return \"long\"; }\n" +
+ " private static String typeName(double arg){ return \"double\"; }\n" +
" private static String typeName(String arg){ return \"String\"; }\n" +
" public static void main(String[] args) {\n" +
- " long v1 = 0L;\n" +
- " double v2 = 0.;\n" +
- " var v = switch(i+1){\n" +
- " case 1 -> v2;\n" +
- " case 5 -> v1;\n" +
- " default -> v2;\n" +
- " };\n" +
+ " long v1 = 0L;\n" +
+ " double v2 = 0.;\n" +
+ " var v = switch(i+1){\n" +
+ " case 1 -> v2;\n" +
+ " case 5 -> v1;\n" +
+ " default -> v2;\n" +
+ " };\n" +
" System.out.print(typeName(v));\n" +
" }\n" +
"}\n"
- },
+ },
"double");
}
public void testConversion3() {
@@ -3866,26 +3866,26 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
"X.java",
"public class X {\n" +
" public static int i = 0;\n" +
- " private static String typeName(byte arg){ return \"byte\"; }\n" +
- " private static String typeName(char arg){ return \"char\"; }\n" +
- " private static String typeName(short arg){ return \"short\"; }\n" +
- " private static String typeName(int arg){ return \"int\"; }\n" +
- " private static String typeName(float arg){ return \"float\"; }\n" +
- " private static String typeName(long arg){ return \"long\"; }\n" +
- " private static String typeName(double arg){ return \"double\"; }\n" +
+ " private static String typeName(byte arg){ return \"byte\"; }\n" +
+ " private static String typeName(char arg){ return \"char\"; }\n" +
+ " private static String typeName(short arg){ return \"short\"; }\n" +
+ " private static String typeName(int arg){ return \"int\"; }\n" +
+ " private static String typeName(float arg){ return \"float\"; }\n" +
+ " private static String typeName(long arg){ return \"long\"; }\n" +
+ " private static String typeName(double arg){ return \"double\"; }\n" +
" private static String typeName(String arg){ return \"String\"; }\n" +
" public static void main(String[] args) {\n" +
- " long v1 = 0L;\n" +
- " float v2 = 0.f;\n" +
- " var v = switch(i+1){\n" +
- " case 1 -> v2;\n" +
- " case 5 -> v1;\n" +
- " default -> v2;\n" +
- " };\n" +
+ " long v1 = 0L;\n" +
+ " float v2 = 0.f;\n" +
+ " var v = switch(i+1){\n" +
+ " case 1 -> v2;\n" +
+ " case 5 -> v1;\n" +
+ " default -> v2;\n" +
+ " };\n" +
" System.out.print(typeName(v));\n" +
" }\n" +
"}\n"
- },
+ },
"float");
}
public void testConversion4() {
@@ -3894,26 +3894,26 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
"X.java",
"public class X {\n" +
" public static int i = 0;\n" +
- " private static String typeName(byte arg){ return \"byte\"; }\n" +
- " private static String typeName(char arg){ return \"char\"; }\n" +
- " private static String typeName(short arg){ return \"short\"; }\n" +
- " private static String typeName(int arg){ return \"int\"; }\n" +
- " private static String typeName(float arg){ return \"float\"; }\n" +
- " private static String typeName(long arg){ return \"long\"; }\n" +
- " private static String typeName(double arg){ return \"double\"; }\n" +
+ " private static String typeName(byte arg){ return \"byte\"; }\n" +
+ " private static String typeName(char arg){ return \"char\"; }\n" +
+ " private static String typeName(short arg){ return \"short\"; }\n" +
+ " private static String typeName(int arg){ return \"int\"; }\n" +
+ " private static String typeName(float arg){ return \"float\"; }\n" +
+ " private static String typeName(long arg){ return \"long\"; }\n" +
+ " private static String typeName(double arg){ return \"double\"; }\n" +
" private static String typeName(String arg){ return \"String\"; }\n" +
" public static void main(String[] args) {\n" +
- " short v1 = 0;\n" +
- " char v2 = ' ';\n" +
- " var v = switch(i+1){\n" +
- " case 1 -> v2;\n" +
- " case 5 -> v1;\n" +
- " default -> v2;\n" +
- " };\n" +
+ " short v1 = 0;\n" +
+ " char v2 = ' ';\n" +
+ " var v = switch(i+1){\n" +
+ " case 1 -> v2;\n" +
+ " case 5 -> v1;\n" +
+ " default -> v2;\n" +
+ " };\n" +
" System.out.print(typeName(v));\n" +
" }\n" +
"}\n"
- },
+ },
"int");
}
public void testConversion5() {
@@ -3922,23 +3922,23 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
"X.java",
"public class X {\n" +
" public static int i = 0;\n" +
- " private static String typeName(char arg){ return \"char\"; }\n" +
- " private static String typeName(int arg){ return \"int\"; }\n" +
- " private static String typeName(float arg){ return \"float\"; }\n" +
- " private static String typeName(long arg){ return \"long\"; }\n" +
- " private static String typeName(double arg){ return \"double\"; }\n" +
+ " private static String typeName(char arg){ return \"char\"; }\n" +
+ " private static String typeName(int arg){ return \"int\"; }\n" +
+ " private static String typeName(float arg){ return \"float\"; }\n" +
+ " private static String typeName(long arg){ return \"long\"; }\n" +
+ " private static String typeName(double arg){ return \"double\"; }\n" +
" private static String typeName(String arg){ return \"String\"; }\n" +
" public static void main(String[] args) {\n" +
- " char v1 = 'a';\n" +
- " var v = switch(i+1){\n" +
- " case 1 -> 200;\n" +
- " case 5 -> v1;\n" +
- " default -> v1;\n" +
- " };\n" +
+ " char v1 = 'a';\n" +
+ " var v = switch(i+1){\n" +
+ " case 1 -> 200;\n" +
+ " case 5 -> v1;\n" +
+ " default -> v1;\n" +
+ " };\n" +
" System.out.print(typeName(v));\n" +
" }\n" +
"}\n"
- },
+ },
"char");
}
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java
index de9009bd9..a740b6bd5 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java
@@ -31,7 +31,7 @@ import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
@SuppressWarnings({ "unchecked", "rawtypes" })
public class SwitchTest extends AbstractRegressionTest {
-
+
private static final long JDKLevelSupportingStringSwitch = ClassFileConstants.JDK1_7;
static {
@@ -296,7 +296,7 @@ public void test010() {
"}\n",
},
this.complianceLevel >= JDKLevelSupportingStringSwitch ? newMessage : oldMessage);
-
+
}
public void test011() {
this.runConformTest(new String[] {
@@ -609,38 +609,38 @@ public void test014() {
options.put(CompilerOptions.OPTION_ReportFallthroughCase, CompilerOptions.ERROR);
this.runNegativeTest(new String[] {
"X.java",
- "public class X {\n" +
- " void foo1(int i) {\n" +
- " switch (i) {\n" +
- " case 0://OK\n" +
- " case 1://OK\n" +
- " System.out.println();\n" +
- " //$FALL-THROUGH$\n" +
- " case 2://OK\n" +
- " System.out.println(); //$FALL-THROUGH$\n" +
- " case 3://OK\n" +
- " System.out.println();\n" +
- " //$FALL-THROUGH$ - some allowed explanation\n" +
- " case 4://OK\n" +
- " case 5://OK\n" +
- " System.out.println();\n" +
- " //$FALL-THROUGH$ - not last comment, thus inoperant\n" +
- " // last comment is not fall-through explanation\n" +
- " case 6://WRONG\n" +
- " //$FALL-THROUGH$ - useless since not leading the case\n" +
- " System.out.println();\n" +
- " /*$FALL-THROUGH$ - block comment, is also allowed */\n" +
- " case 7://OK\n" +
- " System.out.println(\"aa\"); //$NON-NLS-1$\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " void foo1(int i) {\n" +
+ " switch (i) {\n" +
+ " case 0://OK\n" +
+ " case 1://OK\n" +
+ " System.out.println();\n" +
+ " //$FALL-THROUGH$\n" +
+ " case 2://OK\n" +
+ " System.out.println(); //$FALL-THROUGH$\n" +
+ " case 3://OK\n" +
+ " System.out.println();\n" +
+ " //$FALL-THROUGH$ - some allowed explanation\n" +
+ " case 4://OK\n" +
+ " case 5://OK\n" +
+ " System.out.println();\n" +
+ " //$FALL-THROUGH$ - not last comment, thus inoperant\n" +
+ " // last comment is not fall-through explanation\n" +
+ " case 6://WRONG\n" +
+ " //$FALL-THROUGH$ - useless since not leading the case\n" +
+ " System.out.println();\n" +
+ " /*$FALL-THROUGH$ - block comment, is also allowed */\n" +
+ " case 7://OK\n" +
+ " System.out.println(\"aa\"); //$NON-NLS-1$\n" +
+ " }\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 18)\n" +
- " case 6://WRONG\n" +
- " ^^^^^^\n" +
- "Switch case may be entered by falling through previous case. If intended, add a new comment //$FALL-THROUGH$ on the line above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 18)\n" +
+ " case 6://WRONG\n" +
+ " ^^^^^^\n" +
+ "Switch case may be entered by falling through previous case. If intended, add a new comment //$FALL-THROUGH$ on the line above\n" +
"----------\n",
null,
true,
@@ -652,38 +652,38 @@ public void test015() {
options.put(CompilerOptions.OPTION_ReportFallthroughCase, CompilerOptions.ERROR);
this.runNegativeTest(new String[] {
"X.java",
- "public class X {\n" +
- " void foo1(int i) {\n" +
- " switch (i) {\n" +
- " case 0://OK\n" +
- " case 1://OK\n" +
- " System.out.println();\n" +
- " // $FALL-THROUGH$\n" +
- " case 2://OK\n" +
- " System.out.println(); // $FALL-THROUGH$\n" +
- " case 3://OK\n" +
- " System.out.println();\n" +
- " // $FALL-THROUGH$ - some allowed explanation\n" +
- " case 4://OK\n" +
- " case 5://OK\n" +
- " System.out.println();\n" +
- " // $FALL-THROUGH$ - not last comment, thus inoperant\n" +
- " // last comment is not fall-through explanation\n" +
- " case 6://WRONG\n" +
- " // $FALL-THROUGH$ - useless since not leading the case\n" +
- " System.out.println();\n" +
- " /* $FALL-THROUGH$ - block comment, is also allowed */\n" +
- " case 7://OK\n" +
- " System.out.println(\"aa\"); //$NON-NLS-1$\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " void foo1(int i) {\n" +
+ " switch (i) {\n" +
+ " case 0://OK\n" +
+ " case 1://OK\n" +
+ " System.out.println();\n" +
+ " // $FALL-THROUGH$\n" +
+ " case 2://OK\n" +
+ " System.out.println(); // $FALL-THROUGH$\n" +
+ " case 3://OK\n" +
+ " System.out.println();\n" +
+ " // $FALL-THROUGH$ - some allowed explanation\n" +
+ " case 4://OK\n" +
+ " case 5://OK\n" +
+ " System.out.println();\n" +
+ " // $FALL-THROUGH$ - not last comment, thus inoperant\n" +
+ " // last comment is not fall-through explanation\n" +
+ " case 6://WRONG\n" +
+ " // $FALL-THROUGH$ - useless since not leading the case\n" +
+ " System.out.println();\n" +
+ " /* $FALL-THROUGH$ - block comment, is also allowed */\n" +
+ " case 7://OK\n" +
+ " System.out.println(\"aa\"); //$NON-NLS-1$\n" +
+ " }\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 18)\n" +
- " case 6://WRONG\n" +
- " ^^^^^^\n" +
- "Switch case may be entered by falling through previous case. If intended, add a new comment //$FALL-THROUGH$ on the line above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 18)\n" +
+ " case 6://WRONG\n" +
+ " ^^^^^^\n" +
+ "Switch case may be entered by falling through previous case. If intended, add a new comment //$FALL-THROUGH$ on the line above\n" +
"----------\n",
null,
true,
@@ -695,24 +695,24 @@ public void test016() {
options.put(CompilerOptions.OPTION_ReportFallthroughCase, CompilerOptions.ERROR);
this.runNegativeTest(new String[] {
"X.java",
- "public class X {\n" +
- " void foo1(int i) {\n" +
- " switch (i) {\n" +
- " case 0://OK\n" +
- " case 1://OK\n" +
- " System.out.println();\n" +
- " // $FALL-THROUGH - missing trailing $ in tag\n" +
- " case 2://WRONG\n" +
- " System.out.println();\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " void foo1(int i) {\n" +
+ " switch (i) {\n" +
+ " case 0://OK\n" +
+ " case 1://OK\n" +
+ " System.out.println();\n" +
+ " // $FALL-THROUGH - missing trailing $ in tag\n" +
+ " case 2://WRONG\n" +
+ " System.out.println();\n" +
+ " }\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " case 2://WRONG\n" +
- " ^^^^^^\n" +
- "Switch case may be entered by falling through previous case. If intended, add a new comment //$FALL-THROUGH$ on the line above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " case 2://WRONG\n" +
+ " ^^^^^^\n" +
+ "Switch case may be entered by falling through previous case. If intended, add a new comment //$FALL-THROUGH$ on the line above\n" +
"----------\n",
null,
true,
@@ -724,25 +724,25 @@ public void test017() {
options.put(CompilerOptions.OPTION_ReportFallthroughCase, CompilerOptions.ERROR);
this.runNegativeTest(new String[] {
"X.java",
- "public class X {\n" +
- " void foo1(char previousChar) {\n" +
- " switch(previousChar) {\n" +
- " case \'/\':\n" +
- " if (previousChar == \'*\') {\n" +
- " // End of javadoc\n" +
- " break;\n" +
- " //$FALL-THROUGH$ into default case\n" +
- " }\n" +
- " default :\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " void foo1(char previousChar) {\n" +
+ " switch(previousChar) {\n" +
+ " case \'/\':\n" +
+ " if (previousChar == \'*\') {\n" +
+ " // End of javadoc\n" +
+ " break;\n" +
+ " //$FALL-THROUGH$ into default case\n" +
+ " }\n" +
+ " default :\n" +
+ " }\n" +
+ " }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " default :\n" +
- " ^^^^^^^\n" +
- "Switch case may be entered by falling through previous case. If intended, add a new comment //$FALL-THROUGH$ on the line above\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " default :\n" +
+ " ^^^^^^^\n" +
+ "Switch case may be entered by falling through previous case. If intended, add a new comment //$FALL-THROUGH$ on the line above\n" +
"----------\n",
null,
true,
@@ -776,10 +776,10 @@ public void test019() {
"public class X {\n" +
" public static void main(String[] args) {\n" +
" try {\n" +
- " switch((Integer) null) {};\n" +
- " System.out.println(\"FAILED\");\n" +
- " } catch(NullPointerException e) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
+ " switch((Integer) null) {};\n" +
+ " System.out.println(\"FAILED\");\n" +
+ " } catch(NullPointerException e) {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
" }\n" +
" }\n" +
"}\n",
@@ -794,10 +794,10 @@ public void test020() {
"public class X {\n" +
" public static void main(String[] args) {\n" +
" try {\n" +
- " switch(foo()) {};\n" +
- " System.out.println(\"FAILED\");\n" +
- " } catch(NullPointerException e) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
+ " switch(foo()) {};\n" +
+ " System.out.println(\"FAILED\");\n" +
+ " } catch(NullPointerException e) {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
" }\n" +
" }" +
" static Integer foo() {\n" +
@@ -815,11 +815,11 @@ public void test021() {
"public class X {\n" +
" public static void main(String[] args) {\n" +
" try {\n" +
- " switch((Character) null) {\n" +
- " default: System.out.println(\"FAILED\");\n" +
- " }\n" +
- " } catch(NullPointerException e) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
+ " switch((Character) null) {\n" +
+ " default: System.out.println(\"FAILED\");\n" +
+ " }\n" +
+ " } catch(NullPointerException e) {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
" }\n" +
" }\n" +
"}\n",
@@ -833,12 +833,12 @@ public void test022() {
"X.java",
"public class X {\n" +
" public static void main(String[] args) {\n" +
- " java.math.RoundingMode mode = null;\n" +
+ " java.math.RoundingMode mode = null;\n" +
" try {\n" +
- " switch (mode) {}\n" +
- " System.out.println(\"FAILED\");\n" +
- " } catch(NullPointerException e) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
+ " switch (mode) {}\n" +
+ " System.out.println(\"FAILED\");\n" +
+ " } catch(NullPointerException e) {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
" }\n" +
" }\n" +
"}\n",
@@ -852,13 +852,13 @@ public void test023() {
"X.java",
"public class X {\n" +
" public static void main(String[] args) {\n" +
- " java.math.RoundingMode mode = java.math.RoundingMode.FLOOR;\n" +
+ " java.math.RoundingMode mode = java.math.RoundingMode.FLOOR;\n" +
" try {\n" +
" switch (mode) {\n" +
- " default: System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " } catch(NullPointerException e) {\n" +
- " System.out.println(\"FAILED\");\n" +
+ " default: System.out.println(\"SUCCESS\");\n" +
+ " }\n" +
+ " } catch(NullPointerException e) {\n" +
+ " System.out.println(\"FAILED\");\n" +
" }\n" +
" }\n" +
"}\n",
@@ -868,31 +868,31 @@ public void test023() {
// JDK7: Strings in Switch.
public void testStringSwitchAtJDK6() {
- String newMessage =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " default: return args;\n" +
- " ^^^^^^^^^^^^\n" +
- "Void methods cannot return a value\n" +
+ String newMessage =
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " default: return args;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Void methods cannot return a value\n" +
"----------\n";
- String oldMessage =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " switch(args[0]) {\n" +
- " ^^^^^^^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " default: return args;\n" +
- " ^^^^^^^^^^^^\n" +
- "Void methods cannot return a value\n" +
+ String oldMessage =
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " switch(args[0]) {\n" +
+ " ^^^^^^^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " default: return args;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Void methods cannot return a value\n" +
"----------\n";
-
+
this.runNegativeTest(new String[] {
"X.java",
"public class X {\n" +
" public static void main(String [] args) {\n" +
- " switch(args[0]) {\n" +
+ " switch(args[0]) {\n" +
" default: return args;\n" +
" }\n" +
" }\n" +
@@ -903,76 +903,76 @@ public void testStringSwitchAtJDK6() {
//JDK7: Strings in Switch.
public void testCaseTypeMismatch() {
- String newMessage =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case 123: break;\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from int to String\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " case (byte) 1: break;\n" +
- " ^^^^^^^^\n" +
- "Type mismatch: cannot convert from byte to String\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " case (char) 2: break;\n" +
- " ^^^^^^^^\n" +
- "Type mismatch: cannot convert from char to String\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " case (short)3: break;\n" +
- " ^^^^^^^^\n" +
- "Type mismatch: cannot convert from short to String\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 8)\n" +
- " case (int) 4: break;\n" +
- " ^^^^^^^\n" +
- "Type mismatch: cannot convert from int to String\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 9)\n" +
- " case (long) 5: break;\n" +
- " ^^^^^^^^\n" +
- "Type mismatch: cannot convert from long to String\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 10)\n" +
- " case (float) 6: break;\n" +
- " ^^^^^^^^^\n" +
- "Type mismatch: cannot convert from float to String\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 11)\n" +
- " case (double) 7: break;\n" +
- " ^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from double to String\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 12)\n" +
- " case (boolean) 8: break;\n" +
- " ^^^^^^^^^^^\n" +
- "Cannot cast from int to boolean\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 12)\n" +
- " case (boolean) 8: break;\n" +
- " ^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from boolean to String\n" +
+ String newMessage =
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case 123: break;\n" +
+ " ^^^\n" +
+ "Type mismatch: cannot convert from int to String\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " case (byte) 1: break;\n" +
+ " ^^^^^^^^\n" +
+ "Type mismatch: cannot convert from byte to String\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " case (char) 2: break;\n" +
+ " ^^^^^^^^\n" +
+ "Type mismatch: cannot convert from char to String\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " case (short)3: break;\n" +
+ " ^^^^^^^^\n" +
+ "Type mismatch: cannot convert from short to String\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 8)\n" +
+ " case (int) 4: break;\n" +
+ " ^^^^^^^\n" +
+ "Type mismatch: cannot convert from int to String\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 9)\n" +
+ " case (long) 5: break;\n" +
+ " ^^^^^^^^\n" +
+ "Type mismatch: cannot convert from long to String\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 10)\n" +
+ " case (float) 6: break;\n" +
+ " ^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from float to String\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 11)\n" +
+ " case (double) 7: break;\n" +
+ " ^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from double to String\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 12)\n" +
+ " case (boolean) 8: break;\n" +
+ " ^^^^^^^^^^^\n" +
+ "Cannot cast from int to boolean\n" +
+ "----------\n" +
+ "10. ERROR in X.java (at line 12)\n" +
+ " case (boolean) 8: break;\n" +
+ " ^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from boolean to String\n" +
"----------\n";
- String oldMessage =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " switch(args[0]) {\n" +
- " ^^^^^^^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " case (boolean) 8: break;\n" +
- " ^^^^^^^^^^^\n" +
- "Cannot cast from int to boolean\n" +
+ String oldMessage =
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " switch(args[0]) {\n" +
+ " ^^^^^^^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 12)\n" +
+ " case (boolean) 8: break;\n" +
+ " ^^^^^^^^^^^\n" +
+ "Cannot cast from int to boolean\n" +
"----------\n";
-
+
this.runNegativeTest(new String[] {
"X.java",
"public class X {\n" +
" public static void main(String [] args) {\n" +
- " switch(args[0]) {\n" +
+ " switch(args[0]) {\n" +
" case 123: break;\n" +
" case (byte) 1: break;\n" +
" case (char) 2: break;\n" +
@@ -993,21 +993,21 @@ public void testCaseTypeMismatch2() {
if (this.complianceLevel < ClassFileConstants.JDK1_5) {
return;
}
- String newMessage =
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " case Days.Sunday: break;\n" +
- " ^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Days to String\n" +
+ String newMessage =
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " case Days.Sunday: break;\n" +
+ " ^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from Days to String\n" +
"----------\n";
- String oldMessage =
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " switch (\"Sunday\") {\n" +
- " ^^^^^^^^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ String oldMessage =
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " switch (\"Sunday\") {\n" +
+ " ^^^^^^^^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
"----------\n";
-
+
this.runNegativeTest(new String[] {
"X.java",
"enum Days { Sunday, Monday, Tuesday, Wednesday, Thuresday, Friday, Satuday };\n" +
@@ -1028,24 +1028,24 @@ public void testCaseTypeMismatch3() {
if (this.complianceLevel < ClassFileConstants.JDK1_5) {
return;
}
- String newMessage =
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " case \"0\": break;\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from String to int\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " case \"Sunday\": break;\n" +
- " ^^^^^^^^\n" +
- "Type mismatch: cannot convert from String to Days\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 13)\n" +
- " case \"0\": break;\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from String to Integer\n" +
+ String newMessage =
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " case \"0\": break;\n" +
+ " ^^^\n" +
+ "Type mismatch: cannot convert from String to int\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " case \"Sunday\": break;\n" +
+ " ^^^^^^^^\n" +
+ "Type mismatch: cannot convert from String to Days\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 13)\n" +
+ " case \"0\": break;\n" +
+ " ^^^\n" +
+ "Type mismatch: cannot convert from String to Integer\n" +
"----------\n";
-
+
this.runNegativeTest(new String[] {
"X.java",
"enum Days { Sunday, Monday, Tuesday, Wednesday, Thuresday, Friday, Satuday };\n" +
@@ -1069,42 +1069,42 @@ public void testCaseTypeMismatch3() {
}
// JDK7: Strings in Switch.
public void testDuplicateCase() {
- String newMessage =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " case \"123\": break;\n" +
- " ^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " case \"123\": break;\n" +
- " ^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " default: return args;\n" +
- " ^^^^^^^^^^^^\n" +
- "Void methods cannot return a value\n" +
+ String newMessage =
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " case \"123\": break;\n" +
+ " ^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " case \"123\": break;\n" +
+ " ^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " default: return args;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Void methods cannot return a value\n" +
"----------\n";
-
- String oldMessage =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " switch(args[0]) {\n" +
- " ^^^^^^^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " default: return args;\n" +
- " ^^^^^^^^^^^^\n" +
- "Void methods cannot return a value\n" +
+
+ String oldMessage =
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " switch(args[0]) {\n" +
+ " ^^^^^^^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 6)\n" +
+ " default: return args;\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Void methods cannot return a value\n" +
"----------\n";
-
+
this.runNegativeTest(new String[] {
"X.java",
"public class X {\n" +
" public static void main(String [] args) {\n" +
- " switch(args[0]) {\n" +
+ " switch(args[0]) {\n" +
" case \"123\": break;\n" +
" case \"123\": break;\n" +
" default: return args;\n" +
@@ -1117,72 +1117,72 @@ public void testDuplicateCase() {
// JDK7: Strings in Switch.
public void testDuplicateCase2() {
- String newMessage =
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " case \"123\": break;\n" +
- " ^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " case \"123\": break;\n" +
- " ^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " case \"1\" + \"2\" + \"3\": break;\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 13)\n" +
- " case local: break;\n" +
- " ^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 14)\n" +
- " case field: break;\n" +
- " ^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 15)\n" +
- " case ifield: break;\n" +
- " ^^^^^^\n" +
- "Cannot make a static reference to the non-static field ifield\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 16)\n" +
- " case inffield: break;\n" +
- " ^^^^^^^^\n" +
- "Cannot make a static reference to the non-static field inffield\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 19)\n" +
- " default: break;\n" +
- " ^^^^^^^\n" +
- "The default case is already defined\n" +
+ String newMessage =
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " case \"123\": break;\n" +
+ " ^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " case \"123\": break;\n" +
+ " ^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 11)\n" +
+ " case \"1\" + \"2\" + \"3\": break;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 13)\n" +
+ " case local: break;\n" +
+ " ^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 14)\n" +
+ " case field: break;\n" +
+ " ^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 15)\n" +
+ " case ifield: break;\n" +
+ " ^^^^^^\n" +
+ "Cannot make a static reference to the non-static field ifield\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 16)\n" +
+ " case inffield: break;\n" +
+ " ^^^^^^^^\n" +
+ "Cannot make a static reference to the non-static field inffield\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 19)\n" +
+ " default: break;\n" +
+ " ^^^^^^^\n" +
+ "The default case is already defined\n" +
"----------\n";
-
- String oldMessage =
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " switch(args[0]) {\n" +
- " ^^^^^^^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 15)\n" +
- " case ifield: break;\n" +
- " ^^^^^^\n" +
- "Cannot make a static reference to the non-static field ifield\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 16)\n" +
- " case inffield: break;\n" +
- " ^^^^^^^^\n" +
- "Cannot make a static reference to the non-static field inffield\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 19)\n" +
- " default: break;\n" +
- " ^^^^^^^\n" +
- "The default case is already defined\n" +
+
+ String oldMessage =
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " switch(args[0]) {\n" +
+ " ^^^^^^^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 15)\n" +
+ " case ifield: break;\n" +
+ " ^^^^^^\n" +
+ "Cannot make a static reference to the non-static field ifield\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 16)\n" +
+ " case inffield: break;\n" +
+ " ^^^^^^^^\n" +
+ "Cannot make a static reference to the non-static field inffield\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 19)\n" +
+ " default: break;\n" +
+ " ^^^^^^^\n" +
+ "The default case is already defined\n" +
"----------\n";
-
+
this.runNegativeTest(new String[] {
"X.java",
"public class X {\n" +
@@ -1192,7 +1192,7 @@ public void testDuplicateCase2() {
" static String nffield = \"123\";\n" +
" public static void main(String [] args, final String argument) {\n" +
" final String local = \"123\";\n" +
- " switch(args[0]) {\n" +
+ " switch(args[0]) {\n" +
" case \"123\": break;\n" +
" case \"\u0031\u0032\u0033\": break;\n" +
" case \"1\" + \"2\" + \"3\": break;\n" +
@@ -1212,42 +1212,42 @@ public void testDuplicateCase2() {
}
// JDK7: Strings in Switch.
public void testVariableCase() {
- String newMessage =
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " case local: break;\n" +
- " ^^^^^\n" +
- "case expressions must be constant expressions\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " case argument: break;\n" +
- " ^^^^^^^^\n" +
- "case expressions must be constant expressions\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " case inffield: break;\n" +
- " ^^^^^^^^\n" +
- "case expressions must be constant expressions\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " case nffield: break;\n" +
- " ^^^^^^^\n" +
- "case expressions must be constant expressions\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 11)\n" +
- " case argument: break;\n" +
- " ^^^^^^^^\n" +
- "case expressions must be constant expressions\n" +
+ String newMessage =
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " case local: break;\n" +
+ " ^^^^^\n" +
+ "case expressions must be constant expressions\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " case argument: break;\n" +
+ " ^^^^^^^^\n" +
+ "case expressions must be constant expressions\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 9)\n" +
+ " case inffield: break;\n" +
+ " ^^^^^^^^\n" +
+ "case expressions must be constant expressions\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 10)\n" +
+ " case nffield: break;\n" +
+ " ^^^^^^^\n" +
+ "case expressions must be constant expressions\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 11)\n" +
+ " case argument: break;\n" +
+ " ^^^^^^^^\n" +
+ "case expressions must be constant expressions\n" +
"----------\n";
-
- String oldMessage =
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " switch(args[0]) {\n" +
- " ^^^^^^^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+
+ String oldMessage =
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " switch(args[0]) {\n" +
+ " ^^^^^^^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
"----------\n";
-
+
this.runNegativeTest(new String[] {
"X.java",
"public class X {\n" +
@@ -1255,7 +1255,7 @@ public void testVariableCase() {
" static String nffield = \"123\";\n" +
" public void main(String [] args, final String argument) {\n" +
" String local = \"123\";\n" +
- " switch(args[0]) {\n" +
+ " switch(args[0]) {\n" +
" case local: break;\n" +
" case argument: break;\n" +
" case inffield: break;\n" +
@@ -1269,27 +1269,27 @@ public void testVariableCase() {
}
// JDK7: Strings in Switch.
public void testVariableCaseFinal() {
- String newMessage =
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " case argument: break;\n" +
- " ^^^^^^^^\n" +
- "case expressions must be constant expressions\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " case argument: break;\n" +
- " ^^^^^^^^\n" +
- "case expressions must be constant expressions\n" +
+ String newMessage =
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " case argument: break;\n" +
+ " ^^^^^^^^\n" +
+ "case expressions must be constant expressions\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " case argument: break;\n" +
+ " ^^^^^^^^\n" +
+ "case expressions must be constant expressions\n" +
"----------\n";
-
- String oldMessage =
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " switch(args[0]) {\n" +
- " ^^^^^^^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+
+ String oldMessage =
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " switch(args[0]) {\n" +
+ " ^^^^^^^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
"----------\n";
-
+
this.runNegativeTest(new String[] {
"X.java",
"public class X {\n" +
@@ -1297,7 +1297,7 @@ public void testVariableCaseFinal() {
" final static String nffield = \"123123\";\n" +
" public void main(String [] args, final String argument) {\n" +
" final String local = \"1233\";\n" +
- " switch(args[0]) {\n" +
+ " switch(args[0]) {\n" +
" case local: break;\n" +
" case argument: break;\n" +
" case inffield: break;\n" +
@@ -1311,52 +1311,52 @@ public void testVariableCaseFinal() {
}
//JDK7: Strings in Switch.
public void testNullCase() {
- String newMessage =
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " case local: break;\n" +
- " ^^^^^\n" +
- "case expressions must be constant expressions\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " case argument: break;\n" +
- " ^^^^^^^^\n" +
- "case expressions must be constant expressions\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " case inffield: break;\n" +
- " ^^^^^^^^\n" +
- "case expressions must be constant expressions\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " case nffield: break;\n" +
- " ^^^^^^^\n" +
- "case expressions must be constant expressions\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 11)\n" +
- " case (String) null: break;\n" +
- " ^^^^^^^^^^^^^\n" +
- "case expressions must be constant expressions\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 12)\n" +
- " case true ? (String) null : (String) null : break;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "case expressions must be constant expressions\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 12)\n" +
- " case true ? (String) null : (String) null : break;\n" +
- " ^^^^^^^^^^^^^\n" +
- "Dead code\n" +
+ String newMessage =
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " case local: break;\n" +
+ " ^^^^^\n" +
+ "case expressions must be constant expressions\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " case argument: break;\n" +
+ " ^^^^^^^^\n" +
+ "case expressions must be constant expressions\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 9)\n" +
+ " case inffield: break;\n" +
+ " ^^^^^^^^\n" +
+ "case expressions must be constant expressions\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 10)\n" +
+ " case nffield: break;\n" +
+ " ^^^^^^^\n" +
+ "case expressions must be constant expressions\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 11)\n" +
+ " case (String) null: break;\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "case expressions must be constant expressions\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 12)\n" +
+ " case true ? (String) null : (String) null : break;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "case expressions must be constant expressions\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 12)\n" +
+ " case true ? (String) null : (String) null : break;\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Dead code\n" +
"----------\n";
-
- String oldMessage =
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " switch(args[0]) {\n" +
- " ^^^^^^^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+
+ String oldMessage =
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " switch(args[0]) {\n" +
+ " ^^^^^^^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
"----------\n";
-
+
this.runNegativeTest(new String[] {
"X.java",
"public class X {\n" +
@@ -1364,7 +1364,7 @@ public void testNullCase() {
" final static String nffield = null;\n" +
" public void main(String [] args, final String argument) {\n" +
" final String local = null;\n" +
- " switch(args[0]) {\n" +
+ " switch(args[0]) {\n" +
" case local: break;\n" +
" case argument: break;\n" +
" case inffield: break;\n" +
@@ -1379,52 +1379,52 @@ public void testNullCase() {
}
// JDK7: Strings in Switch.
public void testDuplicateCase3() {
- String newMessage =
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " case \"123\": break;\n" +
- " ^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " case \"1\" + \"2\" + \"3\": break;\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 12)\n" +
- " case local: break;\n" +
- " ^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 13)\n" +
- " case field: break;\n" +
- " ^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 14)\n" +
- " case ifield: break;\n" +
- " ^^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 18)\n" +
- " default: break;\n" +
- " ^^^^^^^\n" +
- "The default case is already defined\n" +
+ String newMessage =
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " case \"123\": break;\n" +
+ " ^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " case \"1\" + \"2\" + \"3\": break;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 12)\n" +
+ " case local: break;\n" +
+ " ^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 13)\n" +
+ " case field: break;\n" +
+ " ^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 14)\n" +
+ " case ifield: break;\n" +
+ " ^^^^^^^^^^^\n" +
+ "Duplicate case\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 18)\n" +
+ " default: break;\n" +
+ " ^^^^^^^\n" +
+ "The default case is already defined\n" +
"----------\n";
-
- String oldMessage =
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " switch(args[0]) {\n" +
- " ^^^^^^^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 18)\n" +
- " default: break;\n" +
- " ^^^^^^^\n" +
- "The default case is already defined\n" +
+
+ String oldMessage =
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " switch(args[0]) {\n" +
+ " ^^^^^^^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 18)\n" +
+ " default: break;\n" +
+ " ^^^^^^^\n" +
+ "The default case is already defined\n" +
"----------\n";
-
+
this.runNegativeTest(new String[] {
"X.java",
"public class X {\n" +
@@ -1434,7 +1434,7 @@ public void testDuplicateCase3() {
" static String nffield = \"123\";\n" +
" public void main(String [] args, final String argument) {\n" +
" final String local = \"123\";\n" +
- " switch(args[0]) {\n" +
+ " switch(args[0]) {\n" +
" case \"123\": break;\n" +
" case \"1\" + \"2\" + \"3\": break;\n" +
" default: break;\n" +
@@ -1453,15 +1453,15 @@ public void testDuplicateCase3() {
}
public void testDuplicateHashCode() {
- String errorMsg =
- "----------\n" +
- "1. ERROR in testDuplicateHashCode.java (at line 5)\n" +
- " switch (dispatcher) {\n" +
- " ^^^^^^^^^^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ String errorMsg =
+ "----------\n" +
+ "1. ERROR in testDuplicateHashCode.java (at line 5)\n" +
+ " switch (dispatcher) {\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
"----------\n";
-
- String [] sourceFiles =
+
+ String [] sourceFiles =
new String[] {
"testDuplicateHashCode.java",
"public class testDuplicateHashCode {\n" +
@@ -1509,15 +1509,15 @@ public void testDuplicateHashCode() {
}
}
public void testDuplicateHashCode2() {
- String errorMsg =
- "----------\n" +
- "1. ERROR in testDuplicateHashCode.java (at line 5)\n" +
- " switch (dispatcher) {\n" +
- " ^^^^^^^^^^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ String errorMsg =
+ "----------\n" +
+ "1. ERROR in testDuplicateHashCode.java (at line 5)\n" +
+ " switch (dispatcher) {\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
"----------\n";
-
- String [] sourceFiles =
+
+ String [] sourceFiles =
new String[] {
"testDuplicateHashCode.java",
"public class testDuplicateHashCode {\n" +
@@ -1572,35 +1572,35 @@ public void testDuplicateHashCode2() {
}
}
public void testSwitchOnNull() {
- String errorMsg =
- "----------\n" +
- "1. ERROR in testSwitchOnNull.java (at line 13)\n" +
- " switch (s) {\n" +
- " ^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
- "----------\n" +
- "2. ERROR in testSwitchOnNull.java (at line 23)\n" +
- " switch ((String) null) {\n" +
- " ^^^^^^^^^^^^^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
- "----------\n" +
- "3. ERROR in testSwitchOnNull.java (at line 33)\n" +
- " switch (someMethod()) {\n" +
- " ^^^^^^^^^^^^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
- "----------\n" +
- "4. ERROR in testSwitchOnNull.java (at line 40)\n" +
- " switch (nullString) {\n" +
- " ^^^^^^^^^^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
- "----------\n" +
- "5. ERROR in testSwitchOnNull.java (at line 47)\n" +
- " switch (someMethod()) {\n" +
- " ^^^^^^^^^^^^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ String errorMsg =
+ "----------\n" +
+ "1. ERROR in testSwitchOnNull.java (at line 13)\n" +
+ " switch (s) {\n" +
+ " ^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ "----------\n" +
+ "2. ERROR in testSwitchOnNull.java (at line 23)\n" +
+ " switch ((String) null) {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ "----------\n" +
+ "3. ERROR in testSwitchOnNull.java (at line 33)\n" +
+ " switch (someMethod()) {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ "----------\n" +
+ "4. ERROR in testSwitchOnNull.java (at line 40)\n" +
+ " switch (nullString) {\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ "----------\n" +
+ "5. ERROR in testSwitchOnNull.java (at line 47)\n" +
+ " switch (someMethod()) {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
"----------\n";
-
- String [] sourceFiles =
+
+ String [] sourceFiles =
new String[] {
"testSwitchOnNull.java",
"public class testSwitchOnNull {\n" +
@@ -1668,15 +1668,15 @@ public void testSwitchOnNull() {
}
}
public void testSideEffect() {
- String errorMsg =
- "----------\n" +
- "1. ERROR in testSideEffect.java (at line 11)\n" +
- " switch(dispatcher()) {\n" +
- " ^^^^^^^^^^^^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ String errorMsg =
+ "----------\n" +
+ "1. ERROR in testSideEffect.java (at line 11)\n" +
+ " switch(dispatcher()) {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
"----------\n";
-
- String [] sourceFiles =
+
+ String [] sourceFiles =
new String[] {
"testSideEffect.java",
"public class testSideEffect {\n" +
@@ -1706,15 +1706,15 @@ public void testSideEffect() {
}
}
public void testFallThrough() {
- String errorMsg =
- "----------\n" +
- "1. ERROR in testFallThrough.java (at line 11)\n" +
- " switch(s = dispatcher()) {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ String errorMsg =
+ "----------\n" +
+ "1. ERROR in testFallThrough.java (at line 11)\n" +
+ " switch(s = dispatcher()) {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
"----------\n";
-
- String [] sourceFiles =
+
+ String [] sourceFiles =
new String[] {
"testFallThrough.java",
"public class testFallThrough {\n" +
@@ -1756,15 +1756,15 @@ public void testFallThrough() {
}
}
public void testFallThrough2() {
- String errorMsg =
- "----------\n" +
- "1. ERROR in testFallThrough.java (at line 11)\n" +
- " switch(s = dispatcher()) {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ String errorMsg =
+ "----------\n" +
+ "1. ERROR in testFallThrough.java (at line 11)\n" +
+ " switch(s = dispatcher()) {\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
"----------\n";
-
- String [] sourceFiles =
+
+ String [] sourceFiles =
new String[] {
"testFallThrough.java",
"public class testFallThrough {\n" +
@@ -1800,16 +1800,16 @@ public void testMarysLamb() {
if (this.complianceLevel < ClassFileConstants.JDK1_5) {
return;
}
-
- String errorMsg =
- "----------\n" +
- "1. ERROR in testMarysLamb.java (at line 4)\n" +
- " switch(s) {\n" +
- " ^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+
+ String errorMsg =
+ "----------\n" +
+ "1. ERROR in testMarysLamb.java (at line 4)\n" +
+ " switch(s) {\n" +
+ " ^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
"----------\n";
-
- String [] sourceFiles =
+
+ String [] sourceFiles =
new String[] {
"testMarysLamb.java",
"public class testMarysLamb {\n" +
@@ -1828,16 +1828,16 @@ public void testMarysLamb() {
this.runConformTest(sourceFiles, "Mary Had A Little Lamb");
}
}
-public void testBreakOut() {
- String errorMsg =
- "----------\n" +
- "1. ERROR in testBreakOut.java (at line 5)\n" +
- " switch(s) {\n" +
- " ^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+public void testBreakOut() {
+ String errorMsg =
+ "----------\n" +
+ "1. ERROR in testBreakOut.java (at line 5)\n" +
+ " switch(s) {\n" +
+ " ^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
"----------\n";
-
- String [] sourceFiles =
+
+ String [] sourceFiles =
new String[] {
"testBreakOut.java",
"public class testBreakOut {\n" +
@@ -1865,25 +1865,25 @@ public void testMultipleSwitches() {
if (this.complianceLevel < ClassFileConstants.JDK1_5) {
return;
}
- String errorMsg =
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " switch (s) {\n" +
- " ^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 35)\n" +
- " switch (s) {\n" +
- " ^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 51)\n" +
- " switch (s) {\n" +
- " ^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ String errorMsg =
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " switch (s) {\n" +
+ " ^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 35)\n" +
+ " switch (s) {\n" +
+ " ^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 51)\n" +
+ " switch (s) {\n" +
+ " ^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
"----------\n";
-
- String [] sourceFiles =
+
+ String [] sourceFiles =
new String[] {
"X.java",
"public class X {\n" +
@@ -1967,25 +1967,25 @@ public void testNestedSwitches() {
if (this.complianceLevel < ClassFileConstants.JDK1_5) {
return;
}
- String errorMsg =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " switch (s) {\n" +
- " ^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " switch (s) {\n" +
- " ^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 18)\n" +
- " switch (s) {\n" +
- " ^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ String errorMsg =
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " switch (s) {\n" +
+ " ^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " switch (s) {\n" +
+ " ^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 18)\n" +
+ " switch (s) {\n" +
+ " ^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
"----------\n";
-
- String [] sourceFiles =
+
+ String [] sourceFiles =
new String[] {
"X.java",
"public class X {\n" +
@@ -2036,31 +2036,31 @@ public void testNestedSwitches() {
}
}
public void testFor356002() {
- String errorMsg =
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " switch (foo()) {\n" +
- " ^^^^^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ String errorMsg =
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " switch (foo()) {\n" +
+ " ^^^^^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
"----------\n";
-
- String [] sourceFiles =
+
+ String [] sourceFiles =
new String[] {
"X.java",
- "public class X {\n" +
- " private static String foo() {\n" +
- " return \"\";\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " switch (foo()) {\n" +
- " default: {\n" +
- " int j = 0;\n" +
- " if (j <= 0)\n" +
+ "public class X {\n" +
+ " private static String foo() {\n" +
+ " return \"\";\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " switch (foo()) {\n" +
+ " default: {\n" +
+ " int j = 0;\n" +
+ " if (j <= 0)\n" +
" System.out.println(\"DONE\");\n" +
- " }\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " return;\n" +
+ " }\n" +
+ " }\n" +
"}",
};
if (this.complianceLevel < JDKLevelSupportingStringSwitch) {
@@ -2070,28 +2070,28 @@ public void testFor356002() {
}
}
public void testFor356002_2() {
- String errorMsg =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " switch (\"\") {\n" +
- " ^^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ String errorMsg =
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " switch (\"\") {\n" +
+ " ^^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
"----------\n";
-
- String [] sourceFiles =
+
+ String [] sourceFiles =
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " switch (\"\") {\n" +
- " default: {\n" +
- " int j = 0;\n" +
- " if (j <= 0)\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " switch (\"\") {\n" +
+ " default: {\n" +
+ " int j = 0;\n" +
+ " if (j <= 0)\n" +
" System.out.println(\"DONE\");\n" +
- " }\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " return;\n" +
+ " }\n" +
+ " }\n" +
"}",
};
if (this.complianceLevel < JDKLevelSupportingStringSwitch) {
@@ -2102,34 +2102,34 @@ public void testFor356002_2() {
}
public void testFor356002_3() {
String errorMsg =
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " switch (foo()) {\n" +
- " ^^^^^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " switch (foo()) {\n" +
+ " ^^^^^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
"----------\n";
-
+
String [] sourceFiles =
new String[] {
"X.java",
- "public class X {\n" +
- " private static String foo() {\n" +
- " return null;\n" +
- " }\n" +
+ "public class X {\n" +
+ " private static String foo() {\n" +
+ " return null;\n" +
+ " }\n" +
" public static void main(String[] args) {\n" +
" try {\n" +
- " switch (foo()) {\n" +
- " default: {\n" +
- " int j = 0;\n" +
- " if (j <= 0)\n" +
+ " switch (foo()) {\n" +
+ " default: {\n" +
+ " int j = 0;\n" +
+ " if (j <= 0)\n" +
" ;\n" +
- " }\n" +
- " return;\n" +
- " }\n" +
+ " }\n" +
+ " return;\n" +
+ " }\n" +
" } catch(NullPointerException e) {\n" +
" System.out.println(\"DONE\");\n" +
" }\n" +
- " }\n" +
+ " }\n" +
"}",
};
if (this.complianceLevel < JDKLevelSupportingStringSwitch) {
@@ -2165,7 +2165,7 @@ public void testBug374605() {
null,
true,
options
- );
+ );
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=380927
public void testBug380927() {
@@ -2194,7 +2194,7 @@ public void testBug380927() {
" }\n" +
"}\n",
},
- "Success");
+ "Success");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=380927
public void testBug380927a() {
@@ -2223,7 +2223,7 @@ public void testBug380927a() {
" }\n" +
"}\n",
},
- "Success");
+ "Success");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=380927
public void testBug380927b() {
@@ -2252,7 +2252,7 @@ public void testBug380927b() {
" }\n" +
"}\n",
},
- "Success");
+ "Success");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=380927
public void testBug380927c() {
@@ -2283,7 +2283,7 @@ public void testBug380927c() {
" }\n" +
"}\n",
},
- "Success");
+ "Success");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=380927
public void testBug380927d() {
@@ -2306,12 +2306,12 @@ public void testBug380927d() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " System.out.println(b);\n" +
- " ^\n" +
- "The local variable b may not have been initialized\n" +
- "----------\n");
+ "----------\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " System.out.println(b);\n" +
+ " ^\n" +
+ "The local variable b may not have been initialized\n" +
+ "----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=380927
public void testBug380927e() {
@@ -2334,12 +2334,12 @@ public void testBug380927e() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " System.out.println(b);\n" +
- " ^\n" +
- "The local variable b may not have been initialized\n" +
- "----------\n");
+ "----------\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " System.out.println(b);\n" +
+ " ^\n" +
+ "The local variable b may not have been initialized\n" +
+ "----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=380927
public void testBug380927f() {
@@ -2362,12 +2362,12 @@ public void testBug380927f() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " System.out.println(b);\n" +
- " ^\n" +
- "The local variable b may not have been initialized\n" +
- "----------\n");
+ "----------\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " System.out.println(b);\n" +
+ " ^\n" +
+ "The local variable b may not have been initialized\n" +
+ "----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=380927
public void testBug380927g() {
@@ -2392,12 +2392,12 @@ public void testBug380927g() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " System.out.println(b);\n" +
- " ^\n" +
- "The local variable b may not have been initialized\n" +
- "----------\n");
+ "----------\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " System.out.println(b);\n" +
+ " ^\n" +
+ "The local variable b may not have been initialized\n" +
+ "----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383629
@@ -2407,36 +2407,36 @@ public void testBug383629() throws Exception {
new String[] {
"X.java",
"public class X {\n" +
- " public static void main(String[] args) {\n" +
+ " public static void main(String[] args) {\n" +
" char chc; \n" +
- " do { \n" +
- " if (args == null) { \n" +
- " switch ('a') { \n" +
- " case '\\n': \n" +
+ " do { \n" +
+ " if (args == null) { \n" +
+ " switch ('a') { \n" +
+ " case '\\n': \n" +
" chc = 'b';\n" +
" } \n" +
- " } else { \n" +
- " switch ('a') { \n" +
+ " } else { \n" +
+ " switch ('a') { \n" +
" case '\\r':\n" +
- " } \n" +
+ " } \n" +
" }\n" +
" } while (false);\n" +
" System.out.println(\"Done\");\n" +
" }\n" +
"}",
}); // custom requestor
-
+
String expectedOutput = this.complianceLevel < ClassFileConstants.JDK1_6 ?
- " Local variable table:\n" +
+ " Local variable table:\n" +
" [pc: 0, pc: 61] local: args index: 0 type: java.lang.String[]\n":
- " Local variable table:\n" +
- " [pc: 0, pc: 61] local: args index: 0 type: java.lang.String[]\n" +
- " Stack map table: number of frames 4\n" +
- " [pc: 24, same]\n" +
- " [pc: 27, same]\n" +
- " [pc: 30, same]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 61] local: args index: 0 type: java.lang.String[]\n" +
+ " Stack map table: number of frames 4\n" +
+ " [pc: 24, same]\n" +
+ " [pc: 27, same]\n" +
+ " [pc: 30, same]\n" +
" [pc: 52, same]\n";
-
+
File f = new File(OUTPUT_DIR + File.separator + "X.class");
byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
@@ -2456,54 +2456,54 @@ public void testBug381172() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args){\n" +
- " System.out.println(\"Test\");\n" +
- " }\n" +
- " public void method() {\n" +
- " try {\n" +
- " int rc;\n" +
- " switch ( 0 )\n" +
- " {\n" +
- " case 0:\n" +
- " rc = 0;\n" +
- " setRC( rc );\n" +
- " break;\n" +
- " case 1:\n" +
- " rc = 1;\n" +
- " setRC( 0 );\n" +
- " break;\n" +
- " case 2:\n" +
- " rc = 2;\n" +
- " setRC( 0 );\n" +
- " break;\n" +
- " default:\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- " catch ( final Exception ex ) {}\n" +
- " }\n" +
- " private void setRC(int rc) {}\n" +
+ "public class X {\n" +
+ " public static void main(String[] args){\n" +
+ " System.out.println(\"Test\");\n" +
+ " }\n" +
+ " public void method() {\n" +
+ " try {\n" +
+ " int rc;\n" +
+ " switch ( 0 )\n" +
+ " {\n" +
+ " case 0:\n" +
+ " rc = 0;\n" +
+ " setRC( rc );\n" +
+ " break;\n" +
+ " case 1:\n" +
+ " rc = 1;\n" +
+ " setRC( 0 );\n" +
+ " break;\n" +
+ " case 2:\n" +
+ " rc = 2;\n" +
+ " setRC( 0 );\n" +
+ " break;\n" +
+ " default:\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
+ " catch ( final Exception ex ) {}\n" +
+ " }\n" +
+ " private void setRC(int rc) {}\n" +
"}",
}); // custom requestor
-
+
String expectedOutput = this.complianceLevel < ClassFileConstants.JDK1_6 ?
- " Local variable table:\n" +
- " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
" [pc: 0, pc: 1] local: rc index: 1 type: int\n":
- " Local variable table:\n" +
- " [pc: 0, pc: 63] local: this index: 0 type: X\n" +
- " [pc: 30, pc: 38] local: rc index: 1 type: int\n" +
- " [pc: 40, pc: 48] local: rc index: 1 type: int\n" +
- " [pc: 50, pc: 58] local: rc index: 1 type: int\n" +
- " Stack map table: number of frames 6\n" +
- " [pc: 28, same]\n" +
- " [pc: 38, same]\n" +
- " [pc: 48, same]\n" +
- " [pc: 58, same]\n" +
- " [pc: 61, same_locals_1_stack_item, stack: {java.lang.Exception}]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 63] local: this index: 0 type: X\n" +
+ " [pc: 30, pc: 38] local: rc index: 1 type: int\n" +
+ " [pc: 40, pc: 48] local: rc index: 1 type: int\n" +
+ " [pc: 50, pc: 58] local: rc index: 1 type: int\n" +
+ " Stack map table: number of frames 6\n" +
+ " [pc: 28, same]\n" +
+ " [pc: 38, same]\n" +
+ " [pc: 48, same]\n" +
+ " [pc: 58, same]\n" +
+ " [pc: 61, same_locals_1_stack_item, stack: {java.lang.Exception}]\n" +
" [pc: 62, same]\n";
-
+
File f = new File(OUTPUT_DIR + File.separator + "X.class");
byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
@@ -2539,31 +2539,31 @@ public void test383643() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " switch (p) {\n" +
- " ^\n" +
- "p cannot be resolved to a variable\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " switch (p) {\n" +
- " ^\n" +
- "The switch statement should have a default case\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " case ONE:\n" +
- " ^^^\n" +
- "ONE cannot be resolved to a variable\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " case TWO:\n" +
- " ^^^\n" +
- "TWO cannot be resolved to a variable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " switch (p) {\n" +
+ " ^\n" +
+ "p cannot be resolved to a variable\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " switch (p) {\n" +
+ " ^\n" +
+ "The switch statement should have a default case\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " case ONE:\n" +
+ " ^^^\n" +
+ "ONE cannot be resolved to a variable\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " case TWO:\n" +
+ " ^^^\n" +
+ "TWO cannot be resolved to a variable\n" +
"----------\n",
null,
true,
options
- );
+ );
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=387146 - the fall-through comment is ignored
public void test387146a() {
@@ -2625,24 +2625,24 @@ public void test387146b() {
}
//JDK7: Strings in Switch.
public void test393537() {
- String errorMsg =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " switch (\"\") {\n" +
- " ^^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ String errorMsg =
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " switch (\"\") {\n" +
+ " ^^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
"----------\n";
-
- String [] sourceFiles =
+
+ String [] sourceFiles =
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " switch (\"\") {\n" +
- " case \"\":\n" +
- " default:\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " switch (\"\") {\n" +
+ " case \"\":\n" +
+ " default:\n" +
+ " }\n" +
+ " }\n" +
"}",
};
if (this.complianceLevel < JDKLevelSupportingStringSwitch) {
@@ -2653,27 +2653,27 @@ public void test393537() {
}
//JDK7: Strings in Switch.
public void test410892() {
- String errorMsg =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " switch (s) {\n" +
- " ^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ String errorMsg =
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " switch (s) {\n" +
+ " ^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
"----------\n";
-
- String [] sourceFiles =
+
+ String [] sourceFiles =
new String[] {
"X.java",
- "public class X {\n" +
- " public void testFunction(String s) {\n" +
- " int var1 = 0;\n" +
- " int var2 = 0;\n" +
- " switch (s) {\n" +
- " case \"test\": \n" +
- " var2 = ++var1 % 2;\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public void testFunction(String s) {\n" +
+ " int var1 = 0;\n" +
+ " int var2 = 0;\n" +
+ " switch (s) {\n" +
+ " case \"test\": \n" +
+ " var2 = ++var1 % 2;\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
"}",
};
if (this.complianceLevel < JDKLevelSupportingStringSwitch) {
@@ -2686,27 +2686,27 @@ public void test410892() {
}
//JDK7: Strings in Switch.
public void test410892_2() {
- String errorMsg =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " switch (s) {\n" +
- " ^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ String errorMsg =
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " switch (s) {\n" +
+ " ^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
"----------\n";
- String [] sourceFiles =
+ String [] sourceFiles =
new String[] {
"X.java",
- "public class X {\n" +
- " public X(String s) {\n" +
- " int var1 = 0;\n" +
- " int var2 = 0;\n" +
- " switch (s) {\n" +
- " case \"test\": \n" +
- " var2 = ++var1 % 2;\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public X(String s) {\n" +
+ " int var1 = 0;\n" +
+ " int var2 = 0;\n" +
+ " switch (s) {\n" +
+ " case \"test\": \n" +
+ " var2 = ++var1 % 2;\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
"}",
};
if (this.complianceLevel < JDKLevelSupportingStringSwitch) {
@@ -2719,28 +2719,28 @@ public void test410892_2() {
}
//JDK7: Strings in Switch.
public void test410892_3() {
- String errorMsg =
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " switch (s) {\n" +
- " ^\n" +
- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
+ String errorMsg =
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " switch (s) {\n" +
+ " ^\n" +
+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" +
"----------\n";
-
- String [] sourceFiles =
+
+ String [] sourceFiles =
new String[] {
"X.java",
- "public class X {\n" +
- " static {\n" +
- " int var1 = 0;\n" +
+ "public class X {\n" +
+ " static {\n" +
+ " int var1 = 0;\n" +
" int var2 = 0;\n" +
" String s = \"test2\";\n" +
- " switch (s) {\n" +
- " case \"test\": \n" +
- " var2 = ++var1 % 2;\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
+ " switch (s) {\n" +
+ " case \"test\": \n" +
+ " var2 = ++var1 % 2;\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
"}",
};
if (this.complianceLevel < JDKLevelSupportingStringSwitch) {
@@ -2756,26 +2756,26 @@ public void test410892_4() {
Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
options.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
- String errorMsg =
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " int var2 = 0;\n" +
- " ^^^^\n" +
- "The value of the local variable var2 is not used\n" +
+ String errorMsg =
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " int var2 = 0;\n" +
+ " ^^^^\n" +
+ "The value of the local variable var2 is not used\n" +
"----------\n";
- String [] sourceFiles =
+ String [] sourceFiles =
new String[] {
"X.java",
- "public class X {\n" +
- " public void testFunction(String s) {\n" +
- " int var1 = 0;\n" +
- " int var2 = 0;\n" +
- " switch (s) {\n" +
- " case \"test\": \n" +
- " var2 = ++var1 % 2;\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public void testFunction(String s) {\n" +
+ " int var1 = 0;\n" +
+ " int var2 = 0;\n" +
+ " switch (s) {\n" +
+ " case \"test\": \n" +
+ " var2 = ++var1 % 2;\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
"}",
};
if (this.complianceLevel >= JDKLevelSupportingStringSwitch) {
@@ -2791,26 +2791,26 @@ public void test410892_5() {
Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
options.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
- String errorMsg =
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " int var2 = 0;\n" +
- " ^^^^\n" +
- "The value of the local variable var2 is not used\n" +
+ String errorMsg =
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " int var2 = 0;\n" +
+ " ^^^^\n" +
+ "The value of the local variable var2 is not used\n" +
"----------\n";
- String [] sourceFiles =
+ String [] sourceFiles =
new String[] {
"X.java",
- "public class X {\n" +
- " public X(String s) {\n" +
- " int var1 = 0;\n" +
- " int var2 = 0;\n" +
- " switch (s) {\n" +
- " case \"test\": \n" +
- " var2 = ++var1 % 2;\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " public X(String s) {\n" +
+ " int var1 = 0;\n" +
+ " int var2 = 0;\n" +
+ " switch (s) {\n" +
+ " case \"test\": \n" +
+ " var2 = ++var1 % 2;\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
"}",
};
if (this.complianceLevel >= JDKLevelSupportingStringSwitch) {
@@ -2826,27 +2826,27 @@ public void test410892_6() {
Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
options.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
- String errorMsg =
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " int var2 = 0;\n" +
- " ^^^^\n" +
- "The value of the local variable var2 is not used\n" +
+ String errorMsg =
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " int var2 = 0;\n" +
+ " ^^^^\n" +
+ "The value of the local variable var2 is not used\n" +
"----------\n";
- String [] sourceFiles =
+ String [] sourceFiles =
new String[] {
"X.java",
- "public class X {\n" +
- " static {\n" +
- " int var1 = 0;\n" +
- " int var2 = 0;\n" +
- " String s = \"Test2\";\n" +
- " switch (s) {\n" +
- " case \"test\": \n" +
- " var2 = ++var1 % 2;\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " static {\n" +
+ " int var1 = 0;\n" +
+ " int var2 = 0;\n" +
+ " String s = \"Test2\";\n" +
+ " switch (s) {\n" +
+ " case \"test\": \n" +
+ " var2 = ++var1 % 2;\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
"}",
};
if (this.complianceLevel >= JDKLevelSupportingStringSwitch) {
@@ -2858,105 +2858,105 @@ public void test410892_6() {
}
}
public void test526911() {
- String [] sourceFiles =
+ String [] sourceFiles =
new String[] {
"Main.java",
- "public class Main {\n" +
- " public static void main(String[] args) {\n" +
- " new Main().run();\n" +
- " }\n" +
- " \n" +
- " private void run() {\n" +
- " V v = new VA();\n" +
- " I i = I.create(v);\n" +
- " System.out.printf(\"%d %d\", i.m1(), i.m2());\n" +
- " }\n" +
+ "public class Main {\n" +
+ " public static void main(String[] args) {\n" +
+ " new Main().run();\n" +
+ " }\n" +
+ " \n" +
+ " private void run() {\n" +
+ " V v = new VA();\n" +
+ " I i = I.create(v);\n" +
+ " System.out.printf(\"%d %d\", i.m1(), i.m2());\n" +
+ " }\n" +
"}\n",
"XI.java",
- "public class XI implements I {\n" +
- " V v;\n" +
- " public XI(V v) {\n" +
- " this.v = v;\n" +
- " }\n" +
- " @Override\n" +
- " public int m1() {\n" +
- " return 1;\n" +
- " }\n" +
- " @Override\n" +
- " public int m2() {\n" +
- " return 11;\n" +
- " }\n" +
+ "public class XI implements I {\n" +
+ " V v;\n" +
+ " public XI(V v) {\n" +
+ " this.v = v;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public int m1() {\n" +
+ " return 1;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public int m2() {\n" +
+ " return 11;\n" +
+ " }\n" +
"}\n",
"YI.java",
- "public class YI implements I {\n" +
- " V v;\n" +
- " public YI(V v) {\n" +
- " this.v = v;\n" +
- " }\n" +
- " @Override\n" +
- " public int m1() {\n" +
- " return 2;\n" +
- " }\n" +
- " @Override\n" +
- " public int m2() {\n" +
- " return 22;\n" +
- " }\n" +
+ "public class YI implements I {\n" +
+ " V v;\n" +
+ " public YI(V v) {\n" +
+ " this.v = v;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public int m1() {\n" +
+ " return 2;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public int m2() {\n" +
+ " return 22;\n" +
+ " }\n" +
"}\n",
"V.java",
- "public class V {\n" +
- " public enum T { A, B, C }\n" +
- " private T t;\n" +
- " public V(T t) {\n" +
- " this.t = t;\n" +
- " }\n" +
- " public T getT() { return t; }\n" +
+ "public class V {\n" +
+ " public enum T { A, B, C }\n" +
+ " private T t;\n" +
+ " public V(T t) {\n" +
+ " this.t = t;\n" +
+ " }\n" +
+ " public T getT() { return t; }\n" +
"}\n" +
- "class VA extends V {\n" +
- " VA() {\n" +
- " super(T.A);\n" +
- " }\n" +
+ "class VA extends V {\n" +
+ " VA() {\n" +
+ " super(T.A);\n" +
+ " }\n" +
"}",
"I.java",
- "enum H { X, Y }\n" +
- "public interface I {\n" +
- " public static final int i = 0;\n" +
- " public int m1();\n" +
- " public int m2();\n" +
- " public static I create(V v) { \n" +
- " V.T t = v.getT();\n" +
- " H h = getH(t);\n" +
- " switch (h) { // depending on H i need different implementations of I. XI and YI provide them\n" +
- " case X:\n" +
- " return new XI(v);\n" +
- " case Y:\n" +
- " return new YI(v);\n" +
- " default:\n" +
- " throw new Error();\n" +
- " } \n" +
- " }\n" +
- " static H getH(V.T t) { // different T's require different H's to handle them\n" +
- " switch (t) {\n" +
- " case A:\n" +
- " return H.X;\n" +
- " case B:\n" +
- " case C:\n" +
- " return H.Y;\n" +
- " }\n" +
- " throw new Error();\n" +
- " }\n" +
+ "enum H { X, Y }\n" +
+ "public interface I {\n" +
+ " public static final int i = 0;\n" +
+ " public int m1();\n" +
+ " public int m2();\n" +
+ " public static I create(V v) { \n" +
+ " V.T t = v.getT();\n" +
+ " H h = getH(t);\n" +
+ " switch (h) { // depending on H i need different implementations of I. XI and YI provide them\n" +
+ " case X:\n" +
+ " return new XI(v);\n" +
+ " case Y:\n" +
+ " return new YI(v);\n" +
+ " default:\n" +
+ " throw new Error();\n" +
+ " } \n" +
+ " }\n" +
+ " static H getH(V.T t) { // different T's require different H's to handle them\n" +
+ " switch (t) {\n" +
+ " case A:\n" +
+ " return H.X;\n" +
+ " case B:\n" +
+ " case C:\n" +
+ " return H.Y;\n" +
+ " }\n" +
+ " throw new Error();\n" +
+ " }\n" +
"}",
"X.java",
- "public class X {\n" +
- " static {\n" +
- " int var1 = 0;\n" +
- " int var2 = 0;\n" +
- " String s = \"Test2\";\n" +
- " switch (s) {\n" +
- " case \"test\": \n" +
- " var2 = ++var1 % 2;\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " static {\n" +
+ " int var1 = 0;\n" +
+ " int var2 = 0;\n" +
+ " String s = \"Test2\";\n" +
+ " switch (s) {\n" +
+ " case \"test\": \n" +
+ " var2 = ++var1 % 2;\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
"}",
};
if (this.complianceLevel >= ClassFileConstants.JDK1_8) {
@@ -2964,110 +2964,110 @@ public void test526911() {
}
}
public void test526911a() {
- // target 1.8, run with 9, should work fine
+ // target 1.8, run with 9, should work fine
if (this.complianceLevel < ClassFileConstants.JDK9)
return;
Map options = getCompilerOptions();
options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_8);
- String [] sourceFiles =
+ String [] sourceFiles =
new String[] {
"Main.java",
- "public class Main {\n" +
- " public static void main(String[] args) {\n" +
- " new Main().run();\n" +
- " }\n" +
- " \n" +
- " private void run() {\n" +
- " V v = new VA();\n" +
- " I i = I.create(v);\n" +
- " System.out.printf(\"%d %d\", i.m1(), i.m2());\n" +
- " }\n" +
+ "public class Main {\n" +
+ " public static void main(String[] args) {\n" +
+ " new Main().run();\n" +
+ " }\n" +
+ " \n" +
+ " private void run() {\n" +
+ " V v = new VA();\n" +
+ " I i = I.create(v);\n" +
+ " System.out.printf(\"%d %d\", i.m1(), i.m2());\n" +
+ " }\n" +
"}\n",
"XI.java",
- "public class XI implements I {\n" +
- " V v;\n" +
- " public XI(V v) {\n" +
- " this.v = v;\n" +
- " }\n" +
- " @Override\n" +
- " public int m1() {\n" +
- " return 1;\n" +
- " }\n" +
- " @Override\n" +
- " public int m2() {\n" +
- " return 11;\n" +
- " }\n" +
+ "public class XI implements I {\n" +
+ " V v;\n" +
+ " public XI(V v) {\n" +
+ " this.v = v;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public int m1() {\n" +
+ " return 1;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public int m2() {\n" +
+ " return 11;\n" +
+ " }\n" +
"}\n",
"YI.java",
- "public class YI implements I {\n" +
- " V v;\n" +
- " public YI(V v) {\n" +
- " this.v = v;\n" +
- " }\n" +
- " @Override\n" +
- " public int m1() {\n" +
- " return 2;\n" +
- " }\n" +
- " @Override\n" +
- " public int m2() {\n" +
- " return 22;\n" +
- " }\n" +
+ "public class YI implements I {\n" +
+ " V v;\n" +
+ " public YI(V v) {\n" +
+ " this.v = v;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public int m1() {\n" +
+ " return 2;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public int m2() {\n" +
+ " return 22;\n" +
+ " }\n" +
"}\n",
"V.java",
- "public class V {\n" +
- " public enum T { A, B, C }\n" +
- " private T t;\n" +
- " public V(T t) {\n" +
- " this.t = t;\n" +
- " }\n" +
- " public T getT() { return t; }\n" +
+ "public class V {\n" +
+ " public enum T { A, B, C }\n" +
+ " private T t;\n" +
+ " public V(T t) {\n" +
+ " this.t = t;\n" +
+ " }\n" +
+ " public T getT() { return t; }\n" +
"}\n" +
- "class VA extends V {\n" +
- " VA() {\n" +
- " super(T.A);\n" +
- " }\n" +
+ "class VA extends V {\n" +
+ " VA() {\n" +
+ " super(T.A);\n" +
+ " }\n" +
"}",
"I.java",
- "enum H { X, Y }\n" +
- "public interface I {\n" +
- " public static final int i = 0;\n" +
- " public int m1();\n" +
- " public int m2();\n" +
- " public static I create(V v) { \n" +
- " V.T t = v.getT();\n" +
- " H h = getH(t);\n" +
- " switch (h) { // depending on H i need different implementations of I. XI and YI provide them\n" +
- " case X:\n" +
- " return new XI(v);\n" +
- " case Y:\n" +
- " return new YI(v);\n" +
- " default:\n" +
- " throw new Error();\n" +
- " } \n" +
- " }\n" +
- " static H getH(V.T t) { // different T's require different H's to handle them\n" +
- " switch (t) {\n" +
- " case A:\n" +
- " return H.X;\n" +
- " case B:\n" +
- " case C:\n" +
- " return H.Y;\n" +
- " }\n" +
- " throw new Error();\n" +
- " }\n" +
+ "enum H { X, Y }\n" +
+ "public interface I {\n" +
+ " public static final int i = 0;\n" +
+ " public int m1();\n" +
+ " public int m2();\n" +
+ " public static I create(V v) { \n" +
+ " V.T t = v.getT();\n" +
+ " H h = getH(t);\n" +
+ " switch (h) { // depending on H i need different implementations of I. XI and YI provide them\n" +
+ " case X:\n" +
+ " return new XI(v);\n" +
+ " case Y:\n" +
+ " return new YI(v);\n" +
+ " default:\n" +
+ " throw new Error();\n" +
+ " } \n" +
+ " }\n" +
+ " static H getH(V.T t) { // different T's require different H's to handle them\n" +
+ " switch (t) {\n" +
+ " case A:\n" +
+ " return H.X;\n" +
+ " case B:\n" +
+ " case C:\n" +
+ " return H.Y;\n" +
+ " }\n" +
+ " throw new Error();\n" +
+ " }\n" +
"}",
"X.java",
- "public class X {\n" +
- " static {\n" +
- " int var1 = 0;\n" +
- " int var2 = 0;\n" +
- " String s = \"Test2\";\n" +
- " switch (s) {\n" +
- " case \"test\": \n" +
- " var2 = ++var1 % 2;\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
+ "public class X {\n" +
+ " static {\n" +
+ " int var1 = 0;\n" +
+ " int var2 = 0;\n" +
+ " String s = \"Test2\";\n" +
+ " switch (s) {\n" +
+ " case \"test\": \n" +
+ " var2 = ++var1 % 2;\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
"}",
};
this.runConformTest(sourceFiles, "1 11", options);
@@ -3078,51 +3078,51 @@ public void testBug533475() {
runConformTest(
new String[] {
"SwitchBug.java",
- "public class SwitchBug {\n" +
- " static class MyClass {\n" +
- " private static final Object C = \"\";\n" +
- "\n" +
- " public enum State {\n" +
- " ENABLED(C); // pass null constant\n" +
- "\n" +
- " State(Object value) {\n" +
- " } // value can be ignored\n" +
- " }\n" +
- "\n" +
- " /* unused method with switch statement IN SAME CLASS */\n" +
- " private void unusedMethod() {\n" +
- " switch (State.ENABLED) {\n" +
- " case ENABLED:\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " // access enum values from an other class\n" +
- " MyClass.State.values();\n" +
- " System.out.println(\"It runs.\");\n" +
- " }\n" +
+ "public class SwitchBug {\n" +
+ " static class MyClass {\n" +
+ " private static final Object C = \"\";\n" +
+ "\n" +
+ " public enum State {\n" +
+ " ENABLED(C); // pass null constant\n" +
+ "\n" +
+ " State(Object value) {\n" +
+ " } // value can be ignored\n" +
+ " }\n" +
+ "\n" +
+ " /* unused method with switch statement IN SAME CLASS */\n" +
+ " private void unusedMethod() {\n" +
+ " switch (State.ENABLED) {\n" +
+ " case ENABLED:\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " // access enum values from an other class\n" +
+ " MyClass.State.values();\n" +
+ " System.out.println(\"It runs.\");\n" +
+ " }\n" +
"}\n"
});
}
public void testBug545518() {
if (this.complianceLevel < ClassFileConstants.JDK1_8 || this.complianceLevel >= ClassFileConstants.JDK12)
return;
- String message =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Multi-constant case labels supported from Java 14 onwards only\n" +
+ String message =
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Multi-constant case labels supported from Java 14 onwards only\n" +
"----------\n";
-
+
this.runNegativeTest(new String[] {
"X.java",
"public class X {\n" +
" public static void main(String [] args) {\n" +
" String arg = \"ABD\";\n" +
- " switch(arg) {\n" +
+ " switch(arg) {\n" +
" case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
" }\n" +
" }\n" +
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java
index 17742ec55..2e3b88eb7 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java
@@ -53,11 +53,11 @@ public static Test suite() {
standardTests.add(BooleanTest.class);
standardTests.add(CastTest.class);
standardTests.add(ClassFileComparatorTest.class);
-//{ObjectTeams: the underlying rule has changed for OT/J:
+//{ObjectTeams: the underlying rule has changed for OT/J:
/* orig:
standardTests.add(CollisionCase.class);
:giro */
-// SH}
+// SH}
standardTests.add(ConstantTest.class);
standardTests.add(DeprecatedTest.class);
standardTests.add(LocalVariableTest.class);
@@ -127,7 +127,7 @@ public static Test suite() {
ArrayList since_1_6 = new ArrayList();
since_1_6.add(StackMapAttributeTest.class);
since_1_6.add(Compliance_1_6.class);
-
+
ArrayList since_1_7 = new ArrayList();
since_1_7.add(AssignmentTest_1_7.class);
since_1_7.add(BinaryLiteralTest.class);
@@ -138,7 +138,7 @@ public static Test suite() {
since_1_7.add(PolymorphicSignatureTest.class);
since_1_7.add(Compliance_1_7.class);
since_1_7.add(MethodHandleTest.class);
-
+
ArrayList since_1_8 = new ArrayList();
since_1_8.add(NegativeTypeAnnotationTest.class);
since_1_8.add(NullTypeAnnotationTest.class);
@@ -178,7 +178,7 @@ public static Test suite() {
ArrayList since_10 = new ArrayList();
since_10.add(JEP286Test.class);
since_10.add(Unicode10Test.class);
-
+
// add 11 specific test here (check duplicates)
ArrayList since_11 = new ArrayList();
since_11.add(JEP323VarLambdaParamsTest.class);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TextBlockTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TextBlockTest.java
index 32906fb2e..e8006e6a3 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TextBlockTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TextBlockTest.java
@@ -24,8 +24,8 @@ import junit.framework.Test;
* This is almost a copy of the one in org.eclipse.jdt.tests.latestBREE.
* The other one also includes tests that are coded using the latest language
* features and API. However, the bundle is not yet setup to run with the build
- * hence this is a temporary arrangement to keep the tests being run. The recommended
- * strategy is to keep this one updated and when the time comes, move this over
+ * hence this is a temporary arrangement to keep the tests being run. The recommended
+ * strategy is to keep this one updated and when the time comes, move this over
* to the other bundle after synch-up of tests from both.
* @author jay
*
@@ -36,7 +36,7 @@ public class TextBlockTest extends AbstractRegressionTest {
// TESTS_NUMBERS = new int [] { 40 };
// TESTS_NAMES = new String[] { "testCompliances_14" };
}
-
+
public static Class<?> testClass() {
return TextBlockTest.class;
}
@@ -73,11 +73,11 @@ public class TextBlockTest extends AbstractRegressionTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public static String textb = \"\"\"\"\"\";\n" +
- " ^^\n" +
- "Syntax error on token \"\"\"\", invalid AssignmentOperator\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public static String textb = \"\"\"\"\"\";\n" +
+ " ^^\n" +
+ "Syntax error on token \"\"\"\", invalid AssignmentOperator\n" +
"----------\n");
}
public void test002() {
@@ -91,11 +91,11 @@ public class TextBlockTest extends AbstractRegressionTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public static String textb = \"\"\" \"\"\";\n" +
- " ^^^\n" +
- "Syntax error on token \"\" \"\", invalid AssignmentOperator\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public static String textb = \"\"\" \"\"\";\n" +
+ " ^^^\n" +
+ "Syntax error on token \"\" \"\", invalid AssignmentOperator\n" +
"----------\n");
}
public void test003() {
@@ -103,19 +103,19 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"X.java",
"public class X {\n" +
- " public static String textb = \"\"\"\n" +
+ " public static String textb = \"\"\"\n" +
"\";\n" +
" public static void main(String[] args) {\n" +
" System.out.println(textb);\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public static String textb = \"\"\"\n" +
- "\";\n" +
- " ^^^^^\n" +
- "Text block is not properly closed with the delimiter\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public static String textb = \"\"\"\n" +
+ "\";\n" +
+ " ^^^^^\n" +
+ "Text block is not properly closed with the delimiter\n" +
"----------\n");
}
public void test003a() {
@@ -123,19 +123,19 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"X.java",
"public class X {\n" +
- " public static String textb = \"\"\"\n" +
+ " public static String textb = \"\"\"\n" +
"\n" +
" public static void main(String[] args) {\n" +
" System.out.println(textb);\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public static String textb = \"\"\"\n" +
- "\n" +
- " ^^^^\n" +
- "Text block is not properly closed with the delimiter\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public static String textb = \"\"\"\n" +
+ "\n" +
+ " ^^^^\n" +
+ "Text block is not properly closed with the delimiter\n" +
"----------\n");
}
/*
@@ -146,20 +146,20 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"X.java",
"public class X {\n" +
- " public static String textb = \"\"\"\n" +
- "abc\\def" +
+ " public static String textb = \"\"\"\n" +
+ "abc\\def" +
"\"\"\";\n" +
" public static void main(String[] args) {\n" +
" System.out.println(textb);\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public static String textb = \"\"\"\n" +
- "abc\\def\"\"\";\n" +
- " ^^^^^^^^^\n" +
- "Invalid escape sequence (valid ones are \\b \\t \\n \\f \\r \\\" \\\' \\\\ )\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public static String textb = \"\"\"\n" +
+ "abc\\def\"\"\";\n" +
+ " ^^^^^^^^^\n" +
+ "Invalid escape sequence (valid ones are \\b \\t \\n \\f \\r \\\" \\\' \\\\ )\n" +
"----------\n");
}
/* empty text block */
@@ -168,7 +168,7 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"X.java",
"public class X {\n" +
- " public static String textb = \"\"\"\n" +
+ " public static String textb = \"\"\"\n" +
"\"\"\";\n" +
" public static void main(String[] args) {\n" +
" System.out.println(textb);\n" +
@@ -187,8 +187,8 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"X.java",
"public class X {\n" +
- " public static String textb = \"\"\"\n" +
- "abc\\\\def" +
+ " public static String textb = \"\"\"\n" +
+ "abc\\\\def" +
"\"\"\";\n" +
" public static void main(String[] args) {\n" +
" System.out.print(textb);\n" +
@@ -201,17 +201,17 @@ public class TextBlockTest extends AbstractRegressionTest {
}
/*
* Positive - Multi line text block with varying indentation
- * and \n
+ * and \n
*/
public void test007() {
runConformTest(
new String[] {
"X.java",
"public class X {\n" +
- " public static String textb = \"\"\"\n" +
- " line 1\n" +
- " line 2\n" +
- " \n" +
+ " public static String textb = \"\"\"\n" +
+ " line 1\n" +
+ " line 2\n" +
+ " \n" +
" line 3\"\"\";\n" +
" public static void main(String[] args) {\n" +
" System.out.print(textb);\n" +
@@ -219,9 +219,9 @@ public class TextBlockTest extends AbstractRegressionTest {
"}\n"
},
"line 1\n" + // test framework trims the leading whitespace
- " line 2\n" +
- "\n" +
- "line 3",
+ " line 2\n" +
+ "\n" +
+ "line 3",
null,
new String[] {"--enable-preview"});
}
@@ -234,19 +234,19 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"X.java",
"public class X {\n" +
- " public static String textb = \"\"\"\n" +
- " line 1\n" +
- " line 2\r" +
- " \r" +
+ " public static String textb = \"\"\"\n" +
+ " line 1\n" +
+ " line 2\r" +
+ " \r" +
" line 3\"\"\";\n" +
" public static void main(String[] args) {\n" +
" System.out.println(textb);\n" +
" }\n" +
"}\n"
},
- "line 1\n" +
- " line 2\n" +
- "\n" +
+ "line 1\n" +
+ " line 2\n" +
+ "\n" +
"line 3", // the trailing whitespace is trimmed by the test framework
null,
new String[] {"--enable-preview"});
@@ -260,10 +260,10 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"X.java",
"public class X {\n" +
- " public static String textb = \"\"\"\n" +
- " line 1\n" +
- " line 2\r" +
- " \r" +
+ " public static String textb = \"\"\"\n" +
+ " line 1\n" +
+ " line 2\r" +
+ " \r" +
" line 3\n\"\"\";\n" +
" public static void main(String[] args) {\n" +
" System.out.print(\"<\");\n" +
@@ -272,9 +272,9 @@ public class TextBlockTest extends AbstractRegressionTest {
" }\n" +
"}\n"
},
- "< line 1\n" +
- " line 2\n" +
- "\n" +
+ "< line 1\n" +
+ " line 2\n" +
+ "\n" +
" line 3\n" +
">", // the trailing whitespace is trimmed by the test framework
null,
@@ -288,8 +288,8 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"X.java",
"public class X {\n" +
- " public static String textb = \"\"\"\n" +
- "\"abc-def" +
+ " public static String textb = \"\"\"\n" +
+ "\"abc-def" +
"\"\"\";\n" +
" public static void main(String[] args) {\n" +
" System.out.println(textb);\n" +
@@ -308,7 +308,7 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"X.java",
"public class X {\n" +
- " public static String textb = \"\"\"\n" +
+ " public static String textb = \"\"\"\n" +
"\"abc-def\\\"\"\"\";\n" +
" public static void main(String[] args) {\n" +
" System.out.println(textb);\n" +
@@ -327,7 +327,7 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"X.java",
"public class X {\n" +
- " public static String textb = \"\"\"\n" +
+ " public static String textb = \"\"\"\n" +
"\"abc\\\"\"\"def\"\"\";\n" +
" public static void main(String[] args) {\n" +
" System.out.println(textb);\n" +
@@ -347,7 +347,7 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"X.java",
"public class X {\n" +
- " public static String textb = \"\"\"\n" +
+ " public static String textb = \"\"\"\n" +
"\\u0ba4\\u0bae\\u0bbf\\u0bb4\"\"\";\n" +
" public static String str = \"\\u0ba4\\u0bae\\u0bbf\\u0bb4\";\n" +
" public static void main(String[] args) {\n" +
@@ -367,18 +367,18 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"X.java",
"public class X {\n" +
- "static String code = \"\"\"\n" +
- " public void print(Object o) {\n" +
- " System.out.println(Objects.toString(o));\n" +
- " }\n" +
+ "static String code = \"\"\"\n" +
+ " public void print(Object o) {\n" +
+ " System.out.println(Objects.toString(o));\n" +
+ " }\n" +
" \"\"\";\n" +
" public static void main(String[] args) {\n" +
" System.out.print(code);\n" +
" }\n" +
"}\n"
},
- "public void print(Object o) {\n" +
- " System.out.println(Objects.toString(o));\n" +
+ "public void print(Object o) {\n" +
+ " System.out.println(Objects.toString(o));\n" +
"}",
null,
new String[] {"--enable-preview"});
@@ -391,18 +391,18 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"X.java",
"public class X {\n" +
- " static String code = \"public void print(Object o) {\\n\" +\n" +
- " \"\"\"\n" +
- " System.out.println(Objects.toString(o));\n" +
- " }\n" +
+ " static String code = \"public void print(Object o) {\\n\" +\n" +
+ " \"\"\"\n" +
+ " System.out.println(Objects.toString(o));\n" +
+ " }\n" +
" \"\"\";\n" +
" public static void main(String[] args) {\n" +
" System.out.print(code);\n" +
" }\n" +
"}\n"
},
- "public void print(Object o) {\n" +
- " System.out.println(Objects.toString(o));\n" +
+ "public void print(Object o) {\n" +
+ " System.out.println(Objects.toString(o));\n" +
"}",
null,
new String[] {"--enable-preview"});
@@ -415,25 +415,25 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"X.java",
"public class X {\n" +
- " static String story = \"\"\"\n" +
- " \"When I use a word,\" Humpty Dumpty said,\n" +
- " in rather a scornful tone, \"it means just what I\n" +
- " choose it to mean - neither more nor less.\"\n" +
- " \"The question is,\" said Alice, \"whether you\n" +
- " can make words mean so many different things.\"\n" +
- " \"The question is,\" said Humpty Dumpty,\n" +
+ " static String story = \"\"\"\n" +
+ " \"When I use a word,\" Humpty Dumpty said,\n" +
+ " in rather a scornful tone, \"it means just what I\n" +
+ " choose it to mean - neither more nor less.\"\n" +
+ " \"The question is,\" said Alice, \"whether you\n" +
+ " can make words mean so many different things.\"\n" +
+ " \"The question is,\" said Humpty Dumpty,\n" +
" \"which is to be master - that's all.\"\"\";\n" +
" public static void main(String[] args) {\n" +
" System.out.print(story);\n" +
" }\n" +
"}\n"
},
- "\"When I use a word,\" Humpty Dumpty said,\n" +
- "in rather a scornful tone, \"it means just what I\n" +
- "choose it to mean - neither more nor less.\"\n" +
- "\"The question is,\" said Alice, \"whether you\n" +
- "can make words mean so many different things.\"\n" +
- "\"The question is,\" said Humpty Dumpty,\n" +
+ "\"When I use a word,\" Humpty Dumpty said,\n" +
+ "in rather a scornful tone, \"it means just what I\n" +
+ "choose it to mean - neither more nor less.\"\n" +
+ "\"The question is,\" said Alice, \"whether you\n" +
+ "can make words mean so many different things.\"\n" +
+ "\"The question is,\" said Humpty Dumpty,\n" +
"\"which is to be master - that's all.",
null,
new String[] {"--enable-preview"});
@@ -446,21 +446,21 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"X.java",
"public class X {\n" +
- " static String html = \"\"\"\n" +
- " <html>\n" +
- " <body>\n" +
- " <p>Hello, world</p>\n" +
- " </body>\n" +
+ " static String html = \"\"\"\n" +
+ " <html>\n" +
+ " <body>\n" +
+ " <p>Hello, world</p>\n" +
+ " </body>\n" +
" </html>\"\"\";\n" +
" public static void main(String[] args) {\n" +
" System.out.print(html);\n" +
" }\n" +
"}\n"
},
- "<html>\n" +
- " <body>\n" +
- " <p>Hello, world</p>\n" +
- " </body>\n" +
+ "<html>\n" +
+ " <body>\n" +
+ " <p>Hello, world</p>\n" +
+ " </body>\n" +
"</html>",
null,
new String[] {"--enable-preview"});
@@ -473,22 +473,22 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"X.java",
"public class X {\n" +
- " static String html = \"\"\"\n" +
- " <html>\\r\\n" +
- " <body>\\r\\n" +
- " <p>Hello, world</p>\\r\\n" +
- " </body>\\r\\n" +
- " </html>\\r\\n" +
+ " static String html = \"\"\"\n" +
+ " <html>\\r\\n" +
+ " <body>\\r\\n" +
+ " <p>Hello, world</p>\\r\\n" +
+ " </body>\\r\\n" +
+ " </html>\\r\\n" +
" \"\"\";\n" +
" public static void main(String[] args) {\n" +
" System.out.println(html);\n" +
" }\n" +
"}\n"
},
- "<html>\n" +
- " <body>\n" +
- " <p>Hello, world</p>\n" +
- " </body>\n" +
+ "<html>\n" +
+ " <body>\n" +
+ " <p>Hello, world</p>\n" +
+ " </body>\n" +
" </html>",
null,
new String[] {"--enable-preview"});
@@ -501,22 +501,22 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"X.java",
"public class X {\n" +
- " static String html = \"\"\"\n" +
- " <html>\n" +
- " <body>\n" +
- " <p>Hello, world</p>\n" +
- " </body>\n" +
- " </html>\n" +
+ " static String html = \"\"\"\n" +
+ " <html>\n" +
+ " <body>\n" +
+ " <p>Hello, world</p>\n" +
+ " </body>\n" +
+ " </html>\n" +
" \"\"\";\n" +
" public static void main(String[] args) {\n" +
" System.out.println(html);\n" +
" }\n" +
"}\n"
},
- "<html>\n" +
- " <body>\n" +
- " <p>Hello, world</p>\n" +
- " </body>\n" +
+ "<html>\n" +
+ " <body>\n" +
+ " <p>Hello, world</p>\n" +
+ " </body>\n" +
"</html>",
null,
new String[] {"--enable-preview"});
@@ -529,22 +529,22 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"X.java",
"public class X {\n" +
- " static String html = \"\"\"\n" +
- " <html> \n" +
- " <body> \n" +
- " <p>Hello, world</p> \n" +
- " </body> \n" +
- " </html> \n" +
+ " static String html = \"\"\"\n" +
+ " <html> \n" +
+ " <body> \n" +
+ " <p>Hello, world</p> \n" +
+ " </body> \n" +
+ " </html> \n" +
" \"\"\";\n" +
" public static void main(String[] args) {\n" +
" System.out.println(html);\n" +
" }\n" +
"}\n"
},
- "<html>\n" +
- " <body>\n" +
- " <p>Hello, world</p>\n" +
- " </body>\n" +
+ "<html>\n" +
+ " <body>\n" +
+ " <p>Hello, world</p>\n" +
+ " </body>\n" +
"</html>",
null,
new String[] {"--enable-preview"});
@@ -557,21 +557,21 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"X.java",
"public class X {\n" +
- " static String html = \"\"\"\n" +
- " <html>\\040\\040\n" +
- " <body>\\040\\040\n" +
- " <p>Hello, world</p>\\040\\040\\040\n" +
- " </body>\\040\\040\n" +
+ " static String html = \"\"\"\n" +
+ " <html>\\040\\040\n" +
+ " <body>\\040\\040\n" +
+ " <p>Hello, world</p>\\040\\040\\040\n" +
+ " </body>\\040\\040\n" +
" </html>\"\"\";\n" +
" public static void main(String[] args) {\n" +
" System.out.print(html);\n" +
" }\n" +
"}\n"
},
- "<html> \n" +
- " <body> \n" +
- " <p>Hello, world</p> \n" +
- " </body> \n" +
+ "<html> \n" +
+ " <body> \n" +
+ " <p>Hello, world</p> \n" +
+ " </body> \n" +
"</html>",
null,
new String[] {"--enable-preview"});
@@ -585,20 +585,20 @@ public class TextBlockTest extends AbstractRegressionTest {
"X.java",
"public class X {\n" +
" public static void main(String[] args) {\n" +
- " System.out.println(\"\"\"\n" +
- " <html>\\n" +
- " <body>\\n" +
- " <p>Hello, world</p>\\n" +
- " </body>\\n" +
- " </html>\\n" +
+ " System.out.println(\"\"\"\n" +
+ " <html>\\n" +
+ " <body>\\n" +
+ " <p>Hello, world</p>\\n" +
+ " </body>\\n" +
+ " </html>\\n" +
" \"\"\");\n" +
" }\n" +
"}\n"
},
- "<html>\n" +
- " <body>\n" +
- " <p>Hello, world</p>\n" +
- " </body>\n" +
+ "<html>\n" +
+ " <body>\n" +
+ " <p>Hello, world</p>\n" +
+ " </body>\n" +
" </html>",
null,
new String[] {"--enable-preview"});
@@ -612,21 +612,21 @@ public class TextBlockTest extends AbstractRegressionTest {
"X.java",
"public class X {\n" +
" public static void main(String[] args) {\n" +
- " String html = \"\"\"\n" +
- " <html>\n" +
- " <body>\n" +
- " <p>Hello, world</p>\n" +
- " </body>\n" +
- " </html>\n" +
- " \"\"\";\n" +
+ " String html = \"\"\"\n" +
+ " <html>\n" +
+ " <body>\n" +
+ " <p>Hello, world</p>\n" +
+ " </body>\n" +
+ " </html>\n" +
+ " \"\"\";\n" +
" System.out.println(html);\n" +
" }\n" +
"}\n"
},
- "<html>\n" +
- " <body>\n" +
- " <p>Hello, world</p>\n" +
- " </body>\n" +
+ "<html>\n" +
+ " <body>\n" +
+ " <p>Hello, world</p>\n" +
+ " </body>\n" +
"</html>",
null,
new String[] {"--enable-preview"});
@@ -640,22 +640,22 @@ public class TextBlockTest extends AbstractRegressionTest {
"X.java",
"public class X {\n" +
" public static void main(String[] args) {\n" +
- " String html = \"\"\"\n" +
- " <html>\n" +
- " <body>\n" +
- " <p>Hello, world</p>\n" +
- " </body>\n" +
- " </html>\n" +
- " \"\"\";\n" +
- " String s = html;\n" +
+ " String html = \"\"\"\n" +
+ " <html>\n" +
+ " <body>\n" +
+ " <p>Hello, world</p>\n" +
+ " </body>\n" +
+ " </html>\n" +
+ " \"\"\";\n" +
+ " String s = html;\n" +
" System.out.println(s);\n" +
" }\n" +
"}\n"
},
- "<html>\n" +
- " <body>\n" +
- " <p>Hello, world</p>\n" +
- " </body>\n" +
+ "<html>\n" +
+ " <body>\n" +
+ " <p>Hello, world</p>\n" +
+ " </body>\n" +
"</html>",
null,
new String[] {"--enable-preview"});
@@ -664,38 +664,38 @@ public class TextBlockTest extends AbstractRegressionTest {
runConformTest(
new String[] {
"Main.java",
- "@SuppressWarnings(\"preview\")\n" +
- "public class Main {\n" +
- " public static void main(String[] args) {\n" +
- " runConformTest(\n" +
- " new String[] {\n" +
- " \"XYZ.java\",\n" +
- " \"\"\"\n" +
- " public class XYZ {\n" +
- " public static String textb = \\\"\"\"\n" +
- " abc\\\\\\\"\"\"def\" \n" +
- " \\\"\"\";\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(textb);\n" +
- " }\n" +
- " }\"\"\"" +
- " }, \n" +
- " \"\",\n" +
- " null,\n" +
- " new String[] {\"--enable-preview\"});\n" +
- " }\n" +
- " private static void runConformTest(String[] strings, String text, Object object, String[] strings2) {\n" +
- " System.out.println(strings[1]);\n" +
- " }\n" +
+ "@SuppressWarnings(\"preview\")\n" +
+ "public class Main {\n" +
+ " public static void main(String[] args) {\n" +
+ " runConformTest(\n" +
+ " new String[] {\n" +
+ " \"XYZ.java\",\n" +
+ " \"\"\"\n" +
+ " public class XYZ {\n" +
+ " public static String textb = \\\"\"\"\n" +
+ " abc\\\\\\\"\"\"def\" \n" +
+ " \\\"\"\";\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(textb);\n" +
+ " }\n" +
+ " }\"\"\"" +
+ " }, \n" +
+ " \"\",\n" +
+ " null,\n" +
+ " new String[] {\"--enable-preview\"});\n" +
+ " }\n" +
+ " private static void runConformTest(String[] strings, String text, Object object, String[] strings2) {\n" +
+ " System.out.println(strings[1]);\n" +
+ " }\n" +
"}"
- },
- "public class XYZ {\n" +
- " public static String textb = \"\"\"\n" +
- " abc\\\"\"\"def\"\n" +
- " \"\"\";\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(textb);\n" +
- " }\n" +
+ },
+ "public class XYZ {\n" +
+ " public static String textb = \"\"\"\n" +
+ " abc\\\"\"\"def\"\n" +
+ " \"\"\";\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(textb);\n" +
+ " }\n" +
"}",
null,
new String[] {"--enable-preview"});
@@ -704,64 +704,64 @@ public class TextBlockTest extends AbstractRegressionTest {
runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" public static String textb = \"\"\"\n" +
" abc\\def\"\"\";\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(textb);\n" +
- " }\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(textb);\n" +
+ " }\n" +
" }"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public static String textb = \"\"\"\n" +
- " abc\\def\"\"\";\n" +
- " ^^^^^^^^^^^^\n" +
- "Invalid escape sequence (valid ones are \\b \\t \\n \\f \\r \\\" \\\' \\\\ )\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public static String textb = \"\"\"\n" +
+ " abc\\def\"\"\";\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Invalid escape sequence (valid ones are \\b \\t \\n \\f \\r \\\" \\\' \\\\ )\n" +
"----------\n",
null,
true,
getCompilerOptions());
}
-
+
public void test027() {
runConformTest(
new String[] {
"X.java",
"public class X {\n" +
" public static void main (String[] args) {\n" +
- " String xyz = \n" +
- " \"\"\"\n" +
- " public class Switch {\n" +
- " public static void bar(int arg0) {\n" +
- " int arg1 = 0;\n" +
- " pointer: foo(\n" +
- " switch (0 + arg0) {\n" +
- " case 1 -> 1;\n" +
- " default -> {break p;}\\n\"\n" +
- " }\n" +
- " });\n" +
- " public static void foo(int arg0) {\n" +
- " bar(MyDay.SUNDAY);\n" +
- " }\n" +
- " }\\n\"\"\"; \n" +
+ " String xyz = \n" +
+ " \"\"\"\n" +
+ " public class Switch {\n" +
+ " public static void bar(int arg0) {\n" +
+ " int arg1 = 0;\n" +
+ " pointer: foo(\n" +
+ " switch (0 + arg0) {\n" +
+ " case 1 -> 1;\n" +
+ " default -> {break p;}\\n\"\n" +
+ " }\n" +
+ " });\n" +
+ " public static void foo(int arg0) {\n" +
+ " bar(MyDay.SUNDAY);\n" +
+ " }\n" +
+ " }\\n\"\"\"; \n" +
" System.out.println(xyz);\n" +
" }\n" +
"}"
- },
- "public class Switch {\n" +
- " public static void bar(int arg0) {\n" +
- " int arg1 = 0;\n" +
- " pointer: foo(\n" +
- " switch (0 + arg0) {\n" +
- " case 1 -> 1;\n" +
- " default -> {break p;}\n" +
- "\"\n" +
- " }\n" +
- " });\n" +
- " public static void foo(int arg0) {\n" +
- " bar(MyDay.SUNDAY);\n" +
- " }\n" +
+ },
+ "public class Switch {\n" +
+ " public static void bar(int arg0) {\n" +
+ " int arg1 = 0;\n" +
+ " pointer: foo(\n" +
+ " switch (0 + arg0) {\n" +
+ " case 1 -> 1;\n" +
+ " default -> {break p;}\n" +
+ "\"\n" +
+ " }\n" +
+ " });\n" +
+ " public static void foo(int arg0) {\n" +
+ " bar(MyDay.SUNDAY);\n" +
+ " }\n" +
" }",
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -773,13 +773,13 @@ public class TextBlockTest extends AbstractRegressionTest {
"X.java",
"public class X {\n" +
" public static void main (String[] args) {\n" +
- " String xyz = \n" +
- " \"\"\"\n" +
- " \\n\"\"\"; \n" +
+ " String xyz = \n" +
+ " \"\"\"\n" +
+ " \\n\"\"\"; \n" +
" System.out.println(xyz);\n" +
" }\n" +
"}"
- },
+ },
"",
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -790,16 +790,16 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"Cls2.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class Cls2 {\n" +
- " public static String str = \"\"\"\n" +
- " Hello Guru \n" +
- " \n" +
- " \"\"\";\n" +
+ "public class Cls2 {\n" +
+ " public static String str = \"\"\"\n" +
+ " Hello Guru \n" +
+ " \n" +
+ " \"\"\";\n" +
" public static void main (String[] args) {\n" +
" System.out.println(str);\n" +
" }\n" +
"}"
- },
+ },
"Hello Guru", // output comparison tool strips off all trailing whitespace
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -810,19 +810,19 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"X.java",
"public class X {\n" +
- " public static String textb = \"\"\"\n" +
+ " public static String textb = \"\"\"\n" +
"\"\"\";\n" +
" public static void main(String[] args) {\n" +
" System.out.println(textb);\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public static String textb = \"\"\"\n" +
- "\"\"\";\n" +
- " ^^^^^^^\n" +
- "Text Blocks is a preview feature and disabled by default. Use --enable-preview to enable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public static String textb = \"\"\"\n" +
+ "\"\"\";\n" +
+ " ^^^^^^^\n" +
+ "Text Blocks is a preview feature and disabled by default. Use --enable-preview to enable\n" +
"----------\n",
null,
true,
@@ -833,17 +833,17 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"Cls2.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class Cls2 {\n" +
- "static String text = \"\"\"\n" +
- " Lorem ipsum dolor sit amet, consectetur adipiscing \\\n" +
- " elit, sed do eiusmod tempor incididunt ut labore \\\n" +
- " et dolore magna aliqua.\\\n" +
- " \"\"\";\n" +
+ "public class Cls2 {\n" +
+ "static String text = \"\"\"\n" +
+ " Lorem ipsum dolor sit amet, consectetur adipiscing \\\n" +
+ " elit, sed do eiusmod tempor incididunt ut labore \\\n" +
+ " et dolore magna aliqua.\\\n" +
+ " \"\"\";\n" +
" public static void main (String[] args) {\n" +
" System.out.print(text);\n" +
" }\n" +
"}"
- },
+ },
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", // output comparison tool strips off all trailing whitespace
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -853,16 +853,16 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"Cls2.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class Cls2 {\n" +
- "static String noLastLF = \"\"\"\n" +
- " abc\n" +
- " def\\\n" +
- " ghi\"\"\";\n" +
+ "public class Cls2 {\n" +
+ "static String noLastLF = \"\"\"\n" +
+ " abc\n" +
+ " def\\\n" +
+ " ghi\"\"\";\n" +
" public static void main (String[] args) {\n" +
" System.out.print(noLastLF);\n" +
" }\n" +
"}"
- },
+ },
"abc\n defghi",
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -872,17 +872,17 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"Cls2.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class Cls2 {\n" +
- "static String python = \"\"\"\n" +
- " if x == True and \\\\\n" +
- " y == False\n" +
- " \"\"\";\n" +
+ "public class Cls2 {\n" +
+ "static String python = \"\"\"\n" +
+ " if x == True and \\\\\n" +
+ " y == False\n" +
+ " \"\"\";\n" +
" public static void main (String[] args) {\n" +
" System.out.print(python);\n" +
" }\n" +
"}"
- },
- "if x == True and \\\n" +
+ },
+ "if x == True and \\\n" +
" y == False",
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -892,17 +892,17 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"Cls2.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class Cls2 {\n" +
- "static String colors = \"\"\"\n" +
- " red \\\n" +
- " green \\\n" +
- " blue \\\n" +
- " orange\"\"\"; \n" +
+ "public class Cls2 {\n" +
+ "static String colors = \"\"\"\n" +
+ " red \\\n" +
+ " green \\\n" +
+ " blue \\\n" +
+ " orange\"\"\"; \n" +
" public static void main (String[] args) {\n" +
" System.out.print(colors);\n" +
" }\n" +
"}"
- },
+ },
"red green blue orange",
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -912,24 +912,24 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"Cls2.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class Cls2 {\n" +
- "static String colors = \"\"\"\n" +
- " \\red \n" +
- " \\green \n" +
- " \\blue \n" +
- " \\orange\"\"\"; \n" +
+ "public class Cls2 {\n" +
+ "static String colors = \"\"\"\n" +
+ " \\red \n" +
+ " \\green \n" +
+ " \\blue \n" +
+ " \\orange\"\"\"; \n" +
" public static void main (String[] args) {\n" +
" System.out.print(colors);\n" +
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in Cls2.java (at line 3)\n" +
- " static String colors = \"\"\"\n" +
- " \\red \n" +
- " \\green \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Invalid escape sequence (valid ones are \\b \\t \\n \\f \\r \\\" \\\' \\\\ )\n" +
+ "----------\n" +
+ "1. ERROR in Cls2.java (at line 3)\n" +
+ " static String colors = \"\"\"\n" +
+ " \\red \n" +
+ " \\green \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Invalid escape sequence (valid ones are \\b \\t \\n \\f \\r \\\" \\\' \\\\ )\n" +
"----------\n",
null,
true,
@@ -940,13 +940,13 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"Cls2.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class Cls2 {\n" +
- "static String str = \"A\\sline\\swith\\sspaces\";\n" +
+ "public class Cls2 {\n" +
+ "static String str = \"A\\sline\\swith\\sspaces\";\n" +
" public static void main (String[] args) {\n" +
" System.out.print(str);\n" +
" }\n" +
"}"
- },
+ },
"A line with spaces",
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -956,17 +956,17 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"Cls2.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class Cls2 {\n" +
- "static String colors = \"\"\"\n" +
- " red \\s\n" +
- " green\\s\n" +
- " blue \\s\n" +
- " \"\"\";\n" +
+ "public class Cls2 {\n" +
+ "static String colors = \"\"\"\n" +
+ " red \\s\n" +
+ " green\\s\n" +
+ " blue \\s\n" +
+ " \"\"\";\n" +
" public static void main (String[] args) {\n" +
" System.out.print(colors);\n" +
" }\n" +
"}"
- },
+ },
"red \ngreen \nblue", // trailing whitespaces are trimmed
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -976,22 +976,22 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"Cls2.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class Cls2 {\n" +
- "static String s = \"\"\"\n" +
- "aaa\n" +
- "\n" +
- "bbb\n" +
- "\n" +
- "\n" +
- "ccc" +
- "\"\"\";\n" +
+ "public class Cls2 {\n" +
+ "static String s = \"\"\"\n" +
+ "aaa\n" +
+ "\n" +
+ "bbb\n" +
+ "\n" +
+ "\n" +
+ "ccc" +
+ "\"\"\";\n" +
" public static void main (String[] args) {\n" +
" System.out.print(s);\n" +
" }\n" +
"}"
- },
- "aaa\n\n" +
- "bbb\n\n\n" +
+ },
+ "aaa\n\n" +
+ "bbb\n\n\n" +
"ccc",
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -1001,20 +1001,20 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"C.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class C {\n" +
- " public static void main(String argv[]) {\n" +
- " String textBlock = \"\"\"\n" +
- "\n" +
- " aa\"\"\";\n" +
- " System.out.print(compare(textBlock));\n" +
- " }\n" +
- " private static boolean compare(String textBlock) {\n" +
- " char LF = (char) 0x000A;\n" +
- " String str = \"\" + LF + \"aa\";\n" +
- " return textBlock.equals(str);\n" +
- " }\n" +
+ "public class C {\n" +
+ " public static void main(String argv[]) {\n" +
+ " String textBlock = \"\"\"\n" +
+ "\n" +
+ " aa\"\"\";\n" +
+ " System.out.print(compare(textBlock));\n" +
+ " }\n" +
+ " private static boolean compare(String textBlock) {\n" +
+ " char LF = (char) 0x000A;\n" +
+ " String str = \"\" + LF + \"aa\";\n" +
+ " return textBlock.equals(str);\n" +
+ " }\n" +
"}"
- },
+ },
"true",
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -1024,21 +1024,21 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"C.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class C {\n" +
- " public static void main(String argv[]) {\n" +
- " String textBlock = \"\"\"\n" +
- "\\n" +
- "\\n" +
- "\"\"\";\n" +
- " System.out.print(compare(textBlock));\n" +
- " }\n" +
- " private static boolean compare(String textBlock) {\n" +
- " char LF = (char) 0x000A;\n" +
- " String str = \"\" + LF + LF + \"\";\n" +
- " return textBlock.equals(str);\n" +
- " }\n" +
+ "public class C {\n" +
+ " public static void main(String argv[]) {\n" +
+ " String textBlock = \"\"\"\n" +
+ "\\n" +
+ "\\n" +
+ "\"\"\";\n" +
+ " System.out.print(compare(textBlock));\n" +
+ " }\n" +
+ " private static boolean compare(String textBlock) {\n" +
+ " char LF = (char) 0x000A;\n" +
+ " String str = \"\" + LF + LF + \"\";\n" +
+ " return textBlock.equals(str);\n" +
+ " }\n" +
"}"
- },
+ },
"true",
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -1048,21 +1048,21 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"C.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class C {\n" +
- " public static void main(String argv[]) {\n" +
- " String textBlock = \"\"\"\n" +
- "\n" +
- "\"\"\";\n" +
- " System.out.print(textBlock);\n" +
- " System.out.print(compare(textBlock));\n" +
- " }\n" +
- " private static boolean compare(String textBlock) {\n" +
- " char LF = (char) 0x000A;\n" +
- " String str = \"\" + '\\u0015' + LF + \"\";\n" +
- " return textBlock.equals(str.stripIndent());\n" +
- " }\n" +
+ "public class C {\n" +
+ " public static void main(String argv[]) {\n" +
+ " String textBlock = \"\"\"\n" +
+ "\n" +
+ "\"\"\";\n" +
+ " System.out.print(textBlock);\n" +
+ " System.out.print(compare(textBlock));\n" +
+ " }\n" +
+ " private static boolean compare(String textBlock) {\n" +
+ " char LF = (char) 0x000A;\n" +
+ " String str = \"\" + '\\u0015' + LF + \"\";\n" +
+ " return textBlock.equals(str.stripIndent());\n" +
+ " }\n" +
"}"
- },
+ },
"true",
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -1072,27 +1072,27 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"C.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class C {\n" +
- " public static void main(String argv[]) {\n" +
- " String textBlock = \"\"\"\n" +
- "v\r" +
- "\r" +
- "vaa\"\"\";\n" +
- " char[] cs = textBlock.toCharArray();\n" +
- " for (char c : cs) {\n" +
+ "public class C {\n" +
+ " public static void main(String argv[]) {\n" +
+ " String textBlock = \"\"\"\n" +
+ "v\r" +
+ "\r" +
+ "vaa\"\"\";\n" +
+ " char[] cs = textBlock.toCharArray();\n" +
+ " for (char c : cs) {\n" +
" //System.out.print((int)c);\n" +
- " //System.out.print(',');\n" +
- " }\n" +
+ " //System.out.print(',');\n" +
+ " }\n" +
" //System.out.println();\n" +
- " System.out.print(compare(textBlock));\n" +
- " }\n" +
- " private static boolean compare(String textBlock) {\n" +
- " char LF = (char) 0x000A;\n" +
+ " System.out.print(compare(textBlock));\n" +
+ " }\n" +
+ " private static boolean compare(String textBlock) {\n" +
+ " char LF = (char) 0x000A;\n" +
" String str = \"v\" + LF + LF + '\\u0076' + \"aa\";\n" +
- " return textBlock.equals(str.stripIndent());\n" +
- " }\n" +
+ " return textBlock.equals(str.stripIndent());\n" +
+ " }\n" +
"}"
- },
+ },
"true",
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -1102,21 +1102,21 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"C.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class C {\n" +
- " public static void main(String argv[]) {\n" +
- " String textBlock = \"\"\"\n" +
- "aa\f" +
- "\f" +
- "\"\"\";\n" +
- " System.out.print(compare(textBlock));\n" +
- " }\n" +
- " private static boolean compare(String textBlock) {\n" +
- " char LF = (char) 0x000A;\n" +
- " String str = \"aa\" + LF + LF + \"\";\n" +
- " return textBlock.equals(str);\n" +
- " }\n" +
+ "public class C {\n" +
+ " public static void main(String argv[]) {\n" +
+ " String textBlock = \"\"\"\n" +
+ "aa\f" +
+ "\f" +
+ "\"\"\";\n" +
+ " System.out.print(compare(textBlock));\n" +
+ " }\n" +
+ " private static boolean compare(String textBlock) {\n" +
+ " char LF = (char) 0x000A;\n" +
+ " String str = \"aa\" + LF + LF + \"\";\n" +
+ " return textBlock.equals(str);\n" +
+ " }\n" +
"}"
- },
+ },
"false",
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -1126,20 +1126,20 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"C.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class C {\n" +
- " public static void main(String argv[]) {\n" +
- " String textBlock = \"\"\"\n" +
- "\n" +
- "\"\"\";\n" +
- " System.out.print(compare(textBlock));\n" +
- " }\n" +
- " private static boolean compare(String textBlock) {\n" +
- " char LF = (char) 0x000A;\n" +
- " String str = \"\" + '\\u0015' + LF + \"\";\n" +
- " return textBlock.equals(str);\n" +
- " }\n" +
+ "public class C {\n" +
+ " public static void main(String argv[]) {\n" +
+ " String textBlock = \"\"\"\n" +
+ "\n" +
+ "\"\"\";\n" +
+ " System.out.print(compare(textBlock));\n" +
+ " }\n" +
+ " private static boolean compare(String textBlock) {\n" +
+ " char LF = (char) 0x000A;\n" +
+ " String str = \"\" + '\\u0015' + LF + \"\";\n" +
+ " return textBlock.equals(str);\n" +
+ " }\n" +
"}"
- },
+ },
"true",
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -1149,20 +1149,20 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"C.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class C {\n" +
- " public static void main(String argv[]) {\n" +
- " String textBlock = \"\"\"\n" +
- "aav\n" +
- "\"\"\";\n" +
- " System.out.print(compare(textBlock));\n" +
- " }\n" +
- " private static boolean compare(String textBlock) {\n" +
- " char LF = (char) 0x000A;\n" +
- " String str = \"aa\" + '\\u0076' + LF + \"\";\n" +
- " return textBlock.equals(str.stripIndent());\n" +
- " }\n" +
+ "public class C {\n" +
+ " public static void main(String argv[]) {\n" +
+ " String textBlock = \"\"\"\n" +
+ "aav\n" +
+ "\"\"\";\n" +
+ " System.out.print(compare(textBlock));\n" +
+ " }\n" +
+ " private static boolean compare(String textBlock) {\n" +
+ " char LF = (char) 0x000A;\n" +
+ " String str = \"aa\" + '\\u0076' + LF + \"\";\n" +
+ " return textBlock.equals(str.stripIndent());\n" +
+ " }\n" +
"}"
- },
+ },
"true",
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -1172,14 +1172,14 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"C.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class C {\n" +
- " public static void main(String argv[]) {\n" +
- " String textBlock = \"\"\"\n" +
- "\\\"some\\\"\\n \\\"string\\\" \\n \\\"here\\\"\\n\"\"\";\n" +
- " System.out.print(textBlock.length());\n" +
- " }\n" +
+ "public class C {\n" +
+ " public static void main(String argv[]) {\n" +
+ " String textBlock = \"\"\"\n" +
+ "\\\"some\\\"\\n \\\"string\\\" \\n \\\"here\\\"\\n\"\"\";\n" +
+ " System.out.print(textBlock.length());\n" +
+ " }\n" +
"}"
- },
+ },
"26",
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -1190,14 +1190,14 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"C.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class C {\n" +
- " public static void main(String argv[]) {\n" +
- " String textBlock = \"\"\"\n" +
- "some string ends with \\\"\"\"\\n\"\"\";\n" +
- " System.out.print(textBlock.length());\n" +
- " }\n" +
+ "public class C {\n" +
+ " public static void main(String argv[]) {\n" +
+ " String textBlock = \"\"\"\n" +
+ "some string ends with \\\"\"\"\\n\"\"\";\n" +
+ " System.out.print(textBlock.length());\n" +
+ " }\n" +
"}"
- },
+ },
"26",
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -1208,14 +1208,14 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"C.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class C {\n" +
- " public static void main(String argv[]) {\n" +
- " String textBlock = \"\"\"\n" +
- "some string ends with \"\\\"\"\\n\"\"\";\n" +
- " System.out.print(textBlock.length());\n" +
- " }\n" +
+ "public class C {\n" +
+ " public static void main(String argv[]) {\n" +
+ " String textBlock = \"\"\"\n" +
+ "some string ends with \"\\\"\"\\n\"\"\";\n" +
+ " System.out.print(textBlock.length());\n" +
+ " }\n" +
"}"
- },
+ },
"26",
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -1226,14 +1226,14 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"C.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class C {\n" +
- " public static void main(String argv[]) {\n" +
- " String textBlock = \"\"\"\n" +
- "some string ends with \"\"\\\"\\n\"\"\";\n" +
- " System.out.print(textBlock.length());\n" +
- " }\n" +
+ "public class C {\n" +
+ " public static void main(String argv[]) {\n" +
+ " String textBlock = \"\"\"\n" +
+ "some string ends with \"\"\\\"\\n\"\"\";\n" +
+ " System.out.print(textBlock.length());\n" +
+ " }\n" +
"}"
- },
+ },
"26",
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -1243,20 +1243,20 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"C.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class C {\n" +
- " public static void main(String argv[]) {\n" +
- " String textBlock = \"\"\"\n" +
- "\r\n" +
- " aa\"\"\";\n" +
- " System.out.print(compare(textBlock));\n" +
- " }\n" +
- " private static boolean compare(String textBlock) {\n" +
- " char LF = (char) 0x000A;\n" +
- " String str = \"\" + LF + \"aa\";\n" +
- " return textBlock.equals(str);\n" +
- " }\n" +
+ "public class C {\n" +
+ " public static void main(String argv[]) {\n" +
+ " String textBlock = \"\"\"\n" +
+ "\r\n" +
+ " aa\"\"\";\n" +
+ " System.out.print(compare(textBlock));\n" +
+ " }\n" +
+ " private static boolean compare(String textBlock) {\n" +
+ " char LF = (char) 0x000A;\n" +
+ " String str = \"\" + LF + \"aa\";\n" +
+ " return textBlock.equals(str);\n" +
+ " }\n" +
"}"
- },
+ },
"true",
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -1266,19 +1266,19 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"C.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class C {\n" +
- " public static void main(String argv[]) {\n" +
- " String textb = \"\"\"\n" +
- "\\0\\1\\2\\3\\4\\5\\6\\7\\10\\11\\12\\13\\14\\15\\16\\17\\20\\21\\22\\23\\24\\25\\26\\27\\30\\31\\32\\33\\34\\35\\36\\37\\40\\41\\42\\43\\44\\45\\46\\47\\50\\51\\52\\53\\54\\55\\56\\57\\60\\61\\62\\63\\64\\65\\66\\67\\70\\71\\72\\73\\74\\75\\76\\77\\100\\101\\102\\103\\104\\105\\106\\107\\110\\111\\112\\113\\114\\115\\116\\117\\120\\121\\122\\123\\124\\125\\126\\127\\130\\131\\132\\133\\134\\135\\136\\137\\140\\141\\142\\143\\144\\145\\146\\147\\150\\151\\152\\153\\154\\155\\156\\157\\160\\161\\162\\163\\164\\165\\166\\167\\170\\171\\172\\173\\174\\175\\176\\177\\200\\201\\202\\203\\204\\205\\206\\207\\210\\211\\212\\213\\214\\215\\216\\217\\220\\221\\222\\223\\224\\225\\226\\227\\230\\231\\232\\233\\234\\235\\236\\237\\240\\241\\242\\243\\244\\245\\246\\247\\250\\251\\252\\253\\254\\255\\256\\257\\260\\261\\262\\263\\264\\265\\266\\267\\270\\271\\272\\273\\274\\275\\276\\277\\300\\301\\302\\303\\304\\305\\306\\307\\310\\311\\312\\313\\314\\315\\316\\317\\320\\321\\322\\323\\324\\325\\326\\327\\330\\331\\332\\333\\334\\335\\336\\337\\340\\341\\342\\343\\344\\345\\346\\347\\350\\351\\352\\353\\354\\355\\356\\357\\360\\361\\362\\363\\364\\365\\366\\367\\370\\371\\372\\373\\374\\375\\376\\377\"\"\";\n" +
- " System.out.println(textb.length());\n" +
- " for (int i=0; i<=0xFF; i++) {\n" +
- " if (i != (int)textb.charAt(i)) {\n" +
- " System.out.println(\"Error in octal escape :\" + i);\n" +
- " }\n" +
+ "public class C {\n" +
+ " public static void main(String argv[]) {\n" +
+ " String textb = \"\"\"\n" +
+ "\\0\\1\\2\\3\\4\\5\\6\\7\\10\\11\\12\\13\\14\\15\\16\\17\\20\\21\\22\\23\\24\\25\\26\\27\\30\\31\\32\\33\\34\\35\\36\\37\\40\\41\\42\\43\\44\\45\\46\\47\\50\\51\\52\\53\\54\\55\\56\\57\\60\\61\\62\\63\\64\\65\\66\\67\\70\\71\\72\\73\\74\\75\\76\\77\\100\\101\\102\\103\\104\\105\\106\\107\\110\\111\\112\\113\\114\\115\\116\\117\\120\\121\\122\\123\\124\\125\\126\\127\\130\\131\\132\\133\\134\\135\\136\\137\\140\\141\\142\\143\\144\\145\\146\\147\\150\\151\\152\\153\\154\\155\\156\\157\\160\\161\\162\\163\\164\\165\\166\\167\\170\\171\\172\\173\\174\\175\\176\\177\\200\\201\\202\\203\\204\\205\\206\\207\\210\\211\\212\\213\\214\\215\\216\\217\\220\\221\\222\\223\\224\\225\\226\\227\\230\\231\\232\\233\\234\\235\\236\\237\\240\\241\\242\\243\\244\\245\\246\\247\\250\\251\\252\\253\\254\\255\\256\\257\\260\\261\\262\\263\\264\\265\\266\\267\\270\\271\\272\\273\\274\\275\\276\\277\\300\\301\\302\\303\\304\\305\\306\\307\\310\\311\\312\\313\\314\\315\\316\\317\\320\\321\\322\\323\\324\\325\\326\\327\\330\\331\\332\\333\\334\\335\\336\\337\\340\\341\\342\\343\\344\\345\\346\\347\\350\\351\\352\\353\\354\\355\\356\\357\\360\\361\\362\\363\\364\\365\\366\\367\\370\\371\\372\\373\\374\\375\\376\\377\"\"\";\n" +
+ " System.out.println(textb.length());\n" +
+ " for (int i=0; i<=0xFF; i++) {\n" +
+ " if (i != (int)textb.charAt(i)) {\n" +
+ " System.out.println(\"Error in octal escape :\" + i);\n" +
+ " }\n" +
" }\n" +
- " }\n" +
+ " }\n" +
"}"
- },
+ },
"256",
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -1288,22 +1288,22 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"C.java",
"@SuppressWarnings(\"preview\")\n" +
- "public class C {\n" +
- " public static void main(String argv[]) {\n" +
- " String textBlock = \"\"\"\r\n" +
- " This is a multi-line\n" +
- " message that is super-\n" +
- " exciting!\"\"\";\n" +
- " System.out.print(compare(textBlock));\n" +
- " }\n" +
- " private static boolean compare(String textBlock) {\n" +
- " String str = \"This is a multi-line\\n\" + \n" +
- " \"message that is super-\\n\" + \n" +
- " \"exciting!\";\n" +
- " return textBlock.equals(str);\n" +
- " }\n" +
+ "public class C {\n" +
+ " public static void main(String argv[]) {\n" +
+ " String textBlock = \"\"\"\r\n" +
+ " This is a multi-line\n" +
+ " message that is super-\n" +
+ " exciting!\"\"\";\n" +
+ " System.out.print(compare(textBlock));\n" +
+ " }\n" +
+ " private static boolean compare(String textBlock) {\n" +
+ " String str = \"This is a multi-line\\n\" + \n" +
+ " \"message that is super-\\n\" + \n" +
+ " \"exciting!\";\n" +
+ " return textBlock.equals(str);\n" +
+ " }\n" +
"}"
- },
+ },
"true",
getCompilerOptions(),
new String[] {"--enable-preview"});
@@ -1320,18 +1320,18 @@ public class TextBlockTest extends AbstractRegressionTest {
new String[] {
"X.java",
"public class X {\n" +
- " public static String textb = \"\"\"\n" +
+ " public static String textb = \"\"\"\n" +
"\"\"\";\n" +
" public static void main(String[] args) {\n" +
" System.out.println(textb);\n" +
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 0)\n" +
- " public class X {\n" +
- " ^\n" +
- "Preview features enabled at an invalid source release level 13, preview can be enabled only at source level 14\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 0)\n" +
+ " public class X {\n" +
+ " ^\n" +
+ "Preview features enabled at an invalid source release level 13, preview can be enabled only at source level 14\n" +
"----------\n",
null,
true,
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatement17Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatement17Test.java
index 7e3a22a96..ffad02ae8 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatement17Test.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatement17Test.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Jesper Steen Moller - bug 404146 nested try-catch-finally-blocks leads to unrunnable Java byte code
@@ -35,151 +35,151 @@ public void test001() {
this.runNegativeTest(
new String[] {
"X.java",
- "import java.io.*;\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " System.out.println();\n" +
- " Reader r = new FileReader(args[0]);\n" +
- " r.read();\n" +
- " } catch(IOException | FileNotFoundException e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
+ " System.out.println();\n" +
+ " Reader r = new FileReader(args[0]);\n" +
+ " r.read();\n" +
+ " } catch(IOException | FileNotFoundException e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " } catch(IOException | FileNotFoundException e) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The exception FileNotFoundException is already caught by the alternative IOException\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " } catch(IOException | FileNotFoundException e) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The exception FileNotFoundException is already caught by the alternative IOException\n" +
"----------\n");
}
public void test002() {
this.runNegativeTest(
new String[] {
"X.java",
- "import java.io.*;\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " System.out.println();\n" +
- " Reader r = new FileReader(args[0]);\n" +
- " r.read();\n" +
- " } catch(FileNotFoundException | FileNotFoundException | IOException e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
+ " System.out.println();\n" +
+ " Reader r = new FileReader(args[0]);\n" +
+ " r.read();\n" +
+ " } catch(FileNotFoundException | FileNotFoundException | IOException e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " } catch(FileNotFoundException | FileNotFoundException | IOException e) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The exception FileNotFoundException is already caught by the alternative FileNotFoundException\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " } catch(FileNotFoundException | FileNotFoundException | IOException e) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The exception FileNotFoundException is already caught by the alternative IOException\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " } catch(FileNotFoundException | FileNotFoundException | IOException e) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The exception FileNotFoundException is already caught by the alternative IOException\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " } catch(FileNotFoundException | FileNotFoundException | IOException e) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The exception FileNotFoundException is already caught by the alternative FileNotFoundException\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " } catch(FileNotFoundException | FileNotFoundException | IOException e) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The exception FileNotFoundException is already caught by the alternative IOException\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 9)\n" +
+ " } catch(FileNotFoundException | FileNotFoundException | IOException e) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The exception FileNotFoundException is already caught by the alternative IOException\n" +
"----------\n");
}
public void test003() {
this.runNegativeTest(
new String[] {
"X.java",
- "import java.io.*;\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " System.out.println();\n" +
- " Reader r = new FileReader(args[0]);\n" +
- " r.read();\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
+ " System.out.println();\n" +
+ " Reader r = new FileReader(args[0]);\n" +
+ " r.read();\n" +
" } catch(FileNotFoundException e) {" +
- " e.printStackTrace();\n" +
- " } catch(FileNotFoundException | IOException e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ " e.printStackTrace();\n" +
+ " } catch(FileNotFoundException | IOException e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " } catch(FileNotFoundException | IOException e) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The exception FileNotFoundException is already caught by the alternative IOException\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " } catch(FileNotFoundException | IOException e) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The exception FileNotFoundException is already caught by the alternative IOException\n" +
"----------\n");
}
public void test004() {
this.runNegativeTest(
new String[] {
"X.java",
- "import java.io.*;\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " System.out.println();\n" +
- " Reader r = new FileReader(args[0]);\n" +
- " r.read();\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
+ " System.out.println();\n" +
+ " Reader r = new FileReader(args[0]);\n" +
+ " r.read();\n" +
" } catch(RuntimeException | Exception e) {" +
- " e.printStackTrace();\n" +
- " } catch(FileNotFoundException | IOException e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ " e.printStackTrace();\n" +
+ " } catch(FileNotFoundException | IOException e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " } catch(RuntimeException | Exception e) { e.printStackTrace();\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The exception RuntimeException is already caught by the alternative Exception\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " } catch(FileNotFoundException | IOException e) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The exception FileNotFoundException is already caught by the alternative IOException\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " } catch(RuntimeException | Exception e) { e.printStackTrace();\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The exception RuntimeException is already caught by the alternative Exception\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " } catch(FileNotFoundException | IOException e) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The exception FileNotFoundException is already caught by the alternative IOException\n" +
"----------\n");
}
public void test005() {
this.runNegativeTest(
new String[] {
"X.java",
- "import java.io.*;\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " System.out.println();\n" +
- " Reader r = new FileReader(\"Zork\");\n" +
- " r.read();\n" +
- " } catch(NumberFormatException | RuntimeException e) {\n" +
- " e.printStackTrace();\n" +
- " } catch(FileNotFoundException | IOException e) {\n" +
- " // ignore\n" +
- " }\n" +
- " }\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
+ " System.out.println();\n" +
+ " Reader r = new FileReader(\"Zork\");\n" +
+ " r.read();\n" +
+ " } catch(NumberFormatException | RuntimeException e) {\n" +
+ " e.printStackTrace();\n" +
+ " } catch(FileNotFoundException | IOException e) {\n" +
+ " // ignore\n" +
+ " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " } catch(NumberFormatException | RuntimeException e) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The exception NumberFormatException is already caught by the alternative RuntimeException\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " } catch(FileNotFoundException | IOException e) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The exception FileNotFoundException is already caught by the alternative IOException\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " } catch(NumberFormatException | RuntimeException e) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The exception NumberFormatException is already caught by the alternative RuntimeException\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 11)\n" +
+ " } catch(FileNotFoundException | IOException e) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The exception FileNotFoundException is already caught by the alternative IOException\n" +
"----------\n");
}
//Test that lub is not used for checking for checking the exceptions
@@ -189,38 +189,38 @@ public void test006() {
"X.java",
"public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
" throw new Foo();\n"+
" } catch(SonOfFoo | DaughterOfFoo e) {\n" +
" e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}\n" +
"class Foo extends Exception {}\n"+
"class SonOfFoo extends Foo {}\n"+
"class DaughterOfFoo extends Foo {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " throw new Foo();\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type Foo\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " class Foo extends Exception {}\n" +
- " ^^^\n" +
- "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 11)\n" +
- " class SonOfFoo extends Foo {}\n" +
- " ^^^^^^^^\n" +
- "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 12)\n" +
- " class DaughterOfFoo extends Foo {}\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " throw new Foo();\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type Foo\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " class Foo extends Exception {}\n" +
+ " ^^^\n" +
+ "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 11)\n" +
+ " class SonOfFoo extends Foo {}\n" +
+ " ^^^^^^^^\n" +
+ "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 12)\n" +
+ " class DaughterOfFoo extends Foo {}\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
"----------\n");
}
public void test007() {
@@ -229,20 +229,20 @@ public void test007() {
"X.java",
"public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
" throw new Foo();\n"+
" } catch(SonOfFoo | DaughterOfFoo e) {\n" +
" System.out.println(\"Caught lub\");\n" +
" } catch(Foo e) {\n" +
- " System.out.println(\"Caught Foo\");\n" +
+ " System.out.println(\"Caught Foo\");\n" +
" }\n" +
- " }\n" +
+ " }\n" +
"}\n" +
"class Foo extends Exception {}\n"+
"class SonOfFoo extends Foo {}\n"+
"class DaughterOfFoo extends Foo {}\n"
- },
+ },
"Caught Foo");
}
// test that lub is not used for precise rethrow
@@ -251,59 +251,59 @@ public void test008() {
new String[] {
"X.java",
"public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
" if (args.length == 0) throw new SonOfFoo();\n"+
" throw new DaughterOfFoo();\n" +
" } catch(SonOfFoo | DaughterOfFoo e) {\n" +
" try {\n" +
" throw e;\n" +
" } catch(SonOfFoo | DaughterOfFoo e1) {}\n"+
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}\n" +
"class Foo extends Exception {}\n"+
"class SonOfFoo extends Foo {}\n"+
"class DaughterOfFoo extends Foo {}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 13)\n" +
- " class Foo extends Exception {}\n" +
- " ^^^\n" +
- "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 14)\n" +
- " class SonOfFoo extends Foo {}\n" +
- " ^^^^^^^^\n" +
- "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 15)\n" +
- " class DaughterOfFoo extends Foo {}\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 13)\n" +
+ " class Foo extends Exception {}\n" +
+ " ^^^\n" +
+ "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 14)\n" +
+ " class SonOfFoo extends Foo {}\n" +
+ " ^^^^^^^^\n" +
+ "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 15)\n" +
+ " class DaughterOfFoo extends Foo {}\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
"----------\n");
}
public void test009() {
this.runNegativeTest(
new String[] {
"X.java",
- "import java.io.*;\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
+ "import java.io.*;\n" +
+ "\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
" try {\n" +
" throw new IOException();\n" +
- " } catch(IOException | RuntimeException e) {\n" +
+ " } catch(IOException | RuntimeException e) {\n" +
" e = new IOException();\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " e = new IOException();\n" +
- " ^\n" +
- "The parameter e of a multi-catch block cannot be assigned\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " e = new IOException();\n" +
+ " ^\n" +
+ "The parameter e of a multi-catch block cannot be assigned\n" +
"----------\n");
}
//Test that union type checks are done for a precise throw too
@@ -313,38 +313,38 @@ public void test010() {
"X.java",
"public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
" throw new DaughterOfFoo();\n"+
" } catch(SonOfFoo | DaughterOfFoo e) {\n" +
" e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}\n" +
"class Foo extends Exception {}\n"+
"class SonOfFoo extends Foo {}\n"+
"class DaughterOfFoo extends Foo {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " } catch(SonOfFoo | DaughterOfFoo e) {\n" +
- " ^^^^^^^^\n" +
- "Unreachable catch block for SonOfFoo. This exception is never thrown from the try statement body\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " class Foo extends Exception {}\n" +
- " ^^^\n" +
- "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 11)\n" +
- " class SonOfFoo extends Foo {}\n" +
- " ^^^^^^^^\n" +
- "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 12)\n" +
- " class DaughterOfFoo extends Foo {}\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " } catch(SonOfFoo | DaughterOfFoo e) {\n" +
+ " ^^^^^^^^\n" +
+ "Unreachable catch block for SonOfFoo. This exception is never thrown from the try statement body\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 10)\n" +
+ " class Foo extends Exception {}\n" +
+ " ^^^\n" +
+ "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 11)\n" +
+ " class SonOfFoo extends Foo {}\n" +
+ " ^^^^^^^^\n" +
+ "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 12)\n" +
+ " class DaughterOfFoo extends Foo {}\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
"----------\n");
}
// Test that a rethrow is precisely computed
@@ -353,42 +353,42 @@ public void test011() {
new String[] {
"X.java",
"public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
" throw new DaughterOfFoo();\n"+
- " } catch(Foo e) {\n" +
+ " } catch(Foo e) {\n" +
" try {\n" +
" throw e;\n" +
" } catch (SonOfFoo e1) {\n" +
" e1.printStackTrace();\n" +
" } catch (Foo e1) {}\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"+
"class Foo extends Exception {}\n"+
"class SonOfFoo extends Foo {}\n"+
"class DaughterOfFoo extends Foo {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " } catch (SonOfFoo e1) {\n" +
- " ^^^^^^^^\n" +
- "Unreachable catch block for SonOfFoo. This exception is never thrown from the try statement body\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 14)\n" +
- " class Foo extends Exception {}\n" +
- " ^^^\n" +
- "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 15)\n" +
- " class SonOfFoo extends Foo {}\n" +
- " ^^^^^^^^\n" +
- "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 16)\n" +
- " class DaughterOfFoo extends Foo {}\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " } catch (SonOfFoo e1) {\n" +
+ " ^^^^^^^^\n" +
+ "Unreachable catch block for SonOfFoo. This exception is never thrown from the try statement body\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 14)\n" +
+ " class Foo extends Exception {}\n" +
+ " ^^^\n" +
+ "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 15)\n" +
+ " class SonOfFoo extends Foo {}\n" +
+ " ^^^^^^^^\n" +
+ "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 16)\n" +
+ " class DaughterOfFoo extends Foo {}\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
"----------\n");
}
//Test that a rethrow is precisely computed
@@ -397,10 +397,10 @@ public void test012() {
new String[] {
"X.java",
"public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
" throw new DaughterOfFoo();\n"+
- " } catch(Foo e) {\n" +
+ " } catch(Foo e) {\n" +
" try {\n" +
" throw e;\n" +
" } catch (SonOfFoo e1) {\n" +
@@ -408,74 +408,74 @@ public void test012() {
" } catch (Foo e1) {}\n" +
" finally {" +
" System.out.println(\"\");}\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"+
"class Foo extends Exception {}\n"+
"class SonOfFoo extends Foo {}\n"+
"class DaughterOfFoo extends Foo {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " } catch (SonOfFoo e1) {\n" +
- " ^^^^^^^^\n" +
- "Unreachable catch block for SonOfFoo. This exception is never thrown from the try statement body\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 15)\n" +
- " class Foo extends Exception {}\n" +
- " ^^^\n" +
- "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 16)\n" +
- " class SonOfFoo extends Foo {}\n" +
- " ^^^^^^^^\n" +
- "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 17)\n" +
- " class DaughterOfFoo extends Foo {}\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " } catch (SonOfFoo e1) {\n" +
+ " ^^^^^^^^\n" +
+ "Unreachable catch block for SonOfFoo. This exception is never thrown from the try statement body\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 15)\n" +
+ " class Foo extends Exception {}\n" +
+ " ^^^\n" +
+ "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 16)\n" +
+ " class SonOfFoo extends Foo {}\n" +
+ " ^^^^^^^^\n" +
+ "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 17)\n" +
+ " class DaughterOfFoo extends Foo {}\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
"----------\n");
}
-// Test that if the rethrow argument is modified (not effectively final), then it is not precisely
+// Test that if the rethrow argument is modified (not effectively final), then it is not precisely
// computed
public void test013() {
this.runNegativeTest(
new String[] {
"X.java",
"public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
" throw new DaughterOfFoo();\n"+
- " } catch(Foo e) {\n" +
+ " } catch(Foo e) {\n" +
" try {\n" +
" e = new Foo();\n" +
" throw e;\n" +
" } catch (SonOfFoo e1) {\n" +
" e1.printStackTrace();\n" +
" } catch (Foo e1) {}\n"+
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"+
"class Foo extends Exception {}\n"+
"class SonOfFoo extends Foo {}\n"+
"class DaughterOfFoo extends Foo {}\n"
},
"----------\n" +
- "1. WARNING in X.java (at line 15)\n" +
- " class Foo extends Exception {}\n" +
- " ^^^\n" +
- "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 16)\n" +
- " class SonOfFoo extends Foo {}\n" +
- " ^^^^^^^^\n" +
- "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 17)\n" +
- " class DaughterOfFoo extends Foo {}\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "1. WARNING in X.java (at line 15)\n" +
+ " class Foo extends Exception {}\n" +
+ " ^^^\n" +
+ "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 16)\n" +
+ " class SonOfFoo extends Foo {}\n" +
+ " ^^^^^^^^\n" +
+ "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 17)\n" +
+ " class DaughterOfFoo extends Foo {}\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
"----------\n");
}
@@ -486,10 +486,10 @@ public void test014() {
new String[] {
"X.java",
"public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
" throw new DaughterOfFoo();\n"+
- " } catch(Foo e) {\n" +
+ " } catch(Foo e) {\n" +
" try {\n" +
" boolean DEBUG = true;\n" +
" if (DEBUG) {\n" +
@@ -500,28 +500,28 @@ public void test014() {
" } catch (SonOfFoo e1) {\n" +
" e1.printStackTrace();\n" +
" } catch (Foo e1) {}\n"+
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"+
"class Foo extends Exception {}\n"+
"class SonOfFoo extends Foo {}\n"+
"class DaughterOfFoo extends Foo {}\n"
},
"----------\n" +
- "1. WARNING in X.java (at line 18)\n" +
- " class Foo extends Exception {}\n" +
- " ^^^\n" +
- "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 19)\n" +
- " class SonOfFoo extends Foo {}\n" +
- " ^^^^^^^^\n" +
- "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 20)\n" +
- " class DaughterOfFoo extends Foo {}\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "1. WARNING in X.java (at line 18)\n" +
+ " class Foo extends Exception {}\n" +
+ " ^^^\n" +
+ "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 19)\n" +
+ " class SonOfFoo extends Foo {}\n" +
+ " ^^^^^^^^\n" +
+ "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 20)\n" +
+ " class DaughterOfFoo extends Foo {}\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
"----------\n");
}
@@ -533,46 +533,46 @@ public void test016() {
new String[] {
"X.java",
"public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
" throw new DaughterOfFoo();\n"+
- " } catch(Foo e) {\n" +
+ " } catch(Foo e) {\n" +
" try {\n" +
" throw new Foo();\n" +
" } catch (Foo e1) {\n" +
" try {\n" +
- " throw e;\n" +
+ " throw e;\n" +
" } catch (SonOfFoo e2) {\n" +
" e1.printStackTrace();\n" +
" } catch (Foo e3) {}\n" +
" }\n" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}\n"+
"class Foo extends Exception {}\n"+
"class SonOfFoo extends Foo {}\n"+
"class DaughterOfFoo extends Foo {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " } catch (SonOfFoo e2) {\n" +
- " ^^^^^^^^\n" +
- "Unreachable catch block for SonOfFoo. This exception is never thrown from the try statement body\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 18)\n" +
- " class Foo extends Exception {}\n" +
- " ^^^\n" +
- "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 19)\n" +
- " class SonOfFoo extends Foo {}\n" +
- " ^^^^^^^^\n" +
- "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 20)\n" +
- " class DaughterOfFoo extends Foo {}\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " } catch (SonOfFoo e2) {\n" +
+ " ^^^^^^^^\n" +
+ "Unreachable catch block for SonOfFoo. This exception is never thrown from the try statement body\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 18)\n" +
+ " class Foo extends Exception {}\n" +
+ " ^^^\n" +
+ "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 19)\n" +
+ " class SonOfFoo extends Foo {}\n" +
+ " ^^^^^^^^\n" +
+ "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 20)\n" +
+ " class DaughterOfFoo extends Foo {}\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
"----------\n");
}
// Test lub computation.
@@ -613,46 +613,46 @@ public void test017() {
"}\n" +
"class GrandDaughterOfFoo extends DaughterOfFoo {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " SonOfFoo s = e;\n" +
- " ^\n" +
- "Type mismatch: cannot convert from Foo to SonOfFoo\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " e.callableOnlyOnMales();\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The method callableOnlyOnMales() is undefined for the type Foo\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 15)\n" +
- " e.callableOnlyOnFemales();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The method callableOnlyOnFemales() is undefined for the type Foo\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 19)\n" +
- " class Foo extends Exception {\n" +
- " ^^^\n" +
- "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 23)\n" +
- " class SonOfFoo extends Foo {\n" +
- " ^^^^^^^^\n" +
- "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 27)\n" +
- " class GrandSonOfFoo extends SonOfFoo {}\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class GrandSonOfFoo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 28)\n" +
- " class DaughterOfFoo extends Foo {\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 32)\n" +
- " class GrandDaughterOfFoo extends DaughterOfFoo {}\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The serializable class GrandDaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 12)\n" +
+ " SonOfFoo s = e;\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from Foo to SonOfFoo\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " e.callableOnlyOnMales();\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "The method callableOnlyOnMales() is undefined for the type Foo\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 15)\n" +
+ " e.callableOnlyOnFemales();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The method callableOnlyOnFemales() is undefined for the type Foo\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 19)\n" +
+ " class Foo extends Exception {\n" +
+ " ^^^\n" +
+ "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 23)\n" +
+ " class SonOfFoo extends Foo {\n" +
+ " ^^^^^^^^\n" +
+ "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 27)\n" +
+ " class GrandSonOfFoo extends SonOfFoo {}\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class GrandSonOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 28)\n" +
+ " class DaughterOfFoo extends Foo {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 32)\n" +
+ " class GrandDaughterOfFoo extends DaughterOfFoo {}\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "The serializable class GrandDaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
"----------\n");
}
// Test explicit final modifiers
@@ -681,26 +681,26 @@ public void test018() {
"class SonOfFoo extends Foo {}\n" +
"class DaughterOfFoo extends Foo {}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " throw new SonOfFoo();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 18)\n" +
- " class Foo extends Exception {}\n" +
- " ^^^\n" +
- "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 19)\n" +
- " class SonOfFoo extends Foo {}\n" +
- " ^^^^^^^^\n" +
- "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 20)\n" +
- " class DaughterOfFoo extends Foo {}\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 7)\n" +
+ " throw new SonOfFoo();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 18)\n" +
+ " class Foo extends Exception {}\n" +
+ " ^^^\n" +
+ "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 19)\n" +
+ " class SonOfFoo extends Foo {}\n" +
+ " ^^^^^^^^\n" +
+ "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 20)\n" +
+ " class DaughterOfFoo extends Foo {}\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
"----------\n");
}
// Test explicit final modifiers
@@ -729,26 +729,26 @@ public void test019() {
"class SonOfFoo extends Foo {}\n" +
"class DaughterOfFoo extends Foo {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " } catch (final SonOfFoo | final DaughterOfFoo e){\n" +
- " ^^^^^\n" +
- "Syntax error on token \"final\", delete this token\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 18)\n" +
- " class Foo extends Exception {}\n" +
- " ^^^\n" +
- "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 19)\n" +
- " class SonOfFoo extends Foo {}\n" +
- " ^^^^^^^^\n" +
- "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 20)\n" +
- " class DaughterOfFoo extends Foo {}\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " } catch (final SonOfFoo | final DaughterOfFoo e){\n" +
+ " ^^^^^\n" +
+ "Syntax error on token \"final\", delete this token\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 18)\n" +
+ " class Foo extends Exception {}\n" +
+ " ^^^\n" +
+ "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 19)\n" +
+ " class SonOfFoo extends Foo {}\n" +
+ " ^^^^^^^^\n" +
+ "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 20)\n" +
+ " class DaughterOfFoo extends Foo {}\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
"----------\n");
}
// Test that for unchecked exceptions, we don't do any precise analysis.
@@ -801,9 +801,9 @@ public void test021() {
" }\n" +
"}\n"
},
- "java.lang.NullPointerException\n" +
- "java.lang.ArithmeticException\n" +
- "java.lang.ArrayStoreException\n" +
+ "java.lang.NullPointerException\n" +
+ "java.lang.ArithmeticException\n" +
+ "java.lang.ArrayStoreException\n" +
"java.lang.ArrayIndexOutOfBoundsException");
}
public void test022() {
@@ -813,18 +813,18 @@ public void test022() {
"public class X<T extends Exception> {\n" +
"public void foo(boolean bool) throws Exception {\n" +
" try {\n" +
- " if (bool)\n" +
+ " if (bool)\n" +
" throw new Exception();\n" +
" else\n" +
" throw new NullPointerException();\n" +
" } catch (T | NullPointerException e) {}\n" +
"}\n" +
- "}\n"},
+ "}\n"},
"----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " } catch (T | NullPointerException e) {}\n" +
- " ^\n" +
- "Cannot use the type parameter T in a catch block\n" +
+ "1. ERROR in X.java (at line 8)\n" +
+ " } catch (T | NullPointerException e) {}\n" +
+ " ^\n" +
+ "Cannot use the type parameter T in a catch block\n" +
"----------\n"
);
}
@@ -835,28 +835,28 @@ public void test023() {
"public class X<T> extends Exception {\n" +
"public void foo(boolean bool) throws Exception {\n" +
" try {\n" +
- " if (bool)\n" +
+ " if (bool)\n" +
" throw new Exception();\n" +
" else\n" +
" throw new NullPointerException();\n" +
" } catch (X<String> | NullPointerException e) {}\n" +
"}\n" +
- "}\n"},
- "----------\n" +
- "1. WARNING in X.java (at line 1)\n" +
- " public class X<T> extends Exception {\n" +
- " ^\n" +
- "The serializable class X does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " public class X<T> extends Exception {\n" +
- " ^^^^^^^^^\n" +
- "The generic class X<T> may not subclass java.lang.Throwable\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " } catch (X<String> | NullPointerException e) {}\n" +
- " ^\n" +
- "Cannot use the parameterized type X<String> either in catch block or throws clause\n" +
+ "}\n"},
+ "----------\n" +
+ "1. WARNING in X.java (at line 1)\n" +
+ " public class X<T> extends Exception {\n" +
+ " ^\n" +
+ "The serializable class X does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 1)\n" +
+ " public class X<T> extends Exception {\n" +
+ " ^^^^^^^^^\n" +
+ "The generic class X<T> may not subclass java.lang.Throwable\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 8)\n" +
+ " } catch (X<String> | NullPointerException e) {}\n" +
+ " ^\n" +
+ "Cannot use the parameterized type X<String> either in catch block or throws clause\n" +
"----------\n"
);
}
@@ -877,12 +877,12 @@ public void test024() {
" }\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " } catch(IOException | FileNotFoundException e) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The exception FileNotFoundException is already caught by the alternative IOException\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " } catch(IOException | FileNotFoundException e) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The exception FileNotFoundException is already caught by the alternative IOException\n" +
"----------\n");
}
public void test024a() {
@@ -901,12 +901,12 @@ public void test024a() {
" }\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " } catch(FileNotFoundException | IOException e) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The exception FileNotFoundException is already caught by the alternative IOException\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " } catch(FileNotFoundException | IOException e) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The exception FileNotFoundException is already caught by the alternative IOException\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=344824
@@ -930,27 +930,27 @@ public void test025() {
"class F extends Exception {}\n" +
"class S extends F {}\n" +
"class D extends F {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " } catch (RuntimeException | S f) {\n" +
- " ^\n" +
- "Unreachable catch block for S. It is already handled by the catch block for F\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 14)\n" +
- " class F extends Exception {}\n" +
- " ^\n" +
- "The serializable class F does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 15)\n" +
- " class S extends F {}\n" +
- " ^\n" +
- "The serializable class S does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 16)\n" +
- " class D extends F {}\n" +
- " ^\n" +
- "The serializable class D does not declare a static final serialVersionUID field of type long\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " } catch (RuntimeException | S f) {\n" +
+ " ^\n" +
+ "Unreachable catch block for S. It is already handled by the catch block for F\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 14)\n" +
+ " class F extends Exception {}\n" +
+ " ^\n" +
+ "The serializable class F does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 15)\n" +
+ " class S extends F {}\n" +
+ " ^\n" +
+ "The serializable class S does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 16)\n" +
+ " class D extends F {}\n" +
+ " ^\n" +
+ "The serializable class D does not declare a static final serialVersionUID field of type long\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=345522
@@ -973,7 +973,7 @@ public void test026() {
" void zoo() throws FileNotFoundException, EOFException {\n" +
" }\n" +
"}\n"
- },
+ },
"");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=345522
@@ -997,12 +997,12 @@ public void test026a() {
" void zoo() throws FileNotFoundException, EOFException {\n" +
" }\n" +
"}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " throw ec;\n" +
- " ^^^^^^^^^\n" +
- "Unhandled exception type Exception\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " throw ec;\n" +
+ " ^^^^^^^^^\n" +
+ "Unhandled exception type Exception\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=345579
@@ -1020,7 +1020,7 @@ public void test027() {
" }\n"+
" }\n"+
"}\n"
- },
+ },
"");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=350361
@@ -1038,7 +1038,7 @@ public void test028() {
" } \n"+
" }\n"+
"}\n"
- },
+ },
"");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=350579
@@ -1059,7 +1059,7 @@ public void test029() { // with finally
" public void close() {\n" +
" }\n" +
"}\n"
- },
+ },
"Done");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=350579
@@ -1078,7 +1078,7 @@ public void test030() { // no finally
" public void close() {\n" +
" }\n" +
"}\n"
- },
+ },
"Done");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=350579
@@ -1125,7 +1125,7 @@ public void test031() { // with finally
"class YYException extends Exception {}\n" +
"class ZException extends Exception {}\n" +
"class ZZException extends Exception {}\n"
- },
+ },
"Done");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=350579
@@ -1171,7 +1171,7 @@ public void test032() { // no finally
"class YYException extends Exception {}\n" +
"class ZException extends Exception {}\n" +
"class ZZException extends Exception {}\n"
- },
+ },
"Done");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=391092
@@ -1191,36 +1191,36 @@ public void testBug391092() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " } catch (NullPointerException | ArrayIndexOutOfBoundsException e []) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Illegal attempt to create arrays of union types\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " } catch (ClassCastException [] c) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "No exception of type ClassCastException[] can be thrown; an exception type must be a subclass of Throwable\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " } catch (ArrayStoreException a[]) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "No exception of type ArrayStoreException[] can be thrown; an exception type must be a subclass of Throwable\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " } catch (ArithmeticException | NegativeArraySizeException b[][] ) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Illegal attempt to create arrays of union types\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 8)\n" +
- " } catch (ClassCastException[][] | ClassNotFoundException[] g) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "No exception of type ClassCastException[][] can be thrown; an exception type must be a subclass of Throwable\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 8)\n" +
- " } catch (ClassCastException[][] | ClassNotFoundException[] g) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "No exception of type ClassNotFoundException[] can be thrown; an exception type must be a subclass of Throwable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " } catch (NullPointerException | ArrayIndexOutOfBoundsException e []) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Illegal attempt to create arrays of union types\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " } catch (ClassCastException [] c) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^\n" +
+ "No exception of type ClassCastException[] can be thrown; an exception type must be a subclass of Throwable\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " } catch (ArrayStoreException a[]) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "No exception of type ArrayStoreException[] can be thrown; an exception type must be a subclass of Throwable\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 7)\n" +
+ " } catch (ArithmeticException | NegativeArraySizeException b[][] ) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Illegal attempt to create arrays of union types\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 8)\n" +
+ " } catch (ClassCastException[][] | ClassNotFoundException[] g) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "No exception of type ClassCastException[][] can be thrown; an exception type must be a subclass of Throwable\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 8)\n" +
+ " } catch (ClassCastException[][] | ClassNotFoundException[] g) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "No exception of type ClassNotFoundException[] can be thrown; an exception type must be a subclass of Throwable\n" +
"----------\n");
}
@@ -1229,37 +1229,37 @@ public void testBug404146() {
runConformTest(
new String[] {
"X.java",
- "import java.io.IOException;\n" +
- "import javax.naming.NamingException;\n" +
+ "import java.io.IOException;\n" +
+ "import javax.naming.NamingException;\n" +
- "\n" +
- "public final class X {\n" +
- "\n" +
- " public static final void illegalStackMap() {\n" +
- " try {\n" +
- " try {\n" +
- " Y.decoy1();\n" +
- " } finally {\n" +
- " try {\n" +
- " Y.decoy2();\n" +
- " } catch (final IOException e) {\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- " } finally {\n" +
- " try {\n" +
- " Y.decoy3();\n" +
- " } catch (final NamingException e) {\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
+ "\n" +
+ "public final class X {\n" +
+ "\n" +
+ " public static final void illegalStackMap() {\n" +
+ " try {\n" +
+ " try {\n" +
+ " Y.decoy1();\n" +
+ " } finally {\n" +
+ " try {\n" +
+ " Y.decoy2();\n" +
+ " } catch (final IOException e) {\n" +
+ " return;\n" +
+ " }\n" +
+ " }\n" +
+ " } finally {\n" +
+ " try {\n" +
+ " Y.decoy3();\n" +
+ " } catch (final NamingException e) {\n" +
+ " return;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
"}\n",
"Y.java",
- "import java.io.IOException;\n" +
- "import javax.naming.NamingException;\n" +
- "public final class Y {\n" +
- "\n" +
+ "import java.io.IOException;\n" +
+ "import javax.naming.NamingException;\n" +
+ "public final class Y {\n" +
+ "\n" +
" public static void decoy1() {}\n" +
" public static void decoy2() throws IOException {}\n" +
" public static void decoy3() throws NamingException {}\n" +
@@ -1289,11 +1289,11 @@ public void testBug488569_001() {
"}\n" +
"\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " try (Y y1 = new Y(); z1;) {\n" +
- " ^^\n" +
- "Variable resource not allowed here for source level below 9\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " try (Y y1 = new Y(); z1;) {\n" +
+ " ^^\n" +
+ "Variable resource not allowed here for source level below 9\n" +
"----------\n");
} else {
this.runConformTest(
@@ -1316,7 +1316,7 @@ public void testBug488569_001() {
" } \n" +
"}\n" +
"\n"
- },
+ },
"");
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatement9Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatement9Test.java
index f73b28f38..70d0ba53c 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatement9Test.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatement9Test.java
@@ -54,12 +54,12 @@ public void testBug488569_001() { // vanilla test case
" System.out.println(\"Done\");\n" +
" }\n" +
"} \n"
- },
+ },
"Done");
}
// vanilla with a delimiter
-public void testBug488569_002() {
+public void testBug488569_002() {
this.runConformTest(
new String[] {
"X.java",
@@ -84,11 +84,11 @@ public void testBug488569_002() {
" System.out.println(\"Done\");\n" +
" }\n" +
"} \n"
- },
+ },
"Done");
}
-public void testBug488569_003() {
+public void testBug488569_003() {
this.runConformTest(
new String[] {
"X.java",
@@ -114,10 +114,10 @@ public void testBug488569_003() {
" System.out.println(\"Done\");\n" +
" }\n" +
"} \n"
- },
+ },
"Done");
}
-public void testBug488569_004() {
+public void testBug488569_004() {
this.runConformTest(
new String[] {
"X.java",
@@ -142,11 +142,11 @@ public void testBug488569_004() {
" System.out.println(\"Done\");\n" +
" }\n" +
"} \n"
- },
+ },
"Done");
}
-public void testBug488569_005() {
+public void testBug488569_005() {
this.runConformTest(
new String[] {
"X.java",
@@ -171,7 +171,7 @@ public void testBug488569_005() {
" System.out.println(\"Done\");\n" +
" }\n" +
"} \n"
- },
+ },
"Done");
}
public void testBug488569_006() {
@@ -229,11 +229,11 @@ public void testBug488569_007() {
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 15)\n" +
- " try (y1) { \n" +
- " ^^\n" +
- "Local variable y1 defined in an enclosing scope must be final or effectively final\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 15)\n" +
+ " try (y1) { \n" +
+ " ^^\n" +
+ "Local variable y1 defined in an enclosing scope must be final or effectively final\n" +
"----------\n");
}
//check for the error for combination of NameRef and LocalVarDecl.
@@ -262,11 +262,11 @@ public void testBug488569_008() {
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " try (y1; Y y1 = new Y()) { \n" +
- " ^^\n" +
- "y1 cannot be resolved\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 13)\n" +
+ " try (y1; Y y1 = new Y()) { \n" +
+ " ^^\n" +
+ "y1 cannot be resolved\n" +
"----------\n");
}
@@ -296,11 +296,11 @@ public void testBug488569_009() {
" }\n" +
"}",
},
- "----------\n" +
- "1. WARNING in X.java (at line 13)\n" +
- " try (Y y1 = new Y(); y1) { \n" +
- " ^^\n" +
- "Duplicate resource reference y1\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 13)\n" +
+ " try (Y y1 = new Y(); y1) { \n" +
+ " ^^\n" +
+ "Duplicate resource reference y1\n" +
"----------\n");
}
//check for the warning for combination of NameRef and NameRef.
@@ -330,11 +330,11 @@ public void testBug488569_010() {
" }\n" +
"}",
},
- "----------\n" +
- "1. WARNING in X.java (at line 14)\n" +
- " try (y1; y1) { \n" +
- " ^^\n" +
- "Duplicate resource reference y1\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 14)\n" +
+ " try (y1; y1) { \n" +
+ " ^^\n" +
+ "Duplicate resource reference y1\n" +
"----------\n");
}
public void testBug488569_011() {
@@ -361,7 +361,7 @@ public void testBug488569_011() {
" System.out.println(\"Done\");\n" +
" }\n" +
"} \n"
- },
+ },
"Done");
}
@@ -390,7 +390,7 @@ public void testBug488569_012() {
" System.out.println(\"Done\");\n" +
" }\n" +
"} \n"
- },
+ },
"Done");
}
@@ -418,7 +418,7 @@ public void testBug488569_013() {
" System.out.println(\"Z CLOSE\");\n" +
" }\n" +
"}\n"
- },
+ },
"Y CLOSE\n" +
"Z CLOSE\n" +
"Y CLOSE"
@@ -448,11 +448,11 @@ public void testBug488569_014() {
" }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " try (y1) {\n" +
- " ^^\n" +
- "Unhandled exception type IOException thrown by automatic close() invocation on y1\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " try (y1) {\n" +
+ " ^^\n" +
+ "Unhandled exception type IOException thrown by automatic close() invocation on y1\n" +
"----------\n");
}
@@ -485,8 +485,8 @@ public void testBug488569_015(){
" System.out.println(\"Closed\");\n" +
" }\n" +
"}\n"
- },
- "In Try\n" +
+ },
+ "In Try\n" +
"Closed"
);
}
@@ -518,8 +518,8 @@ public void testBug488569_016(){
" System.out.println(\"Closed\");\n" +
" }\n" +
"}\n"
- },
- "In Try"
+ },
+ "In Try"
);
}
@@ -553,10 +553,10 @@ public void testBug488569_017(){
" public void close() throws IOException {\n" +
" System.out.println(\"Closed\");\n" +
" } \n" +
- "} \n"
- },
- "In Try\n" +
- "Closed\n" +
+ "} \n"
+ },
+ "In Try\n" +
+ "Closed\n" +
"Closed"
);
}
@@ -591,21 +591,21 @@ public void testBug488569_018() {
" } \n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " try (this.y2; super.yz;y2) { \n" +
- " ^^\n" +
- "Field y2 must be final\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " try (this.y2; super.yz;y2) { \n" +
- " ^^\n" +
- "Field yz must be final\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " try (this.y2; super.yz;y2) { \n" +
- " ^^\n" +
- "Local variable y2 defined in an enclosing scope must be final or effectively final\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " try (this.y2; super.yz;y2) { \n" +
+ " ^^\n" +
+ "Field y2 must be final\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " try (this.y2; super.yz;y2) { \n" +
+ " ^^\n" +
+ "Field yz must be final\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 10)\n" +
+ " try (this.y2; super.yz;y2) { \n" +
+ " ^^\n" +
+ "Local variable y2 defined in an enclosing scope must be final or effectively final\n" +
"----------\n");
}
//negative tests: duplicate fields
@@ -642,16 +642,16 @@ public void testBug488569_019() {
" } \n" +
"} \n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 14)\n" +
- " try (y3; y3;super.yz;super.yz;this.y2;) { \n" +
- " ^^\n" +
- "Duplicate resource reference y3\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 14)\n" +
- " try (y3; y3;super.yz;super.yz;this.y2;) { \n" +
- " ^^^^^^^^\n" +
- "Duplicate resource reference super.yz\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 14)\n" +
+ " try (y3; y3;super.yz;super.yz;this.y2;) { \n" +
+ " ^^\n" +
+ "Duplicate resource reference y3\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 14)\n" +
+ " try (y3; y3;super.yz;super.yz;this.y2;) { \n" +
+ " ^^^^^^^^\n" +
+ "Duplicate resource reference super.yz\n" +
"----------\n");
}
@@ -676,7 +676,7 @@ public void testBug488569_020() { // vanilla test case
" System.out.println(\"Done\");\n" +
" }\n" +
"} \n"
- },
+ },
"Done");
}
@@ -703,11 +703,11 @@ public void testBug488569_021() {
" } \n" +
"} \n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " try(this.z) {\n" +
- " ^^^^^^\n" +
- "Unhandled exception type IOException thrown by automatic close() invocation on z\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " try(this.z) {\n" +
+ " ^^^^^^\n" +
+ "Unhandled exception type IOException thrown by automatic close() invocation on z\n" +
"----------\n");
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatementTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatementTest.java
index 16d4edd63..3e7a0f833 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatementTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatementTest.java
@@ -2417,70 +2417,70 @@ public void test042_not_shared() throws Exception {
null);
String expectedOutput =
- " // Method descriptor #26 ([Ljava/lang/String;)Ljava/lang/String;\n" +
- " // Stack: 2, Locals: 3\n" +
- " java.lang.String foo(java.lang.String[] args);\n" +
- " 0 aload_1 [args]\n" +
- " 1 ifnonnull 15\n" +
- " 4 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 7 ldc <String \"FINALLY:\"> [35]\n" +
- " 9 invokevirtual java.io.PrintStream.print(java.lang.String) : void [37]\n" +
- " 12 ldc <String \"KO\"> [40]\n" +
- " 14 areturn\n" +
- " 15 aload_1 [args]\n" +
- " 16 arraylength\n" +
- " 17 tableswitch default: 81\n" +
- " case 0: 48\n" +
- " case 1: 59\n" +
- " case 2: 81\n" +
- " case 3: 70\n" +
- " 48 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 51 ldc <String \"FINALLY:\"> [35]\n" +
- " 53 invokevirtual java.io.PrintStream.print(java.lang.String) : void [37]\n" +
- " 56 ldc <String \"OK\"> [42]\n" +
- " 58 areturn\n" +
- " 59 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 62 ldc <String \"FINALLY:\"> [35]\n" +
- " 64 invokevirtual java.io.PrintStream.print(java.lang.String) : void [37]\n" +
- " 67 ldc <String \"KO\"> [40]\n" +
- " 69 areturn\n" +
- " 70 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 73 ldc <String \"FINALLY:\"> [35]\n" +
- " 75 invokevirtual java.io.PrintStream.print(java.lang.String) : void [37]\n" +
- " 78 ldc <String \"OK\"> [42]\n" +
- " 80 areturn\n" +
- " 81 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 84 ldc <String \"FINALLY:\"> [35]\n" +
- " 86 invokevirtual java.io.PrintStream.print(java.lang.String) : void [37]\n" +
- " 89 ldc <String \"KO\"> [40]\n" +
- " 91 areturn\n" +
- " 92 astore_2\n" +
- " 93 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 96 ldc <String \"FINALLY:\"> [35]\n" +
- " 98 invokevirtual java.io.PrintStream.print(java.lang.String) : void [37]\n" +
- " 101 aload_2\n" +
- " 102 athrow\n" +
- " Exception Table:\n" +
- " [pc: 0, pc: 4] -> 92 when : any\n" +
- " [pc: 15, pc: 48] -> 92 when : any\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 7]\n" +
- " [pc: 4, line: 19]\n" +
- " [pc: 12, line: 7]\n" +
- " [pc: 15, line: 8]\n" +
- " [pc: 48, line: 19]\n" +
- " [pc: 56, line: 10]\n" +
- " [pc: 59, line: 19]\n" +
- " [pc: 67, line: 12]\n" +
- " [pc: 70, line: 19]\n" +
- " [pc: 78, line: 14]\n" +
- " [pc: 81, line: 19]\n" +
- " [pc: 89, line: 16]\n" +
- " [pc: 92, line: 18]\n" +
- " [pc: 93, line: 19]\n" +
- " [pc: 101, line: 20]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 103] local: this index: 0 type: X\n" +
+ " // Method descriptor #26 ([Ljava/lang/String;)Ljava/lang/String;\n" +
+ " // Stack: 2, Locals: 3\n" +
+ " java.lang.String foo(java.lang.String[] args);\n" +
+ " 0 aload_1 [args]\n" +
+ " 1 ifnonnull 15\n" +
+ " 4 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 7 ldc <String \"FINALLY:\"> [35]\n" +
+ " 9 invokevirtual java.io.PrintStream.print(java.lang.String) : void [37]\n" +
+ " 12 ldc <String \"KO\"> [40]\n" +
+ " 14 areturn\n" +
+ " 15 aload_1 [args]\n" +
+ " 16 arraylength\n" +
+ " 17 tableswitch default: 81\n" +
+ " case 0: 48\n" +
+ " case 1: 59\n" +
+ " case 2: 81\n" +
+ " case 3: 70\n" +
+ " 48 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 51 ldc <String \"FINALLY:\"> [35]\n" +
+ " 53 invokevirtual java.io.PrintStream.print(java.lang.String) : void [37]\n" +
+ " 56 ldc <String \"OK\"> [42]\n" +
+ " 58 areturn\n" +
+ " 59 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 62 ldc <String \"FINALLY:\"> [35]\n" +
+ " 64 invokevirtual java.io.PrintStream.print(java.lang.String) : void [37]\n" +
+ " 67 ldc <String \"KO\"> [40]\n" +
+ " 69 areturn\n" +
+ " 70 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 73 ldc <String \"FINALLY:\"> [35]\n" +
+ " 75 invokevirtual java.io.PrintStream.print(java.lang.String) : void [37]\n" +
+ " 78 ldc <String \"OK\"> [42]\n" +
+ " 80 areturn\n" +
+ " 81 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 84 ldc <String \"FINALLY:\"> [35]\n" +
+ " 86 invokevirtual java.io.PrintStream.print(java.lang.String) : void [37]\n" +
+ " 89 ldc <String \"KO\"> [40]\n" +
+ " 91 areturn\n" +
+ " 92 astore_2\n" +
+ " 93 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 96 ldc <String \"FINALLY:\"> [35]\n" +
+ " 98 invokevirtual java.io.PrintStream.print(java.lang.String) : void [37]\n" +
+ " 101 aload_2\n" +
+ " 102 athrow\n" +
+ " Exception Table:\n" +
+ " [pc: 0, pc: 4] -> 92 when : any\n" +
+ " [pc: 15, pc: 48] -> 92 when : any\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 7]\n" +
+ " [pc: 4, line: 19]\n" +
+ " [pc: 12, line: 7]\n" +
+ " [pc: 15, line: 8]\n" +
+ " [pc: 48, line: 19]\n" +
+ " [pc: 56, line: 10]\n" +
+ " [pc: 59, line: 19]\n" +
+ " [pc: 67, line: 12]\n" +
+ " [pc: 70, line: 19]\n" +
+ " [pc: 78, line: 14]\n" +
+ " [pc: 81, line: 19]\n" +
+ " [pc: 89, line: 16]\n" +
+ " [pc: 92, line: 18]\n" +
+ " [pc: 93, line: 19]\n" +
+ " [pc: 101, line: 20]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 103] local: this index: 0 type: X\n" +
" [pc: 0, pc: 103] local: args index: 1 type: java.lang.String[]\n";
File f = new File(OUTPUT_DIR + File.separator + "X.class");
@@ -5841,28 +5841,28 @@ public void test067() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(final String[] args) {\n" +
- " System.out.println(new X().verifyError());\n" +
- " }\n" +
- " private Object verifyError() {\n" +
- " try {\n" +
- " if (someBooleanMethod()) {\n" +
- " return null;\n" +
- " }\n" +
- " return getStuff();\n" +
- " } catch (final Exception ex) {\n" +
- " return null;\n" +
- " } finally {\n" +
- " while (someBooleanMethod()) {\n" +
- " anyMethod();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " private void anyMethod() { /*empty*/ }\n" +
- " private Object getStuff() { return null; }\n" +
- " private boolean someBooleanMethod() { return false; }\n" +
- "}\n" +
+ "public class X {\n" +
+ " public static void main(final String[] args) {\n" +
+ " System.out.println(new X().verifyError());\n" +
+ " }\n" +
+ " private Object verifyError() {\n" +
+ " try {\n" +
+ " if (someBooleanMethod()) {\n" +
+ " return null;\n" +
+ " }\n" +
+ " return getStuff();\n" +
+ " } catch (final Exception ex) {\n" +
+ " return null;\n" +
+ " } finally {\n" +
+ " while (someBooleanMethod()) {\n" +
+ " anyMethod();\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " private void anyMethod() { /*empty*/ }\n" +
+ " private Object getStuff() { return null; }\n" +
+ " private boolean someBooleanMethod() { return false; }\n" +
+ "}\n" +
"",
},
"null");
@@ -5898,7 +5898,7 @@ public void test068() {
"class GrandSonOfFoo extends SonOfFoo {}\n" +
"class DaughterOfFoo extends Foo {}\n" +
"class GrandDaughterOfFoo extends DaughterOfFoo {}\n"
- },
+ },
"caught a daughter of foo");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=340484
@@ -5926,42 +5926,42 @@ public void test069() {
"class DaughterOfFoo extends Foo {}\n"
},
this.complianceLevel < ClassFileConstants.JDK1_7 ?
- "----------\n" +
- "1. WARNING in X.java (at line 16)\n" +
- " class Foo extends Exception {}\n" +
- " ^^^\n" +
- "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 17)\n" +
- " class SonOfFoo extends Foo {}\n" +
- " ^^^^^^^^\n" +
- "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 18)\n" +
- " class DaughterOfFoo extends Foo {}\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 16)\n" +
+ " class Foo extends Exception {}\n" +
+ " ^^^\n" +
+ "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 17)\n" +
+ " class SonOfFoo extends Foo {}\n" +
+ " ^^^^^^^^\n" +
+ "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 18)\n" +
+ " class DaughterOfFoo extends Foo {}\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
"----------\n" :
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " } catch (SonOfFoo e1) {\n" +
- " ^^^^^^^^\n" +
- "Unreachable catch block for SonOfFoo. This exception is never thrown from the try statement body\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 16)\n" +
- " class Foo extends Exception {}\n" +
- " ^^^\n" +
- "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 17)\n" +
- " class SonOfFoo extends Foo {}\n" +
- " ^^^^^^^^\n" +
- "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 18)\n" +
- " class DaughterOfFoo extends Foo {}\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " } catch (SonOfFoo e1) {\n" +
+ " ^^^^^^^^\n" +
+ "Unreachable catch block for SonOfFoo. This exception is never thrown from the try statement body\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 16)\n" +
+ " class Foo extends Exception {}\n" +
+ " ^^^\n" +
+ "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 17)\n" +
+ " class SonOfFoo extends Foo {}\n" +
+ " ^^^^^^^^\n" +
+ "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 18)\n" +
+ " class DaughterOfFoo extends Foo {}\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
"----------\n");
}
// precise throw computation should also take care of throws clause in 1.7. 1.6- should continue to behave as it always has.
@@ -5973,69 +5973,69 @@ public void test070() {
" public static void foo() throws DaughterOfFoo {\n" +
" try {\n" +
" throw new DaughterOfFoo();\n" +
- " } catch (Foo e){\n" +
+ " } catch (Foo e){\n" +
" throw e;\n" +
" foo();\n" +
" }\n"+
" }\n"+
- " public static void main(String[] args) {\n" +
- " try {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
" foo();\n"+
- " } catch(Foo e) {}\n" +
- " }\n" +
+ " } catch(Foo e) {}\n" +
+ " }\n" +
"}\n"+
"class Foo extends Exception {}\n"+
"class SonOfFoo extends Foo {}\n"+
"class DaughterOfFoo extends Foo {}\n"
},
- this.complianceLevel < ClassFileConstants.JDK1_7 ?
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " throw e;\n" +
- " ^^^^^^^^\n" +
- "Unhandled exception type Foo\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " foo();\n" +
- " ^^^^^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 16)\n" +
- " class Foo extends Exception {}\n" +
- " ^^^\n" +
- "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 17)\n" +
- " class SonOfFoo extends Foo {}\n" +
- " ^^^^^^^^\n" +
- "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 18)\n" +
- " class DaughterOfFoo extends Foo {}\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ this.complianceLevel < ClassFileConstants.JDK1_7 ?
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " throw e;\n" +
+ " ^^^^^^^^\n" +
+ "Unhandled exception type Foo\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " foo();\n" +
+ " ^^^^^^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 16)\n" +
+ " class Foo extends Exception {}\n" +
+ " ^^^\n" +
+ "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 17)\n" +
+ " class SonOfFoo extends Foo {}\n" +
+ " ^^^^^^^^\n" +
+ "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 18)\n" +
+ " class DaughterOfFoo extends Foo {}\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
"----------\n":
-
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " foo();\n" +
- " ^^^^^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 16)\n" +
- " class Foo extends Exception {}\n" +
- " ^^^\n" +
- "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 17)\n" +
- " class SonOfFoo extends Foo {}\n" +
- " ^^^^^^^^\n" +
- "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 18)\n" +
- " class DaughterOfFoo extends Foo {}\n" +
- " ^^^^^^^^^^^^^\n" +
- "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
+
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " foo();\n" +
+ " ^^^^^^\n" +
+ "Unreachable code\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 16)\n" +
+ " class Foo extends Exception {}\n" +
+ " ^^^\n" +
+ "The serializable class Foo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 17)\n" +
+ " class SonOfFoo extends Foo {}\n" +
+ " ^^^^^^^^\n" +
+ "The serializable class SonOfFoo does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 18)\n" +
+ " class DaughterOfFoo extends Foo {}\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "The serializable class DaughterOfFoo does not declare a static final serialVersionUID field of type long\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=348369
@@ -6051,11 +6051,11 @@ public void test071() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " } catch (Exception [][][][][] e [][][][]) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "No exception of type Exception[][][][][][][][][] can be thrown; an exception type must be a subclass of Throwable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " } catch (Exception [][][][][] e [][][][]) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "No exception of type Exception[][][][][][][][][] can be thrown; an exception type must be a subclass of Throwable\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=348369
@@ -6071,11 +6071,11 @@ public void test072() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " } catch (Exception e []) {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "No exception of type Exception[] can be thrown; an exception type must be a subclass of Throwable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " } catch (Exception e []) {\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "No exception of type Exception[] can be thrown; an exception type must be a subclass of Throwable\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=348369
@@ -6091,11 +6091,11 @@ public void test073() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " } catch (Exception [] e) {\n" +
- " ^^^^^^^^^^^^\n" +
- "No exception of type Exception[] can be thrown; an exception type must be a subclass of Throwable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " } catch (Exception [] e) {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "No exception of type Exception[] can be thrown; an exception type must be a subclass of Throwable\n" +
"----------\n");
}
// test for regression during work on bug 345305
@@ -6105,20 +6105,20 @@ public void test074() {
new String[] {
"X.java",
"public class X {\n" +
- " Class test(String name) throws ClassNotFoundException {\n" +
- " Class c= findClass(name);\n" +
- " if (c != null)\n" +
- " return c;\n" +
- " if (isExcluded(name)) {\n" +
- " try {\n" +
- " c= findClass(name);\n" +
- " return c;\n" +
- " } catch (ClassNotFoundException e) {\n" +
- " // keep searching\n" +
- " }\n" +
- " }\n" +
+ " Class test(String name) throws ClassNotFoundException {\n" +
+ " Class c= findClass(name);\n" +
+ " if (c != null)\n" +
+ " return c;\n" +
+ " if (isExcluded(name)) {\n" +
+ " try {\n" +
+ " c= findClass(name);\n" +
+ " return c;\n" +
+ " } catch (ClassNotFoundException e) {\n" +
+ " // keep searching\n" +
+ " }\n" +
+ " }\n" +
" return findClass(name);\n" +
- " }\n" +
+ " }\n" +
" boolean isExcluded(String name) { return false; }\n" +
" Class findClass(String name) throws ClassNotFoundException { return null; }\n" +
"}\n"
@@ -6161,11 +6161,11 @@ public void testBug387612() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in Client.java (at line 7)\n" +
- " b.foo(null, null);\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type E\n" +
+ "----------\n" +
+ "1. ERROR in Client.java (at line 7)\n" +
+ " b.foo(null, null);\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type E\n" +
"----------\n");
}
@@ -6205,11 +6205,11 @@ public void testBug387612b() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in Client.java (at line 7)\n" +
- " b.foo(null, null);\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type E\n" +
+ "----------\n" +
+ "1. ERROR in Client.java (at line 7)\n" +
+ " b.foo(null, null);\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type E\n" +
"----------\n");
}
@@ -6250,11 +6250,11 @@ public void testBug387612c() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in Client.java (at line 7)\n" +
- " b.foo(null, null);\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type E\n" +
+ "----------\n" +
+ "1. ERROR in Client.java (at line 7)\n" +
+ " b.foo(null, null);\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type E\n" +
"----------\n",
null,
false/*shouldFlush*/);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryWithResourcesStatementTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryWithResourcesStatementTest.java
index 83620d722..7b578601e 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryWithResourcesStatementTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryWithResourcesStatementTest.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Stephan Herrmann - Contributions for
@@ -38,7 +38,7 @@ public TryWithResourcesStatementTest(String name) {
public static Test suite() {
return buildMinimalComplianceTestSuite(testClass(), F_1_7);
}
-// Test resource type related errors
+// Test resource type related errors
public void test001() {
this.runNegativeTest(
new String[] {
@@ -51,14 +51,14 @@ public void test001() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " try (int i = 0) {\n" +
- " ^^^\n" +
- "The resource type int does not implement java.lang.AutoCloseable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " try (int i = 0) {\n" +
+ " ^^^\n" +
+ "The resource type int does not implement java.lang.AutoCloseable\n" +
"----------\n");
}
-// Test resource type related errors
+// Test resource type related errors
public void test002() {
this.runNegativeTest(
new String[] {
@@ -71,14 +71,14 @@ public void test002() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " try (int[] tab = {}) {\n" +
- " ^^^^^\n" +
- "The resource type int[] does not implement java.lang.AutoCloseable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " try (int[] tab = {}) {\n" +
+ " ^^^^^\n" +
+ "The resource type int[] does not implement java.lang.AutoCloseable\n" +
"----------\n");
}
-// Test that resource type could be interface type.
+// Test that resource type could be interface type.
public void test003() {
this.runNegativeTest(
new String[] {
@@ -91,19 +91,19 @@ public void test003() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X implements AutoCloseable{\n" +
- " ^\n" +
- "The type X must implement the inherited abstract method AutoCloseable.close()\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " try (AutoCloseable a = new X()) {\n" +
- " ^\n" +
- "Unhandled exception type Exception thrown by automatic close() invocation on a\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X implements AutoCloseable{\n" +
+ " ^\n" +
+ "The type X must implement the inherited abstract method AutoCloseable.close()\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " try (AutoCloseable a = new X()) {\n" +
+ " ^\n" +
+ "Unhandled exception type Exception thrown by automatic close() invocation on a\n" +
"----------\n");
}
-// Type resource type related errors
+// Type resource type related errors
public void test003a() {
this.runNegativeTest(
new String[] {
@@ -124,11 +124,11 @@ public void test003a() {
"}\n" +
"interface Managed extends AutoCloseable {}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " Zork z;\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// Scope, visibility related tests.
@@ -136,27 +136,27 @@ public void test004() {
this.runNegativeTest(
new String[] {
"X.java",
- "import java.io.*;\n" +
- "public class X {\n" +
- " public static void main(String[] args) throws IOException {\n" +
- " int i = 0;\n" +
- " try (LineNumberReader reader = new LineNumberReader(new BufferedReader(new FileReader(args[0])))) {\n" +
- " String s;\n" +
- " int i = 0;\n" +
- " while ((s = reader.readLine()) != null) {\n" +
- " System.out.println(s);\n" +
- " i++;\n" +
- " }\n" +
- " System.out.println(\"\" + i + \" lines\");\n" +
- " }\n" +
- " }\n" +
+ "import java.io.*;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) throws IOException {\n" +
+ " int i = 0;\n" +
+ " try (LineNumberReader reader = new LineNumberReader(new BufferedReader(new FileReader(args[0])))) {\n" +
+ " String s;\n" +
+ " int i = 0;\n" +
+ " while ((s = reader.readLine()) != null) {\n" +
+ " System.out.println(s);\n" +
+ " i++;\n" +
+ " }\n" +
+ " System.out.println(\"\" + i + \" lines\");\n" +
+ " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " int i = 0;\n" +
- " ^\n" +
- "Duplicate local variable i\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " int i = 0;\n" +
+ " ^\n" +
+ "Duplicate local variable i\n" +
"----------\n");
}
//Scope, visibility related tests.
@@ -164,31 +164,31 @@ public void test004a() {
this.runNegativeTest(
new String[] {
"X.java",
- "import java.io.*;\n" +
- "public class X {\n" +
- " public static void main(String[] args) throws IOException {\n" +
- " try (LineNumberReader r = new LineNumberReader(new BufferedReader(new FileReader(args[0])))) {\n" +
- " String s;\n" +
- " int r = 0;\n" +
- " while ((s = r.readLine()) != null) {\n" +
- " System.out.println(s);\n" +
- " r++;\n" +
- " }\n" +
- " System.out.println(\"\" + r + \" lines\");\n" +
- " }\n" +
- " }\n" +
+ "import java.io.*;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) throws IOException {\n" +
+ " try (LineNumberReader r = new LineNumberReader(new BufferedReader(new FileReader(args[0])))) {\n" +
+ " String s;\n" +
+ " int r = 0;\n" +
+ " while ((s = r.readLine()) != null) {\n" +
+ " System.out.println(s);\n" +
+ " r++;\n" +
+ " }\n" +
+ " System.out.println(\"\" + r + \" lines\");\n" +
+ " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " int r = 0;\n" +
- " ^\n" +
- "Duplicate local variable r\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " while ((s = r.readLine()) != null) {\n" +
- " ^^^^^^^^^^^^\n" +
- "Cannot invoke readLine() on the primitive type int\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " int r = 0;\n" +
+ " ^\n" +
+ "Duplicate local variable r\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " while ((s = r.readLine()) != null) {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Cannot invoke readLine() on the primitive type int\n" +
"----------\n");
}
// check that resources are implicitly final
@@ -196,20 +196,20 @@ public void test005() {
this.runNegativeTest(
new String[] {
"X.java",
- "import java.io.*;\n" +
- "public class X {\n" +
- " public static void main(String[] args) throws IOException {\n" +
- " try (Reader r = new LineNumberReader(new BufferedReader(new FileReader(args[0])))) {\n" +
- " r = new FileReader(args[0]);\n" +
- " }\n" +
- " }\n" +
+ "import java.io.*;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) throws IOException {\n" +
+ " try (Reader r = new LineNumberReader(new BufferedReader(new FileReader(args[0])))) {\n" +
+ " r = new FileReader(args[0]);\n" +
+ " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " r = new FileReader(args[0]);\n" +
- " ^\n" +
- "The resource r of a try-with-resources statement cannot be assigned\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " r = new FileReader(args[0]);\n" +
+ " ^\n" +
+ "The resource r of a try-with-resources statement cannot be assigned\n" +
"----------\n");
}
//check that try statement can be empty
@@ -217,41 +217,41 @@ public void test006() {
this.runNegativeTest( // cannot be a conform test as this triggers an AIOOB.
new String[] {
"X.java",
- "import java.io.*;\n" +
- "public class X {\n" +
- " public static void main(String[] args) throws IOException {\n" +
- " try (Reader r = new LineNumberReader(new BufferedReader(new FileReader(args[0])))) {\n" +
+ "import java.io.*;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) throws IOException {\n" +
+ " try (Reader r = new LineNumberReader(new BufferedReader(new FileReader(args[0])))) {\n" +
" } catch(Zork z) {" +
- " }\n" +
- " }\n" +
+ " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " } catch(Zork z) { }\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " } catch(Zork z) { }\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
-//check that resources are implicitly final but they can be explicitly final
+//check that resources are implicitly final but they can be explicitly final
public void test007() {
this.runNegativeTest(
new String[] {
"X.java",
- "import java.io.*;\n" +
- "public class X {\n" +
- " public static void main(String[] args) throws IOException {\n" +
- " try (final Reader r = new LineNumberReader(new BufferedReader(new FileReader(args[0])))) {\n" +
- " r = new FileReader(args[0]);\n" +
- " }\n" +
- " }\n" +
+ "import java.io.*;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) throws IOException {\n" +
+ " try (final Reader r = new LineNumberReader(new BufferedReader(new FileReader(args[0])))) {\n" +
+ " r = new FileReader(args[0]);\n" +
+ " }\n" +
+ " }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " r = new FileReader(args[0]);\n" +
- " ^\n" +
- "The resource r of a try-with-resources statement cannot be assigned\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " r = new FileReader(args[0]);\n" +
+ " ^\n" +
+ "The resource r of a try-with-resources statement cannot be assigned\n" +
"----------\n");
}
// resource type tests
@@ -270,11 +270,11 @@ public void test008() {
" public void close () {}\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " try (Y [] i = null) {\n" +
- " ^^^^\n" +
- "The resource type Y[] does not implement java.lang.AutoCloseable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " try (Y [] i = null) {\n" +
+ " ^^^^\n" +
+ "The resource type Y[] does not implement java.lang.AutoCloseable\n" +
"----------\n");
}
// Resource Type tests
@@ -293,11 +293,11 @@ public void test009() {
" public void close () {}\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " try (Y i [] = null) {\n" +
- " ^\n" +
- "The resource type Y[] does not implement java.lang.AutoCloseable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " try (Y i [] = null) {\n" +
+ " ^\n" +
+ "The resource type Y[] does not implement java.lang.AutoCloseable\n" +
"----------\n");
}
// Scope, visibility tests
@@ -317,21 +317,21 @@ public void test010() {
" public void close () {}\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " try (Y i = new Y(); Y i = new Y(); Y p = new Y(); Y k = new Y();) {\n" +
- " ^\n" +
- "Duplicate local variable i\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " try (Y i = new Y(); Y i = new Y(); Y p = new Y(); Y k = new Y();) {\n" +
- " ^\n" +
- "Duplicate local variable p\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " try (Y i = new Y(); Y i = new Y(); Y p = new Y(); Y k = new Y();) {\n" +
- " ^\n" +
- "Duplicate local variable k\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " try (Y i = new Y(); Y i = new Y(); Y p = new Y(); Y k = new Y();) {\n" +
+ " ^\n" +
+ "Duplicate local variable i\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " try (Y i = new Y(); Y i = new Y(); Y p = new Y(); Y k = new Y();) {\n" +
+ " ^\n" +
+ "Duplicate local variable p\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " try (Y i = new Y(); Y i = new Y(); Y p = new Y(); Y k = new Y();) {\n" +
+ " ^\n" +
+ "Duplicate local variable k\n" +
"----------\n");
}
// Scope, visibility tests
@@ -356,16 +356,16 @@ public void test011() {
" public void close () {}\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " System.out.println(i);\n" +
- " ^\n" +
- "i cannot be resolved to a variable\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " System.out.println(p);\n" +
- " ^\n" +
- "p cannot be resolved to a variable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " System.out.println(i);\n" +
+ " ^\n" +
+ "i cannot be resolved to a variable\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " System.out.println(p);\n" +
+ " ^\n" +
+ "p cannot be resolved to a variable\n" +
"---" +
"-------\n");
}
@@ -394,21 +394,21 @@ public void test012() {
" public void close () {}\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " } catch (Exception i) {\n" +
- " ^\n" +
- "Duplicate parameter i\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " System.out.println(i);\n" +
- " ^\n" +
- "i cannot be resolved to a variable\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 13)\n" +
- " System.out.println(p);\n" +
- " ^\n" +
- "p cannot be resolved to a variable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " } catch (Exception i) {\n" +
+ " ^\n" +
+ "Duplicate parameter i\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 10)\n" +
+ " System.out.println(i);\n" +
+ " ^\n" +
+ "i cannot be resolved to a variable\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 13)\n" +
+ " System.out.println(p);\n" +
+ " ^\n" +
+ "p cannot be resolved to a variable\n" +
"----------\n");
}
// Shadowing behavior tests
@@ -439,21 +439,21 @@ public void test013() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " public void foo(int p) {\n" +
- " ^\n" +
- "The parameter p is hiding another local variable defined in an enclosing scope\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " } catch (Exception y) {\n" +
- " ^\n" +
- "The parameter y is hiding another local variable defined in an enclosing scope\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 13)\n" +
- " System.out.println(y);\n" +
- " ^\n" +
- "y cannot be resolved to a variable\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " public void foo(int p) {\n" +
+ " ^\n" +
+ "The parameter p is hiding another local variable defined in an enclosing scope\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 8)\n" +
+ " } catch (Exception y) {\n" +
+ " ^\n" +
+ "The parameter y is hiding another local variable defined in an enclosing scope\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 13)\n" +
+ " System.out.println(y);\n" +
+ " ^\n" +
+ "y cannot be resolved to a variable\n" +
"----------\n");
}
// Test for unhandled exceptions
@@ -486,31 +486,31 @@ public void test014() {
"\n" +
"class WeirdException extends Throwable {}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " try (Y y = new Y();) {\n" +
- " ^^^^^^^\n" +
- "Unhandled exception type WeirdException\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " if (y == null) {}\n" +
- " ^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 5)\n" +
- " Y why = new Y();\n" +
- " ^^^\n" +
- "Resource leak: 'why' is never closed\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " Y why = new Y();\n" +
- " ^^^^^^^\n" +
- "Unhandled exception type WeirdException\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 22)\n" +
- " class WeirdException extends Throwable {}\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The serializable class WeirdException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " try (Y y = new Y();) {\n" +
+ " ^^^^^^^\n" +
+ "Unhandled exception type WeirdException\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " if (y == null) {}\n" +
+ " ^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 5)\n" +
+ " Y why = new Y();\n" +
+ " ^^^\n" +
+ "Resource leak: 'why' is never closed\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " Y why = new Y();\n" +
+ " ^^^^^^^\n" +
+ "Unhandled exception type WeirdException\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 22)\n" +
+ " class WeirdException extends Throwable {}\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The serializable class WeirdException does not declare a static final serialVersionUID field of type long\n" +
"----------\n",
null, true, options);
}
@@ -535,11 +535,11 @@ public void test015() {
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " {}\n" +
- " ^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " {}\n" +
+ " ^^\n" +
+ "Dead code\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings;
runner.runWarningTest();
@@ -572,31 +572,31 @@ public void test016() {
"\n" +
"class WeirdException extends Throwable {}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " try (Y y = new Y();) {\n" +
- " ^^^^^^^\n" +
- "Unhandled exception type WeirdException\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " if (y == null) {}\n" +
- " ^^\n" +
- "Dead code\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 5)\n" +
- " Y why = new Y();\n" +
- " ^^^\n" +
- "Resource leak: 'why' is never closed\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " Y why = new Y();\n" +
- " ^^^^^^^\n" +
- "Unhandled exception type WeirdException\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 20)\n" +
- " class WeirdException extends Throwable {}\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The serializable class WeirdException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " try (Y y = new Y();) {\n" +
+ " ^^^^^^^\n" +
+ "Unhandled exception type WeirdException\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 4)\n" +
+ " if (y == null) {}\n" +
+ " ^^\n" +
+ "Dead code\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 5)\n" +
+ " Y why = new Y();\n" +
+ " ^^^\n" +
+ "Resource leak: 'why' is never closed\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 5)\n" +
+ " Y why = new Y();\n" +
+ " ^^^^^^^\n" +
+ "Unhandled exception type WeirdException\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 20)\n" +
+ " class WeirdException extends Throwable {}\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "The serializable class WeirdException does not declare a static final serialVersionUID field of type long\n" +
"----------\n",
null,
true,
@@ -624,11 +624,11 @@ public void test017() {
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " {}\n" +
- " ^^\n" +
- "Dead code\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " {}\n" +
+ " ^^\n" +
+ "Dead code\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings;
runner.runWarningTest();
@@ -646,11 +646,11 @@ public void test018() {
" }\n" +
"} \n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " try () {\n" +
- " ^\n" +
- "Syntax error on token \"(\", Resources expected after this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " try () {\n" +
+ " ^\n" +
+ "Syntax error on token \"(\", Resources expected after this token\n" +
"----------\n");
}
// Unhandled exception tests
@@ -698,56 +698,56 @@ public void test020() {
"class ZException extends Exception {}\n" +
"class ZZException extends Exception {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " try (X x = new X(); Y y = new Y(); Z z = new Z()) {\n" +
- " ^\n" +
- "Unhandled exception type XXException thrown by automatic close() invocation on x\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " try (X x = new X(); Y y = new Y(); Z z = new Z()) {\n" +
- " ^\n" +
- "Unhandled exception type YYException thrown by automatic close() invocation on y\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " try (X x = new X(); Y y = new Y(); Z z = new Z()) {\n" +
- " ^\n" +
- "Unhandled exception type ZZException thrown by automatic close() invocation on z\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 4)\n" +
- " throw new XXException();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type XXException\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 34)\n" +
- " class XException extends Exception {}\n" +
- " ^^^^^^^^^^\n" +
- "The serializable class XException does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 35)\n" +
- " class XXException extends Exception {}\n" +
- " ^^^^^^^^^^^\n" +
- "The serializable class XXException does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 36)\n" +
- " class YException extends Exception {}\n" +
- " ^^^^^^^^^^\n" +
- "The serializable class YException does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 37)\n" +
- " class YYException extends Exception {}\n" +
- " ^^^^^^^^^^^\n" +
- "The serializable class YYException does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "9. WARNING in X.java (at line 38)\n" +
- " class ZException extends Exception {}\n" +
- " ^^^^^^^^^^\n" +
- "The serializable class ZException does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "10. WARNING in X.java (at line 39)\n" +
- " class ZZException extends Exception {}\n" +
- " ^^^^^^^^^^^\n" +
- "The serializable class ZZException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " try (X x = new X(); Y y = new Y(); Z z = new Z()) {\n" +
+ " ^\n" +
+ "Unhandled exception type XXException thrown by automatic close() invocation on x\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " try (X x = new X(); Y y = new Y(); Z z = new Z()) {\n" +
+ " ^\n" +
+ "Unhandled exception type YYException thrown by automatic close() invocation on y\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " try (X x = new X(); Y y = new Y(); Z z = new Z()) {\n" +
+ " ^\n" +
+ "Unhandled exception type ZZException thrown by automatic close() invocation on z\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 4)\n" +
+ " throw new XXException();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type XXException\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 34)\n" +
+ " class XException extends Exception {}\n" +
+ " ^^^^^^^^^^\n" +
+ "The serializable class XException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 35)\n" +
+ " class XXException extends Exception {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "The serializable class XXException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 36)\n" +
+ " class YException extends Exception {}\n" +
+ " ^^^^^^^^^^\n" +
+ "The serializable class YException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 37)\n" +
+ " class YYException extends Exception {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "The serializable class YYException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "9. WARNING in X.java (at line 38)\n" +
+ " class ZException extends Exception {}\n" +
+ " ^^^^^^^^^^\n" +
+ "The serializable class ZException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "10. WARNING in X.java (at line 39)\n" +
+ " class ZZException extends Exception {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "The serializable class ZZException does not declare a static final serialVersionUID field of type long\n" +
"----------\n");
}
// Resource type test
@@ -766,11 +766,11 @@ public void test021() {
" public void close () {}\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " try (Y i = null) {\n" +
- " ^\n" +
- "The resource type Y does not implement java.lang.AutoCloseable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " try (Y i = null) {\n" +
+ " ^\n" +
+ "The resource type Y does not implement java.lang.AutoCloseable\n" +
"----------\n");
}
// Interface method return type compatibility test
@@ -789,11 +789,11 @@ public void test022() {
" public int close () { return 0; }\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " public int close () { return 0; }\n" +
- " ^^^\n" +
- "The return type is incompatible with AutoCloseable.close()\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " public int close () { return 0; }\n" +
+ " ^^^\n" +
+ "The return type is incompatible with AutoCloseable.close()\n" +
"----------\n");
}
// Exception handling, compatibility tests
@@ -813,21 +813,21 @@ public void test023() {
"}\n" +
"class Blah extends Throwable {}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " try (Y i = null) {\n" +
- " ^\n" +
- "Unhandled exception type Blah thrown by automatic close() invocation on i\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " public void close () throws Blah {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Exception Blah is not compatible with throws clause in AutoCloseable.close()\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 11)\n" +
- " class Blah extends Throwable {}\n" +
- " ^^^^\n" +
- "The serializable class Blah does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " try (Y i = null) {\n" +
+ " ^\n" +
+ "Unhandled exception type Blah thrown by automatic close() invocation on i\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " public void close () throws Blah {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "Exception Blah is not compatible with throws clause in AutoCloseable.close()\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 11)\n" +
+ " class Blah extends Throwable {}\n" +
+ " ^^^^\n" +
+ "The serializable class Blah does not declare a static final serialVersionUID field of type long\n" +
"----------\n");
}
// Exception handling tests
@@ -878,36 +878,36 @@ public void test024() {
"class ZException extends Exception {}\n" +
"class ZZException extends Exception {}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 37)\n" +
- " class XException extends Exception {}\n" +
- " ^^^^^^^^^^\n" +
- "The serializable class XException does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 38)\n" +
- " class XXException extends Exception {}\n" +
- " ^^^^^^^^^^^\n" +
- "The serializable class XXException does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 39)\n" +
- " class YException extends Exception {}\n" +
- " ^^^^^^^^^^\n" +
- "The serializable class YException does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 40)\n" +
- " class YYException extends Exception {}\n" +
- " ^^^^^^^^^^^\n" +
- "The serializable class YYException does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 41)\n" +
- " class ZException extends Exception {}\n" +
- " ^^^^^^^^^^\n" +
- "The serializable class ZException does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 42)\n" +
- " class ZZException extends Exception {}\n" +
- " ^^^^^^^^^^^\n" +
- "The serializable class ZZException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 37)\n" +
+ " class XException extends Exception {}\n" +
+ " ^^^^^^^^^^\n" +
+ "The serializable class XException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 38)\n" +
+ " class XXException extends Exception {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "The serializable class XXException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 39)\n" +
+ " class YException extends Exception {}\n" +
+ " ^^^^^^^^^^\n" +
+ "The serializable class YException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 40)\n" +
+ " class YYException extends Exception {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "The serializable class YYException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 41)\n" +
+ " class ZException extends Exception {}\n" +
+ " ^^^^^^^^^^\n" +
+ "The serializable class ZException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 42)\n" +
+ " class ZZException extends Exception {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "The serializable class ZZException does not declare a static final serialVersionUID field of type long\n" +
"----------\n");
}
// Unhandled exception tests
@@ -955,56 +955,56 @@ public void test025() {
"class ZException extends Exception {}\n" +
"class ZZException extends Exception {}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " try (X x = new X(); Y y = new Y(); Z z = new Z()) {\n" +
- " ^\n" +
- "Unhandled exception type XXException thrown by automatic close() invocation on x\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " try (X x = new X(); Y y = new Y(); Z z = new Z()) {\n" +
- " ^\n" +
- "Unhandled exception type YYException thrown by automatic close() invocation on y\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " try (X x = new X(); Y y = new Y(); Z z = new Z()) {\n" +
- " ^\n" +
- "Unhandled exception type ZZException thrown by automatic close() invocation on z\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 4)\n" +
- " throw new XXException();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unhandled exception type XXException\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 34)\n" +
- " class XException extends Exception {}\n" +
- " ^^^^^^^^^^\n" +
- "The serializable class XException does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 35)\n" +
- " class XXException extends Exception {}\n" +
- " ^^^^^^^^^^^\n" +
- "The serializable class XXException does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 36)\n" +
- " class YException extends Exception {}\n" +
- " ^^^^^^^^^^\n" +
- "The serializable class YException does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 37)\n" +
- " class YYException extends Exception {}\n" +
- " ^^^^^^^^^^^\n" +
- "The serializable class YYException does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "9. WARNING in X.java (at line 38)\n" +
- " class ZException extends Exception {}\n" +
- " ^^^^^^^^^^\n" +
- "The serializable class ZException does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "10. WARNING in X.java (at line 39)\n" +
- " class ZZException extends Exception {}\n" +
- " ^^^^^^^^^^^\n" +
- "The serializable class ZZException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " try (X x = new X(); Y y = new Y(); Z z = new Z()) {\n" +
+ " ^\n" +
+ "Unhandled exception type XXException thrown by automatic close() invocation on x\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " try (X x = new X(); Y y = new Y(); Z z = new Z()) {\n" +
+ " ^\n" +
+ "Unhandled exception type YYException thrown by automatic close() invocation on y\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " try (X x = new X(); Y y = new Y(); Z z = new Z()) {\n" +
+ " ^\n" +
+ "Unhandled exception type ZZException thrown by automatic close() invocation on z\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 4)\n" +
+ " throw new XXException();\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Unhandled exception type XXException\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 34)\n" +
+ " class XException extends Exception {}\n" +
+ " ^^^^^^^^^^\n" +
+ "The serializable class XException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 35)\n" +
+ " class XXException extends Exception {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "The serializable class XXException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 36)\n" +
+ " class YException extends Exception {}\n" +
+ " ^^^^^^^^^^\n" +
+ "The serializable class YException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "8. WARNING in X.java (at line 37)\n" +
+ " class YYException extends Exception {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "The serializable class YYException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "9. WARNING in X.java (at line 38)\n" +
+ " class ZException extends Exception {}\n" +
+ " ^^^^^^^^^^\n" +
+ "The serializable class ZException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "10. WARNING in X.java (at line 39)\n" +
+ " class ZZException extends Exception {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "The serializable class ZZException does not declare a static final serialVersionUID field of type long\n" +
"----------\n");
}
public void test026() {
@@ -1053,36 +1053,36 @@ public void test026() {
"class ZException extends Exception {}\n" +
"class ZZException extends Exception {}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 37)\n" +
- " class XException extends Exception {}\n" +
- " ^^^^^^^^^^\n" +
- "The serializable class XException does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 38)\n" +
- " class XXException extends Exception {}\n" +
- " ^^^^^^^^^^^\n" +
- "The serializable class XXException does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 39)\n" +
- " class YException extends Exception {}\n" +
- " ^^^^^^^^^^\n" +
- "The serializable class YException does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 40)\n" +
- " class YYException extends Exception {}\n" +
- " ^^^^^^^^^^^\n" +
- "The serializable class YYException does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 41)\n" +
- " class ZException extends Exception {}\n" +
- " ^^^^^^^^^^\n" +
- "The serializable class ZException does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 42)\n" +
- " class ZZException extends Exception {}\n" +
- " ^^^^^^^^^^^\n" +
- "The serializable class ZZException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 37)\n" +
+ " class XException extends Exception {}\n" +
+ " ^^^^^^^^^^\n" +
+ "The serializable class XException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 38)\n" +
+ " class XXException extends Exception {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "The serializable class XXException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 39)\n" +
+ " class YException extends Exception {}\n" +
+ " ^^^^^^^^^^\n" +
+ "The serializable class YException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 40)\n" +
+ " class YYException extends Exception {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "The serializable class YYException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 41)\n" +
+ " class ZException extends Exception {}\n" +
+ " ^^^^^^^^^^\n" +
+ "The serializable class ZException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 42)\n" +
+ " class ZZException extends Exception {}\n" +
+ " ^^^^^^^^^^^\n" +
+ "The serializable class ZZException does not declare a static final serialVersionUID field of type long\n" +
"----------\n");
}
public void test027() {
@@ -1123,14 +1123,14 @@ public void test027() {
" }\n" +
"}\n"
},
- "X CTOR\n" +
- "Y CTOR\n" +
- "Body\n" +
- "Y Close\n" +
- "X Close\n" +
- "java.lang.Exception: Body\n" +
- "Suppressed:java.lang.Exception: Y Close\n" +
- "Suppressed:java.lang.Exception: X Close\n" +
+ "X CTOR\n" +
+ "Y CTOR\n" +
+ "Body\n" +
+ "Y Close\n" +
+ "X Close\n" +
+ "java.lang.Exception: Body\n" +
+ "Suppressed:java.lang.Exception: Y Close\n" +
+ "Suppressed:java.lang.Exception: X Close\n" +
"10");
}
public void test028() {
@@ -1161,10 +1161,10 @@ public void test028() {
" }\n" +
"}\n"
},
- "X CTOR\n" +
- "Y CTOR\n" +
- "Body\n" +
- "Y DTOR\n" +
+ "X CTOR\n" +
+ "Y CTOR\n" +
+ "Body\n" +
+ "Y DTOR\n" +
"X DTOR");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=338881
@@ -1242,21 +1242,21 @@ public void test030() { // test return + resources
" }\n" +
"}\n"
},
- "Main\n" +
- "X::X\n" +
- "X::X\n" +
- "Outer Try\n" +
- "Y::Y\n" +
- "Y::Y\n" +
- "Middle Try\n" +
- "Z::Z\n" +
- "Z::Z\n" +
- "Inner Try\n" +
- "Z::~Z\n" +
- "Z::~Z\n" +
- "Y::~Y\n" +
- "Y::~Y\n" +
- "X::~X\n" +
+ "Main\n" +
+ "X::X\n" +
+ "X::X\n" +
+ "Outer Try\n" +
+ "Y::Y\n" +
+ "Y::Y\n" +
+ "Middle Try\n" +
+ "Z::Z\n" +
+ "Z::Z\n" +
+ "Inner Try\n" +
+ "Z::~Z\n" +
+ "Z::~Z\n" +
+ "Y::~Y\n" +
+ "Y::~Y\n" +
+ "X::~X\n" +
"X::~X");
}
public void test030a() { // test return + resources + with exceptions being thrown by close()
@@ -1317,27 +1317,27 @@ public void test030a() { // test return + resources + with exceptions being thr
" }\n" +
"}\n"
},
- "Main\n" +
- "X::X\n" +
- "X::X\n" +
- "Outer Try\n" +
- "Y::Y\n" +
- "Y::Y\n" +
- "Middle Try\n" +
- "Z::Z\n" +
- "Z::Z\n" +
- "Inner Try\n" +
- "Z::~Z\n" +
- "Z::~Z\n" +
- "Y::~Y\n" +
- "Y::~Y\n" +
- "X::~X\n" +
- "X::~X\n" +
- "java.lang.Exception: Z::~Z\n" +
- "Suppressed: java.lang.Exception: Z::~Z\n" +
- "Suppressed: java.lang.Exception: Y::~Y\n" +
- "Suppressed: java.lang.Exception: Y::~Y\n" +
- "Suppressed: java.lang.Exception: X::~X\n" +
+ "Main\n" +
+ "X::X\n" +
+ "X::X\n" +
+ "Outer Try\n" +
+ "Y::Y\n" +
+ "Y::Y\n" +
+ "Middle Try\n" +
+ "Z::Z\n" +
+ "Z::Z\n" +
+ "Inner Try\n" +
+ "Z::~Z\n" +
+ "Z::~Z\n" +
+ "Y::~Y\n" +
+ "Y::~Y\n" +
+ "X::~X\n" +
+ "X::~X\n" +
+ "java.lang.Exception: Z::~Z\n" +
+ "Suppressed: java.lang.Exception: Z::~Z\n" +
+ "Suppressed: java.lang.Exception: Y::~Y\n" +
+ "Suppressed: java.lang.Exception: Y::~Y\n" +
+ "Suppressed: java.lang.Exception: X::~X\n" +
"Suppressed: java.lang.Exception: X::~X");
}
public void test031() { // test break + resources
@@ -1389,22 +1389,22 @@ public void test031() { // test break + resources
" }\n" +
"}\n"
},
- "Main\n" +
- "X::X\n" +
- "X::X\n" +
- "Outer Try\n" +
- "Y::Y\n" +
- "Y::Y\n" +
- "Middle Try\n" +
- "Z::Z\n" +
- "Z::Z\n" +
- "Inner Try\n" +
- "Z::~Z\n" +
- "Z::~Z\n" +
- "Y::~Y\n" +
- "Y::~Y\n" +
- "Out of while\n" +
- "X::~X\n" +
+ "Main\n" +
+ "X::X\n" +
+ "X::X\n" +
+ "Outer Try\n" +
+ "Y::Y\n" +
+ "Y::Y\n" +
+ "Middle Try\n" +
+ "Z::Z\n" +
+ "Z::Z\n" +
+ "Inner Try\n" +
+ "Z::~Z\n" +
+ "Z::~Z\n" +
+ "Y::~Y\n" +
+ "Y::~Y\n" +
+ "Out of while\n" +
+ "X::~X\n" +
"X::~X");
}
public void test032() { // test continue + resources
@@ -1461,25 +1461,25 @@ public void test032() { // test continue + resources
" }\n" +
"}\n"
},
- "Main\n" +
- "X::X\n" +
- "X::X\n" +
- "Outer Try\n" +
- "Y::Y\n" +
- "Y::Y\n" +
- "Middle Try\n" +
- "Z::Z\n" +
- "Z::Z\n" +
- "Inner Try\n" +
- "Z::~Z\n" +
- "Z::~Z\n" +
- "Inner Finally\n" +
- "Y::~Y\n" +
- "Y::~Y\n" +
- "Middle Finally\n" +
- "Out of while\n" +
- "X::~X\n" +
- "X::~X\n" +
+ "Main\n" +
+ "X::X\n" +
+ "X::X\n" +
+ "Outer Try\n" +
+ "Y::Y\n" +
+ "Y::Y\n" +
+ "Middle Try\n" +
+ "Z::Z\n" +
+ "Z::Z\n" +
+ "Inner Try\n" +
+ "Z::~Z\n" +
+ "Z::~Z\n" +
+ "Inner Finally\n" +
+ "Y::~Y\n" +
+ "Y::~Y\n" +
+ "Middle Finally\n" +
+ "Out of while\n" +
+ "X::~X\n" +
+ "X::~X\n" +
"Outer Finally");
}
public void test033() { // test null resources
@@ -1520,10 +1520,10 @@ public void test033() { // test null resources
" }\n" +
"}\n"
},
- "Main\n" +
- "Y::Y\n" +
- "Body\n" +
- "Y::~Y\n" +
+ "Main\n" +
+ "Y::Y\n" +
+ "Body\n" +
+ "Y::~Y\n" +
"Outer Finally");
}
public void test034() {
@@ -1624,9 +1624,9 @@ public void test034() {
" }\n" +
"}\n"
},
- "Main\n" +
- "A::A\n" +
- "java.lang.Exception: A::A\n" +
+ "Main\n" +
+ "A::A\n" +
+ "java.lang.Exception: A::A\n" +
"All done");
}
public void test035() {
@@ -1726,12 +1726,12 @@ public void test035() {
" }\n" +
"}\n"
},
- "Main\n" +
- "A::A\n" +
- "B::B\n" +
- "A::~A\n" +
- "java.lang.Exception: B::B\n" +
- "Suppressed: java.lang.Exception: A::~A\n" +
+ "Main\n" +
+ "A::A\n" +
+ "B::B\n" +
+ "A::~A\n" +
+ "java.lang.Exception: B::B\n" +
+ "Suppressed: java.lang.Exception: A::~A\n" +
"All done");
}
public void test036() {
@@ -1830,16 +1830,16 @@ public void test036() {
" }\n" +
"}\n"
},
- "Main\n" +
- "A::A\n" +
- "B::B\n" +
- "Outer try\n" +
- "C::C\n" +
- "B::~B\n" +
- "A::~A\n" +
- "java.lang.Exception: C::C\n" +
- "Suppressed: java.lang.Exception: B::~B\n" +
- "Suppressed: java.lang.Exception: A::~A\n" +
+ "Main\n" +
+ "A::A\n" +
+ "B::B\n" +
+ "Outer try\n" +
+ "C::C\n" +
+ "B::~B\n" +
+ "A::~A\n" +
+ "java.lang.Exception: C::C\n" +
+ "Suppressed: java.lang.Exception: B::~B\n" +
+ "Suppressed: java.lang.Exception: A::~A\n" +
"All done");
}
public void test037() {
@@ -1937,19 +1937,19 @@ public void test037() {
" }\n" +
"}\n"
},
- "Main\n" +
- "A::A\n" +
- "B::B\n" +
- "Outer try\n" +
- "C::C\n" +
- "D::D\n" +
- "C::~C\n" +
- "B::~B\n" +
- "A::~A\n" +
- "java.lang.Exception: D::D\n" +
- "Suppressed: java.lang.Exception: C::~C\n" +
- "Suppressed: java.lang.Exception: B::~B\n" +
- "Suppressed: java.lang.Exception: A::~A\n" +
+ "Main\n" +
+ "A::A\n" +
+ "B::B\n" +
+ "Outer try\n" +
+ "C::C\n" +
+ "D::D\n" +
+ "C::~C\n" +
+ "B::~B\n" +
+ "A::~A\n" +
+ "java.lang.Exception: D::D\n" +
+ "Suppressed: java.lang.Exception: C::~C\n" +
+ "Suppressed: java.lang.Exception: B::~B\n" +
+ "Suppressed: java.lang.Exception: A::~A\n" +
"All done");
}
public void test038() {
@@ -2046,23 +2046,23 @@ public void test038() {
" }\n" +
"}\n"
},
- "Main\n" +
- "A::A\n" +
- "B::B\n" +
- "Outer try\n" +
- "C::C\n" +
- "D::D\n" +
- "Middle try\n" +
- "E::E\n" +
- "D::~D\n" +
- "C::~C\n" +
- "B::~B\n" +
- "A::~A\n" +
- "java.lang.Exception: E::E\n" +
- "Suppressed: java.lang.Exception: D::~D\n" +
- "Suppressed: java.lang.Exception: C::~C\n" +
- "Suppressed: java.lang.Exception: B::~B\n" +
- "Suppressed: java.lang.Exception: A::~A\n" +
+ "Main\n" +
+ "A::A\n" +
+ "B::B\n" +
+ "Outer try\n" +
+ "C::C\n" +
+ "D::D\n" +
+ "Middle try\n" +
+ "E::E\n" +
+ "D::~D\n" +
+ "C::~C\n" +
+ "B::~B\n" +
+ "A::~A\n" +
+ "java.lang.Exception: E::E\n" +
+ "Suppressed: java.lang.Exception: D::~D\n" +
+ "Suppressed: java.lang.Exception: C::~C\n" +
+ "Suppressed: java.lang.Exception: B::~B\n" +
+ "Suppressed: java.lang.Exception: A::~A\n" +
"All done");
}
public void test039() {
@@ -2158,26 +2158,26 @@ public void test039() {
" }\n" +
"}\n"
},
- "Main\n" +
- "A::A\n" +
- "B::B\n" +
- "Outer try\n" +
- "C::C\n" +
- "D::D\n" +
- "Middle try\n" +
- "E::E\n" +
- "F::F\n" +
- "E::~E\n" +
- "D::~D\n" +
- "C::~C\n" +
- "B::~B\n" +
- "A::~A\n" +
- "java.lang.Exception: F::F\n" +
- "Suppressed: java.lang.Exception: E::~E\n" +
- "Suppressed: java.lang.Exception: D::~D\n" +
- "Suppressed: java.lang.Exception: C::~C\n" +
- "Suppressed: java.lang.Exception: B::~B\n" +
- "Suppressed: java.lang.Exception: A::~A\n" +
+ "Main\n" +
+ "A::A\n" +
+ "B::B\n" +
+ "Outer try\n" +
+ "C::C\n" +
+ "D::D\n" +
+ "Middle try\n" +
+ "E::E\n" +
+ "F::F\n" +
+ "E::~E\n" +
+ "D::~D\n" +
+ "C::~C\n" +
+ "B::~B\n" +
+ "A::~A\n" +
+ "java.lang.Exception: F::F\n" +
+ "Suppressed: java.lang.Exception: E::~E\n" +
+ "Suppressed: java.lang.Exception: D::~D\n" +
+ "Suppressed: java.lang.Exception: C::~C\n" +
+ "Suppressed: java.lang.Exception: B::~B\n" +
+ "Suppressed: java.lang.Exception: A::~A\n" +
"All done");
}
public void test040() {
@@ -2272,29 +2272,29 @@ public void test040() {
" }\n" +
"}\n"
},
- "Main\n" +
- "A::A\n" +
- "B::B\n" +
- "Outer try\n" +
- "C::C\n" +
- "D::D\n" +
- "Middle try\n" +
- "E::E\n" +
- "F::F\n" +
- "Inner try\n" +
- "F::~F\n" +
- "E::~E\n" +
- "D::~D\n" +
- "C::~C\n" +
- "B::~B\n" +
- "A::~A\n" +
- "java.lang.Exception: Body\n" +
- "Suppressed: java.lang.Exception: F::~F\n" +
- "Suppressed: java.lang.Exception: E::~E\n" +
- "Suppressed: java.lang.Exception: D::~D\n" +
- "Suppressed: java.lang.Exception: C::~C\n" +
- "Suppressed: java.lang.Exception: B::~B\n" +
- "Suppressed: java.lang.Exception: A::~A\n" +
+ "Main\n" +
+ "A::A\n" +
+ "B::B\n" +
+ "Outer try\n" +
+ "C::C\n" +
+ "D::D\n" +
+ "Middle try\n" +
+ "E::E\n" +
+ "F::F\n" +
+ "Inner try\n" +
+ "F::~F\n" +
+ "E::~E\n" +
+ "D::~D\n" +
+ "C::~C\n" +
+ "B::~B\n" +
+ "A::~A\n" +
+ "java.lang.Exception: Body\n" +
+ "Suppressed: java.lang.Exception: F::~F\n" +
+ "Suppressed: java.lang.Exception: E::~E\n" +
+ "Suppressed: java.lang.Exception: D::~D\n" +
+ "Suppressed: java.lang.Exception: C::~C\n" +
+ "Suppressed: java.lang.Exception: B::~B\n" +
+ "Suppressed: java.lang.Exception: A::~A\n" +
"All done");
}
public void test041() {
@@ -2388,28 +2388,28 @@ public void test041() {
" }\n" +
"}\n"
},
- "Main\n" +
- "A::A\n" +
- "B::B\n" +
- "Outer try\n" +
- "C::C\n" +
- "D::D\n" +
- "Middle try\n" +
- "E::E\n" +
- "F::F\n" +
- "Inner try\n" +
- "F::~F\n" +
- "E::~E\n" +
- "D::~D\n" +
- "C::~C\n" +
- "B::~B\n" +
- "A::~A\n" +
- "java.lang.Exception: F::~F\n" +
- "Suppressed: java.lang.Exception: E::~E\n" +
- "Suppressed: java.lang.Exception: D::~D\n" +
- "Suppressed: java.lang.Exception: C::~C\n" +
- "Suppressed: java.lang.Exception: B::~B\n" +
- "Suppressed: java.lang.Exception: A::~A\n" +
+ "Main\n" +
+ "A::A\n" +
+ "B::B\n" +
+ "Outer try\n" +
+ "C::C\n" +
+ "D::D\n" +
+ "Middle try\n" +
+ "E::E\n" +
+ "F::F\n" +
+ "Inner try\n" +
+ "F::~F\n" +
+ "E::~E\n" +
+ "D::~D\n" +
+ "C::~C\n" +
+ "B::~B\n" +
+ "A::~A\n" +
+ "java.lang.Exception: F::~F\n" +
+ "Suppressed: java.lang.Exception: E::~E\n" +
+ "Suppressed: java.lang.Exception: D::~D\n" +
+ "Suppressed: java.lang.Exception: C::~C\n" +
+ "Suppressed: java.lang.Exception: B::~B\n" +
+ "Suppressed: java.lang.Exception: A::~A\n" +
"All done");
}
public void test042() {
@@ -2502,27 +2502,27 @@ public void test042() {
" }\n" +
"}\n"
},
- "Main\n" +
- "A::A\n" +
- "B::B\n" +
- "Outer try\n" +
- "C::C\n" +
- "D::D\n" +
- "Middle try\n" +
- "E::E\n" +
- "F::F\n" +
- "Inner try\n" +
- "F::~F\n" +
- "E::~E\n" +
- "D::~D\n" +
- "C::~C\n" +
- "B::~B\n" +
- "A::~A\n" +
- "java.lang.Exception: E::~E\n" +
- "Suppressed: java.lang.Exception: D::~D\n" +
- "Suppressed: java.lang.Exception: C::~C\n" +
- "Suppressed: java.lang.Exception: B::~B\n" +
- "Suppressed: java.lang.Exception: A::~A\n" +
+ "Main\n" +
+ "A::A\n" +
+ "B::B\n" +
+ "Outer try\n" +
+ "C::C\n" +
+ "D::D\n" +
+ "Middle try\n" +
+ "E::E\n" +
+ "F::F\n" +
+ "Inner try\n" +
+ "F::~F\n" +
+ "E::~E\n" +
+ "D::~D\n" +
+ "C::~C\n" +
+ "B::~B\n" +
+ "A::~A\n" +
+ "java.lang.Exception: E::~E\n" +
+ "Suppressed: java.lang.Exception: D::~D\n" +
+ "Suppressed: java.lang.Exception: C::~C\n" +
+ "Suppressed: java.lang.Exception: B::~B\n" +
+ "Suppressed: java.lang.Exception: A::~A\n" +
"All done");
}
public void test043() {
@@ -2614,26 +2614,26 @@ public void test043() {
" }\n" +
"}\n"
},
- "Main\n" +
- "A::A\n" +
- "B::B\n" +
- "Outer try\n" +
- "C::C\n" +
- "D::D\n" +
- "Middle try\n" +
- "E::E\n" +
- "F::F\n" +
- "Inner try\n" +
- "F::~F\n" +
- "E::~E\n" +
- "D::~D\n" +
- "C::~C\n" +
- "B::~B\n" +
- "A::~A\n" +
- "java.lang.Exception: D::~D\n" +
- "Suppressed: java.lang.Exception: C::~C\n" +
- "Suppressed: java.lang.Exception: B::~B\n" +
- "Suppressed: java.lang.Exception: A::~A\n" +
+ "Main\n" +
+ "A::A\n" +
+ "B::B\n" +
+ "Outer try\n" +
+ "C::C\n" +
+ "D::D\n" +
+ "Middle try\n" +
+ "E::E\n" +
+ "F::F\n" +
+ "Inner try\n" +
+ "F::~F\n" +
+ "E::~E\n" +
+ "D::~D\n" +
+ "C::~C\n" +
+ "B::~B\n" +
+ "A::~A\n" +
+ "java.lang.Exception: D::~D\n" +
+ "Suppressed: java.lang.Exception: C::~C\n" +
+ "Suppressed: java.lang.Exception: B::~B\n" +
+ "Suppressed: java.lang.Exception: A::~A\n" +
"All done");
}
public void test044() {
@@ -2724,25 +2724,25 @@ public void test044() {
" }\n" +
"}\n"
},
- "Main\n" +
- "A::A\n" +
- "B::B\n" +
- "Outer try\n" +
- "C::C\n" +
- "D::D\n" +
- "Middle try\n" +
- "E::E\n" +
- "F::F\n" +
- "Inner try\n" +
- "F::~F\n" +
- "E::~E\n" +
- "D::~D\n" +
- "C::~C\n" +
- "B::~B\n" +
- "A::~A\n" +
- "java.lang.Exception: C::~C\n" +
- "Suppressed: java.lang.Exception: B::~B\n" +
- "Suppressed: java.lang.Exception: A::~A\n" +
+ "Main\n" +
+ "A::A\n" +
+ "B::B\n" +
+ "Outer try\n" +
+ "C::C\n" +
+ "D::D\n" +
+ "Middle try\n" +
+ "E::E\n" +
+ "F::F\n" +
+ "Inner try\n" +
+ "F::~F\n" +
+ "E::~E\n" +
+ "D::~D\n" +
+ "C::~C\n" +
+ "B::~B\n" +
+ "A::~A\n" +
+ "java.lang.Exception: C::~C\n" +
+ "Suppressed: java.lang.Exception: B::~B\n" +
+ "Suppressed: java.lang.Exception: A::~A\n" +
"All done");
}
public void test045() {
@@ -2832,24 +2832,24 @@ public void test045() {
" }\n" +
"}\n"
},
- "Main\n" +
- "A::A\n" +
- "B::B\n" +
- "Outer try\n" +
- "C::C\n" +
- "D::D\n" +
- "Middle try\n" +
- "E::E\n" +
- "F::F\n" +
- "Inner try\n" +
- "F::~F\n" +
- "E::~E\n" +
- "D::~D\n" +
- "C::~C\n" +
- "B::~B\n" +
- "A::~A\n" +
- "java.lang.Exception: B::~B\n" +
- "Suppressed: java.lang.Exception: A::~A\n" +
+ "Main\n" +
+ "A::A\n" +
+ "B::B\n" +
+ "Outer try\n" +
+ "C::C\n" +
+ "D::D\n" +
+ "Middle try\n" +
+ "E::E\n" +
+ "F::F\n" +
+ "Inner try\n" +
+ "F::~F\n" +
+ "E::~E\n" +
+ "D::~D\n" +
+ "C::~C\n" +
+ "B::~B\n" +
+ "A::~A\n" +
+ "java.lang.Exception: B::~B\n" +
+ "Suppressed: java.lang.Exception: A::~A\n" +
"All done");
}
public void test046() {
@@ -2938,23 +2938,23 @@ public void test046() {
" }\n" +
"}\n"
},
- "Main\n" +
- "A::A\n" +
- "B::B\n" +
- "Outer try\n" +
- "C::C\n" +
- "D::D\n" +
- "Middle try\n" +
- "E::E\n" +
- "F::F\n" +
- "Inner try\n" +
- "F::~F\n" +
- "E::~E\n" +
- "D::~D\n" +
- "C::~C\n" +
- "B::~B\n" +
- "A::~A\n" +
- "java.lang.Exception: A::~A\n" +
+ "Main\n" +
+ "A::A\n" +
+ "B::B\n" +
+ "Outer try\n" +
+ "C::C\n" +
+ "D::D\n" +
+ "Middle try\n" +
+ "E::E\n" +
+ "F::F\n" +
+ "Inner try\n" +
+ "F::~F\n" +
+ "E::~E\n" +
+ "D::~D\n" +
+ "C::~C\n" +
+ "B::~B\n" +
+ "A::~A\n" +
+ "java.lang.Exception: A::~A\n" +
"All done");
}
public void test047() {
@@ -3042,22 +3042,22 @@ public void test047() {
" }\n" +
"}\n"
},
- "Main\n" +
- "A::A\n" +
- "B::B\n" +
- "Outer try\n" +
- "C::C\n" +
- "D::D\n" +
- "Middle try\n" +
- "E::E\n" +
- "F::F\n" +
- "Inner try\n" +
- "F::~F\n" +
- "E::~E\n" +
- "D::~D\n" +
- "C::~C\n" +
- "B::~B\n" +
- "A::~A\n" +
+ "Main\n" +
+ "A::A\n" +
+ "B::B\n" +
+ "Outer try\n" +
+ "C::C\n" +
+ "D::D\n" +
+ "Middle try\n" +
+ "E::E\n" +
+ "F::F\n" +
+ "Inner try\n" +
+ "F::~F\n" +
+ "E::~E\n" +
+ "D::~D\n" +
+ "C::~C\n" +
+ "B::~B\n" +
+ "A::~A\n" +
"All done");
}
public void test048() {
@@ -3131,22 +3131,22 @@ public void test048() {
" } \n" +
"}\n"
},
- "Main\n" +
- "A::A\n" +
- "X::Try\n" +
- "A::~A\n" +
- "B::B\n" +
- "A::~A::Try\n" +
- "B::~B\n" +
- "C::C\n" +
- "B::~B::Try\n" +
- "C::~C\n" +
- "java.lang.Exception: B::~B\n" +
- "Suppressed: java.lang.Exception: C::~C\n" +
- "java.lang.Exception: A::~A\n" +
- "Suppressed: java.lang.Exception: B::~B\n" +
- "java.lang.Exception: X::Main\n" +
- "Suppressed: java.lang.Exception: A::~A\n" +
+ "Main\n" +
+ "A::A\n" +
+ "X::Try\n" +
+ "A::~A\n" +
+ "B::B\n" +
+ "A::~A::Try\n" +
+ "B::~B\n" +
+ "C::C\n" +
+ "B::~B::Try\n" +
+ "C::~C\n" +
+ "java.lang.Exception: B::~B\n" +
+ "Suppressed: java.lang.Exception: C::~C\n" +
+ "java.lang.Exception: A::~A\n" +
+ "Suppressed: java.lang.Exception: B::~B\n" +
+ "java.lang.Exception: X::Main\n" +
+ "Suppressed: java.lang.Exception: A::~A\n" +
"All done");
}
//ensure that it doesn't completely fail when using TWR and 1.5 mode
@@ -3179,11 +3179,11 @@ public void test049() {
"}\n"
};
runner.expectedCompilerLog =
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " try(FileReader fileReader = new FileReader(file);) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Resource specification not allowed here for source level below 1.7\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 7)\n" +
+ " try(FileReader fileReader = new FileReader(file);) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Resource specification not allowed here for source level below 1.7\n" +
"----------\n";
runner.javacTestOptions = JavacTestOptions.forRelease("5");
runner.runNegativeTest();
@@ -3220,11 +3220,11 @@ public void test050() {
" }\n" +
"}"
},
- "Main\n" +
- "E::E\n" +
- "Outer try\n" +
- "E::~E\n" +
- "java.lang.Exception: E::~E\n" +
+ "Main\n" +
+ "E::E\n" +
+ "Outer try\n" +
+ "E::~E\n" +
+ "java.lang.Exception: E::~E\n" +
"All done");
}
public void test051() {
@@ -3277,13 +3277,13 @@ public void test052() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " try (Test t = new Test()) {\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Resource specification not allowed here for source level below 1.7\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " try (Test t = new Test()) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Resource specification not allowed here for source level below 1.7\n" +
"----------\n",
- null,
+ null,
true,
options);
}
@@ -3309,31 +3309,31 @@ public void test053() {
"}\n" +
"interface Managed extends AutoCloseable {}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " try (Y y = new Y()) { \n" +
- " ^\n" +
- "Unhandled exception type ClassNotFoundException thrown by automatic close() invocation on y\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " try (Y y = new Y()) { \n" +
- " ^\n" +
- "Unhandled exception type IOException thrown by automatic close() invocation on y\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " try (Y y = new Y()) { \n" +
- " ^^^^^^^\n" +
- "Unhandled exception type CloneNotSupportedException\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 4)\n" +
- " y.close();\n" +
- " ^^^^^^^^^\n" +
- "Unhandled exception type ClassNotFoundException\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 4)\n" +
- " y.close();\n" +
- " ^^^^^^^^^\n" +
- "Unhandled exception type IOException\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " try (Y y = new Y()) { \n" +
+ " ^\n" +
+ "Unhandled exception type ClassNotFoundException thrown by automatic close() invocation on y\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " try (Y y = new Y()) { \n" +
+ " ^\n" +
+ "Unhandled exception type IOException thrown by automatic close() invocation on y\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " try (Y y = new Y()) { \n" +
+ " ^^^^^^^\n" +
+ "Unhandled exception type CloneNotSupportedException\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 4)\n" +
+ " y.close();\n" +
+ " ^^^^^^^^^\n" +
+ "Unhandled exception type ClassNotFoundException\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 4)\n" +
+ " y.close();\n" +
+ " ^^^^^^^^^\n" +
+ "Unhandled exception type IOException\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=348705
@@ -3360,31 +3360,31 @@ public void test053a() {
"}\n" +
"interface Managed extends AutoCloseable {}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " try (Y y = new Y()) { \n" +
- " ^\n" +
- "Unhandled exception type ClassNotFoundException thrown by automatic close() invocation on y\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " try (Y y = new Y()) { \n" +
- " ^\n" +
- "Unhandled exception type IOException thrown by automatic close() invocation on y\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " try (Y y = new Y()) { \n" +
- " ^^^^^^^\n" +
- "Unhandled exception type CloneNotSupportedException\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 4)\n" +
- " y.close();\n" +
- " ^^^^^^^^^\n" +
- "Unhandled exception type ClassNotFoundException\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 4)\n" +
- " y.close();\n" +
- " ^^^^^^^^^\n" +
- "Unhandled exception type IOException\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " try (Y y = new Y()) { \n" +
+ " ^\n" +
+ "Unhandled exception type ClassNotFoundException thrown by automatic close() invocation on y\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " try (Y y = new Y()) { \n" +
+ " ^\n" +
+ "Unhandled exception type IOException thrown by automatic close() invocation on y\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " try (Y y = new Y()) { \n" +
+ " ^^^^^^^\n" +
+ "Unhandled exception type CloneNotSupportedException\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 4)\n" +
+ " y.close();\n" +
+ " ^^^^^^^^^\n" +
+ "Unhandled exception type ClassNotFoundException\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 4)\n" +
+ " y.close();\n" +
+ " ^^^^^^^^^\n" +
+ "Unhandled exception type IOException\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=349862 (NPE when union type is used in the resource section.)
@@ -3400,11 +3400,11 @@ public void test054() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " try (Object | Integer res = null) {\n" +
- " ^\n" +
- "Syntax error on token \"|\", . expected\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " try (Object | Integer res = null) {\n" +
+ " ^\n" +
+ "Syntax error on token \"|\", . expected\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=349862 (NPE when union type is used in the resource section.)
@@ -3420,11 +3420,11 @@ public void test054a() {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " try (Object.Integer res = null) {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Object.Integer cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " try (Object.Integer res = null) {\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Object.Integer cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=353535 (verify error with try with resources)
@@ -3492,7 +3492,7 @@ public void test057() {
" }\n" +
" }\n" +
"}\n"
- }, "");
+ }, "");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=364008
public void test058() {
@@ -3513,7 +3513,7 @@ public void test058() {
" }\n" +
" }\n" +
"}\n"
- }, "");
+ }, "");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=367566 - In try-with-resources statement close() method of resource is not called
public void test059() {
@@ -3538,8 +3538,8 @@ public void test059() {
" isOpen = false;\n" +
" }\n" +
"}\n"
- },
- "false");
+ },
+ "false");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=367566 - In try-with-resources statement close() method of resource is not called
@@ -3607,40 +3607,40 @@ public void test060() {
" System.out.println(\"Z::~Z\");\n" +
" }\n" +
"}\n"
- },
- "Main\n" +
- "X::X\n" +
- "X::X\n" +
- "X::~X\n" +
- "X::~X\n" +
- "true\n" +
- "Main\n" +
- "X::X\n" +
- "X::X\n" +
- "Outer Try\n" +
- "Y::Y\n" +
- "Y::Y\n" +
- "Y::~Y\n" +
- "Y::~Y\n" +
- "X::~X\n" +
- "X::~X\n" +
- "true\n" +
- "Main\n" +
- "X::X\n" +
- "X::X\n" +
- "Outer Try\n" +
- "Y::Y\n" +
- "Y::Y\n" +
- "Middle Try\n" +
- "Z::Z\n" +
- "Z::Z\n" +
- "Inner Try\n" +
- "Z::~Z\n" +
- "Z::~Z\n" +
- "Y::~Y\n" +
- "Y::~Y\n" +
- "X::~X\n" +
- "X::~X\n" +
+ },
+ "Main\n" +
+ "X::X\n" +
+ "X::X\n" +
+ "X::~X\n" +
+ "X::~X\n" +
+ "true\n" +
+ "Main\n" +
+ "X::X\n" +
+ "X::X\n" +
+ "Outer Try\n" +
+ "Y::Y\n" +
+ "Y::Y\n" +
+ "Y::~Y\n" +
+ "Y::~Y\n" +
+ "X::~X\n" +
+ "X::~X\n" +
+ "true\n" +
+ "Main\n" +
+ "X::X\n" +
+ "X::X\n" +
+ "Outer Try\n" +
+ "Y::Y\n" +
+ "Y::Y\n" +
+ "Middle Try\n" +
+ "Z::Z\n" +
+ "Z::Z\n" +
+ "Inner Try\n" +
+ "Z::~Z\n" +
+ "Z::~Z\n" +
+ "Y::~Y\n" +
+ "Y::~Y\n" +
+ "X::~X\n" +
+ "X::~X\n" +
"true");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=375248 (AIOOB with try with resources)
@@ -3774,7 +3774,7 @@ public void test375248c() {
" System.out.println(\"Try\");\n" +
" throw new Exception();\n" +
" } catch (Exception e) {\n" +
- " System.out.println(\"Catch\");\n"+
+ " System.out.println(\"Catch\");\n"+
" return;\n" +
" } finally {\n" +
" System.out.println(\"Finally\");\n" +
@@ -3786,11 +3786,11 @@ public void test375248c() {
" public static void main(String[] args) {\n" +
" new X().foo();\n" +
" }\n" +
- "}\n"
+ "}\n"
},
- "Try\n" +
- "Close\n" +
- "Catch\n" +
+ "Try\n" +
+ "Close\n" +
+ "Catch\n" +
"Finally");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=375248 (AIOOB with try with resources)
@@ -3811,7 +3811,7 @@ public void test375248d() {
" try (X x = new X()) {\n" +
" System.out.println(\"Try\");\n" +
" } catch (Exception e) {\n" +
- " System.out.println(\"Catch\");\n"+
+ " System.out.println(\"Catch\");\n"+
" return;\n" +
" } finally {\n" +
" System.out.println(\"Finally\");\n" +
@@ -3824,10 +3824,10 @@ public void test375248d() {
" public static void main(String[] args) {\n" +
" new X().foo();\n" +
" }\n" +
- "}\n"
+ "}\n"
},
- "Try\n" +
- "Close\n" +
+ "Try\n" +
+ "Close\n" +
"Finally");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=375326
@@ -3835,26 +3835,26 @@ public void test375326() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) throws Exception {\n" +
- " HasAutoCloseable a;\n" +
- " try(AutoCloseable b=(a=new HasAutoCloseable()).a) {\n" +
- " }\n" +
- " System.out.println(a);\n" +
- " }\n" +
- " public static class AutoCloseableA implements AutoCloseable {\n" +
- " @Override\n" +
- " public void close() {\n" +
- " // TODO Auto-generated method stub\n" +
- " }\n" +
- " }\n" +
- " public static class HasAutoCloseable {\n" +
- " AutoCloseable a = new AutoCloseableA();\n" +
- " public String toString() {\n" +
- " return \"SUCCESS\";\n" +
- " }\n" +
- " }\n" +
- "}"
+ "public class X {\n" +
+ " public static void main(String[] args) throws Exception {\n" +
+ " HasAutoCloseable a;\n" +
+ " try(AutoCloseable b=(a=new HasAutoCloseable()).a) {\n" +
+ " }\n" +
+ " System.out.println(a);\n" +
+ " }\n" +
+ " public static class AutoCloseableA implements AutoCloseable {\n" +
+ " @Override\n" +
+ " public void close() {\n" +
+ " // TODO Auto-generated method stub\n" +
+ " }\n" +
+ " }\n" +
+ " public static class HasAutoCloseable {\n" +
+ " AutoCloseable a = new AutoCloseableA();\n" +
+ " public String toString() {\n" +
+ " return \"SUCCESS\";\n" +
+ " }\n" +
+ " }\n" +
+ "}"
},
"SUCCESS");
}
@@ -3883,11 +3883,11 @@ public void test375326a() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " System.out.println(aLocal.toString()); \n" +
- " ^^^^^^\n" +
- "The local variable aLocal may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " System.out.println(aLocal.toString()); \n" +
+ " ^^^^^^\n" +
+ "The local variable aLocal may not have been initialized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=375326
@@ -3915,11 +3915,11 @@ public void test375326b() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " System.out.println(aLocal.toString()); \n" +
- " ^^^^^^\n" +
- "The local variable aLocal may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " System.out.println(aLocal.toString()); \n" +
+ " ^^^^^^\n" +
+ "The local variable aLocal may not have been initialized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=375326
@@ -3927,30 +3927,30 @@ public void test375326c() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) throws Exception {\n" +
- " HasAutoCloseable a;\n" +
- " try(AutoCloseable b=(a=new HasAutoCloseable()).a) {\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) throws Exception {\n" +
+ " HasAutoCloseable a;\n" +
+ " try(AutoCloseable b=(a=new HasAutoCloseable()).a) {\n" +
" } finally {\n" +
" System.out.println(\"Finally\");\n" +
" }\n" +
- " System.out.println(a);\n" +
- " }\n" +
- " public static class AutoCloseableA implements AutoCloseable {\n" +
- " @Override\n" +
- " public void close() {\n" +
- " // TODO Auto-generated method stub\n" +
- " }\n" +
- " }\n" +
- " public static class HasAutoCloseable {\n" +
- " AutoCloseable a = new AutoCloseableA();\n" +
- " public String toString() {\n" +
- " return \"SUCCESS\";\n" +
- " }\n" +
- " }\n" +
- "}"
+ " System.out.println(a);\n" +
+ " }\n" +
+ " public static class AutoCloseableA implements AutoCloseable {\n" +
+ " @Override\n" +
+ " public void close() {\n" +
+ " // TODO Auto-generated method stub\n" +
+ " }\n" +
+ " }\n" +
+ " public static class HasAutoCloseable {\n" +
+ " AutoCloseable a = new AutoCloseableA();\n" +
+ " public String toString() {\n" +
+ " return \"SUCCESS\";\n" +
+ " }\n" +
+ " }\n" +
+ "}"
},
- "Finally\n" +
+ "Finally\n" +
"SUCCESS");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=375326
@@ -3980,11 +3980,11 @@ public void test375326d() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " System.out.println(aLocal.toString()); \n" +
- " ^^^^^^\n" +
- "The local variable aLocal may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " System.out.println(aLocal.toString()); \n" +
+ " ^^^^^^\n" +
+ "The local variable aLocal may not have been initialized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=375326
@@ -4014,11 +4014,11 @@ public void test375326e() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " System.out.println(aLocal.toString()); \n" +
- " ^^^^^^\n" +
- "The local variable aLocal may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " System.out.println(aLocal.toString()); \n" +
+ " ^^^^^^\n" +
+ "The local variable aLocal may not have been initialized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=375326
@@ -4044,11 +4044,11 @@ public void test375326f() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " System.out.println(a);\n" +
- " ^\n" +
- "The local variable a may not have been initialized\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " System.out.println(a);\n" +
+ " ^\n" +
+ "The local variable a may not have been initialized\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=375326
@@ -4078,21 +4078,21 @@ public void test375326g() {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 1)\n" +
- " class CheckedException extends Throwable {}\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The serializable class CheckedException does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " System.out.println(a);\n" +
- " ^\n" +
- "The local variable a may not have been initialized\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " System.out.println(a);\n" +
- " ^\n" +
- "The local variable a may not have been initialized\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 1)\n" +
+ " class CheckedException extends Throwable {}\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "The serializable class CheckedException does not declare a static final serialVersionUID field of type long\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " System.out.println(a);\n" +
+ " ^\n" +
+ "The local variable a may not have been initialized\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 10)\n" +
+ " System.out.println(a);\n" +
+ " ^\n" +
+ "The local variable a may not have been initialized\n" +
"----------\n");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=380112
@@ -4112,7 +4112,7 @@ public void test380112a() {
" public static I getX() { return null;}\n"+
" public X(){}\n" +
"}\n"
- },
+ },
"Done");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=380112
@@ -4134,7 +4134,7 @@ public void test380112b() {
" public static I getX() { return null;}\n"+
" public X(){}\n" +
"}\n"
- },
+ },
"Done");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=380112
@@ -4157,7 +4157,7 @@ public void test380112c() {
" public static I getX() { return null;}\n"+
" public X(){}\n" +
"}\n"
- },
+ },
"Done");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=380112
@@ -4180,7 +4180,7 @@ public void test380112d() {
" public static I getX() { return null;}\n"+
" public X(){}\n" +
"}\n"
- },
+ },
"Done");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=380112
@@ -4212,36 +4212,36 @@ public void test380112e() {
public void test394780() {
this.runConformTest(
new String[] {
- "X.java",
- "public class X<R extends Resource> {\n" +
- " public static void main(String[] args) {\n" +
- " X<Resource> m = new X<>();\n" +
- " m.tryWithResource(new ResourceImpl());\n" +
- " }\n" +
- " public void tryWithResource(R resource) {\n" +
- " try (R r = resource) {\n" +
- " r.compute();\n" +
- " }\n" +
- " }\n" +
+ "X.java",
+ "public class X<R extends Resource> {\n" +
+ " public static void main(String[] args) {\n" +
+ " X<Resource> m = new X<>();\n" +
+ " m.tryWithResource(new ResourceImpl());\n" +
+ " }\n" +
+ " public void tryWithResource(R resource) {\n" +
+ " try (R r = resource) {\n" +
+ " r.compute();\n" +
+ " }\n" +
+ " }\n" +
"}",
"Resource.java",
- "public interface Resource extends AutoCloseable {\n" +
- " void compute();\n" +
- " @Override\n" +
- " public void close();\n" +
+ "public interface Resource extends AutoCloseable {\n" +
+ " void compute();\n" +
+ " @Override\n" +
+ " public void close();\n" +
"}",
"ResourceImpl.java",
- "public class ResourceImpl implements Resource {\n" +
- " @Override\n" +
- " public void close() {\n" +
- " System.out.print(\"close\");\n" +
- " }\n" +
- " @Override\n" +
- " public void compute() {\n" +
- " System.out.print(\"compute\");\n" +
- " }\n" +
+ "public class ResourceImpl implements Resource {\n" +
+ " @Override\n" +
+ " public void close() {\n" +
+ " System.out.print(\"close\");\n" +
+ " }\n" +
+ " @Override\n" +
+ " public void compute() {\n" +
+ " System.out.print(\"compute\");\n" +
+ " }\n" +
"}"
- },
+ },
"computeclose");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=533187
@@ -4249,36 +4249,36 @@ public void testBug533187() {
this.runConformTest(
true,
new String[] {
- "Stuck.java",
- "public class Stuck {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(snippet1());\n" +
- " }\n" +
- " public static String snippet1() {\n" +
- " try {\n" +
- " synchronized (String.class) {\n" +
- " try (AutoCloseable scope = null) { \n" +
- " return \"RETURN\";\n" +
- " } catch (Throwable t) {\n" +
- " return t.toString();\n" +
- " }\n" +
- " }\n" +
- " } finally {\n" +
- " raise();\n" +
- " }\n" +
- " }\n" +
- " public static void raise() {\n" +
- " throw new RuntimeException();\n" +
- " }\n" +
+ "Stuck.java",
+ "public class Stuck {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(snippet1());\n" +
+ " }\n" +
+ " public static String snippet1() {\n" +
+ " try {\n" +
+ " synchronized (String.class) {\n" +
+ " try (AutoCloseable scope = null) { \n" +
+ " return \"RETURN\";\n" +
+ " } catch (Throwable t) {\n" +
+ " return t.toString();\n" +
+ " }\n" +
+ " }\n" +
+ " } finally {\n" +
+ " raise();\n" +
+ " }\n" +
+ " }\n" +
+ " public static void raise() {\n" +
+ " throw new RuntimeException();\n" +
+ " }\n" +
"}"
},
null,
null,
null,
null,
- "java.lang.RuntimeException\n" +
- " at Stuck.raise(Stuck.java:19)\n" +
- " at Stuck.snippet1(Stuck.java:15)\n" +
+ "java.lang.RuntimeException\n" +
+ " at Stuck.raise(Stuck.java:19)\n" +
+ " at Stuck.snippet1(Stuck.java:15)\n" +
" at Stuck.main(Stuck.java:3)\n",
null);
}
@@ -4287,27 +4287,27 @@ public void testBug467230() {
this.runConformTest(
true,
new String[] {
- "Test.java",
- "public class Test {\n" +
- " static class C implements AutoCloseable {\n" +
- " @Override\n" +
- " public void close() {\n" +
- " System.out.println(\"close\");\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " try (C c = new C()) {\n" +
- " return;\n" +
- " } catch (Exception e) {\n" +
- " System.out.println(\"catch\");\n" +
- " } finally {\n" +
- " f();\n" +
- " }\n" +
- " }\n" +
- " private static void f() {\n" +
- " System.out.println(\"finally\");\n" +
- " throw new RuntimeException();\n" +
- " }\n" +
+ "Test.java",
+ "public class Test {\n" +
+ " static class C implements AutoCloseable {\n" +
+ " @Override\n" +
+ " public void close() {\n" +
+ " System.out.println(\"close\");\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " try (C c = new C()) {\n" +
+ " return;\n" +
+ " } catch (Exception e) {\n" +
+ " System.out.println(\"catch\");\n" +
+ " } finally {\n" +
+ " f();\n" +
+ " }\n" +
+ " }\n" +
+ " private static void f() {\n" +
+ " System.out.println(\"finally\");\n" +
+ " throw new RuntimeException();\n" +
+ " }\n" +
"}"
},
null,
@@ -4315,8 +4315,8 @@ public void testBug467230() {
null,
"close\n" +
"finally",
- "java.lang.RuntimeException\n" +
- " at Test.f(Test.java:19)\n" +
+ "java.lang.RuntimeException\n" +
+ " at Test.f(Test.java:19)\n" +
" at Test.main(Test.java:14)\n",
null);
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TypeAnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TypeAnnotationTest.java
index b960a1db0..3d4571d00 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TypeAnnotationTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TypeAnnotationTest.java
@@ -16,7 +16,7 @@
* Bug 409246 - [1.8][compiler] Type annotations on catch parameters not handled properly
* Bug 409517 - [1.8][compiler] Type annotation problems on more elaborate array references
* Bug 415821 - [1.8][compiler] CLASS_EXTENDS target type annotation missing for anonymous classes
- * Bug 426616 - [1.8][compiler] Type Annotations, multiple problems
+ * Bug 426616 - [1.8][compiler] Type Annotations, multiple problems
* Stephan Herrmann - Contribution for
* Bug 415911 - [1.8][compiler] NPE when TYPE_USE annotated method with missing return type
* Bug 416176 - [1.8][compiler][null] null type annotations cause grief on type variables
@@ -60,7 +60,7 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_8);
return defaultOptions;
}
-
+
private static final String HELPER_CLASS =
"import java.lang.annotation.*;\n"+
"import java.lang.reflect.*;\n"+
@@ -110,7 +110,7 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
" System.out.print(\"\\n\");\n"+
" }\n"+
"}\n";
-
+
// http://types.cs.washington.edu/jsr308/specification/java-annotation-design.pdf
// type_annotation {
// // New fields in JSR 308:
@@ -137,7 +137,7 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
// element_value value;
// } element_value_pairs[num_element_value_pairs];
// }
-
+
public void test001_classTypeParameter() throws Exception {
this.runConformTest(
new String[] {
@@ -145,18 +145,18 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"public class X<@Marker T> {}",
"Marker.java",
- "import java.lang.annotation.*;\n" +
+ "import java.lang.annotation.*;\n" +
"@Retention(RetentionPolicy.RUNTIME)\n"+
- "@Target(ElementType.TYPE_PARAMETER)\n" +
- "@interface Marker {}",
+ "@Target(ElementType.TYPE_PARAMETER)\n" +
+ "@interface Marker {}",
},
"");
// javac-b81: 9[0 1 0 0 0 0 13 0 0] (13=Marker annotation)
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #21 @Marker(\n" +
- " target type = 0x0 CLASS_TYPE_PARAMETER\n" +
- " type parameter index = 0\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #21 @Marker(\n" +
+ " target type = 0x0 CLASS_TYPE_PARAMETER\n" +
+ " type parameter index = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -168,13 +168,13 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"public class X<@Marker T> {\n"+
" public static void main(String[] argv) { Helper.printTypeAnnotations2(X.class);}\n"+
"}",
-
+
"Helper.java",HELPER_CLASS,
"Marker.java",
- "import java.lang.annotation.*;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.*;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
"@Retention(RetentionPolicy.RUNTIME)\n"+
- "@Target(TYPE_PARAMETER)\n" +
+ "@Target(TYPE_PARAMETER)\n" +
"@interface Marker {}",
},
"X<@Marker T>");
@@ -187,39 +187,39 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"public class X<@A1 T1,@A2 @A3 T2> {}",
"A1.java",
- "import java.lang.annotation.*;\n" +
+ "import java.lang.annotation.*;\n" +
"@Retention(RetentionPolicy.RUNTIME)\n"+
- "@Target(ElementType.TYPE_PARAMETER)\n" +
+ "@Target(ElementType.TYPE_PARAMETER)\n" +
"@interface A1 {}",
-
+
"A2.java",
- "import java.lang.annotation.*;\n" +
+ "import java.lang.annotation.*;\n" +
"@Retention(RetentionPolicy.RUNTIME)\n"+
- "@Target(ElementType.TYPE_PARAMETER)\n" +
+ "@Target(ElementType.TYPE_PARAMETER)\n" +
"@interface A2 {}",
-
+
"A3.java",
- "import java.lang.annotation.*;\n" +
+ "import java.lang.annotation.*;\n" +
"@Retention(RetentionPolicy.RUNTIME)\n"+
- "@Target(ElementType.TYPE_PARAMETER)\n" +
+ "@Target(ElementType.TYPE_PARAMETER)\n" +
"@interface A3 {}",
},
"");
// javac-b81: 9[0 1 0 0 0 0 13 0 0] (13=Marker)
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #21 @A1(\n" +
- " target type = 0x0 CLASS_TYPE_PARAMETER\n" +
- " type parameter index = 0\n" +
- " )\n" +
- " #22 @A2(\n" +
- " target type = 0x0 CLASS_TYPE_PARAMETER\n" +
- " type parameter index = 1\n" +
- " )\n" +
- " #23 @A3(\n" +
- " target type = 0x0 CLASS_TYPE_PARAMETER\n" +
- " type parameter index = 1\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #21 @A1(\n" +
+ " target type = 0x0 CLASS_TYPE_PARAMETER\n" +
+ " type parameter index = 0\n" +
+ " )\n" +
+ " #22 @A2(\n" +
+ " target type = 0x0 CLASS_TYPE_PARAMETER\n" +
+ " type parameter index = 1\n" +
+ " )\n" +
+ " #23 @A3(\n" +
+ " target type = 0x0 CLASS_TYPE_PARAMETER\n" +
+ " type parameter index = 1\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -231,109 +231,109 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"public class X<@A1 T1,@A2 @A3 T2> {\n"+
" public static void main(String[] argv) { Helper.printTypeAnnotations2(X.class); }\n"+
"}",
-
+
"Helper.java",HELPER_CLASS,
"A1.java",
- "import java.lang.annotation.*;\n" +
+ "import java.lang.annotation.*;\n" +
"@Retention(RetentionPolicy.RUNTIME)\n"+
- "@Target(ElementType.TYPE_PARAMETER)\n" +
+ "@Target(ElementType.TYPE_PARAMETER)\n" +
"@interface A1 {}",
"A2.java",
- "import java.lang.annotation.*;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.*;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
"@Retention(RetentionPolicy.RUNTIME)\n"+
- "@Target(TYPE_PARAMETER)\n" +
+ "@Target(TYPE_PARAMETER)\n" +
"@interface A2 {}",
"A3.java",
- "import java.lang.annotation.*;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.*;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
"@Retention(RetentionPolicy.RUNTIME)\n"+
- "@Target(TYPE_PARAMETER)\n" +
+ "@Target(TYPE_PARAMETER)\n" +
"@interface A3 {}",
},
"X<@A1 T1,@A2 @A3 T2>");
}
-
+
public void test005_classTypeParameter() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_PARAMETER)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_PARAMETER)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_PARAMETER)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_PARAMETER)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"X.java",
"public class X<@A @B(3) T> {}",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #25 @A(\n" +
- " target type = 0x0 CLASS_TYPE_PARAMETER\n" +
- " type parameter index = 0\n" +
- " )\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #21 @B(\n" +
- " #22 value=(int) 3 (constant type)\n" +
- " target type = 0x0 CLASS_TYPE_PARAMETER\n" +
- " type parameter index = 0\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #25 @A(\n" +
+ " target type = 0x0 CLASS_TYPE_PARAMETER\n" +
+ " type parameter index = 0\n" +
+ " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #21 @B(\n" +
+ " #22 value=(int) 3 (constant type)\n" +
+ " target type = 0x0 CLASS_TYPE_PARAMETER\n" +
+ " type parameter index = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test006_classTypeParameter() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_PARAMETER)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_PARAMETER)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_PARAMETER)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_PARAMETER)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"X.java",
"public class X<T1,T2,@A @B(3) T3> {}",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #25 @A(\n" +
- " target type = 0x0 CLASS_TYPE_PARAMETER\n" +
- " type parameter index = 2\n" +
- " )\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #21 @B(\n" +
- " #22 value=(int) 3 (constant type)\n" +
- " target type = 0x0 CLASS_TYPE_PARAMETER\n" +
- " type parameter index = 2\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #25 @A(\n" +
+ " target type = 0x0 CLASS_TYPE_PARAMETER\n" +
+ " type parameter index = 2\n" +
+ " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #21 @B(\n" +
+ " #22 value=(int) 3 (constant type)\n" +
+ " target type = 0x0 CLASS_TYPE_PARAMETER\n" +
+ " type parameter index = 2\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -342,97 +342,97 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_PARAMETER)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_PARAMETER)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_PARAMETER)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_PARAMETER)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"X.java",
- "public class X {\n" +
- " <@A @B(3) T> void foo(T t) {}\n" +
+ "public class X {\n" +
+ " <@A @B(3) T> void foo(T t) {}\n" +
"}",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #27 @A(\n" +
- " target type = 0x1 METHOD_TYPE_PARAMETER\n" +
- " type parameter index = 0\n" +
- " )\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #23 @B(\n" +
- " #24 value=(int) 3 (constant type)\n" +
- " target type = 0x1 METHOD_TYPE_PARAMETER\n" +
- " type parameter index = 0\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #27 @A(\n" +
+ " target type = 0x1 METHOD_TYPE_PARAMETER\n" +
+ " type parameter index = 0\n" +
+ " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #23 @B(\n" +
+ " #24 value=(int) 3 (constant type)\n" +
+ " target type = 0x1 METHOD_TYPE_PARAMETER\n" +
+ " type parameter index = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test008_methodTypeParameter() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_PARAMETER)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_PARAMETER)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_PARAMETER)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_PARAMETER)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"X.java",
- "public class X {\n" +
- " <T1, @A @B(3) T2> void foo(T1 t1,T2 t2) {}\n" +
+ "public class X {\n" +
+ " <T1, @A @B(3) T2> void foo(T1 t1,T2 t2) {}\n" +
"}",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #29 @A(\n" +
- " target type = 0x1 METHOD_TYPE_PARAMETER\n" +
- " type parameter index = 1\n" +
- " )\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #25 @B(\n" +
- " #26 value=(int) 3 (constant type)\n" +
- " target type = 0x1 METHOD_TYPE_PARAMETER\n" +
- " type parameter index = 1\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #29 @A(\n" +
+ " target type = 0x1 METHOD_TYPE_PARAMETER\n" +
+ " type parameter index = 1\n" +
+ " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #25 @B(\n" +
+ " #26 value=(int) 3 (constant type)\n" +
+ " target type = 0x1 METHOD_TYPE_PARAMETER\n" +
+ " type parameter index = 1\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test009_classExtends() throws Exception {
this.runConformTest(
new String[] {
"Marker.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "@Target(TYPE_USE)\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "@Target(TYPE_USE)\n" +
"@interface Marker {}",
"X.java",
"public class X extends @Marker Object {}",
@@ -440,10 +440,10 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"");
// javac-b81 annotation contents: len:10[0 1 16 -1 -1 0 0 17 0 0]
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #17 @Marker(\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = -1\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #17 @Marker(\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = -1\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -452,10 +452,10 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"Marker.java",
- "import java.lang.annotation.*;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.*;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
"@Retention(RetentionPolicy.RUNTIME)\n"+
- "@Target(TYPE_USE)\n" +
+ "@Target(TYPE_USE)\n" +
"@interface Marker {}",
"X.java",
"public class X extends @Marker Object {}",
@@ -463,14 +463,14 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"");
// Bytes:10[0 1 16 -1 -1 0 0 17 0 0]
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #17 @Marker(\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = -1\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #17 @Marker(\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = -1\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test011_classExtends_reflection() throws Exception {
this.runConformTest(
new String[] {
@@ -478,9 +478,9 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"public class X extends @Marker Object {public static void main(String[] argv) {Helper.printTypeAnnotations(X.class);}}",
"Helper.java",HELPER_CLASS,
"Marker.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "@Target(TYPE_USE)\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "@Target(TYPE_USE)\n" +
"@interface Marker {}"
},
"Annotations on superclass of X\n"+
@@ -494,8 +494,8 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"public class X extends @Marker Object {public static void main(String[] argv) {Helper.printTypeAnnotations(X.class);}}",
"Helper.java",HELPER_CLASS,
"Marker.java",
- "import java.lang.annotation.*;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.*;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
"@Target(TYPE_USE)\n" +
"@Retention(RetentionPolicy.RUNTIME)\n"+
"@interface Marker {}"
@@ -508,34 +508,34 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " String id() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " String id() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"C.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface C {\n" +
- " char value() default '-';\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface C {\n" +
+ " char value() default '-';\n" +
"}\n",
"I.java",
"interface I {}\n",
@@ -549,27 +549,27 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
// RuntimeVisibleTypeAnnotations
// Bytes:28[0 2 16 0 0 0 0 13 0 1 0 14 115 0 15 16 0 1 0 0 16 0 1 0 17 67 0 18]
// RuntimeInvisibleTypeAnnotations
- // Bytes:10[0 1 16 0 1 0 0 20 0 0]
+ // Bytes:10[0 1 16 0 1 0 0 20 0 0]
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #23 @A(\n" +
- " #24 id=\"Hello, World!\" (constant type)\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = 0\n" +
- " )\n" +
- " #26 @C(\n" +
- " #27 value=\'(\' (constant type)\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = 1\n" +
- " )\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #21 @B(\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = 1\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #23 @A(\n" +
+ " #24 id=\"Hello, World!\" (constant type)\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = 0\n" +
+ " )\n" +
+ " #26 @C(\n" +
+ " #27 value=\'(\' (constant type)\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = 1\n" +
+ " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #21 @B(\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = 1\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test014_classExtends_interfaces_reflection() throws Exception {
this.runConformTest(
new String[] {
@@ -577,23 +577,23 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"public class X implements @A I {public static void main(String[]argv) {Helper.printTypeAnnotations(X.class);}}",
"Helper.java",HELPER_CLASS,
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
"}\n",
"I.java",
"interface I {}\n"
},
- "Annotations on superclass of X\n" +
- " class java.lang.Object:no annotations\n" +
- "Annotations on superinterfaces of X\n" +
+ "Annotations on superclass of X\n" +
+ " class java.lang.Object:no annotations\n" +
+ "Annotations on superinterfaces of X\n" +
" interface I:@A");
}
-
+
public void test015_classExtends_interfaces_reflection() throws Exception {
String javaVersion = System.getProperty("java.version");
int index = javaVersion.indexOf('.');
@@ -611,44 +611,44 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"public class X implements @A(id=\"Hello, World!\") I, @B @C('i') J {public static void main(String[] argv) { Helper.printTypeAnnotations(X.class);}}",
"Helper.java",HELPER_CLASS,
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " String id() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " String id() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"C.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface C {\n" +
- " char value() default '-';\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface C {\n" +
+ " char value() default '-';\n" +
"}\n",
"I.java",
"interface I {}\n",
"J.java",
"interface J {}\n",
},
- "Annotations on superclass of X\n" +
- " class java.lang.Object:no annotations\n" +
- "Annotations on superinterfaces of X\n" +
- " interface I:@A(id=Hello, World!) \n" +
+ "Annotations on superclass of X\n" +
+ " class java.lang.Object:no annotations\n" +
+ "Annotations on superinterfaces of X\n" +
+ " interface I:@A(id=Hello, World!) \n" +
" interface J:@C(" + (v < 14 ? "value=" : "") + "i)");
}
@@ -656,257 +656,257 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"Y.java",
"class Y<T> {}\n",
"X.java",
- "public class X extends Y<@B String> {\n" +
+ "public class X extends Y<@B String> {\n" +
"}",
},
"");
// javac-b81: Bytes:12[0 1 16 -1 -1 1 3 0 0 13 0 0] // type path: 1,3,0
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #19 @B(\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = -1\n" +
- " location = [TYPE_ARGUMENT(0)]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #19 @B(\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = -1\n" +
+ " location = [TYPE_ARGUMENT(0)]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test017_classExtends() throws Exception {
this.runConformTest(
new String[] {
"Marker.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface Marker { }\n",
"I.java",
"interface I<T> {}\n",
"X.java",
- "public class X implements I<@Marker String> {\n" +
+ "public class X implements I<@Marker String> {\n" +
"}",
},
"");
// javac-b81: Bytes:12[0 1 16 0 0 1 3 0 0 14 0 0] // type path: 1,3,0
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #21 @Marker(\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = 0\n" +
- " location = [TYPE_ARGUMENT(0)]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #21 @Marker(\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = 0\n" +
+ " location = [TYPE_ARGUMENT(0)]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test018_classExtends() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface A { }\n",
"I.java",
"interface I<T1,T2> {}\n",
-
+
"X.java",
"public class X implements I<Integer, @A String> {}\n"
},
"");
// javac-b81: Bytes:12[0 1 16 0 0 1 3 1 0 14 0 0] // type path: 1,3,1
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #21 @A(\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = 0\n" +
- " location = [TYPE_ARGUMENT(1)]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #21 @A(\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = 0\n" +
+ " location = [TYPE_ARGUMENT(1)]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test019_classExtends() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface A { }\n",
"J.java",
"interface J<T> {}\n",
-
+
"I.java",
"interface I<T> {}\n",
-
+
"X.java",
"public class X implements I<J<@A String>> {}\n"
},
"");
// javac-b81: Bytes:14[0 1 16 0 0 2 3 0 3 0 0 14 0 0] // type path: 2,3,0,3,0
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #21 @A(\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = 0\n" +
- " location = [TYPE_ARGUMENT(0), TYPE_ARGUMENT(0)]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #21 @A(\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = 0\n" +
+ " location = [TYPE_ARGUMENT(0), TYPE_ARGUMENT(0)]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test020_classExtends() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface A { }\n",
-
+
"I.java",
"interface I<T> {}\n",
-
+
"X.java",
"public class X implements I<@A String[]> {}\n"
},
"");
// javac-b81: Bytes:14[0 1 16 0 0 2 3 0 0 0 0 14 0 0] // type path: 2,3,0,0,0
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #21 @A(\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = 0\n" +
- " location = [TYPE_ARGUMENT(0), ARRAY]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #21 @A(\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = 0\n" +
+ " location = [TYPE_ARGUMENT(0), ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test021_classExtends() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface A { }\n",
-
+
"I.java",
"interface I<T> {}\n",
-
+
"X.java",
"public class X implements I<String @A[]> {}\n"
},
"");
// javac-b81: Bytes:12[0 1 16 0 0 1 3 0 0 14 0 0] // type path: 1,3,0
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #21 @A(\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = 0\n" +
- " location = [TYPE_ARGUMENT(0)]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #21 @A(\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = 0\n" +
+ " location = [TYPE_ARGUMENT(0)]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test022_classExtends() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface A { }\n",
-
+
"I.java",
"interface I<T> {}\n",
-
+
"X.java",
"public class X implements I<String []@A[]> {}\n"
},
"");
// javac-b81: Bytes:14[0 1 16 0 0 2 3 0 0 0 0 14 0 0] // type path: 2,3,0,0,0
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #21 @A(\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = 0\n" +
- " location = [TYPE_ARGUMENT(0), ARRAY]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #21 @A(\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = 0\n" +
+ " location = [TYPE_ARGUMENT(0), ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test023_classExtends() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface A { }\n",
-
+
"I.java",
"interface I<T> {}\n",
-
+
"X.java",
"public class X implements I<@A String [][][]> {}\n"
},
"");
// javac-b81: Bytes:10[0 1 16 0 0 0 0 12 0 0] // type path: 4,3,0,0,0,0,0,0,0
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #21 @A(\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = 0\n" +
- " location = [TYPE_ARGUMENT(0), ARRAY, ARRAY, ARRAY]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #21 @A(\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = 0\n" +
+ " location = [TYPE_ARGUMENT(0), ARRAY, ARRAY, ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
-
+
+
public void test024_classExtends() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"C.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface C {\n" +
- " char value() default '-';\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface C {\n" +
+ " char value() default '-';\n" +
"}\n",
"I.java",
"interface I<T> {}\n",
@@ -917,46 +917,46 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #25 @A(\n" +
- " #26 value=\"Hello, World!\" (constant type)\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = 0\n" +
- " location = [TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " #28 @C(\n" +
- " #26 value=\'(\' (constant type)\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = 1\n" +
- " location = [TYPE_ARGUMENT(1)]\n" +
- " )\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #23 @B(\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = 1\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #25 @A(\n" +
+ " #26 value=\"Hello, World!\" (constant type)\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = 0\n" +
+ " location = [TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " #28 @C(\n" +
+ " #26 value=\'(\' (constant type)\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = 1\n" +
+ " location = [TYPE_ARGUMENT(1)]\n" +
+ " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #23 @B(\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = 1\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test025_classTypeParameterBound() throws Exception {
this.runConformTest(
new String[] {
"X.java",
"public class X<T extends @A String> {}",
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface A {}\n"
},
"");
- // javac-b81: Bytes:10[0 1 17 0 0 0 0 13 0 0]
+ // javac-b81: Bytes:10[0 1 17 0 0 0 0 13 0 0]
// [17 0 0] is CLASS_PARAMETER_BOUND type_parameter_index=0 bound_index=0
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #21 @A(\n" +
- " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 0 type parameter bound index = 0\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #21 @A(\n" +
+ " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 0 type parameter bound index = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -965,67 +965,67 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"X.java",
"public class X<T extends @A String & @B(3) Cloneable> {}",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #25 @A(\n" +
- " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 0 type parameter bound index = 0\n" +
- " )\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #21 @B(\n" +
- " #22 value=(int) 3 (constant type)\n" +
- " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 0 type parameter bound index = 1\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #25 @A(\n" +
+ " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 0 type parameter bound index = 0\n" +
+ " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #21 @B(\n" +
+ " #22 value=(int) 3 (constant type)\n" +
+ " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 0 type parameter bound index = 1\n" +
" )\n" ;
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test027_classTypeParameterBound_complex() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"C.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface C {\n" +
- " char value() default '-';\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface C {\n" +
+ " char value() default '-';\n" +
"}\n",
"Y.java",
"public class Y<T> {}",
@@ -1037,40 +1037,40 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
// Bytes:28[0 2 17 1 0 1 3 0 0 13 0 0 17 1 0 4 3 0 0 0 0 0 0 0 0 14 0 0]
// Bytes:29[0 2 17 1 0 3 3 0 0 0 0 0 0 16 0 0 17 1 1 0 0 16 0 1 0 17 73 0 18]
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #25 @A(\n" +
- " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 1 type parameter bound index = 0\n" +
- " location = [TYPE_ARGUMENT(0), ARRAY, ARRAY, ARRAY]\n" +
- " )\n" +
- " #26 @C(\n" +
- " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 1 type parameter bound index = 0\n" +
- " location = [TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #21 @B(\n" +
- " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 1 type parameter bound index = 0\n" +
- " location = [TYPE_ARGUMENT(0), ARRAY, ARRAY]\n" +
- " )\n" +
- " #21 @B(\n" +
- " #22 value=(int) 3 (constant type)\n" +
- " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 1 type parameter bound index = 1\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #25 @A(\n" +
+ " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 1 type parameter bound index = 0\n" +
+ " location = [TYPE_ARGUMENT(0), ARRAY, ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #26 @C(\n" +
+ " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 1 type parameter bound index = 0\n" +
+ " location = [TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #21 @B(\n" +
+ " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 1 type parameter bound index = 0\n" +
+ " location = [TYPE_ARGUMENT(0), ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #21 @B(\n" +
+ " #22 value=(int) 3 (constant type)\n" +
+ " target type = 0x11 CLASS_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 1 type parameter bound index = 1\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test028_methodTypeParameterBound() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"Z.java",
"public class Z {}",
@@ -1082,36 +1082,36 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"");
// javac-b81: Bytes:10[0 1 18 0 0 0 0 13 0 0]
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #23 @A(\n" +
- " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 0 type parameter bound index = 0\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #23 @A(\n" +
+ " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 0 type parameter bound index = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test029_methodTypeParameterBound() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"Z.java",
"public class Z {}",
@@ -1122,43 +1122,43 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #27 @A(\n" +
- " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 0 type parameter bound index = 0\n" +
- " )\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #23 @B(\n" +
- " #24 value=(int) 3 (constant type)\n" +
- " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 0 type parameter bound index = 1\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #27 @A(\n" +
+ " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 0 type parameter bound index = 0\n" +
+ " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #23 @B(\n" +
+ " #24 value=(int) 3 (constant type)\n" +
+ " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 0 type parameter bound index = 1\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test030_methodTypeParameterBound() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"C.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface C {\n" +
- " char value() default '-';\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface C {\n" +
+ " char value() default '-';\n" +
"}\n",
"Z.java",
"public class Z {}",
@@ -1171,38 +1171,38 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #23 @B(\n" +
- " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 0 type parameter bound index = 0\n" +
- " location = [TYPE_ARGUMENT(0), ARRAY, ARRAY]\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #23 @B(\n" +
+ " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 0 type parameter bound index = 0\n" +
+ " location = [TYPE_ARGUMENT(0), ARRAY, ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test031_methodTypeParameterBound_complex() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"C.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface C {\n" +
- " char value() default '-';\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface C {\n" +
+ " char value() default '-';\n" +
"}\n",
"Z.java",
"public class Z {}",
@@ -1218,263 +1218,263 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
// Bytes:28[0 2 18 0 0 1 3 0 0 13 0 0 18 0 0 4 3 0 0 0 0 0 0 0 0 14 0 0]
// Bytes:29[0 2 18 0 0 3 3 0 0 0 0 0 0 16 0 0 18 0 1 0 0 16 0 1 0 17 73 0 18]
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #27 @A(\n" +
- " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 0 type parameter bound index = 0\n" +
- " location = [TYPE_ARGUMENT(0), ARRAY, ARRAY, ARRAY]\n" +
- " )\n" +
- " #28 @C(\n" +
- " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 0 type parameter bound index = 0\n" +
- " location = [TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #23 @B(\n" +
- " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 0 type parameter bound index = 0\n" +
- " location = [TYPE_ARGUMENT(0), ARRAY, ARRAY]\n" +
- " )\n" +
- " #23 @B(\n" +
- " #24 value=(int) 3 (constant type)\n" +
- " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
- " type parameter index = 0 type parameter bound index = 1\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #27 @A(\n" +
+ " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 0 type parameter bound index = 0\n" +
+ " location = [TYPE_ARGUMENT(0), ARRAY, ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #28 @C(\n" +
+ " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 0 type parameter bound index = 0\n" +
+ " location = [TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #23 @B(\n" +
+ " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 0 type parameter bound index = 0\n" +
+ " location = [TYPE_ARGUMENT(0), ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #23 @B(\n" +
+ " #24 value=(int) 3 (constant type)\n" +
+ " target type = 0x12 METHOD_TYPE_PARAMETER_BOUND\n" +
+ " type parameter index = 0 type parameter bound index = 1\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test032_field() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface A {}\n",
-
+
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" @A int field;\n" +
"}",
},
"");
// javac-b81: Bytes:8[0 1 19 0 0 7 0 0] 19 = 0x13 (FIELD)
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #8 @A(\n" +
- " target type = 0x13 FIELD\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #8 @A(\n" +
+ " target type = 0x13 FIELD\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test033_field() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface A {}\n",
-
+
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" java.util.List<@A String> field;\n" +
"}",
},
"");
// javac-b81: Bytes:10[0 1 19 1 3 0 0 9 0 0]
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #10 @A(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(0)]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #10 @A(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(0)]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test034_field() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" @B(3) @A int field;\n" +
"}",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #12 @A(\n" +
- " target type = 0x13 FIELD\n" +
- " )\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #8 @B(\n" +
- " #9 value=(int) 3 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #12 @A(\n" +
+ " target type = 0x13 FIELD\n" +
+ " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #8 @B(\n" +
+ " #9 value=(int) 3 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test035_field() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface A {}\n",
-
+
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" java.util.Map<String, @A String> field;\n" +
"}",
},
"");
// javac-b81: Bytes:10[0 1 19 1 3 1 0 9 0 0]
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #10 @A(\n" +
- " target type = 0x13 FIELD\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #10 @A(\n" +
+ " target type = 0x13 FIELD\n" +
" location = [TYPE_ARGUMENT(1)]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test036_field() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface A {}\n",
-
+
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" java.util.List<String[][]@A[][]> field;\n" +
"}",
},
"");
// javac-b81: Bytes:14[0 1 19 3 3 0 0 0 0 0 0 9 0 0]
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #10 @A(\n" +
- " target type = 0x13 FIELD\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #10 @A(\n" +
+ " target type = 0x13 FIELD\n" +
" location = [TYPE_ARGUMENT(0), ARRAY, ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test037_field() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" java.util.List<? extends @A Number> field;\n" +
"}",
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface A {}\n",
},
"");
// javac-b81: Bytes:12[0 1 19 2 3 0 2 0 0 9 0 0]
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #10 @A(\n" +
- " target type = 0x13 FIELD\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #10 @A(\n" +
+ " target type = 0x13 FIELD\n" +
" location = [TYPE_ARGUMENT(0), WILDCARD]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test038_field() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "class AA { class BB<T> {}}" +
+ "class AA { class BB<T> {}}" +
"class X {\n" +
" AA.@A BB field;\n" +
"}\n",
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface A { }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #8 @A(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [INNER_TYPE]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #8 @A(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [INNER_TYPE]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test038a_field() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "class AA { class BB<T> {}}" +
+ "class AA { class BB<T> {}}" +
"class X {\n" +
" @B AA.@A BB[] @C[] field;\n" +
"}\n",
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface A { }\n",
-
+
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { }\n",
-
+
"C.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface C { }\n",
},
"");
-
+
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #8 @B(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
- " #9 @A(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY, INNER_TYPE]\n" +
- " )\n" +
- " #10 @C(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #8 @B(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #9 @A(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY, INNER_TYPE]\n" +
+ " )\n" +
+ " #10 @C(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -1483,208 +1483,208 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" @A int [] @B(3) [] field;\n" +
"}",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #12 @A(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #8 @B(\n" +
- " #9 value=(int) 3 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #12 @A(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #8 @B(\n" +
+ " #9 value=(int) 3 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test040_field_complex() throws Exception {
this.runConformTest(
new String[] {
"X.java",
"import java.util.Map;\n" +
"import java.util.List;\n" +
- "public class X {\n" +
- " @H String @E[] @F[] @G[] field;\n" +
- " @A Map<@B String, @C List<@D Object>> field2;\n" +
- " @A Map<@B String, @H String @E[] @F[] @G[]> field3;\n" +
+ "public class X {\n" +
+ " @H String @E[] @F[] @G[] field;\n" +
+ " @A Map<@B String, @C List<@D Object>> field2;\n" +
+ " @A Map<@B String, @H String @E[] @F[] @G[]> field3;\n" +
"}",
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"C.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface C {\n" +
- " char value() default '-';\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface C {\n" +
+ " char value() default '-';\n" +
"}\n",
"D.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface D {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface D {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"E.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface E {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface E {\n" +
+ " int value() default -1;\n" +
"}",
"F.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface F {\n" +
- " char value() default '-';\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface F {\n" +
+ " char value() default '-';\n" +
"}\n",
"G.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface G {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface G {\n" +
+ " int value() default -1;\n" +
"}",
"H.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface H {\n" +
- " char value() default '-';\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface H {\n" +
+ " char value() default '-';\n" +
"}\n",
},
"");
String expectedOutput =
- " // Field descriptor #6 [[[Ljava/lang/String;\n" +
- " java.lang.String[][][] field;\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #11 @H(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY, ARRAY]\n" +
- " )\n" +
- " #12 @F(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #8 @E(\n" +
- " target type = 0x13 FIELD\n" +
- " )\n" +
- " #9 @G(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
- " \n" +
- " // Field descriptor #14 Ljava/util/Map;\n" +
- " // Signature: Ljava/util/Map<Ljava/lang/String;Ljava/util/List<Ljava/lang/Object;>;>;\n" +
- " java.util.Map field2;\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #18 @A(\n" +
- " target type = 0x13 FIELD\n" +
- " )\n" +
- " #19 @C(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(1)]\n" +
- " )\n" +
- " #20 @D(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(1), TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #17 @B(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " \n" +
- " // Field descriptor #14 Ljava/util/Map;\n" +
- " // Signature: Ljava/util/Map<Ljava/lang/String;[[[Ljava/lang/String;>;\n" +
- " java.util.Map field3;\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #18 @A(\n" +
- " target type = 0x13 FIELD\n" +
- " )\n" +
- " #11 @H(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(1), ARRAY, ARRAY, ARRAY]\n" +
- " )\n" +
- " #12 @F(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(1), ARRAY]\n" +
- " )\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #17 @B(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " #8 @E(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(1)]\n" +
- " )\n" +
- " #9 @G(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(1), ARRAY, ARRAY]\n" +
+ " // Field descriptor #6 [[[Ljava/lang/String;\n" +
+ " java.lang.String[][][] field;\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #11 @H(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #12 @F(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #8 @E(\n" +
+ " target type = 0x13 FIELD\n" +
+ " )\n" +
+ " #9 @G(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
+ " \n" +
+ " // Field descriptor #14 Ljava/util/Map;\n" +
+ " // Signature: Ljava/util/Map<Ljava/lang/String;Ljava/util/List<Ljava/lang/Object;>;>;\n" +
+ " java.util.Map field2;\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #18 @A(\n" +
+ " target type = 0x13 FIELD\n" +
+ " )\n" +
+ " #19 @C(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(1)]\n" +
+ " )\n" +
+ " #20 @D(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(1), TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #17 @B(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " \n" +
+ " // Field descriptor #14 Ljava/util/Map;\n" +
+ " // Signature: Ljava/util/Map<Ljava/lang/String;[[[Ljava/lang/String;>;\n" +
+ " java.util.Map field3;\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #18 @A(\n" +
+ " target type = 0x13 FIELD\n" +
+ " )\n" +
+ " #11 @H(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(1), ARRAY, ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #12 @F(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(1), ARRAY]\n" +
+ " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #17 @B(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " #8 @E(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(1)]\n" +
+ " )\n" +
+ " #9 @G(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(1), ARRAY, ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -1693,94 +1693,94 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " java.lang.@H String @E[] @F[] @G[] field;\n" +
+ "public class X {\n" +
+ " java.lang.@H String @E[] @F[] @G[] field;\n" +
"}",
"E.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface E {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface E {\n" +
+ " int value() default -1;\n" +
"}",
"F.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface F {\n" +
- " char value() default '-';\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface F {\n" +
+ " char value() default '-';\n" +
"}\n",
"G.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface G {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface G {\n" +
+ " int value() default -1;\n" +
"}",
"H.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface H {\n" +
- " char value() default '-';\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface H {\n" +
+ " char value() default '-';\n" +
"}\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #11 @H(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY, ARRAY]\n" +
- " )\n" +
- " #12 @F(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #8 @E(\n" +
- " target type = 0x13 FIELD\n" +
- " )\n" +
- " #9 @G(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #11 @H(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #12 @F(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #8 @E(\n" +
+ " target type = 0x13 FIELD\n" +
+ " )\n" +
+ " #9 @G(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test042_methodReturnType() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" @B(3) @A(value=\"test\") int foo() {\n" +
" return 1;\n" +
- " }\n" +
+ " }\n" +
"}",
},
"");
@@ -1788,54 +1788,54 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
// Bytes:13[0 1 20 0 0 11 0 1 0 12 115 0 13]
// Bytes:13[0 1 20 0 0 15 0 1 0 12 73 0 16]
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #21 @A(\n" +
- " #18 value=\"test\" (constant type)\n" +
- " target type = 0x14 METHOD_RETURN\n" +
- " )\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #17 @B(\n" +
- " #18 value=(int) 3 (constant type)\n" +
- " target type = 0x14 METHOD_RETURN\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #21 @A(\n" +
+ " #18 value=\"test\" (constant type)\n" +
+ " target type = 0x14 METHOD_RETURN\n" +
+ " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #17 @B(\n" +
+ " #18 value=(int) 3 (constant type)\n" +
+ " target type = 0x14 METHOD_RETURN\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test043_methodReceiver() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"X.java",
- "public class X {\n" +
- " void foo(@B(3) X this) {}\n" +
+ "public class X {\n" +
+ " void foo(@B(3) X this) {}\n" +
"}",
},
"");
// javac-b81: Bytes:13[0 1 21 0 0 10 0 1 0 11 73 0 12]
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #16 @B(\n" +
- " #17 value=(int) 3 (constant type)\n" +
- " target type = 0x15 METHOD_RECEIVER\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #16 @B(\n" +
+ " #17 value=(int) 3 (constant type)\n" +
+ " target type = 0x15 METHOD_RECEIVER\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -1844,137 +1844,137 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T> {\n" +
- " void foo(X<@B(3) T> this) {}\n" +
+ "public class X<T> {\n" +
+ " void foo(X<@B(3) T> this) {}\n" +
"}",
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
},
"");
// javac-b81: Bytes:15[0 1 21 1 3 0 0 10 0 1 0 11 73 0 12]
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #18 @B(\n" +
- " #19 value=(int) 3 (constant type)\n" +
- " target type = 0x15 METHOD_RECEIVER\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #18 @B(\n" +
+ " #19 value=(int) 3 (constant type)\n" +
+ " target type = 0x15 METHOD_RECEIVER\n" +
" location = [TYPE_ARGUMENT(0)]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test045_methodParameter() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" int foo(@B(3) String s) {\n" +
" return s.length();\n" +
- " }\n" +
+ " }\n" +
"}",
-
+
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
},
"");
// javac-b81: Bytes:14[0 1 22 0 0 0 11 0 1 0 12 73 0 13]
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #25 @B(\n" +
- " #26 value=(int) 3 (constant type)\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #25 @B(\n" +
+ " #26 value=(int) 3 (constant type)\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test046_methodParameter() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" int foo(int i, double d, @B(3) String s) {\n" +
" return s.length();\n" +
- " }\n" +
+ " }\n" +
"}",
-
+
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
},
"");
// javac-b81: Bytes:14[0 1 22 1 0 0 11 0 1 0 12 73 0 13]
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #29 @B(\n" +
- " #30 value=(int) 3 (constant type)\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 2\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #29 @B(\n" +
+ " #30 value=(int) 3 (constant type)\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 2\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test047_methodParameterArray() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" int foo(String @A [] @B(3) [] s) {\n" +
" return s.length;\n" +
- " }\n" +
+ " }\n" +
"}",
},
"");
@@ -1982,17 +1982,17 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
// Bytes:9[0 1 22 0 0 0 11 0 0]
// Bytes:16[0 1 22 0 1 0 0 0 13 0 1 0 14 73 0 15]
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #23 @A(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " )\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #19 @B(\n" +
- " #20 value=(int) 3 (constant type)\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " location = [ARRAY]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #23 @A(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #19 @B(\n" +
+ " #20 value=(int) 3 (constant type)\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " location = [ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -2002,24 +2002,24 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
new String[] {
"A.java",
"import java.lang.annotation.*;\n"+
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
"import java.lang.annotation.*;\n"+
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"C.java",
"import java.lang.annotation.*;\n"+
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface C {\n" +
- " char value() default '-';\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface C {\n" +
+ " char value() default '-';\n" +
"}\n",
"E.java",
"class E extends RuntimeException {\n" +
@@ -2043,427 +2043,427 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
// Bytes:28[0 2 23 0 0 0 0 14 0 1 0 15 115 0 16 23 0 2 0 0 17 0 1 0 15 67 0 18]
// Bytes:10[0 1 23 0 2 0 0 20 0 0]
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #25 @A(\n" +
- " #26 value=\"Hello, World!\" (constant type)\n" +
- " target type = 0x17 THROWS\n" +
- " throws index = 0\n" +
- " )\n" +
- " #28 @C(\n" +
- " #26 value=\'(\' (constant type)\n" +
- " target type = 0x17 THROWS\n" +
- " throws index = 2\n" +
- " )\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #23 @B(\n" +
- " target type = 0x17 THROWS\n" +
- " throws index = 2\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #25 @A(\n" +
+ " #26 value=\"Hello, World!\" (constant type)\n" +
+ " target type = 0x17 THROWS\n" +
+ " throws index = 0\n" +
+ " )\n" +
+ " #28 @C(\n" +
+ " #26 value=\'(\' (constant type)\n" +
+ " target type = 0x17 THROWS\n" +
+ " throws index = 2\n" +
+ " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #23 @B(\n" +
+ " target type = 0x17 THROWS\n" +
+ " throws index = 2\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
-
+
+
public void test049_codeblocks_localVariable() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "import java.lang.annotation.Target;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " @B int j = 9;\n" +
- " try {\n" +
- " System.out.print(\"SUCCESS\" + j);\n" +
- " } catch(@A Exception e) {\n" +
- " }\n" +
- " @B int k = 3;\n" +
- " System.out.println(k);\n" +
- " }\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " @B int j = 9;\n" +
+ " try {\n" +
+ " System.out.print(\"SUCCESS\" + j);\n" +
+ " } catch(@A Exception e) {\n" +
+ " }\n" +
+ " @B int k = 3;\n" +
+ " System.out.println(k);\n" +
+ " }\n" +
"}",
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " String value() default \"default\";\n" +
"}\n",
},
"SUCCESS93");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #56 @B(\n" +
- " target type = 0x40 LOCAL_VARIABLE\n" +
- " local variable entries:\n" +
- " [pc: 3, pc: 39] index: 1\n" +
- " )\n" +
- " #56 @B(\n" +
- " target type = 0x40 LOCAL_VARIABLE\n" +
- " local variable entries:\n" +
- " [pc: 31, pc: 39] index: 2\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #56 @B(\n" +
+ " target type = 0x40 LOCAL_VARIABLE\n" +
+ " local variable entries:\n" +
+ " [pc: 3, pc: 39] index: 1\n" +
+ " )\n" +
+ " #56 @B(\n" +
+ " target type = 0x40 LOCAL_VARIABLE\n" +
+ " local variable entries:\n" +
+ " [pc: 31, pc: 39] index: 2\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test050_codeblocks_localVariable() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"C.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface C {\n" +
- " char value() default '-';\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface C {\n" +
+ " char value() default '-';\n" +
"}\n",
"X.java",
- "public class X {\n" +
- " String[][] bar() {\n" +
+ "public class X {\n" +
+ " String[][] bar() {\n" +
" return new String[][] {};" +
- " }\n" +
- " void foo(String s) {\n" +
- " @C int i;\n" +
- " @A String [] @B(3)[] tab = bar();\n" +
- " if (tab != null) {\n" +
- " i = 0;\n" +
- " System.out.println(i + tab.length);\n" +
- " } else {\n" +
- " System.out.println(tab.length);\n" +
- " }\n" +
- " i = 4;\n" +
- " System.out.println(-i + tab.length);\n" +
- " }\n" +
+ " }\n" +
+ " void foo(String s) {\n" +
+ " @C int i;\n" +
+ " @A String [] @B(3)[] tab = bar();\n" +
+ " if (tab != null) {\n" +
+ " i = 0;\n" +
+ " System.out.println(i + tab.length);\n" +
+ " } else {\n" +
+ " System.out.println(tab.length);\n" +
+ " }\n" +
+ " i = 4;\n" +
+ " System.out.println(-i + tab.length);\n" +
+ " }\n" +
"}",
},
"");
// javac-b81:
// Bytes:34[0 2 64 0 1 0 34 0 12 0 2 0 0 19 0 0 64 0 1 0 5 0 41 0 3 2 0 0 0 0 0 20 0 0]
// Bytes:23[0 1 64 0 1 0 5 0 41 0 3 1 0 0 0 22 0 1 0 23 73 0 24]
- // ECJ data varies a little here as it is splitting the range
+ // ECJ data varies a little here as it is splitting the range
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #45 @B(\n" +
- " #46 value=(int) 3 (constant type)\n" +
- " target type = 0x40 LOCAL_VARIABLE\n" +
- " local variable entries:\n" +
- " [pc: 5, pc: 46] index: 3\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #49 @C(\n" +
- " target type = 0x40 LOCAL_VARIABLE\n" +
- " local variable entries:\n" +
- " [pc: 11, pc: 24] index: 2\n" +
- " [pc: 34, pc: 46] index: 2\n" +
- " )\n" +
- " #50 @A(\n" +
- " target type = 0x40 LOCAL_VARIABLE\n" +
- " local variable entries:\n" +
- " [pc: 5, pc: 46] index: 3\n" +
- " location = [ARRAY, ARRAY]\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #45 @B(\n" +
+ " #46 value=(int) 3 (constant type)\n" +
+ " target type = 0x40 LOCAL_VARIABLE\n" +
+ " local variable entries:\n" +
+ " [pc: 5, pc: 46] index: 3\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #49 @C(\n" +
+ " target type = 0x40 LOCAL_VARIABLE\n" +
+ " local variable entries:\n" +
+ " [pc: 11, pc: 24] index: 2\n" +
+ " [pc: 34, pc: 46] index: 2\n" +
+ " )\n" +
+ " #50 @A(\n" +
+ " target type = 0x40 LOCAL_VARIABLE\n" +
+ " local variable entries:\n" +
+ " [pc: 5, pc: 46] index: 3\n" +
+ " location = [ARRAY, ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test051_codeblocks_resourceVariable() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"X.java",
"import java.io.*;\n"+
- "public class X {\n" +
+ "public class X {\n" +
" public static void main(String[] argv) throws Exception {\n"+
" try (@A BufferedReader br1 = new BufferedReader(new FileReader(\"a\"));\n"+
" @B(99) BufferedReader br2 = new BufferedReader(new FileReader(\"b\"))) {\n"+
" System.out.println(br1.readLine()+br2.readLine());\n" +
" }\n" +
- " }\n" +
+ " }\n" +
"}",
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #81 @B(\n" +
- " #82 value=(int) 99 (constant type)\n" +
- " target type = 0x41 RESOURCE_VARIABLE\n" +
- " local variable entries:\n" +
- " [pc: 39, pc: 94] index: 4\n" +
- " )\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #85 @A(\n" +
- " target type = 0x41 RESOURCE_VARIABLE\n" +
- " local variable entries:\n" +
- " [pc: 21, pc: 135] index: 3\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #81 @B(\n" +
+ " #82 value=(int) 99 (constant type)\n" +
+ " target type = 0x41 RESOURCE_VARIABLE\n" +
+ " local variable entries:\n" +
+ " [pc: 39, pc: 94] index: 4\n" +
+ " )\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #85 @A(\n" +
+ " target type = 0x41 RESOURCE_VARIABLE\n" +
+ " local variable entries:\n" +
+ " [pc: 21, pc: 135] index: 3\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test052_codeblocks_exceptionParameter() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "import java.lang.annotation.*;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
+ "import java.lang.annotation.*;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
" Exception test = new Exception() {\n" +
" private static final long serialVersionUID = 1L;\n" +
" @Override\n" +
" public String toString() {\n" +
" return \"SUCCESS\";\n" +
" }\n" +
- " };\n" +
- " try {\n" +
- " System.out.println(test);\n" +
- " } catch(@A Exception e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ " };\n" +
+ " try {\n" +
+ " System.out.println(test);\n" +
+ " } catch(@A Exception e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}",
-
+
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
},
"SUCCESS");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #44 @A(\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 0\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #44 @A(\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test053_codeblocks_exceptionParameter() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "import java.lang.annotation.Target;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
" @A Exception test = new Exception() {\n" +
" private static final long serialVersionUID = 1L;\n" +
" @Override\n" +
" public String toString() {\n" +
" return \"SUCCESS\";\n" +
" }\n" +
- " };\n" +
- " try {\n" +
- " System.out.println(test);\n" +
- " } catch(@A Exception e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ " };\n" +
+ " try {\n" +
+ " System.out.println(test);\n" +
+ " } catch(@A Exception e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}",
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
},
"SUCCESS");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #44 @A(\n" +
- " target type = 0x40 LOCAL_VARIABLE\n" +
- " local variable entries:\n" +
- " [pc: 8, pc: 24] index: 1\n" +
- " )\n" +
- " #44 @A(\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 0\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #44 @A(\n" +
+ " target type = 0x40 LOCAL_VARIABLE\n" +
+ " local variable entries:\n" +
+ " [pc: 8, pc: 24] index: 1\n" +
+ " )\n" +
+ " #44 @A(\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test054_codeblocks_exceptionParameter() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "import java.lang.annotation.Target;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " System.out.println(42);\n" +
- " } catch(@B(1) RuntimeException e) {\n" +
- " e.printStackTrace();\n" +
- " } catch(@B(2) Throwable t) {\n" +
- " t.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
+ " System.out.println(42);\n" +
+ " } catch(@B(1) RuntimeException e) {\n" +
+ " e.printStackTrace();\n" +
+ " } catch(@B(2) Throwable t) {\n" +
+ " t.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface B {\n" +
- " int value() default 99;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface B {\n" +
+ " int value() default 99;\n" +
"}\n",
},
"42");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #44 @B(\n" +
- " #45 value=(int) 1 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 0\n" +
- " )\n" +
- " #44 @B(\n" +
- " #45 value=(int) 2 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 1\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #44 @B(\n" +
+ " #45 value=(int) 1 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 0\n" +
+ " )\n" +
+ " #44 @B(\n" +
+ " #45 value=(int) 2 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 1\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test055_codeblocks_exceptionParameterMultiCatch() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "import java.lang.annotation.Target;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "class Exc1 extends RuntimeException {" +
+ "import java.lang.annotation.Target;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "class Exc1 extends RuntimeException {" +
" private static final long serialVersionUID = 1L;\n" +
"}\n"+
- "class Exc2 extends RuntimeException {" +
+ "class Exc2 extends RuntimeException {" +
" private static final long serialVersionUID = 1L;\n" +
"}\n"+
- "class Exc3 extends RuntimeException {" +
+ "class Exc3 extends RuntimeException {" +
" private static final long serialVersionUID = 1L;\n" +
"}\n"+
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
" System.out.println(42);\n" +
// @B(1) is attached to the argument, the others are attached to the type reference in the union type reference
// During Parsing the @B(1) is moved from the argument to Exc1
- " } catch(@B(1) Exc1 | Exc2 | @B(2) Exc3 t) {\n" +
- " t.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ " } catch(@B(1) Exc1 | Exc2 | @B(2) Exc3 t) {\n" +
+ " t.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface B {\n" +
- " int value() default 99;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface B {\n" +
+ " int value() default 99;\n" +
"}\n",
},
"42");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #45 @B(\n" +
- " #46 value=(int) 1 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 0\n" +
- " )\n" +
- " #45 @B(\n" +
- " #46 value=(int) 2 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 2\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #45 @B(\n" +
+ " #46 value=(int) 1 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 0\n" +
+ " )\n" +
+ " #45 @B(\n" +
+ " #46 value=(int) 2 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 2\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test056_codeblocks_instanceof() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public void foo(Object o) {\n" +
+ "public class X {\n" +
+ " public void foo(Object o) {\n" +
" if (o instanceof @A String) {\n" +
" String tab = (String) o;\n" +
" System.out.println(tab);\n" +
- " }\n" +
+ " }\n" +
" System.out.println(o);\n" +
- " }\n" +
+ " }\n" +
"}",
-
+
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
-
+
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #38 @A(\n" +
- " target type = 0x43 INSTANCEOF\n" +
- " offset = 1\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #38 @A(\n" +
+ " target type = 0x43 INSTANCEOF\n" +
+ " offset = 1\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
-
+
expectedOutput = " 1 instanceof java.lang.String [16]\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -2472,89 +2472,89 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"C.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface C {\n" +
- " char value() default '-';\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface C {\n" +
+ " char value() default '-';\n" +
"}\n",
"I.java",
"interface I {}\n",
"J.java",
"interface J {}\n",
"X.java",
- "public class X {\n" +
- " public boolean foo(String s) {\n" +
+ "public class X {\n" +
+ " public boolean foo(String s) {\n" +
" System.out.println(\"xyz\");\n" +
- " Object o = new @B(3) Object();\n" +
- " return true;\n" +
- " }\n" +
+ " Object o = new @B(3) Object();\n" +
+ " return true;\n" +
+ " }\n" +
"}",
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #35 @B(\n" +
- " #36 value=(int) 3 (constant type)\n" +
- " target type = 0x44 NEW\n" +
- " offset = 8\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #35 @B(\n" +
+ " #36 value=(int) 3 (constant type)\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 8\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test058_codeblocks_new2() throws Exception {
this.runConformTest(
new String[] {
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"X.java",
- "public class X {\n" +
- " public void foo() {\n" +
+ "public class X {\n" +
+ " public void foo() {\n" +
" Outer o = new Outer();\n" +
" o.new @B(1) Inner();\n" +
- " }\n" +
+ " }\n" +
"}\n" +
"class Outer { class Inner {}}\n"
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #30 @B(\n" +
- " #31 value=(int) 1 (constant type)\n" +
- " target type = 0x44 NEW\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #30 @B(\n" +
+ " #31 value=(int) 1 (constant type)\n" +
+ " target type = 0x44 NEW\n" +
" offset = 8\n" +
" location = [INNER_TYPE]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test057_codeblocks_new3_415821() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface X { }\n" +
"\n" +
"class Foo {}\n",
@@ -2563,28 +2563,28 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #21 @X(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 0\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #21 @X(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "C.class", "C", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #28 @X(\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = -1\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #28 @X(\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = -1\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "C$1.class", "C$1", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test057_codeblocks_new4_415821() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface X { }\n" +
"\n",
"C.java",
@@ -2592,322 +2592,322 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #21 @X(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 0\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #21 @X(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "C.class", "C", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #31 @X(\n" +
- " target type = 0x10 CLASS_EXTENDS\n" +
- " type index = 0\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #31 @X(\n" +
+ " target type = 0x10 CLASS_EXTENDS\n" +
+ " type index = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "C$1.class", "C$1", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test059_codeblocks_new_newArray() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"C.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface C {\n" +
- " char value() default '-';\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface C {\n" +
+ " char value() default '-';\n" +
"}\n",
"I.java",
"interface I {}\n",
"J.java",
"interface J {}\n",
"X.java",
- "public class X {\n" +
- " public boolean foo(String s) {\n" +
+ "public class X {\n" +
+ " public boolean foo(String s) {\n" +
" System.out.println(\"xyz\");\n" +
" Object o = new @A String [1];\n" +
- " return true;\n" +
- " }\n" +
+ " return true;\n" +
+ " }\n" +
"}",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #37 @A(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 9\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #37 @A(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 9\n" +
" location = [ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test060_codeblocks_new_multiNewArray() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"X.java",
- "public class X {\n" +
- " public boolean foo(String s) {\n" +
+ "public class X {\n" +
+ " public boolean foo(String s) {\n" +
" System.out.println(\"xyz\");\n" +
- " Object o = new @A String [2][3];\n" +
- " return true;\n" +
- " }\n" +
+ " Object o = new @A String [2][3];\n" +
+ " return true;\n" +
+ " }\n" +
"}",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #37 @A(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 10\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #37 @A(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 10\n" +
" location = [ARRAY, ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test060a_codeblocks_new_newArrayWithInitializer() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public boolean foo(String s) {\n" +
+ "public class X {\n" +
+ " public boolean foo(String s) {\n" +
" System.out.println(\"xyz\");\n" +
- " X[][] x = new @A X @B [] @C[]{ { null }, { null } };\n" +
- " return true;\n" +
- " }\n" +
+ " X[][] x = new @A X @B [] @C[]{ { null }, { null } };\n" +
+ " return true;\n" +
+ " }\n" +
"}",
-
+
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
-
+
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@interface B {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@interface B {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"C.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@interface C {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@interface C {\n" +
+ " String value() default \"default\";\n" +
"}\n",
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #37 @A(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 9\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
- " #38 @B(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 9\n" +
- " )\n" +
- " #39 @C(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 9\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #37 @A(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 9\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #38 @B(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 9\n" +
+ " )\n" +
+ " #39 @C(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 9\n" +
" location = [ARRAY]\n" +
- " )\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test060b_codeblocks_new_multiNewArray() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public boolean foo(String s) {\n" +
+ "public class X {\n" +
+ " public boolean foo(String s) {\n" +
" System.out.println(\"xyz\");\n" +
- " X[][] x = new @A X @B [1] @C[2];\n" +
- " return true;\n" +
- " }\n" +
+ " X[][] x = new @A X @B [1] @C[2];\n" +
+ " return true;\n" +
+ " }\n" +
"}",
-
+
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
-
+
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@interface B {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@interface B {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"C.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@interface C {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@interface C {\n" +
+ " String value() default \"default\";\n" +
"}\n",
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #36 @A(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 10\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
- " #37 @B(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 10\n" +
- " )\n" +
- " #38 @C(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 10\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #36 @A(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 10\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #37 @B(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 10\n" +
+ " )\n" +
+ " #38 @C(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 10\n" +
" location = [ARRAY]\n" +
- " )\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test060c_codeblocks_new_multiNewArray() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public boolean foo(String s) {\n" +
+ "public class X {\n" +
+ " public boolean foo(String s) {\n" +
" System.out.println(\"xyz\");\n" +
" X [][][] x = new @A X @B[10] @C[10] @D[];\n" +
- " return true;\n" +
- " }\n" +
+ " return true;\n" +
+ " }\n" +
"}",
-
+
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
-
+
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@interface B {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@interface B {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"C.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@interface C {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@interface C {\n" +
+ " String value() default \"default\";\n" +
"}\n",
-
+
"D.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@interface D {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@interface D {\n" +
+ " String value() default \"default\";\n" +
"}\n",
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #36 @A(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 12\n" +
- " location = [ARRAY, ARRAY, ARRAY]\n" +
- " )\n" +
- " #37 @B(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 12\n" +
- " )\n" +
- " #38 @C(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 12\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " #39 @D(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 12\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #36 @A(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 12\n" +
+ " location = [ARRAY, ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #37 @B(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 12\n" +
+ " )\n" +
+ " #38 @C(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 12\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " #39 @D(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 12\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test060d_codeblocks_new_arraysWithNestedTypes() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public boolean foo(String s) {\n" +
+ "public class X {\n" +
+ " public boolean foo(String s) {\n" +
" System.out.println(\"xyz\");\n" +
- " Object o = new @B(1) Outer.@B(2) Inner @B(3) [2];\n" +
- " return true;\n" +
- " }\n" +
+ " Object o = new @B(1) Outer.@B(2) Inner @B(3) [2];\n" +
+ " return true;\n" +
+ " }\n" +
"}\n" +
"class Outer { class Inner {}}\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface B {\n" +
- " int value() default 99;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface B {\n" +
+ " int value() default 99;\n" +
"}\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #37 @B(\n" +
- " #38 value=(int) 1 (constant type)\n" +
- " target type = 0x44 NEW\n" +
- " offset = 9\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " #37 @B(\n" +
- " #38 value=(int) 2 (constant type)\n" +
- " target type = 0x44 NEW\n" +
- " offset = 9\n" +
- " location = [ARRAY, INNER_TYPE]\n" +
- " )\n" +
- " #37 @B(\n" +
- " #38 value=(int) 3 (constant type)\n" +
- " target type = 0x44 NEW\n" +
- " offset = 9\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #37 @B(\n" +
+ " #38 value=(int) 1 (constant type)\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 9\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " #37 @B(\n" +
+ " #38 value=(int) 2 (constant type)\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 9\n" +
+ " location = [ARRAY, INNER_TYPE]\n" +
+ " )\n" +
+ " #37 @B(\n" +
+ " #38 value=(int) 3 (constant type)\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 9\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -2916,51 +2916,51 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public boolean foo(String s) {\n" +
+ "public class X {\n" +
+ " public boolean foo(String s) {\n" +
" System.out.println(\"xyz\");\n" +
- " Object o = new @B(1) Outer.@B(2) Inner @B(3) [2] @B(4)[4];\n" +
- " return true;\n" +
- " }\n" +
+ " Object o = new @B(1) Outer.@B(2) Inner @B(3) [2] @B(4)[4];\n" +
+ " return true;\n" +
+ " }\n" +
"}\n" +
"class Outer { class Inner {}}\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface B {\n" +
- " int value() default 99;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface B {\n" +
+ " int value() default 99;\n" +
"}\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #37 @B(\n" +
- " #38 value=(int) 1 (constant type)\n" +
- " target type = 0x44 NEW\n" +
- " offset = 10\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
- " #37 @B(\n" +
- " #38 value=(int) 2 (constant type)\n" +
- " target type = 0x44 NEW\n" +
- " offset = 10\n" +
- " location = [ARRAY, ARRAY, INNER_TYPE]\n" +
- " )\n" +
- " #37 @B(\n" +
- " #38 value=(int) 3 (constant type)\n" +
- " target type = 0x44 NEW\n" +
- " offset = 10\n" +
- " )\n" +
- " #37 @B(\n" +
- " #38 value=(int) 4 (constant type)\n" +
- " target type = 0x44 NEW\n" +
- " offset = 10\n" +
- " location = [ARRAY]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #37 @B(\n" +
+ " #38 value=(int) 1 (constant type)\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 10\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #37 @B(\n" +
+ " #38 value=(int) 2 (constant type)\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 10\n" +
+ " location = [ARRAY, ARRAY, INNER_TYPE]\n" +
+ " )\n" +
+ " #37 @B(\n" +
+ " #38 value=(int) 3 (constant type)\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 10\n" +
+ " )\n" +
+ " #37 @B(\n" +
+ " #38 value=(int) 4 (constant type)\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 10\n" +
+ " location = [ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test060f_codeblocks_new_arraysWithQualifiedNestedTypes() throws Exception {
this.runConformTest(
new String[] {
@@ -2968,48 +2968,48 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"public class Z {}",
"X.java",
"package org.foo.bar;\n" +
- "public class X {\n" +
- " public boolean foo(String s) {\n" +
+ "public class X {\n" +
+ " public boolean foo(String s) {\n" +
" System.out.println(\"xyz\");\n" +
- " Object o = new org.foo.bar.@B(1) Outer.@B(2) Inner @B(3) [2] @B(4)[4];\n" +
- " return true;\n" +
- " }\n" +
+ " Object o = new org.foo.bar.@B(1) Outer.@B(2) Inner @B(3) [2] @B(4)[4];\n" +
+ " return true;\n" +
+ " }\n" +
"}\n" +
"class Outer { class Inner {}}\n",
"B.java",
"package org.foo.bar;\n" +
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface B {\n" +
- " int value() default 99;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface B {\n" +
+ " int value() default 99;\n" +
"}\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #37 @org.foo.bar.B(\n" +
- " #38 value=(int) 1 (constant type)\n" +
- " target type = 0x44 NEW\n" +
- " offset = 10\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
- " #37 @org.foo.bar.B(\n" +
- " #38 value=(int) 2 (constant type)\n" +
- " target type = 0x44 NEW\n" +
- " offset = 10\n" +
- " location = [ARRAY, ARRAY, INNER_TYPE]\n" +
- " )\n" +
- " #37 @org.foo.bar.B(\n" +
- " #38 value=(int) 3 (constant type)\n" +
- " target type = 0x44 NEW\n" +
- " offset = 10\n" +
- " )\n" +
- " #37 @org.foo.bar.B(\n" +
- " #38 value=(int) 4 (constant type)\n" +
- " target type = 0x44 NEW\n" +
- " offset = 10\n" +
- " location = [ARRAY]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #37 @org.foo.bar.B(\n" +
+ " #38 value=(int) 1 (constant type)\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 10\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #37 @org.foo.bar.B(\n" +
+ " #38 value=(int) 2 (constant type)\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 10\n" +
+ " location = [ARRAY, ARRAY, INNER_TYPE]\n" +
+ " )\n" +
+ " #37 @org.foo.bar.B(\n" +
+ " #38 value=(int) 3 (constant type)\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 10\n" +
+ " )\n" +
+ " #37 @org.foo.bar.B(\n" +
+ " #38 value=(int) 4 (constant type)\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 10\n" +
+ " location = [ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "org" + File.separator + "foo" + File.separator + "bar" + File.separator + "X.class",
"org.foo.bar.X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
@@ -3019,217 +3019,217 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"C.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface C {\n" +
- " char value() default '-';\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface C {\n" +
+ " char value() default '-';\n" +
"}\n",
"I.java",
"interface I {}\n",
"J.java",
"interface J {}\n",
"X.java",
- "public class X {\n" +
- " public boolean foo(String s) {\n" +
+ "public class X {\n" +
+ " public boolean foo(String s) {\n" +
" System.out.println(\"xyz\");\n" +
- " Object o = new @A String []{\"xyz\"};\n" +
- " return true;\n" +
- " }\n" +
+ " Object o = new @A String []{\"xyz\"};\n" +
+ " return true;\n" +
+ " }\n" +
"}",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #37 @A(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 9\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #37 @A(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 9\n" +
" location = [ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test062_codeblocks_newArray() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"C.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface C {\n" +
- " char value() default '-';\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface C {\n" +
+ " char value() default '-';\n" +
"}\n",
"I.java",
"interface I {}\n",
"J.java",
"interface J {}\n",
"X.java",
- "public class X {\n" +
- " public boolean foo(String s) {\n" +
+ "public class X {\n" +
+ " public boolean foo(String s) {\n" +
" System.out.println(\"xyz\");\n" +
- " Object o = new String @A[1];\n" +
- " return true;\n" +
- " }\n" +
+ " Object o = new String @A[1];\n" +
+ " return true;\n" +
+ " }\n" +
"}",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #37 @A(\n" +
- " target type = 0x44 NEW\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #37 @A(\n" +
+ " target type = 0x44 NEW\n" +
" offset = 9\n" +
// no type path expected here
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test062_codeblocks_newArrayWithInitializer() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"C.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface C {\n" +
- " char value() default '-';\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface C {\n" +
+ " char value() default '-';\n" +
"}\n",
"I.java",
"interface I {}\n",
"J.java",
"interface J {}\n",
"X.java",
- "public class X {\n" +
- " public boolean foo(String s) {\n" +
+ "public class X {\n" +
+ " public boolean foo(String s) {\n" +
" System.out.println(\"xyz\");\n" +
- " Object o = new String @A[] { \"Hello\" };\n" +
- " return true;\n" +
- " }\n" +
+ " Object o = new String @A[] { \"Hello\" };\n" +
+ " return true;\n" +
+ " }\n" +
"}",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #39 @A(\n" +
- " target type = 0x44 NEW\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #39 @A(\n" +
+ " target type = 0x44 NEW\n" +
" offset = 9\n" +
// no type path expected here
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test063_codeblocks_new_instanceof() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"C.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface C {\n" +
- " char value() default '-';\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface C {\n" +
+ " char value() default '-';\n" +
"}\n",
"I.java",
"interface I {}\n",
"J.java",
"interface J {}\n",
"X.java",
- "public class X {\n" +
- " public boolean foo(Object o) {\n" +
- " boolean b = (o instanceof @C('_') Object[]);\n" +
- " Object o1 = new @B(3) @A(\"new Object\") Object[] {};\n" +
- " return b;\n" +
- " }\n" +
+ "public class X {\n" +
+ " public boolean foo(Object o) {\n" +
+ " boolean b = (o instanceof @C('_') Object[]);\n" +
+ " Object o1 = new @B(3) @A(\"new Object\") Object[] {};\n" +
+ " return b;\n" +
+ " }\n" +
"}",
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #24 @B(\n" +
- " #25 value=(int) 3 (constant type)\n" +
- " target type = 0x44 NEW\n" +
- " offset = 6\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #28 @C(\n" +
- " #25 value=\'_\' (constant type)\n" +
- " target type = 0x43 INSTANCEOF\n" +
- " offset = 1\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " #30 @A(\n" +
- " #25 value=\"new Object\" (constant type)\n" +
- " target type = 0x44 NEW\n" +
- " offset = 6\n" +
- " location = [ARRAY]\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #24 @B(\n" +
+ " #25 value=(int) 3 (constant type)\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 6\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #28 @C(\n" +
+ " #25 value=\'_\' (constant type)\n" +
+ " target type = 0x43 INSTANCEOF\n" +
+ " offset = 1\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " #30 @A(\n" +
+ " #25 value=\"new Object\" (constant type)\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 6\n" +
+ " location = [ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test064_codeblocks_constructorReference() throws Exception {
this.runConformTest(
@@ -3237,34 +3237,34 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"X.java",
"import java.util.*;\n" +
"interface MR { X process(String input); }\n"+
- "public class X<T> {\n" +
+ "public class X<T> {\n" +
" public X(T t) {}\n" +
" public static <T> String foo(String bar) { return bar; }\n"+
" public void bar() {\n" +
" System.out.println(\"abc\");\n" +
" MR ref = @A X::new;\n" +
- " }\n" +
+ " }\n" +
"}",
-
+
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
-
+
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #48 @A(\n" +
- " target type = 0x45 CONSTRUCTOR_REFERENCE\n" +
- " offset = 8\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #48 @A(\n" +
+ " target type = 0x45 CONSTRUCTOR_REFERENCE\n" +
+ " offset = 8\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test065_codeblocks_methodReference() throws Exception {
this.runConformTest(
@@ -3272,34 +3272,34 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"X.java",
"import java.util.*;\n" +
"interface MR { String process(String input); }\n"+
- "public class X<T> {\n" +
+ "public class X<T> {\n" +
" public static <T> String foo(String bar) { return bar; }\n"+
" public void bar() {\n" +
" System.out.println(\"abc\");\n" +
" MR ref = @A X::foo;\n" +
" ref.process(\"abc\");\n" +
- " }\n" +
+ " }\n" +
"}",
-
+
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
-
+
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #47 @A(\n" +
- " target type = 0x46 METHOD_REFERENCE\n" +
- " offset = 8\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #47 @A(\n" +
+ " target type = 0x46 METHOD_REFERENCE\n" +
+ " offset = 8\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test066_codeblocks_methodReference() throws Exception {
this.runConformTest(
new String[] {
@@ -3313,28 +3313,28 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
" i.copy(new int[10]); \n" +
" }\n" +
"}\n",
-
+
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #30 @B(\n" +
- " #31 value=(int) 1 (constant type)\n" +
- " target type = 0x46 METHOD_REFERENCE\n" +
- " offset = 0\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " #30 @B(\n" +
- " #31 value=(int) 2 (constant type)\n" +
- " target type = 0x46 METHOD_REFERENCE\n" +
- " offset = 0\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #30 @B(\n" +
+ " #31 value=(int) 1 (constant type)\n" +
+ " target type = 0x46 METHOD_REFERENCE\n" +
+ " offset = 0\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " #30 @B(\n" +
+ " #31 value=(int) 2 (constant type)\n" +
+ " target type = 0x46 METHOD_REFERENCE\n" +
+ " offset = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -3345,150 +3345,150 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"X.java",
"import java.util.*;\n" +
"interface MR { X process(String input); }\n" +
- "public class X<T> {\n" +
+ "public class X<T> {\n" +
" public X(T s) {};\n" +
" public static <T> String foo(String bar) { return bar; }\n"+
" public void bar() {\n" +
" System.out.println(\"abc\");\n" +
" MR ref = X<String>::<@A String>new;\n" +
" ref.process(\"abc\");\n" +
- " }\n" +
+ " }\n" +
"}",
-
+
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
-
+
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #53 @A(\n" +
- " target type = 0x4a CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT\n" +
- " offset = 8\n" +
- " type argument index = 0\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #53 @A(\n" +
+ " target type = 0x4a CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT\n" +
+ " offset = 8\n" +
+ " type argument index = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test068_codeblocks_methodReferenceTypeArgument() throws Exception {
this.runConformTest(
new String[] {
"X.java",
"import java.util.*;\n" +
"interface MR { String process(String input); }\n"+
- "public class X<T> {\n" +
+ "public class X<T> {\n" +
" public static <T> String foo(String bar) { return bar; }\n"+
" public void bar() {\n" +
" System.out.println(\"abc\");\n" +
" MR ref = X::<@A String>foo;\n" +
" ref.process(\"abc\");\n" +
- " }\n" +
+ " }\n" +
"}",
-
+
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
-
+
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #47 @A(\n" +
- " target type = 0x4b METHOD_REFERENCE_TYPE_ARGUMENT\n" +
- " offset = 8\n" +
- " type argument index = 0\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #47 @A(\n" +
+ " target type = 0x4b METHOD_REFERENCE_TYPE_ARGUMENT\n" +
+ " offset = 8\n" +
+ " type argument index = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test069_codeblocks_cast() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public void foo(Object o) {\n" +
+ "public class X {\n" +
+ " public void foo(Object o) {\n" +
" if (o instanceof String) {\n" +
" String tab = (@A String) o;\n" +
" System.out.println(tab);\n" +
- " }\n" +
+ " }\n" +
" System.out.println(o);\n" +
- " }\n" +
+ " }\n" +
"}",
-
+
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
-
+
},
"");
// javac-b81: Bytes:11[0 1 71 0 7 0 0 0 16 0 0]
// relevant numbers '71 0 7 0' which mean 0x47 (CAST) at offset 7
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #38 @A(\n" +
- " target type = 0x47 CAST\n" +
- " offset = 8\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #38 @A(\n" +
+ " target type = 0x47 CAST\n" +
+ " offset = 8\n" +
" type argument index = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test070_codeblocks_cast_complex() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"C.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface C {\n" +
- " char value() default '-';\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface C {\n" +
+ " char value() default '-';\n" +
"}\n",
"I.java",
"interface I {}\n",
"J.java",
"interface J {}\n",
"X.java",
- "public class X {\n" +
- " public void foo(Object o) {\n" +
+ "public class X {\n" +
+ " public void foo(Object o) {\n" +
" if (o instanceof String[][]) {\n" +
" String[][] tab = (@C('_') @B(3) String[] @A[]) o;\n" +
" System.out.println(tab.length);\n" +
- " }\n" +
+ " }\n" +
" System.out.println(o);\n" +
- " }\n" +
+ " }\n" +
"}",
},
"");
@@ -3496,37 +3496,37 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
// Bytes:31[0 2 71 0 7 0 1 0 0 0 16 0 0 71 0 7 0 2 0 0 0 0 0 17 0 1 0 18 67 0 19]
// Bytes:20[0 1 71 0 7 0 2 0 0 0 0 0 21 0 1 0 18 73 0 22]
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #37 @B(\n" +
- " #38 value=(int) 3 (constant type)\n" +
- " target type = 0x47 CAST\n" +
- " offset = 8\n" +
- " type argument index = 0\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #41 @C(\n" +
- " #38 value=\'_\' (constant type)\n" +
- " target type = 0x47 CAST\n" +
- " offset = 8\n" +
- " type argument index = 0\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
- " #43 @A(\n" +
- " target type = 0x47 CAST\n" +
- " offset = 8\n" +
- " type argument index = 0\n" +
- " location = [ARRAY]\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #37 @B(\n" +
+ " #38 value=(int) 3 (constant type)\n" +
+ " target type = 0x47 CAST\n" +
+ " offset = 8\n" +
+ " type argument index = 0\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #41 @C(\n" +
+ " #38 value=\'_\' (constant type)\n" +
+ " target type = 0x47 CAST\n" +
+ " offset = 8\n" +
+ " type argument index = 0\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #43 @A(\n" +
+ " target type = 0x47 CAST\n" +
+ " offset = 8\n" +
+ " type argument index = 0\n" +
+ " location = [ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test070a_codeblocks_castWithIntersectionCast() throws Exception {
this.runConformTest(
new String[] {
"X.java",
"import java.io.*;\n" +
- "public class X {\n" +
+ "public class X {\n" +
" public void foo(Object o) {\n" +
" I i = (@B(1) I & J) o;\n" +
" J j = (I & @B(2) J) o;\n" +
@@ -3534,60 +3534,60 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n" +
"interface J {}\n",
-
+
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface B {\n" +
- " int value() default 1;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface B {\n" +
+ " int value() default 1;\n" +
"}\n",
},
"");
String expectedOutput =
- " // Method descriptor #15 (Ljava/lang/Object;)V\n" +
- " // Stack: 1, Locals: 4\n" +
- " public void foo(java.lang.Object o);\n" +
- " 0 aload_1 [o]\n" +
- " 1 checkcast J [16]\n" +
- " 4 checkcast I [18]\n" +
- " 7 astore_2 [i]\n" +
- " 8 aload_1 [o]\n" +
- " 9 checkcast J [16]\n" +
- " 12 checkcast I [18]\n" +
- " 15 astore_3 [j]\n" +
- " 16 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 4]\n" +
- " [pc: 8, line: 5]\n" +
- " [pc: 16, line: 6]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 17] local: this index: 0 type: X\n" +
- " [pc: 0, pc: 17] local: o index: 1 type: java.lang.Object\n" +
- " [pc: 8, pc: 17] local: i index: 2 type: I\n" +
- " [pc: 16, pc: 17] local: j index: 3 type: J\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #27 @B(\n" +
- " #28 value=(int) 1 (constant type)\n" +
- " target type = 0x47 CAST\n" +
- " offset = 4\n" +
- " type argument index = 0\n" +
- " )\n" +
- " #27 @B(\n" +
- " #28 value=(int) 2 (constant type)\n" +
- " target type = 0x47 CAST\n" +
- " offset = 9\n" +
- " type argument index = 1\n" +
+ " // Method descriptor #15 (Ljava/lang/Object;)V\n" +
+ " // Stack: 1, Locals: 4\n" +
+ " public void foo(java.lang.Object o);\n" +
+ " 0 aload_1 [o]\n" +
+ " 1 checkcast J [16]\n" +
+ " 4 checkcast I [18]\n" +
+ " 7 astore_2 [i]\n" +
+ " 8 aload_1 [o]\n" +
+ " 9 checkcast J [16]\n" +
+ " 12 checkcast I [18]\n" +
+ " 15 astore_3 [j]\n" +
+ " 16 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 4]\n" +
+ " [pc: 8, line: 5]\n" +
+ " [pc: 16, line: 6]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 17] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 17] local: o index: 1 type: java.lang.Object\n" +
+ " [pc: 8, pc: 17] local: i index: 2 type: I\n" +
+ " [pc: 16, pc: 17] local: j index: 3 type: J\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #27 @B(\n" +
+ " #28 value=(int) 1 (constant type)\n" +
+ " target type = 0x47 CAST\n" +
+ " offset = 4\n" +
+ " type argument index = 0\n" +
+ " )\n" +
+ " #27 @B(\n" +
+ " #28 value=(int) 2 (constant type)\n" +
+ " target type = 0x47 CAST\n" +
+ " offset = 9\n" +
+ " type argument index = 1\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test070b_codeblocks_castWithIntersectionCast() throws Exception {
this.runConformTest(
new String[] {
"X.java",
"import java.io.*;\n" +
- "public class X {\n" +
+ "public class X {\n" +
" public void foo(Object o) {\n" +
" System.out.println(123);\n" +
" I<String> i = (I<@B(1) String> & @B(2) J<String>) o;\n" +
@@ -3595,59 +3595,59 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"}\n" +
"interface I<T> {}\n" +
"interface J<T> {}\n",
-
+
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface B {\n" +
- " int value() default 1;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface B {\n" +
+ " int value() default 1;\n" +
"}\n",
},
"");
String expectedOutput =
- " public void foo(java.lang.Object o);\n" +
- " 0 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 3 bipush 123\n" +
- " 5 invokevirtual java.io.PrintStream.println(int) : void [22]\n" +
- " 8 aload_1 [o]\n" +
- " 9 checkcast J [28]\n" +
- " 12 checkcast I [30]\n" +
- " 15 astore_2 [i]\n" +
- " 16 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 4]\n" +
- " [pc: 8, line: 5]\n" +
- " [pc: 16, line: 6]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 17] local: this index: 0 type: X\n" +
- " [pc: 0, pc: 17] local: o index: 1 type: java.lang.Object\n" +
- " [pc: 16, pc: 17] local: i index: 2 type: I\n" +
- " Local variable type table:\n" +
- " [pc: 16, pc: 17] local: i index: 2 type: I<java.lang.String>\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #39 @B(\n" +
- " #40 value=(int) 2 (constant type)\n" +
- " target type = 0x47 CAST\n" +
- " offset = 9\n" +
- " type argument index = 1\n" +
- " )\n" +
- " #39 @B(\n" +
- " #40 value=(int) 1 (constant type)\n" +
- " target type = 0x47 CAST\n" +
- " offset = 12\n" +
- " type argument index = 0\n" +
- " location = [TYPE_ARGUMENT(0)]\n" +
+ " public void foo(java.lang.Object o);\n" +
+ " 0 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 3 bipush 123\n" +
+ " 5 invokevirtual java.io.PrintStream.println(int) : void [22]\n" +
+ " 8 aload_1 [o]\n" +
+ " 9 checkcast J [28]\n" +
+ " 12 checkcast I [30]\n" +
+ " 15 astore_2 [i]\n" +
+ " 16 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 4]\n" +
+ " [pc: 8, line: 5]\n" +
+ " [pc: 16, line: 6]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 17] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 17] local: o index: 1 type: java.lang.Object\n" +
+ " [pc: 16, pc: 17] local: i index: 2 type: I\n" +
+ " Local variable type table:\n" +
+ " [pc: 16, pc: 17] local: i index: 2 type: I<java.lang.String>\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #39 @B(\n" +
+ " #40 value=(int) 2 (constant type)\n" +
+ " target type = 0x47 CAST\n" +
+ " offset = 9\n" +
+ " type argument index = 1\n" +
+ " )\n" +
+ " #39 @B(\n" +
+ " #40 value=(int) 1 (constant type)\n" +
+ " target type = 0x47 CAST\n" +
+ " offset = 12\n" +
+ " type argument index = 0\n" +
+ " location = [TYPE_ARGUMENT(0)]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test070c_codeblocks_castTwiceInExpression() throws Exception {
this.runConformTest(
new String[] {
"X.java",
"import java.io.*;\n" +
- "public class X {\n" +
+ "public class X {\n" +
" public void foo(Object o) {\n" +
" System.out.println(123);\n" +
" I i = (@B(1) I)(@B(2) J) o;\n" +
@@ -3655,55 +3655,55 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"}\n" +
"interface I {}\n" +
"interface J {}\n",
-
+
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface B {\n" +
- " int value() default 1;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface B {\n" +
+ " int value() default 1;\n" +
"}\n",
},
"");
String expectedOutput =
- " 0 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 3 bipush 123\n" +
- " 5 invokevirtual java.io.PrintStream.println(int) : void [22]\n" +
- " 8 aload_1 [o]\n" +
- " 9 checkcast J [28]\n" +
- " 12 checkcast I [30]\n" +
- " 15 astore_2 [i]\n" +
- " 16 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 4]\n" +
- " [pc: 8, line: 5]\n" +
- " [pc: 16, line: 6]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 17] local: this index: 0 type: X\n" +
- " [pc: 0, pc: 17] local: o index: 1 type: java.lang.Object\n" +
- " [pc: 16, pc: 17] local: i index: 2 type: I\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #37 @B(\n" +
- " #38 value=(int) 2 (constant type)\n" +
- " target type = 0x47 CAST\n" +
- " offset = 9\n" +
- " type argument index = 0\n" +
- " )\n" +
- " #37 @B(\n" +
- " #38 value=(int) 1 (constant type)\n" +
- " target type = 0x47 CAST\n" +
- " offset = 12\n" +
- " type argument index = 0\n" +
+ " 0 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 3 bipush 123\n" +
+ " 5 invokevirtual java.io.PrintStream.println(int) : void [22]\n" +
+ " 8 aload_1 [o]\n" +
+ " 9 checkcast J [28]\n" +
+ " 12 checkcast I [30]\n" +
+ " 15 astore_2 [i]\n" +
+ " 16 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 4]\n" +
+ " [pc: 8, line: 5]\n" +
+ " [pc: 16, line: 6]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 17] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 17] local: o index: 1 type: java.lang.Object\n" +
+ " [pc: 16, pc: 17] local: i index: 2 type: I\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #37 @B(\n" +
+ " #38 value=(int) 2 (constant type)\n" +
+ " target type = 0x47 CAST\n" +
+ " offset = 9\n" +
+ " type argument index = 0\n" +
+ " )\n" +
+ " #37 @B(\n" +
+ " #38 value=(int) 1 (constant type)\n" +
+ " target type = 0x47 CAST\n" +
+ " offset = 12\n" +
+ " type argument index = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test070d_codeblocks_castDoubleIntersectionCastInExpression() throws Exception {
this.runConformTest(
new String[] {
"X.java",
"import java.io.*;\n" +
- "public class X {\n" +
+ "public class X {\n" +
" public void foo(Object o) {\n" +
" System.out.println(123);\n" +
" I i = (@B(1) I & J)(K & @B(2) L) o;\n" +
@@ -3713,172 +3713,172 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"interface J {}\n" +
"interface K {}\n" +
"interface L {}\n",
-
+
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface B {\n" +
- " int value() default 1;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface B {\n" +
+ " int value() default 1;\n" +
"}\n",
},
"");
String expectedOutput =
- " public void foo(java.lang.Object o);\n" +
- " 0 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- " 3 bipush 123\n" +
- " 5 invokevirtual java.io.PrintStream.println(int) : void [22]\n" +
- " 8 aload_1 [o]\n" +
- " 9 checkcast L [28]\n" +
- " 12 checkcast K [30]\n" +
- " 15 checkcast J [32]\n" +
- " 18 checkcast I [34]\n" +
- " 21 astore_2 [i]\n" +
- " 22 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 4]\n" +
- " [pc: 8, line: 5]\n" +
- " [pc: 22, line: 6]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 23] local: this index: 0 type: X\n" +
- " [pc: 0, pc: 23] local: o index: 1 type: java.lang.Object\n" +
- " [pc: 22, pc: 23] local: i index: 2 type: I\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #41 @B(\n" +
- " #42 value=(int) 2 (constant type)\n" +
- " target type = 0x47 CAST\n" +
- " offset = 9\n" +
- " type argument index = 1\n" +
- " )\n" +
- " #41 @B(\n" +
- " #42 value=(int) 1 (constant type)\n" +
- " target type = 0x47 CAST\n" +
- " offset = 18\n" +
- " type argument index = 0\n" +
+ " public void foo(java.lang.Object o);\n" +
+ " 0 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
+ " 3 bipush 123\n" +
+ " 5 invokevirtual java.io.PrintStream.println(int) : void [22]\n" +
+ " 8 aload_1 [o]\n" +
+ " 9 checkcast L [28]\n" +
+ " 12 checkcast K [30]\n" +
+ " 15 checkcast J [32]\n" +
+ " 18 checkcast I [34]\n" +
+ " 21 astore_2 [i]\n" +
+ " 22 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 4]\n" +
+ " [pc: 8, line: 5]\n" +
+ " [pc: 22, line: 6]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 23] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 23] local: o index: 1 type: java.lang.Object\n" +
+ " [pc: 22, pc: 23] local: i index: 2 type: I\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #41 @B(\n" +
+ " #42 value=(int) 2 (constant type)\n" +
+ " target type = 0x47 CAST\n" +
+ " offset = 9\n" +
+ " type argument index = 1\n" +
+ " )\n" +
+ " #41 @B(\n" +
+ " #42 value=(int) 1 (constant type)\n" +
+ " target type = 0x47 CAST\n" +
+ " offset = 18\n" +
+ " type argument index = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test071_codeblocks_constructorInvocationTypeArgument() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"X.java",
- "public class X {\n" +
- " <T> X(T t) {\n" +
- " }\n" +
- " public Object foo() {\n" +
- " X x = new <@A @B(1) String>X(null);\n" +
- " return x;\n" +
- " }\n" +
+ "public class X {\n" +
+ " <T> X(T t) {\n" +
+ " }\n" +
+ " public Object foo() {\n" +
+ " X x = new <@A @B(1) String>X(null);\n" +
+ " return x;\n" +
+ " }\n" +
"}",
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #27 @B(\n" +
- " #28 value=(int) 1 (constant type)\n" +
- " target type = 0x48 CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT\n" +
- " offset = 5\n" +
- " type argument index = 0\n" +
- " )\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #31 @A(\n" +
- " target type = 0x48 CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT\n" +
- " offset = 5\n" +
- " type argument index = 0\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #27 @B(\n" +
+ " #28 value=(int) 1 (constant type)\n" +
+ " target type = 0x48 CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT\n" +
+ " offset = 5\n" +
+ " type argument index = 0\n" +
+ " )\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #31 @A(\n" +
+ " target type = 0x48 CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT\n" +
+ " offset = 5\n" +
+ " type argument index = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test072_codeblocks_constructorInvocationTypeArgument() throws Exception {
this.runConformTest(
new String[] {
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"C.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface C {\n" +
- " char value() default '-';\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface C {\n" +
+ " char value() default '-';\n" +
"}\n",
"X.java",
- "public class X {\n" +
- " <T, U> X(T t, U u) {\n" +
- " }\n" +
- " public Object foo() {\n" +
- " X x = new <@A Integer, @A String @C [] @B(1)[]>X(null, null);\n" +
- " return x;\n" +
- " }\n" +
+ "public class X {\n" +
+ " <T, U> X(T t, U u) {\n" +
+ " }\n" +
+ " public Object foo() {\n" +
+ " X x = new <@A Integer, @A String @C [] @B(1)[]>X(null, null);\n" +
+ " return x;\n" +
+ " }\n" +
"}",
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #29 @B(\n" +
- " #30 value=(int) 1 (constant type)\n" +
- " target type = 0x48 CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT\n" +
- " offset = 6\n" +
- " type argument index = 1\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #33 @A(\n" +
- " target type = 0x48 CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT\n" +
- " offset = 6\n" +
- " type argument index = 0\n" +
- " )\n" +
- " #33 @A(\n" +
- " target type = 0x48 CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT\n" +
- " offset = 6\n" +
- " type argument index = 1\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
- " #34 @C(\n" +
- " target type = 0x48 CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT\n" +
- " offset = 6\n" +
- " type argument index = 1\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #29 @B(\n" +
+ " #30 value=(int) 1 (constant type)\n" +
+ " target type = 0x48 CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT\n" +
+ " offset = 6\n" +
+ " type argument index = 1\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #33 @A(\n" +
+ " target type = 0x48 CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT\n" +
+ " offset = 6\n" +
+ " type argument index = 0\n" +
+ " )\n" +
+ " #33 @A(\n" +
+ " target type = 0x48 CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT\n" +
+ " offset = 6\n" +
+ " type argument index = 1\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #34 @C(\n" +
+ " target type = 0x48 CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT\n" +
+ " offset = 6\n" +
+ " type argument index = 1\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -3886,97 +3886,97 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T1, T2> {\n" +
- " public void bar() {\n" +
+ "public class X<T1, T2> {\n" +
+ " public void bar() {\n" +
" new <String, @A T2>X();\n"+
- " }\n" +
+ " }\n" +
"}",
-
+
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
-
+
},
"");
// Example bytes:11[0 1 73 0 0 0 0 0 13 0 0] this would be for offset 0
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #19 @A(\n" +
- " target type = 0x48 CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT\n" +
- " offset = 3\n" +
- " type argument index = 1\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #19 @A(\n" +
+ " target type = 0x48 CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT\n" +
+ " offset = 3\n" +
+ " type argument index = 1\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test074_codeblocks_constructorInvocationTypeArgument() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T1,T2> {\n" +
+ "public class X<T1,T2> {\n" +
" public static void foo(int i) {}\n"+
- " public void bar() {\n" +
+ " public void bar() {\n" +
" new <java.util.List<@A String>, T2>X();\n"+
- " }\n" +
+ " }\n" +
"}",
-
+
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
-
+
},
"");
// Example bytes:11[0 1 73 0 0 0 0 0 13 0 0] this would be for offset 0
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #23 @A(\n" +
- " target type = 0x48 CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT\n" +
- " offset = 3\n" +
- " type argument index = 0\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #23 @A(\n" +
+ " target type = 0x48 CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT\n" +
+ " offset = 3\n" +
+ " type argument index = 0\n" +
" location = [TYPE_ARGUMENT(0)]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test075_codeblocks_constructorInvocationTypeArgument() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T> {\n" +
- " public void bar() {\n" +
+ "public class X<T> {\n" +
+ " public void bar() {\n" +
" new <@A T>X();\n"+
- " }\n" +
+ " }\n" +
"}",
-
+
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
-
+
},
"");
// Example bytes:11[0 1 73 0 0 0 0 0 13 0 0] this would be for offset 0
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #19 @A(\n" +
- " target type = 0x48 CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT\n" +
- " offset = 3\n" +
- " type argument index = 0\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #19 @A(\n" +
+ " target type = 0x48 CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT\n" +
+ " offset = 3\n" +
+ " type argument index = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test076_codeblocks_methodInvocationTypeArgument() throws Exception {
this.runConformTest(
new String[] {
@@ -3991,244 +3991,244 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
" }\n" +
"}\n",
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(CLASS)\n" +
- "@interface B {\n" +
- " int value() default -1;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(CLASS)\n" +
+ "@interface B {\n" +
+ " int value() default -1;\n" +
"}",
"C.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface C {\n" +
- " char value() default '-';\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface C {\n" +
+ " char value() default '-';\n" +
"}\n",
},
"SUCCESS");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #48 @B(\n" +
- " #49 value=(int) 1 (constant type)\n" +
- " target type = 0x49 METHOD_INVOCATION_TYPE_ARGUMENT\n" +
- " offset = 13\n" +
- " type argument index = 0\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #52 @A(\n" +
- " target type = 0x49 METHOD_INVOCATION_TYPE_ARGUMENT\n" +
- " offset = 13\n" +
- " type argument index = 0\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " #53 @C(\n" +
- " #49 value=\'-\' (constant type)\n" +
- " target type = 0x49 METHOD_INVOCATION_TYPE_ARGUMENT\n" +
- " offset = 13\n" +
- " type argument index = 1\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #48 @B(\n" +
+ " #49 value=(int) 1 (constant type)\n" +
+ " target type = 0x49 METHOD_INVOCATION_TYPE_ARGUMENT\n" +
+ " offset = 13\n" +
+ " type argument index = 0\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #52 @A(\n" +
+ " target type = 0x49 METHOD_INVOCATION_TYPE_ARGUMENT\n" +
+ " offset = 13\n" +
+ " type argument index = 0\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " #53 @C(\n" +
+ " #49 value=\'-\' (constant type)\n" +
+ " target type = 0x49 METHOD_INVOCATION_TYPE_ARGUMENT\n" +
+ " offset = 13\n" +
+ " type argument index = 1\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test077_codeblocks_methodInvocationTypeArgument() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T1,T2> {\n" +
+ "public class X<T1,T2> {\n" +
" public static void foo(int i) {}\n"+
- " public void bar() {\n" +
+ " public void bar() {\n" +
" X.<String, @A T2>foo(42);\n"+
- " }\n" +
+ " }\n" +
"}",
-
+
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
-
+
},
"");
// Example bytes:11[0 1 73 0 0 0 0 0 13 0 0] this would be for offset 0
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #24 @A(\n" +
- " target type = 0x49 METHOD_INVOCATION_TYPE_ARGUMENT\n" +
- " offset = 2\n" +
- " type argument index = 1\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #24 @A(\n" +
+ " target type = 0x49 METHOD_INVOCATION_TYPE_ARGUMENT\n" +
+ " offset = 2\n" +
+ " type argument index = 1\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test078_codeblocks_methodInvocationTypeArgument() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T1,T2> {\n" +
+ "public class X<T1,T2> {\n" +
" public static void foo(int i) {}\n"+
- " public void bar() {\n" +
+ " public void bar() {\n" +
" X.<java.util.List<@A String>, T2>foo(42);\n"+
- " }\n" +
+ " }\n" +
"}",
-
+
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
-
+
},
"");
// Example bytes:11[0 1 73 0 0 0 0 0 13 0 0] this would be for offset 0
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #24 @A(\n" +
- " target type = 0x49 METHOD_INVOCATION_TYPE_ARGUMENT\n" +
- " offset = 2\n" +
- " type argument index = 0\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #24 @A(\n" +
+ " target type = 0x49 METHOD_INVOCATION_TYPE_ARGUMENT\n" +
+ " offset = 2\n" +
+ " type argument index = 0\n" +
" location = [TYPE_ARGUMENT(0)]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test079_codeblocks_methodInvocationTypeArgument() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X<T> {\n" +
+ "public class X<T> {\n" +
" public static void foo(int i) {}\n"+
- " public void bar() {\n" +
+ " public void bar() {\n" +
" X.<@A T>foo(42);\n"+
- " }\n" +
+ " }\n" +
"}",
-
+
"A.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface A {\n" +
- " String value() default \"default\";\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface A {\n" +
+ " String value() default \"default\";\n" +
"}\n",
},
"");
// Example bytes:11[0 1 73 0 0 0 0 0 13 0 0] this would be for offset 0
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #24 @A(\n" +
- " target type = 0x49 METHOD_INVOCATION_TYPE_ARGUMENT\n" +
- " offset = 2\n" +
- " type argument index = 0\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #24 @A(\n" +
+ " target type = 0x49 METHOD_INVOCATION_TYPE_ARGUMENT\n" +
+ " offset = 2\n" +
+ " type argument index = 0\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
// Annotation should appear twice in this case
public void test080_multiuseAnnotations() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
+ "public class X {\n" +
" @B(1) int foo() { return 0; }\n" +
"}",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target({ElementType.METHOD, ElementType.TYPE_USE})\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface B {\n" +
- " int value() default 99;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target({ElementType.METHOD, ElementType.TYPE_USE})\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface B {\n" +
+ " int value() default 99;\n" +
"}\n",
},
"");
String expectedOutput =
- " RuntimeVisibleAnnotations: \n" +
- " #17 @B(\n" +
- " #18 value=(int) 1 (constant type)\n" +
- " )\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #17 @B(\n" +
- " #18 value=(int) 1 (constant type)\n" +
- " target type = 0x14 METHOD_RETURN\n" +
+ " RuntimeVisibleAnnotations: \n" +
+ " #17 @B(\n" +
+ " #18 value=(int) 1 (constant type)\n" +
+ " )\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #17 @B(\n" +
+ " #18 value=(int) 1 (constant type)\n" +
+ " target type = 0x14 METHOD_RETURN\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test081_multiuseAnnotations() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "import java.lang.annotation.*;\n" +
- "@Target({ElementType.METHOD, ElementType.TYPE_USE})\n" +
- "@interface Annot {\n" +
- " int value() default 0;\n" +
- "}\n" +
- "public class X {\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target({ElementType.METHOD, ElementType.TYPE_USE})\n" +
+ "@interface Annot {\n" +
+ " int value() default 0;\n" +
+ "}\n" +
+ "public class X {\n" +
" @Annot(4) public String foo() { return \"hello\"; }" +
"}",
},
"");
String expectedOutput =
- " RuntimeInvisibleAnnotations: \n" +
- " #17 @Annot(\n" +
- " #18 value=(int) 4 (constant type)\n" +
- " )\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #17 @Annot(\n" +
- " #18 value=(int) 4 (constant type)\n" +
- " target type = 0x14 METHOD_RETURN\n" +
+ " RuntimeInvisibleAnnotations: \n" +
+ " #17 @Annot(\n" +
+ " #18 value=(int) 4 (constant type)\n" +
+ " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #17 @Annot(\n" +
+ " #18 value=(int) 4 (constant type)\n" +
+ " target type = 0x14 METHOD_RETURN\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
// When not annotated with any TYPE it assumes the Java7 set (i.e. not TYPE_USE/TYPE_PARAMETER)
public void test082_multiuseAnnotations() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "@interface Annot {\r\n" +
- " int value() default 0;\r\n" +
- "}\r\n" +
- "public class X {\r\n" +
- " @Annot(4)\r\n" +
- " public void foo() {\r\n" +
- " }\r\n" +
+ "@interface Annot {\r\n" +
+ " int value() default 0;\r\n" +
+ "}\r\n" +
+ "public class X {\r\n" +
+ " @Annot(4)\r\n" +
+ " public void foo() {\r\n" +
+ " }\r\n" +
"}",
},
"");
String expectedOutput =
- " // Method descriptor #6 ()V\n" +
- " // Stack: 0, Locals: 1\n" +
- " public void foo();\n" +
- " 0 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 7]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
- " RuntimeInvisibleAnnotations: \n" +
- " #16 @Annot(\n" +
- " #17 value=(int) 4 (constant type)\n" +
- " )\n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 0, Locals: 1\n" +
+ " public void foo();\n" +
+ " 0 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 7]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
+ " RuntimeInvisibleAnnotations: \n" +
+ " #16 @Annot(\n" +
+ " #17 value=(int) 4 (constant type)\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -4238,66 +4238,66 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "@interface Annot {\n" +
- " int value() default 0;\n" +
- "}\n" +
- "public class X<@Annot(1) T> {\n" +
- " java.lang. @Annot(2)String f;\n" +
- " public void foo(String @Annot(3)[] args) {\n" +
- " }\n" +
+ "@interface Annot {\n" +
+ " int value() default 0;\n" +
+ "}\n" +
+ "public class X<@Annot(1) T> {\n" +
+ " java.lang. @Annot(2)String f;\n" +
+ " public void foo(String @Annot(3)[] args) {\n" +
+ " }\n" +
"}\n",
},
"");
String expectedOutput =
- " // Field descriptor #6 Ljava/lang/String;\n" +
- " java.lang.String f;\n" +
+ " // Field descriptor #6 Ljava/lang/String;\n" +
+ " java.lang.String f;\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #8 @Annot(\n" +
+ " #9 value=(int) 2 (constant type)\n" + // <-2-
+ " target type = 0x13 FIELD\n" +
+ " )\n" +
+ " \n" +
+ " // Method descriptor #12 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [14]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 4]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
+ " Local variable type table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X<T>\n" +
+ " \n" +
+ " // Method descriptor #23 ([Ljava/lang/String;)V\n" +
+ " // Stack: 0, Locals: 2\n" +
+ " public void foo(java.lang.String[] args);\n" +
+ " 0 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 7]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 1] local: args index: 1 type: java.lang.String[]\n" +
+ " Local variable type table:\n" +
+ " [pc: 0, pc: 1] local: this index: 0 type: X<T>\n" +
" RuntimeInvisibleTypeAnnotations: \n" +
- " #8 @Annot(\n" +
- " #9 value=(int) 2 (constant type)\n" + // <-2-
- " target type = 0x13 FIELD\n" +
- " )\n" +
- " \n" +
- " // Method descriptor #12 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [14]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 4]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- " Local variable type table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X<T>\n" +
- " \n" +
- " // Method descriptor #23 ([Ljava/lang/String;)V\n" +
- " // Stack: 0, Locals: 2\n" +
- " public void foo(java.lang.String[] args);\n" +
- " 0 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 7]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
- " [pc: 0, pc: 1] local: args index: 1 type: java.lang.String[]\n" +
- " Local variable type table:\n" +
- " [pc: 0, pc: 1] local: this index: 0 type: X<T>\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #8 @Annot(\n" +
+ " #8 @Annot(\n" +
" #9 value=(int) 3 (constant type)\n" + // <-3-
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " )\n" +
- "\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #8 @Annot(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " )\n" +
+ "\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #8 @Annot(\n" +
" #9 value=(int) 1 (constant type)\n" + // <-1-
- " target type = 0x0 CLASS_TYPE_PARAMETER\n" +
- " type parameter index = 0\n" +
- " )\n" +
+ " target type = 0x0 CLASS_TYPE_PARAMETER\n" +
+ " type parameter index = 0\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test100_pqtr() throws Exception { // PQTR (ParameterizedQualifiedTypeReference)
this.runConformTest(
new String[] {
@@ -4307,17 +4307,17 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"}\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #10 @B(\n" +
- " #11 value=(int) 2 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 2 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -4331,22 +4331,22 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"}\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #10 @B(\n" +
- " #11 value=(int) 2 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 2 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
" location = [ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test100b_pqtr() throws Exception {
this.runConformTest(
new String[] {
@@ -4356,17 +4356,17 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"}\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #10 @B(\n" +
- " #11 value=(int) 3 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 3 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
" location = [ARRAY, TYPE_ARGUMENT(0)]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
@@ -4381,21 +4381,21 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"}\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #10 @B(\n" +
- " #11 value=(int) 3 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 3 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test100d_pqtr() throws Exception {
this.runConformTest(
new String[] {
@@ -4405,36 +4405,36 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"}\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #10 @B(\n" +
- " #11 value=(int) 2 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 2 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
" location = [ARRAY, ARRAY]\n" +
" )\n" +
- " #10 @B(\n" +
- " #11 value=(int) 3 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 3 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
" )\n" +
- " #10 @B(\n" +
- " #11 value=(int) 4 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 4 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
" location = [ARRAY]\n" +
" )\n" +
- " #10 @B(\n" +
- " #11 value=(int) 5 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 5 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
" location = [ARRAY, ARRAY, TYPE_ARGUMENT(0)]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test100e_pqtr() throws Exception {
this.runConformTest(
@@ -4445,31 +4445,31 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"}\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #10 @B(\n" +
- " #11 value=(int) 2 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 2 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test100f_pqtr() throws Exception {
this.runConformTest(
new String[] {
"Foo.java",
"class Foo {}\n",
-
+
"Levels.java",
"package one.two.three;\n" +
"class Level1 { static class Level2 { class Level3 { class Level4 { class Level5<T> { } } } } }\n",
-
+
"X.java",
"package one.two.three;\n" +
"class X {\n" +
@@ -4478,37 +4478,37 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"B.java",
"package one.two.three;\n" +
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #10 @one.two.three.B(\n" +
- " #11 value=(int) 2 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [INNER_TYPE]\n" +
- " )\n" +
- " #10 @one.two.three.B(\n" +
- " #11 value=(int) 3 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [INNER_TYPE, INNER_TYPE, INNER_TYPE]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #10 @one.two.three.B(\n" +
+ " #11 value=(int) 2 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [INNER_TYPE]\n" +
+ " )\n" +
+ " #10 @one.two.three.B(\n" +
+ " #11 value=(int) 3 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [INNER_TYPE, INNER_TYPE, INNER_TYPE]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "one" + File.separator + "two" + File.separator + "three" + File.separator + "X.class", "one.two.three.X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test100g_pqtr() throws Exception {
this.runConformTest(
new String[] {
"Foo.java",
"class Foo {}\n",
-
+
"Levels.java",
"package one.two.three;\n" +
"class Level1 { static class Level2 { class Level3 { class Level4 { class Level5<T> { } } } } }\n",
-
+
"X.java",
"package one.two.three;\n" +
"class X {\n" +
@@ -4517,27 +4517,27 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"B.java",
"package one.two.three;\n" +
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #10 @one.two.three.B(\n" +
- " #11 value=(int) 2 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY, INNER_TYPE]\n" +
- " )\n" +
- " #10 @one.two.three.B(\n" +
- " #11 value=(int) 3 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY, INNER_TYPE, INNER_TYPE, INNER_TYPE]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #10 @one.two.three.B(\n" +
+ " #11 value=(int) 2 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY, INNER_TYPE]\n" +
+ " )\n" +
+ " #10 @one.two.three.B(\n" +
+ " #11 value=(int) 3 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY, INNER_TYPE, INNER_TYPE, INNER_TYPE]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "one" + File.separator + "two" + File.separator + "three" + File.separator + "X.class", "one.two.three.X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test100h_pqtr() throws Exception {
this.runConformTest(
new String[] {
@@ -4550,27 +4550,27 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"class Level1 { static class Level2 { class Level3 { class Level4 { class Level5<T> { } } } } }\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #10 @B(\n" +
- " #11 value=(int) 2 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY, INNER_TYPE]\n" +
- " )\n" +
- " #10 @B(\n" +
- " #11 value=(int) 3 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY, INNER_TYPE, INNER_TYPE, INNER_TYPE]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 2 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY, INNER_TYPE]\n" +
+ " )\n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 3 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY, INNER_TYPE, INNER_TYPE, INNER_TYPE]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test100i_pqtr() throws Exception {
this.runConformTest(
new String[] {
@@ -4583,22 +4583,22 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"class Level1 { static class Level2 { class Level3 { class Level4 { class Level5<T> { } } } } }\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #10 @B(\n" +
- " #11 value=(int) 1 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY, INNER_TYPE, INNER_TYPE, INNER_TYPE, TYPE_ARGUMENT(0)]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 1 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY, INNER_TYPE, INNER_TYPE, INNER_TYPE, TYPE_ARGUMENT(0)]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test100j_pqtr() throws Exception {
this.runConformTest(
new String[] {
@@ -4611,27 +4611,27 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"class Level1 { static class Level2 { class Level3<Q> { class Level4 { class Level5<T> { } } } } }\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #10 @B(\n" +
- " #11 value=(int) 1 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY, INNER_TYPE, TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " #10 @B(\n" +
- " #11 value=(int) 2 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY, INNER_TYPE, INNER_TYPE, INNER_TYPE, TYPE_ARGUMENT(0)]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 1 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY, INNER_TYPE, TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 2 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY, INNER_TYPE, INNER_TYPE, INNER_TYPE, TYPE_ARGUMENT(0)]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test100k_pqtr() throws Exception {
this.runConformTest(
new String[] {
@@ -4644,32 +4644,32 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"class Level1 { static class Level2 { class Level3<Q> { class Level4 { class Level5<T> { } } } } }\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #10 @B(\n" +
- " #11 value=(int) 5 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
- " #10 @B(\n" +
- " #11 value=(int) 1 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY, INNER_TYPE, TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " #10 @B(\n" +
- " #11 value=(int) 2 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY, INNER_TYPE, INNER_TYPE, INNER_TYPE, TYPE_ARGUMENT(0)]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 5 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 1 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY, INNER_TYPE, TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 2 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY, INNER_TYPE, INNER_TYPE, INNER_TYPE, TYPE_ARGUMENT(0)]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test101a_qtr() throws Exception { // QTR (QualifiedTypeReference)
this.runConformTest(
new String[] {
@@ -4677,28 +4677,28 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"class X {\n" +
" com.foo.@B(2) List field2;\n" +
"}\n",
-
+
"List.java",
"package com.foo;\n"+
"public class List {}\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #8 @B(\n" +
- " #9 value=(int) 2 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #8 @B(\n" +
+ " #9 value=(int) 2 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test101b_qtr() throws Exception { // QTR (QualifiedTypeReference)
this.runConformTest(
new String[] {
@@ -4708,32 +4708,32 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"}\n",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #8 @B(\n" +
- " #9 value=(int) 2 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #8 @B(\n" +
+ " #9 value=(int) 2 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test101c_qtr() throws Exception { // QTR (QualifiedTypeReference)
this.runConformTest(
new String[] {
"Runner.java",
"public class Runner {}\n",
-
+
"B.java",
"package one.two.three;\n" +
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
"X.java",
@@ -4748,20 +4748,20 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #8 @one.two.three.B(\n" +
- " #9 value=(int) 2 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [INNER_TYPE]\n" +
- " )\n" +
- " #8 @one.two.three.B(\n" +
- " #9 value=(int) 3 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [INNER_TYPE, INNER_TYPE, INNER_TYPE]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #8 @one.two.three.B(\n" +
+ " #9 value=(int) 2 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [INNER_TYPE]\n" +
+ " )\n" +
+ " #8 @one.two.three.B(\n" +
+ " #9 value=(int) 3 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [INNER_TYPE, INNER_TYPE, INNER_TYPE]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "one" + File.separator + "two" + File.separator + "three" + File.separator + "X.class", "one.two.three.X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test102a_str() throws Exception { // STR (SingleTypeReference)
this.runConformTest(
new String[] {
@@ -4769,23 +4769,23 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"class X {\n" +
" @B(1) X field;\n" +
"}\n",
-
+
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #8 @B(\n" +
- " #9 value=(int) 1 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #8 @B(\n" +
+ " #9 value=(int) 1 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test102b_str() throws Exception { // STR (SingleTypeReference)
this.runConformTest(
new String[] {
@@ -4793,23 +4793,23 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"class X {\n" +
" @B(1) int field;\n" +
"}\n",
-
+
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #8 @B(\n" +
- " #9 value=(int) 1 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #8 @B(\n" +
+ " #9 value=(int) 1 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test103a_atr() throws Exception { // ATR (ArrayTypeReference)
this.runConformTest(
new String[] {
@@ -4817,24 +4817,24 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"class X {\n" +
" @B(1) X[] field;\n" +
"}\n",
-
+
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #8 @B(\n" +
- " #9 value=(int) 1 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #8 @B(\n" +
+ " #9 value=(int) 1 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
" location = [ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test103b_atr() throws Exception { // ATR (ArrayTypeReference)
this.runConformTest(
new String[] {
@@ -4842,23 +4842,23 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"class X {\n" +
" X @B(2)[] field;\n" +
"}\n",
-
+
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #8 @B(\n" +
- " #9 value=(int) 2 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #8 @B(\n" +
+ " #9 value=(int) 2 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test103c_atr() throws Exception { // ATR (ArrayTypeReference)
this.runConformTest(
new String[] {
@@ -4866,24 +4866,24 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"class X {\n" +
" X []@B(3)[] field;\n" +
"}\n",
-
+
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #8 @B(\n" +
- " #9 value=(int) 3 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #8 @B(\n" +
+ " #9 value=(int) 3 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
" location = [ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test103d_atr() throws Exception { // ATR (ArrayTypeReference)
this.runConformTest(
new String[] {
@@ -4891,24 +4891,24 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"class X {\n" +
" X []@B(3)[][] field;\n" +
"}\n",
-
+
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #8 @B(\n" +
- " #9 value=(int) 3 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #8 @B(\n" +
+ " #9 value=(int) 3 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
" location = [ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test103e_atr() throws Exception { // ATR (ArrayTypeReference)
this.runConformTest(
new String[] {
@@ -4916,29 +4916,29 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"class X {\n" +
" @B(1) int []@B(3)[][] field;\n" +
"}\n",
-
+
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #8 @B(\n" +
- " #9 value=(int) 1 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #8 @B(\n" +
+ " #9 value=(int) 1 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
" location = [ARRAY, ARRAY, ARRAY]\n" +
" )\n" +
- " #8 @B(\n" +
- " #9 value=(int) 3 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
+ " #8 @B(\n" +
+ " #9 value=(int) 3 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
" location = [ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test104a_pstr() throws Exception { // PSTR (ParameterizedSingleTypeReference)
this.runConformTest(
new String[] {
@@ -4946,38 +4946,38 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"class X<T1,T2,T3> {\n" +
" @B(1) X<@B(2) String, @B(3) Integer, @B(4) Boolean> field;\n" +
"}\n",
-
+
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #10 @B(\n" +
- " #11 value=(int) 1 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " )\n" +
- " #10 @B(\n" +
- " #11 value=(int) 2 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " #10 @B(\n" +
- " #11 value=(int) 3 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(1)]\n" +
- " )\n" +
- " #10 @B(\n" +
- " #11 value=(int) 4 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(2)]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 1 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " )\n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 2 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 3 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(1)]\n" +
+ " )\n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 4 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(2)]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test104b_pstr() throws Exception { // PSTR (ParameterizedSingleTypeReference)
this.runConformTest(
new String[] {
@@ -4985,141 +4985,141 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"class X<T1> {\n" +
" @B(1) X<@B(2) String> @B(3)[] field;\n" +
"}\n",
-
+
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #10 @B(\n" +
- " #11 value=(int) 1 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " #10 @B(\n" +
- " #11 value=(int) 3 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " )\n" +
- " #10 @B(\n" +
- " #11 value=(int) 2 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, TYPE_ARGUMENT(0)]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 1 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 3 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " )\n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 2 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, TYPE_ARGUMENT(0)]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test105a_aqtr() throws Exception { // AQTR (ArrayQualifiedTypeReference)
this.runConformTest(
new String[] {
"Y.java",
"class Y {}",
-
+
"X.java",
"package one.two.three;\n" +
"class X<T1> {\n" +
" one.two.three.@B(1) List[] field;\n" +
"}\n",
-
+
"List.java",
"package one.two.three;\n" +
"class List {}\n",
-
+
"B.java",
"package one.two.three;\n" +
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #8 @one.two.three.B(\n" +
- " #9 value=(int) 1 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #8 @one.two.three.B(\n" +
+ " #9 value=(int) 1 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY]\n" +
" )\n";
- checkDisassembledClassFile(OUTPUT_DIR + File.separator + "one" + File.separator + "two" + File.separator + "three" + File.separator +"X.class",
+ checkDisassembledClassFile(OUTPUT_DIR + File.separator + "one" + File.separator + "two" + File.separator + "three" + File.separator +"X.class",
"one.two.three.X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test105b_aqtr() throws Exception { // AQTR (ArrayQualifiedTypeReference)
this.runConformTest(
new String[] {
"Y.java",
"class Y {}",
-
+
"X.java",
"package one.two.three;\n" +
"class X<T1> {\n" +
" one.two.three.@B(2) List @B(3)[]@B(4)[] field;\n" +
"}\n",
-
+
"List.java",
"package one.two.three;\n" +
"class List {}\n",
-
+
"B.java",
"package one.two.three;\n" +
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #8 @one.two.three.B(\n" +
- " #9 value=(int) 2 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #8 @one.two.three.B(\n" +
+ " #9 value=(int) 2 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY]\n" +
" )\n" +
- " #8 @one.two.three.B(\n" +
- " #9 value=(int) 3 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
+ " #8 @one.two.three.B(\n" +
+ " #9 value=(int) 3 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
" )\n" +
- " #8 @one.two.three.B(\n" +
- " #9 value=(int) 4 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY]\n" +
+ " #8 @one.two.three.B(\n" +
+ " #9 value=(int) 4 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY]\n" +
" )\n";
- checkDisassembledClassFile(OUTPUT_DIR + File.separator + "one" + File.separator + "two" + File.separator + "three" + File.separator +"X.class",
+ checkDisassembledClassFile(OUTPUT_DIR + File.separator + "one" + File.separator + "two" + File.separator + "three" + File.separator +"X.class",
"one.two.three.X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test106a_wtr() throws Exception { // WTR (WildcardTypeReference)
this.runConformTest(
- new String[] {
+ new String[] {
"X.java",
"import java.util.List;\n" +
"class X<T1> {\n" +
" List<? extends @B(1) Number> field;\n" +
"}\n",
-
+
"List.java",
"class List {}\n",
-
+
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #10 @B(\n" +
- " #11 value=(int) 1 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(0), WILDCARD]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 1 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(0), WILDCARD]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator +"X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test106b_wtr() throws Exception { // WTR (WildcardTypeReference)
this.runConformTest(
new String[] {
@@ -5128,23 +5128,23 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"class X<T1> {\n" +
" List<? extends @B(1) Number[]> field;\n" +
"}\n",
-
+
"List.java",
"class List {}\n",
-
+
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface B { int value() default -1; }\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #10 @B(\n" +
- " #11 value=(int) 1 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [TYPE_ARGUMENT(0), WILDCARD, ARRAY]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #10 @B(\n" +
+ " #11 value=(int) 1 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [TYPE_ARGUMENT(0), WILDCARD, ARRAY]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -5156,37 +5156,37 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"class X {\n" +
" String s = (@NonNull String) \"Hello\";\n" +
"}\n",
-
+
"NonNull.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface NonNull {}\n",
},
"");
String expectedOutput =
- " // Method descriptor #8 ()V\n" +
- " // Stack: 2, Locals: 1\n" +
- " X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [10]\n" +
- " 4 aload_0 [this]\n" +
- " 5 ldc <String \"Hello\"> [12]\n" +
- " 7 checkcast java.lang.String [14]\n" +
- " 10 putfield X.s : java.lang.String [16]\n" +
- " 13 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
- " [pc: 4, line: 2]\n" +
- " [pc: 13, line: 1]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #23 @NonNull(\n" +
- " target type = 0x47 CAST\n" +
- " offset = 7\n" +
- " type argument index = 0\n" +
- " )\n" +
+ " // Method descriptor #8 ()V\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [10]\n" +
+ " 4 aload_0 [this]\n" +
+ " 5 ldc <String \"Hello\"> [12]\n" +
+ " 7 checkcast java.lang.String [14]\n" +
+ " 10 putfield X.s : java.lang.String [16]\n" +
+ " 13 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
+ " [pc: 4, line: 2]\n" +
+ " [pc: 13, line: 1]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #23 @NonNull(\n" +
+ " target type = 0x47 CAST\n" +
+ " offset = 7\n" +
+ " type argument index = 0\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -5198,46 +5198,46 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"class X {\n" +
" String s = (String) \"Hello\";\n" +
"}\n",
-
+
"NonNull.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface NonNull {}\n",
},
"");
String expectedOutput =
- " // Method descriptor #8 ()V\n" +
- " // Stack: 2, Locals: 1\n" +
- " X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [10]\n" +
- " 4 aload_0 [this]\n" +
- " 5 ldc <String \"Hello\"> [12]\n" +
- " 7 putfield X.s : java.lang.String [14]\n" +
- " 10 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
- " [pc: 4, line: 2]\n" +
- " [pc: 10, line: 1]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 11] local: this index: 0 type: X\n" +
+ " // Method descriptor #8 ()V\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [10]\n" +
+ " 4 aload_0 [this]\n" +
+ " 5 ldc <String \"Hello\"> [12]\n" +
+ " 7 putfield X.s : java.lang.String [14]\n" +
+ " 10 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
+ " [pc: 4, line: 2]\n" +
+ " [pc: 10, line: 1]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 11] local: this index: 0 type: X\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test055a_codeblocks_exceptionParameterNestedType() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
" foo();\n" +
- " } catch(@B(1) Outer.@B(2) MyException e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ " } catch(@B(1) Outer.@B(2) MyException e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
" static void foo() throws Outer.MyException {}\n" +
"}\n" +
"class Outer {\n" +
@@ -5245,29 +5245,29 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
" private static final long serialVersionUID = 1L;\n" +
" }\n" +
"}",
-
+
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface B {\n" +
- " int value() default 0;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface B {\n" +
+ " int value() default 0;\n" +
"}\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #30 @B(\n" +
- " #31 value=(int) 1 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 0\n" +
- " )\n" +
- " #30 @B(\n" +
- " #31 value=(int) 2 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 0\n" +
- " location = [INNER_TYPE]\n" +
- " )\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #30 @B(\n" +
+ " #31 value=(int) 1 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 0\n" +
+ " )\n" +
+ " #30 @B(\n" +
+ " #31 value=(int) 2 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 0\n" +
+ " location = [INNER_TYPE]\n" +
+ " )\n" +
" \n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -5276,14 +5276,14 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
" foo();\n" +
- " } catch(@B(1) Outer.@B(2) MyException | @B(3) Outer2.@B(4) MyException2 e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ " } catch(@B(1) Outer.@B(2) MyException | @B(3) Outer2.@B(4) MyException2 e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
" static void foo() throws Outer.MyException, Outer2.MyException2 {}\n" +
"}\n" +
"class Outer {\n" +
@@ -5297,318 +5297,318 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
" }\n" +
"}",
"B.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
- "@interface B {\n" +
- " int value() default 0;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "@interface B {\n" +
+ " int value() default 0;\n" +
"}\n",
},
"");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #34 @B(\n" +
- " #35 value=(int) 1 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 0\n" +
- " )\n" +
- " #34 @B(\n" +
- " #35 value=(int) 2 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 0\n" +
- " location = [INNER_TYPE]\n" +
- " )\n" +
- " #34 @B(\n" +
- " #35 value=(int) 3 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 1\n" +
- " )\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
" #34 @B(\n" +
- " #35 value=(int) 4 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 1\n" +
- " location = [INNER_TYPE]\n" +
+ " #35 value=(int) 1 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 0\n" +
+ " )\n" +
+ " #34 @B(\n" +
+ " #35 value=(int) 2 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 0\n" +
+ " location = [INNER_TYPE]\n" +
+ " )\n" +
+ " #34 @B(\n" +
+ " #35 value=(int) 3 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 1\n" +
+ " )\n" +
+ " #34 @B(\n" +
+ " #35 value=(int) 4 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 1\n" +
+ " location = [INNER_TYPE]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test055c_codeblocks_exceptionParameterMultiCatch() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "import java.lang.annotation.Target;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "class Exc1 extends RuntimeException {" +
+ "import java.lang.annotation.Target;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "class Exc1 extends RuntimeException {" +
" private static final long serialVersionUID = 1L;\n" +
"}\n"+
- "class Exc2 extends RuntimeException {" +
+ "class Exc2 extends RuntimeException {" +
" private static final long serialVersionUID = 1L;\n" +
"}\n"+
- "class Exc3 extends RuntimeException {" +
+ "class Exc3 extends RuntimeException {" +
" private static final long serialVersionUID = 1L;\n" +
"}\n"+
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
" System.out.println(42);\n" +
- " } catch(Exc1 | @B(1) Exc2 | @B(2) Exc3 t) {\n" +
- " t.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ " } catch(Exc1 | @B(1) Exc2 | @B(2) Exc3 t) {\n" +
+ " t.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface B {\n" +
- " int value() default 99;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface B {\n" +
+ " int value() default 99;\n" +
"}\n",
},
"42");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #45 @B(\n" +
- " #46 value=(int) 1 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 1\n" +
- " )\n" +
- " #45 @B(\n" +
- " #46 value=(int) 2 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 2\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #45 @B(\n" +
+ " #46 value=(int) 1 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 1\n" +
+ " )\n" +
+ " #45 @B(\n" +
+ " #46 value=(int) 2 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 2\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test055d_codeblocks_exceptionParameterMultiCatch() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "import java.lang.annotation.Target;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "class Exc1 extends RuntimeException {" +
+ "import java.lang.annotation.Target;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "class Exc1 extends RuntimeException {" +
" private static final long serialVersionUID = 1L;\n" +
"}\n"+
- "class Exc2 extends RuntimeException {" +
+ "class Exc2 extends RuntimeException {" +
" private static final long serialVersionUID = 1L;\n" +
"}\n"+
- "class Exc3 extends RuntimeException {" +
+ "class Exc3 extends RuntimeException {" +
" private static final long serialVersionUID = 1L;\n" +
"}\n"+
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
" System.out.println(42);\n" +
- " } catch(@A(1) @B(2) Exc1 | Exc2 | @A(3) @B(4) Exc3 t) {\n" +
- " t.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ " } catch(@A(1) @B(2) Exc1 | Exc2 | @A(3) @B(4) Exc3 t) {\n" +
+ " t.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}",
-
+
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " int value() default 99;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " int value() default 99;\n" +
"}\n",
-
+
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface B {\n" +
- " int value() default 99;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface B {\n" +
+ " int value() default 99;\n" +
"}\n",
},
"42");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #45 @A(\n" +
- " #46 value=(int) 1 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 0\n" +
- " )\n" +
- " #48 @B(\n" +
- " #46 value=(int) 2 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 0\n" +
- " )\n" +
- " #45 @A(\n" +
- " #46 value=(int) 3 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 2\n" +
- " )\n" +
- " #48 @B(\n" +
- " #46 value=(int) 4 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 2\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #45 @A(\n" +
+ " #46 value=(int) 1 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 0\n" +
+ " )\n" +
+ " #48 @B(\n" +
+ " #46 value=(int) 2 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 0\n" +
+ " )\n" +
+ " #45 @A(\n" +
+ " #46 value=(int) 3 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 2\n" +
+ " )\n" +
+ " #48 @B(\n" +
+ " #46 value=(int) 4 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 2\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test055e_codeblocks_exceptionParameterMultiCatch() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "import java.lang.annotation.Target;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "class Exc1 extends RuntimeException {" +
+ "import java.lang.annotation.Target;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "class Exc1 extends RuntimeException {" +
" private static final long serialVersionUID = 1L;\n" +
"}\n"+
- "class Exc2 extends RuntimeException {" +
+ "class Exc2 extends RuntimeException {" +
" private static final long serialVersionUID = 1L;\n" +
"}\n"+
- "class Exc3 extends RuntimeException {" +
+ "class Exc3 extends RuntimeException {" +
" private static final long serialVersionUID = 1L;\n" +
"}\n"+
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
" System.out.println(42);\n" +
- " } catch(@A(1) @B(2) Exc1 | Exc2 | @A(3) @B(4) Exc3 t) {\n" +
- " t.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ " } catch(@A(1) @B(2) Exc1 | Exc2 | @A(3) @B(4) Exc3 t) {\n" +
+ " t.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}",
-
+
"A.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface A {\n" +
- " int value() default 99;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface A {\n" +
+ " int value() default 99;\n" +
"}\n",
-
+
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface B {\n" +
- " int value() default 99;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface B {\n" +
+ " int value() default 99;\n" +
"}\n",
},
"42");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #45 @A(\n" +
- " #46 value=(int) 1 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 0\n" +
- " )\n" +
- " #48 @B(\n" +
- " #46 value=(int) 2 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 0\n" +
- " )\n" +
- " #45 @A(\n" +
- " #46 value=(int) 3 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 2\n" +
- " )\n" +
- " #48 @B(\n" +
- " #46 value=(int) 4 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 2\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #45 @A(\n" +
+ " #46 value=(int) 1 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 0\n" +
+ " )\n" +
+ " #48 @B(\n" +
+ " #46 value=(int) 2 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 0\n" +
+ " )\n" +
+ " #45 @A(\n" +
+ " #46 value=(int) 3 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 2\n" +
+ " )\n" +
+ " #48 @B(\n" +
+ " #46 value=(int) 4 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 2\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void test055f_codeblocks_exceptionParameterComplex() throws Exception {
this.runConformTest(
new String[] {
"X.java",
- "import java.lang.annotation.Target;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "class Exc1 extends RuntimeException {" +
+ "import java.lang.annotation.Target;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "class Exc1 extends RuntimeException {" +
" private static final long serialVersionUID = 1L;\n" +
"}\n"+
- "class Exc2 extends RuntimeException {" +
+ "class Exc2 extends RuntimeException {" +
" private static final long serialVersionUID = 1L;\n" +
"}\n"+
- "class Exc3 extends RuntimeException {" +
+ "class Exc3 extends RuntimeException {" +
" private static final long serialVersionUID = 1L;\n" +
"}\n"+
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
" System.out.println(42);\n" +
- " } catch(@B(1) Exc1 | Exc2 | @B(2) Exc3 t) {\n" +
- " t.printStackTrace();\n" +
- " }\n" +
- " try {\n" +
+ " } catch(@B(1) Exc1 | Exc2 | @B(2) Exc3 t) {\n" +
+ " t.printStackTrace();\n" +
+ " }\n" +
+ " try {\n" +
" System.out.println(43);\n" +
- " } catch(@B(1) Exc1 t) {\n" +
- " t.printStackTrace();\n" +
- " }\n" +
- " try {\n" +
+ " } catch(@B(1) Exc1 t) {\n" +
+ " t.printStackTrace();\n" +
+ " }\n" +
+ " try {\n" +
" System.out.println(44);\n" +
- " } catch(@B(1) Exc1 | @B(2) Exc2 t) {\n" +
- " t.printStackTrace();\n" +
- " }\n" +
- " }\n" +
+ " } catch(@B(1) Exc1 | @B(2) Exc2 t) {\n" +
+ " t.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
"}",
"B.java",
- "import java.lang.annotation.Target;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
- "@interface B {\n" +
- " int value() default 99;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.Retention;\n" +
+ "import static java.lang.annotation.RetentionPolicy.*;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@interface B {\n" +
+ " int value() default 99;\n" +
"}\n",
},
"42\n43\n44");
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
- " #47 @B(\n" +
- " #48 value=(int) 1 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 0\n" +
- " )\n" +
- " #47 @B(\n" +
- " #48 value=(int) 2 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 2\n" +
- " )\n" +
- " #47 @B(\n" +
- " #48 value=(int) 1 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 3\n" +
- " )\n" +
- " #47 @B(\n" +
- " #48 value=(int) 1 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 4\n" +
- " )\n" +
- " #47 @B(\n" +
- " #48 value=(int) 2 (constant type)\n" +
- " target type = 0x42 EXCEPTION_PARAMETER\n" +
- " exception table index = 5\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #47 @B(\n" +
+ " #48 value=(int) 1 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 0\n" +
+ " )\n" +
+ " #47 @B(\n" +
+ " #48 value=(int) 2 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 2\n" +
+ " )\n" +
+ " #47 @B(\n" +
+ " #48 value=(int) 1 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 3\n" +
+ " )\n" +
+ " #47 @B(\n" +
+ " #48 value=(int) 1 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 4\n" +
+ " )\n" +
+ " #47 @B(\n" +
+ " #48 value=(int) 2 (constant type)\n" +
+ " target type = 0x42 EXCEPTION_PARAMETER\n" +
+ " exception table index = 5\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -5617,48 +5617,48 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
runNegativeTest(
new String[] {
"X.java",
- "import java.lang.annotation.ElementType;\n" +
- "import java.lang.annotation.Target;\n" +
- "\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@interface Marker {\n" +
- "}\n" +
- "\n" +
- "public class X {\n" +
- " @Marker\n" +
- " foo(String s) {\n" +
- "\n" +
- " }\n" +
+ "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@interface Marker {\n" +
+ "}\n" +
+ "\n" +
+ "public class X {\n" +
+ " @Marker\n" +
+ " foo(String s) {\n" +
+ "\n" +
+ " }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " foo(String s) {\n" +
- " ^^^^^^^^^^^^^\n" +
- "Return type for the method is missing\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " foo(String s) {\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Return type for the method is missing\n" +
"----------\n");
}
-
+
public void testBug426616() throws Exception {
this.runConformTest(
new String[] {
"X.java",
"import java.util.*;\n"+
- "import java.lang.annotation.*;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.*;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
"import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Retention(RUNTIME)\n" +
- "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@Target(TYPE_USE)\n" +
"@interface SizeHolder { Size[] value();}\n"+
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
"@Repeatable(SizeHolder.class)\n"+
"@interface Size { int max(); }\n"+
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
"@interface Nonnull {}\n"+
"\n"+
- "public class X {\n" +
+ "public class X {\n" +
" public static void main(String[]argv) {}\n"+
" public static String testArrays() {\n"+
" List<@Size(max = 41) CharSequence>[] @Size(max = 42) [] @Nonnull @Size(max = 43) [][] test = new @Size(max = 44) ArrayList @Size(max = 45) [10][][] @Size(max = 47) @Size(max = 48) [];\n"+
@@ -5671,186 +5671,186 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
// 0: Size(45): NEW, offset=0
// 1: SizeHolder([@Size(max=47),@Size(max=48)]): NEW, offset=0, location=[ARRAY, ARRAY, ARRAY]
// 2: Size(44): NEW, offset=0, location=[ARRAY, ARRAY, ARRAY, ARRAY]
- // 3: Size(49): CAST, offset=6, type_index=0
+ // 3: Size(49): CAST, offset=6, type_index=0
// 4: Size(42): LOCAL_VARIABLE, {start_pc=6, length=19, index=0}, location=[ARRAY]
// 5: NonNull: LOCAL_VARIABLE, {start_pc=6, length=19, index=0}, location=[ARRAY, ARRAY]
// 6: Size(43): LOCAL_VARIABLE, {start_pc=6, length=19, index=0}, location=[ARRAY, ARRAY]
// 7: Size(41): LOCAL_VARIABLE, {start_pc=6, length=19, index=0}, location=[ARRAY, ARRAY, ARRAY, ARRAY, TYPE_ARGUMENT(0)]
String expectedOutput =
- " RuntimeVisibleTypeAnnotations: \n" +
-
+ " RuntimeVisibleTypeAnnotations: \n" +
+
// X Maps to javac entry (2): location OK, target type OK, offset different, our offset is 2 and not 0
- " #33 @Size(\n" +
- " #34 max=(int) 44 (constant type)\n" +
- " target type = 0x44 NEW\n" +
- " offset = 2\n" +
- " location = [ARRAY, ARRAY, ARRAY, ARRAY]\n" +
- " )\n" +
-
+ " #33 @Size(\n" +
+ " #34 max=(int) 44 (constant type)\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 2\n" +
+ " location = [ARRAY, ARRAY, ARRAY, ARRAY]\n" +
+ " )\n" +
+
// X Maps to javac entry (0), location OK, target type OK, offset different, our offset is 2 and not 0
- " #33 @Size(\n" +
- " #34 max=(int) 45 (constant type)\n" +
- " target type = 0x44 NEW\n" +
- " offset = 2\n" +
- " )\n" +
-
+ " #33 @Size(\n" +
+ " #34 max=(int) 45 (constant type)\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 2\n" +
+ " )\n" +
+
// X Maps to javac entry (1), location OK, target type OK, offset different, our offset is 2 and not 0
- " #37 @SizeHolder(\n" +
- " #38 value=[\n" +
- " annotation value =\n" +
- " #33 @Size(\n" +
- " #34 max=(int) 47 (constant type)\n" +
- " )\n" +
- " annotation value =\n" +
- " #33 @Size(\n" +
- " #34 max=(int) 48 (constant type)\n" +
- " )\n" +
- " ]\n" +
- " target type = 0x44 NEW\n" +
- " offset = 2\n" +
- " location = [ARRAY, ARRAY, ARRAY]\n" +
- " )\n" +
-
+ " #37 @SizeHolder(\n" +
+ " #38 value=[\n" +
+ " annotation value =\n" +
+ " #33 @Size(\n" +
+ " #34 max=(int) 47 (constant type)\n" +
+ " )\n" +
+ " annotation value =\n" +
+ " #33 @Size(\n" +
+ " #34 max=(int) 48 (constant type)\n" +
+ " )\n" +
+ " ]\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 2\n" +
+ " location = [ARRAY, ARRAY, ARRAY]\n" +
+ " )\n" +
+
// X Maps to javac entry (3), location OK, target type OK, offset different, our offset is 24 (not 6), type index OK
- " #33 @Size(\n" +
- " #34 max=(int) 49 (constant type)\n" +
- " target type = 0x47 CAST\n" +
- " offset = 24\n" +
- " type argument index = 0\n" +
- " )\n" +
-
+ " #33 @Size(\n" +
+ " #34 max=(int) 49 (constant type)\n" +
+ " target type = 0x47 CAST\n" +
+ " offset = 24\n" +
+ " type argument index = 0\n" +
+ " )\n" +
+
// Maps to javac entry (4), location OK, target type OK, lvar diff, slight position difference (we seem to have an extra CHECKCAST)
- " #33 @Size(\n" +
- " #34 max=(int) 42 (constant type)\n" +
- " target type = 0x40 LOCAL_VARIABLE\n" +
- " local variable entries:\n" +
- " [pc: 6, pc: 28] index: 0\n" +
- " location = [ARRAY]\n" +
- " )\n" +
-
+ " #33 @Size(\n" +
+ " #34 max=(int) 42 (constant type)\n" +
+ " target type = 0x40 LOCAL_VARIABLE\n" +
+ " local variable entries:\n" +
+ " [pc: 6, pc: 28] index: 0\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+
// Maps to javac entry (5), location OK, taret type OK, lvar diff, slight position difference (we seem to have an extra CHECKCAST)
- " #43 @Nonnull(\n" +
- " target type = 0x40 LOCAL_VARIABLE\n" +
- " local variable entries:\n" +
- " [pc: 6, pc: 28] index: 0\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
-
+ " #43 @Nonnull(\n" +
+ " target type = 0x40 LOCAL_VARIABLE\n" +
+ " local variable entries:\n" +
+ " [pc: 6, pc: 28] index: 0\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
+
// Maps to javac entry (6), location OK, target type OK, slight position difference (we seem to have an extra CHECKCAST)
- " #33 @Size(\n" +
- " #34 max=(int) 43 (constant type)\n" +
- " target type = 0x40 LOCAL_VARIABLE\n" +
- " local variable entries:\n" +
- " [pc: 6, pc: 28] index: 0\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
-
+ " #33 @Size(\n" +
+ " #34 max=(int) 43 (constant type)\n" +
+ " target type = 0x40 LOCAL_VARIABLE\n" +
+ " local variable entries:\n" +
+ " [pc: 6, pc: 28] index: 0\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
+
// Maps to javac entry (7), location OK, target type OK, slight position difference (we seem to have an extra CHECKCAST)
- " #33 @Size(\n" +
- " #34 max=(int) 41 (constant type)\n" +
- " target type = 0x40 LOCAL_VARIABLE\n" +
- " local variable entries:\n" +
- " [pc: 6, pc: 28] index: 0\n" +
- " location = [ARRAY, ARRAY, ARRAY, ARRAY, TYPE_ARGUMENT(0)]\n" +
+ " #33 @Size(\n" +
+ " #34 max=(int) 41 (constant type)\n" +
+ " target type = 0x40 LOCAL_VARIABLE\n" +
+ " local variable entries:\n" +
+ " [pc: 6, pc: 28] index: 0\n" +
+ " location = [ARRAY, ARRAY, ARRAY, ARRAY, TYPE_ARGUMENT(0)]\n" +
" )\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
-
+
public void testBug426616a() throws Exception {
this.runConformTest(
new String[] {
"X.java",
"import java.util.*;\n"+
- "import java.lang.annotation.*;\n" +
- "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.*;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
"import static java.lang.annotation.RetentionPolicy.*;\n" +
- "@Retention(RUNTIME)\n" +
- "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
+ "@Target(TYPE_USE)\n" +
"@interface SizeHolder { Size[] value();}\n"+
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
"@Repeatable(SizeHolder.class)\n"+
"@interface Size { int max(); }\n"+
- "@Target(TYPE_USE)\n" +
- "@Retention(RUNTIME)\n" +
+ "@Target(TYPE_USE)\n" +
+ "@Retention(RUNTIME)\n" +
"@interface Nonnull {}\n"+
"\n"+
- "public class X {\n" +
+ "public class X {\n" +
" List<@Size(max = 41) CharSequence>[] @Size(max = 42) [] @Nonnull @Size(max = 43) [][] test = new @Size(max = 44) ArrayList @Size(max = 45) [10][][] @Size(max = 47) @Size(max = 48) [];\n" +
" public static void main(String[]argv) {}\n"+
"}",
},
"");
-
+
String expectedOutput =
- " // Field descriptor #6 [[[[Ljava/util/List;\n" +
- " // Signature: [[[[Ljava/util/List<Ljava/lang/CharSequence;>;\n" +
- " java.util.List[][][][] test;\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #10 @Size(\n" +
- " #11 max=(int) 42 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " #13 @Nonnull(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
- " #10 @Size(\n" +
- " #11 max=(int) 43 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
- " #10 @Size(\n" +
- " #11 max=(int) 41 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY, ARRAY, ARRAY, TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " \n" +
- " // Method descriptor #17 ()V\n" +
- " // Stack: 2, Locals: 1\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [19]\n" +
- " 4 aload_0 [this]\n" +
- " 5 bipush 10\n" +
- " 7 anewarray java.util.ArrayList[][][] [21]\n" +
- " 10 putfield X.test : java.util.List[][][][] [23]\n" +
- " 13 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 16]\n" +
- " [pc: 4, line: 17]\n" +
- " [pc: 13, line: 16]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #10 @Size(\n" +
- " #11 max=(int) 44 (constant type)\n" +
- " target type = 0x44 NEW\n" +
- " offset = 7\n" +
- " location = [ARRAY, ARRAY, ARRAY, ARRAY]\n" +
- " )\n" +
- " #10 @Size(\n" +
- " #11 max=(int) 45 (constant type)\n" +
- " target type = 0x44 NEW\n" +
- " offset = 7\n" +
- " )\n" +
- " #31 @SizeHolder(\n" +
- " #32 value=[\n" +
- " annotation value =\n" +
- " #10 @Size(\n" +
- " #11 max=(int) 47 (constant type)\n" +
- " )\n" +
- " annotation value =\n" +
- " #10 @Size(\n" +
- " #11 max=(int) 48 (constant type)\n" +
- " )\n" +
- " ]\n" +
- " target type = 0x44 NEW\n" +
- " offset = 7\n" +
- " location = [ARRAY, ARRAY, ARRAY]\n" +
- " )\n" +
+ " // Field descriptor #6 [[[[Ljava/util/List;\n" +
+ " // Signature: [[[[Ljava/util/List<Ljava/lang/CharSequence;>;\n" +
+ " java.util.List[][][][] test;\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #10 @Size(\n" +
+ " #11 max=(int) 42 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " #13 @Nonnull(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #10 @Size(\n" +
+ " #11 max=(int) 43 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #10 @Size(\n" +
+ " #11 max=(int) 41 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY, ARRAY, ARRAY, TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " \n" +
+ " // Method descriptor #17 ()V\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [19]\n" +
+ " 4 aload_0 [this]\n" +
+ " 5 bipush 10\n" +
+ " 7 anewarray java.util.ArrayList[][][] [21]\n" +
+ " 10 putfield X.test : java.util.List[][][][] [23]\n" +
+ " 13 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 16]\n" +
+ " [pc: 4, line: 17]\n" +
+ " [pc: 13, line: 16]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #10 @Size(\n" +
+ " #11 max=(int) 44 (constant type)\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 7\n" +
+ " location = [ARRAY, ARRAY, ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #10 @Size(\n" +
+ " #11 max=(int) 45 (constant type)\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 7\n" +
+ " )\n" +
+ " #31 @SizeHolder(\n" +
+ " #32 value=[\n" +
+ " annotation value =\n" +
+ " #10 @Size(\n" +
+ " #11 max=(int) 47 (constant type)\n" +
+ " )\n" +
+ " annotation value =\n" +
+ " #10 @Size(\n" +
+ " #11 max=(int) 48 (constant type)\n" +
+ " )\n" +
+ " ]\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 7\n" +
+ " location = [ARRAY, ARRAY, ARRAY]\n" +
+ " )\n" +
" \n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -5862,14 +5862,14 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"public class X<@Missing T> {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<@Missing T> {\n" +
- " ^^^^^^^\n" +
- "Missing cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public class X<@Missing T> {\n" +
+ " ^^^^^^^\n" +
+ "Missing cannot be resolved to a type\n" +
"----------\n");
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=417660, [1.8][compiler] Incorrect parsing of Annotations with array dimensions in arguments
public void test417660() {
this.runConformTest(
@@ -5897,7 +5897,7 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
},
"1234");
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=417660, [1.8][compiler] Incorrect parsing of Annotations with array dimensions in arguments
public void test417660b() {
this.runConformTest(
@@ -5925,7 +5925,7 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
},
"1234");
}
-
+
public void testAnnotatedExtendedDimensions() throws Exception {
this.runConformTest(
new String[] {
@@ -5938,112 +5938,112 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
" return p;\n" +
" }\n" +
"}\n",
-
+
"NonNull.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface NonNull {}\n",
-
+
"Nullable.java",
- "import java.lang.annotation.*;\n" +
- "@Target(ElementType.TYPE_USE)\n" +
- "@Retention(RetentionPolicy.RUNTIME)\n" +
+ "import java.lang.annotation.*;\n" +
+ "@Target(ElementType.TYPE_USE)\n" +
+ "@Retention(RetentionPolicy.RUNTIME)\n" +
"@interface Nullable {}\n",
},
"");
String expectedOutput =
- " // Field descriptor #6 [[Ljava/lang/String;\n" +
- " java.lang.String[][] f;\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #8 @NonNull(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
- " #9 @Nullable(\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " #8 @NonNull(\n" +
- " target type = 0x13 FIELD\n" +
- " )\n" +
- " \n" +
- " // Method descriptor #11 ()V\n" +
- " // Stack: 2, Locals: 1\n" +
- " public X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [13]\n" +
- " 4 aload_0 [this]\n" +
- " 5 aconst_null\n" +
- " 6 putfield X.f : java.lang.String[][] [15]\n" +
- " 9 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 1]\n" +
- " [pc: 4, line: 2]\n" +
- " [pc: 9, line: 1]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 10] local: this index: 0 type: X\n" +
- " \n" +
- " // Method descriptor #22 ([[Ljava/lang/String;)[[Ljava/lang/String;\n" +
- " // Stack: 1, Locals: 2\n" +
- " static java.lang.String[][] foo(java.lang.String[][] p);\n" +
- " 0 aconst_null\n" +
- " 1 astore_0 [p]\n" +
- " 2 aconst_null\n" +
- " 3 astore_1 [l]\n" +
- " 4 aload_0 [p]\n" +
- " 5 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 4]\n" +
- " [pc: 2, line: 5]\n" +
- " [pc: 4, line: 6]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 6] local: p index: 0 type: java.lang.String[][]\n" +
- " [pc: 4, pc: 6] local: l index: 1 type: java.lang.String[][]\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #8 @NonNull(\n" +
- " target type = 0x40 LOCAL_VARIABLE\n" +
- " local variable entries:\n" +
- " [pc: 4, pc: 6] index: 1\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
- " #9 @Nullable(\n" +
- " target type = 0x40 LOCAL_VARIABLE\n" +
- " local variable entries:\n" +
- " [pc: 4, pc: 6] index: 1\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " #8 @NonNull(\n" +
- " target type = 0x40 LOCAL_VARIABLE\n" +
- " local variable entries:\n" +
- " [pc: 4, pc: 6] index: 1\n" +
- " )\n" +
- " RuntimeVisibleTypeAnnotations: \n" +
- " #8 @NonNull(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
- " #9 @Nullable(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " #8 @NonNull(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " )\n" +
- " #8 @NonNull(\n" +
- " target type = 0x14 METHOD_RETURN\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
- " #9 @Nullable(\n" +
- " target type = 0x14 METHOD_RETURN\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " #8 @NonNull(\n" +
- " target type = 0x14 METHOD_RETURN\n" +
- " )\n" +
+ " // Field descriptor #6 [[Ljava/lang/String;\n" +
+ " java.lang.String[][] f;\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #8 @NonNull(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #9 @Nullable(\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " #8 @NonNull(\n" +
+ " target type = 0x13 FIELD\n" +
+ " )\n" +
+ " \n" +
+ " // Method descriptor #11 ()V\n" +
+ " // Stack: 2, Locals: 1\n" +
+ " public X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [13]\n" +
+ " 4 aload_0 [this]\n" +
+ " 5 aconst_null\n" +
+ " 6 putfield X.f : java.lang.String[][] [15]\n" +
+ " 9 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 1]\n" +
+ " [pc: 4, line: 2]\n" +
+ " [pc: 9, line: 1]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 10] local: this index: 0 type: X\n" +
+ " \n" +
+ " // Method descriptor #22 ([[Ljava/lang/String;)[[Ljava/lang/String;\n" +
+ " // Stack: 1, Locals: 2\n" +
+ " static java.lang.String[][] foo(java.lang.String[][] p);\n" +
+ " 0 aconst_null\n" +
+ " 1 astore_0 [p]\n" +
+ " 2 aconst_null\n" +
+ " 3 astore_1 [l]\n" +
+ " 4 aload_0 [p]\n" +
+ " 5 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 4]\n" +
+ " [pc: 2, line: 5]\n" +
+ " [pc: 4, line: 6]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 6] local: p index: 0 type: java.lang.String[][]\n" +
+ " [pc: 4, pc: 6] local: l index: 1 type: java.lang.String[][]\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #8 @NonNull(\n" +
+ " target type = 0x40 LOCAL_VARIABLE\n" +
+ " local variable entries:\n" +
+ " [pc: 4, pc: 6] index: 1\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #9 @Nullable(\n" +
+ " target type = 0x40 LOCAL_VARIABLE\n" +
+ " local variable entries:\n" +
+ " [pc: 4, pc: 6] index: 1\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " #8 @NonNull(\n" +
+ " target type = 0x40 LOCAL_VARIABLE\n" +
+ " local variable entries:\n" +
+ " [pc: 4, pc: 6] index: 1\n" +
+ " )\n" +
+ " RuntimeVisibleTypeAnnotations: \n" +
+ " #8 @NonNull(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #9 @Nullable(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " #8 @NonNull(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " )\n" +
+ " #8 @NonNull(\n" +
+ " target type = 0x14 METHOD_RETURN\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #9 @Nullable(\n" +
+ " target type = 0x14 METHOD_RETURN\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " #8 @NonNull(\n" +
+ " target type = 0x14 METHOD_RETURN\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -6065,37 +6065,37 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " public Outer$Inner[][] omi;\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #10 @T(\n" +
- " #11 value=(int) 1 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
- " #10 @T(\n" +
- " #11 value=(int) 3 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY, INNER_TYPE]\n" +
- " )\n" +
- " #10 @T(\n" +
- " #11 value=(int) 5 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " #10 @T(\n" +
- " #11 value=(int) 6 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " )\n" +
- " #10 @T(\n" +
- " #11 value=(int) 2 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY, TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " #10 @T(\n" +
- " #11 value=(int) 4 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY, INNER_TYPE, TYPE_ARGUMENT(0)]\n" +
- " )\n" +
+ " public Outer$Inner[][] omi;\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #10 @T(\n" +
+ " #11 value=(int) 1 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #10 @T(\n" +
+ " #11 value=(int) 3 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY, INNER_TYPE]\n" +
+ " )\n" +
+ " #10 @T(\n" +
+ " #11 value=(int) 5 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " #10 @T(\n" +
+ " #11 value=(int) 6 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " )\n" +
+ " #10 @T(\n" +
+ " #11 value=(int) 2 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY, TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " #10 @T(\n" +
+ " #11 value=(int) 4 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY, INNER_TYPE, TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
" \n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "Outer.class", "Outer", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -6116,54 +6116,54 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " // Field descriptor #6 [[LOuter$Inner;\n" +
- " // Signature: [[LOuter<Ljava/lang/String;LOuter$Inner;>.Inner<Ljava/lang/Integer;LOuter$Inner;>;\n" +
- " public Outer$Inner[][] omi;\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #10 @T(\n" +
- " #11 value=(int) 1 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY]\n" +
- " )\n" +
- " #10 @T(\n" +
- " #11 value=(int) 4 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY, INNER_TYPE]\n" +
- " )\n" +
- " #10 @T(\n" +
- " #11 value=(int) 7 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " #10 @T(\n" +
- " #11 value=(int) 8 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " )\n" +
- " #10 @T(\n" +
- " #11 value=(int) 2 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY, TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " #10 @T(\n" +
- " #11 value=(int) 3 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY, TYPE_ARGUMENT(1), INNER_TYPE]\n" +
- " )\n" +
- " #10 @T(\n" +
- " #11 value=(int) 5 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY, INNER_TYPE, TYPE_ARGUMENT(0)]\n" +
- " )\n" +
- " #10 @T(\n" +
- " #11 value=(int) 6 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY, INNER_TYPE, TYPE_ARGUMENT(1)]\n" +
- " )\n" +
- " #10 @T(\n" +
- " #11 value=(int) 7 (constant type)\n" +
- " target type = 0x13 FIELD\n" +
- " location = [ARRAY, ARRAY, INNER_TYPE, TYPE_ARGUMENT(1), INNER_TYPE]\n" +
- " )\n" +
+ " // Field descriptor #6 [[LOuter$Inner;\n" +
+ " // Signature: [[LOuter<Ljava/lang/String;LOuter$Inner;>.Inner<Ljava/lang/Integer;LOuter$Inner;>;\n" +
+ " public Outer$Inner[][] omi;\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #10 @T(\n" +
+ " #11 value=(int) 1 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY]\n" +
+ " )\n" +
+ " #10 @T(\n" +
+ " #11 value=(int) 4 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY, INNER_TYPE]\n" +
+ " )\n" +
+ " #10 @T(\n" +
+ " #11 value=(int) 7 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " #10 @T(\n" +
+ " #11 value=(int) 8 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " )\n" +
+ " #10 @T(\n" +
+ " #11 value=(int) 2 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY, TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " #10 @T(\n" +
+ " #11 value=(int) 3 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY, TYPE_ARGUMENT(1), INNER_TYPE]\n" +
+ " )\n" +
+ " #10 @T(\n" +
+ " #11 value=(int) 5 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY, INNER_TYPE, TYPE_ARGUMENT(0)]\n" +
+ " )\n" +
+ " #10 @T(\n" +
+ " #11 value=(int) 6 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY, INNER_TYPE, TYPE_ARGUMENT(1)]\n" +
+ " )\n" +
+ " #10 @T(\n" +
+ " #11 value=(int) 7 (constant type)\n" +
+ " target type = 0x13 FIELD\n" +
+ " location = [ARRAY, ARRAY, INNER_TYPE, TYPE_ARGUMENT(1), INNER_TYPE]\n" +
+ " )\n" +
" \n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "Outer.class", "Outer", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -6187,41 +6187,41 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " // Method descriptor #6 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [8]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 7]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #15 @T(\n" +
- " target type = 0x14 METHOD_RETURN\n" +
- " )\n" +
+ " // Method descriptor #6 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [8]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 7]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #15 @T(\n" +
+ " target type = 0x14 METHOD_RETURN\n" +
+ " )\n" +
"\n";
- String expectedOutForY =
- " // Method descriptor #8 (LX;)V\n" +
- " // Stack: 2, Locals: 2\n" +
- " X$Y(X arg0);\n" +
- " 0 aload_0 [this]\n" +
- " 1 aload_1 [arg0]\n" +
- " 2 putfield X$Y.this$0 : X [10]\n" +
- " 5 aload_0 [this]\n" +
- " 6 invokespecial java.lang.Object() [12]\n" +
- " 9 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 9]\n" +
- " [pc: 9, line: 10]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 10] local: this index: 0 type: X.Y\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #20 @T(\n" +
+ String expectedOutForY =
+ " // Method descriptor #8 (LX;)V\n" +
+ " // Stack: 2, Locals: 2\n" +
+ " X$Y(X arg0);\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 aload_1 [arg0]\n" +
+ " 2 putfield X$Y.this$0 : X [10]\n" +
+ " 5 aload_0 [this]\n" +
+ " 6 invokespecial java.lang.Object() [12]\n" +
+ " 9 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 9]\n" +
+ " [pc: 9, line: 10]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 10] local: this index: 0 type: X.Y\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #20 @T(\n" +
" target type = 0x14 METHOD_RETURN\n" +
- " location = [INNER_TYPE]\n" +
- " )\n" +
+ " location = [INNER_TYPE]\n" +
+ " )\n" +
"\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X$Y.class", "Y", expectedOutForY, ClassFileBytesDisassembler.SYSTEM);
@@ -6244,12 +6244,12 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #24 @P(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " location = [INNER_TYPE]\n" +
- " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #24 @P(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " location = [INNER_TYPE]\n" +
+ " )\n" +
"\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -6272,22 +6272,22 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #19 @P(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " location = [ARRAY]\n" +
- " )\n" +
- " #20 @O(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " location = [ARRAY, INNER_TYPE]\n" +
- " )\n" +
- " #21 @I(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " location = [ARRAY, INNER_TYPE, INNER_TYPE]\n" +
- " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #19 @P(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
+ " #20 @O(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " location = [ARRAY, INNER_TYPE]\n" +
+ " )\n" +
+ " #21 @I(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " location = [ARRAY, INNER_TYPE, INNER_TYPE]\n" +
+ " )\n" +
"\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -6309,16 +6309,16 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #21 @pkg.NonNull(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 6\n" +
- " )\n" +
- " #21 @pkg.NonNull(\n" +
- " target type = 0x44 NEW\n" +
- " offset = 6\n" +
- " location = [ARRAY]\n" +
- " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #21 @pkg.NonNull(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 6\n" +
+ " )\n" +
+ " #21 @pkg.NonNull(\n" +
+ " target type = 0x44 NEW\n" +
+ " offset = 6\n" +
+ " location = [ARRAY]\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -6376,50 +6376,50 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " // Field descriptor #6 Ljava/lang/String;\n" +
- " java.lang.String x;\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #8 @T(\n" +
- " target type = 0x13 FIELD\n" +
- " )\n" +
- " \n" +
- " // Method descriptor #10 ()V\n" +
- " // Stack: 1, Locals: 1\n" +
- " X();\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [12]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 9]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #8 @T(\n" +
- " target type = 0x14 METHOD_RETURN\n" +
- " )\n" +
- " \n" +
- " // Method descriptor #19 (I)I\n" +
- " // Stack: 1, Locals: 2\n" +
- " int foo(int p);\n" +
- " 0 iconst_0\n" +
- " 1 ireturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 14]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 2] local: this index: 0 type: X\n" +
- " [pc: 0, pc: 2] local: p index: 1 type: int\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #8 @T(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " )\n" +
- " #8 @T(\n" +
- " target type = 0x14 METHOD_RETURN\n" +
- " )\n" +
- "\n" +
- " RuntimeInvisibleAnnotations: \n" +
- " #8 @T(\n" +
- " )\n" +
+ " // Field descriptor #6 Ljava/lang/String;\n" +
+ " java.lang.String x;\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #8 @T(\n" +
+ " target type = 0x13 FIELD\n" +
+ " )\n" +
+ " \n" +
+ " // Method descriptor #10 ()V\n" +
+ " // Stack: 1, Locals: 1\n" +
+ " X();\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [12]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 9]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #8 @T(\n" +
+ " target type = 0x14 METHOD_RETURN\n" +
+ " )\n" +
+ " \n" +
+ " // Method descriptor #19 (I)I\n" +
+ " // Stack: 1, Locals: 2\n" +
+ " int foo(int p);\n" +
+ " 0 iconst_0\n" +
+ " 1 ireturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 14]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 2] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 2] local: p index: 1 type: int\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #8 @T(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " )\n" +
+ " #8 @T(\n" +
+ " target type = 0x14 METHOD_RETURN\n" +
+ " )\n" +
+ "\n" +
+ " RuntimeInvisibleAnnotations: \n" +
+ " #8 @T(\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -6448,73 +6448,73 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
},
"");
String expectedOutput =
- " // Field descriptor #6 LX;\n" +
- " X field;\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #8 @SillyAnnotation(\n" +
- " target type = 0x13 FIELD\n" +
- " )\n" +
- " \n" +
- " // Method descriptor #10 (I)V\n" +
- " // Stack: 1, Locals: 2\n" +
- " X(int x);\n" +
- " 0 aload_0 [this]\n" +
- " 1 invokespecial java.lang.Object() [12]\n" +
- " 4 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 7]\n" +
- " [pc: 4, line: 8]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- " [pc: 0, pc: 5] local: x index: 1 type: int\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #8 @SillyAnnotation(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " )\n" +
- " #8 @SillyAnnotation(\n" +
- " target type = 0x14 METHOD_RETURN\n" +
- " )\n" +
- " \n" +
- " // Method descriptor #10 (I)V\n" +
- " // Stack: 0, Locals: 2\n" +
- " void foo(int x);\n" +
- " 0 return\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 11]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
- " [pc: 0, pc: 1] local: x index: 1 type: int\n" +
- " RuntimeInvisibleAnnotations: \n" +
- " #8 @SillyAnnotation(\n" +
- " )\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #8 @SillyAnnotation(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " )\n" +
- " \n" +
- " // Method descriptor #23 (I)Ljava/lang/String;\n" +
- " // Stack: 1, Locals: 2\n" +
- " java.lang.String goo(int x);\n" +
- " 0 aconst_null\n" +
- " 1 areturn\n" +
- " Line numbers:\n" +
- " [pc: 0, line: 14]\n" +
- " Local variable table:\n" +
- " [pc: 0, pc: 2] local: this index: 0 type: X\n" +
- " [pc: 0, pc: 2] local: x index: 1 type: int\n" +
- " RuntimeInvisibleAnnotations: \n" +
- " #8 @SillyAnnotation(\n" +
- " )\n" +
- " RuntimeInvisibleTypeAnnotations: \n" +
- " #8 @SillyAnnotation(\n" +
- " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
- " method parameter index = 0\n" +
- " )\n" +
- " #8 @SillyAnnotation(\n" +
- " target type = 0x14 METHOD_RETURN\n" +
- " )\n" +
+ " // Field descriptor #6 LX;\n" +
+ " X field;\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #8 @SillyAnnotation(\n" +
+ " target type = 0x13 FIELD\n" +
+ " )\n" +
+ " \n" +
+ " // Method descriptor #10 (I)V\n" +
+ " // Stack: 1, Locals: 2\n" +
+ " X(int x);\n" +
+ " 0 aload_0 [this]\n" +
+ " 1 invokespecial java.lang.Object() [12]\n" +
+ " 4 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 7]\n" +
+ " [pc: 4, line: 8]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 5] local: x index: 1 type: int\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #8 @SillyAnnotation(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " )\n" +
+ " #8 @SillyAnnotation(\n" +
+ " target type = 0x14 METHOD_RETURN\n" +
+ " )\n" +
+ " \n" +
+ " // Method descriptor #10 (I)V\n" +
+ " // Stack: 0, Locals: 2\n" +
+ " void foo(int x);\n" +
+ " 0 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 11]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 1] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 1] local: x index: 1 type: int\n" +
+ " RuntimeInvisibleAnnotations: \n" +
+ " #8 @SillyAnnotation(\n" +
+ " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #8 @SillyAnnotation(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " )\n" +
+ " \n" +
+ " // Method descriptor #23 (I)Ljava/lang/String;\n" +
+ " // Stack: 1, Locals: 2\n" +
+ " java.lang.String goo(int x);\n" +
+ " 0 aconst_null\n" +
+ " 1 areturn\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 14]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 2] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 2] local: x index: 1 type: int\n" +
+ " RuntimeInvisibleAnnotations: \n" +
+ " #8 @SillyAnnotation(\n" +
+ " )\n" +
+ " RuntimeInvisibleTypeAnnotations: \n" +
+ " #8 @SillyAnnotation(\n" +
+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" +
+ " method parameter index = 0\n" +
+ " )\n" +
+ " #8 @SillyAnnotation(\n" +
+ " target type = 0x14 METHOD_RETURN\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
@@ -6524,7 +6524,7 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
"X.java",
"import java.lang.annotation.ElementType;\n" +
"import java.lang.annotation.Target;\n" +
- "@Deprecated\n" +
+ "@Deprecated\n" +
"@Target(ElementType.TYPE_USE)\n" +
"@interface X {\n" +
" int value() default 0;\n" +
@@ -6532,47 +6532,47 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
},
"");
String expectedOutput =
- "// Compiled from X.java (version 1.8 : 52.0, no super bit, deprecated)\n" +
- "abstract @interface X extends java.lang.annotation.Annotation {\n" +
- " Constant pool:\n" +
- " constant #1 class: #2 X\n" +
- " constant #2 utf8: \"X\"\n" +
- " constant #3 class: #4 java/lang/Object\n" +
- " constant #4 utf8: \"java/lang/Object\"\n" +
- " constant #5 class: #6 java/lang/annotation/Annotation\n" +
- " constant #6 utf8: \"java/lang/annotation/Annotation\"\n" +
- " constant #7 utf8: \"value\"\n" +
- " constant #8 utf8: \"()I\"\n" +
- " constant #9 utf8: \"AnnotationDefault\"\n" +
- " constant #10 integer: 0\n" +
- " constant #11 utf8: \"SourceFile\"\n" +
- " constant #12 utf8: \"X.java\"\n" +
- " constant #13 utf8: \"Deprecated\"\n" +
- " constant #14 utf8: \"RuntimeVisibleAnnotations\"\n" +
- " constant #15 utf8: \"Ljava/lang/Deprecated;\"\n" +
- " constant #16 utf8: \"Ljava/lang/annotation/Target;\"\n" +
- " constant #17 utf8: \"Ljava/lang/annotation/ElementType;\"\n" +
- " constant #18 utf8: \"TYPE_USE\"\n" +
- " \n" +
- " // Method descriptor #8 ()I\n" +
- " public abstract int value();\n" +
- " Annotation Default: \n" +
- " (int) 0 (constant type)\n" +
- "\n" +
- " RuntimeVisibleAnnotations: \n" +
- " #15 @java.lang.Deprecated(\n" +
- " )\n" +
- " #16 @java.lang.annotation.Target(\n" +
- " #7 value=[\n" +
- " java.lang.annotation.ElementType.TYPE_USE(enum type #17.#18)\n" +
- " ]\n" +
- " )\n" +
+ "// Compiled from X.java (version 1.8 : 52.0, no super bit, deprecated)\n" +
+ "abstract @interface X extends java.lang.annotation.Annotation {\n" +
+ " Constant pool:\n" +
+ " constant #1 class: #2 X\n" +
+ " constant #2 utf8: \"X\"\n" +
+ " constant #3 class: #4 java/lang/Object\n" +
+ " constant #4 utf8: \"java/lang/Object\"\n" +
+ " constant #5 class: #6 java/lang/annotation/Annotation\n" +
+ " constant #6 utf8: \"java/lang/annotation/Annotation\"\n" +
+ " constant #7 utf8: \"value\"\n" +
+ " constant #8 utf8: \"()I\"\n" +
+ " constant #9 utf8: \"AnnotationDefault\"\n" +
+ " constant #10 integer: 0\n" +
+ " constant #11 utf8: \"SourceFile\"\n" +
+ " constant #12 utf8: \"X.java\"\n" +
+ " constant #13 utf8: \"Deprecated\"\n" +
+ " constant #14 utf8: \"RuntimeVisibleAnnotations\"\n" +
+ " constant #15 utf8: \"Ljava/lang/Deprecated;\"\n" +
+ " constant #16 utf8: \"Ljava/lang/annotation/Target;\"\n" +
+ " constant #17 utf8: \"Ljava/lang/annotation/ElementType;\"\n" +
+ " constant #18 utf8: \"TYPE_USE\"\n" +
+ " \n" +
+ " // Method descriptor #8 ()I\n" +
+ " public abstract int value();\n" +
+ " Annotation Default: \n" +
+ " (int) 0 (constant type)\n" +
+ "\n" +
+ " RuntimeVisibleAnnotations: \n" +
+ " #15 @java.lang.Deprecated(\n" +
+ " )\n" +
+ " #16 @java.lang.annotation.Target(\n" +
+ " #7 value=[\n" +
+ " java.lang.annotation.ElementType.TYPE_USE(enum type #17.#18)\n" +
+ " ]\n" +
+ " )\n" +
"}";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=421148, [1.8][compiler] Verify error with annotated casts and unused locals.
+ }
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=421148, [1.8][compiler] Verify error with annotated casts and unused locals.
public void test421148() {
-
+
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
runConformTest(
@@ -6587,13 +6587,13 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
" System.out.println(\"OK\");\n" +
" }\n" +
"}\n"
- },
+ },
"OK",
- customOptions);
+ customOptions);
}
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=421620, [1.8][compiler] wrong compile error with TYPE_USE annotation on exception
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=421620, [1.8][compiler] wrong compile error with TYPE_USE annotation on exception
public void test421620() {
-
+
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
runConformTest(
@@ -6632,13 +6632,13 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
" System.out.println(\"OK\");\n" +
" }\n" +
"}\n"
- },
+ },
"OK",
- customOptions);
+ customOptions);
}
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=425599, [1.8][compiler] ISE when trying to compile qualified and annotated class instance creation
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=425599, [1.8][compiler] ISE when trying to compile qualified and annotated class instance creation
public void _test425599() {
-
+
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_Store_Annotations, CompilerOptions.ENABLED);
runConformTest(
@@ -6659,9 +6659,9 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
" @A Middle<Object>.@A Inner<Character> ax = new pack.@A Outer().new @A Middle<@A Object>().new @A Inner<@A Character>(null);\n" +
" }\n" +
"}\n"
- },
+ },
"OK",
- customOptions);
+ customOptions);
}
public void testBug485386() {
String javaVersion = System.getProperty("java.version");
@@ -6677,33 +6677,33 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
runConformTest(
new String[] {
"Test.java",
- "import java.lang.annotation.*;\n" +
- "import java.lang.reflect.*;\n" +
- "\n" +
- "@Retention(value = RetentionPolicy.RUNTIME)\n" +
- "@java.lang.annotation.Target(ElementType.TYPE_USE)\n" +
- "@interface TestAnn1 {\n" +
- " String value() default \"1\";\n" +
- "}\n" +
- "\n" +
- "public class Test {\n" +
- "\n" +
- " class Inner {\n" +
- " public @TestAnn1() Inner() {\n" +
- " System.out.println(\"New\");\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public void test() throws SecurityException, NoSuchMethodException {\n" +
- " Executable f = Test.Inner.class.getDeclaredConstructor(Test.class);\n" +
- " AnnotatedType ae = f.getAnnotatedReturnType();\n" +
- " Object o = ae.getAnnotation(TestAnn1.class);\n" +
- " System.out.println(o);\n" +
- " }\n" +
- " \n" +
- " public static void main(String... args) throws Exception {\n" +
- " new Test().test();\n" +
- " }\n" +
+ "import java.lang.annotation.*;\n" +
+ "import java.lang.reflect.*;\n" +
+ "\n" +
+ "@Retention(value = RetentionPolicy.RUNTIME)\n" +
+ "@java.lang.annotation.Target(ElementType.TYPE_USE)\n" +
+ "@interface TestAnn1 {\n" +
+ " String value() default \"1\";\n" +
+ "}\n" +
+ "\n" +
+ "public class Test {\n" +
+ "\n" +
+ " class Inner {\n" +
+ " public @TestAnn1() Inner() {\n" +
+ " System.out.println(\"New\");\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public void test() throws SecurityException, NoSuchMethodException {\n" +
+ " Executable f = Test.Inner.class.getDeclaredConstructor(Test.class);\n" +
+ " AnnotatedType ae = f.getAnnotatedReturnType();\n" +
+ " Object o = ae.getAnnotation(TestAnn1.class);\n" +
+ " System.out.println(o);\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String... args) throws Exception {\n" +
+ " new Test().test();\n" +
+ " }\n" +
"}\n"
},
"@TestAnn1(" + (v < 14 ? "value=" : "") + decorateAnnotationValueLiteral("1") + ")");
@@ -6768,16 +6768,16 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
MethodBinding[] methods1 = type.getMethods("method1".toCharArray());
assertEquals("Base.@A2 Static.@A3 Middle1.@A4 Middle2<Object>.@A5 Middle3.@A6 GenericInner<String>",
new String(methods1[0].parameters[0].annotatedDebugName()));
-
+
MethodBinding[] methods2 = type.getMethods("method2".toCharArray());
assertEquals("Base.@A2 Static.@A3 Middle1.@A4 Middle2<@B1 Object>.@A5 Middle3.@A6 GenericInner<@B2 String> @A7 [] @A8 []",
new String(methods2[0].parameters[0].annotatedDebugName()));
-
+
MethodBinding[] methods3 = type.getMethods("method3".toCharArray());
assertEquals("Base.@A2 Static.@A3 Middle1.@A4 Middle2<@B1 Class<@C1 Object @C2 []> @B2 []>.@A5 Middle3.@A6 GenericInner<@B3 String> @A7 [] @A8 []",
new String(methods3[0].parameters[0].annotatedDebugName()));
}
-
+
public void testBug492322readFromClassWithGenericBase() {
runConformTest(
new String[] {
@@ -6838,11 +6838,11 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
MethodBinding[] methods1 = type.getMethods("method1".toCharArray());
assertEquals("Base.@A2 Static.@A3 Middle1.@A4 Middle2<Object>.@A5 Middle3.@A6 GenericInner<String>",
new String(methods1[0].parameters[0].annotatedDebugName()));
-
+
MethodBinding[] methods2 = type.getMethods("method2".toCharArray());
assertEquals("Base.@A2 Static.@A3 Middle1.@A4 Middle2<@B1 Object>.@A5 Middle3.@A6 GenericInner<@B2 String> @A7 [] @A8 []",
new String(methods2[0].parameters[0].annotatedDebugName()));
-
+
MethodBinding[] methods3 = type.getMethods("method3".toCharArray());
assertEquals("Base.@A2 Static.@A3 Middle1.@A4 Middle2<@B1 Class<@C1 Object @C2 []> @B2 []>.@A5 Middle3.@A6 GenericInner<@B3 String> @A7 [] @A8 []",
new String(methods3[0].parameters[0].annotatedDebugName()));
@@ -6851,10 +6851,10 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
// bug492322-compiled-with-4.6.jar contains classes compiled with eclipse 4.6:
/*-
package test1;
-
+
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
-
+
@Target(ElementType.TYPE_USE) @interface A2 {}
@Target(ElementType.TYPE_USE) @interface A3 {}
@Target(ElementType.TYPE_USE) @interface A4 {}
@@ -6868,7 +6868,7 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
@Target(ElementType.TYPE_USE) @interface B4 {}
@Target(ElementType.TYPE_USE) @interface C1 {}
@Target(ElementType.TYPE_USE) @interface C2 {}
-
+
public abstract class Base<B> {
static public class Static {
public static class Static2<X> {
@@ -6882,7 +6882,7 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
}
}
}
-
+
public Object method1(Static.@A2 Static2<Exception>.@A3 Middle1.@A4 Middle2<Object>.@A5 Middle3.@A6 GenericInner<String> nullable) {
return new Object();
}
@@ -6911,11 +6911,11 @@ public class TypeAnnotationTest extends AbstractRegressionTest {
MethodBinding[] methods1 = type.getMethods("method1".toCharArray());
assertEquals("Base.Static.@A2 Static2<Exception>.@A3 Middle1.@A4 Middle2<Object>.@A5 Middle3.@A6 GenericInner<String>",
new String(methods1[0].parameters[0].annotatedDebugName()));
-
+
MethodBinding[] methods2 = type.getMethods("method2".toCharArray());
assertEquals("Base.Static.@A2 Static2<@B1 Exception>.@A3 Middle1.@A4 Middle2<@B2 Object>.@A5 Middle3.@A6 GenericInner<@B3 String> @A7 [] @A8 []",
new String(methods2[0].parameters[0].annotatedDebugName()));
-
+
MethodBinding[] methods3 = type.getMethods("method3".toCharArray());
assertEquals("Base.Static.@A2 Static2<@B1 Exception>.@A3 Middle1.@A4 Middle2<@B2 Class<@C1 Object @C2 []> @B3 []>.@A5 Middle3.@A6 GenericInner<@B4 String> @A7 [] @A8 []",
new String(methods3[0].parameters[0].annotatedDebugName()));
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UnderscoresInLiteralsTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UnderscoresInLiteralsTest.java
index 41127d9a8..098dd3fbe 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UnderscoresInLiteralsTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UnderscoresInLiteralsTest.java
@@ -45,11 +45,11 @@ public class UnderscoresInLiteralsTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(0b_001);\n" +
- " ^^^\n" +
- "Underscores have to be located within digits\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(0b_001);\n" +
+ " ^^^\n" +
+ "Underscores have to be located within digits\n" +
"----------\n");
}
public void test002() {
@@ -62,11 +62,11 @@ public class UnderscoresInLiteralsTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(0_b001);\n" +
- " ^^\n" +
- "Underscores have to be located within digits\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(0_b001);\n" +
+ " ^^\n" +
+ "Underscores have to be located within digits\n" +
"----------\n");
}
public void test003() {
@@ -79,11 +79,11 @@ public class UnderscoresInLiteralsTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(0b001_);\n" +
- " ^^^^^^\n" +
- "Underscores have to be located within digits\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(0b001_);\n" +
+ " ^^^^^^\n" +
+ "Underscores have to be located within digits\n" +
"----------\n");
}
public void test004() {
@@ -96,11 +96,11 @@ public class UnderscoresInLiteralsTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(0x_11.0p33f);\n" +
- " ^^^\n" +
- "Underscores have to be located within digits\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(0x_11.0p33f);\n" +
+ " ^^^\n" +
+ "Underscores have to be located within digits\n" +
"----------\n");
}
public void test005() {
@@ -113,11 +113,11 @@ public class UnderscoresInLiteralsTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(0x11_.0p33f);\n" +
- " ^^^^^\n" +
- "Underscores have to be located within digits\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(0x11_.0p33f);\n" +
+ " ^^^^^\n" +
+ "Underscores have to be located within digits\n" +
"----------\n");
}
public void test006() {
@@ -130,11 +130,11 @@ public class UnderscoresInLiteralsTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(0x11._0p33f);\n" +
- " ^^^^^^\n" +
- "Underscores have to be located within digits\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(0x11._0p33f);\n" +
+ " ^^^^^^\n" +
+ "Underscores have to be located within digits\n" +
"----------\n");
}
public void test007() {
@@ -147,11 +147,11 @@ public class UnderscoresInLiteralsTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(0x11.0_p33f);\n" +
- " ^^^^^^^\n" +
- "Underscores have to be located within digits\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(0x11.0_p33f);\n" +
+ " ^^^^^^^\n" +
+ "Underscores have to be located within digits\n" +
"----------\n");
}
public void test008() {
@@ -164,11 +164,11 @@ public class UnderscoresInLiteralsTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(0x11.0p_33f);\n" +
- " ^^^^^^^^^^\n" +
- "Underscores have to be located within digits\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(0x11.0p_33f);\n" +
+ " ^^^^^^^^^^\n" +
+ "Underscores have to be located within digits\n" +
"----------\n");
}
public void test009() {
@@ -181,11 +181,11 @@ public class UnderscoresInLiteralsTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(0x11.0p33_f);\n" +
- " ^^^^^^^^^^\n" +
- "Underscores have to be located within digits\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(0x11.0p33_f);\n" +
+ " ^^^^^^^^^^\n" +
+ "Underscores have to be located within digits\n" +
"----------\n");
}
public void test010() {
@@ -198,11 +198,11 @@ public class UnderscoresInLiteralsTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(0x_0001AEFBBA);\n" +
- " ^^^\n" +
- "Underscores have to be located within digits\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(0x_0001AEFBBA);\n" +
+ " ^^^\n" +
+ "Underscores have to be located within digits\n" +
"----------\n");
}
public void test011() {
@@ -215,11 +215,11 @@ public class UnderscoresInLiteralsTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(0_x0001AEFBBA);\n" +
- " ^^\n" +
- "Underscores have to be located within digits\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(0_x0001AEFBBA);\n" +
+ " ^^\n" +
+ "Underscores have to be located within digits\n" +
"----------\n");
}
public void test012() {
@@ -232,11 +232,11 @@ public class UnderscoresInLiteralsTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(0x0001AEFBBA_);\n" +
- " ^^^^^^^^^^^^^\n" +
- "Underscores have to be located within digits\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(0x0001AEFBBA_);\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Underscores have to be located within digits\n" +
"----------\n");
}
public void test013() {
@@ -249,11 +249,11 @@ public class UnderscoresInLiteralsTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(_01234567);\n" +
- " ^^^^^^^^^\n" +
- "_01234567 cannot be resolved to a variable\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(_01234567);\n" +
+ " ^^^^^^^^^\n" +
+ "_01234567 cannot be resolved to a variable\n" +
"----------\n");
}
public void test014() {
@@ -266,11 +266,11 @@ public class UnderscoresInLiteralsTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(01234567_);\n" +
- " ^^^^^^^^^\n" +
- "Underscores have to be located within digits\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(01234567_);\n" +
+ " ^^^^^^^^^\n" +
+ "Underscores have to be located within digits\n" +
"----------\n");
}
public void test015() {
@@ -283,11 +283,11 @@ public class UnderscoresInLiteralsTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(1_.236589954f);\n" +
- " ^^\n" +
- "Underscores have to be located within digits\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(1_.236589954f);\n" +
+ " ^^\n" +
+ "Underscores have to be located within digits\n" +
"----------\n");
}
public void test016() {
@@ -300,11 +300,11 @@ public class UnderscoresInLiteralsTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(1._236589954f);\n" +
- " ^^^\n" +
- "Underscores have to be located within digits\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(1._236589954f);\n" +
+ " ^^^\n" +
+ "Underscores have to be located within digits\n" +
"----------\n");
}
public void test017() {
@@ -317,11 +317,11 @@ public class UnderscoresInLiteralsTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(1_e2);\n" +
- " ^^\n" +
- "Underscores have to be located within digits\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(1_e2);\n" +
+ " ^^\n" +
+ "Underscores have to be located within digits\n" +
"----------\n");
}
public void test018() {
@@ -334,11 +334,11 @@ public class UnderscoresInLiteralsTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(1e_2);\n" +
- " ^^^^\n" +
- "Underscores have to be located within digits\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(1e_2);\n" +
+ " ^^^^\n" +
+ "Underscores have to be located within digits\n" +
"----------\n");
}
public void test019() {
@@ -351,11 +351,11 @@ public class UnderscoresInLiteralsTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(1e2_);\n" +
- " ^^^^\n" +
- "Underscores have to be located within digits\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(1e2_);\n" +
+ " ^^^^\n" +
+ "Underscores have to be located within digits\n" +
"----------\n");
}
public void test020() {
@@ -368,11 +368,11 @@ public class UnderscoresInLiteralsTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(01e2_);\n" +
- " ^^^^^\n" +
- "Underscores have to be located within digits\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(01e2_);\n" +
+ " ^^^^^\n" +
+ "Underscores have to be located within digits\n" +
"----------\n");
}
public void test021() {
@@ -385,11 +385,11 @@ public class UnderscoresInLiteralsTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(01_e2_);\n" +
- " ^^^\n" +
- "Underscores have to be located within digits\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(01_e2_);\n" +
+ " ^^^\n" +
+ "Underscores have to be located within digits\n" +
"----------\n");
}
public void test022() {
@@ -406,11 +406,11 @@ public class UnderscoresInLiteralsTest extends AbstractRegressionTest {
" }\n" +
"}"
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(0b1110000_);\n" +
- " ^^^^^^^^^^\n" +
- "Underscores can only be used with source level 1.7 or greater\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " System.out.println(0b1110000_);\n" +
+ " ^^^^^^^^^^\n" +
+ "Underscores can only be used with source level 1.7 or greater\n" +
"----------\n",
null,
true,
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode10Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode10Test.java
index 19badb2be..7d739cd71 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode10Test.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode10Test.java
@@ -32,8 +32,8 @@ public void test1() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public int a\u0860; // new unicode character in unicode 10.0 \n" +
+ "public class X {\n" +
+ " public int a\u0860; // new unicode character in unicode 10.0 \n" +
"}",
},
"",
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode11Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode11Test.java
index 99940b139..060e2dec7 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode11Test.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode11Test.java
@@ -32,8 +32,8 @@ public void test1() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public int a\u0560; // new unicode character in unicode 11.0 \n" +
+ "public class X {\n" +
+ " public int a\u0560; // new unicode character in unicode 11.0 \n" +
"}",
},
"",
@@ -45,15 +45,15 @@ public void test2() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public int a\\u0560; // new unicode character in unicode 11.0 \n" +
+ "public class X {\n" +
+ " public int a\\u0560; // new unicode character in unicode 11.0 \n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public int a\\u0560; // new unicode character in unicode 11.0 \n" +
- " ^^^^^^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public int a\\u0560; // new unicode character in unicode 11.0 \n" +
+ " ^^^^^^\n" +
+ "Syntax error on token \"Invalid Character\", delete this token\n" +
"----------\n",
null,
true,
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode12_1Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode12_1Test.java
index 11f4a3981..039d2167e 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode12_1Test.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode12_1Test.java
@@ -32,8 +32,8 @@ public void test1() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public int a\\uA7BA; // new unicode character in unicode 12.0 \n" +
+ "public class X {\n" +
+ " public int a\\uA7BA; // new unicode character in unicode 12.0 \n" +
"}",
},
"",
@@ -45,15 +45,15 @@ public void test2() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public int a\\uA7BA; // new unicode character in unicode 12.0 \n" +
+ "public class X {\n" +
+ " public int a\\uA7BA; // new unicode character in unicode 12.0 \n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public int a\\uA7BA; // new unicode character in unicode 12.0 \n" +
- " ^^^^^^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " public int a\\uA7BA; // new unicode character in unicode 12.0 \n" +
+ " ^^^^^^\n" +
+ "Syntax error on token \"Invalid Character\", delete this token\n" +
"----------\n",
null,
true,
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode18Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode18Test.java
index a31540519..64c22b3ac 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode18Test.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode18Test.java
@@ -33,10 +33,10 @@ public void test426214() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " int a\\u058f = 0; // new unicode character in 6.2.0 \n" +
- " String a41\\u08fc; // new unicode character in 6.2.0\n" +
- " float a\\u057f = 1;\n" +
+ "public class X {\n" +
+ " int a\\u058f = 0; // new unicode character in 6.2.0 \n" +
+ " String a41\\u08fc; // new unicode character in 6.2.0\n" +
+ " float a\\u057f = 1;\n" +
"}",
},
"",
@@ -50,22 +50,22 @@ public void test426214_2() {
JavacTestOptions.Excuse.JavacCompilesIncorrectSource,
new String[] {
"X.java",
- "public class X {\n" +
- " int a\\u058f = 0; // new unicode character in 6.2.0 \n" +
- " String a41\\u08fc; // new unicode character in 6.2.0\n" +
- " float a\\u057f = 1;\n" +
+ "public class X {\n" +
+ " int a\\u058f = 0; // new unicode character in 6.2.0 \n" +
+ " String a41\\u08fc; // new unicode character in 6.2.0\n" +
+ " float a\\u057f = 1;\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " int a\\u058f = 0; // new unicode character in 6.2.0 \n" +
- " ^^^^^^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " String a41\\u08fc; // new unicode character in 6.2.0\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " int a\\u058f = 0; // new unicode character in 6.2.0 \n" +
+ " ^^^^^^\n" +
+ "Syntax error on token \"Invalid Character\", delete this token\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " String a41\\u08fc; // new unicode character in 6.2.0\n" +
+ " ^^^^^^\n" +
+ "Syntax error on token \"Invalid Character\", delete this token\n" +
"----------\n",
null,
true,
@@ -79,22 +79,22 @@ public void test426214_3() {
JavacTestOptions.Excuse.JavacCompilesIncorrectSource,
new String[] {
"X.java",
- "public class X {\n" +
- " int a\\u058f = 0; // new unicode character in 6.2.0 \n" +
- " String a41\\u08fc; // new unicode character in 6.2.0\n" +
- " float a\\u057f = 1;\n" +
+ "public class X {\n" +
+ " int a\\u058f = 0; // new unicode character in 6.2.0 \n" +
+ " String a41\\u08fc; // new unicode character in 6.2.0\n" +
+ " float a\\u057f = 1;\n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " int a\\u058f = 0; // new unicode character in 6.2.0 \n" +
- " ^^^^^^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " String a41\\u08fc; // new unicode character in 6.2.0\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " int a\\u058f = 0; // new unicode character in 6.2.0 \n" +
+ " ^^^^^^\n" +
+ "Syntax error on token \"Invalid Character\", delete this token\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " String a41\\u08fc; // new unicode character in 6.2.0\n" +
+ " ^^^^^^\n" +
+ "Syntax error on token \"Invalid Character\", delete this token\n" +
"----------\n",
null,
true,
@@ -106,15 +106,15 @@ public void test426214_4() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " int a\\u061C = 0; // new unicode character in 6.3.0 \n" +
+ "public class X {\n" +
+ " int a\\u061C = 0; // new unicode character in 6.3.0 \n" +
"}",
},
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " int a\\u061C = 0; // new unicode character in 6.3.0 \n" +
- " ^^^^^^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " int a\\u061C = 0; // new unicode character in 6.3.0 \n" +
+ " ^^^^^^\n" +
+ "Syntax error on token \"Invalid Character\", delete this token\n" +
"----------\n",
null,
true,
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode9Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode9Test.java
index a77892c4c..df1dd0d6d 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode9Test.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode9Test.java
@@ -32,8 +32,8 @@ public void test1() {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public int a\u20BE; // new unicode character in unicode 8.0 \n" +
+ "public class X {\n" +
+ " public int a\u20BE; // new unicode character in unicode 8.0 \n" +
"}",
},
"",
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UnnamedModuleTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UnnamedModuleTest.java
index 0374092e1..ce530f0fe 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UnnamedModuleTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UnnamedModuleTest.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Till Brychcy - initial API and implementation
*******************************************************************************/
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java
index 6e7d315d3..115954b20 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java
@@ -805,15 +805,15 @@ public class VarargsTest extends AbstractComparableTest {
" public static void count(int[] array, int[] ... values) { System.out.print(2); }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Y.count(new int[0]);\n" +
- " ^^^^^\n" +
- "The method count(int[], int[]) is ambiguous for the type Y\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " Y.count(new int[0]);\n" +
+ " ^^^^^\n" +
+ "The method count(int[], int[]) is ambiguous for the type Y\n" +
"----------\n"
);
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383780
public void test015_tolerate() throws Exception {
if (this.complianceLevel < ClassFileConstants.JDK1_5) return;
@@ -834,11 +834,11 @@ public class VarargsTest extends AbstractComparableTest {
" public static void count(int[] array, int[] ... values) { System.out.print(2); }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Y.count(new int[0]);\n" +
- " ^^^^^\n" +
- "The method count(int[], int[]) is ambiguous for the type Y\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " Y.count(new int[0]);\n" +
+ " ^^^^^\n" +
+ "The method count(int[], int[]) is ambiguous for the type Y\n" +
"----------\n",
null, true, options);
} else {
@@ -855,7 +855,7 @@ public class VarargsTest extends AbstractComparableTest {
" public static void count(int[] array, int[] ... values) { System.out.print(2); }\n" +
"}\n",
},
- "1",
+ "1",
null, true, null, options, null);
}
} finally {
@@ -1318,16 +1318,16 @@ public class VarargsTest extends AbstractComparableTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " x.a(true);\n" +
- " ^\n" +
- "The method a(boolean, Object[]) is ambiguous for the type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " x.a(true, \"foobar\");\n" +
- " ^\n" +
- "The method a(boolean, Object[]) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " x.a(true);\n" +
+ " ^\n" +
+ "The method a(boolean, Object[]) is ambiguous for the type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " x.a(true, \"foobar\");\n" +
+ " ^\n" +
+ "The method a(boolean, Object[]) is ambiguous for the type X\n" +
"----------\n");
this.runNegativeTest(
new String[] {
@@ -1393,16 +1393,16 @@ public class VarargsTest extends AbstractComparableTest {
" }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " x.a(true);\n" +
- " ^\n" +
- "The method a(boolean, Object[]) is ambiguous for the type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " x.a(true, \"foobar\");\n" +
- " ^\n" +
- "The method a(boolean, Object[]) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " x.a(true);\n" +
+ " ^\n" +
+ "The method a(boolean, Object[]) is ambiguous for the type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " x.a(true, \"foobar\");\n" +
+ " ^\n" +
+ "The method a(boolean, Object[]) is ambiguous for the type X\n" +
"----------\n",
null, true, options);
} else {
@@ -1535,16 +1535,16 @@ public class VarargsTest extends AbstractComparableTest {
"The method foo3(String, V, String[]) is ambiguous for the type V\n" +
"----------\n"
: // one fewer ambiguity in 1.8:
- "----------\n" +
- "1. ERROR in V.java (at line 4)\n" +
- " v.foo2(null, \"\");\n" +
- " ^^^^\n" +
- "The method foo2(String, Object[]) is ambiguous for the type V\n" +
- "----------\n" +
- "2. ERROR in V.java (at line 5)\n" +
- " v.foo2(null, \"\", \"\");\n" +
- " ^^^^\n" +
- "The method foo2(String, Object[]) is ambiguous for the type V\n" +
+ "----------\n" +
+ "1. ERROR in V.java (at line 4)\n" +
+ " v.foo2(null, \"\");\n" +
+ " ^^^^\n" +
+ "The method foo2(String, Object[]) is ambiguous for the type V\n" +
+ "----------\n" +
+ "2. ERROR in V.java (at line 5)\n" +
+ " v.foo2(null, \"\", \"\");\n" +
+ " ^^^^\n" +
+ "The method foo2(String, Object[]) is ambiguous for the type V\n" +
"----------\n")
);
}
@@ -2299,7 +2299,7 @@ public class VarargsTest extends AbstractComparableTest {
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=223427
public void test061() {
- String expectedOutput =
+ String expectedOutput =
"----------\n" +
"1. WARNING in X.java (at line 5)\n" +
" Collections.addAll(constantClassSet, String.class, Object.class);\n" +
@@ -2312,7 +2312,7 @@ public class VarargsTest extends AbstractComparableTest {
"Zork cannot be resolved to a type\n" +
"----------\n";
if (this.complianceLevel >= ClassFileConstants.JDK1_7) {
- expectedOutput =
+ expectedOutput =
"----------\n" +
"1. ERROR in X.java (at line 6)\n" +
" Zork z;\n" +
@@ -2339,26 +2339,26 @@ public class VarargsTest extends AbstractComparableTest {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\r\n" +
- " private static final String CONST = \"\";\r\n" +
- "\r\n" +
- " public static class A {\r\n" +
- " A(Integer i, String... tab) {}\r\n" +
- " }\r\n" +
- " \r\n" +
- " Object foo(final Float f) {\r\n" +
- " return new A(Integer.valueOf(0), CONST) {\r\n" +
- " public String toString() {\r\n" +
- " return f.toString();\r\n" +
- " }\r\n" +
- " };\r\n" +
- " }\r\n" +
+ "public class X {\r\n" +
+ " private static final String CONST = \"\";\r\n" +
+ "\r\n" +
+ " public static class A {\r\n" +
+ " A(Integer i, String... tab) {}\r\n" +
+ " }\r\n" +
+ " \r\n" +
+ " Object foo(final Float f) {\r\n" +
+ " return new A(Integer.valueOf(0), CONST) {\r\n" +
+ " public String toString() {\r\n" +
+ " return f.toString();\r\n" +
+ " }\r\n" +
+ " };\r\n" +
+ " }\r\n" +
"}",
},
"");
String expectedOutput =
- " // Method descriptor #10 (LX;Ljava/lang/Integer;[Ljava/lang/String;Ljava/lang/Float;)V\n" +
- " // Stack: 3, Locals: 5\n" +
+ " // Method descriptor #10 (LX;Ljava/lang/Integer;[Ljava/lang/String;Ljava/lang/Float;)V\n" +
+ " // Stack: 3, Locals: 5\n" +
" X$1(X arg0, java.lang.Integer $anonymous0, java.lang.String... $anonymous1, java.lang.Float arg3);\n";
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X$1.class", "X$1", expectedOutput);
}
@@ -2372,8 +2372,8 @@ public class VarargsTest extends AbstractComparableTest {
"import java.util.List;\n" +
"public class Y {\r\n" +
" @SafeVarargs\n" +
- " public static <T> List<T> asList(T... a) {\n" +
- " return null;\n" +
+ " public static <T> List<T> asList(T... a) {\n" +
+ " return null;\n" +
" }\n" +
"}",
},
@@ -2409,8 +2409,8 @@ public class VarargsTest extends AbstractComparableTest {
"import java.util.List;\n" +
"public class X {\r\n" +
" @SafeVarargs\n" +
- " public static <T> List<T> asList(T... a) {\n" +
- " return null;\n" +
+ " public static <T> List<T> asList(T... a) {\n" +
+ " return null;\n" +
" }\n" +
" public void bar() {\n" +
" List<? extends Class<?>> classes = X.asList(String.class, Boolean.class);\n" +
@@ -2435,8 +2435,8 @@ public class VarargsTest extends AbstractComparableTest {
"import java.util.List;\n" +
"public class X {\r\n" +
" @SafeVarargs\n" +
- " public static <T> List<T> asList(T... a) {\n" +
- " return null;\n" +
+ " public static <T> List<T> asList(T... a) {\n" +
+ " return null;\n" +
" }\n" +
" public void bar() {\n" +
" List<List<String>> classes = X.asList(X.asList(\"Hello\", \"World\"));\n" +
@@ -2479,26 +2479,26 @@ public class VarargsTest extends AbstractComparableTest {
"}\n", // =================
},
this.complianceLevel < ClassFileConstants.JDK1_7 ?
- "----------\n" +
- "1. WARNING in X.java (at line 18)\n" +
- " new IteratorChain<Number>(null, null);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: A generic array of Collection<? extends Number> is created for a varargs parameter\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 18)\n" +
+ " new IteratorChain<Number>(null, null);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: A generic array of Collection<? extends Number> is created for a varargs parameter\n" +
"----------\n":
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " public IteratorChain(Collection<? extends T> a, Collection<? extends T> b, Collection<? extends T> ... collections) {\n" +
- " ^^^^^^^^^^^\n" +
- "Type safety: Potential heap pollution via varargs parameter collections\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 18)\n" +
- " new IteratorChain<Number>(null, null);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: A generic array of Collection<? extends Number> is created for a varargs parameter\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " public IteratorChain(Collection<? extends T> a, Collection<? extends T> b, Collection<? extends T> ... collections) {\n" +
+ " ^^^^^^^^^^^\n" +
+ "Type safety: Potential heap pollution via varargs parameter collections\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 18)\n" +
+ " new IteratorChain<Number>(null, null);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: A generic array of Collection<? extends Number> is created for a varargs parameter\n" +
"----------\n",
- null,
+ null,
true,
- options);
+ options);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=337799
public void test067() throws Exception {
@@ -2538,26 +2538,26 @@ public class VarargsTest extends AbstractComparableTest {
" public <T> List<T> asList(T ... t);\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public static <T> List<T> asList() { // Error, not varargs\n" +
- " ^^^^^^^^\n" +
- "@SafeVarargs annotation cannot be applied to fixed arity method asList\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " public <T> List<T> asList2(T ... a) { // error not static or final\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "@SafeVarargs annotation cannot be applied to non-final instance method asList2\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 23)\n" +
- " @SafeVarargs\n" +
- " ^^^^^^^^^^^^\n" +
- "The annotation @SafeVarargs is disallowed for this location\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 28)\n" +
- " public <T> List<T> asList(T ... t);\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "@SafeVarargs annotation cannot be applied to non-final instance method asList\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " public static <T> List<T> asList() { // Error, not varargs\n" +
+ " ^^^^^^^^\n" +
+ "@SafeVarargs annotation cannot be applied to fixed arity method asList\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " public <T> List<T> asList2(T ... a) { // error not static or final\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "@SafeVarargs annotation cannot be applied to non-final instance method asList2\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 23)\n" +
+ " @SafeVarargs\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The annotation @SafeVarargs is disallowed for this location\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 28)\n" +
+ " public <T> List<T> asList(T ... t);\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "@SafeVarargs annotation cannot be applied to non-final instance method asList\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=337799
@@ -2578,11 +2578,11 @@ public class VarargsTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public X() { // Error, not varargs\n" +
- " ^^^\n" +
- "@SafeVarargs annotation cannot be applied to fixed arity method X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " public X() { // Error, not varargs\n" +
+ " ^^^\n" +
+ "@SafeVarargs annotation cannot be applied to fixed arity method X\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=337795 (make sure there is no warning if vararg parameter is reifiable)
@@ -2607,11 +2607,11 @@ public class VarargsTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " public <T> List<T> asList(Zork t, String ... a) {\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " public <T> List<T> asList(Zork t, String ... a) {\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=337795 (make sure there is a warning if vararg parameter is not reifiable)
@@ -2636,26 +2636,26 @@ public class VarargsTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " public <T> X(T ... a) {\n" +
- " ^\n" +
- "Type safety: Potential heap pollution via varargs parameter a\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " public <T> X(int i, T ... a) {\n" +
- " ^\n" +
- "Type safety: Potential heap pollution via varargs parameter a\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 7)\n" +
- " public <T> List<T> asList(T ... a) {\n" +
- " ^\n" +
- "Type safety: Potential heap pollution via varargs parameter a\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 10)\n" +
- " public <T> List<T> asList(T t, T ... a) {\n" +
- " ^\n" +
- "Type safety: Potential heap pollution via varargs parameter a\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 3)\n" +
+ " public <T> X(T ... a) {\n" +
+ " ^\n" +
+ "Type safety: Potential heap pollution via varargs parameter a\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 5)\n" +
+ " public <T> X(int i, T ... a) {\n" +
+ " ^\n" +
+ "Type safety: Potential heap pollution via varargs parameter a\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 7)\n" +
+ " public <T> List<T> asList(T ... a) {\n" +
+ " ^\n" +
+ "Type safety: Potential heap pollution via varargs parameter a\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 10)\n" +
+ " public <T> List<T> asList(T t, T ... a) {\n" +
+ " ^\n" +
+ "Type safety: Potential heap pollution via varargs parameter a\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=337795
@@ -2684,16 +2684,16 @@ public class VarargsTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " public <T> List<T> asList(T ... a) {\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "@SafeVarargs annotation cannot be applied to non-final instance method asList\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " public <T> List<T> asList(T t, T ... a) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "@SafeVarargs annotation cannot be applied to non-final instance method asList\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " public <T> List<T> asList(T ... a) {\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "@SafeVarargs annotation cannot be applied to non-final instance method asList\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 14)\n" +
+ " public <T> List<T> asList(T t, T ... a) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^\n" +
+ "@SafeVarargs annotation cannot be applied to non-final instance method asList\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=337795
@@ -2720,16 +2720,16 @@ public class VarargsTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " public static <T> List<T> asList2(T ... a) {\n" +
- " ^\n" +
- "Type safety: Potential heap pollution via varargs parameter a\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 13)\n" +
- " classes = X.asList2(String.class, Boolean.class);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: A generic array of Class<? extends "+intersection("Object","Serializable","Comparable<?>")+"> is created for a varargs parameter\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 7)\n" +
+ " public static <T> List<T> asList2(T ... a) {\n" +
+ " ^\n" +
+ "Type safety: Potential heap pollution via varargs parameter a\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 13)\n" +
+ " classes = X.asList2(String.class, Boolean.class);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: A generic array of Class<? extends "+intersection("Object","Serializable","Comparable<?>")+"> is created for a varargs parameter\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=337795 (test effect of SuppressWarnings (should suppress at declaration site, but not at call site)
@@ -2757,11 +2757,11 @@ public class VarargsTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 14)\n" +
- " classes = X.asList2(String.class, Boolean.class);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: A generic array of Class<? extends "+intersection("Object","Serializable","Comparable<?>")+"> is created for a varargs parameter\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 14)\n" +
+ " classes = X.asList2(String.class, Boolean.class);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Type safety: A generic array of Class<? extends "+intersection("Object","Serializable","Comparable<?>")+"> is created for a varargs parameter\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=346042
@@ -2787,11 +2787,11 @@ public class VarargsTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in p2\\C.java (at line 6)\n" +
- " (new B()).foo(new B(), new B());\n" +
- " ^^^\n" +
- "The method foo(A...) of type B is not applicable as the formal varargs element type A is not accessible here\n" +
+ "----------\n" +
+ "1. ERROR in p2\\C.java (at line 6)\n" +
+ " (new B()).foo(new B(), new B());\n" +
+ " ^^^\n" +
+ "The method foo(A...) of type B is not applicable as the formal varargs element type A is not accessible here\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=346038
@@ -2811,7 +2811,7 @@ public class VarargsTest extends AbstractComparableTest {
},
"Done");
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383780
public void test070_tolerate() throws Exception {
if (this.complianceLevel < ClassFileConstants.JDK1_5) return;
@@ -2831,12 +2831,12 @@ public class VarargsTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " foo(1, 2, 3);\n" +
- " ^^^\n" +
- "The method foo(int[]) is ambiguous for the type X\n" +
- "----------\n",
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " foo(1, 2, 3);\n" +
+ " ^^^\n" +
+ "The method foo(int[]) is ambiguous for the type X\n" +
+ "----------\n",
null, true, options);
} else {
this.runConformTest(
@@ -2851,15 +2851,15 @@ public class VarargsTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "Done",
+ "Done",
null, true, null, options, null);
}
} finally {
System.setProperty("tolerateIllegalAmbiguousVarargsInvocation", "false");
}
-
+
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383780
public void test070_tolerate2() throws Exception {
if (this.complianceLevel < ClassFileConstants.JDK1_5) return;
@@ -2869,7 +2869,7 @@ public class VarargsTest extends AbstractComparableTest {
if (this.complianceLevel >= ClassFileConstants.JDK1_7) {
this.runNegativeTest(
false /* skipJavac */,
- this.complianceLevel == ClassFileConstants.JDK1_7 ?
+ this.complianceLevel == ClassFileConstants.JDK1_7 ?
JavacTestOptions.Excuse.JavacCompilesIncorrectSource : null,
new String[] {
"X.java",
@@ -2884,12 +2884,12 @@ public class VarargsTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " test(1);\n" +
- " ^^^^\n" +
- "The method test(int[]) is ambiguous for the type X\n" +
- "----------\n",
+ "----------\n" +
+ "1. ERROR in X.java (at line 10)\n" +
+ " test(1);\n" +
+ " ^^^^\n" +
+ "The method test(int[]) is ambiguous for the type X\n" +
+ "----------\n",
null, true, options);
} else {
this.runConformTest(
@@ -2906,13 +2906,13 @@ public class VarargsTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "[1]",
+ "[1]",
null, true, null, options, null);
}
} finally {
System.setProperty("tolerateIllegalAmbiguousVarargsInvocation", "false");
}
-
+
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=346038
public void test070a() throws Exception {
@@ -2950,12 +2950,12 @@ public class VarargsTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " foo(1, 2, 3);\n" +
- " ^^^\n" +
- "The method foo(int[]) is ambiguous for the type X\n" +
- "----------\n",
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " foo(1, 2, 3);\n" +
+ " ^^^\n" +
+ "The method foo(int[]) is ambiguous for the type X\n" +
+ "----------\n",
null, true, options);
} else {
this.runConformTest(
@@ -2970,7 +2970,7 @@ public class VarargsTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "Done",
+ "Done",
null, true, null, options, null);
}
} finally {
@@ -2989,11 +2989,11 @@ public class VarargsTest extends AbstractComparableTest {
" public static void main(String[] args) {\n" +
" foo(1, 2, 3); // foo NOT flagged ambiguous\n" +
" }\n" +
- "}\n"
+ "}\n"
},
"");
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383780
public void test070b_tolerate() throws Exception {
if (this.complianceLevel < ClassFileConstants.JDK1_5) return;
@@ -3005,7 +3005,7 @@ public class VarargsTest extends AbstractComparableTest {
" public static void main(String[] args) {\n" +
" foo(1, 2, 3); // foo NOT flagged ambiguous\n" +
" }\n" +
- "}\n"
+ "}\n"
};
try {
System.setProperty("tolerateIllegalAmbiguousVarargsInvocation", "true");
@@ -3016,18 +3016,18 @@ public class VarargsTest extends AbstractComparableTest {
} else {
this.runNegativeTest(
src,
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " foo(1, 2, 3); // foo NOT flagged ambiguous\n" +
- " ^^^\n" +
- "The method foo(int[]) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " foo(1, 2, 3); // foo NOT flagged ambiguous\n" +
+ " ^^^\n" +
+ "The method foo(int[]) is ambiguous for the type X\n" +
"----------\n");
}
} finally {
System.setProperty("tolerateIllegalAmbiguousVarargsInvocation", "false");
}
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=346038
public void test070c() { // check behaviour of Scope.mostSpecificMethodBinding()
this.runNegativeTest(
@@ -3043,21 +3043,21 @@ public class VarargsTest extends AbstractComparableTest {
" public static void count(int i, int ... values) {}\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " count(1);\n" +
- " ^^^^^\n" +
- "The method count(int[]) is ambiguous for the type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " count(1, 1);\n" +
- " ^^^^^\n" +
- "The method count(int[]) is ambiguous for the type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " count(1, 1, 1);\n" +
- " ^^^^^\n" +
- "The method count(int[]) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " count(1);\n" +
+ " ^^^^^\n" +
+ "The method count(int[]) is ambiguous for the type X\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " count(1, 1);\n" +
+ " ^^^^^\n" +
+ "The method count(int[]) is ambiguous for the type X\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 5)\n" +
+ " count(1, 1, 1);\n" +
+ " ^^^^^\n" +
+ "The method count(int[]) is ambiguous for the type X\n" +
"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=346038
@@ -3115,7 +3115,7 @@ public class VarargsTest extends AbstractComparableTest {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=383780
public void test071_tolerate() throws Exception {
if (this.complianceLevel < ClassFileConstants.JDK1_5) return;
- String[] src =
+ String[] src =
new String[] {
"X.java",
"public class X implements IClass{\n" +
@@ -3143,11 +3143,11 @@ public class VarargsTest extends AbstractComparableTest {
} else {
this.runNegativeTest(
src,
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " X t2 = new X(c, t); // incorrectly flagged ambiguous\n" +
- " ^^^^^^^^^^^\n" +
- "The constructor X(IClass, X, IType[]) is ambiguous\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 11)\n" +
+ " X t2 = new X(c, t); // incorrectly flagged ambiguous\n" +
+ " ^^^^^^^^^^^\n" +
+ "The constructor X(IClass, X, IType[]) is ambiguous\n" +
"----------\n");
}
} finally {
@@ -3159,17 +3159,17 @@ public class VarargsTest extends AbstractComparableTest {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " private class Z {}\n" +
- " public void foo() {\n" +
- " Z[] zs = null;\n" +
- " Y.bar(zs, new Z());\n" +
- " }\n" +
- " public static void main(String[] args) {}\n" +
+ "public class X {\n" +
+ " private class Z {}\n" +
+ " public void foo() {\n" +
+ " Z[] zs = null;\n" +
+ " Y.bar(zs, new Z());\n" +
+ " }\n" +
+ " public static void main(String[] args) {}\n" +
"}",
"Y.java",
- "public class Y {\n" +
- " public native static <T> void bar(T[] t, T t1, T... t2);\n" +
+ "public class Y {\n" +
+ " public native static <T> void bar(T[] t, T t1, T... t2);\n" +
"}"
},
"");
@@ -3179,25 +3179,25 @@ public class VarargsTest extends AbstractComparableTest {
this.runConformTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public static final String CONSTANT = \"\";\n" +
- " private static class A {\n" +
- " A(String s, String s2, String s3, A... a) {}\n" +
- " }\n" +
- " private static class B extends A {\n" +
- " B(String s, String s2) {\n" +
- " super(s, s2, CONSTANT);\n" +
- " }\n" +
- " }\n" +
- " private static void foo(Object o, A ... a) {\n" +
- " }\n" +
- " private static B bar() {\n" +
- " return null;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " Object o = null;\n" +
- " foo(o, bar(), bar());\n" +
- " }\n" +
+ "public class X {\n" +
+ " public static final String CONSTANT = \"\";\n" +
+ " private static class A {\n" +
+ " A(String s, String s2, String s3, A... a) {}\n" +
+ " }\n" +
+ " private static class B extends A {\n" +
+ " B(String s, String s2) {\n" +
+ " super(s, s2, CONSTANT);\n" +
+ " }\n" +
+ " }\n" +
+ " private static void foo(Object o, A ... a) {\n" +
+ " }\n" +
+ " private static B bar() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " Object o = null;\n" +
+ " foo(o, bar(), bar());\n" +
+ " }\n" +
"}"
},
"");
@@ -3222,18 +3222,18 @@ public class VarargsTest extends AbstractComparableTest {
" }\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in p2\\C.java (at line 5)\n" +
- " new B(new B(), new B());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The constructor B(A...) of type B is not applicable as the formal varargs element type A is not accessible here\n" +
+ "----------\n" +
+ "1. ERROR in p2\\C.java (at line 5)\n" +
+ " new B(new B(), new B());\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The constructor B(A...) of type B is not applicable as the formal varargs element type A is not accessible here\n" +
"----------\n");
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=382469
public void testBug382469() throws Exception {
if (this.complianceLevel < ClassFileConstants.JDK1_5) return;
- String[] src =
+ String[] src =
new String[] {
"X.java",
"public class X {\n" +
@@ -3257,27 +3257,27 @@ public class VarargsTest extends AbstractComparableTest {
} else {
this.runNegativeTest(
src,
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " private static void bar(int intValue, Object... objs) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The method bar(int, Object...) from the type X is never used locally\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " bar(5);\n" +
- " ^^^\n" +
- "The method bar(Object[]) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " private static void bar(int intValue, Object... objs) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "The method bar(int, Object...) from the type X is never used locally\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 9)\n" +
+ " bar(5);\n" +
+ " ^^^\n" +
+ "The method bar(Object[]) is ambiguous for the type X\n" +
"----------\n");
}
} finally {
System.setProperty("tolerateIllegalAmbiguousVarargsInvocation", "false");
}
}
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=386361
public void testBug386361() throws Exception {
if (this.complianceLevel < ClassFileConstants.JDK1_5) return;
- String[] src =
+ String[] src =
new String[] {
"X.java",
"public class X {\n" +
@@ -3301,11 +3301,11 @@ public class VarargsTest extends AbstractComparableTest {
} else {
this.runNegativeTest(
src,
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " test(1,\"test\");\n" +
- " ^^^^\n" +
- "The method test(int, Object[]) is ambiguous for the type X\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 9)\n" +
+ " test(1,\"test\");\n" +
+ " ^^^^\n" +
+ "The method test(int, Object[]) is ambiguous for the type X\n" +
"----------\n");
}
} finally {
@@ -3323,7 +3323,7 @@ public class VarargsTest extends AbstractComparableTest {
" new B().foo(null, null);\n" +
" }\n" +
"}\n",
-
+
"p/B.java",
"package p;\n" +
"class A {\n" +
@@ -3333,11 +3333,11 @@ public class VarargsTest extends AbstractComparableTest {
" public void foo(Object... o) { System.out.println(\"MB:O\"); }\n" +
"}\n",
},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " new B().foo(null, null);\n" +
- " ^^^\n" +
- "The method foo(A...) of type B is not applicable as the formal varargs element type A is not accessible here\n" +
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " new B().foo(null, null);\n" +
+ " ^^^\n" +
+ "The method foo(A...) of type B is not applicable as the formal varargs element type A is not accessible here\n" +
"----------\n"); // check and adjust,
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=436474, [codegen]Problem with varargs and List.toString
@@ -3345,17 +3345,17 @@ public class VarargsTest extends AbstractComparableTest {
runConformTest(
new String[] {
"Scratch.java",
- "import java.util.Arrays;\n" +
- "import java.util.List;\n" +
- "public class Scratch {\n" +
- " public static void vararg(String... strs) {\n" +
- " System.out.println(strs[0]);\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " List<String> l = Arrays.asList(\"a\");\n" +
- " vararg(l.toArray(new String[0]));\n" +
- " }\n" +
+ "import java.util.Arrays;\n" +
+ "import java.util.List;\n" +
+ "public class Scratch {\n" +
+ " public static void vararg(String... strs) {\n" +
+ " System.out.println(strs[0]);\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " List<String> l = Arrays.asList(\"a\");\n" +
+ " vararg(l.toArray(new String[0]));\n" +
+ " }\n" +
"}",
},
"a");
@@ -3586,18 +3586,18 @@ public class VarargsTest extends AbstractComparableTest {
runConformTest(
new String[] {
"TestVarargs.java",
- "import java.util.*;\n" +
- "public class TestVarargs {\n" +
- " public static void main(String[] args) {\n" +
- " bar(new Class<?>[]{});\n" +
- " foo(new Class<?>[]{});\n" +
- " }\n" +
- " public static Object foo(Class<?>[] sig) {\n" +
- " return Arrays.asList(Arrays.copyOfRange(sig, 0, sig.length));\n" +
- " }\n" +
- " public static List<Class<?>> bar(Class<?>[] sig) {\n" +
- " return Arrays.asList(Arrays.copyOfRange(sig, 0, sig.length));\n" +
- " }\n" +
+ "import java.util.*;\n" +
+ "public class TestVarargs {\n" +
+ " public static void main(String[] args) {\n" +
+ " bar(new Class<?>[]{});\n" +
+ " foo(new Class<?>[]{});\n" +
+ " }\n" +
+ " public static Object foo(Class<?>[] sig) {\n" +
+ " return Arrays.asList(Arrays.copyOfRange(sig, 0, sig.length));\n" +
+ " }\n" +
+ " public static List<Class<?>> bar(Class<?>[] sig) {\n" +
+ " return Arrays.asList(Arrays.copyOfRange(sig, 0, sig.length));\n" +
+ " }\n" +
"}"
},
"");
@@ -3631,11 +3631,11 @@ public class VarargsTest extends AbstractComparableTest {
" }\n"+
"}\n"
},
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " private <T> Y<T> foo(T ... a) {\n" +
- " ^\n" +
- "Type safety: Potential heap pollution via varargs parameter a\n" +
+ "----------\n" +
+ "1. WARNING in X.java (at line 4)\n" +
+ " private <T> Y<T> foo(T ... a) {\n" +
+ " ^\n" +
+ "Type safety: Potential heap pollution via varargs parameter a\n" +
"----------\n");
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/XLargeTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/XLargeTest.java
index 3d8fcadfd..045b30455 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/XLargeTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/XLargeTest.java
@@ -50,12 +50,12 @@ public void test368435() {
" int i = 0;\n" +
" if (System.currentTimeMillis() > 17000L) {\n" +
" System.out.println(i++);\n");
-
+
for (int i = 0; i < 5000; i++) {
sourceCode.append("\t\t System.out.println(\"xyz\");\n");
}
sourceCode.append("}\n}\n}\n");
-
+
this.runConformTest(
new String[] {
"X.java",
@@ -81,12 +81,12 @@ public void test368435b() {
" int i = 0;\n" +
" if (System.currentTimeMillis() > 17000L) {\n" +
" System.out.println(i++);\n");
-
+
for (int i = 0; i < 5000; i++) {
sourceCode.append("\t\t System.out.println(\"xyz\");\n");
}
sourceCode.append("}\n}\n}\n");
-
+
this.runConformTest(
new String[] {
"X.java",
@@ -112,12 +112,12 @@ public void test368435c() {
" int i = 0;\n" +
" if (System.currentTimeMillis() > 17000L) {\n" +
" System.out.println(i++);\n");
-
+
for (int i = 0; i < 5000; i++) {
sourceCode.append("\t\t System.out.println(\"xyz\");\n");
}
sourceCode.append("}\n}\n}\n");
-
+
this.runConformTest(
new String[] {
"X.java",
@@ -11959,7 +11959,7 @@ public void test0016() {
StringBuffer buffer = new StringBuffer();
buffer
.append("0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119")
- .append("1201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022")
+ .append("1201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022")
.append("0320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528")
.append("6287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369")
.append("3703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524")
@@ -11997,2537 +11997,2537 @@ public void test0016() {
String[] src = {
"X.java",
- "public enum X {\n" +
- " X0(0),\n" +
- " X1(1),\n" +
- " X2(2),\n" +
- " X3(3),\n" +
- " X4(4),\n" +
- " X5(5),\n" +
- " X6(6),\n" +
- " X7(7),\n" +
- " X8(8),\n" +
- " X9(9),\n" +
- " X10(10),\n" +
- " X11(11),\n" +
- " X12(12),\n" +
- " X13(13),\n" +
- " X14(14),\n" +
- " X15(15),\n" +
- " X16(16),\n" +
- " X17(17),\n" +
- " X18(18),\n" +
- " X19(19),\n" +
- " X20(20),\n" +
- " X21(21),\n" +
- " X22(22),\n" +
- " X23(23),\n" +
- " X24(24),\n" +
- " X25(25),\n" +
- " X26(26),\n" +
- " X27(27),\n" +
- " X28(28),\n" +
- " X29(29),\n" +
- " X30(30),\n" +
- " X31(31),\n" +
- " X32(32),\n" +
- " X33(33),\n" +
- " X34(34),\n" +
- " X35(35),\n" +
- " X36(36),\n" +
- " X37(37),\n" +
- " X38(38),\n" +
- " X39(39),\n" +
- " X40(40),\n" +
- " X41(41),\n" +
- " X42(42),\n" +
- " X43(43),\n" +
- " X44(44),\n" +
- " X45(45),\n" +
- " X46(46),\n" +
- " X47(47),\n" +
- " X48(48),\n" +
- " X49(49),\n" +
- " X50(50),\n" +
- " X51(51),\n" +
- " X52(52),\n" +
- " X53(53),\n" +
- " X54(54),\n" +
- " X55(55),\n" +
- " X56(56),\n" +
- " X57(57),\n" +
- " X58(58),\n" +
- " X59(59),\n" +
- " X60(60),\n" +
- " X61(61),\n" +
- " X62(62),\n" +
- " X63(63),\n" +
- " X64(64),\n" +
- " X65(65),\n" +
- " X66(66),\n" +
- " X67(67),\n" +
- " X68(68),\n" +
- " X69(69),\n" +
- " X70(70),\n" +
- " X71(71),\n" +
- " X72(72),\n" +
- " X73(73),\n" +
- " X74(74),\n" +
- " X75(75),\n" +
- " X76(76),\n" +
- " X77(77),\n" +
- " X78(78),\n" +
- " X79(79),\n" +
- " X80(80),\n" +
- " X81(81),\n" +
- " X82(82),\n" +
- " X83(83),\n" +
- " X84(84),\n" +
- " X85(85),\n" +
- " X86(86),\n" +
- " X87(87),\n" +
- " X88(88),\n" +
- " X89(89),\n" +
- " X90(90),\n" +
- " X91(91),\n" +
- " X92(92),\n" +
- " X93(93),\n" +
- " X94(94),\n" +
- " X95(95),\n" +
- " X96(96),\n" +
- " X97(97),\n" +
- " X98(98),\n" +
- " X99(99),\n" +
- " X100(100),\n" +
- " X101(101),\n" +
- " X102(102),\n" +
- " X103(103),\n" +
- " X104(104),\n" +
- " X105(105),\n" +
- " X106(106),\n" +
- " X107(107),\n" +
- " X108(108),\n" +
- " X109(109),\n" +
- " X110(110),\n" +
- " X111(111),\n" +
- " X112(112),\n" +
- " X113(113),\n" +
- " X114(114),\n" +
- " X115(115),\n" +
- " X116(116),\n" +
- " X117(117),\n" +
- " X118(118),\n" +
- " X119(119),\n" +
- " X120(120),\n" +
- " X121(121),\n" +
- " X122(122),\n" +
- " X123(123),\n" +
- " X124(124),\n" +
- " X125(125),\n" +
- " X126(126),\n" +
- " X127(127),\n" +
- " X128(128),\n" +
- " X129(129),\n" +
- " X130(130),\n" +
- " X131(131),\n" +
- " X132(132),\n" +
- " X133(133),\n" +
- " X134(134),\n" +
- " X135(135),\n" +
- " X136(136),\n" +
- " X137(137),\n" +
- " X138(138),\n" +
- " X139(139),\n" +
- " X140(140),\n" +
- " X141(141),\n" +
- " X142(142),\n" +
- " X143(143),\n" +
- " X144(144),\n" +
- " X145(145),\n" +
- " X146(146),\n" +
- " X147(147),\n" +
- " X148(148),\n" +
- " X149(149),\n" +
- " X150(150),\n" +
- " X151(151),\n" +
- " X152(152),\n" +
- " X153(153),\n" +
- " X154(154),\n" +
- " X155(155),\n" +
- " X156(156),\n" +
- " X157(157),\n" +
- " X158(158),\n" +
- " X159(159),\n" +
- " X160(160),\n" +
- " X161(161),\n" +
- " X162(162),\n" +
- " X163(163),\n" +
- " X164(164),\n" +
- " X165(165),\n" +
- " X166(166),\n" +
- " X167(167),\n" +
- " X168(168),\n" +
- " X169(169),\n" +
- " X170(170),\n" +
- " X171(171),\n" +
- " X172(172),\n" +
- " X173(173),\n" +
- " X174(174),\n" +
- " X175(175),\n" +
- " X176(176),\n" +
- " X177(177),\n" +
- " X178(178),\n" +
- " X179(179),\n" +
- " X180(180),\n" +
- " X181(181),\n" +
- " X182(182),\n" +
- " X183(183),\n" +
- " X184(184),\n" +
- " X185(185),\n" +
- " X186(186),\n" +
- " X187(187),\n" +
- " X188(188),\n" +
- " X189(189),\n" +
- " X190(190),\n" +
- " X191(191),\n" +
- " X192(192),\n" +
- " X193(193),\n" +
- " X194(194),\n" +
- " X195(195),\n" +
- " X196(196),\n" +
- " X197(197),\n" +
- " X198(198),\n" +
- " X199(199),\n" +
- " X200(200),\n" +
- " X201(201),\n" +
- " X202(202),\n" +
- " X203(203),\n" +
- " X204(204),\n" +
- " X205(205),\n" +
- " X206(206),\n" +
- " X207(207),\n" +
- " X208(208),\n" +
- " X209(209),\n" +
- " X210(210),\n" +
- " X211(211),\n" +
- " X212(212),\n" +
- " X213(213),\n" +
- " X214(214),\n" +
- " X215(215),\n" +
- " X216(216),\n" +
- " X217(217),\n" +
- " X218(218),\n" +
- " X219(219),\n" +
- " X220(220),\n" +
- " X221(221),\n" +
- " X222(222),\n" +
- " X223(223),\n" +
- " X224(224),\n" +
- " X225(225),\n" +
- " X226(226),\n" +
- " X227(227),\n" +
- " X228(228),\n" +
- " X229(229),\n" +
- " X230(230),\n" +
- " X231(231),\n" +
- " X232(232),\n" +
- " X233(233),\n" +
- " X234(234),\n" +
- " X235(235),\n" +
- " X236(236),\n" +
- " X237(237),\n" +
- " X238(238),\n" +
- " X239(239),\n" +
- " X240(240),\n" +
- " X241(241),\n" +
- " X242(242),\n" +
- " X243(243),\n" +
- " X244(244),\n" +
- " X245(245),\n" +
- " X246(246),\n" +
- " X247(247),\n" +
- " X248(248),\n" +
- " X249(249),\n" +
- " X250(250),\n" +
- " X251(251),\n" +
- " X252(252),\n" +
- " X253(253),\n" +
- " X254(254),\n" +
- " X255(255),\n" +
- " X256(256),\n" +
- " X257(257),\n" +
- " X258(258),\n" +
- " X259(259),\n" +
- " X260(260),\n" +
- " X261(261),\n" +
- " X262(262),\n" +
- " X263(263),\n" +
- " X264(264),\n" +
- " X265(265),\n" +
- " X266(266),\n" +
- " X267(267),\n" +
- " X268(268),\n" +
- " X269(269),\n" +
- " X270(270),\n" +
- " X271(271),\n" +
- " X272(272),\n" +
- " X273(273),\n" +
- " X274(274),\n" +
- " X275(275),\n" +
- " X276(276),\n" +
- " X277(277),\n" +
- " X278(278),\n" +
- " X279(279),\n" +
- " X280(280),\n" +
- " X281(281),\n" +
- " X282(282),\n" +
- " X283(283),\n" +
- " X284(284),\n" +
- " X285(285),\n" +
- " X286(286),\n" +
- " X287(287),\n" +
- " X288(288),\n" +
- " X289(289),\n" +
- " X290(290),\n" +
- " X291(291),\n" +
- " X292(292),\n" +
- " X293(293),\n" +
- " X294(294),\n" +
- " X295(295),\n" +
- " X296(296),\n" +
- " X297(297),\n" +
- " X298(298),\n" +
- " X299(299),\n" +
- " X300(300),\n" +
- " X301(301),\n" +
- " X302(302),\n" +
- " X303(303),\n" +
- " X304(304),\n" +
- " X305(305),\n" +
- " X306(306),\n" +
- " X307(307),\n" +
- " X308(308),\n" +
- " X309(309),\n" +
- " X310(310),\n" +
- " X311(311),\n" +
- " X312(312),\n" +
- " X313(313),\n" +
- " X314(314),\n" +
- " X315(315),\n" +
- " X316(316),\n" +
- " X317(317),\n" +
- " X318(318),\n" +
- " X319(319),\n" +
- " X320(320),\n" +
- " X321(321),\n" +
- " X322(322),\n" +
- " X323(323),\n" +
- " X324(324),\n" +
- " X325(325),\n" +
- " X326(326),\n" +
- " X327(327),\n" +
- " X328(328),\n" +
- " X329(329),\n" +
- " X330(330),\n" +
- " X331(331),\n" +
- " X332(332),\n" +
- " X333(333),\n" +
- " X334(334),\n" +
- " X335(335),\n" +
- " X336(336),\n" +
- " X337(337),\n" +
- " X338(338),\n" +
- " X339(339),\n" +
- " X340(340),\n" +
- " X341(341),\n" +
- " X342(342),\n" +
- " X343(343),\n" +
- " X344(344),\n" +
- " X345(345),\n" +
- " X346(346),\n" +
- " X347(347),\n" +
- " X348(348),\n" +
- " X349(349),\n" +
- " X350(350),\n" +
- " X351(351),\n" +
- " X352(352),\n" +
- " X353(353),\n" +
- " X354(354),\n" +
- " X355(355),\n" +
- " X356(356),\n" +
- " X357(357),\n" +
- " X358(358),\n" +
- " X359(359),\n" +
- " X360(360),\n" +
- " X361(361),\n" +
- " X362(362),\n" +
- " X363(363),\n" +
- " X364(364),\n" +
- " X365(365),\n" +
- " X366(366),\n" +
- " X367(367),\n" +
- " X368(368),\n" +
- " X369(369),\n" +
- " X370(370),\n" +
- " X371(371),\n" +
- " X372(372),\n" +
- " X373(373),\n" +
- " X374(374),\n" +
- " X375(375),\n" +
- " X376(376),\n" +
- " X377(377),\n" +
- " X378(378),\n" +
- " X379(379),\n" +
- " X380(380),\n" +
- " X381(381),\n" +
- " X382(382),\n" +
- " X383(383),\n" +
- " X384(384),\n" +
- " X385(385),\n" +
- " X386(386),\n" +
- " X387(387),\n" +
- " X388(388),\n" +
- " X389(389),\n" +
- " X390(390),\n" +
- " X391(391),\n" +
- " X392(392),\n" +
- " X393(393),\n" +
- " X394(394),\n" +
- " X395(395),\n" +
- " X396(396),\n" +
- " X397(397),\n" +
- " X398(398),\n" +
- " X399(399),\n" +
- " X400(400),\n" +
- " X401(401),\n" +
- " X402(402),\n" +
- " X403(403),\n" +
- " X404(404),\n" +
- " X405(405),\n" +
- " X406(406),\n" +
- " X407(407),\n" +
- " X408(408),\n" +
- " X409(409),\n" +
- " X410(410),\n" +
- " X411(411),\n" +
- " X412(412),\n" +
- " X413(413),\n" +
- " X414(414),\n" +
- " X415(415),\n" +
- " X416(416),\n" +
- " X417(417),\n" +
- " X418(418),\n" +
- " X419(419),\n" +
- " X420(420),\n" +
- " X421(421),\n" +
- " X422(422),\n" +
- " X423(423),\n" +
- " X424(424),\n" +
- " X425(425),\n" +
- " X426(426),\n" +
- " X427(427),\n" +
- " X428(428),\n" +
- " X429(429),\n" +
- " X430(430),\n" +
- " X431(431),\n" +
- " X432(432),\n" +
- " X433(433),\n" +
- " X434(434),\n" +
- " X435(435),\n" +
- " X436(436),\n" +
- " X437(437),\n" +
- " X438(438),\n" +
- " X439(439),\n" +
- " X440(440),\n" +
- " X441(441),\n" +
- " X442(442),\n" +
- " X443(443),\n" +
- " X444(444),\n" +
- " X445(445),\n" +
- " X446(446),\n" +
- " X447(447),\n" +
- " X448(448),\n" +
- " X449(449),\n" +
- " X450(450),\n" +
- " X451(451),\n" +
- " X452(452),\n" +
- " X453(453),\n" +
- " X454(454),\n" +
- " X455(455),\n" +
- " X456(456),\n" +
- " X457(457),\n" +
- " X458(458),\n" +
- " X459(459),\n" +
- " X460(460),\n" +
- " X461(461),\n" +
- " X462(462),\n" +
- " X463(463),\n" +
- " X464(464),\n" +
- " X465(465),\n" +
- " X466(466),\n" +
- " X467(467),\n" +
- " X468(468),\n" +
- " X469(469),\n" +
- " X470(470),\n" +
- " X471(471),\n" +
- " X472(472),\n" +
- " X473(473),\n" +
- " X474(474),\n" +
- " X475(475),\n" +
- " X476(476),\n" +
- " X477(477),\n" +
- " X478(478),\n" +
- " X479(479),\n" +
- " X480(480),\n" +
- " X481(481),\n" +
- " X482(482),\n" +
- " X483(483),\n" +
- " X484(484),\n" +
- " X485(485),\n" +
- " X486(486),\n" +
- " X487(487),\n" +
- " X488(488),\n" +
- " X489(489),\n" +
- " X490(490),\n" +
- " X491(491),\n" +
- " X492(492),\n" +
- " X493(493),\n" +
- " X494(494),\n" +
- " X495(495),\n" +
- " X496(496),\n" +
- " X497(497),\n" +
- " X498(498),\n" +
- " X499(499),\n" +
- " X500(500),\n" +
- " X501(501),\n" +
- " X502(502),\n" +
- " X503(503),\n" +
- " X504(504),\n" +
- " X505(505),\n" +
- " X506(506),\n" +
- " X507(507),\n" +
- " X508(508),\n" +
- " X509(509),\n" +
- " X510(510),\n" +
- " X511(511),\n" +
- " X512(512),\n" +
- " X513(513),\n" +
- " X514(514),\n" +
- " X515(515),\n" +
- " X516(516),\n" +
- " X517(517),\n" +
- " X518(518),\n" +
- " X519(519),\n" +
- " X520(520),\n" +
- " X521(521),\n" +
- " X522(522),\n" +
- " X523(523),\n" +
- " X524(524),\n" +
- " X525(525),\n" +
- " X526(526),\n" +
- " X527(527),\n" +
- " X528(528),\n" +
- " X529(529),\n" +
- " X530(530),\n" +
- " X531(531),\n" +
- " X532(532),\n" +
- " X533(533),\n" +
- " X534(534),\n" +
- " X535(535),\n" +
- " X536(536),\n" +
- " X537(537),\n" +
- " X538(538),\n" +
- " X539(539),\n" +
- " X540(540),\n" +
- " X541(541),\n" +
- " X542(542),\n" +
- " X543(543),\n" +
- " X544(544),\n" +
- " X545(545),\n" +
- " X546(546),\n" +
- " X547(547),\n" +
- " X548(548),\n" +
- " X549(549),\n" +
- " X550(550),\n" +
- " X551(551),\n" +
- " X552(552),\n" +
- " X553(553),\n" +
- " X554(554),\n" +
- " X555(555),\n" +
- " X556(556),\n" +
- " X557(557),\n" +
- " X558(558),\n" +
- " X559(559),\n" +
- " X560(560),\n" +
- " X561(561),\n" +
- " X562(562),\n" +
- " X563(563),\n" +
- " X564(564),\n" +
- " X565(565),\n" +
- " X566(566),\n" +
- " X567(567),\n" +
- " X568(568),\n" +
- " X569(569),\n" +
- " X570(570),\n" +
- " X571(571),\n" +
- " X572(572),\n" +
- " X573(573),\n" +
- " X574(574),\n" +
- " X575(575),\n" +
- " X576(576),\n" +
- " X577(577),\n" +
- " X578(578),\n" +
- " X579(579),\n" +
- " X580(580),\n" +
- " X581(581),\n" +
- " X582(582),\n" +
- " X583(583),\n" +
- " X584(584),\n" +
- " X585(585),\n" +
- " X586(586),\n" +
- " X587(587),\n" +
- " X588(588),\n" +
- " X589(589),\n" +
- " X590(590),\n" +
- " X591(591),\n" +
- " X592(592),\n" +
- " X593(593),\n" +
- " X594(594),\n" +
- " X595(595),\n" +
- " X596(596),\n" +
- " X597(597),\n" +
- " X598(598),\n" +
- " X599(599),\n" +
- " X600(600),\n" +
- " X601(601),\n" +
- " X602(602),\n" +
- " X603(603),\n" +
- " X604(604),\n" +
- " X605(605),\n" +
- " X606(606),\n" +
- " X607(607),\n" +
- " X608(608),\n" +
- " X609(609),\n" +
- " X610(610),\n" +
- " X611(611),\n" +
- " X612(612),\n" +
- " X613(613),\n" +
- " X614(614),\n" +
- " X615(615),\n" +
- " X616(616),\n" +
- " X617(617),\n" +
- " X618(618),\n" +
- " X619(619),\n" +
- " X620(620),\n" +
- " X621(621),\n" +
- " X622(622),\n" +
- " X623(623),\n" +
- " X624(624),\n" +
- " X625(625),\n" +
- " X626(626),\n" +
- " X627(627),\n" +
- " X628(628),\n" +
- " X629(629),\n" +
- " X630(630),\n" +
- " X631(631),\n" +
- " X632(632),\n" +
- " X633(633),\n" +
- " X634(634),\n" +
- " X635(635),\n" +
- " X636(636),\n" +
- " X637(637),\n" +
- " X638(638),\n" +
- " X639(639),\n" +
- " X640(640),\n" +
- " X641(641),\n" +
- " X642(642),\n" +
- " X643(643),\n" +
- " X644(644),\n" +
- " X645(645),\n" +
- " X646(646),\n" +
- " X647(647),\n" +
- " X648(648),\n" +
- " X649(649),\n" +
- " X650(650),\n" +
- " X651(651),\n" +
- " X652(652),\n" +
- " X653(653),\n" +
- " X654(654),\n" +
- " X655(655),\n" +
- " X656(656),\n" +
- " X657(657),\n" +
- " X658(658),\n" +
- " X659(659),\n" +
- " X660(660),\n" +
- " X661(661),\n" +
- " X662(662),\n" +
- " X663(663),\n" +
- " X664(664),\n" +
- " X665(665),\n" +
- " X666(666),\n" +
- " X667(667),\n" +
- " X668(668),\n" +
- " X669(669),\n" +
- " X670(670),\n" +
- " X671(671),\n" +
- " X672(672),\n" +
- " X673(673),\n" +
- " X674(674),\n" +
- " X675(675),\n" +
- " X676(676),\n" +
- " X677(677),\n" +
- " X678(678),\n" +
- " X679(679),\n" +
- " X680(680),\n" +
- " X681(681),\n" +
- " X682(682),\n" +
- " X683(683),\n" +
- " X684(684),\n" +
- " X685(685),\n" +
- " X686(686),\n" +
- " X687(687),\n" +
- " X688(688),\n" +
- " X689(689),\n" +
- " X690(690),\n" +
- " X691(691),\n" +
- " X692(692),\n" +
- " X693(693),\n" +
- " X694(694),\n" +
- " X695(695),\n" +
- " X696(696),\n" +
- " X697(697),\n" +
- " X698(698),\n" +
- " X699(699),\n" +
- " X700(700),\n" +
- " X701(701),\n" +
- " X702(702),\n" +
- " X703(703),\n" +
- " X704(704),\n" +
- " X705(705),\n" +
- " X706(706),\n" +
- " X707(707),\n" +
- " X708(708),\n" +
- " X709(709),\n" +
- " X710(710),\n" +
- " X711(711),\n" +
- " X712(712),\n" +
- " X713(713),\n" +
- " X714(714),\n" +
- " X715(715),\n" +
- " X716(716),\n" +
- " X717(717),\n" +
- " X718(718),\n" +
- " X719(719),\n" +
- " X720(720),\n" +
- " X721(721),\n" +
- " X722(722),\n" +
- " X723(723),\n" +
- " X724(724),\n" +
- " X725(725),\n" +
- " X726(726),\n" +
- " X727(727),\n" +
- " X728(728),\n" +
- " X729(729),\n" +
- " X730(730),\n" +
- " X731(731),\n" +
- " X732(732),\n" +
- " X733(733),\n" +
- " X734(734),\n" +
- " X735(735),\n" +
- " X736(736),\n" +
- " X737(737),\n" +
- " X738(738),\n" +
- " X739(739),\n" +
- " X740(740),\n" +
- " X741(741),\n" +
- " X742(742),\n" +
- " X743(743),\n" +
- " X744(744),\n" +
- " X745(745),\n" +
- " X746(746),\n" +
- " X747(747),\n" +
- " X748(748),\n" +
- " X749(749),\n" +
- " X750(750),\n" +
- " X751(751),\n" +
- " X752(752),\n" +
- " X753(753),\n" +
- " X754(754),\n" +
- " X755(755),\n" +
- " X756(756),\n" +
- " X757(757),\n" +
- " X758(758),\n" +
- " X759(759),\n" +
- " X760(760),\n" +
- " X761(761),\n" +
- " X762(762),\n" +
- " X763(763),\n" +
- " X764(764),\n" +
- " X765(765),\n" +
- " X766(766),\n" +
- " X767(767),\n" +
- " X768(768),\n" +
- " X769(769),\n" +
- " X770(770),\n" +
- " X771(771),\n" +
- " X772(772),\n" +
- " X773(773),\n" +
- " X774(774),\n" +
- " X775(775),\n" +
- " X776(776),\n" +
- " X777(777),\n" +
- " X778(778),\n" +
- " X779(779),\n" +
- " X780(780),\n" +
- " X781(781),\n" +
- " X782(782),\n" +
- " X783(783),\n" +
- " X784(784),\n" +
- " X785(785),\n" +
- " X786(786),\n" +
- " X787(787),\n" +
- " X788(788),\n" +
- " X789(789),\n" +
- " X790(790),\n" +
- " X791(791),\n" +
- " X792(792),\n" +
- " X793(793),\n" +
- " X794(794),\n" +
- " X795(795),\n" +
- " X796(796),\n" +
- " X797(797),\n" +
- " X798(798),\n" +
- " X799(799),\n" +
- " X800(800),\n" +
- " X801(801),\n" +
- " X802(802),\n" +
- " X803(803),\n" +
- " X804(804),\n" +
- " X805(805),\n" +
- " X806(806),\n" +
- " X807(807),\n" +
- " X808(808),\n" +
- " X809(809),\n" +
- " X810(810),\n" +
- " X811(811),\n" +
- " X812(812),\n" +
- " X813(813),\n" +
- " X814(814),\n" +
- " X815(815),\n" +
- " X816(816),\n" +
- " X817(817),\n" +
- " X818(818),\n" +
- " X819(819),\n" +
- " X820(820),\n" +
- " X821(821),\n" +
- " X822(822),\n" +
- " X823(823),\n" +
- " X824(824),\n" +
- " X825(825),\n" +
- " X826(826),\n" +
- " X827(827),\n" +
- " X828(828),\n" +
- " X829(829),\n" +
- " X830(830),\n" +
- " X831(831),\n" +
- " X832(832),\n" +
- " X833(833),\n" +
- " X834(834),\n" +
- " X835(835),\n" +
- " X836(836),\n" +
- " X837(837),\n" +
- " X838(838),\n" +
- " X839(839),\n" +
- " X840(840),\n" +
- " X841(841),\n" +
- " X842(842),\n" +
- " X843(843),\n" +
- " X844(844),\n" +
- " X845(845),\n" +
- " X846(846),\n" +
- " X847(847),\n" +
- " X848(848),\n" +
- " X849(849),\n" +
- " X850(850),\n" +
- " X851(851),\n" +
- " X852(852),\n" +
- " X853(853),\n" +
- " X854(854),\n" +
- " X855(855),\n" +
- " X856(856),\n" +
- " X857(857),\n" +
- " X858(858),\n" +
- " X859(859),\n" +
- " X860(860),\n" +
- " X861(861),\n" +
- " X862(862),\n" +
- " X863(863),\n" +
- " X864(864),\n" +
- " X865(865),\n" +
- " X866(866),\n" +
- " X867(867),\n" +
- " X868(868),\n" +
- " X869(869),\n" +
- " X870(870),\n" +
- " X871(871),\n" +
- " X872(872),\n" +
- " X873(873),\n" +
- " X874(874),\n" +
- " X875(875),\n" +
- " X876(876),\n" +
- " X877(877),\n" +
- " X878(878),\n" +
- " X879(879),\n" +
- " X880(880),\n" +
- " X881(881),\n" +
- " X882(882),\n" +
- " X883(883),\n" +
- " X884(884),\n" +
- " X885(885),\n" +
- " X886(886),\n" +
- " X887(887),\n" +
- " X888(888),\n" +
- " X889(889),\n" +
- " X890(890),\n" +
- " X891(891),\n" +
- " X892(892),\n" +
- " X893(893),\n" +
- " X894(894),\n" +
- " X895(895),\n" +
- " X896(896),\n" +
- " X897(897),\n" +
- " X898(898),\n" +
- " X899(899),\n" +
- " X900(900),\n" +
- " X901(901),\n" +
- " X902(902),\n" +
- " X903(903),\n" +
- " X904(904),\n" +
- " X905(905),\n" +
- " X906(906),\n" +
- " X907(907),\n" +
- " X908(908),\n" +
- " X909(909),\n" +
- " X910(910),\n" +
- " X911(911),\n" +
- " X912(912),\n" +
- " X913(913),\n" +
- " X914(914),\n" +
- " X915(915),\n" +
- " X916(916),\n" +
- " X917(917),\n" +
- " X918(918),\n" +
- " X919(919),\n" +
- " X920(920),\n" +
- " X921(921),\n" +
- " X922(922),\n" +
- " X923(923),\n" +
- " X924(924),\n" +
- " X925(925),\n" +
- " X926(926),\n" +
- " X927(927),\n" +
- " X928(928),\n" +
- " X929(929),\n" +
- " X930(930),\n" +
- " X931(931),\n" +
- " X932(932),\n" +
- " X933(933),\n" +
- " X934(934),\n" +
- " X935(935),\n" +
- " X936(936),\n" +
- " X937(937),\n" +
- " X938(938),\n" +
- " X939(939),\n" +
- " X940(940),\n" +
- " X941(941),\n" +
- " X942(942),\n" +
- " X943(943),\n" +
- " X944(944),\n" +
- " X945(945),\n" +
- " X946(946),\n" +
- " X947(947),\n" +
- " X948(948),\n" +
- " X949(949),\n" +
- " X950(950),\n" +
- " X951(951),\n" +
- " X952(952),\n" +
- " X953(953),\n" +
- " X954(954),\n" +
- " X955(955),\n" +
- " X956(956),\n" +
- " X957(957),\n" +
- " X958(958),\n" +
- " X959(959),\n" +
- " X960(960),\n" +
- " X961(961),\n" +
- " X962(962),\n" +
- " X963(963),\n" +
- " X964(964),\n" +
- " X965(965),\n" +
- " X966(966),\n" +
- " X967(967),\n" +
- " X968(968),\n" +
- " X969(969),\n" +
- " X970(970),\n" +
- " X971(971),\n" +
- " X972(972),\n" +
- " X973(973),\n" +
- " X974(974),\n" +
- " X975(975),\n" +
- " X976(976),\n" +
- " X977(977),\n" +
- " X978(978),\n" +
- " X979(979),\n" +
- " X980(980),\n" +
- " X981(981),\n" +
- " X982(982),\n" +
- " X983(983),\n" +
- " X984(984),\n" +
- " X985(985),\n" +
- " X986(986),\n" +
- " X987(987),\n" +
- " X988(988),\n" +
- " X989(989),\n" +
- " X990(990),\n" +
- " X991(991),\n" +
- " X992(992),\n" +
- " X993(993),\n" +
- " X994(994),\n" +
- " X995(995),\n" +
- " X996(996),\n" +
- " X997(997),\n" +
- " X998(998),\n" +
- " X999(999),\n" +
- " X1000(1000),\n" +
- " X1001(1001),\n" +
- " X1002(1002),\n" +
- " X1003(1003),\n" +
- " X1004(1004),\n" +
- " X1005(1005),\n" +
- " X1006(1006),\n" +
- " X1007(1007),\n" +
- " X1008(1008),\n" +
- " X1009(1009),\n" +
- " X1010(1010),\n" +
- " X1011(1011),\n" +
- " X1012(1012),\n" +
- " X1013(1013),\n" +
- " X1014(1014),\n" +
- " X1015(1015),\n" +
- " X1016(1016),\n" +
- " X1017(1017),\n" +
- " X1018(1018),\n" +
- " X1019(1019),\n" +
- " X1020(1020),\n" +
- " X1021(1021),\n" +
- " X1022(1022),\n" +
- " X1023(1023),\n" +
- " X1024(1024),\n" +
- " X1025(1025),\n" +
- " X1026(1026),\n" +
- " X1027(1027),\n" +
- " X1028(1028),\n" +
- " X1029(1029),\n" +
- " X1030(1030),\n" +
- " X1031(1031),\n" +
- " X1032(1032),\n" +
- " X1033(1033),\n" +
- " X1034(1034),\n" +
- " X1035(1035),\n" +
- " X1036(1036),\n" +
- " X1037(1037),\n" +
- " X1038(1038),\n" +
- " X1039(1039),\n" +
- " X1040(1040),\n" +
- " X1041(1041),\n" +
- " X1042(1042),\n" +
- " X1043(1043),\n" +
- " X1044(1044),\n" +
- " X1045(1045),\n" +
- " X1046(1046),\n" +
- " X1047(1047),\n" +
- " X1048(1048),\n" +
- " X1049(1049),\n" +
- " X1050(1050),\n" +
- " X1051(1051),\n" +
- " X1052(1052),\n" +
- " X1053(1053),\n" +
- " X1054(1054),\n" +
- " X1055(1055),\n" +
- " X1056(1056),\n" +
- " X1057(1057),\n" +
- " X1058(1058),\n" +
- " X1059(1059),\n" +
- " X1060(1060),\n" +
- " X1061(1061),\n" +
- " X1062(1062),\n" +
- " X1063(1063),\n" +
- " X1064(1064),\n" +
- " X1065(1065),\n" +
- " X1066(1066),\n" +
- " X1067(1067),\n" +
- " X1068(1068),\n" +
- " X1069(1069),\n" +
- " X1070(1070),\n" +
- " X1071(1071),\n" +
- " X1072(1072),\n" +
- " X1073(1073),\n" +
- " X1074(1074),\n" +
- " X1075(1075),\n" +
- " X1076(1076),\n" +
- " X1077(1077),\n" +
- " X1078(1078),\n" +
- " X1079(1079),\n" +
- " X1080(1080),\n" +
- " X1081(1081),\n" +
- " X1082(1082),\n" +
- " X1083(1083),\n" +
- " X1084(1084),\n" +
- " X1085(1085),\n" +
- " X1086(1086),\n" +
- " X1087(1087),\n" +
- " X1088(1088),\n" +
- " X1089(1089),\n" +
- " X1090(1090),\n" +
- " X1091(1091),\n" +
- " X1092(1092),\n" +
- " X1093(1093),\n" +
- " X1094(1094),\n" +
- " X1095(1095),\n" +
- " X1096(1096),\n" +
- " X1097(1097),\n" +
- " X1098(1098),\n" +
- " X1099(1099),\n" +
- " X1100(1100),\n" +
- " X1101(1101),\n" +
- " X1102(1102),\n" +
- " X1103(1103),\n" +
- " X1104(1104),\n" +
- " X1105(1105),\n" +
- " X1106(1106),\n" +
- " X1107(1107),\n" +
- " X1108(1108),\n" +
- " X1109(1109),\n" +
- " X1110(1110),\n" +
- " X1111(1111),\n" +
- " X1112(1112),\n" +
- " X1113(1113),\n" +
- " X1114(1114),\n" +
- " X1115(1115),\n" +
- " X1116(1116),\n" +
- " X1117(1117),\n" +
- " X1118(1118),\n" +
- " X1119(1119),\n" +
- " X1120(1120),\n" +
- " X1121(1121),\n" +
- " X1122(1122),\n" +
- " X1123(1123),\n" +
- " X1124(1124),\n" +
- " X1125(1125),\n" +
- " X1126(1126),\n" +
- " X1127(1127),\n" +
- " X1128(1128),\n" +
- " X1129(1129),\n" +
- " X1130(1130),\n" +
- " X1131(1131),\n" +
- " X1132(1132),\n" +
- " X1133(1133),\n" +
- " X1134(1134),\n" +
- " X1135(1135),\n" +
- " X1136(1136),\n" +
- " X1137(1137),\n" +
- " X1138(1138),\n" +
- " X1139(1139),\n" +
- " X1140(1140),\n" +
- " X1141(1141),\n" +
- " X1142(1142),\n" +
- " X1143(1143),\n" +
- " X1144(1144),\n" +
- " X1145(1145),\n" +
- " X1146(1146),\n" +
- " X1147(1147),\n" +
- " X1148(1148),\n" +
- " X1149(1149),\n" +
- " X1150(1150),\n" +
- " X1151(1151),\n" +
- " X1152(1152),\n" +
- " X1153(1153),\n" +
- " X1154(1154),\n" +
- " X1155(1155),\n" +
- " X1156(1156),\n" +
- " X1157(1157),\n" +
- " X1158(1158),\n" +
- " X1159(1159),\n" +
- " X1160(1160),\n" +
- " X1161(1161),\n" +
- " X1162(1162),\n" +
- " X1163(1163),\n" +
- " X1164(1164),\n" +
- " X1165(1165),\n" +
- " X1166(1166),\n" +
- " X1167(1167),\n" +
- " X1168(1168),\n" +
- " X1169(1169),\n" +
- " X1170(1170),\n" +
- " X1171(1171),\n" +
- " X1172(1172),\n" +
- " X1173(1173),\n" +
- " X1174(1174),\n" +
- " X1175(1175),\n" +
- " X1176(1176),\n" +
- " X1177(1177),\n" +
- " X1178(1178),\n" +
- " X1179(1179),\n" +
- " X1180(1180),\n" +
- " X1181(1181),\n" +
- " X1182(1182),\n" +
- " X1183(1183),\n" +
- " X1184(1184),\n" +
- " X1185(1185),\n" +
- " X1186(1186),\n" +
- " X1187(1187),\n" +
- " X1188(1188),\n" +
- " X1189(1189),\n" +
- " X1190(1190),\n" +
- " X1191(1191),\n" +
- " X1192(1192),\n" +
- " X1193(1193),\n" +
- " X1194(1194),\n" +
- " X1195(1195),\n" +
- " X1196(1196),\n" +
- " X1197(1197),\n" +
- " X1198(1198),\n" +
- " X1199(1199),\n" +
- " X1200(1200),\n" +
- " X1201(1201),\n" +
- " X1202(1202),\n" +
- " X1203(1203),\n" +
- " X1204(1204),\n" +
- " X1205(1205),\n" +
- " X1206(1206),\n" +
- " X1207(1207),\n" +
- " X1208(1208),\n" +
- " X1209(1209),\n" +
- " X1210(1210),\n" +
- " X1211(1211),\n" +
- " X1212(1212),\n" +
- " X1213(1213),\n" +
- " X1214(1214),\n" +
- " X1215(1215),\n" +
- " X1216(1216),\n" +
- " X1217(1217),\n" +
- " X1218(1218),\n" +
- " X1219(1219),\n" +
- " X1220(1220),\n" +
- " X1221(1221),\n" +
- " X1222(1222),\n" +
- " X1223(1223),\n" +
- " X1224(1224),\n" +
- " X1225(1225),\n" +
- " X1226(1226),\n" +
- " X1227(1227),\n" +
- " X1228(1228),\n" +
- " X1229(1229),\n" +
- " X1230(1230),\n" +
- " X1231(1231),\n" +
- " X1232(1232),\n" +
- " X1233(1233),\n" +
- " X1234(1234),\n" +
- " X1235(1235),\n" +
- " X1236(1236),\n" +
- " X1237(1237),\n" +
- " X1238(1238),\n" +
- " X1239(1239),\n" +
- " X1240(1240),\n" +
- " X1241(1241),\n" +
- " X1242(1242),\n" +
- " X1243(1243),\n" +
- " X1244(1244),\n" +
- " X1245(1245),\n" +
- " X1246(1246),\n" +
- " X1247(1247),\n" +
- " X1248(1248),\n" +
- " X1249(1249),\n" +
- " X1250(1250),\n" +
- " X1251(1251),\n" +
- " X1252(1252),\n" +
- " X1253(1253),\n" +
- " X1254(1254),\n" +
- " X1255(1255),\n" +
- " X1256(1256),\n" +
- " X1257(1257),\n" +
- " X1258(1258),\n" +
- " X1259(1259),\n" +
- " X1260(1260),\n" +
- " X1261(1261),\n" +
- " X1262(1262),\n" +
- " X1263(1263),\n" +
- " X1264(1264),\n" +
- " X1265(1265),\n" +
- " X1266(1266),\n" +
- " X1267(1267),\n" +
- " X1268(1268),\n" +
- " X1269(1269),\n" +
- " X1270(1270),\n" +
- " X1271(1271),\n" +
- " X1272(1272),\n" +
- " X1273(1273),\n" +
- " X1274(1274),\n" +
- " X1275(1275),\n" +
- " X1276(1276),\n" +
- " X1277(1277),\n" +
- " X1278(1278),\n" +
- " X1279(1279),\n" +
- " X1280(1280),\n" +
- " X1281(1281),\n" +
- " X1282(1282),\n" +
- " X1283(1283),\n" +
- " X1284(1284),\n" +
- " X1285(1285),\n" +
- " X1286(1286),\n" +
- " X1287(1287),\n" +
- " X1288(1288),\n" +
- " X1289(1289),\n" +
- " X1290(1290),\n" +
- " X1291(1291),\n" +
- " X1292(1292),\n" +
- " X1293(1293),\n" +
- " X1294(1294),\n" +
- " X1295(1295),\n" +
- " X1296(1296),\n" +
- " X1297(1297),\n" +
- " X1298(1298),\n" +
- " X1299(1299),\n" +
- " X1300(1300),\n" +
- " X1301(1301),\n" +
- " X1302(1302),\n" +
- " X1303(1303),\n" +
- " X1304(1304),\n" +
- " X1305(1305),\n" +
- " X1306(1306),\n" +
- " X1307(1307),\n" +
- " X1308(1308),\n" +
- " X1309(1309),\n" +
- " X1310(1310),\n" +
- " X1311(1311),\n" +
- " X1312(1312),\n" +
- " X1313(1313),\n" +
- " X1314(1314),\n" +
- " X1315(1315),\n" +
- " X1316(1316),\n" +
- " X1317(1317),\n" +
- " X1318(1318),\n" +
- " X1319(1319),\n" +
- " X1320(1320),\n" +
- " X1321(1321),\n" +
- " X1322(1322),\n" +
- " X1323(1323),\n" +
- " X1324(1324),\n" +
- " X1325(1325),\n" +
- " X1326(1326),\n" +
- " X1327(1327),\n" +
- " X1328(1328),\n" +
- " X1329(1329),\n" +
- " X1330(1330),\n" +
- " X1331(1331),\n" +
- " X1332(1332),\n" +
- " X1333(1333),\n" +
- " X1334(1334),\n" +
- " X1335(1335),\n" +
- " X1336(1336),\n" +
- " X1337(1337),\n" +
- " X1338(1338),\n" +
- " X1339(1339),\n" +
- " X1340(1340),\n" +
- " X1341(1341),\n" +
- " X1342(1342),\n" +
- " X1343(1343),\n" +
- " X1344(1344),\n" +
- " X1345(1345),\n" +
- " X1346(1346),\n" +
- " X1347(1347),\n" +
- " X1348(1348),\n" +
- " X1349(1349),\n" +
- " X1350(1350),\n" +
- " X1351(1351),\n" +
- " X1352(1352),\n" +
- " X1353(1353),\n" +
- " X1354(1354),\n" +
- " X1355(1355),\n" +
- " X1356(1356),\n" +
- " X1357(1357),\n" +
- " X1358(1358),\n" +
- " X1359(1359),\n" +
- " X1360(1360),\n" +
- " X1361(1361),\n" +
- " X1362(1362),\n" +
- " X1363(1363),\n" +
- " X1364(1364),\n" +
- " X1365(1365),\n" +
- " X1366(1366),\n" +
- " X1367(1367),\n" +
- " X1368(1368),\n" +
- " X1369(1369),\n" +
- " X1370(1370),\n" +
- " X1371(1371),\n" +
- " X1372(1372),\n" +
- " X1373(1373),\n" +
- " X1374(1374),\n" +
- " X1375(1375),\n" +
- " X1376(1376),\n" +
- " X1377(1377),\n" +
- " X1378(1378),\n" +
- " X1379(1379),\n" +
- " X1380(1380),\n" +
- " X1381(1381),\n" +
- " X1382(1382),\n" +
- " X1383(1383),\n" +
- " X1384(1384),\n" +
- " X1385(1385),\n" +
- " X1386(1386),\n" +
- " X1387(1387),\n" +
- " X1388(1388),\n" +
- " X1389(1389),\n" +
- " X1390(1390),\n" +
- " X1391(1391),\n" +
- " X1392(1392),\n" +
- " X1393(1393),\n" +
- " X1394(1394),\n" +
- " X1395(1395),\n" +
- " X1396(1396),\n" +
- " X1397(1397),\n" +
- " X1398(1398),\n" +
- " X1399(1399),\n" +
- " X1400(1400),\n" +
- " X1401(1401),\n" +
- " X1402(1402),\n" +
- " X1403(1403),\n" +
- " X1404(1404),\n" +
- " X1405(1405),\n" +
- " X1406(1406),\n" +
- " X1407(1407),\n" +
- " X1408(1408),\n" +
- " X1409(1409),\n" +
- " X1410(1410),\n" +
- " X1411(1411),\n" +
- " X1412(1412),\n" +
- " X1413(1413),\n" +
- " X1414(1414),\n" +
- " X1415(1415),\n" +
- " X1416(1416),\n" +
- " X1417(1417),\n" +
- " X1418(1418),\n" +
- " X1419(1419),\n" +
- " X1420(1420),\n" +
- " X1421(1421),\n" +
- " X1422(1422),\n" +
- " X1423(1423),\n" +
- " X1424(1424),\n" +
- " X1425(1425),\n" +
- " X1426(1426),\n" +
- " X1427(1427),\n" +
- " X1428(1428),\n" +
- " X1429(1429),\n" +
- " X1430(1430),\n" +
- " X1431(1431),\n" +
- " X1432(1432),\n" +
- " X1433(1433),\n" +
- " X1434(1434),\n" +
- " X1435(1435),\n" +
- " X1436(1436),\n" +
- " X1437(1437),\n" +
- " X1438(1438),\n" +
- " X1439(1439),\n" +
- " X1440(1440),\n" +
- " X1441(1441),\n" +
- " X1442(1442),\n" +
- " X1443(1443),\n" +
- " X1444(1444),\n" +
- " X1445(1445),\n" +
- " X1446(1446),\n" +
- " X1447(1447),\n" +
- " X1448(1448),\n" +
- " X1449(1449),\n" +
- " X1450(1450),\n" +
- " X1451(1451),\n" +
- " X1452(1452),\n" +
- " X1453(1453),\n" +
- " X1454(1454),\n" +
- " X1455(1455),\n" +
- " X1456(1456),\n" +
- " X1457(1457),\n" +
- " X1458(1458),\n" +
- " X1459(1459),\n" +
- " X1460(1460),\n" +
- " X1461(1461),\n" +
- " X1462(1462),\n" +
- " X1463(1463),\n" +
- " X1464(1464),\n" +
- " X1465(1465),\n" +
- " X1466(1466),\n" +
- " X1467(1467),\n" +
- " X1468(1468),\n" +
- " X1469(1469),\n" +
- " X1470(1470),\n" +
- " X1471(1471),\n" +
- " X1472(1472),\n" +
- " X1473(1473),\n" +
- " X1474(1474),\n" +
- " X1475(1475),\n" +
- " X1476(1476),\n" +
- " X1477(1477),\n" +
- " X1478(1478),\n" +
- " X1479(1479),\n" +
- " X1480(1480),\n" +
- " X1481(1481),\n" +
- " X1482(1482),\n" +
- " X1483(1483),\n" +
- " X1484(1484),\n" +
- " X1485(1485),\n" +
- " X1486(1486),\n" +
- " X1487(1487),\n" +
- " X1488(1488),\n" +
- " X1489(1489),\n" +
- " X1490(1490),\n" +
- " X1491(1491),\n" +
- " X1492(1492),\n" +
- " X1493(1493),\n" +
- " X1494(1494),\n" +
- " X1495(1495),\n" +
- " X1496(1496),\n" +
- " X1497(1497),\n" +
- " X1498(1498),\n" +
- " X1499(1499),\n" +
- " X1500(1500),\n" +
- " X1501(1501),\n" +
- " X1502(1502),\n" +
- " X1503(1503),\n" +
- " X1504(1504),\n" +
- " X1505(1505),\n" +
- " X1506(1506),\n" +
- " X1507(1507),\n" +
- " X1508(1508),\n" +
- " X1509(1509),\n" +
- " X1510(1510),\n" +
- " X1511(1511),\n" +
- " X1512(1512),\n" +
- " X1513(1513),\n" +
- " X1514(1514),\n" +
- " X1515(1515),\n" +
- " X1516(1516),\n" +
- " X1517(1517),\n" +
- " X1518(1518),\n" +
- " X1519(1519),\n" +
- " X1520(1520),\n" +
- " X1521(1521),\n" +
- " X1522(1522),\n" +
- " X1523(1523),\n" +
- " X1524(1524),\n" +
- " X1525(1525),\n" +
- " X1526(1526),\n" +
- " X1527(1527),\n" +
- " X1528(1528),\n" +
- " X1529(1529),\n" +
- " X1530(1530),\n" +
- " X1531(1531),\n" +
- " X1532(1532),\n" +
- " X1533(1533),\n" +
- " X1534(1534),\n" +
- " X1535(1535),\n" +
- " X1536(1536),\n" +
- " X1537(1537),\n" +
- " X1538(1538),\n" +
- " X1539(1539),\n" +
- " X1540(1540),\n" +
- " X1541(1541),\n" +
- " X1542(1542),\n" +
- " X1543(1543),\n" +
- " X1544(1544),\n" +
- " X1545(1545),\n" +
- " X1546(1546),\n" +
- " X1547(1547),\n" +
- " X1548(1548),\n" +
- " X1549(1549),\n" +
- " X1550(1550),\n" +
- " X1551(1551),\n" +
- " X1552(1552),\n" +
- " X1553(1553),\n" +
- " X1554(1554),\n" +
- " X1555(1555),\n" +
- " X1556(1556),\n" +
- " X1557(1557),\n" +
- " X1558(1558),\n" +
- " X1559(1559),\n" +
- " X1560(1560),\n" +
- " X1561(1561),\n" +
- " X1562(1562),\n" +
- " X1563(1563),\n" +
- " X1564(1564),\n" +
- " X1565(1565),\n" +
- " X1566(1566),\n" +
- " X1567(1567),\n" +
- " X1568(1568),\n" +
- " X1569(1569),\n" +
- " X1570(1570),\n" +
- " X1571(1571),\n" +
- " X1572(1572),\n" +
- " X1573(1573),\n" +
- " X1574(1574),\n" +
- " X1575(1575),\n" +
- " X1576(1576),\n" +
- " X1577(1577),\n" +
- " X1578(1578),\n" +
- " X1579(1579),\n" +
- " X1580(1580),\n" +
- " X1581(1581),\n" +
- " X1582(1582),\n" +
- " X1583(1583),\n" +
- " X1584(1584),\n" +
- " X1585(1585),\n" +
- " X1586(1586),\n" +
- " X1587(1587),\n" +
- " X1588(1588),\n" +
- " X1589(1589),\n" +
- " X1590(1590),\n" +
- " X1591(1591),\n" +
- " X1592(1592),\n" +
- " X1593(1593),\n" +
- " X1594(1594),\n" +
- " X1595(1595),\n" +
- " X1596(1596),\n" +
- " X1597(1597),\n" +
- " X1598(1598),\n" +
- " X1599(1599),\n" +
- " X1600(1600),\n" +
- " X1601(1601),\n" +
- " X1602(1602),\n" +
- " X1603(1603),\n" +
- " X1604(1604),\n" +
- " X1605(1605),\n" +
- " X1606(1606),\n" +
- " X1607(1607),\n" +
- " X1608(1608),\n" +
- " X1609(1609),\n" +
- " X1610(1610),\n" +
- " X1611(1611),\n" +
- " X1612(1612),\n" +
- " X1613(1613),\n" +
- " X1614(1614),\n" +
- " X1615(1615),\n" +
- " X1616(1616),\n" +
- " X1617(1617),\n" +
- " X1618(1618),\n" +
- " X1619(1619),\n" +
- " X1620(1620),\n" +
- " X1621(1621),\n" +
- " X1622(1622),\n" +
- " X1623(1623),\n" +
- " X1624(1624),\n" +
- " X1625(1625),\n" +
- " X1626(1626),\n" +
- " X1627(1627),\n" +
- " X1628(1628),\n" +
- " X1629(1629),\n" +
- " X1630(1630),\n" +
- " X1631(1631),\n" +
- " X1632(1632),\n" +
- " X1633(1633),\n" +
- " X1634(1634),\n" +
- " X1635(1635),\n" +
- " X1636(1636),\n" +
- " X1637(1637),\n" +
- " X1638(1638),\n" +
- " X1639(1639),\n" +
- " X1640(1640),\n" +
- " X1641(1641),\n" +
- " X1642(1642),\n" +
- " X1643(1643),\n" +
- " X1644(1644),\n" +
- " X1645(1645),\n" +
- " X1646(1646),\n" +
- " X1647(1647),\n" +
- " X1648(1648),\n" +
- " X1649(1649),\n" +
- " X1650(1650),\n" +
- " X1651(1651),\n" +
- " X1652(1652),\n" +
- " X1653(1653),\n" +
- " X1654(1654),\n" +
- " X1655(1655),\n" +
- " X1656(1656),\n" +
- " X1657(1657),\n" +
- " X1658(1658),\n" +
- " X1659(1659),\n" +
- " X1660(1660),\n" +
- " X1661(1661),\n" +
- " X1662(1662),\n" +
- " X1663(1663),\n" +
- " X1664(1664),\n" +
- " X1665(1665),\n" +
- " X1666(1666),\n" +
- " X1667(1667),\n" +
- " X1668(1668),\n" +
- " X1669(1669),\n" +
- " X1670(1670),\n" +
- " X1671(1671),\n" +
- " X1672(1672),\n" +
- " X1673(1673),\n" +
- " X1674(1674),\n" +
- " X1675(1675),\n" +
- " X1676(1676),\n" +
- " X1677(1677),\n" +
- " X1678(1678),\n" +
- " X1679(1679),\n" +
- " X1680(1680),\n" +
- " X1681(1681),\n" +
- " X1682(1682),\n" +
- " X1683(1683),\n" +
- " X1684(1684),\n" +
- " X1685(1685),\n" +
- " X1686(1686),\n" +
- " X1687(1687),\n" +
- " X1688(1688),\n" +
- " X1689(1689),\n" +
- " X1690(1690),\n" +
- " X1691(1691),\n" +
- " X1692(1692),\n" +
- " X1693(1693),\n" +
- " X1694(1694),\n" +
- " X1695(1695),\n" +
- " X1696(1696),\n" +
- " X1697(1697),\n" +
- " X1698(1698),\n" +
- " X1699(1699),\n" +
- " X1700(1700),\n" +
- " X1701(1701),\n" +
- " X1702(1702),\n" +
- " X1703(1703),\n" +
- " X1704(1704),\n" +
- " X1705(1705),\n" +
- " X1706(1706),\n" +
- " X1707(1707),\n" +
- " X1708(1708),\n" +
- " X1709(1709),\n" +
- " X1710(1710),\n" +
- " X1711(1711),\n" +
- " X1712(1712),\n" +
- " X1713(1713),\n" +
- " X1714(1714),\n" +
- " X1715(1715),\n" +
- " X1716(1716),\n" +
- " X1717(1717),\n" +
- " X1718(1718),\n" +
- " X1719(1719),\n" +
- " X1720(1720),\n" +
- " X1721(1721),\n" +
- " X1722(1722),\n" +
- " X1723(1723),\n" +
- " X1724(1724),\n" +
- " X1725(1725),\n" +
- " X1726(1726),\n" +
- " X1727(1727),\n" +
- " X1728(1728),\n" +
- " X1729(1729),\n" +
- " X1730(1730),\n" +
- " X1731(1731),\n" +
- " X1732(1732),\n" +
- " X1733(1733),\n" +
- " X1734(1734),\n" +
- " X1735(1735),\n" +
- " X1736(1736),\n" +
- " X1737(1737),\n" +
- " X1738(1738),\n" +
- " X1739(1739),\n" +
- " X1740(1740),\n" +
- " X1741(1741),\n" +
- " X1742(1742),\n" +
- " X1743(1743),\n" +
- " X1744(1744),\n" +
- " X1745(1745),\n" +
- " X1746(1746),\n" +
- " X1747(1747),\n" +
- " X1748(1748),\n" +
- " X1749(1749),\n" +
- " X1750(1750),\n" +
- " X1751(1751),\n" +
- " X1752(1752),\n" +
- " X1753(1753),\n" +
- " X1754(1754),\n" +
- " X1755(1755),\n" +
- " X1756(1756),\n" +
- " X1757(1757),\n" +
- " X1758(1758),\n" +
- " X1759(1759),\n" +
- " X1760(1760),\n" +
- " X1761(1761),\n" +
- " X1762(1762),\n" +
- " X1763(1763),\n" +
- " X1764(1764),\n" +
- " X1765(1765),\n" +
- " X1766(1766),\n" +
- " X1767(1767),\n" +
- " X1768(1768),\n" +
- " X1769(1769),\n" +
- " X1770(1770),\n" +
- " X1771(1771),\n" +
- " X1772(1772),\n" +
- " X1773(1773),\n" +
- " X1774(1774),\n" +
- " X1775(1775),\n" +
- " X1776(1776),\n" +
- " X1777(1777),\n" +
- " X1778(1778),\n" +
- " X1779(1779),\n" +
- " X1780(1780),\n" +
- " X1781(1781),\n" +
- " X1782(1782),\n" +
- " X1783(1783),\n" +
- " X1784(1784),\n" +
- " X1785(1785),\n" +
- " X1786(1786),\n" +
- " X1787(1787),\n" +
- " X1788(1788),\n" +
- " X1789(1789),\n" +
- " X1790(1790),\n" +
- " X1791(1791),\n" +
- " X1792(1792),\n" +
- " X1793(1793),\n" +
- " X1794(1794),\n" +
- " X1795(1795),\n" +
- " X1796(1796),\n" +
- " X1797(1797),\n" +
- " X1798(1798),\n" +
- " X1799(1799),\n" +
- " X1800(1800),\n" +
- " X1801(1801),\n" +
- " X1802(1802),\n" +
- " X1803(1803),\n" +
- " X1804(1804),\n" +
- " X1805(1805),\n" +
- " X1806(1806),\n" +
- " X1807(1807),\n" +
- " X1808(1808),\n" +
- " X1809(1809),\n" +
- " X1810(1810),\n" +
- " X1811(1811),\n" +
- " X1812(1812),\n" +
- " X1813(1813),\n" +
- " X1814(1814),\n" +
- " X1815(1815),\n" +
- " X1816(1816),\n" +
- " X1817(1817),\n" +
- " X1818(1818),\n" +
- " X1819(1819),\n" +
- " X1820(1820),\n" +
- " X1821(1821),\n" +
- " X1822(1822),\n" +
- " X1823(1823),\n" +
- " X1824(1824),\n" +
- " X1825(1825),\n" +
- " X1826(1826),\n" +
- " X1827(1827),\n" +
- " X1828(1828),\n" +
- " X1829(1829),\n" +
- " X1830(1830),\n" +
- " X1831(1831),\n" +
- " X1832(1832),\n" +
- " X1833(1833),\n" +
- " X1834(1834),\n" +
- " X1835(1835),\n" +
- " X1836(1836),\n" +
- " X1837(1837),\n" +
- " X1838(1838),\n" +
- " X1839(1839),\n" +
- " X1840(1840),\n" +
- " X1841(1841),\n" +
- " X1842(1842),\n" +
- " X1843(1843),\n" +
- " X1844(1844),\n" +
- " X1845(1845),\n" +
- " X1846(1846),\n" +
- " X1847(1847),\n" +
- " X1848(1848),\n" +
- " X1849(1849),\n" +
- " X1850(1850),\n" +
- " X1851(1851),\n" +
- " X1852(1852),\n" +
- " X1853(1853),\n" +
- " X1854(1854),\n" +
- " X1855(1855),\n" +
- " X1856(1856),\n" +
- " X1857(1857),\n" +
- " X1858(1858),\n" +
- " X1859(1859),\n" +
- " X1860(1860),\n" +
- " X1861(1861),\n" +
- " X1862(1862),\n" +
- " X1863(1863),\n" +
- " X1864(1864),\n" +
- " X1865(1865),\n" +
- " X1866(1866),\n" +
- " X1867(1867),\n" +
- " X1868(1868),\n" +
- " X1869(1869),\n" +
- " X1870(1870),\n" +
- " X1871(1871),\n" +
- " X1872(1872),\n" +
- " X1873(1873),\n" +
- " X1874(1874),\n" +
- " X1875(1875),\n" +
- " X1876(1876),\n" +
- " X1877(1877),\n" +
- " X1878(1878),\n" +
- " X1879(1879),\n" +
- " X1880(1880),\n" +
- " X1881(1881),\n" +
- " X1882(1882),\n" +
- " X1883(1883),\n" +
- " X1884(1884),\n" +
- " X1885(1885),\n" +
- " X1886(1886),\n" +
- " X1887(1887),\n" +
- " X1888(1888),\n" +
- " X1889(1889),\n" +
- " X1890(1890),\n" +
- " X1891(1891),\n" +
- " X1892(1892),\n" +
- " X1893(1893),\n" +
- " X1894(1894),\n" +
- " X1895(1895),\n" +
- " X1896(1896),\n" +
- " X1897(1897),\n" +
- " X1898(1898),\n" +
- " X1899(1899),\n" +
- " X1900(1900),\n" +
- " X1901(1901),\n" +
- " X1902(1902),\n" +
- " X1903(1903),\n" +
- " X1904(1904),\n" +
- " X1905(1905),\n" +
- " X1906(1906),\n" +
- " X1907(1907),\n" +
- " X1908(1908),\n" +
- " X1909(1909),\n" +
- " X1910(1910),\n" +
- " X1911(1911),\n" +
- " X1912(1912),\n" +
- " X1913(1913),\n" +
- " X1914(1914),\n" +
- " X1915(1915),\n" +
- " X1916(1916),\n" +
- " X1917(1917),\n" +
- " X1918(1918),\n" +
- " X1919(1919),\n" +
- " X1920(1920),\n" +
- " X1921(1921),\n" +
- " X1922(1922),\n" +
- " X1923(1923),\n" +
- " X1924(1924),\n" +
- " X1925(1925),\n" +
- " X1926(1926),\n" +
- " X1927(1927),\n" +
- " X1928(1928),\n" +
- " X1929(1929),\n" +
- " X1930(1930),\n" +
- " X1931(1931),\n" +
- " X1932(1932),\n" +
- " X1933(1933),\n" +
- " X1934(1934),\n" +
- " X1935(1935),\n" +
- " X1936(1936),\n" +
- " X1937(1937),\n" +
- " X1938(1938),\n" +
- " X1939(1939),\n" +
- " X1940(1940),\n" +
- " X1941(1941),\n" +
- " X1942(1942),\n" +
- " X1943(1943),\n" +
- " X1944(1944),\n" +
- " X1945(1945),\n" +
- " X1946(1946),\n" +
- " X1947(1947),\n" +
- " X1948(1948),\n" +
- " X1949(1949),\n" +
- " X1950(1950),\n" +
- " X1951(1951),\n" +
- " X1952(1952),\n" +
- " X1953(1953),\n" +
- " X1954(1954),\n" +
- " X1955(1955),\n" +
- " X1956(1956),\n" +
- " X1957(1957),\n" +
- " X1958(1958),\n" +
- " X1959(1959),\n" +
- " X1960(1960),\n" +
- " X1961(1961),\n" +
- " X1962(1962),\n" +
- " X1963(1963),\n" +
- " X1964(1964),\n" +
- " X1965(1965),\n" +
- " X1966(1966),\n" +
- " X1967(1967),\n" +
- " X1968(1968),\n" +
- " X1969(1969),\n" +
- " X1970(1970),\n" +
- " X1971(1971),\n" +
- " X1972(1972),\n" +
- " X1973(1973),\n" +
- " X1974(1974),\n" +
- " X1975(1975),\n" +
- " X1976(1976),\n" +
- " X1977(1977),\n" +
- " X1978(1978),\n" +
- " X1979(1979),\n" +
- " X1980(1980),\n" +
- " X1981(1981),\n" +
- " X1982(1982),\n" +
- " X1983(1983),\n" +
- " X1984(1984),\n" +
- " X1985(1985),\n" +
- " X1986(1986),\n" +
- " X1987(1987),\n" +
- " X1988(1988),\n" +
- " X1989(1989),\n" +
- " X1990(1990),\n" +
- " X1991(1991),\n" +
- " X1992(1992),\n" +
- " X1993(1993),\n" +
- " X1994(1994),\n" +
- " X1995(1995),\n" +
- " X1996(1996),\n" +
- " X1997(1997),\n" +
- " X1998(1998),\n" +
- " X1999(1999),\n" +
- " X2000(2000),\n" +
- " X2001(2001),\n" +
- " X2002(2002),\n" +
- " X2003(2003),\n" +
- " X2004(2004),\n" +
- " X2005(2005),\n" +
- " X2006(2006),\n" +
- " X2007(2007),\n" +
- " X2008(2008),\n" +
- " X2009(2009),\n" +
- " X2010(2010),\n" +
- " X2011(2011),\n" +
- " X2012(2012),\n" +
- " X2013(2013),\n" +
- " X2014(2014),\n" +
- " X2015(2015),\n" +
- " X2016(2016),\n" +
- " X2017(2017),\n" +
- " X2018(2018),\n" +
- " X2019(2019),\n" +
- " X2020(2020),\n" +
- " X2021(2021),\n" +
- " X2022(2022),\n" +
- " X2023(2023),\n" +
- " X2024(2024),\n" +
- " X2025(2025),\n" +
- " X2026(2026),\n" +
- " X2027(2027),\n" +
- " X2028(2028),\n" +
- " X2029(2029),\n" +
- " X2030(2030),\n" +
- " X2031(2031),\n" +
- " X2032(2032),\n" +
- " X2033(2033),\n" +
- " X2034(2034),\n" +
- " X2035(2035),\n" +
- " X2036(2036),\n" +
- " X2037(2037),\n" +
- " X2038(2038),\n" +
- " X2039(2039),\n" +
- " X2040(2040),\n" +
- " X2041(2041),\n" +
- " X2042(2042),\n" +
- " X2043(2043),\n" +
- " X2044(2044),\n" +
- " X2045(2045),\n" +
- " X2046(2046),\n" +
- " X2047(2047),\n" +
- " X2048(2048),\n" +
- " X2049(2049),\n" +
- " X2050(2050),\n" +
- " X2051(2051),\n" +
- " X2052(2052),\n" +
- " X2053(2053),\n" +
- " X2054(2054),\n" +
- " X2055(2055),\n" +
- " X2056(2056),\n" +
- " X2057(2057),\n" +
- " X2058(2058),\n" +
- " X2059(2059),\n" +
- " X2060(2060),\n" +
- " X2061(2061),\n" +
- " X2062(2062),\n" +
- " X2063(2063),\n" +
- " X2064(2064),\n" +
- " X2065(2065),\n" +
- " X2066(2066),\n" +
- " X2067(2067),\n" +
- " X2068(2068),\n" +
- " X2069(2069),\n" +
- " X2070(2070),\n" +
- " X2071(2071),\n" +
- " X2072(2072),\n" +
- " X2073(2073),\n" +
- " X2074(2074),\n" +
- " X2075(2075),\n" +
- " X2076(2076),\n" +
- " X2077(2077),\n" +
- " X2078(2078),\n" +
- " X2079(2079),\n" +
- " X2080(2080),\n" +
- " X2081(2081),\n" +
- " X2082(2082),\n" +
- " X2083(2083),\n" +
- " X2084(2084),\n" +
- " X2085(2085),\n" +
- " X2086(2086),\n" +
- " X2087(2087),\n" +
- " X2088(2088),\n" +
- " X2089(2089),\n" +
- " X2090(2090),\n" +
- " X2091(2091),\n" +
- " X2092(2092),\n" +
- " X2093(2093),\n" +
- " X2094(2094),\n" +
- " X2095(2095),\n" +
- " X2096(2096),\n" +
- " X2097(2097),\n" +
- " X2098(2098),\n" +
- " X2099(2099),\n" +
- " X2100(2100),\n" +
- " X2101(2101),\n" +
- " X2102(2102),\n" +
- " X2103(2103),\n" +
- " X2104(2104),\n" +
- " X2105(2105),\n" +
- " X2106(2106),\n" +
- " X2107(2107),\n" +
- " X2108(2108),\n" +
- " X2109(2109),\n" +
- " X2110(2110),\n" +
- " X2111(2111),\n" +
- " X2112(2112),\n" +
- " X2113(2113),\n" +
- " X2114(2114),\n" +
- " X2115(2115),\n" +
- " X2116(2116),\n" +
- " X2117(2117),\n" +
- " X2118(2118),\n" +
- " X2119(2119),\n" +
- " X2120(2120),\n" +
- " X2121(2121),\n" +
- " X2122(2122),\n" +
- " X2123(2123),\n" +
- " X2124(2124),\n" +
- " X2125(2125),\n" +
- " X2126(2126),\n" +
- " X2127(2127),\n" +
- " X2128(2128),\n" +
- " X2129(2129),\n" +
- " X2130(2130),\n" +
- " X2131(2131),\n" +
- " X2132(2132),\n" +
- " X2133(2133),\n" +
- " X2134(2134),\n" +
- " X2135(2135),\n" +
- " X2136(2136),\n" +
- " X2137(2137),\n" +
- " X2138(2138),\n" +
- " X2139(2139),\n" +
- " X2140(2140),\n" +
- " X2141(2141),\n" +
- " X2142(2142),\n" +
- " X2143(2143),\n" +
- " X2144(2144),\n" +
- " X2145(2145),\n" +
- " X2146(2146),\n" +
- " X2147(2147),\n" +
- " X2148(2148),\n" +
- " X2149(2149),\n" +
- " X2150(2150),\n" +
- " X2151(2151),\n" +
- " X2152(2152),\n" +
- " X2153(2153),\n" +
- " X2154(2154),\n" +
- " X2155(2155),\n" +
- " X2156(2156),\n" +
- " X2157(2157),\n" +
- " X2158(2158),\n" +
- " X2159(2159),\n" +
- " X2160(2160),\n" +
- " X2161(2161),\n" +
- " X2162(2162),\n" +
- " X2163(2163),\n" +
- " X2164(2164),\n" +
- " X2165(2165),\n" +
- " X2166(2166),\n" +
- " X2167(2167),\n" +
- " X2168(2168),\n" +
- " X2169(2169),\n" +
- " X2170(2170),\n" +
- " X2171(2171),\n" +
- " X2172(2172),\n" +
- " X2173(2173),\n" +
- " X2174(2174),\n" +
- " X2175(2175),\n" +
- " X2176(2176),\n" +
- " X2177(2177),\n" +
- " X2178(2178),\n" +
- " X2179(2179),\n" +
- " X2180(2180),\n" +
- " X2181(2181),\n" +
- " X2182(2182),\n" +
- " X2183(2183),\n" +
- " X2184(2184),\n" +
- " X2185(2185),\n" +
- " X2186(2186),\n" +
- " X2187(2187),\n" +
- " X2188(2188),\n" +
- " X2189(2189),\n" +
- " X2190(2190),\n" +
- " X2191(2191),\n" +
- " X2192(2192),\n" +
- " X2193(2193),\n" +
- " X2194(2194),\n" +
- " X2195(2195),\n" +
- " X2196(2196),\n" +
- " X2197(2197),\n" +
- " X2198(2198),\n" +
- " X2199(2199),\n" +
- " X2200(2200),\n" +
- " X2201(2201),\n" +
- " X2202(2202),\n" +
- " X2203(2203),\n" +
- " X2204(2204),\n" +
- " X2205(2205),\n" +
- " X2206(2206),\n" +
- " X2207(2207),\n" +
- " X2208(2208),\n" +
- " X2209(2209),\n" +
- " X2210(2210),\n" +
- " X2211(2211),\n" +
- " X2212(2212),\n" +
- " X2213(2213),\n" +
- " X2214(2214),\n" +
- " X2215(2215),\n" +
- " X2216(2216),\n" +
- " X2217(2217),\n" +
- " X2218(2218),\n" +
- " X2219(2219),\n" +
- " X2220(2220),\n" +
- " X2221(2221),\n" +
- " X2222(2222),\n" +
- " X2223(2223),\n" +
- " X2224(2224),\n" +
- " X2225(2225),\n" +
- " X2226(2226),\n" +
- " X2227(2227),\n" +
- " X2228(2228),\n" +
- " X2229(2229),\n" +
- " X2230(2230),\n" +
- " X2231(2231),\n" +
- " X2232(2232),\n" +
- " X2233(2233),\n" +
- " X2234(2234),\n" +
- " X2235(2235),\n" +
- " X2236(2236),\n" +
- " X2237(2237),\n" +
- " X2238(2238),\n" +
- " X2239(2239),\n" +
- " X2240(2240),\n" +
- " X2241(2241),\n" +
- " X2242(2242),\n" +
- " X2243(2243),\n" +
- " X2244(2244),\n" +
- " X2245(2245),\n" +
- " X2246(2246),\n" +
- " X2247(2247),\n" +
- " X2248(2248),\n" +
- " X2249(2249),\n" +
- " X2250(2250),\n" +
- " X2251(2251),\n" +
- " X2252(2252),\n" +
- " X2253(2253),\n" +
- " X2254(2254),\n" +
- " X2255(2255),\n" +
- " X2256(2256),\n" +
- " X2257(2257),\n" +
- " X2258(2258),\n" +
- " X2259(2259),\n" +
- " X2260(2260),\n" +
- " X2261(2261),\n" +
- " X2262(2262),\n" +
- " X2263(2263),\n" +
- " X2264(2264),\n" +
- " X2265(2265),\n" +
- " X2266(2266),\n" +
- " X2267(2267),\n" +
- " X2268(2268),\n" +
- " X2269(2269),\n" +
- " X2270(2270),\n" +
- " X2271(2271),\n" +
- " X2272(2272),\n" +
- " X2273(2273),\n" +
- " X2274(2274),\n" +
- " X2275(2275),\n" +
- " X2276(2276),\n" +
- " X2277(2277),\n" +
- " X2278(2278),\n" +
- " X2279(2279),\n" +
- " X2280(2280),\n" +
- " X2281(2281),\n" +
- " X2282(2282),\n" +
- " X2283(2283),\n" +
- " X2284(2284),\n" +
- " X2285(2285),\n" +
- " X2286(2286),\n" +
- " X2287(2287),\n" +
- " X2288(2288),\n" +
- " X2289(2289),\n" +
- " X2290(2290),\n" +
- " X2291(2291),\n" +
- " X2292(2292),\n" +
- " X2293(2293),\n" +
- " X2294(2294),\n" +
- " X2295(2295),\n" +
- " X2296(2296),\n" +
- " X2297(2297),\n" +
- " X2298(2298),\n" +
- " X2299(2299),\n" +
- " X2300(2300),\n" +
- " X2301(2301),\n" +
- " X2302(2302),\n" +
- " X2303(2303),\n" +
- " X2304(2304),\n" +
- " X2305(2305),\n" +
- " X2306(2306),\n" +
- " X2307(2307),\n" +
- " X2308(2308),\n" +
- " X2309(2309),\n" +
- " X2310(2310),\n" +
- " X2311(2311),\n" +
- " X2312(2312),\n" +
- " X2313(2313),\n" +
- " X2314(2314),\n" +
- " X2315(2315),\n" +
- " X2316(2316),\n" +
- " X2317(2317),\n" +
- " X2318(2318),\n" +
- " X2319(2319),\n" +
- " X2320(2320),\n" +
- " X2321(2321),\n" +
- " X2322(2322),\n" +
- " X2323(2323),\n" +
- " X2324(2324),\n" +
- " X2325(2325),\n" +
- " X2326(2326),\n" +
- " X2327(2327),\n" +
- " X2328(2328),\n" +
- " X2329(2329),\n" +
- " X2330(2330),\n" +
- " X2331(2331),\n" +
- " X2332(2332),\n" +
- " X2333(2333),\n" +
- " X2334(2334),\n" +
- " X2335(2335),\n" +
- " X2336(2336),\n" +
- " X2337(2337),\n" +
- " X2338(2338),\n" +
- " X2339(2339),\n" +
- " X2340(2340),\n" +
- " X2341(2341),\n" +
- " X2342(2342),\n" +
- " X2343(2343),\n" +
- " X2344(2344),\n" +
- " X2345(2345),\n" +
- " X2346(2346),\n" +
- " X2347(2347),\n" +
- " X2348(2348),\n" +
- " X2349(2349),\n" +
- " X2350(2350),\n" +
- " X2351(2351),\n" +
- " X2352(2352),\n" +
- " X2353(2353),\n" +
- " X2354(2354),\n" +
- " X2355(2355),\n" +
- " X2356(2356),\n" +
- " X2357(2357),\n" +
- " X2358(2358),\n" +
- " X2359(2359),\n" +
- " X2360(2360),\n" +
- " X2361(2361),\n" +
- " X2362(2362),\n" +
- " X2363(2363),\n" +
- " X2364(2364),\n" +
- " X2365(2365),\n" +
- " X2366(2366),\n" +
- " X2367(2367),\n" +
- " X2368(2368),\n" +
- " X2369(2369),\n" +
- " X2370(2370),\n" +
- " X2371(2371),\n" +
- " X2372(2372),\n" +
- " X2373(2373),\n" +
- " X2374(2374),\n" +
- " X2375(2375),\n" +
- " X2376(2376),\n" +
- " X2377(2377),\n" +
- " X2378(2378),\n" +
- " X2379(2379),\n" +
- " X2380(2380),\n" +
- " X2381(2381),\n" +
- " X2382(2382),\n" +
- " X2383(2383),\n" +
- " X2384(2384),\n" +
- " X2385(2385),\n" +
- " X2386(2386),\n" +
- " X2387(2387),\n" +
- " X2388(2388),\n" +
- " X2389(2389),\n" +
- " X2390(2390),\n" +
- " X2391(2391),\n" +
- " X2392(2392),\n" +
- " X2393(2393),\n" +
- " X2394(2394),\n" +
- " X2395(2395),\n" +
- " X2396(2396),\n" +
- " X2397(2397),\n" +
- " X2398(2398),\n" +
- " X2399(2399),\n" +
- " X2400(2400),\n" +
- " X2401(2401),\n" +
- " X2402(2402),\n" +
- " X2403(2403),\n" +
- " X2404(2404),\n" +
- " X2405(2405),\n" +
- " X2406(2406),\n" +
- " X2407(2407),\n" +
- " X2408(2408),\n" +
- " X2409(2409),\n" +
- " X2410(2410),\n" +
- " X2411(2411),\n" +
- " X2412(2412),\n" +
- " X2413(2413),\n" +
- " X2414(2414),\n" +
- " X2415(2415),\n" +
- " X2416(2416),\n" +
- " X2417(2417),\n" +
- " X2418(2418),\n" +
- " X2419(2419),\n" +
- " X2420(2420),\n" +
- " X2421(2421),\n" +
- " X2422(2422),\n" +
- " X2423(2423),\n" +
- " X2424(2424),\n" +
- " X2425(2425),\n" +
- " X2426(2426),\n" +
- " X2427(2427),\n" +
- " X2428(2428),\n" +
- " X2429(2429),\n" +
- " X2430(2430),\n" +
- " X2431(2431),\n" +
- " X2432(2432),\n" +
- " X2433(2433),\n" +
- " X2434(2434),\n" +
- " X2435(2435),\n" +
- " X2436(2436),\n" +
- " X2437(2437),\n" +
- " X2438(2438),\n" +
- " X2439(2439),\n" +
- " X2440(2440),\n" +
- " X2441(2441),\n" +
- " X2442(2442),\n" +
- " X2443(2443),\n" +
- " X2444(2444),\n" +
- " X2445(2445),\n" +
- " X2446(2446),\n" +
- " X2447(2447),\n" +
- " X2448(2448),\n" +
- " X2449(2449),\n" +
- " X2450(2450),\n" +
- " X2451(2451),\n" +
- " X2452(2452),\n" +
- " X2453(2453),\n" +
- " X2454(2454),\n" +
- " X2455(2455),\n" +
- " X2456(2456),\n" +
- " X2457(2457),\n" +
- " X2458(2458),\n" +
- " X2459(2459),\n" +
- " X2460(2460),\n" +
- " X2461(2461),\n" +
- " X2462(2462),\n" +
- " X2463(2463),\n" +
- " X2464(2464),\n" +
- " X2465(2465),\n" +
- " X2466(2466),\n" +
- " X2467(2467),\n" +
- " X2468(2468),\n" +
- " X2469(2469),\n" +
- " X2470(2470),\n" +
- " X2471(2471),\n" +
- " X2472(2472),\n" +
- " X2473(2473),\n" +
- " X2474(2474),\n" +
- " X2475(2475),\n" +
- " X2476(2476),\n" +
- " X2477(2477),\n" +
- " X2478(2478),\n" +
- " X2479(2479),\n" +
- " X2480(2480),\n" +
- " X2481(2481),\n" +
- " X2482(2482),\n" +
- " X2483(2483),\n" +
- " X2484(2484),\n" +
- " X2485(2485),\n" +
- " X2486(2486),\n" +
- " X2487(2487),\n" +
- " X2488(2488),\n" +
- " X2489(2489),\n" +
- " X2490(2490),\n" +
- " X2491(2491),\n" +
- " X2492(2492),\n" +
- " X2493(2493),\n" +
- " X2494(2494),\n" +
- " X2495(2495),\n" +
- " X2496(2496),\n" +
- " X2497(2497),\n" +
- " X2498(2498),\n" +
- " X2499(2499),\n" +
- " ;\n" +
- "\n" +
- " private int value;\n" +
- " X(int i) {\n" +
- " this.value = i;\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " int i = 0;\n" +
- " for (X x : X.values()) {\n" +
- " i++;\n" +
- " System.out.print(x);\n" +
- " }\n" +
- " System.out.print(i);\n" +
- " }\n" +
- " \n" +
- " public String toString() {\n" +
- " return Integer.toString(this.value);\n" +
- " }\n" +
+ "public enum X {\n" +
+ " X0(0),\n" +
+ " X1(1),\n" +
+ " X2(2),\n" +
+ " X3(3),\n" +
+ " X4(4),\n" +
+ " X5(5),\n" +
+ " X6(6),\n" +
+ " X7(7),\n" +
+ " X8(8),\n" +
+ " X9(9),\n" +
+ " X10(10),\n" +
+ " X11(11),\n" +
+ " X12(12),\n" +
+ " X13(13),\n" +
+ " X14(14),\n" +
+ " X15(15),\n" +
+ " X16(16),\n" +
+ " X17(17),\n" +
+ " X18(18),\n" +
+ " X19(19),\n" +
+ " X20(20),\n" +
+ " X21(21),\n" +
+ " X22(22),\n" +
+ " X23(23),\n" +
+ " X24(24),\n" +
+ " X25(25),\n" +
+ " X26(26),\n" +
+ " X27(27),\n" +
+ " X28(28),\n" +
+ " X29(29),\n" +
+ " X30(30),\n" +
+ " X31(31),\n" +
+ " X32(32),\n" +
+ " X33(33),\n" +
+ " X34(34),\n" +
+ " X35(35),\n" +
+ " X36(36),\n" +
+ " X37(37),\n" +
+ " X38(38),\n" +
+ " X39(39),\n" +
+ " X40(40),\n" +
+ " X41(41),\n" +
+ " X42(42),\n" +
+ " X43(43),\n" +
+ " X44(44),\n" +
+ " X45(45),\n" +
+ " X46(46),\n" +
+ " X47(47),\n" +
+ " X48(48),\n" +
+ " X49(49),\n" +
+ " X50(50),\n" +
+ " X51(51),\n" +
+ " X52(52),\n" +
+ " X53(53),\n" +
+ " X54(54),\n" +
+ " X55(55),\n" +
+ " X56(56),\n" +
+ " X57(57),\n" +
+ " X58(58),\n" +
+ " X59(59),\n" +
+ " X60(60),\n" +
+ " X61(61),\n" +
+ " X62(62),\n" +
+ " X63(63),\n" +
+ " X64(64),\n" +
+ " X65(65),\n" +
+ " X66(66),\n" +
+ " X67(67),\n" +
+ " X68(68),\n" +
+ " X69(69),\n" +
+ " X70(70),\n" +
+ " X71(71),\n" +
+ " X72(72),\n" +
+ " X73(73),\n" +
+ " X74(74),\n" +
+ " X75(75),\n" +
+ " X76(76),\n" +
+ " X77(77),\n" +
+ " X78(78),\n" +
+ " X79(79),\n" +
+ " X80(80),\n" +
+ " X81(81),\n" +
+ " X82(82),\n" +
+ " X83(83),\n" +
+ " X84(84),\n" +
+ " X85(85),\n" +
+ " X86(86),\n" +
+ " X87(87),\n" +
+ " X88(88),\n" +
+ " X89(89),\n" +
+ " X90(90),\n" +
+ " X91(91),\n" +
+ " X92(92),\n" +
+ " X93(93),\n" +
+ " X94(94),\n" +
+ " X95(95),\n" +
+ " X96(96),\n" +
+ " X97(97),\n" +
+ " X98(98),\n" +
+ " X99(99),\n" +
+ " X100(100),\n" +
+ " X101(101),\n" +
+ " X102(102),\n" +
+ " X103(103),\n" +
+ " X104(104),\n" +
+ " X105(105),\n" +
+ " X106(106),\n" +
+ " X107(107),\n" +
+ " X108(108),\n" +
+ " X109(109),\n" +
+ " X110(110),\n" +
+ " X111(111),\n" +
+ " X112(112),\n" +
+ " X113(113),\n" +
+ " X114(114),\n" +
+ " X115(115),\n" +
+ " X116(116),\n" +
+ " X117(117),\n" +
+ " X118(118),\n" +
+ " X119(119),\n" +
+ " X120(120),\n" +
+ " X121(121),\n" +
+ " X122(122),\n" +
+ " X123(123),\n" +
+ " X124(124),\n" +
+ " X125(125),\n" +
+ " X126(126),\n" +
+ " X127(127),\n" +
+ " X128(128),\n" +
+ " X129(129),\n" +
+ " X130(130),\n" +
+ " X131(131),\n" +
+ " X132(132),\n" +
+ " X133(133),\n" +
+ " X134(134),\n" +
+ " X135(135),\n" +
+ " X136(136),\n" +
+ " X137(137),\n" +
+ " X138(138),\n" +
+ " X139(139),\n" +
+ " X140(140),\n" +
+ " X141(141),\n" +
+ " X142(142),\n" +
+ " X143(143),\n" +
+ " X144(144),\n" +
+ " X145(145),\n" +
+ " X146(146),\n" +
+ " X147(147),\n" +
+ " X148(148),\n" +
+ " X149(149),\n" +
+ " X150(150),\n" +
+ " X151(151),\n" +
+ " X152(152),\n" +
+ " X153(153),\n" +
+ " X154(154),\n" +
+ " X155(155),\n" +
+ " X156(156),\n" +
+ " X157(157),\n" +
+ " X158(158),\n" +
+ " X159(159),\n" +
+ " X160(160),\n" +
+ " X161(161),\n" +
+ " X162(162),\n" +
+ " X163(163),\n" +
+ " X164(164),\n" +
+ " X165(165),\n" +
+ " X166(166),\n" +
+ " X167(167),\n" +
+ " X168(168),\n" +
+ " X169(169),\n" +
+ " X170(170),\n" +
+ " X171(171),\n" +
+ " X172(172),\n" +
+ " X173(173),\n" +
+ " X174(174),\n" +
+ " X175(175),\n" +
+ " X176(176),\n" +
+ " X177(177),\n" +
+ " X178(178),\n" +
+ " X179(179),\n" +
+ " X180(180),\n" +
+ " X181(181),\n" +
+ " X182(182),\n" +
+ " X183(183),\n" +
+ " X184(184),\n" +
+ " X185(185),\n" +
+ " X186(186),\n" +
+ " X187(187),\n" +
+ " X188(188),\n" +
+ " X189(189),\n" +
+ " X190(190),\n" +
+ " X191(191),\n" +
+ " X192(192),\n" +
+ " X193(193),\n" +
+ " X194(194),\n" +
+ " X195(195),\n" +
+ " X196(196),\n" +
+ " X197(197),\n" +
+ " X198(198),\n" +
+ " X199(199),\n" +
+ " X200(200),\n" +
+ " X201(201),\n" +
+ " X202(202),\n" +
+ " X203(203),\n" +
+ " X204(204),\n" +
+ " X205(205),\n" +
+ " X206(206),\n" +
+ " X207(207),\n" +
+ " X208(208),\n" +
+ " X209(209),\n" +
+ " X210(210),\n" +
+ " X211(211),\n" +
+ " X212(212),\n" +
+ " X213(213),\n" +
+ " X214(214),\n" +
+ " X215(215),\n" +
+ " X216(216),\n" +
+ " X217(217),\n" +
+ " X218(218),\n" +
+ " X219(219),\n" +
+ " X220(220),\n" +
+ " X221(221),\n" +
+ " X222(222),\n" +
+ " X223(223),\n" +
+ " X224(224),\n" +
+ " X225(225),\n" +
+ " X226(226),\n" +
+ " X227(227),\n" +
+ " X228(228),\n" +
+ " X229(229),\n" +
+ " X230(230),\n" +
+ " X231(231),\n" +
+ " X232(232),\n" +
+ " X233(233),\n" +
+ " X234(234),\n" +
+ " X235(235),\n" +
+ " X236(236),\n" +
+ " X237(237),\n" +
+ " X238(238),\n" +
+ " X239(239),\n" +
+ " X240(240),\n" +
+ " X241(241),\n" +
+ " X242(242),\n" +
+ " X243(243),\n" +
+ " X244(244),\n" +
+ " X245(245),\n" +
+ " X246(246),\n" +
+ " X247(247),\n" +
+ " X248(248),\n" +
+ " X249(249),\n" +
+ " X250(250),\n" +
+ " X251(251),\n" +
+ " X252(252),\n" +
+ " X253(253),\n" +
+ " X254(254),\n" +
+ " X255(255),\n" +
+ " X256(256),\n" +
+ " X257(257),\n" +
+ " X258(258),\n" +
+ " X259(259),\n" +
+ " X260(260),\n" +
+ " X261(261),\n" +
+ " X262(262),\n" +
+ " X263(263),\n" +
+ " X264(264),\n" +
+ " X265(265),\n" +
+ " X266(266),\n" +
+ " X267(267),\n" +
+ " X268(268),\n" +
+ " X269(269),\n" +
+ " X270(270),\n" +
+ " X271(271),\n" +
+ " X272(272),\n" +
+ " X273(273),\n" +
+ " X274(274),\n" +
+ " X275(275),\n" +
+ " X276(276),\n" +
+ " X277(277),\n" +
+ " X278(278),\n" +
+ " X279(279),\n" +
+ " X280(280),\n" +
+ " X281(281),\n" +
+ " X282(282),\n" +
+ " X283(283),\n" +
+ " X284(284),\n" +
+ " X285(285),\n" +
+ " X286(286),\n" +
+ " X287(287),\n" +
+ " X288(288),\n" +
+ " X289(289),\n" +
+ " X290(290),\n" +
+ " X291(291),\n" +
+ " X292(292),\n" +
+ " X293(293),\n" +
+ " X294(294),\n" +
+ " X295(295),\n" +
+ " X296(296),\n" +
+ " X297(297),\n" +
+ " X298(298),\n" +
+ " X299(299),\n" +
+ " X300(300),\n" +
+ " X301(301),\n" +
+ " X302(302),\n" +
+ " X303(303),\n" +
+ " X304(304),\n" +
+ " X305(305),\n" +
+ " X306(306),\n" +
+ " X307(307),\n" +
+ " X308(308),\n" +
+ " X309(309),\n" +
+ " X310(310),\n" +
+ " X311(311),\n" +
+ " X312(312),\n" +
+ " X313(313),\n" +
+ " X314(314),\n" +
+ " X315(315),\n" +
+ " X316(316),\n" +
+ " X317(317),\n" +
+ " X318(318),\n" +
+ " X319(319),\n" +
+ " X320(320),\n" +
+ " X321(321),\n" +
+ " X322(322),\n" +
+ " X323(323),\n" +
+ " X324(324),\n" +
+ " X325(325),\n" +
+ " X326(326),\n" +
+ " X327(327),\n" +
+ " X328(328),\n" +
+ " X329(329),\n" +
+ " X330(330),\n" +
+ " X331(331),\n" +
+ " X332(332),\n" +
+ " X333(333),\n" +
+ " X334(334),\n" +
+ " X335(335),\n" +
+ " X336(336),\n" +
+ " X337(337),\n" +
+ " X338(338),\n" +
+ " X339(339),\n" +
+ " X340(340),\n" +
+ " X341(341),\n" +
+ " X342(342),\n" +
+ " X343(343),\n" +
+ " X344(344),\n" +
+ " X345(345),\n" +
+ " X346(346),\n" +
+ " X347(347),\n" +
+ " X348(348),\n" +
+ " X349(349),\n" +
+ " X350(350),\n" +
+ " X351(351),\n" +
+ " X352(352),\n" +
+ " X353(353),\n" +
+ " X354(354),\n" +
+ " X355(355),\n" +
+ " X356(356),\n" +
+ " X357(357),\n" +
+ " X358(358),\n" +
+ " X359(359),\n" +
+ " X360(360),\n" +
+ " X361(361),\n" +
+ " X362(362),\n" +
+ " X363(363),\n" +
+ " X364(364),\n" +
+ " X365(365),\n" +
+ " X366(366),\n" +
+ " X367(367),\n" +
+ " X368(368),\n" +
+ " X369(369),\n" +
+ " X370(370),\n" +
+ " X371(371),\n" +
+ " X372(372),\n" +
+ " X373(373),\n" +
+ " X374(374),\n" +
+ " X375(375),\n" +
+ " X376(376),\n" +
+ " X377(377),\n" +
+ " X378(378),\n" +
+ " X379(379),\n" +
+ " X380(380),\n" +
+ " X381(381),\n" +
+ " X382(382),\n" +
+ " X383(383),\n" +
+ " X384(384),\n" +
+ " X385(385),\n" +
+ " X386(386),\n" +
+ " X387(387),\n" +
+ " X388(388),\n" +
+ " X389(389),\n" +
+ " X390(390),\n" +
+ " X391(391),\n" +
+ " X392(392),\n" +
+ " X393(393),\n" +
+ " X394(394),\n" +
+ " X395(395),\n" +
+ " X396(396),\n" +
+ " X397(397),\n" +
+ " X398(398),\n" +
+ " X399(399),\n" +
+ " X400(400),\n" +
+ " X401(401),\n" +
+ " X402(402),\n" +
+ " X403(403),\n" +
+ " X404(404),\n" +
+ " X405(405),\n" +
+ " X406(406),\n" +
+ " X407(407),\n" +
+ " X408(408),\n" +
+ " X409(409),\n" +
+ " X410(410),\n" +
+ " X411(411),\n" +
+ " X412(412),\n" +
+ " X413(413),\n" +
+ " X414(414),\n" +
+ " X415(415),\n" +
+ " X416(416),\n" +
+ " X417(417),\n" +
+ " X418(418),\n" +
+ " X419(419),\n" +
+ " X420(420),\n" +
+ " X421(421),\n" +
+ " X422(422),\n" +
+ " X423(423),\n" +
+ " X424(424),\n" +
+ " X425(425),\n" +
+ " X426(426),\n" +
+ " X427(427),\n" +
+ " X428(428),\n" +
+ " X429(429),\n" +
+ " X430(430),\n" +
+ " X431(431),\n" +
+ " X432(432),\n" +
+ " X433(433),\n" +
+ " X434(434),\n" +
+ " X435(435),\n" +
+ " X436(436),\n" +
+ " X437(437),\n" +
+ " X438(438),\n" +
+ " X439(439),\n" +
+ " X440(440),\n" +
+ " X441(441),\n" +
+ " X442(442),\n" +
+ " X443(443),\n" +
+ " X444(444),\n" +
+ " X445(445),\n" +
+ " X446(446),\n" +
+ " X447(447),\n" +
+ " X448(448),\n" +
+ " X449(449),\n" +
+ " X450(450),\n" +
+ " X451(451),\n" +
+ " X452(452),\n" +
+ " X453(453),\n" +
+ " X454(454),\n" +
+ " X455(455),\n" +
+ " X456(456),\n" +
+ " X457(457),\n" +
+ " X458(458),\n" +
+ " X459(459),\n" +
+ " X460(460),\n" +
+ " X461(461),\n" +
+ " X462(462),\n" +
+ " X463(463),\n" +
+ " X464(464),\n" +
+ " X465(465),\n" +
+ " X466(466),\n" +
+ " X467(467),\n" +
+ " X468(468),\n" +
+ " X469(469),\n" +
+ " X470(470),\n" +
+ " X471(471),\n" +
+ " X472(472),\n" +
+ " X473(473),\n" +
+ " X474(474),\n" +
+ " X475(475),\n" +
+ " X476(476),\n" +
+ " X477(477),\n" +
+ " X478(478),\n" +
+ " X479(479),\n" +
+ " X480(480),\n" +
+ " X481(481),\n" +
+ " X482(482),\n" +
+ " X483(483),\n" +
+ " X484(484),\n" +
+ " X485(485),\n" +
+ " X486(486),\n" +
+ " X487(487),\n" +
+ " X488(488),\n" +
+ " X489(489),\n" +
+ " X490(490),\n" +
+ " X491(491),\n" +
+ " X492(492),\n" +
+ " X493(493),\n" +
+ " X494(494),\n" +
+ " X495(495),\n" +
+ " X496(496),\n" +
+ " X497(497),\n" +
+ " X498(498),\n" +
+ " X499(499),\n" +
+ " X500(500),\n" +
+ " X501(501),\n" +
+ " X502(502),\n" +
+ " X503(503),\n" +
+ " X504(504),\n" +
+ " X505(505),\n" +
+ " X506(506),\n" +
+ " X507(507),\n" +
+ " X508(508),\n" +
+ " X509(509),\n" +
+ " X510(510),\n" +
+ " X511(511),\n" +
+ " X512(512),\n" +
+ " X513(513),\n" +
+ " X514(514),\n" +
+ " X515(515),\n" +
+ " X516(516),\n" +
+ " X517(517),\n" +
+ " X518(518),\n" +
+ " X519(519),\n" +
+ " X520(520),\n" +
+ " X521(521),\n" +
+ " X522(522),\n" +
+ " X523(523),\n" +
+ " X524(524),\n" +
+ " X525(525),\n" +
+ " X526(526),\n" +
+ " X527(527),\n" +
+ " X528(528),\n" +
+ " X529(529),\n" +
+ " X530(530),\n" +
+ " X531(531),\n" +
+ " X532(532),\n" +
+ " X533(533),\n" +
+ " X534(534),\n" +
+ " X535(535),\n" +
+ " X536(536),\n" +
+ " X537(537),\n" +
+ " X538(538),\n" +
+ " X539(539),\n" +
+ " X540(540),\n" +
+ " X541(541),\n" +
+ " X542(542),\n" +
+ " X543(543),\n" +
+ " X544(544),\n" +
+ " X545(545),\n" +
+ " X546(546),\n" +
+ " X547(547),\n" +
+ " X548(548),\n" +
+ " X549(549),\n" +
+ " X550(550),\n" +
+ " X551(551),\n" +
+ " X552(552),\n" +
+ " X553(553),\n" +
+ " X554(554),\n" +
+ " X555(555),\n" +
+ " X556(556),\n" +
+ " X557(557),\n" +
+ " X558(558),\n" +
+ " X559(559),\n" +
+ " X560(560),\n" +
+ " X561(561),\n" +
+ " X562(562),\n" +
+ " X563(563),\n" +
+ " X564(564),\n" +
+ " X565(565),\n" +
+ " X566(566),\n" +
+ " X567(567),\n" +
+ " X568(568),\n" +
+ " X569(569),\n" +
+ " X570(570),\n" +
+ " X571(571),\n" +
+ " X572(572),\n" +
+ " X573(573),\n" +
+ " X574(574),\n" +
+ " X575(575),\n" +
+ " X576(576),\n" +
+ " X577(577),\n" +
+ " X578(578),\n" +
+ " X579(579),\n" +
+ " X580(580),\n" +
+ " X581(581),\n" +
+ " X582(582),\n" +
+ " X583(583),\n" +
+ " X584(584),\n" +
+ " X585(585),\n" +
+ " X586(586),\n" +
+ " X587(587),\n" +
+ " X588(588),\n" +
+ " X589(589),\n" +
+ " X590(590),\n" +
+ " X591(591),\n" +
+ " X592(592),\n" +
+ " X593(593),\n" +
+ " X594(594),\n" +
+ " X595(595),\n" +
+ " X596(596),\n" +
+ " X597(597),\n" +
+ " X598(598),\n" +
+ " X599(599),\n" +
+ " X600(600),\n" +
+ " X601(601),\n" +
+ " X602(602),\n" +
+ " X603(603),\n" +
+ " X604(604),\n" +
+ " X605(605),\n" +
+ " X606(606),\n" +
+ " X607(607),\n" +
+ " X608(608),\n" +
+ " X609(609),\n" +
+ " X610(610),\n" +
+ " X611(611),\n" +
+ " X612(612),\n" +
+ " X613(613),\n" +
+ " X614(614),\n" +
+ " X615(615),\n" +
+ " X616(616),\n" +
+ " X617(617),\n" +
+ " X618(618),\n" +
+ " X619(619),\n" +
+ " X620(620),\n" +
+ " X621(621),\n" +
+ " X622(622),\n" +
+ " X623(623),\n" +
+ " X624(624),\n" +
+ " X625(625),\n" +
+ " X626(626),\n" +
+ " X627(627),\n" +
+ " X628(628),\n" +
+ " X629(629),\n" +
+ " X630(630),\n" +
+ " X631(631),\n" +
+ " X632(632),\n" +
+ " X633(633),\n" +
+ " X634(634),\n" +
+ " X635(635),\n" +
+ " X636(636),\n" +
+ " X637(637),\n" +
+ " X638(638),\n" +
+ " X639(639),\n" +
+ " X640(640),\n" +
+ " X641(641),\n" +
+ " X642(642),\n" +
+ " X643(643),\n" +
+ " X644(644),\n" +
+ " X645(645),\n" +
+ " X646(646),\n" +
+ " X647(647),\n" +
+ " X648(648),\n" +
+ " X649(649),\n" +
+ " X650(650),\n" +
+ " X651(651),\n" +
+ " X652(652),\n" +
+ " X653(653),\n" +
+ " X654(654),\n" +
+ " X655(655),\n" +
+ " X656(656),\n" +
+ " X657(657),\n" +
+ " X658(658),\n" +
+ " X659(659),\n" +
+ " X660(660),\n" +
+ " X661(661),\n" +
+ " X662(662),\n" +
+ " X663(663),\n" +
+ " X664(664),\n" +
+ " X665(665),\n" +
+ " X666(666),\n" +
+ " X667(667),\n" +
+ " X668(668),\n" +
+ " X669(669),\n" +
+ " X670(670),\n" +
+ " X671(671),\n" +
+ " X672(672),\n" +
+ " X673(673),\n" +
+ " X674(674),\n" +
+ " X675(675),\n" +
+ " X676(676),\n" +
+ " X677(677),\n" +
+ " X678(678),\n" +
+ " X679(679),\n" +
+ " X680(680),\n" +
+ " X681(681),\n" +
+ " X682(682),\n" +
+ " X683(683),\n" +
+ " X684(684),\n" +
+ " X685(685),\n" +
+ " X686(686),\n" +
+ " X687(687),\n" +
+ " X688(688),\n" +
+ " X689(689),\n" +
+ " X690(690),\n" +
+ " X691(691),\n" +
+ " X692(692),\n" +
+ " X693(693),\n" +
+ " X694(694),\n" +
+ " X695(695),\n" +
+ " X696(696),\n" +
+ " X697(697),\n" +
+ " X698(698),\n" +
+ " X699(699),\n" +
+ " X700(700),\n" +
+ " X701(701),\n" +
+ " X702(702),\n" +
+ " X703(703),\n" +
+ " X704(704),\n" +
+ " X705(705),\n" +
+ " X706(706),\n" +
+ " X707(707),\n" +
+ " X708(708),\n" +
+ " X709(709),\n" +
+ " X710(710),\n" +
+ " X711(711),\n" +
+ " X712(712),\n" +
+ " X713(713),\n" +
+ " X714(714),\n" +
+ " X715(715),\n" +
+ " X716(716),\n" +
+ " X717(717),\n" +
+ " X718(718),\n" +
+ " X719(719),\n" +
+ " X720(720),\n" +
+ " X721(721),\n" +
+ " X722(722),\n" +
+ " X723(723),\n" +
+ " X724(724),\n" +
+ " X725(725),\n" +
+ " X726(726),\n" +
+ " X727(727),\n" +
+ " X728(728),\n" +
+ " X729(729),\n" +
+ " X730(730),\n" +
+ " X731(731),\n" +
+ " X732(732),\n" +
+ " X733(733),\n" +
+ " X734(734),\n" +
+ " X735(735),\n" +
+ " X736(736),\n" +
+ " X737(737),\n" +
+ " X738(738),\n" +
+ " X739(739),\n" +
+ " X740(740),\n" +
+ " X741(741),\n" +
+ " X742(742),\n" +
+ " X743(743),\n" +
+ " X744(744),\n" +
+ " X745(745),\n" +
+ " X746(746),\n" +
+ " X747(747),\n" +
+ " X748(748),\n" +
+ " X749(749),\n" +
+ " X750(750),\n" +
+ " X751(751),\n" +
+ " X752(752),\n" +
+ " X753(753),\n" +
+ " X754(754),\n" +
+ " X755(755),\n" +
+ " X756(756),\n" +
+ " X757(757),\n" +
+ " X758(758),\n" +
+ " X759(759),\n" +
+ " X760(760),\n" +
+ " X761(761),\n" +
+ " X762(762),\n" +
+ " X763(763),\n" +
+ " X764(764),\n" +
+ " X765(765),\n" +
+ " X766(766),\n" +
+ " X767(767),\n" +
+ " X768(768),\n" +
+ " X769(769),\n" +
+ " X770(770),\n" +
+ " X771(771),\n" +
+ " X772(772),\n" +
+ " X773(773),\n" +
+ " X774(774),\n" +
+ " X775(775),\n" +
+ " X776(776),\n" +
+ " X777(777),\n" +
+ " X778(778),\n" +
+ " X779(779),\n" +
+ " X780(780),\n" +
+ " X781(781),\n" +
+ " X782(782),\n" +
+ " X783(783),\n" +
+ " X784(784),\n" +
+ " X785(785),\n" +
+ " X786(786),\n" +
+ " X787(787),\n" +
+ " X788(788),\n" +
+ " X789(789),\n" +
+ " X790(790),\n" +
+ " X791(791),\n" +
+ " X792(792),\n" +
+ " X793(793),\n" +
+ " X794(794),\n" +
+ " X795(795),\n" +
+ " X796(796),\n" +
+ " X797(797),\n" +
+ " X798(798),\n" +
+ " X799(799),\n" +
+ " X800(800),\n" +
+ " X801(801),\n" +
+ " X802(802),\n" +
+ " X803(803),\n" +
+ " X804(804),\n" +
+ " X805(805),\n" +
+ " X806(806),\n" +
+ " X807(807),\n" +
+ " X808(808),\n" +
+ " X809(809),\n" +
+ " X810(810),\n" +
+ " X811(811),\n" +
+ " X812(812),\n" +
+ " X813(813),\n" +
+ " X814(814),\n" +
+ " X815(815),\n" +
+ " X816(816),\n" +
+ " X817(817),\n" +
+ " X818(818),\n" +
+ " X819(819),\n" +
+ " X820(820),\n" +
+ " X821(821),\n" +
+ " X822(822),\n" +
+ " X823(823),\n" +
+ " X824(824),\n" +
+ " X825(825),\n" +
+ " X826(826),\n" +
+ " X827(827),\n" +
+ " X828(828),\n" +
+ " X829(829),\n" +
+ " X830(830),\n" +
+ " X831(831),\n" +
+ " X832(832),\n" +
+ " X833(833),\n" +
+ " X834(834),\n" +
+ " X835(835),\n" +
+ " X836(836),\n" +
+ " X837(837),\n" +
+ " X838(838),\n" +
+ " X839(839),\n" +
+ " X840(840),\n" +
+ " X841(841),\n" +
+ " X842(842),\n" +
+ " X843(843),\n" +
+ " X844(844),\n" +
+ " X845(845),\n" +
+ " X846(846),\n" +
+ " X847(847),\n" +
+ " X848(848),\n" +
+ " X849(849),\n" +
+ " X850(850),\n" +
+ " X851(851),\n" +
+ " X852(852),\n" +
+ " X853(853),\n" +
+ " X854(854),\n" +
+ " X855(855),\n" +
+ " X856(856),\n" +
+ " X857(857),\n" +
+ " X858(858),\n" +
+ " X859(859),\n" +
+ " X860(860),\n" +
+ " X861(861),\n" +
+ " X862(862),\n" +
+ " X863(863),\n" +
+ " X864(864),\n" +
+ " X865(865),\n" +
+ " X866(866),\n" +
+ " X867(867),\n" +
+ " X868(868),\n" +
+ " X869(869),\n" +
+ " X870(870),\n" +
+ " X871(871),\n" +
+ " X872(872),\n" +
+ " X873(873),\n" +
+ " X874(874),\n" +
+ " X875(875),\n" +
+ " X876(876),\n" +
+ " X877(877),\n" +
+ " X878(878),\n" +
+ " X879(879),\n" +
+ " X880(880),\n" +
+ " X881(881),\n" +
+ " X882(882),\n" +
+ " X883(883),\n" +
+ " X884(884),\n" +
+ " X885(885),\n" +
+ " X886(886),\n" +
+ " X887(887),\n" +
+ " X888(888),\n" +
+ " X889(889),\n" +
+ " X890(890),\n" +
+ " X891(891),\n" +
+ " X892(892),\n" +
+ " X893(893),\n" +
+ " X894(894),\n" +
+ " X895(895),\n" +
+ " X896(896),\n" +
+ " X897(897),\n" +
+ " X898(898),\n" +
+ " X899(899),\n" +
+ " X900(900),\n" +
+ " X901(901),\n" +
+ " X902(902),\n" +
+ " X903(903),\n" +
+ " X904(904),\n" +
+ " X905(905),\n" +
+ " X906(906),\n" +
+ " X907(907),\n" +
+ " X908(908),\n" +
+ " X909(909),\n" +
+ " X910(910),\n" +
+ " X911(911),\n" +
+ " X912(912),\n" +
+ " X913(913),\n" +
+ " X914(914),\n" +
+ " X915(915),\n" +
+ " X916(916),\n" +
+ " X917(917),\n" +
+ " X918(918),\n" +
+ " X919(919),\n" +
+ " X920(920),\n" +
+ " X921(921),\n" +
+ " X922(922),\n" +
+ " X923(923),\n" +
+ " X924(924),\n" +
+ " X925(925),\n" +
+ " X926(926),\n" +
+ " X927(927),\n" +
+ " X928(928),\n" +
+ " X929(929),\n" +
+ " X930(930),\n" +
+ " X931(931),\n" +
+ " X932(932),\n" +
+ " X933(933),\n" +
+ " X934(934),\n" +
+ " X935(935),\n" +
+ " X936(936),\n" +
+ " X937(937),\n" +
+ " X938(938),\n" +
+ " X939(939),\n" +
+ " X940(940),\n" +
+ " X941(941),\n" +
+ " X942(942),\n" +
+ " X943(943),\n" +
+ " X944(944),\n" +
+ " X945(945),\n" +
+ " X946(946),\n" +
+ " X947(947),\n" +
+ " X948(948),\n" +
+ " X949(949),\n" +
+ " X950(950),\n" +
+ " X951(951),\n" +
+ " X952(952),\n" +
+ " X953(953),\n" +
+ " X954(954),\n" +
+ " X955(955),\n" +
+ " X956(956),\n" +
+ " X957(957),\n" +
+ " X958(958),\n" +
+ " X959(959),\n" +
+ " X960(960),\n" +
+ " X961(961),\n" +
+ " X962(962),\n" +
+ " X963(963),\n" +
+ " X964(964),\n" +
+ " X965(965),\n" +
+ " X966(966),\n" +
+ " X967(967),\n" +
+ " X968(968),\n" +
+ " X969(969),\n" +
+ " X970(970),\n" +
+ " X971(971),\n" +
+ " X972(972),\n" +
+ " X973(973),\n" +
+ " X974(974),\n" +
+ " X975(975),\n" +
+ " X976(976),\n" +
+ " X977(977),\n" +
+ " X978(978),\n" +
+ " X979(979),\n" +
+ " X980(980),\n" +
+ " X981(981),\n" +
+ " X982(982),\n" +
+ " X983(983),\n" +
+ " X984(984),\n" +
+ " X985(985),\n" +
+ " X986(986),\n" +
+ " X987(987),\n" +
+ " X988(988),\n" +
+ " X989(989),\n" +
+ " X990(990),\n" +
+ " X991(991),\n" +
+ " X992(992),\n" +
+ " X993(993),\n" +
+ " X994(994),\n" +
+ " X995(995),\n" +
+ " X996(996),\n" +
+ " X997(997),\n" +
+ " X998(998),\n" +
+ " X999(999),\n" +
+ " X1000(1000),\n" +
+ " X1001(1001),\n" +
+ " X1002(1002),\n" +
+ " X1003(1003),\n" +
+ " X1004(1004),\n" +
+ " X1005(1005),\n" +
+ " X1006(1006),\n" +
+ " X1007(1007),\n" +
+ " X1008(1008),\n" +
+ " X1009(1009),\n" +
+ " X1010(1010),\n" +
+ " X1011(1011),\n" +
+ " X1012(1012),\n" +
+ " X1013(1013),\n" +
+ " X1014(1014),\n" +
+ " X1015(1015),\n" +
+ " X1016(1016),\n" +
+ " X1017(1017),\n" +
+ " X1018(1018),\n" +
+ " X1019(1019),\n" +
+ " X1020(1020),\n" +
+ " X1021(1021),\n" +
+ " X1022(1022),\n" +
+ " X1023(1023),\n" +
+ " X1024(1024),\n" +
+ " X1025(1025),\n" +
+ " X1026(1026),\n" +
+ " X1027(1027),\n" +
+ " X1028(1028),\n" +
+ " X1029(1029),\n" +
+ " X1030(1030),\n" +
+ " X1031(1031),\n" +
+ " X1032(1032),\n" +
+ " X1033(1033),\n" +
+ " X1034(1034),\n" +
+ " X1035(1035),\n" +
+ " X1036(1036),\n" +
+ " X1037(1037),\n" +
+ " X1038(1038),\n" +
+ " X1039(1039),\n" +
+ " X1040(1040),\n" +
+ " X1041(1041),\n" +
+ " X1042(1042),\n" +
+ " X1043(1043),\n" +
+ " X1044(1044),\n" +
+ " X1045(1045),\n" +
+ " X1046(1046),\n" +
+ " X1047(1047),\n" +
+ " X1048(1048),\n" +
+ " X1049(1049),\n" +
+ " X1050(1050),\n" +
+ " X1051(1051),\n" +
+ " X1052(1052),\n" +
+ " X1053(1053),\n" +
+ " X1054(1054),\n" +
+ " X1055(1055),\n" +
+ " X1056(1056),\n" +
+ " X1057(1057),\n" +
+ " X1058(1058),\n" +
+ " X1059(1059),\n" +
+ " X1060(1060),\n" +
+ " X1061(1061),\n" +
+ " X1062(1062),\n" +
+ " X1063(1063),\n" +
+ " X1064(1064),\n" +
+ " X1065(1065),\n" +
+ " X1066(1066),\n" +
+ " X1067(1067),\n" +
+ " X1068(1068),\n" +
+ " X1069(1069),\n" +
+ " X1070(1070),\n" +
+ " X1071(1071),\n" +
+ " X1072(1072),\n" +
+ " X1073(1073),\n" +
+ " X1074(1074),\n" +
+ " X1075(1075),\n" +
+ " X1076(1076),\n" +
+ " X1077(1077),\n" +
+ " X1078(1078),\n" +
+ " X1079(1079),\n" +
+ " X1080(1080),\n" +
+ " X1081(1081),\n" +
+ " X1082(1082),\n" +
+ " X1083(1083),\n" +
+ " X1084(1084),\n" +
+ " X1085(1085),\n" +
+ " X1086(1086),\n" +
+ " X1087(1087),\n" +
+ " X1088(1088),\n" +
+ " X1089(1089),\n" +
+ " X1090(1090),\n" +
+ " X1091(1091),\n" +
+ " X1092(1092),\n" +
+ " X1093(1093),\n" +
+ " X1094(1094),\n" +
+ " X1095(1095),\n" +
+ " X1096(1096),\n" +
+ " X1097(1097),\n" +
+ " X1098(1098),\n" +
+ " X1099(1099),\n" +
+ " X1100(1100),\n" +
+ " X1101(1101),\n" +
+ " X1102(1102),\n" +
+ " X1103(1103),\n" +
+ " X1104(1104),\n" +
+ " X1105(1105),\n" +
+ " X1106(1106),\n" +
+ " X1107(1107),\n" +
+ " X1108(1108),\n" +
+ " X1109(1109),\n" +
+ " X1110(1110),\n" +
+ " X1111(1111),\n" +
+ " X1112(1112),\n" +
+ " X1113(1113),\n" +
+ " X1114(1114),\n" +
+ " X1115(1115),\n" +
+ " X1116(1116),\n" +
+ " X1117(1117),\n" +
+ " X1118(1118),\n" +
+ " X1119(1119),\n" +
+ " X1120(1120),\n" +
+ " X1121(1121),\n" +
+ " X1122(1122),\n" +
+ " X1123(1123),\n" +
+ " X1124(1124),\n" +
+ " X1125(1125),\n" +
+ " X1126(1126),\n" +
+ " X1127(1127),\n" +
+ " X1128(1128),\n" +
+ " X1129(1129),\n" +
+ " X1130(1130),\n" +
+ " X1131(1131),\n" +
+ " X1132(1132),\n" +
+ " X1133(1133),\n" +
+ " X1134(1134),\n" +
+ " X1135(1135),\n" +
+ " X1136(1136),\n" +
+ " X1137(1137),\n" +
+ " X1138(1138),\n" +
+ " X1139(1139),\n" +
+ " X1140(1140),\n" +
+ " X1141(1141),\n" +
+ " X1142(1142),\n" +
+ " X1143(1143),\n" +
+ " X1144(1144),\n" +
+ " X1145(1145),\n" +
+ " X1146(1146),\n" +
+ " X1147(1147),\n" +
+ " X1148(1148),\n" +
+ " X1149(1149),\n" +
+ " X1150(1150),\n" +
+ " X1151(1151),\n" +
+ " X1152(1152),\n" +
+ " X1153(1153),\n" +
+ " X1154(1154),\n" +
+ " X1155(1155),\n" +
+ " X1156(1156),\n" +
+ " X1157(1157),\n" +
+ " X1158(1158),\n" +
+ " X1159(1159),\n" +
+ " X1160(1160),\n" +
+ " X1161(1161),\n" +
+ " X1162(1162),\n" +
+ " X1163(1163),\n" +
+ " X1164(1164),\n" +
+ " X1165(1165),\n" +
+ " X1166(1166),\n" +
+ " X1167(1167),\n" +
+ " X1168(1168),\n" +
+ " X1169(1169),\n" +
+ " X1170(1170),\n" +
+ " X1171(1171),\n" +
+ " X1172(1172),\n" +
+ " X1173(1173),\n" +
+ " X1174(1174),\n" +
+ " X1175(1175),\n" +
+ " X1176(1176),\n" +
+ " X1177(1177),\n" +
+ " X1178(1178),\n" +
+ " X1179(1179),\n" +
+ " X1180(1180),\n" +
+ " X1181(1181),\n" +
+ " X1182(1182),\n" +
+ " X1183(1183),\n" +
+ " X1184(1184),\n" +
+ " X1185(1185),\n" +
+ " X1186(1186),\n" +
+ " X1187(1187),\n" +
+ " X1188(1188),\n" +
+ " X1189(1189),\n" +
+ " X1190(1190),\n" +
+ " X1191(1191),\n" +
+ " X1192(1192),\n" +
+ " X1193(1193),\n" +
+ " X1194(1194),\n" +
+ " X1195(1195),\n" +
+ " X1196(1196),\n" +
+ " X1197(1197),\n" +
+ " X1198(1198),\n" +
+ " X1199(1199),\n" +
+ " X1200(1200),\n" +
+ " X1201(1201),\n" +
+ " X1202(1202),\n" +
+ " X1203(1203),\n" +
+ " X1204(1204),\n" +
+ " X1205(1205),\n" +
+ " X1206(1206),\n" +
+ " X1207(1207),\n" +
+ " X1208(1208),\n" +
+ " X1209(1209),\n" +
+ " X1210(1210),\n" +
+ " X1211(1211),\n" +
+ " X1212(1212),\n" +
+ " X1213(1213),\n" +
+ " X1214(1214),\n" +
+ " X1215(1215),\n" +
+ " X1216(1216),\n" +
+ " X1217(1217),\n" +
+ " X1218(1218),\n" +
+ " X1219(1219),\n" +
+ " X1220(1220),\n" +
+ " X1221(1221),\n" +
+ " X1222(1222),\n" +
+ " X1223(1223),\n" +
+ " X1224(1224),\n" +
+ " X1225(1225),\n" +
+ " X1226(1226),\n" +
+ " X1227(1227),\n" +
+ " X1228(1228),\n" +
+ " X1229(1229),\n" +
+ " X1230(1230),\n" +
+ " X1231(1231),\n" +
+ " X1232(1232),\n" +
+ " X1233(1233),\n" +
+ " X1234(1234),\n" +
+ " X1235(1235),\n" +
+ " X1236(1236),\n" +
+ " X1237(1237),\n" +
+ " X1238(1238),\n" +
+ " X1239(1239),\n" +
+ " X1240(1240),\n" +
+ " X1241(1241),\n" +
+ " X1242(1242),\n" +
+ " X1243(1243),\n" +
+ " X1244(1244),\n" +
+ " X1245(1245),\n" +
+ " X1246(1246),\n" +
+ " X1247(1247),\n" +
+ " X1248(1248),\n" +
+ " X1249(1249),\n" +
+ " X1250(1250),\n" +
+ " X1251(1251),\n" +
+ " X1252(1252),\n" +
+ " X1253(1253),\n" +
+ " X1254(1254),\n" +
+ " X1255(1255),\n" +
+ " X1256(1256),\n" +
+ " X1257(1257),\n" +
+ " X1258(1258),\n" +
+ " X1259(1259),\n" +
+ " X1260(1260),\n" +
+ " X1261(1261),\n" +
+ " X1262(1262),\n" +
+ " X1263(1263),\n" +
+ " X1264(1264),\n" +
+ " X1265(1265),\n" +
+ " X1266(1266),\n" +
+ " X1267(1267),\n" +
+ " X1268(1268),\n" +
+ " X1269(1269),\n" +
+ " X1270(1270),\n" +
+ " X1271(1271),\n" +
+ " X1272(1272),\n" +
+ " X1273(1273),\n" +
+ " X1274(1274),\n" +
+ " X1275(1275),\n" +
+ " X1276(1276),\n" +
+ " X1277(1277),\n" +
+ " X1278(1278),\n" +
+ " X1279(1279),\n" +
+ " X1280(1280),\n" +
+ " X1281(1281),\n" +
+ " X1282(1282),\n" +
+ " X1283(1283),\n" +
+ " X1284(1284),\n" +
+ " X1285(1285),\n" +
+ " X1286(1286),\n" +
+ " X1287(1287),\n" +
+ " X1288(1288),\n" +
+ " X1289(1289),\n" +
+ " X1290(1290),\n" +
+ " X1291(1291),\n" +
+ " X1292(1292),\n" +
+ " X1293(1293),\n" +
+ " X1294(1294),\n" +
+ " X1295(1295),\n" +
+ " X1296(1296),\n" +
+ " X1297(1297),\n" +
+ " X1298(1298),\n" +
+ " X1299(1299),\n" +
+ " X1300(1300),\n" +
+ " X1301(1301),\n" +
+ " X1302(1302),\n" +
+ " X1303(1303),\n" +
+ " X1304(1304),\n" +
+ " X1305(1305),\n" +
+ " X1306(1306),\n" +
+ " X1307(1307),\n" +
+ " X1308(1308),\n" +
+ " X1309(1309),\n" +
+ " X1310(1310),\n" +
+ " X1311(1311),\n" +
+ " X1312(1312),\n" +
+ " X1313(1313),\n" +
+ " X1314(1314),\n" +
+ " X1315(1315),\n" +
+ " X1316(1316),\n" +
+ " X1317(1317),\n" +
+ " X1318(1318),\n" +
+ " X1319(1319),\n" +
+ " X1320(1320),\n" +
+ " X1321(1321),\n" +
+ " X1322(1322),\n" +
+ " X1323(1323),\n" +
+ " X1324(1324),\n" +
+ " X1325(1325),\n" +
+ " X1326(1326),\n" +
+ " X1327(1327),\n" +
+ " X1328(1328),\n" +
+ " X1329(1329),\n" +
+ " X1330(1330),\n" +
+ " X1331(1331),\n" +
+ " X1332(1332),\n" +
+ " X1333(1333),\n" +
+ " X1334(1334),\n" +
+ " X1335(1335),\n" +
+ " X1336(1336),\n" +
+ " X1337(1337),\n" +
+ " X1338(1338),\n" +
+ " X1339(1339),\n" +
+ " X1340(1340),\n" +
+ " X1341(1341),\n" +
+ " X1342(1342),\n" +
+ " X1343(1343),\n" +
+ " X1344(1344),\n" +
+ " X1345(1345),\n" +
+ " X1346(1346),\n" +
+ " X1347(1347),\n" +
+ " X1348(1348),\n" +
+ " X1349(1349),\n" +
+ " X1350(1350),\n" +
+ " X1351(1351),\n" +
+ " X1352(1352),\n" +
+ " X1353(1353),\n" +
+ " X1354(1354),\n" +
+ " X1355(1355),\n" +
+ " X1356(1356),\n" +
+ " X1357(1357),\n" +
+ " X1358(1358),\n" +
+ " X1359(1359),\n" +
+ " X1360(1360),\n" +
+ " X1361(1361),\n" +
+ " X1362(1362),\n" +
+ " X1363(1363),\n" +
+ " X1364(1364),\n" +
+ " X1365(1365),\n" +
+ " X1366(1366),\n" +
+ " X1367(1367),\n" +
+ " X1368(1368),\n" +
+ " X1369(1369),\n" +
+ " X1370(1370),\n" +
+ " X1371(1371),\n" +
+ " X1372(1372),\n" +
+ " X1373(1373),\n" +
+ " X1374(1374),\n" +
+ " X1375(1375),\n" +
+ " X1376(1376),\n" +
+ " X1377(1377),\n" +
+ " X1378(1378),\n" +
+ " X1379(1379),\n" +
+ " X1380(1380),\n" +
+ " X1381(1381),\n" +
+ " X1382(1382),\n" +
+ " X1383(1383),\n" +
+ " X1384(1384),\n" +
+ " X1385(1385),\n" +
+ " X1386(1386),\n" +
+ " X1387(1387),\n" +
+ " X1388(1388),\n" +
+ " X1389(1389),\n" +
+ " X1390(1390),\n" +
+ " X1391(1391),\n" +
+ " X1392(1392),\n" +
+ " X1393(1393),\n" +
+ " X1394(1394),\n" +
+ " X1395(1395),\n" +
+ " X1396(1396),\n" +
+ " X1397(1397),\n" +
+ " X1398(1398),\n" +
+ " X1399(1399),\n" +
+ " X1400(1400),\n" +
+ " X1401(1401),\n" +
+ " X1402(1402),\n" +
+ " X1403(1403),\n" +
+ " X1404(1404),\n" +
+ " X1405(1405),\n" +
+ " X1406(1406),\n" +
+ " X1407(1407),\n" +
+ " X1408(1408),\n" +
+ " X1409(1409),\n" +
+ " X1410(1410),\n" +
+ " X1411(1411),\n" +
+ " X1412(1412),\n" +
+ " X1413(1413),\n" +
+ " X1414(1414),\n" +
+ " X1415(1415),\n" +
+ " X1416(1416),\n" +
+ " X1417(1417),\n" +
+ " X1418(1418),\n" +
+ " X1419(1419),\n" +
+ " X1420(1420),\n" +
+ " X1421(1421),\n" +
+ " X1422(1422),\n" +
+ " X1423(1423),\n" +
+ " X1424(1424),\n" +
+ " X1425(1425),\n" +
+ " X1426(1426),\n" +
+ " X1427(1427),\n" +
+ " X1428(1428),\n" +
+ " X1429(1429),\n" +
+ " X1430(1430),\n" +
+ " X1431(1431),\n" +
+ " X1432(1432),\n" +
+ " X1433(1433),\n" +
+ " X1434(1434),\n" +
+ " X1435(1435),\n" +
+ " X1436(1436),\n" +
+ " X1437(1437),\n" +
+ " X1438(1438),\n" +
+ " X1439(1439),\n" +
+ " X1440(1440),\n" +
+ " X1441(1441),\n" +
+ " X1442(1442),\n" +
+ " X1443(1443),\n" +
+ " X1444(1444),\n" +
+ " X1445(1445),\n" +
+ " X1446(1446),\n" +
+ " X1447(1447),\n" +
+ " X1448(1448),\n" +
+ " X1449(1449),\n" +
+ " X1450(1450),\n" +
+ " X1451(1451),\n" +
+ " X1452(1452),\n" +
+ " X1453(1453),\n" +
+ " X1454(1454),\n" +
+ " X1455(1455),\n" +
+ " X1456(1456),\n" +
+ " X1457(1457),\n" +
+ " X1458(1458),\n" +
+ " X1459(1459),\n" +
+ " X1460(1460),\n" +
+ " X1461(1461),\n" +
+ " X1462(1462),\n" +
+ " X1463(1463),\n" +
+ " X1464(1464),\n" +
+ " X1465(1465),\n" +
+ " X1466(1466),\n" +
+ " X1467(1467),\n" +
+ " X1468(1468),\n" +
+ " X1469(1469),\n" +
+ " X1470(1470),\n" +
+ " X1471(1471),\n" +
+ " X1472(1472),\n" +
+ " X1473(1473),\n" +
+ " X1474(1474),\n" +
+ " X1475(1475),\n" +
+ " X1476(1476),\n" +
+ " X1477(1477),\n" +
+ " X1478(1478),\n" +
+ " X1479(1479),\n" +
+ " X1480(1480),\n" +
+ " X1481(1481),\n" +
+ " X1482(1482),\n" +
+ " X1483(1483),\n" +
+ " X1484(1484),\n" +
+ " X1485(1485),\n" +
+ " X1486(1486),\n" +
+ " X1487(1487),\n" +
+ " X1488(1488),\n" +
+ " X1489(1489),\n" +
+ " X1490(1490),\n" +
+ " X1491(1491),\n" +
+ " X1492(1492),\n" +
+ " X1493(1493),\n" +
+ " X1494(1494),\n" +
+ " X1495(1495),\n" +
+ " X1496(1496),\n" +
+ " X1497(1497),\n" +
+ " X1498(1498),\n" +
+ " X1499(1499),\n" +
+ " X1500(1500),\n" +
+ " X1501(1501),\n" +
+ " X1502(1502),\n" +
+ " X1503(1503),\n" +
+ " X1504(1504),\n" +
+ " X1505(1505),\n" +
+ " X1506(1506),\n" +
+ " X1507(1507),\n" +
+ " X1508(1508),\n" +
+ " X1509(1509),\n" +
+ " X1510(1510),\n" +
+ " X1511(1511),\n" +
+ " X1512(1512),\n" +
+ " X1513(1513),\n" +
+ " X1514(1514),\n" +
+ " X1515(1515),\n" +
+ " X1516(1516),\n" +
+ " X1517(1517),\n" +
+ " X1518(1518),\n" +
+ " X1519(1519),\n" +
+ " X1520(1520),\n" +
+ " X1521(1521),\n" +
+ " X1522(1522),\n" +
+ " X1523(1523),\n" +
+ " X1524(1524),\n" +
+ " X1525(1525),\n" +
+ " X1526(1526),\n" +
+ " X1527(1527),\n" +
+ " X1528(1528),\n" +
+ " X1529(1529),\n" +
+ " X1530(1530),\n" +
+ " X1531(1531),\n" +
+ " X1532(1532),\n" +
+ " X1533(1533),\n" +
+ " X1534(1534),\n" +
+ " X1535(1535),\n" +
+ " X1536(1536),\n" +
+ " X1537(1537),\n" +
+ " X1538(1538),\n" +
+ " X1539(1539),\n" +
+ " X1540(1540),\n" +
+ " X1541(1541),\n" +
+ " X1542(1542),\n" +
+ " X1543(1543),\n" +
+ " X1544(1544),\n" +
+ " X1545(1545),\n" +
+ " X1546(1546),\n" +
+ " X1547(1547),\n" +
+ " X1548(1548),\n" +
+ " X1549(1549),\n" +
+ " X1550(1550),\n" +
+ " X1551(1551),\n" +
+ " X1552(1552),\n" +
+ " X1553(1553),\n" +
+ " X1554(1554),\n" +
+ " X1555(1555),\n" +
+ " X1556(1556),\n" +
+ " X1557(1557),\n" +
+ " X1558(1558),\n" +
+ " X1559(1559),\n" +
+ " X1560(1560),\n" +
+ " X1561(1561),\n" +
+ " X1562(1562),\n" +
+ " X1563(1563),\n" +
+ " X1564(1564),\n" +
+ " X1565(1565),\n" +
+ " X1566(1566),\n" +
+ " X1567(1567),\n" +
+ " X1568(1568),\n" +
+ " X1569(1569),\n" +
+ " X1570(1570),\n" +
+ " X1571(1571),\n" +
+ " X1572(1572),\n" +
+ " X1573(1573),\n" +
+ " X1574(1574),\n" +
+ " X1575(1575),\n" +
+ " X1576(1576),\n" +
+ " X1577(1577),\n" +
+ " X1578(1578),\n" +
+ " X1579(1579),\n" +
+ " X1580(1580),\n" +
+ " X1581(1581),\n" +
+ " X1582(1582),\n" +
+ " X1583(1583),\n" +
+ " X1584(1584),\n" +
+ " X1585(1585),\n" +
+ " X1586(1586),\n" +
+ " X1587(1587),\n" +
+ " X1588(1588),\n" +
+ " X1589(1589),\n" +
+ " X1590(1590),\n" +
+ " X1591(1591),\n" +
+ " X1592(1592),\n" +
+ " X1593(1593),\n" +
+ " X1594(1594),\n" +
+ " X1595(1595),\n" +
+ " X1596(1596),\n" +
+ " X1597(1597),\n" +
+ " X1598(1598),\n" +
+ " X1599(1599),\n" +
+ " X1600(1600),\n" +
+ " X1601(1601),\n" +
+ " X1602(1602),\n" +
+ " X1603(1603),\n" +
+ " X1604(1604),\n" +
+ " X1605(1605),\n" +
+ " X1606(1606),\n" +
+ " X1607(1607),\n" +
+ " X1608(1608),\n" +
+ " X1609(1609),\n" +
+ " X1610(1610),\n" +
+ " X1611(1611),\n" +
+ " X1612(1612),\n" +
+ " X1613(1613),\n" +
+ " X1614(1614),\n" +
+ " X1615(1615),\n" +
+ " X1616(1616),\n" +
+ " X1617(1617),\n" +
+ " X1618(1618),\n" +
+ " X1619(1619),\n" +
+ " X1620(1620),\n" +
+ " X1621(1621),\n" +
+ " X1622(1622),\n" +
+ " X1623(1623),\n" +
+ " X1624(1624),\n" +
+ " X1625(1625),\n" +
+ " X1626(1626),\n" +
+ " X1627(1627),\n" +
+ " X1628(1628),\n" +
+ " X1629(1629),\n" +
+ " X1630(1630),\n" +
+ " X1631(1631),\n" +
+ " X1632(1632),\n" +
+ " X1633(1633),\n" +
+ " X1634(1634),\n" +
+ " X1635(1635),\n" +
+ " X1636(1636),\n" +
+ " X1637(1637),\n" +
+ " X1638(1638),\n" +
+ " X1639(1639),\n" +
+ " X1640(1640),\n" +
+ " X1641(1641),\n" +
+ " X1642(1642),\n" +
+ " X1643(1643),\n" +
+ " X1644(1644),\n" +
+ " X1645(1645),\n" +
+ " X1646(1646),\n" +
+ " X1647(1647),\n" +
+ " X1648(1648),\n" +
+ " X1649(1649),\n" +
+ " X1650(1650),\n" +
+ " X1651(1651),\n" +
+ " X1652(1652),\n" +
+ " X1653(1653),\n" +
+ " X1654(1654),\n" +
+ " X1655(1655),\n" +
+ " X1656(1656),\n" +
+ " X1657(1657),\n" +
+ " X1658(1658),\n" +
+ " X1659(1659),\n" +
+ " X1660(1660),\n" +
+ " X1661(1661),\n" +
+ " X1662(1662),\n" +
+ " X1663(1663),\n" +
+ " X1664(1664),\n" +
+ " X1665(1665),\n" +
+ " X1666(1666),\n" +
+ " X1667(1667),\n" +
+ " X1668(1668),\n" +
+ " X1669(1669),\n" +
+ " X1670(1670),\n" +
+ " X1671(1671),\n" +
+ " X1672(1672),\n" +
+ " X1673(1673),\n" +
+ " X1674(1674),\n" +
+ " X1675(1675),\n" +
+ " X1676(1676),\n" +
+ " X1677(1677),\n" +
+ " X1678(1678),\n" +
+ " X1679(1679),\n" +
+ " X1680(1680),\n" +
+ " X1681(1681),\n" +
+ " X1682(1682),\n" +
+ " X1683(1683),\n" +
+ " X1684(1684),\n" +
+ " X1685(1685),\n" +
+ " X1686(1686),\n" +
+ " X1687(1687),\n" +
+ " X1688(1688),\n" +
+ " X1689(1689),\n" +
+ " X1690(1690),\n" +
+ " X1691(1691),\n" +
+ " X1692(1692),\n" +
+ " X1693(1693),\n" +
+ " X1694(1694),\n" +
+ " X1695(1695),\n" +
+ " X1696(1696),\n" +
+ " X1697(1697),\n" +
+ " X1698(1698),\n" +
+ " X1699(1699),\n" +
+ " X1700(1700),\n" +
+ " X1701(1701),\n" +
+ " X1702(1702),\n" +
+ " X1703(1703),\n" +
+ " X1704(1704),\n" +
+ " X1705(1705),\n" +
+ " X1706(1706),\n" +
+ " X1707(1707),\n" +
+ " X1708(1708),\n" +
+ " X1709(1709),\n" +
+ " X1710(1710),\n" +
+ " X1711(1711),\n" +
+ " X1712(1712),\n" +
+ " X1713(1713),\n" +
+ " X1714(1714),\n" +
+ " X1715(1715),\n" +
+ " X1716(1716),\n" +
+ " X1717(1717),\n" +
+ " X1718(1718),\n" +
+ " X1719(1719),\n" +
+ " X1720(1720),\n" +
+ " X1721(1721),\n" +
+ " X1722(1722),\n" +
+ " X1723(1723),\n" +
+ " X1724(1724),\n" +
+ " X1725(1725),\n" +
+ " X1726(1726),\n" +
+ " X1727(1727),\n" +
+ " X1728(1728),\n" +
+ " X1729(1729),\n" +
+ " X1730(1730),\n" +
+ " X1731(1731),\n" +
+ " X1732(1732),\n" +
+ " X1733(1733),\n" +
+ " X1734(1734),\n" +
+ " X1735(1735),\n" +
+ " X1736(1736),\n" +
+ " X1737(1737),\n" +
+ " X1738(1738),\n" +
+ " X1739(1739),\n" +
+ " X1740(1740),\n" +
+ " X1741(1741),\n" +
+ " X1742(1742),\n" +
+ " X1743(1743),\n" +
+ " X1744(1744),\n" +
+ " X1745(1745),\n" +
+ " X1746(1746),\n" +
+ " X1747(1747),\n" +
+ " X1748(1748),\n" +
+ " X1749(1749),\n" +
+ " X1750(1750),\n" +
+ " X1751(1751),\n" +
+ " X1752(1752),\n" +
+ " X1753(1753),\n" +
+ " X1754(1754),\n" +
+ " X1755(1755),\n" +
+ " X1756(1756),\n" +
+ " X1757(1757),\n" +
+ " X1758(1758),\n" +
+ " X1759(1759),\n" +
+ " X1760(1760),\n" +
+ " X1761(1761),\n" +
+ " X1762(1762),\n" +
+ " X1763(1763),\n" +
+ " X1764(1764),\n" +
+ " X1765(1765),\n" +
+ " X1766(1766),\n" +
+ " X1767(1767),\n" +
+ " X1768(1768),\n" +
+ " X1769(1769),\n" +
+ " X1770(1770),\n" +
+ " X1771(1771),\n" +
+ " X1772(1772),\n" +
+ " X1773(1773),\n" +
+ " X1774(1774),\n" +
+ " X1775(1775),\n" +
+ " X1776(1776),\n" +
+ " X1777(1777),\n" +
+ " X1778(1778),\n" +
+ " X1779(1779),\n" +
+ " X1780(1780),\n" +
+ " X1781(1781),\n" +
+ " X1782(1782),\n" +
+ " X1783(1783),\n" +
+ " X1784(1784),\n" +
+ " X1785(1785),\n" +
+ " X1786(1786),\n" +
+ " X1787(1787),\n" +
+ " X1788(1788),\n" +
+ " X1789(1789),\n" +
+ " X1790(1790),\n" +
+ " X1791(1791),\n" +
+ " X1792(1792),\n" +
+ " X1793(1793),\n" +
+ " X1794(1794),\n" +
+ " X1795(1795),\n" +
+ " X1796(1796),\n" +
+ " X1797(1797),\n" +
+ " X1798(1798),\n" +
+ " X1799(1799),\n" +
+ " X1800(1800),\n" +
+ " X1801(1801),\n" +
+ " X1802(1802),\n" +
+ " X1803(1803),\n" +
+ " X1804(1804),\n" +
+ " X1805(1805),\n" +
+ " X1806(1806),\n" +
+ " X1807(1807),\n" +
+ " X1808(1808),\n" +
+ " X1809(1809),\n" +
+ " X1810(1810),\n" +
+ " X1811(1811),\n" +
+ " X1812(1812),\n" +
+ " X1813(1813),\n" +
+ " X1814(1814),\n" +
+ " X1815(1815),\n" +
+ " X1816(1816),\n" +
+ " X1817(1817),\n" +
+ " X1818(1818),\n" +
+ " X1819(1819),\n" +
+ " X1820(1820),\n" +
+ " X1821(1821),\n" +
+ " X1822(1822),\n" +
+ " X1823(1823),\n" +
+ " X1824(1824),\n" +
+ " X1825(1825),\n" +
+ " X1826(1826),\n" +
+ " X1827(1827),\n" +
+ " X1828(1828),\n" +
+ " X1829(1829),\n" +
+ " X1830(1830),\n" +
+ " X1831(1831),\n" +
+ " X1832(1832),\n" +
+ " X1833(1833),\n" +
+ " X1834(1834),\n" +
+ " X1835(1835),\n" +
+ " X1836(1836),\n" +
+ " X1837(1837),\n" +
+ " X1838(1838),\n" +
+ " X1839(1839),\n" +
+ " X1840(1840),\n" +
+ " X1841(1841),\n" +
+ " X1842(1842),\n" +
+ " X1843(1843),\n" +
+ " X1844(1844),\n" +
+ " X1845(1845),\n" +
+ " X1846(1846),\n" +
+ " X1847(1847),\n" +
+ " X1848(1848),\n" +
+ " X1849(1849),\n" +
+ " X1850(1850),\n" +
+ " X1851(1851),\n" +
+ " X1852(1852),\n" +
+ " X1853(1853),\n" +
+ " X1854(1854),\n" +
+ " X1855(1855),\n" +
+ " X1856(1856),\n" +
+ " X1857(1857),\n" +
+ " X1858(1858),\n" +
+ " X1859(1859),\n" +
+ " X1860(1860),\n" +
+ " X1861(1861),\n" +
+ " X1862(1862),\n" +
+ " X1863(1863),\n" +
+ " X1864(1864),\n" +
+ " X1865(1865),\n" +
+ " X1866(1866),\n" +
+ " X1867(1867),\n" +
+ " X1868(1868),\n" +
+ " X1869(1869),\n" +
+ " X1870(1870),\n" +
+ " X1871(1871),\n" +
+ " X1872(1872),\n" +
+ " X1873(1873),\n" +
+ " X1874(1874),\n" +
+ " X1875(1875),\n" +
+ " X1876(1876),\n" +
+ " X1877(1877),\n" +
+ " X1878(1878),\n" +
+ " X1879(1879),\n" +
+ " X1880(1880),\n" +
+ " X1881(1881),\n" +
+ " X1882(1882),\n" +
+ " X1883(1883),\n" +
+ " X1884(1884),\n" +
+ " X1885(1885),\n" +
+ " X1886(1886),\n" +
+ " X1887(1887),\n" +
+ " X1888(1888),\n" +
+ " X1889(1889),\n" +
+ " X1890(1890),\n" +
+ " X1891(1891),\n" +
+ " X1892(1892),\n" +
+ " X1893(1893),\n" +
+ " X1894(1894),\n" +
+ " X1895(1895),\n" +
+ " X1896(1896),\n" +
+ " X1897(1897),\n" +
+ " X1898(1898),\n" +
+ " X1899(1899),\n" +
+ " X1900(1900),\n" +
+ " X1901(1901),\n" +
+ " X1902(1902),\n" +
+ " X1903(1903),\n" +
+ " X1904(1904),\n" +
+ " X1905(1905),\n" +
+ " X1906(1906),\n" +
+ " X1907(1907),\n" +
+ " X1908(1908),\n" +
+ " X1909(1909),\n" +
+ " X1910(1910),\n" +
+ " X1911(1911),\n" +
+ " X1912(1912),\n" +
+ " X1913(1913),\n" +
+ " X1914(1914),\n" +
+ " X1915(1915),\n" +
+ " X1916(1916),\n" +
+ " X1917(1917),\n" +
+ " X1918(1918),\n" +
+ " X1919(1919),\n" +
+ " X1920(1920),\n" +
+ " X1921(1921),\n" +
+ " X1922(1922),\n" +
+ " X1923(1923),\n" +
+ " X1924(1924),\n" +
+ " X1925(1925),\n" +
+ " X1926(1926),\n" +
+ " X1927(1927),\n" +
+ " X1928(1928),\n" +
+ " X1929(1929),\n" +
+ " X1930(1930),\n" +
+ " X1931(1931),\n" +
+ " X1932(1932),\n" +
+ " X1933(1933),\n" +
+ " X1934(1934),\n" +
+ " X1935(1935),\n" +
+ " X1936(1936),\n" +
+ " X1937(1937),\n" +
+ " X1938(1938),\n" +
+ " X1939(1939),\n" +
+ " X1940(1940),\n" +
+ " X1941(1941),\n" +
+ " X1942(1942),\n" +
+ " X1943(1943),\n" +
+ " X1944(1944),\n" +
+ " X1945(1945),\n" +
+ " X1946(1946),\n" +
+ " X1947(1947),\n" +
+ " X1948(1948),\n" +
+ " X1949(1949),\n" +
+ " X1950(1950),\n" +
+ " X1951(1951),\n" +
+ " X1952(1952),\n" +
+ " X1953(1953),\n" +
+ " X1954(1954),\n" +
+ " X1955(1955),\n" +
+ " X1956(1956),\n" +
+ " X1957(1957),\n" +
+ " X1958(1958),\n" +
+ " X1959(1959),\n" +
+ " X1960(1960),\n" +
+ " X1961(1961),\n" +
+ " X1962(1962),\n" +
+ " X1963(1963),\n" +
+ " X1964(1964),\n" +
+ " X1965(1965),\n" +
+ " X1966(1966),\n" +
+ " X1967(1967),\n" +
+ " X1968(1968),\n" +
+ " X1969(1969),\n" +
+ " X1970(1970),\n" +
+ " X1971(1971),\n" +
+ " X1972(1972),\n" +
+ " X1973(1973),\n" +
+ " X1974(1974),\n" +
+ " X1975(1975),\n" +
+ " X1976(1976),\n" +
+ " X1977(1977),\n" +
+ " X1978(1978),\n" +
+ " X1979(1979),\n" +
+ " X1980(1980),\n" +
+ " X1981(1981),\n" +
+ " X1982(1982),\n" +
+ " X1983(1983),\n" +
+ " X1984(1984),\n" +
+ " X1985(1985),\n" +
+ " X1986(1986),\n" +
+ " X1987(1987),\n" +
+ " X1988(1988),\n" +
+ " X1989(1989),\n" +
+ " X1990(1990),\n" +
+ " X1991(1991),\n" +
+ " X1992(1992),\n" +
+ " X1993(1993),\n" +
+ " X1994(1994),\n" +
+ " X1995(1995),\n" +
+ " X1996(1996),\n" +
+ " X1997(1997),\n" +
+ " X1998(1998),\n" +
+ " X1999(1999),\n" +
+ " X2000(2000),\n" +
+ " X2001(2001),\n" +
+ " X2002(2002),\n" +
+ " X2003(2003),\n" +
+ " X2004(2004),\n" +
+ " X2005(2005),\n" +
+ " X2006(2006),\n" +
+ " X2007(2007),\n" +
+ " X2008(2008),\n" +
+ " X2009(2009),\n" +
+ " X2010(2010),\n" +
+ " X2011(2011),\n" +
+ " X2012(2012),\n" +
+ " X2013(2013),\n" +
+ " X2014(2014),\n" +
+ " X2015(2015),\n" +
+ " X2016(2016),\n" +
+ " X2017(2017),\n" +
+ " X2018(2018),\n" +
+ " X2019(2019),\n" +
+ " X2020(2020),\n" +
+ " X2021(2021),\n" +
+ " X2022(2022),\n" +
+ " X2023(2023),\n" +
+ " X2024(2024),\n" +
+ " X2025(2025),\n" +
+ " X2026(2026),\n" +
+ " X2027(2027),\n" +
+ " X2028(2028),\n" +
+ " X2029(2029),\n" +
+ " X2030(2030),\n" +
+ " X2031(2031),\n" +
+ " X2032(2032),\n" +
+ " X2033(2033),\n" +
+ " X2034(2034),\n" +
+ " X2035(2035),\n" +
+ " X2036(2036),\n" +
+ " X2037(2037),\n" +
+ " X2038(2038),\n" +
+ " X2039(2039),\n" +
+ " X2040(2040),\n" +
+ " X2041(2041),\n" +
+ " X2042(2042),\n" +
+ " X2043(2043),\n" +
+ " X2044(2044),\n" +
+ " X2045(2045),\n" +
+ " X2046(2046),\n" +
+ " X2047(2047),\n" +
+ " X2048(2048),\n" +
+ " X2049(2049),\n" +
+ " X2050(2050),\n" +
+ " X2051(2051),\n" +
+ " X2052(2052),\n" +
+ " X2053(2053),\n" +
+ " X2054(2054),\n" +
+ " X2055(2055),\n" +
+ " X2056(2056),\n" +
+ " X2057(2057),\n" +
+ " X2058(2058),\n" +
+ " X2059(2059),\n" +
+ " X2060(2060),\n" +
+ " X2061(2061),\n" +
+ " X2062(2062),\n" +
+ " X2063(2063),\n" +
+ " X2064(2064),\n" +
+ " X2065(2065),\n" +
+ " X2066(2066),\n" +
+ " X2067(2067),\n" +
+ " X2068(2068),\n" +
+ " X2069(2069),\n" +
+ " X2070(2070),\n" +
+ " X2071(2071),\n" +
+ " X2072(2072),\n" +
+ " X2073(2073),\n" +
+ " X2074(2074),\n" +
+ " X2075(2075),\n" +
+ " X2076(2076),\n" +
+ " X2077(2077),\n" +
+ " X2078(2078),\n" +
+ " X2079(2079),\n" +
+ " X2080(2080),\n" +
+ " X2081(2081),\n" +
+ " X2082(2082),\n" +
+ " X2083(2083),\n" +
+ " X2084(2084),\n" +
+ " X2085(2085),\n" +
+ " X2086(2086),\n" +
+ " X2087(2087),\n" +
+ " X2088(2088),\n" +
+ " X2089(2089),\n" +
+ " X2090(2090),\n" +
+ " X2091(2091),\n" +
+ " X2092(2092),\n" +
+ " X2093(2093),\n" +
+ " X2094(2094),\n" +
+ " X2095(2095),\n" +
+ " X2096(2096),\n" +
+ " X2097(2097),\n" +
+ " X2098(2098),\n" +
+ " X2099(2099),\n" +
+ " X2100(2100),\n" +
+ " X2101(2101),\n" +
+ " X2102(2102),\n" +
+ " X2103(2103),\n" +
+ " X2104(2104),\n" +
+ " X2105(2105),\n" +
+ " X2106(2106),\n" +
+ " X2107(2107),\n" +
+ " X2108(2108),\n" +
+ " X2109(2109),\n" +
+ " X2110(2110),\n" +
+ " X2111(2111),\n" +
+ " X2112(2112),\n" +
+ " X2113(2113),\n" +
+ " X2114(2114),\n" +
+ " X2115(2115),\n" +
+ " X2116(2116),\n" +
+ " X2117(2117),\n" +
+ " X2118(2118),\n" +
+ " X2119(2119),\n" +
+ " X2120(2120),\n" +
+ " X2121(2121),\n" +
+ " X2122(2122),\n" +
+ " X2123(2123),\n" +
+ " X2124(2124),\n" +
+ " X2125(2125),\n" +
+ " X2126(2126),\n" +
+ " X2127(2127),\n" +
+ " X2128(2128),\n" +
+ " X2129(2129),\n" +
+ " X2130(2130),\n" +
+ " X2131(2131),\n" +
+ " X2132(2132),\n" +
+ " X2133(2133),\n" +
+ " X2134(2134),\n" +
+ " X2135(2135),\n" +
+ " X2136(2136),\n" +
+ " X2137(2137),\n" +
+ " X2138(2138),\n" +
+ " X2139(2139),\n" +
+ " X2140(2140),\n" +
+ " X2141(2141),\n" +
+ " X2142(2142),\n" +
+ " X2143(2143),\n" +
+ " X2144(2144),\n" +
+ " X2145(2145),\n" +
+ " X2146(2146),\n" +
+ " X2147(2147),\n" +
+ " X2148(2148),\n" +
+ " X2149(2149),\n" +
+ " X2150(2150),\n" +
+ " X2151(2151),\n" +
+ " X2152(2152),\n" +
+ " X2153(2153),\n" +
+ " X2154(2154),\n" +
+ " X2155(2155),\n" +
+ " X2156(2156),\n" +
+ " X2157(2157),\n" +
+ " X2158(2158),\n" +
+ " X2159(2159),\n" +
+ " X2160(2160),\n" +
+ " X2161(2161),\n" +
+ " X2162(2162),\n" +
+ " X2163(2163),\n" +
+ " X2164(2164),\n" +
+ " X2165(2165),\n" +
+ " X2166(2166),\n" +
+ " X2167(2167),\n" +
+ " X2168(2168),\n" +
+ " X2169(2169),\n" +
+ " X2170(2170),\n" +
+ " X2171(2171),\n" +
+ " X2172(2172),\n" +
+ " X2173(2173),\n" +
+ " X2174(2174),\n" +
+ " X2175(2175),\n" +
+ " X2176(2176),\n" +
+ " X2177(2177),\n" +
+ " X2178(2178),\n" +
+ " X2179(2179),\n" +
+ " X2180(2180),\n" +
+ " X2181(2181),\n" +
+ " X2182(2182),\n" +
+ " X2183(2183),\n" +
+ " X2184(2184),\n" +
+ " X2185(2185),\n" +
+ " X2186(2186),\n" +
+ " X2187(2187),\n" +
+ " X2188(2188),\n" +
+ " X2189(2189),\n" +
+ " X2190(2190),\n" +
+ " X2191(2191),\n" +
+ " X2192(2192),\n" +
+ " X2193(2193),\n" +
+ " X2194(2194),\n" +
+ " X2195(2195),\n" +
+ " X2196(2196),\n" +
+ " X2197(2197),\n" +
+ " X2198(2198),\n" +
+ " X2199(2199),\n" +
+ " X2200(2200),\n" +
+ " X2201(2201),\n" +
+ " X2202(2202),\n" +
+ " X2203(2203),\n" +
+ " X2204(2204),\n" +
+ " X2205(2205),\n" +
+ " X2206(2206),\n" +
+ " X2207(2207),\n" +
+ " X2208(2208),\n" +
+ " X2209(2209),\n" +
+ " X2210(2210),\n" +
+ " X2211(2211),\n" +
+ " X2212(2212),\n" +
+ " X2213(2213),\n" +
+ " X2214(2214),\n" +
+ " X2215(2215),\n" +
+ " X2216(2216),\n" +
+ " X2217(2217),\n" +
+ " X2218(2218),\n" +
+ " X2219(2219),\n" +
+ " X2220(2220),\n" +
+ " X2221(2221),\n" +
+ " X2222(2222),\n" +
+ " X2223(2223),\n" +
+ " X2224(2224),\n" +
+ " X2225(2225),\n" +
+ " X2226(2226),\n" +
+ " X2227(2227),\n" +
+ " X2228(2228),\n" +
+ " X2229(2229),\n" +
+ " X2230(2230),\n" +
+ " X2231(2231),\n" +
+ " X2232(2232),\n" +
+ " X2233(2233),\n" +
+ " X2234(2234),\n" +
+ " X2235(2235),\n" +
+ " X2236(2236),\n" +
+ " X2237(2237),\n" +
+ " X2238(2238),\n" +
+ " X2239(2239),\n" +
+ " X2240(2240),\n" +
+ " X2241(2241),\n" +
+ " X2242(2242),\n" +
+ " X2243(2243),\n" +
+ " X2244(2244),\n" +
+ " X2245(2245),\n" +
+ " X2246(2246),\n" +
+ " X2247(2247),\n" +
+ " X2248(2248),\n" +
+ " X2249(2249),\n" +
+ " X2250(2250),\n" +
+ " X2251(2251),\n" +
+ " X2252(2252),\n" +
+ " X2253(2253),\n" +
+ " X2254(2254),\n" +
+ " X2255(2255),\n" +
+ " X2256(2256),\n" +
+ " X2257(2257),\n" +
+ " X2258(2258),\n" +
+ " X2259(2259),\n" +
+ " X2260(2260),\n" +
+ " X2261(2261),\n" +
+ " X2262(2262),\n" +
+ " X2263(2263),\n" +
+ " X2264(2264),\n" +
+ " X2265(2265),\n" +
+ " X2266(2266),\n" +
+ " X2267(2267),\n" +
+ " X2268(2268),\n" +
+ " X2269(2269),\n" +
+ " X2270(2270),\n" +
+ " X2271(2271),\n" +
+ " X2272(2272),\n" +
+ " X2273(2273),\n" +
+ " X2274(2274),\n" +
+ " X2275(2275),\n" +
+ " X2276(2276),\n" +
+ " X2277(2277),\n" +
+ " X2278(2278),\n" +
+ " X2279(2279),\n" +
+ " X2280(2280),\n" +
+ " X2281(2281),\n" +
+ " X2282(2282),\n" +
+ " X2283(2283),\n" +
+ " X2284(2284),\n" +
+ " X2285(2285),\n" +
+ " X2286(2286),\n" +
+ " X2287(2287),\n" +
+ " X2288(2288),\n" +
+ " X2289(2289),\n" +
+ " X2290(2290),\n" +
+ " X2291(2291),\n" +
+ " X2292(2292),\n" +
+ " X2293(2293),\n" +
+ " X2294(2294),\n" +
+ " X2295(2295),\n" +
+ " X2296(2296),\n" +
+ " X2297(2297),\n" +
+ " X2298(2298),\n" +
+ " X2299(2299),\n" +
+ " X2300(2300),\n" +
+ " X2301(2301),\n" +
+ " X2302(2302),\n" +
+ " X2303(2303),\n" +
+ " X2304(2304),\n" +
+ " X2305(2305),\n" +
+ " X2306(2306),\n" +
+ " X2307(2307),\n" +
+ " X2308(2308),\n" +
+ " X2309(2309),\n" +
+ " X2310(2310),\n" +
+ " X2311(2311),\n" +
+ " X2312(2312),\n" +
+ " X2313(2313),\n" +
+ " X2314(2314),\n" +
+ " X2315(2315),\n" +
+ " X2316(2316),\n" +
+ " X2317(2317),\n" +
+ " X2318(2318),\n" +
+ " X2319(2319),\n" +
+ " X2320(2320),\n" +
+ " X2321(2321),\n" +
+ " X2322(2322),\n" +
+ " X2323(2323),\n" +
+ " X2324(2324),\n" +
+ " X2325(2325),\n" +
+ " X2326(2326),\n" +
+ " X2327(2327),\n" +
+ " X2328(2328),\n" +
+ " X2329(2329),\n" +
+ " X2330(2330),\n" +
+ " X2331(2331),\n" +
+ " X2332(2332),\n" +
+ " X2333(2333),\n" +
+ " X2334(2334),\n" +
+ " X2335(2335),\n" +
+ " X2336(2336),\n" +
+ " X2337(2337),\n" +
+ " X2338(2338),\n" +
+ " X2339(2339),\n" +
+ " X2340(2340),\n" +
+ " X2341(2341),\n" +
+ " X2342(2342),\n" +
+ " X2343(2343),\n" +
+ " X2344(2344),\n" +
+ " X2345(2345),\n" +
+ " X2346(2346),\n" +
+ " X2347(2347),\n" +
+ " X2348(2348),\n" +
+ " X2349(2349),\n" +
+ " X2350(2350),\n" +
+ " X2351(2351),\n" +
+ " X2352(2352),\n" +
+ " X2353(2353),\n" +
+ " X2354(2354),\n" +
+ " X2355(2355),\n" +
+ " X2356(2356),\n" +
+ " X2357(2357),\n" +
+ " X2358(2358),\n" +
+ " X2359(2359),\n" +
+ " X2360(2360),\n" +
+ " X2361(2361),\n" +
+ " X2362(2362),\n" +
+ " X2363(2363),\n" +
+ " X2364(2364),\n" +
+ " X2365(2365),\n" +
+ " X2366(2366),\n" +
+ " X2367(2367),\n" +
+ " X2368(2368),\n" +
+ " X2369(2369),\n" +
+ " X2370(2370),\n" +
+ " X2371(2371),\n" +
+ " X2372(2372),\n" +
+ " X2373(2373),\n" +
+ " X2374(2374),\n" +
+ " X2375(2375),\n" +
+ " X2376(2376),\n" +
+ " X2377(2377),\n" +
+ " X2378(2378),\n" +
+ " X2379(2379),\n" +
+ " X2380(2380),\n" +
+ " X2381(2381),\n" +
+ " X2382(2382),\n" +
+ " X2383(2383),\n" +
+ " X2384(2384),\n" +
+ " X2385(2385),\n" +
+ " X2386(2386),\n" +
+ " X2387(2387),\n" +
+ " X2388(2388),\n" +
+ " X2389(2389),\n" +
+ " X2390(2390),\n" +
+ " X2391(2391),\n" +
+ " X2392(2392),\n" +
+ " X2393(2393),\n" +
+ " X2394(2394),\n" +
+ " X2395(2395),\n" +
+ " X2396(2396),\n" +
+ " X2397(2397),\n" +
+ " X2398(2398),\n" +
+ " X2399(2399),\n" +
+ " X2400(2400),\n" +
+ " X2401(2401),\n" +
+ " X2402(2402),\n" +
+ " X2403(2403),\n" +
+ " X2404(2404),\n" +
+ " X2405(2405),\n" +
+ " X2406(2406),\n" +
+ " X2407(2407),\n" +
+ " X2408(2408),\n" +
+ " X2409(2409),\n" +
+ " X2410(2410),\n" +
+ " X2411(2411),\n" +
+ " X2412(2412),\n" +
+ " X2413(2413),\n" +
+ " X2414(2414),\n" +
+ " X2415(2415),\n" +
+ " X2416(2416),\n" +
+ " X2417(2417),\n" +
+ " X2418(2418),\n" +
+ " X2419(2419),\n" +
+ " X2420(2420),\n" +
+ " X2421(2421),\n" +
+ " X2422(2422),\n" +
+ " X2423(2423),\n" +
+ " X2424(2424),\n" +
+ " X2425(2425),\n" +
+ " X2426(2426),\n" +
+ " X2427(2427),\n" +
+ " X2428(2428),\n" +
+ " X2429(2429),\n" +
+ " X2430(2430),\n" +
+ " X2431(2431),\n" +
+ " X2432(2432),\n" +
+ " X2433(2433),\n" +
+ " X2434(2434),\n" +
+ " X2435(2435),\n" +
+ " X2436(2436),\n" +
+ " X2437(2437),\n" +
+ " X2438(2438),\n" +
+ " X2439(2439),\n" +
+ " X2440(2440),\n" +
+ " X2441(2441),\n" +
+ " X2442(2442),\n" +
+ " X2443(2443),\n" +
+ " X2444(2444),\n" +
+ " X2445(2445),\n" +
+ " X2446(2446),\n" +
+ " X2447(2447),\n" +
+ " X2448(2448),\n" +
+ " X2449(2449),\n" +
+ " X2450(2450),\n" +
+ " X2451(2451),\n" +
+ " X2452(2452),\n" +
+ " X2453(2453),\n" +
+ " X2454(2454),\n" +
+ " X2455(2455),\n" +
+ " X2456(2456),\n" +
+ " X2457(2457),\n" +
+ " X2458(2458),\n" +
+ " X2459(2459),\n" +
+ " X2460(2460),\n" +
+ " X2461(2461),\n" +
+ " X2462(2462),\n" +
+ " X2463(2463),\n" +
+ " X2464(2464),\n" +
+ " X2465(2465),\n" +
+ " X2466(2466),\n" +
+ " X2467(2467),\n" +
+ " X2468(2468),\n" +
+ " X2469(2469),\n" +
+ " X2470(2470),\n" +
+ " X2471(2471),\n" +
+ " X2472(2472),\n" +
+ " X2473(2473),\n" +
+ " X2474(2474),\n" +
+ " X2475(2475),\n" +
+ " X2476(2476),\n" +
+ " X2477(2477),\n" +
+ " X2478(2478),\n" +
+ " X2479(2479),\n" +
+ " X2480(2480),\n" +
+ " X2481(2481),\n" +
+ " X2482(2482),\n" +
+ " X2483(2483),\n" +
+ " X2484(2484),\n" +
+ " X2485(2485),\n" +
+ " X2486(2486),\n" +
+ " X2487(2487),\n" +
+ " X2488(2488),\n" +
+ " X2489(2489),\n" +
+ " X2490(2490),\n" +
+ " X2491(2491),\n" +
+ " X2492(2492),\n" +
+ " X2493(2493),\n" +
+ " X2494(2494),\n" +
+ " X2495(2495),\n" +
+ " X2496(2496),\n" +
+ " X2497(2497),\n" +
+ " X2498(2498),\n" +
+ " X2499(2499),\n" +
+ " ;\n" +
+ "\n" +
+ " private int value;\n" +
+ " X(int i) {\n" +
+ " this.value = i;\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " int i = 0;\n" +
+ " for (X x : X.values()) {\n" +
+ " i++;\n" +
+ " System.out.print(x);\n" +
+ " }\n" +
+ " System.out.print(i);\n" +
+ " }\n" +
+ " \n" +
+ " public String toString() {\n" +
+ " return Integer.toString(this.value);\n" +
+ " }\n" +
"}"
};
if (this.complianceLevel < ClassFileConstants.JDK9) {
this.runConformTest(src, buffer.toString());
} else {
- this.runNegativeTest(src,
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public enum X {\n" +
- " ^\n" +
- "The code for the static initializer is exceeding the 65535 bytes limit\n" +
+ this.runNegativeTest(src,
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public enum X {\n" +
+ " ^\n" +
+ "The code for the static initializer is exceeding the 65535 bytes limit\n" +
"----------\n");
}
}
@@ -14537,7 +14537,7 @@ public void test0017() {
StringBuffer buffer = new StringBuffer();
buffer
.append("123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119")
- .append("1201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022")
+ .append("1201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022")
.append("0320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528")
.append("6287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369")
.append("3703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524")
@@ -14567,2027 +14567,2027 @@ public void test0017() {
this.runConformTest(
new String[] {
"X.java",
- "public enum X {\n" +
- " X1(1),\n" +
- " X2(2),\n" +
- " X3(3),\n" +
- " X4(4),\n" +
- " X5(5),\n" +
- " X6(6),\n" +
- " X7(7),\n" +
- " X8(8),\n" +
- " X9(9),\n" +
- " X10(10),\n" +
- " X11(11),\n" +
- " X12(12),\n" +
- " X13(13),\n" +
- " X14(14),\n" +
- " X15(15),\n" +
- " X16(16),\n" +
- " X17(17),\n" +
- " X18(18),\n" +
- " X19(19),\n" +
- " X20(20),\n" +
- " X21(21),\n" +
- " X22(22),\n" +
- " X23(23),\n" +
- " X24(24),\n" +
- " X25(25),\n" +
- " X26(26),\n" +
- " X27(27),\n" +
- " X28(28),\n" +
- " X29(29),\n" +
- " X30(30),\n" +
- " X31(31),\n" +
- " X32(32),\n" +
- " X33(33),\n" +
- " X34(34),\n" +
- " X35(35),\n" +
- " X36(36),\n" +
- " X37(37),\n" +
- " X38(38),\n" +
- " X39(39),\n" +
- " X40(40),\n" +
- " X41(41),\n" +
- " X42(42),\n" +
- " X43(43),\n" +
- " X44(44),\n" +
- " X45(45),\n" +
- " X46(46),\n" +
- " X47(47),\n" +
- " X48(48),\n" +
- " X49(49),\n" +
- " X50(50),\n" +
- " X51(51),\n" +
- " X52(52),\n" +
- " X53(53),\n" +
- " X54(54),\n" +
- " X55(55),\n" +
- " X56(56),\n" +
- " X57(57),\n" +
- " X58(58),\n" +
- " X59(59),\n" +
- " X60(60),\n" +
- " X61(61),\n" +
- " X62(62),\n" +
- " X63(63),\n" +
- " X64(64),\n" +
- " X65(65),\n" +
- " X66(66),\n" +
- " X67(67),\n" +
- " X68(68),\n" +
- " X69(69),\n" +
- " X70(70),\n" +
- " X71(71),\n" +
- " X72(72),\n" +
- " X73(73),\n" +
- " X74(74),\n" +
- " X75(75),\n" +
- " X76(76),\n" +
- " X77(77),\n" +
- " X78(78),\n" +
- " X79(79),\n" +
- " X80(80),\n" +
- " X81(81),\n" +
- " X82(82),\n" +
- " X83(83),\n" +
- " X84(84),\n" +
- " X85(85),\n" +
- " X86(86),\n" +
- " X87(87),\n" +
- " X88(88),\n" +
- " X89(89),\n" +
- " X90(90),\n" +
- " X91(91),\n" +
- " X92(92),\n" +
- " X93(93),\n" +
- " X94(94),\n" +
- " X95(95),\n" +
- " X96(96),\n" +
- " X97(97),\n" +
- " X98(98),\n" +
- " X99(99),\n" +
- " X100(100),\n" +
- " X101(101),\n" +
- " X102(102),\n" +
- " X103(103),\n" +
- " X104(104),\n" +
- " X105(105),\n" +
- " X106(106),\n" +
- " X107(107),\n" +
- " X108(108),\n" +
- " X109(109),\n" +
- " X110(110),\n" +
- " X111(111),\n" +
- " X112(112),\n" +
- " X113(113),\n" +
- " X114(114),\n" +
- " X115(115),\n" +
- " X116(116),\n" +
- " X117(117),\n" +
- " X118(118),\n" +
- " X119(119),\n" +
- " X120(120),\n" +
- " X121(121),\n" +
- " X122(122),\n" +
- " X123(123),\n" +
- " X124(124),\n" +
- " X125(125),\n" +
- " X126(126),\n" +
- " X127(127),\n" +
- " X128(128),\n" +
- " X129(129),\n" +
- " X130(130),\n" +
- " X131(131),\n" +
- " X132(132),\n" +
- " X133(133),\n" +
- " X134(134),\n" +
- " X135(135),\n" +
- " X136(136),\n" +
- " X137(137),\n" +
- " X138(138),\n" +
- " X139(139),\n" +
- " X140(140),\n" +
- " X141(141),\n" +
- " X142(142),\n" +
- " X143(143),\n" +
- " X144(144),\n" +
- " X145(145),\n" +
- " X146(146),\n" +
- " X147(147),\n" +
- " X148(148),\n" +
- " X149(149),\n" +
- " X150(150),\n" +
- " X151(151),\n" +
- " X152(152),\n" +
- " X153(153),\n" +
- " X154(154),\n" +
- " X155(155),\n" +
- " X156(156),\n" +
- " X157(157),\n" +
- " X158(158),\n" +
- " X159(159),\n" +
- " X160(160),\n" +
- " X161(161),\n" +
- " X162(162),\n" +
- " X163(163),\n" +
- " X164(164),\n" +
- " X165(165),\n" +
- " X166(166),\n" +
- " X167(167),\n" +
- " X168(168),\n" +
- " X169(169),\n" +
- " X170(170),\n" +
- " X171(171),\n" +
- " X172(172),\n" +
- " X173(173),\n" +
- " X174(174),\n" +
- " X175(175),\n" +
- " X176(176),\n" +
- " X177(177),\n" +
- " X178(178),\n" +
- " X179(179),\n" +
- " X180(180),\n" +
- " X181(181),\n" +
- " X182(182),\n" +
- " X183(183),\n" +
- " X184(184),\n" +
- " X185(185),\n" +
- " X186(186),\n" +
- " X187(187),\n" +
- " X188(188),\n" +
- " X189(189),\n" +
- " X190(190),\n" +
- " X191(191),\n" +
- " X192(192),\n" +
- " X193(193),\n" +
- " X194(194),\n" +
- " X195(195),\n" +
- " X196(196),\n" +
- " X197(197),\n" +
- " X198(198),\n" +
- " X199(199),\n" +
- " X200(200),\n" +
- " X201(201),\n" +
- " X202(202),\n" +
- " X203(203),\n" +
- " X204(204),\n" +
- " X205(205),\n" +
- " X206(206),\n" +
- " X207(207),\n" +
- " X208(208),\n" +
- " X209(209),\n" +
- " X210(210),\n" +
- " X211(211),\n" +
- " X212(212),\n" +
- " X213(213),\n" +
- " X214(214),\n" +
- " X215(215),\n" +
- " X216(216),\n" +
- " X217(217),\n" +
- " X218(218),\n" +
- " X219(219),\n" +
- " X220(220),\n" +
- " X221(221),\n" +
- " X222(222),\n" +
- " X223(223),\n" +
- " X224(224),\n" +
- " X225(225),\n" +
- " X226(226),\n" +
- " X227(227),\n" +
- " X228(228),\n" +
- " X229(229),\n" +
- " X230(230),\n" +
- " X231(231),\n" +
- " X232(232),\n" +
- " X233(233),\n" +
- " X234(234),\n" +
- " X235(235),\n" +
- " X236(236),\n" +
- " X237(237),\n" +
- " X238(238),\n" +
- " X239(239),\n" +
- " X240(240),\n" +
- " X241(241),\n" +
- " X242(242),\n" +
- " X243(243),\n" +
- " X244(244),\n" +
- " X245(245),\n" +
- " X246(246),\n" +
- " X247(247),\n" +
- " X248(248),\n" +
- " X249(249),\n" +
- " X250(250),\n" +
- " X251(251),\n" +
- " X252(252),\n" +
- " X253(253),\n" +
- " X254(254),\n" +
- " X255(255),\n" +
- " X256(256),\n" +
- " X257(257),\n" +
- " X258(258),\n" +
- " X259(259),\n" +
- " X260(260),\n" +
- " X261(261),\n" +
- " X262(262),\n" +
- " X263(263),\n" +
- " X264(264),\n" +
- " X265(265),\n" +
- " X266(266),\n" +
- " X267(267),\n" +
- " X268(268),\n" +
- " X269(269),\n" +
- " X270(270),\n" +
- " X271(271),\n" +
- " X272(272),\n" +
- " X273(273),\n" +
- " X274(274),\n" +
- " X275(275),\n" +
- " X276(276),\n" +
- " X277(277),\n" +
- " X278(278),\n" +
- " X279(279),\n" +
- " X280(280),\n" +
- " X281(281),\n" +
- " X282(282),\n" +
- " X283(283),\n" +
- " X284(284),\n" +
- " X285(285),\n" +
- " X286(286),\n" +
- " X287(287),\n" +
- " X288(288),\n" +
- " X289(289),\n" +
- " X290(290),\n" +
- " X291(291),\n" +
- " X292(292),\n" +
- " X293(293),\n" +
- " X294(294),\n" +
- " X295(295),\n" +
- " X296(296),\n" +
- " X297(297),\n" +
- " X298(298),\n" +
- " X299(299),\n" +
- " X300(300),\n" +
- " X301(301),\n" +
- " X302(302),\n" +
- " X303(303),\n" +
- " X304(304),\n" +
- " X305(305),\n" +
- " X306(306),\n" +
- " X307(307),\n" +
- " X308(308),\n" +
- " X309(309),\n" +
- " X310(310),\n" +
- " X311(311),\n" +
- " X312(312),\n" +
- " X313(313),\n" +
- " X314(314),\n" +
- " X315(315),\n" +
- " X316(316),\n" +
- " X317(317),\n" +
- " X318(318),\n" +
- " X319(319),\n" +
- " X320(320),\n" +
- " X321(321),\n" +
- " X322(322),\n" +
- " X323(323),\n" +
- " X324(324),\n" +
- " X325(325),\n" +
- " X326(326),\n" +
- " X327(327),\n" +
- " X328(328),\n" +
- " X329(329),\n" +
- " X330(330),\n" +
- " X331(331),\n" +
- " X332(332),\n" +
- " X333(333),\n" +
- " X334(334),\n" +
- " X335(335),\n" +
- " X336(336),\n" +
- " X337(337),\n" +
- " X338(338),\n" +
- " X339(339),\n" +
- " X340(340),\n" +
- " X341(341),\n" +
- " X342(342),\n" +
- " X343(343),\n" +
- " X344(344),\n" +
- " X345(345),\n" +
- " X346(346),\n" +
- " X347(347),\n" +
- " X348(348),\n" +
- " X349(349),\n" +
- " X350(350),\n" +
- " X351(351),\n" +
- " X352(352),\n" +
- " X353(353),\n" +
- " X354(354),\n" +
- " X355(355),\n" +
- " X356(356),\n" +
- " X357(357),\n" +
- " X358(358),\n" +
- " X359(359),\n" +
- " X360(360),\n" +
- " X361(361),\n" +
- " X362(362),\n" +
- " X363(363),\n" +
- " X364(364),\n" +
- " X365(365),\n" +
- " X366(366),\n" +
- " X367(367),\n" +
- " X368(368),\n" +
- " X369(369),\n" +
- " X370(370),\n" +
- " X371(371),\n" +
- " X372(372),\n" +
- " X373(373),\n" +
- " X374(374),\n" +
- " X375(375),\n" +
- " X376(376),\n" +
- " X377(377),\n" +
- " X378(378),\n" +
- " X379(379),\n" +
- " X380(380),\n" +
- " X381(381),\n" +
- " X382(382),\n" +
- " X383(383),\n" +
- " X384(384),\n" +
- " X385(385),\n" +
- " X386(386),\n" +
- " X387(387),\n" +
- " X388(388),\n" +
- " X389(389),\n" +
- " X390(390),\n" +
- " X391(391),\n" +
- " X392(392),\n" +
- " X393(393),\n" +
- " X394(394),\n" +
- " X395(395),\n" +
- " X396(396),\n" +
- " X397(397),\n" +
- " X398(398),\n" +
- " X399(399),\n" +
- " X400(400),\n" +
- " X401(401),\n" +
- " X402(402),\n" +
- " X403(403),\n" +
- " X404(404),\n" +
- " X405(405),\n" +
- " X406(406),\n" +
- " X407(407),\n" +
- " X408(408),\n" +
- " X409(409),\n" +
- " X410(410),\n" +
- " X411(411),\n" +
- " X412(412),\n" +
- " X413(413),\n" +
- " X414(414),\n" +
- " X415(415),\n" +
- " X416(416),\n" +
- " X417(417),\n" +
- " X418(418),\n" +
- " X419(419),\n" +
- " X420(420),\n" +
- " X421(421),\n" +
- " X422(422),\n" +
- " X423(423),\n" +
- " X424(424),\n" +
- " X425(425),\n" +
- " X426(426),\n" +
- " X427(427),\n" +
- " X428(428),\n" +
- " X429(429),\n" +
- " X430(430),\n" +
- " X431(431),\n" +
- " X432(432),\n" +
- " X433(433),\n" +
- " X434(434),\n" +
- " X435(435),\n" +
- " X436(436),\n" +
- " X437(437),\n" +
- " X438(438),\n" +
- " X439(439),\n" +
- " X440(440),\n" +
- " X441(441),\n" +
- " X442(442),\n" +
- " X443(443),\n" +
- " X444(444),\n" +
- " X445(445),\n" +
- " X446(446),\n" +
- " X447(447),\n" +
- " X448(448),\n" +
- " X449(449),\n" +
- " X450(450),\n" +
- " X451(451),\n" +
- " X452(452),\n" +
- " X453(453),\n" +
- " X454(454),\n" +
- " X455(455),\n" +
- " X456(456),\n" +
- " X457(457),\n" +
- " X458(458),\n" +
- " X459(459),\n" +
- " X460(460),\n" +
- " X461(461),\n" +
- " X462(462),\n" +
- " X463(463),\n" +
- " X464(464),\n" +
- " X465(465),\n" +
- " X466(466),\n" +
- " X467(467),\n" +
- " X468(468),\n" +
- " X469(469),\n" +
- " X470(470),\n" +
- " X471(471),\n" +
- " X472(472),\n" +
- " X473(473),\n" +
- " X474(474),\n" +
- " X475(475),\n" +
- " X476(476),\n" +
- " X477(477),\n" +
- " X478(478),\n" +
- " X479(479),\n" +
- " X480(480),\n" +
- " X481(481),\n" +
- " X482(482),\n" +
- " X483(483),\n" +
- " X484(484),\n" +
- " X485(485),\n" +
- " X486(486),\n" +
- " X487(487),\n" +
- " X488(488),\n" +
- " X489(489),\n" +
- " X490(490),\n" +
- " X491(491),\n" +
- " X492(492),\n" +
- " X493(493),\n" +
- " X494(494),\n" +
- " X495(495),\n" +
- " X496(496),\n" +
- " X497(497),\n" +
- " X498(498),\n" +
- " X499(499),\n" +
- " X500(500),\n" +
- " X501(501),\n" +
- " X502(502),\n" +
- " X503(503),\n" +
- " X504(504),\n" +
- " X505(505),\n" +
- " X506(506),\n" +
- " X507(507),\n" +
- " X508(508),\n" +
- " X509(509),\n" +
- " X510(510),\n" +
- " X511(511),\n" +
- " X512(512),\n" +
- " X513(513),\n" +
- " X514(514),\n" +
- " X515(515),\n" +
- " X516(516),\n" +
- " X517(517),\n" +
- " X518(518),\n" +
- " X519(519),\n" +
- " X520(520),\n" +
- " X521(521),\n" +
- " X522(522),\n" +
- " X523(523),\n" +
- " X524(524),\n" +
- " X525(525),\n" +
- " X526(526),\n" +
- " X527(527),\n" +
- " X528(528),\n" +
- " X529(529),\n" +
- " X530(530),\n" +
- " X531(531),\n" +
- " X532(532),\n" +
- " X533(533),\n" +
- " X534(534),\n" +
- " X535(535),\n" +
- " X536(536),\n" +
- " X537(537),\n" +
- " X538(538),\n" +
- " X539(539),\n" +
- " X540(540),\n" +
- " X541(541),\n" +
- " X542(542),\n" +
- " X543(543),\n" +
- " X544(544),\n" +
- " X545(545),\n" +
- " X546(546),\n" +
- " X547(547),\n" +
- " X548(548),\n" +
- " X549(549),\n" +
- " X550(550),\n" +
- " X551(551),\n" +
- " X552(552),\n" +
- " X553(553),\n" +
- " X554(554),\n" +
- " X555(555),\n" +
- " X556(556),\n" +
- " X557(557),\n" +
- " X558(558),\n" +
- " X559(559),\n" +
- " X560(560),\n" +
- " X561(561),\n" +
- " X562(562),\n" +
- " X563(563),\n" +
- " X564(564),\n" +
- " X565(565),\n" +
- " X566(566),\n" +
- " X567(567),\n" +
- " X568(568),\n" +
- " X569(569),\n" +
- " X570(570),\n" +
- " X571(571),\n" +
- " X572(572),\n" +
- " X573(573),\n" +
- " X574(574),\n" +
- " X575(575),\n" +
- " X576(576),\n" +
- " X577(577),\n" +
- " X578(578),\n" +
- " X579(579),\n" +
- " X580(580),\n" +
- " X581(581),\n" +
- " X582(582),\n" +
- " X583(583),\n" +
- " X584(584),\n" +
- " X585(585),\n" +
- " X586(586),\n" +
- " X587(587),\n" +
- " X588(588),\n" +
- " X589(589),\n" +
- " X590(590),\n" +
- " X591(591),\n" +
- " X592(592),\n" +
- " X593(593),\n" +
- " X594(594),\n" +
- " X595(595),\n" +
- " X596(596),\n" +
- " X597(597),\n" +
- " X598(598),\n" +
- " X599(599),\n" +
- " X600(600),\n" +
- " X601(601),\n" +
- " X602(602),\n" +
- " X603(603),\n" +
- " X604(604),\n" +
- " X605(605),\n" +
- " X606(606),\n" +
- " X607(607),\n" +
- " X608(608),\n" +
- " X609(609),\n" +
- " X610(610),\n" +
- " X611(611),\n" +
- " X612(612),\n" +
- " X613(613),\n" +
- " X614(614),\n" +
- " X615(615),\n" +
- " X616(616),\n" +
- " X617(617),\n" +
- " X618(618),\n" +
- " X619(619),\n" +
- " X620(620),\n" +
- " X621(621),\n" +
- " X622(622),\n" +
- " X623(623),\n" +
- " X624(624),\n" +
- " X625(625),\n" +
- " X626(626),\n" +
- " X627(627),\n" +
- " X628(628),\n" +
- " X629(629),\n" +
- " X630(630),\n" +
- " X631(631),\n" +
- " X632(632),\n" +
- " X633(633),\n" +
- " X634(634),\n" +
- " X635(635),\n" +
- " X636(636),\n" +
- " X637(637),\n" +
- " X638(638),\n" +
- " X639(639),\n" +
- " X640(640),\n" +
- " X641(641),\n" +
- " X642(642),\n" +
- " X643(643),\n" +
- " X644(644),\n" +
- " X645(645),\n" +
- " X646(646),\n" +
- " X647(647),\n" +
- " X648(648),\n" +
- " X649(649),\n" +
- " X650(650),\n" +
- " X651(651),\n" +
- " X652(652),\n" +
- " X653(653),\n" +
- " X654(654),\n" +
- " X655(655),\n" +
- " X656(656),\n" +
- " X657(657),\n" +
- " X658(658),\n" +
- " X659(659),\n" +
- " X660(660),\n" +
- " X661(661),\n" +
- " X662(662),\n" +
- " X663(663),\n" +
- " X664(664),\n" +
- " X665(665),\n" +
- " X666(666),\n" +
- " X667(667),\n" +
- " X668(668),\n" +
- " X669(669),\n" +
- " X670(670),\n" +
- " X671(671),\n" +
- " X672(672),\n" +
- " X673(673),\n" +
- " X674(674),\n" +
- " X675(675),\n" +
- " X676(676),\n" +
- " X677(677),\n" +
- " X678(678),\n" +
- " X679(679),\n" +
- " X680(680),\n" +
- " X681(681),\n" +
- " X682(682),\n" +
- " X683(683),\n" +
- " X684(684),\n" +
- " X685(685),\n" +
- " X686(686),\n" +
- " X687(687),\n" +
- " X688(688),\n" +
- " X689(689),\n" +
- " X690(690),\n" +
- " X691(691),\n" +
- " X692(692),\n" +
- " X693(693),\n" +
- " X694(694),\n" +
- " X695(695),\n" +
- " X696(696),\n" +
- " X697(697),\n" +
- " X698(698),\n" +
- " X699(699),\n" +
- " X700(700),\n" +
- " X701(701),\n" +
- " X702(702),\n" +
- " X703(703),\n" +
- " X704(704),\n" +
- " X705(705),\n" +
- " X706(706),\n" +
- " X707(707),\n" +
- " X708(708),\n" +
- " X709(709),\n" +
- " X710(710),\n" +
- " X711(711),\n" +
- " X712(712),\n" +
- " X713(713),\n" +
- " X714(714),\n" +
- " X715(715),\n" +
- " X716(716),\n" +
- " X717(717),\n" +
- " X718(718),\n" +
- " X719(719),\n" +
- " X720(720),\n" +
- " X721(721),\n" +
- " X722(722),\n" +
- " X723(723),\n" +
- " X724(724),\n" +
- " X725(725),\n" +
- " X726(726),\n" +
- " X727(727),\n" +
- " X728(728),\n" +
- " X729(729),\n" +
- " X730(730),\n" +
- " X731(731),\n" +
- " X732(732),\n" +
- " X733(733),\n" +
- " X734(734),\n" +
- " X735(735),\n" +
- " X736(736),\n" +
- " X737(737),\n" +
- " X738(738),\n" +
- " X739(739),\n" +
- " X740(740),\n" +
- " X741(741),\n" +
- " X742(742),\n" +
- " X743(743),\n" +
- " X744(744),\n" +
- " X745(745),\n" +
- " X746(746),\n" +
- " X747(747),\n" +
- " X748(748),\n" +
- " X749(749),\n" +
- " X750(750),\n" +
- " X751(751),\n" +
- " X752(752),\n" +
- " X753(753),\n" +
- " X754(754),\n" +
- " X755(755),\n" +
- " X756(756),\n" +
- " X757(757),\n" +
- " X758(758),\n" +
- " X759(759),\n" +
- " X760(760),\n" +
- " X761(761),\n" +
- " X762(762),\n" +
- " X763(763),\n" +
- " X764(764),\n" +
- " X765(765),\n" +
- " X766(766),\n" +
- " X767(767),\n" +
- " X768(768),\n" +
- " X769(769),\n" +
- " X770(770),\n" +
- " X771(771),\n" +
- " X772(772),\n" +
- " X773(773),\n" +
- " X774(774),\n" +
- " X775(775),\n" +
- " X776(776),\n" +
- " X777(777),\n" +
- " X778(778),\n" +
- " X779(779),\n" +
- " X780(780),\n" +
- " X781(781),\n" +
- " X782(782),\n" +
- " X783(783),\n" +
- " X784(784),\n" +
- " X785(785),\n" +
- " X786(786),\n" +
- " X787(787),\n" +
- " X788(788),\n" +
- " X789(789),\n" +
- " X790(790),\n" +
- " X791(791),\n" +
- " X792(792),\n" +
- " X793(793),\n" +
- " X794(794),\n" +
- " X795(795),\n" +
- " X796(796),\n" +
- " X797(797),\n" +
- " X798(798),\n" +
- " X799(799),\n" +
- " X800(800),\n" +
- " X801(801),\n" +
- " X802(802),\n" +
- " X803(803),\n" +
- " X804(804),\n" +
- " X805(805),\n" +
- " X806(806),\n" +
- " X807(807),\n" +
- " X808(808),\n" +
- " X809(809),\n" +
- " X810(810),\n" +
- " X811(811),\n" +
- " X812(812),\n" +
- " X813(813),\n" +
- " X814(814),\n" +
- " X815(815),\n" +
- " X816(816),\n" +
- " X817(817),\n" +
- " X818(818),\n" +
- " X819(819),\n" +
- " X820(820),\n" +
- " X821(821),\n" +
- " X822(822),\n" +
- " X823(823),\n" +
- " X824(824),\n" +
- " X825(825),\n" +
- " X826(826),\n" +
- " X827(827),\n" +
- " X828(828),\n" +
- " X829(829),\n" +
- " X830(830),\n" +
- " X831(831),\n" +
- " X832(832),\n" +
- " X833(833),\n" +
- " X834(834),\n" +
- " X835(835),\n" +
- " X836(836),\n" +
- " X837(837),\n" +
- " X838(838),\n" +
- " X839(839),\n" +
- " X840(840),\n" +
- " X841(841),\n" +
- " X842(842),\n" +
- " X843(843),\n" +
- " X844(844),\n" +
- " X845(845),\n" +
- " X846(846),\n" +
- " X847(847),\n" +
- " X848(848),\n" +
- " X849(849),\n" +
- " X850(850),\n" +
- " X851(851),\n" +
- " X852(852),\n" +
- " X853(853),\n" +
- " X854(854),\n" +
- " X855(855),\n" +
- " X856(856),\n" +
- " X857(857),\n" +
- " X858(858),\n" +
- " X859(859),\n" +
- " X860(860),\n" +
- " X861(861),\n" +
- " X862(862),\n" +
- " X863(863),\n" +
- " X864(864),\n" +
- " X865(865),\n" +
- " X866(866),\n" +
- " X867(867),\n" +
- " X868(868),\n" +
- " X869(869),\n" +
- " X870(870),\n" +
- " X871(871),\n" +
- " X872(872),\n" +
- " X873(873),\n" +
- " X874(874),\n" +
- " X875(875),\n" +
- " X876(876),\n" +
- " X877(877),\n" +
- " X878(878),\n" +
- " X879(879),\n" +
- " X880(880),\n" +
- " X881(881),\n" +
- " X882(882),\n" +
- " X883(883),\n" +
- " X884(884),\n" +
- " X885(885),\n" +
- " X886(886),\n" +
- " X887(887),\n" +
- " X888(888),\n" +
- " X889(889),\n" +
- " X890(890),\n" +
- " X891(891),\n" +
- " X892(892),\n" +
- " X893(893),\n" +
- " X894(894),\n" +
- " X895(895),\n" +
- " X896(896),\n" +
- " X897(897),\n" +
- " X898(898),\n" +
- " X899(899),\n" +
- " X900(900),\n" +
- " X901(901),\n" +
- " X902(902),\n" +
- " X903(903),\n" +
- " X904(904),\n" +
- " X905(905),\n" +
- " X906(906),\n" +
- " X907(907),\n" +
- " X908(908),\n" +
- " X909(909),\n" +
- " X910(910),\n" +
- " X911(911),\n" +
- " X912(912),\n" +
- " X913(913),\n" +
- " X914(914),\n" +
- " X915(915),\n" +
- " X916(916),\n" +
- " X917(917),\n" +
- " X918(918),\n" +
- " X919(919),\n" +
- " X920(920),\n" +
- " X921(921),\n" +
- " X922(922),\n" +
- " X923(923),\n" +
- " X924(924),\n" +
- " X925(925),\n" +
- " X926(926),\n" +
- " X927(927),\n" +
- " X928(928),\n" +
- " X929(929),\n" +
- " X930(930),\n" +
- " X931(931),\n" +
- " X932(932),\n" +
- " X933(933),\n" +
- " X934(934),\n" +
- " X935(935),\n" +
- " X936(936),\n" +
- " X937(937),\n" +
- " X938(938),\n" +
- " X939(939),\n" +
- " X940(940),\n" +
- " X941(941),\n" +
- " X942(942),\n" +
- " X943(943),\n" +
- " X944(944),\n" +
- " X945(945),\n" +
- " X946(946),\n" +
- " X947(947),\n" +
- " X948(948),\n" +
- " X949(949),\n" +
- " X950(950),\n" +
- " X951(951),\n" +
- " X952(952),\n" +
- " X953(953),\n" +
- " X954(954),\n" +
- " X955(955),\n" +
- " X956(956),\n" +
- " X957(957),\n" +
- " X958(958),\n" +
- " X959(959),\n" +
- " X960(960),\n" +
- " X961(961),\n" +
- " X962(962),\n" +
- " X963(963),\n" +
- " X964(964),\n" +
- " X965(965),\n" +
- " X966(966),\n" +
- " X967(967),\n" +
- " X968(968),\n" +
- " X969(969),\n" +
- " X970(970),\n" +
- " X971(971),\n" +
- " X972(972),\n" +
- " X973(973),\n" +
- " X974(974),\n" +
- " X975(975),\n" +
- " X976(976),\n" +
- " X977(977),\n" +
- " X978(978),\n" +
- " X979(979),\n" +
- " X980(980),\n" +
- " X981(981),\n" +
- " X982(982),\n" +
- " X983(983),\n" +
- " X984(984),\n" +
- " X985(985),\n" +
- " X986(986),\n" +
- " X987(987),\n" +
- " X988(988),\n" +
- " X989(989),\n" +
- " X990(990),\n" +
- " X991(991),\n" +
- " X992(992),\n" +
- " X993(993),\n" +
- " X994(994),\n" +
- " X995(995),\n" +
- " X996(996),\n" +
- " X997(997),\n" +
- " X998(998),\n" +
- " X999(999),\n" +
- " X1000(1000),\n" +
- " X1001(1001),\n" +
- " X1002(1002),\n" +
- " X1003(1003),\n" +
- " X1004(1004),\n" +
- " X1005(1005),\n" +
- " X1006(1006),\n" +
- " X1007(1007),\n" +
- " X1008(1008),\n" +
- " X1009(1009),\n" +
- " X1010(1010),\n" +
- " X1011(1011),\n" +
- " X1012(1012),\n" +
- " X1013(1013),\n" +
- " X1014(1014),\n" +
- " X1015(1015),\n" +
- " X1016(1016),\n" +
- " X1017(1017),\n" +
- " X1018(1018),\n" +
- " X1019(1019),\n" +
- " X1020(1020),\n" +
- " X1021(1021),\n" +
- " X1022(1022),\n" +
- " X1023(1023),\n" +
- " X1024(1024),\n" +
- " X1025(1025),\n" +
- " X1026(1026),\n" +
- " X1027(1027),\n" +
- " X1028(1028),\n" +
- " X1029(1029),\n" +
- " X1030(1030),\n" +
- " X1031(1031),\n" +
- " X1032(1032),\n" +
- " X1033(1033),\n" +
- " X1034(1034),\n" +
- " X1035(1035),\n" +
- " X1036(1036),\n" +
- " X1037(1037),\n" +
- " X1038(1038),\n" +
- " X1039(1039),\n" +
- " X1040(1040),\n" +
- " X1041(1041),\n" +
- " X1042(1042),\n" +
- " X1043(1043),\n" +
- " X1044(1044),\n" +
- " X1045(1045),\n" +
- " X1046(1046),\n" +
- " X1047(1047),\n" +
- " X1048(1048),\n" +
- " X1049(1049),\n" +
- " X1050(1050),\n" +
- " X1051(1051),\n" +
- " X1052(1052),\n" +
- " X1053(1053),\n" +
- " X1054(1054),\n" +
- " X1055(1055),\n" +
- " X1056(1056),\n" +
- " X1057(1057),\n" +
- " X1058(1058),\n" +
- " X1059(1059),\n" +
- " X1060(1060),\n" +
- " X1061(1061),\n" +
- " X1062(1062),\n" +
- " X1063(1063),\n" +
- " X1064(1064),\n" +
- " X1065(1065),\n" +
- " X1066(1066),\n" +
- " X1067(1067),\n" +
- " X1068(1068),\n" +
- " X1069(1069),\n" +
- " X1070(1070),\n" +
- " X1071(1071),\n" +
- " X1072(1072),\n" +
- " X1073(1073),\n" +
- " X1074(1074),\n" +
- " X1075(1075),\n" +
- " X1076(1076),\n" +
- " X1077(1077),\n" +
- " X1078(1078),\n" +
- " X1079(1079),\n" +
- " X1080(1080),\n" +
- " X1081(1081),\n" +
- " X1082(1082),\n" +
- " X1083(1083),\n" +
- " X1084(1084),\n" +
- " X1085(1085),\n" +
- " X1086(1086),\n" +
- " X1087(1087),\n" +
- " X1088(1088),\n" +
- " X1089(1089),\n" +
- " X1090(1090),\n" +
- " X1091(1091),\n" +
- " X1092(1092),\n" +
- " X1093(1093),\n" +
- " X1094(1094),\n" +
- " X1095(1095),\n" +
- " X1096(1096),\n" +
- " X1097(1097),\n" +
- " X1098(1098),\n" +
- " X1099(1099),\n" +
- " X1100(1100),\n" +
- " X1101(1101),\n" +
- " X1102(1102),\n" +
- " X1103(1103),\n" +
- " X1104(1104),\n" +
- " X1105(1105),\n" +
- " X1106(1106),\n" +
- " X1107(1107),\n" +
- " X1108(1108),\n" +
- " X1109(1109),\n" +
- " X1110(1110),\n" +
- " X1111(1111),\n" +
- " X1112(1112),\n" +
- " X1113(1113),\n" +
- " X1114(1114),\n" +
- " X1115(1115),\n" +
- " X1116(1116),\n" +
- " X1117(1117),\n" +
- " X1118(1118),\n" +
- " X1119(1119),\n" +
- " X1120(1120),\n" +
- " X1121(1121),\n" +
- " X1122(1122),\n" +
- " X1123(1123),\n" +
- " X1124(1124),\n" +
- " X1125(1125),\n" +
- " X1126(1126),\n" +
- " X1127(1127),\n" +
- " X1128(1128),\n" +
- " X1129(1129),\n" +
- " X1130(1130),\n" +
- " X1131(1131),\n" +
- " X1132(1132),\n" +
- " X1133(1133),\n" +
- " X1134(1134),\n" +
- " X1135(1135),\n" +
- " X1136(1136),\n" +
- " X1137(1137),\n" +
- " X1138(1138),\n" +
- " X1139(1139),\n" +
- " X1140(1140),\n" +
- " X1141(1141),\n" +
- " X1142(1142),\n" +
- " X1143(1143),\n" +
- " X1144(1144),\n" +
- " X1145(1145),\n" +
- " X1146(1146),\n" +
- " X1147(1147),\n" +
- " X1148(1148),\n" +
- " X1149(1149),\n" +
- " X1150(1150),\n" +
- " X1151(1151),\n" +
- " X1152(1152),\n" +
- " X1153(1153),\n" +
- " X1154(1154),\n" +
- " X1155(1155),\n" +
- " X1156(1156),\n" +
- " X1157(1157),\n" +
- " X1158(1158),\n" +
- " X1159(1159),\n" +
- " X1160(1160),\n" +
- " X1161(1161),\n" +
- " X1162(1162),\n" +
- " X1163(1163),\n" +
- " X1164(1164),\n" +
- " X1165(1165),\n" +
- " X1166(1166),\n" +
- " X1167(1167),\n" +
- " X1168(1168),\n" +
- " X1169(1169),\n" +
- " X1170(1170),\n" +
- " X1171(1171),\n" +
- " X1172(1172),\n" +
- " X1173(1173),\n" +
- " X1174(1174),\n" +
- " X1175(1175),\n" +
- " X1176(1176),\n" +
- " X1177(1177),\n" +
- " X1178(1178),\n" +
- " X1179(1179),\n" +
- " X1180(1180),\n" +
- " X1181(1181),\n" +
- " X1182(1182),\n" +
- " X1183(1183),\n" +
- " X1184(1184),\n" +
- " X1185(1185),\n" +
- " X1186(1186),\n" +
- " X1187(1187),\n" +
- " X1188(1188),\n" +
- " X1189(1189),\n" +
- " X1190(1190),\n" +
- " X1191(1191),\n" +
- " X1192(1192),\n" +
- " X1193(1193),\n" +
- " X1194(1194),\n" +
- " X1195(1195),\n" +
- " X1196(1196),\n" +
- " X1197(1197),\n" +
- " X1198(1198),\n" +
- " X1199(1199),\n" +
- " X1200(1200),\n" +
- " X1201(1201),\n" +
- " X1202(1202),\n" +
- " X1203(1203),\n" +
- " X1204(1204),\n" +
- " X1205(1205),\n" +
- " X1206(1206),\n" +
- " X1207(1207),\n" +
- " X1208(1208),\n" +
- " X1209(1209),\n" +
- " X1210(1210),\n" +
- " X1211(1211),\n" +
- " X1212(1212),\n" +
- " X1213(1213),\n" +
- " X1214(1214),\n" +
- " X1215(1215),\n" +
- " X1216(1216),\n" +
- " X1217(1217),\n" +
- " X1218(1218),\n" +
- " X1219(1219),\n" +
- " X1220(1220),\n" +
- " X1221(1221),\n" +
- " X1222(1222),\n" +
- " X1223(1223),\n" +
- " X1224(1224),\n" +
- " X1225(1225),\n" +
- " X1226(1226),\n" +
- " X1227(1227),\n" +
- " X1228(1228),\n" +
- " X1229(1229),\n" +
- " X1230(1230),\n" +
- " X1231(1231),\n" +
- " X1232(1232),\n" +
- " X1233(1233),\n" +
- " X1234(1234),\n" +
- " X1235(1235),\n" +
- " X1236(1236),\n" +
- " X1237(1237),\n" +
- " X1238(1238),\n" +
- " X1239(1239),\n" +
- " X1240(1240),\n" +
- " X1241(1241),\n" +
- " X1242(1242),\n" +
- " X1243(1243),\n" +
- " X1244(1244),\n" +
- " X1245(1245),\n" +
- " X1246(1246),\n" +
- " X1247(1247),\n" +
- " X1248(1248),\n" +
- " X1249(1249),\n" +
- " X1250(1250),\n" +
- " X1251(1251),\n" +
- " X1252(1252),\n" +
- " X1253(1253),\n" +
- " X1254(1254),\n" +
- " X1255(1255),\n" +
- " X1256(1256),\n" +
- " X1257(1257),\n" +
- " X1258(1258),\n" +
- " X1259(1259),\n" +
- " X1260(1260),\n" +
- " X1261(1261),\n" +
- " X1262(1262),\n" +
- " X1263(1263),\n" +
- " X1264(1264),\n" +
- " X1265(1265),\n" +
- " X1266(1266),\n" +
- " X1267(1267),\n" +
- " X1268(1268),\n" +
- " X1269(1269),\n" +
- " X1270(1270),\n" +
- " X1271(1271),\n" +
- " X1272(1272),\n" +
- " X1273(1273),\n" +
- " X1274(1274),\n" +
- " X1275(1275),\n" +
- " X1276(1276),\n" +
- " X1277(1277),\n" +
- " X1278(1278),\n" +
- " X1279(1279),\n" +
- " X1280(1280),\n" +
- " X1281(1281),\n" +
- " X1282(1282),\n" +
- " X1283(1283),\n" +
- " X1284(1284),\n" +
- " X1285(1285),\n" +
- " X1286(1286),\n" +
- " X1287(1287),\n" +
- " X1288(1288),\n" +
- " X1289(1289),\n" +
- " X1290(1290),\n" +
- " X1291(1291),\n" +
- " X1292(1292),\n" +
- " X1293(1293),\n" +
- " X1294(1294),\n" +
- " X1295(1295),\n" +
- " X1296(1296),\n" +
- " X1297(1297),\n" +
- " X1298(1298),\n" +
- " X1299(1299),\n" +
- " X1300(1300),\n" +
- " X1301(1301),\n" +
- " X1302(1302),\n" +
- " X1303(1303),\n" +
- " X1304(1304),\n" +
- " X1305(1305),\n" +
- " X1306(1306),\n" +
- " X1307(1307),\n" +
- " X1308(1308),\n" +
- " X1309(1309),\n" +
- " X1310(1310),\n" +
- " X1311(1311),\n" +
- " X1312(1312),\n" +
- " X1313(1313),\n" +
- " X1314(1314),\n" +
- " X1315(1315),\n" +
- " X1316(1316),\n" +
- " X1317(1317),\n" +
- " X1318(1318),\n" +
- " X1319(1319),\n" +
- " X1320(1320),\n" +
- " X1321(1321),\n" +
- " X1322(1322),\n" +
- " X1323(1323),\n" +
- " X1324(1324),\n" +
- " X1325(1325),\n" +
- " X1326(1326),\n" +
- " X1327(1327),\n" +
- " X1328(1328),\n" +
- " X1329(1329),\n" +
- " X1330(1330),\n" +
- " X1331(1331),\n" +
- " X1332(1332),\n" +
- " X1333(1333),\n" +
- " X1334(1334),\n" +
- " X1335(1335),\n" +
- " X1336(1336),\n" +
- " X1337(1337),\n" +
- " X1338(1338),\n" +
- " X1339(1339),\n" +
- " X1340(1340),\n" +
- " X1341(1341),\n" +
- " X1342(1342),\n" +
- " X1343(1343),\n" +
- " X1344(1344),\n" +
- " X1345(1345),\n" +
- " X1346(1346),\n" +
- " X1347(1347),\n" +
- " X1348(1348),\n" +
- " X1349(1349),\n" +
- " X1350(1350),\n" +
- " X1351(1351),\n" +
- " X1352(1352),\n" +
- " X1353(1353),\n" +
- " X1354(1354),\n" +
- " X1355(1355),\n" +
- " X1356(1356),\n" +
- " X1357(1357),\n" +
- " X1358(1358),\n" +
- " X1359(1359),\n" +
- " X1360(1360),\n" +
- " X1361(1361),\n" +
- " X1362(1362),\n" +
- " X1363(1363),\n" +
- " X1364(1364),\n" +
- " X1365(1365),\n" +
- " X1366(1366),\n" +
- " X1367(1367),\n" +
- " X1368(1368),\n" +
- " X1369(1369),\n" +
- " X1370(1370),\n" +
- " X1371(1371),\n" +
- " X1372(1372),\n" +
- " X1373(1373),\n" +
- " X1374(1374),\n" +
- " X1375(1375),\n" +
- " X1376(1376),\n" +
- " X1377(1377),\n" +
- " X1378(1378),\n" +
- " X1379(1379),\n" +
- " X1380(1380),\n" +
- " X1381(1381),\n" +
- " X1382(1382),\n" +
- " X1383(1383),\n" +
- " X1384(1384),\n" +
- " X1385(1385),\n" +
- " X1386(1386),\n" +
- " X1387(1387),\n" +
- " X1388(1388),\n" +
- " X1389(1389),\n" +
- " X1390(1390),\n" +
- " X1391(1391),\n" +
- " X1392(1392),\n" +
- " X1393(1393),\n" +
- " X1394(1394),\n" +
- " X1395(1395),\n" +
- " X1396(1396),\n" +
- " X1397(1397),\n" +
- " X1398(1398),\n" +
- " X1399(1399),\n" +
- " X1400(1400),\n" +
- " X1401(1401),\n" +
- " X1402(1402),\n" +
- " X1403(1403),\n" +
- " X1404(1404),\n" +
- " X1405(1405),\n" +
- " X1406(1406),\n" +
- " X1407(1407),\n" +
- " X1408(1408),\n" +
- " X1409(1409),\n" +
- " X1410(1410),\n" +
- " X1411(1411),\n" +
- " X1412(1412),\n" +
- " X1413(1413),\n" +
- " X1414(1414),\n" +
- " X1415(1415),\n" +
- " X1416(1416),\n" +
- " X1417(1417),\n" +
- " X1418(1418),\n" +
- " X1419(1419),\n" +
- " X1420(1420),\n" +
- " X1421(1421),\n" +
- " X1422(1422),\n" +
- " X1423(1423),\n" +
- " X1424(1424),\n" +
- " X1425(1425),\n" +
- " X1426(1426),\n" +
- " X1427(1427),\n" +
- " X1428(1428),\n" +
- " X1429(1429),\n" +
- " X1430(1430),\n" +
- " X1431(1431),\n" +
- " X1432(1432),\n" +
- " X1433(1433),\n" +
- " X1434(1434),\n" +
- " X1435(1435),\n" +
- " X1436(1436),\n" +
- " X1437(1437),\n" +
- " X1438(1438),\n" +
- " X1439(1439),\n" +
- " X1440(1440),\n" +
- " X1441(1441),\n" +
- " X1442(1442),\n" +
- " X1443(1443),\n" +
- " X1444(1444),\n" +
- " X1445(1445),\n" +
- " X1446(1446),\n" +
- " X1447(1447),\n" +
- " X1448(1448),\n" +
- " X1449(1449),\n" +
- " X1450(1450),\n" +
- " X1451(1451),\n" +
- " X1452(1452),\n" +
- " X1453(1453),\n" +
- " X1454(1454),\n" +
- " X1455(1455),\n" +
- " X1456(1456),\n" +
- " X1457(1457),\n" +
- " X1458(1458),\n" +
- " X1459(1459),\n" +
- " X1460(1460),\n" +
- " X1461(1461),\n" +
- " X1462(1462),\n" +
- " X1463(1463),\n" +
- " X1464(1464),\n" +
- " X1465(1465),\n" +
- " X1466(1466),\n" +
- " X1467(1467),\n" +
- " X1468(1468),\n" +
- " X1469(1469),\n" +
- " X1470(1470),\n" +
- " X1471(1471),\n" +
- " X1472(1472),\n" +
- " X1473(1473),\n" +
- " X1474(1474),\n" +
- " X1475(1475),\n" +
- " X1476(1476),\n" +
- " X1477(1477),\n" +
- " X1478(1478),\n" +
- " X1479(1479),\n" +
- " X1480(1480),\n" +
- " X1481(1481),\n" +
- " X1482(1482),\n" +
- " X1483(1483),\n" +
- " X1484(1484),\n" +
- " X1485(1485),\n" +
- " X1486(1486),\n" +
- " X1487(1487),\n" +
- " X1488(1488),\n" +
- " X1489(1489),\n" +
- " X1490(1490),\n" +
- " X1491(1491),\n" +
- " X1492(1492),\n" +
- " X1493(1493),\n" +
- " X1494(1494),\n" +
- " X1495(1495),\n" +
- " X1496(1496),\n" +
- " X1497(1497),\n" +
- " X1498(1498),\n" +
- " X1499(1499),\n" +
- " X1500(1500),\n" +
- " X1501(1501),\n" +
- " X1502(1502),\n" +
- " X1503(1503),\n" +
- " X1504(1504),\n" +
- " X1505(1505),\n" +
- " X1506(1506),\n" +
- " X1507(1507),\n" +
- " X1508(1508),\n" +
- " X1509(1509),\n" +
- " X1510(1510),\n" +
- " X1511(1511),\n" +
- " X1512(1512),\n" +
- " X1513(1513),\n" +
- " X1514(1514),\n" +
- " X1515(1515),\n" +
- " X1516(1516),\n" +
- " X1517(1517),\n" +
- " X1518(1518),\n" +
- " X1519(1519),\n" +
- " X1520(1520),\n" +
- " X1521(1521),\n" +
- " X1522(1522),\n" +
- " X1523(1523),\n" +
- " X1524(1524),\n" +
- " X1525(1525),\n" +
- " X1526(1526),\n" +
- " X1527(1527),\n" +
- " X1528(1528),\n" +
- " X1529(1529),\n" +
- " X1530(1530),\n" +
- " X1531(1531),\n" +
- " X1532(1532),\n" +
- " X1533(1533),\n" +
- " X1534(1534),\n" +
- " X1535(1535),\n" +
- " X1536(1536),\n" +
- " X1537(1537),\n" +
- " X1538(1538),\n" +
- " X1539(1539),\n" +
- " X1540(1540),\n" +
- " X1541(1541),\n" +
- " X1542(1542),\n" +
- " X1543(1543),\n" +
- " X1544(1544),\n" +
- " X1545(1545),\n" +
- " X1546(1546),\n" +
- " X1547(1547),\n" +
- " X1548(1548),\n" +
- " X1549(1549),\n" +
- " X1550(1550),\n" +
- " X1551(1551),\n" +
- " X1552(1552),\n" +
- " X1553(1553),\n" +
- " X1554(1554),\n" +
- " X1555(1555),\n" +
- " X1556(1556),\n" +
- " X1557(1557),\n" +
- " X1558(1558),\n" +
- " X1559(1559),\n" +
- " X1560(1560),\n" +
- " X1561(1561),\n" +
- " X1562(1562),\n" +
- " X1563(1563),\n" +
- " X1564(1564),\n" +
- " X1565(1565),\n" +
- " X1566(1566),\n" +
- " X1567(1567),\n" +
- " X1568(1568),\n" +
- " X1569(1569),\n" +
- " X1570(1570),\n" +
- " X1571(1571),\n" +
- " X1572(1572),\n" +
- " X1573(1573),\n" +
- " X1574(1574),\n" +
- " X1575(1575),\n" +
- " X1576(1576),\n" +
- " X1577(1577),\n" +
- " X1578(1578),\n" +
- " X1579(1579),\n" +
- " X1580(1580),\n" +
- " X1581(1581),\n" +
- " X1582(1582),\n" +
- " X1583(1583),\n" +
- " X1584(1584),\n" +
- " X1585(1585),\n" +
- " X1586(1586),\n" +
- " X1587(1587),\n" +
- " X1588(1588),\n" +
- " X1589(1589),\n" +
- " X1590(1590),\n" +
- " X1591(1591),\n" +
- " X1592(1592),\n" +
- " X1593(1593),\n" +
- " X1594(1594),\n" +
- " X1595(1595),\n" +
- " X1596(1596),\n" +
- " X1597(1597),\n" +
- " X1598(1598),\n" +
- " X1599(1599),\n" +
- " X1600(1600),\n" +
- " X1601(1601),\n" +
- " X1602(1602),\n" +
- " X1603(1603),\n" +
- " X1604(1604),\n" +
- " X1605(1605),\n" +
- " X1606(1606),\n" +
- " X1607(1607),\n" +
- " X1608(1608),\n" +
- " X1609(1609),\n" +
- " X1610(1610),\n" +
- " X1611(1611),\n" +
- " X1612(1612),\n" +
- " X1613(1613),\n" +
- " X1614(1614),\n" +
- " X1615(1615),\n" +
- " X1616(1616),\n" +
- " X1617(1617),\n" +
- " X1618(1618),\n" +
- " X1619(1619),\n" +
- " X1620(1620),\n" +
- " X1621(1621),\n" +
- " X1622(1622),\n" +
- " X1623(1623),\n" +
- " X1624(1624),\n" +
- " X1625(1625),\n" +
- " X1626(1626),\n" +
- " X1627(1627),\n" +
- " X1628(1628),\n" +
- " X1629(1629),\n" +
- " X1630(1630),\n" +
- " X1631(1631),\n" +
- " X1632(1632),\n" +
- " X1633(1633),\n" +
- " X1634(1634),\n" +
- " X1635(1635),\n" +
- " X1636(1636),\n" +
- " X1637(1637),\n" +
- " X1638(1638),\n" +
- " X1639(1639),\n" +
- " X1640(1640),\n" +
- " X1641(1641),\n" +
- " X1642(1642),\n" +
- " X1643(1643),\n" +
- " X1644(1644),\n" +
- " X1645(1645),\n" +
- " X1646(1646),\n" +
- " X1647(1647),\n" +
- " X1648(1648),\n" +
- " X1649(1649),\n" +
- " X1650(1650),\n" +
- " X1651(1651),\n" +
- " X1652(1652),\n" +
- " X1653(1653),\n" +
- " X1654(1654),\n" +
- " X1655(1655),\n" +
- " X1656(1656),\n" +
- " X1657(1657),\n" +
- " X1658(1658),\n" +
- " X1659(1659),\n" +
- " X1660(1660),\n" +
- " X1661(1661),\n" +
- " X1662(1662),\n" +
- " X1663(1663),\n" +
- " X1664(1664),\n" +
- " X1665(1665),\n" +
- " X1666(1666),\n" +
- " X1667(1667),\n" +
- " X1668(1668),\n" +
- " X1669(1669),\n" +
- " X1670(1670),\n" +
- " X1671(1671),\n" +
- " X1672(1672),\n" +
- " X1673(1673),\n" +
- " X1674(1674),\n" +
- " X1675(1675),\n" +
- " X1676(1676),\n" +
- " X1677(1677),\n" +
- " X1678(1678),\n" +
- " X1679(1679),\n" +
- " X1680(1680),\n" +
- " X1681(1681),\n" +
- " X1682(1682),\n" +
- " X1683(1683),\n" +
- " X1684(1684),\n" +
- " X1685(1685),\n" +
- " X1686(1686),\n" +
- " X1687(1687),\n" +
- " X1688(1688),\n" +
- " X1689(1689),\n" +
- " X1690(1690),\n" +
- " X1691(1691),\n" +
- " X1692(1692),\n" +
- " X1693(1693),\n" +
- " X1694(1694),\n" +
- " X1695(1695),\n" +
- " X1696(1696),\n" +
- " X1697(1697),\n" +
- " X1698(1698),\n" +
- " X1699(1699),\n" +
- " X1700(1700),\n" +
- " X1701(1701),\n" +
- " X1702(1702),\n" +
- " X1703(1703),\n" +
- " X1704(1704),\n" +
- " X1705(1705),\n" +
- " X1706(1706),\n" +
- " X1707(1707),\n" +
- " X1708(1708),\n" +
- " X1709(1709),\n" +
- " X1710(1710),\n" +
- " X1711(1711),\n" +
- " X1712(1712),\n" +
- " X1713(1713),\n" +
- " X1714(1714),\n" +
- " X1715(1715),\n" +
- " X1716(1716),\n" +
- " X1717(1717),\n" +
- " X1718(1718),\n" +
- " X1719(1719),\n" +
- " X1720(1720),\n" +
- " X1721(1721),\n" +
- " X1722(1722),\n" +
- " X1723(1723),\n" +
- " X1724(1724),\n" +
- " X1725(1725),\n" +
- " X1726(1726),\n" +
- " X1727(1727),\n" +
- " X1728(1728),\n" +
- " X1729(1729),\n" +
- " X1730(1730),\n" +
- " X1731(1731),\n" +
- " X1732(1732),\n" +
- " X1733(1733),\n" +
- " X1734(1734),\n" +
- " X1735(1735),\n" +
- " X1736(1736),\n" +
- " X1737(1737),\n" +
- " X1738(1738),\n" +
- " X1739(1739),\n" +
- " X1740(1740),\n" +
- " X1741(1741),\n" +
- " X1742(1742),\n" +
- " X1743(1743),\n" +
- " X1744(1744),\n" +
- " X1745(1745),\n" +
- " X1746(1746),\n" +
- " X1747(1747),\n" +
- " X1748(1748),\n" +
- " X1749(1749),\n" +
- " X1750(1750),\n" +
- " X1751(1751),\n" +
- " X1752(1752),\n" +
- " X1753(1753),\n" +
- " X1754(1754),\n" +
- " X1755(1755),\n" +
- " X1756(1756),\n" +
- " X1757(1757),\n" +
- " X1758(1758),\n" +
- " X1759(1759),\n" +
- " X1760(1760),\n" +
- " X1761(1761),\n" +
- " X1762(1762),\n" +
- " X1763(1763),\n" +
- " X1764(1764),\n" +
- " X1765(1765),\n" +
- " X1766(1766),\n" +
- " X1767(1767),\n" +
- " X1768(1768),\n" +
- " X1769(1769),\n" +
- " X1770(1770),\n" +
- " X1771(1771),\n" +
- " X1772(1772),\n" +
- " X1773(1773),\n" +
- " X1774(1774),\n" +
- " X1775(1775),\n" +
- " X1776(1776),\n" +
- " X1777(1777),\n" +
- " X1778(1778),\n" +
- " X1779(1779),\n" +
- " X1780(1780),\n" +
- " X1781(1781),\n" +
- " X1782(1782),\n" +
- " X1783(1783),\n" +
- " X1784(1784),\n" +
- " X1785(1785),\n" +
- " X1786(1786),\n" +
- " X1787(1787),\n" +
- " X1788(1788),\n" +
- " X1789(1789),\n" +
- " X1790(1790),\n" +
- " X1791(1791),\n" +
- " X1792(1792),\n" +
- " X1793(1793),\n" +
- " X1794(1794),\n" +
- " X1795(1795),\n" +
- " X1796(1796),\n" +
- " X1797(1797),\n" +
- " X1798(1798),\n" +
- " X1799(1799),\n" +
- " X1800(1800),\n" +
- " X1801(1801),\n" +
- " X1802(1802),\n" +
- " X1803(1803),\n" +
- " X1804(1804),\n" +
- " X1805(1805),\n" +
- " X1806(1806),\n" +
- " X1807(1807),\n" +
- " X1808(1808),\n" +
- " X1809(1809),\n" +
- " X1810(1810),\n" +
- " X1811(1811),\n" +
- " X1812(1812),\n" +
- " X1813(1813),\n" +
- " X1814(1814),\n" +
- " X1815(1815),\n" +
- " X1816(1816),\n" +
- " X1817(1817),\n" +
- " X1818(1818),\n" +
- " X1819(1819),\n" +
- " X1820(1820),\n" +
- " X1821(1821),\n" +
- " X1822(1822),\n" +
- " X1823(1823),\n" +
- " X1824(1824),\n" +
- " X1825(1825),\n" +
- " X1826(1826),\n" +
- " X1827(1827),\n" +
- " X1828(1828),\n" +
- " X1829(1829),\n" +
- " X1830(1830),\n" +
- " X1831(1831),\n" +
- " X1832(1832),\n" +
- " X1833(1833),\n" +
- " X1834(1834),\n" +
- " X1835(1835),\n" +
- " X1836(1836),\n" +
- " X1837(1837),\n" +
- " X1838(1838),\n" +
- " X1839(1839),\n" +
- " X1840(1840),\n" +
- " X1841(1841),\n" +
- " X1842(1842),\n" +
- " X1843(1843),\n" +
- " X1844(1844),\n" +
- " X1845(1845),\n" +
- " X1846(1846),\n" +
- " X1847(1847),\n" +
- " X1848(1848),\n" +
- " X1849(1849),\n" +
- " X1850(1850),\n" +
- " X1851(1851),\n" +
- " X1852(1852),\n" +
- " X1853(1853),\n" +
- " X1854(1854),\n" +
- " X1855(1855),\n" +
- " X1856(1856),\n" +
- " X1857(1857),\n" +
- " X1858(1858),\n" +
- " X1859(1859),\n" +
- " X1860(1860),\n" +
- " X1861(1861),\n" +
- " X1862(1862),\n" +
- " X1863(1863),\n" +
- " X1864(1864),\n" +
- " X1865(1865),\n" +
- " X1866(1866),\n" +
- " X1867(1867),\n" +
- " X1868(1868),\n" +
- " X1869(1869),\n" +
- " X1870(1870),\n" +
- " X1871(1871),\n" +
- " X1872(1872),\n" +
- " X1873(1873),\n" +
- " X1874(1874),\n" +
- " X1875(1875),\n" +
- " X1876(1876),\n" +
- " X1877(1877),\n" +
- " X1878(1878),\n" +
- " X1879(1879),\n" +
- " X1880(1880),\n" +
- " X1881(1881),\n" +
- " X1882(1882),\n" +
- " X1883(1883),\n" +
- " X1884(1884),\n" +
- " X1885(1885),\n" +
- " X1886(1886),\n" +
- " X1887(1887),\n" +
- " X1888(1888),\n" +
- " X1889(1889),\n" +
- " X1890(1890),\n" +
- " X1891(1891),\n" +
- " X1892(1892),\n" +
- " X1893(1893),\n" +
- " X1894(1894),\n" +
- " X1895(1895),\n" +
- " X1896(1896),\n" +
- " X1897(1897),\n" +
- " X1898(1898),\n" +
- " X1899(1899),\n" +
- " X1900(1900),\n" +
- " X1901(1901),\n" +
- " X1902(1902),\n" +
- " X1903(1903),\n" +
- " X1904(1904),\n" +
- " X1905(1905),\n" +
- " X1906(1906),\n" +
- " X1907(1907),\n" +
- " X1908(1908),\n" +
- " X1909(1909),\n" +
- " X1910(1910),\n" +
- " X1911(1911),\n" +
- " X1912(1912),\n" +
- " X1913(1913),\n" +
- " X1914(1914),\n" +
- " X1915(1915),\n" +
- " X1916(1916),\n" +
- " X1917(1917),\n" +
- " X1918(1918),\n" +
- " X1919(1919),\n" +
- " X1920(1920),\n" +
- " X1921(1921),\n" +
- " X1922(1922),\n" +
- " X1923(1923),\n" +
- " X1924(1924),\n" +
- " X1925(1925),\n" +
- " X1926(1926),\n" +
- " X1927(1927),\n" +
- " X1928(1928),\n" +
- " X1929(1929),\n" +
- " X1930(1930),\n" +
- " X1931(1931),\n" +
- " X1932(1932),\n" +
- " X1933(1933),\n" +
- " X1934(1934),\n" +
- " X1935(1935),\n" +
- " X1936(1936),\n" +
- " X1937(1937),\n" +
- " X1938(1938),\n" +
- " X1939(1939),\n" +
- " X1940(1940),\n" +
- " X1941(1941),\n" +
- " X1942(1942),\n" +
- " X1943(1943),\n" +
- " X1944(1944),\n" +
- " X1945(1945),\n" +
- " X1946(1946),\n" +
- " X1947(1947),\n" +
- " X1948(1948),\n" +
- " X1949(1949),\n" +
- " X1950(1950),\n" +
- " X1951(1951),\n" +
- " X1952(1952),\n" +
- " X1953(1953),\n" +
- " X1954(1954),\n" +
- " X1955(1955),\n" +
- " X1956(1956),\n" +
- " X1957(1957),\n" +
- " X1958(1958),\n" +
- " X1959(1959),\n" +
- " X1960(1960),\n" +
- " X1961(1961),\n" +
- " X1962(1962),\n" +
- " X1963(1963),\n" +
- " X1964(1964),\n" +
- " X1965(1965),\n" +
- " X1966(1966),\n" +
- " X1967(1967),\n" +
- " X1968(1968),\n" +
- " X1969(1969),\n" +
- " X1970(1970),\n" +
- " X1971(1971),\n" +
- " X1972(1972),\n" +
- " X1973(1973),\n" +
- " X1974(1974),\n" +
- " X1975(1975),\n" +
- " X1976(1976),\n" +
- " X1977(1977),\n" +
- " X1978(1978),\n" +
- " X1979(1979),\n" +
- " X1980(1980),\n" +
- " X1981(1981),\n" +
- " X1982(1982),\n" +
- " X1983(1983),\n" +
- " X1984(1984),\n" +
- " X1985(1985),\n" +
- " X1986(1986),\n" +
- " X1987(1987),\n" +
- " X1988(1988),\n" +
- " X1989(1989),\n" +
- " X1990(1990),\n" +
- " X1991(1991),\n" +
- " X1992(1992),\n" +
- " X1993(1993),\n" +
- " X1994(1994),\n" +
- " X1995(1995),\n" +
- " X1996(1996),\n" +
- " X1997(1997),\n" +
- " X1998(1998),\n" +
- " X1999(1999),\n" +
- " X2000(2000),\n" +
- " X2001(2001),\n" +
- " ;\n" +
- "\n" +
- " private int value;\n" +
- " X(int i) {\n" +
- " this.value = i;\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " int i = 0;\n" +
- " for (X x : X.values()) {\n" +
- " i++;\n" +
- " System.out.print(x);\n" +
- " }\n" +
- " System.out.print(i);\n" +
- " }\n" +
- " \n" +
- " public String toString() {\n" +
- " return Integer.toString(this.value);\n" +
- " }\n" +
+ "public enum X {\n" +
+ " X1(1),\n" +
+ " X2(2),\n" +
+ " X3(3),\n" +
+ " X4(4),\n" +
+ " X5(5),\n" +
+ " X6(6),\n" +
+ " X7(7),\n" +
+ " X8(8),\n" +
+ " X9(9),\n" +
+ " X10(10),\n" +
+ " X11(11),\n" +
+ " X12(12),\n" +
+ " X13(13),\n" +
+ " X14(14),\n" +
+ " X15(15),\n" +
+ " X16(16),\n" +
+ " X17(17),\n" +
+ " X18(18),\n" +
+ " X19(19),\n" +
+ " X20(20),\n" +
+ " X21(21),\n" +
+ " X22(22),\n" +
+ " X23(23),\n" +
+ " X24(24),\n" +
+ " X25(25),\n" +
+ " X26(26),\n" +
+ " X27(27),\n" +
+ " X28(28),\n" +
+ " X29(29),\n" +
+ " X30(30),\n" +
+ " X31(31),\n" +
+ " X32(32),\n" +
+ " X33(33),\n" +
+ " X34(34),\n" +
+ " X35(35),\n" +
+ " X36(36),\n" +
+ " X37(37),\n" +
+ " X38(38),\n" +
+ " X39(39),\n" +
+ " X40(40),\n" +
+ " X41(41),\n" +
+ " X42(42),\n" +
+ " X43(43),\n" +
+ " X44(44),\n" +
+ " X45(45),\n" +
+ " X46(46),\n" +
+ " X47(47),\n" +
+ " X48(48),\n" +
+ " X49(49),\n" +
+ " X50(50),\n" +
+ " X51(51),\n" +
+ " X52(52),\n" +
+ " X53(53),\n" +
+ " X54(54),\n" +
+ " X55(55),\n" +
+ " X56(56),\n" +
+ " X57(57),\n" +
+ " X58(58),\n" +
+ " X59(59),\n" +
+ " X60(60),\n" +
+ " X61(61),\n" +
+ " X62(62),\n" +
+ " X63(63),\n" +
+ " X64(64),\n" +
+ " X65(65),\n" +
+ " X66(66),\n" +
+ " X67(67),\n" +
+ " X68(68),\n" +
+ " X69(69),\n" +
+ " X70(70),\n" +
+ " X71(71),\n" +
+ " X72(72),\n" +
+ " X73(73),\n" +
+ " X74(74),\n" +
+ " X75(75),\n" +
+ " X76(76),\n" +
+ " X77(77),\n" +
+ " X78(78),\n" +
+ " X79(79),\n" +
+ " X80(80),\n" +
+ " X81(81),\n" +
+ " X82(82),\n" +
+ " X83(83),\n" +
+ " X84(84),\n" +
+ " X85(85),\n" +
+ " X86(86),\n" +
+ " X87(87),\n" +
+ " X88(88),\n" +
+ " X89(89),\n" +
+ " X90(90),\n" +
+ " X91(91),\n" +
+ " X92(92),\n" +
+ " X93(93),\n" +
+ " X94(94),\n" +
+ " X95(95),\n" +
+ " X96(96),\n" +
+ " X97(97),\n" +
+ " X98(98),\n" +
+ " X99(99),\n" +
+ " X100(100),\n" +
+ " X101(101),\n" +
+ " X102(102),\n" +
+ " X103(103),\n" +
+ " X104(104),\n" +
+ " X105(105),\n" +
+ " X106(106),\n" +
+ " X107(107),\n" +
+ " X108(108),\n" +
+ " X109(109),\n" +
+ " X110(110),\n" +
+ " X111(111),\n" +
+ " X112(112),\n" +
+ " X113(113),\n" +
+ " X114(114),\n" +
+ " X115(115),\n" +
+ " X116(116),\n" +
+ " X117(117),\n" +
+ " X118(118),\n" +
+ " X119(119),\n" +
+ " X120(120),\n" +
+ " X121(121),\n" +
+ " X122(122),\n" +
+ " X123(123),\n" +
+ " X124(124),\n" +
+ " X125(125),\n" +
+ " X126(126),\n" +
+ " X127(127),\n" +
+ " X128(128),\n" +
+ " X129(129),\n" +
+ " X130(130),\n" +
+ " X131(131),\n" +
+ " X132(132),\n" +
+ " X133(133),\n" +
+ " X134(134),\n" +
+ " X135(135),\n" +
+ " X136(136),\n" +
+ " X137(137),\n" +
+ " X138(138),\n" +
+ " X139(139),\n" +
+ " X140(140),\n" +
+ " X141(141),\n" +
+ " X142(142),\n" +
+ " X143(143),\n" +
+ " X144(144),\n" +
+ " X145(145),\n" +
+ " X146(146),\n" +
+ " X147(147),\n" +
+ " X148(148),\n" +
+ " X149(149),\n" +
+ " X150(150),\n" +
+ " X151(151),\n" +
+ " X152(152),\n" +
+ " X153(153),\n" +
+ " X154(154),\n" +
+ " X155(155),\n" +
+ " X156(156),\n" +
+ " X157(157),\n" +
+ " X158(158),\n" +
+ " X159(159),\n" +
+ " X160(160),\n" +
+ " X161(161),\n" +
+ " X162(162),\n" +
+ " X163(163),\n" +
+ " X164(164),\n" +
+ " X165(165),\n" +
+ " X166(166),\n" +
+ " X167(167),\n" +
+ " X168(168),\n" +
+ " X169(169),\n" +
+ " X170(170),\n" +
+ " X171(171),\n" +
+ " X172(172),\n" +
+ " X173(173),\n" +
+ " X174(174),\n" +
+ " X175(175),\n" +
+ " X176(176),\n" +
+ " X177(177),\n" +
+ " X178(178),\n" +
+ " X179(179),\n" +
+ " X180(180),\n" +
+ " X181(181),\n" +
+ " X182(182),\n" +
+ " X183(183),\n" +
+ " X184(184),\n" +
+ " X185(185),\n" +
+ " X186(186),\n" +
+ " X187(187),\n" +
+ " X188(188),\n" +
+ " X189(189),\n" +
+ " X190(190),\n" +
+ " X191(191),\n" +
+ " X192(192),\n" +
+ " X193(193),\n" +
+ " X194(194),\n" +
+ " X195(195),\n" +
+ " X196(196),\n" +
+ " X197(197),\n" +
+ " X198(198),\n" +
+ " X199(199),\n" +
+ " X200(200),\n" +
+ " X201(201),\n" +
+ " X202(202),\n" +
+ " X203(203),\n" +
+ " X204(204),\n" +
+ " X205(205),\n" +
+ " X206(206),\n" +
+ " X207(207),\n" +
+ " X208(208),\n" +
+ " X209(209),\n" +
+ " X210(210),\n" +
+ " X211(211),\n" +
+ " X212(212),\n" +
+ " X213(213),\n" +
+ " X214(214),\n" +
+ " X215(215),\n" +
+ " X216(216),\n" +
+ " X217(217),\n" +
+ " X218(218),\n" +
+ " X219(219),\n" +
+ " X220(220),\n" +
+ " X221(221),\n" +
+ " X222(222),\n" +
+ " X223(223),\n" +
+ " X224(224),\n" +
+ " X225(225),\n" +
+ " X226(226),\n" +
+ " X227(227),\n" +
+ " X228(228),\n" +
+ " X229(229),\n" +
+ " X230(230),\n" +
+ " X231(231),\n" +
+ " X232(232),\n" +
+ " X233(233),\n" +
+ " X234(234),\n" +
+ " X235(235),\n" +
+ " X236(236),\n" +
+ " X237(237),\n" +
+ " X238(238),\n" +
+ " X239(239),\n" +
+ " X240(240),\n" +
+ " X241(241),\n" +
+ " X242(242),\n" +
+ " X243(243),\n" +
+ " X244(244),\n" +
+ " X245(245),\n" +
+ " X246(246),\n" +
+ " X247(247),\n" +
+ " X248(248),\n" +
+ " X249(249),\n" +
+ " X250(250),\n" +
+ " X251(251),\n" +
+ " X252(252),\n" +
+ " X253(253),\n" +
+ " X254(254),\n" +
+ " X255(255),\n" +
+ " X256(256),\n" +
+ " X257(257),\n" +
+ " X258(258),\n" +
+ " X259(259),\n" +
+ " X260(260),\n" +
+ " X261(261),\n" +
+ " X262(262),\n" +
+ " X263(263),\n" +
+ " X264(264),\n" +
+ " X265(265),\n" +
+ " X266(266),\n" +
+ " X267(267),\n" +
+ " X268(268),\n" +
+ " X269(269),\n" +
+ " X270(270),\n" +
+ " X271(271),\n" +
+ " X272(272),\n" +
+ " X273(273),\n" +
+ " X274(274),\n" +
+ " X275(275),\n" +
+ " X276(276),\n" +
+ " X277(277),\n" +
+ " X278(278),\n" +
+ " X279(279),\n" +
+ " X280(280),\n" +
+ " X281(281),\n" +
+ " X282(282),\n" +
+ " X283(283),\n" +
+ " X284(284),\n" +
+ " X285(285),\n" +
+ " X286(286),\n" +
+ " X287(287),\n" +
+ " X288(288),\n" +
+ " X289(289),\n" +
+ " X290(290),\n" +
+ " X291(291),\n" +
+ " X292(292),\n" +
+ " X293(293),\n" +
+ " X294(294),\n" +
+ " X295(295),\n" +
+ " X296(296),\n" +
+ " X297(297),\n" +
+ " X298(298),\n" +
+ " X299(299),\n" +
+ " X300(300),\n" +
+ " X301(301),\n" +
+ " X302(302),\n" +
+ " X303(303),\n" +
+ " X304(304),\n" +
+ " X305(305),\n" +
+ " X306(306),\n" +
+ " X307(307),\n" +
+ " X308(308),\n" +
+ " X309(309),\n" +
+ " X310(310),\n" +
+ " X311(311),\n" +
+ " X312(312),\n" +
+ " X313(313),\n" +
+ " X314(314),\n" +
+ " X315(315),\n" +
+ " X316(316),\n" +
+ " X317(317),\n" +
+ " X318(318),\n" +
+ " X319(319),\n" +
+ " X320(320),\n" +
+ " X321(321),\n" +
+ " X322(322),\n" +
+ " X323(323),\n" +
+ " X324(324),\n" +
+ " X325(325),\n" +
+ " X326(326),\n" +
+ " X327(327),\n" +
+ " X328(328),\n" +
+ " X329(329),\n" +
+ " X330(330),\n" +
+ " X331(331),\n" +
+ " X332(332),\n" +
+ " X333(333),\n" +
+ " X334(334),\n" +
+ " X335(335),\n" +
+ " X336(336),\n" +
+ " X337(337),\n" +
+ " X338(338),\n" +
+ " X339(339),\n" +
+ " X340(340),\n" +
+ " X341(341),\n" +
+ " X342(342),\n" +
+ " X343(343),\n" +
+ " X344(344),\n" +
+ " X345(345),\n" +
+ " X346(346),\n" +
+ " X347(347),\n" +
+ " X348(348),\n" +
+ " X349(349),\n" +
+ " X350(350),\n" +
+ " X351(351),\n" +
+ " X352(352),\n" +
+ " X353(353),\n" +
+ " X354(354),\n" +
+ " X355(355),\n" +
+ " X356(356),\n" +
+ " X357(357),\n" +
+ " X358(358),\n" +
+ " X359(359),\n" +
+ " X360(360),\n" +
+ " X361(361),\n" +
+ " X362(362),\n" +
+ " X363(363),\n" +
+ " X364(364),\n" +
+ " X365(365),\n" +
+ " X366(366),\n" +
+ " X367(367),\n" +
+ " X368(368),\n" +
+ " X369(369),\n" +
+ " X370(370),\n" +
+ " X371(371),\n" +
+ " X372(372),\n" +
+ " X373(373),\n" +
+ " X374(374),\n" +
+ " X375(375),\n" +
+ " X376(376),\n" +
+ " X377(377),\n" +
+ " X378(378),\n" +
+ " X379(379),\n" +
+ " X380(380),\n" +
+ " X381(381),\n" +
+ " X382(382),\n" +
+ " X383(383),\n" +
+ " X384(384),\n" +
+ " X385(385),\n" +
+ " X386(386),\n" +
+ " X387(387),\n" +
+ " X388(388),\n" +
+ " X389(389),\n" +
+ " X390(390),\n" +
+ " X391(391),\n" +
+ " X392(392),\n" +
+ " X393(393),\n" +
+ " X394(394),\n" +
+ " X395(395),\n" +
+ " X396(396),\n" +
+ " X397(397),\n" +
+ " X398(398),\n" +
+ " X399(399),\n" +
+ " X400(400),\n" +
+ " X401(401),\n" +
+ " X402(402),\n" +
+ " X403(403),\n" +
+ " X404(404),\n" +
+ " X405(405),\n" +
+ " X406(406),\n" +
+ " X407(407),\n" +
+ " X408(408),\n" +
+ " X409(409),\n" +
+ " X410(410),\n" +
+ " X411(411),\n" +
+ " X412(412),\n" +
+ " X413(413),\n" +
+ " X414(414),\n" +
+ " X415(415),\n" +
+ " X416(416),\n" +
+ " X417(417),\n" +
+ " X418(418),\n" +
+ " X419(419),\n" +
+ " X420(420),\n" +
+ " X421(421),\n" +
+ " X422(422),\n" +
+ " X423(423),\n" +
+ " X424(424),\n" +
+ " X425(425),\n" +
+ " X426(426),\n" +
+ " X427(427),\n" +
+ " X428(428),\n" +
+ " X429(429),\n" +
+ " X430(430),\n" +
+ " X431(431),\n" +
+ " X432(432),\n" +
+ " X433(433),\n" +
+ " X434(434),\n" +
+ " X435(435),\n" +
+ " X436(436),\n" +
+ " X437(437),\n" +
+ " X438(438),\n" +
+ " X439(439),\n" +
+ " X440(440),\n" +
+ " X441(441),\n" +
+ " X442(442),\n" +
+ " X443(443),\n" +
+ " X444(444),\n" +
+ " X445(445),\n" +
+ " X446(446),\n" +
+ " X447(447),\n" +
+ " X448(448),\n" +
+ " X449(449),\n" +
+ " X450(450),\n" +
+ " X451(451),\n" +
+ " X452(452),\n" +
+ " X453(453),\n" +
+ " X454(454),\n" +
+ " X455(455),\n" +
+ " X456(456),\n" +
+ " X457(457),\n" +
+ " X458(458),\n" +
+ " X459(459),\n" +
+ " X460(460),\n" +
+ " X461(461),\n" +
+ " X462(462),\n" +
+ " X463(463),\n" +
+ " X464(464),\n" +
+ " X465(465),\n" +
+ " X466(466),\n" +
+ " X467(467),\n" +
+ " X468(468),\n" +
+ " X469(469),\n" +
+ " X470(470),\n" +
+ " X471(471),\n" +
+ " X472(472),\n" +
+ " X473(473),\n" +
+ " X474(474),\n" +
+ " X475(475),\n" +
+ " X476(476),\n" +
+ " X477(477),\n" +
+ " X478(478),\n" +
+ " X479(479),\n" +
+ " X480(480),\n" +
+ " X481(481),\n" +
+ " X482(482),\n" +
+ " X483(483),\n" +
+ " X484(484),\n" +
+ " X485(485),\n" +
+ " X486(486),\n" +
+ " X487(487),\n" +
+ " X488(488),\n" +
+ " X489(489),\n" +
+ " X490(490),\n" +
+ " X491(491),\n" +
+ " X492(492),\n" +
+ " X493(493),\n" +
+ " X494(494),\n" +
+ " X495(495),\n" +
+ " X496(496),\n" +
+ " X497(497),\n" +
+ " X498(498),\n" +
+ " X499(499),\n" +
+ " X500(500),\n" +
+ " X501(501),\n" +
+ " X502(502),\n" +
+ " X503(503),\n" +
+ " X504(504),\n" +
+ " X505(505),\n" +
+ " X506(506),\n" +
+ " X507(507),\n" +
+ " X508(508),\n" +
+ " X509(509),\n" +
+ " X510(510),\n" +
+ " X511(511),\n" +
+ " X512(512),\n" +
+ " X513(513),\n" +
+ " X514(514),\n" +
+ " X515(515),\n" +
+ " X516(516),\n" +
+ " X517(517),\n" +
+ " X518(518),\n" +
+ " X519(519),\n" +
+ " X520(520),\n" +
+ " X521(521),\n" +
+ " X522(522),\n" +
+ " X523(523),\n" +
+ " X524(524),\n" +
+ " X525(525),\n" +
+ " X526(526),\n" +
+ " X527(527),\n" +
+ " X528(528),\n" +
+ " X529(529),\n" +
+ " X530(530),\n" +
+ " X531(531),\n" +
+ " X532(532),\n" +
+ " X533(533),\n" +
+ " X534(534),\n" +
+ " X535(535),\n" +
+ " X536(536),\n" +
+ " X537(537),\n" +
+ " X538(538),\n" +
+ " X539(539),\n" +
+ " X540(540),\n" +
+ " X541(541),\n" +
+ " X542(542),\n" +
+ " X543(543),\n" +
+ " X544(544),\n" +
+ " X545(545),\n" +
+ " X546(546),\n" +
+ " X547(547),\n" +
+ " X548(548),\n" +
+ " X549(549),\n" +
+ " X550(550),\n" +
+ " X551(551),\n" +
+ " X552(552),\n" +
+ " X553(553),\n" +
+ " X554(554),\n" +
+ " X555(555),\n" +
+ " X556(556),\n" +
+ " X557(557),\n" +
+ " X558(558),\n" +
+ " X559(559),\n" +
+ " X560(560),\n" +
+ " X561(561),\n" +
+ " X562(562),\n" +
+ " X563(563),\n" +
+ " X564(564),\n" +
+ " X565(565),\n" +
+ " X566(566),\n" +
+ " X567(567),\n" +
+ " X568(568),\n" +
+ " X569(569),\n" +
+ " X570(570),\n" +
+ " X571(571),\n" +
+ " X572(572),\n" +
+ " X573(573),\n" +
+ " X574(574),\n" +
+ " X575(575),\n" +
+ " X576(576),\n" +
+ " X577(577),\n" +
+ " X578(578),\n" +
+ " X579(579),\n" +
+ " X580(580),\n" +
+ " X581(581),\n" +
+ " X582(582),\n" +
+ " X583(583),\n" +
+ " X584(584),\n" +
+ " X585(585),\n" +
+ " X586(586),\n" +
+ " X587(587),\n" +
+ " X588(588),\n" +
+ " X589(589),\n" +
+ " X590(590),\n" +
+ " X591(591),\n" +
+ " X592(592),\n" +
+ " X593(593),\n" +
+ " X594(594),\n" +
+ " X595(595),\n" +
+ " X596(596),\n" +
+ " X597(597),\n" +
+ " X598(598),\n" +
+ " X599(599),\n" +
+ " X600(600),\n" +
+ " X601(601),\n" +
+ " X602(602),\n" +
+ " X603(603),\n" +
+ " X604(604),\n" +
+ " X605(605),\n" +
+ " X606(606),\n" +
+ " X607(607),\n" +
+ " X608(608),\n" +
+ " X609(609),\n" +
+ " X610(610),\n" +
+ " X611(611),\n" +
+ " X612(612),\n" +
+ " X613(613),\n" +
+ " X614(614),\n" +
+ " X615(615),\n" +
+ " X616(616),\n" +
+ " X617(617),\n" +
+ " X618(618),\n" +
+ " X619(619),\n" +
+ " X620(620),\n" +
+ " X621(621),\n" +
+ " X622(622),\n" +
+ " X623(623),\n" +
+ " X624(624),\n" +
+ " X625(625),\n" +
+ " X626(626),\n" +
+ " X627(627),\n" +
+ " X628(628),\n" +
+ " X629(629),\n" +
+ " X630(630),\n" +
+ " X631(631),\n" +
+ " X632(632),\n" +
+ " X633(633),\n" +
+ " X634(634),\n" +
+ " X635(635),\n" +
+ " X636(636),\n" +
+ " X637(637),\n" +
+ " X638(638),\n" +
+ " X639(639),\n" +
+ " X640(640),\n" +
+ " X641(641),\n" +
+ " X642(642),\n" +
+ " X643(643),\n" +
+ " X644(644),\n" +
+ " X645(645),\n" +
+ " X646(646),\n" +
+ " X647(647),\n" +
+ " X648(648),\n" +
+ " X649(649),\n" +
+ " X650(650),\n" +
+ " X651(651),\n" +
+ " X652(652),\n" +
+ " X653(653),\n" +
+ " X654(654),\n" +
+ " X655(655),\n" +
+ " X656(656),\n" +
+ " X657(657),\n" +
+ " X658(658),\n" +
+ " X659(659),\n" +
+ " X660(660),\n" +
+ " X661(661),\n" +
+ " X662(662),\n" +
+ " X663(663),\n" +
+ " X664(664),\n" +
+ " X665(665),\n" +
+ " X666(666),\n" +
+ " X667(667),\n" +
+ " X668(668),\n" +
+ " X669(669),\n" +
+ " X670(670),\n" +
+ " X671(671),\n" +
+ " X672(672),\n" +
+ " X673(673),\n" +
+ " X674(674),\n" +
+ " X675(675),\n" +
+ " X676(676),\n" +
+ " X677(677),\n" +
+ " X678(678),\n" +
+ " X679(679),\n" +
+ " X680(680),\n" +
+ " X681(681),\n" +
+ " X682(682),\n" +
+ " X683(683),\n" +
+ " X684(684),\n" +
+ " X685(685),\n" +
+ " X686(686),\n" +
+ " X687(687),\n" +
+ " X688(688),\n" +
+ " X689(689),\n" +
+ " X690(690),\n" +
+ " X691(691),\n" +
+ " X692(692),\n" +
+ " X693(693),\n" +
+ " X694(694),\n" +
+ " X695(695),\n" +
+ " X696(696),\n" +
+ " X697(697),\n" +
+ " X698(698),\n" +
+ " X699(699),\n" +
+ " X700(700),\n" +
+ " X701(701),\n" +
+ " X702(702),\n" +
+ " X703(703),\n" +
+ " X704(704),\n" +
+ " X705(705),\n" +
+ " X706(706),\n" +
+ " X707(707),\n" +
+ " X708(708),\n" +
+ " X709(709),\n" +
+ " X710(710),\n" +
+ " X711(711),\n" +
+ " X712(712),\n" +
+ " X713(713),\n" +
+ " X714(714),\n" +
+ " X715(715),\n" +
+ " X716(716),\n" +
+ " X717(717),\n" +
+ " X718(718),\n" +
+ " X719(719),\n" +
+ " X720(720),\n" +
+ " X721(721),\n" +
+ " X722(722),\n" +
+ " X723(723),\n" +
+ " X724(724),\n" +
+ " X725(725),\n" +
+ " X726(726),\n" +
+ " X727(727),\n" +
+ " X728(728),\n" +
+ " X729(729),\n" +
+ " X730(730),\n" +
+ " X731(731),\n" +
+ " X732(732),\n" +
+ " X733(733),\n" +
+ " X734(734),\n" +
+ " X735(735),\n" +
+ " X736(736),\n" +
+ " X737(737),\n" +
+ " X738(738),\n" +
+ " X739(739),\n" +
+ " X740(740),\n" +
+ " X741(741),\n" +
+ " X742(742),\n" +
+ " X743(743),\n" +
+ " X744(744),\n" +
+ " X745(745),\n" +
+ " X746(746),\n" +
+ " X747(747),\n" +
+ " X748(748),\n" +
+ " X749(749),\n" +
+ " X750(750),\n" +
+ " X751(751),\n" +
+ " X752(752),\n" +
+ " X753(753),\n" +
+ " X754(754),\n" +
+ " X755(755),\n" +
+ " X756(756),\n" +
+ " X757(757),\n" +
+ " X758(758),\n" +
+ " X759(759),\n" +
+ " X760(760),\n" +
+ " X761(761),\n" +
+ " X762(762),\n" +
+ " X763(763),\n" +
+ " X764(764),\n" +
+ " X765(765),\n" +
+ " X766(766),\n" +
+ " X767(767),\n" +
+ " X768(768),\n" +
+ " X769(769),\n" +
+ " X770(770),\n" +
+ " X771(771),\n" +
+ " X772(772),\n" +
+ " X773(773),\n" +
+ " X774(774),\n" +
+ " X775(775),\n" +
+ " X776(776),\n" +
+ " X777(777),\n" +
+ " X778(778),\n" +
+ " X779(779),\n" +
+ " X780(780),\n" +
+ " X781(781),\n" +
+ " X782(782),\n" +
+ " X783(783),\n" +
+ " X784(784),\n" +
+ " X785(785),\n" +
+ " X786(786),\n" +
+ " X787(787),\n" +
+ " X788(788),\n" +
+ " X789(789),\n" +
+ " X790(790),\n" +
+ " X791(791),\n" +
+ " X792(792),\n" +
+ " X793(793),\n" +
+ " X794(794),\n" +
+ " X795(795),\n" +
+ " X796(796),\n" +
+ " X797(797),\n" +
+ " X798(798),\n" +
+ " X799(799),\n" +
+ " X800(800),\n" +
+ " X801(801),\n" +
+ " X802(802),\n" +
+ " X803(803),\n" +
+ " X804(804),\n" +
+ " X805(805),\n" +
+ " X806(806),\n" +
+ " X807(807),\n" +
+ " X808(808),\n" +
+ " X809(809),\n" +
+ " X810(810),\n" +
+ " X811(811),\n" +
+ " X812(812),\n" +
+ " X813(813),\n" +
+ " X814(814),\n" +
+ " X815(815),\n" +
+ " X816(816),\n" +
+ " X817(817),\n" +
+ " X818(818),\n" +
+ " X819(819),\n" +
+ " X820(820),\n" +
+ " X821(821),\n" +
+ " X822(822),\n" +
+ " X823(823),\n" +
+ " X824(824),\n" +
+ " X825(825),\n" +
+ " X826(826),\n" +
+ " X827(827),\n" +
+ " X828(828),\n" +
+ " X829(829),\n" +
+ " X830(830),\n" +
+ " X831(831),\n" +
+ " X832(832),\n" +
+ " X833(833),\n" +
+ " X834(834),\n" +
+ " X835(835),\n" +
+ " X836(836),\n" +
+ " X837(837),\n" +
+ " X838(838),\n" +
+ " X839(839),\n" +
+ " X840(840),\n" +
+ " X841(841),\n" +
+ " X842(842),\n" +
+ " X843(843),\n" +
+ " X844(844),\n" +
+ " X845(845),\n" +
+ " X846(846),\n" +
+ " X847(847),\n" +
+ " X848(848),\n" +
+ " X849(849),\n" +
+ " X850(850),\n" +
+ " X851(851),\n" +
+ " X852(852),\n" +
+ " X853(853),\n" +
+ " X854(854),\n" +
+ " X855(855),\n" +
+ " X856(856),\n" +
+ " X857(857),\n" +
+ " X858(858),\n" +
+ " X859(859),\n" +
+ " X860(860),\n" +
+ " X861(861),\n" +
+ " X862(862),\n" +
+ " X863(863),\n" +
+ " X864(864),\n" +
+ " X865(865),\n" +
+ " X866(866),\n" +
+ " X867(867),\n" +
+ " X868(868),\n" +
+ " X869(869),\n" +
+ " X870(870),\n" +
+ " X871(871),\n" +
+ " X872(872),\n" +
+ " X873(873),\n" +
+ " X874(874),\n" +
+ " X875(875),\n" +
+ " X876(876),\n" +
+ " X877(877),\n" +
+ " X878(878),\n" +
+ " X879(879),\n" +
+ " X880(880),\n" +
+ " X881(881),\n" +
+ " X882(882),\n" +
+ " X883(883),\n" +
+ " X884(884),\n" +
+ " X885(885),\n" +
+ " X886(886),\n" +
+ " X887(887),\n" +
+ " X888(888),\n" +
+ " X889(889),\n" +
+ " X890(890),\n" +
+ " X891(891),\n" +
+ " X892(892),\n" +
+ " X893(893),\n" +
+ " X894(894),\n" +
+ " X895(895),\n" +
+ " X896(896),\n" +
+ " X897(897),\n" +
+ " X898(898),\n" +
+ " X899(899),\n" +
+ " X900(900),\n" +
+ " X901(901),\n" +
+ " X902(902),\n" +
+ " X903(903),\n" +
+ " X904(904),\n" +
+ " X905(905),\n" +
+ " X906(906),\n" +
+ " X907(907),\n" +
+ " X908(908),\n" +
+ " X909(909),\n" +
+ " X910(910),\n" +
+ " X911(911),\n" +
+ " X912(912),\n" +
+ " X913(913),\n" +
+ " X914(914),\n" +
+ " X915(915),\n" +
+ " X916(916),\n" +
+ " X917(917),\n" +
+ " X918(918),\n" +
+ " X919(919),\n" +
+ " X920(920),\n" +
+ " X921(921),\n" +
+ " X922(922),\n" +
+ " X923(923),\n" +
+ " X924(924),\n" +
+ " X925(925),\n" +
+ " X926(926),\n" +
+ " X927(927),\n" +
+ " X928(928),\n" +
+ " X929(929),\n" +
+ " X930(930),\n" +
+ " X931(931),\n" +
+ " X932(932),\n" +
+ " X933(933),\n" +
+ " X934(934),\n" +
+ " X935(935),\n" +
+ " X936(936),\n" +
+ " X937(937),\n" +
+ " X938(938),\n" +
+ " X939(939),\n" +
+ " X940(940),\n" +
+ " X941(941),\n" +
+ " X942(942),\n" +
+ " X943(943),\n" +
+ " X944(944),\n" +
+ " X945(945),\n" +
+ " X946(946),\n" +
+ " X947(947),\n" +
+ " X948(948),\n" +
+ " X949(949),\n" +
+ " X950(950),\n" +
+ " X951(951),\n" +
+ " X952(952),\n" +
+ " X953(953),\n" +
+ " X954(954),\n" +
+ " X955(955),\n" +
+ " X956(956),\n" +
+ " X957(957),\n" +
+ " X958(958),\n" +
+ " X959(959),\n" +
+ " X960(960),\n" +
+ " X961(961),\n" +
+ " X962(962),\n" +
+ " X963(963),\n" +
+ " X964(964),\n" +
+ " X965(965),\n" +
+ " X966(966),\n" +
+ " X967(967),\n" +
+ " X968(968),\n" +
+ " X969(969),\n" +
+ " X970(970),\n" +
+ " X971(971),\n" +
+ " X972(972),\n" +
+ " X973(973),\n" +
+ " X974(974),\n" +
+ " X975(975),\n" +
+ " X976(976),\n" +
+ " X977(977),\n" +
+ " X978(978),\n" +
+ " X979(979),\n" +
+ " X980(980),\n" +
+ " X981(981),\n" +
+ " X982(982),\n" +
+ " X983(983),\n" +
+ " X984(984),\n" +
+ " X985(985),\n" +
+ " X986(986),\n" +
+ " X987(987),\n" +
+ " X988(988),\n" +
+ " X989(989),\n" +
+ " X990(990),\n" +
+ " X991(991),\n" +
+ " X992(992),\n" +
+ " X993(993),\n" +
+ " X994(994),\n" +
+ " X995(995),\n" +
+ " X996(996),\n" +
+ " X997(997),\n" +
+ " X998(998),\n" +
+ " X999(999),\n" +
+ " X1000(1000),\n" +
+ " X1001(1001),\n" +
+ " X1002(1002),\n" +
+ " X1003(1003),\n" +
+ " X1004(1004),\n" +
+ " X1005(1005),\n" +
+ " X1006(1006),\n" +
+ " X1007(1007),\n" +
+ " X1008(1008),\n" +
+ " X1009(1009),\n" +
+ " X1010(1010),\n" +
+ " X1011(1011),\n" +
+ " X1012(1012),\n" +
+ " X1013(1013),\n" +
+ " X1014(1014),\n" +
+ " X1015(1015),\n" +
+ " X1016(1016),\n" +
+ " X1017(1017),\n" +
+ " X1018(1018),\n" +
+ " X1019(1019),\n" +
+ " X1020(1020),\n" +
+ " X1021(1021),\n" +
+ " X1022(1022),\n" +
+ " X1023(1023),\n" +
+ " X1024(1024),\n" +
+ " X1025(1025),\n" +
+ " X1026(1026),\n" +
+ " X1027(1027),\n" +
+ " X1028(1028),\n" +
+ " X1029(1029),\n" +
+ " X1030(1030),\n" +
+ " X1031(1031),\n" +
+ " X1032(1032),\n" +
+ " X1033(1033),\n" +
+ " X1034(1034),\n" +
+ " X1035(1035),\n" +
+ " X1036(1036),\n" +
+ " X1037(1037),\n" +
+ " X1038(1038),\n" +
+ " X1039(1039),\n" +
+ " X1040(1040),\n" +
+ " X1041(1041),\n" +
+ " X1042(1042),\n" +
+ " X1043(1043),\n" +
+ " X1044(1044),\n" +
+ " X1045(1045),\n" +
+ " X1046(1046),\n" +
+ " X1047(1047),\n" +
+ " X1048(1048),\n" +
+ " X1049(1049),\n" +
+ " X1050(1050),\n" +
+ " X1051(1051),\n" +
+ " X1052(1052),\n" +
+ " X1053(1053),\n" +
+ " X1054(1054),\n" +
+ " X1055(1055),\n" +
+ " X1056(1056),\n" +
+ " X1057(1057),\n" +
+ " X1058(1058),\n" +
+ " X1059(1059),\n" +
+ " X1060(1060),\n" +
+ " X1061(1061),\n" +
+ " X1062(1062),\n" +
+ " X1063(1063),\n" +
+ " X1064(1064),\n" +
+ " X1065(1065),\n" +
+ " X1066(1066),\n" +
+ " X1067(1067),\n" +
+ " X1068(1068),\n" +
+ " X1069(1069),\n" +
+ " X1070(1070),\n" +
+ " X1071(1071),\n" +
+ " X1072(1072),\n" +
+ " X1073(1073),\n" +
+ " X1074(1074),\n" +
+ " X1075(1075),\n" +
+ " X1076(1076),\n" +
+ " X1077(1077),\n" +
+ " X1078(1078),\n" +
+ " X1079(1079),\n" +
+ " X1080(1080),\n" +
+ " X1081(1081),\n" +
+ " X1082(1082),\n" +
+ " X1083(1083),\n" +
+ " X1084(1084),\n" +
+ " X1085(1085),\n" +
+ " X1086(1086),\n" +
+ " X1087(1087),\n" +
+ " X1088(1088),\n" +
+ " X1089(1089),\n" +
+ " X1090(1090),\n" +
+ " X1091(1091),\n" +
+ " X1092(1092),\n" +
+ " X1093(1093),\n" +
+ " X1094(1094),\n" +
+ " X1095(1095),\n" +
+ " X1096(1096),\n" +
+ " X1097(1097),\n" +
+ " X1098(1098),\n" +
+ " X1099(1099),\n" +
+ " X1100(1100),\n" +
+ " X1101(1101),\n" +
+ " X1102(1102),\n" +
+ " X1103(1103),\n" +
+ " X1104(1104),\n" +
+ " X1105(1105),\n" +
+ " X1106(1106),\n" +
+ " X1107(1107),\n" +
+ " X1108(1108),\n" +
+ " X1109(1109),\n" +
+ " X1110(1110),\n" +
+ " X1111(1111),\n" +
+ " X1112(1112),\n" +
+ " X1113(1113),\n" +
+ " X1114(1114),\n" +
+ " X1115(1115),\n" +
+ " X1116(1116),\n" +
+ " X1117(1117),\n" +
+ " X1118(1118),\n" +
+ " X1119(1119),\n" +
+ " X1120(1120),\n" +
+ " X1121(1121),\n" +
+ " X1122(1122),\n" +
+ " X1123(1123),\n" +
+ " X1124(1124),\n" +
+ " X1125(1125),\n" +
+ " X1126(1126),\n" +
+ " X1127(1127),\n" +
+ " X1128(1128),\n" +
+ " X1129(1129),\n" +
+ " X1130(1130),\n" +
+ " X1131(1131),\n" +
+ " X1132(1132),\n" +
+ " X1133(1133),\n" +
+ " X1134(1134),\n" +
+ " X1135(1135),\n" +
+ " X1136(1136),\n" +
+ " X1137(1137),\n" +
+ " X1138(1138),\n" +
+ " X1139(1139),\n" +
+ " X1140(1140),\n" +
+ " X1141(1141),\n" +
+ " X1142(1142),\n" +
+ " X1143(1143),\n" +
+ " X1144(1144),\n" +
+ " X1145(1145),\n" +
+ " X1146(1146),\n" +
+ " X1147(1147),\n" +
+ " X1148(1148),\n" +
+ " X1149(1149),\n" +
+ " X1150(1150),\n" +
+ " X1151(1151),\n" +
+ " X1152(1152),\n" +
+ " X1153(1153),\n" +
+ " X1154(1154),\n" +
+ " X1155(1155),\n" +
+ " X1156(1156),\n" +
+ " X1157(1157),\n" +
+ " X1158(1158),\n" +
+ " X1159(1159),\n" +
+ " X1160(1160),\n" +
+ " X1161(1161),\n" +
+ " X1162(1162),\n" +
+ " X1163(1163),\n" +
+ " X1164(1164),\n" +
+ " X1165(1165),\n" +
+ " X1166(1166),\n" +
+ " X1167(1167),\n" +
+ " X1168(1168),\n" +
+ " X1169(1169),\n" +
+ " X1170(1170),\n" +
+ " X1171(1171),\n" +
+ " X1172(1172),\n" +
+ " X1173(1173),\n" +
+ " X1174(1174),\n" +
+ " X1175(1175),\n" +
+ " X1176(1176),\n" +
+ " X1177(1177),\n" +
+ " X1178(1178),\n" +
+ " X1179(1179),\n" +
+ " X1180(1180),\n" +
+ " X1181(1181),\n" +
+ " X1182(1182),\n" +
+ " X1183(1183),\n" +
+ " X1184(1184),\n" +
+ " X1185(1185),\n" +
+ " X1186(1186),\n" +
+ " X1187(1187),\n" +
+ " X1188(1188),\n" +
+ " X1189(1189),\n" +
+ " X1190(1190),\n" +
+ " X1191(1191),\n" +
+ " X1192(1192),\n" +
+ " X1193(1193),\n" +
+ " X1194(1194),\n" +
+ " X1195(1195),\n" +
+ " X1196(1196),\n" +
+ " X1197(1197),\n" +
+ " X1198(1198),\n" +
+ " X1199(1199),\n" +
+ " X1200(1200),\n" +
+ " X1201(1201),\n" +
+ " X1202(1202),\n" +
+ " X1203(1203),\n" +
+ " X1204(1204),\n" +
+ " X1205(1205),\n" +
+ " X1206(1206),\n" +
+ " X1207(1207),\n" +
+ " X1208(1208),\n" +
+ " X1209(1209),\n" +
+ " X1210(1210),\n" +
+ " X1211(1211),\n" +
+ " X1212(1212),\n" +
+ " X1213(1213),\n" +
+ " X1214(1214),\n" +
+ " X1215(1215),\n" +
+ " X1216(1216),\n" +
+ " X1217(1217),\n" +
+ " X1218(1218),\n" +
+ " X1219(1219),\n" +
+ " X1220(1220),\n" +
+ " X1221(1221),\n" +
+ " X1222(1222),\n" +
+ " X1223(1223),\n" +
+ " X1224(1224),\n" +
+ " X1225(1225),\n" +
+ " X1226(1226),\n" +
+ " X1227(1227),\n" +
+ " X1228(1228),\n" +
+ " X1229(1229),\n" +
+ " X1230(1230),\n" +
+ " X1231(1231),\n" +
+ " X1232(1232),\n" +
+ " X1233(1233),\n" +
+ " X1234(1234),\n" +
+ " X1235(1235),\n" +
+ " X1236(1236),\n" +
+ " X1237(1237),\n" +
+ " X1238(1238),\n" +
+ " X1239(1239),\n" +
+ " X1240(1240),\n" +
+ " X1241(1241),\n" +
+ " X1242(1242),\n" +
+ " X1243(1243),\n" +
+ " X1244(1244),\n" +
+ " X1245(1245),\n" +
+ " X1246(1246),\n" +
+ " X1247(1247),\n" +
+ " X1248(1248),\n" +
+ " X1249(1249),\n" +
+ " X1250(1250),\n" +
+ " X1251(1251),\n" +
+ " X1252(1252),\n" +
+ " X1253(1253),\n" +
+ " X1254(1254),\n" +
+ " X1255(1255),\n" +
+ " X1256(1256),\n" +
+ " X1257(1257),\n" +
+ " X1258(1258),\n" +
+ " X1259(1259),\n" +
+ " X1260(1260),\n" +
+ " X1261(1261),\n" +
+ " X1262(1262),\n" +
+ " X1263(1263),\n" +
+ " X1264(1264),\n" +
+ " X1265(1265),\n" +
+ " X1266(1266),\n" +
+ " X1267(1267),\n" +
+ " X1268(1268),\n" +
+ " X1269(1269),\n" +
+ " X1270(1270),\n" +
+ " X1271(1271),\n" +
+ " X1272(1272),\n" +
+ " X1273(1273),\n" +
+ " X1274(1274),\n" +
+ " X1275(1275),\n" +
+ " X1276(1276),\n" +
+ " X1277(1277),\n" +
+ " X1278(1278),\n" +
+ " X1279(1279),\n" +
+ " X1280(1280),\n" +
+ " X1281(1281),\n" +
+ " X1282(1282),\n" +
+ " X1283(1283),\n" +
+ " X1284(1284),\n" +
+ " X1285(1285),\n" +
+ " X1286(1286),\n" +
+ " X1287(1287),\n" +
+ " X1288(1288),\n" +
+ " X1289(1289),\n" +
+ " X1290(1290),\n" +
+ " X1291(1291),\n" +
+ " X1292(1292),\n" +
+ " X1293(1293),\n" +
+ " X1294(1294),\n" +
+ " X1295(1295),\n" +
+ " X1296(1296),\n" +
+ " X1297(1297),\n" +
+ " X1298(1298),\n" +
+ " X1299(1299),\n" +
+ " X1300(1300),\n" +
+ " X1301(1301),\n" +
+ " X1302(1302),\n" +
+ " X1303(1303),\n" +
+ " X1304(1304),\n" +
+ " X1305(1305),\n" +
+ " X1306(1306),\n" +
+ " X1307(1307),\n" +
+ " X1308(1308),\n" +
+ " X1309(1309),\n" +
+ " X1310(1310),\n" +
+ " X1311(1311),\n" +
+ " X1312(1312),\n" +
+ " X1313(1313),\n" +
+ " X1314(1314),\n" +
+ " X1315(1315),\n" +
+ " X1316(1316),\n" +
+ " X1317(1317),\n" +
+ " X1318(1318),\n" +
+ " X1319(1319),\n" +
+ " X1320(1320),\n" +
+ " X1321(1321),\n" +
+ " X1322(1322),\n" +
+ " X1323(1323),\n" +
+ " X1324(1324),\n" +
+ " X1325(1325),\n" +
+ " X1326(1326),\n" +
+ " X1327(1327),\n" +
+ " X1328(1328),\n" +
+ " X1329(1329),\n" +
+ " X1330(1330),\n" +
+ " X1331(1331),\n" +
+ " X1332(1332),\n" +
+ " X1333(1333),\n" +
+ " X1334(1334),\n" +
+ " X1335(1335),\n" +
+ " X1336(1336),\n" +
+ " X1337(1337),\n" +
+ " X1338(1338),\n" +
+ " X1339(1339),\n" +
+ " X1340(1340),\n" +
+ " X1341(1341),\n" +
+ " X1342(1342),\n" +
+ " X1343(1343),\n" +
+ " X1344(1344),\n" +
+ " X1345(1345),\n" +
+ " X1346(1346),\n" +
+ " X1347(1347),\n" +
+ " X1348(1348),\n" +
+ " X1349(1349),\n" +
+ " X1350(1350),\n" +
+ " X1351(1351),\n" +
+ " X1352(1352),\n" +
+ " X1353(1353),\n" +
+ " X1354(1354),\n" +
+ " X1355(1355),\n" +
+ " X1356(1356),\n" +
+ " X1357(1357),\n" +
+ " X1358(1358),\n" +
+ " X1359(1359),\n" +
+ " X1360(1360),\n" +
+ " X1361(1361),\n" +
+ " X1362(1362),\n" +
+ " X1363(1363),\n" +
+ " X1364(1364),\n" +
+ " X1365(1365),\n" +
+ " X1366(1366),\n" +
+ " X1367(1367),\n" +
+ " X1368(1368),\n" +
+ " X1369(1369),\n" +
+ " X1370(1370),\n" +
+ " X1371(1371),\n" +
+ " X1372(1372),\n" +
+ " X1373(1373),\n" +
+ " X1374(1374),\n" +
+ " X1375(1375),\n" +
+ " X1376(1376),\n" +
+ " X1377(1377),\n" +
+ " X1378(1378),\n" +
+ " X1379(1379),\n" +
+ " X1380(1380),\n" +
+ " X1381(1381),\n" +
+ " X1382(1382),\n" +
+ " X1383(1383),\n" +
+ " X1384(1384),\n" +
+ " X1385(1385),\n" +
+ " X1386(1386),\n" +
+ " X1387(1387),\n" +
+ " X1388(1388),\n" +
+ " X1389(1389),\n" +
+ " X1390(1390),\n" +
+ " X1391(1391),\n" +
+ " X1392(1392),\n" +
+ " X1393(1393),\n" +
+ " X1394(1394),\n" +
+ " X1395(1395),\n" +
+ " X1396(1396),\n" +
+ " X1397(1397),\n" +
+ " X1398(1398),\n" +
+ " X1399(1399),\n" +
+ " X1400(1400),\n" +
+ " X1401(1401),\n" +
+ " X1402(1402),\n" +
+ " X1403(1403),\n" +
+ " X1404(1404),\n" +
+ " X1405(1405),\n" +
+ " X1406(1406),\n" +
+ " X1407(1407),\n" +
+ " X1408(1408),\n" +
+ " X1409(1409),\n" +
+ " X1410(1410),\n" +
+ " X1411(1411),\n" +
+ " X1412(1412),\n" +
+ " X1413(1413),\n" +
+ " X1414(1414),\n" +
+ " X1415(1415),\n" +
+ " X1416(1416),\n" +
+ " X1417(1417),\n" +
+ " X1418(1418),\n" +
+ " X1419(1419),\n" +
+ " X1420(1420),\n" +
+ " X1421(1421),\n" +
+ " X1422(1422),\n" +
+ " X1423(1423),\n" +
+ " X1424(1424),\n" +
+ " X1425(1425),\n" +
+ " X1426(1426),\n" +
+ " X1427(1427),\n" +
+ " X1428(1428),\n" +
+ " X1429(1429),\n" +
+ " X1430(1430),\n" +
+ " X1431(1431),\n" +
+ " X1432(1432),\n" +
+ " X1433(1433),\n" +
+ " X1434(1434),\n" +
+ " X1435(1435),\n" +
+ " X1436(1436),\n" +
+ " X1437(1437),\n" +
+ " X1438(1438),\n" +
+ " X1439(1439),\n" +
+ " X1440(1440),\n" +
+ " X1441(1441),\n" +
+ " X1442(1442),\n" +
+ " X1443(1443),\n" +
+ " X1444(1444),\n" +
+ " X1445(1445),\n" +
+ " X1446(1446),\n" +
+ " X1447(1447),\n" +
+ " X1448(1448),\n" +
+ " X1449(1449),\n" +
+ " X1450(1450),\n" +
+ " X1451(1451),\n" +
+ " X1452(1452),\n" +
+ " X1453(1453),\n" +
+ " X1454(1454),\n" +
+ " X1455(1455),\n" +
+ " X1456(1456),\n" +
+ " X1457(1457),\n" +
+ " X1458(1458),\n" +
+ " X1459(1459),\n" +
+ " X1460(1460),\n" +
+ " X1461(1461),\n" +
+ " X1462(1462),\n" +
+ " X1463(1463),\n" +
+ " X1464(1464),\n" +
+ " X1465(1465),\n" +
+ " X1466(1466),\n" +
+ " X1467(1467),\n" +
+ " X1468(1468),\n" +
+ " X1469(1469),\n" +
+ " X1470(1470),\n" +
+ " X1471(1471),\n" +
+ " X1472(1472),\n" +
+ " X1473(1473),\n" +
+ " X1474(1474),\n" +
+ " X1475(1475),\n" +
+ " X1476(1476),\n" +
+ " X1477(1477),\n" +
+ " X1478(1478),\n" +
+ " X1479(1479),\n" +
+ " X1480(1480),\n" +
+ " X1481(1481),\n" +
+ " X1482(1482),\n" +
+ " X1483(1483),\n" +
+ " X1484(1484),\n" +
+ " X1485(1485),\n" +
+ " X1486(1486),\n" +
+ " X1487(1487),\n" +
+ " X1488(1488),\n" +
+ " X1489(1489),\n" +
+ " X1490(1490),\n" +
+ " X1491(1491),\n" +
+ " X1492(1492),\n" +
+ " X1493(1493),\n" +
+ " X1494(1494),\n" +
+ " X1495(1495),\n" +
+ " X1496(1496),\n" +
+ " X1497(1497),\n" +
+ " X1498(1498),\n" +
+ " X1499(1499),\n" +
+ " X1500(1500),\n" +
+ " X1501(1501),\n" +
+ " X1502(1502),\n" +
+ " X1503(1503),\n" +
+ " X1504(1504),\n" +
+ " X1505(1505),\n" +
+ " X1506(1506),\n" +
+ " X1507(1507),\n" +
+ " X1508(1508),\n" +
+ " X1509(1509),\n" +
+ " X1510(1510),\n" +
+ " X1511(1511),\n" +
+ " X1512(1512),\n" +
+ " X1513(1513),\n" +
+ " X1514(1514),\n" +
+ " X1515(1515),\n" +
+ " X1516(1516),\n" +
+ " X1517(1517),\n" +
+ " X1518(1518),\n" +
+ " X1519(1519),\n" +
+ " X1520(1520),\n" +
+ " X1521(1521),\n" +
+ " X1522(1522),\n" +
+ " X1523(1523),\n" +
+ " X1524(1524),\n" +
+ " X1525(1525),\n" +
+ " X1526(1526),\n" +
+ " X1527(1527),\n" +
+ " X1528(1528),\n" +
+ " X1529(1529),\n" +
+ " X1530(1530),\n" +
+ " X1531(1531),\n" +
+ " X1532(1532),\n" +
+ " X1533(1533),\n" +
+ " X1534(1534),\n" +
+ " X1535(1535),\n" +
+ " X1536(1536),\n" +
+ " X1537(1537),\n" +
+ " X1538(1538),\n" +
+ " X1539(1539),\n" +
+ " X1540(1540),\n" +
+ " X1541(1541),\n" +
+ " X1542(1542),\n" +
+ " X1543(1543),\n" +
+ " X1544(1544),\n" +
+ " X1545(1545),\n" +
+ " X1546(1546),\n" +
+ " X1547(1547),\n" +
+ " X1548(1548),\n" +
+ " X1549(1549),\n" +
+ " X1550(1550),\n" +
+ " X1551(1551),\n" +
+ " X1552(1552),\n" +
+ " X1553(1553),\n" +
+ " X1554(1554),\n" +
+ " X1555(1555),\n" +
+ " X1556(1556),\n" +
+ " X1557(1557),\n" +
+ " X1558(1558),\n" +
+ " X1559(1559),\n" +
+ " X1560(1560),\n" +
+ " X1561(1561),\n" +
+ " X1562(1562),\n" +
+ " X1563(1563),\n" +
+ " X1564(1564),\n" +
+ " X1565(1565),\n" +
+ " X1566(1566),\n" +
+ " X1567(1567),\n" +
+ " X1568(1568),\n" +
+ " X1569(1569),\n" +
+ " X1570(1570),\n" +
+ " X1571(1571),\n" +
+ " X1572(1572),\n" +
+ " X1573(1573),\n" +
+ " X1574(1574),\n" +
+ " X1575(1575),\n" +
+ " X1576(1576),\n" +
+ " X1577(1577),\n" +
+ " X1578(1578),\n" +
+ " X1579(1579),\n" +
+ " X1580(1580),\n" +
+ " X1581(1581),\n" +
+ " X1582(1582),\n" +
+ " X1583(1583),\n" +
+ " X1584(1584),\n" +
+ " X1585(1585),\n" +
+ " X1586(1586),\n" +
+ " X1587(1587),\n" +
+ " X1588(1588),\n" +
+ " X1589(1589),\n" +
+ " X1590(1590),\n" +
+ " X1591(1591),\n" +
+ " X1592(1592),\n" +
+ " X1593(1593),\n" +
+ " X1594(1594),\n" +
+ " X1595(1595),\n" +
+ " X1596(1596),\n" +
+ " X1597(1597),\n" +
+ " X1598(1598),\n" +
+ " X1599(1599),\n" +
+ " X1600(1600),\n" +
+ " X1601(1601),\n" +
+ " X1602(1602),\n" +
+ " X1603(1603),\n" +
+ " X1604(1604),\n" +
+ " X1605(1605),\n" +
+ " X1606(1606),\n" +
+ " X1607(1607),\n" +
+ " X1608(1608),\n" +
+ " X1609(1609),\n" +
+ " X1610(1610),\n" +
+ " X1611(1611),\n" +
+ " X1612(1612),\n" +
+ " X1613(1613),\n" +
+ " X1614(1614),\n" +
+ " X1615(1615),\n" +
+ " X1616(1616),\n" +
+ " X1617(1617),\n" +
+ " X1618(1618),\n" +
+ " X1619(1619),\n" +
+ " X1620(1620),\n" +
+ " X1621(1621),\n" +
+ " X1622(1622),\n" +
+ " X1623(1623),\n" +
+ " X1624(1624),\n" +
+ " X1625(1625),\n" +
+ " X1626(1626),\n" +
+ " X1627(1627),\n" +
+ " X1628(1628),\n" +
+ " X1629(1629),\n" +
+ " X1630(1630),\n" +
+ " X1631(1631),\n" +
+ " X1632(1632),\n" +
+ " X1633(1633),\n" +
+ " X1634(1634),\n" +
+ " X1635(1635),\n" +
+ " X1636(1636),\n" +
+ " X1637(1637),\n" +
+ " X1638(1638),\n" +
+ " X1639(1639),\n" +
+ " X1640(1640),\n" +
+ " X1641(1641),\n" +
+ " X1642(1642),\n" +
+ " X1643(1643),\n" +
+ " X1644(1644),\n" +
+ " X1645(1645),\n" +
+ " X1646(1646),\n" +
+ " X1647(1647),\n" +
+ " X1648(1648),\n" +
+ " X1649(1649),\n" +
+ " X1650(1650),\n" +
+ " X1651(1651),\n" +
+ " X1652(1652),\n" +
+ " X1653(1653),\n" +
+ " X1654(1654),\n" +
+ " X1655(1655),\n" +
+ " X1656(1656),\n" +
+ " X1657(1657),\n" +
+ " X1658(1658),\n" +
+ " X1659(1659),\n" +
+ " X1660(1660),\n" +
+ " X1661(1661),\n" +
+ " X1662(1662),\n" +
+ " X1663(1663),\n" +
+ " X1664(1664),\n" +
+ " X1665(1665),\n" +
+ " X1666(1666),\n" +
+ " X1667(1667),\n" +
+ " X1668(1668),\n" +
+ " X1669(1669),\n" +
+ " X1670(1670),\n" +
+ " X1671(1671),\n" +
+ " X1672(1672),\n" +
+ " X1673(1673),\n" +
+ " X1674(1674),\n" +
+ " X1675(1675),\n" +
+ " X1676(1676),\n" +
+ " X1677(1677),\n" +
+ " X1678(1678),\n" +
+ " X1679(1679),\n" +
+ " X1680(1680),\n" +
+ " X1681(1681),\n" +
+ " X1682(1682),\n" +
+ " X1683(1683),\n" +
+ " X1684(1684),\n" +
+ " X1685(1685),\n" +
+ " X1686(1686),\n" +
+ " X1687(1687),\n" +
+ " X1688(1688),\n" +
+ " X1689(1689),\n" +
+ " X1690(1690),\n" +
+ " X1691(1691),\n" +
+ " X1692(1692),\n" +
+ " X1693(1693),\n" +
+ " X1694(1694),\n" +
+ " X1695(1695),\n" +
+ " X1696(1696),\n" +
+ " X1697(1697),\n" +
+ " X1698(1698),\n" +
+ " X1699(1699),\n" +
+ " X1700(1700),\n" +
+ " X1701(1701),\n" +
+ " X1702(1702),\n" +
+ " X1703(1703),\n" +
+ " X1704(1704),\n" +
+ " X1705(1705),\n" +
+ " X1706(1706),\n" +
+ " X1707(1707),\n" +
+ " X1708(1708),\n" +
+ " X1709(1709),\n" +
+ " X1710(1710),\n" +
+ " X1711(1711),\n" +
+ " X1712(1712),\n" +
+ " X1713(1713),\n" +
+ " X1714(1714),\n" +
+ " X1715(1715),\n" +
+ " X1716(1716),\n" +
+ " X1717(1717),\n" +
+ " X1718(1718),\n" +
+ " X1719(1719),\n" +
+ " X1720(1720),\n" +
+ " X1721(1721),\n" +
+ " X1722(1722),\n" +
+ " X1723(1723),\n" +
+ " X1724(1724),\n" +
+ " X1725(1725),\n" +
+ " X1726(1726),\n" +
+ " X1727(1727),\n" +
+ " X1728(1728),\n" +
+ " X1729(1729),\n" +
+ " X1730(1730),\n" +
+ " X1731(1731),\n" +
+ " X1732(1732),\n" +
+ " X1733(1733),\n" +
+ " X1734(1734),\n" +
+ " X1735(1735),\n" +
+ " X1736(1736),\n" +
+ " X1737(1737),\n" +
+ " X1738(1738),\n" +
+ " X1739(1739),\n" +
+ " X1740(1740),\n" +
+ " X1741(1741),\n" +
+ " X1742(1742),\n" +
+ " X1743(1743),\n" +
+ " X1744(1744),\n" +
+ " X1745(1745),\n" +
+ " X1746(1746),\n" +
+ " X1747(1747),\n" +
+ " X1748(1748),\n" +
+ " X1749(1749),\n" +
+ " X1750(1750),\n" +
+ " X1751(1751),\n" +
+ " X1752(1752),\n" +
+ " X1753(1753),\n" +
+ " X1754(1754),\n" +
+ " X1755(1755),\n" +
+ " X1756(1756),\n" +
+ " X1757(1757),\n" +
+ " X1758(1758),\n" +
+ " X1759(1759),\n" +
+ " X1760(1760),\n" +
+ " X1761(1761),\n" +
+ " X1762(1762),\n" +
+ " X1763(1763),\n" +
+ " X1764(1764),\n" +
+ " X1765(1765),\n" +
+ " X1766(1766),\n" +
+ " X1767(1767),\n" +
+ " X1768(1768),\n" +
+ " X1769(1769),\n" +
+ " X1770(1770),\n" +
+ " X1771(1771),\n" +
+ " X1772(1772),\n" +
+ " X1773(1773),\n" +
+ " X1774(1774),\n" +
+ " X1775(1775),\n" +
+ " X1776(1776),\n" +
+ " X1777(1777),\n" +
+ " X1778(1778),\n" +
+ " X1779(1779),\n" +
+ " X1780(1780),\n" +
+ " X1781(1781),\n" +
+ " X1782(1782),\n" +
+ " X1783(1783),\n" +
+ " X1784(1784),\n" +
+ " X1785(1785),\n" +
+ " X1786(1786),\n" +
+ " X1787(1787),\n" +
+ " X1788(1788),\n" +
+ " X1789(1789),\n" +
+ " X1790(1790),\n" +
+ " X1791(1791),\n" +
+ " X1792(1792),\n" +
+ " X1793(1793),\n" +
+ " X1794(1794),\n" +
+ " X1795(1795),\n" +
+ " X1796(1796),\n" +
+ " X1797(1797),\n" +
+ " X1798(1798),\n" +
+ " X1799(1799),\n" +
+ " X1800(1800),\n" +
+ " X1801(1801),\n" +
+ " X1802(1802),\n" +
+ " X1803(1803),\n" +
+ " X1804(1804),\n" +
+ " X1805(1805),\n" +
+ " X1806(1806),\n" +
+ " X1807(1807),\n" +
+ " X1808(1808),\n" +
+ " X1809(1809),\n" +
+ " X1810(1810),\n" +
+ " X1811(1811),\n" +
+ " X1812(1812),\n" +
+ " X1813(1813),\n" +
+ " X1814(1814),\n" +
+ " X1815(1815),\n" +
+ " X1816(1816),\n" +
+ " X1817(1817),\n" +
+ " X1818(1818),\n" +
+ " X1819(1819),\n" +
+ " X1820(1820),\n" +
+ " X1821(1821),\n" +
+ " X1822(1822),\n" +
+ " X1823(1823),\n" +
+ " X1824(1824),\n" +
+ " X1825(1825),\n" +
+ " X1826(1826),\n" +
+ " X1827(1827),\n" +
+ " X1828(1828),\n" +
+ " X1829(1829),\n" +
+ " X1830(1830),\n" +
+ " X1831(1831),\n" +
+ " X1832(1832),\n" +
+ " X1833(1833),\n" +
+ " X1834(1834),\n" +
+ " X1835(1835),\n" +
+ " X1836(1836),\n" +
+ " X1837(1837),\n" +
+ " X1838(1838),\n" +
+ " X1839(1839),\n" +
+ " X1840(1840),\n" +
+ " X1841(1841),\n" +
+ " X1842(1842),\n" +
+ " X1843(1843),\n" +
+ " X1844(1844),\n" +
+ " X1845(1845),\n" +
+ " X1846(1846),\n" +
+ " X1847(1847),\n" +
+ " X1848(1848),\n" +
+ " X1849(1849),\n" +
+ " X1850(1850),\n" +
+ " X1851(1851),\n" +
+ " X1852(1852),\n" +
+ " X1853(1853),\n" +
+ " X1854(1854),\n" +
+ " X1855(1855),\n" +
+ " X1856(1856),\n" +
+ " X1857(1857),\n" +
+ " X1858(1858),\n" +
+ " X1859(1859),\n" +
+ " X1860(1860),\n" +
+ " X1861(1861),\n" +
+ " X1862(1862),\n" +
+ " X1863(1863),\n" +
+ " X1864(1864),\n" +
+ " X1865(1865),\n" +
+ " X1866(1866),\n" +
+ " X1867(1867),\n" +
+ " X1868(1868),\n" +
+ " X1869(1869),\n" +
+ " X1870(1870),\n" +
+ " X1871(1871),\n" +
+ " X1872(1872),\n" +
+ " X1873(1873),\n" +
+ " X1874(1874),\n" +
+ " X1875(1875),\n" +
+ " X1876(1876),\n" +
+ " X1877(1877),\n" +
+ " X1878(1878),\n" +
+ " X1879(1879),\n" +
+ " X1880(1880),\n" +
+ " X1881(1881),\n" +
+ " X1882(1882),\n" +
+ " X1883(1883),\n" +
+ " X1884(1884),\n" +
+ " X1885(1885),\n" +
+ " X1886(1886),\n" +
+ " X1887(1887),\n" +
+ " X1888(1888),\n" +
+ " X1889(1889),\n" +
+ " X1890(1890),\n" +
+ " X1891(1891),\n" +
+ " X1892(1892),\n" +
+ " X1893(1893),\n" +
+ " X1894(1894),\n" +
+ " X1895(1895),\n" +
+ " X1896(1896),\n" +
+ " X1897(1897),\n" +
+ " X1898(1898),\n" +
+ " X1899(1899),\n" +
+ " X1900(1900),\n" +
+ " X1901(1901),\n" +
+ " X1902(1902),\n" +
+ " X1903(1903),\n" +
+ " X1904(1904),\n" +
+ " X1905(1905),\n" +
+ " X1906(1906),\n" +
+ " X1907(1907),\n" +
+ " X1908(1908),\n" +
+ " X1909(1909),\n" +
+ " X1910(1910),\n" +
+ " X1911(1911),\n" +
+ " X1912(1912),\n" +
+ " X1913(1913),\n" +
+ " X1914(1914),\n" +
+ " X1915(1915),\n" +
+ " X1916(1916),\n" +
+ " X1917(1917),\n" +
+ " X1918(1918),\n" +
+ " X1919(1919),\n" +
+ " X1920(1920),\n" +
+ " X1921(1921),\n" +
+ " X1922(1922),\n" +
+ " X1923(1923),\n" +
+ " X1924(1924),\n" +
+ " X1925(1925),\n" +
+ " X1926(1926),\n" +
+ " X1927(1927),\n" +
+ " X1928(1928),\n" +
+ " X1929(1929),\n" +
+ " X1930(1930),\n" +
+ " X1931(1931),\n" +
+ " X1932(1932),\n" +
+ " X1933(1933),\n" +
+ " X1934(1934),\n" +
+ " X1935(1935),\n" +
+ " X1936(1936),\n" +
+ " X1937(1937),\n" +
+ " X1938(1938),\n" +
+ " X1939(1939),\n" +
+ " X1940(1940),\n" +
+ " X1941(1941),\n" +
+ " X1942(1942),\n" +
+ " X1943(1943),\n" +
+ " X1944(1944),\n" +
+ " X1945(1945),\n" +
+ " X1946(1946),\n" +
+ " X1947(1947),\n" +
+ " X1948(1948),\n" +
+ " X1949(1949),\n" +
+ " X1950(1950),\n" +
+ " X1951(1951),\n" +
+ " X1952(1952),\n" +
+ " X1953(1953),\n" +
+ " X1954(1954),\n" +
+ " X1955(1955),\n" +
+ " X1956(1956),\n" +
+ " X1957(1957),\n" +
+ " X1958(1958),\n" +
+ " X1959(1959),\n" +
+ " X1960(1960),\n" +
+ " X1961(1961),\n" +
+ " X1962(1962),\n" +
+ " X1963(1963),\n" +
+ " X1964(1964),\n" +
+ " X1965(1965),\n" +
+ " X1966(1966),\n" +
+ " X1967(1967),\n" +
+ " X1968(1968),\n" +
+ " X1969(1969),\n" +
+ " X1970(1970),\n" +
+ " X1971(1971),\n" +
+ " X1972(1972),\n" +
+ " X1973(1973),\n" +
+ " X1974(1974),\n" +
+ " X1975(1975),\n" +
+ " X1976(1976),\n" +
+ " X1977(1977),\n" +
+ " X1978(1978),\n" +
+ " X1979(1979),\n" +
+ " X1980(1980),\n" +
+ " X1981(1981),\n" +
+ " X1982(1982),\n" +
+ " X1983(1983),\n" +
+ " X1984(1984),\n" +
+ " X1985(1985),\n" +
+ " X1986(1986),\n" +
+ " X1987(1987),\n" +
+ " X1988(1988),\n" +
+ " X1989(1989),\n" +
+ " X1990(1990),\n" +
+ " X1991(1991),\n" +
+ " X1992(1992),\n" +
+ " X1993(1993),\n" +
+ " X1994(1994),\n" +
+ " X1995(1995),\n" +
+ " X1996(1996),\n" +
+ " X1997(1997),\n" +
+ " X1998(1998),\n" +
+ " X1999(1999),\n" +
+ " X2000(2000),\n" +
+ " X2001(2001),\n" +
+ " ;\n" +
+ "\n" +
+ " private int value;\n" +
+ " X(int i) {\n" +
+ " this.value = i;\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " int i = 0;\n" +
+ " for (X x : X.values()) {\n" +
+ " i++;\n" +
+ " System.out.print(x);\n" +
+ " }\n" +
+ " System.out.print(i);\n" +
+ " }\n" +
+ " \n" +
+ " public String toString() {\n" +
+ " return Integer.toString(this.value);\n" +
+ " }\n" +
"}"
},
buffer.toString());
@@ -16598,7 +16598,7 @@ public void test0018() {
StringBuffer buffer = new StringBuffer();
buffer
.append("123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119")
- .append("1201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022")
+ .append("1201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022")
.append("0320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528")
.append("6287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369")
.append("3703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524")
@@ -16628,2028 +16628,2028 @@ public void test0018() {
this.runConformTest(
new String[] {
"X.java",
- "public enum X {\n" +
- " X1(1),\n" +
- " X2(2),\n" +
- " X3(3),\n" +
- " X4(4),\n" +
- " X5(5),\n" +
- " X6(6),\n" +
- " X7(7),\n" +
- " X8(8),\n" +
- " X9(9),\n" +
- " X10(10),\n" +
- " X11(11),\n" +
- " X12(12),\n" +
- " X13(13),\n" +
- " X14(14),\n" +
- " X15(15),\n" +
- " X16(16),\n" +
- " X17(17),\n" +
- " X18(18),\n" +
- " X19(19),\n" +
- " X20(20),\n" +
- " X21(21),\n" +
- " X22(22),\n" +
- " X23(23),\n" +
- " X24(24),\n" +
- " X25(25),\n" +
- " X26(26),\n" +
- " X27(27),\n" +
- " X28(28),\n" +
- " X29(29),\n" +
- " X30(30),\n" +
- " X31(31),\n" +
- " X32(32),\n" +
- " X33(33),\n" +
- " X34(34),\n" +
- " X35(35),\n" +
- " X36(36),\n" +
- " X37(37),\n" +
- " X38(38),\n" +
- " X39(39),\n" +
- " X40(40),\n" +
- " X41(41),\n" +
- " X42(42),\n" +
- " X43(43),\n" +
- " X44(44),\n" +
- " X45(45),\n" +
- " X46(46),\n" +
- " X47(47),\n" +
- " X48(48),\n" +
- " X49(49),\n" +
- " X50(50),\n" +
- " X51(51),\n" +
- " X52(52),\n" +
- " X53(53),\n" +
- " X54(54),\n" +
- " X55(55),\n" +
- " X56(56),\n" +
- " X57(57),\n" +
- " X58(58),\n" +
- " X59(59),\n" +
- " X60(60),\n" +
- " X61(61),\n" +
- " X62(62),\n" +
- " X63(63),\n" +
- " X64(64),\n" +
- " X65(65),\n" +
- " X66(66),\n" +
- " X67(67),\n" +
- " X68(68),\n" +
- " X69(69),\n" +
- " X70(70),\n" +
- " X71(71),\n" +
- " X72(72),\n" +
- " X73(73),\n" +
- " X74(74),\n" +
- " X75(75),\n" +
- " X76(76),\n" +
- " X77(77),\n" +
- " X78(78),\n" +
- " X79(79),\n" +
- " X80(80),\n" +
- " X81(81),\n" +
- " X82(82),\n" +
- " X83(83),\n" +
- " X84(84),\n" +
- " X85(85),\n" +
- " X86(86),\n" +
- " X87(87),\n" +
- " X88(88),\n" +
- " X89(89),\n" +
- " X90(90),\n" +
- " X91(91),\n" +
- " X92(92),\n" +
- " X93(93),\n" +
- " X94(94),\n" +
- " X95(95),\n" +
- " X96(96),\n" +
- " X97(97),\n" +
- " X98(98),\n" +
- " X99(99),\n" +
- " X100(100),\n" +
- " X101(101),\n" +
- " X102(102),\n" +
- " X103(103),\n" +
- " X104(104),\n" +
- " X105(105),\n" +
- " X106(106),\n" +
- " X107(107),\n" +
- " X108(108),\n" +
- " X109(109),\n" +
- " X110(110),\n" +
- " X111(111),\n" +
- " X112(112),\n" +
- " X113(113),\n" +
- " X114(114),\n" +
- " X115(115),\n" +
- " X116(116),\n" +
- " X117(117),\n" +
- " X118(118),\n" +
- " X119(119),\n" +
- " X120(120),\n" +
- " X121(121),\n" +
- " X122(122),\n" +
- " X123(123),\n" +
- " X124(124),\n" +
- " X125(125),\n" +
- " X126(126),\n" +
- " X127(127),\n" +
- " X128(128),\n" +
- " X129(129),\n" +
- " X130(130),\n" +
- " X131(131),\n" +
- " X132(132),\n" +
- " X133(133),\n" +
- " X134(134),\n" +
- " X135(135),\n" +
- " X136(136),\n" +
- " X137(137),\n" +
- " X138(138),\n" +
- " X139(139),\n" +
- " X140(140),\n" +
- " X141(141),\n" +
- " X142(142),\n" +
- " X143(143),\n" +
- " X144(144),\n" +
- " X145(145),\n" +
- " X146(146),\n" +
- " X147(147),\n" +
- " X148(148),\n" +
- " X149(149),\n" +
- " X150(150),\n" +
- " X151(151),\n" +
- " X152(152),\n" +
- " X153(153),\n" +
- " X154(154),\n" +
- " X155(155),\n" +
- " X156(156),\n" +
- " X157(157),\n" +
- " X158(158),\n" +
- " X159(159),\n" +
- " X160(160),\n" +
- " X161(161),\n" +
- " X162(162),\n" +
- " X163(163),\n" +
- " X164(164),\n" +
- " X165(165),\n" +
- " X166(166),\n" +
- " X167(167),\n" +
- " X168(168),\n" +
- " X169(169),\n" +
- " X170(170),\n" +
- " X171(171),\n" +
- " X172(172),\n" +
- " X173(173),\n" +
- " X174(174),\n" +
- " X175(175),\n" +
- " X176(176),\n" +
- " X177(177),\n" +
- " X178(178),\n" +
- " X179(179),\n" +
- " X180(180),\n" +
- " X181(181),\n" +
- " X182(182),\n" +
- " X183(183),\n" +
- " X184(184),\n" +
- " X185(185),\n" +
- " X186(186),\n" +
- " X187(187),\n" +
- " X188(188),\n" +
- " X189(189),\n" +
- " X190(190),\n" +
- " X191(191),\n" +
- " X192(192),\n" +
- " X193(193),\n" +
- " X194(194),\n" +
- " X195(195),\n" +
- " X196(196),\n" +
- " X197(197),\n" +
- " X198(198),\n" +
- " X199(199),\n" +
- " X200(200),\n" +
- " X201(201),\n" +
- " X202(202),\n" +
- " X203(203),\n" +
- " X204(204),\n" +
- " X205(205),\n" +
- " X206(206),\n" +
- " X207(207),\n" +
- " X208(208),\n" +
- " X209(209),\n" +
- " X210(210),\n" +
- " X211(211),\n" +
- " X212(212),\n" +
- " X213(213),\n" +
- " X214(214),\n" +
- " X215(215),\n" +
- " X216(216),\n" +
- " X217(217),\n" +
- " X218(218),\n" +
- " X219(219),\n" +
- " X220(220),\n" +
- " X221(221),\n" +
- " X222(222),\n" +
- " X223(223),\n" +
- " X224(224),\n" +
- " X225(225),\n" +
- " X226(226),\n" +
- " X227(227),\n" +
- " X228(228),\n" +
- " X229(229),\n" +
- " X230(230),\n" +
- " X231(231),\n" +
- " X232(232),\n" +
- " X233(233),\n" +
- " X234(234),\n" +
- " X235(235),\n" +
- " X236(236),\n" +
- " X237(237),\n" +
- " X238(238),\n" +
- " X239(239),\n" +
- " X240(240),\n" +
- " X241(241),\n" +
- " X242(242),\n" +
- " X243(243),\n" +
- " X244(244),\n" +
- " X245(245),\n" +
- " X246(246),\n" +
- " X247(247),\n" +
- " X248(248),\n" +
- " X249(249),\n" +
- " X250(250),\n" +
- " X251(251),\n" +
- " X252(252),\n" +
- " X253(253),\n" +
- " X254(254),\n" +
- " X255(255),\n" +
- " X256(256),\n" +
- " X257(257),\n" +
- " X258(258),\n" +
- " X259(259),\n" +
- " X260(260),\n" +
- " X261(261),\n" +
- " X262(262),\n" +
- " X263(263),\n" +
- " X264(264),\n" +
- " X265(265),\n" +
- " X266(266),\n" +
- " X267(267),\n" +
- " X268(268),\n" +
- " X269(269),\n" +
- " X270(270),\n" +
- " X271(271),\n" +
- " X272(272),\n" +
- " X273(273),\n" +
- " X274(274),\n" +
- " X275(275),\n" +
- " X276(276),\n" +
- " X277(277),\n" +
- " X278(278),\n" +
- " X279(279),\n" +
- " X280(280),\n" +
- " X281(281),\n" +
- " X282(282),\n" +
- " X283(283),\n" +
- " X284(284),\n" +
- " X285(285),\n" +
- " X286(286),\n" +
- " X287(287),\n" +
- " X288(288),\n" +
- " X289(289),\n" +
- " X290(290),\n" +
- " X291(291),\n" +
- " X292(292),\n" +
- " X293(293),\n" +
- " X294(294),\n" +
- " X295(295),\n" +
- " X296(296),\n" +
- " X297(297),\n" +
- " X298(298),\n" +
- " X299(299),\n" +
- " X300(300),\n" +
- " X301(301),\n" +
- " X302(302),\n" +
- " X303(303),\n" +
- " X304(304),\n" +
- " X305(305),\n" +
- " X306(306),\n" +
- " X307(307),\n" +
- " X308(308),\n" +
- " X309(309),\n" +
- " X310(310),\n" +
- " X311(311),\n" +
- " X312(312),\n" +
- " X313(313),\n" +
- " X314(314),\n" +
- " X315(315),\n" +
- " X316(316),\n" +
- " X317(317),\n" +
- " X318(318),\n" +
- " X319(319),\n" +
- " X320(320),\n" +
- " X321(321),\n" +
- " X322(322),\n" +
- " X323(323),\n" +
- " X324(324),\n" +
- " X325(325),\n" +
- " X326(326),\n" +
- " X327(327),\n" +
- " X328(328),\n" +
- " X329(329),\n" +
- " X330(330),\n" +
- " X331(331),\n" +
- " X332(332),\n" +
- " X333(333),\n" +
- " X334(334),\n" +
- " X335(335),\n" +
- " X336(336),\n" +
- " X337(337),\n" +
- " X338(338),\n" +
- " X339(339),\n" +
- " X340(340),\n" +
- " X341(341),\n" +
- " X342(342),\n" +
- " X343(343),\n" +
- " X344(344),\n" +
- " X345(345),\n" +
- " X346(346),\n" +
- " X347(347),\n" +
- " X348(348),\n" +
- " X349(349),\n" +
- " X350(350),\n" +
- " X351(351),\n" +
- " X352(352),\n" +
- " X353(353),\n" +
- " X354(354),\n" +
- " X355(355),\n" +
- " X356(356),\n" +
- " X357(357),\n" +
- " X358(358),\n" +
- " X359(359),\n" +
- " X360(360),\n" +
- " X361(361),\n" +
- " X362(362),\n" +
- " X363(363),\n" +
- " X364(364),\n" +
- " X365(365),\n" +
- " X366(366),\n" +
- " X367(367),\n" +
- " X368(368),\n" +
- " X369(369),\n" +
- " X370(370),\n" +
- " X371(371),\n" +
- " X372(372),\n" +
- " X373(373),\n" +
- " X374(374),\n" +
- " X375(375),\n" +
- " X376(376),\n" +
- " X377(377),\n" +
- " X378(378),\n" +
- " X379(379),\n" +
- " X380(380),\n" +
- " X381(381),\n" +
- " X382(382),\n" +
- " X383(383),\n" +
- " X384(384),\n" +
- " X385(385),\n" +
- " X386(386),\n" +
- " X387(387),\n" +
- " X388(388),\n" +
- " X389(389),\n" +
- " X390(390),\n" +
- " X391(391),\n" +
- " X392(392),\n" +
- " X393(393),\n" +
- " X394(394),\n" +
- " X395(395),\n" +
- " X396(396),\n" +
- " X397(397),\n" +
- " X398(398),\n" +
- " X399(399),\n" +
- " X400(400),\n" +
- " X401(401),\n" +
- " X402(402),\n" +
- " X403(403),\n" +
- " X404(404),\n" +
- " X405(405),\n" +
- " X406(406),\n" +
- " X407(407),\n" +
- " X408(408),\n" +
- " X409(409),\n" +
- " X410(410),\n" +
- " X411(411),\n" +
- " X412(412),\n" +
- " X413(413),\n" +
- " X414(414),\n" +
- " X415(415),\n" +
- " X416(416),\n" +
- " X417(417),\n" +
- " X418(418),\n" +
- " X419(419),\n" +
- " X420(420),\n" +
- " X421(421),\n" +
- " X422(422),\n" +
- " X423(423),\n" +
- " X424(424),\n" +
- " X425(425),\n" +
- " X426(426),\n" +
- " X427(427),\n" +
- " X428(428),\n" +
- " X429(429),\n" +
- " X430(430),\n" +
- " X431(431),\n" +
- " X432(432),\n" +
- " X433(433),\n" +
- " X434(434),\n" +
- " X435(435),\n" +
- " X436(436),\n" +
- " X437(437),\n" +
- " X438(438),\n" +
- " X439(439),\n" +
- " X440(440),\n" +
- " X441(441),\n" +
- " X442(442),\n" +
- " X443(443),\n" +
- " X444(444),\n" +
- " X445(445),\n" +
- " X446(446),\n" +
- " X447(447),\n" +
- " X448(448),\n" +
- " X449(449),\n" +
- " X450(450),\n" +
- " X451(451),\n" +
- " X452(452),\n" +
- " X453(453),\n" +
- " X454(454),\n" +
- " X455(455),\n" +
- " X456(456),\n" +
- " X457(457),\n" +
- " X458(458),\n" +
- " X459(459),\n" +
- " X460(460),\n" +
- " X461(461),\n" +
- " X462(462),\n" +
- " X463(463),\n" +
- " X464(464),\n" +
- " X465(465),\n" +
- " X466(466),\n" +
- " X467(467),\n" +
- " X468(468),\n" +
- " X469(469),\n" +
- " X470(470),\n" +
- " X471(471),\n" +
- " X472(472),\n" +
- " X473(473),\n" +
- " X474(474),\n" +
- " X475(475),\n" +
- " X476(476),\n" +
- " X477(477),\n" +
- " X478(478),\n" +
- " X479(479),\n" +
- " X480(480),\n" +
- " X481(481),\n" +
- " X482(482),\n" +
- " X483(483),\n" +
- " X484(484),\n" +
- " X485(485),\n" +
- " X486(486),\n" +
- " X487(487),\n" +
- " X488(488),\n" +
- " X489(489),\n" +
- " X490(490),\n" +
- " X491(491),\n" +
- " X492(492),\n" +
- " X493(493),\n" +
- " X494(494),\n" +
- " X495(495),\n" +
- " X496(496),\n" +
- " X497(497),\n" +
- " X498(498),\n" +
- " X499(499),\n" +
- " X500(500),\n" +
- " X501(501),\n" +
- " X502(502),\n" +
- " X503(503),\n" +
- " X504(504),\n" +
- " X505(505),\n" +
- " X506(506),\n" +
- " X507(507),\n" +
- " X508(508),\n" +
- " X509(509),\n" +
- " X510(510),\n" +
- " X511(511),\n" +
- " X512(512),\n" +
- " X513(513),\n" +
- " X514(514),\n" +
- " X515(515),\n" +
- " X516(516),\n" +
- " X517(517),\n" +
- " X518(518),\n" +
- " X519(519),\n" +
- " X520(520),\n" +
- " X521(521),\n" +
- " X522(522),\n" +
- " X523(523),\n" +
- " X524(524),\n" +
- " X525(525),\n" +
- " X526(526),\n" +
- " X527(527),\n" +
- " X528(528),\n" +
- " X529(529),\n" +
- " X530(530),\n" +
- " X531(531),\n" +
- " X532(532),\n" +
- " X533(533),\n" +
- " X534(534),\n" +
- " X535(535),\n" +
- " X536(536),\n" +
- " X537(537),\n" +
- " X538(538),\n" +
- " X539(539),\n" +
- " X540(540),\n" +
- " X541(541),\n" +
- " X542(542),\n" +
- " X543(543),\n" +
- " X544(544),\n" +
- " X545(545),\n" +
- " X546(546),\n" +
- " X547(547),\n" +
- " X548(548),\n" +
- " X549(549),\n" +
- " X550(550),\n" +
- " X551(551),\n" +
- " X552(552),\n" +
- " X553(553),\n" +
- " X554(554),\n" +
- " X555(555),\n" +
- " X556(556),\n" +
- " X557(557),\n" +
- " X558(558),\n" +
- " X559(559),\n" +
- " X560(560),\n" +
- " X561(561),\n" +
- " X562(562),\n" +
- " X563(563),\n" +
- " X564(564),\n" +
- " X565(565),\n" +
- " X566(566),\n" +
- " X567(567),\n" +
- " X568(568),\n" +
- " X569(569),\n" +
- " X570(570),\n" +
- " X571(571),\n" +
- " X572(572),\n" +
- " X573(573),\n" +
- " X574(574),\n" +
- " X575(575),\n" +
- " X576(576),\n" +
- " X577(577),\n" +
- " X578(578),\n" +
- " X579(579),\n" +
- " X580(580),\n" +
- " X581(581),\n" +
- " X582(582),\n" +
- " X583(583),\n" +
- " X584(584),\n" +
- " X585(585),\n" +
- " X586(586),\n" +
- " X587(587),\n" +
- " X588(588),\n" +
- " X589(589),\n" +
- " X590(590),\n" +
- " X591(591),\n" +
- " X592(592),\n" +
- " X593(593),\n" +
- " X594(594),\n" +
- " X595(595),\n" +
- " X596(596),\n" +
- " X597(597),\n" +
- " X598(598),\n" +
- " X599(599),\n" +
- " X600(600),\n" +
- " X601(601),\n" +
- " X602(602),\n" +
- " X603(603),\n" +
- " X604(604),\n" +
- " X605(605),\n" +
- " X606(606),\n" +
- " X607(607),\n" +
- " X608(608),\n" +
- " X609(609),\n" +
- " X610(610),\n" +
- " X611(611),\n" +
- " X612(612),\n" +
- " X613(613),\n" +
- " X614(614),\n" +
- " X615(615),\n" +
- " X616(616),\n" +
- " X617(617),\n" +
- " X618(618),\n" +
- " X619(619),\n" +
- " X620(620),\n" +
- " X621(621),\n" +
- " X622(622),\n" +
- " X623(623),\n" +
- " X624(624),\n" +
- " X625(625),\n" +
- " X626(626),\n" +
- " X627(627),\n" +
- " X628(628),\n" +
- " X629(629),\n" +
- " X630(630),\n" +
- " X631(631),\n" +
- " X632(632),\n" +
- " X633(633),\n" +
- " X634(634),\n" +
- " X635(635),\n" +
- " X636(636),\n" +
- " X637(637),\n" +
- " X638(638),\n" +
- " X639(639),\n" +
- " X640(640),\n" +
- " X641(641),\n" +
- " X642(642),\n" +
- " X643(643),\n" +
- " X644(644),\n" +
- " X645(645),\n" +
- " X646(646),\n" +
- " X647(647),\n" +
- " X648(648),\n" +
- " X649(649),\n" +
- " X650(650),\n" +
- " X651(651),\n" +
- " X652(652),\n" +
- " X653(653),\n" +
- " X654(654),\n" +
- " X655(655),\n" +
- " X656(656),\n" +
- " X657(657),\n" +
- " X658(658),\n" +
- " X659(659),\n" +
- " X660(660),\n" +
- " X661(661),\n" +
- " X662(662),\n" +
- " X663(663),\n" +
- " X664(664),\n" +
- " X665(665),\n" +
- " X666(666),\n" +
- " X667(667),\n" +
- " X668(668),\n" +
- " X669(669),\n" +
- " X670(670),\n" +
- " X671(671),\n" +
- " X672(672),\n" +
- " X673(673),\n" +
- " X674(674),\n" +
- " X675(675),\n" +
- " X676(676),\n" +
- " X677(677),\n" +
- " X678(678),\n" +
- " X679(679),\n" +
- " X680(680),\n" +
- " X681(681),\n" +
- " X682(682),\n" +
- " X683(683),\n" +
- " X684(684),\n" +
- " X685(685),\n" +
- " X686(686),\n" +
- " X687(687),\n" +
- " X688(688),\n" +
- " X689(689),\n" +
- " X690(690),\n" +
- " X691(691),\n" +
- " X692(692),\n" +
- " X693(693),\n" +
- " X694(694),\n" +
- " X695(695),\n" +
- " X696(696),\n" +
- " X697(697),\n" +
- " X698(698),\n" +
- " X699(699),\n" +
- " X700(700),\n" +
- " X701(701),\n" +
- " X702(702),\n" +
- " X703(703),\n" +
- " X704(704),\n" +
- " X705(705),\n" +
- " X706(706),\n" +
- " X707(707),\n" +
- " X708(708),\n" +
- " X709(709),\n" +
- " X710(710),\n" +
- " X711(711),\n" +
- " X712(712),\n" +
- " X713(713),\n" +
- " X714(714),\n" +
- " X715(715),\n" +
- " X716(716),\n" +
- " X717(717),\n" +
- " X718(718),\n" +
- " X719(719),\n" +
- " X720(720),\n" +
- " X721(721),\n" +
- " X722(722),\n" +
- " X723(723),\n" +
- " X724(724),\n" +
- " X725(725),\n" +
- " X726(726),\n" +
- " X727(727),\n" +
- " X728(728),\n" +
- " X729(729),\n" +
- " X730(730),\n" +
- " X731(731),\n" +
- " X732(732),\n" +
- " X733(733),\n" +
- " X734(734),\n" +
- " X735(735),\n" +
- " X736(736),\n" +
- " X737(737),\n" +
- " X738(738),\n" +
- " X739(739),\n" +
- " X740(740),\n" +
- " X741(741),\n" +
- " X742(742),\n" +
- " X743(743),\n" +
- " X744(744),\n" +
- " X745(745),\n" +
- " X746(746),\n" +
- " X747(747),\n" +
- " X748(748),\n" +
- " X749(749),\n" +
- " X750(750),\n" +
- " X751(751),\n" +
- " X752(752),\n" +
- " X753(753),\n" +
- " X754(754),\n" +
- " X755(755),\n" +
- " X756(756),\n" +
- " X757(757),\n" +
- " X758(758),\n" +
- " X759(759),\n" +
- " X760(760),\n" +
- " X761(761),\n" +
- " X762(762),\n" +
- " X763(763),\n" +
- " X764(764),\n" +
- " X765(765),\n" +
- " X766(766),\n" +
- " X767(767),\n" +
- " X768(768),\n" +
- " X769(769),\n" +
- " X770(770),\n" +
- " X771(771),\n" +
- " X772(772),\n" +
- " X773(773),\n" +
- " X774(774),\n" +
- " X775(775),\n" +
- " X776(776),\n" +
- " X777(777),\n" +
- " X778(778),\n" +
- " X779(779),\n" +
- " X780(780),\n" +
- " X781(781),\n" +
- " X782(782),\n" +
- " X783(783),\n" +
- " X784(784),\n" +
- " X785(785),\n" +
- " X786(786),\n" +
- " X787(787),\n" +
- " X788(788),\n" +
- " X789(789),\n" +
- " X790(790),\n" +
- " X791(791),\n" +
- " X792(792),\n" +
- " X793(793),\n" +
- " X794(794),\n" +
- " X795(795),\n" +
- " X796(796),\n" +
- " X797(797),\n" +
- " X798(798),\n" +
- " X799(799),\n" +
- " X800(800),\n" +
- " X801(801),\n" +
- " X802(802),\n" +
- " X803(803),\n" +
- " X804(804),\n" +
- " X805(805),\n" +
- " X806(806),\n" +
- " X807(807),\n" +
- " X808(808),\n" +
- " X809(809),\n" +
- " X810(810),\n" +
- " X811(811),\n" +
- " X812(812),\n" +
- " X813(813),\n" +
- " X814(814),\n" +
- " X815(815),\n" +
- " X816(816),\n" +
- " X817(817),\n" +
- " X818(818),\n" +
- " X819(819),\n" +
- " X820(820),\n" +
- " X821(821),\n" +
- " X822(822),\n" +
- " X823(823),\n" +
- " X824(824),\n" +
- " X825(825),\n" +
- " X826(826),\n" +
- " X827(827),\n" +
- " X828(828),\n" +
- " X829(829),\n" +
- " X830(830),\n" +
- " X831(831),\n" +
- " X832(832),\n" +
- " X833(833),\n" +
- " X834(834),\n" +
- " X835(835),\n" +
- " X836(836),\n" +
- " X837(837),\n" +
- " X838(838),\n" +
- " X839(839),\n" +
- " X840(840),\n" +
- " X841(841),\n" +
- " X842(842),\n" +
- " X843(843),\n" +
- " X844(844),\n" +
- " X845(845),\n" +
- " X846(846),\n" +
- " X847(847),\n" +
- " X848(848),\n" +
- " X849(849),\n" +
- " X850(850),\n" +
- " X851(851),\n" +
- " X852(852),\n" +
- " X853(853),\n" +
- " X854(854),\n" +
- " X855(855),\n" +
- " X856(856),\n" +
- " X857(857),\n" +
- " X858(858),\n" +
- " X859(859),\n" +
- " X860(860),\n" +
- " X861(861),\n" +
- " X862(862),\n" +
- " X863(863),\n" +
- " X864(864),\n" +
- " X865(865),\n" +
- " X866(866),\n" +
- " X867(867),\n" +
- " X868(868),\n" +
- " X869(869),\n" +
- " X870(870),\n" +
- " X871(871),\n" +
- " X872(872),\n" +
- " X873(873),\n" +
- " X874(874),\n" +
- " X875(875),\n" +
- " X876(876),\n" +
- " X877(877),\n" +
- " X878(878),\n" +
- " X879(879),\n" +
- " X880(880),\n" +
- " X881(881),\n" +
- " X882(882),\n" +
- " X883(883),\n" +
- " X884(884),\n" +
- " X885(885),\n" +
- " X886(886),\n" +
- " X887(887),\n" +
- " X888(888),\n" +
- " X889(889),\n" +
- " X890(890),\n" +
- " X891(891),\n" +
- " X892(892),\n" +
- " X893(893),\n" +
- " X894(894),\n" +
- " X895(895),\n" +
- " X896(896),\n" +
- " X897(897),\n" +
- " X898(898),\n" +
- " X899(899),\n" +
- " X900(900),\n" +
- " X901(901),\n" +
- " X902(902),\n" +
- " X903(903),\n" +
- " X904(904),\n" +
- " X905(905),\n" +
- " X906(906),\n" +
- " X907(907),\n" +
- " X908(908),\n" +
- " X909(909),\n" +
- " X910(910),\n" +
- " X911(911),\n" +
- " X912(912),\n" +
- " X913(913),\n" +
- " X914(914),\n" +
- " X915(915),\n" +
- " X916(916),\n" +
- " X917(917),\n" +
- " X918(918),\n" +
- " X919(919),\n" +
- " X920(920),\n" +
- " X921(921),\n" +
- " X922(922),\n" +
- " X923(923),\n" +
- " X924(924),\n" +
- " X925(925),\n" +
- " X926(926),\n" +
- " X927(927),\n" +
- " X928(928),\n" +
- " X929(929),\n" +
- " X930(930),\n" +
- " X931(931),\n" +
- " X932(932),\n" +
- " X933(933),\n" +
- " X934(934),\n" +
- " X935(935),\n" +
- " X936(936),\n" +
- " X937(937),\n" +
- " X938(938),\n" +
- " X939(939),\n" +
- " X940(940),\n" +
- " X941(941),\n" +
- " X942(942),\n" +
- " X943(943),\n" +
- " X944(944),\n" +
- " X945(945),\n" +
- " X946(946),\n" +
- " X947(947),\n" +
- " X948(948),\n" +
- " X949(949),\n" +
- " X950(950),\n" +
- " X951(951),\n" +
- " X952(952),\n" +
- " X953(953),\n" +
- " X954(954),\n" +
- " X955(955),\n" +
- " X956(956),\n" +
- " X957(957),\n" +
- " X958(958),\n" +
- " X959(959),\n" +
- " X960(960),\n" +
- " X961(961),\n" +
- " X962(962),\n" +
- " X963(963),\n" +
- " X964(964),\n" +
- " X965(965),\n" +
- " X966(966),\n" +
- " X967(967),\n" +
- " X968(968),\n" +
- " X969(969),\n" +
- " X970(970),\n" +
- " X971(971),\n" +
- " X972(972),\n" +
- " X973(973),\n" +
- " X974(974),\n" +
- " X975(975),\n" +
- " X976(976),\n" +
- " X977(977),\n" +
- " X978(978),\n" +
- " X979(979),\n" +
- " X980(980),\n" +
- " X981(981),\n" +
- " X982(982),\n" +
- " X983(983),\n" +
- " X984(984),\n" +
- " X985(985),\n" +
- " X986(986),\n" +
- " X987(987),\n" +
- " X988(988),\n" +
- " X989(989),\n" +
- " X990(990),\n" +
- " X991(991),\n" +
- " X992(992),\n" +
- " X993(993),\n" +
- " X994(994),\n" +
- " X995(995),\n" +
- " X996(996),\n" +
- " X997(997),\n" +
- " X998(998),\n" +
- " X999(999),\n" +
- " X1000(1000),\n" +
- " X1001(1001),\n" +
- " X1002(1002),\n" +
- " X1003(1003),\n" +
- " X1004(1004),\n" +
- " X1005(1005),\n" +
- " X1006(1006),\n" +
- " X1007(1007),\n" +
- " X1008(1008),\n" +
- " X1009(1009),\n" +
- " X1010(1010),\n" +
- " X1011(1011),\n" +
- " X1012(1012),\n" +
- " X1013(1013),\n" +
- " X1014(1014),\n" +
- " X1015(1015),\n" +
- " X1016(1016),\n" +
- " X1017(1017),\n" +
- " X1018(1018),\n" +
- " X1019(1019),\n" +
- " X1020(1020),\n" +
- " X1021(1021),\n" +
- " X1022(1022),\n" +
- " X1023(1023),\n" +
- " X1024(1024),\n" +
- " X1025(1025),\n" +
- " X1026(1026),\n" +
- " X1027(1027),\n" +
- " X1028(1028),\n" +
- " X1029(1029),\n" +
- " X1030(1030),\n" +
- " X1031(1031),\n" +
- " X1032(1032),\n" +
- " X1033(1033),\n" +
- " X1034(1034),\n" +
- " X1035(1035),\n" +
- " X1036(1036),\n" +
- " X1037(1037),\n" +
- " X1038(1038),\n" +
- " X1039(1039),\n" +
- " X1040(1040),\n" +
- " X1041(1041),\n" +
- " X1042(1042),\n" +
- " X1043(1043),\n" +
- " X1044(1044),\n" +
- " X1045(1045),\n" +
- " X1046(1046),\n" +
- " X1047(1047),\n" +
- " X1048(1048),\n" +
- " X1049(1049),\n" +
- " X1050(1050),\n" +
- " X1051(1051),\n" +
- " X1052(1052),\n" +
- " X1053(1053),\n" +
- " X1054(1054),\n" +
- " X1055(1055),\n" +
- " X1056(1056),\n" +
- " X1057(1057),\n" +
- " X1058(1058),\n" +
- " X1059(1059),\n" +
- " X1060(1060),\n" +
- " X1061(1061),\n" +
- " X1062(1062),\n" +
- " X1063(1063),\n" +
- " X1064(1064),\n" +
- " X1065(1065),\n" +
- " X1066(1066),\n" +
- " X1067(1067),\n" +
- " X1068(1068),\n" +
- " X1069(1069),\n" +
- " X1070(1070),\n" +
- " X1071(1071),\n" +
- " X1072(1072),\n" +
- " X1073(1073),\n" +
- " X1074(1074),\n" +
- " X1075(1075),\n" +
- " X1076(1076),\n" +
- " X1077(1077),\n" +
- " X1078(1078),\n" +
- " X1079(1079),\n" +
- " X1080(1080),\n" +
- " X1081(1081),\n" +
- " X1082(1082),\n" +
- " X1083(1083),\n" +
- " X1084(1084),\n" +
- " X1085(1085),\n" +
- " X1086(1086),\n" +
- " X1087(1087),\n" +
- " X1088(1088),\n" +
- " X1089(1089),\n" +
- " X1090(1090),\n" +
- " X1091(1091),\n" +
- " X1092(1092),\n" +
- " X1093(1093),\n" +
- " X1094(1094),\n" +
- " X1095(1095),\n" +
- " X1096(1096),\n" +
- " X1097(1097),\n" +
- " X1098(1098),\n" +
- " X1099(1099),\n" +
- " X1100(1100),\n" +
- " X1101(1101),\n" +
- " X1102(1102),\n" +
- " X1103(1103),\n" +
- " X1104(1104),\n" +
- " X1105(1105),\n" +
- " X1106(1106),\n" +
- " X1107(1107),\n" +
- " X1108(1108),\n" +
- " X1109(1109),\n" +
- " X1110(1110),\n" +
- " X1111(1111),\n" +
- " X1112(1112),\n" +
- " X1113(1113),\n" +
- " X1114(1114),\n" +
- " X1115(1115),\n" +
- " X1116(1116),\n" +
- " X1117(1117),\n" +
- " X1118(1118),\n" +
- " X1119(1119),\n" +
- " X1120(1120),\n" +
- " X1121(1121),\n" +
- " X1122(1122),\n" +
- " X1123(1123),\n" +
- " X1124(1124),\n" +
- " X1125(1125),\n" +
- " X1126(1126),\n" +
- " X1127(1127),\n" +
- " X1128(1128),\n" +
- " X1129(1129),\n" +
- " X1130(1130),\n" +
- " X1131(1131),\n" +
- " X1132(1132),\n" +
- " X1133(1133),\n" +
- " X1134(1134),\n" +
- " X1135(1135),\n" +
- " X1136(1136),\n" +
- " X1137(1137),\n" +
- " X1138(1138),\n" +
- " X1139(1139),\n" +
- " X1140(1140),\n" +
- " X1141(1141),\n" +
- " X1142(1142),\n" +
- " X1143(1143),\n" +
- " X1144(1144),\n" +
- " X1145(1145),\n" +
- " X1146(1146),\n" +
- " X1147(1147),\n" +
- " X1148(1148),\n" +
- " X1149(1149),\n" +
- " X1150(1150),\n" +
- " X1151(1151),\n" +
- " X1152(1152),\n" +
- " X1153(1153),\n" +
- " X1154(1154),\n" +
- " X1155(1155),\n" +
- " X1156(1156),\n" +
- " X1157(1157),\n" +
- " X1158(1158),\n" +
- " X1159(1159),\n" +
- " X1160(1160),\n" +
- " X1161(1161),\n" +
- " X1162(1162),\n" +
- " X1163(1163),\n" +
- " X1164(1164),\n" +
- " X1165(1165),\n" +
- " X1166(1166),\n" +
- " X1167(1167),\n" +
- " X1168(1168),\n" +
- " X1169(1169),\n" +
- " X1170(1170),\n" +
- " X1171(1171),\n" +
- " X1172(1172),\n" +
- " X1173(1173),\n" +
- " X1174(1174),\n" +
- " X1175(1175),\n" +
- " X1176(1176),\n" +
- " X1177(1177),\n" +
- " X1178(1178),\n" +
- " X1179(1179),\n" +
- " X1180(1180),\n" +
- " X1181(1181),\n" +
- " X1182(1182),\n" +
- " X1183(1183),\n" +
- " X1184(1184),\n" +
- " X1185(1185),\n" +
- " X1186(1186),\n" +
- " X1187(1187),\n" +
- " X1188(1188),\n" +
- " X1189(1189),\n" +
- " X1190(1190),\n" +
- " X1191(1191),\n" +
- " X1192(1192),\n" +
- " X1193(1193),\n" +
- " X1194(1194),\n" +
- " X1195(1195),\n" +
- " X1196(1196),\n" +
- " X1197(1197),\n" +
- " X1198(1198),\n" +
- " X1199(1199),\n" +
- " X1200(1200),\n" +
- " X1201(1201),\n" +
- " X1202(1202),\n" +
- " X1203(1203),\n" +
- " X1204(1204),\n" +
- " X1205(1205),\n" +
- " X1206(1206),\n" +
- " X1207(1207),\n" +
- " X1208(1208),\n" +
- " X1209(1209),\n" +
- " X1210(1210),\n" +
- " X1211(1211),\n" +
- " X1212(1212),\n" +
- " X1213(1213),\n" +
- " X1214(1214),\n" +
- " X1215(1215),\n" +
- " X1216(1216),\n" +
- " X1217(1217),\n" +
- " X1218(1218),\n" +
- " X1219(1219),\n" +
- " X1220(1220),\n" +
- " X1221(1221),\n" +
- " X1222(1222),\n" +
- " X1223(1223),\n" +
- " X1224(1224),\n" +
- " X1225(1225),\n" +
- " X1226(1226),\n" +
- " X1227(1227),\n" +
- " X1228(1228),\n" +
- " X1229(1229),\n" +
- " X1230(1230),\n" +
- " X1231(1231),\n" +
- " X1232(1232),\n" +
- " X1233(1233),\n" +
- " X1234(1234),\n" +
- " X1235(1235),\n" +
- " X1236(1236),\n" +
- " X1237(1237),\n" +
- " X1238(1238),\n" +
- " X1239(1239),\n" +
- " X1240(1240),\n" +
- " X1241(1241),\n" +
- " X1242(1242),\n" +
- " X1243(1243),\n" +
- " X1244(1244),\n" +
- " X1245(1245),\n" +
- " X1246(1246),\n" +
- " X1247(1247),\n" +
- " X1248(1248),\n" +
- " X1249(1249),\n" +
- " X1250(1250),\n" +
- " X1251(1251),\n" +
- " X1252(1252),\n" +
- " X1253(1253),\n" +
- " X1254(1254),\n" +
- " X1255(1255),\n" +
- " X1256(1256),\n" +
- " X1257(1257),\n" +
- " X1258(1258),\n" +
- " X1259(1259),\n" +
- " X1260(1260),\n" +
- " X1261(1261),\n" +
- " X1262(1262),\n" +
- " X1263(1263),\n" +
- " X1264(1264),\n" +
- " X1265(1265),\n" +
- " X1266(1266),\n" +
- " X1267(1267),\n" +
- " X1268(1268),\n" +
- " X1269(1269),\n" +
- " X1270(1270),\n" +
- " X1271(1271),\n" +
- " X1272(1272),\n" +
- " X1273(1273),\n" +
- " X1274(1274),\n" +
- " X1275(1275),\n" +
- " X1276(1276),\n" +
- " X1277(1277),\n" +
- " X1278(1278),\n" +
- " X1279(1279),\n" +
- " X1280(1280),\n" +
- " X1281(1281),\n" +
- " X1282(1282),\n" +
- " X1283(1283),\n" +
- " X1284(1284),\n" +
- " X1285(1285),\n" +
- " X1286(1286),\n" +
- " X1287(1287),\n" +
- " X1288(1288),\n" +
- " X1289(1289),\n" +
- " X1290(1290),\n" +
- " X1291(1291),\n" +
- " X1292(1292),\n" +
- " X1293(1293),\n" +
- " X1294(1294),\n" +
- " X1295(1295),\n" +
- " X1296(1296),\n" +
- " X1297(1297),\n" +
- " X1298(1298),\n" +
- " X1299(1299),\n" +
- " X1300(1300),\n" +
- " X1301(1301),\n" +
- " X1302(1302),\n" +
- " X1303(1303),\n" +
- " X1304(1304),\n" +
- " X1305(1305),\n" +
- " X1306(1306),\n" +
- " X1307(1307),\n" +
- " X1308(1308),\n" +
- " X1309(1309),\n" +
- " X1310(1310),\n" +
- " X1311(1311),\n" +
- " X1312(1312),\n" +
- " X1313(1313),\n" +
- " X1314(1314),\n" +
- " X1315(1315),\n" +
- " X1316(1316),\n" +
- " X1317(1317),\n" +
- " X1318(1318),\n" +
- " X1319(1319),\n" +
- " X1320(1320),\n" +
- " X1321(1321),\n" +
- " X1322(1322),\n" +
- " X1323(1323),\n" +
- " X1324(1324),\n" +
- " X1325(1325),\n" +
- " X1326(1326),\n" +
- " X1327(1327),\n" +
- " X1328(1328),\n" +
- " X1329(1329),\n" +
- " X1330(1330),\n" +
- " X1331(1331),\n" +
- " X1332(1332),\n" +
- " X1333(1333),\n" +
- " X1334(1334),\n" +
- " X1335(1335),\n" +
- " X1336(1336),\n" +
- " X1337(1337),\n" +
- " X1338(1338),\n" +
- " X1339(1339),\n" +
- " X1340(1340),\n" +
- " X1341(1341),\n" +
- " X1342(1342),\n" +
- " X1343(1343),\n" +
- " X1344(1344),\n" +
- " X1345(1345),\n" +
- " X1346(1346),\n" +
- " X1347(1347),\n" +
- " X1348(1348),\n" +
- " X1349(1349),\n" +
- " X1350(1350),\n" +
- " X1351(1351),\n" +
- " X1352(1352),\n" +
- " X1353(1353),\n" +
- " X1354(1354),\n" +
- " X1355(1355),\n" +
- " X1356(1356),\n" +
- " X1357(1357),\n" +
- " X1358(1358),\n" +
- " X1359(1359),\n" +
- " X1360(1360),\n" +
- " X1361(1361),\n" +
- " X1362(1362),\n" +
- " X1363(1363),\n" +
- " X1364(1364),\n" +
- " X1365(1365),\n" +
- " X1366(1366),\n" +
- " X1367(1367),\n" +
- " X1368(1368),\n" +
- " X1369(1369),\n" +
- " X1370(1370),\n" +
- " X1371(1371),\n" +
- " X1372(1372),\n" +
- " X1373(1373),\n" +
- " X1374(1374),\n" +
- " X1375(1375),\n" +
- " X1376(1376),\n" +
- " X1377(1377),\n" +
- " X1378(1378),\n" +
- " X1379(1379),\n" +
- " X1380(1380),\n" +
- " X1381(1381),\n" +
- " X1382(1382),\n" +
- " X1383(1383),\n" +
- " X1384(1384),\n" +
- " X1385(1385),\n" +
- " X1386(1386),\n" +
- " X1387(1387),\n" +
- " X1388(1388),\n" +
- " X1389(1389),\n" +
- " X1390(1390),\n" +
- " X1391(1391),\n" +
- " X1392(1392),\n" +
- " X1393(1393),\n" +
- " X1394(1394),\n" +
- " X1395(1395),\n" +
- " X1396(1396),\n" +
- " X1397(1397),\n" +
- " X1398(1398),\n" +
- " X1399(1399),\n" +
- " X1400(1400),\n" +
- " X1401(1401),\n" +
- " X1402(1402),\n" +
- " X1403(1403),\n" +
- " X1404(1404),\n" +
- " X1405(1405),\n" +
- " X1406(1406),\n" +
- " X1407(1407),\n" +
- " X1408(1408),\n" +
- " X1409(1409),\n" +
- " X1410(1410),\n" +
- " X1411(1411),\n" +
- " X1412(1412),\n" +
- " X1413(1413),\n" +
- " X1414(1414),\n" +
- " X1415(1415),\n" +
- " X1416(1416),\n" +
- " X1417(1417),\n" +
- " X1418(1418),\n" +
- " X1419(1419),\n" +
- " X1420(1420),\n" +
- " X1421(1421),\n" +
- " X1422(1422),\n" +
- " X1423(1423),\n" +
- " X1424(1424),\n" +
- " X1425(1425),\n" +
- " X1426(1426),\n" +
- " X1427(1427),\n" +
- " X1428(1428),\n" +
- " X1429(1429),\n" +
- " X1430(1430),\n" +
- " X1431(1431),\n" +
- " X1432(1432),\n" +
- " X1433(1433),\n" +
- " X1434(1434),\n" +
- " X1435(1435),\n" +
- " X1436(1436),\n" +
- " X1437(1437),\n" +
- " X1438(1438),\n" +
- " X1439(1439),\n" +
- " X1440(1440),\n" +
- " X1441(1441),\n" +
- " X1442(1442),\n" +
- " X1443(1443),\n" +
- " X1444(1444),\n" +
- " X1445(1445),\n" +
- " X1446(1446),\n" +
- " X1447(1447),\n" +
- " X1448(1448),\n" +
- " X1449(1449),\n" +
- " X1450(1450),\n" +
- " X1451(1451),\n" +
- " X1452(1452),\n" +
- " X1453(1453),\n" +
- " X1454(1454),\n" +
- " X1455(1455),\n" +
- " X1456(1456),\n" +
- " X1457(1457),\n" +
- " X1458(1458),\n" +
- " X1459(1459),\n" +
- " X1460(1460),\n" +
- " X1461(1461),\n" +
- " X1462(1462),\n" +
- " X1463(1463),\n" +
- " X1464(1464),\n" +
- " X1465(1465),\n" +
- " X1466(1466),\n" +
- " X1467(1467),\n" +
- " X1468(1468),\n" +
- " X1469(1469),\n" +
- " X1470(1470),\n" +
- " X1471(1471),\n" +
- " X1472(1472),\n" +
- " X1473(1473),\n" +
- " X1474(1474),\n" +
- " X1475(1475),\n" +
- " X1476(1476),\n" +
- " X1477(1477),\n" +
- " X1478(1478),\n" +
- " X1479(1479),\n" +
- " X1480(1480),\n" +
- " X1481(1481),\n" +
- " X1482(1482),\n" +
- " X1483(1483),\n" +
- " X1484(1484),\n" +
- " X1485(1485),\n" +
- " X1486(1486),\n" +
- " X1487(1487),\n" +
- " X1488(1488),\n" +
- " X1489(1489),\n" +
- " X1490(1490),\n" +
- " X1491(1491),\n" +
- " X1492(1492),\n" +
- " X1493(1493),\n" +
- " X1494(1494),\n" +
- " X1495(1495),\n" +
- " X1496(1496),\n" +
- " X1497(1497),\n" +
- " X1498(1498),\n" +
- " X1499(1499),\n" +
- " X1500(1500),\n" +
- " X1501(1501),\n" +
- " X1502(1502),\n" +
- " X1503(1503),\n" +
- " X1504(1504),\n" +
- " X1505(1505),\n" +
- " X1506(1506),\n" +
- " X1507(1507),\n" +
- " X1508(1508),\n" +
- " X1509(1509),\n" +
- " X1510(1510),\n" +
- " X1511(1511),\n" +
- " X1512(1512),\n" +
- " X1513(1513),\n" +
- " X1514(1514),\n" +
- " X1515(1515),\n" +
- " X1516(1516),\n" +
- " X1517(1517),\n" +
- " X1518(1518),\n" +
- " X1519(1519),\n" +
- " X1520(1520),\n" +
- " X1521(1521),\n" +
- " X1522(1522),\n" +
- " X1523(1523),\n" +
- " X1524(1524),\n" +
- " X1525(1525),\n" +
- " X1526(1526),\n" +
- " X1527(1527),\n" +
- " X1528(1528),\n" +
- " X1529(1529),\n" +
- " X1530(1530),\n" +
- " X1531(1531),\n" +
- " X1532(1532),\n" +
- " X1533(1533),\n" +
- " X1534(1534),\n" +
- " X1535(1535),\n" +
- " X1536(1536),\n" +
- " X1537(1537),\n" +
- " X1538(1538),\n" +
- " X1539(1539),\n" +
- " X1540(1540),\n" +
- " X1541(1541),\n" +
- " X1542(1542),\n" +
- " X1543(1543),\n" +
- " X1544(1544),\n" +
- " X1545(1545),\n" +
- " X1546(1546),\n" +
- " X1547(1547),\n" +
- " X1548(1548),\n" +
- " X1549(1549),\n" +
- " X1550(1550),\n" +
- " X1551(1551),\n" +
- " X1552(1552),\n" +
- " X1553(1553),\n" +
- " X1554(1554),\n" +
- " X1555(1555),\n" +
- " X1556(1556),\n" +
- " X1557(1557),\n" +
- " X1558(1558),\n" +
- " X1559(1559),\n" +
- " X1560(1560),\n" +
- " X1561(1561),\n" +
- " X1562(1562),\n" +
- " X1563(1563),\n" +
- " X1564(1564),\n" +
- " X1565(1565),\n" +
- " X1566(1566),\n" +
- " X1567(1567),\n" +
- " X1568(1568),\n" +
- " X1569(1569),\n" +
- " X1570(1570),\n" +
- " X1571(1571),\n" +
- " X1572(1572),\n" +
- " X1573(1573),\n" +
- " X1574(1574),\n" +
- " X1575(1575),\n" +
- " X1576(1576),\n" +
- " X1577(1577),\n" +
- " X1578(1578),\n" +
- " X1579(1579),\n" +
- " X1580(1580),\n" +
- " X1581(1581),\n" +
- " X1582(1582),\n" +
- " X1583(1583),\n" +
- " X1584(1584),\n" +
- " X1585(1585),\n" +
- " X1586(1586),\n" +
- " X1587(1587),\n" +
- " X1588(1588),\n" +
- " X1589(1589),\n" +
- " X1590(1590),\n" +
- " X1591(1591),\n" +
- " X1592(1592),\n" +
- " X1593(1593),\n" +
- " X1594(1594),\n" +
- " X1595(1595),\n" +
- " X1596(1596),\n" +
- " X1597(1597),\n" +
- " X1598(1598),\n" +
- " X1599(1599),\n" +
- " X1600(1600),\n" +
- " X1601(1601),\n" +
- " X1602(1602),\n" +
- " X1603(1603),\n" +
- " X1604(1604),\n" +
- " X1605(1605),\n" +
- " X1606(1606),\n" +
- " X1607(1607),\n" +
- " X1608(1608),\n" +
- " X1609(1609),\n" +
- " X1610(1610),\n" +
- " X1611(1611),\n" +
- " X1612(1612),\n" +
- " X1613(1613),\n" +
- " X1614(1614),\n" +
- " X1615(1615),\n" +
- " X1616(1616),\n" +
- " X1617(1617),\n" +
- " X1618(1618),\n" +
- " X1619(1619),\n" +
- " X1620(1620),\n" +
- " X1621(1621),\n" +
- " X1622(1622),\n" +
- " X1623(1623),\n" +
- " X1624(1624),\n" +
- " X1625(1625),\n" +
- " X1626(1626),\n" +
- " X1627(1627),\n" +
- " X1628(1628),\n" +
- " X1629(1629),\n" +
- " X1630(1630),\n" +
- " X1631(1631),\n" +
- " X1632(1632),\n" +
- " X1633(1633),\n" +
- " X1634(1634),\n" +
- " X1635(1635),\n" +
- " X1636(1636),\n" +
- " X1637(1637),\n" +
- " X1638(1638),\n" +
- " X1639(1639),\n" +
- " X1640(1640),\n" +
- " X1641(1641),\n" +
- " X1642(1642),\n" +
- " X1643(1643),\n" +
- " X1644(1644),\n" +
- " X1645(1645),\n" +
- " X1646(1646),\n" +
- " X1647(1647),\n" +
- " X1648(1648),\n" +
- " X1649(1649),\n" +
- " X1650(1650),\n" +
- " X1651(1651),\n" +
- " X1652(1652),\n" +
- " X1653(1653),\n" +
- " X1654(1654),\n" +
- " X1655(1655),\n" +
- " X1656(1656),\n" +
- " X1657(1657),\n" +
- " X1658(1658),\n" +
- " X1659(1659),\n" +
- " X1660(1660),\n" +
- " X1661(1661),\n" +
- " X1662(1662),\n" +
- " X1663(1663),\n" +
- " X1664(1664),\n" +
- " X1665(1665),\n" +
- " X1666(1666),\n" +
- " X1667(1667),\n" +
- " X1668(1668),\n" +
- " X1669(1669),\n" +
- " X1670(1670),\n" +
- " X1671(1671),\n" +
- " X1672(1672),\n" +
- " X1673(1673),\n" +
- " X1674(1674),\n" +
- " X1675(1675),\n" +
- " X1676(1676),\n" +
- " X1677(1677),\n" +
- " X1678(1678),\n" +
- " X1679(1679),\n" +
- " X1680(1680),\n" +
- " X1681(1681),\n" +
- " X1682(1682),\n" +
- " X1683(1683),\n" +
- " X1684(1684),\n" +
- " X1685(1685),\n" +
- " X1686(1686),\n" +
- " X1687(1687),\n" +
- " X1688(1688),\n" +
- " X1689(1689),\n" +
- " X1690(1690),\n" +
- " X1691(1691),\n" +
- " X1692(1692),\n" +
- " X1693(1693),\n" +
- " X1694(1694),\n" +
- " X1695(1695),\n" +
- " X1696(1696),\n" +
- " X1697(1697),\n" +
- " X1698(1698),\n" +
- " X1699(1699),\n" +
- " X1700(1700),\n" +
- " X1701(1701),\n" +
- " X1702(1702),\n" +
- " X1703(1703),\n" +
- " X1704(1704),\n" +
- " X1705(1705),\n" +
- " X1706(1706),\n" +
- " X1707(1707),\n" +
- " X1708(1708),\n" +
- " X1709(1709),\n" +
- " X1710(1710),\n" +
- " X1711(1711),\n" +
- " X1712(1712),\n" +
- " X1713(1713),\n" +
- " X1714(1714),\n" +
- " X1715(1715),\n" +
- " X1716(1716),\n" +
- " X1717(1717),\n" +
- " X1718(1718),\n" +
- " X1719(1719),\n" +
- " X1720(1720),\n" +
- " X1721(1721),\n" +
- " X1722(1722),\n" +
- " X1723(1723),\n" +
- " X1724(1724),\n" +
- " X1725(1725),\n" +
- " X1726(1726),\n" +
- " X1727(1727),\n" +
- " X1728(1728),\n" +
- " X1729(1729),\n" +
- " X1730(1730),\n" +
- " X1731(1731),\n" +
- " X1732(1732),\n" +
- " X1733(1733),\n" +
- " X1734(1734),\n" +
- " X1735(1735),\n" +
- " X1736(1736),\n" +
- " X1737(1737),\n" +
- " X1738(1738),\n" +
- " X1739(1739),\n" +
- " X1740(1740),\n" +
- " X1741(1741),\n" +
- " X1742(1742),\n" +
- " X1743(1743),\n" +
- " X1744(1744),\n" +
- " X1745(1745),\n" +
- " X1746(1746),\n" +
- " X1747(1747),\n" +
- " X1748(1748),\n" +
- " X1749(1749),\n" +
- " X1750(1750),\n" +
- " X1751(1751),\n" +
- " X1752(1752),\n" +
- " X1753(1753),\n" +
- " X1754(1754),\n" +
- " X1755(1755),\n" +
- " X1756(1756),\n" +
- " X1757(1757),\n" +
- " X1758(1758),\n" +
- " X1759(1759),\n" +
- " X1760(1760),\n" +
- " X1761(1761),\n" +
- " X1762(1762),\n" +
- " X1763(1763),\n" +
- " X1764(1764),\n" +
- " X1765(1765),\n" +
- " X1766(1766),\n" +
- " X1767(1767),\n" +
- " X1768(1768),\n" +
- " X1769(1769),\n" +
- " X1770(1770),\n" +
- " X1771(1771),\n" +
- " X1772(1772),\n" +
- " X1773(1773),\n" +
- " X1774(1774),\n" +
- " X1775(1775),\n" +
- " X1776(1776),\n" +
- " X1777(1777),\n" +
- " X1778(1778),\n" +
- " X1779(1779),\n" +
- " X1780(1780),\n" +
- " X1781(1781),\n" +
- " X1782(1782),\n" +
- " X1783(1783),\n" +
- " X1784(1784),\n" +
- " X1785(1785),\n" +
- " X1786(1786),\n" +
- " X1787(1787),\n" +
- " X1788(1788),\n" +
- " X1789(1789),\n" +
- " X1790(1790),\n" +
- " X1791(1791),\n" +
- " X1792(1792),\n" +
- " X1793(1793),\n" +
- " X1794(1794),\n" +
- " X1795(1795),\n" +
- " X1796(1796),\n" +
- " X1797(1797),\n" +
- " X1798(1798),\n" +
- " X1799(1799),\n" +
- " X1800(1800),\n" +
- " X1801(1801),\n" +
- " X1802(1802),\n" +
- " X1803(1803),\n" +
- " X1804(1804),\n" +
- " X1805(1805),\n" +
- " X1806(1806),\n" +
- " X1807(1807),\n" +
- " X1808(1808),\n" +
- " X1809(1809),\n" +
- " X1810(1810),\n" +
- " X1811(1811),\n" +
- " X1812(1812),\n" +
- " X1813(1813),\n" +
- " X1814(1814),\n" +
- " X1815(1815),\n" +
- " X1816(1816),\n" +
- " X1817(1817),\n" +
- " X1818(1818),\n" +
- " X1819(1819),\n" +
- " X1820(1820),\n" +
- " X1821(1821),\n" +
- " X1822(1822),\n" +
- " X1823(1823),\n" +
- " X1824(1824),\n" +
- " X1825(1825),\n" +
- " X1826(1826),\n" +
- " X1827(1827),\n" +
- " X1828(1828),\n" +
- " X1829(1829),\n" +
- " X1830(1830),\n" +
- " X1831(1831),\n" +
- " X1832(1832),\n" +
- " X1833(1833),\n" +
- " X1834(1834),\n" +
- " X1835(1835),\n" +
- " X1836(1836),\n" +
- " X1837(1837),\n" +
- " X1838(1838),\n" +
- " X1839(1839),\n" +
- " X1840(1840),\n" +
- " X1841(1841),\n" +
- " X1842(1842),\n" +
- " X1843(1843),\n" +
- " X1844(1844),\n" +
- " X1845(1845),\n" +
- " X1846(1846),\n" +
- " X1847(1847),\n" +
- " X1848(1848),\n" +
- " X1849(1849),\n" +
- " X1850(1850),\n" +
- " X1851(1851),\n" +
- " X1852(1852),\n" +
- " X1853(1853),\n" +
- " X1854(1854),\n" +
- " X1855(1855),\n" +
- " X1856(1856),\n" +
- " X1857(1857),\n" +
- " X1858(1858),\n" +
- " X1859(1859),\n" +
- " X1860(1860),\n" +
- " X1861(1861),\n" +
- " X1862(1862),\n" +
- " X1863(1863),\n" +
- " X1864(1864),\n" +
- " X1865(1865),\n" +
- " X1866(1866),\n" +
- " X1867(1867),\n" +
- " X1868(1868),\n" +
- " X1869(1869),\n" +
- " X1870(1870),\n" +
- " X1871(1871),\n" +
- " X1872(1872),\n" +
- " X1873(1873),\n" +
- " X1874(1874),\n" +
- " X1875(1875),\n" +
- " X1876(1876),\n" +
- " X1877(1877),\n" +
- " X1878(1878),\n" +
- " X1879(1879),\n" +
- " X1880(1880),\n" +
- " X1881(1881),\n" +
- " X1882(1882),\n" +
- " X1883(1883),\n" +
- " X1884(1884),\n" +
- " X1885(1885),\n" +
- " X1886(1886),\n" +
- " X1887(1887),\n" +
- " X1888(1888),\n" +
- " X1889(1889),\n" +
- " X1890(1890),\n" +
- " X1891(1891),\n" +
- " X1892(1892),\n" +
- " X1893(1893),\n" +
- " X1894(1894),\n" +
- " X1895(1895),\n" +
- " X1896(1896),\n" +
- " X1897(1897),\n" +
- " X1898(1898),\n" +
- " X1899(1899),\n" +
- " X1900(1900),\n" +
- " X1901(1901),\n" +
- " X1902(1902),\n" +
- " X1903(1903),\n" +
- " X1904(1904),\n" +
- " X1905(1905),\n" +
- " X1906(1906),\n" +
- " X1907(1907),\n" +
- " X1908(1908),\n" +
- " X1909(1909),\n" +
- " X1910(1910),\n" +
- " X1911(1911),\n" +
- " X1912(1912),\n" +
- " X1913(1913),\n" +
- " X1914(1914),\n" +
- " X1915(1915),\n" +
- " X1916(1916),\n" +
- " X1917(1917),\n" +
- " X1918(1918),\n" +
- " X1919(1919),\n" +
- " X1920(1920),\n" +
- " X1921(1921),\n" +
- " X1922(1922),\n" +
- " X1923(1923),\n" +
- " X1924(1924),\n" +
- " X1925(1925),\n" +
- " X1926(1926),\n" +
- " X1927(1927),\n" +
- " X1928(1928),\n" +
- " X1929(1929),\n" +
- " X1930(1930),\n" +
- " X1931(1931),\n" +
- " X1932(1932),\n" +
- " X1933(1933),\n" +
- " X1934(1934),\n" +
- " X1935(1935),\n" +
- " X1936(1936),\n" +
- " X1937(1937),\n" +
- " X1938(1938),\n" +
- " X1939(1939),\n" +
- " X1940(1940),\n" +
- " X1941(1941),\n" +
- " X1942(1942),\n" +
- " X1943(1943),\n" +
- " X1944(1944),\n" +
- " X1945(1945),\n" +
- " X1946(1946),\n" +
- " X1947(1947),\n" +
- " X1948(1948),\n" +
- " X1949(1949),\n" +
- " X1950(1950),\n" +
- " X1951(1951),\n" +
- " X1952(1952),\n" +
- " X1953(1953),\n" +
- " X1954(1954),\n" +
- " X1955(1955),\n" +
- " X1956(1956),\n" +
- " X1957(1957),\n" +
- " X1958(1958),\n" +
- " X1959(1959),\n" +
- " X1960(1960),\n" +
- " X1961(1961),\n" +
- " X1962(1962),\n" +
- " X1963(1963),\n" +
- " X1964(1964),\n" +
- " X1965(1965),\n" +
- " X1966(1966),\n" +
- " X1967(1967),\n" +
- " X1968(1968),\n" +
- " X1969(1969),\n" +
- " X1970(1970),\n" +
- " X1971(1971),\n" +
- " X1972(1972),\n" +
- " X1973(1973),\n" +
- " X1974(1974),\n" +
- " X1975(1975),\n" +
- " X1976(1976),\n" +
- " X1977(1977),\n" +
- " X1978(1978),\n" +
- " X1979(1979),\n" +
- " X1980(1980),\n" +
- " X1981(1981),\n" +
- " X1982(1982),\n" +
- " X1983(1983),\n" +
- " X1984(1984),\n" +
- " X1985(1985),\n" +
- " X1986(1986),\n" +
- " X1987(1987),\n" +
- " X1988(1988),\n" +
- " X1989(1989),\n" +
- " X1990(1990),\n" +
- " X1991(1991),\n" +
- " X1992(1992),\n" +
- " X1993(1993),\n" +
- " X1994(1994),\n" +
- " X1995(1995),\n" +
- " X1996(1996),\n" +
- " X1997(1997),\n" +
- " X1998(1998),\n" +
- " X1999(1999),\n" +
- " X2000(2000),\n" +
- " X2001(2001),\n" +
- " X2002(2002),\n" +
- " ;\n" +
- "\n" +
- " private int value;\n" +
- " X(int i) {\n" +
- " this.value = i;\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " int i = 0;\n" +
- " for (X x : X.values()) {\n" +
- " i++;\n" +
- " System.out.print(x);\n" +
- " }\n" +
- " System.out.print(i);\n" +
- " }\n" +
- " \n" +
- " public String toString() {\n" +
- " return Integer.toString(this.value);\n" +
- " }\n" +
+ "public enum X {\n" +
+ " X1(1),\n" +
+ " X2(2),\n" +
+ " X3(3),\n" +
+ " X4(4),\n" +
+ " X5(5),\n" +
+ " X6(6),\n" +
+ " X7(7),\n" +
+ " X8(8),\n" +
+ " X9(9),\n" +
+ " X10(10),\n" +
+ " X11(11),\n" +
+ " X12(12),\n" +
+ " X13(13),\n" +
+ " X14(14),\n" +
+ " X15(15),\n" +
+ " X16(16),\n" +
+ " X17(17),\n" +
+ " X18(18),\n" +
+ " X19(19),\n" +
+ " X20(20),\n" +
+ " X21(21),\n" +
+ " X22(22),\n" +
+ " X23(23),\n" +
+ " X24(24),\n" +
+ " X25(25),\n" +
+ " X26(26),\n" +
+ " X27(27),\n" +
+ " X28(28),\n" +
+ " X29(29),\n" +
+ " X30(30),\n" +
+ " X31(31),\n" +
+ " X32(32),\n" +
+ " X33(33),\n" +
+ " X34(34),\n" +
+ " X35(35),\n" +
+ " X36(36),\n" +
+ " X37(37),\n" +
+ " X38(38),\n" +
+ " X39(39),\n" +
+ " X40(40),\n" +
+ " X41(41),\n" +
+ " X42(42),\n" +
+ " X43(43),\n" +
+ " X44(44),\n" +
+ " X45(45),\n" +
+ " X46(46),\n" +
+ " X47(47),\n" +
+ " X48(48),\n" +
+ " X49(49),\n" +
+ " X50(50),\n" +
+ " X51(51),\n" +
+ " X52(52),\n" +
+ " X53(53),\n" +
+ " X54(54),\n" +
+ " X55(55),\n" +
+ " X56(56),\n" +
+ " X57(57),\n" +
+ " X58(58),\n" +
+ " X59(59),\n" +
+ " X60(60),\n" +
+ " X61(61),\n" +
+ " X62(62),\n" +
+ " X63(63),\n" +
+ " X64(64),\n" +
+ " X65(65),\n" +
+ " X66(66),\n" +
+ " X67(67),\n" +
+ " X68(68),\n" +
+ " X69(69),\n" +
+ " X70(70),\n" +
+ " X71(71),\n" +
+ " X72(72),\n" +
+ " X73(73),\n" +
+ " X74(74),\n" +
+ " X75(75),\n" +
+ " X76(76),\n" +
+ " X77(77),\n" +
+ " X78(78),\n" +
+ " X79(79),\n" +
+ " X80(80),\n" +
+ " X81(81),\n" +
+ " X82(82),\n" +
+ " X83(83),\n" +
+ " X84(84),\n" +
+ " X85(85),\n" +
+ " X86(86),\n" +
+ " X87(87),\n" +
+ " X88(88),\n" +
+ " X89(89),\n" +
+ " X90(90),\n" +
+ " X91(91),\n" +
+ " X92(92),\n" +
+ " X93(93),\n" +
+ " X94(94),\n" +
+ " X95(95),\n" +
+ " X96(96),\n" +
+ " X97(97),\n" +
+ " X98(98),\n" +
+ " X99(99),\n" +
+ " X100(100),\n" +
+ " X101(101),\n" +
+ " X102(102),\n" +
+ " X103(103),\n" +
+ " X104(104),\n" +
+ " X105(105),\n" +
+ " X106(106),\n" +
+ " X107(107),\n" +
+ " X108(108),\n" +
+ " X109(109),\n" +
+ " X110(110),\n" +
+ " X111(111),\n" +
+ " X112(112),\n" +
+ " X113(113),\n" +
+ " X114(114),\n" +
+ " X115(115),\n" +
+ " X116(116),\n" +
+ " X117(117),\n" +
+ " X118(118),\n" +
+ " X119(119),\n" +
+ " X120(120),\n" +
+ " X121(121),\n" +
+ " X122(122),\n" +
+ " X123(123),\n" +
+ " X124(124),\n" +
+ " X125(125),\n" +
+ " X126(126),\n" +
+ " X127(127),\n" +
+ " X128(128),\n" +
+ " X129(129),\n" +
+ " X130(130),\n" +
+ " X131(131),\n" +
+ " X132(132),\n" +
+ " X133(133),\n" +
+ " X134(134),\n" +
+ " X135(135),\n" +
+ " X136(136),\n" +
+ " X137(137),\n" +
+ " X138(138),\n" +
+ " X139(139),\n" +
+ " X140(140),\n" +
+ " X141(141),\n" +
+ " X142(142),\n" +
+ " X143(143),\n" +
+ " X144(144),\n" +
+ " X145(145),\n" +
+ " X146(146),\n" +
+ " X147(147),\n" +
+ " X148(148),\n" +
+ " X149(149),\n" +
+ " X150(150),\n" +
+ " X151(151),\n" +
+ " X152(152),\n" +
+ " X153(153),\n" +
+ " X154(154),\n" +
+ " X155(155),\n" +
+ " X156(156),\n" +
+ " X157(157),\n" +
+ " X158(158),\n" +
+ " X159(159),\n" +
+ " X160(160),\n" +
+ " X161(161),\n" +
+ " X162(162),\n" +
+ " X163(163),\n" +
+ " X164(164),\n" +
+ " X165(165),\n" +
+ " X166(166),\n" +
+ " X167(167),\n" +
+ " X168(168),\n" +
+ " X169(169),\n" +
+ " X170(170),\n" +
+ " X171(171),\n" +
+ " X172(172),\n" +
+ " X173(173),\n" +
+ " X174(174),\n" +
+ " X175(175),\n" +
+ " X176(176),\n" +
+ " X177(177),\n" +
+ " X178(178),\n" +
+ " X179(179),\n" +
+ " X180(180),\n" +
+ " X181(181),\n" +
+ " X182(182),\n" +
+ " X183(183),\n" +
+ " X184(184),\n" +
+ " X185(185),\n" +
+ " X186(186),\n" +
+ " X187(187),\n" +
+ " X188(188),\n" +
+ " X189(189),\n" +
+ " X190(190),\n" +
+ " X191(191),\n" +
+ " X192(192),\n" +
+ " X193(193),\n" +
+ " X194(194),\n" +
+ " X195(195),\n" +
+ " X196(196),\n" +
+ " X197(197),\n" +
+ " X198(198),\n" +
+ " X199(199),\n" +
+ " X200(200),\n" +
+ " X201(201),\n" +
+ " X202(202),\n" +
+ " X203(203),\n" +
+ " X204(204),\n" +
+ " X205(205),\n" +
+ " X206(206),\n" +
+ " X207(207),\n" +
+ " X208(208),\n" +
+ " X209(209),\n" +
+ " X210(210),\n" +
+ " X211(211),\n" +
+ " X212(212),\n" +
+ " X213(213),\n" +
+ " X214(214),\n" +
+ " X215(215),\n" +
+ " X216(216),\n" +
+ " X217(217),\n" +
+ " X218(218),\n" +
+ " X219(219),\n" +
+ " X220(220),\n" +
+ " X221(221),\n" +
+ " X222(222),\n" +
+ " X223(223),\n" +
+ " X224(224),\n" +
+ " X225(225),\n" +
+ " X226(226),\n" +
+ " X227(227),\n" +
+ " X228(228),\n" +
+ " X229(229),\n" +
+ " X230(230),\n" +
+ " X231(231),\n" +
+ " X232(232),\n" +
+ " X233(233),\n" +
+ " X234(234),\n" +
+ " X235(235),\n" +
+ " X236(236),\n" +
+ " X237(237),\n" +
+ " X238(238),\n" +
+ " X239(239),\n" +
+ " X240(240),\n" +
+ " X241(241),\n" +
+ " X242(242),\n" +
+ " X243(243),\n" +
+ " X244(244),\n" +
+ " X245(245),\n" +
+ " X246(246),\n" +
+ " X247(247),\n" +
+ " X248(248),\n" +
+ " X249(249),\n" +
+ " X250(250),\n" +
+ " X251(251),\n" +
+ " X252(252),\n" +
+ " X253(253),\n" +
+ " X254(254),\n" +
+ " X255(255),\n" +
+ " X256(256),\n" +
+ " X257(257),\n" +
+ " X258(258),\n" +
+ " X259(259),\n" +
+ " X260(260),\n" +
+ " X261(261),\n" +
+ " X262(262),\n" +
+ " X263(263),\n" +
+ " X264(264),\n" +
+ " X265(265),\n" +
+ " X266(266),\n" +
+ " X267(267),\n" +
+ " X268(268),\n" +
+ " X269(269),\n" +
+ " X270(270),\n" +
+ " X271(271),\n" +
+ " X272(272),\n" +
+ " X273(273),\n" +
+ " X274(274),\n" +
+ " X275(275),\n" +
+ " X276(276),\n" +
+ " X277(277),\n" +
+ " X278(278),\n" +
+ " X279(279),\n" +
+ " X280(280),\n" +
+ " X281(281),\n" +
+ " X282(282),\n" +
+ " X283(283),\n" +
+ " X284(284),\n" +
+ " X285(285),\n" +
+ " X286(286),\n" +
+ " X287(287),\n" +
+ " X288(288),\n" +
+ " X289(289),\n" +
+ " X290(290),\n" +
+ " X291(291),\n" +
+ " X292(292),\n" +
+ " X293(293),\n" +
+ " X294(294),\n" +
+ " X295(295),\n" +
+ " X296(296),\n" +
+ " X297(297),\n" +
+ " X298(298),\n" +
+ " X299(299),\n" +
+ " X300(300),\n" +
+ " X301(301),\n" +
+ " X302(302),\n" +
+ " X303(303),\n" +
+ " X304(304),\n" +
+ " X305(305),\n" +
+ " X306(306),\n" +
+ " X307(307),\n" +
+ " X308(308),\n" +
+ " X309(309),\n" +
+ " X310(310),\n" +
+ " X311(311),\n" +
+ " X312(312),\n" +
+ " X313(313),\n" +
+ " X314(314),\n" +
+ " X315(315),\n" +
+ " X316(316),\n" +
+ " X317(317),\n" +
+ " X318(318),\n" +
+ " X319(319),\n" +
+ " X320(320),\n" +
+ " X321(321),\n" +
+ " X322(322),\n" +
+ " X323(323),\n" +
+ " X324(324),\n" +
+ " X325(325),\n" +
+ " X326(326),\n" +
+ " X327(327),\n" +
+ " X328(328),\n" +
+ " X329(329),\n" +
+ " X330(330),\n" +
+ " X331(331),\n" +
+ " X332(332),\n" +
+ " X333(333),\n" +
+ " X334(334),\n" +
+ " X335(335),\n" +
+ " X336(336),\n" +
+ " X337(337),\n" +
+ " X338(338),\n" +
+ " X339(339),\n" +
+ " X340(340),\n" +
+ " X341(341),\n" +
+ " X342(342),\n" +
+ " X343(343),\n" +
+ " X344(344),\n" +
+ " X345(345),\n" +
+ " X346(346),\n" +
+ " X347(347),\n" +
+ " X348(348),\n" +
+ " X349(349),\n" +
+ " X350(350),\n" +
+ " X351(351),\n" +
+ " X352(352),\n" +
+ " X353(353),\n" +
+ " X354(354),\n" +
+ " X355(355),\n" +
+ " X356(356),\n" +
+ " X357(357),\n" +
+ " X358(358),\n" +
+ " X359(359),\n" +
+ " X360(360),\n" +
+ " X361(361),\n" +
+ " X362(362),\n" +
+ " X363(363),\n" +
+ " X364(364),\n" +
+ " X365(365),\n" +
+ " X366(366),\n" +
+ " X367(367),\n" +
+ " X368(368),\n" +
+ " X369(369),\n" +
+ " X370(370),\n" +
+ " X371(371),\n" +
+ " X372(372),\n" +
+ " X373(373),\n" +
+ " X374(374),\n" +
+ " X375(375),\n" +
+ " X376(376),\n" +
+ " X377(377),\n" +
+ " X378(378),\n" +
+ " X379(379),\n" +
+ " X380(380),\n" +
+ " X381(381),\n" +
+ " X382(382),\n" +
+ " X383(383),\n" +
+ " X384(384),\n" +
+ " X385(385),\n" +
+ " X386(386),\n" +
+ " X387(387),\n" +
+ " X388(388),\n" +
+ " X389(389),\n" +
+ " X390(390),\n" +
+ " X391(391),\n" +
+ " X392(392),\n" +
+ " X393(393),\n" +
+ " X394(394),\n" +
+ " X395(395),\n" +
+ " X396(396),\n" +
+ " X397(397),\n" +
+ " X398(398),\n" +
+ " X399(399),\n" +
+ " X400(400),\n" +
+ " X401(401),\n" +
+ " X402(402),\n" +
+ " X403(403),\n" +
+ " X404(404),\n" +
+ " X405(405),\n" +
+ " X406(406),\n" +
+ " X407(407),\n" +
+ " X408(408),\n" +
+ " X409(409),\n" +
+ " X410(410),\n" +
+ " X411(411),\n" +
+ " X412(412),\n" +
+ " X413(413),\n" +
+ " X414(414),\n" +
+ " X415(415),\n" +
+ " X416(416),\n" +
+ " X417(417),\n" +
+ " X418(418),\n" +
+ " X419(419),\n" +
+ " X420(420),\n" +
+ " X421(421),\n" +
+ " X422(422),\n" +
+ " X423(423),\n" +
+ " X424(424),\n" +
+ " X425(425),\n" +
+ " X426(426),\n" +
+ " X427(427),\n" +
+ " X428(428),\n" +
+ " X429(429),\n" +
+ " X430(430),\n" +
+ " X431(431),\n" +
+ " X432(432),\n" +
+ " X433(433),\n" +
+ " X434(434),\n" +
+ " X435(435),\n" +
+ " X436(436),\n" +
+ " X437(437),\n" +
+ " X438(438),\n" +
+ " X439(439),\n" +
+ " X440(440),\n" +
+ " X441(441),\n" +
+ " X442(442),\n" +
+ " X443(443),\n" +
+ " X444(444),\n" +
+ " X445(445),\n" +
+ " X446(446),\n" +
+ " X447(447),\n" +
+ " X448(448),\n" +
+ " X449(449),\n" +
+ " X450(450),\n" +
+ " X451(451),\n" +
+ " X452(452),\n" +
+ " X453(453),\n" +
+ " X454(454),\n" +
+ " X455(455),\n" +
+ " X456(456),\n" +
+ " X457(457),\n" +
+ " X458(458),\n" +
+ " X459(459),\n" +
+ " X460(460),\n" +
+ " X461(461),\n" +
+ " X462(462),\n" +
+ " X463(463),\n" +
+ " X464(464),\n" +
+ " X465(465),\n" +
+ " X466(466),\n" +
+ " X467(467),\n" +
+ " X468(468),\n" +
+ " X469(469),\n" +
+ " X470(470),\n" +
+ " X471(471),\n" +
+ " X472(472),\n" +
+ " X473(473),\n" +
+ " X474(474),\n" +
+ " X475(475),\n" +
+ " X476(476),\n" +
+ " X477(477),\n" +
+ " X478(478),\n" +
+ " X479(479),\n" +
+ " X480(480),\n" +
+ " X481(481),\n" +
+ " X482(482),\n" +
+ " X483(483),\n" +
+ " X484(484),\n" +
+ " X485(485),\n" +
+ " X486(486),\n" +
+ " X487(487),\n" +
+ " X488(488),\n" +
+ " X489(489),\n" +
+ " X490(490),\n" +
+ " X491(491),\n" +
+ " X492(492),\n" +
+ " X493(493),\n" +
+ " X494(494),\n" +
+ " X495(495),\n" +
+ " X496(496),\n" +
+ " X497(497),\n" +
+ " X498(498),\n" +
+ " X499(499),\n" +
+ " X500(500),\n" +
+ " X501(501),\n" +
+ " X502(502),\n" +
+ " X503(503),\n" +
+ " X504(504),\n" +
+ " X505(505),\n" +
+ " X506(506),\n" +
+ " X507(507),\n" +
+ " X508(508),\n" +
+ " X509(509),\n" +
+ " X510(510),\n" +
+ " X511(511),\n" +
+ " X512(512),\n" +
+ " X513(513),\n" +
+ " X514(514),\n" +
+ " X515(515),\n" +
+ " X516(516),\n" +
+ " X517(517),\n" +
+ " X518(518),\n" +
+ " X519(519),\n" +
+ " X520(520),\n" +
+ " X521(521),\n" +
+ " X522(522),\n" +
+ " X523(523),\n" +
+ " X524(524),\n" +
+ " X525(525),\n" +
+ " X526(526),\n" +
+ " X527(527),\n" +
+ " X528(528),\n" +
+ " X529(529),\n" +
+ " X530(530),\n" +
+ " X531(531),\n" +
+ " X532(532),\n" +
+ " X533(533),\n" +
+ " X534(534),\n" +
+ " X535(535),\n" +
+ " X536(536),\n" +
+ " X537(537),\n" +
+ " X538(538),\n" +
+ " X539(539),\n" +
+ " X540(540),\n" +
+ " X541(541),\n" +
+ " X542(542),\n" +
+ " X543(543),\n" +
+ " X544(544),\n" +
+ " X545(545),\n" +
+ " X546(546),\n" +
+ " X547(547),\n" +
+ " X548(548),\n" +
+ " X549(549),\n" +
+ " X550(550),\n" +
+ " X551(551),\n" +
+ " X552(552),\n" +
+ " X553(553),\n" +
+ " X554(554),\n" +
+ " X555(555),\n" +
+ " X556(556),\n" +
+ " X557(557),\n" +
+ " X558(558),\n" +
+ " X559(559),\n" +
+ " X560(560),\n" +
+ " X561(561),\n" +
+ " X562(562),\n" +
+ " X563(563),\n" +
+ " X564(564),\n" +
+ " X565(565),\n" +
+ " X566(566),\n" +
+ " X567(567),\n" +
+ " X568(568),\n" +
+ " X569(569),\n" +
+ " X570(570),\n" +
+ " X571(571),\n" +
+ " X572(572),\n" +
+ " X573(573),\n" +
+ " X574(574),\n" +
+ " X575(575),\n" +
+ " X576(576),\n" +
+ " X577(577),\n" +
+ " X578(578),\n" +
+ " X579(579),\n" +
+ " X580(580),\n" +
+ " X581(581),\n" +
+ " X582(582),\n" +
+ " X583(583),\n" +
+ " X584(584),\n" +
+ " X585(585),\n" +
+ " X586(586),\n" +
+ " X587(587),\n" +
+ " X588(588),\n" +
+ " X589(589),\n" +
+ " X590(590),\n" +
+ " X591(591),\n" +
+ " X592(592),\n" +
+ " X593(593),\n" +
+ " X594(594),\n" +
+ " X595(595),\n" +
+ " X596(596),\n" +
+ " X597(597),\n" +
+ " X598(598),\n" +
+ " X599(599),\n" +
+ " X600(600),\n" +
+ " X601(601),\n" +
+ " X602(602),\n" +
+ " X603(603),\n" +
+ " X604(604),\n" +
+ " X605(605),\n" +
+ " X606(606),\n" +
+ " X607(607),\n" +
+ " X608(608),\n" +
+ " X609(609),\n" +
+ " X610(610),\n" +
+ " X611(611),\n" +
+ " X612(612),\n" +
+ " X613(613),\n" +
+ " X614(614),\n" +
+ " X615(615),\n" +
+ " X616(616),\n" +
+ " X617(617),\n" +
+ " X618(618),\n" +
+ " X619(619),\n" +
+ " X620(620),\n" +
+ " X621(621),\n" +
+ " X622(622),\n" +
+ " X623(623),\n" +
+ " X624(624),\n" +
+ " X625(625),\n" +
+ " X626(626),\n" +
+ " X627(627),\n" +
+ " X628(628),\n" +
+ " X629(629),\n" +
+ " X630(630),\n" +
+ " X631(631),\n" +
+ " X632(632),\n" +
+ " X633(633),\n" +
+ " X634(634),\n" +
+ " X635(635),\n" +
+ " X636(636),\n" +
+ " X637(637),\n" +
+ " X638(638),\n" +
+ " X639(639),\n" +
+ " X640(640),\n" +
+ " X641(641),\n" +
+ " X642(642),\n" +
+ " X643(643),\n" +
+ " X644(644),\n" +
+ " X645(645),\n" +
+ " X646(646),\n" +
+ " X647(647),\n" +
+ " X648(648),\n" +
+ " X649(649),\n" +
+ " X650(650),\n" +
+ " X651(651),\n" +
+ " X652(652),\n" +
+ " X653(653),\n" +
+ " X654(654),\n" +
+ " X655(655),\n" +
+ " X656(656),\n" +
+ " X657(657),\n" +
+ " X658(658),\n" +
+ " X659(659),\n" +
+ " X660(660),\n" +
+ " X661(661),\n" +
+ " X662(662),\n" +
+ " X663(663),\n" +
+ " X664(664),\n" +
+ " X665(665),\n" +
+ " X666(666),\n" +
+ " X667(667),\n" +
+ " X668(668),\n" +
+ " X669(669),\n" +
+ " X670(670),\n" +
+ " X671(671),\n" +
+ " X672(672),\n" +
+ " X673(673),\n" +
+ " X674(674),\n" +
+ " X675(675),\n" +
+ " X676(676),\n" +
+ " X677(677),\n" +
+ " X678(678),\n" +
+ " X679(679),\n" +
+ " X680(680),\n" +
+ " X681(681),\n" +
+ " X682(682),\n" +
+ " X683(683),\n" +
+ " X684(684),\n" +
+ " X685(685),\n" +
+ " X686(686),\n" +
+ " X687(687),\n" +
+ " X688(688),\n" +
+ " X689(689),\n" +
+ " X690(690),\n" +
+ " X691(691),\n" +
+ " X692(692),\n" +
+ " X693(693),\n" +
+ " X694(694),\n" +
+ " X695(695),\n" +
+ " X696(696),\n" +
+ " X697(697),\n" +
+ " X698(698),\n" +
+ " X699(699),\n" +
+ " X700(700),\n" +
+ " X701(701),\n" +
+ " X702(702),\n" +
+ " X703(703),\n" +
+ " X704(704),\n" +
+ " X705(705),\n" +
+ " X706(706),\n" +
+ " X707(707),\n" +
+ " X708(708),\n" +
+ " X709(709),\n" +
+ " X710(710),\n" +
+ " X711(711),\n" +
+ " X712(712),\n" +
+ " X713(713),\n" +
+ " X714(714),\n" +
+ " X715(715),\n" +
+ " X716(716),\n" +
+ " X717(717),\n" +
+ " X718(718),\n" +
+ " X719(719),\n" +
+ " X720(720),\n" +
+ " X721(721),\n" +
+ " X722(722),\n" +
+ " X723(723),\n" +
+ " X724(724),\n" +
+ " X725(725),\n" +
+ " X726(726),\n" +
+ " X727(727),\n" +
+ " X728(728),\n" +
+ " X729(729),\n" +
+ " X730(730),\n" +
+ " X731(731),\n" +
+ " X732(732),\n" +
+ " X733(733),\n" +
+ " X734(734),\n" +
+ " X735(735),\n" +
+ " X736(736),\n" +
+ " X737(737),\n" +
+ " X738(738),\n" +
+ " X739(739),\n" +
+ " X740(740),\n" +
+ " X741(741),\n" +
+ " X742(742),\n" +
+ " X743(743),\n" +
+ " X744(744),\n" +
+ " X745(745),\n" +
+ " X746(746),\n" +
+ " X747(747),\n" +
+ " X748(748),\n" +
+ " X749(749),\n" +
+ " X750(750),\n" +
+ " X751(751),\n" +
+ " X752(752),\n" +
+ " X753(753),\n" +
+ " X754(754),\n" +
+ " X755(755),\n" +
+ " X756(756),\n" +
+ " X757(757),\n" +
+ " X758(758),\n" +
+ " X759(759),\n" +
+ " X760(760),\n" +
+ " X761(761),\n" +
+ " X762(762),\n" +
+ " X763(763),\n" +
+ " X764(764),\n" +
+ " X765(765),\n" +
+ " X766(766),\n" +
+ " X767(767),\n" +
+ " X768(768),\n" +
+ " X769(769),\n" +
+ " X770(770),\n" +
+ " X771(771),\n" +
+ " X772(772),\n" +
+ " X773(773),\n" +
+ " X774(774),\n" +
+ " X775(775),\n" +
+ " X776(776),\n" +
+ " X777(777),\n" +
+ " X778(778),\n" +
+ " X779(779),\n" +
+ " X780(780),\n" +
+ " X781(781),\n" +
+ " X782(782),\n" +
+ " X783(783),\n" +
+ " X784(784),\n" +
+ " X785(785),\n" +
+ " X786(786),\n" +
+ " X787(787),\n" +
+ " X788(788),\n" +
+ " X789(789),\n" +
+ " X790(790),\n" +
+ " X791(791),\n" +
+ " X792(792),\n" +
+ " X793(793),\n" +
+ " X794(794),\n" +
+ " X795(795),\n" +
+ " X796(796),\n" +
+ " X797(797),\n" +
+ " X798(798),\n" +
+ " X799(799),\n" +
+ " X800(800),\n" +
+ " X801(801),\n" +
+ " X802(802),\n" +
+ " X803(803),\n" +
+ " X804(804),\n" +
+ " X805(805),\n" +
+ " X806(806),\n" +
+ " X807(807),\n" +
+ " X808(808),\n" +
+ " X809(809),\n" +
+ " X810(810),\n" +
+ " X811(811),\n" +
+ " X812(812),\n" +
+ " X813(813),\n" +
+ " X814(814),\n" +
+ " X815(815),\n" +
+ " X816(816),\n" +
+ " X817(817),\n" +
+ " X818(818),\n" +
+ " X819(819),\n" +
+ " X820(820),\n" +
+ " X821(821),\n" +
+ " X822(822),\n" +
+ " X823(823),\n" +
+ " X824(824),\n" +
+ " X825(825),\n" +
+ " X826(826),\n" +
+ " X827(827),\n" +
+ " X828(828),\n" +
+ " X829(829),\n" +
+ " X830(830),\n" +
+ " X831(831),\n" +
+ " X832(832),\n" +
+ " X833(833),\n" +
+ " X834(834),\n" +
+ " X835(835),\n" +
+ " X836(836),\n" +
+ " X837(837),\n" +
+ " X838(838),\n" +
+ " X839(839),\n" +
+ " X840(840),\n" +
+ " X841(841),\n" +
+ " X842(842),\n" +
+ " X843(843),\n" +
+ " X844(844),\n" +
+ " X845(845),\n" +
+ " X846(846),\n" +
+ " X847(847),\n" +
+ " X848(848),\n" +
+ " X849(849),\n" +
+ " X850(850),\n" +
+ " X851(851),\n" +
+ " X852(852),\n" +
+ " X853(853),\n" +
+ " X854(854),\n" +
+ " X855(855),\n" +
+ " X856(856),\n" +
+ " X857(857),\n" +
+ " X858(858),\n" +
+ " X859(859),\n" +
+ " X860(860),\n" +
+ " X861(861),\n" +
+ " X862(862),\n" +
+ " X863(863),\n" +
+ " X864(864),\n" +
+ " X865(865),\n" +
+ " X866(866),\n" +
+ " X867(867),\n" +
+ " X868(868),\n" +
+ " X869(869),\n" +
+ " X870(870),\n" +
+ " X871(871),\n" +
+ " X872(872),\n" +
+ " X873(873),\n" +
+ " X874(874),\n" +
+ " X875(875),\n" +
+ " X876(876),\n" +
+ " X877(877),\n" +
+ " X878(878),\n" +
+ " X879(879),\n" +
+ " X880(880),\n" +
+ " X881(881),\n" +
+ " X882(882),\n" +
+ " X883(883),\n" +
+ " X884(884),\n" +
+ " X885(885),\n" +
+ " X886(886),\n" +
+ " X887(887),\n" +
+ " X888(888),\n" +
+ " X889(889),\n" +
+ " X890(890),\n" +
+ " X891(891),\n" +
+ " X892(892),\n" +
+ " X893(893),\n" +
+ " X894(894),\n" +
+ " X895(895),\n" +
+ " X896(896),\n" +
+ " X897(897),\n" +
+ " X898(898),\n" +
+ " X899(899),\n" +
+ " X900(900),\n" +
+ " X901(901),\n" +
+ " X902(902),\n" +
+ " X903(903),\n" +
+ " X904(904),\n" +
+ " X905(905),\n" +
+ " X906(906),\n" +
+ " X907(907),\n" +
+ " X908(908),\n" +
+ " X909(909),\n" +
+ " X910(910),\n" +
+ " X911(911),\n" +
+ " X912(912),\n" +
+ " X913(913),\n" +
+ " X914(914),\n" +
+ " X915(915),\n" +
+ " X916(916),\n" +
+ " X917(917),\n" +
+ " X918(918),\n" +
+ " X919(919),\n" +
+ " X920(920),\n" +
+ " X921(921),\n" +
+ " X922(922),\n" +
+ " X923(923),\n" +
+ " X924(924),\n" +
+ " X925(925),\n" +
+ " X926(926),\n" +
+ " X927(927),\n" +
+ " X928(928),\n" +
+ " X929(929),\n" +
+ " X930(930),\n" +
+ " X931(931),\n" +
+ " X932(932),\n" +
+ " X933(933),\n" +
+ " X934(934),\n" +
+ " X935(935),\n" +
+ " X936(936),\n" +
+ " X937(937),\n" +
+ " X938(938),\n" +
+ " X939(939),\n" +
+ " X940(940),\n" +
+ " X941(941),\n" +
+ " X942(942),\n" +
+ " X943(943),\n" +
+ " X944(944),\n" +
+ " X945(945),\n" +
+ " X946(946),\n" +
+ " X947(947),\n" +
+ " X948(948),\n" +
+ " X949(949),\n" +
+ " X950(950),\n" +
+ " X951(951),\n" +
+ " X952(952),\n" +
+ " X953(953),\n" +
+ " X954(954),\n" +
+ " X955(955),\n" +
+ " X956(956),\n" +
+ " X957(957),\n" +
+ " X958(958),\n" +
+ " X959(959),\n" +
+ " X960(960),\n" +
+ " X961(961),\n" +
+ " X962(962),\n" +
+ " X963(963),\n" +
+ " X964(964),\n" +
+ " X965(965),\n" +
+ " X966(966),\n" +
+ " X967(967),\n" +
+ " X968(968),\n" +
+ " X969(969),\n" +
+ " X970(970),\n" +
+ " X971(971),\n" +
+ " X972(972),\n" +
+ " X973(973),\n" +
+ " X974(974),\n" +
+ " X975(975),\n" +
+ " X976(976),\n" +
+ " X977(977),\n" +
+ " X978(978),\n" +
+ " X979(979),\n" +
+ " X980(980),\n" +
+ " X981(981),\n" +
+ " X982(982),\n" +
+ " X983(983),\n" +
+ " X984(984),\n" +
+ " X985(985),\n" +
+ " X986(986),\n" +
+ " X987(987),\n" +
+ " X988(988),\n" +
+ " X989(989),\n" +
+ " X990(990),\n" +
+ " X991(991),\n" +
+ " X992(992),\n" +
+ " X993(993),\n" +
+ " X994(994),\n" +
+ " X995(995),\n" +
+ " X996(996),\n" +
+ " X997(997),\n" +
+ " X998(998),\n" +
+ " X999(999),\n" +
+ " X1000(1000),\n" +
+ " X1001(1001),\n" +
+ " X1002(1002),\n" +
+ " X1003(1003),\n" +
+ " X1004(1004),\n" +
+ " X1005(1005),\n" +
+ " X1006(1006),\n" +
+ " X1007(1007),\n" +
+ " X1008(1008),\n" +
+ " X1009(1009),\n" +
+ " X1010(1010),\n" +
+ " X1011(1011),\n" +
+ " X1012(1012),\n" +
+ " X1013(1013),\n" +
+ " X1014(1014),\n" +
+ " X1015(1015),\n" +
+ " X1016(1016),\n" +
+ " X1017(1017),\n" +
+ " X1018(1018),\n" +
+ " X1019(1019),\n" +
+ " X1020(1020),\n" +
+ " X1021(1021),\n" +
+ " X1022(1022),\n" +
+ " X1023(1023),\n" +
+ " X1024(1024),\n" +
+ " X1025(1025),\n" +
+ " X1026(1026),\n" +
+ " X1027(1027),\n" +
+ " X1028(1028),\n" +
+ " X1029(1029),\n" +
+ " X1030(1030),\n" +
+ " X1031(1031),\n" +
+ " X1032(1032),\n" +
+ " X1033(1033),\n" +
+ " X1034(1034),\n" +
+ " X1035(1035),\n" +
+ " X1036(1036),\n" +
+ " X1037(1037),\n" +
+ " X1038(1038),\n" +
+ " X1039(1039),\n" +
+ " X1040(1040),\n" +
+ " X1041(1041),\n" +
+ " X1042(1042),\n" +
+ " X1043(1043),\n" +
+ " X1044(1044),\n" +
+ " X1045(1045),\n" +
+ " X1046(1046),\n" +
+ " X1047(1047),\n" +
+ " X1048(1048),\n" +
+ " X1049(1049),\n" +
+ " X1050(1050),\n" +
+ " X1051(1051),\n" +
+ " X1052(1052),\n" +
+ " X1053(1053),\n" +
+ " X1054(1054),\n" +
+ " X1055(1055),\n" +
+ " X1056(1056),\n" +
+ " X1057(1057),\n" +
+ " X1058(1058),\n" +
+ " X1059(1059),\n" +
+ " X1060(1060),\n" +
+ " X1061(1061),\n" +
+ " X1062(1062),\n" +
+ " X1063(1063),\n" +
+ " X1064(1064),\n" +
+ " X1065(1065),\n" +
+ " X1066(1066),\n" +
+ " X1067(1067),\n" +
+ " X1068(1068),\n" +
+ " X1069(1069),\n" +
+ " X1070(1070),\n" +
+ " X1071(1071),\n" +
+ " X1072(1072),\n" +
+ " X1073(1073),\n" +
+ " X1074(1074),\n" +
+ " X1075(1075),\n" +
+ " X1076(1076),\n" +
+ " X1077(1077),\n" +
+ " X1078(1078),\n" +
+ " X1079(1079),\n" +
+ " X1080(1080),\n" +
+ " X1081(1081),\n" +
+ " X1082(1082),\n" +
+ " X1083(1083),\n" +
+ " X1084(1084),\n" +
+ " X1085(1085),\n" +
+ " X1086(1086),\n" +
+ " X1087(1087),\n" +
+ " X1088(1088),\n" +
+ " X1089(1089),\n" +
+ " X1090(1090),\n" +
+ " X1091(1091),\n" +
+ " X1092(1092),\n" +
+ " X1093(1093),\n" +
+ " X1094(1094),\n" +
+ " X1095(1095),\n" +
+ " X1096(1096),\n" +
+ " X1097(1097),\n" +
+ " X1098(1098),\n" +
+ " X1099(1099),\n" +
+ " X1100(1100),\n" +
+ " X1101(1101),\n" +
+ " X1102(1102),\n" +
+ " X1103(1103),\n" +
+ " X1104(1104),\n" +
+ " X1105(1105),\n" +
+ " X1106(1106),\n" +
+ " X1107(1107),\n" +
+ " X1108(1108),\n" +
+ " X1109(1109),\n" +
+ " X1110(1110),\n" +
+ " X1111(1111),\n" +
+ " X1112(1112),\n" +
+ " X1113(1113),\n" +
+ " X1114(1114),\n" +
+ " X1115(1115),\n" +
+ " X1116(1116),\n" +
+ " X1117(1117),\n" +
+ " X1118(1118),\n" +
+ " X1119(1119),\n" +
+ " X1120(1120),\n" +
+ " X1121(1121),\n" +
+ " X1122(1122),\n" +
+ " X1123(1123),\n" +
+ " X1124(1124),\n" +
+ " X1125(1125),\n" +
+ " X1126(1126),\n" +
+ " X1127(1127),\n" +
+ " X1128(1128),\n" +
+ " X1129(1129),\n" +
+ " X1130(1130),\n" +
+ " X1131(1131),\n" +
+ " X1132(1132),\n" +
+ " X1133(1133),\n" +
+ " X1134(1134),\n" +
+ " X1135(1135),\n" +
+ " X1136(1136),\n" +
+ " X1137(1137),\n" +
+ " X1138(1138),\n" +
+ " X1139(1139),\n" +
+ " X1140(1140),\n" +
+ " X1141(1141),\n" +
+ " X1142(1142),\n" +
+ " X1143(1143),\n" +
+ " X1144(1144),\n" +
+ " X1145(1145),\n" +
+ " X1146(1146),\n" +
+ " X1147(1147),\n" +
+ " X1148(1148),\n" +
+ " X1149(1149),\n" +
+ " X1150(1150),\n" +
+ " X1151(1151),\n" +
+ " X1152(1152),\n" +
+ " X1153(1153),\n" +
+ " X1154(1154),\n" +
+ " X1155(1155),\n" +
+ " X1156(1156),\n" +
+ " X1157(1157),\n" +
+ " X1158(1158),\n" +
+ " X1159(1159),\n" +
+ " X1160(1160),\n" +
+ " X1161(1161),\n" +
+ " X1162(1162),\n" +
+ " X1163(1163),\n" +
+ " X1164(1164),\n" +
+ " X1165(1165),\n" +
+ " X1166(1166),\n" +
+ " X1167(1167),\n" +
+ " X1168(1168),\n" +
+ " X1169(1169),\n" +
+ " X1170(1170),\n" +
+ " X1171(1171),\n" +
+ " X1172(1172),\n" +
+ " X1173(1173),\n" +
+ " X1174(1174),\n" +
+ " X1175(1175),\n" +
+ " X1176(1176),\n" +
+ " X1177(1177),\n" +
+ " X1178(1178),\n" +
+ " X1179(1179),\n" +
+ " X1180(1180),\n" +
+ " X1181(1181),\n" +
+ " X1182(1182),\n" +
+ " X1183(1183),\n" +
+ " X1184(1184),\n" +
+ " X1185(1185),\n" +
+ " X1186(1186),\n" +
+ " X1187(1187),\n" +
+ " X1188(1188),\n" +
+ " X1189(1189),\n" +
+ " X1190(1190),\n" +
+ " X1191(1191),\n" +
+ " X1192(1192),\n" +
+ " X1193(1193),\n" +
+ " X1194(1194),\n" +
+ " X1195(1195),\n" +
+ " X1196(1196),\n" +
+ " X1197(1197),\n" +
+ " X1198(1198),\n" +
+ " X1199(1199),\n" +
+ " X1200(1200),\n" +
+ " X1201(1201),\n" +
+ " X1202(1202),\n" +
+ " X1203(1203),\n" +
+ " X1204(1204),\n" +
+ " X1205(1205),\n" +
+ " X1206(1206),\n" +
+ " X1207(1207),\n" +
+ " X1208(1208),\n" +
+ " X1209(1209),\n" +
+ " X1210(1210),\n" +
+ " X1211(1211),\n" +
+ " X1212(1212),\n" +
+ " X1213(1213),\n" +
+ " X1214(1214),\n" +
+ " X1215(1215),\n" +
+ " X1216(1216),\n" +
+ " X1217(1217),\n" +
+ " X1218(1218),\n" +
+ " X1219(1219),\n" +
+ " X1220(1220),\n" +
+ " X1221(1221),\n" +
+ " X1222(1222),\n" +
+ " X1223(1223),\n" +
+ " X1224(1224),\n" +
+ " X1225(1225),\n" +
+ " X1226(1226),\n" +
+ " X1227(1227),\n" +
+ " X1228(1228),\n" +
+ " X1229(1229),\n" +
+ " X1230(1230),\n" +
+ " X1231(1231),\n" +
+ " X1232(1232),\n" +
+ " X1233(1233),\n" +
+ " X1234(1234),\n" +
+ " X1235(1235),\n" +
+ " X1236(1236),\n" +
+ " X1237(1237),\n" +
+ " X1238(1238),\n" +
+ " X1239(1239),\n" +
+ " X1240(1240),\n" +
+ " X1241(1241),\n" +
+ " X1242(1242),\n" +
+ " X1243(1243),\n" +
+ " X1244(1244),\n" +
+ " X1245(1245),\n" +
+ " X1246(1246),\n" +
+ " X1247(1247),\n" +
+ " X1248(1248),\n" +
+ " X1249(1249),\n" +
+ " X1250(1250),\n" +
+ " X1251(1251),\n" +
+ " X1252(1252),\n" +
+ " X1253(1253),\n" +
+ " X1254(1254),\n" +
+ " X1255(1255),\n" +
+ " X1256(1256),\n" +
+ " X1257(1257),\n" +
+ " X1258(1258),\n" +
+ " X1259(1259),\n" +
+ " X1260(1260),\n" +
+ " X1261(1261),\n" +
+ " X1262(1262),\n" +
+ " X1263(1263),\n" +
+ " X1264(1264),\n" +
+ " X1265(1265),\n" +
+ " X1266(1266),\n" +
+ " X1267(1267),\n" +
+ " X1268(1268),\n" +
+ " X1269(1269),\n" +
+ " X1270(1270),\n" +
+ " X1271(1271),\n" +
+ " X1272(1272),\n" +
+ " X1273(1273),\n" +
+ " X1274(1274),\n" +
+ " X1275(1275),\n" +
+ " X1276(1276),\n" +
+ " X1277(1277),\n" +
+ " X1278(1278),\n" +
+ " X1279(1279),\n" +
+ " X1280(1280),\n" +
+ " X1281(1281),\n" +
+ " X1282(1282),\n" +
+ " X1283(1283),\n" +
+ " X1284(1284),\n" +
+ " X1285(1285),\n" +
+ " X1286(1286),\n" +
+ " X1287(1287),\n" +
+ " X1288(1288),\n" +
+ " X1289(1289),\n" +
+ " X1290(1290),\n" +
+ " X1291(1291),\n" +
+ " X1292(1292),\n" +
+ " X1293(1293),\n" +
+ " X1294(1294),\n" +
+ " X1295(1295),\n" +
+ " X1296(1296),\n" +
+ " X1297(1297),\n" +
+ " X1298(1298),\n" +
+ " X1299(1299),\n" +
+ " X1300(1300),\n" +
+ " X1301(1301),\n" +
+ " X1302(1302),\n" +
+ " X1303(1303),\n" +
+ " X1304(1304),\n" +
+ " X1305(1305),\n" +
+ " X1306(1306),\n" +
+ " X1307(1307),\n" +
+ " X1308(1308),\n" +
+ " X1309(1309),\n" +
+ " X1310(1310),\n" +
+ " X1311(1311),\n" +
+ " X1312(1312),\n" +
+ " X1313(1313),\n" +
+ " X1314(1314),\n" +
+ " X1315(1315),\n" +
+ " X1316(1316),\n" +
+ " X1317(1317),\n" +
+ " X1318(1318),\n" +
+ " X1319(1319),\n" +
+ " X1320(1320),\n" +
+ " X1321(1321),\n" +
+ " X1322(1322),\n" +
+ " X1323(1323),\n" +
+ " X1324(1324),\n" +
+ " X1325(1325),\n" +
+ " X1326(1326),\n" +
+ " X1327(1327),\n" +
+ " X1328(1328),\n" +
+ " X1329(1329),\n" +
+ " X1330(1330),\n" +
+ " X1331(1331),\n" +
+ " X1332(1332),\n" +
+ " X1333(1333),\n" +
+ " X1334(1334),\n" +
+ " X1335(1335),\n" +
+ " X1336(1336),\n" +
+ " X1337(1337),\n" +
+ " X1338(1338),\n" +
+ " X1339(1339),\n" +
+ " X1340(1340),\n" +
+ " X1341(1341),\n" +
+ " X1342(1342),\n" +
+ " X1343(1343),\n" +
+ " X1344(1344),\n" +
+ " X1345(1345),\n" +
+ " X1346(1346),\n" +
+ " X1347(1347),\n" +
+ " X1348(1348),\n" +
+ " X1349(1349),\n" +
+ " X1350(1350),\n" +
+ " X1351(1351),\n" +
+ " X1352(1352),\n" +
+ " X1353(1353),\n" +
+ " X1354(1354),\n" +
+ " X1355(1355),\n" +
+ " X1356(1356),\n" +
+ " X1357(1357),\n" +
+ " X1358(1358),\n" +
+ " X1359(1359),\n" +
+ " X1360(1360),\n" +
+ " X1361(1361),\n" +
+ " X1362(1362),\n" +
+ " X1363(1363),\n" +
+ " X1364(1364),\n" +
+ " X1365(1365),\n" +
+ " X1366(1366),\n" +
+ " X1367(1367),\n" +
+ " X1368(1368),\n" +
+ " X1369(1369),\n" +
+ " X1370(1370),\n" +
+ " X1371(1371),\n" +
+ " X1372(1372),\n" +
+ " X1373(1373),\n" +
+ " X1374(1374),\n" +
+ " X1375(1375),\n" +
+ " X1376(1376),\n" +
+ " X1377(1377),\n" +
+ " X1378(1378),\n" +
+ " X1379(1379),\n" +
+ " X1380(1380),\n" +
+ " X1381(1381),\n" +
+ " X1382(1382),\n" +
+ " X1383(1383),\n" +
+ " X1384(1384),\n" +
+ " X1385(1385),\n" +
+ " X1386(1386),\n" +
+ " X1387(1387),\n" +
+ " X1388(1388),\n" +
+ " X1389(1389),\n" +
+ " X1390(1390),\n" +
+ " X1391(1391),\n" +
+ " X1392(1392),\n" +
+ " X1393(1393),\n" +
+ " X1394(1394),\n" +
+ " X1395(1395),\n" +
+ " X1396(1396),\n" +
+ " X1397(1397),\n" +
+ " X1398(1398),\n" +
+ " X1399(1399),\n" +
+ " X1400(1400),\n" +
+ " X1401(1401),\n" +
+ " X1402(1402),\n" +
+ " X1403(1403),\n" +
+ " X1404(1404),\n" +
+ " X1405(1405),\n" +
+ " X1406(1406),\n" +
+ " X1407(1407),\n" +
+ " X1408(1408),\n" +
+ " X1409(1409),\n" +
+ " X1410(1410),\n" +
+ " X1411(1411),\n" +
+ " X1412(1412),\n" +
+ " X1413(1413),\n" +
+ " X1414(1414),\n" +
+ " X1415(1415),\n" +
+ " X1416(1416),\n" +
+ " X1417(1417),\n" +
+ " X1418(1418),\n" +
+ " X1419(1419),\n" +
+ " X1420(1420),\n" +
+ " X1421(1421),\n" +
+ " X1422(1422),\n" +
+ " X1423(1423),\n" +
+ " X1424(1424),\n" +
+ " X1425(1425),\n" +
+ " X1426(1426),\n" +
+ " X1427(1427),\n" +
+ " X1428(1428),\n" +
+ " X1429(1429),\n" +
+ " X1430(1430),\n" +
+ " X1431(1431),\n" +
+ " X1432(1432),\n" +
+ " X1433(1433),\n" +
+ " X1434(1434),\n" +
+ " X1435(1435),\n" +
+ " X1436(1436),\n" +
+ " X1437(1437),\n" +
+ " X1438(1438),\n" +
+ " X1439(1439),\n" +
+ " X1440(1440),\n" +
+ " X1441(1441),\n" +
+ " X1442(1442),\n" +
+ " X1443(1443),\n" +
+ " X1444(1444),\n" +
+ " X1445(1445),\n" +
+ " X1446(1446),\n" +
+ " X1447(1447),\n" +
+ " X1448(1448),\n" +
+ " X1449(1449),\n" +
+ " X1450(1450),\n" +
+ " X1451(1451),\n" +
+ " X1452(1452),\n" +
+ " X1453(1453),\n" +
+ " X1454(1454),\n" +
+ " X1455(1455),\n" +
+ " X1456(1456),\n" +
+ " X1457(1457),\n" +
+ " X1458(1458),\n" +
+ " X1459(1459),\n" +
+ " X1460(1460),\n" +
+ " X1461(1461),\n" +
+ " X1462(1462),\n" +
+ " X1463(1463),\n" +
+ " X1464(1464),\n" +
+ " X1465(1465),\n" +
+ " X1466(1466),\n" +
+ " X1467(1467),\n" +
+ " X1468(1468),\n" +
+ " X1469(1469),\n" +
+ " X1470(1470),\n" +
+ " X1471(1471),\n" +
+ " X1472(1472),\n" +
+ " X1473(1473),\n" +
+ " X1474(1474),\n" +
+ " X1475(1475),\n" +
+ " X1476(1476),\n" +
+ " X1477(1477),\n" +
+ " X1478(1478),\n" +
+ " X1479(1479),\n" +
+ " X1480(1480),\n" +
+ " X1481(1481),\n" +
+ " X1482(1482),\n" +
+ " X1483(1483),\n" +
+ " X1484(1484),\n" +
+ " X1485(1485),\n" +
+ " X1486(1486),\n" +
+ " X1487(1487),\n" +
+ " X1488(1488),\n" +
+ " X1489(1489),\n" +
+ " X1490(1490),\n" +
+ " X1491(1491),\n" +
+ " X1492(1492),\n" +
+ " X1493(1493),\n" +
+ " X1494(1494),\n" +
+ " X1495(1495),\n" +
+ " X1496(1496),\n" +
+ " X1497(1497),\n" +
+ " X1498(1498),\n" +
+ " X1499(1499),\n" +
+ " X1500(1500),\n" +
+ " X1501(1501),\n" +
+ " X1502(1502),\n" +
+ " X1503(1503),\n" +
+ " X1504(1504),\n" +
+ " X1505(1505),\n" +
+ " X1506(1506),\n" +
+ " X1507(1507),\n" +
+ " X1508(1508),\n" +
+ " X1509(1509),\n" +
+ " X1510(1510),\n" +
+ " X1511(1511),\n" +
+ " X1512(1512),\n" +
+ " X1513(1513),\n" +
+ " X1514(1514),\n" +
+ " X1515(1515),\n" +
+ " X1516(1516),\n" +
+ " X1517(1517),\n" +
+ " X1518(1518),\n" +
+ " X1519(1519),\n" +
+ " X1520(1520),\n" +
+ " X1521(1521),\n" +
+ " X1522(1522),\n" +
+ " X1523(1523),\n" +
+ " X1524(1524),\n" +
+ " X1525(1525),\n" +
+ " X1526(1526),\n" +
+ " X1527(1527),\n" +
+ " X1528(1528),\n" +
+ " X1529(1529),\n" +
+ " X1530(1530),\n" +
+ " X1531(1531),\n" +
+ " X1532(1532),\n" +
+ " X1533(1533),\n" +
+ " X1534(1534),\n" +
+ " X1535(1535),\n" +
+ " X1536(1536),\n" +
+ " X1537(1537),\n" +
+ " X1538(1538),\n" +
+ " X1539(1539),\n" +
+ " X1540(1540),\n" +
+ " X1541(1541),\n" +
+ " X1542(1542),\n" +
+ " X1543(1543),\n" +
+ " X1544(1544),\n" +
+ " X1545(1545),\n" +
+ " X1546(1546),\n" +
+ " X1547(1547),\n" +
+ " X1548(1548),\n" +
+ " X1549(1549),\n" +
+ " X1550(1550),\n" +
+ " X1551(1551),\n" +
+ " X1552(1552),\n" +
+ " X1553(1553),\n" +
+ " X1554(1554),\n" +
+ " X1555(1555),\n" +
+ " X1556(1556),\n" +
+ " X1557(1557),\n" +
+ " X1558(1558),\n" +
+ " X1559(1559),\n" +
+ " X1560(1560),\n" +
+ " X1561(1561),\n" +
+ " X1562(1562),\n" +
+ " X1563(1563),\n" +
+ " X1564(1564),\n" +
+ " X1565(1565),\n" +
+ " X1566(1566),\n" +
+ " X1567(1567),\n" +
+ " X1568(1568),\n" +
+ " X1569(1569),\n" +
+ " X1570(1570),\n" +
+ " X1571(1571),\n" +
+ " X1572(1572),\n" +
+ " X1573(1573),\n" +
+ " X1574(1574),\n" +
+ " X1575(1575),\n" +
+ " X1576(1576),\n" +
+ " X1577(1577),\n" +
+ " X1578(1578),\n" +
+ " X1579(1579),\n" +
+ " X1580(1580),\n" +
+ " X1581(1581),\n" +
+ " X1582(1582),\n" +
+ " X1583(1583),\n" +
+ " X1584(1584),\n" +
+ " X1585(1585),\n" +
+ " X1586(1586),\n" +
+ " X1587(1587),\n" +
+ " X1588(1588),\n" +
+ " X1589(1589),\n" +
+ " X1590(1590),\n" +
+ " X1591(1591),\n" +
+ " X1592(1592),\n" +
+ " X1593(1593),\n" +
+ " X1594(1594),\n" +
+ " X1595(1595),\n" +
+ " X1596(1596),\n" +
+ " X1597(1597),\n" +
+ " X1598(1598),\n" +
+ " X1599(1599),\n" +
+ " X1600(1600),\n" +
+ " X1601(1601),\n" +
+ " X1602(1602),\n" +
+ " X1603(1603),\n" +
+ " X1604(1604),\n" +
+ " X1605(1605),\n" +
+ " X1606(1606),\n" +
+ " X1607(1607),\n" +
+ " X1608(1608),\n" +
+ " X1609(1609),\n" +
+ " X1610(1610),\n" +
+ " X1611(1611),\n" +
+ " X1612(1612),\n" +
+ " X1613(1613),\n" +
+ " X1614(1614),\n" +
+ " X1615(1615),\n" +
+ " X1616(1616),\n" +
+ " X1617(1617),\n" +
+ " X1618(1618),\n" +
+ " X1619(1619),\n" +
+ " X1620(1620),\n" +
+ " X1621(1621),\n" +
+ " X1622(1622),\n" +
+ " X1623(1623),\n" +
+ " X1624(1624),\n" +
+ " X1625(1625),\n" +
+ " X1626(1626),\n" +
+ " X1627(1627),\n" +
+ " X1628(1628),\n" +
+ " X1629(1629),\n" +
+ " X1630(1630),\n" +
+ " X1631(1631),\n" +
+ " X1632(1632),\n" +
+ " X1633(1633),\n" +
+ " X1634(1634),\n" +
+ " X1635(1635),\n" +
+ " X1636(1636),\n" +
+ " X1637(1637),\n" +
+ " X1638(1638),\n" +
+ " X1639(1639),\n" +
+ " X1640(1640),\n" +
+ " X1641(1641),\n" +
+ " X1642(1642),\n" +
+ " X1643(1643),\n" +
+ " X1644(1644),\n" +
+ " X1645(1645),\n" +
+ " X1646(1646),\n" +
+ " X1647(1647),\n" +
+ " X1648(1648),\n" +
+ " X1649(1649),\n" +
+ " X1650(1650),\n" +
+ " X1651(1651),\n" +
+ " X1652(1652),\n" +
+ " X1653(1653),\n" +
+ " X1654(1654),\n" +
+ " X1655(1655),\n" +
+ " X1656(1656),\n" +
+ " X1657(1657),\n" +
+ " X1658(1658),\n" +
+ " X1659(1659),\n" +
+ " X1660(1660),\n" +
+ " X1661(1661),\n" +
+ " X1662(1662),\n" +
+ " X1663(1663),\n" +
+ " X1664(1664),\n" +
+ " X1665(1665),\n" +
+ " X1666(1666),\n" +
+ " X1667(1667),\n" +
+ " X1668(1668),\n" +
+ " X1669(1669),\n" +
+ " X1670(1670),\n" +
+ " X1671(1671),\n" +
+ " X1672(1672),\n" +
+ " X1673(1673),\n" +
+ " X1674(1674),\n" +
+ " X1675(1675),\n" +
+ " X1676(1676),\n" +
+ " X1677(1677),\n" +
+ " X1678(1678),\n" +
+ " X1679(1679),\n" +
+ " X1680(1680),\n" +
+ " X1681(1681),\n" +
+ " X1682(1682),\n" +
+ " X1683(1683),\n" +
+ " X1684(1684),\n" +
+ " X1685(1685),\n" +
+ " X1686(1686),\n" +
+ " X1687(1687),\n" +
+ " X1688(1688),\n" +
+ " X1689(1689),\n" +
+ " X1690(1690),\n" +
+ " X1691(1691),\n" +
+ " X1692(1692),\n" +
+ " X1693(1693),\n" +
+ " X1694(1694),\n" +
+ " X1695(1695),\n" +
+ " X1696(1696),\n" +
+ " X1697(1697),\n" +
+ " X1698(1698),\n" +
+ " X1699(1699),\n" +
+ " X1700(1700),\n" +
+ " X1701(1701),\n" +
+ " X1702(1702),\n" +
+ " X1703(1703),\n" +
+ " X1704(1704),\n" +
+ " X1705(1705),\n" +
+ " X1706(1706),\n" +
+ " X1707(1707),\n" +
+ " X1708(1708),\n" +
+ " X1709(1709),\n" +
+ " X1710(1710),\n" +
+ " X1711(1711),\n" +
+ " X1712(1712),\n" +
+ " X1713(1713),\n" +
+ " X1714(1714),\n" +
+ " X1715(1715),\n" +
+ " X1716(1716),\n" +
+ " X1717(1717),\n" +
+ " X1718(1718),\n" +
+ " X1719(1719),\n" +
+ " X1720(1720),\n" +
+ " X1721(1721),\n" +
+ " X1722(1722),\n" +
+ " X1723(1723),\n" +
+ " X1724(1724),\n" +
+ " X1725(1725),\n" +
+ " X1726(1726),\n" +
+ " X1727(1727),\n" +
+ " X1728(1728),\n" +
+ " X1729(1729),\n" +
+ " X1730(1730),\n" +
+ " X1731(1731),\n" +
+ " X1732(1732),\n" +
+ " X1733(1733),\n" +
+ " X1734(1734),\n" +
+ " X1735(1735),\n" +
+ " X1736(1736),\n" +
+ " X1737(1737),\n" +
+ " X1738(1738),\n" +
+ " X1739(1739),\n" +
+ " X1740(1740),\n" +
+ " X1741(1741),\n" +
+ " X1742(1742),\n" +
+ " X1743(1743),\n" +
+ " X1744(1744),\n" +
+ " X1745(1745),\n" +
+ " X1746(1746),\n" +
+ " X1747(1747),\n" +
+ " X1748(1748),\n" +
+ " X1749(1749),\n" +
+ " X1750(1750),\n" +
+ " X1751(1751),\n" +
+ " X1752(1752),\n" +
+ " X1753(1753),\n" +
+ " X1754(1754),\n" +
+ " X1755(1755),\n" +
+ " X1756(1756),\n" +
+ " X1757(1757),\n" +
+ " X1758(1758),\n" +
+ " X1759(1759),\n" +
+ " X1760(1760),\n" +
+ " X1761(1761),\n" +
+ " X1762(1762),\n" +
+ " X1763(1763),\n" +
+ " X1764(1764),\n" +
+ " X1765(1765),\n" +
+ " X1766(1766),\n" +
+ " X1767(1767),\n" +
+ " X1768(1768),\n" +
+ " X1769(1769),\n" +
+ " X1770(1770),\n" +
+ " X1771(1771),\n" +
+ " X1772(1772),\n" +
+ " X1773(1773),\n" +
+ " X1774(1774),\n" +
+ " X1775(1775),\n" +
+ " X1776(1776),\n" +
+ " X1777(1777),\n" +
+ " X1778(1778),\n" +
+ " X1779(1779),\n" +
+ " X1780(1780),\n" +
+ " X1781(1781),\n" +
+ " X1782(1782),\n" +
+ " X1783(1783),\n" +
+ " X1784(1784),\n" +
+ " X1785(1785),\n" +
+ " X1786(1786),\n" +
+ " X1787(1787),\n" +
+ " X1788(1788),\n" +
+ " X1789(1789),\n" +
+ " X1790(1790),\n" +
+ " X1791(1791),\n" +
+ " X1792(1792),\n" +
+ " X1793(1793),\n" +
+ " X1794(1794),\n" +
+ " X1795(1795),\n" +
+ " X1796(1796),\n" +
+ " X1797(1797),\n" +
+ " X1798(1798),\n" +
+ " X1799(1799),\n" +
+ " X1800(1800),\n" +
+ " X1801(1801),\n" +
+ " X1802(1802),\n" +
+ " X1803(1803),\n" +
+ " X1804(1804),\n" +
+ " X1805(1805),\n" +
+ " X1806(1806),\n" +
+ " X1807(1807),\n" +
+ " X1808(1808),\n" +
+ " X1809(1809),\n" +
+ " X1810(1810),\n" +
+ " X1811(1811),\n" +
+ " X1812(1812),\n" +
+ " X1813(1813),\n" +
+ " X1814(1814),\n" +
+ " X1815(1815),\n" +
+ " X1816(1816),\n" +
+ " X1817(1817),\n" +
+ " X1818(1818),\n" +
+ " X1819(1819),\n" +
+ " X1820(1820),\n" +
+ " X1821(1821),\n" +
+ " X1822(1822),\n" +
+ " X1823(1823),\n" +
+ " X1824(1824),\n" +
+ " X1825(1825),\n" +
+ " X1826(1826),\n" +
+ " X1827(1827),\n" +
+ " X1828(1828),\n" +
+ " X1829(1829),\n" +
+ " X1830(1830),\n" +
+ " X1831(1831),\n" +
+ " X1832(1832),\n" +
+ " X1833(1833),\n" +
+ " X1834(1834),\n" +
+ " X1835(1835),\n" +
+ " X1836(1836),\n" +
+ " X1837(1837),\n" +
+ " X1838(1838),\n" +
+ " X1839(1839),\n" +
+ " X1840(1840),\n" +
+ " X1841(1841),\n" +
+ " X1842(1842),\n" +
+ " X1843(1843),\n" +
+ " X1844(1844),\n" +
+ " X1845(1845),\n" +
+ " X1846(1846),\n" +
+ " X1847(1847),\n" +
+ " X1848(1848),\n" +
+ " X1849(1849),\n" +
+ " X1850(1850),\n" +
+ " X1851(1851),\n" +
+ " X1852(1852),\n" +
+ " X1853(1853),\n" +
+ " X1854(1854),\n" +
+ " X1855(1855),\n" +
+ " X1856(1856),\n" +
+ " X1857(1857),\n" +
+ " X1858(1858),\n" +
+ " X1859(1859),\n" +
+ " X1860(1860),\n" +
+ " X1861(1861),\n" +
+ " X1862(1862),\n" +
+ " X1863(1863),\n" +
+ " X1864(1864),\n" +
+ " X1865(1865),\n" +
+ " X1866(1866),\n" +
+ " X1867(1867),\n" +
+ " X1868(1868),\n" +
+ " X1869(1869),\n" +
+ " X1870(1870),\n" +
+ " X1871(1871),\n" +
+ " X1872(1872),\n" +
+ " X1873(1873),\n" +
+ " X1874(1874),\n" +
+ " X1875(1875),\n" +
+ " X1876(1876),\n" +
+ " X1877(1877),\n" +
+ " X1878(1878),\n" +
+ " X1879(1879),\n" +
+ " X1880(1880),\n" +
+ " X1881(1881),\n" +
+ " X1882(1882),\n" +
+ " X1883(1883),\n" +
+ " X1884(1884),\n" +
+ " X1885(1885),\n" +
+ " X1886(1886),\n" +
+ " X1887(1887),\n" +
+ " X1888(1888),\n" +
+ " X1889(1889),\n" +
+ " X1890(1890),\n" +
+ " X1891(1891),\n" +
+ " X1892(1892),\n" +
+ " X1893(1893),\n" +
+ " X1894(1894),\n" +
+ " X1895(1895),\n" +
+ " X1896(1896),\n" +
+ " X1897(1897),\n" +
+ " X1898(1898),\n" +
+ " X1899(1899),\n" +
+ " X1900(1900),\n" +
+ " X1901(1901),\n" +
+ " X1902(1902),\n" +
+ " X1903(1903),\n" +
+ " X1904(1904),\n" +
+ " X1905(1905),\n" +
+ " X1906(1906),\n" +
+ " X1907(1907),\n" +
+ " X1908(1908),\n" +
+ " X1909(1909),\n" +
+ " X1910(1910),\n" +
+ " X1911(1911),\n" +
+ " X1912(1912),\n" +
+ " X1913(1913),\n" +
+ " X1914(1914),\n" +
+ " X1915(1915),\n" +
+ " X1916(1916),\n" +
+ " X1917(1917),\n" +
+ " X1918(1918),\n" +
+ " X1919(1919),\n" +
+ " X1920(1920),\n" +
+ " X1921(1921),\n" +
+ " X1922(1922),\n" +
+ " X1923(1923),\n" +
+ " X1924(1924),\n" +
+ " X1925(1925),\n" +
+ " X1926(1926),\n" +
+ " X1927(1927),\n" +
+ " X1928(1928),\n" +
+ " X1929(1929),\n" +
+ " X1930(1930),\n" +
+ " X1931(1931),\n" +
+ " X1932(1932),\n" +
+ " X1933(1933),\n" +
+ " X1934(1934),\n" +
+ " X1935(1935),\n" +
+ " X1936(1936),\n" +
+ " X1937(1937),\n" +
+ " X1938(1938),\n" +
+ " X1939(1939),\n" +
+ " X1940(1940),\n" +
+ " X1941(1941),\n" +
+ " X1942(1942),\n" +
+ " X1943(1943),\n" +
+ " X1944(1944),\n" +
+ " X1945(1945),\n" +
+ " X1946(1946),\n" +
+ " X1947(1947),\n" +
+ " X1948(1948),\n" +
+ " X1949(1949),\n" +
+ " X1950(1950),\n" +
+ " X1951(1951),\n" +
+ " X1952(1952),\n" +
+ " X1953(1953),\n" +
+ " X1954(1954),\n" +
+ " X1955(1955),\n" +
+ " X1956(1956),\n" +
+ " X1957(1957),\n" +
+ " X1958(1958),\n" +
+ " X1959(1959),\n" +
+ " X1960(1960),\n" +
+ " X1961(1961),\n" +
+ " X1962(1962),\n" +
+ " X1963(1963),\n" +
+ " X1964(1964),\n" +
+ " X1965(1965),\n" +
+ " X1966(1966),\n" +
+ " X1967(1967),\n" +
+ " X1968(1968),\n" +
+ " X1969(1969),\n" +
+ " X1970(1970),\n" +
+ " X1971(1971),\n" +
+ " X1972(1972),\n" +
+ " X1973(1973),\n" +
+ " X1974(1974),\n" +
+ " X1975(1975),\n" +
+ " X1976(1976),\n" +
+ " X1977(1977),\n" +
+ " X1978(1978),\n" +
+ " X1979(1979),\n" +
+ " X1980(1980),\n" +
+ " X1981(1981),\n" +
+ " X1982(1982),\n" +
+ " X1983(1983),\n" +
+ " X1984(1984),\n" +
+ " X1985(1985),\n" +
+ " X1986(1986),\n" +
+ " X1987(1987),\n" +
+ " X1988(1988),\n" +
+ " X1989(1989),\n" +
+ " X1990(1990),\n" +
+ " X1991(1991),\n" +
+ " X1992(1992),\n" +
+ " X1993(1993),\n" +
+ " X1994(1994),\n" +
+ " X1995(1995),\n" +
+ " X1996(1996),\n" +
+ " X1997(1997),\n" +
+ " X1998(1998),\n" +
+ " X1999(1999),\n" +
+ " X2000(2000),\n" +
+ " X2001(2001),\n" +
+ " X2002(2002),\n" +
+ " ;\n" +
+ "\n" +
+ " private int value;\n" +
+ " X(int i) {\n" +
+ " this.value = i;\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " int i = 0;\n" +
+ " for (X x : X.values()) {\n" +
+ " i++;\n" +
+ " System.out.print(x);\n" +
+ " }\n" +
+ " System.out.print(i);\n" +
+ " }\n" +
+ " \n" +
+ " public String toString() {\n" +
+ " return Integer.toString(this.value);\n" +
+ " }\n" +
"}"
},
buffer.toString());
@@ -18661,2033 +18661,2033 @@ public void test0019() {
this.runConformTest(
new String[] {
"X.java",
- "import java.util.HashMap;\n" +
- "import java.util.Map;\n" +
- "\n" +
- "public enum X {\n" +
- " C0,\n" +
- " C1,\n" +
- " C2,\n" +
- " C3,\n" +
- " C4,\n" +
- " C5,\n" +
- " C6,\n" +
- " C7,\n" +
- " C8,\n" +
- " C9,\n" +
- " C10,\n" +
- " C11,\n" +
- " C12,\n" +
- " C13,\n" +
- " C14,\n" +
- " C15,\n" +
- " C16,\n" +
- " C17,\n" +
- " C18,\n" +
- " C19,\n" +
- " C20,\n" +
- " C21,\n" +
- " C22,\n" +
- " C23,\n" +
- " C24,\n" +
- " C25,\n" +
- " C26,\n" +
- " C27,\n" +
- " C28,\n" +
- " C29,\n" +
- " C30,\n" +
- " C31,\n" +
- " C32,\n" +
- " C33,\n" +
- " C34,\n" +
- " C35,\n" +
- " C36,\n" +
- " C37,\n" +
- " C38,\n" +
- " C39,\n" +
- " C40,\n" +
- " C41,\n" +
- " C42,\n" +
- " C43,\n" +
- " C44,\n" +
- " C45,\n" +
- " C46,\n" +
- " C47,\n" +
- " C48,\n" +
- " C49,\n" +
- " C50,\n" +
- " C51,\n" +
- " C52,\n" +
- " C53,\n" +
- " C54,\n" +
- " C55,\n" +
- " C56,\n" +
- " C57,\n" +
- " C58,\n" +
- " C59,\n" +
- " C60,\n" +
- " C61,\n" +
- " C62,\n" +
- " C63,\n" +
- " C64,\n" +
- " C65,\n" +
- " C66,\n" +
- " C67,\n" +
- " C68,\n" +
- " C69,\n" +
- " C70,\n" +
- " C71,\n" +
- " C72,\n" +
- " C73,\n" +
- " C74,\n" +
- " C75,\n" +
- " C76,\n" +
- " C77,\n" +
- " C78,\n" +
- " C79,\n" +
- " C80,\n" +
- " C81,\n" +
- " C82,\n" +
- " C83,\n" +
- " C84,\n" +
- " C85,\n" +
- " C86,\n" +
- " C87,\n" +
- " C88,\n" +
- " C89,\n" +
- " C90,\n" +
- " C91,\n" +
- " C92,\n" +
- " C93,\n" +
- " C94,\n" +
- " C95,\n" +
- " C96,\n" +
- " C97,\n" +
- " C98,\n" +
- " C99,\n" +
- " C100,\n" +
- " C101,\n" +
- " C102,\n" +
- " C103,\n" +
- " C104,\n" +
- " C105,\n" +
- " C106,\n" +
- " C107,\n" +
- " C108,\n" +
- " C109,\n" +
- " C110,\n" +
- " C111,\n" +
- " C112,\n" +
- " C113,\n" +
- " C114,\n" +
- " C115,\n" +
- " C116,\n" +
- " C117,\n" +
- " C118,\n" +
- " C119,\n" +
- " C120,\n" +
- " C121,\n" +
- " C122,\n" +
- " C123,\n" +
- " C124,\n" +
- " C125,\n" +
- " C126,\n" +
- " C127,\n" +
- " C128,\n" +
- " C129,\n" +
- " C130,\n" +
- " C131,\n" +
- " C132,\n" +
- " C133,\n" +
- " C134,\n" +
- " C135,\n" +
- " C136,\n" +
- " C137,\n" +
- " C138,\n" +
- " C139,\n" +
- " C140,\n" +
- " C141,\n" +
- " C142,\n" +
- " C143,\n" +
- " C144,\n" +
- " C145,\n" +
- " C146,\n" +
- " C147,\n" +
- " C148,\n" +
- " C149,\n" +
- " C150,\n" +
- " C151,\n" +
- " C152,\n" +
- " C153,\n" +
- " C154,\n" +
- " C155,\n" +
- " C156,\n" +
- " C157,\n" +
- " C158,\n" +
- " C159,\n" +
- " C160,\n" +
- " C161,\n" +
- " C162,\n" +
- " C163,\n" +
- " C164,\n" +
- " C165,\n" +
- " C166,\n" +
- " C167,\n" +
- " C168,\n" +
- " C169,\n" +
- " C170,\n" +
- " C171,\n" +
- " C172,\n" +
- " C173,\n" +
- " C174,\n" +
- " C175,\n" +
- " C176,\n" +
- " C177,\n" +
- " C178,\n" +
- " C179,\n" +
- " C180,\n" +
- " C181,\n" +
- " C182,\n" +
- " C183,\n" +
- " C184,\n" +
- " C185,\n" +
- " C186,\n" +
- " C187,\n" +
- " C188,\n" +
- " C189,\n" +
- " C190,\n" +
- " C191,\n" +
- " C192,\n" +
- " C193,\n" +
- " C194,\n" +
- " C195,\n" +
- " C196,\n" +
- " C197,\n" +
- " C198,\n" +
- " C199,\n" +
- " C200,\n" +
- " C201,\n" +
- " C202,\n" +
- " C203,\n" +
- " C204,\n" +
- " C205,\n" +
- " C206,\n" +
- " C207,\n" +
- " C208,\n" +
- " C209,\n" +
- " C210,\n" +
- " C211,\n" +
- " C212,\n" +
- " C213,\n" +
- " C214,\n" +
- " C215,\n" +
- " C216,\n" +
- " C217,\n" +
- " C218,\n" +
- " C219,\n" +
- " C220,\n" +
- " C221,\n" +
- " C222,\n" +
- " C223,\n" +
- " C224,\n" +
- " C225,\n" +
- " C226,\n" +
- " C227,\n" +
- " C228,\n" +
- " C229,\n" +
- " C230,\n" +
- " C231,\n" +
- " C232,\n" +
- " C233,\n" +
- " C234,\n" +
- " C235,\n" +
- " C236,\n" +
- " C237,\n" +
- " C238,\n" +
- " C239,\n" +
- " C240,\n" +
- " C241,\n" +
- " C242,\n" +
- " C243,\n" +
- " C244,\n" +
- " C245,\n" +
- " C246,\n" +
- " C247,\n" +
- " C248,\n" +
- " C249,\n" +
- " C250,\n" +
- " C251,\n" +
- " C252,\n" +
- " C253,\n" +
- " C254,\n" +
- " C255,\n" +
- " C256,\n" +
- " C257,\n" +
- " C258,\n" +
- " C259,\n" +
- " C260,\n" +
- " C261,\n" +
- " C262,\n" +
- " C263,\n" +
- " C264,\n" +
- " C265,\n" +
- " C266,\n" +
- " C267,\n" +
- " C268,\n" +
- " C269,\n" +
- " C270,\n" +
- " C271,\n" +
- " C272,\n" +
- " C273,\n" +
- " C274,\n" +
- " C275,\n" +
- " C276,\n" +
- " C277,\n" +
- " C278,\n" +
- " C279,\n" +
- " C280,\n" +
- " C281,\n" +
- " C282,\n" +
- " C283,\n" +
- " C284,\n" +
- " C285,\n" +
- " C286,\n" +
- " C287,\n" +
- " C288,\n" +
- " C289,\n" +
- " C290,\n" +
- " C291,\n" +
- " C292,\n" +
- " C293,\n" +
- " C294,\n" +
- " C295,\n" +
- " C296,\n" +
- " C297,\n" +
- " C298,\n" +
- " C299,\n" +
- " C300,\n" +
- " C301,\n" +
- " C302,\n" +
- " C303,\n" +
- " C304,\n" +
- " C305,\n" +
- " C306,\n" +
- " C307,\n" +
- " C308,\n" +
- " C309,\n" +
- " C310,\n" +
- " C311,\n" +
- " C312,\n" +
- " C313,\n" +
- " C314,\n" +
- " C315,\n" +
- " C316,\n" +
- " C317,\n" +
- " C318,\n" +
- " C319,\n" +
- " C320,\n" +
- " C321,\n" +
- " C322,\n" +
- " C323,\n" +
- " C324,\n" +
- " C325,\n" +
- " C326,\n" +
- " C327,\n" +
- " C328,\n" +
- " C329,\n" +
- " C330,\n" +
- " C331,\n" +
- " C332,\n" +
- " C333,\n" +
- " C334,\n" +
- " C335,\n" +
- " C336,\n" +
- " C337,\n" +
- " C338,\n" +
- " C339,\n" +
- " C340,\n" +
- " C341,\n" +
- " C342,\n" +
- " C343,\n" +
- " C344,\n" +
- " C345,\n" +
- " C346,\n" +
- " C347,\n" +
- " C348,\n" +
- " C349,\n" +
- " C350,\n" +
- " C351,\n" +
- " C352,\n" +
- " C353,\n" +
- " C354,\n" +
- " C355,\n" +
- " C356,\n" +
- " C357,\n" +
- " C358,\n" +
- " C359,\n" +
- " C360,\n" +
- " C361,\n" +
- " C362,\n" +
- " C363,\n" +
- " C364,\n" +
- " C365,\n" +
- " C366,\n" +
- " C367,\n" +
- " C368,\n" +
- " C369,\n" +
- " C370,\n" +
- " C371,\n" +
- " C372,\n" +
- " C373,\n" +
- " C374,\n" +
- " C375,\n" +
- " C376,\n" +
- " C377,\n" +
- " C378,\n" +
- " C379,\n" +
- " C380,\n" +
- " C381,\n" +
- " C382,\n" +
- " C383,\n" +
- " C384,\n" +
- " C385,\n" +
- " C386,\n" +
- " C387,\n" +
- " C388,\n" +
- " C389,\n" +
- " C390,\n" +
- " C391,\n" +
- " C392,\n" +
- " C393,\n" +
- " C394,\n" +
- " C395,\n" +
- " C396,\n" +
- " C397,\n" +
- " C398,\n" +
- " C399,\n" +
- " C400,\n" +
- " C401,\n" +
- " C402,\n" +
- " C403,\n" +
- " C404,\n" +
- " C405,\n" +
- " C406,\n" +
- " C407,\n" +
- " C408,\n" +
- " C409,\n" +
- " C410,\n" +
- " C411,\n" +
- " C412,\n" +
- " C413,\n" +
- " C414,\n" +
- " C415,\n" +
- " C416,\n" +
- " C417,\n" +
- " C418,\n" +
- " C419,\n" +
- " C420,\n" +
- " C421,\n" +
- " C422,\n" +
- " C423,\n" +
- " C424,\n" +
- " C425,\n" +
- " C426,\n" +
- " C427,\n" +
- " C428,\n" +
- " C429,\n" +
- " C430,\n" +
- " C431,\n" +
- " C432,\n" +
- " C433,\n" +
- " C434,\n" +
- " C435,\n" +
- " C436,\n" +
- " C437,\n" +
- " C438,\n" +
- " C439,\n" +
- " C440,\n" +
- " C441,\n" +
- " C442,\n" +
- " C443,\n" +
- " C444,\n" +
- " C445,\n" +
- " C446,\n" +
- " C447,\n" +
- " C448,\n" +
- " C449,\n" +
- " C450,\n" +
- " C451,\n" +
- " C452,\n" +
- " C453,\n" +
- " C454,\n" +
- " C455,\n" +
- " C456,\n" +
- " C457,\n" +
- " C458,\n" +
- " C459,\n" +
- " C460,\n" +
- " C461,\n" +
- " C462,\n" +
- " C463,\n" +
- " C464,\n" +
- " C465,\n" +
- " C466,\n" +
- " C467,\n" +
- " C468,\n" +
- " C469,\n" +
- " C470,\n" +
- " C471,\n" +
- " C472,\n" +
- " C473,\n" +
- " C474,\n" +
- " C475,\n" +
- " C476,\n" +
- " C477,\n" +
- " C478,\n" +
- " C479,\n" +
- " C480,\n" +
- " C481,\n" +
- " C482,\n" +
- " C483,\n" +
- " C484,\n" +
- " C485,\n" +
- " C486,\n" +
- " C487,\n" +
- " C488,\n" +
- " C489,\n" +
- " C490,\n" +
- " C491,\n" +
- " C492,\n" +
- " C493,\n" +
- " C494,\n" +
- " C495,\n" +
- " C496,\n" +
- " C497,\n" +
- " C498,\n" +
- " C499,\n" +
- " C500,\n" +
- " C501,\n" +
- " C502,\n" +
- " C503,\n" +
- " C504,\n" +
- " C505,\n" +
- " C506,\n" +
- " C507,\n" +
- " C508,\n" +
- " C509,\n" +
- " C510,\n" +
- " C511,\n" +
- " C512,\n" +
- " C513,\n" +
- " C514,\n" +
- " C515,\n" +
- " C516,\n" +
- " C517,\n" +
- " C518,\n" +
- " C519,\n" +
- " C520,\n" +
- " C521,\n" +
- " C522,\n" +
- " C523,\n" +
- " C524,\n" +
- " C525,\n" +
- " C526,\n" +
- " C527,\n" +
- " C528,\n" +
- " C529,\n" +
- " C530,\n" +
- " C531,\n" +
- " C532,\n" +
- " C533,\n" +
- " C534,\n" +
- " C535,\n" +
- " C536,\n" +
- " C537,\n" +
- " C538,\n" +
- " C539,\n" +
- " C540,\n" +
- " C541,\n" +
- " C542,\n" +
- " C543,\n" +
- " C544,\n" +
- " C545,\n" +
- " C546,\n" +
- " C547,\n" +
- " C548,\n" +
- " C549,\n" +
- " C550,\n" +
- " C551,\n" +
- " C552,\n" +
- " C553,\n" +
- " C554,\n" +
- " C555,\n" +
- " C556,\n" +
- " C557,\n" +
- " C558,\n" +
- " C559,\n" +
- " C560,\n" +
- " C561,\n" +
- " C562,\n" +
- " C563,\n" +
- " C564,\n" +
- " C565,\n" +
- " C566,\n" +
- " C567,\n" +
- " C568,\n" +
- " C569,\n" +
- " C570,\n" +
- " C571,\n" +
- " C572,\n" +
- " C573,\n" +
- " C574,\n" +
- " C575,\n" +
- " C576,\n" +
- " C577,\n" +
- " C578,\n" +
- " C579,\n" +
- " C580,\n" +
- " C581,\n" +
- " C582,\n" +
- " C583,\n" +
- " C584,\n" +
- " C585,\n" +
- " C586,\n" +
- " C587,\n" +
- " C588,\n" +
- " C589,\n" +
- " C590,\n" +
- " C591,\n" +
- " C592,\n" +
- " C593,\n" +
- " C594,\n" +
- " C595,\n" +
- " C596,\n" +
- " C597,\n" +
- " C598,\n" +
- " C599,\n" +
- " C600,\n" +
- " C601,\n" +
- " C602,\n" +
- " C603,\n" +
- " C604,\n" +
- " C605,\n" +
- " C606,\n" +
- " C607,\n" +
- " C608,\n" +
- " C609,\n" +
- " C610,\n" +
- " C611,\n" +
- " C612,\n" +
- " C613,\n" +
- " C614,\n" +
- " C615,\n" +
- " C616,\n" +
- " C617,\n" +
- " C618,\n" +
- " C619,\n" +
- " C620,\n" +
- " C621,\n" +
- " C622,\n" +
- " C623,\n" +
- " C624,\n" +
- " C625,\n" +
- " C626,\n" +
- " C627,\n" +
- " C628,\n" +
- " C629,\n" +
- " C630,\n" +
- " C631,\n" +
- " C632,\n" +
- " C633,\n" +
- " C634,\n" +
- " C635,\n" +
- " C636,\n" +
- " C637,\n" +
- " C638,\n" +
- " C639,\n" +
- " C640,\n" +
- " C641,\n" +
- " C642,\n" +
- " C643,\n" +
- " C644,\n" +
- " C645,\n" +
- " C646,\n" +
- " C647,\n" +
- " C648,\n" +
- " C649,\n" +
- " C650,\n" +
- " C651,\n" +
- " C652,\n" +
- " C653,\n" +
- " C654,\n" +
- " C655,\n" +
- " C656,\n" +
- " C657,\n" +
- " C658,\n" +
- " C659,\n" +
- " C660,\n" +
- " C661,\n" +
- " C662,\n" +
- " C663,\n" +
- " C664,\n" +
- " C665,\n" +
- " C666,\n" +
- " C667,\n" +
- " C668,\n" +
- " C669,\n" +
- " C670,\n" +
- " C671,\n" +
- " C672,\n" +
- " C673,\n" +
- " C674,\n" +
- " C675,\n" +
- " C676,\n" +
- " C677,\n" +
- " C678,\n" +
- " C679,\n" +
- " C680,\n" +
- " C681,\n" +
- " C682,\n" +
- " C683,\n" +
- " C684,\n" +
- " C685,\n" +
- " C686,\n" +
- " C687,\n" +
- " C688,\n" +
- " C689,\n" +
- " C690,\n" +
- " C691,\n" +
- " C692,\n" +
- " C693,\n" +
- " C694,\n" +
- " C695,\n" +
- " C696,\n" +
- " C697,\n" +
- " C698,\n" +
- " C699,\n" +
- " C700,\n" +
- " C701,\n" +
- " C702,\n" +
- " C703,\n" +
- " C704,\n" +
- " C705,\n" +
- " C706,\n" +
- " C707,\n" +
- " C708,\n" +
- " C709,\n" +
- " C710,\n" +
- " C711,\n" +
- " C712,\n" +
- " C713,\n" +
- " C714,\n" +
- " C715,\n" +
- " C716,\n" +
- " C717,\n" +
- " C718,\n" +
- " C719,\n" +
- " C720,\n" +
- " C721,\n" +
- " C722,\n" +
- " C723,\n" +
- " C724,\n" +
- " C725,\n" +
- " C726,\n" +
- " C727,\n" +
- " C728,\n" +
- " C729,\n" +
- " C730,\n" +
- " C731,\n" +
- " C732,\n" +
- " C733,\n" +
- " C734,\n" +
- " C735,\n" +
- " C736,\n" +
- " C737,\n" +
- " C738,\n" +
- " C739,\n" +
- " C740,\n" +
- " C741,\n" +
- " C742,\n" +
- " C743,\n" +
- " C744,\n" +
- " C745,\n" +
- " C746,\n" +
- " C747,\n" +
- " C748,\n" +
- " C749,\n" +
- " C750,\n" +
- " C751,\n" +
- " C752,\n" +
- " C753,\n" +
- " C754,\n" +
- " C755,\n" +
- " C756,\n" +
- " C757,\n" +
- " C758,\n" +
- " C759,\n" +
- " C760,\n" +
- " C761,\n" +
- " C762,\n" +
- " C763,\n" +
- " C764,\n" +
- " C765,\n" +
- " C766,\n" +
- " C767,\n" +
- " C768,\n" +
- " C769,\n" +
- " C770,\n" +
- " C771,\n" +
- " C772,\n" +
- " C773,\n" +
- " C774,\n" +
- " C775,\n" +
- " C776,\n" +
- " C777,\n" +
- " C778,\n" +
- " C779,\n" +
- " C780,\n" +
- " C781,\n" +
- " C782,\n" +
- " C783,\n" +
- " C784,\n" +
- " C785,\n" +
- " C786,\n" +
- " C787,\n" +
- " C788,\n" +
- " C789,\n" +
- " C790,\n" +
- " C791,\n" +
- " C792,\n" +
- " C793,\n" +
- " C794,\n" +
- " C795,\n" +
- " C796,\n" +
- " C797,\n" +
- " C798,\n" +
- " C799,\n" +
- " C800,\n" +
- " C801,\n" +
- " C802,\n" +
- " C803,\n" +
- " C804,\n" +
- " C805,\n" +
- " C806,\n" +
- " C807,\n" +
- " C808,\n" +
- " C809,\n" +
- " C810,\n" +
- " C811,\n" +
- " C812,\n" +
- " C813,\n" +
- " C814,\n" +
- " C815,\n" +
- " C816,\n" +
- " C817,\n" +
- " C818,\n" +
- " C819,\n" +
- " C820,\n" +
- " C821,\n" +
- " C822,\n" +
- " C823,\n" +
- " C824,\n" +
- " C825,\n" +
- " C826,\n" +
- " C827,\n" +
- " C828,\n" +
- " C829,\n" +
- " C830,\n" +
- " C831,\n" +
- " C832,\n" +
- " C833,\n" +
- " C834,\n" +
- " C835,\n" +
- " C836,\n" +
- " C837,\n" +
- " C838,\n" +
- " C839,\n" +
- " C840,\n" +
- " C841,\n" +
- " C842,\n" +
- " C843,\n" +
- " C844,\n" +
- " C845,\n" +
- " C846,\n" +
- " C847,\n" +
- " C848,\n" +
- " C849,\n" +
- " C850,\n" +
- " C851,\n" +
- " C852,\n" +
- " C853,\n" +
- " C854,\n" +
- " C855,\n" +
- " C856,\n" +
- " C857,\n" +
- " C858,\n" +
- " C859,\n" +
- " C860,\n" +
- " C861,\n" +
- " C862,\n" +
- " C863,\n" +
- " C864,\n" +
- " C865,\n" +
- " C866,\n" +
- " C867,\n" +
- " C868,\n" +
- " C869,\n" +
- " C870,\n" +
- " C871,\n" +
- " C872,\n" +
- " C873,\n" +
- " C874,\n" +
- " C875,\n" +
- " C876,\n" +
- " C877,\n" +
- " C878,\n" +
- " C879,\n" +
- " C880,\n" +
- " C881,\n" +
- " C882,\n" +
- " C883,\n" +
- " C884,\n" +
- " C885,\n" +
- " C886,\n" +
- " C887,\n" +
- " C888,\n" +
- " C889,\n" +
- " C890,\n" +
- " C891,\n" +
- " C892,\n" +
- " C893,\n" +
- " C894,\n" +
- " C895,\n" +
- " C896,\n" +
- " C897,\n" +
- " C898,\n" +
- " C899,\n" +
- " C900,\n" +
- " C901,\n" +
- " C902,\n" +
- " C903,\n" +
- " C904,\n" +
- " C905,\n" +
- " C906,\n" +
- " C907,\n" +
- " C908,\n" +
- " C909,\n" +
- " C910,\n" +
- " C911,\n" +
- " C912,\n" +
- " C913,\n" +
- " C914,\n" +
- " C915,\n" +
- " C916,\n" +
- " C917,\n" +
- " C918,\n" +
- " C919,\n" +
- " C920,\n" +
- " C921,\n" +
- " C922,\n" +
- " C923,\n" +
- " C924,\n" +
- " C925,\n" +
- " C926,\n" +
- " C927,\n" +
- " C928,\n" +
- " C929,\n" +
- " C930,\n" +
- " C931,\n" +
- " C932,\n" +
- " C933,\n" +
- " C934,\n" +
- " C935,\n" +
- " C936,\n" +
- " C937,\n" +
- " C938,\n" +
- " C939,\n" +
- " C940,\n" +
- " C941,\n" +
- " C942,\n" +
- " C943,\n" +
- " C944,\n" +
- " C945,\n" +
- " C946,\n" +
- " C947,\n" +
- " C948,\n" +
- " C949,\n" +
- " C950,\n" +
- " C951,\n" +
- " C952,\n" +
- " C953,\n" +
- " C954,\n" +
- " C955,\n" +
- " C956,\n" +
- " C957,\n" +
- " C958,\n" +
- " C959,\n" +
- " C960,\n" +
- " C961,\n" +
- " C962,\n" +
- " C963,\n" +
- " C964,\n" +
- " C965,\n" +
- " C966,\n" +
- " C967,\n" +
- " C968,\n" +
- " C969,\n" +
- " C970,\n" +
- " C971,\n" +
- " C972,\n" +
- " C973,\n" +
- " C974,\n" +
- " C975,\n" +
- " C976,\n" +
- " C977,\n" +
- " C978,\n" +
- " C979,\n" +
- " C980,\n" +
- " C981,\n" +
- " C982,\n" +
- " C983,\n" +
- " C984,\n" +
- " C985,\n" +
- " C986,\n" +
- " C987,\n" +
- " C988,\n" +
- " C989,\n" +
- " C990,\n" +
- " C991,\n" +
- " C992,\n" +
- " C993,\n" +
- " C994,\n" +
- " C995,\n" +
- " C996,\n" +
- " C997,\n" +
- " C998,\n" +
- " C999,\n" +
- " C1000,\n" +
- " C1001,\n" +
- " C1002,\n" +
- " C1003,\n" +
- " C1004,\n" +
- " C1005,\n" +
- " C1006,\n" +
- " C1007,\n" +
- " C1008,\n" +
- " C1009,\n" +
- " C1010,\n" +
- " C1011,\n" +
- " C1012,\n" +
- " C1013,\n" +
- " C1014,\n" +
- " C1015,\n" +
- " C1016,\n" +
- " C1017,\n" +
- " C1018,\n" +
- " C1019,\n" +
- " C1020,\n" +
- " C1021,\n" +
- " C1022,\n" +
- " C1023,\n" +
- " C1024,\n" +
- " C1025,\n" +
- " C1026,\n" +
- " C1027,\n" +
- " C1028,\n" +
- " C1029,\n" +
- " C1030,\n" +
- " C1031,\n" +
- " C1032,\n" +
- " C1033,\n" +
- " C1034,\n" +
- " C1035,\n" +
- " C1036,\n" +
- " C1037,\n" +
- " C1038,\n" +
- " C1039,\n" +
- " C1040,\n" +
- " C1041,\n" +
- " C1042,\n" +
- " C1043,\n" +
- " C1044,\n" +
- " C1045,\n" +
- " C1046,\n" +
- " C1047,\n" +
- " C1048,\n" +
- " C1049,\n" +
- " C1050,\n" +
- " C1051,\n" +
- " C1052,\n" +
- " C1053,\n" +
- " C1054,\n" +
- " C1055,\n" +
- " C1056,\n" +
- " C1057,\n" +
- " C1058,\n" +
- " C1059,\n" +
- " C1060,\n" +
- " C1061,\n" +
- " C1062,\n" +
- " C1063,\n" +
- " C1064,\n" +
- " C1065,\n" +
- " C1066,\n" +
- " C1067,\n" +
- " C1068,\n" +
- " C1069,\n" +
- " C1070,\n" +
- " C1071,\n" +
- " C1072,\n" +
- " C1073,\n" +
- " C1074,\n" +
- " C1075,\n" +
- " C1076,\n" +
- " C1077,\n" +
- " C1078,\n" +
- " C1079,\n" +
- " C1080,\n" +
- " C1081,\n" +
- " C1082,\n" +
- " C1083,\n" +
- " C1084,\n" +
- " C1085,\n" +
- " C1086,\n" +
- " C1087,\n" +
- " C1088,\n" +
- " C1089,\n" +
- " C1090,\n" +
- " C1091,\n" +
- " C1092,\n" +
- " C1093,\n" +
- " C1094,\n" +
- " C1095,\n" +
- " C1096,\n" +
- " C1097,\n" +
- " C1098,\n" +
- " C1099,\n" +
- " C1100,\n" +
- " C1101,\n" +
- " C1102,\n" +
- " C1103,\n" +
- " C1104,\n" +
- " C1105,\n" +
- " C1106,\n" +
- " C1107,\n" +
- " C1108,\n" +
- " C1109,\n" +
- " C1110,\n" +
- " C1111,\n" +
- " C1112,\n" +
- " C1113,\n" +
- " C1114,\n" +
- " C1115,\n" +
- " C1116,\n" +
- " C1117,\n" +
- " C1118,\n" +
- " C1119,\n" +
- " C1120,\n" +
- " C1121,\n" +
- " C1122,\n" +
- " C1123,\n" +
- " C1124,\n" +
- " C1125,\n" +
- " C1126,\n" +
- " C1127,\n" +
- " C1128,\n" +
- " C1129,\n" +
- " C1130,\n" +
- " C1131,\n" +
- " C1132,\n" +
- " C1133,\n" +
- " C1134,\n" +
- " C1135,\n" +
- " C1136,\n" +
- " C1137,\n" +
- " C1138,\n" +
- " C1139,\n" +
- " C1140,\n" +
- " C1141,\n" +
- " C1142,\n" +
- " C1143,\n" +
- " C1144,\n" +
- " C1145,\n" +
- " C1146,\n" +
- " C1147,\n" +
- " C1148,\n" +
- " C1149,\n" +
- " C1150,\n" +
- " C1151,\n" +
- " C1152,\n" +
- " C1153,\n" +
- " C1154,\n" +
- " C1155,\n" +
- " C1156,\n" +
- " C1157,\n" +
- " C1158,\n" +
- " C1159,\n" +
- " C1160,\n" +
- " C1161,\n" +
- " C1162,\n" +
- " C1163,\n" +
- " C1164,\n" +
- " C1165,\n" +
- " C1166,\n" +
- " C1167,\n" +
- " C1168,\n" +
- " C1169,\n" +
- " C1170,\n" +
- " C1171,\n" +
- " C1172,\n" +
- " C1173,\n" +
- " C1174,\n" +
- " C1175,\n" +
- " C1176,\n" +
- " C1177,\n" +
- " C1178,\n" +
- " C1179,\n" +
- " C1180,\n" +
- " C1181,\n" +
- " C1182,\n" +
- " C1183,\n" +
- " C1184,\n" +
- " C1185,\n" +
- " C1186,\n" +
- " C1187,\n" +
- " C1188,\n" +
- " C1189,\n" +
- " C1190,\n" +
- " C1191,\n" +
- " C1192,\n" +
- " C1193,\n" +
- " C1194,\n" +
- " C1195,\n" +
- " C1196,\n" +
- " C1197,\n" +
- " C1198,\n" +
- " C1199,\n" +
- " C1200,\n" +
- " C1201,\n" +
- " C1202,\n" +
- " C1203,\n" +
- " C1204,\n" +
- " C1205,\n" +
- " C1206,\n" +
- " C1207,\n" +
- " C1208,\n" +
- " C1209,\n" +
- " C1210,\n" +
- " C1211,\n" +
- " C1212,\n" +
- " C1213,\n" +
- " C1214,\n" +
- " C1215,\n" +
- " C1216,\n" +
- " C1217,\n" +
- " C1218,\n" +
- " C1219,\n" +
- " C1220,\n" +
- " C1221,\n" +
- " C1222,\n" +
- " C1223,\n" +
- " C1224,\n" +
- " C1225,\n" +
- " C1226,\n" +
- " C1227,\n" +
- " C1228,\n" +
- " C1229,\n" +
- " C1230,\n" +
- " C1231,\n" +
- " C1232,\n" +
- " C1233,\n" +
- " C1234,\n" +
- " C1235,\n" +
- " C1236,\n" +
- " C1237,\n" +
- " C1238,\n" +
- " C1239,\n" +
- " C1240,\n" +
- " C1241,\n" +
- " C1242,\n" +
- " C1243,\n" +
- " C1244,\n" +
- " C1245,\n" +
- " C1246,\n" +
- " C1247,\n" +
- " C1248,\n" +
- " C1249,\n" +
- " C1250,\n" +
- " C1251,\n" +
- " C1252,\n" +
- " C1253,\n" +
- " C1254,\n" +
- " C1255,\n" +
- " C1256,\n" +
- " C1257,\n" +
- " C1258,\n" +
- " C1259,\n" +
- " C1260,\n" +
- " C1261,\n" +
- " C1262,\n" +
- " C1263,\n" +
- " C1264,\n" +
- " C1265,\n" +
- " C1266,\n" +
- " C1267,\n" +
- " C1268,\n" +
- " C1269,\n" +
- " C1270,\n" +
- " C1271,\n" +
- " C1272,\n" +
- " C1273,\n" +
- " C1274,\n" +
- " C1275,\n" +
- " C1276,\n" +
- " C1277,\n" +
- " C1278,\n" +
- " C1279,\n" +
- " C1280,\n" +
- " C1281,\n" +
- " C1282,\n" +
- " C1283,\n" +
- " C1284,\n" +
- " C1285,\n" +
- " C1286,\n" +
- " C1287,\n" +
- " C1288,\n" +
- " C1289,\n" +
- " C1290,\n" +
- " C1291,\n" +
- " C1292,\n" +
- " C1293,\n" +
- " C1294,\n" +
- " C1295,\n" +
- " C1296,\n" +
- " C1297,\n" +
- " C1298,\n" +
- " C1299,\n" +
- " C1300,\n" +
- " C1301,\n" +
- " C1302,\n" +
- " C1303,\n" +
- " C1304,\n" +
- " C1305,\n" +
- " C1306,\n" +
- " C1307,\n" +
- " C1308,\n" +
- " C1309,\n" +
- " C1310,\n" +
- " C1311,\n" +
- " C1312,\n" +
- " C1313,\n" +
- " C1314,\n" +
- " C1315,\n" +
- " C1316,\n" +
- " C1317,\n" +
- " C1318,\n" +
- " C1319,\n" +
- " C1320,\n" +
- " C1321,\n" +
- " C1322,\n" +
- " C1323,\n" +
- " C1324,\n" +
- " C1325,\n" +
- " C1326,\n" +
- " C1327,\n" +
- " C1328,\n" +
- " C1329,\n" +
- " C1330,\n" +
- " C1331,\n" +
- " C1332,\n" +
- " C1333,\n" +
- " C1334,\n" +
- " C1335,\n" +
- " C1336,\n" +
- " C1337,\n" +
- " C1338,\n" +
- " C1339,\n" +
- " C1340,\n" +
- " C1341,\n" +
- " C1342,\n" +
- " C1343,\n" +
- " C1344,\n" +
- " C1345,\n" +
- " C1346,\n" +
- " C1347,\n" +
- " C1348,\n" +
- " C1349,\n" +
- " C1350,\n" +
- " C1351,\n" +
- " C1352,\n" +
- " C1353,\n" +
- " C1354,\n" +
- " C1355,\n" +
- " C1356,\n" +
- " C1357,\n" +
- " C1358,\n" +
- " C1359,\n" +
- " C1360,\n" +
- " C1361,\n" +
- " C1362,\n" +
- " C1363,\n" +
- " C1364,\n" +
- " C1365,\n" +
- " C1366,\n" +
- " C1367,\n" +
- " C1368,\n" +
- " C1369,\n" +
- " C1370,\n" +
- " C1371,\n" +
- " C1372,\n" +
- " C1373,\n" +
- " C1374,\n" +
- " C1375,\n" +
- " C1376,\n" +
- " C1377,\n" +
- " C1378,\n" +
- " C1379,\n" +
- " C1380,\n" +
- " C1381,\n" +
- " C1382,\n" +
- " C1383,\n" +
- " C1384,\n" +
- " C1385,\n" +
- " C1386,\n" +
- " C1387,\n" +
- " C1388,\n" +
- " C1389,\n" +
- " C1390,\n" +
- " C1391,\n" +
- " C1392,\n" +
- " C1393,\n" +
- " C1394,\n" +
- " C1395,\n" +
- " C1396,\n" +
- " C1397,\n" +
- " C1398,\n" +
- " C1399,\n" +
- " C1400,\n" +
- " C1401,\n" +
- " C1402,\n" +
- " C1403,\n" +
- " C1404,\n" +
- " C1405,\n" +
- " C1406,\n" +
- " C1407,\n" +
- " C1408,\n" +
- " C1409,\n" +
- " C1410,\n" +
- " C1411,\n" +
- " C1412,\n" +
- " C1413,\n" +
- " C1414,\n" +
- " C1415,\n" +
- " C1416,\n" +
- " C1417,\n" +
- " C1418,\n" +
- " C1419,\n" +
- " C1420,\n" +
- " C1421,\n" +
- " C1422,\n" +
- " C1423,\n" +
- " C1424,\n" +
- " C1425,\n" +
- " C1426,\n" +
- " C1427,\n" +
- " C1428,\n" +
- " C1429,\n" +
- " C1430,\n" +
- " C1431,\n" +
- " C1432,\n" +
- " C1433,\n" +
- " C1434,\n" +
- " C1435,\n" +
- " C1436,\n" +
- " C1437,\n" +
- " C1438,\n" +
- " C1439,\n" +
- " C1440,\n" +
- " C1441,\n" +
- " C1442,\n" +
- " C1443,\n" +
- " C1444,\n" +
- " C1445,\n" +
- " C1446,\n" +
- " C1447,\n" +
- " C1448,\n" +
- " C1449,\n" +
- " C1450,\n" +
- " C1451,\n" +
- " C1452,\n" +
- " C1453,\n" +
- " C1454,\n" +
- " C1455,\n" +
- " C1456,\n" +
- " C1457,\n" +
- " C1458,\n" +
- " C1459,\n" +
- " C1460,\n" +
- " C1461,\n" +
- " C1462,\n" +
- " C1463,\n" +
- " C1464,\n" +
- " C1465,\n" +
- " C1466,\n" +
- " C1467,\n" +
- " C1468,\n" +
- " C1469,\n" +
- " C1470,\n" +
- " C1471,\n" +
- " C1472,\n" +
- " C1473,\n" +
- " C1474,\n" +
- " C1475,\n" +
- " C1476,\n" +
- " C1477,\n" +
- " C1478,\n" +
- " C1479,\n" +
- " C1480,\n" +
- " C1481,\n" +
- " C1482,\n" +
- " C1483,\n" +
- " C1484,\n" +
- " C1485,\n" +
- " C1486,\n" +
- " C1487,\n" +
- " C1488,\n" +
- " C1489,\n" +
- " C1490,\n" +
- " C1491,\n" +
- " C1492,\n" +
- " C1493,\n" +
- " C1494,\n" +
- " C1495,\n" +
- " C1496,\n" +
- " C1497,\n" +
- " C1498,\n" +
- " C1499,\n" +
- " C1500,\n" +
- " C1501,\n" +
- " C1502,\n" +
- " C1503,\n" +
- " C1504,\n" +
- " C1505,\n" +
- " C1506,\n" +
- " C1507,\n" +
- " C1508,\n" +
- " C1509,\n" +
- " C1510,\n" +
- " C1511,\n" +
- " C1512,\n" +
- " C1513,\n" +
- " C1514,\n" +
- " C1515,\n" +
- " C1516,\n" +
- " C1517,\n" +
- " C1518,\n" +
- " C1519,\n" +
- " C1520,\n" +
- " C1521,\n" +
- " C1522,\n" +
- " C1523,\n" +
- " C1524,\n" +
- " C1525,\n" +
- " C1526,\n" +
- " C1527,\n" +
- " C1528,\n" +
- " C1529,\n" +
- " C1530,\n" +
- " C1531,\n" +
- " C1532,\n" +
- " C1533,\n" +
- " C1534,\n" +
- " C1535,\n" +
- " C1536,\n" +
- " C1537,\n" +
- " C1538,\n" +
- " C1539,\n" +
- " C1540,\n" +
- " C1541,\n" +
- " C1542,\n" +
- " C1543,\n" +
- " C1544,\n" +
- " C1545,\n" +
- " C1546,\n" +
- " C1547,\n" +
- " C1548,\n" +
- " C1549,\n" +
- " C1550,\n" +
- " C1551,\n" +
- " C1552,\n" +
- " C1553,\n" +
- " C1554,\n" +
- " C1555,\n" +
- " C1556,\n" +
- " C1557,\n" +
- " C1558,\n" +
- " C1559,\n" +
- " C1560,\n" +
- " C1561,\n" +
- " C1562,\n" +
- " C1563,\n" +
- " C1564,\n" +
- " C1565,\n" +
- " C1566,\n" +
- " C1567,\n" +
- " C1568,\n" +
- " C1569,\n" +
- " C1570,\n" +
- " C1571,\n" +
- " C1572,\n" +
- " C1573,\n" +
- " C1574,\n" +
- " C1575,\n" +
- " C1576,\n" +
- " C1577,\n" +
- " C1578,\n" +
- " C1579,\n" +
- " C1580,\n" +
- " C1581,\n" +
- " C1582,\n" +
- " C1583,\n" +
- " C1584,\n" +
- " C1585,\n" +
- " C1586,\n" +
- " C1587,\n" +
- " C1588,\n" +
- " C1589,\n" +
- " C1590,\n" +
- " C1591,\n" +
- " C1592,\n" +
- " C1593,\n" +
- " C1594,\n" +
- " C1595,\n" +
- " C1596,\n" +
- " C1597,\n" +
- " C1598,\n" +
- " C1599,\n" +
- " C1600,\n" +
- " C1601,\n" +
- " C1602,\n" +
- " C1603,\n" +
- " C1604,\n" +
- " C1605,\n" +
- " C1606,\n" +
- " C1607,\n" +
- " C1608,\n" +
- " C1609,\n" +
- " C1610,\n" +
- " C1611,\n" +
- " C1612,\n" +
- " C1613,\n" +
- " C1614,\n" +
- " C1615,\n" +
- " C1616,\n" +
- " C1617,\n" +
- " C1618,\n" +
- " C1619,\n" +
- " C1620,\n" +
- " C1621,\n" +
- " C1622,\n" +
- " C1623,\n" +
- " C1624,\n" +
- " C1625,\n" +
- " C1626,\n" +
- " C1627,\n" +
- " C1628,\n" +
- " C1629,\n" +
- " C1630,\n" +
- " C1631,\n" +
- " C1632,\n" +
- " C1633,\n" +
- " C1634,\n" +
- " C1635,\n" +
- " C1636,\n" +
- " C1637,\n" +
- " C1638,\n" +
- " C1639,\n" +
- " C1640,\n" +
- " C1641,\n" +
- " C1642,\n" +
- " C1643,\n" +
- " C1644,\n" +
- " C1645,\n" +
- " C1646,\n" +
- " C1647,\n" +
- " C1648,\n" +
- " C1649,\n" +
- " C1650,\n" +
- " C1651,\n" +
- " C1652,\n" +
- " C1653,\n" +
- " C1654,\n" +
- " C1655,\n" +
- " C1656,\n" +
- " C1657,\n" +
- " C1658,\n" +
- " C1659,\n" +
- " C1660,\n" +
- " C1661,\n" +
- " C1662,\n" +
- " C1663,\n" +
- " C1664,\n" +
- " C1665,\n" +
- " C1666,\n" +
- " C1667,\n" +
- " C1668,\n" +
- " C1669,\n" +
- " C1670,\n" +
- " C1671,\n" +
- " C1672,\n" +
- " C1673,\n" +
- " C1674,\n" +
- " C1675,\n" +
- " C1676,\n" +
- " C1677,\n" +
- " C1678,\n" +
- " C1679,\n" +
- " C1680,\n" +
- " C1681,\n" +
- " C1682,\n" +
- " C1683,\n" +
- " C1684,\n" +
- " C1685,\n" +
- " C1686,\n" +
- " C1687,\n" +
- " C1688,\n" +
- " C1689,\n" +
- " C1690,\n" +
- " C1691,\n" +
- " C1692,\n" +
- " C1693,\n" +
- " C1694,\n" +
- " C1695,\n" +
- " C1696,\n" +
- " C1697,\n" +
- " C1698,\n" +
- " C1699,\n" +
- " C1700,\n" +
- " C1701,\n" +
- " C1702,\n" +
- " C1703,\n" +
- " C1704,\n" +
- " C1705,\n" +
- " C1706,\n" +
- " C1707,\n" +
- " C1708,\n" +
- " C1709,\n" +
- " C1710,\n" +
- " C1711,\n" +
- " C1712,\n" +
- " C1713,\n" +
- " C1714,\n" +
- " C1715,\n" +
- " C1716,\n" +
- " C1717,\n" +
- " C1718,\n" +
- " C1719,\n" +
- " C1720,\n" +
- " C1721,\n" +
- " C1722,\n" +
- " C1723,\n" +
- " C1724,\n" +
- " C1725,\n" +
- " C1726,\n" +
- " C1727,\n" +
- " C1728,\n" +
- " C1729,\n" +
- " C1730,\n" +
- " C1731,\n" +
- " C1732,\n" +
- " C1733,\n" +
- " C1734,\n" +
- " C1735,\n" +
- " C1736,\n" +
- " C1737,\n" +
- " C1738,\n" +
- " C1739,\n" +
- " C1740,\n" +
- " C1741,\n" +
- " C1742,\n" +
- " C1743,\n" +
- " C1744,\n" +
- " C1745,\n" +
- " C1746,\n" +
- " C1747,\n" +
- " C1748,\n" +
- " C1749,\n" +
- " C1750,\n" +
- " C1751,\n" +
- " C1752,\n" +
- " C1753,\n" +
- " C1754,\n" +
- " C1755,\n" +
- " C1756,\n" +
- " C1757,\n" +
- " C1758,\n" +
- " C1759,\n" +
- " C1760,\n" +
- " C1761,\n" +
- " C1762,\n" +
- " C1763,\n" +
- " C1764,\n" +
- " C1765,\n" +
- " C1766,\n" +
- " C1767,\n" +
- " C1768,\n" +
- " C1769,\n" +
- " C1770,\n" +
- " C1771,\n" +
- " C1772,\n" +
- " C1773,\n" +
- " C1774,\n" +
- " C1775,\n" +
- " C1776,\n" +
- " C1777,\n" +
- " C1778,\n" +
- " C1779,\n" +
- " C1780,\n" +
- " C1781,\n" +
- " C1782,\n" +
- " C1783,\n" +
- " C1784,\n" +
- " C1785,\n" +
- " C1786,\n" +
- " C1787,\n" +
- " C1788,\n" +
- " C1789,\n" +
- " C1790,\n" +
- " C1791,\n" +
- " C1792,\n" +
- " C1793,\n" +
- " C1794,\n" +
- " C1795,\n" +
- " C1796,\n" +
- " C1797,\n" +
- " C1798,\n" +
- " C1799,\n" +
- " C1800,\n" +
- " C1801,\n" +
- " C1802,\n" +
- " C1803,\n" +
- " C1804,\n" +
- " C1805,\n" +
- " C1806,\n" +
- " C1807,\n" +
- " C1808,\n" +
- " C1809,\n" +
- " C1810,\n" +
- " C1811,\n" +
- " C1812,\n" +
- " C1813,\n" +
- " C1814,\n" +
- " C1815,\n" +
- " C1816,\n" +
- " C1817,\n" +
- " C1818,\n" +
- " C1819,\n" +
- " C1820,\n" +
- " C1821,\n" +
- " C1822,\n" +
- " C1823,\n" +
- " C1824,\n" +
- " C1825,\n" +
- " C1826,\n" +
- " C1827,\n" +
- " C1828,\n" +
- " C1829,\n" +
- " C1830,\n" +
- " C1831,\n" +
- " C1832,\n" +
- " C1833,\n" +
- " C1834,\n" +
- " C1835,\n" +
- " C1836,\n" +
- " C1837,\n" +
- " C1838,\n" +
- " C1839,\n" +
- " C1840,\n" +
- " C1841,\n" +
- " C1842,\n" +
- " C1843,\n" +
- " C1844,\n" +
- " C1845,\n" +
- " C1846,\n" +
- " C1847,\n" +
- " C1848,\n" +
- " C1849,\n" +
- " C1850,\n" +
- " C1851,\n" +
- " C1852,\n" +
- " C1853,\n" +
- " C1854,\n" +
- " C1855,\n" +
- " C1856,\n" +
- " C1857,\n" +
- " C1858,\n" +
- " C1859,\n" +
- " C1860,\n" +
- " C1861,\n" +
- " C1862,\n" +
- " C1863,\n" +
- " C1864,\n" +
- " C1865,\n" +
- " C1866,\n" +
- " C1867,\n" +
- " C1868,\n" +
- " C1869,\n" +
- " C1870,\n" +
- " C1871,\n" +
- " C1872,\n" +
- " C1873,\n" +
- " C1874,\n" +
- " C1875,\n" +
- " C1876,\n" +
- " C1877,\n" +
- " C1878,\n" +
- " C1879,\n" +
- " C1880,\n" +
- " C1881,\n" +
- " C1882,\n" +
- " C1883,\n" +
- " C1884,\n" +
- " C1885,\n" +
- " C1886,\n" +
- " C1887,\n" +
- " C1888,\n" +
- " C1889,\n" +
- " C1890,\n" +
- " C1891,\n" +
- " C1892,\n" +
- " C1893,\n" +
- " C1894,\n" +
- " C1895,\n" +
- " C1896,\n" +
- " C1897,\n" +
- " C1898,\n" +
- " C1899,\n" +
- " C1900,\n" +
- " C1901,\n" +
- " C1902,\n" +
- " C1903,\n" +
- " C1904,\n" +
- " C1905,\n" +
- " C1906,\n" +
- " C1907,\n" +
- " C1908,\n" +
- " C1909,\n" +
- " C1910,\n" +
- " C1911,\n" +
- " C1912,\n" +
- " C1913,\n" +
- " C1914,\n" +
- " C1915,\n" +
- " C1916,\n" +
- " C1917,\n" +
- " C1918,\n" +
- " C1919,\n" +
- " C1920,\n" +
- " C1921,\n" +
- " C1922,\n" +
- " C1923,\n" +
- " C1924,\n" +
- " C1925,\n" +
- " C1926,\n" +
- " C1927,\n" +
- " C1928,\n" +
- " C1929,\n" +
- " C1930,\n" +
- " C1931,\n" +
- " C1932,\n" +
- " C1933,\n" +
- " C1934,\n" +
- " C1935,\n" +
- " C1936,\n" +
- " C1937,\n" +
- " C1938,\n" +
- " C1939,\n" +
- " C1940,\n" +
- " C1941,\n" +
- " C1942,\n" +
- " C1943,\n" +
- " C1944,\n" +
- " C1945,\n" +
- " C1946,\n" +
- " C1947,\n" +
- " C1948,\n" +
- " C1949,\n" +
- " C1950,\n" +
- " C1951,\n" +
- " C1952,\n" +
- " C1953,\n" +
- " C1954,\n" +
- " C1955,\n" +
- " C1956,\n" +
- " C1957,\n" +
- " C1958,\n" +
- " C1959,\n" +
- " C1960,\n" +
- " C1961,\n" +
- " C1962,\n" +
- " C1963,\n" +
- " C1964,\n" +
- " C1965,\n" +
- " C1966,\n" +
- " C1967,\n" +
- " C1968,\n" +
- " C1969,\n" +
- " C1970,\n" +
- " C1971,\n" +
- " C1972,\n" +
- " C1973,\n" +
- " C1974,\n" +
- " C1975,\n" +
- " C1976,\n" +
- " C1977,\n" +
- " C1978,\n" +
- " C1979,\n" +
- " C1980,\n" +
- " C1981,\n" +
- " C1982,\n" +
- " C1983,\n" +
- " C1984,\n" +
- " C1985,\n" +
- " C1986,\n" +
- " C1987,\n" +
- " C1988,\n" +
- " C1989,\n" +
- " C1990,\n" +
- " C1991,\n" +
- " C1992,\n" +
- " C1993,\n" +
- " C1994,\n" +
- " C1995,\n" +
- " C1996,\n" +
- " C1997,\n" +
- " C1998,\n" +
- " C1999,\n" +
- " C2000,\n" +
- " C2001,\n" +
- " C2002,\n" +
- " C2003,\n" +
- " C2004\n" +
- " ;\n" +
- " \n" +
- " private static Map<String, X> nameToInstanceMap = new HashMap<String, X>();\n" +
- "\n" +
- " static {\n" +
- " for (X b : values()) {\n" +
- " nameToInstanceMap.put(b.name(), b);\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static X fromName(String n) {\n" +
- " X b = nameToInstanceMap.get(n);\n" +
- "\n" +
- " return b;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(fromName(\"C0\"));\n" +
- " }\n" +
+ "import java.util.HashMap;\n" +
+ "import java.util.Map;\n" +
+ "\n" +
+ "public enum X {\n" +
+ " C0,\n" +
+ " C1,\n" +
+ " C2,\n" +
+ " C3,\n" +
+ " C4,\n" +
+ " C5,\n" +
+ " C6,\n" +
+ " C7,\n" +
+ " C8,\n" +
+ " C9,\n" +
+ " C10,\n" +
+ " C11,\n" +
+ " C12,\n" +
+ " C13,\n" +
+ " C14,\n" +
+ " C15,\n" +
+ " C16,\n" +
+ " C17,\n" +
+ " C18,\n" +
+ " C19,\n" +
+ " C20,\n" +
+ " C21,\n" +
+ " C22,\n" +
+ " C23,\n" +
+ " C24,\n" +
+ " C25,\n" +
+ " C26,\n" +
+ " C27,\n" +
+ " C28,\n" +
+ " C29,\n" +
+ " C30,\n" +
+ " C31,\n" +
+ " C32,\n" +
+ " C33,\n" +
+ " C34,\n" +
+ " C35,\n" +
+ " C36,\n" +
+ " C37,\n" +
+ " C38,\n" +
+ " C39,\n" +
+ " C40,\n" +
+ " C41,\n" +
+ " C42,\n" +
+ " C43,\n" +
+ " C44,\n" +
+ " C45,\n" +
+ " C46,\n" +
+ " C47,\n" +
+ " C48,\n" +
+ " C49,\n" +
+ " C50,\n" +
+ " C51,\n" +
+ " C52,\n" +
+ " C53,\n" +
+ " C54,\n" +
+ " C55,\n" +
+ " C56,\n" +
+ " C57,\n" +
+ " C58,\n" +
+ " C59,\n" +
+ " C60,\n" +
+ " C61,\n" +
+ " C62,\n" +
+ " C63,\n" +
+ " C64,\n" +
+ " C65,\n" +
+ " C66,\n" +
+ " C67,\n" +
+ " C68,\n" +
+ " C69,\n" +
+ " C70,\n" +
+ " C71,\n" +
+ " C72,\n" +
+ " C73,\n" +
+ " C74,\n" +
+ " C75,\n" +
+ " C76,\n" +
+ " C77,\n" +
+ " C78,\n" +
+ " C79,\n" +
+ " C80,\n" +
+ " C81,\n" +
+ " C82,\n" +
+ " C83,\n" +
+ " C84,\n" +
+ " C85,\n" +
+ " C86,\n" +
+ " C87,\n" +
+ " C88,\n" +
+ " C89,\n" +
+ " C90,\n" +
+ " C91,\n" +
+ " C92,\n" +
+ " C93,\n" +
+ " C94,\n" +
+ " C95,\n" +
+ " C96,\n" +
+ " C97,\n" +
+ " C98,\n" +
+ " C99,\n" +
+ " C100,\n" +
+ " C101,\n" +
+ " C102,\n" +
+ " C103,\n" +
+ " C104,\n" +
+ " C105,\n" +
+ " C106,\n" +
+ " C107,\n" +
+ " C108,\n" +
+ " C109,\n" +
+ " C110,\n" +
+ " C111,\n" +
+ " C112,\n" +
+ " C113,\n" +
+ " C114,\n" +
+ " C115,\n" +
+ " C116,\n" +
+ " C117,\n" +
+ " C118,\n" +
+ " C119,\n" +
+ " C120,\n" +
+ " C121,\n" +
+ " C122,\n" +
+ " C123,\n" +
+ " C124,\n" +
+ " C125,\n" +
+ " C126,\n" +
+ " C127,\n" +
+ " C128,\n" +
+ " C129,\n" +
+ " C130,\n" +
+ " C131,\n" +
+ " C132,\n" +
+ " C133,\n" +
+ " C134,\n" +
+ " C135,\n" +
+ " C136,\n" +
+ " C137,\n" +
+ " C138,\n" +
+ " C139,\n" +
+ " C140,\n" +
+ " C141,\n" +
+ " C142,\n" +
+ " C143,\n" +
+ " C144,\n" +
+ " C145,\n" +
+ " C146,\n" +
+ " C147,\n" +
+ " C148,\n" +
+ " C149,\n" +
+ " C150,\n" +
+ " C151,\n" +
+ " C152,\n" +
+ " C153,\n" +
+ " C154,\n" +
+ " C155,\n" +
+ " C156,\n" +
+ " C157,\n" +
+ " C158,\n" +
+ " C159,\n" +
+ " C160,\n" +
+ " C161,\n" +
+ " C162,\n" +
+ " C163,\n" +
+ " C164,\n" +
+ " C165,\n" +
+ " C166,\n" +
+ " C167,\n" +
+ " C168,\n" +
+ " C169,\n" +
+ " C170,\n" +
+ " C171,\n" +
+ " C172,\n" +
+ " C173,\n" +
+ " C174,\n" +
+ " C175,\n" +
+ " C176,\n" +
+ " C177,\n" +
+ " C178,\n" +
+ " C179,\n" +
+ " C180,\n" +
+ " C181,\n" +
+ " C182,\n" +
+ " C183,\n" +
+ " C184,\n" +
+ " C185,\n" +
+ " C186,\n" +
+ " C187,\n" +
+ " C188,\n" +
+ " C189,\n" +
+ " C190,\n" +
+ " C191,\n" +
+ " C192,\n" +
+ " C193,\n" +
+ " C194,\n" +
+ " C195,\n" +
+ " C196,\n" +
+ " C197,\n" +
+ " C198,\n" +
+ " C199,\n" +
+ " C200,\n" +
+ " C201,\n" +
+ " C202,\n" +
+ " C203,\n" +
+ " C204,\n" +
+ " C205,\n" +
+ " C206,\n" +
+ " C207,\n" +
+ " C208,\n" +
+ " C209,\n" +
+ " C210,\n" +
+ " C211,\n" +
+ " C212,\n" +
+ " C213,\n" +
+ " C214,\n" +
+ " C215,\n" +
+ " C216,\n" +
+ " C217,\n" +
+ " C218,\n" +
+ " C219,\n" +
+ " C220,\n" +
+ " C221,\n" +
+ " C222,\n" +
+ " C223,\n" +
+ " C224,\n" +
+ " C225,\n" +
+ " C226,\n" +
+ " C227,\n" +
+ " C228,\n" +
+ " C229,\n" +
+ " C230,\n" +
+ " C231,\n" +
+ " C232,\n" +
+ " C233,\n" +
+ " C234,\n" +
+ " C235,\n" +
+ " C236,\n" +
+ " C237,\n" +
+ " C238,\n" +
+ " C239,\n" +
+ " C240,\n" +
+ " C241,\n" +
+ " C242,\n" +
+ " C243,\n" +
+ " C244,\n" +
+ " C245,\n" +
+ " C246,\n" +
+ " C247,\n" +
+ " C248,\n" +
+ " C249,\n" +
+ " C250,\n" +
+ " C251,\n" +
+ " C252,\n" +
+ " C253,\n" +
+ " C254,\n" +
+ " C255,\n" +
+ " C256,\n" +
+ " C257,\n" +
+ " C258,\n" +
+ " C259,\n" +
+ " C260,\n" +
+ " C261,\n" +
+ " C262,\n" +
+ " C263,\n" +
+ " C264,\n" +
+ " C265,\n" +
+ " C266,\n" +
+ " C267,\n" +
+ " C268,\n" +
+ " C269,\n" +
+ " C270,\n" +
+ " C271,\n" +
+ " C272,\n" +
+ " C273,\n" +
+ " C274,\n" +
+ " C275,\n" +
+ " C276,\n" +
+ " C277,\n" +
+ " C278,\n" +
+ " C279,\n" +
+ " C280,\n" +
+ " C281,\n" +
+ " C282,\n" +
+ " C283,\n" +
+ " C284,\n" +
+ " C285,\n" +
+ " C286,\n" +
+ " C287,\n" +
+ " C288,\n" +
+ " C289,\n" +
+ " C290,\n" +
+ " C291,\n" +
+ " C292,\n" +
+ " C293,\n" +
+ " C294,\n" +
+ " C295,\n" +
+ " C296,\n" +
+ " C297,\n" +
+ " C298,\n" +
+ " C299,\n" +
+ " C300,\n" +
+ " C301,\n" +
+ " C302,\n" +
+ " C303,\n" +
+ " C304,\n" +
+ " C305,\n" +
+ " C306,\n" +
+ " C307,\n" +
+ " C308,\n" +
+ " C309,\n" +
+ " C310,\n" +
+ " C311,\n" +
+ " C312,\n" +
+ " C313,\n" +
+ " C314,\n" +
+ " C315,\n" +
+ " C316,\n" +
+ " C317,\n" +
+ " C318,\n" +
+ " C319,\n" +
+ " C320,\n" +
+ " C321,\n" +
+ " C322,\n" +
+ " C323,\n" +
+ " C324,\n" +
+ " C325,\n" +
+ " C326,\n" +
+ " C327,\n" +
+ " C328,\n" +
+ " C329,\n" +
+ " C330,\n" +
+ " C331,\n" +
+ " C332,\n" +
+ " C333,\n" +
+ " C334,\n" +
+ " C335,\n" +
+ " C336,\n" +
+ " C337,\n" +
+ " C338,\n" +
+ " C339,\n" +
+ " C340,\n" +
+ " C341,\n" +
+ " C342,\n" +
+ " C343,\n" +
+ " C344,\n" +
+ " C345,\n" +
+ " C346,\n" +
+ " C347,\n" +
+ " C348,\n" +
+ " C349,\n" +
+ " C350,\n" +
+ " C351,\n" +
+ " C352,\n" +
+ " C353,\n" +
+ " C354,\n" +
+ " C355,\n" +
+ " C356,\n" +
+ " C357,\n" +
+ " C358,\n" +
+ " C359,\n" +
+ " C360,\n" +
+ " C361,\n" +
+ " C362,\n" +
+ " C363,\n" +
+ " C364,\n" +
+ " C365,\n" +
+ " C366,\n" +
+ " C367,\n" +
+ " C368,\n" +
+ " C369,\n" +
+ " C370,\n" +
+ " C371,\n" +
+ " C372,\n" +
+ " C373,\n" +
+ " C374,\n" +
+ " C375,\n" +
+ " C376,\n" +
+ " C377,\n" +
+ " C378,\n" +
+ " C379,\n" +
+ " C380,\n" +
+ " C381,\n" +
+ " C382,\n" +
+ " C383,\n" +
+ " C384,\n" +
+ " C385,\n" +
+ " C386,\n" +
+ " C387,\n" +
+ " C388,\n" +
+ " C389,\n" +
+ " C390,\n" +
+ " C391,\n" +
+ " C392,\n" +
+ " C393,\n" +
+ " C394,\n" +
+ " C395,\n" +
+ " C396,\n" +
+ " C397,\n" +
+ " C398,\n" +
+ " C399,\n" +
+ " C400,\n" +
+ " C401,\n" +
+ " C402,\n" +
+ " C403,\n" +
+ " C404,\n" +
+ " C405,\n" +
+ " C406,\n" +
+ " C407,\n" +
+ " C408,\n" +
+ " C409,\n" +
+ " C410,\n" +
+ " C411,\n" +
+ " C412,\n" +
+ " C413,\n" +
+ " C414,\n" +
+ " C415,\n" +
+ " C416,\n" +
+ " C417,\n" +
+ " C418,\n" +
+ " C419,\n" +
+ " C420,\n" +
+ " C421,\n" +
+ " C422,\n" +
+ " C423,\n" +
+ " C424,\n" +
+ " C425,\n" +
+ " C426,\n" +
+ " C427,\n" +
+ " C428,\n" +
+ " C429,\n" +
+ " C430,\n" +
+ " C431,\n" +
+ " C432,\n" +
+ " C433,\n" +
+ " C434,\n" +
+ " C435,\n" +
+ " C436,\n" +
+ " C437,\n" +
+ " C438,\n" +
+ " C439,\n" +
+ " C440,\n" +
+ " C441,\n" +
+ " C442,\n" +
+ " C443,\n" +
+ " C444,\n" +
+ " C445,\n" +
+ " C446,\n" +
+ " C447,\n" +
+ " C448,\n" +
+ " C449,\n" +
+ " C450,\n" +
+ " C451,\n" +
+ " C452,\n" +
+ " C453,\n" +
+ " C454,\n" +
+ " C455,\n" +
+ " C456,\n" +
+ " C457,\n" +
+ " C458,\n" +
+ " C459,\n" +
+ " C460,\n" +
+ " C461,\n" +
+ " C462,\n" +
+ " C463,\n" +
+ " C464,\n" +
+ " C465,\n" +
+ " C466,\n" +
+ " C467,\n" +
+ " C468,\n" +
+ " C469,\n" +
+ " C470,\n" +
+ " C471,\n" +
+ " C472,\n" +
+ " C473,\n" +
+ " C474,\n" +
+ " C475,\n" +
+ " C476,\n" +
+ " C477,\n" +
+ " C478,\n" +
+ " C479,\n" +
+ " C480,\n" +
+ " C481,\n" +
+ " C482,\n" +
+ " C483,\n" +
+ " C484,\n" +
+ " C485,\n" +
+ " C486,\n" +
+ " C487,\n" +
+ " C488,\n" +
+ " C489,\n" +
+ " C490,\n" +
+ " C491,\n" +
+ " C492,\n" +
+ " C493,\n" +
+ " C494,\n" +
+ " C495,\n" +
+ " C496,\n" +
+ " C497,\n" +
+ " C498,\n" +
+ " C499,\n" +
+ " C500,\n" +
+ " C501,\n" +
+ " C502,\n" +
+ " C503,\n" +
+ " C504,\n" +
+ " C505,\n" +
+ " C506,\n" +
+ " C507,\n" +
+ " C508,\n" +
+ " C509,\n" +
+ " C510,\n" +
+ " C511,\n" +
+ " C512,\n" +
+ " C513,\n" +
+ " C514,\n" +
+ " C515,\n" +
+ " C516,\n" +
+ " C517,\n" +
+ " C518,\n" +
+ " C519,\n" +
+ " C520,\n" +
+ " C521,\n" +
+ " C522,\n" +
+ " C523,\n" +
+ " C524,\n" +
+ " C525,\n" +
+ " C526,\n" +
+ " C527,\n" +
+ " C528,\n" +
+ " C529,\n" +
+ " C530,\n" +
+ " C531,\n" +
+ " C532,\n" +
+ " C533,\n" +
+ " C534,\n" +
+ " C535,\n" +
+ " C536,\n" +
+ " C537,\n" +
+ " C538,\n" +
+ " C539,\n" +
+ " C540,\n" +
+ " C541,\n" +
+ " C542,\n" +
+ " C543,\n" +
+ " C544,\n" +
+ " C545,\n" +
+ " C546,\n" +
+ " C547,\n" +
+ " C548,\n" +
+ " C549,\n" +
+ " C550,\n" +
+ " C551,\n" +
+ " C552,\n" +
+ " C553,\n" +
+ " C554,\n" +
+ " C555,\n" +
+ " C556,\n" +
+ " C557,\n" +
+ " C558,\n" +
+ " C559,\n" +
+ " C560,\n" +
+ " C561,\n" +
+ " C562,\n" +
+ " C563,\n" +
+ " C564,\n" +
+ " C565,\n" +
+ " C566,\n" +
+ " C567,\n" +
+ " C568,\n" +
+ " C569,\n" +
+ " C570,\n" +
+ " C571,\n" +
+ " C572,\n" +
+ " C573,\n" +
+ " C574,\n" +
+ " C575,\n" +
+ " C576,\n" +
+ " C577,\n" +
+ " C578,\n" +
+ " C579,\n" +
+ " C580,\n" +
+ " C581,\n" +
+ " C582,\n" +
+ " C583,\n" +
+ " C584,\n" +
+ " C585,\n" +
+ " C586,\n" +
+ " C587,\n" +
+ " C588,\n" +
+ " C589,\n" +
+ " C590,\n" +
+ " C591,\n" +
+ " C592,\n" +
+ " C593,\n" +
+ " C594,\n" +
+ " C595,\n" +
+ " C596,\n" +
+ " C597,\n" +
+ " C598,\n" +
+ " C599,\n" +
+ " C600,\n" +
+ " C601,\n" +
+ " C602,\n" +
+ " C603,\n" +
+ " C604,\n" +
+ " C605,\n" +
+ " C606,\n" +
+ " C607,\n" +
+ " C608,\n" +
+ " C609,\n" +
+ " C610,\n" +
+ " C611,\n" +
+ " C612,\n" +
+ " C613,\n" +
+ " C614,\n" +
+ " C615,\n" +
+ " C616,\n" +
+ " C617,\n" +
+ " C618,\n" +
+ " C619,\n" +
+ " C620,\n" +
+ " C621,\n" +
+ " C622,\n" +
+ " C623,\n" +
+ " C624,\n" +
+ " C625,\n" +
+ " C626,\n" +
+ " C627,\n" +
+ " C628,\n" +
+ " C629,\n" +
+ " C630,\n" +
+ " C631,\n" +
+ " C632,\n" +
+ " C633,\n" +
+ " C634,\n" +
+ " C635,\n" +
+ " C636,\n" +
+ " C637,\n" +
+ " C638,\n" +
+ " C639,\n" +
+ " C640,\n" +
+ " C641,\n" +
+ " C642,\n" +
+ " C643,\n" +
+ " C644,\n" +
+ " C645,\n" +
+ " C646,\n" +
+ " C647,\n" +
+ " C648,\n" +
+ " C649,\n" +
+ " C650,\n" +
+ " C651,\n" +
+ " C652,\n" +
+ " C653,\n" +
+ " C654,\n" +
+ " C655,\n" +
+ " C656,\n" +
+ " C657,\n" +
+ " C658,\n" +
+ " C659,\n" +
+ " C660,\n" +
+ " C661,\n" +
+ " C662,\n" +
+ " C663,\n" +
+ " C664,\n" +
+ " C665,\n" +
+ " C666,\n" +
+ " C667,\n" +
+ " C668,\n" +
+ " C669,\n" +
+ " C670,\n" +
+ " C671,\n" +
+ " C672,\n" +
+ " C673,\n" +
+ " C674,\n" +
+ " C675,\n" +
+ " C676,\n" +
+ " C677,\n" +
+ " C678,\n" +
+ " C679,\n" +
+ " C680,\n" +
+ " C681,\n" +
+ " C682,\n" +
+ " C683,\n" +
+ " C684,\n" +
+ " C685,\n" +
+ " C686,\n" +
+ " C687,\n" +
+ " C688,\n" +
+ " C689,\n" +
+ " C690,\n" +
+ " C691,\n" +
+ " C692,\n" +
+ " C693,\n" +
+ " C694,\n" +
+ " C695,\n" +
+ " C696,\n" +
+ " C697,\n" +
+ " C698,\n" +
+ " C699,\n" +
+ " C700,\n" +
+ " C701,\n" +
+ " C702,\n" +
+ " C703,\n" +
+ " C704,\n" +
+ " C705,\n" +
+ " C706,\n" +
+ " C707,\n" +
+ " C708,\n" +
+ " C709,\n" +
+ " C710,\n" +
+ " C711,\n" +
+ " C712,\n" +
+ " C713,\n" +
+ " C714,\n" +
+ " C715,\n" +
+ " C716,\n" +
+ " C717,\n" +
+ " C718,\n" +
+ " C719,\n" +
+ " C720,\n" +
+ " C721,\n" +
+ " C722,\n" +
+ " C723,\n" +
+ " C724,\n" +
+ " C725,\n" +
+ " C726,\n" +
+ " C727,\n" +
+ " C728,\n" +
+ " C729,\n" +
+ " C730,\n" +
+ " C731,\n" +
+ " C732,\n" +
+ " C733,\n" +
+ " C734,\n" +
+ " C735,\n" +
+ " C736,\n" +
+ " C737,\n" +
+ " C738,\n" +
+ " C739,\n" +
+ " C740,\n" +
+ " C741,\n" +
+ " C742,\n" +
+ " C743,\n" +
+ " C744,\n" +
+ " C745,\n" +
+ " C746,\n" +
+ " C747,\n" +
+ " C748,\n" +
+ " C749,\n" +
+ " C750,\n" +
+ " C751,\n" +
+ " C752,\n" +
+ " C753,\n" +
+ " C754,\n" +
+ " C755,\n" +
+ " C756,\n" +
+ " C757,\n" +
+ " C758,\n" +
+ " C759,\n" +
+ " C760,\n" +
+ " C761,\n" +
+ " C762,\n" +
+ " C763,\n" +
+ " C764,\n" +
+ " C765,\n" +
+ " C766,\n" +
+ " C767,\n" +
+ " C768,\n" +
+ " C769,\n" +
+ " C770,\n" +
+ " C771,\n" +
+ " C772,\n" +
+ " C773,\n" +
+ " C774,\n" +
+ " C775,\n" +
+ " C776,\n" +
+ " C777,\n" +
+ " C778,\n" +
+ " C779,\n" +
+ " C780,\n" +
+ " C781,\n" +
+ " C782,\n" +
+ " C783,\n" +
+ " C784,\n" +
+ " C785,\n" +
+ " C786,\n" +
+ " C787,\n" +
+ " C788,\n" +
+ " C789,\n" +
+ " C790,\n" +
+ " C791,\n" +
+ " C792,\n" +
+ " C793,\n" +
+ " C794,\n" +
+ " C795,\n" +
+ " C796,\n" +
+ " C797,\n" +
+ " C798,\n" +
+ " C799,\n" +
+ " C800,\n" +
+ " C801,\n" +
+ " C802,\n" +
+ " C803,\n" +
+ " C804,\n" +
+ " C805,\n" +
+ " C806,\n" +
+ " C807,\n" +
+ " C808,\n" +
+ " C809,\n" +
+ " C810,\n" +
+ " C811,\n" +
+ " C812,\n" +
+ " C813,\n" +
+ " C814,\n" +
+ " C815,\n" +
+ " C816,\n" +
+ " C817,\n" +
+ " C818,\n" +
+ " C819,\n" +
+ " C820,\n" +
+ " C821,\n" +
+ " C822,\n" +
+ " C823,\n" +
+ " C824,\n" +
+ " C825,\n" +
+ " C826,\n" +
+ " C827,\n" +
+ " C828,\n" +
+ " C829,\n" +
+ " C830,\n" +
+ " C831,\n" +
+ " C832,\n" +
+ " C833,\n" +
+ " C834,\n" +
+ " C835,\n" +
+ " C836,\n" +
+ " C837,\n" +
+ " C838,\n" +
+ " C839,\n" +
+ " C840,\n" +
+ " C841,\n" +
+ " C842,\n" +
+ " C843,\n" +
+ " C844,\n" +
+ " C845,\n" +
+ " C846,\n" +
+ " C847,\n" +
+ " C848,\n" +
+ " C849,\n" +
+ " C850,\n" +
+ " C851,\n" +
+ " C852,\n" +
+ " C853,\n" +
+ " C854,\n" +
+ " C855,\n" +
+ " C856,\n" +
+ " C857,\n" +
+ " C858,\n" +
+ " C859,\n" +
+ " C860,\n" +
+ " C861,\n" +
+ " C862,\n" +
+ " C863,\n" +
+ " C864,\n" +
+ " C865,\n" +
+ " C866,\n" +
+ " C867,\n" +
+ " C868,\n" +
+ " C869,\n" +
+ " C870,\n" +
+ " C871,\n" +
+ " C872,\n" +
+ " C873,\n" +
+ " C874,\n" +
+ " C875,\n" +
+ " C876,\n" +
+ " C877,\n" +
+ " C878,\n" +
+ " C879,\n" +
+ " C880,\n" +
+ " C881,\n" +
+ " C882,\n" +
+ " C883,\n" +
+ " C884,\n" +
+ " C885,\n" +
+ " C886,\n" +
+ " C887,\n" +
+ " C888,\n" +
+ " C889,\n" +
+ " C890,\n" +
+ " C891,\n" +
+ " C892,\n" +
+ " C893,\n" +
+ " C894,\n" +
+ " C895,\n" +
+ " C896,\n" +
+ " C897,\n" +
+ " C898,\n" +
+ " C899,\n" +
+ " C900,\n" +
+ " C901,\n" +
+ " C902,\n" +
+ " C903,\n" +
+ " C904,\n" +
+ " C905,\n" +
+ " C906,\n" +
+ " C907,\n" +
+ " C908,\n" +
+ " C909,\n" +
+ " C910,\n" +
+ " C911,\n" +
+ " C912,\n" +
+ " C913,\n" +
+ " C914,\n" +
+ " C915,\n" +
+ " C916,\n" +
+ " C917,\n" +
+ " C918,\n" +
+ " C919,\n" +
+ " C920,\n" +
+ " C921,\n" +
+ " C922,\n" +
+ " C923,\n" +
+ " C924,\n" +
+ " C925,\n" +
+ " C926,\n" +
+ " C927,\n" +
+ " C928,\n" +
+ " C929,\n" +
+ " C930,\n" +
+ " C931,\n" +
+ " C932,\n" +
+ " C933,\n" +
+ " C934,\n" +
+ " C935,\n" +
+ " C936,\n" +
+ " C937,\n" +
+ " C938,\n" +
+ " C939,\n" +
+ " C940,\n" +
+ " C941,\n" +
+ " C942,\n" +
+ " C943,\n" +
+ " C944,\n" +
+ " C945,\n" +
+ " C946,\n" +
+ " C947,\n" +
+ " C948,\n" +
+ " C949,\n" +
+ " C950,\n" +
+ " C951,\n" +
+ " C952,\n" +
+ " C953,\n" +
+ " C954,\n" +
+ " C955,\n" +
+ " C956,\n" +
+ " C957,\n" +
+ " C958,\n" +
+ " C959,\n" +
+ " C960,\n" +
+ " C961,\n" +
+ " C962,\n" +
+ " C963,\n" +
+ " C964,\n" +
+ " C965,\n" +
+ " C966,\n" +
+ " C967,\n" +
+ " C968,\n" +
+ " C969,\n" +
+ " C970,\n" +
+ " C971,\n" +
+ " C972,\n" +
+ " C973,\n" +
+ " C974,\n" +
+ " C975,\n" +
+ " C976,\n" +
+ " C977,\n" +
+ " C978,\n" +
+ " C979,\n" +
+ " C980,\n" +
+ " C981,\n" +
+ " C982,\n" +
+ " C983,\n" +
+ " C984,\n" +
+ " C985,\n" +
+ " C986,\n" +
+ " C987,\n" +
+ " C988,\n" +
+ " C989,\n" +
+ " C990,\n" +
+ " C991,\n" +
+ " C992,\n" +
+ " C993,\n" +
+ " C994,\n" +
+ " C995,\n" +
+ " C996,\n" +
+ " C997,\n" +
+ " C998,\n" +
+ " C999,\n" +
+ " C1000,\n" +
+ " C1001,\n" +
+ " C1002,\n" +
+ " C1003,\n" +
+ " C1004,\n" +
+ " C1005,\n" +
+ " C1006,\n" +
+ " C1007,\n" +
+ " C1008,\n" +
+ " C1009,\n" +
+ " C1010,\n" +
+ " C1011,\n" +
+ " C1012,\n" +
+ " C1013,\n" +
+ " C1014,\n" +
+ " C1015,\n" +
+ " C1016,\n" +
+ " C1017,\n" +
+ " C1018,\n" +
+ " C1019,\n" +
+ " C1020,\n" +
+ " C1021,\n" +
+ " C1022,\n" +
+ " C1023,\n" +
+ " C1024,\n" +
+ " C1025,\n" +
+ " C1026,\n" +
+ " C1027,\n" +
+ " C1028,\n" +
+ " C1029,\n" +
+ " C1030,\n" +
+ " C1031,\n" +
+ " C1032,\n" +
+ " C1033,\n" +
+ " C1034,\n" +
+ " C1035,\n" +
+ " C1036,\n" +
+ " C1037,\n" +
+ " C1038,\n" +
+ " C1039,\n" +
+ " C1040,\n" +
+ " C1041,\n" +
+ " C1042,\n" +
+ " C1043,\n" +
+ " C1044,\n" +
+ " C1045,\n" +
+ " C1046,\n" +
+ " C1047,\n" +
+ " C1048,\n" +
+ " C1049,\n" +
+ " C1050,\n" +
+ " C1051,\n" +
+ " C1052,\n" +
+ " C1053,\n" +
+ " C1054,\n" +
+ " C1055,\n" +
+ " C1056,\n" +
+ " C1057,\n" +
+ " C1058,\n" +
+ " C1059,\n" +
+ " C1060,\n" +
+ " C1061,\n" +
+ " C1062,\n" +
+ " C1063,\n" +
+ " C1064,\n" +
+ " C1065,\n" +
+ " C1066,\n" +
+ " C1067,\n" +
+ " C1068,\n" +
+ " C1069,\n" +
+ " C1070,\n" +
+ " C1071,\n" +
+ " C1072,\n" +
+ " C1073,\n" +
+ " C1074,\n" +
+ " C1075,\n" +
+ " C1076,\n" +
+ " C1077,\n" +
+ " C1078,\n" +
+ " C1079,\n" +
+ " C1080,\n" +
+ " C1081,\n" +
+ " C1082,\n" +
+ " C1083,\n" +
+ " C1084,\n" +
+ " C1085,\n" +
+ " C1086,\n" +
+ " C1087,\n" +
+ " C1088,\n" +
+ " C1089,\n" +
+ " C1090,\n" +
+ " C1091,\n" +
+ " C1092,\n" +
+ " C1093,\n" +
+ " C1094,\n" +
+ " C1095,\n" +
+ " C1096,\n" +
+ " C1097,\n" +
+ " C1098,\n" +
+ " C1099,\n" +
+ " C1100,\n" +
+ " C1101,\n" +
+ " C1102,\n" +
+ " C1103,\n" +
+ " C1104,\n" +
+ " C1105,\n" +
+ " C1106,\n" +
+ " C1107,\n" +
+ " C1108,\n" +
+ " C1109,\n" +
+ " C1110,\n" +
+ " C1111,\n" +
+ " C1112,\n" +
+ " C1113,\n" +
+ " C1114,\n" +
+ " C1115,\n" +
+ " C1116,\n" +
+ " C1117,\n" +
+ " C1118,\n" +
+ " C1119,\n" +
+ " C1120,\n" +
+ " C1121,\n" +
+ " C1122,\n" +
+ " C1123,\n" +
+ " C1124,\n" +
+ " C1125,\n" +
+ " C1126,\n" +
+ " C1127,\n" +
+ " C1128,\n" +
+ " C1129,\n" +
+ " C1130,\n" +
+ " C1131,\n" +
+ " C1132,\n" +
+ " C1133,\n" +
+ " C1134,\n" +
+ " C1135,\n" +
+ " C1136,\n" +
+ " C1137,\n" +
+ " C1138,\n" +
+ " C1139,\n" +
+ " C1140,\n" +
+ " C1141,\n" +
+ " C1142,\n" +
+ " C1143,\n" +
+ " C1144,\n" +
+ " C1145,\n" +
+ " C1146,\n" +
+ " C1147,\n" +
+ " C1148,\n" +
+ " C1149,\n" +
+ " C1150,\n" +
+ " C1151,\n" +
+ " C1152,\n" +
+ " C1153,\n" +
+ " C1154,\n" +
+ " C1155,\n" +
+ " C1156,\n" +
+ " C1157,\n" +
+ " C1158,\n" +
+ " C1159,\n" +
+ " C1160,\n" +
+ " C1161,\n" +
+ " C1162,\n" +
+ " C1163,\n" +
+ " C1164,\n" +
+ " C1165,\n" +
+ " C1166,\n" +
+ " C1167,\n" +
+ " C1168,\n" +
+ " C1169,\n" +
+ " C1170,\n" +
+ " C1171,\n" +
+ " C1172,\n" +
+ " C1173,\n" +
+ " C1174,\n" +
+ " C1175,\n" +
+ " C1176,\n" +
+ " C1177,\n" +
+ " C1178,\n" +
+ " C1179,\n" +
+ " C1180,\n" +
+ " C1181,\n" +
+ " C1182,\n" +
+ " C1183,\n" +
+ " C1184,\n" +
+ " C1185,\n" +
+ " C1186,\n" +
+ " C1187,\n" +
+ " C1188,\n" +
+ " C1189,\n" +
+ " C1190,\n" +
+ " C1191,\n" +
+ " C1192,\n" +
+ " C1193,\n" +
+ " C1194,\n" +
+ " C1195,\n" +
+ " C1196,\n" +
+ " C1197,\n" +
+ " C1198,\n" +
+ " C1199,\n" +
+ " C1200,\n" +
+ " C1201,\n" +
+ " C1202,\n" +
+ " C1203,\n" +
+ " C1204,\n" +
+ " C1205,\n" +
+ " C1206,\n" +
+ " C1207,\n" +
+ " C1208,\n" +
+ " C1209,\n" +
+ " C1210,\n" +
+ " C1211,\n" +
+ " C1212,\n" +
+ " C1213,\n" +
+ " C1214,\n" +
+ " C1215,\n" +
+ " C1216,\n" +
+ " C1217,\n" +
+ " C1218,\n" +
+ " C1219,\n" +
+ " C1220,\n" +
+ " C1221,\n" +
+ " C1222,\n" +
+ " C1223,\n" +
+ " C1224,\n" +
+ " C1225,\n" +
+ " C1226,\n" +
+ " C1227,\n" +
+ " C1228,\n" +
+ " C1229,\n" +
+ " C1230,\n" +
+ " C1231,\n" +
+ " C1232,\n" +
+ " C1233,\n" +
+ " C1234,\n" +
+ " C1235,\n" +
+ " C1236,\n" +
+ " C1237,\n" +
+ " C1238,\n" +
+ " C1239,\n" +
+ " C1240,\n" +
+ " C1241,\n" +
+ " C1242,\n" +
+ " C1243,\n" +
+ " C1244,\n" +
+ " C1245,\n" +
+ " C1246,\n" +
+ " C1247,\n" +
+ " C1248,\n" +
+ " C1249,\n" +
+ " C1250,\n" +
+ " C1251,\n" +
+ " C1252,\n" +
+ " C1253,\n" +
+ " C1254,\n" +
+ " C1255,\n" +
+ " C1256,\n" +
+ " C1257,\n" +
+ " C1258,\n" +
+ " C1259,\n" +
+ " C1260,\n" +
+ " C1261,\n" +
+ " C1262,\n" +
+ " C1263,\n" +
+ " C1264,\n" +
+ " C1265,\n" +
+ " C1266,\n" +
+ " C1267,\n" +
+ " C1268,\n" +
+ " C1269,\n" +
+ " C1270,\n" +
+ " C1271,\n" +
+ " C1272,\n" +
+ " C1273,\n" +
+ " C1274,\n" +
+ " C1275,\n" +
+ " C1276,\n" +
+ " C1277,\n" +
+ " C1278,\n" +
+ " C1279,\n" +
+ " C1280,\n" +
+ " C1281,\n" +
+ " C1282,\n" +
+ " C1283,\n" +
+ " C1284,\n" +
+ " C1285,\n" +
+ " C1286,\n" +
+ " C1287,\n" +
+ " C1288,\n" +
+ " C1289,\n" +
+ " C1290,\n" +
+ " C1291,\n" +
+ " C1292,\n" +
+ " C1293,\n" +
+ " C1294,\n" +
+ " C1295,\n" +
+ " C1296,\n" +
+ " C1297,\n" +
+ " C1298,\n" +
+ " C1299,\n" +
+ " C1300,\n" +
+ " C1301,\n" +
+ " C1302,\n" +
+ " C1303,\n" +
+ " C1304,\n" +
+ " C1305,\n" +
+ " C1306,\n" +
+ " C1307,\n" +
+ " C1308,\n" +
+ " C1309,\n" +
+ " C1310,\n" +
+ " C1311,\n" +
+ " C1312,\n" +
+ " C1313,\n" +
+ " C1314,\n" +
+ " C1315,\n" +
+ " C1316,\n" +
+ " C1317,\n" +
+ " C1318,\n" +
+ " C1319,\n" +
+ " C1320,\n" +
+ " C1321,\n" +
+ " C1322,\n" +
+ " C1323,\n" +
+ " C1324,\n" +
+ " C1325,\n" +
+ " C1326,\n" +
+ " C1327,\n" +
+ " C1328,\n" +
+ " C1329,\n" +
+ " C1330,\n" +
+ " C1331,\n" +
+ " C1332,\n" +
+ " C1333,\n" +
+ " C1334,\n" +
+ " C1335,\n" +
+ " C1336,\n" +
+ " C1337,\n" +
+ " C1338,\n" +
+ " C1339,\n" +
+ " C1340,\n" +
+ " C1341,\n" +
+ " C1342,\n" +
+ " C1343,\n" +
+ " C1344,\n" +
+ " C1345,\n" +
+ " C1346,\n" +
+ " C1347,\n" +
+ " C1348,\n" +
+ " C1349,\n" +
+ " C1350,\n" +
+ " C1351,\n" +
+ " C1352,\n" +
+ " C1353,\n" +
+ " C1354,\n" +
+ " C1355,\n" +
+ " C1356,\n" +
+ " C1357,\n" +
+ " C1358,\n" +
+ " C1359,\n" +
+ " C1360,\n" +
+ " C1361,\n" +
+ " C1362,\n" +
+ " C1363,\n" +
+ " C1364,\n" +
+ " C1365,\n" +
+ " C1366,\n" +
+ " C1367,\n" +
+ " C1368,\n" +
+ " C1369,\n" +
+ " C1370,\n" +
+ " C1371,\n" +
+ " C1372,\n" +
+ " C1373,\n" +
+ " C1374,\n" +
+ " C1375,\n" +
+ " C1376,\n" +
+ " C1377,\n" +
+ " C1378,\n" +
+ " C1379,\n" +
+ " C1380,\n" +
+ " C1381,\n" +
+ " C1382,\n" +
+ " C1383,\n" +
+ " C1384,\n" +
+ " C1385,\n" +
+ " C1386,\n" +
+ " C1387,\n" +
+ " C1388,\n" +
+ " C1389,\n" +
+ " C1390,\n" +
+ " C1391,\n" +
+ " C1392,\n" +
+ " C1393,\n" +
+ " C1394,\n" +
+ " C1395,\n" +
+ " C1396,\n" +
+ " C1397,\n" +
+ " C1398,\n" +
+ " C1399,\n" +
+ " C1400,\n" +
+ " C1401,\n" +
+ " C1402,\n" +
+ " C1403,\n" +
+ " C1404,\n" +
+ " C1405,\n" +
+ " C1406,\n" +
+ " C1407,\n" +
+ " C1408,\n" +
+ " C1409,\n" +
+ " C1410,\n" +
+ " C1411,\n" +
+ " C1412,\n" +
+ " C1413,\n" +
+ " C1414,\n" +
+ " C1415,\n" +
+ " C1416,\n" +
+ " C1417,\n" +
+ " C1418,\n" +
+ " C1419,\n" +
+ " C1420,\n" +
+ " C1421,\n" +
+ " C1422,\n" +
+ " C1423,\n" +
+ " C1424,\n" +
+ " C1425,\n" +
+ " C1426,\n" +
+ " C1427,\n" +
+ " C1428,\n" +
+ " C1429,\n" +
+ " C1430,\n" +
+ " C1431,\n" +
+ " C1432,\n" +
+ " C1433,\n" +
+ " C1434,\n" +
+ " C1435,\n" +
+ " C1436,\n" +
+ " C1437,\n" +
+ " C1438,\n" +
+ " C1439,\n" +
+ " C1440,\n" +
+ " C1441,\n" +
+ " C1442,\n" +
+ " C1443,\n" +
+ " C1444,\n" +
+ " C1445,\n" +
+ " C1446,\n" +
+ " C1447,\n" +
+ " C1448,\n" +
+ " C1449,\n" +
+ " C1450,\n" +
+ " C1451,\n" +
+ " C1452,\n" +
+ " C1453,\n" +
+ " C1454,\n" +
+ " C1455,\n" +
+ " C1456,\n" +
+ " C1457,\n" +
+ " C1458,\n" +
+ " C1459,\n" +
+ " C1460,\n" +
+ " C1461,\n" +
+ " C1462,\n" +
+ " C1463,\n" +
+ " C1464,\n" +
+ " C1465,\n" +
+ " C1466,\n" +
+ " C1467,\n" +
+ " C1468,\n" +
+ " C1469,\n" +
+ " C1470,\n" +
+ " C1471,\n" +
+ " C1472,\n" +
+ " C1473,\n" +
+ " C1474,\n" +
+ " C1475,\n" +
+ " C1476,\n" +
+ " C1477,\n" +
+ " C1478,\n" +
+ " C1479,\n" +
+ " C1480,\n" +
+ " C1481,\n" +
+ " C1482,\n" +
+ " C1483,\n" +
+ " C1484,\n" +
+ " C1485,\n" +
+ " C1486,\n" +
+ " C1487,\n" +
+ " C1488,\n" +
+ " C1489,\n" +
+ " C1490,\n" +
+ " C1491,\n" +
+ " C1492,\n" +
+ " C1493,\n" +
+ " C1494,\n" +
+ " C1495,\n" +
+ " C1496,\n" +
+ " C1497,\n" +
+ " C1498,\n" +
+ " C1499,\n" +
+ " C1500,\n" +
+ " C1501,\n" +
+ " C1502,\n" +
+ " C1503,\n" +
+ " C1504,\n" +
+ " C1505,\n" +
+ " C1506,\n" +
+ " C1507,\n" +
+ " C1508,\n" +
+ " C1509,\n" +
+ " C1510,\n" +
+ " C1511,\n" +
+ " C1512,\n" +
+ " C1513,\n" +
+ " C1514,\n" +
+ " C1515,\n" +
+ " C1516,\n" +
+ " C1517,\n" +
+ " C1518,\n" +
+ " C1519,\n" +
+ " C1520,\n" +
+ " C1521,\n" +
+ " C1522,\n" +
+ " C1523,\n" +
+ " C1524,\n" +
+ " C1525,\n" +
+ " C1526,\n" +
+ " C1527,\n" +
+ " C1528,\n" +
+ " C1529,\n" +
+ " C1530,\n" +
+ " C1531,\n" +
+ " C1532,\n" +
+ " C1533,\n" +
+ " C1534,\n" +
+ " C1535,\n" +
+ " C1536,\n" +
+ " C1537,\n" +
+ " C1538,\n" +
+ " C1539,\n" +
+ " C1540,\n" +
+ " C1541,\n" +
+ " C1542,\n" +
+ " C1543,\n" +
+ " C1544,\n" +
+ " C1545,\n" +
+ " C1546,\n" +
+ " C1547,\n" +
+ " C1548,\n" +
+ " C1549,\n" +
+ " C1550,\n" +
+ " C1551,\n" +
+ " C1552,\n" +
+ " C1553,\n" +
+ " C1554,\n" +
+ " C1555,\n" +
+ " C1556,\n" +
+ " C1557,\n" +
+ " C1558,\n" +
+ " C1559,\n" +
+ " C1560,\n" +
+ " C1561,\n" +
+ " C1562,\n" +
+ " C1563,\n" +
+ " C1564,\n" +
+ " C1565,\n" +
+ " C1566,\n" +
+ " C1567,\n" +
+ " C1568,\n" +
+ " C1569,\n" +
+ " C1570,\n" +
+ " C1571,\n" +
+ " C1572,\n" +
+ " C1573,\n" +
+ " C1574,\n" +
+ " C1575,\n" +
+ " C1576,\n" +
+ " C1577,\n" +
+ " C1578,\n" +
+ " C1579,\n" +
+ " C1580,\n" +
+ " C1581,\n" +
+ " C1582,\n" +
+ " C1583,\n" +
+ " C1584,\n" +
+ " C1585,\n" +
+ " C1586,\n" +
+ " C1587,\n" +
+ " C1588,\n" +
+ " C1589,\n" +
+ " C1590,\n" +
+ " C1591,\n" +
+ " C1592,\n" +
+ " C1593,\n" +
+ " C1594,\n" +
+ " C1595,\n" +
+ " C1596,\n" +
+ " C1597,\n" +
+ " C1598,\n" +
+ " C1599,\n" +
+ " C1600,\n" +
+ " C1601,\n" +
+ " C1602,\n" +
+ " C1603,\n" +
+ " C1604,\n" +
+ " C1605,\n" +
+ " C1606,\n" +
+ " C1607,\n" +
+ " C1608,\n" +
+ " C1609,\n" +
+ " C1610,\n" +
+ " C1611,\n" +
+ " C1612,\n" +
+ " C1613,\n" +
+ " C1614,\n" +
+ " C1615,\n" +
+ " C1616,\n" +
+ " C1617,\n" +
+ " C1618,\n" +
+ " C1619,\n" +
+ " C1620,\n" +
+ " C1621,\n" +
+ " C1622,\n" +
+ " C1623,\n" +
+ " C1624,\n" +
+ " C1625,\n" +
+ " C1626,\n" +
+ " C1627,\n" +
+ " C1628,\n" +
+ " C1629,\n" +
+ " C1630,\n" +
+ " C1631,\n" +
+ " C1632,\n" +
+ " C1633,\n" +
+ " C1634,\n" +
+ " C1635,\n" +
+ " C1636,\n" +
+ " C1637,\n" +
+ " C1638,\n" +
+ " C1639,\n" +
+ " C1640,\n" +
+ " C1641,\n" +
+ " C1642,\n" +
+ " C1643,\n" +
+ " C1644,\n" +
+ " C1645,\n" +
+ " C1646,\n" +
+ " C1647,\n" +
+ " C1648,\n" +
+ " C1649,\n" +
+ " C1650,\n" +
+ " C1651,\n" +
+ " C1652,\n" +
+ " C1653,\n" +
+ " C1654,\n" +
+ " C1655,\n" +
+ " C1656,\n" +
+ " C1657,\n" +
+ " C1658,\n" +
+ " C1659,\n" +
+ " C1660,\n" +
+ " C1661,\n" +
+ " C1662,\n" +
+ " C1663,\n" +
+ " C1664,\n" +
+ " C1665,\n" +
+ " C1666,\n" +
+ " C1667,\n" +
+ " C1668,\n" +
+ " C1669,\n" +
+ " C1670,\n" +
+ " C1671,\n" +
+ " C1672,\n" +
+ " C1673,\n" +
+ " C1674,\n" +
+ " C1675,\n" +
+ " C1676,\n" +
+ " C1677,\n" +
+ " C1678,\n" +
+ " C1679,\n" +
+ " C1680,\n" +
+ " C1681,\n" +
+ " C1682,\n" +
+ " C1683,\n" +
+ " C1684,\n" +
+ " C1685,\n" +
+ " C1686,\n" +
+ " C1687,\n" +
+ " C1688,\n" +
+ " C1689,\n" +
+ " C1690,\n" +
+ " C1691,\n" +
+ " C1692,\n" +
+ " C1693,\n" +
+ " C1694,\n" +
+ " C1695,\n" +
+ " C1696,\n" +
+ " C1697,\n" +
+ " C1698,\n" +
+ " C1699,\n" +
+ " C1700,\n" +
+ " C1701,\n" +
+ " C1702,\n" +
+ " C1703,\n" +
+ " C1704,\n" +
+ " C1705,\n" +
+ " C1706,\n" +
+ " C1707,\n" +
+ " C1708,\n" +
+ " C1709,\n" +
+ " C1710,\n" +
+ " C1711,\n" +
+ " C1712,\n" +
+ " C1713,\n" +
+ " C1714,\n" +
+ " C1715,\n" +
+ " C1716,\n" +
+ " C1717,\n" +
+ " C1718,\n" +
+ " C1719,\n" +
+ " C1720,\n" +
+ " C1721,\n" +
+ " C1722,\n" +
+ " C1723,\n" +
+ " C1724,\n" +
+ " C1725,\n" +
+ " C1726,\n" +
+ " C1727,\n" +
+ " C1728,\n" +
+ " C1729,\n" +
+ " C1730,\n" +
+ " C1731,\n" +
+ " C1732,\n" +
+ " C1733,\n" +
+ " C1734,\n" +
+ " C1735,\n" +
+ " C1736,\n" +
+ " C1737,\n" +
+ " C1738,\n" +
+ " C1739,\n" +
+ " C1740,\n" +
+ " C1741,\n" +
+ " C1742,\n" +
+ " C1743,\n" +
+ " C1744,\n" +
+ " C1745,\n" +
+ " C1746,\n" +
+ " C1747,\n" +
+ " C1748,\n" +
+ " C1749,\n" +
+ " C1750,\n" +
+ " C1751,\n" +
+ " C1752,\n" +
+ " C1753,\n" +
+ " C1754,\n" +
+ " C1755,\n" +
+ " C1756,\n" +
+ " C1757,\n" +
+ " C1758,\n" +
+ " C1759,\n" +
+ " C1760,\n" +
+ " C1761,\n" +
+ " C1762,\n" +
+ " C1763,\n" +
+ " C1764,\n" +
+ " C1765,\n" +
+ " C1766,\n" +
+ " C1767,\n" +
+ " C1768,\n" +
+ " C1769,\n" +
+ " C1770,\n" +
+ " C1771,\n" +
+ " C1772,\n" +
+ " C1773,\n" +
+ " C1774,\n" +
+ " C1775,\n" +
+ " C1776,\n" +
+ " C1777,\n" +
+ " C1778,\n" +
+ " C1779,\n" +
+ " C1780,\n" +
+ " C1781,\n" +
+ " C1782,\n" +
+ " C1783,\n" +
+ " C1784,\n" +
+ " C1785,\n" +
+ " C1786,\n" +
+ " C1787,\n" +
+ " C1788,\n" +
+ " C1789,\n" +
+ " C1790,\n" +
+ " C1791,\n" +
+ " C1792,\n" +
+ " C1793,\n" +
+ " C1794,\n" +
+ " C1795,\n" +
+ " C1796,\n" +
+ " C1797,\n" +
+ " C1798,\n" +
+ " C1799,\n" +
+ " C1800,\n" +
+ " C1801,\n" +
+ " C1802,\n" +
+ " C1803,\n" +
+ " C1804,\n" +
+ " C1805,\n" +
+ " C1806,\n" +
+ " C1807,\n" +
+ " C1808,\n" +
+ " C1809,\n" +
+ " C1810,\n" +
+ " C1811,\n" +
+ " C1812,\n" +
+ " C1813,\n" +
+ " C1814,\n" +
+ " C1815,\n" +
+ " C1816,\n" +
+ " C1817,\n" +
+ " C1818,\n" +
+ " C1819,\n" +
+ " C1820,\n" +
+ " C1821,\n" +
+ " C1822,\n" +
+ " C1823,\n" +
+ " C1824,\n" +
+ " C1825,\n" +
+ " C1826,\n" +
+ " C1827,\n" +
+ " C1828,\n" +
+ " C1829,\n" +
+ " C1830,\n" +
+ " C1831,\n" +
+ " C1832,\n" +
+ " C1833,\n" +
+ " C1834,\n" +
+ " C1835,\n" +
+ " C1836,\n" +
+ " C1837,\n" +
+ " C1838,\n" +
+ " C1839,\n" +
+ " C1840,\n" +
+ " C1841,\n" +
+ " C1842,\n" +
+ " C1843,\n" +
+ " C1844,\n" +
+ " C1845,\n" +
+ " C1846,\n" +
+ " C1847,\n" +
+ " C1848,\n" +
+ " C1849,\n" +
+ " C1850,\n" +
+ " C1851,\n" +
+ " C1852,\n" +
+ " C1853,\n" +
+ " C1854,\n" +
+ " C1855,\n" +
+ " C1856,\n" +
+ " C1857,\n" +
+ " C1858,\n" +
+ " C1859,\n" +
+ " C1860,\n" +
+ " C1861,\n" +
+ " C1862,\n" +
+ " C1863,\n" +
+ " C1864,\n" +
+ " C1865,\n" +
+ " C1866,\n" +
+ " C1867,\n" +
+ " C1868,\n" +
+ " C1869,\n" +
+ " C1870,\n" +
+ " C1871,\n" +
+ " C1872,\n" +
+ " C1873,\n" +
+ " C1874,\n" +
+ " C1875,\n" +
+ " C1876,\n" +
+ " C1877,\n" +
+ " C1878,\n" +
+ " C1879,\n" +
+ " C1880,\n" +
+ " C1881,\n" +
+ " C1882,\n" +
+ " C1883,\n" +
+ " C1884,\n" +
+ " C1885,\n" +
+ " C1886,\n" +
+ " C1887,\n" +
+ " C1888,\n" +
+ " C1889,\n" +
+ " C1890,\n" +
+ " C1891,\n" +
+ " C1892,\n" +
+ " C1893,\n" +
+ " C1894,\n" +
+ " C1895,\n" +
+ " C1896,\n" +
+ " C1897,\n" +
+ " C1898,\n" +
+ " C1899,\n" +
+ " C1900,\n" +
+ " C1901,\n" +
+ " C1902,\n" +
+ " C1903,\n" +
+ " C1904,\n" +
+ " C1905,\n" +
+ " C1906,\n" +
+ " C1907,\n" +
+ " C1908,\n" +
+ " C1909,\n" +
+ " C1910,\n" +
+ " C1911,\n" +
+ " C1912,\n" +
+ " C1913,\n" +
+ " C1914,\n" +
+ " C1915,\n" +
+ " C1916,\n" +
+ " C1917,\n" +
+ " C1918,\n" +
+ " C1919,\n" +
+ " C1920,\n" +
+ " C1921,\n" +
+ " C1922,\n" +
+ " C1923,\n" +
+ " C1924,\n" +
+ " C1925,\n" +
+ " C1926,\n" +
+ " C1927,\n" +
+ " C1928,\n" +
+ " C1929,\n" +
+ " C1930,\n" +
+ " C1931,\n" +
+ " C1932,\n" +
+ " C1933,\n" +
+ " C1934,\n" +
+ " C1935,\n" +
+ " C1936,\n" +
+ " C1937,\n" +
+ " C1938,\n" +
+ " C1939,\n" +
+ " C1940,\n" +
+ " C1941,\n" +
+ " C1942,\n" +
+ " C1943,\n" +
+ " C1944,\n" +
+ " C1945,\n" +
+ " C1946,\n" +
+ " C1947,\n" +
+ " C1948,\n" +
+ " C1949,\n" +
+ " C1950,\n" +
+ " C1951,\n" +
+ " C1952,\n" +
+ " C1953,\n" +
+ " C1954,\n" +
+ " C1955,\n" +
+ " C1956,\n" +
+ " C1957,\n" +
+ " C1958,\n" +
+ " C1959,\n" +
+ " C1960,\n" +
+ " C1961,\n" +
+ " C1962,\n" +
+ " C1963,\n" +
+ " C1964,\n" +
+ " C1965,\n" +
+ " C1966,\n" +
+ " C1967,\n" +
+ " C1968,\n" +
+ " C1969,\n" +
+ " C1970,\n" +
+ " C1971,\n" +
+ " C1972,\n" +
+ " C1973,\n" +
+ " C1974,\n" +
+ " C1975,\n" +
+ " C1976,\n" +
+ " C1977,\n" +
+ " C1978,\n" +
+ " C1979,\n" +
+ " C1980,\n" +
+ " C1981,\n" +
+ " C1982,\n" +
+ " C1983,\n" +
+ " C1984,\n" +
+ " C1985,\n" +
+ " C1986,\n" +
+ " C1987,\n" +
+ " C1988,\n" +
+ " C1989,\n" +
+ " C1990,\n" +
+ " C1991,\n" +
+ " C1992,\n" +
+ " C1993,\n" +
+ " C1994,\n" +
+ " C1995,\n" +
+ " C1996,\n" +
+ " C1997,\n" +
+ " C1998,\n" +
+ " C1999,\n" +
+ " C2000,\n" +
+ " C2001,\n" +
+ " C2002,\n" +
+ " C2003,\n" +
+ " C2004\n" +
+ " ;\n" +
+ " \n" +
+ " private static Map<String, X> nameToInstanceMap = new HashMap<String, X>();\n" +
+ "\n" +
+ " static {\n" +
+ " for (X b : values()) {\n" +
+ " nameToInstanceMap.put(b.name(), b);\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public static X fromName(String n) {\n" +
+ " X b = nameToInstanceMap.get(n);\n" +
+ "\n" +
+ " return b;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(fromName(\"C0\"));\n" +
+ " }\n" +
"}"
},
"C0");
@@ -20706,7 +20706,7 @@ public void testBug519070() {
sourceCode.append("\t}\n");
}
sourceCode.append("}\n");
-
+
this.runConformTest(
new String[] {
"X.java",
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/XLargeTest2.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/XLargeTest2.java
index 5fde7f474..53c49bf32 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/XLargeTest2.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/XLargeTest2.java
@@ -163,10 +163,10 @@ public class XLargeTest2 extends AbstractRegressionTest {
runConformTest(
new String[] {
"p001/bip.java",
- "package p001;\n" +
- "\n" +
+ "package p001;\n" +
+ "\n" +
getManyInterfaceDeclarations() +
- "\n" +
+ "\n" +
"class bip implements brj, brk, cem, cen, cey, cez, cfk, cfl, cgu, cgx, che, chh, chq, chr, cji, cjj, ckk, ckl, clb, clc, clf, cli, cnk,\n" +
" cnl, cok, cqa, cqd, cqw, cqx, crs, crv, csu, csv, ctq, ctt, cvg, cvj, cvo, cvp, cwk, cwn, cwu, cww, cxh, cxk, daz, dba, dbr, dbu, dck,\n" +
" dcl, deh, dei, dep, deq, dff, dfg, dfl, dfo, dsp, dss, dtp, dtq, dtt, dtw, duj, duk, dvm, dvp, dvs, dvv, dwe, dwh, dxd, dxg, dyq, dys,\n" +
@@ -174,7 +174,7 @@ public class XLargeTest2 extends AbstractRegressionTest {
" eqj, erv, erw, etd, etg, etm, eto, fbc, fbd, feu, fev, ffc, fff, fgf, fgh, fgo, fgp, fhm, fhn, fib, fki, fkj, fkw, fkx, fmh, fmk, fnk,\n" +
" fnl, fnz, foc, fof, foi, fvk, fvn, fvv, fvw, fwy, fxb, fyb, fye, fyl, fym, fyv, fyy, fzq, fzs, gad, gag, gaq, gas, gav, gax, gbc, gbd,\n" +
" gco, gcr, gdc, gdf, gdn, gdq, gei, gej, gih, gik, gku, gkx, gln, glo, gmi, gmj, gmu, gmv, gpx, gpy, gqb, gqe, gqp, gqs, grb, grc, grh,\n" +
- " gri, grn, gro, grv, grw, gtr, gtu, gxc, gvt, gvw, gwz {\n" +
+ " gri, grn, gro, grv, grw, gtr, gtu, gxc, gvt, gvw, gwz {\n" +
"}\n"
});
}
@@ -183,10 +183,10 @@ public class XLargeTest2 extends AbstractRegressionTest {
runNegativeTest(
new String[] {
"p001/bip.java",
- "package p001;\n" +
- "\n" +
+ "package p001;\n" +
+ "\n" +
getManyInterfaceDeclarations() +
- "\n" +
+ "\n" +
"class bop implements missing,\n" +
" brj, brk, cem, cen, cey, cez, cfk, cfl, cgu, cgx, che, chh, chq, chr, cji, cjj, ckk, ckl, clb, clc, clf, cli, cnk,\n" +
" cnl, cok, cqa, cqd, cqw, cqx, crs, crv, csu, csv, ctq, ctt, cvg, cvj, cvo, cvp, cwk, cwn, cwu, cww, cxh, cxk, daz, dba, dbr, dbu, dck,\n" +
@@ -195,213 +195,213 @@ public class XLargeTest2 extends AbstractRegressionTest {
" eqj, erv, erw, etd, etg, etm, eto, fbc, fbd, feu, fev, ffc, fff, fgf, fgh, fgo, fgp, fhm, fhn, fib, fki, fkj, fkw, fkx, fmh, fmk, fnk,\n" +
" fnl, fnz, foc, fof, foi, fvk, fvn, fvv, fvw, fwy, fxb, fyb, fye, fyl, fym, fyv, fyy, fzq, fzs, gad, gag, gaq, gas, gav, gax, gbc, gbd,\n" +
" gco, gcr, gdc, gdf, gdn, gdq, gei, gej, gih, gik, gku, gkx, gln, glo, gmi, gmj, gmu, gmv, gpx, gpy, gqb, gqe, gqp, gqs, grb, grc, grh,\n" +
- " gri, grn, gro, grv, grw, gtr, gtu, gxc, gvt, gvw, gwz {\n" +
+ " gri, grn, gro, grv, grw, gtr, gtu, gxc, gvt, gvw, gwz {\n" +
"}\n"
},
- "----------\n" +
- "1. ERROR in p001\\bip.java (at line 200)\n" +
- " class bop implements missing,\n" +
- " ^^^^^^^\n" +
- "missing cannot be resolved to a type\n" +
+ "----------\n" +
+ "1. ERROR in p001\\bip.java (at line 200)\n" +
+ " class bop implements missing,\n" +
+ " ^^^^^^^\n" +
+ "missing cannot be resolved to a type\n" +
"----------\n");
}
private String getManyInterfaceDeclarations() {
- return "interface brj {}\n" +
- "interface brk {}\n" +
- "interface cem {}\n" +
- "interface cen {}\n" +
- "interface cey {}\n" +
- "interface cez {}\n" +
- "interface cfk {}\n" +
- "interface cfl {}\n" +
- "interface cgu {}\n" +
- "interface cgx {}\n" +
- "interface che {}\n" +
- "interface chh {}\n" +
- "interface chq {}\n" +
- "interface chr {}\n" +
- "interface cji {}\n" +
- "interface cjj {}\n" +
- "interface ckk {}\n" +
- "interface ckl {}\n" +
- "interface clb {}\n" +
- "interface clc {}\n" +
- "interface clf {}\n" +
- "interface cli {}\n" +
- "interface cnk {}\n" +
- "interface cnl {}\n" +
- "interface cok {}\n" +
- "interface cqa {}\n" +
- "interface cqd {}\n" +
- "interface cqw {}\n" +
- "interface cqx {}\n" +
- "interface crs {}\n" +
- "interface crv {}\n" +
- "interface csu {}\n" +
- "interface csv {}\n" +
- "interface ctq {}\n" +
- "interface ctt {}\n" +
- "interface cvg {}\n" +
- "interface cvj {}\n" +
- "interface cvo {}\n" +
- "interface cvp {}\n" +
- "interface cwk {}\n" +
- "interface cwn {}\n" +
- "interface cwu {}\n" +
- "interface cww {}\n" +
- "interface cxh {}\n" +
- "interface cxk {}\n" +
- "interface daz {}\n" +
- "interface dba {}\n" +
- "interface dbr {}\n" +
- "interface dbu {}\n" +
- "interface dck {}\n" +
- "interface dcl {}\n" +
- "interface deh {}\n" +
- "interface dei {}\n" +
- "interface dep {}\n" +
- "interface deq {}\n" +
- "interface dff {}\n" +
- "interface dfg {}\n" +
- "interface dfl {}\n" +
- "interface dfo {}\n" +
- "interface dsp {}\n" +
- "interface dss {}\n" +
- "interface dtp {}\n" +
- "interface dtq {}\n" +
- "interface dtt {}\n" +
- "interface dtw {}\n" +
- "interface duj {}\n" +
- "interface duk {}\n" +
- "interface dvm {}\n" +
- "interface dvp {}\n" +
- "interface dvs {}\n" +
- "interface dvv {}\n" +
- "interface dwe {}\n" +
- "interface dwh {}\n" +
- "interface dxd {}\n" +
- "interface dxg {}\n" +
- "interface dyq {}\n" +
- "interface dys {}\n" +
- "interface dyv {}\n" +
- "interface dyw {}\n" +
- "interface dzh {}\n" +
- "interface dzk {}\n" +
- "interface dzn {}\n" +
- "interface dzo {}\n" +
- "interface dzx {}\n" +
- "interface eaa {}\n" +
- "interface ecw {}\n" +
- "interface ecx {}\n" +
- "interface edr {}\n" +
- "interface eds {}\n" +
- "interface efc {}\n" +
- "interface efd {}\n" +
- "interface eiw {}\n" +
- "interface eiz {}\n" +
- "interface ejy {}\n" +
- "interface ekb {}\n" +
- "interface emi {}\n" +
- "interface eml {}\n" +
- "interface eor {}\n" +
- "interface eou {}\n" +
- "interface epe {}\n" +
- "interface eph {}\n" +
- "interface epk {}\n" +
- "interface epl {}\n" +
- "interface eqi {}\n" +
- "interface eqj {}\n" +
- "interface erv {}\n" +
- "interface erw {}\n" +
- "interface etd {}\n" +
- "interface etg {}\n" +
- "interface etm {}\n" +
- "interface eto {}\n" +
- "interface fbc {}\n" +
- "interface fbd {}\n" +
- "interface feu {}\n" +
- "interface fev {}\n" +
- "interface ffc {}\n" +
- "interface fff {}\n" +
- "interface fgf {}\n" +
- "interface fgh {}\n" +
- "interface fgo {}\n" +
- "interface fgp {}\n" +
- "interface fhm {}\n" +
- "interface fhn {}\n" +
- "interface fib {}\n" +
- "interface fki {}\n" +
- "interface fkj {}\n" +
- "interface fkw {}\n" +
- "interface fkx {}\n" +
- "interface fmh {}\n" +
- "interface fmk {}\n" +
- "interface fnk {}\n" +
- "interface fnl {}\n" +
- "interface fnz {}\n" +
- "interface foc {}\n" +
- "interface fof {}\n" +
- "interface foi {}\n" +
- "interface fvk {}\n" +
- "interface fvn {}\n" +
- "interface fvv {}\n" +
- "interface fvw {}\n" +
- "interface fwy {}\n" +
- "interface fxb {}\n" +
- "interface fyb {}\n" +
- "interface fye {}\n" +
- "interface fyl {}\n" +
- "interface fym {}\n" +
- "interface fyv {}\n" +
- "interface fyy {}\n" +
- "interface fzq {}\n" +
- "interface fzs {}\n" +
- "interface gad {}\n" +
- "interface gag {}\n" +
- "interface gaq {}\n" +
- "interface gas {}\n" +
- "interface gav {}\n" +
- "interface gax {}\n" +
- "interface gbc {}\n" +
- "interface gbd {}\n" +
- "interface gco {}\n" +
- "interface gcr {}\n" +
- "interface gdc {}\n" +
- "interface gdf {}\n" +
- "interface gdn {}\n" +
- "interface gdq {}\n" +
- "interface gei {}\n" +
- "interface gej {}\n" +
- "interface gih {}\n" +
- "interface gik {}\n" +
- "interface gku {}\n" +
- "interface gkx {}\n" +
- "interface gln {}\n" +
- "interface glo {}\n" +
- "interface gmi {}\n" +
- "interface gmj {}\n" +
- "interface gmu {}\n" +
- "interface gmv {}\n" +
- "interface gpx {}\n" +
- "interface gpy {}\n" +
- "interface gqb {}\n" +
- "interface gqe {}\n" +
- "interface gqp {}\n" +
- "interface gqs {}\n" +
- "interface grb {}\n" +
- "interface grc {}\n" +
- "interface grh {}\n" +
- "interface gri {}\n" +
- "interface grn {}\n" +
- "interface gro {}\n" +
- "interface grv {}\n" +
- "interface grw {}\n" +
- "interface gtr {}\n" +
- "interface gtu {}\n" +
- "interface gvt {}\n" +
- "interface gvw {}\n" +
- "interface gwz {}\n" +
+ return "interface brj {}\n" +
+ "interface brk {}\n" +
+ "interface cem {}\n" +
+ "interface cen {}\n" +
+ "interface cey {}\n" +
+ "interface cez {}\n" +
+ "interface cfk {}\n" +
+ "interface cfl {}\n" +
+ "interface cgu {}\n" +
+ "interface cgx {}\n" +
+ "interface che {}\n" +
+ "interface chh {}\n" +
+ "interface chq {}\n" +
+ "interface chr {}\n" +
+ "interface cji {}\n" +
+ "interface cjj {}\n" +
+ "interface ckk {}\n" +
+ "interface ckl {}\n" +
+ "interface clb {}\n" +
+ "interface clc {}\n" +
+ "interface clf {}\n" +
+ "interface cli {}\n" +
+ "interface cnk {}\n" +
+ "interface cnl {}\n" +
+ "interface cok {}\n" +
+ "interface cqa {}\n" +
+ "interface cqd {}\n" +
+ "interface cqw {}\n" +
+ "interface cqx {}\n" +
+ "interface crs {}\n" +
+ "interface crv {}\n" +
+ "interface csu {}\n" +
+ "interface csv {}\n" +
+ "interface ctq {}\n" +
+ "interface ctt {}\n" +
+ "interface cvg {}\n" +
+ "interface cvj {}\n" +
+ "interface cvo {}\n" +
+ "interface cvp {}\n" +
+ "interface cwk {}\n" +
+ "interface cwn {}\n" +
+ "interface cwu {}\n" +
+ "interface cww {}\n" +
+ "interface cxh {}\n" +
+ "interface cxk {}\n" +
+ "interface daz {}\n" +
+ "interface dba {}\n" +
+ "interface dbr {}\n" +
+ "interface dbu {}\n" +
+ "interface dck {}\n" +
+ "interface dcl {}\n" +
+ "interface deh {}\n" +
+ "interface dei {}\n" +
+ "interface dep {}\n" +
+ "interface deq {}\n" +
+ "interface dff {}\n" +
+ "interface dfg {}\n" +
+ "interface dfl {}\n" +
+ "interface dfo {}\n" +
+ "interface dsp {}\n" +
+ "interface dss {}\n" +
+ "interface dtp {}\n" +
+ "interface dtq {}\n" +
+ "interface dtt {}\n" +
+ "interface dtw {}\n" +
+ "interface duj {}\n" +
+ "interface duk {}\n" +
+ "interface dvm {}\n" +
+ "interface dvp {}\n" +
+ "interface dvs {}\n" +
+ "interface dvv {}\n" +
+ "interface dwe {}\n" +
+ "interface dwh {}\n" +
+ "interface dxd {}\n" +
+ "interface dxg {}\n" +
+ "interface dyq {}\n" +
+ "interface dys {}\n" +
+ "interface dyv {}\n" +
+ "interface dyw {}\n" +
+ "interface dzh {}\n" +
+ "interface dzk {}\n" +
+ "interface dzn {}\n" +
+ "interface dzo {}\n" +
+ "interface dzx {}\n" +
+ "interface eaa {}\n" +
+ "interface ecw {}\n" +
+ "interface ecx {}\n" +
+ "interface edr {}\n" +
+ "interface eds {}\n" +
+ "interface efc {}\n" +
+ "interface efd {}\n" +
+ "interface eiw {}\n" +
+ "interface eiz {}\n" +
+ "interface ejy {}\n" +
+ "interface ekb {}\n" +
+ "interface emi {}\n" +
+ "interface eml {}\n" +
+ "interface eor {}\n" +
+ "interface eou {}\n" +
+ "interface epe {}\n" +
+ "interface eph {}\n" +
+ "interface epk {}\n" +
+ "interface epl {}\n" +
+ "interface eqi {}\n" +
+ "interface eqj {}\n" +
+ "interface erv {}\n" +
+ "interface erw {}\n" +
+ "interface etd {}\n" +
+ "interface etg {}\n" +
+ "interface etm {}\n" +
+ "interface eto {}\n" +
+ "interface fbc {}\n" +
+ "interface fbd {}\n" +
+ "interface feu {}\n" +
+ "interface fev {}\n" +
+ "interface ffc {}\n" +
+ "interface fff {}\n" +
+ "interface fgf {}\n" +
+ "interface fgh {}\n" +
+ "interface fgo {}\n" +
+ "interface fgp {}\n" +
+ "interface fhm {}\n" +
+ "interface fhn {}\n" +
+ "interface fib {}\n" +
+ "interface fki {}\n" +
+ "interface fkj {}\n" +
+ "interface fkw {}\n" +
+ "interface fkx {}\n" +
+ "interface fmh {}\n" +
+ "interface fmk {}\n" +
+ "interface fnk {}\n" +
+ "interface fnl {}\n" +
+ "interface fnz {}\n" +
+ "interface foc {}\n" +
+ "interface fof {}\n" +
+ "interface foi {}\n" +
+ "interface fvk {}\n" +
+ "interface fvn {}\n" +
+ "interface fvv {}\n" +
+ "interface fvw {}\n" +
+ "interface fwy {}\n" +
+ "interface fxb {}\n" +
+ "interface fyb {}\n" +
+ "interface fye {}\n" +
+ "interface fyl {}\n" +
+ "interface fym {}\n" +
+ "interface fyv {}\n" +
+ "interface fyy {}\n" +
+ "interface fzq {}\n" +
+ "interface fzs {}\n" +
+ "interface gad {}\n" +
+ "interface gag {}\n" +
+ "interface gaq {}\n" +
+ "interface gas {}\n" +
+ "interface gav {}\n" +
+ "interface gax {}\n" +
+ "interface gbc {}\n" +
+ "interface gbd {}\n" +
+ "interface gco {}\n" +
+ "interface gcr {}\n" +
+ "interface gdc {}\n" +
+ "interface gdf {}\n" +
+ "interface gdn {}\n" +
+ "interface gdq {}\n" +
+ "interface gei {}\n" +
+ "interface gej {}\n" +
+ "interface gih {}\n" +
+ "interface gik {}\n" +
+ "interface gku {}\n" +
+ "interface gkx {}\n" +
+ "interface gln {}\n" +
+ "interface glo {}\n" +
+ "interface gmi {}\n" +
+ "interface gmj {}\n" +
+ "interface gmu {}\n" +
+ "interface gmv {}\n" +
+ "interface gpx {}\n" +
+ "interface gpy {}\n" +
+ "interface gqb {}\n" +
+ "interface gqe {}\n" +
+ "interface gqp {}\n" +
+ "interface gqs {}\n" +
+ "interface grb {}\n" +
+ "interface grc {}\n" +
+ "interface grh {}\n" +
+ "interface gri {}\n" +
+ "interface grn {}\n" +
+ "interface gro {}\n" +
+ "interface grv {}\n" +
+ "interface grw {}\n" +
+ "interface gtr {}\n" +
+ "interface gtu {}\n" +
+ "interface gvt {}\n" +
+ "interface gvw {}\n" +
+ "interface gwz {}\n" +
"interface gxc {}\n";
}
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/dom/StandAloneASTParserTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/dom/StandAloneASTParserTest.java
index 9924f6139..0dee50504 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/dom/StandAloneASTParserTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/dom/StandAloneASTParserTest.java
@@ -64,7 +64,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
public StandAloneASTParserTest(String name) {
super(name);
}
-
+
private static final int AST_JLS_LATEST = AST.JLS14;
public ASTNode runConversion(
@@ -94,7 +94,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
}
public void testBug529654_001() {
String contents =
- "module m {\n" +
+ "module m {\n" +
"}";
ASTParser parser = ASTParser.newParser(AST_JLS_LATEST);
parser.setSource(contents.toCharArray());
@@ -117,13 +117,13 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
}
public void test1() {
String contents =
- "package p;\n" +
- "public class X {\n" +
- " public int i;\n" +
- " public static void main(String[] args) {\n" +
- " int length = args.length;\n" +
- " System.out.println(length);\n" +
- " }\n" +
+ "package p;\n" +
+ "public class X {\n" +
+ " public int i;\n" +
+ " public static void main(String[] args) {\n" +
+ " int length = args.length;\n" +
+ " System.out.println(length);\n" +
+ " }\n" +
"}";
ASTNode node = runConversion(AST_JLS_LATEST, contents, true, true, true, "p/X.java");
assertTrue("Should be a compilation unit", node instanceof CompilationUnit);
@@ -149,7 +149,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
MethodInvocation invocation = (MethodInvocation) expression;
Expression expression2 = invocation.getExpression();
assertNotNull("No binding", expression2.resolveTypeBinding());
-
+
FieldDeclaration fieldDeclaration = (FieldDeclaration) typeDeclaration.bodyDeclarations().get(0);
VariableDeclarationFragment fragment2 = (VariableDeclarationFragment) fieldDeclaration.fragments().get(0);
IVariableBinding variableBinding2 = fragment2.resolveBinding();
@@ -198,15 +198,15 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
final IBinding[] bindings = new IBinding[1];
String contents =
- "package p;\n" +
- "public class X extends Y {\n" +
- " public int i;\n" +
- " public static void main(String[] args) {\n" +
- " int length = args.length;\n" +
- " System.out.println(length);\n" +
- " }\n" +
+ "package p;\n" +
+ "public class X extends Y {\n" +
+ " public int i;\n" +
+ " public static void main(String[] args) {\n" +
+ " int length = args.length;\n" +
+ " System.out.println(length);\n" +
+ " }\n" +
"}";
-
+
File packageDir = new File(rootDir, "p");
packageDir.mkdir();
File file = new File(packageDir, "X.java");
@@ -225,7 +225,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
}
String contents2 =
- "package p;\n" +
+ "package p;\n" +
"public class Y {}";
File fileY = new File(packageDir, "Y.java");
Writer writer2 = null;
@@ -245,7 +245,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
try {
final String canonicalPath = file.getCanonicalPath();
final CompilationUnit[] units = new CompilationUnit[1];
-
+
FileASTRequestor requestor = new FileASTRequestor() {
public void acceptBinding(String bindingKey, IBinding binding) {
if (key.equals(bindingKey)) {
@@ -258,11 +258,11 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
}
}
};
-
+
parser.setEnvironment(null, new String[] { rootDir.getCanonicalPath() }, null, true);
-
+
parser.createASTs(new String[] {canonicalPath}, null, new String[] {key}, requestor, null);
-
+
assertNotNull("No binding", bindings[0]);
assertEquals("Wrong type of binding", IBinding.TYPE, bindings[0].getKind());
ITypeBinding typeBinding = (ITypeBinding) bindings[0];
@@ -309,15 +309,15 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
final IBinding[] bindings = new IBinding[2];
String contents =
- "package p;\n" +
- "public class X extends Y {\n" +
- " public int i;\n" +
- " public static void main(String[] args) {\n" +
- " int length = args.length;\n" +
- " System.out.println(length);\n" +
- " }\n" +
+ "package p;\n" +
+ "public class X extends Y {\n" +
+ " public int i;\n" +
+ " public static void main(String[] args) {\n" +
+ " int length = args.length;\n" +
+ " System.out.println(length);\n" +
+ " }\n" +
"}";
-
+
File packageDir = new File(rootDir, "p");
packageDir.mkdir();
File file = new File(packageDir, "X.java");
@@ -336,7 +336,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
}
String contents2 =
- "package p;\n" +
+ "package p;\n" +
"public class Y {}";
File fileY = new File(packageDir, "Y.java");
Writer writer2 = null;
@@ -356,7 +356,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
try {
final String canonicalPath = file.getCanonicalPath();
final CompilationUnit[] units = new CompilationUnit[1];
-
+
FileASTRequestor requestor = new FileASTRequestor() {
public void acceptBinding(String bindingKey, IBinding binding) {
if (key.equals(bindingKey)) {
@@ -373,11 +373,11 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
}
}
};
-
+
parser.setEnvironment(null, new String[] { rootDir.getCanonicalPath() }, null, true);
-
+
parser.createASTs(new String[] {canonicalPath}, null, new String[] {key}, requestor, null);
-
+
assertNotNull("No binding", bindings[0]);
assertEquals("Wrong type of binding", IBinding.TYPE, bindings[0].getKind());
ITypeBinding typeBinding = (ITypeBinding) bindings[0];
@@ -396,7 +396,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
fileY.delete();
}
}
-
+
/**
* @deprecated
* @throws IOException
@@ -413,11 +413,11 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
final String key = "Lp/C;";
final IBinding[] bindings = new IBinding[2];
- String contents =
- "package p;\n" +
- "public class A{}\n" +
+ String contents =
+ "package p;\n" +
+ "public class A{}\n" +
"class B{}";
-
+
File packageDir = new File(rootDir, "p");
packageDir.mkdir();
File file = new File(packageDir, "A.java");
@@ -436,7 +436,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
}
String contents2 =
- "package p;\n" +
+ "package p;\n" +
"public class C extends B {}";
File fileY = new File(packageDir, "C.java");
Writer writer2 = null;
@@ -456,7 +456,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
try {
final String canonicalPath = fileY.getCanonicalPath();
final CompilationUnit[] units = new CompilationUnit[1];
-
+
FileASTRequestor requestor = new FileASTRequestor() {
public void acceptBinding(String bindingKey, IBinding binding) {
if (key.equals(bindingKey)) {
@@ -473,7 +473,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
}
}
};
-
+
parser.setEnvironment(null, new String[] { rootDir.getCanonicalPath() }, null, true);
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.MAX_AT_ONCE = 0;
parser.createASTs(new String[] {canonicalPath}, null, new String[] {key}, requestor, null);
@@ -502,11 +502,11 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
final String key = "Lp/C;";
final IBinding[] bindings = new IBinding[2];
- String contents =
- "package p;\n" +
- "public class A{}\n" +
+ String contents =
+ "package p;\n" +
+ "public class A{}\n" +
"class B{}";
-
+
File packageDir = new File(rootDir, "p");
packageDir.mkdir();
File file = new File(packageDir, "A.java");
@@ -546,7 +546,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
try {
final String canonicalPath = fileY.getCanonicalPath();
final CompilationUnit[] units = new CompilationUnit[1];
-
+
FileASTRequestor requestor = new FileASTRequestor() {
public void acceptBinding(String bindingKey, IBinding binding) {
if (key.equals(bindingKey)) {
@@ -563,7 +563,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
}
}
};
-
+
parser.setEnvironment(null, new String[] { rootDir.getCanonicalPath() }, null, true);
parser.createASTs(new String[] {canonicalPath}, null, new String[] {key}, requestor, null);
assertNotNull("No ast", units[0]);
@@ -580,11 +580,11 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
File rootDir = new File(System.getProperty("java.io.tmpdir"));
String contents =
- "enum X {\n" +
- " /** */\n" +
- " FOO\n" +
+ "enum X {\n" +
+ " /** */\n" +
+ " FOO\n" +
"}";
-
+
File file = new File(rootDir, "X.java");
Writer writer = null;
try {
@@ -601,7 +601,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
}
String contents2 =
- "package p;\n" +
+ "package p;\n" +
"class Y {}";
File packageDir = new File(rootDir, "p");
packageDir.mkdir();
@@ -706,7 +706,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
" public static final class if {\n"+
" public static final if ËŠ = new if(null, null, null, null);\n"+
" }\n" +
- "}";
+ "}";
ASTParser parser = ASTParser.newParser(AST.JLS9);
parser.setSource(input.toCharArray());
parser.setResolveBindings(true);
@@ -714,7 +714,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
parser.setBindingsRecovery(true);
parser.setKind(ASTParser.K_COMPILATION_UNIT);
parser.setEnvironment(null, new String[] {null}, null, true);
-
+
Hashtable<String, String> options1 = JavaCore.getDefaultOptions();
options1.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_8);
options1.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_8);
@@ -725,7 +725,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
@Deprecated
public void testBug526996_001() {
File rootDir = new File(System.getProperty("java.io.tmpdir"));
- String contents =
+ String contents =
"public class X {\n" +
" public X() {\n" +
" this.f16132b =\n" +
@@ -739,7 +739,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
" }\n" +
" }\n" +
"\n";
-
+
File file = new File(rootDir, "X.java");
Writer writer = null;
try {
@@ -818,7 +818,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
}
public void testBug526996_002() {
File rootDir = new File(System.getProperty("java.io.tmpdir"));
- String contents =
+ String contents =
"public class zzei {\n"+
" private final Context mContext;\n"+
" private final String zzAg;\n"+
@@ -1221,7 +1221,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
" return com_google_android_gms_internal_zzei_zze;\n"+
" }\n"+
"}\n";
-
+
File file = new File(rootDir, "zzei.java");
Writer writer = null;
try {
@@ -1636,7 +1636,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
parser.setBindingsRecovery(true);
parser.setKind(ASTParser.K_COMPILATION_UNIT);
parser.setEnvironment(null, new String[] {null}, null, true);
- parser.setResolveBindings(true);
+ parser.setResolveBindings(true);
Map<String, String> options = getCompilerOptions();
options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_10);
options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_10);
@@ -1658,11 +1658,11 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
File rootDir = new File(System.getProperty("java.io.tmpdir"));
String contents =
- "enum X {\n" +
- " /** */\n" +
- " FOO\n" +
+ "enum X {\n" +
+ " /** */\n" +
+ " FOO\n" +
"}";
-
+
File file = new File(rootDir, "X.java");
Writer writer = null;
try {
@@ -1689,11 +1689,11 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
String canonicalPath2 = fileY.getCanonicalPath();
contents =
- "enum X {\n" +
- " /** */\n" +
- " FOO\n" +
+ "enum X {\n" +
+ " /** */\n" +
+ " FOO\n" +
"}";
-
+
File file2 = new File(rootDir, "X.java");
writer = null;
try {
@@ -1726,7 +1726,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
fileY.delete();
}
}
-
+
/*
* To test isVar returning false for ast level 10 and compliance 9
*/
@@ -1734,7 +1734,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
String contents =
"public class X {\n" +
" public static void main(String[] args) {\n" +
- " var s = new Y();\n" +
+ " var s = new Y();\n" +
" }\n" +
"}\n" +
"class Y {}";
@@ -1751,7 +1751,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_9);
options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_9);
parser.setCompilerOptions(options);
-
+
ASTNode node = parser.createAST(null);
assertTrue("Should be a compilation unit", node instanceof CompilationUnit);
CompilationUnit cu = (CompilationUnit) node;
@@ -1791,14 +1791,14 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
parser.setCompilerOptions(options);
-
+
ASTNode node = parser.createAST(null);
assertTrue("Should be a compilation unit", node instanceof CompilationUnit);
CompilationUnit cu = (CompilationUnit) node;
IProblem[] problems = cu.getProblems();
assertTrue(problems.length > 0);
assertTrue(problems[0].toString().contains("preview"));
- }
+ }
public void testBug547900_01() throws JavaModelException {
String contents =
"class X {\n"+
@@ -1820,7 +1820,7 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_14);
options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_14);
parser.setCompilerOptions(options);
-
+
ASTNode node = parser.createAST(null);
assertTrue("Should be a compilation unit", node instanceof CompilationUnit);
CompilationUnit cu = (CompilationUnit) node;
@@ -1844,20 +1844,20 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
String fileName2 = "C9947f.java";
f1 = createFile(
packDir, fileName1,
- "package x;\n" +
- "\n" +
- "class EnsureImpl$1 {\n" +
+ "package x;\n" +
+ "\n" +
+ "class EnsureImpl$1 {\n" +
"}\n");
f2 = createFile(
packDir, fileName2,
- "package x;\n" +
- "public final class C9947f {\n" +
- " public C9947f() {\n" +
- " try {\n" +
- " new x.EnsureImpl$1();\n" +
- " } catch (Throwable unused) {\n" +
- " }\n" +
- " }\n" +
+ "package x;\n" +
+ "public final class C9947f {\n" +
+ " public C9947f() {\n" +
+ " try {\n" +
+ " new x.EnsureImpl$1();\n" +
+ " } catch (Throwable unused) {\n" +
+ " }\n" +
+ " }\n" +
"}\n");
ASTParser parser = ASTParser.newParser(AST_JLS_LATEST);
parser.setResolveBindings(true);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/DebugEvaluationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/DebugEvaluationTest.java
index a30900281..836727a72 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/DebugEvaluationTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/DebugEvaluationTest.java
@@ -2809,7 +2809,7 @@ public void test065() {
+ "\t}\n"
+ "\tprivate <U>A65(int i) {;\n"
+ "\t\tthis.i = i;\n"
- + "\t}\n"
+ + "\t}\n"
+ "\tpublic void bar() {\n"
+ "\t}\n"
+ "}";
@@ -2858,8 +2858,8 @@ public void test066() {
+ "\tpublic A66() {;\n"
+ "\t}\n"
+ "\tprivate <U> int foo(int i) {;\n"
- + "\t\treturn i;\n"
- + "\t}\n"
+ + "\t\treturn i;\n"
+ + "\t}\n"
+ "\tpublic void bar() {\n"
+ "\t}\n"
+ "}";
@@ -2965,7 +2965,7 @@ public void test068() {
+ "\tpublic SuperA68() {\n"
+ "\t}\n"
+ "\tpublic <U> int foo(int i) {;\n"
- + "\t\treturn i;\n"
+ + "\t\treturn i;\n"
+ "\t}\n"
+ "}";
compileAndDeploy15(sourceSuperA68, "SuperA68");
@@ -2975,8 +2975,8 @@ public void test068() {
+ "\tpublic A68() {\n"
+ "\t}\n"
+ "\tpublic <U> int foo(int i) {\n"
- + "\t\treturn i;\n"
- + "\t}\n"
+ + "\t\treturn i;\n"
+ + "\t}\n"
+ "\tpublic void bar() {\n"
+ "\t}\n"
+ "}";
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/EvaluationSetup.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/EvaluationSetup.java
index cdf0ea6e7..673663b5e 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/EvaluationSetup.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/EvaluationSetup.java
@@ -83,8 +83,8 @@ public class EvaluationSetup extends CompilerTestSetup {
this.target = new TargetInterface();
// allow 30s max to connect (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=188127)
// Increased to 60 s for https://bugs.eclipse.org/bugs/show_bug.cgi?id=547417
- this.target.connect(server, 60000);
-
+ this.target.connect(server, 60000);
+
assertTrue("Failed to connect VM server", this.target.isConnected());
System.out.println(getName() + ": connected to target");
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/JDIStackFrame.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/JDIStackFrame.java
index 62b4a0164..4d866619e 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/JDIStackFrame.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/JDIStackFrame.java
@@ -66,9 +66,9 @@ public JDIStackFrame(
String breakpointClassName,
String breakpointMethodName,
int breakpointLine) {
-
+
this(jdiVM, test, userCode, breakpointClassName, breakpointMethodName, breakpointLine, 10000/*timeout*/);
-
+
}
public JDIStackFrame(
VirtualMachine jdiVM,
@@ -78,7 +78,7 @@ public JDIStackFrame(
String breakpointMethodName,
int breakpointLine,
long timeout) {
-
+
this.jdiVM = jdiVM;
this.userCode = userCode;
this.breakpointClassName = breakpointClassName;
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SimpleTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SimpleTest.java
index fc734cc13..bac50d997 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SimpleTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SimpleTest.java
@@ -252,7 +252,7 @@ protected void startEvaluationContext() throws TargetException {
launcher.setEvalPort(evalPort);
launcher.setEvalTargetPath(TARGET_PATH);
this.launchedVM = launcher.launch();
-
+
(new Thread() {
public void run() {
try {
@@ -272,7 +272,7 @@ protected void startEvaluationContext() throws TargetException {
}
}
}).start();
-
+
(new Thread() {
public void run() {
try {
@@ -292,7 +292,7 @@ protected void startEvaluationContext() throws TargetException {
}
}
}).start();
-
+
this.requestor = new Requestor();
this.target = new TargetInterface();
this.target.connect(server, 30000); // allow 30s max to connect (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=188127)
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/TestCase.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/TestCase.java
index 46cdca411..2c0bced32 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/TestCase.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/TestCase.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Jesper S Moller <jesper@selskabet.org> - Contributions for
@@ -889,7 +889,7 @@ public static Test setUpTest(Test test) throws Exception {
field.setAccessible(true);
Set set = (Set) field.get(null);
set.clear();
-
+
return test;
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/LocalVMLauncher.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/LocalVMLauncher.java
index ad925d71f..05a66222d 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/LocalVMLauncher.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/LocalVMLauncher.java
@@ -35,7 +35,7 @@ import org.eclipse.jdt.core.tests.util.Util;
public abstract class LocalVMLauncher implements RuntimeConstants {
private static final boolean PWR_DEBUG = Boolean.getBoolean("ot.debug.pwr");
-
+
static final String[] env = System.getenv().entrySet().stream()
.filter(e -> !"JAVA_TOOL_OPTIONS".equals(e.getKey()))
.map(e -> e.getKey() + "=" + e.getValue())
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/StandardVMLauncher.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/StandardVMLauncher.java
index 433f8bf23..ac7ebb3cf 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/StandardVMLauncher.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/StandardVMLauncher.java
@@ -114,7 +114,7 @@ public String[] getCommandLine() {
if (vmVersion != -1) {
if (vmVersion < ClassFileConstants.JDK13) { // FailOverToOldVerifier deprecated from 13
commandLine.addElement("-XX:-FailOverToOldVerifier");
- }
+ }
if (vmVersion >= ClassFileConstants.JDK1_6) {
commandLine.addElement("-Xverify:all");
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java
index b73a84c5e..e664e6268 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java
@@ -383,7 +383,7 @@ public class AbstractCompilerTest extends TestCase {
} else {
complianceString = "unknown";
}
-
+
}
System.err.println("Cannot run "+evaluationTestClass.getName()+" at compliance "+complianceString+"!");
@@ -446,7 +446,7 @@ public class AbstractCompilerTest extends TestCase {
String version = System.getProperty("java.version");
if (version.startsWith("1.8.0_")) {
int build = Integer.parseInt(version.substring("1.8.0_".length()));
- reflectNestedClassUseDollar = build >= 171;
+ reflectNestedClassUseDollar = build >= 171;
} else if (version.startsWith("1.8.0-")) {
// Some versions start with 1.8.0- but don't have build qualifier.
// Just assume they are > 171 build. Nothing much can be done.
@@ -520,7 +520,7 @@ public class AbstractCompilerTest extends TestCase {
if (possibleComplianceLevels == 0) {
System.out.println("Defaulting to all possible compliances");
possibleComplianceLevels = UNINITIALIZED;
- }
+ }
}
if (possibleComplianceLevels == UNINITIALIZED) {
if (!RUN_JAVAC) {
@@ -756,7 +756,7 @@ public class AbstractCompilerTest extends TestCase {
options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_10);
options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_10);
} else {
- // This is already good enough to cover versions from future
+ // This is already good enough to cover versions from future
// (as long as versionFromJdkLevel does its job)
String ver = CompilerOptions.versionFromJdkLevel(this.complianceLevel);
options.put(CompilerOptions.OPTION_Compliance, ver);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/TestVerifier.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/TestVerifier.java
index 2fad177f5..66a7cc52d 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/TestVerifier.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/TestVerifier.java
@@ -151,104 +151,104 @@ public String getExecutionError(){
*/
private String getVerifyTestsCode() {
return
- "/*******************************************************************************\n" +
- " * Copyright (c) 2000, 2017 IBM Corporation and others.\n" +
- " * All rights reserved. This program and the accompanying materials\n" +
- " * are made available under the terms of the Eclipse Public License v1.0\n" +
- " * which accompanies this distribution, and is available at\n" +
- " * http://www.eclipse.org/legal/epl-v10.html\n" +
- " *\n" +
- " * Contributors:\n" +
- " * IBM Corporation - initial API and implementation\n" +
- " *******************************************************************************/\n" +
- "package org.eclipse.jdt.core.tests.util;\n" +
- "\n" +
- "import java.io.DataInputStream;\n" +
- "import java.io.DataOutputStream;\n" +
- "import java.io.File;\n" +
- "import java.io.FileInputStream;\n" +
- "import java.io.FileNotFoundException;\n" +
- "import java.io.IOException;\n" +
- "import java.io.InputStream;\n" +
- "import java.lang.reflect.InvocationTargetException;\n" +
- "import java.lang.reflect.Method;\n" +
- "import java.net.Socket;\n" +
- "import java.util.StringTokenizer;\n" +
- "\n" +
- "/******************************************************\n" +
- " *\n" +
- " * IMPORTANT NOTE: If modifying this class, copy the source to TestVerifier#getVerifyTestsCode()\n" +
- " * (see this method for details)\n" +
- " *\n" +
- " ******************************************************/\n" +
- "\n" +
- "public class VerifyTests {\n" +
- " int portNumber;\n" +
- " Socket socket;\n" +
- "\n" +
- "/**\n" +
- " * NOTE: Code copied from junit.util.TestCaseClassLoader.\n" +
- " *\n" +
- " * A custom class loader which enables the reloading\n" +
- " * of classes for each test run. The class loader\n" +
- " * can be configured with a list of package paths that\n" +
- " * should be excluded from loading. The loading\n" +
- " * of these packages is delegated to the system class\n" +
- " * loader. They will be shared across test runs.\n" +
- " * <p>\n" +
- " * The list of excluded package paths is specified in\n" +
- " * a properties file \"excluded.properties\" that is located in\n" +
- " * the same place as the TestCaseClassLoader class.\n" +
- " * <p>\n" +
- " * <b>Known limitation:</b> the VerifyClassLoader cannot load classes\n" +
- " * from jar files.\n" +
- " */\n" +
- "\n" +
- "\n" +
- "public class VerifyClassLoader extends ClassLoader {\n" +
- " /** scanned class path */\n" +
- " private String[] pathItems;\n" +
- "\n" +
- " /** excluded paths */\n" +
- " private String[] excluded= {};\n" +
- "\n" +
- " /**\n" +
- " * Constructs a VerifyClassLoader. It scans the class path\n" +
- " * and the excluded package paths\n" +
- " */\n" +
- " public VerifyClassLoader() {\n" +
- " super();\n" +
- " String classPath= System.getProperty(\"java.class.path\");\n" +
- " String separator= System.getProperty(\"path.separator\");\n" +
- "\n" +
- " // first pass: count elements\n" +
- " StringTokenizer st= new StringTokenizer(classPath, separator);\n" +
- " int i= 0;\n" +
- " while (st.hasMoreTokens()) {\n" +
- " st.nextToken();\n" +
- " i++;\n" +
- " }\n" +
- " // second pass: split\n" +
- " this.pathItems= new String[i];\n" +
- " st= new StringTokenizer(classPath, separator);\n" +
- " i= 0;\n" +
- " while (st.hasMoreTokens()) {\n" +
- " this.pathItems[i++]= st.nextToken();\n" +
- " }\n" +
- "\n" +
- " }\n" +
- " public java.net.URL getResource(String name) {\n" +
- " return ClassLoader.getSystemResource(name);\n" +
- " }\n" +
- " public InputStream getResourceAsStream(String name) {\n" +
- " return ClassLoader.getSystemResourceAsStream(name);\n" +
- " }\n" +
- " protected boolean isExcluded(String name) {\n" +
- " // exclude the \"java\" packages.\n" +
- " // They always need to be excluded so that they are loaded by the system class loader\n" +
- " if (name.startsWith(\"java\") || name.startsWith(\"[Ljava\"))\n" +
- " return true;\n" +
- "\n" +
+ "/*******************************************************************************\n" +
+ " * Copyright (c) 2000, 2017 IBM Corporation and others.\n" +
+ " * All rights reserved. This program and the accompanying materials\n" +
+ " * are made available under the terms of the Eclipse Public License v1.0\n" +
+ " * which accompanies this distribution, and is available at\n" +
+ " * http://www.eclipse.org/legal/epl-v10.html\n" +
+ " *\n" +
+ " * Contributors:\n" +
+ " * IBM Corporation - initial API and implementation\n" +
+ " *******************************************************************************/\n" +
+ "package org.eclipse.jdt.core.tests.util;\n" +
+ "\n" +
+ "import java.io.DataInputStream;\n" +
+ "import java.io.DataOutputStream;\n" +
+ "import java.io.File;\n" +
+ "import java.io.FileInputStream;\n" +
+ "import java.io.FileNotFoundException;\n" +
+ "import java.io.IOException;\n" +
+ "import java.io.InputStream;\n" +
+ "import java.lang.reflect.InvocationTargetException;\n" +
+ "import java.lang.reflect.Method;\n" +
+ "import java.net.Socket;\n" +
+ "import java.util.StringTokenizer;\n" +
+ "\n" +
+ "/******************************************************\n" +
+ " *\n" +
+ " * IMPORTANT NOTE: If modifying this class, copy the source to TestVerifier#getVerifyTestsCode()\n" +
+ " * (see this method for details)\n" +
+ " *\n" +
+ " ******************************************************/\n" +
+ "\n" +
+ "public class VerifyTests {\n" +
+ " int portNumber;\n" +
+ " Socket socket;\n" +
+ "\n" +
+ "/**\n" +
+ " * NOTE: Code copied from junit.util.TestCaseClassLoader.\n" +
+ " *\n" +
+ " * A custom class loader which enables the reloading\n" +
+ " * of classes for each test run. The class loader\n" +
+ " * can be configured with a list of package paths that\n" +
+ " * should be excluded from loading. The loading\n" +
+ " * of these packages is delegated to the system class\n" +
+ " * loader. They will be shared across test runs.\n" +
+ " * <p>\n" +
+ " * The list of excluded package paths is specified in\n" +
+ " * a properties file \"excluded.properties\" that is located in\n" +
+ " * the same place as the TestCaseClassLoader class.\n" +
+ " * <p>\n" +
+ " * <b>Known limitation:</b> the VerifyClassLoader cannot load classes\n" +
+ " * from jar files.\n" +
+ " */\n" +
+ "\n" +
+ "\n" +
+ "public class VerifyClassLoader extends ClassLoader {\n" +
+ " /** scanned class path */\n" +
+ " private String[] pathItems;\n" +
+ "\n" +
+ " /** excluded paths */\n" +
+ " private String[] excluded= {};\n" +
+ "\n" +
+ " /**\n" +
+ " * Constructs a VerifyClassLoader. It scans the class path\n" +
+ " * and the excluded package paths\n" +
+ " */\n" +
+ " public VerifyClassLoader() {\n" +
+ " super();\n" +
+ " String classPath= System.getProperty(\"java.class.path\");\n" +
+ " String separator= System.getProperty(\"path.separator\");\n" +
+ "\n" +
+ " // first pass: count elements\n" +
+ " StringTokenizer st= new StringTokenizer(classPath, separator);\n" +
+ " int i= 0;\n" +
+ " while (st.hasMoreTokens()) {\n" +
+ " st.nextToken();\n" +
+ " i++;\n" +
+ " }\n" +
+ " // second pass: split\n" +
+ " this.pathItems= new String[i];\n" +
+ " st= new StringTokenizer(classPath, separator);\n" +
+ " i= 0;\n" +
+ " while (st.hasMoreTokens()) {\n" +
+ " this.pathItems[i++]= st.nextToken();\n" +
+ " }\n" +
+ "\n" +
+ " }\n" +
+ " public java.net.URL getResource(String name) {\n" +
+ " return ClassLoader.getSystemResource(name);\n" +
+ " }\n" +
+ " public InputStream getResourceAsStream(String name) {\n" +
+ " return ClassLoader.getSystemResourceAsStream(name);\n" +
+ " }\n" +
+ " protected boolean isExcluded(String name) {\n" +
+ " // exclude the \"java\" packages.\n" +
+ " // They always need to be excluded so that they are loaded by the system class loader\n" +
+ " if (name.startsWith(\"java\") || name.startsWith(\"[Ljava\"))\n" +
+ " return true;\n" +
+ "\n" +
//{ObjectTeams: don't process core OT-classes either (unpacked .class not available on classpath):
" if (name.startsWith(\"org.objectteams\"))\n" +
" return true;\n" +
@@ -263,141 +263,141 @@ private String getVerifyTestsCode() {
" return true;\n" +
" \n" +
// SH}
- " // exclude the user defined package paths\n" +
- " for (int i= 0; i < this.excluded.length; i++) {\n" +
- " if (name.startsWith(this.excluded[i])) {\n" +
- " return true;\n" +
- " }\n" +
- " }\n" +
- " return false;\n" +
- " }\n" +
- " public synchronized Class loadClass(String name, boolean resolve)\n" +
- " throws ClassNotFoundException {\n" +
- "\n" +
- " Class c= findLoadedClass(name);\n" +
- " if (c != null)\n" +
- " return c;\n" +
- " //\n" +
- " // Delegate the loading of excluded classes to the\n" +
- " // standard class loader.\n" +
- " //\n" +
- " if (isExcluded(name)) {\n" +
- " try {\n" +
- " c= findSystemClass(name);\n" +
- " return c;\n" +
- " } catch (ClassNotFoundException e) {\n" +
- " // keep searching\n" +
- " }\n" +
- " }\n" +
- " File file= locate(name);\n" +
- " if (file == null)\n" +
- " throw new ClassNotFoundException();\n" +
- " byte data[]= loadClassData(file);\n" +
- " c= defineClass(name, data, 0, data.length);\n" +
- " if (resolve)\n" +
- " resolveClass(c);\n" +
- " return c;\n" +
- " }\n" +
- " private byte[] loadClassData(File f) throws ClassNotFoundException {\n" +
- " FileInputStream stream = null;\n" +
- " try {\n" +
- " //System.out.println(\"loading: \"+f.getPath());\n" +
- " stream = new FileInputStream(f);\n" +
- "\n" +
- " try {\n" +
- " byte[] b= new byte[stream.available()];\n" +
- " stream.read(b);\n" +
- " return b;\n" +
- " }\n" +
- " catch (IOException e) {\n" +
- " throw new ClassNotFoundException();\n" +
- " }\n" +
- " }\n" +
- " catch (FileNotFoundException e) {\n" +
- " throw new ClassNotFoundException();\n" +
- " } finally {\n" +
- " if (stream != null) {\n" +
- " try {\n" +
- " stream.close();\n" +
- " } catch (IOException e) {\n" +
- " /* ignore */\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " /**\n" +
- " * Locate the given file.\n" +
- " * @return Returns null if file couldn't be found.\n" +
- " */\n" +
- " private File locate(String fileName) {\n" +
- " if (fileName != null) {\n" +
- " fileName= fileName.replace('.', '/')+\".class\";\n" +
- " File path= null;\n" +
- " for (int i= 0; i < this.pathItems.length; i++) {\n" +
- " path= new File(this.pathItems[i], fileName);\n" +
- " if (path.exists())\n" +
- " return path;\n" +
- " }\n" +
- " }\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "public void loadAndRun(String className) throws Throwable {\n" +
- " //System.out.println(\"Loading \" + className + \"...\");\n" +
- " Class testClass = new VerifyClassLoader().loadClass(className);\n" +
- " //System.out.println(\"Loaded \" + className);\n" +
- " try {\n" +
- " Method main = testClass.getMethod(\"main\", new Class[] {String[].class});\n" +
- " //System.out.println(\"Running \" + className);\n" +
- " main.invoke(null, new Object[] {new String[] {}});\n" +
- " //System.out.println(\"Finished running \" + className);\n" +
- " } catch (NoSuchMethodException e) {\n" +
- " return;\n" +
- " } catch (InvocationTargetException e) {\n" +
- " throw e.getTargetException();\n" +
- " }\n" +
- "}\n" +
- "public static void main(String[] args) throws IOException {\n" +
- " VerifyTests verify = new VerifyTests();\n" +
- " verify.portNumber = Integer.parseInt(args[0]);\n" +
- " verify.run();\n" +
- "}\n" +
- "public void run() throws IOException {\n" +
- " this.socket = new Socket(\"localhost\", this.portNumber);\n" +
- " this.socket.setTcpNoDelay(true);\n" +
- "\n" +
- " DataInputStream in = new DataInputStream(this.socket.getInputStream());\n" +
- " final DataOutputStream out = new DataOutputStream(this.socket.getOutputStream());\n" +
- " while (true) {\n" +
- " final String className = in.readUTF();\n" +
- " Thread thread = new Thread() {\n" +
- " public void run() {\n" +
- " try {\n" +
- " loadAndRun(className);\n" +
- " out.writeBoolean(true);\n" +
- " System.err.println(VerifyTests.class.getName());\n" +
- " System.out.println(VerifyTests.class.getName());\n" +
- " } catch (Throwable e) {\n" +
- " e.printStackTrace();\n" +
- " try {\n" +
- " System.err.println(VerifyTests.class.getName());\n" +
- " System.out.println(VerifyTests.class.getName());\n" +
- " out.writeBoolean(false);\n" +
- " } catch (IOException e1) {\n" +
- " e1.printStackTrace();\n" +
- " }\n" +
- " }\n" +
- " try {\n" +
- " out.flush();\n" +
- " } catch (IOException e) {\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
- " };\n" +
- " thread.start();\n" +
- " }\n" +
- "}\n" +
+ " // exclude the user defined package paths\n" +
+ " for (int i= 0; i < this.excluded.length; i++) {\n" +
+ " if (name.startsWith(this.excluded[i])) {\n" +
+ " return true;\n" +
+ " }\n" +
+ " }\n" +
+ " return false;\n" +
+ " }\n" +
+ " public synchronized Class loadClass(String name, boolean resolve)\n" +
+ " throws ClassNotFoundException {\n" +
+ "\n" +
+ " Class c= findLoadedClass(name);\n" +
+ " if (c != null)\n" +
+ " return c;\n" +
+ " //\n" +
+ " // Delegate the loading of excluded classes to the\n" +
+ " // standard class loader.\n" +
+ " //\n" +
+ " if (isExcluded(name)) {\n" +
+ " try {\n" +
+ " c= findSystemClass(name);\n" +
+ " return c;\n" +
+ " } catch (ClassNotFoundException e) {\n" +
+ " // keep searching\n" +
+ " }\n" +
+ " }\n" +
+ " File file= locate(name);\n" +
+ " if (file == null)\n" +
+ " throw new ClassNotFoundException();\n" +
+ " byte data[]= loadClassData(file);\n" +
+ " c= defineClass(name, data, 0, data.length);\n" +
+ " if (resolve)\n" +
+ " resolveClass(c);\n" +
+ " return c;\n" +
+ " }\n" +
+ " private byte[] loadClassData(File f) throws ClassNotFoundException {\n" +
+ " FileInputStream stream = null;\n" +
+ " try {\n" +
+ " //System.out.println(\"loading: \"+f.getPath());\n" +
+ " stream = new FileInputStream(f);\n" +
+ "\n" +
+ " try {\n" +
+ " byte[] b= new byte[stream.available()];\n" +
+ " stream.read(b);\n" +
+ " return b;\n" +
+ " }\n" +
+ " catch (IOException e) {\n" +
+ " throw new ClassNotFoundException();\n" +
+ " }\n" +
+ " }\n" +
+ " catch (FileNotFoundException e) {\n" +
+ " throw new ClassNotFoundException();\n" +
+ " } finally {\n" +
+ " if (stream != null) {\n" +
+ " try {\n" +
+ " stream.close();\n" +
+ " } catch (IOException e) {\n" +
+ " /* ignore */\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " /**\n" +
+ " * Locate the given file.\n" +
+ " * @return Returns null if file couldn't be found.\n" +
+ " */\n" +
+ " private File locate(String fileName) {\n" +
+ " if (fileName != null) {\n" +
+ " fileName= fileName.replace('.', '/')+\".class\";\n" +
+ " File path= null;\n" +
+ " for (int i= 0; i < this.pathItems.length; i++) {\n" +
+ " path= new File(this.pathItems[i], fileName);\n" +
+ " if (path.exists())\n" +
+ " return path;\n" +
+ " }\n" +
+ " }\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "public void loadAndRun(String className) throws Throwable {\n" +
+ " //System.out.println(\"Loading \" + className + \"...\");\n" +
+ " Class testClass = new VerifyClassLoader().loadClass(className);\n" +
+ " //System.out.println(\"Loaded \" + className);\n" +
+ " try {\n" +
+ " Method main = testClass.getMethod(\"main\", new Class[] {String[].class});\n" +
+ " //System.out.println(\"Running \" + className);\n" +
+ " main.invoke(null, new Object[] {new String[] {}});\n" +
+ " //System.out.println(\"Finished running \" + className);\n" +
+ " } catch (NoSuchMethodException e) {\n" +
+ " return;\n" +
+ " } catch (InvocationTargetException e) {\n" +
+ " throw e.getTargetException();\n" +
+ " }\n" +
+ "}\n" +
+ "public static void main(String[] args) throws IOException {\n" +
+ " VerifyTests verify = new VerifyTests();\n" +
+ " verify.portNumber = Integer.parseInt(args[0]);\n" +
+ " verify.run();\n" +
+ "}\n" +
+ "public void run() throws IOException {\n" +
+ " this.socket = new Socket(\"localhost\", this.portNumber);\n" +
+ " this.socket.setTcpNoDelay(true);\n" +
+ "\n" +
+ " DataInputStream in = new DataInputStream(this.socket.getInputStream());\n" +
+ " final DataOutputStream out = new DataOutputStream(this.socket.getOutputStream());\n" +
+ " while (true) {\n" +
+ " final String className = in.readUTF();\n" +
+ " Thread thread = new Thread() {\n" +
+ " public void run() {\n" +
+ " try {\n" +
+ " loadAndRun(className);\n" +
+ " out.writeBoolean(true);\n" +
+ " System.err.println(VerifyTests.class.getName());\n" +
+ " System.out.println(VerifyTests.class.getName());\n" +
+ " } catch (Throwable e) {\n" +
+ " e.printStackTrace();\n" +
+ " try {\n" +
+ " System.err.println(VerifyTests.class.getName());\n" +
+ " System.out.println(VerifyTests.class.getName());\n" +
+ " out.writeBoolean(false);\n" +
+ " } catch (IOException e1) {\n" +
+ " e1.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
+ " try {\n" +
+ " out.flush();\n" +
+ " } catch (IOException e) {\n" +
+ " e.printStackTrace();\n" +
+ " }\n" +
+ " }\n" +
+ " };\n" +
+ " thread.start();\n" +
+ " }\n" +
+ "}\n" +
"}";
}
private void launchAndRun(String className, String[] classpaths, String[] programArguments, String[] vmArguments) {
@@ -550,7 +550,7 @@ private void launchVerifyTestsIfNeeded(String[] classpaths, String[] vmArguments
} catch(TargetException e) {
throw new Error(e.getMessage());
}
-
+
// connect to the vm
this.socket = null;
boolean isVMRunning = false;
@@ -697,7 +697,7 @@ private void waitForFullBuffers() {
}
//{ObjectTeams: helper
public boolean vmArgsEqual(String[] newArgs) {
- if (this.fVMArguments == null || newArgs == null)
+ if (this.fVMArguments == null || newArgs == null)
return this.fVMArguments == null && newArgs == null;
if (this.fVMArguments.length != newArgs.length)
return false;
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java
index c26434e76..afb3f07d5 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java
@@ -179,13 +179,13 @@ public static CompilationUnit[] compilationUnits9(String[] testFiles, String com
{
int fileCount = testFiles.length / 2;
CompilationUnit[] units = new CompilationUnit[fileCount];
-
+
String modName = null;
CompilationUnit modCU = null;
for (int i = 0; i < fileCount; i++) {
String fileName = testFiles[i*2];
boolean isModuleInfo = fileName.endsWith(TypeConstants.MODULE_INFO_FILE_NAME_STRING);
- units[i] = new CompilationUnit(testFiles[i*2+1].toCharArray(), fileName, null, "", false, modName);
+ units[i] = new CompilationUnit(testFiles[i*2+1].toCharArray(), fileName, null, "", false, modName);
if (isModuleInfo) {
IModule mod = extractModuleDesc(testFiles[i*2+1], compliance, errorHandlingPolicy, problemFactory);
if (mod != null) {
@@ -237,7 +237,7 @@ public static void compile(String[] pathsAndContents, Map options, String[] clas
} else {
classpath = classLibs;
}
-
+
FileSystem nameEnvironment = new FileSystem(classpath, new String[] {}, null);
if (CompilerOptions.versionToJdkLevel((String) options.get(CompilerOptions.OPTION_Compliance)) >= ClassFileConstants.JDK9) {
nameEnvironment.scanForModules(createParser9());
@@ -437,7 +437,7 @@ public static void createEmptyJar(String jarPath, String compliance) throws IOEx
},
jarPath,
null,
- compliance);
+ compliance);
}
public static void createJar(String[] pathsAndContents, Map options, String jarPath) throws IOException {
createJar(pathsAndContents, null, options, null, jarPath);
@@ -1460,7 +1460,7 @@ private static void zip(File dir, ZipOutputStream zip, int rootPathLength) throw
}
/**
- * Zips the given files into the given jar. All the files are kept at the root of the zip.
+ * Zips the given files into the given jar. All the files are kept at the root of the zip.
*/
public static void zipFiles(File[] files, String zipPath) throws IOException {
File zipFile = new File(zipPath);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/ZipEntryStorageException.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/ZipEntryStorageException.java
index 16506bf0f..474dbbb2d 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/ZipEntryStorageException.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/ZipEntryStorageException.java
@@ -5,7 +5,7 @@ import java.io.IOException;
public class ZipEntryStorageException extends IOException {
private static final long serialVersionUID = 1L;
-
+
public ZipEntryStorageException(String message) {
super(message);
}

Back to the top